From 84008aa8aeb924d4839e74e61f7abdd8941d7498 Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Mon, 27 May 2024 18:08:11 -0700 Subject: [PATCH 001/308] Glossary: Fix broken link (#1751) --- docs/spec/glossary.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/spec/glossary.rst b/docs/spec/glossary.rst index 39973ab6c..3c8314d74 100644 --- a/docs/spec/glossary.rst +++ b/docs/spec/glossary.rst @@ -52,4 +52,4 @@ This section defines a few terms that may be used elsewhere in the specification form an :term:`annotation expression`. For example, the type qualifier :ref:`Final ` can be used around a type to indicate that the annotated value may not be overridden or modified. This term is also used for other special forms that modify a type, but using a different - syntactic context, such as the `@final ` decorator. + syntactic context, such as the :ref:`@final ` decorator. From a79b87fadb0185d8032211dc81638f4acb5bc122 Mon Sep 17 00:00:00 2001 From: Eric Traut Date: Fri, 31 May 2024 09:02:37 -0700 Subject: [PATCH 002/308] Updated conformance test results for pyright 1.1.365. (#1755) There are no changes to the top-level conformance results, but some of pyright's error messages changed (for improved clarity), and this results in changes to the diffs from previous versions. --- conformance/results/mypy/version.toml | 2 +- conformance/results/pyre/version.toml | 2 +- .../results/pyright/aliases_explicit.toml | 3 +- .../results/pyright/aliases_recursive.toml | 10 +++---- .../pyright/aliases_type_statement.toml | 3 +- .../pyright/aliases_typealiastype.toml | 3 +- .../results/pyright/callables_kwargs.toml | 6 ++-- .../results/pyright/callables_protocol.toml | 10 +++---- .../results/pyright/callables_subtyping.toml | 30 ++++++++++--------- .../pyright/generics_paramspec_semantics.toml | 4 +-- .../pyright/protocols_class_objects.toml | 3 +- .../results/pyright/protocols_definition.toml | 11 +++---- .../results/pyright/qualifiers_annotated.toml | 3 +- .../pyright/qualifiers_final_annotation.toml | 1 + conformance/results/pyright/version.toml | 2 +- conformance/results/pytype/version.toml | 2 +- conformance/results/results.html | 8 ++--- 17 files changed, 56 insertions(+), 47 deletions(-) diff --git a/conformance/results/mypy/version.toml b/conformance/results/mypy/version.toml index 268bd31ac..dc9b55ed5 100644 --- a/conformance/results/mypy/version.toml +++ b/conformance/results/mypy/version.toml @@ -1,2 +1,2 @@ version = "mypy 1.10.0" -test_duration = 1.4 +test_duration = 1.5 diff --git a/conformance/results/pyre/version.toml b/conformance/results/pyre/version.toml index 57ed5696a..737b7ea3a 100644 --- a/conformance/results/pyre/version.toml +++ b/conformance/results/pyre/version.toml @@ -1,2 +1,2 @@ version = "pyre 0.9.21" -test_duration = 3.4 +test_duration = 4.1 diff --git a/conformance/results/pyright/aliases_explicit.toml b/conformance/results/pyright/aliases_explicit.toml index c52150393..e1f0c29b6 100644 --- a/conformance/results/pyright/aliases_explicit.toml +++ b/conformance/results/pyright/aliases_explicit.toml @@ -22,7 +22,8 @@ aliases_explicit.py:82:21 - error: Expected type expression but received "list[t aliases_explicit.py:83:21 - error: Invalid expression form for type alias definition (reportInvalidTypeForm) aliases_explicit.py:83:21 - error: Dictionary expression not allowed in type annotation   Use Dict[T1, T2] to indicate a dictionary type (reportInvalidTypeForm) -aliases_explicit.py:83:21 - error: Expected type expression but received "dict[str, str]" (reportGeneralTypeIssues) +aliases_explicit.py:83:21 - error: Expected type expression but received "dict[str, Unknown]" (reportGeneralTypeIssues) +aliases_explicit.py:83:28 - error: "b" is not defined (reportUndefinedVariable) aliases_explicit.py:84:21 - error: Invalid expression form for type alias definition (reportInvalidTypeForm) aliases_explicit.py:84:21 - error: Call expression not allowed in type expression (reportInvalidTypeForm) aliases_explicit.py:85:21 - error: Invalid expression form for type alias definition (reportInvalidTypeForm) diff --git a/conformance/results/pyright/aliases_recursive.toml b/conformance/results/pyright/aliases_recursive.toml index 47830d168..eafd7b25d 100644 --- a/conformance/results/pyright/aliases_recursive.toml +++ b/conformance/results/pyright/aliases_recursive.toml @@ -18,11 +18,11 @@ aliases_recursive.py:20:16 - error: Expression of type "list[int | complex]" is     "complex" is incompatible with "float"     "complex" is incompatible with "list[Json]"     "complex" is incompatible with "dict[str, Json]" (reportAssignmentType) -aliases_recursive.py:38:22 - error: Expression of type "tuple[Literal[1], tuple[Literal['1'], Literal[1]], tuple[Literal[1], tuple[Literal[1], list[int]]]]" is incompatible with declared type "RecursiveTuple" -  Type "tuple[Literal[1], tuple[Literal['1'], Literal[1]], tuple[Literal[1], tuple[Literal[1], list[int]]]]" is incompatible with type "RecursiveTuple" -    "tuple[Literal[1], tuple[Literal['1'], Literal[1]], tuple[Literal[1], tuple[Literal[1], list[int]]]]" is incompatible with "str" -    "tuple[Literal[1], tuple[Literal['1'], Literal[1]], tuple[Literal[1], tuple[Literal[1], list[int]]]]" is incompatible with "int" -    "tuple[Literal[1], tuple[Literal['1'], Literal[1]], tuple[Literal[1], tuple[Literal[1], list[int]]]]" is incompatible with "tuple[RecursiveTuple, ...]" +aliases_recursive.py:38:22 - error: Expression of type "tuple[Literal[1], tuple[str, int], tuple[int, tuple[int, list[int]]]]" is incompatible with declared type "RecursiveTuple" +  Type "tuple[Literal[1], tuple[str, int], tuple[int, tuple[int, list[int]]]]" is incompatible with type "RecursiveTuple" +    "tuple[Literal[1], tuple[str, int], tuple[int, tuple[int, list[int]]]]" is incompatible with "str" +    "tuple[Literal[1], tuple[str, int], tuple[int, tuple[int, list[int]]]]" is incompatible with "int" +    "tuple[Literal[1], tuple[str, int], tuple[int, tuple[int, list[int]]]]" is incompatible with "tuple[RecursiveTuple, ...]"       Tuple entry 1 is incorrect type (reportAssignmentType) aliases_recursive.py:39:22 - error: Expression of type "tuple[Literal[1], list[int]]" is incompatible with declared type "RecursiveTuple"   Type "tuple[Literal[1], list[int]]" is incompatible with type "RecursiveTuple" diff --git a/conformance/results/pyright/aliases_type_statement.toml b/conformance/results/pyright/aliases_type_statement.toml index 63bd24874..73c0013de 100644 --- a/conformance/results/pyright/aliases_type_statement.toml +++ b/conformance/results/pyright/aliases_type_statement.toml @@ -24,7 +24,8 @@ aliases_type_statement.py:40:22 - error: List expression not allowed in type ann aliases_type_statement.py:40:22 - error: Expected type expression but received "list[type[int]]" (reportGeneralTypeIssues) aliases_type_statement.py:41:22 - error: Dictionary expression not allowed in type annotation   Use Dict[T1, T2] to indicate a dictionary type (reportInvalidTypeForm) -aliases_type_statement.py:41:22 - error: Expected type expression but received "dict[str, str]" (reportGeneralTypeIssues) +aliases_type_statement.py:41:22 - error: Expected type expression but received "dict[str, Unknown]" (reportGeneralTypeIssues) +aliases_type_statement.py:41:29 - error: "b" is not defined (reportUndefinedVariable) aliases_type_statement.py:42:22 - error: Call expression not allowed in type expression (reportInvalidTypeForm) aliases_type_statement.py:43:22 - error: List expression not allowed in type annotation   Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) diff --git a/conformance/results/pyright/aliases_typealiastype.toml b/conformance/results/pyright/aliases_typealiastype.toml index 48ebb2a23..967f4ae61 100644 --- a/conformance/results/pyright/aliases_typealiastype.toml +++ b/conformance/results/pyright/aliases_typealiastype.toml @@ -15,7 +15,8 @@ aliases_typealiastype.py:52:40 - error: Call expression not allowed in type expr aliases_typealiastype.py:53:40 - error: Expected type expression but received "list[Unknown]" (reportGeneralTypeIssues) aliases_typealiastype.py:54:42 - error: Expected type expression but received "tuple[tuple[type[int], type[str]]]" (reportGeneralTypeIssues) aliases_typealiastype.py:55:42 - error: Expected type expression but received "list[type[int]]" (reportGeneralTypeIssues) -aliases_typealiastype.py:56:42 - error: Expected type expression but received "dict[str, str]" (reportGeneralTypeIssues) +aliases_typealiastype.py:56:42 - error: Expected type expression but received "dict[str, Unknown]" (reportGeneralTypeIssues) +aliases_typealiastype.py:56:49 - error: "b" is not defined (reportUndefinedVariable) aliases_typealiastype.py:57:42 - error: Call expression not allowed in type expression (reportInvalidTypeForm) aliases_typealiastype.py:58:42 - error: List expression not allowed in type annotation   Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) diff --git a/conformance/results/pyright/callables_kwargs.toml b/conformance/results/pyright/callables_kwargs.toml index c82031c93..51ad276db 100644 --- a/conformance/results/pyright/callables_kwargs.toml +++ b/conformance/results/pyright/callables_kwargs.toml @@ -19,12 +19,12 @@ callables_kwargs.py:101:19 - error: Expression of type "(**kwargs: **TD2) -> Non       "int" is incompatible with "str" (reportAssignmentType) callables_kwargs.py:102:19 - error: Expression of type "(**kwargs: **TD2) -> None" is incompatible with declared type "TDProtocol4"   Type "(**kwargs: **TD2) -> None" is incompatible with type "(*, v1: int) -> None" -    Keyword parameter "v3" is missing in destination (reportAssignmentType) +    Extra parameter "v3" (reportAssignmentType) callables_kwargs.py:103:19 - error: Expression of type "(**kwargs: **TD2) -> None" is incompatible with declared type "TDProtocol5"   Type "(**kwargs: **TD2) -> None" is incompatible with type "(v1: int, v3: str) -> None"     Function accepts too many positional parameters; expected 0 but received 2 -      Keyword parameter "v1" is missing in destination -      Keyword parameter "v3" is missing in destination (reportAssignmentType) +      Extra parameter "v1" +      Extra parameter "v3" (reportAssignmentType) callables_kwargs.py:111:30 - error: Typed dictionary overlaps with keyword parameter: v1 (reportGeneralTypeIssues) callables_kwargs.py:122:21 - error: Expected TypedDict type argument for Unpack (reportGeneralTypeIssues) """ diff --git a/conformance/results/pyright/callables_protocol.toml b/conformance/results/pyright/callables_protocol.toml index 957091858..df57b9b31 100644 --- a/conformance/results/pyright/callables_protocol.toml +++ b/conformance/results/pyright/callables_protocol.toml @@ -2,11 +2,11 @@ conformant = "Pass" output = """ callables_protocol.py:35:7 - error: Expression of type "(*vals: bytes, max_items: int | None) -> list[bytes]" is incompatible with declared type "Proto1"   Type "(*vals: bytes, max_items: int | None) -> list[bytes]" is incompatible with type "(*vals: bytes, max_len: int | None = None) -> list[bytes]" -    Keyword parameter "max_items" is missing in destination -    Keyword parameter "max_len" is missing in source (reportAssignmentType) +    Extra parameter "max_items" +    Missing keyword parameter "max_len" (reportAssignmentType) callables_protocol.py:36:7 - error: Expression of type "(*vals: bytes) -> list[bytes]" is incompatible with declared type "Proto1"   Type "(*vals: bytes) -> list[bytes]" is incompatible with type "(*vals: bytes, max_len: int | None = None) -> list[bytes]" -    Keyword parameter "max_len" is missing in source (reportAssignmentType) +    Missing keyword parameter "max_len" (reportAssignmentType) callables_protocol.py:37:7 - error: Expression of type "(*vals: bytes, max_len: str | None) -> list[bytes]" is incompatible with declared type "Proto1"   Type "(*vals: bytes, max_len: str | None) -> list[bytes]" is incompatible with type "(*vals: bytes, max_len: int | None = None) -> list[bytes]"     Keyword parameter "max_len" of type "int | None" is incompatible with type "str | None" @@ -46,12 +46,12 @@ callables_protocol.py:197:16 - error: Cannot access attribute "other_attribute2"   Attribute "other_attribute2" is unknown (reportAttributeAccessIssue) callables_protocol.py:238:8 - error: Expression of type "(x: int, y: str, /) -> Any" is incompatible with declared type "Proto11"   Type "(x: int, y: str, /) -> Any" is incompatible with type "(x: int, /, y: str) -> Any" -    Keyword parameter "y" is missing in source +    Missing keyword parameter "y"       Position-only parameter mismatch; parameter "y" is not position-only       Position-only parameter mismatch; expected 2 but received 1 (reportAssignmentType) callables_protocol.py:260:8 - error: Expression of type "(*args: Any, kwarg0: Any) -> None" is incompatible with declared type "Proto12"   Type "(*args: Any, kwarg0: Any) -> None" is incompatible with type "(*args: Any, kwarg0: Any, kwarg1: Any) -> None" -    Keyword parameter "kwarg1" is missing in source (reportAssignmentType) +    Missing keyword parameter "kwarg1" (reportAssignmentType) callables_protocol.py:284:27 - error: Expression of type "(path: str) -> str" is incompatible with declared type "Proto13_Default"   Type "(path: str) -> str" is incompatible with type "(path: str = ...) -> str"     Parameter "path" is missing default argument (reportAssignmentType) diff --git a/conformance/results/pyright/callables_subtyping.toml b/conformance/results/pyright/callables_subtyping.toml index 3a852269a..932c0799b 100644 --- a/conformance/results/pyright/callables_subtyping.toml +++ b/conformance/results/pyright/callables_subtyping.toml @@ -14,8 +14,8 @@ callables_subtyping.py:51:21 - error: Expression of type "PosOnly2" is incompati   "PosOnly2" is incompatible with protocol "Standard2"     "__call__" is an incompatible type       Type "(b: int, a: int, /) -> None" is incompatible with type "(a: int, b: int) -> None" -        Keyword parameter "a" is missing in source -        Keyword parameter "b" is missing in source +        Missing keyword parameter "a" +        Missing keyword parameter "b"           Position-only parameter mismatch; parameter "a" is not position-only           Position-only parameter mismatch; parameter "b" is not position-only           Position-only parameter mismatch; expected 2 but received 0 (reportAssignmentType) @@ -24,22 +24,23 @@ callables_subtyping.py:52:21 - error: Expression of type "KwOnly2" is incompatib     "__call__" is an incompatible type       Type "(*, b: int, a: int) -> None" is incompatible with type "(a: int, b: int) -> None"         Function accepts too many positional parameters; expected 0 but received 2 -          Keyword parameter "b" is missing in destination -          Keyword parameter "a" is missing in destination (reportAssignmentType) +          Extra parameter "b" +          Extra parameter "a" (reportAssignmentType) callables_subtyping.py:55:20 - error: Expression of type "KwOnly2" is incompatible with declared type "PosOnly2"   "KwOnly2" is incompatible with protocol "PosOnly2"     "__call__" is an incompatible type       Type "(*, b: int, a: int) -> None" is incompatible with type "(b: int, a: int, /) -> None"         Function accepts too many positional parameters; expected 0 but received 2 -          Keyword parameter "b" is missing in destination -          Keyword parameter "a" is missing in destination (reportAssignmentType) +          Extra parameter "b" +          Extra parameter "a" (reportAssignmentType) callables_subtyping.py:58:19 - error: Expression of type "PosOnly2" is incompatible with declared type "KwOnly2"   "PosOnly2" is incompatible with protocol "KwOnly2"     "__call__" is an incompatible type       Type "(b: int, a: int, /) -> None" is incompatible with type "(*, b: int, a: int) -> None"         Position-only parameter mismatch; expected 2 but received 0 -        Keyword parameter "b" is missing in source -        Keyword parameter "a" is missing in source (reportAssignmentType) +        Function accepts too few positional parameters; expected 2 but received 0 +        Missing keyword parameter "b" +        Missing keyword parameter "a" (reportAssignmentType) callables_subtyping.py:82:20 - error: Expression of type "NoArgs3" is incompatible with declared type "IntArgs3"   "NoArgs3" is incompatible with protocol "IntArgs3"     "__call__" is an incompatible type @@ -96,14 +97,14 @@ callables_subtyping.py:125:22 - error: Expression of type "IntStrArgs4" is incom   "IntStrArgs4" is incompatible with protocol "Standard4"     "__call__" is an incompatible type       Type "(*args: int | str) -> None" is incompatible with type "(a: int, b: str) -> None" -        Keyword parameter "a" is missing in source -        Keyword parameter "b" is missing in source (reportAssignmentType) +        Missing keyword parameter "a" +        Missing keyword parameter "b" (reportAssignmentType) callables_subtyping.py:126:22 - error: Expression of type "StrArgs4" is incompatible with declared type "Standard4"   "StrArgs4" is incompatible with protocol "Standard4"     "__call__" is an incompatible type       Type "(a: int, /, *args: str) -> None" is incompatible with type "(a: int, b: str) -> None" -        Keyword parameter "a" is missing in source -        Keyword parameter "b" is missing in source +        Missing keyword parameter "a" +        Missing keyword parameter "b"           Position-only parameter mismatch; parameter "a" is not position-only           Position-only parameter mismatch; expected 1 but received 0 (reportAssignmentType) callables_subtyping.py:151:22 - error: Expression of type "NoKwargs5" is incompatible with declared type "IntKwargs5" @@ -164,7 +165,7 @@ callables_subtyping.py:197:22 - error: Expression of type "StrKwargs6" is incomp     "__call__" is an incompatible type       Type "(*, a: int, **kwargs: str) -> None" is incompatible with type "(a: int, b: str) -> None"         Function accepts too many positional parameters; expected 0 but received 2 -          Keyword parameter "a" is missing in destination (reportAssignmentType) +          Extra parameter "a" (reportAssignmentType) callables_subtyping.py:236:23 - error: Expression of type "NoDefaultArg8" is incompatible with declared type "DefaultArg8"   "NoDefaultArg8" is incompatible with protocol "DefaultArg8"     "__call__" is an incompatible type @@ -183,7 +184,8 @@ callables_subtyping.py:240:25 - error: Expression of type "NoX8" is incompatible callables_subtyping.py:243:16 - error: Expression of type "NoDefaultArg8" is incompatible with declared type "NoX8"   "NoDefaultArg8" is incompatible with protocol "NoX8"     "__call__" is an incompatible type -      Type "(x: int) -> None" is incompatible with type "() -> None" (reportAssignmentType) +      Type "(x: int) -> None" is incompatible with type "() -> None" +        Extra parameter "x" (reportAssignmentType) callables_subtyping.py:273:21 - error: Expression of type "Overloaded9" is incompatible with declared type "FloatArg9"   "Overloaded9" is incompatible with protocol "FloatArg9"     "__call__" is an incompatible type diff --git a/conformance/results/pyright/generics_paramspec_semantics.toml b/conformance/results/pyright/generics_paramspec_semantics.toml index 3a3e0bcd0..7573ed90b 100644 --- a/conformance/results/pyright/generics_paramspec_semantics.toml +++ b/conformance/results/pyright/generics_paramspec_semantics.toml @@ -12,8 +12,8 @@ generics_paramspec_semantics.py:46:17 - error: Argument of type "(y: int, x: str     Parameter name mismatch: "y" versus "x" (reportArgumentType) generics_paramspec_semantics.py:61:23 - error: Argument of type "(*, y: int) -> int" cannot be assigned to parameter "y" of type "(**P@func1) -> int" in function "func1"   Type "(*, y: int) -> int" is incompatible with type "(*, x: int) -> int" -    Keyword parameter "y" is missing in destination -    Keyword parameter "x" is missing in source (reportArgumentType) +    Extra parameter "y" +    Missing keyword parameter "x" (reportArgumentType) generics_paramspec_semantics.py:97:4 - error: Argument of type "Literal[1]" cannot be assigned to parameter of type "str"   "Literal[1]" is incompatible with "str" (reportArgumentType) generics_paramspec_semantics.py:107:4 - error: Argument of type "Literal[1]" cannot be assigned to parameter "args" of type "bool" diff --git a/conformance/results/pyright/protocols_class_objects.toml b/conformance/results/pyright/protocols_class_objects.toml index 8841024c2..f24e98e4e 100644 --- a/conformance/results/pyright/protocols_class_objects.toml +++ b/conformance/results/pyright/protocols_class_objects.toml @@ -11,7 +11,8 @@ protocols_class_objects.py:58:16 - error: Expression of type "type[ConcreteA]" i     Type "(self: ConcreteA, x: int) -> int" is incompatible with type "(x: int) -> int"       Parameter name mismatch: "x" versus "self"       Parameter 1: type "int" is incompatible with type "ConcreteA" -        "int" is incompatible with "ConcreteA" (reportAssignmentType) +        "int" is incompatible with "ConcreteA" +      Extra parameter "x" (reportAssignmentType) protocols_class_objects.py:74:16 - error: Expression of type "type[ConcreteB]" is incompatible with declared type "ProtoB1"   "prop1" is an incompatible type     "property" is incompatible with "int" (reportAssignmentType) diff --git a/conformance/results/pyright/protocols_definition.toml b/conformance/results/pyright/protocols_definition.toml index 60efcd1ef..bfc48c1f4 100644 --- a/conformance/results/pyright/protocols_definition.toml +++ b/conformance/results/pyright/protocols_definition.toml @@ -66,14 +66,14 @@ protocols_definition.py:287:22 - error: Expression of type "Concrete5_Bad3" is i     "method1" is an incompatible type       Type "(*, a: int, b: int) -> float" is incompatible with type "(a: int, b: int) -> float"         Function accepts too many positional parameters; expected 0 but received 2 -          Keyword parameter "a" is missing in destination -          Keyword parameter "b" is missing in destination (reportAssignmentType) +          Extra parameter "a" +          Extra parameter "b" (reportAssignmentType) protocols_definition.py:288:22 - error: Expression of type "Concrete5_Bad4" is incompatible with declared type "Template5"   "Concrete5_Bad4" is incompatible with protocol "Template5"     "method1" is an incompatible type       Type "(a: int, b: int, /) -> float" is incompatible with type "(a: int, b: int) -> float" -        Keyword parameter "a" is missing in source -        Keyword parameter "b" is missing in source +        Missing keyword parameter "a" +        Missing keyword parameter "b"           Position-only parameter mismatch; parameter "a" is not position-only           Position-only parameter mismatch; parameter "b" is not position-only           Position-only parameter mismatch; expected 2 but received 0 (reportAssignmentType) @@ -82,7 +82,8 @@ protocols_definition.py:289:22 - error: Expression of type "Concrete5_Bad5" is i     "method1" is an incompatible type       Type "(self: Unknown, a: int, b: int) -> float" is incompatible with type "(a: int, b: int) -> float"         Parameter name mismatch: "a" versus "self" -        Parameter name mismatch: "b" versus "a" (reportAssignmentType) +        Parameter name mismatch: "b" versus "a" +        Extra parameter "b" (reportAssignmentType) protocols_definition.py:339:22 - error: Expression of type "Concrete6_Bad1" is incompatible with declared type "Template6"   "Concrete6_Bad1" is incompatible with protocol "Template6"     "val1" is an incompatible type diff --git a/conformance/results/pyright/qualifiers_annotated.toml b/conformance/results/pyright/qualifiers_annotated.toml index 1722f6650..a7e82db02 100644 --- a/conformance/results/pyright/qualifiers_annotated.toml +++ b/conformance/results/pyright/qualifiers_annotated.toml @@ -4,8 +4,9 @@ qualifiers_annotated.py:43:17 - error: List expression not allowed for this type qualifiers_annotated.py:44:17 - error: Expected type expression but received "tuple[tuple[type[int], type[str]]]" (reportGeneralTypeIssues) qualifiers_annotated.py:45:17 - error: List expression not allowed for this type argument qualifiers_annotated.py:45:18 - error: Expected type expression but received "Generator[type[int], None, None]" (reportGeneralTypeIssues) -qualifiers_annotated.py:46:17 - error: Expected type expression but received "dict[str, str]" (reportGeneralTypeIssues) +qualifiers_annotated.py:46:17 - error: Expected type expression but received "dict[str, Unknown]" (reportGeneralTypeIssues) qualifiers_annotated.py:46:17 - error: Dictionary expression not allowed in type annotation +qualifiers_annotated.py:46:24 - error: "b" is not defined (reportUndefinedVariable) qualifiers_annotated.py:47:17 - error: Call expression not allowed in type expression (reportInvalidTypeForm) qualifiers_annotated.py:48:17 - error: List expression not allowed in type annotation   Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) diff --git a/conformance/results/pyright/qualifiers_final_annotation.toml b/conformance/results/pyright/qualifiers_final_annotation.toml index 73d3648cc..d8ddd04bd 100644 --- a/conformance/results/pyright/qualifiers_final_annotation.toml +++ b/conformance/results/pyright/qualifiers_final_annotation.toml @@ -6,6 +6,7 @@ qualifiers_final_annotation.py:34:5 - error: "ID2" is declared Final, but value qualifiers_final_annotation.py:38:5 - error: "ID3" is declared Final, but value is not assigned (reportGeneralTypeIssues) qualifiers_final_annotation.py:54:14 - error: Cannot assign to attribute "ID5" for class "ClassA*"   Attribute "ID5" cannot be assigned through a class instance because it is a ClassVar +  "ID5" is declared as Final and cannot be reassigned     Attribute "__set__" is unknown (reportAttributeAccessIssue) qualifiers_final_annotation.py:62:19 - error: "Final" is not allowed in this context qualifiers_final_annotation.py:63:19 - error: "Final" is not allowed in this context diff --git a/conformance/results/pyright/version.toml b/conformance/results/pyright/version.toml index 6302edbf3..99853f7f6 100644 --- a/conformance/results/pyright/version.toml +++ b/conformance/results/pyright/version.toml @@ -1,2 +1,2 @@ -version = "pyright 1.1.364" +version = "pyright 1.1.365" test_duration = 1.4 diff --git a/conformance/results/pytype/version.toml b/conformance/results/pytype/version.toml index 68b8ac608..3d4735eb9 100644 --- a/conformance/results/pytype/version.toml +++ b/conformance/results/pytype/version.toml @@ -1,2 +1,2 @@ version = "pytype 2024.04.11" -test_duration = 30.1 +test_duration = 29.7 diff --git a/conformance/results/results.html b/conformance/results/results.html index 9693b2e83..268c79091 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -159,16 +159,16 @@

Python Type System Conformance Test Results

-
 
mypy 1.10.0
-
1.4sec
+
1.5sec
pyright 1.1.364
+
pyright 1.1.365
1.4sec
pyre 0.9.21
-
3.4sec
+
4.1sec
pytype 2024.04.11
-
30.1sec
+
29.7sec
From d442dcb003cec5b5f1e4f89937c9b1de87cb99a1 Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Sun, 2 Jun 2024 17:59:06 +0100 Subject: [PATCH 003/308] List pip as an explicit dependency for the conformance tests (#1757) I created a virtual environment using `uv`, which meant that `pip` wasn't automatically installed into my environment, causing all tests to be skipped due to things like this: https://github.com/python/typing/blob/a79b87fadb0185d8032211dc81638f4acb5bc122/conformance/src/type_checker.py#L76-L84 --- conformance/requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/conformance/requirements.txt b/conformance/requirements.txt index 179cd8de6..396b5100d 100644 --- a/conformance/requirements.txt +++ b/conformance/requirements.txt @@ -3,5 +3,6 @@ tomlkit tqdm pyright mypy +pip pyre-check pytype; platform_system != "Windows" From 459e610627b308de32194831b0a1cfdcd2978b02 Mon Sep 17 00:00:00 2001 From: Eric Traut Date: Sun, 2 Jun 2024 22:55:48 -0700 Subject: [PATCH 004/308] Added draft chapter to typing spec for enumerations. (#1759) This is the same set of changes as PR #1591. The CI script that enforces CLA signing was confused, so it didn't permit merging the original PR. --- docs/spec/enums.rst | 363 ++++++++++++++++++++++++++++++++++++++++++++ docs/spec/index.rst | 1 + 2 files changed, 364 insertions(+) create mode 100644 docs/spec/enums.rst diff --git a/docs/spec/enums.rst b/docs/spec/enums.rst new file mode 100644 index 000000000..b9759e545 --- /dev/null +++ b/docs/spec/enums.rst @@ -0,0 +1,363 @@ +Enumerations +============ + +The ``enum.Enum`` class behaves differently from other Python classes in several +ways that require special-case handling in type checkers. This section discusses +the Enum behaviors that should be supported by type checkers and others which +may be supported optionally. It is recommended that library and type stub +authors avoid using optional behaviors because these may not be supported +by some type checkers. + + +Enum Definition +--------------- + +Enum classes can be defined using a "class syntax" or a "function syntax". +The function syntax offers several ways to specify enum members: names passed +as individual arguments, a list or tuple of names, a string of +comma-delimited or space-delimited names, a list or tuple of tuples that contain +name/value pairs, and a dictionary of name/value items. + +Type checkers should support the class syntax, but the function syntax (in +its various forms) is optional:: + + class Color1(Enum): # Supported + RED = 1 + GREEN = 2 + BLUE = 3 + + Color2 = Enum('Color2', 'RED', 'GREEN', 'BLUE') # Optional + Color3 = Enum('Color3', ['RED', 'GREEN', 'BLUE']) # Optional + Color4 = Enum('Color4', ('RED', 'GREEN', 'BLUE')) # Optional + Color5 = Enum('Color5', 'RED, GREEN, BLUE') # Optional + Color6 = Enum('Color6', 'RED GREEN BLUE') # Optional + Color7 = Enum('Color7', [('RED': 1), ('GREEN': 2), ('BLUE': 3)]) # Optional + Color8 = Enum('Color8', (('RED': 1), ('GREEN': 2), ('BLUE': 3))) # Optional + Color9 = Enum('Color9', {'RED': 1, 'GREEN': 2, 'BLUE': 3}) # Optional + +Enum classes can also be defined using a subclass of ``enum.Enum`` or any class +that uses ``enum.EnumType`` (or a subclass thereof) as a metaclass. Note that +``enum.EnumType`` was named ``enum.EnumMeta`` prior to Python 3.11. Type +checkers should treat such classes as enums:: + + class CustomEnum1(Enum): + pass + + class Color7(CustomEnum1): # Supported + RED = 1 + GREEN = 2 + BLUE = 3 + + class CustomEnumType(EnumType): + pass + + class CustomEnum2(metaclass=CustomEnumType): + pass + + class Color8(CustomEnum2): # Supported + RED = 1 + GREEN = 2 + BLUE = 3 + + +Enum Behaviors +-------------- + +Enum classes are iterable and indexable, and they can be called with a value +to look up the enum member with that value. Type checkers should support these +behaviors:: + + class Color(Enum): + RED = 1 + GREEN = 2 + BLUE = 3 + + for color in Color: + reveal_type(color) # Revealed type is 'Color' + + reveal_type(Color["RED"]) # Revealed type is 'Literal[Color.RED]' (or 'Color') + reveal_type(Color(3)) # Revealed type is 'Literal[Color.BLUE]' (or 'Color') + +Unlike most Python classes, Calling an enum class does not invoke its constructor. +Instead, the call performs a value-based lookup of an enum member. + +An Enum class with one or more defined members cannot be subclassed. They are +implicitly "final". Type checkers should enforce this:: + + class EnumWithNoMembers(Enum): + pass + + class Shape(EnumWithNoMembers): # OK (because no members are defined) + SQUARE = 1 + CIRCLE = 2 + + class ExtendedShape(Shape): # Type checker error: Shape is implicitly final + TRIANGLE = 3 + + +Defining Members +---------------- + +When using the "class syntax", enum classes can define both members and +other (non-member) attributes. The ``EnumType`` metaclass applies a set +of rules to distinguish between members and non-members. Type checkers +should honor the most common of these rules. The lesser-used rules are +optional. Some of these rules may be impossible to evaluate and enforce +statically in cases where dynamic values are used. + +* If an attribute is defined in the class body with a type annotation but + with no assigned value, a type checker should assume this is a non-member + attribute:: + + class Pet(Enum): + genus: str # Non-member attribute + species: str # Non-member attribute + + CAT = 1 # Member attribute + DOG = 2 # Member attribute + + Within a type stub, members can be defined using the actual runtime values, + or a placeholder of ``...`` can be used:: + + class Pet(Enum): + genus: str # Non-member attribute + species: str # Non-member attribute + + CAT = ... # Member attribute + DOG = ... # Member attribute + +* Members defined within an enum class should not include explicit type + annotations. Type checkers should infer a literal type for all members. + A type checker should report an error if a type annotation is used + for an enum member because this type will be incorrect and misleading + to readers of the code:: + + class Pet(Enum): + CAT = 1 # OK + DOG: int = 2 # Type checker error + +* Methods, callables, descriptors (including properties), and nested classes + that are defined in the class are not treated as enum members by the + ``EnumType`` metaclass and should likewise not be treated as enum members by + a type checker:: + + def identity(x): return x + + class Pet(Enum): + CAT = 1 # Member attribute + DOG = 2 # Member attribute + + converter = lambda x: str(x) # Non-member attribute + transform = identity # Non-member attribute + + @property + def species(self) -> str: # Non-member property + return "mammal" + + def speak(self) -> None: # Non-member method + print("meow" if self is Pet.CAT else "woof") + + class Nested: ... # Non-member nested class + +* An attribute that is assigned the value of another member of the same enum + is not a member itself. Instead, it is an alias for the first member:: + + class TrafficLight(Enum): + RED = 1 + GREEN = 2 + YELLOW = 3 + + AMBER = YELLOW # Alias for YELLOW + + reveal_type(TrafficLight.AMBER) # Revealed type is Literal[TrafficLight.YELLOW] + +* If using Python 3.11 or newer, the ``enum.member`` and ``enum.nonmember`` + classes can be used to unambiguously distinguish members from non-members. + Type checkers should support these classes:: + + class Example(Enum): + a = member(1) # Member attribute + b = nonmember(2) # Non-member attribute + + @member + def c(self) -> None: # Member method + pass + + reveal_type(Example.a) # Revealed type is Literal[Example.a] + reveal_type(Example.b) # Revealed type is int or Literal[2] + reveal_type(Example.c) # Revealed type is Literal[Example.c] + +* An attribute with a private name (beginning with, but not ending in, a double + underscore) is treated as a non-member. + + class Example(Enum): + A = 1 # Member attribute + __B = 2 # Non-member attribute + + reveal_type(Example.A) # Revealed type is Literal[Example.A] + reveal_type(Example.__B) # Type Error: Private name is mangled + +* An enum class can define a class symbol named ``_ignore_``. This can be a list + of names or a string containing a space-delimited list of names that are + deleted from the enum class at runtime. Type checkers may support this + mechanism:: + + class Pet(Enum): + _ignore_ = "DOG FISH" + CAT = 1 # Member attribute + DOG = 2 # temporary variable, will be removed from the final enum class + FISH = 3 # temporary variable, will be removed from the final enum class + + +Member Names +------------ + +All enum member objects have an attribute ``_name_`` that contains the member's +name. They also have a property ``name`` that returns the same name. Type +checkers may infer a literal type for the name of a member:: + + class Color(Enum): + RED = 1 + GREEN = 2 + BLUE = 3 + + reveal_type(Color.RED._name_) # Revealed type is Literal["RED"] (or str) + reveal_type(Color.RED.name) # Revealed type is Literal["RED"] (or str) + + def func1(red_or_blue: Literal[Color.RED, Color.BLUE]): + reveal_type(red_or_blue.name) # Revealed type is Literal["RED", "BLUE"] (or str) + + def func2(any_color: Color): + reveal_type(any_color.name) # Revealed type is Literal["RED", "BLUE", "GREEN"] (or str) + + +Member Values +------------- + +All enum member objects have an attribute ``_value_`` that contains the member's +value. They also have a property ``value`` that returns the same value. Type +checkers may infer the type of a member's value:: + + class Color(Enum): + RED = 1 + GREEN = 2 + BLUE = 3 + + reveal_type(Color.RED._value_) # Revealed type is Literal[1] (or int or object or Any) + reveal_type(Color.RED.value) # Revealed type is Literal[1] (or int or object or Any) + + def func1(red_or_blue: Literal[Color.RED, Color.BLUE]): + reveal_type(red_or_blue.value) # Revealed type is Literal[1, 2] (or int or object or Any) + + def func2(any_color: Color): + reveal_type(any_color.value) # Revealed type is Literal[1, 2, 3] (or int or object or Any) + + +The value of ``_value_`` can be assigned in a constructor method. This technique +is sometimes used to initialize both the member value and non-member attributes. +If the value assigned in the class body is a tuple, the unpacked tuple value is +passed to the constructor. Type checkers may validate consistency between assigned +tuple values and the constructor signature:: + + class Planet(Enum): + def __init__(self, value: int, mass: float, radius: float): + self._value_ = value + self.mass = mass + self.radius = radius + + MERCURY = (1, 3.303e+23, 2.4397e6) + VENUS = (2, 4.869e+24, 6.0518e6) + EARTH = (3, 5.976e+24, 6.37814e6) + MARS = (6.421e+23, 3.3972e6) # Type checker error (optional) + JUPITER = 5 # Type checker error (optional) + + reveal_type(Planet.MERCURY.value) # Revealed type is Literal[1] (or int or object or Any) + + +The class ``enum.auto`` and method ``_generate_next_value_`` can be used within +an enum class to automatically generate values for enum members. Type checkers +may support these to infer literal types for member values:: + + class Color(Enum): + RED = auto() + GREEN = auto() + BLUE = auto() + + reveal_type(Color.RED.value) # Revealed type is Literal[1] (or int or object or Any) + + +If an enum class provides an explicit type annotation for ``_value_``, type +checkers should enforce this declared type when values are assigned to +``_value_``:: + + class Color(Enum): + _value_: int + RED = 1 # OK + GREEN = "green" # Type error + + class Planet(Enum): + _value_: str + + def __init__(self, value: int, mass: float, radius: float): + self._value_ = value # Type error + + MERCURY = (1, 3.303e+23, 2.4397e6) + +If the literal values for enum members are not supplied, as they sometimes +are not within a type stub file, a type checker can use the type of the +``_value_`` attribute:: + + class ColumnType(Enum): + _value_: int + DORIC = ... + IONIC = ... + CORINTHIAN = ... + + reveal_type(ColumnType.DORIC.value) # Revealed type is int (or object or Any) + + +Enum Literal Expansion +---------------------- + +From the perspective of the type system, most enum classes are equivalent +to the union of the literal members within that enum. (This rule +does not apply to classes that derive from ``enum.Flag`` because these enums +allow flags to be combined in arbitrary ways.) Because of the equivalency +between an enum class and the union of literal members within that enum, the +two types may be used interchangeably. Type checkers may therefore expand +an enum type (that does not derive from ``enum.Flag``) into a union of +literal values during type narrowing and exhaustion detection:: + + class Color(Enum): + RED = 1 + GREEN = 2 + BLUE = 3 + + def print_color1(c: Color): + if c is Color.RED or c is Color.BLUE: + print("red or blue") + else: + reveal_type(c) # Revealed type is Literal[Color.GREEN] + + def print_color2(c: Color): + match c: + case Color.RED | Color.BLUE: + print("red or blue") + case Color.GREEN: + print("green") + case _: + reveal_type(c) # Revealed type is Never + + +Likewise, a type checker should treat a complete union of all literal members +as compatible with the enum type:: + + class Answer(Enum): + Yes = 1 + No = 2 + + def func(val: object) -> Answer: + if val is not Answer.Yes and val is not Answer.No: + raise ValueError("Invalid value") + reveal_type(val) # Revealed type is Answer (or Literal[Answer.Yes, Answer.No]) + return val # OK diff --git a/docs/spec/index.rst b/docs/spec/index.rst index 6e5e5c00b..30210227e 100644 --- a/docs/spec/index.rst +++ b/docs/spec/index.rst @@ -24,6 +24,7 @@ Specification for the Python type system typeddict tuples namedtuples + enums narrowing directives distributing From 0a47e5653be266b49c7882188359f36457e5240b Mon Sep 17 00:00:00 2001 From: Thanos <111999343+Sachaa-Thanasius@users.noreply.github.com> Date: Mon, 3 Jun 2024 14:32:41 -0400 Subject: [PATCH 005/308] Typo fix: Replace `TypeVar` with `TypeVarTuple` in a docs example (#1760) Replace `TypeVar` with `TypeVarTuple` in two spots. --- docs/spec/generics.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/spec/generics.rst b/docs/spec/generics.rst index 53d8626f6..e565e21e6 100644 --- a/docs/spec/generics.rst +++ b/docs/spec/generics.rst @@ -1574,8 +1574,8 @@ First, type arguments to generic aliases can be variadic. For example, a :: - Ts1 = TypeVar('Ts1') - Ts2 = TypeVar('Ts2') + Ts1 = TypeVarTuple('Ts1') + Ts2 = TypeVarTuple('Ts2') IntTuple = tuple[int, *Ts1] IntFloatTuple = IntTuple[float, *Ts2] # Valid From 77cc3a796918300b7d848e48d65d01658e68f610 Mon Sep 17 00:00:00 2001 From: Eric Traut Date: Mon, 3 Jun 2024 15:38:45 -0700 Subject: [PATCH 006/308] =?UTF-8?q?Fixed=20two=20small=20typos=20in=20Enum?= =?UTF-8?q?s=20chapter=20that=20I=20discovered=20when=20writing=E2=80=A6?= =?UTF-8?q?=20(#1762)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixed two small typos in Enums chapter that I discovered when writing conformance tests. 1. A syntax error in a couple of code samples 2. A formatting error that causes a code sample to be rendered incorrectly These changes don't impact the meaning of the spec. --- docs/spec/enums.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/spec/enums.rst b/docs/spec/enums.rst index b9759e545..6e10a90e5 100644 --- a/docs/spec/enums.rst +++ b/docs/spec/enums.rst @@ -31,8 +31,8 @@ its various forms) is optional:: Color4 = Enum('Color4', ('RED', 'GREEN', 'BLUE')) # Optional Color5 = Enum('Color5', 'RED, GREEN, BLUE') # Optional Color6 = Enum('Color6', 'RED GREEN BLUE') # Optional - Color7 = Enum('Color7', [('RED': 1), ('GREEN': 2), ('BLUE': 3)]) # Optional - Color8 = Enum('Color8', (('RED': 1), ('GREEN': 2), ('BLUE': 3))) # Optional + Color7 = Enum('Color7', [('RED', 1), ('GREEN', 2), ('BLUE', 3)]) # Optional + Color8 = Enum('Color8', (('RED', 1), ('GREEN', 2), ('BLUE', 3))) # Optional Color9 = Enum('Color9', {'RED': 1, 'GREEN': 2, 'BLUE': 3}) # Optional Enum classes can also be defined using a subclass of ``enum.Enum`` or any class @@ -188,7 +188,7 @@ statically in cases where dynamic values are used. reveal_type(Example.c) # Revealed type is Literal[Example.c] * An attribute with a private name (beginning with, but not ending in, a double - underscore) is treated as a non-member. + underscore) is treated as a non-member:: class Example(Enum): A = 1 # Member attribute From 9a215982451a0a163afe3a0fa719832f8c2f8b6f Mon Sep 17 00:00:00 2001 From: Eric Traut Date: Mon, 3 Jun 2024 15:52:03 -0700 Subject: [PATCH 007/308] Fixed two bugs in the conformance test: (#1763) 1. The "conformance_automated" was not written to the output in some cases. 2. The output file was not written if it didn't previously exist and the tests passed. This doesn't change the results of any of the tests. --- conformance/results/mypy/constructors_consistency.toml | 5 +++++ conformance/results/mypy/exceptions_context_managers.toml | 1 + conformance/results/pyre/constructors_call_type.toml | 1 + conformance/results/pyre/constructors_consistency.toml | 5 +++++ conformance/results/pyright/constructors_call_new.toml | 1 + conformance/results/pyright/constructors_consistency.toml | 1 + .../results/pyright/exceptions_context_managers.toml | 1 + conformance/results/pytype/constructors_consistency.toml | 1 + conformance/src/main.py | 8 +++++--- 9 files changed, 21 insertions(+), 3 deletions(-) diff --git a/conformance/results/mypy/constructors_consistency.toml b/conformance/results/mypy/constructors_consistency.toml index 225d7847a..654ebaa96 100644 --- a/conformance/results/mypy/constructors_consistency.toml +++ b/conformance/results/mypy/constructors_consistency.toml @@ -2,3 +2,8 @@ conformant = "Pass" notes = """ Does not report inconsistency between __new__ and __init__ (optional). """ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +""" diff --git a/conformance/results/mypy/exceptions_context_managers.toml b/conformance/results/mypy/exceptions_context_managers.toml index cd630cbf5..513dbe853 100644 --- a/conformance/results/mypy/exceptions_context_managers.toml +++ b/conformance/results/mypy/exceptions_context_managers.toml @@ -3,3 +3,4 @@ errors_diff = """ """ output = """ """ +conformance_automated = "Pass" diff --git a/conformance/results/pyre/constructors_call_type.toml b/conformance/results/pyre/constructors_call_type.toml index 1e06c340a..b78a1daf4 100644 --- a/conformance/results/pyre/constructors_call_type.toml +++ b/conformance/results/pyre/constructors_call_type.toml @@ -11,3 +11,4 @@ constructors_call_type.py:72:4 Missing argument [20]: Call `Meta1.__call__` expe constructors_call_type.py:81:4 Missing argument [20]: Call `Class2.__new__` expects argument `y`. constructors_call_type.py:82:11 Incompatible parameter type [6]: In call `Class2.__new__`, for 2nd positional argument, expected `str` but got `int`. """ +conformance_automated = "Pass" diff --git a/conformance/results/pyre/constructors_consistency.toml b/conformance/results/pyre/constructors_consistency.toml index 225d7847a..654ebaa96 100644 --- a/conformance/results/pyre/constructors_consistency.toml +++ b/conformance/results/pyre/constructors_consistency.toml @@ -2,3 +2,8 @@ conformant = "Pass" notes = """ Does not report inconsistency between __new__ and __init__ (optional). """ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +""" diff --git a/conformance/results/pyright/constructors_call_new.toml b/conformance/results/pyright/constructors_call_new.toml index 8ca005715..5880ad7fc 100644 --- a/conformance/results/pyright/constructors_call_new.toml +++ b/conformance/results/pyright/constructors_call_new.toml @@ -10,3 +10,4 @@ constructors_call_new.py:145:1 - error:     Type "type[Class11[str]]" is incompatible with type "type[Class11[int]]"       Type parameter "T@Class11" is invariant, but "str" is not the same as "int" (reportGeneralTypeIssues) """ +conformance_automated = "Pass" diff --git a/conformance/results/pyright/constructors_consistency.toml b/conformance/results/pyright/constructors_consistency.toml index 8a3840678..e9fee5022 100644 --- a/conformance/results/pyright/constructors_consistency.toml +++ b/conformance/results/pyright/constructors_consistency.toml @@ -6,3 +6,4 @@ constructors_consistency.py:25:9 - error: Mismatch between signature of __new__   Signature of __init__ is "(x: str)"   Signature of __new__ is "()" (reportInconsistentConstructor) """ +conformance_automated = "Pass" diff --git a/conformance/results/pyright/exceptions_context_managers.toml b/conformance/results/pyright/exceptions_context_managers.toml index cd630cbf5..513dbe853 100644 --- a/conformance/results/pyright/exceptions_context_managers.toml +++ b/conformance/results/pyright/exceptions_context_managers.toml @@ -3,3 +3,4 @@ errors_diff = """ """ output = """ """ +conformance_automated = "Pass" diff --git a/conformance/results/pytype/constructors_consistency.toml b/conformance/results/pytype/constructors_consistency.toml index 100481a6b..a5d4de873 100644 --- a/conformance/results/pytype/constructors_consistency.toml +++ b/conformance/results/pytype/constructors_consistency.toml @@ -7,3 +7,4 @@ errors_diff = """ output = """ """ +conformance_automated = "Pass" diff --git a/conformance/src/main.py b/conformance/src/main.py index c1c8d76fa..02453f9f8 100644 --- a/conformance/src/main.py +++ b/conformance/src/main.py @@ -141,6 +141,7 @@ def update_output_for_test( results_file = results_dir / f"{test_name}.toml" results_file.parent.mkdir(parents=True, exist_ok=True) + should_write = False # Read the existing results file if present. try: @@ -153,7 +154,6 @@ def update_output_for_test( print(f"Error decoding {results_file}") existing_results = {} - should_write = False ignored_errors = existing_results.get("ignore_errors", []) errors_diff = "\n" + diff_expected_errors(type_checker, test_case, output, ignored_errors) old_errors_diff = "\n" + existing_results.get("errors_diff", "") @@ -165,8 +165,10 @@ def update_output_for_test( print(f"New output: {errors_diff}") print("") - existing_results["conformance_automated"] = "Fail" if errors_diff.strip() else "Pass" - + conformance_automated = "Fail" if errors_diff.strip() else "Pass" + if existing_results.get("conformance_automated") != conformance_automated: + should_write = True + existing_results["conformance_automated"] = conformance_automated old_output = existing_results.get("output", "") old_output = f"\n{old_output}" From 84bed8b51f66a6bd759e596712d4e134154f7125 Mon Sep 17 00:00:00 2001 From: Eric Traut Date: Tue, 4 Jun 2024 10:17:07 -0700 Subject: [PATCH 008/308] Implemented conformance tests for Enums chapter. (#1764) --- conformance/results/mypy/enums_behaviors.toml | 7 + .../results/mypy/enums_definition.toml | 6 + conformance/results/mypy/enums_expansion.toml | 12 ++ .../results/mypy/enums_member_names.toml | 11 ++ .../results/mypy/enums_member_values.toml | 16 ++ conformance/results/mypy/enums_members.toml | 42 +++++ conformance/results/mypy/version.toml | 2 +- conformance/results/pyre/enums_behaviors.toml | 10 ++ .../results/pyre/enums_definition.toml | 19 +++ conformance/results/pyre/enums_expansion.toml | 12 ++ .../results/pyre/enums_member_names.toml | 13 ++ .../results/pyre/enums_member_values.toml | 23 +++ conformance/results/pyre/enums_members.toml | 43 ++++++ conformance/results/pyre/version.toml | 2 +- .../results/pyright/enums_behaviors.toml | 7 + .../results/pyright/enums_definition.toml | 6 + .../results/pyright/enums_expansion.toml | 16 ++ .../results/pyright/enums_member_names.toml | 6 + .../results/pyright/enums_member_values.toml | 14 ++ .../results/pyright/enums_members.toml | 31 ++++ .../results/pytype/enums_behaviors.toml | 11 ++ .../results/pytype/enums_definition.toml | 10 ++ .../results/pytype/enums_expansion.toml | 11 ++ .../results/pytype/enums_member_names.toml | 7 + .../results/pytype/enums_member_values.toml | 18 +++ conformance/results/pytype/enums_members.toml | 39 +++++ conformance/results/pytype/version.toml | 2 +- conformance/results/results.html | 45 +++++- conformance/src/test_groups.toml | 4 + conformance/tests/_enums_member_values.py | 3 + conformance/tests/_enums_member_values.pyi | 15 ++ conformance/tests/_enums_members.py | 3 + conformance/tests/_enums_members.pyi | 15 ++ conformance/tests/enums_behaviors.py | 40 +++++ conformance/tests/enums_definition.py | 75 +++++++++ conformance/tests/enums_expansion.py | 78 ++++++++++ conformance/tests/enums_member_names.py | 30 ++++ conformance/tests/enums_member_values.py | 96 ++++++++++++ conformance/tests/enums_members.py | 143 ++++++++++++++++++ 39 files changed, 937 insertions(+), 6 deletions(-) create mode 100644 conformance/results/mypy/enums_behaviors.toml create mode 100644 conformance/results/mypy/enums_definition.toml create mode 100644 conformance/results/mypy/enums_expansion.toml create mode 100644 conformance/results/mypy/enums_member_names.toml create mode 100644 conformance/results/mypy/enums_member_values.toml create mode 100644 conformance/results/mypy/enums_members.toml create mode 100644 conformance/results/pyre/enums_behaviors.toml create mode 100644 conformance/results/pyre/enums_definition.toml create mode 100644 conformance/results/pyre/enums_expansion.toml create mode 100644 conformance/results/pyre/enums_member_names.toml create mode 100644 conformance/results/pyre/enums_member_values.toml create mode 100644 conformance/results/pyre/enums_members.toml create mode 100644 conformance/results/pyright/enums_behaviors.toml create mode 100644 conformance/results/pyright/enums_definition.toml create mode 100644 conformance/results/pyright/enums_expansion.toml create mode 100644 conformance/results/pyright/enums_member_names.toml create mode 100644 conformance/results/pyright/enums_member_values.toml create mode 100644 conformance/results/pyright/enums_members.toml create mode 100644 conformance/results/pytype/enums_behaviors.toml create mode 100644 conformance/results/pytype/enums_definition.toml create mode 100644 conformance/results/pytype/enums_expansion.toml create mode 100644 conformance/results/pytype/enums_member_names.toml create mode 100644 conformance/results/pytype/enums_member_values.toml create mode 100644 conformance/results/pytype/enums_members.toml create mode 100644 conformance/tests/_enums_member_values.py create mode 100644 conformance/tests/_enums_member_values.pyi create mode 100644 conformance/tests/_enums_members.py create mode 100644 conformance/tests/_enums_members.pyi create mode 100644 conformance/tests/enums_behaviors.py create mode 100644 conformance/tests/enums_definition.py create mode 100644 conformance/tests/enums_expansion.py create mode 100644 conformance/tests/enums_member_names.py create mode 100644 conformance/tests/enums_member_values.py create mode 100644 conformance/tests/enums_members.py diff --git a/conformance/results/mypy/enums_behaviors.toml b/conformance/results/mypy/enums_behaviors.toml new file mode 100644 index 000000000..80498e652 --- /dev/null +++ b/conformance/results/mypy/enums_behaviors.toml @@ -0,0 +1,7 @@ +conformant = "Pass" +errors_diff = """ +""" +output = """ +enums_behaviors.py:39: error: Cannot extend enum with existing members: "Shape" [misc] +""" +conformance_automated = "Pass" diff --git a/conformance/results/mypy/enums_definition.toml b/conformance/results/mypy/enums_definition.toml new file mode 100644 index 000000000..513dbe853 --- /dev/null +++ b/conformance/results/mypy/enums_definition.toml @@ -0,0 +1,6 @@ +conformant = "Pass" +errors_diff = """ +""" +output = """ +""" +conformance_automated = "Pass" diff --git a/conformance/results/mypy/enums_expansion.toml b/conformance/results/mypy/enums_expansion.toml new file mode 100644 index 000000000..9858edfea --- /dev/null +++ b/conformance/results/mypy/enums_expansion.toml @@ -0,0 +1,12 @@ +conformant = "Partial" +notes = """ +Improperly applies narrowing to Flag subclass. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 53: Expected 1 errors +Line 52: Unexpected errors ['enums_expansion.py:52: error: Expression is of type "Literal[CustomFlags.FLAG3]", not "CustomFlags" [assert-type]'] +""" +output = """ +enums_expansion.py:52: error: Expression is of type "Literal[CustomFlags.FLAG3]", not "CustomFlags" [assert-type] +""" diff --git a/conformance/results/mypy/enums_member_names.toml b/conformance/results/mypy/enums_member_names.toml new file mode 100644 index 000000000..fc838dc78 --- /dev/null +++ b/conformance/results/mypy/enums_member_names.toml @@ -0,0 +1,11 @@ +conformant = "Pass" +notes = """ +Does not support special-cased handling of member name literal types in some cases (optional). +""" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +enums_member_names.py:26: error: Expression is of type "str", not "Literal['RED', 'BLUE']" [assert-type] +enums_member_names.py:30: error: Expression is of type "str", not "Literal['RED', 'BLUE', 'GREEN']" [assert-type] +""" diff --git a/conformance/results/mypy/enums_member_values.toml b/conformance/results/mypy/enums_member_values.toml new file mode 100644 index 000000000..87ec4a09c --- /dev/null +++ b/conformance/results/mypy/enums_member_values.toml @@ -0,0 +1,16 @@ +conformant = "Partial" +notes = """ +Does not enforce declared type of `_value_`. +Does not enforce assigned tuple types for enum members (optional). +""" +conformance_automated = "Fail" +errors_diff = """ +Line 78: Expected 1 errors +""" +output = """ +enums_member_values.py:26: error: Expression is of type "Any", not "Literal[1, 3]" [assert-type] +enums_member_values.py:54: error: Expression is of type "tuple[int, float, float]", not "Literal[1]" [assert-type] +enums_member_values.py:68: error: Expression is of type "int", not "Literal[1]" [assert-type] +enums_member_values.py:85: error: Incompatible types in assignment (expression has type "int", variable has type "str") [assignment] +enums_member_values.py:96: error: Expression is of type "EllipsisType", not "int" [assert-type] +""" diff --git a/conformance/results/mypy/enums_members.toml b/conformance/results/mypy/enums_members.toml new file mode 100644 index 000000000..1c6b709ba --- /dev/null +++ b/conformance/results/mypy/enums_members.toml @@ -0,0 +1,42 @@ +conformant = "Partial" +notes = """ +Does not treat attribute with annotation and no assignment as non-member. +Does not reject use of annotation with enum member. +Does not treat callables as non-members. +Does not honor `enum.nonmember` to define non-member attribute. +Does not honor `enum.member` as method decorator. +Does not properly handle aliased enum members. +Does not support `_ignore_` mechanism (optional). +""" +conformance_automated = "Fail" +errors_diff = """ +Line 46: Expected 1 errors +Line 78: Expected 1 errors +Line 79: Expected 1 errors +Line 112: Expected 1 errors +Line 23: Unexpected errors ['enums_members.py:23: error: Expression is of type "Literal[Pet.genus]", not "str" [assert-type]'] +Line 24: Unexpected errors ['enums_members.py:24: error: Expression is of type "Literal[Pet.species]", not "str" [assert-type]'] +Line 31: Unexpected errors ['enums_members.py:31: error: Expression is of type "Literal[Pet2.genus]", not "str" [assert-type]'] +Line 32: Unexpected errors ['enums_members.py:32: error: Expression is of type "Literal[Pet2.species]", not "str" [assert-type]'] +Line 96: Unexpected errors ['enums_members.py:96: error: Expression is of type "Literal[TrafficLight.AMBER]", not "Literal[TrafficLight.YELLOW]" [assert-type]'] +Line 113: Unexpected errors ['enums_members.py:113: error: Expression is of type "member[Callable[[Example], None]]", not "Any" [assert-type]', 'enums_members.py:113: error: Parameter 1 of Literal[...] is invalid [valid-type]'] +""" +output = """ +enums_members.py:23: error: Expression is of type "Literal[Pet.genus]", not "str" [assert-type] +enums_members.py:24: error: Expression is of type "Literal[Pet.species]", not "str" [assert-type] +enums_members.py:31: error: Expression is of type "Literal[Pet2.genus]", not "str" [assert-type] +enums_members.py:32: error: Expression is of type "Literal[Pet2.species]", not "str" [assert-type] +enums_members.py:80: error: Expression is of type "Callable[[Pet4], str]", not "Any" [assert-type] +enums_members.py:80: error: Parameter 1 of Literal[...] is invalid [valid-type] +enums_members.py:81: error: Expression is of type "Callable[[Pet4], None]", not "Any" [assert-type] +enums_members.py:81: error: Parameter 1 of Literal[...] is invalid [valid-type] +enums_members.py:96: error: Expression is of type "Literal[TrafficLight.AMBER]", not "Literal[TrafficLight.YELLOW]" [assert-type] +enums_members.py:113: error: Expression is of type "member[Callable[[Example], None]]", not "Any" [assert-type] +enums_members.py:113: error: Parameter 1 of Literal[...] is invalid [valid-type] +enums_members.py:124: note: Revealed type is "Any" +enums_members.py:124: note: 'reveal_type' always outputs 'Any' in unchecked functions +enums_members.py:125: error: Expression is of type "Any", not "Literal[Example2.__B]" [assert-type] +enums_members.py:125: note: "assert_type" expects everything to be "Any" in unchecked functions +enums_members.py:142: error: Expression is of type "Literal[Pet5.DOG]", not "int" [assert-type] +enums_members.py:143: error: Expression is of type "Literal[Pet5.FISH]", not "int" [assert-type] +""" diff --git a/conformance/results/mypy/version.toml b/conformance/results/mypy/version.toml index dc9b55ed5..2d942f878 100644 --- a/conformance/results/mypy/version.toml +++ b/conformance/results/mypy/version.toml @@ -1,2 +1,2 @@ version = "mypy 1.10.0" -test_duration = 1.5 +test_duration = 0.9 diff --git a/conformance/results/pyre/enums_behaviors.toml b/conformance/results/pyre/enums_behaviors.toml new file mode 100644 index 000000000..42e562319 --- /dev/null +++ b/conformance/results/pyre/enums_behaviors.toml @@ -0,0 +1,10 @@ +conformant = "Partial" +notes = """ +Does not enforce that Enum classes are implicitly final. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 39: Expected 1 errors +""" +output = """ +""" diff --git a/conformance/results/pyre/enums_definition.toml b/conformance/results/pyre/enums_definition.toml new file mode 100644 index 000000000..832a9d48d --- /dev/null +++ b/conformance/results/pyre/enums_definition.toml @@ -0,0 +1,19 @@ +conformant = "Partial" +notes = """ +Does not support custom Enum classes based on EnumType metaclass. +Does not support some functional forms for Enum class definitions (optional). +""" +conformance_automated = "Fail" +errors_diff = """ +Line 75: Unexpected errors ['enums_definition.py:75:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[Color11.RED]` but got `int`.'] +""" +output = """ +enums_definition.py:24:9 Too many arguments [19]: Call `Enum.__new__` expects 1 positional argument, 4 were provided. +enums_definition.py:27:9 Too many arguments [19]: Call `Enum.__new__` expects 1 positional argument, 2 were provided. +enums_definition.py:28:9 Too many arguments [19]: Call `Enum.__new__` expects 1 positional argument, 2 were provided. +enums_definition.py:31:9 Too many arguments [19]: Call `Enum.__new__` expects 1 positional argument, 2 were provided. +enums_definition.py:33:12 Undefined attribute [16]: `Enum` has no attribute `RED`. +enums_definition.py:38:12 Undefined attribute [16]: `Color7` has no attribute `RED`. +enums_definition.py:39:12 Undefined attribute [16]: `Color8` has no attribute `RED`. +enums_definition.py:75:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[Color11.RED]` but got `int`. +""" diff --git a/conformance/results/pyre/enums_expansion.toml b/conformance/results/pyre/enums_expansion.toml new file mode 100644 index 000000000..8b75a929a --- /dev/null +++ b/conformance/results/pyre/enums_expansion.toml @@ -0,0 +1,12 @@ +conformant = "Pass" +notes = """ +Does not perform type narrowing based on enum literal expansion (optional). +""" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +enums_expansion.py:25:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[Color.GREEN]` but got `Color`. +enums_expansion.py:35:12 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Never` but got `Color`. +enums_expansion.py:53:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[CustomFlags.FLAG3]` but got `CustomFlags`. +""" diff --git a/conformance/results/pyre/enums_member_names.toml b/conformance/results/pyre/enums_member_names.toml new file mode 100644 index 000000000..109185b53 --- /dev/null +++ b/conformance/results/pyre/enums_member_names.toml @@ -0,0 +1,13 @@ +conformant = "Pass" +notes = """ +Does not support special-cased handling of member name literal types (optional). +""" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +enums_member_names.py:21:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal['RED']` but got `str`. +enums_member_names.py:22:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal['RED']` but got `typing.Any`. +enums_member_names.py:26:4 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Union[typing_extensions.Literal['BLUE'], typing_extensions.Literal['RED']]` but got `typing.Any`. +enums_member_names.py:30:4 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Union[typing_extensions.Literal['BLUE'], typing_extensions.Literal['GREEN'], typing_extensions.Literal['RED']]` but got `typing.Any`. +""" diff --git a/conformance/results/pyre/enums_member_values.toml b/conformance/results/pyre/enums_member_values.toml new file mode 100644 index 000000000..2cac7f64f --- /dev/null +++ b/conformance/results/pyre/enums_member_values.toml @@ -0,0 +1,23 @@ +conformant = "Partial" +notes = """ +Does not enforce declared type of `_value_`. +Does not enforce assigned tuple types for enum members (optional). +Does not evaluate literal types for enum member values (optional). +Does not evaluate literal types for auto values (optional). +""" +conformance_automated = "Fail" +errors_diff = """ +Line 78: Expected 1 errors +Line 85: Expected 1 errors +Line 75: Unexpected errors ['enums_member_values.py:75:0 Uninitialized attribute [13]: Attribute `_value_` is declared in class `Color3` to have type `Color3` but is never initialized.'] +""" +output = """ +enums_member_values.py:21:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[1]` but got `typing.Any`. +enums_member_values.py:22:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[1]` but got `typing.Any`. +enums_member_values.py:26:4 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Union[typing_extensions.Literal[1], typing_extensions.Literal[3]]` but got `typing.Any`. +enums_member_values.py:30:4 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Union[typing_extensions.Literal[1], typing_extensions.Literal[2], typing_extensions.Literal[3]]` but got `typing.Any`. +enums_member_values.py:54:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[1]` but got `typing.Any`. +enums_member_values.py:68:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[1]` but got `typing.Any`. +enums_member_values.py:75:0 Uninitialized attribute [13]: Attribute `_value_` is declared in class `Color3` to have type `Color3` but is never initialized. +enums_member_values.py:96:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `typing.Any`. +""" diff --git a/conformance/results/pyre/enums_members.toml b/conformance/results/pyre/enums_members.toml new file mode 100644 index 000000000..3e4ef99c1 --- /dev/null +++ b/conformance/results/pyre/enums_members.toml @@ -0,0 +1,43 @@ +conformant = "Partial" +notes = """ +Does not reject use of annotation with enum member. +Does not treat callables as non-members. +Does not treat annotated attributes as non-members. +Does not honor `enum.nonmember` to define non-member attribute. +Does not honor `enum.member` as method decorator. +Does not properly handle aliased enum members. +Rejects use of `_ignore_`. +Does not support `_ignore_` mechanism (optional). +""" +conformance_automated = "Fail" +errors_diff = """ +Line 46: Expected 1 errors +Line 78: Expected 1 errors +Line 79: Expected 1 errors +Line 112: Expected 1 errors +Line 125: Expected 1 errors +Line 23: Unexpected errors ['enums_members.py:23:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `Pet`.'] +Line 24: Unexpected errors ['enums_members.py:24:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `Pet`.'] +Line 31: Unexpected errors ['enums_members.py:31:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `Pet2`.'] +Line 32: Unexpected errors ['enums_members.py:32:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `Pet2`.'] +Line 96: Unexpected errors ['enums_members.py:96:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[TrafficLight.YELLOW]` but got `typing_extensions.Literal[TrafficLight.AMBER]`.'] +Line 113: Unexpected errors ['enums_members.py:113:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[Example.c]` but got `member[typing.Callable(Example.c)[[Named(self, Example)], None]]`.'] +Line 124: Unexpected errors ['enums_members.py:124:8 Revealed type [-1]: Revealed type for `enums_members.Example2._Example2__B` is `typing_extensions.Literal[Example2._Example2__B]` (final).'] +Line 135: Unexpected errors ['enums_members.py:135:4 Inconsistent override [15]: `_ignore_` overrides attribute defined in `Enum` inconsistently. Type `Pet5` is not a subtype of the overridden attribute `typing.Union[typing.List[str], str]`.'] +""" +output = """ +enums_members.py:15:0 Uninitialized attribute [13]: Attribute `genus` is declared in class `Pet` to have type `Pet` but is never initialized. +enums_members.py:15:0 Uninitialized attribute [13]: Attribute `species` is declared in class `Pet` to have type `Pet` but is never initialized. +enums_members.py:23:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `Pet`. +enums_members.py:24:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `Pet`. +enums_members.py:31:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `Pet2`. +enums_members.py:32:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `Pet2`. +enums_members.py:80:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[Pet4.species]` but got `str`. +enums_members.py:81:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[Pet4.speak]` but got `typing.Callable(Pet4.speak)[[Named(self, Pet4)], None]`. +enums_members.py:96:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[TrafficLight.YELLOW]` but got `typing_extensions.Literal[TrafficLight.AMBER]`. +enums_members.py:113:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[Example.c]` but got `member[typing.Callable(Example.c)[[Named(self, Example)], None]]`. +enums_members.py:124:8 Revealed type [-1]: Revealed type for `enums_members.Example2._Example2__B` is `typing_extensions.Literal[Example2._Example2__B]` (final). +enums_members.py:135:4 Inconsistent override [15]: `_ignore_` overrides attribute defined in `Enum` inconsistently. Type `Pet5` is not a subtype of the overridden attribute `typing.Union[typing.List[str], str]`. +enums_members.py:142:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `Pet5`. +enums_members.py:143:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `Pet5`. +""" diff --git a/conformance/results/pyre/version.toml b/conformance/results/pyre/version.toml index 737b7ea3a..47c7ebccd 100644 --- a/conformance/results/pyre/version.toml +++ b/conformance/results/pyre/version.toml @@ -1,2 +1,2 @@ version = "pyre 0.9.21" -test_duration = 4.1 +test_duration = 2.6 diff --git a/conformance/results/pyright/enums_behaviors.toml b/conformance/results/pyright/enums_behaviors.toml new file mode 100644 index 000000000..8a9ff77e3 --- /dev/null +++ b/conformance/results/pyright/enums_behaviors.toml @@ -0,0 +1,7 @@ +conformant = "Pass" +errors_diff = """ +""" +output = """ +enums_behaviors.py:39:21 - error: Enum class "Shape" is final and cannot be subclassed (reportGeneralTypeIssues) +""" +conformance_automated = "Pass" diff --git a/conformance/results/pyright/enums_definition.toml b/conformance/results/pyright/enums_definition.toml new file mode 100644 index 000000000..513dbe853 --- /dev/null +++ b/conformance/results/pyright/enums_definition.toml @@ -0,0 +1,6 @@ +conformant = "Pass" +errors_diff = """ +""" +output = """ +""" +conformance_automated = "Pass" diff --git a/conformance/results/pyright/enums_expansion.toml b/conformance/results/pyright/enums_expansion.toml new file mode 100644 index 000000000..c0150f0cc --- /dev/null +++ b/conformance/results/pyright/enums_expansion.toml @@ -0,0 +1,16 @@ +conformant = "Partial" +notes = """ +Applies type narrowing incorrectly for `a is E` pattern where `E` is an enum member. + +""" +conformance_automated = "Fail" +errors_diff = """ +Line 78: Unexpected errors ['enums_expansion.py:78:12 - error: Expression of type "list[Never]" is incompatible with return type "list[Answer]"'] +""" +output = """ +enums_expansion.py:53:21 - error: "assert_type" mismatch: expected "Literal[CustomFlags.FLAG3]" but received "CustomFlags" (reportAssertTypeFailure) +enums_expansion.py:78:12 - error: Expression of type "list[Never]" is incompatible with return type "list[Answer]" +  "list[Never]" is incompatible with "list[Answer]" +    Type parameter "_T@list" is invariant, but "Never" is not the same as "Answer" +    Consider switching from "list" to "Sequence" which is covariant (reportReturnType) +""" diff --git a/conformance/results/pyright/enums_member_names.toml b/conformance/results/pyright/enums_member_names.toml new file mode 100644 index 000000000..be211bd5b --- /dev/null +++ b/conformance/results/pyright/enums_member_names.toml @@ -0,0 +1,6 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +""" diff --git a/conformance/results/pyright/enums_member_values.toml b/conformance/results/pyright/enums_member_values.toml new file mode 100644 index 000000000..566fcd4f5 --- /dev/null +++ b/conformance/results/pyright/enums_member_values.toml @@ -0,0 +1,14 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +enums_member_values.py:50:12 - error: Argument missing for parameter "radius" (reportCallIssue) +enums_member_values.py:51:15 - error: Arguments missing for parameters "mass", "radius" (reportCallIssue) +enums_member_values.py:54:13 - error: "assert_type" mismatch: expected "Literal[1]" but received "Any" (reportAssertTypeFailure) +enums_member_values.py:68:13 - error: "assert_type" mismatch: expected "Literal[1]" but received "int" (reportAssertTypeFailure) +enums_member_values.py:78:13 - error: Expression of type "Literal['green']" is incompatible with declared type "int" +  "Literal['green']" is incompatible with "int" (reportAssignmentType) +enums_member_values.py:85:24 - error: Cannot assign to attribute "_value_" for class "Planet2*" +  "int" is incompatible with "str" (reportAttributeAccessIssue) +""" diff --git a/conformance/results/pyright/enums_members.toml b/conformance/results/pyright/enums_members.toml new file mode 100644 index 000000000..ed18e64b3 --- /dev/null +++ b/conformance/results/pyright/enums_members.toml @@ -0,0 +1,31 @@ +conformant = "Partial" +notes = """ +Does not reject use of annotation with enum member. +Does not treat annotated attributes as non-members in stub. +Does not support `_ignore_` mechanism (optional). +""" +conformance_automated = "Fail" +errors_diff = """ +Line 46: Expected 1 errors +Line 31: Unexpected errors ['enums_members.py:31:13 - error: "assert_type" mismatch: expected "str" but received "Literal[Pet2.genus]" (reportAssertTypeFailure)'] +Line 32: Unexpected errors ['enums_members.py:32:13 - error: "assert_type" mismatch: expected "str" but received "Literal[Pet2.species]" (reportAssertTypeFailure)'] +""" +output = """ +enums_members.py:31:13 - error: "assert_type" mismatch: expected "str" but received "Literal[Pet2.genus]" (reportAssertTypeFailure) +enums_members.py:32:13 - error: "assert_type" mismatch: expected "str" but received "Literal[Pet2.species]" (reportAssertTypeFailure) +enums_members.py:78:13 - error: "assert_type" mismatch: expected "Unknown" but received "(x: Unknown) -> str" (reportAssertTypeFailure) +enums_members.py:78:37 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value +enums_members.py:79:13 - error: "assert_type" mismatch: expected "Unknown" but received "(x: int) -> int" (reportAssertTypeFailure) +enums_members.py:79:37 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value +enums_members.py:80:13 - error: "assert_type" mismatch: expected "Unknown" but received "property" (reportAssertTypeFailure) +enums_members.py:80:35 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value +enums_members.py:81:13 - error: "assert_type" mismatch: expected "Unknown" but received "(self: Pet4) -> None" (reportAssertTypeFailure) +enums_members.py:81:33 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value +enums_members.py:112:13 - error: "assert_type" mismatch: expected "Unknown" but received "int" (reportAssertTypeFailure) +enums_members.py:112:32 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value +enums_members.py:124:21 - information: Type of "Example2.__B" is "Literal[2]" +enums_members.py:125:21 - error: "assert_type" mismatch: expected "Unknown" but received "Literal[2]" (reportAssertTypeFailure) +enums_members.py:125:43 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value +enums_members.py:142:13 - error: "assert_type" mismatch: expected "int" but received "Literal[Pet5.DOG]" (reportAssertTypeFailure) +enums_members.py:143:13 - error: "assert_type" mismatch: expected "int" but received "Literal[Pet5.FISH]" (reportAssertTypeFailure) +""" diff --git a/conformance/results/pytype/enums_behaviors.toml b/conformance/results/pytype/enums_behaviors.toml new file mode 100644 index 000000000..ab9118cfb --- /dev/null +++ b/conformance/results/pytype/enums_behaviors.toml @@ -0,0 +1,11 @@ +conformant = "Partial" +notes = """ +Does not enforce that Enum classes are implicitly final. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 39: Expected 1 errors +""" +output = """ + +""" diff --git a/conformance/results/pytype/enums_definition.toml b/conformance/results/pytype/enums_definition.toml new file mode 100644 index 000000000..29c66d614 --- /dev/null +++ b/conformance/results/pytype/enums_definition.toml @@ -0,0 +1,10 @@ +conformant = "Pass" +notes = """ +Does not support some functional forms for Enum class definitions (optional). +""" +errors_diff = """ +""" +output = """ +File "enums_definition.py", line 24, in : Function unsolveable.__new__ was called with the wrong arguments [wrong-arg-types] +""" +conformance_automated = "Pass" diff --git a/conformance/results/pytype/enums_expansion.toml b/conformance/results/pytype/enums_expansion.toml new file mode 100644 index 000000000..9f168ca05 --- /dev/null +++ b/conformance/results/pytype/enums_expansion.toml @@ -0,0 +1,11 @@ +conformant = "Partial" +notes = """ +Improperly applies narrowing to Flag subclass. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 53: Expected 1 errors +""" +output = """ + +""" diff --git a/conformance/results/pytype/enums_member_names.toml b/conformance/results/pytype/enums_member_names.toml new file mode 100644 index 000000000..fb0bc9609 --- /dev/null +++ b/conformance/results/pytype/enums_member_names.toml @@ -0,0 +1,7 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ + +""" diff --git a/conformance/results/pytype/enums_member_values.toml b/conformance/results/pytype/enums_member_values.toml new file mode 100644 index 000000000..c562dce2a --- /dev/null +++ b/conformance/results/pytype/enums_member_values.toml @@ -0,0 +1,18 @@ +conformant = "Partial" +notes = """ +Does not enforce declared type of `_value_`. +Does not correctly enforce assigned tuple types for enum members (optional). +Does not evaluate literal types for enum member values (optional). +Does not evaluate literal types for auto values (optional). +""" +conformance_automated = "Fail" +errors_diff = """ +Line 78: Expected 1 errors +Line 41: Unexpected errors ['File "enums_member_values.py", line 41, in : Missing parameter \\'mass\\' in call to function Planet.__init__ [missing-parameter]', 'File "enums_member_values.py", line 41, in : Function Planet.__init__ was called with the wrong arguments [wrong-arg-types]'] +""" +output = """ +File "enums_member_values.py", line 41, in : Missing parameter 'mass' in call to function Planet.__init__ [missing-parameter] +File "enums_member_values.py", line 41, in : Function Planet.__init__ was called with the wrong arguments [wrong-arg-types] +File "enums_member_values.py", line 85, in __init__: Type annotation for _value_ does not match type of assignment [annotation-type-mismatch] +File "enums_member_values.py", line 96, in : Any [assert-type] +""" diff --git a/conformance/results/pytype/enums_members.toml b/conformance/results/pytype/enums_members.toml new file mode 100644 index 000000000..3d3967c88 --- /dev/null +++ b/conformance/results/pytype/enums_members.toml @@ -0,0 +1,39 @@ +conformant = "Partial" +notes = """ +Does not reject use of annotation with enum member. +Does not support `enum.member` and `enum.nonmember`. +Does not support `_ignore_` mechanism (optional). +""" +conformance_automated = "Fail" +errors_diff = """ +Line 46: Expected 1 errors +Line 112: Expected 1 errors +Line 125: Expected 1 errors +Line 7: Unexpected errors ['File "enums_members.py", line 7, in : enum.nonmember not supported yet [not-supported-yet]', 'File "enums_members.py", line 7, in : enum.member not supported yet [not-supported-yet]'] +Line 31: Unexpected errors ['File "enums_members.py", line 31, in : _enums_members.Pet2 [assert-type]'] +Line 32: Unexpected errors ['File "enums_members.py", line 32, in : _enums_members.Pet2 [assert-type]'] +Line 103: Unexpected errors ['File "enums_members.py", line 103, in Example: Function enum.member expects 0 arg(s), got 1 [wrong-arg-count]'] +Line 104: Unexpected errors ['File "enums_members.py", line 104, in Example: Function enum.nonmember expects 0 arg(s), got 1 [wrong-arg-count]'] +Line 106: Unexpected errors ['File "enums_members.py", line 106, in Example: Function enum.member expects 0 arg(s), got 1 [wrong-arg-count]'] +Line 124: Unexpected errors ['File "enums_members.py", line 124, in method: Example2 [reveal-type]'] +""" +output = """ +File "enums_members.py", line 7, in : enum.nonmember not supported yet [not-supported-yet] +File "enums_members.py", line 7, in : enum.member not supported yet [not-supported-yet] +File "enums_members.py", line 31, in : _enums_members.Pet2 [assert-type] +File "enums_members.py", line 32, in : _enums_members.Pet2 [assert-type] +File "enums_members.py", line 78, in : Invalid type annotation 'Literal' [invalid-annotation] +File "enums_members.py", line 78, in : Callable[[Any], Any] [assert-type] +File "enums_members.py", line 79, in : Invalid type annotation 'Literal' [invalid-annotation] +File "enums_members.py", line 79, in : Callable[[int], int] [assert-type] +File "enums_members.py", line 80, in : property [assert-type] +File "enums_members.py", line 80, in : Invalid type annotation 'Literal' [invalid-annotation] +File "enums_members.py", line 81, in : Invalid type annotation 'Literal' [invalid-annotation] +File "enums_members.py", line 81, in : Callable[[Any], None] [assert-type] +File "enums_members.py", line 103, in Example: Function enum.member expects 0 arg(s), got 1 [wrong-arg-count] +File "enums_members.py", line 104, in Example: Function enum.nonmember expects 0 arg(s), got 1 [wrong-arg-count] +File "enums_members.py", line 106, in Example: Function enum.member expects 0 arg(s), got 1 [wrong-arg-count] +File "enums_members.py", line 124, in method: Example2 [reveal-type] +File "enums_members.py", line 142, in : Pet5 [assert-type] +File "enums_members.py", line 143, in : Pet5 [assert-type] +""" diff --git a/conformance/results/pytype/version.toml b/conformance/results/pytype/version.toml index 3d4735eb9..e1fc04b63 100644 --- a/conformance/results/pytype/version.toml +++ b/conformance/results/pytype/version.toml @@ -1,2 +1,2 @@ version = "pytype 2024.04.11" -test_duration = 29.7 +test_duration = 29.9 diff --git a/conformance/results/results.html b/conformance/results/results.html index 268c79091..7f2380997 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -159,16 +159,16 @@

Python Type System Conformance Test Results

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/conformance/src/test_groups.toml b/conformance/src/test_groups.toml index 155287f48..f6588f561 100644 --- a/conformance/src/test_groups.toml +++ b/conformance/src/test_groups.toml @@ -67,6 +67,10 @@ href = "https://typing.readthedocs.io/en/latest/spec/tuples.html" name = "Named tuples" href = "https://typing.readthedocs.io/en/latest/spec/namedtuples.html" +[enums] +name = "Enumerations" +href = "https://typing.readthedocs.io/en/latest/spec/enums.html" + [narrowing] name = "Type narrowing" href = "https://typing.readthedocs.io/en/latest/spec/narrowing.html" diff --git a/conformance/tests/_enums_member_values.py b/conformance/tests/_enums_member_values.py new file mode 100644 index 000000000..c51259fe9 --- /dev/null +++ b/conformance/tests/_enums_member_values.py @@ -0,0 +1,3 @@ +""" +Dummy implementation _enums_member_values stub. +""" diff --git a/conformance/tests/_enums_member_values.pyi b/conformance/tests/_enums_member_values.pyi new file mode 100644 index 000000000..4778f266f --- /dev/null +++ b/conformance/tests/_enums_member_values.pyi @@ -0,0 +1,15 @@ +""" +Support stub file for enums_member_values test. +""" + +from enum import Enum + +# > If the literal values for enum members are not supplied, as they sometimes +# > are not within a type stub file, a type checker can use the type of the +# > _value_ attribute. + +class ColumnType(Enum): + _value_: int + DORIC = ... + IONIC = ... + CORINTHIAN = ... diff --git a/conformance/tests/_enums_members.py b/conformance/tests/_enums_members.py new file mode 100644 index 000000000..3a6d43227 --- /dev/null +++ b/conformance/tests/_enums_members.py @@ -0,0 +1,3 @@ +""" +Dummy implementation for stub file for enums_members test. +""" diff --git a/conformance/tests/_enums_members.pyi b/conformance/tests/_enums_members.pyi new file mode 100644 index 000000000..73f3cdc56 --- /dev/null +++ b/conformance/tests/_enums_members.pyi @@ -0,0 +1,15 @@ +""" +Support stub file for enums_members test. +""" + +from enum import Enum + +# > Within a type stub, members can be defined using the actual runtime values, +# > or a placeholder of ... can be used + +class Pet2(Enum): + genus: str # Non-member attribute + species: str # Non-member attribute + + CAT = ... # Member attribute + DOG = ... # Member attribute diff --git a/conformance/tests/enums_behaviors.py b/conformance/tests/enums_behaviors.py new file mode 100644 index 000000000..fa3aeec7d --- /dev/null +++ b/conformance/tests/enums_behaviors.py @@ -0,0 +1,40 @@ +""" +Tests basic behaviors of of Enum classes. +""" + +# Specification: https://typing.readthedocs.io/en/latest/spec/enums.html#enum-definition + +from enum import Enum +from typing import assert_type + +# > Enum classes are iterable and indexable, and they can be called with a +# > value to look up the enum member with that value. Type checkers should +# > support these behaviors + +class Color(Enum): + RED = 1 + GREEN = 2 + BLUE = 3 + +for color in Color: + assert_type(color, Color) + +# > Unlike most Python classes, Calling an enum class does not invoke its +# > constructor. Instead, the call performs a value-based lookup of an +# > enum member. + +assert_type(Color["RED"], Color) # 'Literal[Color.RED]' is also acceptable +assert_type(Color(3), Color) # 'Literal[Color.BLUE]' is also acceptable + + +# > An Enum class with one or more defined members cannot be subclassed. + +class EnumWithNoMembers(Enum): + pass + +class Shape(EnumWithNoMembers): # OK (because no members are defined) + SQUARE = 1 + CIRCLE = 2 + +class ExtendedShape(Shape): # E: Shape is implicitly final + TRIANGLE = 3 diff --git a/conformance/tests/enums_definition.py b/conformance/tests/enums_definition.py new file mode 100644 index 000000000..31a137c40 --- /dev/null +++ b/conformance/tests/enums_definition.py @@ -0,0 +1,75 @@ +""" +Tests handling of Enum class definitions using the class syntax. +""" + +# Specification: https://typing.readthedocs.io/en/latest/spec/enums.html#enum-definition + +from enum import Enum, EnumType +from typing import Literal, assert_type + +# > Type checkers should support the class syntax + + +class Color1(Enum): + RED = 1 + GREEN = 2 + BLUE = 3 + + +assert_type(Color1.RED, Literal[Color1.RED]) + + +# > The function syntax (in its various forms) is optional + +Color2 = Enum("Color2", "RED", "GREEN", "BLUE") # E? +Color3 = Enum("Color3", ["RED", "GREEN", "BLUE"]) # E? +Color4 = Enum("Color4", ("RED", "GREEN", "BLUE")) # E? +Color5 = Enum("Color5", "RED, GREEN, BLUE") # E? +Color6 = Enum("Color6", "RED GREEN BLUE") # E? +Color7 = Enum("Color7", [("RED", 1), ("GREEN", 2), ("BLUE", 3)]) # E? +Color8 = Enum("Color8", (("RED", 1), ("GREEN", 2), ("BLUE", 3))) # E? +Color9 = Enum("Color9", {"RED": 1, "GREEN": 2, "BLUE": 3}) # E? + +assert_type(Color2.RED, Literal[Color2.RED]) # E? +assert_type(Color3.RED, Literal[Color3.RED]) # E? +assert_type(Color4.RED, Literal[Color4.RED]) # E? +assert_type(Color5.RED, Literal[Color5.RED]) # E? +assert_type(Color6.RED, Literal[Color6.RED]) # E? +assert_type(Color7.RED, Literal[Color7.RED]) # E? +assert_type(Color8.RED, Literal[Color8.RED]) # E? +assert_type(Color9.RED, Literal[Color9.RED]) # E? + + +# > Enum classes can also be defined using a subclass of enum.Enum or any class +# > that uses enum.EnumType (or a subclass thereof) as a metaclass. +# > Type checkers should treat such classes as enums + + +class CustomEnum1(Enum): + pass + + +class Color10(CustomEnum1): + RED = 1 + GREEN = 2 + BLUE = 3 + + +assert_type(Color10.RED, Literal[Color10.RED]) + + +class CustomEnumType(EnumType): + pass + + +class CustomEnum2(metaclass=CustomEnumType): + pass + + +class Color11(CustomEnum2): + RED = 1 + GREEN = 2 + BLUE = 3 + + +assert_type(Color11.RED, Literal[Color11.RED]) diff --git a/conformance/tests/enums_expansion.py b/conformance/tests/enums_expansion.py new file mode 100644 index 000000000..57f701f10 --- /dev/null +++ b/conformance/tests/enums_expansion.py @@ -0,0 +1,78 @@ +""" +Tests that the type checker handles literal expansion of enum classes. +""" + +# Specification: https://typing.readthedocs.io/en/latest/spec/enums.html#enum-literal-expansion + +from enum import Enum, Flag +from typing import Literal, Never, assert_type + +# > From the perspective of the type system, most enum classes are equivalent +# > to the union of the literal members within that enum. Type checkers may +# > therefore expand an enum type + + +class Color(Enum): + RED = 1 + GREEN = 2 + BLUE = 3 + + +def print_color1(c: Color): + if c is Color.RED or c is Color.BLUE: + print("red or blue") + else: + assert_type(c, Literal[Color.GREEN]) # E? + + +def print_color2(c: Color): + match c: + case Color.RED | Color.BLUE: + print("red or blue") + case Color.GREEN: + print("green") + case _: + assert_type(c, Never) # E? + + +# > This rule does not apply to classes that derive from enum. Flag because +# > these enums allow flags to be combined in arbitrary ways. + + +class CustomFlags(Flag): + FLAG1 = 1 + FLAG2 = 2 + FLAG3 = 4 + + +def test1(f: CustomFlags): + if f is CustomFlags.FLAG1 or f is CustomFlags.FLAG2: + print("flag1 and flag2") + else: + assert_type(f, CustomFlags) + assert_type(f, Literal[CustomFlags.FLAG3]) # E + + +def test2(f: CustomFlags): + match f: + case CustomFlags.FLAG1 | CustomFlags.FLAG2: + pass + case CustomFlags.FLAG3: + pass + case _: + assert_type(f, CustomFlags) + + +# > A type checker should treat a complete union of all literal members as +# > compatible with the enum type. + + +class Answer(Enum): + Yes = 1 + No = 2 + + +def test3(val: object) -> list[Answer]: + assert val is Answer.Yes or val is Answer.No + x = [val] + return x diff --git a/conformance/tests/enums_member_names.py b/conformance/tests/enums_member_names.py new file mode 100644 index 000000000..dc9ee0aae --- /dev/null +++ b/conformance/tests/enums_member_names.py @@ -0,0 +1,30 @@ +""" +Tests that the type checker handles the `_name_` and `name` attributes correctly. +""" + +# Specification: https://typing.readthedocs.io/en/latest/spec/enums.html#member-names + +from enum import Enum +from typing import Literal, assert_type + +# > All enum member objects have an attribute _name_ that contains the member’s +# > name. They also have a property name that returns the same name. Type +# > checkers may infer a literal type for the name of a member + + +class Color(Enum): + RED = 1 + GREEN = 2 + BLUE = 3 + + +assert_type(Color.RED._name_, Literal["RED"]) # E? +assert_type(Color.RED.name, Literal["RED"]) # E? + + +def func1(red_or_blue: Literal[Color.RED, Color.BLUE]): + assert_type(red_or_blue.name, Literal["RED", "BLUE"]) # E? + + +def func2(any_color: Color): + assert_type(any_color.name, Literal["RED", "BLUE", "GREEN"]) # E? diff --git a/conformance/tests/enums_member_values.py b/conformance/tests/enums_member_values.py new file mode 100644 index 000000000..741099596 --- /dev/null +++ b/conformance/tests/enums_member_values.py @@ -0,0 +1,96 @@ +""" +Tests that the type checker handles the `_value_` and `value` attributes correctly. +""" + +# Specification: https://typing.readthedocs.io/en/latest/spec/enums.html#member-values + +# > All enum member objects have an attribute _value_ that contains the +# > member’s value. They also have a property value that returns the same value. +# > Type checkers may infer the type of a member’s value. + +from enum import Enum, auto +from typing import Literal, assert_type + + +class Color(Enum): + RED = 1 + GREEN = 2 + BLUE = 3 + + +assert_type(Color.RED._value_, Literal[1]) # E? +assert_type(Color.RED.value, Literal[1]) # E? + + +def func1(red_or_blue: Literal[Color.RED, Color.BLUE]): + assert_type(red_or_blue.value, Literal[1, 3]) # E? + + +def func2(any_color: Color): + assert_type(any_color.value, Literal[1, 2, 3]) # E? + + +# > The value of _value_ can be assigned in a constructor method. This +# > technique is sometimes used to initialize both the member value and +# > non-member attributes. If the value assigned in the class body is a tuple, +# > the unpacked tuple value is passed to the constructor. Type checkers may +# > validate consistency between assigned tuple values and the constructor +# > signature. + + +class Planet(Enum): + def __init__(self, value: int, mass: float, radius: float): + self._value_ = value + self.mass = mass + self.radius = radius + + MERCURY = (1, 3.303e23, 2.4397e6) + VENUS = (2, 4.869e24, 6.0518e6) + EARTH = (3, 5.976e24, 6.37814e6) + MARS = (6.421e23, 3.3972e6) # E?: Type checker error (optional) + JUPITER = 5 # E?: Type checker error (optional) + + +assert_type(Planet.MERCURY.value, Literal[1]) # E? + + +# > The class enum.auto and method _generate_next_value_ can be used within +# > an enum class to automatically generate values for enum members. +# > Type checkers may support these to infer literal types for member values. + + +class Color2(Enum): + RED = auto() + GREEN = auto() + BLUE = auto() + + +assert_type(Color2.RED.value, Literal[1]) # E? + +# > If an enum class provides an explicit type annotation for _value_, type +# > checkers should enforce this declared type when values are assigned to +# > _value_. + + +class Color3(Enum): + _value_: int + RED = 1 # OK + GREEN = "green" # E + + +class Planet2(Enum): + _value_: str + + def __init__(self, value: int, mass: float, radius: float): + self._value_ = value # E + + MERCURY = (1, 3.303e23, 2.4397e6) + + +from _enums_member_values import ColumnType + +# > If the literal values for enum members are not supplied, as they sometimes +# > are not within a type stub file, a type checker can use the type of the +# > _value_ attribute. + +assert_type(ColumnType.DORIC.value, int) # E? diff --git a/conformance/tests/enums_members.py b/conformance/tests/enums_members.py new file mode 100644 index 000000000..505cacfcc --- /dev/null +++ b/conformance/tests/enums_members.py @@ -0,0 +1,143 @@ +""" +Tests that the type checker can distinguish enum members from non-members. +""" + +# Specification: https://typing.readthedocs.io/en/latest/spec/enums.html#defining-members + +from enum import Enum, member, nonmember +from typing import Literal, assert_type + +# > If an attribute is defined in the class body with a type annotation but +# > with no assigned value, a type checker should assume this is a non-member +# > attribute + + +class Pet(Enum): # E?: Uninitialized attributes (pyre) + genus: str # Non-member attribute + species: str # Non-member attribute + + CAT = 1 # Member attribute + DOG = 2 # Member attribute + + +assert_type(Pet.genus, str) +assert_type(Pet.species, str) +assert_type(Pet.CAT, Literal[Pet.CAT]) +assert_type(Pet.DOG, Literal[Pet.DOG]) + + +from _enums_members import Pet2 + +assert_type(Pet2.genus, str) +assert_type(Pet2.species, str) +assert_type(Pet2.CAT, Literal[Pet2.CAT]) +assert_type(Pet2.DOG, Literal[Pet2.DOG]) + + +# > Members defined within an enum class should not include explicit type +# > annotations. Type checkers should infer a literal type for all members. +# > A type checker should report an error if a type annotation is used for +# > an enum member because this type will be incorrect and misleading to +# > readers of the code + + +class Pet3(Enum): + CAT = 1 + DOG: int = 2 # E + + +# > Methods, callables, descriptors (including properties), and nested classes +# > that are defined in the class are not treated as enum members by the +# > EnumType metaclass and should likewise not be treated as enum members by a +# > type checker + + +def identity(x: int) -> int: + return x + + +class Pet4(Enum): + CAT = 1 # Member attribute + DOG = 2 # Member attribute + + converter = lambda x: str(x) # Non-member attribute + transform = staticmethod(identity) # Non-member attribute + + @property + def species(self) -> str: # Non-member property + return "mammal" + + def speak(self) -> None: # Non-member method + print("meow" if self is Pet.CAT else "woof") + + class Nested: ... # Non-member nested class + + +assert_type(Pet4.CAT, Literal[Pet4.CAT]) +assert_type(Pet4.DOG, Literal[Pet4.DOG]) +assert_type(Pet4.converter, Literal[Pet4.converter]) # E +assert_type(Pet4.transform, Literal[Pet4.transform]) # E +assert_type(Pet4.species, Literal[Pet4.species]) # E +assert_type(Pet4.speak, Literal[Pet4.speak]) # E + + +# > An attribute that is assigned the value of another member of the same +# > enum is not a member itself. Instead, it is an alias for the first member + + +class TrafficLight(Enum): + RED = 1 + GREEN = 2 + YELLOW = 3 + + AMBER = YELLOW # Alias for YELLOW + + +assert_type(TrafficLight.AMBER, Literal[TrafficLight.YELLOW]) + +# > If using Python 3.11 or newer, the enum.member and enum.nonmember classes +# > can be used to unambiguously distinguish members from non-members. + + +class Example(Enum): + a = member(1) # Member attribute + b = nonmember(2) # Non-member attribute + + @member + def c(self) -> None: # Member method + pass + + +assert_type(Example.a, Literal[Example.a]) +assert_type(Example.b, Literal[Example.b]) # E +assert_type(Example.c, Literal[Example.c]) + + +# > An attribute with a private name (beginning with, but not ending in, +# > a double underscore) is treated as a non-member. + + +class Example2(Enum): + __B = 2 # Non-member attribute + + def method(self): + reveal_type(Example2.__B) + assert_type(Example2.__B, Literal[Example2.__B]) # E + + +# > An enum class can define a class symbol named _ignore_. This can be +# > a list of names or a string containing a space-delimited list of names +# > that are deleted from the enum class at runtime. Type checkers may +# > support this mechanism + + +class Pet5(Enum): + _ignore_ = "DOG FISH" + CAT = 1 # Member attribute + DOG = 2 # temporary variable, will be removed from the final enum class + FISH = 3 # temporary variable, will be removed from the final enum class + + +assert_type(Pet5.CAT, Literal[Pet5.CAT]) +assert_type(Pet5.DOG, int) # E?: Literal[2] is also acceptable +assert_type(Pet5.FISH, int) # E?: Literal[3] is also acceptable From 11da23ae0c6028536290a315367a5f9be39bd8b2 Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Wed, 5 Jun 2024 16:36:01 +0100 Subject: [PATCH 009/308] Spec: "Distributing type information": add links to PEPs 484 and 561; add a new anchor for easy intersphinx referencing (#1767) --- docs/spec/distributing.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/spec/distributing.rst b/docs/spec/distributing.rst index 9f92c3ad9..afa5953ca 100644 --- a/docs/spec/distributing.rst +++ b/docs/spec/distributing.rst @@ -8,6 +8,8 @@ Distributing type information Stub files ---------- +(Originally specified in :pep:`484`.) + Stub files are files containing type hints that are only for use by the type checker, not at runtime. There are several use cases for stub files: @@ -85,9 +87,13 @@ and type stubs for third-party libraries that don't ship their own type informat stubs collected there are decided separately and described in the project's documentation. +.. _packaging-typed-libraries: + Type information in libraries ----------------------------- +(Originally specified in :pep:`561`.) + There are several motivations and methods of supporting typing in a package. This specification recognizes three types of packages that users of typing wish to create: From 7cbb3f2162863e3d83725764a303bc623d6bc09d Mon Sep 17 00:00:00 2001 From: Eric Traut Date: Wed, 5 Jun 2024 14:27:21 -0700 Subject: [PATCH 010/308] Updated conformance test results for pyright 1.1.366. (#1768) This version fixes several conformance issues related to the recently added Enumerations chapter. --- conformance/results/mypy/version.toml | 2 +- conformance/results/pyre/version.toml | 2 +- conformance/results/pyright/enums_expansion.toml | 13 ++----------- conformance/results/pyright/enums_members.toml | 12 +++--------- conformance/results/pyright/version.toml | 2 +- conformance/results/pytype/version.toml | 2 +- conformance/results/results.html | 12 ++++++------ 7 files changed, 15 insertions(+), 30 deletions(-) diff --git a/conformance/results/mypy/version.toml b/conformance/results/mypy/version.toml index 2d942f878..dc9b55ed5 100644 --- a/conformance/results/mypy/version.toml +++ b/conformance/results/mypy/version.toml @@ -1,2 +1,2 @@ version = "mypy 1.10.0" -test_duration = 0.9 +test_duration = 1.5 diff --git a/conformance/results/pyre/version.toml b/conformance/results/pyre/version.toml index 47c7ebccd..4687d8542 100644 --- a/conformance/results/pyre/version.toml +++ b/conformance/results/pyre/version.toml @@ -1,2 +1,2 @@ version = "pyre 0.9.21" -test_duration = 2.6 +test_duration = 3.6 diff --git a/conformance/results/pyright/enums_expansion.toml b/conformance/results/pyright/enums_expansion.toml index c0150f0cc..2a48dea06 100644 --- a/conformance/results/pyright/enums_expansion.toml +++ b/conformance/results/pyright/enums_expansion.toml @@ -1,16 +1,7 @@ -conformant = "Partial" -notes = """ -Applies type narrowing incorrectly for `a is E` pattern where `E` is an enum member. - -""" -conformance_automated = "Fail" +conformant = "Pass" +conformance_automated = "Pass" errors_diff = """ -Line 78: Unexpected errors ['enums_expansion.py:78:12 - error: Expression of type "list[Never]" is incompatible with return type "list[Answer]"'] """ output = """ enums_expansion.py:53:21 - error: "assert_type" mismatch: expected "Literal[CustomFlags.FLAG3]" but received "CustomFlags" (reportAssertTypeFailure) -enums_expansion.py:78:12 - error: Expression of type "list[Never]" is incompatible with return type "list[Answer]" -  "list[Never]" is incompatible with "list[Answer]" -    Type parameter "_T@list" is invariant, but "Never" is not the same as "Answer" -    Consider switching from "list" to "Sequence" which is covariant (reportReturnType) """ diff --git a/conformance/results/pyright/enums_members.toml b/conformance/results/pyright/enums_members.toml index ed18e64b3..00145a6d4 100644 --- a/conformance/results/pyright/enums_members.toml +++ b/conformance/results/pyright/enums_members.toml @@ -1,18 +1,12 @@ -conformant = "Partial" +conformant = "Pass" notes = """ -Does not reject use of annotation with enum member. -Does not treat annotated attributes as non-members in stub. Does not support `_ignore_` mechanism (optional). """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 46: Expected 1 errors -Line 31: Unexpected errors ['enums_members.py:31:13 - error: "assert_type" mismatch: expected "str" but received "Literal[Pet2.genus]" (reportAssertTypeFailure)'] -Line 32: Unexpected errors ['enums_members.py:32:13 - error: "assert_type" mismatch: expected "str" but received "Literal[Pet2.species]" (reportAssertTypeFailure)'] """ output = """ -enums_members.py:31:13 - error: "assert_type" mismatch: expected "str" but received "Literal[Pet2.genus]" (reportAssertTypeFailure) -enums_members.py:32:13 - error: "assert_type" mismatch: expected "str" but received "Literal[Pet2.species]" (reportAssertTypeFailure) +enums_members.py:46:5 - error: Type annotations are not allowed for enum members (reportGeneralTypeIssues) enums_members.py:78:13 - error: "assert_type" mismatch: expected "Unknown" but received "(x: Unknown) -> str" (reportAssertTypeFailure) enums_members.py:78:37 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value enums_members.py:79:13 - error: "assert_type" mismatch: expected "Unknown" but received "(x: int) -> int" (reportAssertTypeFailure) diff --git a/conformance/results/pyright/version.toml b/conformance/results/pyright/version.toml index 99853f7f6..d79a176b0 100644 --- a/conformance/results/pyright/version.toml +++ b/conformance/results/pyright/version.toml @@ -1,2 +1,2 @@ -version = "pyright 1.1.365" +version = "pyright 1.1.366" test_duration = 1.4 diff --git a/conformance/results/pytype/version.toml b/conformance/results/pytype/version.toml index e1fc04b63..9c27bf79d 100644 --- a/conformance/results/pytype/version.toml +++ b/conformance/results/pytype/version.toml @@ -1,2 +1,2 @@ version = "pytype 2024.04.11" -test_duration = 29.9 +test_duration = 32.9 diff --git a/conformance/results/results.html b/conformance/results/results.html index 7f2380997..56739d7a9 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -159,16 +159,16 @@

Python Type System Conformance Test Results

 
mypy 1.10.0
-
1.5sec
+
0.9sec
pyright 1.1.365
1.4sec
pyre 0.9.21
-
4.1sec
+
2.6sec
pytype 2024.04.11
-
29.7sec
+
29.9sec
@@ -898,6 +898,45 @@

Python Type System Conformance Test Results

Partial

Incorrectly rejects valid index of named tuple instance when using a negative index.

Does not report out-of-range index access with named tuple instance.

Does not reject attempt to overwrite named tuple entry by name.

Does not reject attempt to delete named tuple entry by name.

+Enumerations +
     enums_behaviorsPassPass
Partial

Does not enforce that Enum classes are implicitly final.

Partial

Does not enforce that Enum classes are implicitly final.

     enums_definitionPassPass
Partial

Does not support custom Enum classes based on EnumType metaclass.

Does not support some functional forms for Enum class definitions (optional).

Pass*

Does not support some functional forms for Enum class definitions (optional).

     enums_expansion
Partial

Improperly applies narrowing to Flag subclass.

Partial

Applies type narrowing incorrectly for `a is E` pattern where `E` is an enum member.

Pass*

Does not perform type narrowing based on enum literal expansion (optional).

Partial

Improperly applies narrowing to Flag subclass.

     enums_member_names
Pass*

Does not support special-cased handling of member name literal types in some cases (optional).

Pass
Pass*

Does not support special-cased handling of member name literal types (optional).

Pass
     enums_member_values
Partial

Does not enforce declared type of `_value_`.

Does not enforce assigned tuple types for enum members (optional).

Pass
Partial

Does not enforce declared type of `_value_`.

Does not enforce assigned tuple types for enum members (optional).

Does not evaluate literal types for enum member values (optional).

Does not evaluate literal types for auto values (optional).

Partial

Does not enforce declared type of `_value_`.

Does not correctly enforce assigned tuple types for enum members (optional).

Does not evaluate literal types for enum member values (optional).

Does not evaluate literal types for auto values (optional).

     enums_members
Partial

Does not treat attribute with annotation and no assignment as non-member.

Does not reject use of annotation with enum member.

Does not treat callables as non-members.

Does not honor `enum.nonmember` to define non-member attribute.

Does not honor `enum.member` as method decorator.

Does not properly handle aliased enum members.

Does not support `_ignore_` mechanism (optional).

Partial

Does not reject use of annotation with enum member.

Does not treat annotated attributes as non-members in stub.

Does not support `_ignore_` mechanism (optional).

Partial

Does not reject use of annotation with enum member.

Does not treat callables as non-members.

Does not treat annotated attributes as non-members.

Does not honor `enum.nonmember` to define non-member attribute.

Does not honor `enum.member` as method decorator.

Does not properly handle aliased enum members.

Rejects use of `_ignore_`.

Does not support `_ignore_` mechanism (optional).

Partial

Does not reject use of annotation with enum member.

Does not support `enum.member` and `enum.nonmember`.

Does not support `_ignore_` mechanism (optional).

Type narrowing
     narrowing_typeguard
- - + @@ -932,7 +932,7 @@

Python Type System Conformance Test Results

- + From 0105dc2bdf09214a5ad915b0124829e8abd66d48 Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Fri, 7 Jun 2024 16:55:25 -0600 Subject: [PATCH 011/308] Conformance tests: Fix manual scoring discrepancy for pyre (#1770) Pyre infers "Literal[1]" instead of "int", which seems legal. Change the test to get an int from a function parameter instead, so that all type checkers are aligned. Part of #1692. --- .../mypy/generics_paramspec_semantics.toml | 14 +++++++------- conformance/results/mypy/version.toml | 2 +- .../pyre/generics_paramspec_semantics.toml | 16 +++++++--------- conformance/results/pyre/version.toml | 2 +- .../pyright/generics_paramspec_semantics.toml | 12 ++++++------ conformance/results/pyright/version.toml | 2 +- .../pytype/generics_paramspec_semantics.toml | 12 ++++++------ conformance/results/pytype/version.toml | 2 +- conformance/results/results.html | 8 ++++---- .../tests/generics_paramspec_semantics.py | 9 +++++---- 10 files changed, 39 insertions(+), 40 deletions(-) diff --git a/conformance/results/mypy/generics_paramspec_semantics.toml b/conformance/results/mypy/generics_paramspec_semantics.toml index e4f5aadaf..eb5b744e6 100644 --- a/conformance/results/mypy/generics_paramspec_semantics.toml +++ b/conformance/results/mypy/generics_paramspec_semantics.toml @@ -4,13 +4,13 @@ generics_paramspec_semantics.py:26: error: Unexpected keyword argument "a" [cal generics_paramspec_semantics.py:26: error: Unexpected keyword argument "b" [call-arg] generics_paramspec_semantics.py:27: error: Argument 2 has incompatible type "str"; expected "bool" [arg-type] generics_paramspec_semantics.py:61: error: Argument 2 to "func1" has incompatible type "Callable[[NamedArg(int, 'y')], int]"; expected "Callable[[NamedArg(int, 'x')], int]" [arg-type] -generics_paramspec_semantics.py:97: error: Argument 1 has incompatible type "int"; expected "str" [arg-type] -generics_paramspec_semantics.py:107: error: Argument 1 has incompatible type "int"; expected "bool" [arg-type] -generics_paramspec_semantics.py:119: error: Argument 1 has incompatible type "int"; expected "str" [arg-type] -generics_paramspec_semantics.py:126: error: Argument 1 to "expects_int_first" has incompatible type "Callable[[str], int]"; expected "Callable[[int], int]" [arg-type] -generics_paramspec_semantics.py:126: note: This is likely because "one" has named arguments: "x". Consider marking them positional-only -generics_paramspec_semantics.py:131: error: Argument 1 to "expects_int_first" has incompatible type "Callable[[NamedArg(int, 'x')], int]"; expected "Callable[[int, NamedArg(int, 'x')], int]" [arg-type] -generics_paramspec_semantics.py:136: error: Argument 1 to "expects_int_first" has incompatible type "Callable[[KwArg(int)], int]"; expected "Callable[[int, KwArg(int)], int]" [arg-type] +generics_paramspec_semantics.py:98: error: Argument 1 has incompatible type "int"; expected "str" [arg-type] +generics_paramspec_semantics.py:108: error: Argument 1 has incompatible type "int"; expected "bool" [arg-type] +generics_paramspec_semantics.py:120: error: Argument 1 has incompatible type "int"; expected "str" [arg-type] +generics_paramspec_semantics.py:127: error: Argument 1 to "expects_int_first" has incompatible type "Callable[[str], int]"; expected "Callable[[int], int]" [arg-type] +generics_paramspec_semantics.py:127: note: This is likely because "one" has named arguments: "x". Consider marking them positional-only +generics_paramspec_semantics.py:132: error: Argument 1 to "expects_int_first" has incompatible type "Callable[[NamedArg(int, 'x')], int]"; expected "Callable[[int, NamedArg(int, 'x')], int]" [arg-type] +generics_paramspec_semantics.py:137: error: Argument 1 to "expects_int_first" has incompatible type "Callable[[KwArg(int)], int]"; expected "Callable[[int, KwArg(int)], int]" [arg-type] """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/mypy/version.toml b/conformance/results/mypy/version.toml index dc9b55ed5..e0a45142b 100644 --- a/conformance/results/mypy/version.toml +++ b/conformance/results/mypy/version.toml @@ -1,2 +1,2 @@ version = "mypy 1.10.0" -test_duration = 1.5 +test_duration = 1.1 diff --git a/conformance/results/pyre/generics_paramspec_semantics.toml b/conformance/results/pyre/generics_paramspec_semantics.toml index df19bc773..a3a645b67 100644 --- a/conformance/results/pyre/generics_paramspec_semantics.toml +++ b/conformance/results/pyre/generics_paramspec_semantics.toml @@ -4,15 +4,13 @@ generics_paramspec_semantics.py:26:0 Unexpected keyword [28]: Unexpected keyword generics_paramspec_semantics.py:27:8 Incompatible parameter type [6]: In anonymous call, for 2nd positional argument, expected `bool` but got `str`. generics_paramspec_semantics.py:46:16 Incompatible parameter type [6]: In call `func1`, for 2nd positional argument, expected `typing.Callable[generics_paramspec_semantics.P, int]` but got `typing.Callable(y_x)[[Named(y, int), Named(x, str)], int]`. generics_paramspec_semantics.py:61:22 Incompatible parameter type [6]: In call `func1`, for 2nd positional argument, expected `typing.Callable[generics_paramspec_semantics.P, int]` but got `typing.Callable(keyword_only_y)[[KeywordOnly(y, int)], int]`. -generics_paramspec_semantics.py:81:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Y[int, [int]]` but got `Y[typing_extensions.Literal[1], [int]]`. -generics_paramspec_semantics.py:97:3 Incompatible parameter type [6]: In anonymous call, for 1st positional argument, expected `str` but got `int`. -generics_paramspec_semantics.py:107:3 Incompatible parameter type [6]: In anonymous call, for 1st positional argument, expected `bool` but got `int`. -generics_paramspec_semantics.py:119:3 Incompatible parameter type [6]: In anonymous call, for 1st positional argument, expected `str` but got `int`. -generics_paramspec_semantics.py:126:1 Invalid decoration [56]: Pyre doesn't yet support decorators with ParamSpec applied to generic functions Please add # pyre-ignore[56] to `generics_paramspec_semantics.expects_int_first`. -generics_paramspec_semantics.py:131:1 Invalid decoration [56]: Pyre doesn't yet support decorators with ParamSpec applied to generic functions Please add # pyre-ignore[56] to `generics_paramspec_semantics.expects_int_first`. -generics_paramspec_semantics.py:136:1 Invalid decoration [56]: Pyre doesn't yet support decorators with ParamSpec applied to generic functions Please add # pyre-ignore[56] to `generics_paramspec_semantics.expects_int_first`. +generics_paramspec_semantics.py:98:3 Incompatible parameter type [6]: In anonymous call, for 1st positional argument, expected `str` but got `int`. +generics_paramspec_semantics.py:108:3 Incompatible parameter type [6]: In anonymous call, for 1st positional argument, expected `bool` but got `int`. +generics_paramspec_semantics.py:120:3 Incompatible parameter type [6]: In anonymous call, for 1st positional argument, expected `str` but got `int`. +generics_paramspec_semantics.py:127:1 Invalid decoration [56]: Pyre doesn't yet support decorators with ParamSpec applied to generic functions Please add # pyre-ignore[56] to `generics_paramspec_semantics.expects_int_first`. +generics_paramspec_semantics.py:132:1 Invalid decoration [56]: Pyre doesn't yet support decorators with ParamSpec applied to generic functions Please add # pyre-ignore[56] to `generics_paramspec_semantics.expects_int_first`. +generics_paramspec_semantics.py:137:1 Invalid decoration [56]: Pyre doesn't yet support decorators with ParamSpec applied to generic functions Please add # pyre-ignore[56] to `generics_paramspec_semantics.expects_int_first`. """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 81: Unexpected errors ['generics_paramspec_semantics.py:81:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Y[int, [int]]` but got `Y[typing_extensions.Literal[1], [int]]`.'] """ diff --git a/conformance/results/pyre/version.toml b/conformance/results/pyre/version.toml index 4687d8542..8156a667e 100644 --- a/conformance/results/pyre/version.toml +++ b/conformance/results/pyre/version.toml @@ -1,2 +1,2 @@ version = "pyre 0.9.21" -test_duration = 3.6 +test_duration = 1.7 diff --git a/conformance/results/pyright/generics_paramspec_semantics.toml b/conformance/results/pyright/generics_paramspec_semantics.toml index 7573ed90b..df1e43dc2 100644 --- a/conformance/results/pyright/generics_paramspec_semantics.toml +++ b/conformance/results/pyright/generics_paramspec_semantics.toml @@ -14,20 +14,20 @@ generics_paramspec_semantics.py:61:23 - error: Argument of type "(*, y: int) ->   Type "(*, y: int) -> int" is incompatible with type "(*, x: int) -> int"     Extra parameter "y"     Missing keyword parameter "x" (reportArgumentType) -generics_paramspec_semantics.py:97:4 - error: Argument of type "Literal[1]" cannot be assigned to parameter of type "str" +generics_paramspec_semantics.py:98:4 - error: Argument of type "Literal[1]" cannot be assigned to parameter of type "str"   "Literal[1]" is incompatible with "str" (reportArgumentType) -generics_paramspec_semantics.py:107:4 - error: Argument of type "Literal[1]" cannot be assigned to parameter "args" of type "bool" +generics_paramspec_semantics.py:108:4 - error: Argument of type "Literal[1]" cannot be assigned to parameter "args" of type "bool"   "Literal[1]" is incompatible with "bool" (reportArgumentType) -generics_paramspec_semantics.py:119:4 - error: Argument of type "Literal[1]" cannot be assigned to parameter of type "str" +generics_paramspec_semantics.py:120:4 - error: Argument of type "Literal[1]" cannot be assigned to parameter of type "str"   "Literal[1]" is incompatible with "str" (reportArgumentType) -generics_paramspec_semantics.py:126:2 - error: Argument of type "(x: str) -> int" cannot be assigned to parameter "x" of type "(int, **P@expects_int_first) -> int" in function "expects_int_first" +generics_paramspec_semantics.py:127:2 - error: Argument of type "(x: str) -> int" cannot be assigned to parameter "x" of type "(int, **P@expects_int_first) -> int" in function "expects_int_first"   Type "(x: str) -> int" is incompatible with type "(int, **P@expects_int_first) -> int"     Parameter 1: type "int" is incompatible with type "str"       "int" is incompatible with "str" (reportArgumentType) -generics_paramspec_semantics.py:131:2 - error: Argument of type "(*, x: int) -> int" cannot be assigned to parameter "x" of type "(int, **P@expects_int_first) -> int" in function "expects_int_first" +generics_paramspec_semantics.py:132:2 - error: Argument of type "(*, x: int) -> int" cannot be assigned to parameter "x" of type "(int, **P@expects_int_first) -> int" in function "expects_int_first"   Type "(*, x: int) -> int" is incompatible with type "(int, **P@expects_int_first) -> int"     Function accepts too many positional parameters; expected 0 but received 1 (reportArgumentType) -generics_paramspec_semantics.py:136:2 - error: Argument of type "(**kwargs: int) -> int" cannot be assigned to parameter "x" of type "(int, **P@expects_int_first) -> int" in function "expects_int_first" +generics_paramspec_semantics.py:137:2 - error: Argument of type "(**kwargs: int) -> int" cannot be assigned to parameter "x" of type "(int, **P@expects_int_first) -> int" in function "expects_int_first"   Type "(**kwargs: int) -> int" is incompatible with type "(int, **P@expects_int_first) -> int"     Function accepts too many positional parameters; expected 0 but received 1 (reportArgumentType) """ diff --git a/conformance/results/pyright/version.toml b/conformance/results/pyright/version.toml index d79a176b0..7fe2e2e7b 100644 --- a/conformance/results/pyright/version.toml +++ b/conformance/results/pyright/version.toml @@ -1,2 +1,2 @@ version = "pyright 1.1.366" -test_duration = 1.4 +test_duration = 1.3 diff --git a/conformance/results/pytype/generics_paramspec_semantics.toml b/conformance/results/pytype/generics_paramspec_semantics.toml index 51f74c3c0..d9d0175b6 100644 --- a/conformance/results/pytype/generics_paramspec_semantics.toml +++ b/conformance/results/pytype/generics_paramspec_semantics.toml @@ -10,10 +10,10 @@ errors_diff = """ Line 26: Expected 1 errors Line 27: Expected 1 errors Line 61: Expected 1 errors -Line 97: Expected 1 errors -Line 107: Expected 1 errors -Line 119: Expected 1 errors -Line 126: Expected 1 errors -Line 131: Expected 1 errors -Line 136: Expected 1 errors +Line 98: Expected 1 errors +Line 108: Expected 1 errors +Line 120: Expected 1 errors +Line 127: Expected 1 errors +Line 132: Expected 1 errors +Line 137: Expected 1 errors """ diff --git a/conformance/results/pytype/version.toml b/conformance/results/pytype/version.toml index 9c27bf79d..46eb986e7 100644 --- a/conformance/results/pytype/version.toml +++ b/conformance/results/pytype/version.toml @@ -1,2 +1,2 @@ version = "pytype 2024.04.11" -test_duration = 32.9 +test_duration = 27.9 diff --git a/conformance/results/results.html b/conformance/results/results.html index 56739d7a9..e0377383b 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -159,16 +159,16 @@

Python Type System Conformance Test Results

 
mypy 1.10.0
-
0.9sec
+
1.5sec
pyright 1.1.365
+
pyright 1.1.366
1.4sec
pyre 0.9.21
-
2.6sec
+
3.6sec
pytype 2024.04.11
-
29.9sec
+
32.9sec
@@ -914,7 +914,7 @@

Python Type System Conformance Test Results

     enums_expansion
Partial

Improperly applies narrowing to Flag subclass.

Partial

Applies type narrowing incorrectly for `a is E` pattern where `E` is an enum member.

Pass
Pass*

Does not perform type narrowing based on enum literal expansion (optional).

Partial

Improperly applies narrowing to Flag subclass.

     enums_members
Partial

Does not treat attribute with annotation and no assignment as non-member.

Does not reject use of annotation with enum member.

Does not treat callables as non-members.

Does not honor `enum.nonmember` to define non-member attribute.

Does not honor `enum.member` as method decorator.

Does not properly handle aliased enum members.

Does not support `_ignore_` mechanism (optional).

Partial

Does not reject use of annotation with enum member.

Does not treat annotated attributes as non-members in stub.

Does not support `_ignore_` mechanism (optional).

Pass*

Does not support `_ignore_` mechanism (optional).

Partial

Does not reject use of annotation with enum member.

Does not treat callables as non-members.

Does not treat annotated attributes as non-members.

Does not honor `enum.nonmember` to define non-member attribute.

Does not honor `enum.member` as method decorator.

Does not properly handle aliased enum members.

Rejects use of `_ignore_`.

Does not support `_ignore_` mechanism (optional).

Partial

Does not reject use of annotation with enum member.

Does not support `enum.member` and `enum.nonmember`.

Does not support `_ignore_` mechanism (optional).

- + From ab3e82d389a6ab5478203932f4cd74ff16ff6c8f Mon Sep 17 00:00:00 2001 From: Rebecca Chen Date: Tue, 11 Jun 2024 20:32:50 -0400 Subject: [PATCH 013/308] Adds links to Python Discourse and ruff to typing.readthedocs.io (#1774) I noticed that the "Discussions and Support" section still linked to the typing-sig mailing list. While touching this page, I figured I might as well add ruff, which is used by typeshed, to the list of linters, and make the items in each list grammatically consistent. --- docs/index.rst | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/docs/index.rst b/docs/index.rst index 84f0a71ec..bad1f3dfa 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -54,7 +54,8 @@ Discussions and Support * `User help forum `_ * `User chat on Gitter `_ -* `Developer mailing list `_ +* `Developer forum `_ +* `Developer mailing list (archived) `_ Typing-related Tools ==================== @@ -64,12 +65,12 @@ Type Checkers * `mypy `_, the reference implementation for type checkers. -* `pyre `_, written in OCaml and optimized for - performance. +* `pyre `_, a type checker written in OCaml and + optimized for performance. * `pyright `_, a type checker that emphasizes speed. -* `pytype `_, checks and infers types for - unannotated code. +* `pytype `_, a type checker that + checks and infers types for unannotated code. Development Environments ------------------------ @@ -89,13 +90,19 @@ Linters and Formatters * `flake8-pyi `_, a plugin for the `flake8 `_ linter that adds support for type stubs. +* `ruff `_, a linter built for speed, with support for + most of the ``flake8-pyi`` rules. Type-Hint and Stub Integration ------------------------------ -* `autotyping `_, a tool which infers simple types from their context and inserts them as inline type-hints. -* `merge_pyi `_, integrates .pyi signatures as inline type-hints in Python source code. - This is a thin wrapper around ``ApplyTypeAnnotationsVisitor`` from `libCST `_. +* `autotyping `_, a tool which + infers simple types from their context and inserts them as inline type-hints. +* `merge-pyi + `_, + a thin wrapper around ``ApplyTypeAnnotationsVisitor`` from + `libCST `_ that integrates .pyi + signatures as inline type-hints in Python source code. Typing PEPs =========== From 21d67ca9d544de8e1e1257360de5f29d59a848e2 Mon Sep 17 00:00:00 2001 From: AurelienNober Date: Sat, 15 Jun 2024 06:15:20 +0200 Subject: [PATCH 014/308] doc fix: generator should yield int, not None (#1776) --- docs/spec/annotations.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/spec/annotations.rst b/docs/spec/annotations.rst index 0b0ce6416..ce675a1f5 100644 --- a/docs/spec/annotations.rst +++ b/docs/spec/annotations.rst @@ -310,7 +310,7 @@ the generic type ``Generator[yield_type, send_type, return_type]`` provided by ``typing.py`` module:: def echo_round() -> Generator[int, float, str]: - res = yield + res = yield 0 while res: res = yield round(res) return 'OK' From 9642a5a7fc947f97f5545b689fb138bb1e2ecdeb Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Tue, 18 Jun 2024 14:49:37 +0100 Subject: [PATCH 015/308] Tweak the typing spec's module resolution to more closely emulate Python's runtime semantics (#1772) --- docs/spec/distributing.rst | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/docs/spec/distributing.rst b/docs/spec/distributing.rst index afa5953ca..9bcd3a6f8 100644 --- a/docs/spec/distributing.rst +++ b/docs/spec/distributing.rst @@ -199,8 +199,9 @@ Partial Stub Packages Many stub packages will only have part of the type interface for libraries completed, especially initially. For the benefit of type checking and code editors, packages can be "partial". This means modules not found in the stub -package SHOULD be searched for in part four of the module resolution -order below, namely :term:`inline` packages. +package SHOULD be searched for in parts five and six of the module resolution +order below, namely :term:`inline` packages and any third-party stubs the type +checker chooses to vendor. Type checkers should merge the stub package and runtime package directories. This can be thought of as the functional equivalent of copying the @@ -235,19 +236,27 @@ resolve modules containing type information: 2. User code - the files the type checker is running on. -3. :term:`Stub ` packages - these packages SHOULD supersede any installed inline +3. Typeshed stubs for the standard library. These will usually be vendored by + type checkers, but type checkers SHOULD provide an option for users to + provide a path to a directory containing a custom or modified version of + typeshed; if this option is provided, type checkers SHOULD use this as the + canonical source for standard-library types in this step. + +4. :term:`Stub ` packages - these packages SHOULD supersede any installed inline package. They can be found in directories named ``foopkg-stubs`` for package ``foopkg``. -4. Packages with a ``py.typed`` marker file - if there is nothing overriding +5. Packages with a ``py.typed`` marker file - if there is nothing overriding the installed package, *and* it opts into type checking, the types bundled with the package SHOULD be used (be they in ``.pyi`` type stub files or inline in ``.py`` files). -5. Typeshed - only for modules in the standard library. +6. If the type checker chooses to additionally vendor any third-party stubs + (from typeshed or elsewhere), these SHOULD come last in the module + resolution order. If typecheckers identify a stub-only namespace package without the desired module -in step 3, they should continue to step 4/5. Typecheckers should identify namespace packages +in step 4, they should continue to step 5/6. Typecheckers should identify namespace packages by the absence of ``__init__.pyi``. This allows different subpackages to independently opt for inline vs stub-only. From b2558aa914f762c20b9259eb287fa1206737e6bb Mon Sep 17 00:00:00 2001 From: Bruce Eckel Date: Fri, 21 Jun 2024 09:34:37 -0600 Subject: [PATCH 016/308] Fix typo in `literal.rst` (#1784) --- docs/spec/literal.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/spec/literal.rst b/docs/spec/literal.rst index d0ca618c6..afbcd6fb6 100644 --- a/docs/spec/literal.rst +++ b/docs/spec/literal.rst @@ -329,7 +329,7 @@ Literals can be used to "intelligently index" into structured types like tuples, NamedTuple, and classes. (Note: this is not an exhaustive list). For example, type checkers should infer the correct value type when -indexing into a tuple using an int key that corresponds a valid index:: +indexing into a tuple using an int key that corresponds to a valid index:: a: Literal[0] = 0 b: Literal[5] = 5 From a6eeccf4870f95357c7cc37332e350d147966b35 Mon Sep 17 00:00:00 2001 From: Carl Meyer Date: Mon, 24 Jun 2024 07:30:17 -0600 Subject: [PATCH 017/308] new "type system concepts" section (#1743) Co-authored-by: Jelle Zijlstra Co-authored-by: Alex Waygood --- docs/spec/annotations.rst | 13 +- docs/spec/callables.rst | 162 +++++++-------- docs/spec/class-compat.rst | 7 +- docs/spec/concepts.rst | 385 +++++++++++++++++++++++++++++++++++- docs/spec/constructors.rst | 15 +- docs/spec/directives.rst | 6 - docs/spec/enums.rst | 2 +- docs/spec/generics.rst | 81 ++++---- docs/spec/glossary.rst | 120 +++++++++++ docs/spec/literal.rst | 47 +++-- docs/spec/namedtuples.rst | 9 +- docs/spec/narrowing.rst | 7 +- docs/spec/protocol.rst | 130 ++++++------ docs/spec/qualifiers.rst | 2 +- docs/spec/special-types.rst | 19 +- docs/spec/tuples.rst | 13 +- docs/spec/typeddict.rst | 157 ++++++++------- 17 files changed, 835 insertions(+), 340 deletions(-) diff --git a/docs/spec/annotations.rst b/docs/spec/annotations.rst index ce675a1f5..3e56e5ce0 100644 --- a/docs/spec/annotations.rst +++ b/docs/spec/annotations.rst @@ -16,13 +16,18 @@ hinting is used by filling function annotation slots with classes:: This states that the expected type of the ``name`` argument is ``str``. Analogically, the expected return type is ``str``. -Expressions whose type is a subtype of a specific argument type are -also accepted for that argument. +Expressions whose type is :term:`assignable` to a specific argument type are +also accepted for that argument. Similarly, an expression whose type is +assignable to the annotated return type can be returned from the function. .. _`missing-annotations`: -Any function without annotations should be treated as having the most -general type possible, or ignored, by any type checker. +Any function without annotations can be treated as having :ref:`Any` +annotations on all arguments and the return type. Type checkers may also +optionally infer more precise types for missing annotations. + +Type checkers may choose to entirely ignore (not type check) the bodies of +functions with no annotations, but this behavior is not required. It is recommended but not required that checked functions have annotations for all arguments and the return type. For a checked diff --git a/docs/spec/callables.rst b/docs/spec/callables.rst index 3ec63bfa6..56b66bc16 100644 --- a/docs/spec/callables.rst +++ b/docs/spec/callables.rst @@ -71,8 +71,8 @@ may be given as an ellipsis. For example:: def func(x: AnyStr, y: AnyStr = ...) -> AnyStr: ... If a non-ellipsis default value is present and its type can be statically -evaluated, a type checker should verify that this type is compatible with the -declared parameter's type:: +evaluated, a type checker should verify that this type is :term:`assignable` to +the declared parameter's type:: def func(x: int = 0): ... # OK def func(x: int | None = None): ... # OK @@ -201,17 +201,16 @@ caller, then an error must be reported by type checkers. Assignment ^^^^^^^^^^ -Assignments of a function typed with ``**kwargs: Unpack[Movie]`` and -another callable type should pass type checking only if they are compatible. -This can happen for the scenarios described below. +Assignments of a function typed with ``**kwargs: Unpack[Movie]`` and another +callable type should pass type checking only for the scenarios described below. Source and destination contain ``**kwargs`` """"""""""""""""""""""""""""""""""""""""""" Both destination and source functions have a ``**kwargs: Unpack[TypedDict]`` -parameter and the destination function's ``TypedDict`` is assignable to the -source function's ``TypedDict`` and the rest of the parameters are -compatible:: +parameter and the destination function's ``TypedDict`` is :term:`assignable` to +the source function's ``TypedDict`` and the rest of the parameters are +assignable:: class Animal(TypedDict): name: str @@ -235,10 +234,10 @@ Source contains ``**kwargs`` and destination doesn't The destination callable doesn't contain ``**kwargs``, the source callable contains ``**kwargs: Unpack[TypedDict]`` and the destination function's keyword -arguments are assignable to the corresponding keys in source function's +arguments are :term:`assignable` to the corresponding keys in source function's ``TypedDict``. Moreover, not required keys should correspond to optional function arguments, whereas required keys should correspond to required -function arguments. Again, the rest of the parameters have to be compatible. +function arguments. Again, the rest of the parameters have to be assignable. Continuing the previous example:: class Example(TypedDict): @@ -252,7 +251,7 @@ Continuing the previous example:: dest = src # OK! It is worth pointing out that the destination function's parameters that are to -be compatible with the keys and values from the ``TypedDict`` must be keyword +be assignable to the keys and values from the ``TypedDict`` must be keyword only:: def dest(dog: Dog, string: str, number: int = ...): ... @@ -282,8 +281,8 @@ unpacked in the destination callable invocation:: dest = src # WRONG! dest(**animal) # Fails at runtime. -Similar situation can happen even without inheritance as compatibility -between ``TypedDict``\s is based on structural subtyping. +A similar situation can happen even without inheritance as :term:`assignability +` between ``TypedDict``\s is :term:`structural`. Source contains untyped ``**kwargs`` """""""""""""""""""""""""""""""""""" @@ -301,8 +300,8 @@ Source contains traditionally typed ``**kwargs: T`` The destination callable contains ``**kwargs: Unpack[TypedDict]``, the source callable contains traditionally typed ``**kwargs: T`` and each of the -destination function ``TypedDict``'s fields is assignable to a variable of -type ``T``:: +destination function ``TypedDict``'s fields is :term:`assignable` to a variable +of type ``T``:: class Vehicle: ... @@ -423,11 +422,9 @@ the section on `Callback protocols`_. Meaning of ``...`` in ``Callable`` ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -The ``Callable`` special form supports the use of ``...`` in place of the -list of parameter types. This indicates that the type is consistent with -any input signature. Just as ``Any`` means "any conceivable type that could be -compatible", ``(...)`` means "any conceivable set of parameters that could be -compatible":: +The ``Callable`` special form supports the use of ``...`` in place of the list +of parameter types. This is a :term:`gradual form` indicating that the type is +:term:`consistent` with any input signature:: cb1: Callable[..., str] cb1 = lambda x: str(x) # OK @@ -437,7 +434,7 @@ compatible":: A ``...`` can also be used with ``Concatenate``. In this case, the parameters prior to the ``...`` are required to be present in the input signature and -be compatible in kind and type, but any additional parameters are permitted:: +be assignable, but any additional parameters are permitted:: cb3: Callable[Concatenate[int, ...], str] cb3 = lambda x: str(x) # OK @@ -475,7 +472,7 @@ and are retained as part of the signature:: pass class B(A): - # This override is OK because it is consistent with the parent's method. + # This override is OK because it is assignable to the parent's method. def method(self, a: float, /, b: int, *, k: str, m: str) -> None: pass @@ -490,7 +487,7 @@ For example:: f: Callback[...] = cb # OK If ``...`` is used with signature concatenation, the ``...`` portion continues -to mean "any conceivable set of parameters that could be compatible":: +to be :term:`consistent` with any input parameters:: type CallbackWithInt[**P] = Callable[Concatenate[int, P], str] type CallbackWithStr[**P] = Callable[Concatenate[str, P], str] @@ -522,21 +519,21 @@ and overloads. They can be defined as protocols with a ``__call__`` member:: ... comb: Combiner = good_cb # OK - comb = bad_cb # Error! Argument 2 has incompatible type because of + comb = bad_cb # Error! Argument 2 is not assignable because of # different parameter name and kind in the callback Callback protocols and ``Callable[...]`` types can generally be used interchangeably. -Subtyping rules for callables ------------------------------ +Assignability rules for callables +--------------------------------- -A callable type ``A`` is a subtype of callable type ``B`` if the return type -of ``A`` is a subtype of the return type of ``B`` and the input signature -of ``A`` accepts all possible combinations of arguments that the input -signature of ``B`` accepts. All of the specific subtyping rules described below -derive from this general rule. +A callable type ``B`` is :term:`assignable` to a callable type ``A`` if the +return type of ``B`` is assignable to the return type of ``A`` and the input +signature of ``B`` accepts all possible combinations of arguments that the +input signature of ``A`` accepts. All of the specific assignability rules +described below derive from this general rule. Parameter types @@ -544,9 +541,9 @@ Parameter types Callable types are covariant with respect to their return types but contravariant with respect to their parameter types. This means a callable -``A`` is a subtype of callable ``B`` if the types of the parameters of -``B`` are subtypes of the parameters of ``A``. For example, -``(x: float) -> int`` is a subtype of ``(x: int) -> float``:: +``B`` is :term:`assignable` to callable ``A`` if the types of the parameters of +``A`` are assignable to the parameters of ``B``. For example, ``(x: float) -> +int`` is assignable to ``(x: int) -> float``:: def func(cb: Callable[[float], int]): f1: Callable[[int], float] = cb # OK @@ -555,11 +552,11 @@ contravariant with respect to their parameter types. This means a callable Parameter kinds ^^^^^^^^^^^^^^^ -Callable ``A`` is a subtype of callable ``B`` if all keyword-only parameters -in ``B`` are present in ``A`` as either keyword-only parameters or standard -(positional or keyword) parameters. For example, ``(a: int) -> None`` is a -subtype of ``(*, a: int) -> None``, but the converse is not true. The order -of keyword-only parameters is ignored for purposes of subtyping:: +Callable ``B`` is :term:`assignable` to callable ``A`` only if all keyword-only +parameters in ``A`` are present in ``B`` as either keyword-only parameters or +standard (positional or keyword) parameters. For example, ``(a: int) -> None`` +is assignable to ``(*, a: int) -> None``, but the converse is not true. The +order of keyword-only parameters is ignored for purposes of assignability:: class KwOnly(Protocol): def __call__(self, *, b: int, a: int) -> None: ... @@ -571,10 +568,10 @@ of keyword-only parameters is ignored for purposes of subtyping:: f1: KwOnly = standard # OK f2: Standard = kw_only # Error -Likewise, callable ``A`` is a subtype of callable ``B`` if all positional-only -parameters in ``B`` are present in ``A`` as either positional-only parameters -or standard (positional or keyword) parameters. The names of positional-only -parameters are ignored for purposes of subtyping:: +Likewise, callable ``B`` is assignable to callable ``A`` only if all +positional-only parameters in ``A`` are present in ``B`` as either +positional-only parameters or standard (positional or keyword) parameters. The +names of positional-only parameters are ignored for purposes of assignability:: class PosOnly(Protocol): def __call__(self, not_a: int, /) -> None: ... @@ -590,9 +587,10 @@ parameters are ignored for purposes of subtyping:: ``*args`` parameters ^^^^^^^^^^^^^^^^^^^^ -If a callable ``B`` has a signature with a ``*args`` parameter, callable ``A`` -must also have a ``*args`` parameter to be a subtype of ``B``, and the type of -``B``'s ``*args`` parameter must be a subtype of ``A``'s ``*args`` parameter:: +If a callable ``A`` has a signature with a ``*args`` parameter, callable ``B`` +must also have a ``*args`` parameter to be :term:`assignable` to ``A``, and the +type of ``A``'s ``*args`` parameter must be assignable to ``B``'s ``*args`` +parameter:: class NoArgs(Protocol): def __call__(self) -> None: ... @@ -611,12 +609,12 @@ must also have a ``*args`` parameter to be a subtype of ``B``, and the type of f4: IntArgs = float_args # OK f5: FloatArgs = no_args # Error: missing *args parameter - f6: FloatArgs = int_args # Error: float is not subtype of int + f6: FloatArgs = int_args # Error: float is not assignable to int -If a callable ``B`` has a signature with one or more positional-only parameters, -a callable ``A`` is a subtype of ``B`` if ``A`` has an ``*args`` parameter whose -type is a supertype of the types of any otherwise-unmatched positional-only -parameters in ``B``:: +If a callable ``A`` has a signature with one or more positional-only +parameters, a callable ``B`` is assignable to ``A`` only if ``B`` has an +``*args`` parameter whose type is assignable from the types of any +otherwise-unmatched positional-only parameters in ``A``:: class PosOnly(Protocol): def __call__(self, a: int, b: str, /) -> None: ... @@ -634,15 +632,15 @@ parameters in ``B``:: def __call__(self, a: int, b: str) -> None: ... def func(int_args: IntArgs, int_str_args: IntStrArgs, str_args: StrArgs): - f1: PosOnly = int_args # Error: str is not subtype of int + f1: PosOnly = int_args # Error: str is not assignable to int f2: PosOnly = int_str_args # OK f3: PosOnly = str_args # OK - f4: IntStrArgs = str_args # Error: int | str is not subtype of str - f5: IntStrArgs = int_args # Error: int | str is not subtype of int + f4: IntStrArgs = str_args # Error: int | str is not assignable to str + f5: IntStrArgs = int_args # Error: int | str is not assignable to int f6: StrArgs = int_str_args # OK - f7: StrArgs = int_args # Error: str is not subtype of int + f7: StrArgs = int_args # Error: str is not assignable to int f8: IntArgs = int_str_args # OK - f9: IntArgs = str_args # Error: int is not subtype of str + f9: IntArgs = str_args # Error: int is not assignable to str f10: Standard = int_str_args # Error: keyword parameters a and b missing f11: Standard = str_args # Error: keyword parameter b missing @@ -650,10 +648,10 @@ parameters in ``B``:: ``**kwargs`` parameters ^^^^^^^^^^^^^^^^^^^^^^^ -If a callable ``B`` has a signature with a ``**kwargs`` parameter (without -an unpacked ``TypedDict`` type annotation), callable ``A`` must also have a -``**kwargs`` parameter to be a subtype of ``B``, and the type of -``B``'s ``**kwargs`` parameter must be a subtype of ``A``'s ``**kwargs`` +If a callable ``A`` has a signature with a ``**kwargs`` parameter (without an +unpacked ``TypedDict`` type annotation), callable ``B`` must also have a +``**kwargs`` parameter to be :term:`assignable` to ``A``, and the type of +``A``'s ``**kwargs`` parameter must be assignable to ``B``'s ``**kwargs`` parameter:: class NoKwargs(Protocol): @@ -673,12 +671,12 @@ parameter:: f4: IntKwargs = float_kwargs # OK f5: FloatKwargs = no_kwargs # Error: missing **kwargs parameter - f6: FloatKwargs = int_kwargs # Error: float is not subtype of int + f6: FloatKwargs = int_kwargs # Error: float is not assignable to int -If a callable ``B`` has a signature with one or more keyword-only parameters, -a callable ``A`` is a subtype of ``B`` if ``A`` has a ``**kwargs`` parameter -whose type is a supertype of the types of any otherwise-unmatched keyword-only -parameters in ``B``:: +If a callable ``A`` has a signature with one or more keyword-only parameters, +a callable ``B`` is assignable to ``A`` if ``B`` has a ``**kwargs`` parameter +whose type is assignable from the types of any otherwise-unmatched keyword-only +parameters in ``A``:: class KwOnly(Protocol): def __call__(self, *, a: int, b: str) -> None: ... @@ -696,20 +694,21 @@ parameters in ``B``:: def __call__(self, a: int, b: str) -> None: ... def func(int_kwargs: IntKwargs, int_str_kwargs: IntStrKwargs, str_kwargs: StrKwargs): - f1: KwOnly = int_kwargs # Error: str is not subtype of int + f1: KwOnly = int_kwargs # Error: str is not assignable to int f2: KwOnly = int_str_kwargs # OK f3: KwOnly = str_kwargs # OK - f4: IntStrKwargs = str_kwargs # Error: int | str is not subtype of str - f5: IntStrKwargs = int_kwargs # Error: int | str is not subtype of int + f4: IntStrKwargs = str_kwargs # Error: int | str is not assignable to str + f5: IntStrKwargs = int_kwargs # Error: int | str is not assignable to int f6: StrKwargs = int_str_kwargs # OK - f7: StrKwargs = int_kwargs # Error: str is not subtype of int + f7: StrKwargs = int_kwargs # Error: str is not assignable to int f8: IntKwargs = int_str_kwargs # OK - f9: IntKwargs = str_kwargs # Error: int is not subtype of str + f9: IntKwargs = str_kwargs # Error: int is not assignable to str f10: Standard = int_str_kwargs # Error: Does not accept positional arguments f11: Standard = str_kwargs # Error: Does not accept positional arguments -Subtyping relationships for callable signatures that contain a ``**kwargs`` -with an unpacked ``TypedDict`` are described in the section :ref:`above `. +Assignability rules for callable signatures that contain a ``**kwargs`` with an +unpacked ``TypedDict`` are described in the section :ref:`above +`. Signatures with ParamSpecs @@ -732,10 +731,10 @@ to a ``Callable`` parameterized by ``P``:: Default argument values ^^^^^^^^^^^^^^^^^^^^^^^ -If a callable ``A`` has a parameter ``x`` with a default argument value and -``B`` is the same as ``A`` except that ``x`` has no default argument, then -``A`` is a subtype of ``B``. ``A`` is also a subtype of ``C`` -if ``C`` is the same as ``A`` with parameter ``x`` removed:: +If a callable ``C`` has a parameter ``x`` with a default argument value and +``A`` is the same as ``C`` except that ``x`` has no default argument, then +``C`` is :term:`assignable` to ``A``. ``C`` is also assignable to ``A`` if +``A`` is the same as ``C`` with parameter ``x`` removed:: class DefaultArg(Protocol): def __call__(self, x: int = 0) -> None: ... @@ -754,9 +753,9 @@ if ``C`` is the same as ``A`` with parameter ``x`` removed:: Overloads ^^^^^^^^^ -If a callable ``A`` is overloaded with two or more signatures, it is a subtype -of callable ``B`` if *at least one* of the overloaded signatures in ``A`` is -a subtype of ``B``:: +If a callable ``B`` is overloaded with two or more signatures, it is +:term:`assignable` to callable ``A`` if *at least one* of the overloaded +signatures in ``B`` is assignable to ``A``:: class Overloaded(Protocol): @overload @@ -778,8 +777,9 @@ a subtype of ``B``:: f2: StrArg = overloaded # OK f3: FloatArg = overloaded # Error -If a callable ``B`` is overloaded with two or more signatures, callable ``A`` -is a subtype of ``B`` if ``A`` is a subtype of *all* of the signatures in ``B``:: +If a callable ``A`` is overloaded with two or more signatures, callable ``B`` +is assignable to ``A`` if ``B`` is assignable to *all* of the signatures in +``A``:: class Overloaded(Protocol): @overload diff --git a/docs/spec/class-compat.rst b/docs/spec/class-compat.rst index b49a20348..9f88d5640 100644 --- a/docs/spec/class-compat.rst +++ b/docs/spec/class-compat.rst @@ -1,6 +1,6 @@ .. _`class-compat`: -Class type compatibility +Class type assignability ======================== .. _`classvar`: @@ -97,8 +97,9 @@ annotated in ``__init__`` or other methods, rather than in the class:: (Originally specified by :pep:`698`.) When type checkers encounter a method decorated with ``@typing.override`` they -should treat it as a type error unless that method is overriding a compatible -method or attribute in some ancestor class. +should treat it as a type error unless that method is overriding a method or +attribute in some ancestor class, and the type of the overriding method is +:term:`assignable` to the type of the overridden method. .. code-block:: python diff --git a/docs/spec/concepts.rst b/docs/spec/concepts.rst index c6418c8b6..058a5794f 100644 --- a/docs/spec/concepts.rst +++ b/docs/spec/concepts.rst @@ -3,6 +3,339 @@ Type system concepts ==================== +Static, dynamic, and gradual typing +----------------------------------- + +A **statically typed** programming language runs a type checker before running +a program. The program is required to be well typed according to the language's +type system. The type system assigns a type to all expressions in the language +and verifies that their uses obey the typing rules. Normally, a program that is +not well typed (i.e., one that contains a type error) will not run. Java and +C++ are examples of statically typed object-oriented languages. + +A **dynamically typed** programming language does not run a type checker before +running a program. Instead, it checks the types of values before performing +operations on them at runtime. This is not to say that the language is +"untyped". Values at runtime have a type and their uses obey typing rules. Not +every operation will be checked, but certain primitive operations in the +language such as attribute access or arithmetic are. Python is a +dynamically typed language. + +**Gradual typing** is a way to combine static and dynamic typing. +Type-annotated Python allows opting in to static type checking at a fine level +of granularity, so that some type errors can be caught statically, without +running the program. Variables, parameters, and returns can optionally be given +static type annotations. Even within the type of a single data structure, +static type checking is optional and granular. For example, a dictionary can be +annotated to enable static checking of the key type but only have dynamic +runtime checking of the value type. + +A **gradual** type system is one in which a special "unknown" or "dynamic" type +is used to describe names or expressions whose types are not known statically. +In Python, this type is spelled :ref:`Any`. Because :ref:`!Any` indicates a +statically unknown type, the static type checker can't check type correctness +of operations on expressions typed as :ref:`!Any`. These operations are still +dynamically checked, via the Python runtime's usual dynamic checking. + +The Python type system also uses ``...`` within :ref:`Callable` types and +within ``tuple[Any, ...]`` (see :ref:`tuples`) to indicate a statically unknown +component of a type. The detailed rules for these usages are discussed in their +respective sections of the specification. Collectively, along with :ref:`Any`, +these are :term:`gradual forms `. + +This specification describes a gradual type system for Python. + +Fully static and gradual types +------------------------------ + +We will refer to types that do not contain a :term:`gradual form` as a sub-part +as **fully static types**. + +A **gradual type** can be a fully static type, :ref:`Any` itself, or a type +that contains a gradual form as a sub-part. All Python types are gradual types; +fully static types are a subset. + +Fully static types +~~~~~~~~~~~~~~~~~~ + +A fully static type denotes a set of potential runtime values. For instance, +the fully static type ``object`` is the set of all Python objects. The fully +static type ``bool`` is the set of values ``{ True, False }``. The fully static +type ``str`` is the set of all Python strings; more precisely, the set of all +Python objects whose runtime type (``__class__`` attribute) is either ``str`` +or a class that inherits directly or indirectly from ``str``. A :ref:`Protocol +` denotes the set of all objects which share a certain set of +attributes and/or methods. + +If an object ``v`` is a member of the set of objects denoted by a fully static +type ``T``, we can say that ``v`` is a "member of" the type ``T``, or ``v`` +"inhabits" ``T``. + +Gradual types +~~~~~~~~~~~~~ + +:ref:`Any` represents an unknown static type. It denotes some unknown set of +runtime values. + +This may appear similar to the fully static type ``object``, which represents +the set of all Python objects, but it is quite different. + +If an expression has the type ``object``, a static type checker should ensure +that operations on the expression are valid for all Python objects, or else +emit a static type error. This allows very few operations! For example, if +``x`` is typed as ``object``, ``x.foo`` should be a static type error because +not all Python objects have an attribute ``foo``. + +An expression typed as :ref:`Any`, on the other hand, should be assumed to have +_some_ specific static type, but _which_ static type is not known. A static +type checker should not emit static type errors on an expression or statement +if :ref:`!Any` might represent a static type which would avoid the error. (This +is defined more precisely below, in terms of materialization and +assignability.) + +Similarly, a type such as ``tuple[int, Any]`` (see :ref:`tuples`) or ``int | +Any`` (see :ref:`union-types`) does not represent a single set of Python +objects; rather, it represents a (bounded) range of possible sets of values. + +In the same way that :ref:`Any` does not represent "the set of all Python +objects" but rather "an unknown set of objects", ``tuple[int, Any]`` does not +represent "the set of all length-two tuples whose first element is an integer". +That is a fully static type, spelled ``tuple[int, object]``. By contrast, +``tuple[int, Any]`` represents some unknown set of tuple values; it might be +the set of all tuples of two integers, or the set of all tuples of an integer +and a string, or some other set of tuple values. + +In practice, this difference is seen (for example) in the fact that we can +assign an expression of type ``tuple[int, Any]`` to a target typed as +``tuple[int, int]``, whereas assigning ``tuple[int, object]`` to ``tuple[int, +int]`` is a static type error. (Again, we formalize this distinction in the +below definitions of materialization and assignability.) + +In the same way that the fully static type ``object`` is the upper bound for +the possible sets of values represented by :ref:`Any`, the fully static type +``tuple[int, object]`` is the upper bound for the possible sets of values +represented by ``tuple[int, Any]``. + +The gradual guarantee +~~~~~~~~~~~~~~~~~~~~~ + +:ref:`Any` allows gradually adding static types to a dynamically typed program. +In a fully dynamically typed program, a static checker assigns the type +:ref:`!Any` to all expressions, and should emit no errors. Inferring static +types or adding type annotations to the program (making the program more +statically typed) may result in static type errors, if the program is not +correct or if the static types aren't able to fully represent the runtime +types. Removing type annotations (making the program more dynamic) should not +result in additional static type errors. This is often referred to as the +**gradual guarantee**. + +In Python's type system, we don't take the gradual guarantee as a strict +requirement, but it's a useful guideline. + +Subtype, supertype, and type equivalence +---------------------------------------- + +A fully static type ``B`` is a **subtype** of another fully static type ``A`` +if and only if the set of values represented by ``B`` is a subset of the set of +values represented by ``A``. Because the subset relation on sets is transitive +and reflexive, the subtype relation is also transitive (if ``C`` is a subtype +of ``B`` and ``B`` is a subtype of ``A``, then ``C`` is a subtype of ``A``) and +reflexive (``A`` is always a subtype of ``A``). + +The **supertype** relation is the inverse of subtype: ``A`` is a supertype of +``B`` if and only if ``B`` is a subtype of ``A``; or equivalently, if and only +if the set of values represented by ``A`` is a superset of the values +represented by ``B``. The supertype relation is also transitive and reflexive. + +We also define an **equivalence** relation on fully static types: the types +``A`` and ``B`` are equivalent (or "the same type") if and only if ``A`` is a +subtype of ``B`` and ``B`` is a subtype of ``A``. This means that the set of +values represented by ``A`` is both a superset and a subset of the values +represented by ``B``, meaning ``A`` and ``B`` must represent the same set of +values. + +We may describe a type ``B`` as "narrower" than a type ``A`` (or as a "proper +subtype" of ``A``) if ``B`` is a subtype of ``A`` and ``B`` is not equivalent +to ``A``. In the same scenario we can describe the type ``A`` as "wider" than +``B``, or a "proper supertype" of ``B``. + +Nominal and structural types +---------------------------- + +For a type such as ``str`` (or any other class), which describes the set of +values whose ``__class__`` is ``str`` or a direct or indirect subclass of it, +subtyping corresponds directly to subclassing. A subclass ``MyStr`` of ``str`` +is a subtype of ``str``, because ``MyStr`` represents a subset of the values +represented by ``str``. Such types can be called "nominal types" and this is +"nominal subtyping." + +Other types (e.g. :ref:`Protocols` and :ref:`TypedDict`) instead describe a set +of values by the types of their attributes and methods, or the types of their +dictionary keys and values. These are called "structural types". A structural +type may be a subtype of another type without any inheritance or subclassing +relationship, simply because it meets all the requirements of the supertype, +and perhaps adds more, thus representing a subset of the possible values of the +supertype. This is "structural subtyping". + +Although the means of specifying the set of values represented by the types +differs, the fundamental concepts are the same for both nominal and structural +types: a type represents a set of possible values and a subtype represents a +subset of those values. + +Materialization +--------------- + +Since :ref:`Any` represents an unknown static type, it does not represent any +known single set of values (it represents an unknown set of values). Thus it is +not in the domain of the subtype, supertype, or equivalence relations on static +types described above. + +To relate gradual types more generally, we define a **materialization** +relation. Materialization transforms a "more dynamic" type to a "more static" +type. Given a gradual type ``A``, if we replace zero or more occurrences of +``Any`` in ``A`` with some type (which can be different for each occurrence of +``Any``), the resulting gradual type ``B`` is a materialization of ``A``. (We +can also materialize a :ref:`Callable` type by replacing ``...`` with any type +signature, and materialize ``tuple[Any, ...]`` by replacing it with a +determinate-length tuple type.) + +For instance, ``tuple[int, str]`` (a fully static type) and ``tuple[Any, str]`` +(a gradual type) are both materializations of ``tuple[Any, Any]``. ``tuple[int, +str]`` is also a materialization of ``tuple[Any, str]``. + +If ``B`` is a materialization of ``A``, we can say that ``B`` is a "more +static" type than ``A``, and ``A`` is a "more dynamic" type than ``B``. + +The materialization relation is both transitive and reflexive, so it defines a +preorder on gradual types. + +.. _`consistent`: + +Consistency +----------- + +We define a **consistency** relation on gradual types, based on +materialization. + +A fully static type ``A`` is consistent with another fully static type ``B`` if +and only if they are the same type (``A`` is equivalent to ``B``). + +A gradual type ``A`` is consistent with a gradual type ``B``, and ``B`` is +consistent with ``A``, if and only if there exists some fully static type ``C`` +which is a materialization of both ``A`` and ``B``. + +:ref:`Any` is consistent with every type, and every type is consistent with +:ref:`!Any`. (This follows from the definitions of materialization and +consistency but is worth stating explicitly.) + +The consistency relation is not transitive. ``tuple[int, int]`` is consistent +with ``tuple[Any, int]``, and ``tuple[Any, int]`` is consistent with +``tuple[str, int]``, but ``tuple[int, int]`` is not consistent with +``tuple[str, int]``. + +The consistency relation is symmetric. If ``A`` is consistent with ``B``, ``B`` +is also consistent with ``A``. It is also reflexive: ``A`` is always consistent +with ``A``. + +.. _`assignable`: + +The assignable-to (or consistent subtyping) relation +---------------------------------------------------- + +Given the materialization relation and the subtyping relation, we can define +the **consistent subtype** relation over all types. A type ``B`` is a +consistent subtype of a type ``A`` if there exists a materialization ``A'`` of +``A`` and a materialization ``B'`` of ``B``, where ``A'`` and ``B'`` are both +fully static types, and ``B'`` is a subtype of ``A'``. + +Consistent subtyping defines "assignability" for Python. An expression can be +assigned to a variable (including passed as an argument or returned from a +function) if its type is a consistent subtype of the variable's type annotation +(respectively, parameter's type annotation or return type annotation). + +We can say that a type ``B`` is "assignable to" a type ``A`` if ``B`` is a +consistent subtype of ``A``. In this case we can also say that ``A`` is +"assignable from" ``B``. + +In the remainder of this specification, we will usually prefer the term +**assignable to** over "consistent subtype of". The two are synonymous, but +"assignable to" is shorter, and may communicate a clearer intuition to many +readers. + +For example, ``Any`` is :term:`assignable` to ``int``, because ``int`` is a +materialization of ``Any``, and ``int`` is a subtype of ``int``. The same +materialization also shows that ``int`` is assignable to ``Any``. + +The assignable-to relation is not generally symmetric, however. If ``B`` is a +subtype of ``A``, then ``tuple[Any, B]`` is assignable to ``tuple[int, A]``, +because ``tuple[Any, B]`` can materialize to ``tuple[int, B]``, which is a +subtype of ``tuple[int, A]``. But ``tuple[int, A]`` is not assignable to +``tuple[Any, B]``. + +For a gradual structural type, consistency and assignability are also +structural. For example, the structural type "all objects with an attribute +``x`` of type ``Any``" is consistent with (and assignable to) the structural +type "all objects with an attribute ``x`` of type ``int``". + +Summary of type relations +------------------------- + +The subtype, supertype, and equivalence relations establish a partial order on +fully static types. The analogous relations on gradual types (via +materialization) are "assignable-to" (or "consistent subtype"), +"assignable-from" (or "consistent supertype"), and "consistent with". We can +visualize this analogy in the following table: + +.. list-table:: + :header-rows: 1 + + * - Fully static types + - Gradual types + * - ``B`` is a :term:`subtype` of ``A`` + - ``B`` is :term:`assignable` to (or a consistent subtype of) ``A`` + * - ``A`` is a :term:`supertype` of ``B`` + - ``A`` is assignable from (or a consistent supertype of) ``B`` + * - ``B`` is :term:`equivalent` to ``A`` + - ``B`` is :term:`consistent` with ``A`` + +We can also define equivalence on gradual types. Two gradual types ``A`` and +``B`` are equivalent (that is, the same gradual type, not merely consistent +with one another) if and only if all materializations of ``A`` are also +materializations of ``B``, and all materializations of ``B`` are also +materializations of ``A``. + +Attributes and methods +---------------------- + +In Python, we can do more with objects at runtime than just assign them to +names, pass them to functions, or return them from functions. We can also +get/set attributes and call methods. + +In the Python data model, the operations that can be performed on a value all +desugar to method calls. For example, ``a + b`` is (roughly, eliding some +details) syntactic sugar for either ``type(a).__add__(a, b)`` or +``type(b).__radd__(b, a)``. + +For a static type checker, accessing ``a.foo`` is a type error unless all +possible objects in the set represented by the type of ``a`` have the ``foo`` +attribute. (We consider an implementation of ``__getattr__`` to be a getter for +all attribute names, and similarly for ``__setattr__`` and ``__delattr__``. +There are more `complexities +`_; +a full specification of attribute access belongs in its own chapter.) + +If all objects in the set represented by the fully static type ``A`` have a +``foo`` attribute, we can say that the type ``A`` has the ``foo`` attribute. + +If the type ``A`` of ``a`` in ``a.foo`` is a gradual type, it may not represent +a single set of objects. In this case, ``a.foo`` is a type error if and only if +there does not exist any materialization of ``A`` which has the ``foo`` +attribute. + +Equivalently, ``a.foo`` is a type error unless the type of ``a`` is assignable +to a type that has the ``foo`` attribute. + + .. _`union-types`: Union types @@ -18,17 +351,44 @@ Example:: e = [e] ... -A type factored by ``T1 | T2 | ...`` is a supertype -of all types ``T1``, ``T2``, etc., so that a value that -is a member of one of these types is acceptable for an argument -annotated by ``T1 | T2 | ...``. +A fully static union type ``T1 | T2``, where ``T1`` and ``T2`` are fully static +types, represents the set of values formed by the union of the sets of values +represented by ``T1`` and ``T2``, respectively. Thus, by the definition of the +supertype relation, the union ``T1 | T2`` is a supertype of both ``T1`` and +``T2``, and ``T1`` and ``T2`` are both subtypes of ``T1 | T2``. -One common case of union types are *optional* types. By default, -``None`` is an invalid value for any type, unless a default value of -``None`` has been provided in the function definition. Examples:: +A gradual union type ``S1 | S2``, where ``S1`` and ``S2`` are gradual types, +represents all possible sets of values that could be formed by union of the +possible sets of values represented by materializations of ``S1`` and ``S2``, +respectively. + +For any materialization of ``S1`` to ``T1`` and ``S2`` to ``T2``, ``S1 | S2`` +can likewise be materialized to ``T1 | T2``. Thus, the gradual types ``S1`` and +``S2`` are both assignable to the gradual union type ``S1 | S2``. + +If ``B`` is a subtype of ``A``, ``B | A`` is equivalent to ``A``. + +This rule applies only to subtypes, not assignable-to. The union ``T | Any`` is +not reducible to a simpler form. It represents an unknown static type with +lower bound ``T``. That is, it represents an unknown set of objects which may +be as large as ``object``, or as small as ``T``, but no smaller. + +Equivalent gradual types can, however, be simplified from unions; e.g. +``list[Any] | list[Any]`` is equivalent to ``list[Any]``. Similarly, the union +``Any | Any`` can be simplified to ``Any``: the union of two unknown sets of +objects is an unknown set of objects. + +Union with None +~~~~~~~~~~~~~~~ + +One common case of union types are *optional* types, which are unions with +``None``. Example:: def handle_employee(e: Employee | None) -> None: ... +Either the type ``Employee`` or the type of ``None`` are assignable to the +union ``Employee | None``. + A past version of this specification allowed type checkers to assume an optional type when the default value is ``None``, as in this code:: @@ -42,7 +402,7 @@ This is no longer the recommended behavior. Type checkers should move towards requiring the optional type to be made explicit. Support for singleton types in unions -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ A singleton instance is frequently used to mark some special condition, in particular in situations where ``None`` is also a valid value @@ -97,3 +457,12 @@ one value:: else: # response can be only str, all other possible values exhausted return 'PROCESSED: ' + response + +References +---------- + +The concepts presented here are derived from the research literature in gradual +typing. See e.g.: + +* `Giuseppe Castagna, Victor Lanvin, Tommaso Petrucciani, and Jeremy G. Siek. 2019. Gradual Typing: A New Perspective. `_ Proc. ACM Program. Lang. 3, POPL, Article 16 (January 2019), 112 pages +* `Victor Lanvin. A semantic foundation for gradual set-theoretic types. `_ Computer science. Université Paris Cité, 2021. English. NNT : 2021UNIP7159. tel-03853222 diff --git a/docs/spec/constructors.rst b/docs/spec/constructors.rst index 0eb34b84d..b8591ba12 100644 --- a/docs/spec/constructors.rst +++ b/docs/spec/constructors.rst @@ -105,11 +105,11 @@ unrelated class. If the evaluated return type of ``__new__`` is not the class being constructed (or a subclass thereof), a type checker should assume that the ``__init__`` -method will not be called. This is consistent with the runtime behavior of -the ``type.__call__`` method. If the ``__new__`` method return type is -a union with one or more subtypes that are not instances of the class being -constructed (or a subclass thereof), a type checker should likewise assume that -the ``__init__`` method will not be called. +method will not be called. This is consistent with the runtime behavior of the +``type.__call__`` method. If the ``__new__`` method return type is a union with +one or more members that are not the class being constructed (or a subclass +thereof), a type checker should likewise assume that the ``__init__`` method +will not be called. :: @@ -337,7 +337,7 @@ Consistency of ``__new__`` and ``__init__`` ------------------------------------------- Type checkers may optionally validate that the ``__new__`` and ``__init__`` -methods for a class have consistent signatures. +methods for a class have :term:`consistent` signatures. :: @@ -353,7 +353,8 @@ methods for a class have consistent signatures. Converting a Constructor to Callable ------------------------------------ -Class objects are callable, which means they are compatible with callable types. +Class objects are callable, which means the type of a class object can be +:term:`assignable` to a callable type. :: diff --git a/docs/spec/directives.rst b/docs/spec/directives.rst index 01c0f6bdb..7fca698a3 100644 --- a/docs/spec/directives.rst +++ b/docs/spec/directives.rst @@ -86,12 +86,6 @@ At runtime a cast always returns the expression unchanged -- it does not check the type, and it does not convert or coerce the value. -Casts differ from type comments (see the previous section). When using -a type comment, the type checker should still verify that the inferred -type is consistent with the stated type. When using a cast, the type -checker should blindly believe the programmer. Also, casts can be used -in expressions, while type comments only apply to assignments. - .. _`if-type-checking`: ``TYPE_CHECKING`` diff --git a/docs/spec/enums.rst b/docs/spec/enums.rst index 6e10a90e5..a3fa1ccd8 100644 --- a/docs/spec/enums.rst +++ b/docs/spec/enums.rst @@ -350,7 +350,7 @@ literal values during type narrowing and exhaustion detection:: Likewise, a type checker should treat a complete union of all literal members -as compatible with the enum type:: +as :term:`equivalent` to the enum type:: class Answer(Enum): Yes = 1 diff --git a/docs/spec/generics.rst b/docs/spec/generics.rst index e565e21e6..8637aa148 100644 --- a/docs/spec/generics.rst +++ b/docs/spec/generics.rst @@ -474,12 +474,12 @@ classes without a metaclass conflict. Type variables with an upper bound ---------------------------------- -A type variable may specify an upper bound using ``bound=`` (when -using the ``TypeVar`` constructor) or using ``: `` (when using the native -syntax for generics). The bound itself cannot be parameterized by type variables. -This means that an -actual type substituted (explicitly or implicitly) for the type variable must -be a subtype of the boundary type. Example:: +A type variable may specify an upper bound using ``bound=`` (when using +the ``TypeVar`` constructor) or using ``: `` (when using the native +syntax for generics). The bound itself cannot be parameterized by type +variables. This means that an actual type substituted (explicitly or +implicitly) for the type variable must be :term:`assignable` to the bound. +Example:: from typing import TypeVar from collections.abc import Sized @@ -496,11 +496,10 @@ be a subtype of the boundary type. Example:: longer({1}, {1, 2}) # ok, return type set[int] longer([1], {1, 2}) # ok, return type a supertype of list[int] and set[int] -An upper bound cannot be combined with type constraints (as used in -``AnyStr``, see the example earlier); type constraints cause the -inferred type to be *exactly* one of the constraint types, while an -upper bound just requires that the actual type is a subtype of the -boundary type. +An upper bound cannot be combined with type constraints (as used in ``AnyStr``, +see the example earlier); type constraints cause the inferred type to be +*exactly* one of the constraint types, while an upper bound just requires that +the actual type is :term:`assignable` to the bound. .. _`variance`: @@ -523,13 +522,12 @@ introduction to these concepts can be found on `Wikipedia `_ and in :pep:`483`; here we just show how to control a type checker's behavior. -By default generic types declared using the old ``TypeVar`` syntax -are considered *invariant* in all type variables, -which means that values for variables annotated with types like -``list[Employee]`` must exactly match the type annotation -- no subclasses or -superclasses of the type parameter (in this example ``Employee``) are -allowed. See below for the behavior when using the built-in generic syntax -in Python 3.12 and higher. +By default generic types declared using the old ``TypeVar`` syntax are +considered *invariant* in all type variables, which means that e.g. +``list[Manager]`` is neither a supertype nor a subtype of ``list[Employee]``. + +See below for the behavior when using the built-in generic syntax in Python +3.12 and higher. To facilitate the declaration of container types where covariant or contravariant type checking is acceptable, type variables accept keyword @@ -1926,7 +1924,7 @@ Using a type parameter from an outer scope as a default is not supported. Bound Rules ^^^^^^^^^^^ -``T1``'s bound must be a subtype of ``T2``'s bound. +``T1``'s bound must be :term:`assignable` to ``T2``'s bound. :: @@ -2022,8 +2020,8 @@ normal subscription rules, non-overridden defaults should be substituted. Using ``bound`` and ``default`` """"""""""""""""""""""""""""""" -If both ``bound`` and ``default`` are passed, ``default`` must be a -subtype of ``bound``. If not, the type checker should generate an +If both ``bound`` and ``default`` are passed, ``default`` must be +:term:`assignable` to ``bound``. If not, the type checker should generate an error. :: @@ -2268,7 +2266,8 @@ Use in Attribute Annotations ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Another use for ``Self`` is to annotate attributes. One example is where we -have a ``LinkedList`` whose elements must be subclasses of the current class. +have a ``LinkedList`` whose elements must be :term:`assignable` to the current +class. :: @@ -2298,8 +2297,8 @@ constructions with subclasses: def ordinal_value(self) -> str: return as_ordinal(self.value) - # Should not be OK because LinkedList[int] is not a subclass of - # OrdinalLinkedList, # but the type checker allows it. + # Should not be OK because LinkedList[int] is not assignable to + # OrdinalLinkedList, but the type checker allows it. xs = OrdinalLinkedList(value=1, next=LinkedList[int](value=2)) if xs.next: @@ -2469,11 +2468,11 @@ See :pep:`PEP 544 <544#self-types-in-protocols>` for details on the behavior of TypeVars bound to protocols. -Checking a class for compatibility with a protocol: If a protocol uses -``Self`` in methods or attribute annotations, then a class ``Foo`` is -considered compatible with the protocol if its corresponding methods and -attribute annotations use either ``Self`` or ``Foo`` or any of ``Foo``’s -subclasses. See the examples below: +Checking a class for assignability to a protocol: If a protocol uses ``Self`` +in methods or attribute annotations, then a class ``Foo`` is :term:`assignable` +to the protocol if its corresponding methods and attribute annotations use +either ``Self`` or ``Foo`` or any of ``Foo``’s subclasses. See the examples +below: :: @@ -2705,16 +2704,15 @@ by the ``TypeVar`` constructor call. No further inference is needed. 3. Create two specialized versions of the class. We'll refer to these as ``upper`` and ``lower`` specializations. In both of these specializations, replace all type parameters other than the one being inferred by a dummy type -instance (a concrete anonymous class that is type compatible with itself and -assumed to meet the bounds or constraints of the type parameter). In -the ``upper`` specialized class, specialize the target type parameter with -an ``object`` instance. This specialization ignores the type parameter's -upper bound or constraints. In the ``lower`` specialized class, specialize -the target type parameter with itself (i.e. the corresponding type argument -is the type parameter itself). - -4. Determine whether ``lower`` can be assigned to ``upper`` using normal type -compatibility rules. If so, the target type parameter is covariant. If not, +instance (a concrete anonymous class that is assumed to meet the bounds or +constraints of the type parameter). In the ``upper`` specialized class, +specialize the target type parameter with an ``object`` instance. This +specialization ignores the type parameter's upper bound or constraints. In the +``lower`` specialized class, specialize the target type parameter with itself +(i.e. the corresponding type argument is the type parameter itself). + +4. Determine whether ``lower`` can be assigned to ``upper`` using normal +assignability rules. If so, the target type parameter is covariant. If not, determine whether ``upper`` can be assigned to ``lower``. If so, the target type parameter is contravariant. If neither of these combinations are assignable, the target type parameter is invariant. @@ -2737,9 +2735,8 @@ To determine the variance of ``T1``, we specialize ``ClassA`` as follows: upper = ClassA[object, Dummy, Dummy] lower = ClassA[T1, Dummy, Dummy] -We find that ``upper`` is not assignable to ``lower`` using normal type -compatibility rules defined in :pep:`484`. Likewise, ``lower`` is not assignable -to ``upper``, so we conclude that ``T1`` is invariant. +We find that ``upper`` is not assignable to ``lower``. Likewise, ``lower`` is +not assignable to ``upper``, so we conclude that ``T1`` is invariant. To determine the variance of ``T2``, we specialize ``ClassA`` as follows: diff --git a/docs/spec/glossary.rst b/docs/spec/glossary.rst index 3c8314d74..791782e7c 100644 --- a/docs/spec/glossary.rst +++ b/docs/spec/glossary.rst @@ -12,18 +12,104 @@ This section defines a few terms that may be used elsewhere in the specification :term:`type expression`, sometimes with additional :term:`type qualifiers `. See :ref:`"Type and annotation expression" ` for details. + assignable + If a type ``B`` is "assignable to" a type ``A``, a type checker should + not error on the assignment ``x: A = b``, where ``b`` is some expression + whose type is ``B``. Similarly for function calls and returns: ``f(b)`` + where ``def f(x: A): ...`` and ``return b`` inside ``def f(...) -> A: + ...`` are both valid (not type errors) if and only if ``B`` is assignable + to ``A``. In this case ``A`` is "assignable from" ``B``. For :term:`fully + static types `, "assignable to" is equivalent to + ":term:`subtype` of" and "assignable from" is equivalent to + ":term:`supertype` of". For :term:`gradual types `, a type + ``B`` is assignable to a type ``A`` if there exist fully static + :term:`materializations ` ``A'`` and ``B'`` of ``A`` and + ``B``, respectively, such that ``B'`` is a subtype of ``A'``. See + :ref:`type-system-concepts`. + + consistent + Two :term:`fully static types ` are "consistent with" + each other if they are :term:`equivalent`. Two gradual types are + "consistent with" each other if they could :term:`materialize` to the + same type. See :ref:`type-system-concepts`. If two types are consistent, + they are both :term:`assignable` to and from each other. + + consistent subtype + "Consistent subtype" is synonymous with ":term:`assignable` to" (and + "consistent supertype" is synonymous with "assignable from"). See + :ref:`type-system-concepts`. + distribution The packaged file which is used to publish and distribute a release. (:pep:`426`) + equivalent + Two :term:`fully static types ` ``A`` and ``B`` are + equivalent if ``A`` is a :term:`subtype` of ``B`` and ``B`` is a + :term:`subtype` of ``A``. This implies that ``A`` and ``B`` represent the + same set of possible runtime objects. Two gradual types ``A`` and ``B`` + are equivalent if all :term:`materializations ` of ``A`` are + also materializations of ``B``, and all materializations of ``B`` are + also materializations of ``A``. + + fully static type + A type is "fully static" if it does not contain any :term:`gradual form`. + A fully static type represents a set of possible runtime values. Fully + static types participate in the :term:`subtype` relation. See + :ref:`type-system-concepts`. + + gradual form + A gradual form is a :term:`type expression` which makes the type it is + part of not a :term:`fully static type`, but rather a representation of a + set of possible static types. See :ref:`type-system-concepts`. The + primary gradual form is :ref:`Any`. The ellipsis (``...``) is a gradual + form in some, but not all, contexts. It is a gradual form when used in a + :ref:`Callable` type, and when used in ``tuple[Any, ...]`` (but not in + other :ref:`tuple ` types). + + gradual type + All types in the Python type system are "gradual". A gradual type may be + a :term:`fully static type`, or it may be :ref:`Any`, or a type that + contains ``Any`` or another :term:`gradual form`. A gradual type does not + necessarily represent a single set of possible runtime values; instead it + can represent a set of possible static types (a set of possible sets of + possible runtime values). Gradual types do not participate in the + :term:`subtype` relation, but they do participate in :term:`consistency + ` and :term:`assignability `. They can be + :term:`materialized ` to a more static, or fully static, + type. See :ref:`type-system-concepts`. + inline Inline type annotations are annotations that are included in the runtime code using :pep:`526` and :pep:`3107` syntax (the filename ends in ``.py``). + materialize + A :term:`gradual type` can be materialized to a more static type + (possibly a :term:`fully static type`) by replacing :ref:`Any` with any + other type, or by replacing the `...` in a :ref:`Callable` type with a + list of types, or by replacing ``tuple[Any, ...]`` with a specific-length + tuple type. This materialization relation is key to defining + :term:`assignability ` for gradual types. See + :ref:`type-system-concepts`. + module A file containing Python runtime code or stubbed type information. + narrow + A :term:`fully static type` ``B`` is narrower than a fully static type + ``A`` if ``B`` is a :term:`subtype` of ``A`` and ``B`` is not + :term:`equivalent` to ``A``. This means that ``B`` represents a proper + subset of the possible objects represented by ``A``. "Type narrowing" is + when a type checker infers that a name or expression must have a narrower + type at some locations in control flow, due to an assignment or a runtime + check of its value. + + nominal + A nominal type (e.g. a class name) represents the set of values whose + ``__class__`` is that type, or any of its subclasses, transitively. In + contrast, see :term:`structural` types. + package A directory or directories that namespace Python modules. (Note the distinction between packages and :term:`distributions `. @@ -38,10 +124,37 @@ This section defines a few terms that may be used elsewhere in the specification be imported from the :py:mod:`typing` module or equivalently from ``typing_extensions``, but some special forms are placed in other modules. + structural + A structural type (see e.g. :ref:`Protocols`, :ref:`TypedDict`) defines a + set of values not by their ``__class__``, but by their properties (e.g. + attributes, methods, dictionary key/value types). :ref:`Callable` types + are also structural; a callable type is a subtype of another callable + type based on their signatures, not a subclass relationship. In contrast, + see :term:`nominal` types. + stub A file containing only type information, empty of runtime code (the filename ends in ``.pyi``). See :ref:`stub-files`. + subtype + A :term:`fully static type` ``B`` is a subtype of a fully static type + ``A`` if and only if the set of possible runtime values represented by + ``B`` is a subset of the set of possible runtime values represented by + ``A``. For :term:`nominal` types (classes), subtyping is defined by + inheritance. For :term:`structural` types, subtyping is defined by a + shared set of attributes/methods or keys. Subtype is the inverse of + :term:`supertype`. A type that is not fully static is not a subtype or + supertype of any other type, but via :term:`materialization + ` can be :term:`assignable` to another type. See + :ref:`type-system-concepts`. + + supertype + A :term:`fully static type` ``A`` is a supertype of a fully static type + ``B`` if and only if the set of possible runtime values represented by + ``A`` is a superset of the set of possible runtime values represented by + ``B``. Supertype is the inverse of :term:`subtype`. See + :ref:`type-system-concepts`. + type expression An expression that represents a type. The type system requires the use of type expressions within :term:`annotation expression` and also in several other contexts. @@ -53,3 +166,10 @@ This section defines a few terms that may be used elsewhere in the specification can be used around a type to indicate that the annotated value may not be overridden or modified. This term is also used for other special forms that modify a type, but using a different syntactic context, such as the :ref:`@final ` decorator. + + wide + A :term:`fully static type` ``A`` is wider than a fully static type ``B`` + if and only if ``B`` is a :term:`subtype` of ``A`` and ``B`` is not + :term:`equivalent` to ``A``. This means that ``A`` represents a proper + superset of the possible values represented by ``B``. See also + ":term:`narrow`". diff --git a/docs/spec/literal.rst b/docs/spec/literal.rst index afbcd6fb6..5cd50a443 100644 --- a/docs/spec/literal.rst +++ b/docs/spec/literal.rst @@ -24,9 +24,8 @@ concrete value. For example, if we define some variable ``foo`` to have type ``Literal[3]``, we are declaring that ``foo`` must be exactly equal to ``3`` and no other value. -Given some value ``v`` that is a member of type ``T``, the type -``Literal[v]`` shall be treated as a subtype of ``T``. For example, -``Literal[3]`` is a subtype of ``int``. +Given some value ``v`` that is a member of type ``T``, the type ``Literal[v]`` +is a subtype of ``T``. For example, ``Literal[3]`` is a subtype of ``int``. All methods from the parent type will be directly inherited by the literal type. So, if we have some variable ``foo`` of type ``Literal[3]`` @@ -304,13 +303,13 @@ special-casing. For example, programs like the following are type safe:: # Legal: Literal["foo"] is a subtype of str expects_str(var) -This also means non-Literal expressions in general should not automatically -be cast to Literal. For example:: +This also means non-Literal types in general are not :term:`assignable` to +Literal types. For example:: def expects_literal(x: Literal["foo"]) -> None: ... def runner(my_str: str) -> None: - # ILLEGAL: str is not a subclass of Literal["foo"] + # ILLEGAL: str is not assignable to Literal["foo"] expects_literal(my_str) **Note:** If the user wants their API to support accepting both literals @@ -398,11 +397,9 @@ maintain backwards-compatibility. Interactions with generics """""""""""""""""""""""""" -Types like ``Literal[3]`` are meant to be just plain old subclasses of -``int``. This means you can use types like ``Literal[3]`` anywhere -you could use normal types, such as with generics. +Literal types are types, and can be used anywhere a type is expected. -This means that it is legal to parameterize generic functions or +For example, it is legal to parameterize generic functions or classes using Literal types:: A = TypeVar('A', bound=int) @@ -584,28 +581,28 @@ Type inference Inferring ``LiteralString`` """"""""""""""""""""""""""" -Any literal string type is compatible with ``LiteralString``. For +Any literal string type is assignable to ``LiteralString``. For example, ``x: LiteralString = "foo"`` is valid because ``"foo"`` is inferred to be of type ``Literal["foo"]``. We also infer ``LiteralString`` in the following cases: -+ Addition: ``x + y`` is of type ``LiteralString`` if both ``x`` and - ``y`` are compatible with ``LiteralString``. ++ Addition: ``x + y`` is of type ``LiteralString`` if the types of both ``x`` + and ``y`` are assignable to ``LiteralString``. + Joining: ``sep.join(xs)`` is of type ``LiteralString`` if ``sep``'s - type is compatible with ``LiteralString`` and ``xs``'s type is - compatible with ``Iterable[LiteralString]``. + type is assignable to ``LiteralString`` and ``xs``'s type is + assignable to ``Iterable[LiteralString]``. -+ In-place addition: If ``s`` has type ``LiteralString`` and ``x`` has - type compatible with ``LiteralString``, then ``s += x`` preserves - ``s``'s type as ``LiteralString``. ++ In-place addition: If ``s`` has type ``LiteralString`` and ``x`` has a type + assignable to ``LiteralString``, then ``s += x`` preserves ``s``'s type as + ``LiteralString``. -+ String formatting: An f-string has type ``LiteralString`` if and only - if its constituent expressions are literal strings. ``s.format(...)`` - has type ``LiteralString`` if and only if ``s`` and the arguments have - types compatible with ``LiteralString``. ++ String formatting: An f-string has type ``LiteralString`` if and only if its + constituent expressions are literal strings. ``s.format(...)`` is assignable + to ``LiteralString`` if and only if ``s`` and the arguments have types + assignable to ``LiteralString``. In all other cases, if one or more of the composed values has a non-literal type ``str``, the composition of types will have type @@ -613,7 +610,7 @@ non-literal type ``str``, the composition of types will have type has type ``str``. This matches the pre-existing behavior of type checkers. -``LiteralString`` is compatible with the type ``str``. It inherits all +``LiteralString`` is assignable to the type ``str``. It inherits all methods from ``str``. So, if we have a variable ``s`` of type ``LiteralString``, it is safe to write ``s.startswith("hello")``. @@ -626,7 +623,7 @@ check: if s == "bar": reveal_type(s) # => Literal["bar"] -Such a refined type in the if-block is also compatible with +Such a refined type in the if-block is also assignable to ``LiteralString`` because its type is ``Literal["bar"]``. @@ -699,7 +696,7 @@ Format strings using literal strings: expect_literal_string("hello {}".format(username)) # Not OK -Other literal types, such as literal integers, are not compatible with ``LiteralString``: +Other literal types, such as literal integers, are not assignable to ``LiteralString``: :: diff --git a/docs/spec/namedtuples.rst b/docs/spec/namedtuples.rst index 835d196f4..1ac141365 100644 --- a/docs/spec/namedtuples.rst +++ b/docs/spec/namedtuples.rst @@ -133,11 +133,12 @@ this:: x, y = p # Type error (too few values to unpack) -Type Compatibility Rules ------------------------- +Assignability +------------- -A named tuple is a subtype of a ``tuple`` with a known length and parameterized -by types corresponding to the named tuple's individual field types:: +A named tuple is :term:`assignable` to a ``tuple`` with a known length and +parameterized by types corresponding to the named tuple's individual field +types:: p = Point(x=1, y=2, units="inches") v1: tuple[int, int, str] = p # OK diff --git a/docs/spec/narrowing.rst b/docs/spec/narrowing.rst index cbab74f09..b7c6cc0d9 100644 --- a/docs/spec/narrowing.rst +++ b/docs/spec/narrowing.rst @@ -149,8 +149,8 @@ To specify the behavior of ``TypeIs``, we use the following terminology: else: assert_type(val, NN) -The return type ``R`` must be consistent with ``I``. The type checker should -emit an error if this condition is not met. +The return type ``R`` must be :term:`assignable` to ``I``. The type checker +should emit an error if this condition is not met. Formally, type *NP* should be narrowed to :math:`A \land R`, the intersection of *A* and *R*, and type *NN* should be narrowed to @@ -193,7 +193,8 @@ argument's previously-known type:: else: assert_type(x, int) -It is an error to narrow to a type that is not consistent with the input type:: +It is an error to narrow to a type that is not :term:`assignable` to the input +type:: from typing import TypeIs diff --git a/docs/spec/protocol.rst b/docs/spec/protocol.rst index 5532276f0..e280f0edb 100644 --- a/docs/spec/protocol.rst +++ b/docs/spec/protocol.rst @@ -8,7 +8,7 @@ Protocols Terminology ^^^^^^^^^^^ -The term *protocols* is used for types supporting structural +The term *protocols* is used for some types supporting :term:`structural` subtyping. The reason is that the term *iterator protocol*, for example, is widely understood in the community, and coming up with a new term for this concept in a statically typed context would just create @@ -22,19 +22,19 @@ The distinction is not important most of the time, and in other cases we can just add a qualifier such as *protocol classes* when referring to the static type concept. -If a class includes a protocol in its MRO, the class is called -an *explicit* subclass of the protocol. If a class is a structural subtype -of a protocol, it is said to implement the protocol and to be compatible -with a protocol. If a class is compatible with a protocol but the protocol -is not included in the MRO, the class is an *implicit* subtype -of the protocol. (Note that one can explicitly subclass a protocol and -still not implement it if a protocol attribute is set to ``None`` -in the subclass, see Python :py:ref:`data model ` -for details.) +If a class includes a protocol in its MRO, the class is called an *explicit* +subclass of the protocol. If a class defines all attributes and methods of a +protocol with types that are :term:`assignable` to the types of the protocol's +attributes and methods, it is said to implement the protocol and to be +assignable to the protocol. If a class is assignable to a protocol but the +protocol is not included in the MRO, the class is *implicitly* assignable to +the protocol. (Note that one can explicitly subclass a protocol and still not +implement it if a protocol attribute is set to ``None`` in the subclass. See +Python :py:ref:`data model ` for details.) -The attributes (variables and methods) of a protocol that are mandatory -for another class in order to be considered a structural subtype are called -protocol members. +The attributes (variables and methods) of a protocol that are mandatory for +another class for it to be assignable to the protocol are called "protocol +members". .. _protocol-definition: @@ -51,10 +51,10 @@ at the end of the list. Here is a simple example:: def close(self) -> None: ... -Now if one defines a class ``Resource`` with a ``close()`` method that has -a compatible signature, it would implicitly be a subtype of -``SupportsClose``, since the structural subtyping is used for -protocol types:: +Now if one defines a class ``Resource`` with a ``close()`` method whose type +signature is :term:`assignable` to ``SupportsClose.close``, it would implicitly +be assignable to ``SupportsClose``, since :term:`structural` assignability is +used for protocol types:: class Resource: ... @@ -74,10 +74,9 @@ be used in every context where normal types can:: close_all([f, r]) # OK! close_all([1]) # Error: 'int' has no 'close' method -Note that both the user-defined class ``Resource`` and the built-in -``IO`` type (the return type of ``open()``) are considered subtypes of -``SupportsClose``, because they provide a ``close()`` method with -a compatible type signature. +Note that both the user-defined class ``Resource`` and the built-in ``IO`` type +(the return type of ``open()``) are assignable to ``SupportsClose``, because +each provides a ``close()`` method with an assignable type signature. Protocol members @@ -147,9 +146,9 @@ expected to automatically detect that a class implements a given protocol. So while it's possible to subclass a protocol explicitly, it's *not necessary* to do so for the sake of type-checking. -The default implementations cannot be used if -the subtype relationship is implicit and only via structural -subtyping -- the semantics of inheritance is not changed. Examples:: +The default implementations cannot be used if the assignable-to relationship is +implicit and only :term:`structural` -- the semantics of inheritance is not +changed. Examples:: class PColor(Protocol): @abstractmethod @@ -181,10 +180,10 @@ subtyping -- the semantics of inheritance is not changed. Examples:: represent(nice) # OK represent(another) # Also OK -Note that there is little difference between explicit and implicit -subtypes; the main benefit of explicit subclassing is to get some protocol -methods "for free". In addition, type checkers can statically verify that -the class actually implements the protocol correctly:: +Note that there is little difference between explicitly subclassing and +implicitly implementing the protocol; the main benefit of explicit subclassing +is to get some protocol methods "for free". In addition, type checkers can +statically verify that the class actually implements the protocol correctly:: class RGB(Protocol): rgb: tuple[int, int, int] @@ -201,22 +200,22 @@ the class actually implements the protocol correctly:: A class can explicitly inherit from multiple protocols and also from normal classes. In this case methods are resolved using normal MRO and a type checker -verifies that all subtyping are correct. The semantics of ``@abstractmethod`` -is not changed; all of them must be implemented by an explicit subclass -before it can be instantiated. +verifies that all member assignability is correct. The semantics of +``@abstractmethod`` is not changed; all of them must be implemented by an +explicit subclass before it can be instantiated. Merging and extending protocols ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -The general philosophy is that protocols are mostly like regular ABCs, -but a static type checker will handle them specially. Subclassing a protocol -class would not turn the subclass into a protocol unless it also has -``typing.Protocol`` as an explicit base class. Without this base, the class -is "downgraded" to a regular ABC that cannot be used with structural +The general philosophy is that protocols are mostly like regular ABCs, but a +static type checker will handle them specially. Subclassing a protocol class +would not turn the subclass into a protocol unless it also has +``typing.Protocol`` as an explicit base class. Without this base, the class is +"downgraded" to a regular ABC that cannot be used with :term:`structural` subtyping. The rationale for this rule is that we don't want to accidentally -have some class act as a protocol just because one of its base classes -happens to be one. We still slightly prefer nominal subtyping over structural +have some class act as a protocol just because one of its base classes happens +to be one. We still slightly prefer :term:`nominal` subtyping over structural subtyping in the static typing world. A subprotocol can be defined by having *both* one or more protocols as @@ -246,9 +245,9 @@ with ``typing.Sized``:: class SizedAndClosable(Sized, SupportsClose, Protocol): pass -The two definitions of ``SizedAndClosable`` are equivalent. -Subclass relationships between protocols are not meaningful when -considering subtyping, since structural compatibility is +The two definitions of ``SizedAndClosable`` are equivalent. Subclass +relationships between protocols are not meaningful when considering +assignability, since :term:`structural` :term:`assignability ` is the criterion, not the MRO. If ``Protocol`` is included in the base class list, all the other base classes @@ -303,7 +302,7 @@ the declared variance. Examples:: var: Proto[float] another_var: Proto[int] - var = another_var # Error! 'Proto[float]' is incompatible with 'Proto[int]'. + var = another_var # Error! 'Proto[float]' is not assignable to 'Proto[int]'. Note that unlike nominal classes, de facto covariant protocols cannot be declared as invariant, since this can break transitivity of subtyping. @@ -328,7 +327,7 @@ like trees in an abstract fashion:: def leaves(self) -> Iterable['Traversable']: ... -Note that for recursive protocols, a class is considered a subtype of +Note that for recursive protocols, a class is considered assignable to the protocol in situations where the decision depends on itself. Continuing the previous example:: @@ -345,7 +344,7 @@ Continuing the previous example:: def walk(graph: Traversable) -> None: ... tree: Tree[float] = Tree() - walk(tree) # OK, 'Tree[float]' is a subtype of 'Traversable' + walk(tree) # OK, 'Tree[float]' is assignable to 'Traversable' Self-types in protocols @@ -371,26 +370,26 @@ The self-types in protocols follow the c = One() # OK c = Other() # Also OK -Subtyping relationships with other types -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Assignability relationships with other types +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Protocols cannot be instantiated, so there are no values whose runtime type is a protocol. For variables and parameters with protocol types, -subtyping relationships are subject to the following rules: +assignability relationships are subject to the following rules: -* A protocol is never a subtype of a concrete type. -* A concrete type ``X`` is a subtype of protocol ``P`` - if and only if ``X`` implements all protocol members of ``P`` with - compatible types. In other words, subtyping with respect to a protocol is - always structural. -* A protocol ``P1`` is a subtype of another protocol ``P2`` if ``P1`` defines - all protocol members of ``P2`` with compatible types. +* A protocol is never assignable to a concrete type. +* A concrete type ``X`` is assignable to a protocol ``P`` if and only if ``X`` + implements all protocol members of ``P`` with assignable types. In other + words, :term:`assignability ` with respect to a protocol is + always :term:`structural`. +* A protocol ``P1`` is assignable to another protocol ``P2`` if ``P1`` defines + all protocol members of ``P2`` with assignable types. Generic protocol types follow the same rules of variance as non-protocol types. Protocol types can be used in all contexts where any other types can be used, such as in unions, ``ClassVar``, type variables bounds, etc. Generic protocols follow the rules for generic abstract classes, except for -using structural compatibility instead of compatibility defined by +using structural assignability instead of assignability defined by inheritance relationships. Static type checkers will recognize protocol implementations, even if the @@ -460,8 +459,9 @@ Example:: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Variables and parameters annotated with ``type[Proto]`` accept only concrete -(non-protocol) subtypes of ``Proto``. The main reason for this is to allow -instantiation of parameters with such types. For example:: +(non-protocol) :term:`consistent subtypes ` of ``Proto``. +The main reason for this is to allow instantiation of parameters with such +types. For example:: class Proto(Protocol): @abstractmethod @@ -489,7 +489,7 @@ For normal (non-abstract) classes, the behavior of ``type[]`` is not changed. A class object is considered an implementation of a protocol if accessing -all members on it results in types compatible with the protocol members. +all members on it results in types assignable to the types of the protocol members. For example:: from typing import Any, Protocol @@ -538,7 +538,7 @@ Modules as implementations of protocols ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ A module object is accepted where a protocol is expected if the public -interface of the given module is compatible with the expected protocol. +interface of the given module is assignable to the expected protocol. For example:: # file default_config.py @@ -560,7 +560,7 @@ For example:: setup(default_config) # OK -To determine compatibility of module level functions, the ``self`` argument +To determine assignability of module level functions, the ``self`` argument of the corresponding protocol methods is dropped. For example:: # callbacks.py @@ -622,11 +622,11 @@ the risks for this feature, the following rules are applied. if it only contains methods as members (for example ``Sized``, ``Iterator``, etc). A protocol that contains at least one non-method member (like ``x: int``) is called a data protocol. -* *Unsafe overlap*: A type ``X`` is called unsafely overlapping with - a protocol ``P``, if ``X`` is not a subtype of ``P``, but it is a subtype - of the type erased version of ``P`` where all members have type ``Any``. - In addition, if at least one element of a union unsafely overlaps with - a protocol ``P``, then the whole union is unsafely overlapping with ``P``. +* *Unsafe overlap*: A type ``X`` is called unsafely overlapping with a protocol + ``P``, if ``X`` is not assignable to ``P``, but it is assignable to the + type-erased version of ``P`` where all members have type ``Any``. In + addition, if at least one element of a union unsafely overlaps with a + protocol ``P``, then the whole union is unsafely overlapping with ``P``. **Specification**: diff --git a/docs/spec/qualifiers.rst b/docs/spec/qualifiers.rst index 49ec63f2d..13cd842b2 100644 --- a/docs/spec/qualifiers.rst +++ b/docs/spec/qualifiers.rst @@ -255,7 +255,7 @@ details of the syntax: V == Annotated[list[tuple[int, int]], MaxLen(10)] -* As with most :term:`special forms `, ``Annotated`` is not type compatible with +* As with most :term:`special forms `, ``Annotated`` is not assignable to ``type`` or ``type[T]``:: v1: type[int] = Annotated[int, ""] # Type error diff --git a/docs/spec/special-types.rst b/docs/spec/special-types.rst index b94222e60..46e1f2bfa 100644 --- a/docs/spec/special-types.rst +++ b/docs/spec/special-types.rst @@ -8,16 +8,12 @@ Special types in annotations ``Any`` ------- -A special kind of type is ``Any``. Every type is consistent with -``Any``. It can be considered a type that has all values and all methods. -Note that ``Any`` and builtin type ``object`` are completely different. +``Any`` represents an unknown static type. -When the type of a value is ``object``, the type checker will reject -almost all operations on it, and assigning it to a variable (or using -it as a return value) of a more specialized type is a type error. On -the other hand, when a value has type ``Any``, the type checker will -allow all operations on it, and a value of type ``Any`` can be assigned -to a variable (or used as a return value) of a more constrained type. +Every type is :term:`assignable` to ``Any``, and ``Any`` is assignable to every +type. + +See :ref:`type-system-concepts` for more discussion of ``Any``. A function parameter without an annotation is assumed to be annotated with ``Any``. If a generic type is used without specifying type parameters, @@ -98,8 +94,9 @@ is unreachable and will behave accordingly:: ``Never`` --------- -Since Python 3.11, the ``typing`` module contains a :term:`special form` ``Never``. It -represents the bottom type, a type that has no members. +Since Python 3.11, the ``typing`` module contains a :term:`special form` +``Never``. It represents the bottom type, a type that represents the empty set +of Python objects. The ``Never`` type is equivalent to ``NoReturn``, which is discussed above. The ``NoReturn`` type is conventionally used in return annotations of diff --git a/docs/spec/tuples.rst b/docs/spec/tuples.rst index 4f04b914a..1209cc027 100644 --- a/docs/spec/tuples.rst +++ b/docs/spec/tuples.rst @@ -29,10 +29,10 @@ Arbitrary-length homogeneous tuples are sometimes referred to as "unbounded tuples". Both of these terms appear within the typing spec, and they refer to the same concept. -The type ``tuple[Any, ...]`` is special in that it is bidirectionally -compatible with any tuple of any length. This is useful for gradual typing. -The type ``tuple`` (with no type arguments provided) is equivalent to -``tuple[Any, ...]``. +The type ``tuple[Any, ...]`` is special in that it is :term:`consistent` with +all tuple types, and :term:`assignable` to a tuple of any length. This is +useful for gradual typing. The type ``tuple`` (with no type arguments provided) +is equivalent to ``tuple[Any, ...]``. Arbitrary-length tuples have exactly two type arguments -- the type and an ellipsis. Any other tuple form that uses an ellipsis is invalid:: @@ -61,8 +61,7 @@ more elements of type ``str``. The type ``tuple[*tuple[int, ...]]`` is equivalent to ``tuple[int, ...]``. If an unpacked ``*tuple[Any, ...]`` is embedded within another tuple, that -portion of the tuple is bidirectionally type compatible with any tuple of -any length. +portion of the tuple is :term:`consistent` with any tuple of any length. Only one unbounded tuple can be used within another tuple:: @@ -100,7 +99,7 @@ to a union of tuples of different lengths. That means ``tuple[()]``, ``tuple[int, ...]``. The converse is not true; ``tuple[int, ...]`` is not a subtype of ``tuple[int]``. -The type ``tuple[Any, ...]`` is bidirectionally compatible with any tuple:: +The type ``tuple[Any, ...]`` is :term:`consistent` with any tuple:: def func(t1: tuple[int], t2: tuple[int, ...], t3: tuple[Any, ...]): v1: tuple[int, ...] = t1 # OK diff --git a/docs/spec/typeddict.rst b/docs/spec/typeddict.rst index 6d6326553..94846172f 100644 --- a/docs/spec/typeddict.rst +++ b/docs/spec/typeddict.rst @@ -27,13 +27,13 @@ supported by ``typing.NamedTuple``. Other features include TypedDict inheritance and totality (specifying whether keys are required or not). -This section also provides a sketch of how a type checker is expected -to support type checking operations involving TypedDict objects. -Similar to :pep:`484`, this discussion is left somewhat vague on purpose, -to allow experimentation with a wide variety of different type -checking approaches. In particular, type compatibility should be -based on structural compatibility: a more specific TypedDict type can -be compatible with a smaller (more general) TypedDict type. +This section also provides a sketch of how a type checker is expected to +support type checking operations involving TypedDict objects. Similar to +:pep:`484`, this discussion is left somewhat vague on purpose, to allow +experimentation with a wide variety of different type checking approaches. In +particular, :term:`assignability ` should be :term:`structural`: a +more specific TypedDict type can be assignable to a more general TypedDict +type, without any inheritance relationship between them. Class-based Syntax @@ -172,9 +172,9 @@ TypedDict types using the class-based syntax. In this case the class BookBasedMovie(Movie): based_on: str -Now ``BookBasedMovie`` has keys ``name``, ``year``, and ``based_on``. -It is equivalent to this definition, since TypedDict types use -structural compatibility:: +Now ``BookBasedMovie`` has keys ``name``, ``year``, and ``based_on``. It is +equivalent to this definition, since TypedDict types use :term:`structural` +:term:`assignability `:: class BookBasedMovie(TypedDict): name: str @@ -284,24 +284,16 @@ refers to a dictionary object does not need to be supported, to simplify implementation. -Type Consistency -^^^^^^^^^^^^^^^^ +Assignability +^^^^^^^^^^^^^ -Informally speaking, *type consistency* is a generalization of the -is-subtype-of relation to support the ``Any`` type. It is defined -more formally in :pep:`483`. This section introduces the -new, non-trivial rules needed to support type consistency for -TypedDict types. +First, any TypedDict type is :term:`assignable` to ``Mapping[str, object]``. -First, any TypedDict type is consistent with ``Mapping[str, object]``. -Second, a TypedDict type ``A`` is consistent with TypedDict ``B`` if -``A`` is structurally compatible with ``B``. This is true if and only -if both of these conditions are satisfied: +Second, a TypedDict type ``B`` is :term:`assignable` to a TypedDict ``A`` if +and only if both of these conditions are satisfied: -* For each key in ``B``, ``A`` has the corresponding key and the - corresponding value type in ``A`` is consistent with the value type - in ``B``. For each key in ``B``, the value type in ``B`` is also - consistent with the corresponding value type in ``A``. +* For each key in ``A``, ``B`` has the corresponding key and the corresponding + value type in ``B`` is :term:`consistent` with the value type in ``A``. * For each required key in ``B``, the corresponding key is required in ``A``. For each non-required key in ``B``, the corresponding key @@ -323,12 +315,12 @@ Discussion: a['x'] = None b: B = {'x': 0} - f(b) # Type check error: 'B' not compatible with 'A' + f(b) # Type check error: 'B' not assignable to 'A' b['x'] + 1 # Runtime error: None + 1 -* A TypedDict type with a required key is not consistent with a - TypedDict type where the same key is a non-required key, since the - latter allows keys to be deleted. Example where this is relevant:: +* A TypedDict type with a required key is not :term:`assignable` to a TypedDict + type where the same key is a non-required key, since the latter allows keys + to be deleted. Example where this is relevant:: class A(TypedDict, total=False): x: int @@ -340,14 +332,14 @@ Discussion: del a['x'] b: B = {'x': 0} - f(b) # Type check error: 'B' not compatible with 'A' + f(b) # Type check error: 'B' not assignable to 'A' b['x'] + 1 # Runtime KeyError: 'x' -* A TypedDict type ``A`` with no key ``'x'`` is not consistent with a - TypedDict type with a non-required key ``'x'``, since at runtime - the key ``'x'`` could be present and have an incompatible type - (which may not be visible through ``A`` due to structural subtyping). - Example:: +* A TypedDict type ``A`` with no key ``'x'`` is not :term:`assignable` to a + TypedDict type with a non-required key ``'x'``, since at runtime the key + ``'x'`` could be present and have an :term:`inconsistent ` type + (which may not be visible through ``A`` due to :term:`structural` + assignability). Example:: class A(TypedDict, total=False): x: int @@ -364,16 +356,16 @@ Discussion: a['y'] = 1 def g(b: B) -> None: - f(b) # Type check error: 'B' incompatible with 'A' + f(b) # Type check error: 'B' not assignable to 'A' c: C = {'x': 0, 'y': 'foo'} g(c) c['y'] + 'bar' # Runtime error: int + str -* A TypedDict isn't consistent with any ``Dict[...]`` type, since - dictionary types allow destructive operations, including - ``clear()``. They also allow arbitrary keys to be set, which - would compromise type safety. Example:: +* A TypedDict isn't :term:`assignable` to any ``Dict[...]`` type, since + dictionary types allow destructive operations, including ``clear()``. They + also allow arbitrary keys to be set, which would compromise type safety. + Example:: class A(TypedDict): x: int @@ -385,17 +377,17 @@ Discussion: d['y'] = 0 def g(a: A) -> None: - f(a) # Type check error: 'A' incompatible with Dict[str, int] + f(a) # Type check error: 'A' not assignable to Dict[str, int] b: B = {'x': 0, 'y': 'foo'} g(b) b['y'] + 'bar' # Runtime error: int + str -* A TypedDict with all ``int`` values is not consistent with - ``Mapping[str, int]``, since there may be additional non-``int`` - values not visible through the type, due to structural subtyping. - These can be accessed using the ``values()`` and ``items()`` - methods in ``Mapping``, for example. Example:: +* A TypedDict with all ``int`` values is not :term:`assignable` to + ``Mapping[str, int]``, since there may be additional non-``int`` values not + visible through the type, due to :term:`structural` assignability. These can + be accessed using the ``values()`` and ``items()`` methods in ``Mapping``, + for example. Example:: class A(TypedDict): x: int @@ -411,7 +403,7 @@ Discussion: return n def f(a: A) -> None: - sum_values(a) # Error: 'A' incompatible with Mapping[str, int] + sum_values(a) # Error: 'A' not assignable to Mapping[str, int] b: B = {'x': 0, 'y': 'foo'} f(b) @@ -437,13 +429,13 @@ value is unknown during type checking, and thus can cause some of the above violations. (`Use of Final Values and Literal Types`_ generalizes this to cover final names and literal types.) -The use of a key that is not known to exist should be reported as an -error, even if this wouldn't necessarily generate a runtime type -error. These are often mistakes, and these may insert values with an -invalid type if structural subtyping hides the types of certain items. -For example, ``d['x'] = 1`` should generate a type check error if -``'x'`` is not a valid key for ``d`` (which is assumed to be a -TypedDict type). +The use of a key that is not known to exist should be reported as an error, +even if this wouldn't necessarily generate a runtime type error. These are +often mistakes, and these may insert values with an invalid type if +:term:`structural` :term:`assignability ` hides the types of +certain items. For example, ``d['x'] = 1`` should generate a type check error +if ``'x'`` is not a valid key for ``d`` (which is assumed to be a TypedDict +type). Extra keys included in TypedDict object construction should also be caught. In this example, the ``director`` key is not defined in @@ -468,10 +460,10 @@ objects as unsafe, even though they are valid for normal dictionaries: of ``d.get(e)`` should be ``object`` if the string value of ``e`` cannot be determined statically. -* ``clear()`` is not safe since it could remove required keys, some of - which may not be directly visible because of structural - subtyping. ``popitem()`` is similarly unsafe, even if all known - keys are not required (``total=False``). +* ``clear()`` is not safe since it could remove required keys, some of which + may not be directly visible because of :term:`structural` + :term:`assignability `. ``popitem()`` is similarly unsafe, even + if all known keys are not required (``total=False``). * ``del obj['key']`` should be rejected unless ``'key'`` is a non-required key. @@ -737,26 +729,39 @@ Subclasses can combine these rules:: class User(OptionalIdent): ident: str # Required, mutable, and not an int -Note that these are just consequences of structural typing, but they are highlighted here as the behavior now differs from the rules specified in :pep:`589`. +Note that these are just consequences of :term:`structural` typing, but they +are highlighted here as the behavior now differs from the rules specified in +:pep:`589`. -Type consistency -^^^^^^^^^^^^^^^^ +Assignability +^^^^^^^^^^^^^ -*This section updates the type consistency rules described above that were created prior to the introduction of ReadOnly* +*This section updates the assignability rules described above that were created +prior to the introduction of ReadOnly* -A TypedDict type ``A`` is consistent with TypedDict ``B`` if ``A`` is structurally compatible with ``B``. This is true if and only if all of the following are satisfied: +A TypedDict type ``B`` is :term:`assignable` to a TypedDict type ``A`` if ``B`` +is :term:`structurally ` assignable to ``A``. This is true if and +only if all of the following are satisfied: -* For each item in ``B``, ``A`` has the corresponding key, unless the item in ``B`` is read-only, not required, and of top value type (``ReadOnly[NotRequired[object]]``). -* For each item in ``B``, if ``A`` has the corresponding key, the corresponding value type in ``A`` is consistent with the value type in ``B``. -* For each non-read-only item in ``B``, its value type is consistent with the corresponding value type in ``A``. -* For each required key in ``B``, the corresponding key is required in ``A``. -* For each non-required key in ``B``, if the item is not read-only in ``B``, the corresponding key is not required in ``A``. +* For each item in ``A``, ``B`` has the corresponding key, unless the item in + ``A`` is read-only, not required, and of top value type + (``ReadOnly[NotRequired[object]]``). +* For each item in ``A``, if ``B`` has the corresponding key, the corresponding + value type in ``B`` is assignable to the value type in ``A``. +* For each non-read-only item in ``A``, its value type is assignable to the + corresponding value type in ``B``. +* For each required key in ``A``, the corresponding key is required in ``B``. +* For each non-required key in ``A``, if the item is not read-only in ``A``, + the corresponding key is not required in ``B``. Discussion: -* All non-specified items in a TypedDict implicitly have value type ``ReadOnly[NotRequired[object]]``. +* All non-specified items in a TypedDict implicitly have value type + ``ReadOnly[NotRequired[object]]``. -* Read-only items behave covariantly, as they cannot be mutated. This is similar to container types such as ``Sequence``, and different from non-read-only items, which behave invariantly. Example:: +* Read-only items behave covariantly, as they cannot be mutated. This is + similar to container types such as ``Sequence``, and different from + non-read-only items, which behave invariantly. Example:: class A(TypedDict): x: ReadOnly[int | None] @@ -770,7 +775,13 @@ Discussion: b: B = {"x": 1} f(b) # Accepted by type checker -* A TypedDict type ``A`` with no explicit key ``'x'`` is not consistent with a TypedDict type ``B`` with a non-required key ``'x'``, since at runtime the key ``'x'`` could be present and have an incompatible type (which may not be visible through ``A`` due to structural subtyping). The only exception to this rule is if the item in ``B`` is read-only, and the value type is of top type (``object``). For example:: +* A TypedDict type ``A`` with no explicit key ``'x'`` is not :term:`assignable` + to a TypedDict type ``B`` with a non-required key ``'x'``, since at runtime + the key ``'x'`` could be present and have an :term:`inconsistent + ` type (which may not be visible through ``A`` due to + :term:`structural` typing). The only exception to this rule is if the item in + ``B`` is read-only, and the value type is of top type (``object``). For + example:: class A(TypedDict): x: int @@ -785,7 +796,9 @@ Discussion: Update method ^^^^^^^^^^^^^ -In addition to existing type checking rules, type checkers should error if a TypedDict with a read-only item is updated with another TypedDict that declares that key:: +In addition to existing type checking rules, type checkers should error if a +TypedDict with a read-only item is updated with another TypedDict that declares +that key:: class A(TypedDict): x: ReadOnly[int] From ff6bee3045b6d6ec5948a714b6eade21b8cb26a8 Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Tue, 25 Jun 2024 07:46:25 -0700 Subject: [PATCH 018/308] Annotated: propose better terminology (#1769) Co-authored-by: Carl Meyer Co-authored-by: Alex Waygood --- docs/spec/qualifiers.rst | 94 ++++++++++++++++++++++++++-------------- 1 file changed, 61 insertions(+), 33 deletions(-) diff --git a/docs/spec/qualifiers.rst b/docs/spec/qualifiers.rst index 13cd842b2..33c94285e 100644 --- a/docs/spec/qualifiers.rst +++ b/docs/spec/qualifiers.rst @@ -213,21 +213,31 @@ following should be allowed:: Syntax ^^^^^^ -``Annotated`` is parameterized with a type and an arbitrary list of -Python values that represent the annotations. Here are the specific -details of the syntax: +``Annotated`` is parameterized with a *base expression* and at least one +Python value representing associated *metadata*:: -* The first argument to ``Annotated`` must be a valid type + from typing import Annotated -* Multiple type annotations are supported (``Annotated`` supports variadic + Annotated[BaseExpr, Metadata1, Metadata2, ...] + +Here are the specific details of the syntax: + +* The base expression (the first argument to ``Annotated``) must be valid + in the context where it is being used: + + * If ``Annotated`` is used in a place where arbitrary + :term:`annotation expressions ` are allowed, + the base expression may be an annotation expression. + * Otherwise, the base expression must be a valid :term:`type expression`. + +* Multiple metadata elements are supported (``Annotated`` supports variadic arguments):: Annotated[int, ValueRange(3, 10), ctype("char")] -* ``Annotated`` must be called with at least two arguments ( - ``Annotated[int]`` is not valid) +* There must be at least one metadata element (``Annotated[int]`` is not valid) -* The order of the annotations is preserved and matters for equality +* The order of the metadata is preserved and matters for equality checks:: Annotated[int, ValueRange(3, 10), ctype("char")] != Annotated[ @@ -235,19 +245,20 @@ details of the syntax: ] * Nested ``Annotated`` types are flattened, with metadata ordered - starting with the innermost annotation:: + starting with the innermost ``Annotated`` expression:: Annotated[Annotated[int, ValueRange(3, 10)], ctype("char")] == Annotated[ int, ValueRange(3, 10), ctype("char") ] -* Duplicated annotations are not removed:: +* Duplicated metadata elements are not removed:: Annotated[int, ValueRange(3, 10)] != Annotated[ int, ValueRange(3, 10), ValueRange(3, 10) ] -* ``Annotated`` can be used with nested and generic aliases:: +* ``Annotated`` can be used in definition of nested and generic aliases, + but only if it wraps a :term:`type expression`:: T = TypeVar("T") Vec = Annotated[list[tuple[T, T]], MaxLen(10)] @@ -272,33 +283,51 @@ details of the syntax: SmallInt = Annotated[int, ValueRange(0, 100)] SmallInt(1) # Type error +:pep:`593` and an earlier version of this specification used the term +"annotations" instead of "metadata" for the extra arguments to +``Annotated``. The term "annotations" is deprecated to avoid confusion +with the parameter, return, and variable annotations that are part of +the Python syntax. + +Meaning +^^^^^^^ + +The metadata provided by ``Annotated`` can be used for either static +or runtime analysis. If a library (or tool) encounters an instance of +``Annotated[T, x]`` and has no special logic for metadata element ``x``, it +should ignore it and treat the expression as equivalent to ``T``. Thus, in general, +any :term:`type expression` or :term:`annotation expression` may be +wrapped in ``Annotated`` without changing the meaning of the +wrapped expression. However, type +checkers may additionally choose to recognize particular metadata elements and use +them to implement extensions to the standard type system. + +``Annotated`` metadata may apply either to the base expression or to the symbol +being annotated, or even to some other aspect of the program. -Consuming annotations -^^^^^^^^^^^^^^^^^^^^^ +Consuming metadata +^^^^^^^^^^^^^^^^^^ -Ultimately, the responsibility of how to interpret the annotations (if +Ultimately, deciding how to interpret the metadata (if at all) is the responsibility of the tool or library encountering the ``Annotated`` type. A tool or library encountering an ``Annotated`` type -can scan through the annotations to determine if they are of interest +can scan through the metadata to determine if they are of interest (e.g., using ``isinstance()``). -**Unknown annotations:** When a tool or a library does not support -annotations or encounters an unknown annotation it should just ignore it -and treat annotated type as the underlying type. For example, when encountering -an annotation that is not an instance of ``struct2.ctype`` to the annotations -for name (e.g., ``Annotated[str, 'foo', struct2.ctype("<10s")]``), the unpack -method should ignore it. +**Unknown metadata:** When a tool or a library does not support +metadata or encounters an unknown metadata element, it should ignore it +and treat the annotation as the base expression. -**Namespacing annotations:** Namespaces are not needed for annotations since -the class used by the annotations acts as a namespace. +**Namespacing metadata:** Namespaces are not needed for metadata since +the class of the metadata object acts as a namespace. -**Multiple annotations:** It's up to the tool consuming the annotations -to decide whether the client is allowed to have several annotations on -one type and how to merge those annotations. +**Multiple metadata elements:** It's up to the tool consuming the metadata +to decide whether the client is allowed to have several metadata elements on +one annotation and how to merge those elements. -Since the ``Annotated`` type allows you to put several annotations of -the same (or different) type(s) on any node, the tools or libraries -consuming those annotations are in charge of dealing with potential +Since the ``Annotated`` type allows you to put several metadata elements of +the same (or different) type(s) on any annotation, the tools or libraries +consuming the metadata are in charge of dealing with potential duplicates. For example, if you are doing value range analysis you might allow this:: @@ -313,12 +342,11 @@ Aliases & Concerns over verbosity ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Writing ``typing.Annotated`` everywhere can be quite verbose; -fortunately, the ability to alias annotations means that in practice we +fortunately, the ability to alias types means that in practice we don't expect clients to have to write lots of boilerplate code:: - T = TypeVar('T') - Const = Annotated[T, my_annotations.CONST] + type Const[T] = Annotated[T, my_annotations.CONST] class C: - def const_method(self: Const[List[int]]) -> int: + def const_method(self, x: Const[list[int]]) -> int: ... From 149e62bf1a2c93f8323d3c13d5240bbf6dde8b73 Mon Sep 17 00:00:00 2001 From: InSync Date: Wed, 26 Jun 2024 12:51:27 +0700 Subject: [PATCH 019/308] Add missing code block marker in `generics.rst` (#1785) --- docs/spec/generics.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/spec/generics.rst b/docs/spec/generics.rst index 8637aa148..2cb3f6f65 100644 --- a/docs/spec/generics.rst +++ b/docs/spec/generics.rst @@ -1918,6 +1918,8 @@ Scoping Rules Using a type parameter from an outer scope as a default is not supported. +:: + class Foo(Generic[T1]): class Bar(Generic[T2]): ... # Type Error From 5f8da04807f21c4613d1955ad9b9c684f50bfe0b Mon Sep 17 00:00:00 2001 From: Eric Traut Date: Sat, 29 Jun 2024 14:22:52 -0700 Subject: [PATCH 020/308] =?UTF-8?q?Updated=20test=20results=20for=20pyre?= =?UTF-8?q?=200.9.22,=20mypy=201.10.1,=20and=20pyright=201.1.36=E2=80=A6?= =?UTF-8?q?=20(#1788)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Updated test results for pyre 0.9.22, mypy 1.10.1, and pyright 1.1.369. The most substantive changes were with pyre, which fixed a bunch of bugs and improved error messages. --- .../results/mypy/classes_classvar.toml | 44 ++++++++--------- .../generics_paramspec_specialization.toml | 10 ++-- conformance/results/mypy/version.toml | 4 +- .../results/pyre/aliases_typealiastype.toml | 7 ++- .../pyre/annotations_forward_refs.toml | 4 +- .../results/pyre/annotations_typeexpr.toml | 2 +- .../results/pyre/callables_annotation.toml | 5 +- .../results/pyre/classes_classvar.toml | 41 +++++++--------- .../results/pyre/dataclasses_final.toml | 14 ++---- .../results/pyre/dataclasses_frozen.toml | 12 ++--- .../results/pyre/dataclasses_kwonly.toml | 9 +++- .../pyre/dataclasses_transform_class.toml | 16 +++---- .../pyre/dataclasses_transform_func.toml | 28 ++++++----- .../pyre/dataclasses_transform_meta.toml | 10 ++-- .../results/pyre/dataclasses_usage.toml | 15 +++--- .../results/pyre/enums_member_values.toml | 4 +- conformance/results/pyre/enums_members.toml | 6 ++- .../results/pyre/generics_defaults.toml | 10 ++-- .../generics_paramspec_specialization.toml | 29 +++++------ .../results/pyre/generics_scoping.toml | 4 +- .../results/pyre/generics_self_basic.toml | 4 +- .../results/pyre/generics_type_erasure.toml | 4 +- .../pyre/generics_typevartuple_args.toml | 16 +++---- .../pyre/generics_typevartuple_basic.toml | 48 +++++++++---------- .../pyre/generics_typevartuple_callable.toml | 18 +++---- .../pyre/generics_typevartuple_concat.toml | 34 ++++++------- .../pyre/generics_typevartuple_overloads.toml | 4 +- .../generics_typevartuple_specialization.toml | 30 ++++++------ .../pyre/generics_typevartuple_unpack.toml | 16 +++---- .../pyre/literals_parameterizations.toml | 6 +-- .../results/pyre/literals_semantics.toml | 9 ++-- .../pyre/namedtuples_define_functional.toml | 6 +-- .../results/pyre/protocols_class_objects.toml | 4 +- .../results/pyre/qualifiers_annotated.toml | 2 +- .../pyre/qualifiers_final_annotation.toml | 10 +--- .../results/pyre/specialtypes_never.toml | 7 +-- .../results/pyre/tuples_type_form.toml | 15 +++--- conformance/results/pyre/tuples_unpacked.toml | 10 ++-- .../results/pyre/typeddicts_class_syntax.toml | 7 +-- .../results/pyre/typeddicts_required.toml | 5 +- conformance/results/pyre/version.toml | 4 +- .../results/pyright/classes_classvar.toml | 28 +++++------ .../generics_paramspec_components.toml | 3 +- .../generics_paramspec_specialization.toml | 10 ++-- .../results/pyright/protocols_generic.toml | 2 +- .../results/pyright/protocols_subtyping.toml | 18 +++++-- conformance/results/pyright/version.toml | 4 +- .../results/pytype/classes_classvar.toml | 44 +++++++++-------- .../generics_paramspec_specialization.toml | 32 ++++++------- conformance/results/pytype/version.toml | 2 +- conformance/results/results.html | 38 +++++++-------- conformance/tests/classes_classvar.py | 13 ++--- .../generics_paramspec_specialization.py | 15 +++--- 53 files changed, 368 insertions(+), 374 deletions(-) diff --git a/conformance/results/mypy/classes_classvar.toml b/conformance/results/mypy/classes_classvar.toml index fc940c040..91c26a60e 100644 --- a/conformance/results/mypy/classes_classvar.toml +++ b/conformance/results/mypy/classes_classvar.toml @@ -7,32 +7,32 @@ Does not reject use of ClassVar in TypeAlias definition. Does not infer type of ClassVar from assignment if no type is provided. """ output = """ -classes_classvar.py:37: error: ClassVar[...] must have at most one type argument [valid-type] -classes_classvar.py:38: error: Invalid type: try using Literal[3] instead? [valid-type] -classes_classvar.py:39: error: Name "var" is not defined [name-defined] -classes_classvar.py:44: error: ClassVar cannot contain type variables [misc] +classes_classvar.py:38: error: ClassVar[...] must have at most one type argument [valid-type] +classes_classvar.py:39: error: Invalid type: try using Literal[3] instead? [valid-type] +classes_classvar.py:40: error: Name "var" is not defined [name-defined] classes_classvar.py:45: error: ClassVar cannot contain type variables [misc] -classes_classvar.py:51: error: Incompatible types in assignment (expression has type "dict[Never, Never]", variable has type "list[str]") [assignment] -classes_classvar.py:53: error: Variable should not be annotated with both ClassVar and Final [misc] -classes_classvar.py:54: error: Invalid type: ClassVar nested inside other type [valid-type] -classes_classvar.py:60: error: Invalid type: ClassVar nested inside other type [valid-type] -classes_classvar.py:62: error: ClassVar can only be used for assignments in class body [misc] +classes_classvar.py:46: error: ClassVar cannot contain type variables [misc] +classes_classvar.py:52: error: Incompatible types in assignment (expression has type "dict[Never, Never]", variable has type "list[str]") [assignment] +classes_classvar.py:54: error: Variable should not be annotated with both ClassVar and Final [misc] +classes_classvar.py:55: error: Invalid type: ClassVar nested inside other type [valid-type] +classes_classvar.py:61: error: Invalid type: ClassVar nested inside other type [valid-type] classes_classvar.py:63: error: ClassVar can only be used for assignments in class body [misc] classes_classvar.py:64: error: ClassVar can only be used for assignments in class body [misc] -classes_classvar.py:66: error: ClassVar can only be used for assignments in class body [misc] -classes_classvar.py:70: error: ClassVar can only be used for assignments in class body [misc] -classes_classvar.py:77: error: Expression is of type "Any", not "float" [assert-type] -classes_classvar.py:101: error: Cannot assign to class variable "stats" via instance [misc] -classes_classvar.py:130: error: Incompatible types in assignment (expression has type "ProtoAImpl", variable has type "ProtoA") [assignment] -classes_classvar.py:130: note: "ProtoAImpl" is missing following "ProtoA" protocol member: -classes_classvar.py:130: note: z -classes_classvar.py:130: note: Protocol member ProtoA.x expected class variable, got instance variable -classes_classvar.py:130: note: Protocol member ProtoA.y expected class variable, got instance variable +classes_classvar.py:65: error: ClassVar can only be used for assignments in class body [misc] +classes_classvar.py:67: error: ClassVar can only be used for assignments in class body [misc] +classes_classvar.py:71: error: ClassVar can only be used for assignments in class body [misc] +classes_classvar.py:78: error: Expression is of type "Any", not "float" [assert-type] +classes_classvar.py:102: error: Cannot assign to class variable "stats" via instance [misc] +classes_classvar.py:131: error: Incompatible types in assignment (expression has type "ProtoAImpl", variable has type "ProtoA") [assignment] +classes_classvar.py:131: note: "ProtoAImpl" is missing following "ProtoA" protocol member: +classes_classvar.py:131: note: z +classes_classvar.py:131: note: Protocol member ProtoA.x expected class variable, got instance variable +classes_classvar.py:131: note: Protocol member ProtoA.y expected class variable, got instance variable """ conformance_automated = "Fail" errors_diff = """ -Line 46: Expected 1 errors -Line 71: Expected 1 errors -Line 60: Unexpected errors ['classes_classvar.py:60: error: Invalid type: ClassVar nested inside other type [valid-type]'] -Line 77: Unexpected errors ['classes_classvar.py:77: error: Expression is of type "Any", not "float" [assert-type]'] +Line 47: Expected 1 errors +Line 72: Expected 1 errors +Line 61: Unexpected errors ['classes_classvar.py:61: error: Invalid type: ClassVar nested inside other type [valid-type]'] +Line 78: Unexpected errors ['classes_classvar.py:78: error: Expression is of type "Any", not "float" [assert-type]'] """ diff --git a/conformance/results/mypy/generics_paramspec_specialization.toml b/conformance/results/mypy/generics_paramspec_specialization.toml index c705fbb80..c80fc5149 100644 --- a/conformance/results/mypy/generics_paramspec_specialization.toml +++ b/conformance/results/mypy/generics_paramspec_specialization.toml @@ -1,10 +1,10 @@ conformant = "Pass" output = """ -generics_paramspec_specialization.py:45: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "int" [misc] -generics_paramspec_specialization.py:55: error: Argument 1 has incompatible type "str"; expected "int" [arg-type] -generics_paramspec_specialization.py:56: error: Argument 3 has incompatible type "str"; expected "bool" [arg-type] -generics_paramspec_specialization.py:61: error: Argument 1 has incompatible type "str"; expected "int" [arg-type] -generics_paramspec_specialization.py:62: error: Argument 3 has incompatible type "str"; expected "bool" [arg-type] +generics_paramspec_specialization.py:44: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "int" [misc] +generics_paramspec_specialization.py:54: error: Argument 1 has incompatible type "str"; expected "int" [arg-type] +generics_paramspec_specialization.py:55: error: Argument 3 has incompatible type "str"; expected "bool" [arg-type] +generics_paramspec_specialization.py:60: error: Argument 1 has incompatible type "str"; expected "int" [arg-type] +generics_paramspec_specialization.py:61: error: Argument 3 has incompatible type "str"; expected "bool" [arg-type] """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/mypy/version.toml b/conformance/results/mypy/version.toml index e0a45142b..b39cbad6f 100644 --- a/conformance/results/mypy/version.toml +++ b/conformance/results/mypy/version.toml @@ -1,2 +1,2 @@ -version = "mypy 1.10.0" -test_duration = 1.1 +version = "mypy 1.10.1" +test_duration = 1.4 diff --git a/conformance/results/pyre/aliases_typealiastype.toml b/conformance/results/pyre/aliases_typealiastype.toml index 1e88186be..152a87de7 100644 --- a/conformance/results/pyre/aliases_typealiastype.toml +++ b/conformance/results/pyre/aliases_typealiastype.toml @@ -9,9 +9,8 @@ aliases_typealiastype.py:22:65 Undefined attribute [16]: `tuple` has no attribut aliases_typealiastype.py:27:45 Undefined attribute [16]: `list` has no attribute `__getitem__`. aliases_typealiastype.py:32:6 Undefined attribute [16]: `TypeAliasType` has no attribute `other_attrib`. aliases_typealiastype.py:35:4 Undefined or invalid type [11]: Annotation `GoodAlias4` is not defined as a type. -aliases_typealiastype.py:37:4 Undefined or invalid type [11]: Annotation `...` is not defined as a type. aliases_typealiastype.py:37:4 Undefined or invalid type [11]: Annotation `GoodAlias5` is not defined as a type. -aliases_typealiastype.py:39:4 Invalid type [31]: Expression `$local_aliases_typealiastype$GoodAlias5[(int, str, [int, str], *tuple[(int, str, int)])]` is not a valid type. +aliases_typealiastype.py:39:4 Invalid type [31]: Expression `GoodAlias5[(int, str, [int, str], *tuple[(int, str, int)])]` is not a valid type. """ conformance_automated = "Fail" errors_diff = """ @@ -39,6 +38,6 @@ Line 17: Unexpected errors ['aliases_typealiastype.py:17:41 Undefined attribute Line 22: Unexpected errors ['aliases_typealiastype.py:22:13 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[typing.Any, Type[Variable[$synthetic_attribute_resolution_variable]]]` but got `Tuple[ParamSpec, TypeVar]`.', 'aliases_typealiastype.py:22:65 Undefined attribute [16]: `tuple` has no attribute `__getitem__`.'] Line 27: Unexpected errors ['aliases_typealiastype.py:27:45 Undefined attribute [16]: `list` has no attribute `__getitem__`.'] Line 35: Unexpected errors ['aliases_typealiastype.py:35:4 Undefined or invalid type [11]: Annotation `GoodAlias4` is not defined as a type.'] -Line 37: Unexpected errors ['aliases_typealiastype.py:37:4 Undefined or invalid type [11]: Annotation `...` is not defined as a type.', 'aliases_typealiastype.py:37:4 Undefined or invalid type [11]: Annotation `GoodAlias5` is not defined as a type.'] -Line 39: Unexpected errors ['aliases_typealiastype.py:39:4 Invalid type [31]: Expression `$local_aliases_typealiastype$GoodAlias5[(int, str, [int, str], *tuple[(int, str, int)])]` is not a valid type.'] +Line 37: Unexpected errors ['aliases_typealiastype.py:37:4 Undefined or invalid type [11]: Annotation `GoodAlias5` is not defined as a type.'] +Line 39: Unexpected errors ['aliases_typealiastype.py:39:4 Invalid type [31]: Expression `GoodAlias5[(int, str, [int, str], *tuple[(int, str, int)])]` is not a valid type.'] """ diff --git a/conformance/results/pyre/annotations_forward_refs.toml b/conformance/results/pyre/annotations_forward_refs.toml index 9c41a7acc..a2cc47c12 100644 --- a/conformance/results/pyre/annotations_forward_refs.toml +++ b/conformance/results/pyre/annotations_forward_refs.toml @@ -22,7 +22,7 @@ annotations_forward_refs.py:51:9 Invalid type [31]: Expression `"1"` is not a va annotations_forward_refs.py:52:9 Invalid type [31]: Expression `"-1"` is not a valid type. annotations_forward_refs.py:53:9 Invalid type [31]: Expression `"int or str"` is not a valid type. annotations_forward_refs.py:55:9 Undefined or invalid type [11]: Annotation `types` is not defined as a type. -annotations_forward_refs.py:77:0 Uninitialized attribute [13]: Attribute `ClassC` is declared in class `ClassD` to have type `ClassC` but is never initialized. +annotations_forward_refs.py:78:4 Uninitialized attribute [13]: Attribute `ClassC` is declared in class `ClassD` to have type `ClassC` but is never initialized. annotations_forward_refs.py:80:12 Undefined or invalid type [11]: Annotation `ClassF` is not defined as a type. annotations_forward_refs.py:87:7 Undefined or invalid type [11]: Annotation `ClassD.int` is not defined as a type. annotations_forward_refs.py:100:7 Undefined or invalid type [11]: Annotation ` @@ -36,7 +36,7 @@ Line 25: Expected 1 errors Line 54: Expected 1 errors Line 66: Expected 1 errors Line 89: Expected 1 errors -Line 77: Unexpected errors ['annotations_forward_refs.py:77:0 Uninitialized attribute [13]: Attribute `ClassC` is declared in class `ClassD` to have type `ClassC` but is never initialized.'] +Line 78: Unexpected errors ['annotations_forward_refs.py:78:4 Uninitialized attribute [13]: Attribute `ClassC` is declared in class `ClassD` to have type `ClassC` but is never initialized.'] Line 87: Unexpected errors ['annotations_forward_refs.py:87:7 Undefined or invalid type [11]: Annotation `ClassD.int` is not defined as a type.'] Line 100: Unexpected errors ['annotations_forward_refs.py:100:7 Undefined or invalid type [11]: Annotation `'] """ diff --git a/conformance/results/pyre/annotations_typeexpr.toml b/conformance/results/pyre/annotations_typeexpr.toml index f3a6f06cd..457e5a3d2 100644 --- a/conformance/results/pyre/annotations_typeexpr.toml +++ b/conformance/results/pyre/annotations_typeexpr.toml @@ -3,7 +3,7 @@ output = """ annotations_typeexpr.py:88:8 Invalid type [31]: Expression `eval("".join(map(chr, [105, 110, 116])))` is not a valid type. annotations_typeexpr.py:89:8 Invalid type [31]: Expression `[int, str]` is not a valid type. annotations_typeexpr.py:90:8 Invalid type [31]: Expression `(int, str)` is not a valid type. -annotations_typeexpr.py:91:8 Invalid type [31]: Expression `comprehension(int for generators(generator($target$i in range(1) if )))` is not a valid type. +annotations_typeexpr.py:91:8 Invalid type [31]: Expression `comprehension(int for generators(generator(i in range(1) if )))` is not a valid type. annotations_typeexpr.py:92:8 Invalid type [31]: Expression `{ }` is not a valid type. annotations_typeexpr.py:93:8 Invalid type [31]: Expression `lambda () (int)()` is not a valid type. annotations_typeexpr.py:94:8 Invalid type [31]: Expression `[int][0]` is not a valid type. diff --git a/conformance/results/pyre/callables_annotation.toml b/conformance/results/pyre/callables_annotation.toml index 900125346..384310ba3 100644 --- a/conformance/results/pyre/callables_annotation.toml +++ b/conformance/results/pyre/callables_annotation.toml @@ -1,7 +1,6 @@ conformant = "Partial" notes = """ Does not evaluate correct type for `*args: int` parameter. -Does not reject illegal form `Callable[[...], int]`. Does not correctly implement type compatibility rules for "...". Does not treat "*args: Any, **kwargs: Any" as "...". """ @@ -15,10 +14,11 @@ callables_annotation.py:55:4 Invalid type [31]: Expression `typing.Callable[int] callables_annotation.py:56:4 Invalid type [31]: Expression `typing.Callable[(int, int)]` is not a valid type. callables_annotation.py:57:4 Invalid type [31]: Expression `typing.Callable[([], [int])]` is not a valid type. callables_annotation.py:58:4 Invalid type [31]: Expression `typing.Callable[(int, int, int)]` is not a valid type. -callables_annotation.py:59:4 Undefined or invalid type [11]: Annotation `...` is not defined as a type. +callables_annotation.py:59:4 Invalid type [31]: Expression `typing.Callable[([...], int)]` is not a valid type. callables_annotation.py:89:5 Invalid type [31]: Expression `typing.Callable[(typing.Concatenate[(int, ...)], str)]` is not a valid type. callables_annotation.py:145:8 Invalid type [31]: Expression `typing.Callable[(typing.Concatenate[(int, ...)], None)]` is not a valid type. callables_annotation.py:151:9 Invalid type [31]: Expression `typing.Callable[(typing.Concatenate[(int, ...)], None)]` is not a valid type. +callables_annotation.py:156:4 Incompatible variable type [9]: ok10 is declared to have type `Proto3` but is used as type `Proto4[[...]]`. callables_annotation.py:157:4 Incompatible variable type [9]: ok11 is declared to have type `Proto6` but is used as type `Proto7`. callables_annotation.py:159:4 Incompatible variable type [9]: err1 is declared to have type `Proto5[typing.Any]` but is used as type `Proto8`. callables_annotation.py:166:0 Incompatible variable type [9]: Callback1 is declared to have type `TypeAlias` but is used as type `Type[typing.Callable[..., str]]`. @@ -39,6 +39,7 @@ Line 93: Expected 1 errors Line 89: Unexpected errors ['callables_annotation.py:89:5 Invalid type [31]: Expression `typing.Callable[(typing.Concatenate[(int, ...)], str)]` is not a valid type.'] Line 145: Unexpected errors ['callables_annotation.py:145:8 Invalid type [31]: Expression `typing.Callable[(typing.Concatenate[(int, ...)], None)]` is not a valid type.'] Line 151: Unexpected errors ['callables_annotation.py:151:9 Invalid type [31]: Expression `typing.Callable[(typing.Concatenate[(int, ...)], None)]` is not a valid type.'] +Line 156: Unexpected errors ['callables_annotation.py:156:4 Incompatible variable type [9]: ok10 is declared to have type `Proto3` but is used as type `Proto4[[...]]`.'] Line 157: Unexpected errors ['callables_annotation.py:157:4 Incompatible variable type [9]: ok11 is declared to have type `Proto6` but is used as type `Proto7`.'] Line 166: Unexpected errors ['callables_annotation.py:166:0 Incompatible variable type [9]: Callback1 is declared to have type `TypeAlias` but is used as type `Type[typing.Callable[..., str]]`.'] Line 167: Unexpected errors ['callables_annotation.py:167:0 Incompatible variable type [9]: Callback2 is declared to have type `TypeAlias` but is used as type `Type[typing.Callable[..., str]]`.'] diff --git a/conformance/results/pyre/classes_classvar.toml b/conformance/results/pyre/classes_classvar.toml index 9c4e661ca..b5dd9e022 100644 --- a/conformance/results/pyre/classes_classvar.toml +++ b/conformance/results/pyre/classes_classvar.toml @@ -11,35 +11,30 @@ Does not reject use of ClassVar in type alias definition. Does not infer type from initialization for bare ClassVar. """ output = """ -classes_classvar.py:34:0 Uninitialized attribute [13]: Attribute `bad1` is declared in class `ClassA` to have type `typing.Any` but is never initialized. -classes_classvar.py:34:0 Uninitialized attribute [13]: Attribute `bad4` is declared in class `ClassA` to have type `Variable[T]` but is never initialized. -classes_classvar.py:34:0 Uninitialized attribute [13]: Attribute `bad5` is declared in class `ClassA` to have type `typing.List[Variable[T]]` but is never initialized. -classes_classvar.py:34:0 Uninitialized attribute [13]: Attribute `bad6` is declared in class `ClassA` to have type `typing.Callable[classes_classvar.P, typing.Any]` but is never initialized. -classes_classvar.py:37:10 Invalid type parameters [24]: Generic type `CV` expects 1 type parameter, received 2. -classes_classvar.py:38:10 Invalid type [31]: Expression `typing.ClassVar[3]` is not a valid type. -classes_classvar.py:39:13 Unbound name [10]: Name `var` is used but not defined in the current scope. -classes_classvar.py:51:4 Incompatible attribute type [8]: Attribute `bad8` declared in class `ClassA` has type `List[str]` but is used as type `Dict[Variable[_KT], Variable[_VT]]`. -classes_classvar.py:64:8 Undefined attribute [16]: `ClassA` has no attribute `xx`. -classes_classvar.py:67:8 Incompatible return type [7]: Expected `CV[int]` but got `int`. -classes_classvar.py:77:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `float` but got `typing.Any`. -classes_classvar.py:80:0 Uninitialized attribute [13]: Attribute `damage` is declared in class `BasicStarship` to have type `int` but is never initialized. -classes_classvar.py:101:0 Invalid assignment [41]: Assigning to class variable through instance, did you mean to assign to `Starship.stats` instead? -classes_classvar.py:130:0 Incompatible variable type [9]: a is declared to have type `ProtoA` but is used as type `ProtoAImpl`. +classes_classvar.py:38:10 Invalid type parameters [24]: Generic type `CV` expects 1 type parameter, received 2. +classes_classvar.py:39:10 Invalid type [31]: Expression `typing.ClassVar[3]` is not a valid type. +classes_classvar.py:40:13 Unbound name [10]: Name `var` is used but not defined in the current scope. +classes_classvar.py:52:4 Incompatible attribute type [8]: Attribute `bad8` declared in class `ClassA` has type `List[str]` but is used as type `Dict[Variable[_KT], Variable[_VT]]`. +classes_classvar.py:65:8 Undefined attribute [16]: `ClassA` has no attribute `xx`. +classes_classvar.py:68:8 Incompatible return type [7]: Expected `CV[int]` but got `int`. +classes_classvar.py:78:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `float` but got `typing.Any`. +classes_classvar.py:83:4 Uninitialized attribute [13]: Attribute `damage` is declared in class `BasicStarship` to have type `int` but is never initialized. +classes_classvar.py:102:0 Invalid assignment [41]: Assigning to class variable through instance, did you mean to assign to `Starship.stats` instead? +classes_classvar.py:131:0 Incompatible variable type [9]: a is declared to have type `ProtoA` but is used as type `ProtoAImpl`. """ conformance_automated = "Fail" errors_diff = """ -Line 44: Expected 1 errors Line 45: Expected 1 errors Line 46: Expected 1 errors -Line 53: Expected 1 errors +Line 47: Expected 1 errors Line 54: Expected 1 errors -Line 62: Expected 1 errors +Line 55: Expected 1 errors Line 63: Expected 1 errors -Line 66: Expected 1 errors -Line 70: Expected 1 errors +Line 64: Expected 1 errors +Line 67: Expected 1 errors Line 71: Expected 1 errors -Line 34: Unexpected errors ['classes_classvar.py:34:0 Uninitialized attribute [13]: Attribute `bad1` is declared in class `ClassA` to have type `typing.Any` but is never initialized.', 'classes_classvar.py:34:0 Uninitialized attribute [13]: Attribute `bad4` is declared in class `ClassA` to have type `Variable[T]` but is never initialized.', 'classes_classvar.py:34:0 Uninitialized attribute [13]: Attribute `bad5` is declared in class `ClassA` to have type `typing.List[Variable[T]]` but is never initialized.', 'classes_classvar.py:34:0 Uninitialized attribute [13]: Attribute `bad6` is declared in class `ClassA` to have type `typing.Callable[classes_classvar.P, typing.Any]` but is never initialized.'] -Line 67: Unexpected errors ['classes_classvar.py:67:8 Incompatible return type [7]: Expected `CV[int]` but got `int`.'] -Line 77: Unexpected errors ['classes_classvar.py:77:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `float` but got `typing.Any`.'] -Line 80: Unexpected errors ['classes_classvar.py:80:0 Uninitialized attribute [13]: Attribute `damage` is declared in class `BasicStarship` to have type `int` but is never initialized.'] +Line 72: Expected 1 errors +Line 68: Unexpected errors ['classes_classvar.py:68:8 Incompatible return type [7]: Expected `CV[int]` but got `int`.'] +Line 78: Unexpected errors ['classes_classvar.py:78:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `float` but got `typing.Any`.'] +Line 83: Unexpected errors ['classes_classvar.py:83:4 Uninitialized attribute [13]: Attribute `damage` is declared in class `BasicStarship` to have type `int` but is never initialized.'] """ diff --git a/conformance/results/pyre/dataclasses_final.toml b/conformance/results/pyre/dataclasses_final.toml index 00886a3ba..c579f1329 100644 --- a/conformance/results/pyre/dataclasses_final.toml +++ b/conformance/results/pyre/dataclasses_final.toml @@ -1,17 +1,9 @@ -conformant = "Partial" -notes = """ -Mis-handles Final nested inside ClassVar. -""" -conformance_automated = "Fail" +conformant = "Pass" +conformance_automated = "Pass" errors_diff = """ -Line 18: Unexpected errors ['dataclasses_final.py:18:4 Incompatible attribute type [8]: Attribute `final_classvar` declared in class `D` has type `Final[int]` but is used as type `int`.', 'dataclasses_final.py:18:4 Invalid type [31]: Expression `Final[int]` is not a valid type. Final cannot be nested.'] -Line 24: Unexpected errors ['dataclasses_final.py:24:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `Final[int]`.'] """ output = """ -dataclasses_final.py:18:4 Incompatible attribute type [8]: Attribute `final_classvar` declared in class `D` has type `Final[int]` but is used as type `int`. -dataclasses_final.py:18:4 Invalid type [31]: Expression `Final[int]` is not a valid type. Final cannot be nested. -dataclasses_final.py:24:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `Final[int]`. -dataclasses_final.py:27:0 Incompatible attribute type [8]: Attribute `final_classvar` declared in class `D` has type `Final[int]` but is used as type `int`. +dataclasses_final.py:27:0 Invalid assignment [41]: Cannot reassign final attribute `D.final_classvar`. dataclasses_final.py:35:0 Invalid assignment [41]: Cannot reassign final attribute `d.final_no_default`. dataclasses_final.py:36:0 Invalid assignment [41]: Cannot reassign final attribute `d.final_with_default`. dataclasses_final.py:37:0 Invalid assignment [41]: Cannot reassign final attribute `D.final_no_default`. diff --git a/conformance/results/pyre/dataclasses_frozen.toml b/conformance/results/pyre/dataclasses_frozen.toml index 109a4dbeb..410c163f9 100644 --- a/conformance/results/pyre/dataclasses_frozen.toml +++ b/conformance/results/pyre/dataclasses_frozen.toml @@ -1,14 +1,10 @@ -conformant = "Partial" -notes = """ -Does not reject frozen dataclass inherited from non-frozen dataclass. -Does not reject non-frozen dataclass inherited from frozen dataclass. -""" +conformant = "Pass" output = """ dataclasses_frozen.py:16:0 Invalid assignment [41]: Cannot reassign final attribute `dc1.a`. dataclasses_frozen.py:17:0 Invalid assignment [41]: Cannot reassign final attribute `dc1.b`. +dataclasses_frozen.py:23:0 Invalid inheritance [39]: Non-frozen dataclass `DC2` cannot inherit from frozen dataclass `DC1`. +dataclasses_frozen.py:33:0 Invalid inheritance [39]: Frozen dataclass `DC4` cannot inherit from non-frozen dataclass `DC3`. """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Lines 22, 23: Expected error (tag 'DC2') -Lines 32, 33: Expected error (tag 'DC4') """ diff --git a/conformance/results/pyre/dataclasses_kwonly.toml b/conformance/results/pyre/dataclasses_kwonly.toml index 7ee1c34ef..9e66c08f0 100644 --- a/conformance/results/pyre/dataclasses_kwonly.toml +++ b/conformance/results/pyre/dataclasses_kwonly.toml @@ -1,9 +1,14 @@ -conformant = "Pass" +conformant = "Partial" +notes = """ +Rejects legitimate use of dataclass field with `kw_only=True`. +""" output = """ dataclasses_kwonly.py:23:0 Too many arguments [19]: Call `DC1.__init__` expects 1 positional argument, 2 were provided. dataclasses_kwonly.py:38:0 Too many arguments [19]: Call `DC2.__init__` expects 1 positional argument, 2 were provided. dataclasses_kwonly.py:53:0 Too many arguments [19]: Call `DC3.__init__` expects 1 positional argument, 2 were provided. +dataclasses_kwonly.py:61:0 Unexpected keyword [28]: Unexpected keyword argument `b` to call `DC4.__init__`. """ -conformance_automated = "Pass" +conformance_automated = "Fail" errors_diff = """ +Line 61: Unexpected errors ['dataclasses_kwonly.py:61:0 Unexpected keyword [28]: Unexpected keyword argument `b` to call `DC4.__init__`.'] """ diff --git a/conformance/results/pyre/dataclasses_transform_class.toml b/conformance/results/pyre/dataclasses_transform_class.toml index e340ff43a..3c0b52dbd 100644 --- a/conformance/results/pyre/dataclasses_transform_class.toml +++ b/conformance/results/pyre/dataclasses_transform_class.toml @@ -1,24 +1,24 @@ conformant = "Partial" notes = """ -Does not validate when a non-frozen model derives from a frozen one. Does not support field specifiers. +Emits "attribute not initialized" error for dataclass field. """ output = """ -dataclasses_transform_class.py:27:0 Uninitialized attribute [13]: Attribute `not_a_field` is declared in class `ModelBase` to have type `str` but is never initialized. +dataclasses_transform_class.py:28:4 Uninitialized attribute [13]: Attribute `not_a_field` is declared in class `ModelBase` to have type `str` but is never initialized. +dataclasses_transform_class.py:48:0 Invalid inheritance [39]: Non-frozen dataclass `Customer1Subclass` cannot inherit from frozen dataclass `Customer1`. dataclasses_transform_class.py:57:7 Unexpected keyword [28]: Unexpected keyword argument `other_name` to call `Customer1.__init__`. dataclasses_transform_class.py:60:0 Invalid assignment [41]: Cannot reassign final attribute `c1_1.id`. dataclasses_transform_class.py:63:7 Too many arguments [19]: Call `Customer1.__init__` expects 0 positional arguments, 2 were provided. dataclasses_transform_class.py:69:5 Unsupported operand [58]: `<` is not supported for operand types `Customer1` and `Customer1`. dataclasses_transform_class.py:79:7 Too many arguments [19]: Call `Customer2.__init__` expects 0 positional arguments, 2 were provided. -dataclasses_transform_class.py:86:0 Uninitialized attribute [13]: Attribute `not_a_field` is declared in class `GenericModelBase` to have type `Variable[T]` but is never initialized. -dataclasses_transform_class.py:107:0 Uninitialized attribute [13]: Attribute `not_a_field` is declared in class `ModelBaseFrozen` to have type `str` but is never initialized. +dataclasses_transform_class.py:87:4 Uninitialized attribute [13]: Attribute `not_a_field` is declared in class `GenericModelBase` to have type `Variable[T]` but is never initialized. +dataclasses_transform_class.py:108:4 Uninitialized attribute [13]: Attribute `not_a_field` is declared in class `ModelBaseFrozen` to have type `str` but is never initialized. dataclasses_transform_class.py:119:0 Invalid assignment [41]: Cannot reassign final attribute `c3_1.id`. """ conformance_automated = "Fail" errors_diff = """ -Line 48: Expected 1 errors -Line 27: Unexpected errors ['dataclasses_transform_class.py:27:0 Uninitialized attribute [13]: Attribute `not_a_field` is declared in class `ModelBase` to have type `str` but is never initialized.'] +Line 28: Unexpected errors ['dataclasses_transform_class.py:28:4 Uninitialized attribute [13]: Attribute `not_a_field` is declared in class `ModelBase` to have type `str` but is never initialized.'] Line 57: Unexpected errors ['dataclasses_transform_class.py:57:7 Unexpected keyword [28]: Unexpected keyword argument `other_name` to call `Customer1.__init__`.'] -Line 86: Unexpected errors ['dataclasses_transform_class.py:86:0 Uninitialized attribute [13]: Attribute `not_a_field` is declared in class `GenericModelBase` to have type `Variable[T]` but is never initialized.'] -Line 107: Unexpected errors ['dataclasses_transform_class.py:107:0 Uninitialized attribute [13]: Attribute `not_a_field` is declared in class `ModelBaseFrozen` to have type `str` but is never initialized.'] +Line 87: Unexpected errors ['dataclasses_transform_class.py:87:4 Uninitialized attribute [13]: Attribute `not_a_field` is declared in class `GenericModelBase` to have type `Variable[T]` but is never initialized.'] +Line 108: Unexpected errors ['dataclasses_transform_class.py:108:4 Uninitialized attribute [13]: Attribute `not_a_field` is declared in class `ModelBaseFrozen` to have type `str` but is never initialized.'] """ diff --git a/conformance/results/pyre/dataclasses_transform_func.toml b/conformance/results/pyre/dataclasses_transform_func.toml index 461f76dc0..2f69091f4 100644 --- a/conformance/results/pyre/dataclasses_transform_func.toml +++ b/conformance/results/pyre/dataclasses_transform_func.toml @@ -1,18 +1,18 @@ conformant = "Partial" notes = """ -Does not understand @dataclass_transform when it is -applied only to overloads of a decorator but not the -definition. +Does not understand @dataclass_transform when it is applied only to overloads of a decorator but not the definition. +Does not detect non-frozen class inheriting from frozen class. +Emits "attribute not initialized" error for dataclass field. """ output = """ dataclasses_transform_func.py:20:0 Incompatible overload [43]: The implementation of `create_model` does not accept all possible arguments of overload defined on line `20`. dataclasses_transform_func.py:25:5 Invalid type variable [34]: The type variable `Variable[T]` isn't present in the function's parameters. dataclasses_transform_func.py:29:0 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s). -dataclasses_transform_func.py:34:0 Uninitialized attribute [13]: Attribute `id` is declared in class `Customer1` to have type `int` but is never initialized. -dataclasses_transform_func.py:34:0 Uninitialized attribute [13]: Attribute `name` is declared in class `Customer1` to have type `str` but is never initialized. -dataclasses_transform_func.py:40:0 Uninitialized attribute [13]: Attribute `id` is declared in class `Customer2` to have type `int` but is never initialized. -dataclasses_transform_func.py:40:0 Uninitialized attribute [13]: Attribute `name` is declared in class `Customer2` to have type `str` but is never initialized. -dataclasses_transform_func.py:46:0 Uninitialized attribute [13]: Attribute `salary` is declared in class `Customer2Subclass` to have type `float` but is never initialized. +dataclasses_transform_func.py:35:4 Uninitialized attribute [13]: Attribute `id` is declared in class `Customer1` to have type `int` but is never initialized. +dataclasses_transform_func.py:36:4 Uninitialized attribute [13]: Attribute `name` is declared in class `Customer1` to have type `str` but is never initialized. +dataclasses_transform_func.py:41:4 Uninitialized attribute [13]: Attribute `id` is declared in class `Customer2` to have type `int` but is never initialized. +dataclasses_transform_func.py:42:4 Uninitialized attribute [13]: Attribute `name` is declared in class `Customer2` to have type `str` but is never initialized. +dataclasses_transform_func.py:47:4 Uninitialized attribute [13]: Attribute `salary` is declared in class `Customer2Subclass` to have type `float` but is never initialized. dataclasses_transform_func.py:50:7 Unexpected keyword [28]: Unexpected keyword argument `id` to call `object.__init__`. dataclasses_transform_func.py:53:7 Too many arguments [19]: Call `object.__init__` expects 0 positional arguments, 2 were provided. dataclasses_transform_func.py:57:0 Incompatible attribute type [8]: Attribute `name` declared in class `Customer1` has type `str` but is used as type `int`. @@ -21,19 +21,23 @@ dataclasses_transform_func.py:65:7 Unexpected keyword [28]: Unexpected keyword a dataclasses_transform_func.py:67:7 Unexpected keyword [28]: Unexpected keyword argument `id` to call `object.__init__`. dataclasses_transform_func.py:71:7 Too many arguments [19]: Call `object.__init__` expects 0 positional arguments, 2 were provided. dataclasses_transform_func.py:73:5 Unsupported operand [58]: `<` is not supported for operand types `Customer2` and `Customer2`. -dataclasses_transform_func.py:90:0 Uninitialized attribute [13]: Attribute `age` is declared in class `Customer3Subclass` to have type `int` but is never initialized. +dataclasses_transform_func.py:91:4 Uninitialized attribute [13]: Attribute `age` is declared in class `Customer3Subclass` to have type `int` but is never initialized. dataclasses_transform_func.py:97:0 Invalid assignment [41]: Cannot reassign final attribute `c3_1.id`. """ conformance_automated = "Fail" errors_diff = """ +Lines 89, 90: Expected error (tag 'Customer3Subclass') Line 20: Unexpected errors ['dataclasses_transform_func.py:20:0 Incompatible overload [43]: The implementation of `create_model` does not accept all possible arguments of overload defined on line `20`.'] Line 25: Unexpected errors ["dataclasses_transform_func.py:25:5 Invalid type variable [34]: The type variable `Variable[T]` isn't present in the function's parameters."] Line 29: Unexpected errors ['dataclasses_transform_func.py:29:0 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).'] -Line 34: Unexpected errors ['dataclasses_transform_func.py:34:0 Uninitialized attribute [13]: Attribute `id` is declared in class `Customer1` to have type `int` but is never initialized.', 'dataclasses_transform_func.py:34:0 Uninitialized attribute [13]: Attribute `name` is declared in class `Customer1` to have type `str` but is never initialized.'] -Line 40: Unexpected errors ['dataclasses_transform_func.py:40:0 Uninitialized attribute [13]: Attribute `id` is declared in class `Customer2` to have type `int` but is never initialized.', 'dataclasses_transform_func.py:40:0 Uninitialized attribute [13]: Attribute `name` is declared in class `Customer2` to have type `str` but is never initialized.'] -Line 46: Unexpected errors ['dataclasses_transform_func.py:46:0 Uninitialized attribute [13]: Attribute `salary` is declared in class `Customer2Subclass` to have type `float` but is never initialized.'] +Line 35: Unexpected errors ['dataclasses_transform_func.py:35:4 Uninitialized attribute [13]: Attribute `id` is declared in class `Customer1` to have type `int` but is never initialized.'] +Line 36: Unexpected errors ['dataclasses_transform_func.py:36:4 Uninitialized attribute [13]: Attribute `name` is declared in class `Customer1` to have type `str` but is never initialized.'] +Line 41: Unexpected errors ['dataclasses_transform_func.py:41:4 Uninitialized attribute [13]: Attribute `id` is declared in class `Customer2` to have type `int` but is never initialized.'] +Line 42: Unexpected errors ['dataclasses_transform_func.py:42:4 Uninitialized attribute [13]: Attribute `name` is declared in class `Customer2` to have type `str` but is never initialized.'] +Line 47: Unexpected errors ['dataclasses_transform_func.py:47:4 Uninitialized attribute [13]: Attribute `salary` is declared in class `Customer2Subclass` to have type `float` but is never initialized.'] Line 50: Unexpected errors ['dataclasses_transform_func.py:50:7 Unexpected keyword [28]: Unexpected keyword argument `id` to call `object.__init__`.'] Line 53: Unexpected errors ['dataclasses_transform_func.py:53:7 Too many arguments [19]: Call `object.__init__` expects 0 positional arguments, 2 were provided.'] Line 67: Unexpected errors ['dataclasses_transform_func.py:67:7 Unexpected keyword [28]: Unexpected keyword argument `id` to call `object.__init__`.'] Line 73: Unexpected errors ['dataclasses_transform_func.py:73:5 Unsupported operand [58]: `<` is not supported for operand types `Customer2` and `Customer2`.'] +Line 91: Unexpected errors ['dataclasses_transform_func.py:91:4 Uninitialized attribute [13]: Attribute `age` is declared in class `Customer3Subclass` to have type `int` but is never initialized.'] """ diff --git a/conformance/results/pyre/dataclasses_transform_meta.toml b/conformance/results/pyre/dataclasses_transform_meta.toml index b773b53e4..66f13cb29 100644 --- a/conformance/results/pyre/dataclasses_transform_meta.toml +++ b/conformance/results/pyre/dataclasses_transform_meta.toml @@ -1,9 +1,13 @@ conformant = "Partial" notes = """ Does not understand custom field specifiers. +Incorrectly rejects frozen dataclass that inherits from non-frozen. +Emits "attribute not initialized" error for dataclass field. """ output = """ -dataclasses_transform_meta.py:25:0 Uninitialized attribute [13]: Attribute `not_a_field` is declared in class `ModelMeta` to have type `str` but is never initialized. +dataclasses_transform_meta.py:26:4 Uninitialized attribute [13]: Attribute `not_a_field` is declared in class `ModelMeta` to have type `str` but is never initialized. +dataclasses_transform_meta.py:40:0 Invalid inheritance [39]: Frozen dataclass `Customer1` cannot inherit from non-frozen dataclass `ModelBase`. +dataclasses_transform_meta.py:48:0 Invalid inheritance [39]: Non-frozen dataclass `Customer1Subclass` cannot inherit from frozen dataclass `Customer1`. dataclasses_transform_meta.py:57:7 Unexpected keyword [28]: Unexpected keyword argument `other_name` to call `Customer1.__init__`. dataclasses_transform_meta.py:60:0 Invalid assignment [41]: Cannot reassign final attribute `c1_1.id`. dataclasses_transform_meta.py:63:7 Too many arguments [19]: Call `Customer1.__init__` expects 0 positional arguments, 2 were provided. @@ -13,7 +17,7 @@ dataclasses_transform_meta.py:100:0 Invalid assignment [41]: Cannot reassign fin """ conformance_automated = "Fail" errors_diff = """ -Line 48: Expected 1 errors -Line 25: Unexpected errors ['dataclasses_transform_meta.py:25:0 Uninitialized attribute [13]: Attribute `not_a_field` is declared in class `ModelMeta` to have type `str` but is never initialized.'] +Line 26: Unexpected errors ['dataclasses_transform_meta.py:26:4 Uninitialized attribute [13]: Attribute `not_a_field` is declared in class `ModelMeta` to have type `str` but is never initialized.'] +Line 40: Unexpected errors ['dataclasses_transform_meta.py:40:0 Invalid inheritance [39]: Frozen dataclass `Customer1` cannot inherit from non-frozen dataclass `ModelBase`.'] Line 57: Unexpected errors ['dataclasses_transform_meta.py:57:7 Unexpected keyword [28]: Unexpected keyword argument `other_name` to call `Customer1.__init__`.'] """ diff --git a/conformance/results/pyre/dataclasses_usage.toml b/conformance/results/pyre/dataclasses_usage.toml index c3feb171e..c9c1c81c6 100644 --- a/conformance/results/pyre/dataclasses_usage.toml +++ b/conformance/results/pyre/dataclasses_usage.toml @@ -1,7 +1,6 @@ conformant = "Partial" notes = """ Does not report error when field with no default follows field with default. -Incorrectly reports error with InitVar that has default value. Complains on `assert_type` when used for bound methods vs `Callable`. Does not understand `__dataclass_fields__`. """ @@ -9,16 +8,15 @@ output = """ dataclasses_usage.py:50:5 Missing argument [20]: Call `InventoryItem.__init__` expects argument `unit_price`. dataclasses_usage.py:51:27 Incompatible parameter type [6]: In call `InventoryItem.__init__`, for 2nd positional argument, expected `float` but got `str`. dataclasses_usage.py:52:5 Too many arguments [19]: Call `InventoryItem.__init__` expects 3 positional arguments, 4 were provided. -dataclasses_usage.py:72:4 Incompatible attribute type [8]: Attribute `a` declared in class `DC3` has type `InitVar[int]` but is used as type `int`. dataclasses_usage.py:72:4 Undefined attribute [16]: `typing.Type` has no attribute `a`. dataclasses_usage.py:83:5 Too many arguments [19]: Call `DC4.__init__` expects 1 positional argument, 2 were provided. dataclasses_usage.py:88:4 Incompatible attribute type [8]: Attribute `a` declared in class `DC5` has type `int` but is used as type `str`. dataclasses_usage.py:106:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing.Callable[[str], int]` but got `BoundMethod[typing.Callable[[str], int], DC6]`. -dataclasses_usage.py:115:0 Uninitialized attribute [13]: Attribute `y` is declared in class `DC8` to have type `int` but is never initialized. +dataclasses_usage.py:116:4 Uninitialized attribute [13]: Attribute `y` is declared in class `DC8` to have type `int` but is never initialized. dataclasses_usage.py:126:0 Too many arguments [19]: Call `DC7.__init__` expects 1 positional argument, 2 were provided. dataclasses_usage.py:129:0 Missing argument [20]: Call `DC8.__init__` expects argument `y`. -dataclasses_usage.py:171:0 Uninitialized attribute [13]: Attribute `x` is declared in class `DC13` to have type `int` but is never initialized. -dataclasses_usage.py:171:0 Uninitialized attribute [13]: Attribute `x_squared` is declared in class `DC13` to have type `int` but is never initialized. +dataclasses_usage.py:172:4 Uninitialized attribute [13]: Attribute `x` is declared in class `DC13` to have type `int` but is never initialized. +dataclasses_usage.py:173:4 Uninitialized attribute [13]: Attribute `x_squared` is declared in class `DC13` to have type `int` but is never initialized. dataclasses_usage.py:178:0 Too many arguments [19]: Call `object.__init__` expects 0 positional arguments, 1 was provided. dataclasses_usage.py:204:0 Incompatible variable type [9]: v7 is declared to have type `DataclassProto` but is used as type `DC15`. dataclasses_usage.py:212:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `DC16[int]` but got `DC16[typing_extensions.Literal[1]]`. @@ -28,10 +26,11 @@ errors_diff = """ Lines 58, 61: Expected error (tag 'DC1') Lines 64, 67: Expected error (tag 'DC2') Lines 70, 73: Expected error (tag 'DC3') -Line 72: Unexpected errors ['dataclasses_usage.py:72:4 Incompatible attribute type [8]: Attribute `a` declared in class `DC3` has type `InitVar[int]` but is used as type `int`.', 'dataclasses_usage.py:72:4 Undefined attribute [16]: `typing.Type` has no attribute `a`.'] +Line 72: Unexpected errors ['dataclasses_usage.py:72:4 Undefined attribute [16]: `typing.Type` has no attribute `a`.'] Line 106: Unexpected errors ['dataclasses_usage.py:106:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing.Callable[[str], int]` but got `BoundMethod[typing.Callable[[str], int], DC6]`.'] -Line 115: Unexpected errors ['dataclasses_usage.py:115:0 Uninitialized attribute [13]: Attribute `y` is declared in class `DC8` to have type `int` but is never initialized.'] -Line 171: Unexpected errors ['dataclasses_usage.py:171:0 Uninitialized attribute [13]: Attribute `x` is declared in class `DC13` to have type `int` but is never initialized.', 'dataclasses_usage.py:171:0 Uninitialized attribute [13]: Attribute `x_squared` is declared in class `DC13` to have type `int` but is never initialized.'] +Line 116: Unexpected errors ['dataclasses_usage.py:116:4 Uninitialized attribute [13]: Attribute `y` is declared in class `DC8` to have type `int` but is never initialized.'] +Line 172: Unexpected errors ['dataclasses_usage.py:172:4 Uninitialized attribute [13]: Attribute `x` is declared in class `DC13` to have type `int` but is never initialized.'] +Line 173: Unexpected errors ['dataclasses_usage.py:173:4 Uninitialized attribute [13]: Attribute `x_squared` is declared in class `DC13` to have type `int` but is never initialized.'] Line 204: Unexpected errors ['dataclasses_usage.py:204:0 Incompatible variable type [9]: v7 is declared to have type `DataclassProto` but is used as type `DC15`.'] Line 212: Unexpected errors ['dataclasses_usage.py:212:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `DC16[int]` but got `DC16[typing_extensions.Literal[1]]`.'] """ diff --git a/conformance/results/pyre/enums_member_values.toml b/conformance/results/pyre/enums_member_values.toml index 2cac7f64f..842417414 100644 --- a/conformance/results/pyre/enums_member_values.toml +++ b/conformance/results/pyre/enums_member_values.toml @@ -9,7 +9,7 @@ conformance_automated = "Fail" errors_diff = """ Line 78: Expected 1 errors Line 85: Expected 1 errors -Line 75: Unexpected errors ['enums_member_values.py:75:0 Uninitialized attribute [13]: Attribute `_value_` is declared in class `Color3` to have type `Color3` but is never initialized.'] +Line 76: Unexpected errors ['enums_member_values.py:76:4 Uninitialized attribute [13]: Attribute `_value_` is declared in class `Color3` to have type `Color3` but is never initialized.'] """ output = """ enums_member_values.py:21:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[1]` but got `typing.Any`. @@ -18,6 +18,6 @@ enums_member_values.py:26:4 Incompatible parameter type [6]: In call `assert_typ enums_member_values.py:30:4 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Union[typing_extensions.Literal[1], typing_extensions.Literal[2], typing_extensions.Literal[3]]` but got `typing.Any`. enums_member_values.py:54:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[1]` but got `typing.Any`. enums_member_values.py:68:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[1]` but got `typing.Any`. -enums_member_values.py:75:0 Uninitialized attribute [13]: Attribute `_value_` is declared in class `Color3` to have type `Color3` but is never initialized. +enums_member_values.py:76:4 Uninitialized attribute [13]: Attribute `_value_` is declared in class `Color3` to have type `Color3` but is never initialized. enums_member_values.py:96:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `typing.Any`. """ diff --git a/conformance/results/pyre/enums_members.toml b/conformance/results/pyre/enums_members.toml index 3e4ef99c1..260feff43 100644 --- a/conformance/results/pyre/enums_members.toml +++ b/conformance/results/pyre/enums_members.toml @@ -16,6 +16,8 @@ Line 78: Expected 1 errors Line 79: Expected 1 errors Line 112: Expected 1 errors Line 125: Expected 1 errors +Line 16: Unexpected errors ['enums_members.py:16:4 Uninitialized attribute [13]: Attribute `genus` is declared in class `Pet` to have type `Pet` but is never initialized.'] +Line 17: Unexpected errors ['enums_members.py:17:4 Uninitialized attribute [13]: Attribute `species` is declared in class `Pet` to have type `Pet` but is never initialized.'] Line 23: Unexpected errors ['enums_members.py:23:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `Pet`.'] Line 24: Unexpected errors ['enums_members.py:24:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `Pet`.'] Line 31: Unexpected errors ['enums_members.py:31:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `Pet2`.'] @@ -26,8 +28,8 @@ Line 124: Unexpected errors ['enums_members.py:124:8 Revealed type [-1]: Reveale Line 135: Unexpected errors ['enums_members.py:135:4 Inconsistent override [15]: `_ignore_` overrides attribute defined in `Enum` inconsistently. Type `Pet5` is not a subtype of the overridden attribute `typing.Union[typing.List[str], str]`.'] """ output = """ -enums_members.py:15:0 Uninitialized attribute [13]: Attribute `genus` is declared in class `Pet` to have type `Pet` but is never initialized. -enums_members.py:15:0 Uninitialized attribute [13]: Attribute `species` is declared in class `Pet` to have type `Pet` but is never initialized. +enums_members.py:16:4 Uninitialized attribute [13]: Attribute `genus` is declared in class `Pet` to have type `Pet` but is never initialized. +enums_members.py:17:4 Uninitialized attribute [13]: Attribute `species` is declared in class `Pet` to have type `Pet` but is never initialized. enums_members.py:23:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `Pet`. enums_members.py:24:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `Pet`. enums_members.py:31:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `Pet2`. diff --git a/conformance/results/pyre/generics_defaults.toml b/conformance/results/pyre/generics_defaults.toml index 2d4d4749a..5e641c5b9 100644 --- a/conformance/results/pyre/generics_defaults.toml +++ b/conformance/results/pyre/generics_defaults.toml @@ -44,7 +44,7 @@ generics_defaults.py:81:0 Incompatible parameter type [6]: In call `assert_type` generics_defaults.py:81:12 Undefined attribute [16]: `Class_ParamSpec` has no attribute `__getitem__`. generics_defaults.py:81:45 Invalid type parameters [24]: Non-generic type `Class_ParamSpec` cannot take parameters. generics_defaults.py:88:53 Undefined attribute [16]: `tuple` has no attribute `__getitem__`. -generics_defaults.py:91:25 Invalid type [31]: Expression `typing.Generic[(*$local_generics_defaults$DefaultTs)]` is not a valid type. +generics_defaults.py:91:25 Invalid type [31]: Expression `typing.Generic[(*DefaultTs)]` is not a valid type. generics_defaults.py:94:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Type[Class_TypeVarTuple[]]` but got `Type[Class_TypeVarTuple]`. generics_defaults.py:94:32 Invalid type [31]: Expression `type[generics_defaults.Class_TypeVarTuple[(*tuple[(str, int)])]]` is not a valid type. generics_defaults.py:94:32 Invalid type parameters [24]: Non-generic type `Class_TypeVarTuple` cannot take parameters. @@ -52,10 +52,10 @@ generics_defaults.py:95:0 Incompatible parameter type [6]: In call `assert_type` generics_defaults.py:95:34 Invalid type parameters [24]: Non-generic type `Class_TypeVarTuple` cannot take parameters. generics_defaults.py:96:31 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[]` but got `Tuple[Type[int], Type[bool]]`. Expected has length 0, but actual has length 2. generics_defaults.py:124:13 Undefined or invalid type [11]: Annotation `T4` is not defined as a type. -generics_defaults.py:138:11 Invalid type [31]: Expression `typing.Generic[(*$local_generics_defaults$Ts, $local_generics_defaults$T5)]` is not a valid type. +generics_defaults.py:138:11 Invalid type [31]: Expression `typing.Generic[(*Ts, T5)]` is not a valid type. generics_defaults.py:138:11 Undefined or invalid type [11]: Annotation `T5` is not defined as a type. generics_defaults.py:145:19 Incompatible parameter type [6]: In call `ParamSpec.__init__`, for argument `default`, expected `Union[None, Type[typing.Any], str]` but got `List[Type[float]]`. -generics_defaults.py:148:11 Invalid type [31]: Expression `typing.Generic[(*$local_generics_defaults$Ts, $local_generics_defaults$P)]` is not a valid type. +generics_defaults.py:148:11 Invalid type [31]: Expression `typing.Generic[(*Ts, P)]` is not a valid type. generics_defaults.py:148:11 Undefined or invalid type [11]: Annotation `P` is not defined as a type. generics_defaults.py:151:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Type[Foo6[]]` but got `typing.Any`. generics_defaults.py:151:12 Undefined attribute [16]: `Foo6` has no attribute `__getitem__`. @@ -95,13 +95,13 @@ Line 79: Unexpected errors ['generics_defaults.py:79:0 Incompatible parameter ty Line 80: Unexpected errors ['generics_defaults.py:80:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Class_ParamSpec[]` but got `Class_ParamSpec`.', 'generics_defaults.py:80:31 Invalid type parameters [24]: Non-generic type `Class_ParamSpec` cannot take parameters.'] Line 81: Unexpected errors ['generics_defaults.py:81:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Class_ParamSpec[]` but got `typing.Any`.', 'generics_defaults.py:81:12 Undefined attribute [16]: `Class_ParamSpec` has no attribute `__getitem__`.', 'generics_defaults.py:81:45 Invalid type parameters [24]: Non-generic type `Class_ParamSpec` cannot take parameters.'] Line 88: Unexpected errors ['generics_defaults.py:88:53 Undefined attribute [16]: `tuple` has no attribute `__getitem__`.'] -Line 91: Unexpected errors ['generics_defaults.py:91:25 Invalid type [31]: Expression `typing.Generic[(*$local_generics_defaults$DefaultTs)]` is not a valid type.'] +Line 91: Unexpected errors ['generics_defaults.py:91:25 Invalid type [31]: Expression `typing.Generic[(*DefaultTs)]` is not a valid type.'] Line 94: Unexpected errors ['generics_defaults.py:94:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Type[Class_TypeVarTuple[]]` but got `Type[Class_TypeVarTuple]`.', 'generics_defaults.py:94:32 Invalid type [31]: Expression `type[generics_defaults.Class_TypeVarTuple[(*tuple[(str, int)])]]` is not a valid type.', 'generics_defaults.py:94:32 Invalid type parameters [24]: Non-generic type `Class_TypeVarTuple` cannot take parameters.'] Line 95: Unexpected errors ['generics_defaults.py:95:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Class_TypeVarTuple[]` but got `Class_TypeVarTuple`.', 'generics_defaults.py:95:34 Invalid type parameters [24]: Non-generic type `Class_TypeVarTuple` cannot take parameters.'] Line 96: Unexpected errors ['generics_defaults.py:96:31 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[]` but got `Tuple[Type[int], Type[bool]]`. Expected has length 0, but actual has length 2.'] Line 124: Unexpected errors ['generics_defaults.py:124:13 Undefined or invalid type [11]: Annotation `T4` is not defined as a type.'] Line 145: Unexpected errors ['generics_defaults.py:145:19 Incompatible parameter type [6]: In call `ParamSpec.__init__`, for argument `default`, expected `Union[None, Type[typing.Any], str]` but got `List[Type[float]]`.'] -Line 148: Unexpected errors ['generics_defaults.py:148:11 Invalid type [31]: Expression `typing.Generic[(*$local_generics_defaults$Ts, $local_generics_defaults$P)]` is not a valid type.', 'generics_defaults.py:148:11 Undefined or invalid type [11]: Annotation `P` is not defined as a type.'] +Line 148: Unexpected errors ['generics_defaults.py:148:11 Invalid type [31]: Expression `typing.Generic[(*Ts, P)]` is not a valid type.', 'generics_defaults.py:148:11 Undefined or invalid type [11]: Annotation `P` is not defined as a type.'] Line 151: Unexpected errors ['generics_defaults.py:151:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Type[Foo6[]]` but got `typing.Any`.', 'generics_defaults.py:151:12 Undefined attribute [16]: `Foo6` has no attribute `__getitem__`.', 'generics_defaults.py:151:28 Invalid type parameters [24]: Non-generic type `Foo6` cannot take parameters.'] Line 152: Unexpected errors ['generics_defaults.py:152:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Type[Foo6[]]` but got `typing.Any`.', 'generics_defaults.py:152:37 Invalid type parameters [24]: Non-generic type `Foo6` cannot take parameters.'] Line 166: Unexpected errors ['generics_defaults.py:166:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing.Callable[[Foo7[]], Foo7[]]` but got `typing.Callable(Foo7.meth)[[Variable[_Self_generics_defaults_Foo7__ (bound to Foo7)]], Variable[_Self_generics_defaults_Foo7__ (bound to Foo7)]]`.', 'generics_defaults.py:166:23 Invalid type parameters [24]: Non-generic type `Foo7` cannot take parameters.'] diff --git a/conformance/results/pyre/generics_paramspec_specialization.toml b/conformance/results/pyre/generics_paramspec_specialization.toml index b152cb021..34a215ee6 100644 --- a/conformance/results/pyre/generics_paramspec_specialization.toml +++ b/conformance/results/pyre/generics_paramspec_specialization.toml @@ -3,23 +3,20 @@ notes = """ Reports error for legitimate use of `...` to specialize ParamSpec """ output = """ -generics_paramspec_specialization.py:14:0 Uninitialized attribute [13]: Attribute `f` is declared in class `ClassA` to have type `typing.Callable[generics_paramspec_specialization.P1, int]` but is never initialized. -generics_paramspec_specialization.py:14:0 Uninitialized attribute [13]: Attribute `x` is declared in class `ClassA` to have type `Variable[T]` but is never initialized. -generics_paramspec_specialization.py:19:0 Uninitialized attribute [13]: Attribute `f1` is declared in class `ClassB` to have type `typing.Callable[generics_paramspec_specialization.P1, int]` but is never initialized. -generics_paramspec_specialization.py:19:0 Uninitialized attribute [13]: Attribute `f2` is declared in class `ClassB` to have type `typing.Callable[generics_paramspec_specialization.P2, int]` but is never initialized. -generics_paramspec_specialization.py:19:0 Uninitialized attribute [13]: Attribute `x` is declared in class `ClassB` to have type `Variable[T]` but is never initialized. -generics_paramspec_specialization.py:33:14 Undefined or invalid type [11]: Annotation `...` is not defined as a type. -generics_paramspec_specialization.py:45:14 Invalid type parameters [24]: Callable parameters expected for parameter specification `P1`, but a single type `int` was given for generic type ClassA. -generics_paramspec_specialization.py:49:0 Uninitialized attribute [13]: Attribute `f` is declared in class `ClassC` to have type `typing.Callable[generics_paramspec_specialization.P1, int]` but is never initialized. -generics_paramspec_specialization.py:55:8 Incompatible parameter type [6]: In anonymous call, for 1st positional argument, expected `int` but got `str`. -generics_paramspec_specialization.py:56:15 Incompatible parameter type [6]: In anonymous call, for 3rd positional argument, expected `bool` but got `str`. -generics_paramspec_specialization.py:61:8 Incompatible parameter type [6]: In anonymous call, for 1st positional argument, expected `int` but got `str`. -generics_paramspec_specialization.py:62:15 Incompatible parameter type [6]: In anonymous call, for 3rd positional argument, expected `bool` but got `str`. +generics_paramspec_specialization.py:32:14 Invalid type parameters [24]: Callable parameters expected for parameter specification `P2`, but a single type `...` was given for generic type ClassB. +generics_paramspec_specialization.py:36:14 Invalid type parameters [24]: Callable parameters expected for parameter specification `P1`, but a single type `...` was given for generic type ClassA. +generics_paramspec_specialization.py:44:14 Invalid type parameters [24]: Callable parameters expected for parameter specification `P1`, but a single type `int` was given for generic type ClassA. +generics_paramspec_specialization.py:53:4 Too many arguments [19]: PositionalOnly call expects 2 positional arguments, 3 were provided. +generics_paramspec_specialization.py:54:4 Too many arguments [19]: PositionalOnly call expects 2 positional arguments, 3 were provided. +generics_paramspec_specialization.py:55:4 Too many arguments [19]: PositionalOnly call expects 2 positional arguments, 3 were provided. +generics_paramspec_specialization.py:59:4 Too many arguments [19]: PositionalOnly call expects 2 positional arguments, 3 were provided. +generics_paramspec_specialization.py:60:4 Too many arguments [19]: PositionalOnly call expects 2 positional arguments, 3 were provided. +generics_paramspec_specialization.py:61:4 Too many arguments [19]: PositionalOnly call expects 2 positional arguments, 3 were provided. """ conformance_automated = "Fail" errors_diff = """ -Line 14: Unexpected errors ['generics_paramspec_specialization.py:14:0 Uninitialized attribute [13]: Attribute `f` is declared in class `ClassA` to have type `typing.Callable[generics_paramspec_specialization.P1, int]` but is never initialized.', 'generics_paramspec_specialization.py:14:0 Uninitialized attribute [13]: Attribute `x` is declared in class `ClassA` to have type `Variable[T]` but is never initialized.'] -Line 19: Unexpected errors ['generics_paramspec_specialization.py:19:0 Uninitialized attribute [13]: Attribute `f1` is declared in class `ClassB` to have type `typing.Callable[generics_paramspec_specialization.P1, int]` but is never initialized.', 'generics_paramspec_specialization.py:19:0 Uninitialized attribute [13]: Attribute `f2` is declared in class `ClassB` to have type `typing.Callable[generics_paramspec_specialization.P2, int]` but is never initialized.', 'generics_paramspec_specialization.py:19:0 Uninitialized attribute [13]: Attribute `x` is declared in class `ClassB` to have type `Variable[T]` but is never initialized.'] -Line 33: Unexpected errors ['generics_paramspec_specialization.py:33:14 Undefined or invalid type [11]: Annotation `...` is not defined as a type.'] -Line 49: Unexpected errors ['generics_paramspec_specialization.py:49:0 Uninitialized attribute [13]: Attribute `f` is declared in class `ClassC` to have type `typing.Callable[generics_paramspec_specialization.P1, int]` but is never initialized.'] +Line 32: Unexpected errors ['generics_paramspec_specialization.py:32:14 Invalid type parameters [24]: Callable parameters expected for parameter specification `P2`, but a single type `...` was given for generic type ClassB.'] +Line 36: Unexpected errors ['generics_paramspec_specialization.py:36:14 Invalid type parameters [24]: Callable parameters expected for parameter specification `P1`, but a single type `...` was given for generic type ClassA.'] +Line 53: Unexpected errors ['generics_paramspec_specialization.py:53:4 Too many arguments [19]: PositionalOnly call expects 2 positional arguments, 3 were provided.'] +Line 59: Unexpected errors ['generics_paramspec_specialization.py:59:4 Too many arguments [19]: PositionalOnly call expects 2 positional arguments, 3 were provided.'] """ diff --git a/conformance/results/pyre/generics_scoping.toml b/conformance/results/pyre/generics_scoping.toml index c29afaebc..6b38cc47d 100644 --- a/conformance/results/pyre/generics_scoping.toml +++ b/conformance/results/pyre/generics_scoping.toml @@ -11,9 +11,9 @@ generics_scoping.py:42:0 Incompatible parameter type [6]: In call `assert_type`, generics_scoping.py:43:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `bytes` but got `typing_extensions.Literal[b'abc']`. generics_scoping.py:50:7 Invalid type variable [34]: The type variable `Variable[S]` isn't present in the function's parameters. generics_scoping.py:54:13 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Variable[S]`. To reference the type variable, you can modify the class to inherit from `typing.Generic[S]`. -generics_scoping.py:74:0 Uninitialized attribute [13]: Attribute `attr` is declared in class `Outer` to have type `Outer.Inner[Variable[T]]` but is never initialized. -generics_scoping.py:77:4 Uninitialized attribute [13]: Attribute `x` is declared in class `Outer.AlsoBad` to have type `typing.List[Variable[T]]` but is never initialized. +generics_scoping.py:78:8 Uninitialized attribute [13]: Attribute `x` is declared in class `Outer.AlsoBad` to have type `typing.List[Variable[T]]` but is never initialized. generics_scoping.py:78:11 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Variable[T]`. To reference the type variable, you can modify the class to inherit from `typing.Generic[T]`. +generics_scoping.py:82:4 Uninitialized attribute [13]: Attribute `attr` is declared in class `Outer` to have type `Outer.Inner[Variable[T]]` but is never initialized. generics_scoping.py:84:23 Undefined attribute [16]: `list` has no attribute `__getitem__`. generics_scoping.py:88:13 Invalid type variable [34]: The type variable `Variable[T]` can only be used to annotate generic classes or functions. generics_scoping.py:89:13 Invalid type variable [34]: The type variable `Variable[T]` can only be used to annotate generic classes or functions. diff --git a/conformance/results/pyre/generics_self_basic.toml b/conformance/results/pyre/generics_self_basic.toml index a2f0dfbe7..41c5b5be9 100644 --- a/conformance/results/pyre/generics_self_basic.toml +++ b/conformance/results/pyre/generics_self_basic.toml @@ -9,7 +9,7 @@ generics_self_basic.py:20:8 Incompatible return type [7]: Expected `Variable[_Se generics_self_basic.py:27:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `unknown` but got `Type[Variable[_Self_generics_self_basic_Shape__ (bound to Shape)]]`. generics_self_basic.py:33:8 Incompatible return type [7]: Expected `Variable[_Self_generics_self_basic_Shape__ (bound to Shape)]` but got `Shape`. generics_self_basic.py:40:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `unknown` but got `Variable[_Self_generics_self_basic_Shape__ (bound to Shape)]`. -generics_self_basic.py:58:0 Uninitialized attribute [13]: Attribute `value` is declared in class `Container` to have type `Variable[T]` but is never initialized. +generics_self_basic.py:59:4 Uninitialized attribute [13]: Attribute `value` is declared in class `Container` to have type `Variable[T]` but is never initialized. """ conformance_automated = "Fail" errors_diff = """ @@ -17,5 +17,5 @@ Line 64: Expected 1 errors Line 14: Unexpected errors ['generics_self_basic.py:14:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `unknown` but got `Variable[_Self_generics_self_basic_Shape__ (bound to Shape)]`.', 'generics_self_basic.py:14:26 Undefined or invalid type [11]: Annotation `Self` is not defined as a type.'] Line 27: Unexpected errors ['generics_self_basic.py:27:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `unknown` but got `Type[Variable[_Self_generics_self_basic_Shape__ (bound to Shape)]]`.'] Line 40: Unexpected errors ['generics_self_basic.py:40:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `unknown` but got `Variable[_Self_generics_self_basic_Shape__ (bound to Shape)]`.'] -Line 58: Unexpected errors ['generics_self_basic.py:58:0 Uninitialized attribute [13]: Attribute `value` is declared in class `Container` to have type `Variable[T]` but is never initialized.'] +Line 59: Unexpected errors ['generics_self_basic.py:59:4 Uninitialized attribute [13]: Attribute `value` is declared in class `Container` to have type `Variable[T]` but is never initialized.'] """ diff --git a/conformance/results/pyre/generics_type_erasure.toml b/conformance/results/pyre/generics_type_erasure.toml index a4669c746..2da356429 100644 --- a/conformance/results/pyre/generics_type_erasure.toml +++ b/conformance/results/pyre/generics_type_erasure.toml @@ -5,7 +5,7 @@ False negatives on instance attribute access on the type. Does not infer type of `DefaultDict` with explicit type parameters on constructor. """ output = """ -generics_type_erasure.py:11:0 Uninitialized attribute [13]: Attribute `label` is declared in class `Node` to have type `Variable[T]` but is never initialized. +generics_type_erasure.py:12:4 Uninitialized attribute [13]: Attribute `label` is declared in class `Node` to have type `Variable[T]` but is never initialized. generics_type_erasure.py:15:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Node[str]` but got `Node[typing_extensions.Literal['']]`. generics_type_erasure.py:16:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Node[int]` but got `Node[typing_extensions.Literal[0]]`. generics_type_erasure.py:17:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Node[typing.Any]` but got `Node[Variable[T]]`. @@ -21,7 +21,7 @@ Line 41: Expected 1 errors Line 42: Expected 1 errors Line 43: Expected 1 errors Line 44: Expected 1 errors -Line 11: Unexpected errors ['generics_type_erasure.py:11:0 Uninitialized attribute [13]: Attribute `label` is declared in class `Node` to have type `Variable[T]` but is never initialized.'] +Line 12: Unexpected errors ['generics_type_erasure.py:12:4 Uninitialized attribute [13]: Attribute `label` is declared in class `Node` to have type `Variable[T]` but is never initialized.'] Line 15: Unexpected errors ["generics_type_erasure.py:15:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Node[str]` but got `Node[typing_extensions.Literal['']]`."] Line 16: Unexpected errors ['generics_type_erasure.py:16:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Node[int]` but got `Node[typing_extensions.Literal[0]]`.'] Line 17: Unexpected errors ['generics_type_erasure.py:17:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Node[typing.Any]` but got `Node[Variable[T]]`.'] diff --git a/conformance/results/pyre/generics_typevartuple_args.toml b/conformance/results/pyre/generics_typevartuple_args.toml index c42d5409b..eaca737dd 100644 --- a/conformance/results/pyre/generics_typevartuple_args.toml +++ b/conformance/results/pyre/generics_typevartuple_args.toml @@ -3,14 +3,14 @@ notes = """ Does not support star expressions for `Unpack`. """ output = """ -generics_typevartuple_args.py:16:25 Invalid type [31]: Expression `*$local_generics_typevartuple_args$Ts` is not a valid type. -generics_typevartuple_args.py:16:33 Invalid type [31]: Expression `tuple[(*$local_generics_typevartuple_args$Ts)]` is not a valid type. -generics_typevartuple_args.py:27:30 Invalid type [31]: Expression `*tuple[(*$local_generics_typevartuple_args$Ts, generics_typevartuple_args.Env)]` is not a valid type. -generics_typevartuple_args.py:27:76 Invalid type [31]: Expression `tuple[(*$local_generics_typevartuple_args$Ts)]` is not a valid type. +generics_typevartuple_args.py:16:25 Invalid type [31]: Expression `*Ts` is not a valid type. +generics_typevartuple_args.py:16:33 Invalid type [31]: Expression `tuple[(*Ts)]` is not a valid type. +generics_typevartuple_args.py:27:30 Invalid type [31]: Expression `*tuple[(*Ts, generics_typevartuple_args.Env)]` is not a valid type. +generics_typevartuple_args.py:27:76 Invalid type [31]: Expression `tuple[(*Ts)]` is not a valid type. generics_typevartuple_args.py:42:17 Invalid type [31]: Expression `*tuple[(int, ...)]` is not a valid type. generics_typevartuple_args.py:51:17 Invalid type [31]: Expression `*tuple[(int, *tuple[(str, ...)], str)]` is not a valid type. generics_typevartuple_args.py:62:17 Invalid type [31]: Expression `*tuple[(int, str)]` is not a valid type. -generics_typevartuple_args.py:70:17 Invalid type [31]: Expression `tuple[(*$local_generics_typevartuple_args$Ts)]` is not a valid type. +generics_typevartuple_args.py:70:17 Invalid type [31]: Expression `tuple[(*Ts)]` is not a valid type. generics_typevartuple_args.py:75:12 Incompatible parameter type [6]: In call `func4`, for 2nd positional argument, expected `Tuple[]` but got `Tuple[int, int]`. Expected has length 1, but actual has length 2. """ conformance_automated = "Fail" @@ -23,10 +23,10 @@ Line 58: Expected 1 errors Line 59: Expected 1 errors Line 67: Expected 1 errors Line 76: Expected 1 errors -Line 16: Unexpected errors ['generics_typevartuple_args.py:16:25 Invalid type [31]: Expression `*$local_generics_typevartuple_args$Ts` is not a valid type.', 'generics_typevartuple_args.py:16:33 Invalid type [31]: Expression `tuple[(*$local_generics_typevartuple_args$Ts)]` is not a valid type.'] -Line 27: Unexpected errors ['generics_typevartuple_args.py:27:30 Invalid type [31]: Expression `*tuple[(*$local_generics_typevartuple_args$Ts, generics_typevartuple_args.Env)]` is not a valid type.', 'generics_typevartuple_args.py:27:76 Invalid type [31]: Expression `tuple[(*$local_generics_typevartuple_args$Ts)]` is not a valid type.'] +Line 16: Unexpected errors ['generics_typevartuple_args.py:16:25 Invalid type [31]: Expression `*Ts` is not a valid type.', 'generics_typevartuple_args.py:16:33 Invalid type [31]: Expression `tuple[(*Ts)]` is not a valid type.'] +Line 27: Unexpected errors ['generics_typevartuple_args.py:27:30 Invalid type [31]: Expression `*tuple[(*Ts, generics_typevartuple_args.Env)]` is not a valid type.', 'generics_typevartuple_args.py:27:76 Invalid type [31]: Expression `tuple[(*Ts)]` is not a valid type.'] Line 42: Unexpected errors ['generics_typevartuple_args.py:42:17 Invalid type [31]: Expression `*tuple[(int, ...)]` is not a valid type.'] Line 51: Unexpected errors ['generics_typevartuple_args.py:51:17 Invalid type [31]: Expression `*tuple[(int, *tuple[(str, ...)], str)]` is not a valid type.'] Line 62: Unexpected errors ['generics_typevartuple_args.py:62:17 Invalid type [31]: Expression `*tuple[(int, str)]` is not a valid type.'] -Line 70: Unexpected errors ['generics_typevartuple_args.py:70:17 Invalid type [31]: Expression `tuple[(*$local_generics_typevartuple_args$Ts)]` is not a valid type.'] +Line 70: Unexpected errors ['generics_typevartuple_args.py:70:17 Invalid type [31]: Expression `tuple[(*Ts)]` is not a valid type.'] """ diff --git a/conformance/results/pyre/generics_typevartuple_basic.toml b/conformance/results/pyre/generics_typevartuple_basic.toml index 4e1ea5a34..73053837f 100644 --- a/conformance/results/pyre/generics_typevartuple_basic.toml +++ b/conformance/results/pyre/generics_typevartuple_basic.toml @@ -3,13 +3,13 @@ notes = """ Does not support TypeVarTuple. """ output = """ -generics_typevartuple_basic.py:12:13 Invalid type [31]: Expression `typing.Generic[(*$local_generics_typevartuple_basic$Ts)]` is not a valid type. -generics_typevartuple_basic.py:16:17 Invalid type [31]: Expression `*$local_generics_typevartuple_basic$Ts` is not a valid type. -generics_typevartuple_basic.py:16:25 Invalid type [31]: Expression `tuple[(*$local_generics_typevartuple_basic$Ts)]` is not a valid type. -generics_typevartuple_basic.py:23:12 Invalid type [31]: Expression `typing.Generic[(*$local_generics_typevartuple_basic$Shape)]` is not a valid type. -generics_typevartuple_basic.py:24:30 Invalid type [31]: Expression `tuple[(*$local_generics_typevartuple_basic$Shape)]` is not a valid type. -generics_typevartuple_basic.py:25:21 Invalid type [31]: Expression `tuple[(*$local_generics_typevartuple_basic$Shape)]` is not a valid type. -generics_typevartuple_basic.py:27:27 Invalid type [31]: Expression `tuple[(*$local_generics_typevartuple_basic$Shape)]` is not a valid type. +generics_typevartuple_basic.py:12:13 Invalid type [31]: Expression `typing.Generic[(*Ts)]` is not a valid type. +generics_typevartuple_basic.py:16:17 Invalid type [31]: Expression `*Ts` is not a valid type. +generics_typevartuple_basic.py:16:25 Invalid type [31]: Expression `tuple[(*Ts)]` is not a valid type. +generics_typevartuple_basic.py:23:12 Invalid type [31]: Expression `typing.Generic[(*Shape)]` is not a valid type. +generics_typevartuple_basic.py:24:30 Invalid type [31]: Expression `tuple[(*Shape)]` is not a valid type. +generics_typevartuple_basic.py:25:21 Invalid type [31]: Expression `tuple[(*Shape)]` is not a valid type. +generics_typevartuple_basic.py:27:27 Invalid type [31]: Expression `tuple[(*Shape)]` is not a valid type. generics_typevartuple_basic.py:36:0 Incompatible variable type [9]: v1 is declared to have type `Array[]` but is used as type `Array`. generics_typevartuple_basic.py:36:4 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. generics_typevartuple_basic.py:36:33 Incompatible parameter type [6]: In call `Array.__init__`, for 1st positional argument, expected `Tuple[]` but got `Tuple[Height, Width]`. Expected has length 1, but actual has length 2. @@ -29,24 +29,24 @@ generics_typevartuple_basic.py:44:0 Incompatible variable type [9]: v6 is declar generics_typevartuple_basic.py:44:4 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. generics_typevartuple_basic.py:45:4 Incompatible parameter type [6]: In call `Array.__init__`, for 1st positional argument, expected `Tuple[]` but got `Tuple[Time, Batch, Width, Height]`. Expected has length 1, but actual has length 4. generics_typevartuple_basic.py:52:13 Undefined or invalid type [11]: Annotation `Shape` is not defined as a type. -generics_typevartuple_basic.py:54:21 Invalid type [31]: Expression `tuple[(*$local_generics_typevartuple_basic$Shape)]` is not a valid type. +generics_typevartuple_basic.py:54:21 Invalid type [31]: Expression `tuple[(*Shape)]` is not a valid type. generics_typevartuple_basic.py:65:6 Unexpected keyword [28]: Unexpected keyword argument `covariant` to call `TypeVarTuple.__init__`. generics_typevartuple_basic.py:66:6 Too many arguments [19]: Call `TypeVarTuple.__init__` expects 1 positional argument, 3 were provided. generics_typevartuple_basic.py:67:6 Unexpected keyword [28]: Unexpected keyword argument `bound` to call `TypeVarTuple.__init__`. -generics_typevartuple_basic.py:75:16 Invalid type [31]: Expression `tuple[(*$local_generics_typevartuple_basic$Ts)]` is not a valid type. -generics_typevartuple_basic.py:75:34 Invalid type [31]: Expression `tuple[(*$local_generics_typevartuple_basic$Ts)]` is not a valid type. -generics_typevartuple_basic.py:75:49 Invalid type [31]: Expression `tuple[(*$local_generics_typevartuple_basic$Ts)]` is not a valid type. +generics_typevartuple_basic.py:75:16 Invalid type [31]: Expression `tuple[(*Ts)]` is not a valid type. +generics_typevartuple_basic.py:75:34 Invalid type [31]: Expression `tuple[(*Ts)]` is not a valid type. +generics_typevartuple_basic.py:75:49 Invalid type [31]: Expression `tuple[(*Ts)]` is not a valid type. generics_typevartuple_basic.py:90:6 Incompatible parameter type [6]: In call `func2`, for 1st positional argument, expected `Tuple[]` but got `Tuple[int, int]`. Expected has length 1, but actual has length 2. -generics_typevartuple_basic.py:93:16 Invalid type [31]: Expression `Array[(*$local_generics_typevartuple_basic$Shape)]` is not a valid type. +generics_typevartuple_basic.py:93:16 Invalid type [31]: Expression `generics_typevartuple_basic.Array[(*Shape)]` is not a valid type. generics_typevartuple_basic.py:93:16 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. -generics_typevartuple_basic.py:93:34 Invalid type [31]: Expression `Array[(*$local_generics_typevartuple_basic$Shape)]` is not a valid type. +generics_typevartuple_basic.py:93:34 Invalid type [31]: Expression `generics_typevartuple_basic.Array[(*Shape)]` is not a valid type. generics_typevartuple_basic.py:93:34 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. -generics_typevartuple_basic.py:93:52 Invalid type [31]: Expression `Array[(*$local_generics_typevartuple_basic$Shape)]` is not a valid type. +generics_typevartuple_basic.py:93:52 Invalid type [31]: Expression `generics_typevartuple_basic.Array[(*Shape)]` is not a valid type. generics_typevartuple_basic.py:93:52 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. generics_typevartuple_basic.py:97:13 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. generics_typevartuple_basic.py:97:31 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. generics_typevartuple_basic.py:97:48 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. -generics_typevartuple_basic.py:106:13 Invalid type [31]: Expression `typing.Generic[(*$local_generics_typevartuple_basic$Ts1, *$local_generics_typevartuple_basic$Ts2)]` is not a valid type. +generics_typevartuple_basic.py:106:13 Invalid type [31]: Expression `typing.Generic[(*Ts1, *Ts2)]` is not a valid type. """ conformance_automated = "Fail" errors_diff = """ @@ -56,19 +56,19 @@ Line 59: Expected 1 errors Line 89: Expected 1 errors Line 99: Expected 1 errors Line 100: Expected 1 errors -Line 12: Unexpected errors ['generics_typevartuple_basic.py:12:13 Invalid type [31]: Expression `typing.Generic[(*$local_generics_typevartuple_basic$Ts)]` is not a valid type.'] -Line 16: Unexpected errors ['generics_typevartuple_basic.py:16:17 Invalid type [31]: Expression `*$local_generics_typevartuple_basic$Ts` is not a valid type.', 'generics_typevartuple_basic.py:16:25 Invalid type [31]: Expression `tuple[(*$local_generics_typevartuple_basic$Ts)]` is not a valid type.'] -Line 23: Unexpected errors ['generics_typevartuple_basic.py:23:12 Invalid type [31]: Expression `typing.Generic[(*$local_generics_typevartuple_basic$Shape)]` is not a valid type.'] -Line 24: Unexpected errors ['generics_typevartuple_basic.py:24:30 Invalid type [31]: Expression `tuple[(*$local_generics_typevartuple_basic$Shape)]` is not a valid type.'] -Line 25: Unexpected errors ['generics_typevartuple_basic.py:25:21 Invalid type [31]: Expression `tuple[(*$local_generics_typevartuple_basic$Shape)]` is not a valid type.'] -Line 27: Unexpected errors ['generics_typevartuple_basic.py:27:27 Invalid type [31]: Expression `tuple[(*$local_generics_typevartuple_basic$Shape)]` is not a valid type.'] +Line 12: Unexpected errors ['generics_typevartuple_basic.py:12:13 Invalid type [31]: Expression `typing.Generic[(*Ts)]` is not a valid type.'] +Line 16: Unexpected errors ['generics_typevartuple_basic.py:16:17 Invalid type [31]: Expression `*Ts` is not a valid type.', 'generics_typevartuple_basic.py:16:25 Invalid type [31]: Expression `tuple[(*Ts)]` is not a valid type.'] +Line 23: Unexpected errors ['generics_typevartuple_basic.py:23:12 Invalid type [31]: Expression `typing.Generic[(*Shape)]` is not a valid type.'] +Line 24: Unexpected errors ['generics_typevartuple_basic.py:24:30 Invalid type [31]: Expression `tuple[(*Shape)]` is not a valid type.'] +Line 25: Unexpected errors ['generics_typevartuple_basic.py:25:21 Invalid type [31]: Expression `tuple[(*Shape)]` is not a valid type.'] +Line 27: Unexpected errors ['generics_typevartuple_basic.py:27:27 Invalid type [31]: Expression `tuple[(*Shape)]` is not a valid type.'] Line 36: Unexpected errors ['generics_typevartuple_basic.py:36:0 Incompatible variable type [9]: v1 is declared to have type `Array[]` but is used as type `Array`.', 'generics_typevartuple_basic.py:36:4 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.', 'generics_typevartuple_basic.py:36:33 Incompatible parameter type [6]: In call `Array.__init__`, for 1st positional argument, expected `Tuple[]` but got `Tuple[Height, Width]`. Expected has length 1, but actual has length 2.'] Line 37: Unexpected errors ['generics_typevartuple_basic.py:37:0 Incompatible variable type [9]: v2 is declared to have type `Array[]` but is used as type `Array`.', 'generics_typevartuple_basic.py:37:4 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.', 'generics_typevartuple_basic.py:37:40 Incompatible parameter type [6]: In call `Array.__init__`, for 1st positional argument, expected `Tuple[]` but got `Tuple[Batch, Height, Width]`. Expected has length 1, but actual has length 3.'] Line 38: Unexpected errors ['generics_typevartuple_basic.py:38:0 Incompatible variable type [9]: v3 is declared to have type `Array[]` but is used as type `Array`.', 'generics_typevartuple_basic.py:38:4 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.'] Line 39: Unexpected errors ['generics_typevartuple_basic.py:39:4 Incompatible parameter type [6]: In call `Array.__init__`, for 1st positional argument, expected `Tuple[]` but got `Tuple[Time, Batch, Height, Width]`. Expected has length 1, but actual has length 4.'] Line 45: Unexpected errors ['generics_typevartuple_basic.py:45:4 Incompatible parameter type [6]: In call `Array.__init__`, for 1st positional argument, expected `Tuple[]` but got `Tuple[Time, Batch, Width, Height]`. Expected has length 1, but actual has length 4.'] -Line 54: Unexpected errors ['generics_typevartuple_basic.py:54:21 Invalid type [31]: Expression `tuple[(*$local_generics_typevartuple_basic$Shape)]` is not a valid type.'] -Line 75: Unexpected errors ['generics_typevartuple_basic.py:75:16 Invalid type [31]: Expression `tuple[(*$local_generics_typevartuple_basic$Ts)]` is not a valid type.', 'generics_typevartuple_basic.py:75:34 Invalid type [31]: Expression `tuple[(*$local_generics_typevartuple_basic$Ts)]` is not a valid type.', 'generics_typevartuple_basic.py:75:49 Invalid type [31]: Expression `tuple[(*$local_generics_typevartuple_basic$Ts)]` is not a valid type.'] -Line 93: Unexpected errors ['generics_typevartuple_basic.py:93:16 Invalid type [31]: Expression `Array[(*$local_generics_typevartuple_basic$Shape)]` is not a valid type.', 'generics_typevartuple_basic.py:93:16 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.', 'generics_typevartuple_basic.py:93:34 Invalid type [31]: Expression `Array[(*$local_generics_typevartuple_basic$Shape)]` is not a valid type.', 'generics_typevartuple_basic.py:93:34 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.', 'generics_typevartuple_basic.py:93:52 Invalid type [31]: Expression `Array[(*$local_generics_typevartuple_basic$Shape)]` is not a valid type.', 'generics_typevartuple_basic.py:93:52 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.'] +Line 54: Unexpected errors ['generics_typevartuple_basic.py:54:21 Invalid type [31]: Expression `tuple[(*Shape)]` is not a valid type.'] +Line 75: Unexpected errors ['generics_typevartuple_basic.py:75:16 Invalid type [31]: Expression `tuple[(*Ts)]` is not a valid type.', 'generics_typevartuple_basic.py:75:34 Invalid type [31]: Expression `tuple[(*Ts)]` is not a valid type.', 'generics_typevartuple_basic.py:75:49 Invalid type [31]: Expression `tuple[(*Ts)]` is not a valid type.'] +Line 93: Unexpected errors ['generics_typevartuple_basic.py:93:16 Invalid type [31]: Expression `generics_typevartuple_basic.Array[(*Shape)]` is not a valid type.', 'generics_typevartuple_basic.py:93:16 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.', 'generics_typevartuple_basic.py:93:34 Invalid type [31]: Expression `generics_typevartuple_basic.Array[(*Shape)]` is not a valid type.', 'generics_typevartuple_basic.py:93:34 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.', 'generics_typevartuple_basic.py:93:52 Invalid type [31]: Expression `generics_typevartuple_basic.Array[(*Shape)]` is not a valid type.', 'generics_typevartuple_basic.py:93:52 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.'] Line 97: Unexpected errors ['generics_typevartuple_basic.py:97:13 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.', 'generics_typevartuple_basic.py:97:31 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.', 'generics_typevartuple_basic.py:97:48 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.'] """ diff --git a/conformance/results/pyre/generics_typevartuple_callable.toml b/conformance/results/pyre/generics_typevartuple_callable.toml index edff454cb..e3c989ea8 100644 --- a/conformance/results/pyre/generics_typevartuple_callable.toml +++ b/conformance/results/pyre/generics_typevartuple_callable.toml @@ -3,26 +3,26 @@ notes = """ Does not support TypeVarTuple. """ output = """ -generics_typevartuple_callable.py:17:31 Invalid type [31]: Expression `typing.Callable[([*$local_generics_typevartuple_callable$Ts], None)]` is not a valid type. -generics_typevartuple_callable.py:17:60 Invalid type [31]: Expression `tuple[(*$local_generics_typevartuple_callable$Ts)]` is not a valid type. +generics_typevartuple_callable.py:17:31 Invalid type [31]: Expression `typing.Callable[([*Ts], None)]` is not a valid type. +generics_typevartuple_callable.py:17:60 Invalid type [31]: Expression `tuple[(*Ts)]` is not a valid type. generics_typevartuple_callable.py:25:8 Incompatible parameter type [6]: In call `Process.__init__`, for argument `target`, expected `typing.Callable[[unknown], None]` but got `typing.Callable(func1)[[Named(arg1, int), Named(arg2, str)], None]`. generics_typevartuple_callable.py:25:22 Incompatible parameter type [6]: In call `Process.__init__`, for argument `args`, expected `Tuple[]` but got `Tuple[int, str]`. Expected has length 1, but actual has length 2. generics_typevartuple_callable.py:26:8 Incompatible parameter type [6]: In call `Process.__init__`, for argument `target`, expected `typing.Callable[[unknown], None]` but got `typing.Callable(func1)[[Named(arg1, int), Named(arg2, str)], None]`. generics_typevartuple_callable.py:26:22 Incompatible parameter type [6]: In call `Process.__init__`, for argument `args`, expected `Tuple[]` but got `Tuple[str, int]`. Expected has length 1, but actual has length 2. -generics_typevartuple_callable.py:29:13 Invalid type [31]: Expression `typing.Callable[([int, *$local_generics_typevartuple_callable$Ts, $local_generics_typevartuple_callable$T], tuple[($local_generics_typevartuple_callable$T, *$local_generics_typevartuple_callable$Ts)])]` is not a valid type. -generics_typevartuple_callable.py:29:56 Invalid type [31]: Expression `tuple[(*$local_generics_typevartuple_callable$Ts, $local_generics_typevartuple_callable$T)]` is not a valid type. +generics_typevartuple_callable.py:29:13 Invalid type [31]: Expression `typing.Callable[([int, *Ts, T], tuple[(T, *Ts)])]` is not a valid type. +generics_typevartuple_callable.py:29:56 Invalid type [31]: Expression `tuple[(*Ts, T)]` is not a valid type. generics_typevartuple_callable.py:41:18 Incompatible parameter type [6]: In call `func2`, for 1st positional argument, expected `typing.Callable[[int, unknown, Variable[T]], Tuple[Variable[T], unknown]]` but got `typing.Callable(callback1)[[Named(a, int), Named(b, str), Named(c, int), Named(d, complex)], Tuple[complex, str, int]]`. generics_typevartuple_callable.py:42:18 Incompatible parameter type [6]: In call `func2`, for 1st positional argument, expected `typing.Callable[[int, unknown, Variable[T]], Tuple[Variable[T], unknown]]` but got `typing.Callable(callback2)[[Named(a, int), Named(d, str)], Tuple[str]]`. -generics_typevartuple_callable.py:45:17 Invalid type [31]: Expression `*tuple[(int, *$local_generics_typevartuple_callable$Ts, $local_generics_typevartuple_callable$T)]` is not a valid type. -generics_typevartuple_callable.py:45:42 Invalid type [31]: Expression `tuple[($local_generics_typevartuple_callable$T, *$local_generics_typevartuple_callable$Ts)]` is not a valid type. +generics_typevartuple_callable.py:45:17 Invalid type [31]: Expression `*tuple[(int, *Ts, T)]` is not a valid type. +generics_typevartuple_callable.py:45:42 Invalid type [31]: Expression `tuple[(T, *Ts)]` is not a valid type. generics_typevartuple_callable.py:45:42 Invalid type variable [34]: The type variable `Variable[T]` isn't present in the function's parameters. """ conformance_automated = "Fail" errors_diff = """ -Line 17: Unexpected errors ['generics_typevartuple_callable.py:17:31 Invalid type [31]: Expression `typing.Callable[([*$local_generics_typevartuple_callable$Ts], None)]` is not a valid type.', 'generics_typevartuple_callable.py:17:60 Invalid type [31]: Expression `tuple[(*$local_generics_typevartuple_callable$Ts)]` is not a valid type.'] +Line 17: Unexpected errors ['generics_typevartuple_callable.py:17:31 Invalid type [31]: Expression `typing.Callable[([*Ts], None)]` is not a valid type.', 'generics_typevartuple_callable.py:17:60 Invalid type [31]: Expression `tuple[(*Ts)]` is not a valid type.'] Line 25: Unexpected errors ['generics_typevartuple_callable.py:25:8 Incompatible parameter type [6]: In call `Process.__init__`, for argument `target`, expected `typing.Callable[[unknown], None]` but got `typing.Callable(func1)[[Named(arg1, int), Named(arg2, str)], None]`.', 'generics_typevartuple_callable.py:25:22 Incompatible parameter type [6]: In call `Process.__init__`, for argument `args`, expected `Tuple[]` but got `Tuple[int, str]`. Expected has length 1, but actual has length 2.'] -Line 29: Unexpected errors ['generics_typevartuple_callable.py:29:13 Invalid type [31]: Expression `typing.Callable[([int, *$local_generics_typevartuple_callable$Ts, $local_generics_typevartuple_callable$T], tuple[($local_generics_typevartuple_callable$T, *$local_generics_typevartuple_callable$Ts)])]` is not a valid type.', 'generics_typevartuple_callable.py:29:56 Invalid type [31]: Expression `tuple[(*$local_generics_typevartuple_callable$Ts, $local_generics_typevartuple_callable$T)]` is not a valid type.'] +Line 29: Unexpected errors ['generics_typevartuple_callable.py:29:13 Invalid type [31]: Expression `typing.Callable[([int, *Ts, T], tuple[(T, *Ts)])]` is not a valid type.', 'generics_typevartuple_callable.py:29:56 Invalid type [31]: Expression `tuple[(*Ts, T)]` is not a valid type.'] Line 41: Unexpected errors ['generics_typevartuple_callable.py:41:18 Incompatible parameter type [6]: In call `func2`, for 1st positional argument, expected `typing.Callable[[int, unknown, Variable[T]], Tuple[Variable[T], unknown]]` but got `typing.Callable(callback1)[[Named(a, int), Named(b, str), Named(c, int), Named(d, complex)], Tuple[complex, str, int]]`.'] Line 42: Unexpected errors ['generics_typevartuple_callable.py:42:18 Incompatible parameter type [6]: In call `func2`, for 1st positional argument, expected `typing.Callable[[int, unknown, Variable[T]], Tuple[Variable[T], unknown]]` but got `typing.Callable(callback2)[[Named(a, int), Named(d, str)], Tuple[str]]`.'] -Line 45: Unexpected errors ['generics_typevartuple_callable.py:45:17 Invalid type [31]: Expression `*tuple[(int, *$local_generics_typevartuple_callable$Ts, $local_generics_typevartuple_callable$T)]` is not a valid type.', 'generics_typevartuple_callable.py:45:42 Invalid type [31]: Expression `tuple[($local_generics_typevartuple_callable$T, *$local_generics_typevartuple_callable$Ts)]` is not a valid type.', "generics_typevartuple_callable.py:45:42 Invalid type variable [34]: The type variable `Variable[T]` isn't present in the function's parameters."] +Line 45: Unexpected errors ['generics_typevartuple_callable.py:45:17 Invalid type [31]: Expression `*tuple[(int, *Ts, T)]` is not a valid type.', 'generics_typevartuple_callable.py:45:42 Invalid type [31]: Expression `tuple[(T, *Ts)]` is not a valid type.', "generics_typevartuple_callable.py:45:42 Invalid type variable [34]: The type variable `Variable[T]` isn't present in the function's parameters."] """ diff --git a/conformance/results/pyre/generics_typevartuple_concat.toml b/conformance/results/pyre/generics_typevartuple_concat.toml index 751ee441c..e3a1bf0fd 100644 --- a/conformance/results/pyre/generics_typevartuple_concat.toml +++ b/conformance/results/pyre/generics_typevartuple_concat.toml @@ -3,37 +3,37 @@ notes = """ Does not support TypeVarTuple. """ output = """ -generics_typevartuple_concat.py:22:12 Invalid type [31]: Expression `typing.Generic[(*$local_generics_typevartuple_concat$Ts)]` is not a valid type. -generics_typevartuple_concat.py:26:22 Invalid type [31]: Expression `Array[(*$local_generics_typevartuple_concat$Shape)]` is not a valid type. +generics_typevartuple_concat.py:22:12 Invalid type [31]: Expression `typing.Generic[(*Ts)]` is not a valid type. +generics_typevartuple_concat.py:26:22 Invalid type [31]: Expression `generics_typevartuple_concat.Array[(*Shape)]` is not a valid type. generics_typevartuple_concat.py:26:22 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. -generics_typevartuple_concat.py:26:40 Invalid type [31]: Expression `Array[(generics_typevartuple_concat.Batch, *$local_generics_typevartuple_concat$Shape)]` is not a valid type. +generics_typevartuple_concat.py:26:40 Invalid type [31]: Expression `generics_typevartuple_concat.Array[(generics_typevartuple_concat.Batch, *Shape)]` is not a valid type. generics_typevartuple_concat.py:26:40 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. -generics_typevartuple_concat.py:30:22 Invalid type [31]: Expression `Array[(generics_typevartuple_concat.Batch, *$local_generics_typevartuple_concat$Shape)]` is not a valid type. +generics_typevartuple_concat.py:30:22 Invalid type [31]: Expression `generics_typevartuple_concat.Array[(generics_typevartuple_concat.Batch, *Shape)]` is not a valid type. generics_typevartuple_concat.py:30:22 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. -generics_typevartuple_concat.py:30:47 Invalid type [31]: Expression `Array[(*$local_generics_typevartuple_concat$Shape)]` is not a valid type. +generics_typevartuple_concat.py:30:47 Invalid type [31]: Expression `generics_typevartuple_concat.Array[(*Shape)]` is not a valid type. generics_typevartuple_concat.py:30:47 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. -generics_typevartuple_concat.py:34:26 Invalid type [31]: Expression `Array[(*$local_generics_typevartuple_concat$Shape)]` is not a valid type. +generics_typevartuple_concat.py:34:26 Invalid type [31]: Expression `generics_typevartuple_concat.Array[(*Shape)]` is not a valid type. generics_typevartuple_concat.py:34:26 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. -generics_typevartuple_concat.py:34:44 Invalid type [31]: Expression `Array[(generics_typevartuple_concat.Batch, *$local_generics_typevartuple_concat$Shape, generics_typevartuple_concat.Channels)]` is not a valid type. +generics_typevartuple_concat.py:34:44 Invalid type [31]: Expression `generics_typevartuple_concat.Array[(generics_typevartuple_concat.Batch, *Shape, generics_typevartuple_concat.Channels)]` is not a valid type. generics_typevartuple_concat.py:34:44 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. generics_typevartuple_concat.py:38:13 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. -generics_typevartuple_concat.py:47:26 Invalid type [31]: Expression `tuple[(*$local_generics_typevartuple_concat$Ts)]` is not a valid type. -generics_typevartuple_concat.py:47:41 Invalid type [31]: Expression `tuple[($local_generics_typevartuple_concat$T, *$local_generics_typevartuple_concat$Ts)]` is not a valid type. +generics_typevartuple_concat.py:47:26 Invalid type [31]: Expression `tuple[(*Ts)]` is not a valid type. +generics_typevartuple_concat.py:47:41 Invalid type [31]: Expression `tuple[(T, *Ts)]` is not a valid type. generics_typevartuple_concat.py:51:22 Incompatible parameter type [6]: In call `prefix_tuple`, for argument `y`, expected `Tuple[]` but got `Tuple[bool, str]`. Expected has length 1, but actual has length 2. -generics_typevartuple_concat.py:55:36 Invalid type [31]: Expression `tuple[($local_generics_typevartuple_concat$T, *$local_generics_typevartuple_concat$Ts)]` is not a valid type. -generics_typevartuple_concat.py:55:54 Invalid type [31]: Expression `tuple[(*$local_generics_typevartuple_concat$Ts, $local_generics_typevartuple_concat$T)]` is not a valid type. +generics_typevartuple_concat.py:55:36 Invalid type [31]: Expression `tuple[(T, *Ts)]` is not a valid type. +generics_typevartuple_concat.py:55:54 Invalid type [31]: Expression `tuple[(*Ts, T)]` is not a valid type. generics_typevartuple_concat.py:56:11 Unable to concatenate tuple [60]: Expected to unpack an iterable, but got `Variable[generics_typevartuple_concat.T]`. generics_typevartuple_concat.py:56:17 Incompatible parameter type [6]: In call `tuple.__getitem__`, for 1st positional argument, expected `typing_extensions.Literal[0]` but got `slice`. """ conformance_automated = "Fail" errors_diff = """ -Line 22: Unexpected errors ['generics_typevartuple_concat.py:22:12 Invalid type [31]: Expression `typing.Generic[(*$local_generics_typevartuple_concat$Ts)]` is not a valid type.'] -Line 26: Unexpected errors ['generics_typevartuple_concat.py:26:22 Invalid type [31]: Expression `Array[(*$local_generics_typevartuple_concat$Shape)]` is not a valid type.', 'generics_typevartuple_concat.py:26:22 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.', 'generics_typevartuple_concat.py:26:40 Invalid type [31]: Expression `Array[(generics_typevartuple_concat.Batch, *$local_generics_typevartuple_concat$Shape)]` is not a valid type.', 'generics_typevartuple_concat.py:26:40 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.'] -Line 30: Unexpected errors ['generics_typevartuple_concat.py:30:22 Invalid type [31]: Expression `Array[(generics_typevartuple_concat.Batch, *$local_generics_typevartuple_concat$Shape)]` is not a valid type.', 'generics_typevartuple_concat.py:30:22 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.', 'generics_typevartuple_concat.py:30:47 Invalid type [31]: Expression `Array[(*$local_generics_typevartuple_concat$Shape)]` is not a valid type.', 'generics_typevartuple_concat.py:30:47 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.'] -Line 34: Unexpected errors ['generics_typevartuple_concat.py:34:26 Invalid type [31]: Expression `Array[(*$local_generics_typevartuple_concat$Shape)]` is not a valid type.', 'generics_typevartuple_concat.py:34:26 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.', 'generics_typevartuple_concat.py:34:44 Invalid type [31]: Expression `Array[(generics_typevartuple_concat.Batch, *$local_generics_typevartuple_concat$Shape, generics_typevartuple_concat.Channels)]` is not a valid type.', 'generics_typevartuple_concat.py:34:44 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.'] +Line 22: Unexpected errors ['generics_typevartuple_concat.py:22:12 Invalid type [31]: Expression `typing.Generic[(*Ts)]` is not a valid type.'] +Line 26: Unexpected errors ['generics_typevartuple_concat.py:26:22 Invalid type [31]: Expression `generics_typevartuple_concat.Array[(*Shape)]` is not a valid type.', 'generics_typevartuple_concat.py:26:22 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.', 'generics_typevartuple_concat.py:26:40 Invalid type [31]: Expression `generics_typevartuple_concat.Array[(generics_typevartuple_concat.Batch, *Shape)]` is not a valid type.', 'generics_typevartuple_concat.py:26:40 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.'] +Line 30: Unexpected errors ['generics_typevartuple_concat.py:30:22 Invalid type [31]: Expression `generics_typevartuple_concat.Array[(generics_typevartuple_concat.Batch, *Shape)]` is not a valid type.', 'generics_typevartuple_concat.py:30:22 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.', 'generics_typevartuple_concat.py:30:47 Invalid type [31]: Expression `generics_typevartuple_concat.Array[(*Shape)]` is not a valid type.', 'generics_typevartuple_concat.py:30:47 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.'] +Line 34: Unexpected errors ['generics_typevartuple_concat.py:34:26 Invalid type [31]: Expression `generics_typevartuple_concat.Array[(*Shape)]` is not a valid type.', 'generics_typevartuple_concat.py:34:26 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.', 'generics_typevartuple_concat.py:34:44 Invalid type [31]: Expression `generics_typevartuple_concat.Array[(generics_typevartuple_concat.Batch, *Shape, generics_typevartuple_concat.Channels)]` is not a valid type.', 'generics_typevartuple_concat.py:34:44 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.'] Line 38: Unexpected errors ['generics_typevartuple_concat.py:38:13 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.'] -Line 47: Unexpected errors ['generics_typevartuple_concat.py:47:26 Invalid type [31]: Expression `tuple[(*$local_generics_typevartuple_concat$Ts)]` is not a valid type.', 'generics_typevartuple_concat.py:47:41 Invalid type [31]: Expression `tuple[($local_generics_typevartuple_concat$T, *$local_generics_typevartuple_concat$Ts)]` is not a valid type.'] +Line 47: Unexpected errors ['generics_typevartuple_concat.py:47:26 Invalid type [31]: Expression `tuple[(*Ts)]` is not a valid type.', 'generics_typevartuple_concat.py:47:41 Invalid type [31]: Expression `tuple[(T, *Ts)]` is not a valid type.'] Line 51: Unexpected errors ['generics_typevartuple_concat.py:51:22 Incompatible parameter type [6]: In call `prefix_tuple`, for argument `y`, expected `Tuple[]` but got `Tuple[bool, str]`. Expected has length 1, but actual has length 2.'] -Line 55: Unexpected errors ['generics_typevartuple_concat.py:55:36 Invalid type [31]: Expression `tuple[($local_generics_typevartuple_concat$T, *$local_generics_typevartuple_concat$Ts)]` is not a valid type.', 'generics_typevartuple_concat.py:55:54 Invalid type [31]: Expression `tuple[(*$local_generics_typevartuple_concat$Ts, $local_generics_typevartuple_concat$T)]` is not a valid type.'] +Line 55: Unexpected errors ['generics_typevartuple_concat.py:55:36 Invalid type [31]: Expression `tuple[(T, *Ts)]` is not a valid type.', 'generics_typevartuple_concat.py:55:54 Invalid type [31]: Expression `tuple[(*Ts, T)]` is not a valid type.'] Line 56: Unexpected errors ['generics_typevartuple_concat.py:56:11 Unable to concatenate tuple [60]: Expected to unpack an iterable, but got `Variable[generics_typevartuple_concat.T]`.', 'generics_typevartuple_concat.py:56:17 Incompatible parameter type [6]: In call `tuple.__getitem__`, for 1st positional argument, expected `typing_extensions.Literal[0]` but got `slice`.'] """ diff --git a/conformance/results/pyre/generics_typevartuple_overloads.toml b/conformance/results/pyre/generics_typevartuple_overloads.toml index 05291c62f..9696e56a0 100644 --- a/conformance/results/pyre/generics_typevartuple_overloads.toml +++ b/conformance/results/pyre/generics_typevartuple_overloads.toml @@ -3,7 +3,7 @@ notes = """ Does not support star expressions for `Unpack`. """ output = """ -generics_typevartuple_overloads.py:16:12 Invalid type [31]: Expression `typing.Generic[(*$local_generics_typevartuple_overloads$Shape)]` is not a valid type. +generics_typevartuple_overloads.py:16:12 Invalid type [31]: Expression `typing.Generic[(*Shape)]` is not a valid type. generics_typevartuple_overloads.py:18:24 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. generics_typevartuple_overloads.py:18:50 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. generics_typevartuple_overloads.py:22:24 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. @@ -13,7 +13,7 @@ generics_typevartuple_overloads.py:29:37 Invalid type parameters [24]: Non-gener """ conformance_automated = "Fail" errors_diff = """ -Line 16: Unexpected errors ['generics_typevartuple_overloads.py:16:12 Invalid type [31]: Expression `typing.Generic[(*$local_generics_typevartuple_overloads$Shape)]` is not a valid type.'] +Line 16: Unexpected errors ['generics_typevartuple_overloads.py:16:12 Invalid type [31]: Expression `typing.Generic[(*Shape)]` is not a valid type.'] Line 18: Unexpected errors ['generics_typevartuple_overloads.py:18:24 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.', 'generics_typevartuple_overloads.py:18:50 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.'] Line 22: Unexpected errors ['generics_typevartuple_overloads.py:22:24 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.', 'generics_typevartuple_overloads.py:22:57 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.'] Line 29: Unexpected errors ['generics_typevartuple_overloads.py:29:13 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.', 'generics_typevartuple_overloads.py:29:37 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.'] diff --git a/conformance/results/pyre/generics_typevartuple_specialization.toml b/conformance/results/pyre/generics_typevartuple_specialization.toml index b78a5b15f..d6cf07fe0 100644 --- a/conformance/results/pyre/generics_typevartuple_specialization.toml +++ b/conformance/results/pyre/generics_typevartuple_specialization.toml @@ -3,8 +3,8 @@ notes = """ Does not support star expressions for `Unpack`. """ output = """ -generics_typevartuple_specialization.py:16:12 Invalid type [31]: Expression `typing.Generic[(*$local_generics_typevartuple_specialization$Ts)]` is not a valid type. -generics_typevartuple_specialization.py:24:26 Invalid type [31]: Expression `Array[(*tuple[(typing.Any, ...)])]` is not a valid type. +generics_typevartuple_specialization.py:16:12 Invalid type [31]: Expression `typing.Generic[(*Ts)]` is not a valid type. +generics_typevartuple_specialization.py:24:26 Invalid type [31]: Expression `generics_typevartuple_specialization.Array[(*tuple[(typing.Any, ...)])]` is not a valid type. generics_typevartuple_specialization.py:24:26 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. generics_typevartuple_specialization.py:28:13 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. generics_typevartuple_specialization.py:33:13 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. @@ -12,7 +12,7 @@ generics_typevartuple_specialization.py:41:11 Undefined attribute [16]: `tuple` generics_typevartuple_specialization.py:45:13 Undefined or invalid type [11]: Annotation `IntTuple` is not defined as a type. generics_typevartuple_specialization.py:45:39 Undefined or invalid type [11]: Annotation `NamedArray` is not defined as a type. generics_typevartuple_specialization.py:47:19 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. -generics_typevartuple_specialization.py:59:13 Invalid type [31]: Expression `typing.Generic[($local_generics_typevartuple_specialization$DType, *$local_generics_typevartuple_specialization$Shape)]` is not a valid type. +generics_typevartuple_specialization.py:59:13 Invalid type [31]: Expression `typing.Generic[(DType, *Shape)]` is not a valid type. generics_typevartuple_specialization.py:59:13 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Variable[DType]`. To reference the type variable, you can modify the class to inherit from `typing.Generic[DType]`. generics_typevartuple_specialization.py:63:20 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[]` but got `typing.Tuple[Type[float], *Tuple[typing.Any, ...]]`. generics_typevartuple_specialization.py:64:0 Invalid type parameters [24]: Non-generic type `Array2` cannot take parameters. @@ -27,25 +27,25 @@ generics_typevartuple_specialization.py:108:0 Undefined attribute [16]: `typing. generics_typevartuple_specialization.py:121:12 Unable to concatenate tuple [60]: Concatenation not yet support for multiple variadic tuples: `*Ts, *Ts`. generics_typevartuple_specialization.py:122:12 Unable to concatenate tuple [60]: Concatenation not yet support for multiple variadic tuples: `*Ts, *tuple[(int, ...)]`. generics_typevartuple_specialization.py:127:4 Undefined or invalid type [11]: Annotation `TA7` is not defined as a type. -generics_typevartuple_specialization.py:130:13 Invalid type [31]: Expression `$local_generics_typevartuple_specialization$TA7[(*$local_generics_typevartuple_specialization$Ts, $local_generics_typevartuple_specialization$T1, $local_generics_typevartuple_specialization$T2)]` is not a valid type. +generics_typevartuple_specialization.py:130:13 Invalid type [31]: Expression `TA7[(*Ts, T1, T2)]` is not a valid type. generics_typevartuple_specialization.py:130:13 Invalid type variable [34]: The type variable `Variable[T1]` isn't present in the function's parameters. generics_typevartuple_specialization.py:130:13 Invalid type variable [34]: The type variable `Variable[T2]` isn't present in the function's parameters. -generics_typevartuple_specialization.py:130:34 Invalid type [31]: Expression `tuple[(tuple[(*$local_generics_typevartuple_specialization$Ts)], $local_generics_typevartuple_specialization$T1, $local_generics_typevartuple_specialization$T2)]` is not a valid type. +generics_typevartuple_specialization.py:130:34 Invalid type [31]: Expression `tuple[(tuple[(*Ts)], T1, T2)]` is not a valid type. generics_typevartuple_specialization.py:130:34 Invalid type variable [34]: The type variable `Variable[T1]` isn't present in the function's parameters. generics_typevartuple_specialization.py:130:34 Invalid type variable [34]: The type variable `Variable[T2]` isn't present in the function's parameters. -generics_typevartuple_specialization.py:143:13 Invalid type [31]: Expression `$local_generics_typevartuple_specialization$TA8[($local_generics_typevartuple_specialization$T1, *$local_generics_typevartuple_specialization$Ts, $local_generics_typevartuple_specialization$T2, $local_generics_typevartuple_specialization$T3)]` is not a valid type. +generics_typevartuple_specialization.py:143:13 Invalid type [31]: Expression `TA8[(T1, *Ts, T2, T3)]` is not a valid type. generics_typevartuple_specialization.py:143:13 Invalid type variable [34]: The type variable `Variable[T1]` isn't present in the function's parameters. generics_typevartuple_specialization.py:143:13 Invalid type variable [34]: The type variable `Variable[T2]` isn't present in the function's parameters. generics_typevartuple_specialization.py:143:13 Invalid type variable [34]: The type variable `Variable[T3]` isn't present in the function's parameters. generics_typevartuple_specialization.py:143:13 Undefined or invalid type [11]: Annotation `TA8` is not defined as a type. -generics_typevartuple_specialization.py:143:38 Invalid type [31]: Expression `tuple[(tuple[(*$local_generics_typevartuple_specialization$Ts)], $local_generics_typevartuple_specialization$T1, $local_generics_typevartuple_specialization$T2, $local_generics_typevartuple_specialization$T3)]` is not a valid type. +generics_typevartuple_specialization.py:143:38 Invalid type [31]: Expression `tuple[(tuple[(*Ts)], T1, T2, T3)]` is not a valid type. generics_typevartuple_specialization.py:143:38 Invalid type variable [34]: The type variable `Variable[T1]` isn't present in the function's parameters. generics_typevartuple_specialization.py:143:38 Invalid type variable [34]: The type variable `Variable[T2]` isn't present in the function's parameters. generics_typevartuple_specialization.py:143:38 Invalid type variable [34]: The type variable `Variable[T3]` isn't present in the function's parameters. generics_typevartuple_specialization.py:156:14 Undefined or invalid type [11]: Annotation `TA10` is not defined as a type. -generics_typevartuple_specialization.py:156:23 Invalid type [31]: Expression `$local_generics_typevartuple_specialization$TA9[(*tuple[(int, ...)], str)]` is not a valid type. +generics_typevartuple_specialization.py:156:23 Invalid type [31]: Expression `TA9[(*tuple[(int, ...)], str)]` is not a valid type. generics_typevartuple_specialization.py:156:23 Undefined or invalid type [11]: Annotation `TA9` is not defined as a type. -generics_typevartuple_specialization.py:156:54 Invalid type [31]: Expression `$local_generics_typevartuple_specialization$TA9[(*tuple[(int, ...)], str)]` is not a valid type. +generics_typevartuple_specialization.py:156:54 Invalid type [31]: Expression `TA9[(*tuple[(int, ...)], str)]` is not a valid type. generics_typevartuple_specialization.py:157:19 Invalid type [31]: Expression `tuple[(*tuple[(int, ...)], int)]` is not a valid type. generics_typevartuple_specialization.py:158:19 Invalid type [31]: Expression `tuple[(*tuple[(int, ...)], str)]` is not a valid type. generics_typevartuple_specialization.py:159:19 Invalid type [31]: Expression `tuple[(*tuple[(int, ...)], str)]` is not a valid type. @@ -55,14 +55,14 @@ errors_diff = """ Line 109: Expected 1 errors Line 110: Expected 1 errors Line 163: Expected 1 errors -Line 16: Unexpected errors ['generics_typevartuple_specialization.py:16:12 Invalid type [31]: Expression `typing.Generic[(*$local_generics_typevartuple_specialization$Ts)]` is not a valid type.'] -Line 24: Unexpected errors ['generics_typevartuple_specialization.py:24:26 Invalid type [31]: Expression `Array[(*tuple[(typing.Any, ...)])]` is not a valid type.', 'generics_typevartuple_specialization.py:24:26 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.'] +Line 16: Unexpected errors ['generics_typevartuple_specialization.py:16:12 Invalid type [31]: Expression `typing.Generic[(*Ts)]` is not a valid type.'] +Line 24: Unexpected errors ['generics_typevartuple_specialization.py:24:26 Invalid type [31]: Expression `generics_typevartuple_specialization.Array[(*tuple[(typing.Any, ...)])]` is not a valid type.', 'generics_typevartuple_specialization.py:24:26 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.'] Line 28: Unexpected errors ['generics_typevartuple_specialization.py:28:13 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.'] Line 33: Unexpected errors ['generics_typevartuple_specialization.py:33:13 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.'] Line 41: Unexpected errors ['generics_typevartuple_specialization.py:41:11 Undefined attribute [16]: `tuple` has no attribute `__getitem__`.'] Line 45: Unexpected errors ['generics_typevartuple_specialization.py:45:13 Undefined or invalid type [11]: Annotation `IntTuple` is not defined as a type.', 'generics_typevartuple_specialization.py:45:39 Undefined or invalid type [11]: Annotation `NamedArray` is not defined as a type.'] Line 47: Unexpected errors ['generics_typevartuple_specialization.py:47:19 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.'] -Line 59: Unexpected errors ['generics_typevartuple_specialization.py:59:13 Invalid type [31]: Expression `typing.Generic[($local_generics_typevartuple_specialization$DType, *$local_generics_typevartuple_specialization$Shape)]` is not a valid type.', "generics_typevartuple_specialization.py:59:13 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Variable[DType]`. To reference the type variable, you can modify the class to inherit from `typing.Generic[DType]`."] +Line 59: Unexpected errors ['generics_typevartuple_specialization.py:59:13 Invalid type [31]: Expression `typing.Generic[(DType, *Shape)]` is not a valid type.', "generics_typevartuple_specialization.py:59:13 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Variable[DType]`. To reference the type variable, you can modify the class to inherit from `typing.Generic[DType]`."] Line 63: Unexpected errors ['generics_typevartuple_specialization.py:63:20 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[]` but got `typing.Tuple[Type[float], *Tuple[typing.Any, ...]]`.'] Line 64: Unexpected errors ['generics_typevartuple_specialization.py:64:0 Invalid type parameters [24]: Non-generic type `Array2` cannot take parameters.'] Line 68: Unexpected errors ['generics_typevartuple_specialization.py:68:4 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Array2[]` but got `Array2`.', 'generics_typevartuple_specialization.py:68:19 Invalid type parameters [24]: Non-generic type `Array2` cannot take parameters.'] @@ -71,9 +71,9 @@ Line 72: Unexpected errors ['generics_typevartuple_specialization.py:72:38 Undef Line 92: Unexpected errors ['generics_typevartuple_specialization.py:92:13 Undefined or invalid type [11]: Annotation `VariadicTuple` is not defined as a type.'] Line 95: Unexpected errors ['generics_typevartuple_specialization.py:95:19 Invalid type [31]: Expression `tuple[(typing.Any, *tuple[(typing.Any, ...)])]` is not a valid type.'] Line 108: Unexpected errors ['generics_typevartuple_specialization.py:108:0 Undefined attribute [16]: `typing.Tuple` has no attribute `__getitem__`.'] -Line 130: Unexpected errors ['generics_typevartuple_specialization.py:130:13 Invalid type [31]: Expression `$local_generics_typevartuple_specialization$TA7[(*$local_generics_typevartuple_specialization$Ts, $local_generics_typevartuple_specialization$T1, $local_generics_typevartuple_specialization$T2)]` is not a valid type.', "generics_typevartuple_specialization.py:130:13 Invalid type variable [34]: The type variable `Variable[T1]` isn't present in the function's parameters.", "generics_typevartuple_specialization.py:130:13 Invalid type variable [34]: The type variable `Variable[T2]` isn't present in the function's parameters.", 'generics_typevartuple_specialization.py:130:34 Invalid type [31]: Expression `tuple[(tuple[(*$local_generics_typevartuple_specialization$Ts)], $local_generics_typevartuple_specialization$T1, $local_generics_typevartuple_specialization$T2)]` is not a valid type.', "generics_typevartuple_specialization.py:130:34 Invalid type variable [34]: The type variable `Variable[T1]` isn't present in the function's parameters.", "generics_typevartuple_specialization.py:130:34 Invalid type variable [34]: The type variable `Variable[T2]` isn't present in the function's parameters."] -Line 143: Unexpected errors ['generics_typevartuple_specialization.py:143:13 Invalid type [31]: Expression `$local_generics_typevartuple_specialization$TA8[($local_generics_typevartuple_specialization$T1, *$local_generics_typevartuple_specialization$Ts, $local_generics_typevartuple_specialization$T2, $local_generics_typevartuple_specialization$T3)]` is not a valid type.', "generics_typevartuple_specialization.py:143:13 Invalid type variable [34]: The type variable `Variable[T1]` isn't present in the function's parameters.", "generics_typevartuple_specialization.py:143:13 Invalid type variable [34]: The type variable `Variable[T2]` isn't present in the function's parameters.", "generics_typevartuple_specialization.py:143:13 Invalid type variable [34]: The type variable `Variable[T3]` isn't present in the function's parameters.", 'generics_typevartuple_specialization.py:143:13 Undefined or invalid type [11]: Annotation `TA8` is not defined as a type.', 'generics_typevartuple_specialization.py:143:38 Invalid type [31]: Expression `tuple[(tuple[(*$local_generics_typevartuple_specialization$Ts)], $local_generics_typevartuple_specialization$T1, $local_generics_typevartuple_specialization$T2, $local_generics_typevartuple_specialization$T3)]` is not a valid type.', "generics_typevartuple_specialization.py:143:38 Invalid type variable [34]: The type variable `Variable[T1]` isn't present in the function's parameters.", "generics_typevartuple_specialization.py:143:38 Invalid type variable [34]: The type variable `Variable[T2]` isn't present in the function's parameters.", "generics_typevartuple_specialization.py:143:38 Invalid type variable [34]: The type variable `Variable[T3]` isn't present in the function's parameters."] -Line 156: Unexpected errors ['generics_typevartuple_specialization.py:156:14 Undefined or invalid type [11]: Annotation `TA10` is not defined as a type.', 'generics_typevartuple_specialization.py:156:23 Invalid type [31]: Expression `$local_generics_typevartuple_specialization$TA9[(*tuple[(int, ...)], str)]` is not a valid type.', 'generics_typevartuple_specialization.py:156:23 Undefined or invalid type [11]: Annotation `TA9` is not defined as a type.', 'generics_typevartuple_specialization.py:156:54 Invalid type [31]: Expression `$local_generics_typevartuple_specialization$TA9[(*tuple[(int, ...)], str)]` is not a valid type.'] +Line 130: Unexpected errors ['generics_typevartuple_specialization.py:130:13 Invalid type [31]: Expression `TA7[(*Ts, T1, T2)]` is not a valid type.', "generics_typevartuple_specialization.py:130:13 Invalid type variable [34]: The type variable `Variable[T1]` isn't present in the function's parameters.", "generics_typevartuple_specialization.py:130:13 Invalid type variable [34]: The type variable `Variable[T2]` isn't present in the function's parameters.", 'generics_typevartuple_specialization.py:130:34 Invalid type [31]: Expression `tuple[(tuple[(*Ts)], T1, T2)]` is not a valid type.', "generics_typevartuple_specialization.py:130:34 Invalid type variable [34]: The type variable `Variable[T1]` isn't present in the function's parameters.", "generics_typevartuple_specialization.py:130:34 Invalid type variable [34]: The type variable `Variable[T2]` isn't present in the function's parameters."] +Line 143: Unexpected errors ['generics_typevartuple_specialization.py:143:13 Invalid type [31]: Expression `TA8[(T1, *Ts, T2, T3)]` is not a valid type.', "generics_typevartuple_specialization.py:143:13 Invalid type variable [34]: The type variable `Variable[T1]` isn't present in the function's parameters.", "generics_typevartuple_specialization.py:143:13 Invalid type variable [34]: The type variable `Variable[T2]` isn't present in the function's parameters.", "generics_typevartuple_specialization.py:143:13 Invalid type variable [34]: The type variable `Variable[T3]` isn't present in the function's parameters.", 'generics_typevartuple_specialization.py:143:13 Undefined or invalid type [11]: Annotation `TA8` is not defined as a type.', 'generics_typevartuple_specialization.py:143:38 Invalid type [31]: Expression `tuple[(tuple[(*Ts)], T1, T2, T3)]` is not a valid type.', "generics_typevartuple_specialization.py:143:38 Invalid type variable [34]: The type variable `Variable[T1]` isn't present in the function's parameters.", "generics_typevartuple_specialization.py:143:38 Invalid type variable [34]: The type variable `Variable[T2]` isn't present in the function's parameters.", "generics_typevartuple_specialization.py:143:38 Invalid type variable [34]: The type variable `Variable[T3]` isn't present in the function's parameters."] +Line 156: Unexpected errors ['generics_typevartuple_specialization.py:156:14 Undefined or invalid type [11]: Annotation `TA10` is not defined as a type.', 'generics_typevartuple_specialization.py:156:23 Invalid type [31]: Expression `TA9[(*tuple[(int, ...)], str)]` is not a valid type.', 'generics_typevartuple_specialization.py:156:23 Undefined or invalid type [11]: Annotation `TA9` is not defined as a type.', 'generics_typevartuple_specialization.py:156:54 Invalid type [31]: Expression `TA9[(*tuple[(int, ...)], str)]` is not a valid type.'] Line 157: Unexpected errors ['generics_typevartuple_specialization.py:157:19 Invalid type [31]: Expression `tuple[(*tuple[(int, ...)], int)]` is not a valid type.'] Line 158: Unexpected errors ['generics_typevartuple_specialization.py:158:19 Invalid type [31]: Expression `tuple[(*tuple[(int, ...)], str)]` is not a valid type.'] Line 159: Unexpected errors ['generics_typevartuple_specialization.py:159:19 Invalid type [31]: Expression `tuple[(*tuple[(int, ...)], str)]` is not a valid type.'] diff --git a/conformance/results/pyre/generics_typevartuple_unpack.toml b/conformance/results/pyre/generics_typevartuple_unpack.toml index 8b9f13eb2..7e2f93c95 100644 --- a/conformance/results/pyre/generics_typevartuple_unpack.toml +++ b/conformance/results/pyre/generics_typevartuple_unpack.toml @@ -3,25 +3,25 @@ notes = """ Does not support star expressions for `Unpack`. """ output = """ -generics_typevartuple_unpack.py:17:12 Invalid type [31]: Expression `typing.Generic[(*$local_generics_typevartuple_unpack$Ts)]` is not a valid type. -generics_typevartuple_unpack.py:21:30 Invalid type [31]: Expression `Array[(generics_typevartuple_unpack.Batch, *tuple[(typing.Any, ...)], generics_typevartuple_unpack.Channels)]` is not a valid type. +generics_typevartuple_unpack.py:17:12 Invalid type [31]: Expression `typing.Generic[(*Ts)]` is not a valid type. +generics_typevartuple_unpack.py:21:30 Invalid type [31]: Expression `generics_typevartuple_unpack.Array[(generics_typevartuple_unpack.Batch, *tuple[(typing.Any, ...)], generics_typevartuple_unpack.Channels)]` is not a valid type. generics_typevartuple_unpack.py:21:30 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. generics_typevartuple_unpack.py:26:7 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. generics_typevartuple_unpack.py:26:49 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. generics_typevartuple_unpack.py:26:76 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. -generics_typevartuple_unpack.py:36:29 Invalid type [31]: Expression `Array[(generics_typevartuple_unpack.Batch, *$local_generics_typevartuple_unpack$Shape)]` is not a valid type. +generics_typevartuple_unpack.py:36:29 Invalid type [31]: Expression `generics_typevartuple_unpack.Array[(generics_typevartuple_unpack.Batch, *Shape)]` is not a valid type. generics_typevartuple_unpack.py:36:29 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. generics_typevartuple_unpack.py:40:28 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. -generics_typevartuple_unpack.py:44:13 Invalid type [31]: Expression `Array[(*tuple[(typing.Any, ...)])]` is not a valid type. +generics_typevartuple_unpack.py:44:13 Invalid type [31]: Expression `generics_typevartuple_unpack.Array[(*tuple[(typing.Any, ...)])]` is not a valid type. generics_typevartuple_unpack.py:44:13 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. """ conformance_automated = "Fail" errors_diff = """ Line 30: Expected 1 errors -Line 17: Unexpected errors ['generics_typevartuple_unpack.py:17:12 Invalid type [31]: Expression `typing.Generic[(*$local_generics_typevartuple_unpack$Ts)]` is not a valid type.'] -Line 21: Unexpected errors ['generics_typevartuple_unpack.py:21:30 Invalid type [31]: Expression `Array[(generics_typevartuple_unpack.Batch, *tuple[(typing.Any, ...)], generics_typevartuple_unpack.Channels)]` is not a valid type.', 'generics_typevartuple_unpack.py:21:30 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.'] +Line 17: Unexpected errors ['generics_typevartuple_unpack.py:17:12 Invalid type [31]: Expression `typing.Generic[(*Ts)]` is not a valid type.'] +Line 21: Unexpected errors ['generics_typevartuple_unpack.py:21:30 Invalid type [31]: Expression `generics_typevartuple_unpack.Array[(generics_typevartuple_unpack.Batch, *tuple[(typing.Any, ...)], generics_typevartuple_unpack.Channels)]` is not a valid type.', 'generics_typevartuple_unpack.py:21:30 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.'] Line 26: Unexpected errors ['generics_typevartuple_unpack.py:26:7 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.', 'generics_typevartuple_unpack.py:26:49 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.', 'generics_typevartuple_unpack.py:26:76 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.'] -Line 36: Unexpected errors ['generics_typevartuple_unpack.py:36:29 Invalid type [31]: Expression `Array[(generics_typevartuple_unpack.Batch, *$local_generics_typevartuple_unpack$Shape)]` is not a valid type.', 'generics_typevartuple_unpack.py:36:29 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.'] +Line 36: Unexpected errors ['generics_typevartuple_unpack.py:36:29 Invalid type [31]: Expression `generics_typevartuple_unpack.Array[(generics_typevartuple_unpack.Batch, *Shape)]` is not a valid type.', 'generics_typevartuple_unpack.py:36:29 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.'] Line 40: Unexpected errors ['generics_typevartuple_unpack.py:40:28 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.'] -Line 44: Unexpected errors ['generics_typevartuple_unpack.py:44:13 Invalid type [31]: Expression `Array[(*tuple[(typing.Any, ...)])]` is not a valid type.', 'generics_typevartuple_unpack.py:44:13 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.'] +Line 44: Unexpected errors ['generics_typevartuple_unpack.py:44:13 Invalid type [31]: Expression `generics_typevartuple_unpack.Array[(*tuple[(typing.Any, ...)])]` is not a valid type.', 'generics_typevartuple_unpack.py:44:13 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.'] """ diff --git a/conformance/results/pyre/literals_parameterizations.toml b/conformance/results/pyre/literals_parameterizations.toml index c856e8bc8..6dc0a5222 100644 --- a/conformance/results/pyre/literals_parameterizations.toml +++ b/conformance/results/pyre/literals_parameterizations.toml @@ -12,9 +12,9 @@ literals_parameterizations.py:33:0 Invalid type [31]: Expression `WriteAndTrunca literals_parameterizations.py:33:0 Invalid type [31]: Expression `WriteNoTruncateMode` is not a literal value. literals_parameterizations.py:33:0 Undefined or invalid type [11]: Annotation `` is not defined as a type. literals_parameterizations.py:35:8 Invalid type [31]: Expression `typing.Literal[(typing.Literal[(typing.Literal[(1, 2, 3)], "foo")], 5, None)]` is not a valid type. -literals_parameterizations.py:41:6 Invalid type [31]: Expression `typing.Literal[3.__add__(4)]` is not a valid type. +literals_parameterizations.py:41:6 Invalid type [31]: Expression `typing.Literal[3 + 4]` is not a valid type. literals_parameterizations.py:42:6 Invalid type [31]: Expression `typing.Literal["foo".replace("o", "b")]` is not a valid type. -literals_parameterizations.py:43:6 Invalid type [31]: Expression `typing.Literal[4.__add__(3.000000j)]` is not a valid type. +literals_parameterizations.py:43:6 Invalid type [31]: Expression `typing.Literal[4 + 3.000000j]` is not a valid type. literals_parameterizations.py:44:6 Invalid type [31]: Expression `typing.Literal[~ 5]` is not a valid type. literals_parameterizations.py:45:6 Invalid type [31]: Expression `typing.Literal[not False]` is not a valid type. literals_parameterizations.py:47:6 Invalid type [31]: Expression `typing.Literal[{ "a":"b","c":"d" }]` is not a valid type. @@ -24,7 +24,7 @@ literals_parameterizations.py:50:7 Invalid type [31]: Expression `T` is not a li literals_parameterizations.py:51:7 Invalid type [31]: Expression `typing.Literal[3.140000]` is not a valid type. literals_parameterizations.py:52:7 Invalid type [31]: Expression `Any` is not a literal value. literals_parameterizations.py:53:7 Invalid type [31]: Expression `typing.Literal[...]` is not a valid type. -literals_parameterizations.py:56:19 Invalid type [31]: Expression `typing.Literal[1.__add__(2)]` is not a valid type. +literals_parameterizations.py:56:19 Invalid type [31]: Expression `typing.Literal[1 + 2]` is not a valid type. literals_parameterizations.py:61:3 Invalid type [31]: Expression `my_function` is not a literal value. literals_parameterizations.py:65:4 Incompatible variable type [9]: x1 is declared to have type `typing_extensions.Literal['Color.RED']` but is used as type `typing_extensions.Literal[Color.RED]`. """ diff --git a/conformance/results/pyre/literals_semantics.toml b/conformance/results/pyre/literals_semantics.toml index be0b6a028..b2d2d1513 100644 --- a/conformance/results/pyre/literals_semantics.toml +++ b/conformance/results/pyre/literals_semantics.toml @@ -1,13 +1,10 @@ -conformant = "Partial" -notes = """ -Does not reject augmented operation that modifies literal value. -""" +conformant = "Pass" output = """ literals_semantics.py:10:0 Incompatible variable type [9]: v2 is declared to have type `typing_extensions.Literal[3]` but is used as type `typing_extensions.Literal[4]`. literals_semantics.py:24:4 Incompatible variable type [9]: x1 is declared to have type `typing_extensions.Literal[False]` but is used as type `typing_extensions.Literal[0]`. literals_semantics.py:25:4 Incompatible variable type [9]: x2 is declared to have type `typing_extensions.Literal[0]` but is used as type `typing_extensions.Literal[False]`. +literals_semantics.py:33:4 Incompatible variable type [9]: a is declared to have type `Union[typing_extensions.Literal[3], typing_extensions.Literal[4], typing_extensions.Literal[5]]` but is used as type `int`. """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 33: Expected 1 errors """ diff --git a/conformance/results/pyre/namedtuples_define_functional.toml b/conformance/results/pyre/namedtuples_define_functional.toml index 8bf701ba9..ac10f8e5f 100644 --- a/conformance/results/pyre/namedtuples_define_functional.toml +++ b/conformance/results/pyre/namedtuples_define_functional.toml @@ -1,6 +1,5 @@ conformant = "Partial" notes = """ -Does not reject duplicate field names in functional form. Does not handle illegal named tuple names the same as runtime. Does not handle defined fields correctly when extra flags like `rename` or `default` are used. Does not support defaults in functional form. @@ -14,6 +13,7 @@ namedtuples_define_functional.py:36:17 Incompatible parameter type [6]: In call namedtuples_define_functional.py:37:7 Too many arguments [19]: Call `Point5.__init__` expects 2 positional arguments, 3 were provided. namedtuples_define_functional.py:42:17 Incompatible parameter type [6]: In call `Point6.__init__`, for 2nd positional argument, expected `int` but got `str`. namedtuples_define_functional.py:43:14 Incompatible parameter type [6]: In call `Point6.__init__`, for argument `x`, expected `int` but got `float`. +namedtuples_define_functional.py:52:0 Duplicate parameter [65]: Duplicate parameter name `a`. namedtuples_define_functional.py:54:47 Invalid type [31]: Expression `False` is not a valid type. namedtuples_define_functional.py:54:47 Invalid type [31]: Expression `False` is not a valid type. namedtuples_define_functional.py:54:47 Invalid type [31]: Expression `typing.Final[False]` is not a valid type. @@ -21,9 +21,9 @@ namedtuples_define_functional.py:56:47 Invalid type [31]: Expression `True` is n namedtuples_define_functional.py:56:47 Invalid type [31]: Expression `True` is not a valid type. namedtuples_define_functional.py:56:47 Invalid type [31]: Expression `typing.Final[True]` is not a valid type. namedtuples_define_functional.py:57:0 Unexpected keyword [28]: Unexpected keyword argument `abc` to call `NT4.__init__`. +namedtuples_define_functional.py:63:42 Invalid type [31]: Expression `typing.Final[(1, 2)]` is not a valid type. namedtuples_define_functional.py:63:42 Invalid type [31]: Expression `(1, 2)` is not a valid type. namedtuples_define_functional.py:63:42 Invalid type [31]: Expression `(1, 2)` is not a valid type. -namedtuples_define_functional.py:63:42 Invalid type [31]: Expression `typing.Final[(1, 2)]` is not a valid type. namedtuples_define_functional.py:63:42 Invalid type parameters [24]: Generic type `typing.Final` expects 1 type parameter, received 2. namedtuples_define_functional.py:65:0 Too many arguments [19]: Call `NT5.__init__` expects 1 positional argument, 3 were provided. namedtuples_define_functional.py:66:0 Missing argument [20]: Call `NT5.__init__` expects argument `defaults`. @@ -32,6 +32,6 @@ conformance_automated = "Fail" errors_diff = """ Line 56: Unexpected errors ['namedtuples_define_functional.py:56:47 Invalid type [31]: Expression `True` is not a valid type.', 'namedtuples_define_functional.py:56:47 Invalid type [31]: Expression `True` is not a valid type.', 'namedtuples_define_functional.py:56:47 Invalid type [31]: Expression `typing.Final[True]` is not a valid type.'] Line 57: Unexpected errors ['namedtuples_define_functional.py:57:0 Unexpected keyword [28]: Unexpected keyword argument `abc` to call `NT4.__init__`.'] -Line 63: Unexpected errors ['namedtuples_define_functional.py:63:42 Invalid type [31]: Expression `(1, 2)` is not a valid type.', 'namedtuples_define_functional.py:63:42 Invalid type [31]: Expression `(1, 2)` is not a valid type.', 'namedtuples_define_functional.py:63:42 Invalid type [31]: Expression `typing.Final[(1, 2)]` is not a valid type.', 'namedtuples_define_functional.py:63:42 Invalid type parameters [24]: Generic type `typing.Final` expects 1 type parameter, received 2.'] +Line 63: Unexpected errors ['namedtuples_define_functional.py:63:42 Invalid type [31]: Expression `typing.Final[(1, 2)]` is not a valid type.', 'namedtuples_define_functional.py:63:42 Invalid type [31]: Expression `(1, 2)` is not a valid type.', 'namedtuples_define_functional.py:63:42 Invalid type [31]: Expression `(1, 2)` is not a valid type.', 'namedtuples_define_functional.py:63:42 Invalid type parameters [24]: Generic type `typing.Final` expects 1 type parameter, received 2.'] Line 65: Unexpected errors ['namedtuples_define_functional.py:65:0 Too many arguments [19]: Call `NT5.__init__` expects 1 positional argument, 3 were provided.'] """ diff --git a/conformance/results/pyre/protocols_class_objects.toml b/conformance/results/pyre/protocols_class_objects.toml index 5c0a15fbe..228b0e384 100644 --- a/conformance/results/pyre/protocols_class_objects.toml +++ b/conformance/results/pyre/protocols_class_objects.toml @@ -7,7 +7,7 @@ Fails to report some class objects as incompatible with a protocol. output = """ protocols_class_objects.py:26:11 Invalid class instantiation [45]: Cannot instantiate abstract class `Proto` with abstract method `meth`. protocols_class_objects.py:58:0 Incompatible variable type [9]: pa1 is declared to have type `ProtoA1` but is used as type `Type[ConcreteA]`. -protocols_class_objects.py:93:0 Uninitialized attribute [13]: Attribute `attr1` is declared in class `CMeta` to have type `int` but is never initialized. +protocols_class_objects.py:94:4 Uninitialized attribute [13]: Attribute `attr1` is declared in class `CMeta` to have type `int` but is never initialized. """ conformance_automated = "Fail" errors_diff = """ @@ -19,5 +19,5 @@ Line 103: Expected 1 errors Line 104: Expected 1 errors Line 105: Expected 1 errors Line 26: Unexpected errors ['protocols_class_objects.py:26:11 Invalid class instantiation [45]: Cannot instantiate abstract class `Proto` with abstract method `meth`.'] -Line 93: Unexpected errors ['protocols_class_objects.py:93:0 Uninitialized attribute [13]: Attribute `attr1` is declared in class `CMeta` to have type `int` but is never initialized.'] +Line 94: Unexpected errors ['protocols_class_objects.py:94:4 Uninitialized attribute [13]: Attribute `attr1` is declared in class `CMeta` to have type `int` but is never initialized.'] """ diff --git a/conformance/results/pyre/qualifiers_annotated.toml b/conformance/results/pyre/qualifiers_annotated.toml index f15d74fc5..2c9bc2893 100644 --- a/conformance/results/pyre/qualifiers_annotated.toml +++ b/conformance/results/pyre/qualifiers_annotated.toml @@ -6,7 +6,7 @@ Does not reject call of Annotated with no type arguments. output = """ qualifiers_annotated.py:43:6 Undefined or invalid type [11]: Annotation `` is not defined as a type. qualifiers_annotated.py:44:6 Invalid type [31]: Expression `typing.Annotated[(((int, str)), "")]` is not a valid type. -qualifiers_annotated.py:45:6 Invalid type [31]: Expression `typing.Annotated[(comprehension(int for generators(generator($target$i in range(1) if ))), "")]` is not a valid type. +qualifiers_annotated.py:45:6 Invalid type [31]: Expression `typing.Annotated[(comprehension(int for generators(generator(i in range(1) if ))), "")]` is not a valid type. qualifiers_annotated.py:46:6 Invalid type [31]: Expression `typing.Annotated[({ "a":"b" }, "")]` is not a valid type. qualifiers_annotated.py:47:6 Invalid type [31]: Expression `typing.Annotated[(lambda () (int)(), "")]` is not a valid type. qualifiers_annotated.py:48:6 Invalid type [31]: Expression `typing.Annotated[([int][0], "")]` is not a valid type. diff --git a/conformance/results/pyre/qualifiers_final_annotation.toml b/conformance/results/pyre/qualifiers_final_annotation.toml index cf80efbd7..1e7cb4c6d 100644 --- a/conformance/results/pyre/qualifiers_final_annotation.toml +++ b/conformance/results/pyre/qualifiers_final_annotation.toml @@ -6,8 +6,8 @@ Does not treat use of Final name as if it was replaced by the literal in NamedTu """ output = """ qualifiers_final_annotation.py:18:6 Invalid type parameters [24]: Generic type `Final` expects 1 type parameter, received 2. -qualifiers_final_annotation.py:28:0 Uninitialized attribute [13]: Attribute `ID3` is declared in class `ClassA` to have type `int` but is never initialized. qualifiers_final_annotation.py:34:4 Invalid assignment [41]: Cannot reassign final attribute `ClassA.ID2`. +qualifiers_final_annotation.py:38:4 Uninitialized attribute [13]: Attribute `ID3` is declared in class `ClassA` to have type `int` but is never initialized. qualifiers_final_annotation.py:54:8 Invalid assignment [41]: Cannot reassign final attribute `self.ID5`. qualifiers_final_annotation.py:62:8 Undefined attribute [16]: `ClassA` has no attribute `id3`. qualifiers_final_annotation.py:63:8 Undefined attribute [16]: `ClassA` has no attribute `id4`. @@ -16,12 +16,8 @@ qualifiers_final_annotation.py:67:8 Invalid assignment [41]: Cannot reassign fin qualifiers_final_annotation.py:71:0 Invalid assignment [41]: Cannot reassign final attribute `RATE`. qualifiers_final_annotation.py:81:0 Invalid assignment [41]: Cannot reassign final attribute `ClassB.DEFAULT_ID`. qualifiers_final_annotation.py:94:4 Invalid assignment [41]: Cannot reassign final attribute `BORDER_WIDTH`. -qualifiers_final_annotation.py:107:4 Incompatible attribute type [8]: Attribute `VALUE2` declared in class `ClassD` has type `Final` but is used as type `int`. -qualifiers_final_annotation.py:107:4 Invalid type [31]: Expression `Final` is not a valid type. Final cannot be nested. qualifiers_final_annotation.py:118:0 Invalid type [31]: Expression `typing.List[Final[int]]` is not a valid type. Final cannot be nested. qualifiers_final_annotation.py:121:10 Invalid type [31]: Parameter `x` cannot be annotated with Final. -qualifiers_final_annotation.py:131:0 Uninitialized attribute [13]: Attribute `($local_qualifiers_final_annotation$X, int)` is declared in class `N` to have type `typing.Any` but is never initialized. -qualifiers_final_annotation.py:131:0 Uninitialized attribute [13]: Attribute `($local_qualifiers_final_annotation$Y, int)` is declared in class `N` to have type `typing.Any` but is never initialized. qualifiers_final_annotation.py:133:0 Unexpected keyword [28]: Unexpected keyword argument `x` to call `N.__init__`. qualifiers_final_annotation.py:134:0 Unexpected keyword [28]: Unexpected keyword argument `a` to call `N.__init__`. qualifiers_final_annotation.py:135:0 Unexpected keyword [28]: Unexpected keyword argument `x` to call `N.__init__`. @@ -35,9 +31,7 @@ qualifiers_final_annotation.py:155:8 Invalid assignment [41]: Cannot reassign fi conformance_automated = "Fail" errors_diff = """ Line 16: Expected 1 errors -Line 38: Expected 1 errors +Line 107: Expected 1 errors Line 108: Expected 1 errors -Line 28: Unexpected errors ['qualifiers_final_annotation.py:28:0 Uninitialized attribute [13]: Attribute `ID3` is declared in class `ClassA` to have type `int` but is never initialized.'] -Line 131: Unexpected errors ['qualifiers_final_annotation.py:131:0 Uninitialized attribute [13]: Attribute `($local_qualifiers_final_annotation$X, int)` is declared in class `N` to have type `typing.Any` but is never initialized.', 'qualifiers_final_annotation.py:131:0 Uninitialized attribute [13]: Attribute `($local_qualifiers_final_annotation$Y, int)` is declared in class `N` to have type `typing.Any` but is never initialized.'] Line 133: Unexpected errors ['qualifiers_final_annotation.py:133:0 Unexpected keyword [28]: Unexpected keyword argument `x` to call `N.__init__`.'] """ diff --git a/conformance/results/pyre/specialtypes_never.toml b/conformance/results/pyre/specialtypes_never.toml index 61b1c2673..0a02bef8f 100644 --- a/conformance/results/pyre/specialtypes_never.toml +++ b/conformance/results/pyre/specialtypes_never.toml @@ -4,8 +4,8 @@ Does not treat Never as compatible with all other types. """ output = """ specialtypes_never.py:21:8 Incompatible return type [7]: Function declared non-returnable, but got `None`. -specialtypes_never.py:55:0 Uninitialized attribute [13]: Attribute `x` is declared in class `ClassA` to have type `NoReturn` but is never initialized. -specialtypes_never.py:55:0 Uninitialized attribute [13]: Attribute `y` is declared in class `ClassA` to have type `typing.List[NoReturn]` but is never initialized. +specialtypes_never.py:56:4 Uninitialized attribute [13]: Attribute `x` is declared in class `ClassA` to have type `NoReturn` but is never initialized. +specialtypes_never.py:57:4 Uninitialized attribute [13]: Attribute `y` is declared in class `ClassA` to have type `typing.List[NoReturn]` but is never initialized. specialtypes_never.py:64:4 Incompatible variable type [9]: v1 is declared to have type `int` but is used as type `Never`. specialtypes_never.py:65:4 Incompatible variable type [9]: v2 is declared to have type `str` but is used as type `Never`. specialtypes_never.py:66:4 Incompatible variable type [9]: v3 is declared to have type `List[str]` but is used as type `Never`. @@ -18,7 +18,8 @@ conformance_automated = "Fail" errors_diff = """ Line 19: Expected 1 errors Line 21: Unexpected errors ['specialtypes_never.py:21:8 Incompatible return type [7]: Function declared non-returnable, but got `None`.'] -Line 55: Unexpected errors ['specialtypes_never.py:55:0 Uninitialized attribute [13]: Attribute `x` is declared in class `ClassA` to have type `NoReturn` but is never initialized.', 'specialtypes_never.py:55:0 Uninitialized attribute [13]: Attribute `y` is declared in class `ClassA` to have type `typing.List[NoReturn]` but is never initialized.'] +Line 56: Unexpected errors ['specialtypes_never.py:56:4 Uninitialized attribute [13]: Attribute `x` is declared in class `ClassA` to have type `NoReturn` but is never initialized.'] +Line 57: Unexpected errors ['specialtypes_never.py:57:4 Uninitialized attribute [13]: Attribute `y` is declared in class `ClassA` to have type `typing.List[NoReturn]` but is never initialized.'] Line 64: Unexpected errors ['specialtypes_never.py:64:4 Incompatible variable type [9]: v1 is declared to have type `int` but is used as type `Never`.'] Line 65: Unexpected errors ['specialtypes_never.py:65:4 Incompatible variable type [9]: v2 is declared to have type `str` but is used as type `Never`.'] Line 66: Unexpected errors ['specialtypes_never.py:66:4 Incompatible variable type [9]: v3 is declared to have type `List[str]` but is used as type `Never`.'] diff --git a/conformance/results/pyre/tuples_type_form.toml b/conformance/results/pyre/tuples_type_form.toml index 18b7d89ad..750fc7954 100644 --- a/conformance/results/pyre/tuples_type_form.toml +++ b/conformance/results/pyre/tuples_type_form.toml @@ -1,20 +1,17 @@ -conformant = "Partial" -notes = """ -Does not reject some invalid tuple forms involving ellipsis. -""" +conformant = "Pass" output = """ tuples_type_form.py:12:0 Incompatible variable type [9]: t1 is declared to have type `Tuple[int]` but is used as type `Tuple[int, int]`. tuples_type_form.py:14:0 Incompatible variable type [9]: t2 is declared to have type `Tuple[int, int]` but is used as type `Tuple[int]`. tuples_type_form.py:15:0 Incompatible variable type [9]: t2 is declared to have type `Tuple[int, int]` but is used as type `Tuple[int, str]`. tuples_type_form.py:25:0 Incompatible variable type [9]: t10 is declared to have type `Tuple[]` but is used as type `Tuple[int]`. tuples_type_form.py:36:0 Incompatible variable type [9]: t20 is declared to have type `typing.Tuple[int, ...]` but is used as type `Tuple[int, int, int, str]`. -tuples_type_form.py:40:5 Undefined or invalid type [11]: Annotation `...` is not defined as a type. +tuples_type_form.py:40:5 Invalid type [31]: Expression `tuple[(int, int, ...)]` is not a valid type. +tuples_type_form.py:41:5 Invalid type [31]: Expression `tuple[...]` is not a valid type. +tuples_type_form.py:42:5 Invalid type [31]: Expression `tuple[(..., int)]` is not a valid type. +tuples_type_form.py:43:5 Invalid type [31]: Expression `tuple[(int, ..., int)]` is not a valid type. tuples_type_form.py:44:5 Invalid type [31]: Expression `tuple[(*tuple[str], ...)]` is not a valid type. tuples_type_form.py:45:5 Invalid type [31]: Expression `tuple[(*tuple[(str, ...)], ...)]` is not a valid type. """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 41: Expected 1 errors -Line 42: Expected 1 errors -Line 43: Expected 1 errors """ diff --git a/conformance/results/pyre/tuples_unpacked.toml b/conformance/results/pyre/tuples_unpacked.toml index 521b8b9a7..19a418572 100644 --- a/conformance/results/pyre/tuples_unpacked.toml +++ b/conformance/results/pyre/tuples_unpacked.toml @@ -13,9 +13,9 @@ tuples_unpacked.py:38:4 Invalid type [31]: Expression `tuple[(*tuple[str], *tupl tuples_unpacked.py:39:4 Invalid type [31]: Expression `tuple[(*tuple[(str, *tuple[(str, ...)])])]` is not a valid type. tuples_unpacked.py:40:4 Invalid type [31]: Expression `tuple[(*tuple[(str, ...)], *tuple[(int, ...)])]` is not a valid type. tuples_unpacked.py:41:4 Invalid type [31]: Expression `tuple[(*tuple[(str, *tuple[(str, ...)])], *tuple[(int, ...)])]` is not a valid type. -tuples_unpacked.py:49:13 Invalid type [31]: Expression `tuple[(*$local_tuples_unpacked$Ts)]` is not a valid type. -tuples_unpacked.py:50:8 Invalid type [31]: Expression `tuple[(*tuple[str], *$local_tuples_unpacked$Ts)]` is not a valid type. -tuples_unpacked.py:51:8 Invalid type [31]: Expression `tuple[(*tuple[(str, ...)], *$local_tuples_unpacked$Ts)]` is not a valid type. +tuples_unpacked.py:49:13 Invalid type [31]: Expression `tuple[(*Ts)]` is not a valid type. +tuples_unpacked.py:50:8 Invalid type [31]: Expression `tuple[(*tuple[str], *Ts)]` is not a valid type. +tuples_unpacked.py:51:8 Invalid type [31]: Expression `tuple[(*tuple[(str, ...)], *Ts)]` is not a valid type. tuples_unpacked.py:59:5 Invalid type [31]: Expression `tuple[(typing.Unpack[tuple[(str, ...)]], typing.Unpack[tuple[(int, ...)]])]` is not a valid type. tuples_unpacked.py:60:5 Invalid type [31]: Expression `tuple[(typing.Unpack[tuple[(str, typing.Unpack[tuple[(str, ...)]])]], typing.Unpack[tuple[(int, ...)]])]` is not a valid type. """ @@ -30,7 +30,7 @@ Line 31: Unexpected errors ['tuples_unpacked.py:31:4 Invalid type [31]: Expressi Line 33: Unexpected errors ['tuples_unpacked.py:33:4 Invalid type [31]: Expression `tuple[(*tuple[(int, ...)], *tuple[int])]` is not a valid type.'] Line 38: Unexpected errors ['tuples_unpacked.py:38:4 Invalid type [31]: Expression `tuple[(*tuple[str], *tuple[str])]` is not a valid type.'] Line 39: Unexpected errors ['tuples_unpacked.py:39:4 Invalid type [31]: Expression `tuple[(*tuple[(str, *tuple[(str, ...)])])]` is not a valid type.'] -Line 49: Unexpected errors ['tuples_unpacked.py:49:13 Invalid type [31]: Expression `tuple[(*$local_tuples_unpacked$Ts)]` is not a valid type.'] -Line 50: Unexpected errors ['tuples_unpacked.py:50:8 Invalid type [31]: Expression `tuple[(*tuple[str], *$local_tuples_unpacked$Ts)]` is not a valid type.'] +Line 49: Unexpected errors ['tuples_unpacked.py:49:13 Invalid type [31]: Expression `tuple[(*Ts)]` is not a valid type.'] +Line 50: Unexpected errors ['tuples_unpacked.py:50:8 Invalid type [31]: Expression `tuple[(*tuple[str], *Ts)]` is not a valid type.'] Line 60: Unexpected errors ['tuples_unpacked.py:60:5 Invalid type [31]: Expression `tuple[(typing.Unpack[tuple[(str, typing.Unpack[tuple[(str, ...)]])]], typing.Unpack[tuple[(int, ...)]])]` is not a valid type.'] """ diff --git a/conformance/results/pyre/typeddicts_class_syntax.toml b/conformance/results/pyre/typeddicts_class_syntax.toml index 213091bcc..86a0789e8 100644 --- a/conformance/results/pyre/typeddicts_class_syntax.toml +++ b/conformance/results/pyre/typeddicts_class_syntax.toml @@ -6,8 +6,8 @@ Does not report when other keyword argument is provided. Does not support generic TypedDict class. """ output = """ -typeddicts_class_syntax.py:57:0 Uninitialized attribute [13]: Attribute `name` is declared in class `GenericTypedDict` to have type `str` but is never initialized. -typeddicts_class_syntax.py:57:0 Uninitialized attribute [13]: Attribute `value` is declared in class `GenericTypedDict` to have type `Variable[T]` but is never initialized. +typeddicts_class_syntax.py:58:4 Uninitialized attribute [13]: Attribute `name` is declared in class `GenericTypedDict` to have type `str` but is never initialized. +typeddicts_class_syntax.py:59:4 Uninitialized attribute [13]: Attribute `value` is declared in class `GenericTypedDict` to have type `Variable[T]` but is never initialized. """ conformance_automated = "Fail" errors_diff = """ @@ -16,5 +16,6 @@ Line 33: Expected 1 errors Line 38: Expected 1 errors Line 44: Expected 1 errors Line 49: Expected 1 errors -Line 57: Unexpected errors ['typeddicts_class_syntax.py:57:0 Uninitialized attribute [13]: Attribute `name` is declared in class `GenericTypedDict` to have type `str` but is never initialized.', 'typeddicts_class_syntax.py:57:0 Uninitialized attribute [13]: Attribute `value` is declared in class `GenericTypedDict` to have type `Variable[T]` but is never initialized.'] +Line 58: Unexpected errors ['typeddicts_class_syntax.py:58:4 Uninitialized attribute [13]: Attribute `name` is declared in class `GenericTypedDict` to have type `str` but is never initialized.'] +Line 59: Unexpected errors ['typeddicts_class_syntax.py:59:4 Uninitialized attribute [13]: Attribute `value` is declared in class `GenericTypedDict` to have type `Variable[T]` but is never initialized.'] """ diff --git a/conformance/results/pyre/typeddicts_required.toml b/conformance/results/pyre/typeddicts_required.toml index f8d3d4cc8..78870ad01 100644 --- a/conformance/results/pyre/typeddicts_required.toml +++ b/conformance/results/pyre/typeddicts_required.toml @@ -4,19 +4,18 @@ Does not reject use of `Required` in function parameter annotation. Does not reject nested use of `Required` in type annotation. Does not support recursive TypedDict definitions. Incorrectly complains about uninitialized attributes on TypedDict definitions. +Incorrectly generates "attribute not initialized" errors for TypedDict fields. """ output = """ -typeddicts_required.py:11:0 Uninitialized attribute [13]: Attribute `x` is declared in class `NotTypedDict` to have type `Required[int]` but is never initialized. +typeddicts_required.py:12:4 Uninitialized attribute [13]: Attribute `x` is declared in class `NotTypedDict` to have type `Required[int]` but is never initialized. typeddicts_required.py:71:62 Undefined or invalid type [11]: Annotation `RecursiveMovie` is not defined as a type. typeddicts_required.py:74:24 TypedDict initialization error [55]: Expected type `unknown` for `RecursiveMovie` field `predecessor` but got `typing.Dict[str, str]`. """ conformance_automated = "Fail" errors_diff = """ -Line 12: Expected 1 errors Line 16: Expected 1 errors Line 59: Expected 1 errors Line 60: Expected 1 errors -Line 11: Unexpected errors ['typeddicts_required.py:11:0 Uninitialized attribute [13]: Attribute `x` is declared in class `NotTypedDict` to have type `Required[int]` but is never initialized.'] Line 71: Unexpected errors ['typeddicts_required.py:71:62 Undefined or invalid type [11]: Annotation `RecursiveMovie` is not defined as a type.'] Line 74: Unexpected errors ['typeddicts_required.py:74:24 TypedDict initialization error [55]: Expected type `unknown` for `RecursiveMovie` field `predecessor` but got `typing.Dict[str, str]`.'] """ diff --git a/conformance/results/pyre/version.toml b/conformance/results/pyre/version.toml index 8156a667e..fff2c3f20 100644 --- a/conformance/results/pyre/version.toml +++ b/conformance/results/pyre/version.toml @@ -1,2 +1,2 @@ -version = "pyre 0.9.21" -test_duration = 1.7 +version = "pyre 0.9.22" +test_duration = 2.8 diff --git a/conformance/results/pyright/classes_classvar.toml b/conformance/results/pyright/classes_classvar.toml index b922102b3..c31f7a241 100644 --- a/conformance/results/pyright/classes_classvar.toml +++ b/conformance/results/pyright/classes_classvar.toml @@ -1,24 +1,24 @@ conformant = "Pass" output = """ -classes_classvar.py:37:25 - error: Expected only one type argument after "ClassVar" -classes_classvar.py:38:14 - error: Expected type expression but received "Literal[3]" (reportGeneralTypeIssues) -classes_classvar.py:39:14 - error: "var" is not defined (reportUndefinedVariable) -classes_classvar.py:44:20 - error: "ClassVar" type cannot include type variables (reportGeneralTypeIssues) +classes_classvar.py:38:25 - error: Expected only one type argument after "ClassVar" +classes_classvar.py:39:14 - error: Expected type expression but received "Literal[3]" (reportGeneralTypeIssues) +classes_classvar.py:40:14 - error: "var" is not defined (reportUndefinedVariable) classes_classvar.py:45:20 - error: "ClassVar" type cannot include type variables (reportGeneralTypeIssues) classes_classvar.py:46:20 - error: "ClassVar" type cannot include type variables (reportGeneralTypeIssues) -classes_classvar.py:51:33 - error: Expression of type "dict[Any, Any]" is incompatible with declared type "list[str]" (reportAssignmentType) -classes_classvar.py:53:17 - error: "ClassVar" is not allowed in this context +classes_classvar.py:47:20 - error: "ClassVar" type cannot include type variables (reportGeneralTypeIssues) +classes_classvar.py:52:33 - error: Expression of type "dict[Any, Any]" is incompatible with declared type "list[str]" (reportAssignmentType) classes_classvar.py:54:17 - error: "ClassVar" is not allowed in this context -classes_classvar.py:62:26 - error: "ClassVar" is not allowed in this context -classes_classvar.py:63:12 - error: "ClassVar" is not allowed in this context -classes_classvar.py:64:18 - error: "ClassVar" is not allowed in this context -classes_classvar.py:66:26 - error: "ClassVar" is not allowed in this context -classes_classvar.py:70:8 - error: "ClassVar" is not allowed in this context -classes_classvar.py:71:20 - error: "ClassVar" is not allowed in this context -classes_classvar.py:101:14 - error: Cannot assign to attribute "stats" for class "Starship" +classes_classvar.py:55:17 - error: "ClassVar" is not allowed in this context +classes_classvar.py:63:26 - error: "ClassVar" is not allowed in this context +classes_classvar.py:64:12 - error: "ClassVar" is not allowed in this context +classes_classvar.py:65:18 - error: "ClassVar" is not allowed in this context +classes_classvar.py:67:26 - error: "ClassVar" is not allowed in this context +classes_classvar.py:71:8 - error: "ClassVar" is not allowed in this context +classes_classvar.py:72:20 - error: "ClassVar" is not allowed in this context +classes_classvar.py:102:14 - error: Cannot assign to attribute "stats" for class "Starship"   Attribute "stats" cannot be assigned through a class instance because it is a ClassVar     Attribute "__set__" is unknown (reportAttributeAccessIssue) -classes_classvar.py:130:13 - error: Expression of type "ProtoAImpl" is incompatible with declared type "ProtoA" +classes_classvar.py:131:13 - error: Expression of type "ProtoAImpl" is incompatible with declared type "ProtoA"   "ProtoAImpl" is incompatible with protocol "ProtoA"     "x" is defined as a ClassVar in protocol     "y" is defined as a ClassVar in protocol (reportAssignmentType) diff --git a/conformance/results/pyright/generics_paramspec_components.toml b/conformance/results/pyright/generics_paramspec_components.toml index c66227eee..cb85d165d 100644 --- a/conformance/results/pyright/generics_paramspec_components.toml +++ b/conformance/results/pyright/generics_paramspec_components.toml @@ -7,7 +7,6 @@ generics_paramspec_components.py:23:28 - error: "args" and "kwargs" attributes o generics_paramspec_components.py:23:46 - error: "args" attribute of ParamSpec is valid only when used with *args parameter generics_paramspec_components.py:26:28 - error: "args" and "kwargs" attributes of ParamSpec must both appear within a function signature (reportGeneralTypeIssues) generics_paramspec_components.py:30:25 - error: ParamSpec "P" has no meaning in this context (reportGeneralTypeIssues) -generics_paramspec_components.py:30:43 - error: ParamSpec "P" has no meaning in this context (reportGeneralTypeIssues) generics_paramspec_components.py:35:18 - error: "args" attribute of ParamSpec is valid only when used with *args parameter generics_paramspec_components.py:36:20 - error: "kwargs" attribute of ParamSpec is valid only when used with **kwargs parameter generics_paramspec_components.py:38:26 - error: "args" and "kwargs" attributes of ParamSpec must both appear within a function signature (reportGeneralTypeIssues) @@ -17,7 +16,7 @@ generics_paramspec_components.py:51:11 - error: Expected 0 positional arguments generics_paramspec_components.py:60:28 - error: Keyword parameter "s" cannot appear in signature after ParamSpec args parameter (reportGeneralTypeIssues) generics_paramspec_components.py:70:12 - error: Expected 1 positional argument (reportCallIssue) generics_paramspec_components.py:72:12 - error: Expected 1 positional argument (reportCallIssue) -generics_paramspec_components.py:83:19 - error: Expected 2 positional arguments (reportCallIssue) +generics_paramspec_components.py:83:19 - error: Expected 1 positional argument (reportCallIssue) generics_paramspec_components.py:98:20 - error: Argument of type "Literal['A']" cannot be assigned to parameter "a" of type "int"   "Literal['A']" is incompatible with "int" (reportArgumentType) generics_paramspec_components.py:98:25 - error: Argument of type "Literal[1]" cannot be assigned to parameter "b" of type "str" diff --git a/conformance/results/pyright/generics_paramspec_specialization.toml b/conformance/results/pyright/generics_paramspec_specialization.toml index 10d7c80a1..525051f47 100644 --- a/conformance/results/pyright/generics_paramspec_specialization.toml +++ b/conformance/results/pyright/generics_paramspec_specialization.toml @@ -1,14 +1,14 @@ conformant = "Pass" output = """ -generics_paramspec_specialization.py:45:27 - error: Type "int" cannot be assigned to type variable "P1@ClassA" +generics_paramspec_specialization.py:44:27 - error: Type "int" cannot be assigned to type variable "P1@ClassA"   Type "int" is incompatible with ParamSpec "P1@ClassA" (reportInvalidTypeArguments) -generics_paramspec_specialization.py:55:9 - error: Argument of type "Literal['']" cannot be assigned to parameter of type "int" +generics_paramspec_specialization.py:54:9 - error: Argument of type "Literal['']" cannot be assigned to parameter of type "int"   "Literal['']" is incompatible with "int" (reportArgumentType) -generics_paramspec_specialization.py:56:16 - error: Argument of type "Literal['']" cannot be assigned to parameter of type "bool" +generics_paramspec_specialization.py:55:16 - error: Argument of type "Literal['']" cannot be assigned to parameter of type "bool"   "Literal['']" is incompatible with "bool" (reportArgumentType) -generics_paramspec_specialization.py:61:9 - error: Argument of type "Literal['']" cannot be assigned to parameter of type "int" +generics_paramspec_specialization.py:60:9 - error: Argument of type "Literal['']" cannot be assigned to parameter of type "int"   "Literal['']" is incompatible with "int" (reportArgumentType) -generics_paramspec_specialization.py:62:16 - error: Argument of type "Literal['']" cannot be assigned to parameter of type "bool" +generics_paramspec_specialization.py:61:16 - error: Argument of type "Literal['']" cannot be assigned to parameter of type "bool"   "Literal['']" is incompatible with "bool" (reportArgumentType) """ conformance_automated = "Pass" diff --git a/conformance/results/pyright/protocols_generic.toml b/conformance/results/pyright/protocols_generic.toml index 02a95883a..6e653d432 100644 --- a/conformance/results/pyright/protocols_generic.toml +++ b/conformance/results/pyright/protocols_generic.toml @@ -7,7 +7,7 @@ protocols_generic.py:40:24 - error: Expression of type "Concrete1" is incompatib         Parameter 1: type "S@Proto1" is incompatible with type "str"           "int" is incompatible with "str"         Function return type "str" is incompatible with type "S@Proto1" -          Type "str" is incompatible with type "int" +          Type "int | str" is incompatible with type "int"     "__iter__" is an incompatible type ... (reportAssignmentType) protocols_generic.py:44:30 - error: Only one Generic[...] or Protocol[...] base class allowed (reportGeneralTypeIssues) diff --git a/conformance/results/pyright/protocols_subtyping.toml b/conformance/results/pyright/protocols_subtyping.toml index 572ac5d8e..a7b394f5e 100644 --- a/conformance/results/pyright/protocols_subtyping.toml +++ b/conformance/results/pyright/protocols_subtyping.toml @@ -8,10 +8,18 @@ protocols_subtyping.py:55:18 - error: Expression of type "Proto2" is incompatibl     "method2" is not present (reportAssignmentType) protocols_subtyping.py:79:30 - error: Expression of type "Proto5[int]" is incompatible with declared type "Proto4[int, float]"   "Proto5[int]" is incompatible with protocol "Proto4[int, float]" -    Type parameter "T@Proto4" is invariant, but "int" is not the same as "float" (reportAssignmentType) +    "method1" is an incompatible type +      Type "(a: int, b: int) -> tuple[int, int]" is incompatible with type "(a: S@Proto4, b: T@Proto4) -> tuple[S@Proto4, T@Proto4]" +        Parameter 2: type "T@Proto4" is incompatible with type "int" +          "float" is incompatible with "int" (reportAssignmentType) protocols_subtyping.py:80:25 - error: Expression of type "Proto4[int, int]" is incompatible with declared type "Proto5[float]"   "Proto4[int, int]" is incompatible with protocol "Proto5[float]" -    Type parameter "T@Proto5" is invariant, but "int" is not the same as "float" (reportAssignmentType) +    "method1" is an incompatible type +      Type "(a: int, b: int) -> tuple[int, int]" is incompatible with type "(a: T@Proto5, b: T@Proto5) -> tuple[T@Proto5, T@Proto5]" +        Parameter 1: type "T@Proto5" is incompatible with type "int" +          "float" is incompatible with "int" +        Parameter 2: type "T@Proto5" is incompatible with type "int" +          "float" is incompatible with "int" (reportAssignmentType) protocols_subtyping.py:102:30 - error: Expression of type "Proto6[float, float]" is incompatible with declared type "Proto7[int, float]"   "Proto6[float, float]" is incompatible with protocol "Proto7[int, float]"     "method1" is an incompatible type @@ -20,8 +28,10 @@ protocols_subtyping.py:102:30 - error: Expression of type "Proto6[float, float]"           "Sequence[float]" is incompatible with "Sequence[S_co@Proto7]" (reportAssignmentType) protocols_subtyping.py:103:33 - error: Expression of type "Proto6[float, float]" is incompatible with declared type "Proto7[float, object]"   "Proto6[float, float]" is incompatible with protocol "Proto7[float, object]" -    Type parameter "T_contra@Proto7" is contravariant, but "float" is not a supertype of "object" -      "object" is incompatible with "float" (reportAssignmentType) +    "method1" is an incompatible type +      Type "(a: float) -> Sequence[float]" is incompatible with type "(a: T_contra@Proto7) -> Sequence[S_co@Proto7]" +        Parameter 1: type "T_contra@Proto7" is incompatible with type "float" +          "object" is incompatible with "float" (reportAssignmentType) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/version.toml b/conformance/results/pyright/version.toml index 7fe2e2e7b..b53d80f08 100644 --- a/conformance/results/pyright/version.toml +++ b/conformance/results/pyright/version.toml @@ -1,2 +1,2 @@ -version = "pyright 1.1.366" -test_duration = 1.3 +version = "pyright 1.1.369" +test_duration = 1.4 diff --git a/conformance/results/pytype/classes_classvar.toml b/conformance/results/pytype/classes_classvar.toml index eae642386..409a82889 100644 --- a/conformance/results/pytype/classes_classvar.toml +++ b/conformance/results/pytype/classes_classvar.toml @@ -13,35 +13,37 @@ Does not reject assignment of ClassVar through instance of class. """ output = """ File "classes_classvar.py", line 7, in : typing.TypeVarTuple not supported yet [not-supported-yet] -File "classes_classvar.py", line 28, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] -File "classes_classvar.py", line 37, in ClassA: Invalid type annotation 'ClassVar[int, str]' [invalid-annotation] -File "classes_classvar.py", line 38, in ClassA: class ClassVar is not indexable [not-indexable] -File "classes_classvar.py", line 39, in ClassA: Name 'var' is not defined [name-error] -File "classes_classvar.py", line 51, in ClassA: Type annotation for bad8 does not match type of assignment [annotation-type-mismatch] -File "classes_classvar.py", line 59, in ClassA: Type annotation for good4 does not match type of assignment [annotation-type-mismatch] -File "classes_classvar.py", line 67, in method2: bad return type [bad-return-type] -File "classes_classvar.py", line 77, in : ClassVar [assert-type] -File "classes_classvar.py", line 120, in ProtoA: Type annotation for z does not match type of assignment [annotation-type-mismatch] -File "classes_classvar.py", line 130, in : Type annotation for a does not match type of assignment [annotation-type-mismatch] +File "classes_classvar.py", line 29, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] +File "classes_classvar.py", line 38, in ClassA: Invalid type annotation 'ClassVar[int, str]' [invalid-annotation] +File "classes_classvar.py", line 38, in ClassA: Invalid type annotation 'ClassVar[int, str]' [invalid-annotation] +File "classes_classvar.py", line 39, in ClassA: class ClassVar is not indexable [not-indexable] +File "classes_classvar.py", line 39, in ClassA: Invalid type annotation 'CV[3]' [invalid-annotation] +File "classes_classvar.py", line 40, in ClassA: Name 'var' is not defined [name-error] +File "classes_classvar.py", line 52, in ClassA: Type annotation for bad8 does not match type of assignment [annotation-type-mismatch] +File "classes_classvar.py", line 60, in ClassA: Type annotation for good4 does not match type of assignment [annotation-type-mismatch] +File "classes_classvar.py", line 68, in method2: bad return type [bad-return-type] +File "classes_classvar.py", line 78, in : ClassVar [assert-type] +File "classes_classvar.py", line 121, in ProtoA: Type annotation for z does not match type of assignment [annotation-type-mismatch] +File "classes_classvar.py", line 131, in : Type annotation for a does not match type of assignment [annotation-type-mismatch] """ conformance_automated = "Fail" errors_diff = """ -Line 44: Expected 1 errors Line 45: Expected 1 errors Line 46: Expected 1 errors -Line 53: Expected 1 errors +Line 47: Expected 1 errors Line 54: Expected 1 errors -Line 62: Expected 1 errors +Line 55: Expected 1 errors Line 63: Expected 1 errors Line 64: Expected 1 errors -Line 66: Expected 1 errors -Line 70: Expected 1 errors +Line 65: Expected 1 errors +Line 67: Expected 1 errors Line 71: Expected 1 errors -Line 101: Expected 1 errors +Line 72: Expected 1 errors +Line 102: Expected 1 errors Line 7: Unexpected errors ['File "classes_classvar.py", line 7, in : typing.TypeVarTuple not supported yet [not-supported-yet]'] -Line 28: Unexpected errors ['File "classes_classvar.py", line 28, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] -Line 59: Unexpected errors ['File "classes_classvar.py", line 59, in ClassA: Type annotation for good4 does not match type of assignment [annotation-type-mismatch]'] -Line 67: Unexpected errors ['File "classes_classvar.py", line 67, in method2: bad return type [bad-return-type]'] -Line 77: Unexpected errors ['File "classes_classvar.py", line 77, in : ClassVar [assert-type]'] -Line 120: Unexpected errors ['File "classes_classvar.py", line 120, in ProtoA: Type annotation for z does not match type of assignment [annotation-type-mismatch]'] +Line 29: Unexpected errors ['File "classes_classvar.py", line 29, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] +Line 60: Unexpected errors ['File "classes_classvar.py", line 60, in ClassA: Type annotation for good4 does not match type of assignment [annotation-type-mismatch]'] +Line 68: Unexpected errors ['File "classes_classvar.py", line 68, in method2: bad return type [bad-return-type]'] +Line 78: Unexpected errors ['File "classes_classvar.py", line 78, in : ClassVar [assert-type]'] +Line 121: Unexpected errors ['File "classes_classvar.py", line 121, in ProtoA: Type annotation for z does not match type of assignment [annotation-type-mismatch]'] """ diff --git a/conformance/results/pytype/generics_paramspec_specialization.toml b/conformance/results/pytype/generics_paramspec_specialization.toml index 683e24760..e4e920c9b 100644 --- a/conformance/results/pytype/generics_paramspec_specialization.toml +++ b/conformance/results/pytype/generics_paramspec_specialization.toml @@ -5,27 +5,27 @@ Does not reject invalid specialization of class with both TypeVar and ParamSpec. Reports error for valid method call involving ParamSpec. """ output = """ -File "generics_paramspec_specialization.py", line 33, in : Invalid type annotation '[int, bool]' [invalid-annotation] -File "generics_paramspec_specialization.py", line 33, in : Invalid type annotation 'Ellipsis' [invalid-annotation] -File "generics_paramspec_specialization.py", line 37, in : Invalid type annotation 'Ellipsis' [invalid-annotation] -File "generics_paramspec_specialization.py", line 41, in : Invalid type annotation '[]' [invalid-annotation] -File "generics_paramspec_specialization.py", line 53, in : Invalid type annotation '[int, str, bool]' [invalid-annotation] +File "generics_paramspec_specialization.py", line 32, in : Invalid type annotation '[int, bool]' [invalid-annotation] +File "generics_paramspec_specialization.py", line 32, in : Invalid type annotation 'Ellipsis' [invalid-annotation] +File "generics_paramspec_specialization.py", line 36, in : Invalid type annotation 'Ellipsis' [invalid-annotation] +File "generics_paramspec_specialization.py", line 40, in : Invalid type annotation '[]' [invalid-annotation] +File "generics_paramspec_specialization.py", line 52, in : Invalid type annotation '[int, str, bool]' [invalid-annotation] +File "generics_paramspec_specialization.py", line 53, in func30: Function expects 1 arg(s), got 3 [wrong-arg-count] File "generics_paramspec_specialization.py", line 54, in func30: Function expects 1 arg(s), got 3 [wrong-arg-count] File "generics_paramspec_specialization.py", line 55, in func30: Function expects 1 arg(s), got 3 [wrong-arg-count] -File "generics_paramspec_specialization.py", line 56, in func30: Function expects 1 arg(s), got 3 [wrong-arg-count] -File "generics_paramspec_specialization.py", line 59, in : Invalid type annotation 'ClassC[int, str, bool]' [invalid-annotation] +File "generics_paramspec_specialization.py", line 58, in : Invalid type annotation 'ClassC[int, str, bool]' [invalid-annotation] +File "generics_paramspec_specialization.py", line 59, in func31: Function expects 1 arg(s), got 3 [wrong-arg-count] File "generics_paramspec_specialization.py", line 60, in func31: Function expects 1 arg(s), got 3 [wrong-arg-count] File "generics_paramspec_specialization.py", line 61, in func31: Function expects 1 arg(s), got 3 [wrong-arg-count] -File "generics_paramspec_specialization.py", line 62, in func31: Function expects 1 arg(s), got 3 [wrong-arg-count] """ conformance_automated = "Fail" errors_diff = """ -Line 45: Expected 1 errors -Line 33: Unexpected errors ['File "generics_paramspec_specialization.py", line 33, in : Invalid type annotation \\'[int, bool]\\' [invalid-annotation]', 'File "generics_paramspec_specialization.py", line 33, in : Invalid type annotation \\'Ellipsis\\' [invalid-annotation]'] -Line 37: Unexpected errors ['File "generics_paramspec_specialization.py", line 37, in : Invalid type annotation \\'Ellipsis\\' [invalid-annotation]'] -Line 41: Unexpected errors ['File "generics_paramspec_specialization.py", line 41, in : Invalid type annotation \\'[]\\' [invalid-annotation]'] -Line 53: Unexpected errors ['File "generics_paramspec_specialization.py", line 53, in : Invalid type annotation \\'[int, str, bool]\\' [invalid-annotation]'] -Line 54: Unexpected errors ['File "generics_paramspec_specialization.py", line 54, in func30: Function expects 1 arg(s), got 3 [wrong-arg-count]'] -Line 59: Unexpected errors ['File "generics_paramspec_specialization.py", line 59, in : Invalid type annotation \\'ClassC[int, str, bool]\\' [invalid-annotation]'] -Line 60: Unexpected errors ['File "generics_paramspec_specialization.py", line 60, in func31: Function expects 1 arg(s), got 3 [wrong-arg-count]'] +Line 44: Expected 1 errors +Line 32: Unexpected errors ['File "generics_paramspec_specialization.py", line 32, in : Invalid type annotation \\'[int, bool]\\' [invalid-annotation]', 'File "generics_paramspec_specialization.py", line 32, in : Invalid type annotation \\'Ellipsis\\' [invalid-annotation]'] +Line 36: Unexpected errors ['File "generics_paramspec_specialization.py", line 36, in : Invalid type annotation \\'Ellipsis\\' [invalid-annotation]'] +Line 40: Unexpected errors ['File "generics_paramspec_specialization.py", line 40, in : Invalid type annotation \\'[]\\' [invalid-annotation]'] +Line 52: Unexpected errors ['File "generics_paramspec_specialization.py", line 52, in : Invalid type annotation \\'[int, str, bool]\\' [invalid-annotation]'] +Line 53: Unexpected errors ['File "generics_paramspec_specialization.py", line 53, in func30: Function expects 1 arg(s), got 3 [wrong-arg-count]'] +Line 58: Unexpected errors ['File "generics_paramspec_specialization.py", line 58, in : Invalid type annotation \\'ClassC[int, str, bool]\\' [invalid-annotation]'] +Line 59: Unexpected errors ['File "generics_paramspec_specialization.py", line 59, in func31: Function expects 1 arg(s), got 3 [wrong-arg-count]'] """ diff --git a/conformance/results/pytype/version.toml b/conformance/results/pytype/version.toml index 46eb986e7..3d4b9cdd9 100644 --- a/conformance/results/pytype/version.toml +++ b/conformance/results/pytype/version.toml @@ -1,2 +1,2 @@ version = "pytype 2024.04.11" -test_duration = 27.9 +test_duration = 31.4 diff --git a/conformance/results/results.html b/conformance/results/results.html index ccfee4398..6ff55b51f 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -158,17 +158,17 @@

Python Type System Conformance Test Results

 
mypy 1.10.0
-
1.5sec
+
1.1sec
pyright 1.1.366
-
1.4sec
+
1.3sec
pyre 0.9.21
-
3.6sec
+
1.7sec
pytype 2024.04.11
-
32.9sec
+
27.9sec
diff --git a/conformance/tests/generics_paramspec_semantics.py b/conformance/tests/generics_paramspec_semantics.py index 63bbac80d..b93066f1f 100644 --- a/conformance/tests/generics_paramspec_semantics.py +++ b/conformance/tests/generics_paramspec_semantics.py @@ -77,10 +77,11 @@ def callback_a(q: int, /) -> str: ... -y1 = Y(callback_a, 1) -assert_type(y1, Y[int, [int]]) -y2 = y1.f -assert_type(y2, Callable[[int], str]) +def func(x: int) -> None: + y1 = Y(callback_a, x) + assert_type(y1, Y[int, [int]]) + y2 = y1.f + assert_type(y2, Callable[[int], str]) def bar(x: int, *args: bool) -> int: From 20efe7b388653952f9475461bc3a28e0d6215e31 Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Fri, 7 Jun 2024 16:58:17 -0600 Subject: [PATCH 012/308] Conformance tests: Mark pytype as passing annotations_coroutines (#1771) It appears to produce the correct output. Part of #1692 --- conformance/results/pytype/annotations_coroutines.toml | 5 +---- conformance/results/results.html | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/conformance/results/pytype/annotations_coroutines.toml b/conformance/results/pytype/annotations_coroutines.toml index a97531845..a339ad0a1 100644 --- a/conformance/results/pytype/annotations_coroutines.toml +++ b/conformance/results/pytype/annotations_coroutines.toml @@ -1,7 +1,4 @@ -conformant = "Partial" -notes = """ -Does not evaluate correct type for async function. -""" +conformant = "Pass" output = """ """ diff --git a/conformance/results/results.html b/conformance/results/results.html index e0377383b..ccfee4398 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -178,7 +178,7 @@

Python Type System Conformance Test Results

Pass Pass Pass
Partial

Does not evaluate correct type for async function.

Pass
     annotations_forward_refs
Partial

Does not report error for a forward reference that is not enclosed in quotes.

Does not report error for use of quoted type with "|" operator (runtime error).

Incorrectly generates error for quoted type defined in class scope.

- - - - + - + @@ -693,13 +693,13 @@

Python Type System Conformance Test Results

- + - + @@ -717,7 +717,7 @@

Python Type System Conformance Test Results

- + @@ -741,7 +741,7 @@

Python Type System Conformance Test Results

- + @@ -753,19 +753,19 @@

Python Type System Conformance Test Results

- + - + - + - + @@ -861,7 +861,7 @@

Python Type System Conformance Test Results

- + @@ -882,7 +882,7 @@

Python Type System Conformance Test Results

- + diff --git a/conformance/tests/classes_classvar.py b/conformance/tests/classes_classvar.py index 234a3d5a5..56bb2a7dd 100644 --- a/conformance/tests/classes_classvar.py +++ b/conformance/tests/classes_classvar.py @@ -17,6 +17,7 @@ TypeVar, TypeVarTuple, assert_type, + cast, ) from typing import ClassVar as CV @@ -34,16 +35,16 @@ class ClassA(Generic[T, P]): # > ClassVar accepts only a single argument that should be a valid type - bad1: ClassVar[int, str] # E: too many arguments - bad2: CV[3] # E: invalid type - bad3: CV[var] # E: invalid type + bad1: ClassVar[int, str] = cast(Any, 0) # E: too many arguments + bad2: CV[3] = cast(Any, 0) # E: invalid type + bad3: CV[var] = cast(Any, 0) # E: invalid type # > Note that a ClassVar parameter cannot include any type variables, # > regardless of the level of nesting. - bad4: ClassVar[T] # E: cannot use TypeVar - bad5: ClassVar[list[T]] # E: cannot use TypeVar - bad6: ClassVar[Callable[P, Any]] # E: cannot use ParamSpec + bad4: ClassVar[T] = cast(Any, 0) # E: cannot use TypeVar + bad5: ClassVar[list[T]] = cast(Any, 0) # E: cannot use TypeVar + bad6: ClassVar[Callable[P, Any]] = cast(Any, 0) # E: cannot use ParamSpec # This is currently commented out because it causes mypy to crash. # bad7: ClassVar[tuple[*Ts]] # E: cannot use TypeVarTuple diff --git a/conformance/tests/generics_paramspec_specialization.py b/conformance/tests/generics_paramspec_specialization.py index e6eb27653..34ed734fd 100644 --- a/conformance/tests/generics_paramspec_specialization.py +++ b/conformance/tests/generics_paramspec_specialization.py @@ -2,8 +2,7 @@ Tests the handling of a ParamSpec specialization. """ - -from typing import Callable, Concatenate, Generic, ParamSpec, TypeVar +from typing import Any, Callable, Concatenate, Generic, ParamSpec, TypeVar, cast T = TypeVar("T") @@ -12,14 +11,14 @@ class ClassA(Generic[T, P1]): - f: Callable[P1, int] - x: T + f: Callable[P1, int] = cast(Any, "") + x: T = cast(Any, "") class ClassB(ClassA[T, P1], Generic[T, P1, P2]): - f1: Callable[P1, int] - f2: Callable[P2, int] - x: T + f1: Callable[P1, int] = cast(Any, "") + f2: Callable[P2, int] = cast(Any, "") + x: T = cast(Any, "") def func20(x: ClassA[int, P2]) -> str: # OK @@ -47,7 +46,7 @@ def func25(x: ClassA[int, int]) -> str: # E class ClassC(Generic[P1]): - f: Callable[P1, int] + f: Callable[P1, int] = cast(Any, "") def func30(x: ClassC[[int, str, bool]]) -> None: # OK From cc0c430f48cc9029b85aac1baa191993e71151b8 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 1 Jul 2024 17:37:17 -0700 Subject: [PATCH 021/308] [pre-commit.ci] pre-commit autoupdate (#1789) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2bdf5973f..61b8f596b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + rev: v4.6.0 hooks: - id: trailing-whitespace exclude: conformance/results/.*/.*\.toml From 5edf914c0c14225b0c2e5a3b453a60c8784b7aac Mon Sep 17 00:00:00 2001 From: Eric Traut Date: Wed, 10 Jul 2024 08:32:52 -0700 Subject: [PATCH 022/308] =?UTF-8?q?Updated=20conformance=20results=20for?= =?UTF-8?q?=20pyright=201.1.371.=20There=20were=20no=20substa=E2=80=A6=20(?= =?UTF-8?q?#1794)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Updated conformance results for pyright 1.1.371. There were no substantive conformance results changes, but a bunch of diagnostic messages changed or were augmented. --- .../results/pyright/aliases_explicit.toml | 16 +++++++------- .../results/pyright/aliases_implicit.toml | 3 ++- .../pyright/aliases_type_statement.toml | 20 +++++++++--------- .../pyright/aliases_typealiastype.toml | 15 ++++++------- .../pyright/annotations_forward_refs.toml | 15 ++++++------- .../results/pyright/annotations_typeexpr.toml | 13 ++++++------ .../results/pyright/classes_classvar.toml | 2 +- .../results/pyright/directives_cast.toml | 2 +- .../results/pyright/enums_members.toml | 3 +++ .../pyright/generics_syntax_declarations.toml | 6 +++--- .../pyright/literals_parameterizations.toml | 8 +++++++ .../results/pyright/qualifiers_annotated.toml | 21 ++++++++++--------- conformance/results/pyright/version.toml | 2 +- conformance/results/results.html | 2 +- conformance/src/type_checker.py | 4 +--- 15 files changed, 74 insertions(+), 58 deletions(-) diff --git a/conformance/results/pyright/aliases_explicit.toml b/conformance/results/pyright/aliases_explicit.toml index e1f0c29b6..cebb2602c 100644 --- a/conformance/results/pyright/aliases_explicit.toml +++ b/conformance/results/pyright/aliases_explicit.toml @@ -11,36 +11,38 @@ aliases_explicit.py:79:21 - error: Call expression not allowed in type expressio aliases_explicit.py:80:21 - error: Invalid expression form for type alias definition (reportInvalidTypeForm) aliases_explicit.py:80:21 - error: List expression not allowed in type annotation   Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) -aliases_explicit.py:80:21 - error: Expected type expression but received "list[Unknown]" (reportGeneralTypeIssues) +aliases_explicit.py:80:21 - error: Expected class but received "list[Unknown]" (reportGeneralTypeIssues) aliases_explicit.py:81:21 - error: Invalid expression form for type alias definition (reportInvalidTypeForm) aliases_explicit.py:81:21 - error: Tuple expression not allowed in type annotation   Use tuple[T1, ..., Tn] to indicate a tuple type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) aliases_explicit.py:82:21 - error: Invalid expression form for type alias definition (reportInvalidTypeForm) aliases_explicit.py:82:21 - error: List expression not allowed in type annotation   Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) -aliases_explicit.py:82:21 - error: Expected type expression but received "list[type[int]]" (reportGeneralTypeIssues) +aliases_explicit.py:82:21 - error: Expected class but received "list[type[int]]" (reportGeneralTypeIssues) aliases_explicit.py:83:21 - error: Invalid expression form for type alias definition (reportInvalidTypeForm) aliases_explicit.py:83:21 - error: Dictionary expression not allowed in type annotation   Use Dict[T1, T2] to indicate a dictionary type (reportInvalidTypeForm) -aliases_explicit.py:83:21 - error: Expected type expression but received "dict[str, Unknown]" (reportGeneralTypeIssues) +aliases_explicit.py:83:21 - error: Expected class but received "dict[str, Unknown]" (reportGeneralTypeIssues) aliases_explicit.py:83:28 - error: "b" is not defined (reportUndefinedVariable) aliases_explicit.py:84:21 - error: Invalid expression form for type alias definition (reportInvalidTypeForm) aliases_explicit.py:84:21 - error: Call expression not allowed in type expression (reportInvalidTypeForm) aliases_explicit.py:85:21 - error: Invalid expression form for type alias definition (reportInvalidTypeForm) aliases_explicit.py:85:21 - error: List expression not allowed in type annotation   Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) -aliases_explicit.py:85:21 - error: Expected type expression but received "list[type[int]]" (reportGeneralTypeIssues) +aliases_explicit.py:85:21 - error: Expected class but received "list[type[int]]" (reportGeneralTypeIssues) +aliases_explicit.py:85:27 - error: Expected class but received "Literal[0]" (reportGeneralTypeIssues) aliases_explicit.py:86:21 - error: Invalid expression form for type alias definition (reportInvalidTypeForm) aliases_explicit.py:86:21 - error: Ternary expression not allowed in type annotation (reportInvalidTypeForm) aliases_explicit.py:87:21 - error: Variable not allowed in type expression (reportInvalidTypeForm) -aliases_explicit.py:88:22 - error: Expected type expression but received "Literal[True]" (reportGeneralTypeIssues) +aliases_explicit.py:88:22 - error: Expected class but received "Literal[True]" (reportGeneralTypeIssues) aliases_explicit.py:89:22 - error: Invalid expression form for type alias definition (reportInvalidTypeForm) -aliases_explicit.py:89:22 - error: Expected type expression but received "Literal[1]" (reportGeneralTypeIssues) +aliases_explicit.py:89:22 - error: Expected class but received "Literal[1]" (reportGeneralTypeIssues) aliases_explicit.py:90:22 - error: Invalid expression form for type alias definition (reportInvalidTypeForm) aliases_explicit.py:90:22 - error: Binary operator not allowed in type annotation (reportInvalidTypeForm) aliases_explicit.py:91:22 - error: Type annotations cannot use format string literals (f-strings) (reportGeneralTypeIssues) aliases_explicit.py:100:5 - error: Type "list[Unknown]" is already specialized (reportInvalidTypeArguments) -aliases_explicit.py:101:6 - error: Object of type "UnionType" is not callable (reportCallIssue) +aliases_explicit.py:101:6 - error: Object of type "UnionType" is not callable +  Attribute "__call__" is unknown (reportCallIssue) aliases_explicit.py:102:5 - error: Type "list[Unknown]" is already specialized (reportInvalidTypeArguments) aliases_explicit.py:102:5 - error: Type "set[Unknown]" is already specialized (reportInvalidTypeArguments) """ diff --git a/conformance/results/pyright/aliases_implicit.toml b/conformance/results/pyright/aliases_implicit.toml index bc3199966..9c6ffb3c0 100644 --- a/conformance/results/pyright/aliases_implicit.toml +++ b/conformance/results/pyright/aliases_implicit.toml @@ -23,7 +23,8 @@ aliases_implicit.py:116:10 - error: Variable not allowed in type expression (rep aliases_implicit.py:117:10 - error: Variable not allowed in type expression (reportInvalidTypeForm) aliases_implicit.py:118:10 - error: Variable not allowed in type expression (reportInvalidTypeForm) aliases_implicit.py:119:10 - error: Variable not allowed in type expression (reportInvalidTypeForm) -aliases_implicit.py:133:6 - error: Object of type "UnionType" is not callable (reportCallIssue) +aliases_implicit.py:133:6 - error: Object of type "UnionType" is not callable +  Attribute "__call__" is unknown (reportCallIssue) aliases_implicit.py:135:5 - error: Type "list[Unknown]" is already specialized (reportInvalidTypeArguments) aliases_implicit.py:135:5 - error: Type "set[Unknown]" is already specialized (reportInvalidTypeArguments) """ diff --git a/conformance/results/pyright/aliases_type_statement.toml b/conformance/results/pyright/aliases_type_statement.toml index 73c0013de..825faaab2 100644 --- a/conformance/results/pyright/aliases_type_statement.toml +++ b/conformance/results/pyright/aliases_type_statement.toml @@ -2,38 +2,38 @@ conformant = "Pass" output = """ aliases_type_statement.py:17:12 - error: Cannot access attribute "bit_count" for class "TypeAliasType"   Attribute "bit_count" is unknown (reportAttributeAccessIssue) -aliases_type_statement.py:19:1 - error: Object of type "TypeAliasType" is not callable (reportCallIssue) +aliases_type_statement.py:19:1 - error: Object of type "TypeAliasType" is not callable +  Attribute "__call__" is unknown (reportCallIssue) aliases_type_statement.py:23:18 - error: Cannot access attribute "other_attrib" for class "TypeAliasType"   Attribute "other_attrib" is unknown (reportAttributeAccessIssue) aliases_type_statement.py:26:18 - error: A type alias defined in a "type" statement cannot be used as a base class -aliases_type_statement.py:31:22 - error: Argument of type "GoodAlias1" cannot be assigned to parameter "class_or_tuple" of type "_ClassInfo" in function "isinstance" +aliases_type_statement.py:31:22 - error: Argument of type "TypeAliasType" cannot be assigned to parameter "class_or_tuple" of type "_ClassInfo" in function "isinstance"   Type "TypeAliasType" is incompatible with type "_ClassInfo"     "TypeAliasType" is incompatible with "type"     "TypeAliasType" is incompatible with "UnionType"     "TypeAliasType" is incompatible with "tuple[_ClassInfo, ...]" (reportArgumentType) -aliases_type_statement.py:31:22 - error: Second argument to "isinstance" must be a class or tuple of classes -  Type alias created with "type" statement cannot be used with instance and class checks (reportArgumentType) aliases_type_statement.py:37:22 - error: Call expression not allowed in type expression (reportInvalidTypeForm) aliases_type_statement.py:38:22 - error: List expression not allowed in type annotation   Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) -aliases_type_statement.py:38:22 - error: Expected type expression but received "list[Unknown]" (reportGeneralTypeIssues) +aliases_type_statement.py:38:22 - error: Expected class but received "list[Unknown]" (reportGeneralTypeIssues) aliases_type_statement.py:39:22 - error: Tuple expression not allowed in type annotation   Use tuple[T1, ..., Tn] to indicate a tuple type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) aliases_type_statement.py:40:22 - error: List expression not allowed in type annotation   Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) -aliases_type_statement.py:40:22 - error: Expected type expression but received "list[type[int]]" (reportGeneralTypeIssues) +aliases_type_statement.py:40:22 - error: Expected class but received "list[type[int]]" (reportGeneralTypeIssues) aliases_type_statement.py:41:22 - error: Dictionary expression not allowed in type annotation   Use Dict[T1, T2] to indicate a dictionary type (reportInvalidTypeForm) -aliases_type_statement.py:41:22 - error: Expected type expression but received "dict[str, Unknown]" (reportGeneralTypeIssues) +aliases_type_statement.py:41:22 - error: Expected class but received "dict[str, Unknown]" (reportGeneralTypeIssues) aliases_type_statement.py:41:29 - error: "b" is not defined (reportUndefinedVariable) aliases_type_statement.py:42:22 - error: Call expression not allowed in type expression (reportInvalidTypeForm) aliases_type_statement.py:43:22 - error: List expression not allowed in type annotation   Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) -aliases_type_statement.py:43:22 - error: Expected type expression but received "list[type[int]]" (reportGeneralTypeIssues) +aliases_type_statement.py:43:22 - error: Expected class but received "list[type[int]]" (reportGeneralTypeIssues) +aliases_type_statement.py:43:28 - error: Expected class but received "Literal[0]" (reportGeneralTypeIssues) aliases_type_statement.py:44:22 - error: Ternary expression not allowed in type annotation (reportInvalidTypeForm) aliases_type_statement.py:45:22 - error: Variable not allowed in type expression (reportInvalidTypeForm) -aliases_type_statement.py:46:23 - error: Expected type expression but received "Literal[True]" (reportGeneralTypeIssues) -aliases_type_statement.py:47:23 - error: Expected type expression but received "Literal[1]" (reportGeneralTypeIssues) +aliases_type_statement.py:46:23 - error: Expected class but received "Literal[True]" (reportGeneralTypeIssues) +aliases_type_statement.py:47:23 - error: Expected class but received "Literal[1]" (reportGeneralTypeIssues) aliases_type_statement.py:48:23 - error: Binary operator not allowed in type annotation (reportInvalidTypeForm) aliases_type_statement.py:49:23 - error: Type annotations cannot use format string literals (f-strings) (reportGeneralTypeIssues) aliases_type_statement.py:52:10 - error: Type alias declaration "BadTypeAlias14" is obscured by a declaration of the same name (reportRedeclaration) diff --git a/conformance/results/pyright/aliases_typealiastype.toml b/conformance/results/pyright/aliases_typealiastype.toml index 967f4ae61..8b1fda765 100644 --- a/conformance/results/pyright/aliases_typealiastype.toml +++ b/conformance/results/pyright/aliases_typealiastype.toml @@ -12,19 +12,20 @@ aliases_typealiastype.py:46:40 - error: Type alias "BadAlias4" cannot use itself aliases_typealiastype.py:47:40 - error: Type alias "BadAlias5" cannot use itself in its definition (reportGeneralTypeIssues) aliases_typealiastype.py:48:40 - error: Type alias "BadAlias6" cannot use itself in its definition (reportGeneralTypeIssues) aliases_typealiastype.py:52:40 - error: Call expression not allowed in type expression (reportInvalidTypeForm) -aliases_typealiastype.py:53:40 - error: Expected type expression but received "list[Unknown]" (reportGeneralTypeIssues) -aliases_typealiastype.py:54:42 - error: Expected type expression but received "tuple[tuple[type[int], type[str]]]" (reportGeneralTypeIssues) -aliases_typealiastype.py:55:42 - error: Expected type expression but received "list[type[int]]" (reportGeneralTypeIssues) -aliases_typealiastype.py:56:42 - error: Expected type expression but received "dict[str, Unknown]" (reportGeneralTypeIssues) +aliases_typealiastype.py:53:40 - error: Expected class but received "list[Unknown]" (reportGeneralTypeIssues) +aliases_typealiastype.py:54:42 - error: Expected class but received "tuple[tuple[type[int], type[str]]]" (reportGeneralTypeIssues) +aliases_typealiastype.py:55:42 - error: Expected class but received "list[type[int]]" (reportGeneralTypeIssues) +aliases_typealiastype.py:56:42 - error: Expected class but received "dict[str, Unknown]" (reportGeneralTypeIssues) aliases_typealiastype.py:56:49 - error: "b" is not defined (reportUndefinedVariable) aliases_typealiastype.py:57:42 - error: Call expression not allowed in type expression (reportInvalidTypeForm) aliases_typealiastype.py:58:42 - error: List expression not allowed in type annotation   Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) -aliases_typealiastype.py:58:42 - error: Expected type expression but received "list[type[int]]" (reportGeneralTypeIssues) +aliases_typealiastype.py:58:42 - error: Expected class but received "list[type[int]]" (reportGeneralTypeIssues) +aliases_typealiastype.py:58:48 - error: Expected class but received "Literal[0]" (reportGeneralTypeIssues) aliases_typealiastype.py:59:42 - error: Ternary expression not allowed in type annotation (reportInvalidTypeForm) aliases_typealiastype.py:60:42 - error: Variable not allowed in type expression (reportInvalidTypeForm) -aliases_typealiastype.py:61:42 - error: Expected type expression but received "Literal[True]" (reportGeneralTypeIssues) -aliases_typealiastype.py:62:42 - error: Expected type expression but received "Literal[1]" (reportGeneralTypeIssues) +aliases_typealiastype.py:61:42 - error: Expected class but received "Literal[True]" (reportGeneralTypeIssues) +aliases_typealiastype.py:62:42 - error: Expected class but received "Literal[1]" (reportGeneralTypeIssues) aliases_typealiastype.py:63:42 - error: Binary operator not allowed in type annotation (reportInvalidTypeForm) aliases_typealiastype.py:64:42 - error: Type annotations cannot use format string literals (f-strings) (reportGeneralTypeIssues) """ diff --git a/conformance/results/pyright/annotations_forward_refs.toml b/conformance/results/pyright/annotations_forward_refs.toml index 4ddb40f39..ae62e5d05 100644 --- a/conformance/results/pyright/annotations_forward_refs.toml +++ b/conformance/results/pyright/annotations_forward_refs.toml @@ -7,23 +7,24 @@ annotations_forward_refs.py:25:13 - error: Union syntax cannot be used with stri annotations_forward_refs.py:41:9 - error: Expected type but received a string literal (reportGeneralTypeIssues) annotations_forward_refs.py:42:10 - error: List expression not allowed in type annotation   Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) -annotations_forward_refs.py:42:10 - error: Expected type expression but received "list[Unknown]" (reportGeneralTypeIssues) +annotations_forward_refs.py:42:10 - error: Expected class but received "list[Unknown]" (reportGeneralTypeIssues) annotations_forward_refs.py:43:10 - error: Tuple expression not allowed in type annotation   Use tuple[T1, ..., Tn] to indicate a tuple type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) annotations_forward_refs.py:44:10 - error: List expression not allowed in type annotation   Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) -annotations_forward_refs.py:44:10 - error: Expected type expression but received "list[type[int]]" (reportGeneralTypeIssues) +annotations_forward_refs.py:44:10 - error: Expected class but received "list[type[int]]" (reportGeneralTypeIssues) annotations_forward_refs.py:45:10 - error: Dictionary expression not allowed in type annotation   Use Dict[T1, T2] to indicate a dictionary type (reportInvalidTypeForm) -annotations_forward_refs.py:45:10 - error: Expected type expression but received "dict[Unknown, Unknown]" (reportGeneralTypeIssues) +annotations_forward_refs.py:45:10 - error: Expected class but received "dict[Unknown, Unknown]" (reportGeneralTypeIssues) annotations_forward_refs.py:46:10 - error: Call expression not allowed in type expression (reportInvalidTypeForm) annotations_forward_refs.py:47:10 - error: List expression not allowed in type annotation   Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) -annotations_forward_refs.py:47:10 - error: Expected type expression but received "list[type[int]]" (reportGeneralTypeIssues) +annotations_forward_refs.py:47:10 - error: Expected class but received "list[type[int]]" (reportGeneralTypeIssues) +annotations_forward_refs.py:47:16 - error: Expected class but received "Literal[0]" (reportGeneralTypeIssues) annotations_forward_refs.py:48:10 - error: Ternary expression not allowed in type annotation (reportInvalidTypeForm) annotations_forward_refs.py:49:10 - error: Variable not allowed in type expression (reportInvalidTypeForm) -annotations_forward_refs.py:50:11 - error: Expected type expression but received "Literal[True]" (reportGeneralTypeIssues) -annotations_forward_refs.py:51:11 - error: Expected type expression but received "Literal[1]" (reportGeneralTypeIssues) +annotations_forward_refs.py:50:11 - error: Expected class but received "Literal[True]" (reportGeneralTypeIssues) +annotations_forward_refs.py:51:11 - error: Expected class but received "Literal[1]" (reportGeneralTypeIssues) annotations_forward_refs.py:52:11 - error: Unary operator not allowed in type annotation (reportInvalidTypeForm) annotations_forward_refs.py:53:11 - error: Binary operator not allowed in type annotation (reportInvalidTypeForm) annotations_forward_refs.py:54:11 - error: Type annotations cannot use format string literals (f-strings) (reportGeneralTypeIssues) @@ -31,7 +32,7 @@ annotations_forward_refs.py:55:10 - error: Module cannot be used as a type (repo annotations_forward_refs.py:66:26 - error: "ClassB" is not defined (reportUndefinedVariable) annotations_forward_refs.py:80:14 - error: Type of "ClassF" could not be determined because it refers to itself (reportGeneralTypeIssues) annotations_forward_refs.py:80:14 - error: Variable not allowed in type expression (reportInvalidTypeForm) -annotations_forward_refs.py:89:8 - error: Expected type expression but received "(self: Self@ClassD) -> None" (reportGeneralTypeIssues) +annotations_forward_refs.py:89:8 - error: Expected class but received "(self: Self@ClassD) -> None" (reportGeneralTypeIssues) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/annotations_typeexpr.toml b/conformance/results/pyright/annotations_typeexpr.toml index 1afdc4e4a..9eed10f39 100644 --- a/conformance/results/pyright/annotations_typeexpr.toml +++ b/conformance/results/pyright/annotations_typeexpr.toml @@ -3,23 +3,24 @@ output = """ annotations_typeexpr.py:88:9 - error: Call expression not allowed in type expression (reportInvalidTypeForm) annotations_typeexpr.py:89:9 - error: List expression not allowed in type annotation   Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) -annotations_typeexpr.py:89:9 - error: Expected type expression but received "list[Unknown]" (reportGeneralTypeIssues) +annotations_typeexpr.py:89:9 - error: Expected class but received "list[Unknown]" (reportGeneralTypeIssues) annotations_typeexpr.py:90:9 - error: Tuple expression not allowed in type annotation   Use tuple[T1, ..., Tn] to indicate a tuple type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) annotations_typeexpr.py:91:9 - error: List expression not allowed in type annotation   Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) -annotations_typeexpr.py:91:9 - error: Expected type expression but received "list[type[int]]" (reportGeneralTypeIssues) +annotations_typeexpr.py:91:9 - error: Expected class but received "list[type[int]]" (reportGeneralTypeIssues) annotations_typeexpr.py:92:9 - error: Dictionary expression not allowed in type annotation   Use Dict[T1, T2] to indicate a dictionary type (reportInvalidTypeForm) -annotations_typeexpr.py:92:9 - error: Expected type expression but received "dict[Unknown, Unknown]" (reportGeneralTypeIssues) +annotations_typeexpr.py:92:9 - error: Expected class but received "dict[Unknown, Unknown]" (reportGeneralTypeIssues) annotations_typeexpr.py:93:9 - error: Call expression not allowed in type expression (reportInvalidTypeForm) annotations_typeexpr.py:94:9 - error: List expression not allowed in type annotation   Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) -annotations_typeexpr.py:94:9 - error: Expected type expression but received "list[type[int]]" (reportGeneralTypeIssues) +annotations_typeexpr.py:94:9 - error: Expected class but received "list[type[int]]" (reportGeneralTypeIssues) +annotations_typeexpr.py:94:15 - error: Expected class but received "Literal[0]" (reportGeneralTypeIssues) annotations_typeexpr.py:95:9 - error: Ternary expression not allowed in type annotation (reportInvalidTypeForm) annotations_typeexpr.py:96:9 - error: Variable not allowed in type expression (reportInvalidTypeForm) -annotations_typeexpr.py:97:10 - error: Expected type expression but received "Literal[True]" (reportGeneralTypeIssues) -annotations_typeexpr.py:98:10 - error: Expected type expression but received "Literal[1]" (reportGeneralTypeIssues) +annotations_typeexpr.py:97:10 - error: Expected class but received "Literal[True]" (reportGeneralTypeIssues) +annotations_typeexpr.py:98:10 - error: Expected class but received "Literal[1]" (reportGeneralTypeIssues) annotations_typeexpr.py:99:10 - error: Unary operator not allowed in type annotation (reportInvalidTypeForm) annotations_typeexpr.py:100:10 - error: Binary operator not allowed in type annotation (reportInvalidTypeForm) annotations_typeexpr.py:101:10 - error: Type annotations cannot use format string literals (f-strings) (reportGeneralTypeIssues) diff --git a/conformance/results/pyright/classes_classvar.toml b/conformance/results/pyright/classes_classvar.toml index c31f7a241..3e50fc7c1 100644 --- a/conformance/results/pyright/classes_classvar.toml +++ b/conformance/results/pyright/classes_classvar.toml @@ -1,7 +1,7 @@ conformant = "Pass" output = """ classes_classvar.py:38:25 - error: Expected only one type argument after "ClassVar" -classes_classvar.py:39:14 - error: Expected type expression but received "Literal[3]" (reportGeneralTypeIssues) +classes_classvar.py:39:14 - error: Expected class but received "Literal[3]" (reportGeneralTypeIssues) classes_classvar.py:40:14 - error: "var" is not defined (reportUndefinedVariable) classes_classvar.py:45:20 - error: "ClassVar" type cannot include type variables (reportGeneralTypeIssues) classes_classvar.py:46:20 - error: "ClassVar" type cannot include type variables (reportGeneralTypeIssues) diff --git a/conformance/results/pyright/directives_cast.toml b/conformance/results/pyright/directives_cast.toml index 9e439f77a..d7dc7e221 100644 --- a/conformance/results/pyright/directives_cast.toml +++ b/conformance/results/pyright/directives_cast.toml @@ -2,7 +2,7 @@ conformant = "Pass" output = """ directives_cast.py:15:8 - error: No overloads for "cast" match the provided arguments   Argument types: () (reportCallIssue) -directives_cast.py:16:13 - error: Expected type expression but received "Literal[1]" (reportGeneralTypeIssues) +directives_cast.py:16:13 - error: Expected class but received "Literal[1]" (reportGeneralTypeIssues) directives_cast.py:17:8 - error: No overloads for "cast" match the provided arguments   Argument types: (type[int], Literal[''], Literal['']) (reportCallIssue) """ diff --git a/conformance/results/pyright/enums_members.toml b/conformance/results/pyright/enums_members.toml index 00145a6d4..db932d715 100644 --- a/conformance/results/pyright/enums_members.toml +++ b/conformance/results/pyright/enums_members.toml @@ -9,8 +9,10 @@ output = """ enums_members.py:46:5 - error: Type annotations are not allowed for enum members (reportGeneralTypeIssues) enums_members.py:78:13 - error: "assert_type" mismatch: expected "Unknown" but received "(x: Unknown) -> str" (reportAssertTypeFailure) enums_members.py:78:37 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value +enums_members.py:78:42 - error: Variable not allowed in type expression (reportInvalidTypeForm) enums_members.py:79:13 - error: "assert_type" mismatch: expected "Unknown" but received "(x: int) -> int" (reportAssertTypeFailure) enums_members.py:79:37 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value +enums_members.py:79:42 - error: Variable not allowed in type expression (reportInvalidTypeForm) enums_members.py:80:13 - error: "assert_type" mismatch: expected "Unknown" but received "property" (reportAssertTypeFailure) enums_members.py:80:35 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value enums_members.py:81:13 - error: "assert_type" mismatch: expected "Unknown" but received "(self: Pet4) -> None" (reportAssertTypeFailure) @@ -20,6 +22,7 @@ enums_members.py:112:32 - error: Type arguments for "Literal" must be None, a li enums_members.py:124:21 - information: Type of "Example2.__B" is "Literal[2]" enums_members.py:125:21 - error: "assert_type" mismatch: expected "Unknown" but received "Literal[2]" (reportAssertTypeFailure) enums_members.py:125:43 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value +enums_members.py:125:52 - error: Variable not allowed in type expression (reportInvalidTypeForm) enums_members.py:142:13 - error: "assert_type" mismatch: expected "int" but received "Literal[Pet5.DOG]" (reportAssertTypeFailure) enums_members.py:143:13 - error: "assert_type" mismatch: expected "int" but received "Literal[Pet5.FISH]" (reportAssertTypeFailure) """ diff --git a/conformance/results/pyright/generics_syntax_declarations.toml b/conformance/results/pyright/generics_syntax_declarations.toml index d11d6b19c..5d3ab52c1 100644 --- a/conformance/results/pyright/generics_syntax_declarations.toml +++ b/conformance/results/pyright/generics_syntax_declarations.toml @@ -5,11 +5,11 @@ generics_syntax_declarations.py:27:20 - error: Type arguments are not allowed wi generics_syntax_declarations.py:34:11 - error: Cannot access attribute "is_integer" for class "str*"   Attribute "is_integer" is unknown (reportAttributeAccessIssue) generics_syntax_declarations.py:46:21 - error: TypeVar constraint type cannot be generic -generics_syntax_declarations.py:50:17 - error: Expected type expression but received "list[Unknown]" (reportGeneralTypeIssues) +generics_syntax_declarations.py:50:17 - error: Expected class but received "list[Unknown]" (reportGeneralTypeIssues) generics_syntax_declarations.py:62:17 - error: TypeVar must have at least two constrained types (reportGeneralTypeIssues) generics_syntax_declarations.py:66:17 - error: TypeVar must have at least two constrained types (reportGeneralTypeIssues) -generics_syntax_declarations.py:73:17 - error: Expected type expression but received "tuple[type[bytes], type[str]]" (reportGeneralTypeIssues) -generics_syntax_declarations.py:77:18 - error: Expected type expression but received "Literal[3]" (reportGeneralTypeIssues) +generics_syntax_declarations.py:73:17 - error: Expected class but received "tuple[type[bytes], type[str]]" (reportGeneralTypeIssues) +generics_syntax_declarations.py:77:18 - error: Expected class but received "Literal[3]" (reportGeneralTypeIssues) generics_syntax_declarations.py:81:23 - error: "S" is not defined (reportUndefinedVariable) """ conformance_automated = "Pass" diff --git a/conformance/results/pyright/literals_parameterizations.toml b/conformance/results/pyright/literals_parameterizations.toml index 4b5ab694f..d54dc0937 100644 --- a/conformance/results/pyright/literals_parameterizations.toml +++ b/conformance/results/pyright/literals_parameterizations.toml @@ -1,18 +1,26 @@ conformant = "Pass" output = """ +literals_parameterizations.py:41:15 - error: Binary operator not allowed in type annotation (reportInvalidTypeForm) literals_parameterizations.py:41:15 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value +literals_parameterizations.py:42:15 - error: Call expression not allowed in type expression (reportInvalidTypeForm) literals_parameterizations.py:42:15 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value +literals_parameterizations.py:43:15 - error: Binary operator not allowed in type annotation (reportInvalidTypeForm) literals_parameterizations.py:43:15 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value +literals_parameterizations.py:44:15 - error: Unary operator not allowed in type annotation (reportInvalidTypeForm) literals_parameterizations.py:44:15 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value +literals_parameterizations.py:45:15 - error: Unary operator not allowed in type annotation (reportInvalidTypeForm) literals_parameterizations.py:45:15 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value literals_parameterizations.py:46:15 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value literals_parameterizations.py:47:15 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value literals_parameterizations.py:48:15 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value +literals_parameterizations.py:49:15 - error: Variable not allowed in type expression (reportInvalidTypeForm) literals_parameterizations.py:49:15 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value +literals_parameterizations.py:50:16 - error: Type variable "T" has no meaning in this context (reportGeneralTypeIssues) literals_parameterizations.py:50:16 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value literals_parameterizations.py:51:16 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value literals_parameterizations.py:52:16 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value literals_parameterizations.py:53:16 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value +literals_parameterizations.py:56:28 - error: Binary operator not allowed in type annotation (reportInvalidTypeForm) literals_parameterizations.py:56:28 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value literals_parameterizations.py:60:4 - error: "Literal" cannot be used in this context without a type argument literals_parameterizations.py:61:12 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value diff --git a/conformance/results/pyright/qualifiers_annotated.toml b/conformance/results/pyright/qualifiers_annotated.toml index a7e82db02..8f019a5c2 100644 --- a/conformance/results/pyright/qualifiers_annotated.toml +++ b/conformance/results/pyright/qualifiers_annotated.toml @@ -1,30 +1,31 @@ conformant = "Pass" output = """ qualifiers_annotated.py:43:17 - error: List expression not allowed for this type argument -qualifiers_annotated.py:44:17 - error: Expected type expression but received "tuple[tuple[type[int], type[str]]]" (reportGeneralTypeIssues) +qualifiers_annotated.py:44:17 - error: Expected class but received "tuple[tuple[type[int], type[str]]]" (reportGeneralTypeIssues) qualifiers_annotated.py:45:17 - error: List expression not allowed for this type argument -qualifiers_annotated.py:45:18 - error: Expected type expression but received "Generator[type[int], None, None]" (reportGeneralTypeIssues) -qualifiers_annotated.py:46:17 - error: Expected type expression but received "dict[str, Unknown]" (reportGeneralTypeIssues) +qualifiers_annotated.py:45:18 - error: Expected class but received "Generator[type[int], None, None]" (reportGeneralTypeIssues) +qualifiers_annotated.py:46:17 - error: Expected class but received "dict[str, Unknown]" (reportGeneralTypeIssues) qualifiers_annotated.py:46:17 - error: Dictionary expression not allowed in type annotation qualifiers_annotated.py:46:24 - error: "b" is not defined (reportUndefinedVariable) qualifiers_annotated.py:47:17 - error: Call expression not allowed in type expression (reportInvalidTypeForm) qualifiers_annotated.py:48:17 - error: List expression not allowed in type annotation   Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) -qualifiers_annotated.py:48:17 - error: Expected type expression but received "list[type[int]]" (reportGeneralTypeIssues) +qualifiers_annotated.py:48:17 - error: Expected class but received "list[type[int]]" (reportGeneralTypeIssues) +qualifiers_annotated.py:48:23 - error: Expected class but received "Literal[0]" (reportGeneralTypeIssues) qualifiers_annotated.py:49:17 - error: Ternary expression not allowed in type annotation (reportInvalidTypeForm) qualifiers_annotated.py:50:17 - error: "var1" is not defined (reportUndefinedVariable) -qualifiers_annotated.py:51:17 - error: Expected type expression but received "Literal[True]" (reportGeneralTypeIssues) -qualifiers_annotated.py:52:18 - error: Expected type expression but received "Literal[1]" (reportGeneralTypeIssues) +qualifiers_annotated.py:51:17 - error: Expected class but received "Literal[True]" (reportGeneralTypeIssues) +qualifiers_annotated.py:52:18 - error: Expected class but received "Literal[1]" (reportGeneralTypeIssues) qualifiers_annotated.py:53:18 - error: Binary operator not allowed in type annotation (reportInvalidTypeForm) qualifiers_annotated.py:54:18 - error: Type annotations cannot use format string literals (f-strings) (reportGeneralTypeIssues) qualifiers_annotated.py:64:8 - error: Expected one type argument and one or more annotations for "Annotated" qualifiers_annotated.py:76:24 - error: Expression of type "type[Annotated]" is incompatible with declared type "type[Any]" (reportAssignmentType) -qualifiers_annotated.py:77:24 - error: Expression of type "SmallInt" is incompatible with declared type "type[Any]" (reportAssignmentType) +qualifiers_annotated.py:77:24 - error: Expression of type "type[Annotated]" is incompatible with declared type "type[Any]" (reportAssignmentType) qualifiers_annotated.py:84:7 - error: Argument of type "type[Annotated]" cannot be assigned to parameter "x" of type "type[T@func4]" in function "func4" (reportArgumentType) -qualifiers_annotated.py:85:7 - error: Argument of type "SmallInt" cannot be assigned to parameter "x" of type "type[T@func4]" in function "func4" (reportArgumentType) +qualifiers_annotated.py:85:7 - error: Argument of type "type[Annotated]" cannot be assigned to parameter "x" of type "type[T@func4]" in function "func4" (reportArgumentType) qualifiers_annotated.py:91:1 - error: "Annotated" cannot be instantiated (reportCallIssue) -qualifiers_annotated.py:92:1 - error: Object of type "type[Annotated]" is not callable (reportCallIssue) -qualifiers_annotated.py:93:1 - error: Object of type "type[Annotated]" is not callable (reportCallIssue) +qualifiers_annotated.py:92:1 - error: "Annotated" cannot be instantiated (reportCallIssue) +qualifiers_annotated.py:93:1 - error: "Annotated" cannot be instantiated (reportCallIssue) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/version.toml b/conformance/results/pyright/version.toml index b53d80f08..95d61e3ae 100644 --- a/conformance/results/pyright/version.toml +++ b/conformance/results/pyright/version.toml @@ -1,2 +1,2 @@ -version = "pyright 1.1.369" +version = "pyright 1.1.371" test_duration = 1.4 diff --git a/conformance/results/results.html b/conformance/results/results.html index 6ff55b51f..b7b4ebd80 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -161,7 +161,7 @@

Python Type System Conformance Test Results

- - + @@ -1824,12 +1824,7 @@

Python Type System Conformance Test Results

- + @@ -1945,7 +1940,7 @@

Python Type System Conformance Test Results

- + @@ -2542,7 +2537,7 @@

Python Type System Conformance Test Results

- +
 
mypy 1.10.0
-
1.1sec
+
mypy 1.10.1
+
1.4sec
pyright 1.1.366
-
1.3sec
+
pyright 1.1.369
+
1.4sec
pyre 0.9.21
-
1.7sec
+
pyre 0.9.22
+
2.8sec
pytype 2024.04.11
-
27.9sec
+
31.4sec
@@ -525,7 +525,7 @@

Python Type System Conformance Test Results

     literals_semantics Pass Pass
Partial

Does not reject augmented operation that modifies literal value.

Pass
Unsupported

Does not understand `Literal` type annotation.

@@ -603,7 +603,7 @@

Python Type System Conformance Test Results

     callables_annotation
Partial

Incorrectly treats "*args: T, **kwargs: T" as "..." when T is specialized to Any.

Does not treat "*args: Any, **kargs: Any" as "..." when separated by keyword parameter.

Pass
Partial

Does not evaluate correct type for `*args: int` parameter.

Does not reject illegal form `Callable[[...], int]`.

Does not correctly implement type compatibility rules for "...".

Does not treat "*args: Any, **kwargs: Any" as "...".

Partial

Does not evaluate correct type for `*args: int` parameter.

Does not correctly implement type compatibility rules for "...".

Does not treat "*args: Any, **kwargs: Any" as "...".

Partial

Does not support Concatenate.

Does not treat "*args: Any, **kwargs: Any" as "...".

     callables_kwargs
     dataclasses_final
Partial

Wrongly requires a Final dataclass field to be initialized at class level.

Doesn't support Final nested inside ClassVar.

Pass
Partial

Mis-handles Final nested inside ClassVar.

Pass
Partial

Doesn't handle Final nested inside ClassVar.

     dataclasses_frozen Pass Pass
Partial

Does not reject frozen dataclass inherited from non-frozen dataclass.

Does not reject non-frozen dataclass inherited from frozen dataclass.

Pass
Unsupported

Does not report assignment to field within frozen dataclass instance.

Does not reject frozen dataclass inherited from non-frozen dataclass.

Does not reject non-frozen dataclass inherited from frozen dataclass.

     dataclasses_hash
     dataclasses_kwonly
Partial

Incorrectly rejects kw_only field with default before positional field.

PassPass
Partial

Rejects legitimate use of dataclass field with `kw_only=True`.

Partial

Incorrectly reports error when kw_only field has default value.

Incorrectly rejects kw_only field with default before positional field.

     dataclasses_order
     dataclasses_transform_class Pass Pass
Partial

Does not validate when a non-frozen model derives from a frozen one.

Does not support field specifiers.

Partial

Does not support field specifiers.

Emits "attribute not initialized" error for dataclass field.

Unsupported

Does not understand @dataclass_transform.

     dataclasses_transform_field
     dataclasses_transform_func
Partial

Does not handle `kw_only=False` override when `kw_only_default=True`.

Does not report error when `order=False` and comparison operators are used.

Pass
Partial

Does not understand @dataclass_transform when it is

applied only to overloads of a decorator but not the

definition.

Partial

Does not understand @dataclass_transform when it is applied only to overloads of a decorator but not the definition.

Does not detect non-frozen class inheriting from frozen class.

Emits "attribute not initialized" error for dataclass field.

Unsupported

Does not understand @dataclass_transform.

     dataclasses_transform_meta Pass Pass
Partial

Does not understand custom field specifiers.

Partial

Does not understand custom field specifiers.

Incorrectly rejects frozen dataclass that inherits from non-frozen.

Emits "attribute not initialized" error for dataclass field.

Unsupported

Does not understand @dataclass_transform.

     dataclasses_usage
Pass*

Does not detect unannotated usage of `dataclasses.field()`.

Pass
Partial

Does not report error when field with no default follows field with default.

Incorrectly reports error with InitVar that has default value.

Complains on `assert_type` when used for bound methods vs `Callable`.

Does not understand `__dataclass_fields__`.

Partial

Does not report error when field with no default follows field with default.

Complains on `assert_type` when used for bound methods vs `Callable`.

Does not understand `__dataclass_fields__`.

Pass
@@ -834,7 +834,7 @@

Python Type System Conformance Test Results

     typeddicts_required
Partial

Does not support nesting of `Annotated` and `Required` or `NotRequired`.

Pass
Partial

Does not reject use of `Required` in function parameter annotation.

Does not reject nested use of `Required` in type annotation.

Does not support recursive TypedDict definitions.

Incorrectly complains about uninitialized attributes on TypedDict definitions.

Partial

Does not reject use of `Required` in function parameter annotation.

Does not reject nested use of `Required` in type annotation.

Does not support recursive TypedDict definitions.

Incorrectly complains about uninitialized attributes on TypedDict definitions.

Incorrectly generates "attribute not initialized" errors for TypedDict fields.

Partial

Does not reject use of `Required` in non-TypedDict class.

Does not reject use of `Required` in function parameter annotation.

Does not reject nested use of `Required` in type annotation.

     typeddicts_type_consistency
     tuples_type_form Pass Pass
Partial

Does not reject some invalid tuple forms involving ellipsis.

Pass Pass
     tuples_unpacked
     namedtuples_define_functional
Pass*

Does not handle illegal named tuple names the same as runtime.

Pass
Partial

Does not reject duplicate field names in functional form.

Does not handle illegal named tuple names the same as runtime.

Does not handle defined fields correctly when extra flags like `rename` or `default` are used.

Does not support defaults in functional form.

Partial

Does not handle illegal named tuple names the same as runtime.

Does not handle defined fields correctly when extra flags like `rename` or `default` are used.

Does not support defaults in functional form.

Partial

Does not handle illegal named tuple names the same as runtime.

Does not support defaults in functional form.

     namedtuples_type_compat
mypy 1.10.1
1.4sec
pyright 1.1.369
+
pyright 1.1.371
1.4sec
pyre 0.9.22
diff --git a/conformance/src/type_checker.py b/conformance/src/type_checker.py index 6ea9d743f..cc64e75e3 100644 --- a/conformance/src/type_checker.py +++ b/conformance/src/type_checker.py @@ -84,9 +84,7 @@ def install(self) -> bool: return False def get_version(self) -> str: - proc = run( - [sys.executable, "-m", "mypy", "--version"], stdout=PIPE, text=True - ) + proc = run([sys.executable, "-m", "mypy", "--version"], stdout=PIPE, text=True) version = proc.stdout.strip() # Remove the " (compiled)" if it's present. From 690b23ca56cc8000fcfa09f2d290ebfdd68c2ed3 Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Mon, 15 Jul 2024 04:48:27 -0700 Subject: [PATCH 023/308] Glossary: Improve definition of "gradual form" (#1799) --- docs/spec/glossary.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/spec/glossary.rst b/docs/spec/glossary.rst index 791782e7c..f17ffb617 100644 --- a/docs/spec/glossary.rst +++ b/docs/spec/glossary.rst @@ -59,7 +59,7 @@ This section defines a few terms that may be used elsewhere in the specification :ref:`type-system-concepts`. gradual form - A gradual form is a :term:`type expression` which makes the type it is + A gradual form is an element of a :term:`type expression` which makes the type it is part of not a :term:`fully static type`, but rather a representation of a set of possible static types. See :ref:`type-system-concepts`. The primary gradual form is :ref:`Any`. The ellipsis (``...``) is a gradual From d8994295c931ab97bd207b8bc7b25837b8148ad1 Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Mon, 15 Jul 2024 14:03:51 +0200 Subject: [PATCH 024/308] Remove empty documents (#1801) These documents were part of a proposed structure. In the meantime, the structure has diverged from the proposal. We also have issue #845 to discuss a structure if we find time in the future to work on this. --- docs/index.rst | 8 ---- docs/source/annotations.rst | 68 ------------------------------ docs/source/basics.rst | 3 -- docs/source/dependencies.rst | 12 ------ docs/source/faq.rst | 23 ---------- docs/source/inference.rst | 28 ------------ docs/source/introduction.rst | 41 ------------------ docs/source/reference.rst | 11 ----- docs/source/type_compatibility.rst | 17 -------- docs/source/type_system.rst | 58 ------------------------- 10 files changed, 269 deletions(-) delete mode 100644 docs/source/annotations.rst delete mode 100644 docs/source/basics.rst delete mode 100644 docs/source/dependencies.rst delete mode 100644 docs/source/faq.rst delete mode 100644 docs/source/inference.rst delete mode 100644 docs/source/introduction.rst delete mode 100644 docs/source/type_compatibility.rst delete mode 100644 docs/source/type_system.rst diff --git a/docs/index.rst b/docs/index.rst index bad1f3dfa..a2be03a6c 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -2,14 +2,6 @@ Static Typing with Python ************************* -.. Introduction -.. ============ -.. -.. .. toctree:: -.. :maxdepth: 2 -.. -.. source/introduction - Guides ====== diff --git a/docs/source/annotations.rst b/docs/source/annotations.rst deleted file mode 100644 index ea5c471fa..000000000 --- a/docs/source/annotations.rst +++ /dev/null @@ -1,68 +0,0 @@ -**************** -Type Annotations -**************** - -Functions -========= - -Parameters ----------- - -Asynchronous Functions ----------------------- - -Generators ----------- - -Lambdas -------- - - -Classes -======= - -Overloads and Overrides ------------------------ - -Instance vs. Class Attributes ------------------------------ - -Final attributes ----------------- - -Abstract base classes ---------------------- - - -Globals -======= - - -Attributes -========== - - -Locals -====== - -Empty Containers ----------------- - - -Runtime Considerations -====================== - -Comment vs. Inline Support --------------------------- - -Forward References ------------------- - -Generic types that don't implement `__getitem__` ------------------------------------------------- - -Conditioning on static type checking ------------------------------------- - -from `__future__` import annotations ------------------------------------- diff --git a/docs/source/basics.rst b/docs/source/basics.rst deleted file mode 100644 index 9b2bf52a1..000000000 --- a/docs/source/basics.rst +++ /dev/null @@ -1,3 +0,0 @@ -********** -The Basics -********** diff --git a/docs/source/dependencies.rst b/docs/source/dependencies.rst deleted file mode 100644 index b16fa639f..000000000 --- a/docs/source/dependencies.rst +++ /dev/null @@ -1,12 +0,0 @@ -************************** -Libraries and Dependencies -************************** - -:doc:`libraries` - -Typeshed -======== - - -Placeholder Stubs -================= diff --git a/docs/source/faq.rst b/docs/source/faq.rst deleted file mode 100644 index 906e27790..000000000 --- a/docs/source/faq.rst +++ /dev/null @@ -1,23 +0,0 @@ -************************** -Frequently Asked Questions -************************** - - -Why Types? -========== - - -Unsupported Python Features -=========================== - - -Common Errors -============= - - -Typing PEPs -=========== - - -Relevant Talks and Resources -============================ diff --git a/docs/source/inference.rst b/docs/source/inference.rst deleted file mode 100644 index 291dec48f..000000000 --- a/docs/source/inference.rst +++ /dev/null @@ -1,28 +0,0 @@ -************** -Type Inference -************** - -Rules for local inference -========================= - -Explicit vs. Implicit Local Types ---------------------------------- - -Changing Types -============== - -Asserts -------- - -Casts ------ - -Type Guards ------------ - - -Protocols and Duck Typing -========================= - -Callback Protocols ------------------- diff --git a/docs/source/introduction.rst b/docs/source/introduction.rst deleted file mode 100644 index fb973559d..000000000 --- a/docs/source/introduction.rst +++ /dev/null @@ -1,41 +0,0 @@ -******************************* -Introduction to Types in Python -******************************* - - -Background -========== - -How to read type annotations ----------------------------- - -When and why types are useful ------------------------------ - - -Gradual Typing: Static Types in a Dynamic Language -================================================== - -Opt-in type checking --------------------- - -Type stubs ----------- - -:doc:`stubs` - -Strategies for increasing coverage ----------------------------------- - - -Getting Started -=============== - -Python type checkers --------------------- - -How to annotate an existing codebase ------------------------------------- - -Typeshed --------- diff --git a/docs/source/reference.rst b/docs/source/reference.rst index 54afcc7b1..010f3b498 100644 --- a/docs/source/reference.rst +++ b/docs/source/reference.rst @@ -12,14 +12,3 @@ Type System Reference best_practices quality typing Module Documentation - -.. The following pages are desired in a new TOC which will cover multiple -.. topics. For now, they are not linked because the pages are empty. -.. -.. basics -.. type_system -.. annotations -.. inference -.. type_compatibility -.. dependencies -.. faq diff --git a/docs/source/type_compatibility.rst b/docs/source/type_compatibility.rst deleted file mode 100644 index 43ebd32b5..000000000 --- a/docs/source/type_compatibility.rst +++ /dev/null @@ -1,17 +0,0 @@ -****************** -Type Compatibility -****************** - - -The Class Hierarchy -=================== - -Mutable Containers ------------------- - -Comparing Callables: Covariance and Contravariance --------------------------------------------------- - - -Metaclasses -=========== diff --git a/docs/source/type_system.rst b/docs/source/type_system.rst deleted file mode 100644 index 6d7954b82..000000000 --- a/docs/source/type_system.rst +++ /dev/null @@ -1,58 +0,0 @@ -*************** -The Type System -*************** - -Built-in Types -============== - -`typing Module Documentation `__ - -Built-in Primitives -------------------- - -Built-in operators ------------------- - -Advanced Types --------------- - - -Simple User-Defined Types -========================= - - -Type Aliases -============ - -Recursive Aliases ------------------ - - -Data Structures -=============== - -Typed Dictionary ----------------- - -Dataclass ---------- - - -Generic Types -============= - - -Type Variables -============== - -TypeVar -------- - -Variadics ---------- - -ParamSpec -^^^^^^^^^ - -TypeVarTuple -^^^^^^^^^^^^ From edc853a954ac91ff244fc76dcbb7aad44b6c5f7b Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Mon, 15 Jul 2024 15:39:15 +0200 Subject: [PATCH 025/308] Don't mention the reference part of the mypy docs (#1800) --- docs/index.rst | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/index.rst b/docs/index.rst index a2be03a6c..27fe63c78 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -21,9 +21,7 @@ Reference .. seealso:: The documentation at https://mypy.readthedocs.io/ is relatively accessible - and complete. Particularly refer to the "Type System Reference" section of - the docs -- since the Python typing system is standardised via PEPs, this - information should apply to most Python type checkers. + and complete. Specification ============= From 42e9118068944e63f4c321f26e4f37f5d77a6d59 Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Mon, 15 Jul 2024 16:49:36 +0200 Subject: [PATCH 026/308] Split source directory into guides and reference (#1802) --- docs/{source/guides.rst => guides/index.rst} | 0 docs/{source => guides}/libraries.rst | 0 docs/{source => guides}/modernizing.rst | 0 docs/{source => guides}/typing_anti_pitch.rst | 0 docs/{source => guides}/unreachable.rst | 0 docs/{source => guides}/writing_stubs.rst | 0 docs/index.rst | 4 ++-- docs/{source => reference}/best_practices.rst | 0 docs/{source => reference}/generics.rst | 0 docs/{source/reference.rst => reference/index.rst} | 0 docs/{source => reference}/protocols.rst | 0 docs/{source => reference}/quality.rst | 0 docs/{source => reference}/stubs.rst | 0 13 files changed, 2 insertions(+), 2 deletions(-) rename docs/{source/guides.rst => guides/index.rst} (100%) rename docs/{source => guides}/libraries.rst (100%) rename docs/{source => guides}/modernizing.rst (100%) rename docs/{source => guides}/typing_anti_pitch.rst (100%) rename docs/{source => guides}/unreachable.rst (100%) rename docs/{source => guides}/writing_stubs.rst (100%) rename docs/{source => reference}/best_practices.rst (100%) rename docs/{source => reference}/generics.rst (100%) rename docs/{source/reference.rst => reference/index.rst} (100%) rename docs/{source => reference}/protocols.rst (100%) rename docs/{source => reference}/quality.rst (100%) rename docs/{source => reference}/stubs.rst (100%) diff --git a/docs/source/guides.rst b/docs/guides/index.rst similarity index 100% rename from docs/source/guides.rst rename to docs/guides/index.rst diff --git a/docs/source/libraries.rst b/docs/guides/libraries.rst similarity index 100% rename from docs/source/libraries.rst rename to docs/guides/libraries.rst diff --git a/docs/source/modernizing.rst b/docs/guides/modernizing.rst similarity index 100% rename from docs/source/modernizing.rst rename to docs/guides/modernizing.rst diff --git a/docs/source/typing_anti_pitch.rst b/docs/guides/typing_anti_pitch.rst similarity index 100% rename from docs/source/typing_anti_pitch.rst rename to docs/guides/typing_anti_pitch.rst diff --git a/docs/source/unreachable.rst b/docs/guides/unreachable.rst similarity index 100% rename from docs/source/unreachable.rst rename to docs/guides/unreachable.rst diff --git a/docs/source/writing_stubs.rst b/docs/guides/writing_stubs.rst similarity index 100% rename from docs/source/writing_stubs.rst rename to docs/guides/writing_stubs.rst diff --git a/docs/index.rst b/docs/index.rst index 27fe63c78..0dfdf131d 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -8,7 +8,7 @@ Guides .. toctree:: :maxdepth: 2 - source/guides + guides/index Reference ========= @@ -16,7 +16,7 @@ Reference .. toctree:: :maxdepth: 2 - source/reference + reference/index .. seealso:: diff --git a/docs/source/best_practices.rst b/docs/reference/best_practices.rst similarity index 100% rename from docs/source/best_practices.rst rename to docs/reference/best_practices.rst diff --git a/docs/source/generics.rst b/docs/reference/generics.rst similarity index 100% rename from docs/source/generics.rst rename to docs/reference/generics.rst diff --git a/docs/source/reference.rst b/docs/reference/index.rst similarity index 100% rename from docs/source/reference.rst rename to docs/reference/index.rst diff --git a/docs/source/protocols.rst b/docs/reference/protocols.rst similarity index 100% rename from docs/source/protocols.rst rename to docs/reference/protocols.rst diff --git a/docs/source/quality.rst b/docs/reference/quality.rst similarity index 100% rename from docs/source/quality.rst rename to docs/reference/quality.rst diff --git a/docs/source/stubs.rst b/docs/reference/stubs.rst similarity index 100% rename from docs/source/stubs.rst rename to docs/reference/stubs.rst From 01a3dd5b55458625f59ab9c872ca935c1a0f040d Mon Sep 17 00:00:00 2001 From: Danny Yang Date: Tue, 16 Jul 2024 09:55:59 -0400 Subject: [PATCH 027/308] Update conformance test sources to initialize uninitialized variables (#1804) --- .../mypy/annotations_forward_refs.toml | 4 +- .../results/mypy/classes_classvar.toml | 12 ++--- .../mypy/dataclasses_transform_class.toml | 12 ++--- .../mypy/dataclasses_transform_meta.toml | 12 ++--- .../results/mypy/dataclasses_usage.toml | 6 +-- conformance/results/mypy/enums_members.toml | 54 +++++++++---------- .../results/mypy/generics_scoping.toml | 20 +++---- .../results/mypy/generics_self_basic.toml | 2 +- .../results/mypy/generics_type_erasure.toml | 18 +++---- .../results/mypy/protocols_class_objects.toml | 16 +++--- .../results/mypy/protocols_explicit.toml | 12 ++--- .../results/mypy/specialtypes_never.toml | 8 +-- .../results/mypy/typeddicts_required.toml | 14 ++--- conformance/results/mypy/version.toml | 2 +- .../pyre/annotations_forward_refs.toml | 6 +-- .../results/pyre/classes_classvar.toml | 6 +-- .../pyre/dataclasses_transform_class.toml | 26 +++++---- .../pyre/dataclasses_transform_meta.toml | 22 ++++---- .../results/pyre/dataclasses_usage.toml | 24 ++++----- conformance/results/pyre/enums_members.toml | 54 +++++++++---------- .../results/pyre/generics_scoping.toml | 11 ++-- .../results/pyre/generics_self_basic.toml | 4 +- .../results/pyre/generics_type_erasure.toml | 30 +++++------ .../results/pyre/protocols_class_objects.toml | 8 ++- .../results/pyre/protocols_explicit.toml | 19 ++----- .../results/pyre/specialtypes_never.toml | 28 +++++----- .../results/pyre/typeddicts_class_syntax.toml | 6 +-- .../results/pyre/typeddicts_required.toml | 18 ++++--- conformance/results/pyre/version.toml | 2 +- .../results/pyright/classes_classvar.toml | 4 +- .../pyright/dataclasses_transform_class.toml | 12 ++--- .../pyright/dataclasses_transform_meta.toml | 12 ++--- .../results/pyright/dataclasses_usage.toml | 8 +-- .../results/pyright/enums_members.toml | 44 ++++++++------- .../results/pyright/generics_scoping.toml | 8 +-- .../results/pyright/generics_self_basic.toml | 2 +- .../pyright/generics_type_erasure.toml | 14 ++--- .../pyright/protocols_class_objects.toml | 8 +-- .../results/pyright/protocols_explicit.toml | 24 ++++----- .../results/pyright/specialtypes_never.toml | 4 +- .../results/pyright/typeddicts_required.toml | 11 ++-- conformance/results/pyright/version.toml | 2 +- .../pytype/annotations_forward_refs.toml | 8 +-- .../results/pytype/classes_classvar.toml | 8 +-- .../pytype/dataclasses_transform_class.toml | 26 ++++----- .../pytype/dataclasses_transform_meta.toml | 18 +++---- .../results/pytype/dataclasses_usage.toml | 6 +-- conformance/results/pytype/enums_members.toml | 51 +++++++++--------- .../results/pytype/generics_scoping.toml | 10 ++-- .../results/pytype/generics_self_basic.toml | 14 ++--- .../results/pytype/generics_type_erasure.toml | 4 +- .../pytype/protocols_class_objects.toml | 8 +-- .../results/pytype/protocols_explicit.toml | 10 ++-- .../results/pytype/specialtypes_never.toml | 16 +++--- .../pytype/typeddicts_class_syntax.toml | 3 +- .../results/pytype/typeddicts_required.toml | 6 +-- conformance/results/pytype/version.toml | 2 +- conformance/results/results.html | 8 +-- conformance/tests/annotations_forward_refs.py | 3 ++ conformance/tests/classes_classvar.py | 3 ++ .../tests/dataclasses_transform_class.py | 3 ++ .../tests/dataclasses_transform_meta.py | 3 ++ conformance/tests/dataclasses_usage.py | 3 +- conformance/tests/enums_members.py | 4 ++ conformance/tests/generics_scoping.py | 6 +++ conformance/tests/generics_self_basic.py | 3 ++ conformance/tests/generics_type_erasure.py | 4 +- conformance/tests/protocols_class_objects.py | 3 ++ conformance/tests/protocols_explicit.py | 10 +++- conformance/tests/specialtypes_never.py | 4 ++ conformance/tests/typeddicts_class_syntax.py | 2 +- conformance/tests/typeddicts_required.py | 3 ++ 72 files changed, 440 insertions(+), 421 deletions(-) diff --git a/conformance/results/mypy/annotations_forward_refs.toml b/conformance/results/mypy/annotations_forward_refs.toml index 53c4e301e..bee7ebbd0 100644 --- a/conformance/results/mypy/annotations_forward_refs.toml +++ b/conformance/results/mypy/annotations_forward_refs.toml @@ -27,7 +27,7 @@ annotations_forward_refs.py:87: error: Function "annotations_forward_refs.ClassD annotations_forward_refs.py:87: note: Perhaps you need "Callable[...]" or a callback protocol? annotations_forward_refs.py:89: error: Function "annotations_forward_refs.ClassD.int" is not valid as a type [valid-type] annotations_forward_refs.py:89: note: Perhaps you need "Callable[...]" or a callback protocol? -annotations_forward_refs.py:93: error: Expression is of type int?, not "int" [assert-type] +annotations_forward_refs.py:96: error: Expression is of type int?, not "int" [assert-type] """ conformance_automated = "Fail" errors_diff = """ @@ -37,5 +37,5 @@ Line 24: Expected 1 errors Line 25: Expected 1 errors Line 66: Expected 1 errors Line 87: Unexpected errors ['annotations_forward_refs.py:87: error: Function "annotations_forward_refs.ClassD.int" is not valid as a type [valid-type]'] -Line 93: Unexpected errors ['annotations_forward_refs.py:93: error: Expression is of type int?, not "int" [assert-type]'] +Line 96: Unexpected errors ['annotations_forward_refs.py:96: error: Expression is of type int?, not "int" [assert-type]'] """ diff --git a/conformance/results/mypy/classes_classvar.toml b/conformance/results/mypy/classes_classvar.toml index 91c26a60e..82c4756ba 100644 --- a/conformance/results/mypy/classes_classvar.toml +++ b/conformance/results/mypy/classes_classvar.toml @@ -22,12 +22,12 @@ classes_classvar.py:65: error: ClassVar can only be used for assignments in clas classes_classvar.py:67: error: ClassVar can only be used for assignments in class body [misc] classes_classvar.py:71: error: ClassVar can only be used for assignments in class body [misc] classes_classvar.py:78: error: Expression is of type "Any", not "float" [assert-type] -classes_classvar.py:102: error: Cannot assign to class variable "stats" via instance [misc] -classes_classvar.py:131: error: Incompatible types in assignment (expression has type "ProtoAImpl", variable has type "ProtoA") [assignment] -classes_classvar.py:131: note: "ProtoAImpl" is missing following "ProtoA" protocol member: -classes_classvar.py:131: note: z -classes_classvar.py:131: note: Protocol member ProtoA.x expected class variable, got instance variable -classes_classvar.py:131: note: Protocol member ProtoA.y expected class variable, got instance variable +classes_classvar.py:105: error: Cannot assign to class variable "stats" via instance [misc] +classes_classvar.py:134: error: Incompatible types in assignment (expression has type "ProtoAImpl", variable has type "ProtoA") [assignment] +classes_classvar.py:134: note: "ProtoAImpl" is missing following "ProtoA" protocol member: +classes_classvar.py:134: note: z +classes_classvar.py:134: note: Protocol member ProtoA.x expected class variable, got instance variable +classes_classvar.py:134: note: Protocol member ProtoA.y expected class variable, got instance variable """ conformance_automated = "Fail" errors_diff = """ diff --git a/conformance/results/mypy/dataclasses_transform_class.toml b/conformance/results/mypy/dataclasses_transform_class.toml index 73d6f16ce..8ca0e9aee 100644 --- a/conformance/results/mypy/dataclasses_transform_class.toml +++ b/conformance/results/mypy/dataclasses_transform_class.toml @@ -1,11 +1,11 @@ conformant = "Pass" output = """ -dataclasses_transform_class.py:48: error: Cannot inherit non-frozen dataclass from a frozen one [misc] -dataclasses_transform_class.py:60: error: Property "id" defined in "Customer1" is read-only [misc] -dataclasses_transform_class.py:63: error: Too many positional arguments for "Customer1" [misc] -dataclasses_transform_class.py:69: error: Unsupported left operand type for < ("Customer1") [operator] -dataclasses_transform_class.py:79: error: Too many positional arguments for "Customer2" [misc] -dataclasses_transform_class.py:119: error: Property "id" defined in "Customer3" is read-only [misc] +dataclasses_transform_class.py:51: error: Cannot inherit non-frozen dataclass from a frozen one [misc] +dataclasses_transform_class.py:63: error: Property "id" defined in "Customer1" is read-only [misc] +dataclasses_transform_class.py:66: error: Too many positional arguments for "Customer1" [misc] +dataclasses_transform_class.py:72: error: Unsupported left operand type for < ("Customer1") [operator] +dataclasses_transform_class.py:82: error: Too many positional arguments for "Customer2" [misc] +dataclasses_transform_class.py:122: error: Property "id" defined in "Customer3" is read-only [misc] """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/mypy/dataclasses_transform_meta.toml b/conformance/results/mypy/dataclasses_transform_meta.toml index 27f979e0d..5d1966324 100644 --- a/conformance/results/mypy/dataclasses_transform_meta.toml +++ b/conformance/results/mypy/dataclasses_transform_meta.toml @@ -1,11 +1,11 @@ conformant = "Pass" output = """ -dataclasses_transform_meta.py:48: error: Cannot inherit non-frozen dataclass from a frozen one [misc] -dataclasses_transform_meta.py:60: error: Property "id" defined in "Customer1" is read-only [misc] -dataclasses_transform_meta.py:63: error: Too many positional arguments for "Customer1" [misc] -dataclasses_transform_meta.py:70: error: Unsupported left operand type for < ("Customer1") [operator] -dataclasses_transform_meta.py:80: error: Too many positional arguments for "Customer2" [misc] -dataclasses_transform_meta.py:100: error: Property "id" defined in "Customer3" is read-only [misc] +dataclasses_transform_meta.py:51: error: Cannot inherit non-frozen dataclass from a frozen one [misc] +dataclasses_transform_meta.py:63: error: Property "id" defined in "Customer1" is read-only [misc] +dataclasses_transform_meta.py:66: error: Too many positional arguments for "Customer1" [misc] +dataclasses_transform_meta.py:73: error: Unsupported left operand type for < ("Customer1") [operator] +dataclasses_transform_meta.py:83: error: Too many positional arguments for "Customer2" [misc] +dataclasses_transform_meta.py:103: error: Property "id" defined in "Customer3" is read-only [misc] """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/mypy/dataclasses_usage.toml b/conformance/results/mypy/dataclasses_usage.toml index 72bf10a7c..978642d09 100644 --- a/conformance/results/mypy/dataclasses_usage.toml +++ b/conformance/results/mypy/dataclasses_usage.toml @@ -12,9 +12,9 @@ dataclasses_usage.py:67: error: Attributes without a default cannot follow attri dataclasses_usage.py:73: error: Attributes without a default cannot follow attributes with one [misc] dataclasses_usage.py:83: error: Too many arguments for "DC4" [call-arg] dataclasses_usage.py:88: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] -dataclasses_usage.py:126: error: Too many arguments for "DC7" [call-arg] -dataclasses_usage.py:129: error: Missing positional argument "y" in call to "DC8" [call-arg] -dataclasses_usage.py:178: error: Too many arguments for "DC13" [call-arg] +dataclasses_usage.py:127: error: Too many arguments for "DC7" [call-arg] +dataclasses_usage.py:130: error: Missing positional argument "y" in call to "DC8" [call-arg] +dataclasses_usage.py:179: error: Too many arguments for "DC13" [call-arg] """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/mypy/enums_members.toml b/conformance/results/mypy/enums_members.toml index 1c6b709ba..a1d4ac3da 100644 --- a/conformance/results/mypy/enums_members.toml +++ b/conformance/results/mypy/enums_members.toml @@ -10,33 +10,33 @@ Does not support `_ignore_` mechanism (optional). """ conformance_automated = "Fail" errors_diff = """ -Line 46: Expected 1 errors -Line 78: Expected 1 errors -Line 79: Expected 1 errors -Line 112: Expected 1 errors -Line 23: Unexpected errors ['enums_members.py:23: error: Expression is of type "Literal[Pet.genus]", not "str" [assert-type]'] -Line 24: Unexpected errors ['enums_members.py:24: error: Expression is of type "Literal[Pet.species]", not "str" [assert-type]'] -Line 31: Unexpected errors ['enums_members.py:31: error: Expression is of type "Literal[Pet2.genus]", not "str" [assert-type]'] -Line 32: Unexpected errors ['enums_members.py:32: error: Expression is of type "Literal[Pet2.species]", not "str" [assert-type]'] -Line 96: Unexpected errors ['enums_members.py:96: error: Expression is of type "Literal[TrafficLight.AMBER]", not "Literal[TrafficLight.YELLOW]" [assert-type]'] -Line 113: Unexpected errors ['enums_members.py:113: error: Expression is of type "member[Callable[[Example], None]]", not "Any" [assert-type]', 'enums_members.py:113: error: Parameter 1 of Literal[...] is invalid [valid-type]'] +Line 50: Expected 1 errors +Line 82: Expected 1 errors +Line 83: Expected 1 errors +Line 116: Expected 1 errors +Line 27: Unexpected errors ['enums_members.py:27: error: Expression is of type "Literal[Pet.genus]", not "str" [assert-type]'] +Line 28: Unexpected errors ['enums_members.py:28: error: Expression is of type "Literal[Pet.species]", not "str" [assert-type]'] +Line 35: Unexpected errors ['enums_members.py:35: error: Expression is of type "Literal[Pet2.genus]", not "str" [assert-type]'] +Line 36: Unexpected errors ['enums_members.py:36: error: Expression is of type "Literal[Pet2.species]", not "str" [assert-type]'] +Line 100: Unexpected errors ['enums_members.py:100: error: Expression is of type "Literal[TrafficLight.AMBER]", not "Literal[TrafficLight.YELLOW]" [assert-type]'] +Line 117: Unexpected errors ['enums_members.py:117: error: Expression is of type "member[Callable[[Example], None]]", not "Any" [assert-type]', 'enums_members.py:117: error: Parameter 1 of Literal[...] is invalid [valid-type]'] """ output = """ -enums_members.py:23: error: Expression is of type "Literal[Pet.genus]", not "str" [assert-type] -enums_members.py:24: error: Expression is of type "Literal[Pet.species]", not "str" [assert-type] -enums_members.py:31: error: Expression is of type "Literal[Pet2.genus]", not "str" [assert-type] -enums_members.py:32: error: Expression is of type "Literal[Pet2.species]", not "str" [assert-type] -enums_members.py:80: error: Expression is of type "Callable[[Pet4], str]", not "Any" [assert-type] -enums_members.py:80: error: Parameter 1 of Literal[...] is invalid [valid-type] -enums_members.py:81: error: Expression is of type "Callable[[Pet4], None]", not "Any" [assert-type] -enums_members.py:81: error: Parameter 1 of Literal[...] is invalid [valid-type] -enums_members.py:96: error: Expression is of type "Literal[TrafficLight.AMBER]", not "Literal[TrafficLight.YELLOW]" [assert-type] -enums_members.py:113: error: Expression is of type "member[Callable[[Example], None]]", not "Any" [assert-type] -enums_members.py:113: error: Parameter 1 of Literal[...] is invalid [valid-type] -enums_members.py:124: note: Revealed type is "Any" -enums_members.py:124: note: 'reveal_type' always outputs 'Any' in unchecked functions -enums_members.py:125: error: Expression is of type "Any", not "Literal[Example2.__B]" [assert-type] -enums_members.py:125: note: "assert_type" expects everything to be "Any" in unchecked functions -enums_members.py:142: error: Expression is of type "Literal[Pet5.DOG]", not "int" [assert-type] -enums_members.py:143: error: Expression is of type "Literal[Pet5.FISH]", not "int" [assert-type] +enums_members.py:27: error: Expression is of type "Literal[Pet.genus]", not "str" [assert-type] +enums_members.py:28: error: Expression is of type "Literal[Pet.species]", not "str" [assert-type] +enums_members.py:35: error: Expression is of type "Literal[Pet2.genus]", not "str" [assert-type] +enums_members.py:36: error: Expression is of type "Literal[Pet2.species]", not "str" [assert-type] +enums_members.py:84: error: Expression is of type "Callable[[Pet4], str]", not "Any" [assert-type] +enums_members.py:84: error: Parameter 1 of Literal[...] is invalid [valid-type] +enums_members.py:85: error: Expression is of type "Callable[[Pet4], None]", not "Any" [assert-type] +enums_members.py:85: error: Parameter 1 of Literal[...] is invalid [valid-type] +enums_members.py:100: error: Expression is of type "Literal[TrafficLight.AMBER]", not "Literal[TrafficLight.YELLOW]" [assert-type] +enums_members.py:117: error: Expression is of type "member[Callable[[Example], None]]", not "Any" [assert-type] +enums_members.py:117: error: Parameter 1 of Literal[...] is invalid [valid-type] +enums_members.py:128: note: Revealed type is "Any" +enums_members.py:128: note: 'reveal_type' always outputs 'Any' in unchecked functions +enums_members.py:129: error: Expression is of type "Any", not "Literal[Example2.__B]" [assert-type] +enums_members.py:129: note: "assert_type" expects everything to be "Any" in unchecked functions +enums_members.py:146: error: Expression is of type "Literal[Pet5.DOG]", not "int" [assert-type] +enums_members.py:147: error: Expression is of type "Literal[Pet5.FISH]", not "int" [assert-type] """ diff --git a/conformance/results/mypy/generics_scoping.toml b/conformance/results/mypy/generics_scoping.toml index cffdc23b9..d9be0a027 100644 --- a/conformance/results/mypy/generics_scoping.toml +++ b/conformance/results/mypy/generics_scoping.toml @@ -14,16 +14,16 @@ generics_scoping.py:65: error: Free type variable expected in Generic[...] [mis generics_scoping.py:78: error: Type variable "generics_scoping.T" is unbound [valid-type] generics_scoping.py:78: note: (Hint: Use "Generic[T]" or "Protocol[T]" base class to bind "T" inside a class) generics_scoping.py:78: note: (Hint: Use "T" in function signature to bind "T" inside a function) -generics_scoping.py:84: error: Can't use bound type variable "T" to define generic alias [valid-type] -generics_scoping.py:88: error: Type variable "generics_scoping.T" is unbound [valid-type] -generics_scoping.py:88: note: (Hint: Use "Generic[T]" or "Protocol[T]" base class to bind "T" inside a class) -generics_scoping.py:88: note: (Hint: Use "T" in function signature to bind "T" inside a function) -generics_scoping.py:89: error: Type variable "generics_scoping.T" is unbound [valid-type] -generics_scoping.py:89: note: (Hint: Use "Generic[T]" or "Protocol[T]" base class to bind "T" inside a class) -generics_scoping.py:89: note: (Hint: Use "T" in function signature to bind "T" inside a function) -generics_scoping.py:90: error: Type variable "generics_scoping.T" is unbound [valid-type] -generics_scoping.py:90: note: (Hint: Use "Generic[T]" or "Protocol[T]" base class to bind "T" inside a class) -generics_scoping.py:90: note: (Hint: Use "T" in function signature to bind "T" inside a function) +generics_scoping.py:87: error: Can't use bound type variable "T" to define generic alias [valid-type] +generics_scoping.py:94: error: Type variable "generics_scoping.T" is unbound [valid-type] +generics_scoping.py:94: note: (Hint: Use "Generic[T]" or "Protocol[T]" base class to bind "T" inside a class) +generics_scoping.py:94: note: (Hint: Use "T" in function signature to bind "T" inside a function) +generics_scoping.py:95: error: Type variable "generics_scoping.T" is unbound [valid-type] +generics_scoping.py:95: note: (Hint: Use "Generic[T]" or "Protocol[T]" base class to bind "T" inside a class) +generics_scoping.py:95: note: (Hint: Use "T" in function signature to bind "T" inside a function) +generics_scoping.py:96: error: Type variable "generics_scoping.T" is unbound [valid-type] +generics_scoping.py:96: note: (Hint: Use "Generic[T]" or "Protocol[T]" base class to bind "T" inside a class) +generics_scoping.py:96: note: (Hint: Use "T" in function signature to bind "T" inside a function) """ conformance_automated = "Fail" errors_diff = """ diff --git a/conformance/results/mypy/generics_self_basic.toml b/conformance/results/mypy/generics_self_basic.toml index 1c3ea6402..c902871c3 100644 --- a/conformance/results/mypy/generics_self_basic.toml +++ b/conformance/results/mypy/generics_self_basic.toml @@ -2,7 +2,7 @@ conformant = "Pass" output = """ generics_self_basic.py:20: error: Incompatible return value type (got "Shape", expected "Self") [return-value] generics_self_basic.py:33: error: Incompatible return value type (got "Shape", expected "Self") [return-value] -generics_self_basic.py:64: error: Self type cannot have type arguments [misc] +generics_self_basic.py:67: error: Self type cannot have type arguments [misc] """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/mypy/generics_type_erasure.toml b/conformance/results/mypy/generics_type_erasure.toml index 86e3cf0ae..78d330b9a 100644 --- a/conformance/results/mypy/generics_type_erasure.toml +++ b/conformance/results/mypy/generics_type_erasure.toml @@ -4,18 +4,18 @@ Infers Node[Never] instead of Node[Any] when argument is not provided. False negative on instance attribute access on type(node). """ output = """ -generics_type_erasure.py:17: error: Expression is of type "Node[Never]", not "Node[Any]" [assert-type] -generics_type_erasure.py:20: error: Expression is of type Never, not "Any" [assert-type] -generics_type_erasure.py:36: error: Argument 1 to "Node" has incompatible type "str"; expected "int | None" [arg-type] -generics_type_erasure.py:38: error: Argument 1 to "Node" has incompatible type "int"; expected "str | None" [arg-type] -generics_type_erasure.py:40: error: Access to generic instance variables via class is ambiguous [misc] -generics_type_erasure.py:41: error: Access to generic instance variables via class is ambiguous [misc] +generics_type_erasure.py:19: error: Expression is of type "Node[Never]", not "Node[Any]" [assert-type] +generics_type_erasure.py:22: error: Expression is of type Never, not "Any" [assert-type] +generics_type_erasure.py:38: error: Argument 1 to "Node" has incompatible type "str"; expected "int | None" [arg-type] +generics_type_erasure.py:40: error: Argument 1 to "Node" has incompatible type "int"; expected "str | None" [arg-type] generics_type_erasure.py:42: error: Access to generic instance variables via class is ambiguous [misc] generics_type_erasure.py:43: error: Access to generic instance variables via class is ambiguous [misc] +generics_type_erasure.py:44: error: Access to generic instance variables via class is ambiguous [misc] +generics_type_erasure.py:45: error: Access to generic instance variables via class is ambiguous [misc] """ conformance_automated = "Fail" errors_diff = """ -Line 44: Expected 1 errors -Line 17: Unexpected errors ['generics_type_erasure.py:17: error: Expression is of type "Node[Never]", not "Node[Any]" [assert-type]'] -Line 20: Unexpected errors ['generics_type_erasure.py:20: error: Expression is of type Never, not "Any" [assert-type]'] +Line 46: Expected 1 errors +Line 19: Unexpected errors ['generics_type_erasure.py:19: error: Expression is of type "Node[Never]", not "Node[Any]" [assert-type]'] +Line 22: Unexpected errors ['generics_type_erasure.py:22: error: Expression is of type Never, not "Any" [assert-type]'] """ diff --git a/conformance/results/mypy/protocols_class_objects.toml b/conformance/results/mypy/protocols_class_objects.toml index 48cccc872..c2fae510f 100644 --- a/conformance/results/mypy/protocols_class_objects.toml +++ b/conformance/results/mypy/protocols_class_objects.toml @@ -12,14 +12,14 @@ protocols_class_objects.py:74: error: Incompatible types in assignment (expressi protocols_class_objects.py:74: note: Following member(s) of "ConcreteB" have conflicts: protocols_class_objects.py:74: note: prop1: expected "int", got "Callable[[ConcreteB], int]" protocols_class_objects.py:74: note: Only class variables allowed for class object access on protocols, prop1 is an instance variable of "ConcreteB" -protocols_class_objects.py:101: error: Incompatible types in assignment (expression has type "type[ConcreteC1]", variable has type "ProtoC1") [assignment] -protocols_class_objects.py:101: note: ClassVar protocol member ProtoC1.attr1 can never be matched by a class object -protocols_class_objects.py:103: error: Incompatible types in assignment (expression has type "type[ConcreteC2]", variable has type "ProtoC1") [assignment] -protocols_class_objects.py:103: note: Only class variables allowed for class object access on protocols, attr1 is an instance variable of "ConcreteC2" -protocols_class_objects.py:103: note: ClassVar protocol member ProtoC1.attr1 can never be matched by a class object -protocols_class_objects.py:104: error: Incompatible types in assignment (expression has type "type[ConcreteC2]", variable has type "ProtoC2") [assignment] -protocols_class_objects.py:104: note: Only class variables allowed for class object access on protocols, attr1 is an instance variable of "ConcreteC2" -protocols_class_objects.py:105: error: Incompatible types in assignment (expression has type "type[ConcreteC3]", variable has type "ProtoC1") [assignment] +protocols_class_objects.py:104: error: Incompatible types in assignment (expression has type "type[ConcreteC1]", variable has type "ProtoC1") [assignment] +protocols_class_objects.py:104: note: ClassVar protocol member ProtoC1.attr1 can never be matched by a class object +protocols_class_objects.py:106: error: Incompatible types in assignment (expression has type "type[ConcreteC2]", variable has type "ProtoC1") [assignment] +protocols_class_objects.py:106: note: Only class variables allowed for class object access on protocols, attr1 is an instance variable of "ConcreteC2" +protocols_class_objects.py:106: note: ClassVar protocol member ProtoC1.attr1 can never be matched by a class object +protocols_class_objects.py:107: error: Incompatible types in assignment (expression has type "type[ConcreteC2]", variable has type "ProtoC2") [assignment] +protocols_class_objects.py:107: note: Only class variables allowed for class object access on protocols, attr1 is an instance variable of "ConcreteC2" +protocols_class_objects.py:108: error: Incompatible types in assignment (expression has type "type[ConcreteC3]", variable has type "ProtoC1") [assignment] """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/mypy/protocols_explicit.toml b/conformance/results/mypy/protocols_explicit.toml index 46491e4d9..5c4cea2ea 100644 --- a/conformance/results/mypy/protocols_explicit.toml +++ b/conformance/results/mypy/protocols_explicit.toml @@ -5,12 +5,12 @@ Does not report unimplemented attributes for class that explicitly derives from output = """ protocols_explicit.py:27: error: Call to abstract method "draw" of "PColor" with trivial body via super() is unsafe [safe-super] protocols_explicit.py:56: error: Incompatible types in assignment (expression has type "tuple[int, int, str]", base class "RGB" defined the type as "tuple[int, int, int]") [assignment] -protocols_explicit.py:59: error: Cannot instantiate abstract class "Point" with abstract attributes "intensity", "other" and "transparency" [abstract] -protocols_explicit.py:86: error: Cannot instantiate abstract class "Concrete1" with abstract attributes "cm1" and "im1" [abstract] -protocols_explicit.py:104: error: Cannot instantiate abstract class "Concrete3" with abstract attributes "cm10", "cm11" and "im1" [abstract] -protocols_explicit.py:129: error: Cannot instantiate abstract class "Concrete5" with abstract attribute "method1" [abstract] -protocols_explicit.py:159: error: Cannot instantiate abstract class "Concrete7A" with abstract attribute "method1" [abstract] +protocols_explicit.py:60: error: Cannot instantiate abstract class "Point" with abstract attributes "intensity" and "transparency" [abstract] +protocols_explicit.py:135: error: Cannot instantiate abstract class "Concrete5" with abstract attribute "method1" [abstract] +protocols_explicit.py:165: error: Cannot instantiate abstract class "Concrete7A" with abstract attribute "method1" [abstract] """ -conformance_automated = "Pass" +conformance_automated = "Fail" errors_diff = """ +Line 90: Expected 1 errors +Line 110: Expected 1 errors """ diff --git a/conformance/results/mypy/specialtypes_never.toml b/conformance/results/mypy/specialtypes_never.toml index 04e942227..49ac22f1e 100644 --- a/conformance/results/mypy/specialtypes_never.toml +++ b/conformance/results/mypy/specialtypes_never.toml @@ -1,10 +1,10 @@ conformant = "Pass" output = """ specialtypes_never.py:19: error: Implicit return in function which does not return [misc] -specialtypes_never.py:82: error: Incompatible types in assignment (expression has type "list[NoReturn]", variable has type "list[int]") [assignment] -specialtypes_never.py:82: note: "List" is invariant -- see https://mypy.readthedocs.io/en/stable/common_issues.html#variance -specialtypes_never.py:82: note: Consider using "Sequence" instead, which is covariant -specialtypes_never.py:101: error: Incompatible return value type (got "ClassC[NoReturn]", expected "ClassC[U]") [return-value] +specialtypes_never.py:86: error: Incompatible types in assignment (expression has type "list[NoReturn]", variable has type "list[int]") [assignment] +specialtypes_never.py:86: note: "List" is invariant -- see https://mypy.readthedocs.io/en/stable/common_issues.html#variance +specialtypes_never.py:86: note: Consider using "Sequence" instead, which is covariant +specialtypes_never.py:105: error: Incompatible return value type (got "ClassC[NoReturn]", expected "ClassC[U]") [return-value] """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/mypy/typeddicts_required.toml b/conformance/results/mypy/typeddicts_required.toml index e4e89e9bf..885bf8575 100644 --- a/conformance/results/mypy/typeddicts_required.toml +++ b/conformance/results/mypy/typeddicts_required.toml @@ -4,14 +4,14 @@ Does not support nesting of `Annotated` and `Required` or `NotRequired`. """ output = """ typeddicts_required.py:12: error: Required[] can be only used in a TypedDict definition [valid-type] -typeddicts_required.py:16: error: NotRequired[] can be only used in a TypedDict definition [valid-type] -typeddicts_required.py:59: error: Required[] can be only used in a TypedDict definition [valid-type] -typeddicts_required.py:60: error: NotRequired[] can be only used in a TypedDict definition [valid-type] -typeddicts_required.py:65: error: Required[] can be only used in a TypedDict definition [valid-type] -typeddicts_required.py:67: error: Required[] can be only used in a TypedDict definition [valid-type] +typeddicts_required.py:19: error: NotRequired[] can be only used in a TypedDict definition [valid-type] +typeddicts_required.py:62: error: Required[] can be only used in a TypedDict definition [valid-type] +typeddicts_required.py:63: error: NotRequired[] can be only used in a TypedDict definition [valid-type] +typeddicts_required.py:68: error: Required[] can be only used in a TypedDict definition [valid-type] +typeddicts_required.py:70: error: Required[] can be only used in a TypedDict definition [valid-type] """ conformance_automated = "Fail" errors_diff = """ -Line 65: Unexpected errors ['typeddicts_required.py:65: error: Required[] can be only used in a TypedDict definition [valid-type]'] -Line 67: Unexpected errors ['typeddicts_required.py:67: error: Required[] can be only used in a TypedDict definition [valid-type]'] +Line 68: Unexpected errors ['typeddicts_required.py:68: error: Required[] can be only used in a TypedDict definition [valid-type]'] +Line 70: Unexpected errors ['typeddicts_required.py:70: error: Required[] can be only used in a TypedDict definition [valid-type]'] """ diff --git a/conformance/results/mypy/version.toml b/conformance/results/mypy/version.toml index b39cbad6f..39314b44d 100644 --- a/conformance/results/mypy/version.toml +++ b/conformance/results/mypy/version.toml @@ -1,2 +1,2 @@ version = "mypy 1.10.1" -test_duration = 1.4 +test_duration = 1.2 diff --git a/conformance/results/pyre/annotations_forward_refs.toml b/conformance/results/pyre/annotations_forward_refs.toml index a2cc47c12..1e4ecf739 100644 --- a/conformance/results/pyre/annotations_forward_refs.toml +++ b/conformance/results/pyre/annotations_forward_refs.toml @@ -22,10 +22,9 @@ annotations_forward_refs.py:51:9 Invalid type [31]: Expression `"1"` is not a va annotations_forward_refs.py:52:9 Invalid type [31]: Expression `"-1"` is not a valid type. annotations_forward_refs.py:53:9 Invalid type [31]: Expression `"int or str"` is not a valid type. annotations_forward_refs.py:55:9 Undefined or invalid type [11]: Annotation `types` is not defined as a type. -annotations_forward_refs.py:78:4 Uninitialized attribute [13]: Attribute `ClassC` is declared in class `ClassD` to have type `ClassC` but is never initialized. annotations_forward_refs.py:80:12 Undefined or invalid type [11]: Annotation `ClassF` is not defined as a type. annotations_forward_refs.py:87:7 Undefined or invalid type [11]: Annotation `ClassD.int` is not defined as a type. -annotations_forward_refs.py:100:7 Undefined or invalid type [11]: Annotation ` +annotations_forward_refs.py:103:7 Undefined or invalid type [11]: Annotation ` """ conformance_automated = "Fail" errors_diff = """ @@ -36,7 +35,6 @@ Line 25: Expected 1 errors Line 54: Expected 1 errors Line 66: Expected 1 errors Line 89: Expected 1 errors -Line 78: Unexpected errors ['annotations_forward_refs.py:78:4 Uninitialized attribute [13]: Attribute `ClassC` is declared in class `ClassD` to have type `ClassC` but is never initialized.'] Line 87: Unexpected errors ['annotations_forward_refs.py:87:7 Undefined or invalid type [11]: Annotation `ClassD.int` is not defined as a type.'] -Line 100: Unexpected errors ['annotations_forward_refs.py:100:7 Undefined or invalid type [11]: Annotation `'] +Line 103: Unexpected errors ['annotations_forward_refs.py:103:7 Undefined or invalid type [11]: Annotation `'] """ diff --git a/conformance/results/pyre/classes_classvar.toml b/conformance/results/pyre/classes_classvar.toml index b5dd9e022..52902aedc 100644 --- a/conformance/results/pyre/classes_classvar.toml +++ b/conformance/results/pyre/classes_classvar.toml @@ -18,9 +18,8 @@ classes_classvar.py:52:4 Incompatible attribute type [8]: Attribute `bad8` decla classes_classvar.py:65:8 Undefined attribute [16]: `ClassA` has no attribute `xx`. classes_classvar.py:68:8 Incompatible return type [7]: Expected `CV[int]` but got `int`. classes_classvar.py:78:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `float` but got `typing.Any`. -classes_classvar.py:83:4 Uninitialized attribute [13]: Attribute `damage` is declared in class `BasicStarship` to have type `int` but is never initialized. -classes_classvar.py:102:0 Invalid assignment [41]: Assigning to class variable through instance, did you mean to assign to `Starship.stats` instead? -classes_classvar.py:131:0 Incompatible variable type [9]: a is declared to have type `ProtoA` but is used as type `ProtoAImpl`. +classes_classvar.py:105:0 Invalid assignment [41]: Assigning to class variable through instance, did you mean to assign to `Starship.stats` instead? +classes_classvar.py:134:0 Incompatible variable type [9]: a is declared to have type `ProtoA` but is used as type `ProtoAImpl`. """ conformance_automated = "Fail" errors_diff = """ @@ -36,5 +35,4 @@ Line 71: Expected 1 errors Line 72: Expected 1 errors Line 68: Unexpected errors ['classes_classvar.py:68:8 Incompatible return type [7]: Expected `CV[int]` but got `int`.'] Line 78: Unexpected errors ['classes_classvar.py:78:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `float` but got `typing.Any`.'] -Line 83: Unexpected errors ['classes_classvar.py:83:4 Uninitialized attribute [13]: Attribute `damage` is declared in class `BasicStarship` to have type `int` but is never initialized.'] """ diff --git a/conformance/results/pyre/dataclasses_transform_class.toml b/conformance/results/pyre/dataclasses_transform_class.toml index 3c0b52dbd..bdb113d36 100644 --- a/conformance/results/pyre/dataclasses_transform_class.toml +++ b/conformance/results/pyre/dataclasses_transform_class.toml @@ -4,21 +4,19 @@ Does not support field specifiers. Emits "attribute not initialized" error for dataclass field. """ output = """ -dataclasses_transform_class.py:28:4 Uninitialized attribute [13]: Attribute `not_a_field` is declared in class `ModelBase` to have type `str` but is never initialized. -dataclasses_transform_class.py:48:0 Invalid inheritance [39]: Non-frozen dataclass `Customer1Subclass` cannot inherit from frozen dataclass `Customer1`. -dataclasses_transform_class.py:57:7 Unexpected keyword [28]: Unexpected keyword argument `other_name` to call `Customer1.__init__`. -dataclasses_transform_class.py:60:0 Invalid assignment [41]: Cannot reassign final attribute `c1_1.id`. -dataclasses_transform_class.py:63:7 Too many arguments [19]: Call `Customer1.__init__` expects 0 positional arguments, 2 were provided. -dataclasses_transform_class.py:69:5 Unsupported operand [58]: `<` is not supported for operand types `Customer1` and `Customer1`. -dataclasses_transform_class.py:79:7 Too many arguments [19]: Call `Customer2.__init__` expects 0 positional arguments, 2 were provided. -dataclasses_transform_class.py:87:4 Uninitialized attribute [13]: Attribute `not_a_field` is declared in class `GenericModelBase` to have type `Variable[T]` but is never initialized. -dataclasses_transform_class.py:108:4 Uninitialized attribute [13]: Attribute `not_a_field` is declared in class `ModelBaseFrozen` to have type `str` but is never initialized. -dataclasses_transform_class.py:119:0 Invalid assignment [41]: Cannot reassign final attribute `c3_1.id`. +dataclasses_transform_class.py:51:0 Invalid inheritance [39]: Non-frozen dataclass `Customer1Subclass` cannot inherit from frozen dataclass `Customer1`. +dataclasses_transform_class.py:60:7 Unexpected keyword [28]: Unexpected keyword argument `other_name` to call `Customer1.__init__`. +dataclasses_transform_class.py:63:0 Invalid assignment [41]: Cannot reassign final attribute `c1_1.id`. +dataclasses_transform_class.py:66:7 Too many arguments [19]: Call `Customer1.__init__` expects 0 positional arguments, 2 were provided. +dataclasses_transform_class.py:72:5 Unsupported operand [58]: `<` is not supported for operand types `Customer1` and `Customer1`. +dataclasses_transform_class.py:82:7 Too many arguments [19]: Call `Customer2.__init__` expects 0 positional arguments, 2 were provided. +dataclasses_transform_class.py:90:4 Uninitialized attribute [13]: Attribute `not_a_field` is declared in class `GenericModelBase` to have type `Variable[T]` but is never initialized. +dataclasses_transform_class.py:111:4 Uninitialized attribute [13]: Attribute `not_a_field` is declared in class `ModelBaseFrozen` to have type `str` but is never initialized. +dataclasses_transform_class.py:122:0 Invalid assignment [41]: Cannot reassign final attribute `c3_1.id`. """ conformance_automated = "Fail" errors_diff = """ -Line 28: Unexpected errors ['dataclasses_transform_class.py:28:4 Uninitialized attribute [13]: Attribute `not_a_field` is declared in class `ModelBase` to have type `str` but is never initialized.'] -Line 57: Unexpected errors ['dataclasses_transform_class.py:57:7 Unexpected keyword [28]: Unexpected keyword argument `other_name` to call `Customer1.__init__`.'] -Line 87: Unexpected errors ['dataclasses_transform_class.py:87:4 Uninitialized attribute [13]: Attribute `not_a_field` is declared in class `GenericModelBase` to have type `Variable[T]` but is never initialized.'] -Line 108: Unexpected errors ['dataclasses_transform_class.py:108:4 Uninitialized attribute [13]: Attribute `not_a_field` is declared in class `ModelBaseFrozen` to have type `str` but is never initialized.'] +Line 60: Unexpected errors ['dataclasses_transform_class.py:60:7 Unexpected keyword [28]: Unexpected keyword argument `other_name` to call `Customer1.__init__`.'] +Line 90: Unexpected errors ['dataclasses_transform_class.py:90:4 Uninitialized attribute [13]: Attribute `not_a_field` is declared in class `GenericModelBase` to have type `Variable[T]` but is never initialized.'] +Line 111: Unexpected errors ['dataclasses_transform_class.py:111:4 Uninitialized attribute [13]: Attribute `not_a_field` is declared in class `ModelBaseFrozen` to have type `str` but is never initialized.'] """ diff --git a/conformance/results/pyre/dataclasses_transform_meta.toml b/conformance/results/pyre/dataclasses_transform_meta.toml index 66f13cb29..ffcce3b41 100644 --- a/conformance/results/pyre/dataclasses_transform_meta.toml +++ b/conformance/results/pyre/dataclasses_transform_meta.toml @@ -5,19 +5,17 @@ Incorrectly rejects frozen dataclass that inherits from non-frozen. Emits "attribute not initialized" error for dataclass field. """ output = """ -dataclasses_transform_meta.py:26:4 Uninitialized attribute [13]: Attribute `not_a_field` is declared in class `ModelMeta` to have type `str` but is never initialized. -dataclasses_transform_meta.py:40:0 Invalid inheritance [39]: Frozen dataclass `Customer1` cannot inherit from non-frozen dataclass `ModelBase`. -dataclasses_transform_meta.py:48:0 Invalid inheritance [39]: Non-frozen dataclass `Customer1Subclass` cannot inherit from frozen dataclass `Customer1`. -dataclasses_transform_meta.py:57:7 Unexpected keyword [28]: Unexpected keyword argument `other_name` to call `Customer1.__init__`. -dataclasses_transform_meta.py:60:0 Invalid assignment [41]: Cannot reassign final attribute `c1_1.id`. -dataclasses_transform_meta.py:63:7 Too many arguments [19]: Call `Customer1.__init__` expects 0 positional arguments, 2 were provided. -dataclasses_transform_meta.py:70:5 Unsupported operand [58]: `<` is not supported for operand types `Customer1` and `Customer1`. -dataclasses_transform_meta.py:80:7 Too many arguments [19]: Call `Customer2.__init__` expects 0 positional arguments, 2 were provided. -dataclasses_transform_meta.py:100:0 Invalid assignment [41]: Cannot reassign final attribute `c3_1.id`. +dataclasses_transform_meta.py:43:0 Invalid inheritance [39]: Frozen dataclass `Customer1` cannot inherit from non-frozen dataclass `ModelBase`. +dataclasses_transform_meta.py:51:0 Invalid inheritance [39]: Non-frozen dataclass `Customer1Subclass` cannot inherit from frozen dataclass `Customer1`. +dataclasses_transform_meta.py:60:7 Unexpected keyword [28]: Unexpected keyword argument `other_name` to call `Customer1.__init__`. +dataclasses_transform_meta.py:63:0 Invalid assignment [41]: Cannot reassign final attribute `c1_1.id`. +dataclasses_transform_meta.py:66:7 Too many arguments [19]: Call `Customer1.__init__` expects 0 positional arguments, 2 were provided. +dataclasses_transform_meta.py:73:5 Unsupported operand [58]: `<` is not supported for operand types `Customer1` and `Customer1`. +dataclasses_transform_meta.py:83:7 Too many arguments [19]: Call `Customer2.__init__` expects 0 positional arguments, 2 were provided. +dataclasses_transform_meta.py:103:0 Invalid assignment [41]: Cannot reassign final attribute `c3_1.id`. """ conformance_automated = "Fail" errors_diff = """ -Line 26: Unexpected errors ['dataclasses_transform_meta.py:26:4 Uninitialized attribute [13]: Attribute `not_a_field` is declared in class `ModelMeta` to have type `str` but is never initialized.'] -Line 40: Unexpected errors ['dataclasses_transform_meta.py:40:0 Invalid inheritance [39]: Frozen dataclass `Customer1` cannot inherit from non-frozen dataclass `ModelBase`.'] -Line 57: Unexpected errors ['dataclasses_transform_meta.py:57:7 Unexpected keyword [28]: Unexpected keyword argument `other_name` to call `Customer1.__init__`.'] +Line 43: Unexpected errors ['dataclasses_transform_meta.py:43:0 Invalid inheritance [39]: Frozen dataclass `Customer1` cannot inherit from non-frozen dataclass `ModelBase`.'] +Line 60: Unexpected errors ['dataclasses_transform_meta.py:60:7 Unexpected keyword [28]: Unexpected keyword argument `other_name` to call `Customer1.__init__`.'] """ diff --git a/conformance/results/pyre/dataclasses_usage.toml b/conformance/results/pyre/dataclasses_usage.toml index c9c1c81c6..4620f9ec1 100644 --- a/conformance/results/pyre/dataclasses_usage.toml +++ b/conformance/results/pyre/dataclasses_usage.toml @@ -12,14 +12,13 @@ dataclasses_usage.py:72:4 Undefined attribute [16]: `typing.Type` has no attribu dataclasses_usage.py:83:5 Too many arguments [19]: Call `DC4.__init__` expects 1 positional argument, 2 were provided. dataclasses_usage.py:88:4 Incompatible attribute type [8]: Attribute `a` declared in class `DC5` has type `int` but is used as type `str`. dataclasses_usage.py:106:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing.Callable[[str], int]` but got `BoundMethod[typing.Callable[[str], int], DC6]`. -dataclasses_usage.py:116:4 Uninitialized attribute [13]: Attribute `y` is declared in class `DC8` to have type `int` but is never initialized. -dataclasses_usage.py:126:0 Too many arguments [19]: Call `DC7.__init__` expects 1 positional argument, 2 were provided. -dataclasses_usage.py:129:0 Missing argument [20]: Call `DC8.__init__` expects argument `y`. -dataclasses_usage.py:172:4 Uninitialized attribute [13]: Attribute `x` is declared in class `DC13` to have type `int` but is never initialized. -dataclasses_usage.py:173:4 Uninitialized attribute [13]: Attribute `x_squared` is declared in class `DC13` to have type `int` but is never initialized. -dataclasses_usage.py:178:0 Too many arguments [19]: Call `object.__init__` expects 0 positional arguments, 1 was provided. -dataclasses_usage.py:204:0 Incompatible variable type [9]: v7 is declared to have type `DataclassProto` but is used as type `DC15`. -dataclasses_usage.py:212:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `DC16[int]` but got `DC16[typing_extensions.Literal[1]]`. +dataclasses_usage.py:127:0 Too many arguments [19]: Call `DC7.__init__` expects 1 positional argument, 2 were provided. +dataclasses_usage.py:130:0 Missing argument [20]: Call `DC8.__init__` expects argument `y`. +dataclasses_usage.py:173:4 Uninitialized attribute [13]: Attribute `x` is declared in class `DC13` to have type `int` but is never initialized. +dataclasses_usage.py:174:4 Uninitialized attribute [13]: Attribute `x_squared` is declared in class `DC13` to have type `int` but is never initialized. +dataclasses_usage.py:179:0 Too many arguments [19]: Call `object.__init__` expects 0 positional arguments, 1 was provided. +dataclasses_usage.py:205:0 Incompatible variable type [9]: v7 is declared to have type `DataclassProto` but is used as type `DC15`. +dataclasses_usage.py:213:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `DC16[int]` but got `DC16[typing_extensions.Literal[1]]`. """ conformance_automated = "Fail" errors_diff = """ @@ -28,9 +27,8 @@ Lines 64, 67: Expected error (tag 'DC2') Lines 70, 73: Expected error (tag 'DC3') Line 72: Unexpected errors ['dataclasses_usage.py:72:4 Undefined attribute [16]: `typing.Type` has no attribute `a`.'] Line 106: Unexpected errors ['dataclasses_usage.py:106:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing.Callable[[str], int]` but got `BoundMethod[typing.Callable[[str], int], DC6]`.'] -Line 116: Unexpected errors ['dataclasses_usage.py:116:4 Uninitialized attribute [13]: Attribute `y` is declared in class `DC8` to have type `int` but is never initialized.'] -Line 172: Unexpected errors ['dataclasses_usage.py:172:4 Uninitialized attribute [13]: Attribute `x` is declared in class `DC13` to have type `int` but is never initialized.'] -Line 173: Unexpected errors ['dataclasses_usage.py:173:4 Uninitialized attribute [13]: Attribute `x_squared` is declared in class `DC13` to have type `int` but is never initialized.'] -Line 204: Unexpected errors ['dataclasses_usage.py:204:0 Incompatible variable type [9]: v7 is declared to have type `DataclassProto` but is used as type `DC15`.'] -Line 212: Unexpected errors ['dataclasses_usage.py:212:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `DC16[int]` but got `DC16[typing_extensions.Literal[1]]`.'] +Line 173: Unexpected errors ['dataclasses_usage.py:173:4 Uninitialized attribute [13]: Attribute `x` is declared in class `DC13` to have type `int` but is never initialized.'] +Line 174: Unexpected errors ['dataclasses_usage.py:174:4 Uninitialized attribute [13]: Attribute `x_squared` is declared in class `DC13` to have type `int` but is never initialized.'] +Line 205: Unexpected errors ['dataclasses_usage.py:205:0 Incompatible variable type [9]: v7 is declared to have type `DataclassProto` but is used as type `DC15`.'] +Line 213: Unexpected errors ['dataclasses_usage.py:213:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `DC16[int]` but got `DC16[typing_extensions.Literal[1]]`.'] """ diff --git a/conformance/results/pyre/enums_members.toml b/conformance/results/pyre/enums_members.toml index 260feff43..914ecb99f 100644 --- a/conformance/results/pyre/enums_members.toml +++ b/conformance/results/pyre/enums_members.toml @@ -11,35 +11,31 @@ Does not support `_ignore_` mechanism (optional). """ conformance_automated = "Fail" errors_diff = """ -Line 46: Expected 1 errors -Line 78: Expected 1 errors -Line 79: Expected 1 errors -Line 112: Expected 1 errors -Line 125: Expected 1 errors -Line 16: Unexpected errors ['enums_members.py:16:4 Uninitialized attribute [13]: Attribute `genus` is declared in class `Pet` to have type `Pet` but is never initialized.'] -Line 17: Unexpected errors ['enums_members.py:17:4 Uninitialized attribute [13]: Attribute `species` is declared in class `Pet` to have type `Pet` but is never initialized.'] -Line 23: Unexpected errors ['enums_members.py:23:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `Pet`.'] -Line 24: Unexpected errors ['enums_members.py:24:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `Pet`.'] -Line 31: Unexpected errors ['enums_members.py:31:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `Pet2`.'] -Line 32: Unexpected errors ['enums_members.py:32:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `Pet2`.'] -Line 96: Unexpected errors ['enums_members.py:96:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[TrafficLight.YELLOW]` but got `typing_extensions.Literal[TrafficLight.AMBER]`.'] -Line 113: Unexpected errors ['enums_members.py:113:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[Example.c]` but got `member[typing.Callable(Example.c)[[Named(self, Example)], None]]`.'] -Line 124: Unexpected errors ['enums_members.py:124:8 Revealed type [-1]: Revealed type for `enums_members.Example2._Example2__B` is `typing_extensions.Literal[Example2._Example2__B]` (final).'] -Line 135: Unexpected errors ['enums_members.py:135:4 Inconsistent override [15]: `_ignore_` overrides attribute defined in `Enum` inconsistently. Type `Pet5` is not a subtype of the overridden attribute `typing.Union[typing.List[str], str]`.'] +Line 50: Expected 1 errors +Line 82: Expected 1 errors +Line 83: Expected 1 errors +Line 116: Expected 1 errors +Line 129: Expected 1 errors +Line 27: Unexpected errors ['enums_members.py:27:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `Pet`.'] +Line 28: Unexpected errors ['enums_members.py:28:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `Pet`.'] +Line 35: Unexpected errors ['enums_members.py:35:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `Pet2`.'] +Line 36: Unexpected errors ['enums_members.py:36:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `Pet2`.'] +Line 100: Unexpected errors ['enums_members.py:100:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[TrafficLight.YELLOW]` but got `typing_extensions.Literal[TrafficLight.AMBER]`.'] +Line 117: Unexpected errors ['enums_members.py:117:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[Example.c]` but got `member[typing.Callable(Example.c)[[Named(self, Example)], None]]`.'] +Line 128: Unexpected errors ['enums_members.py:128:8 Revealed type [-1]: Revealed type for `enums_members.Example2._Example2__B` is `typing_extensions.Literal[Example2._Example2__B]` (final).'] +Line 139: Unexpected errors ['enums_members.py:139:4 Inconsistent override [15]: `_ignore_` overrides attribute defined in `Enum` inconsistently. Type `Pet5` is not a subtype of the overridden attribute `typing.Union[typing.List[str], str]`.'] """ output = """ -enums_members.py:16:4 Uninitialized attribute [13]: Attribute `genus` is declared in class `Pet` to have type `Pet` but is never initialized. -enums_members.py:17:4 Uninitialized attribute [13]: Attribute `species` is declared in class `Pet` to have type `Pet` but is never initialized. -enums_members.py:23:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `Pet`. -enums_members.py:24:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `Pet`. -enums_members.py:31:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `Pet2`. -enums_members.py:32:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `Pet2`. -enums_members.py:80:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[Pet4.species]` but got `str`. -enums_members.py:81:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[Pet4.speak]` but got `typing.Callable(Pet4.speak)[[Named(self, Pet4)], None]`. -enums_members.py:96:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[TrafficLight.YELLOW]` but got `typing_extensions.Literal[TrafficLight.AMBER]`. -enums_members.py:113:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[Example.c]` but got `member[typing.Callable(Example.c)[[Named(self, Example)], None]]`. -enums_members.py:124:8 Revealed type [-1]: Revealed type for `enums_members.Example2._Example2__B` is `typing_extensions.Literal[Example2._Example2__B]` (final). -enums_members.py:135:4 Inconsistent override [15]: `_ignore_` overrides attribute defined in `Enum` inconsistently. Type `Pet5` is not a subtype of the overridden attribute `typing.Union[typing.List[str], str]`. -enums_members.py:142:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `Pet5`. -enums_members.py:143:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `Pet5`. +enums_members.py:27:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `Pet`. +enums_members.py:28:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `Pet`. +enums_members.py:35:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `Pet2`. +enums_members.py:36:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `Pet2`. +enums_members.py:84:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[Pet4.species]` but got `str`. +enums_members.py:85:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[Pet4.speak]` but got `typing.Callable(Pet4.speak)[[Named(self, Pet4)], None]`. +enums_members.py:100:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[TrafficLight.YELLOW]` but got `typing_extensions.Literal[TrafficLight.AMBER]`. +enums_members.py:117:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[Example.c]` but got `member[typing.Callable(Example.c)[[Named(self, Example)], None]]`. +enums_members.py:128:8 Revealed type [-1]: Revealed type for `enums_members.Example2._Example2__B` is `typing_extensions.Literal[Example2._Example2__B]` (final). +enums_members.py:139:4 Inconsistent override [15]: `_ignore_` overrides attribute defined in `Enum` inconsistently. Type `Pet5` is not a subtype of the overridden attribute `typing.Union[typing.List[str], str]`. +enums_members.py:146:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `Pet5`. +enums_members.py:147:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `Pet5`. """ diff --git a/conformance/results/pyre/generics_scoping.toml b/conformance/results/pyre/generics_scoping.toml index 6b38cc47d..ae6cd48ca 100644 --- a/conformance/results/pyre/generics_scoping.toml +++ b/conformance/results/pyre/generics_scoping.toml @@ -11,13 +11,11 @@ generics_scoping.py:42:0 Incompatible parameter type [6]: In call `assert_type`, generics_scoping.py:43:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `bytes` but got `typing_extensions.Literal[b'abc']`. generics_scoping.py:50:7 Invalid type variable [34]: The type variable `Variable[S]` isn't present in the function's parameters. generics_scoping.py:54:13 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Variable[S]`. To reference the type variable, you can modify the class to inherit from `typing.Generic[S]`. -generics_scoping.py:78:8 Uninitialized attribute [13]: Attribute `x` is declared in class `Outer.AlsoBad` to have type `typing.List[Variable[T]]` but is never initialized. generics_scoping.py:78:11 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Variable[T]`. To reference the type variable, you can modify the class to inherit from `typing.Generic[T]`. -generics_scoping.py:82:4 Uninitialized attribute [13]: Attribute `attr` is declared in class `Outer` to have type `Outer.Inner[Variable[T]]` but is never initialized. -generics_scoping.py:84:23 Undefined attribute [16]: `list` has no attribute `__getitem__`. -generics_scoping.py:88:13 Invalid type variable [34]: The type variable `Variable[T]` can only be used to annotate generic classes or functions. -generics_scoping.py:89:13 Invalid type variable [34]: The type variable `Variable[T]` can only be used to annotate generic classes or functions. -generics_scoping.py:90:0 Undefined attribute [16]: `list` has no attribute `__getitem__`. +generics_scoping.py:87:23 Undefined attribute [16]: `list` has no attribute `__getitem__`. +generics_scoping.py:94:13 Invalid type variable [34]: The type variable `Variable[T]` can only be used to annotate generic classes or functions. +generics_scoping.py:95:13 Invalid type variable [34]: The type variable `Variable[T]` can only be used to annotate generic classes or functions. +generics_scoping.py:96:0 Undefined attribute [16]: `list` has no attribute `__getitem__`. """ conformance_automated = "Fail" errors_diff = """ @@ -28,4 +26,3 @@ Line 15: Unexpected errors ["generics_scoping.py:15:0 Incompatible parameter typ Line 42: Unexpected errors ["generics_scoping.py:42:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `typing_extensions.Literal['abc']`."] Line 43: Unexpected errors ["generics_scoping.py:43:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `bytes` but got `typing_extensions.Literal[b'abc']`."] """ -ignore_errors = ["Uninitialized attribute [13]"] diff --git a/conformance/results/pyre/generics_self_basic.toml b/conformance/results/pyre/generics_self_basic.toml index 41c5b5be9..8b64f8127 100644 --- a/conformance/results/pyre/generics_self_basic.toml +++ b/conformance/results/pyre/generics_self_basic.toml @@ -9,13 +9,11 @@ generics_self_basic.py:20:8 Incompatible return type [7]: Expected `Variable[_Se generics_self_basic.py:27:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `unknown` but got `Type[Variable[_Self_generics_self_basic_Shape__ (bound to Shape)]]`. generics_self_basic.py:33:8 Incompatible return type [7]: Expected `Variable[_Self_generics_self_basic_Shape__ (bound to Shape)]` but got `Shape`. generics_self_basic.py:40:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `unknown` but got `Variable[_Self_generics_self_basic_Shape__ (bound to Shape)]`. -generics_self_basic.py:59:4 Uninitialized attribute [13]: Attribute `value` is declared in class `Container` to have type `Variable[T]` but is never initialized. """ conformance_automated = "Fail" errors_diff = """ -Line 64: Expected 1 errors +Line 67: Expected 1 errors Line 14: Unexpected errors ['generics_self_basic.py:14:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `unknown` but got `Variable[_Self_generics_self_basic_Shape__ (bound to Shape)]`.', 'generics_self_basic.py:14:26 Undefined or invalid type [11]: Annotation `Self` is not defined as a type.'] Line 27: Unexpected errors ['generics_self_basic.py:27:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `unknown` but got `Type[Variable[_Self_generics_self_basic_Shape__ (bound to Shape)]]`.'] Line 40: Unexpected errors ['generics_self_basic.py:40:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `unknown` but got `Variable[_Self_generics_self_basic_Shape__ (bound to Shape)]`.'] -Line 59: Unexpected errors ['generics_self_basic.py:59:4 Uninitialized attribute [13]: Attribute `value` is declared in class `Container` to have type `Variable[T]` but is never initialized.'] """ diff --git a/conformance/results/pyre/generics_type_erasure.toml b/conformance/results/pyre/generics_type_erasure.toml index 2da356429..f2bc6919e 100644 --- a/conformance/results/pyre/generics_type_erasure.toml +++ b/conformance/results/pyre/generics_type_erasure.toml @@ -5,26 +5,24 @@ False negatives on instance attribute access on the type. Does not infer type of `DefaultDict` with explicit type parameters on constructor. """ output = """ -generics_type_erasure.py:12:4 Uninitialized attribute [13]: Attribute `label` is declared in class `Node` to have type `Variable[T]` but is never initialized. -generics_type_erasure.py:15:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Node[str]` but got `Node[typing_extensions.Literal['']]`. -generics_type_erasure.py:16:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Node[int]` but got `Node[typing_extensions.Literal[0]]`. -generics_type_erasure.py:17:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Node[typing.Any]` but got `Node[Variable[T]]`. -generics_type_erasure.py:19:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `typing_extensions.Literal[0]`. -generics_type_erasure.py:36:15 Incompatible parameter type [6]: In call `Node.__init__`, for 1st positional argument, expected `Optional[int]` but got `str`. -generics_type_erasure.py:38:15 Incompatible parameter type [6]: In call `Node.__init__`, for 1st positional argument, expected `Optional[str]` but got `int`. -generics_type_erasure.py:54:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `bytes` but got `typing.Any`. +generics_type_erasure.py:17:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Node[str]` but got `Node[typing_extensions.Literal['']]`. +generics_type_erasure.py:18:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Node[int]` but got `Node[typing_extensions.Literal[0]]`. +generics_type_erasure.py:19:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Node[typing.Any]` but got `Node[Variable[T]]`. +generics_type_erasure.py:21:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `typing_extensions.Literal[0]`. +generics_type_erasure.py:38:15 Incompatible parameter type [6]: In call `Node.__init__`, for 1st positional argument, expected `Optional[int]` but got `str`. +generics_type_erasure.py:40:15 Incompatible parameter type [6]: In call `Node.__init__`, for 1st positional argument, expected `Optional[str]` but got `int`. +generics_type_erasure.py:56:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `bytes` but got `typing.Any`. """ conformance_automated = "Fail" errors_diff = """ -Line 40: Expected 1 errors -Line 41: Expected 1 errors Line 42: Expected 1 errors Line 43: Expected 1 errors Line 44: Expected 1 errors -Line 12: Unexpected errors ['generics_type_erasure.py:12:4 Uninitialized attribute [13]: Attribute `label` is declared in class `Node` to have type `Variable[T]` but is never initialized.'] -Line 15: Unexpected errors ["generics_type_erasure.py:15:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Node[str]` but got `Node[typing_extensions.Literal['']]`."] -Line 16: Unexpected errors ['generics_type_erasure.py:16:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Node[int]` but got `Node[typing_extensions.Literal[0]]`.'] -Line 17: Unexpected errors ['generics_type_erasure.py:17:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Node[typing.Any]` but got `Node[Variable[T]]`.'] -Line 19: Unexpected errors ['generics_type_erasure.py:19:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `typing_extensions.Literal[0]`.'] -Line 54: Unexpected errors ['generics_type_erasure.py:54:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `bytes` but got `typing.Any`.'] +Line 45: Expected 1 errors +Line 46: Expected 1 errors +Line 17: Unexpected errors ["generics_type_erasure.py:17:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Node[str]` but got `Node[typing_extensions.Literal['']]`."] +Line 18: Unexpected errors ['generics_type_erasure.py:18:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Node[int]` but got `Node[typing_extensions.Literal[0]]`.'] +Line 19: Unexpected errors ['generics_type_erasure.py:19:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Node[typing.Any]` but got `Node[Variable[T]]`.'] +Line 21: Unexpected errors ['generics_type_erasure.py:21:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `typing_extensions.Literal[0]`.'] +Line 56: Unexpected errors ['generics_type_erasure.py:56:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `bytes` but got `typing.Any`.'] """ diff --git a/conformance/results/pyre/protocols_class_objects.toml b/conformance/results/pyre/protocols_class_objects.toml index 228b0e384..9a640450a 100644 --- a/conformance/results/pyre/protocols_class_objects.toml +++ b/conformance/results/pyre/protocols_class_objects.toml @@ -7,17 +7,15 @@ Fails to report some class objects as incompatible with a protocol. output = """ protocols_class_objects.py:26:11 Invalid class instantiation [45]: Cannot instantiate abstract class `Proto` with abstract method `meth`. protocols_class_objects.py:58:0 Incompatible variable type [9]: pa1 is declared to have type `ProtoA1` but is used as type `Type[ConcreteA]`. -protocols_class_objects.py:94:4 Uninitialized attribute [13]: Attribute `attr1` is declared in class `CMeta` to have type `int` but is never initialized. """ conformance_automated = "Fail" errors_diff = """ Line 29: Expected 1 errors Line 34: Expected 1 errors Line 74: Expected 1 errors -Line 101: Expected 1 errors -Line 103: Expected 1 errors Line 104: Expected 1 errors -Line 105: Expected 1 errors +Line 106: Expected 1 errors +Line 107: Expected 1 errors +Line 108: Expected 1 errors Line 26: Unexpected errors ['protocols_class_objects.py:26:11 Invalid class instantiation [45]: Cannot instantiate abstract class `Proto` with abstract method `meth`.'] -Line 94: Unexpected errors ['protocols_class_objects.py:94:4 Uninitialized attribute [13]: Attribute `attr1` is declared in class `CMeta` to have type `int` but is never initialized.'] """ diff --git a/conformance/results/pyre/protocols_explicit.toml b/conformance/results/pyre/protocols_explicit.toml index 20d00e13e..0e7d70ef0 100644 --- a/conformance/results/pyre/protocols_explicit.toml +++ b/conformance/results/pyre/protocols_explicit.toml @@ -4,23 +4,14 @@ Does not report error when calling unimplemented protocol method from derived cl Does not report error when method is not implemented in derived class. """ output = """ -protocols_explicit.py:54:0 Uninitialized attribute [13]: Attribute `other` inherited from protocol `RGB` in class `Point` to have type `int` but is never initialized. -protocols_explicit.py:59:4 Invalid class instantiation [45]: Cannot instantiate abstract class `Point` with abstract method `intensity`. -protocols_explicit.py:82:0 Uninitialized attribute [13]: Attribute `cm1` inherited from protocol `Proto1` in class `Concrete1` to have type `int` but is never initialized. -protocols_explicit.py:82:0 Uninitialized attribute [13]: Attribute `im1` inherited from protocol `Proto1` in class `Concrete1` to have type `int` but is never initialized. -protocols_explicit.py:97:0 Uninitialized attribute [13]: Attribute `cm10` inherited from protocol `Proto2` in class `Concrete3` to have type `int` but is never initialized. -protocols_explicit.py:97:0 Uninitialized attribute [13]: Attribute `cm11` inherited from protocol `Proto3` in class `Concrete3` to have type `int` but is never initialized. -protocols_explicit.py:97:0 Uninitialized attribute [13]: Attribute `im1` inherited from protocol `Proto1` in class `Concrete3` to have type `int` but is never initialized. -protocols_explicit.py:159:6 Invalid class instantiation [45]: Cannot instantiate abstract class `Concrete7A` with abstract method `method1`. +protocols_explicit.py:60:4 Invalid class instantiation [45]: Cannot instantiate abstract class `Point` with abstract method `intensity`. +protocols_explicit.py:165:6 Invalid class instantiation [45]: Cannot instantiate abstract class `Concrete7A` with abstract method `method1`. """ conformance_automated = "Fail" errors_diff = """ Line 27: Expected 1 errors Line 56: Expected 1 errors -Line 86: Expected 1 errors -Line 104: Expected 1 errors -Line 129: Expected 1 errors -Line 54: Unexpected errors ['protocols_explicit.py:54:0 Uninitialized attribute [13]: Attribute `other` inherited from protocol `RGB` in class `Point` to have type `int` but is never initialized.'] -Line 82: Unexpected errors ['protocols_explicit.py:82:0 Uninitialized attribute [13]: Attribute `cm1` inherited from protocol `Proto1` in class `Concrete1` to have type `int` but is never initialized.', 'protocols_explicit.py:82:0 Uninitialized attribute [13]: Attribute `im1` inherited from protocol `Proto1` in class `Concrete1` to have type `int` but is never initialized.'] -Line 97: Unexpected errors ['protocols_explicit.py:97:0 Uninitialized attribute [13]: Attribute `cm10` inherited from protocol `Proto2` in class `Concrete3` to have type `int` but is never initialized.', 'protocols_explicit.py:97:0 Uninitialized attribute [13]: Attribute `cm11` inherited from protocol `Proto3` in class `Concrete3` to have type `int` but is never initialized.', 'protocols_explicit.py:97:0 Uninitialized attribute [13]: Attribute `im1` inherited from protocol `Proto1` in class `Concrete3` to have type `int` but is never initialized.'] +Line 90: Expected 1 errors +Line 110: Expected 1 errors +Line 135: Expected 1 errors """ diff --git a/conformance/results/pyre/specialtypes_never.toml b/conformance/results/pyre/specialtypes_never.toml index 0a02bef8f..d65de23ed 100644 --- a/conformance/results/pyre/specialtypes_never.toml +++ b/conformance/results/pyre/specialtypes_never.toml @@ -4,25 +4,21 @@ Does not treat Never as compatible with all other types. """ output = """ specialtypes_never.py:21:8 Incompatible return type [7]: Function declared non-returnable, but got `None`. -specialtypes_never.py:56:4 Uninitialized attribute [13]: Attribute `x` is declared in class `ClassA` to have type `NoReturn` but is never initialized. -specialtypes_never.py:57:4 Uninitialized attribute [13]: Attribute `y` is declared in class `ClassA` to have type `typing.List[NoReturn]` but is never initialized. -specialtypes_never.py:64:4 Incompatible variable type [9]: v1 is declared to have type `int` but is used as type `Never`. -specialtypes_never.py:65:4 Incompatible variable type [9]: v2 is declared to have type `str` but is used as type `Never`. -specialtypes_never.py:66:4 Incompatible variable type [9]: v3 is declared to have type `List[str]` but is used as type `Never`. -specialtypes_never.py:82:4 Incompatible variable type [9]: v3 is declared to have type `List[int]` but is used as type `List[Never]`. -specialtypes_never.py:83:4 Incompatible variable type [9]: v4 is declared to have type `Never` but is used as type `NoReturn`. -specialtypes_never.py:92:4 Incompatible return type [7]: Expected `ClassB[Variable[U]]` but got `ClassB[Never]`. -specialtypes_never.py:101:4 Incompatible return type [7]: Expected `ClassC[Variable[U]]` but got `ClassC[Never]`. +specialtypes_never.py:68:4 Incompatible variable type [9]: v1 is declared to have type `int` but is used as type `Never`. +specialtypes_never.py:69:4 Incompatible variable type [9]: v2 is declared to have type `str` but is used as type `Never`. +specialtypes_never.py:70:4 Incompatible variable type [9]: v3 is declared to have type `List[str]` but is used as type `Never`. +specialtypes_never.py:86:4 Incompatible variable type [9]: v3 is declared to have type `List[int]` but is used as type `List[Never]`. +specialtypes_never.py:87:4 Incompatible variable type [9]: v4 is declared to have type `Never` but is used as type `NoReturn`. +specialtypes_never.py:96:4 Incompatible return type [7]: Expected `ClassB[Variable[U]]` but got `ClassB[Never]`. +specialtypes_never.py:105:4 Incompatible return type [7]: Expected `ClassC[Variable[U]]` but got `ClassC[Never]`. """ conformance_automated = "Fail" errors_diff = """ Line 19: Expected 1 errors Line 21: Unexpected errors ['specialtypes_never.py:21:8 Incompatible return type [7]: Function declared non-returnable, but got `None`.'] -Line 56: Unexpected errors ['specialtypes_never.py:56:4 Uninitialized attribute [13]: Attribute `x` is declared in class `ClassA` to have type `NoReturn` but is never initialized.'] -Line 57: Unexpected errors ['specialtypes_never.py:57:4 Uninitialized attribute [13]: Attribute `y` is declared in class `ClassA` to have type `typing.List[NoReturn]` but is never initialized.'] -Line 64: Unexpected errors ['specialtypes_never.py:64:4 Incompatible variable type [9]: v1 is declared to have type `int` but is used as type `Never`.'] -Line 65: Unexpected errors ['specialtypes_never.py:65:4 Incompatible variable type [9]: v2 is declared to have type `str` but is used as type `Never`.'] -Line 66: Unexpected errors ['specialtypes_never.py:66:4 Incompatible variable type [9]: v3 is declared to have type `List[str]` but is used as type `Never`.'] -Line 83: Unexpected errors ['specialtypes_never.py:83:4 Incompatible variable type [9]: v4 is declared to have type `Never` but is used as type `NoReturn`.'] -Line 92: Unexpected errors ['specialtypes_never.py:92:4 Incompatible return type [7]: Expected `ClassB[Variable[U]]` but got `ClassB[Never]`.'] +Line 68: Unexpected errors ['specialtypes_never.py:68:4 Incompatible variable type [9]: v1 is declared to have type `int` but is used as type `Never`.'] +Line 69: Unexpected errors ['specialtypes_never.py:69:4 Incompatible variable type [9]: v2 is declared to have type `str` but is used as type `Never`.'] +Line 70: Unexpected errors ['specialtypes_never.py:70:4 Incompatible variable type [9]: v3 is declared to have type `List[str]` but is used as type `Never`.'] +Line 87: Unexpected errors ['specialtypes_never.py:87:4 Incompatible variable type [9]: v4 is declared to have type `Never` but is used as type `NoReturn`.'] +Line 96: Unexpected errors ['specialtypes_never.py:96:4 Incompatible return type [7]: Expected `ClassB[Variable[U]]` but got `ClassB[Never]`.'] """ diff --git a/conformance/results/pyre/typeddicts_class_syntax.toml b/conformance/results/pyre/typeddicts_class_syntax.toml index 86a0789e8..3bcd15206 100644 --- a/conformance/results/pyre/typeddicts_class_syntax.toml +++ b/conformance/results/pyre/typeddicts_class_syntax.toml @@ -6,8 +6,7 @@ Does not report when other keyword argument is provided. Does not support generic TypedDict class. """ output = """ -typeddicts_class_syntax.py:58:4 Uninitialized attribute [13]: Attribute `name` is declared in class `GenericTypedDict` to have type `str` but is never initialized. -typeddicts_class_syntax.py:59:4 Uninitialized attribute [13]: Attribute `value` is declared in class `GenericTypedDict` to have type `Variable[T]` but is never initialized. +typeddicts_class_syntax.py:59:11 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Variable[T]`. To reference the type variable, you can modify the class to inherit from `typing.Generic[T]`. """ conformance_automated = "Fail" errors_diff = """ @@ -16,6 +15,5 @@ Line 33: Expected 1 errors Line 38: Expected 1 errors Line 44: Expected 1 errors Line 49: Expected 1 errors -Line 58: Unexpected errors ['typeddicts_class_syntax.py:58:4 Uninitialized attribute [13]: Attribute `name` is declared in class `GenericTypedDict` to have type `str` but is never initialized.'] -Line 59: Unexpected errors ['typeddicts_class_syntax.py:59:4 Uninitialized attribute [13]: Attribute `value` is declared in class `GenericTypedDict` to have type `Variable[T]` but is never initialized.'] +Line 59: Unexpected errors ["typeddicts_class_syntax.py:59:11 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Variable[T]`. To reference the type variable, you can modify the class to inherit from `typing.Generic[T]`."] """ diff --git a/conformance/results/pyre/typeddicts_required.toml b/conformance/results/pyre/typeddicts_required.toml index 78870ad01..2d84becd8 100644 --- a/conformance/results/pyre/typeddicts_required.toml +++ b/conformance/results/pyre/typeddicts_required.toml @@ -7,15 +7,17 @@ Incorrectly complains about uninitialized attributes on TypedDict definitions. Incorrectly generates "attribute not initialized" errors for TypedDict fields. """ output = """ -typeddicts_required.py:12:4 Uninitialized attribute [13]: Attribute `x` is declared in class `NotTypedDict` to have type `Required[int]` but is never initialized. -typeddicts_required.py:71:62 Undefined or invalid type [11]: Annotation `RecursiveMovie` is not defined as a type. -typeddicts_required.py:74:24 TypedDict initialization error [55]: Expected type `unknown` for `RecursiveMovie` field `predecessor` but got `typing.Dict[str, str]`. +typeddicts_required.py:15:8 Incompatible attribute type [8]: Attribute `x` declared in class `NotTypedDict` has type `Required[int]` but is used as type `int`. +typeddicts_required.py:74:62 Undefined or invalid type [11]: Annotation `RecursiveMovie` is not defined as a type. +typeddicts_required.py:77:24 TypedDict initialization error [55]: Expected type `unknown` for `RecursiveMovie` field `predecessor` but got `typing.Dict[str, str]`. """ conformance_automated = "Fail" errors_diff = """ -Line 16: Expected 1 errors -Line 59: Expected 1 errors -Line 60: Expected 1 errors -Line 71: Unexpected errors ['typeddicts_required.py:71:62 Undefined or invalid type [11]: Annotation `RecursiveMovie` is not defined as a type.'] -Line 74: Unexpected errors ['typeddicts_required.py:74:24 TypedDict initialization error [55]: Expected type `unknown` for `RecursiveMovie` field `predecessor` but got `typing.Dict[str, str]`.'] +Line 12: Expected 1 errors +Line 19: Expected 1 errors +Line 62: Expected 1 errors +Line 63: Expected 1 errors +Line 15: Unexpected errors ['typeddicts_required.py:15:8 Incompatible attribute type [8]: Attribute `x` declared in class `NotTypedDict` has type `Required[int]` but is used as type `int`.'] +Line 74: Unexpected errors ['typeddicts_required.py:74:62 Undefined or invalid type [11]: Annotation `RecursiveMovie` is not defined as a type.'] +Line 77: Unexpected errors ['typeddicts_required.py:77:24 TypedDict initialization error [55]: Expected type `unknown` for `RecursiveMovie` field `predecessor` but got `typing.Dict[str, str]`.'] """ diff --git a/conformance/results/pyre/version.toml b/conformance/results/pyre/version.toml index fff2c3f20..cd590f239 100644 --- a/conformance/results/pyre/version.toml +++ b/conformance/results/pyre/version.toml @@ -1,2 +1,2 @@ version = "pyre 0.9.22" -test_duration = 2.8 +test_duration = 1.7 diff --git a/conformance/results/pyright/classes_classvar.toml b/conformance/results/pyright/classes_classvar.toml index 3e50fc7c1..641aa6973 100644 --- a/conformance/results/pyright/classes_classvar.toml +++ b/conformance/results/pyright/classes_classvar.toml @@ -15,10 +15,10 @@ classes_classvar.py:65:18 - error: "ClassVar" is not allowed in this context classes_classvar.py:67:26 - error: "ClassVar" is not allowed in this context classes_classvar.py:71:8 - error: "ClassVar" is not allowed in this context classes_classvar.py:72:20 - error: "ClassVar" is not allowed in this context -classes_classvar.py:102:14 - error: Cannot assign to attribute "stats" for class "Starship" +classes_classvar.py:105:14 - error: Cannot assign to attribute "stats" for class "Starship"   Attribute "stats" cannot be assigned through a class instance because it is a ClassVar     Attribute "__set__" is unknown (reportAttributeAccessIssue) -classes_classvar.py:131:13 - error: Expression of type "ProtoAImpl" is incompatible with declared type "ProtoA" +classes_classvar.py:134:13 - error: Expression of type "ProtoAImpl" is incompatible with declared type "ProtoA"   "ProtoAImpl" is incompatible with protocol "ProtoA"     "x" is defined as a ClassVar in protocol     "y" is defined as a ClassVar in protocol (reportAssignmentType) diff --git a/conformance/results/pyright/dataclasses_transform_class.toml b/conformance/results/pyright/dataclasses_transform_class.toml index 76157c6d6..b7bf3083f 100644 --- a/conformance/results/pyright/dataclasses_transform_class.toml +++ b/conformance/results/pyright/dataclasses_transform_class.toml @@ -1,13 +1,13 @@ conformant = "Pass" output = """ -dataclasses_transform_class.py:48:7 - error: A non-frozen class cannot inherit from a class that is frozen (reportGeneralTypeIssues) -dataclasses_transform_class.py:60:6 - error: Cannot assign to attribute "id" for class "Customer1" +dataclasses_transform_class.py:51:7 - error: A non-frozen class cannot inherit from a class that is frozen (reportGeneralTypeIssues) +dataclasses_transform_class.py:63:6 - error: Cannot assign to attribute "id" for class "Customer1"   "Customer1" is frozen     Attribute "__set__" is unknown (reportAttributeAccessIssue) -dataclasses_transform_class.py:63:18 - error: Expected 0 positional arguments (reportCallIssue) -dataclasses_transform_class.py:69:6 - error: Operator "<" not supported for types "Customer1" and "Customer1" (reportOperatorIssue) -dataclasses_transform_class.py:79:18 - error: Expected 0 positional arguments (reportCallIssue) -dataclasses_transform_class.py:119:6 - error: Cannot assign to attribute "id" for class "Customer3" +dataclasses_transform_class.py:66:18 - error: Expected 0 positional arguments (reportCallIssue) +dataclasses_transform_class.py:72:6 - error: Operator "<" not supported for types "Customer1" and "Customer1" (reportOperatorIssue) +dataclasses_transform_class.py:82:18 - error: Expected 0 positional arguments (reportCallIssue) +dataclasses_transform_class.py:122:6 - error: Cannot assign to attribute "id" for class "Customer3"   "Customer3" is frozen     Attribute "__set__" is unknown (reportAttributeAccessIssue) """ diff --git a/conformance/results/pyright/dataclasses_transform_meta.toml b/conformance/results/pyright/dataclasses_transform_meta.toml index 6e77a130f..d59747196 100644 --- a/conformance/results/pyright/dataclasses_transform_meta.toml +++ b/conformance/results/pyright/dataclasses_transform_meta.toml @@ -1,13 +1,13 @@ conformant = "Pass" output = """ -dataclasses_transform_meta.py:48:36 - error: A non-frozen class cannot inherit from a class that is frozen (reportGeneralTypeIssues) -dataclasses_transform_meta.py:60:6 - error: Cannot assign to attribute "id" for class "Customer1" +dataclasses_transform_meta.py:51:36 - error: A non-frozen class cannot inherit from a class that is frozen (reportGeneralTypeIssues) +dataclasses_transform_meta.py:63:6 - error: Cannot assign to attribute "id" for class "Customer1"   "Customer1" is frozen     Attribute "__set__" is unknown (reportAttributeAccessIssue) -dataclasses_transform_meta.py:63:18 - error: Expected 0 positional arguments (reportCallIssue) -dataclasses_transform_meta.py:70:6 - error: Operator "<" not supported for types "Customer1" and "Customer1" (reportOperatorIssue) -dataclasses_transform_meta.py:80:18 - error: Expected 0 positional arguments (reportCallIssue) -dataclasses_transform_meta.py:100:6 - error: Cannot assign to attribute "id" for class "Customer3" +dataclasses_transform_meta.py:66:18 - error: Expected 0 positional arguments (reportCallIssue) +dataclasses_transform_meta.py:73:6 - error: Operator "<" not supported for types "Customer1" and "Customer1" (reportOperatorIssue) +dataclasses_transform_meta.py:83:18 - error: Expected 0 positional arguments (reportCallIssue) +dataclasses_transform_meta.py:103:6 - error: Cannot assign to attribute "id" for class "Customer3"   "Customer3" is frozen     Attribute "__set__" is unknown (reportAttributeAccessIssue) """ diff --git a/conformance/results/pyright/dataclasses_usage.toml b/conformance/results/pyright/dataclasses_usage.toml index e9c7365f3..8a2b626c8 100644 --- a/conformance/results/pyright/dataclasses_usage.toml +++ b/conformance/results/pyright/dataclasses_usage.toml @@ -10,10 +10,10 @@ dataclasses_usage.py:73:5 - error: Fields without default values cannot appear a dataclasses_usage.py:83:13 - error: Expected 1 positional argument (reportCallIssue) dataclasses_usage.py:88:36 - error: Argument of type "type[str]" cannot be assigned to parameter "default_factory" of type "() -> _T@field" in function "field"   No overloaded function matches type "() -> int" (reportArgumentType) -dataclasses_usage.py:126:8 - error: Expected 1 positional argument (reportCallIssue) -dataclasses_usage.py:129:1 - error: Argument missing for parameter "y" (reportCallIssue) -dataclasses_usage.py:178:1 - error: Expected no arguments to "DC13" constructor (reportCallIssue) -dataclasses_usage.py:227:9 - error: Dataclass field without type annotation will cause runtime exception (reportGeneralTypeIssues) +dataclasses_usage.py:127:8 - error: Expected 1 positional argument (reportCallIssue) +dataclasses_usage.py:130:1 - error: Argument missing for parameter "y" (reportCallIssue) +dataclasses_usage.py:179:1 - error: Expected no arguments to "DC13" constructor (reportCallIssue) +dataclasses_usage.py:228:9 - error: Dataclass field without type annotation will cause runtime exception (reportGeneralTypeIssues) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/enums_members.toml b/conformance/results/pyright/enums_members.toml index db932d715..ef78691b0 100644 --- a/conformance/results/pyright/enums_members.toml +++ b/conformance/results/pyright/enums_members.toml @@ -2,27 +2,31 @@ conformant = "Pass" notes = """ Does not support `_ignore_` mechanism (optional). """ -conformance_automated = "Pass" +conformance_automated = "Fail" errors_diff = """ +Line 19: Unexpected errors ['enums_members.py:19:11 - error: Argument missing for parameter "species" (reportCallIssue)'] +Line 20: Unexpected errors ['enums_members.py:20:11 - error: Argument missing for parameter "species" (reportCallIssue)'] """ output = """ -enums_members.py:46:5 - error: Type annotations are not allowed for enum members (reportGeneralTypeIssues) -enums_members.py:78:13 - error: "assert_type" mismatch: expected "Unknown" but received "(x: Unknown) -> str" (reportAssertTypeFailure) -enums_members.py:78:37 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value -enums_members.py:78:42 - error: Variable not allowed in type expression (reportInvalidTypeForm) -enums_members.py:79:13 - error: "assert_type" mismatch: expected "Unknown" but received "(x: int) -> int" (reportAssertTypeFailure) -enums_members.py:79:37 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value -enums_members.py:79:42 - error: Variable not allowed in type expression (reportInvalidTypeForm) -enums_members.py:80:13 - error: "assert_type" mismatch: expected "Unknown" but received "property" (reportAssertTypeFailure) -enums_members.py:80:35 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value -enums_members.py:81:13 - error: "assert_type" mismatch: expected "Unknown" but received "(self: Pet4) -> None" (reportAssertTypeFailure) -enums_members.py:81:33 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value -enums_members.py:112:13 - error: "assert_type" mismatch: expected "Unknown" but received "int" (reportAssertTypeFailure) -enums_members.py:112:32 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value -enums_members.py:124:21 - information: Type of "Example2.__B" is "Literal[2]" -enums_members.py:125:21 - error: "assert_type" mismatch: expected "Unknown" but received "Literal[2]" (reportAssertTypeFailure) -enums_members.py:125:43 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value -enums_members.py:125:52 - error: Variable not allowed in type expression (reportInvalidTypeForm) -enums_members.py:142:13 - error: "assert_type" mismatch: expected "int" but received "Literal[Pet5.DOG]" (reportAssertTypeFailure) -enums_members.py:143:13 - error: "assert_type" mismatch: expected "int" but received "Literal[Pet5.FISH]" (reportAssertTypeFailure) +enums_members.py:19:11 - error: Argument missing for parameter "species" (reportCallIssue) +enums_members.py:20:11 - error: Argument missing for parameter "species" (reportCallIssue) +enums_members.py:50:5 - error: Type annotations are not allowed for enum members (reportGeneralTypeIssues) +enums_members.py:82:13 - error: "assert_type" mismatch: expected "Unknown" but received "(x: Unknown) -> str" (reportAssertTypeFailure) +enums_members.py:82:37 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value +enums_members.py:82:42 - error: Variable not allowed in type expression (reportInvalidTypeForm) +enums_members.py:83:13 - error: "assert_type" mismatch: expected "Unknown" but received "(x: int) -> int" (reportAssertTypeFailure) +enums_members.py:83:37 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value +enums_members.py:83:42 - error: Variable not allowed in type expression (reportInvalidTypeForm) +enums_members.py:84:13 - error: "assert_type" mismatch: expected "Unknown" but received "property" (reportAssertTypeFailure) +enums_members.py:84:35 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value +enums_members.py:85:13 - error: "assert_type" mismatch: expected "Unknown" but received "(self: Pet4) -> None" (reportAssertTypeFailure) +enums_members.py:85:33 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value +enums_members.py:116:13 - error: "assert_type" mismatch: expected "Unknown" but received "int" (reportAssertTypeFailure) +enums_members.py:116:32 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value +enums_members.py:128:21 - information: Type of "Example2.__B" is "Literal[2]" +enums_members.py:129:21 - error: "assert_type" mismatch: expected "Unknown" but received "Literal[2]" (reportAssertTypeFailure) +enums_members.py:129:43 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value +enums_members.py:129:52 - error: Variable not allowed in type expression (reportInvalidTypeForm) +enums_members.py:146:13 - error: "assert_type" mismatch: expected "int" but received "Literal[Pet5.DOG]" (reportAssertTypeFailure) +enums_members.py:147:13 - error: "assert_type" mismatch: expected "int" but received "Literal[Pet5.FISH]" (reportAssertTypeFailure) """ diff --git a/conformance/results/pyright/generics_scoping.toml b/conformance/results/pyright/generics_scoping.toml index 229fa95ab..fc1bd87c1 100644 --- a/conformance/results/pyright/generics_scoping.toml +++ b/conformance/results/pyright/generics_scoping.toml @@ -7,10 +7,10 @@ generics_scoping.py:54:19 - error: Type variable "S" has no meaning in this cont generics_scoping.py:65:29 - error: TypeVar "T" is already in use by an outer scope (reportGeneralTypeIssues) generics_scoping.py:75:24 - error: TypeVar "T" is already in use by an outer scope (reportGeneralTypeIssues) generics_scoping.py:78:17 - error: Type variable "T" has no meaning in this context (reportGeneralTypeIssues) -generics_scoping.py:84:5 - error: Generic type alias within class cannot use bound type variables T -generics_scoping.py:88:14 - error: Type variable "T" has no meaning in this context (reportGeneralTypeIssues) -generics_scoping.py:89:19 - error: Type variable "T" has no meaning in this context (reportGeneralTypeIssues) -generics_scoping.py:90:6 - error: Type variable "T" has no meaning in this context (reportGeneralTypeIssues) +generics_scoping.py:87:5 - error: Generic type alias within class cannot use bound type variables T +generics_scoping.py:94:14 - error: Type variable "T" has no meaning in this context (reportGeneralTypeIssues) +generics_scoping.py:95:19 - error: Type variable "T" has no meaning in this context (reportGeneralTypeIssues) +generics_scoping.py:96:6 - error: Type variable "T" has no meaning in this context (reportGeneralTypeIssues) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/generics_self_basic.toml b/conformance/results/pyright/generics_self_basic.toml index 3fa07521f..a7a676071 100644 --- a/conformance/results/pyright/generics_self_basic.toml +++ b/conformance/results/pyright/generics_self_basic.toml @@ -4,7 +4,7 @@ generics_self_basic.py:20:16 - error: Expression of type "Shape" is incompatible   Type "Shape" is incompatible with type "Self@Shape" (reportReturnType) generics_self_basic.py:33:16 - error: Expression of type "Shape" is incompatible with return type "Self@Shape"   Type "Shape" is incompatible with type "Self@Shape" (reportReturnType) -generics_self_basic.py:64:31 - error: Expected no type arguments for class "Self" (reportInvalidTypeArguments) +generics_self_basic.py:67:31 - error: Expected no type arguments for class "Self" (reportInvalidTypeArguments) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/generics_type_erasure.toml b/conformance/results/pyright/generics_type_erasure.toml index 35398f2c1..caf122a4e 100644 --- a/conformance/results/pyright/generics_type_erasure.toml +++ b/conformance/results/pyright/generics_type_erasure.toml @@ -1,18 +1,18 @@ conformant = "Pass" output = """ -generics_type_erasure.py:36:16 - error: Argument of type "Literal['']" cannot be assigned to parameter "label" of type "int | None" in function "__init__" +generics_type_erasure.py:38:16 - error: Argument of type "Literal['']" cannot be assigned to parameter "label" of type "int | None" in function "__init__"   Type "Literal['']" is incompatible with type "int | None"     "Literal['']" is incompatible with "int"     "Literal['']" is incompatible with "None" (reportArgumentType) -generics_type_erasure.py:38:16 - error: Argument of type "Literal[0]" cannot be assigned to parameter "label" of type "str | None" in function "__init__" +generics_type_erasure.py:40:16 - error: Argument of type "Literal[0]" cannot be assigned to parameter "label" of type "str | None" in function "__init__"   Type "Literal[0]" is incompatible with type "str | None"     "Literal[0]" is incompatible with "str"     "Literal[0]" is incompatible with "None" (reportArgumentType) -generics_type_erasure.py:40:11 - error: Access to generic instance variable through class is ambiguous (reportGeneralTypeIssues) -generics_type_erasure.py:41:11 - error: Access to generic instance variable through class is ambiguous (reportGeneralTypeIssues) -generics_type_erasure.py:42:6 - error: Access to generic instance variable through class is ambiguous (reportGeneralTypeIssues) -generics_type_erasure.py:43:6 - error: Access to generic instance variable through class is ambiguous (reportGeneralTypeIssues) -generics_type_erasure.py:44:10 - error: Access to generic instance variable through class is ambiguous (reportGeneralTypeIssues) +generics_type_erasure.py:42:11 - error: Access to generic instance variable through class is ambiguous (reportGeneralTypeIssues) +generics_type_erasure.py:43:11 - error: Access to generic instance variable through class is ambiguous (reportGeneralTypeIssues) +generics_type_erasure.py:44:6 - error: Access to generic instance variable through class is ambiguous (reportGeneralTypeIssues) +generics_type_erasure.py:45:6 - error: Access to generic instance variable through class is ambiguous (reportGeneralTypeIssues) +generics_type_erasure.py:46:10 - error: Access to generic instance variable through class is ambiguous (reportGeneralTypeIssues) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/protocols_class_objects.toml b/conformance/results/pyright/protocols_class_objects.toml index f24e98e4e..47e31dabf 100644 --- a/conformance/results/pyright/protocols_class_objects.toml +++ b/conformance/results/pyright/protocols_class_objects.toml @@ -16,13 +16,13 @@ protocols_class_objects.py:58:16 - error: Expression of type "type[ConcreteA]" i protocols_class_objects.py:74:16 - error: Expression of type "type[ConcreteB]" is incompatible with declared type "ProtoB1"   "prop1" is an incompatible type     "property" is incompatible with "int" (reportAssignmentType) -protocols_class_objects.py:101:16 - error: Expression of type "type[ConcreteC1]" is incompatible with declared type "ProtoC1" +protocols_class_objects.py:104:16 - error: Expression of type "type[ConcreteC1]" is incompatible with declared type "ProtoC1"   "attr1" is defined as a ClassVar in protocol (reportAssignmentType) -protocols_class_objects.py:103:16 - error: Expression of type "type[ConcreteC2]" is incompatible with declared type "ProtoC1" +protocols_class_objects.py:106:16 - error: Expression of type "type[ConcreteC2]" is incompatible with declared type "ProtoC1"   "attr1" is defined as a ClassVar in protocol (reportAssignmentType) -protocols_class_objects.py:104:16 - error: Expression of type "type[ConcreteC2]" is incompatible with declared type "ProtoC2" +protocols_class_objects.py:107:16 - error: Expression of type "type[ConcreteC2]" is incompatible with declared type "ProtoC2"   "attr1" must be defined as a ClassVar to be compatible with protocol (reportAssignmentType) -protocols_class_objects.py:105:16 - error: Expression of type "type[ConcreteC3]" is incompatible with declared type "ProtoC1" +protocols_class_objects.py:108:16 - error: Expression of type "type[ConcreteC3]" is incompatible with declared type "ProtoC1"   "attr1" is defined as a ClassVar in protocol (reportAssignmentType) """ conformance_automated = "Pass" diff --git a/conformance/results/pyright/protocols_explicit.toml b/conformance/results/pyright/protocols_explicit.toml index c6b503d29..4ee4fca06 100644 --- a/conformance/results/pyright/protocols_explicit.toml +++ b/conformance/results/pyright/protocols_explicit.toml @@ -3,22 +3,20 @@ output = """ protocols_explicit.py:27:16 - error: Method "draw" cannot be called because it is abstract and unimplemented (reportAbstractUsage) protocols_explicit.py:56:32 - error: Cannot assign to attribute "rgb" for class "Point*"   "str" is incompatible with "int" (reportAttributeAccessIssue) -protocols_explicit.py:59:5 - error: Cannot instantiate abstract class "Point" -  "RGB.other" is not implemented +protocols_explicit.py:60:5 - error: Cannot instantiate abstract class "Point"   "RGB.intensity" is not implemented -  and 1 more... (reportAbstractUsage) -protocols_explicit.py:86:6 - error: Cannot instantiate abstract class "Concrete1" -  "Proto1.cm1" is not implemented -  "Proto1.im1" is not implemented (reportAbstractUsage) -protocols_explicit.py:104:6 - error: Cannot instantiate abstract class "Concrete3" -  "Proto2.cm10" is not implemented -  "Proto3.cm11" is not implemented -  and 1 more... (reportAbstractUsage) -protocols_explicit.py:129:6 - error: Cannot instantiate abstract class "Concrete5" +  "RGB.transparency" is not implemented (reportAbstractUsage) +protocols_explicit.py:85:14 - error: Cannot assign to attribute "cm1" for class "Concrete1*" +  Attribute "cm1" cannot be assigned through a class instance because it is a ClassVar +    Attribute "__set__" is unknown (reportAttributeAccessIssue) +protocols_explicit.py:135:6 - error: Cannot instantiate abstract class "Concrete5"   "Proto5.method1" is not implemented (reportAbstractUsage) -protocols_explicit.py:159:7 - error: Cannot instantiate abstract class "Concrete7A" +protocols_explicit.py:165:7 - error: Cannot instantiate abstract class "Concrete7A"   "Proto7.method1" is not implemented (reportAbstractUsage) """ -conformance_automated = "Pass" +conformance_automated = "Fail" errors_diff = """ +Line 90: Expected 1 errors +Line 110: Expected 1 errors +Line 85: Unexpected errors ['protocols_explicit.py:85:14 - error: Cannot assign to attribute "cm1" for class "Concrete1*"'] """ diff --git a/conformance/results/pyright/specialtypes_never.toml b/conformance/results/pyright/specialtypes_never.toml index 51770402b..b72b75c74 100644 --- a/conformance/results/pyright/specialtypes_never.toml +++ b/conformance/results/pyright/specialtypes_never.toml @@ -1,11 +1,11 @@ conformant = "Pass" output = """ specialtypes_never.py:19:22 - error: Function with declared return type "NoReturn" cannot return "None" (reportReturnType) -specialtypes_never.py:82:21 - error: Expression of type "list[Never]" is incompatible with declared type "list[int]" +specialtypes_never.py:86:21 - error: Expression of type "list[Never]" is incompatible with declared type "list[int]"   "list[Never]" is incompatible with "list[int]"     Type parameter "_T@list" is invariant, but "Never" is not the same as "int"     Consider switching from "list" to "Sequence" which is covariant (reportAssignmentType) -specialtypes_never.py:101:12 - error: Expression of type "ClassC[Never]" is incompatible with return type "ClassC[U@func10]" +specialtypes_never.py:105:12 - error: Expression of type "ClassC[Never]" is incompatible with return type "ClassC[U@func10]"   "ClassC[Never]" is incompatible with "ClassC[U@func10]"     Type parameter "T@ClassC" is invariant, but "Never" is not the same as "U@func10" (reportReturnType) """ diff --git a/conformance/results/pyright/typeddicts_required.toml b/conformance/results/pyright/typeddicts_required.toml index 874099f4d..4205fdffe 100644 --- a/conformance/results/pyright/typeddicts_required.toml +++ b/conformance/results/pyright/typeddicts_required.toml @@ -1,10 +1,13 @@ conformant = "Pass" output = """ typeddicts_required.py:12:8 - error: "Required" is not allowed in this context -typeddicts_required.py:16:8 - error: "NotRequired" is not allowed in this context -typeddicts_required.py:59:8 - error: "Required" is not allowed in this context -typeddicts_required.py:60:8 - error: "Required" is not allowed in this context +typeddicts_required.py:15:18 - error: Cannot assign to attribute "x" for class "NotTypedDict*" +  "int" is incompatible with "Required[int]" (reportAttributeAccessIssue) +typeddicts_required.py:19:8 - error: "NotRequired" is not allowed in this context +typeddicts_required.py:62:8 - error: "Required" is not allowed in this context +typeddicts_required.py:63:8 - error: "Required" is not allowed in this context """ -conformance_automated = "Pass" +conformance_automated = "Fail" errors_diff = """ +Line 15: Unexpected errors ['typeddicts_required.py:15:18 - error: Cannot assign to attribute "x" for class "NotTypedDict*"'] """ diff --git a/conformance/results/pyright/version.toml b/conformance/results/pyright/version.toml index 95d61e3ae..b3946bc45 100644 --- a/conformance/results/pyright/version.toml +++ b/conformance/results/pyright/version.toml @@ -1,2 +1,2 @@ version = "pyright 1.1.371" -test_duration = 1.4 +test_duration = 1.5 diff --git a/conformance/results/pytype/annotations_forward_refs.toml b/conformance/results/pytype/annotations_forward_refs.toml index c9373b7cc..016f08a29 100644 --- a/conformance/results/pytype/annotations_forward_refs.toml +++ b/conformance/results/pytype/annotations_forward_refs.toml @@ -25,8 +25,8 @@ File "annotations_forward_refs.py", line 80, in ClassD: Name 'ClassF' is not def File "annotations_forward_refs.py", line 82, in ClassD: Invalid type annotation '' for str [invalid-annotation] File "annotations_forward_refs.py", line 87, in ClassD: Invalid type annotation '' for x [invalid-annotation] File "annotations_forward_refs.py", line 89, in ClassD: Invalid type annotation '' for y [invalid-annotation] -File "annotations_forward_refs.py", line 93, in : Any [assert-type] -File "annotations_forward_refs.py", line 100, in : unexpected indent [python-compiler-error] +File "annotations_forward_refs.py", line 96, in : Any [assert-type] +File "annotations_forward_refs.py", line 103, in : unexpected indent [python-compiler-error] """ conformance_automated = "Fail" errors_diff = """ @@ -48,6 +48,6 @@ Line 55: Expected 1 errors Line 40: Unexpected errors ['File "annotations_forward_refs.py", line 40, in : invalid syntax [python-compiler-error]', 'File "annotations_forward_refs.py", line 40, in : Invalid type annotation \\'{}\\' for p5 [invalid-annotation]', 'File "annotations_forward_refs.py", line 40, in : Invalid type annotation \\'[int, str]\\' for p2 [invalid-annotation]', 'File "annotations_forward_refs.py", line 40, in : Invalid type annotation \\'True\\' for p10 [invalid-annotation]', 'File "annotations_forward_refs.py", line 40, in : Invalid type annotation \\'\\' for p15 [invalid-annotation]', 'File "annotations_forward_refs.py", line 40, in : Invalid type annotation \\'\\' for p4 [invalid-annotation]', 'File "annotations_forward_refs.py", line 40, in : Invalid type annotation \\'1\\' for p9 [invalid-annotation]', 'File "annotations_forward_refs.py", line 40, in : Invalid type annotation \\'1\\' for p11 [invalid-annotation]', 'File "annotations_forward_refs.py", line 40, in : Invalid type annotation \\'-1\\' for p12 [invalid-annotation]', 'File "annotations_forward_refs.py", line 40, in : Invalid type annotation \\'(int, str)\\' for p3 [invalid-annotation]'] Line 82: Unexpected errors ['File "annotations_forward_refs.py", line 82, in ClassD: Invalid type annotation \\'\\' for str [invalid-annotation]'] Line 87: Unexpected errors ['File "annotations_forward_refs.py", line 87, in ClassD: Invalid type annotation \\'\\' for x [invalid-annotation]'] -Line 93: Unexpected errors ['File "annotations_forward_refs.py", line 93, in : Any [assert-type]'] -Line 100: Unexpected errors ['File "annotations_forward_refs.py", line 100, in : unexpected indent [python-compiler-error]'] +Line 96: Unexpected errors ['File "annotations_forward_refs.py", line 96, in : Any [assert-type]'] +Line 103: Unexpected errors ['File "annotations_forward_refs.py", line 103, in : unexpected indent [python-compiler-error]'] """ diff --git a/conformance/results/pytype/classes_classvar.toml b/conformance/results/pytype/classes_classvar.toml index 409a82889..c79f592cb 100644 --- a/conformance/results/pytype/classes_classvar.toml +++ b/conformance/results/pytype/classes_classvar.toml @@ -23,8 +23,8 @@ File "classes_classvar.py", line 52, in ClassA: Type annotation for bad8 does no File "classes_classvar.py", line 60, in ClassA: Type annotation for good4 does not match type of assignment [annotation-type-mismatch] File "classes_classvar.py", line 68, in method2: bad return type [bad-return-type] File "classes_classvar.py", line 78, in : ClassVar [assert-type] -File "classes_classvar.py", line 121, in ProtoA: Type annotation for z does not match type of assignment [annotation-type-mismatch] -File "classes_classvar.py", line 131, in : Type annotation for a does not match type of assignment [annotation-type-mismatch] +File "classes_classvar.py", line 124, in ProtoA: Type annotation for z does not match type of assignment [annotation-type-mismatch] +File "classes_classvar.py", line 134, in : Type annotation for a does not match type of assignment [annotation-type-mismatch] """ conformance_automated = "Fail" errors_diff = """ @@ -39,11 +39,11 @@ Line 65: Expected 1 errors Line 67: Expected 1 errors Line 71: Expected 1 errors Line 72: Expected 1 errors -Line 102: Expected 1 errors +Line 105: Expected 1 errors Line 7: Unexpected errors ['File "classes_classvar.py", line 7, in : typing.TypeVarTuple not supported yet [not-supported-yet]'] Line 29: Unexpected errors ['File "classes_classvar.py", line 29, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] Line 60: Unexpected errors ['File "classes_classvar.py", line 60, in ClassA: Type annotation for good4 does not match type of assignment [annotation-type-mismatch]'] Line 68: Unexpected errors ['File "classes_classvar.py", line 68, in method2: bad return type [bad-return-type]'] Line 78: Unexpected errors ['File "classes_classvar.py", line 78, in : ClassVar [assert-type]'] -Line 121: Unexpected errors ['File "classes_classvar.py", line 121, in ProtoA: Type annotation for z does not match type of assignment [annotation-type-mismatch]'] +Line 124: Unexpected errors ['File "classes_classvar.py", line 124, in ProtoA: Type annotation for z does not match type of assignment [annotation-type-mismatch]'] """ diff --git a/conformance/results/pytype/dataclasses_transform_class.toml b/conformance/results/pytype/dataclasses_transform_class.toml index c68dac896..8d25adeb7 100644 --- a/conformance/results/pytype/dataclasses_transform_class.toml +++ b/conformance/results/pytype/dataclasses_transform_class.toml @@ -4,22 +4,22 @@ Does not understand @dataclass_transform. """ output = """ File "dataclasses_transform_class.py", line 23, in : Arguments to dataclass_transform not supported yet [not-supported-yet] -File "dataclasses_transform_class.py", line 57, in : Invalid keyword argument other_name to function Customer1.__init__ [wrong-keyword-args] -File "dataclasses_transform_class.py", line 82, in : Arguments to dataclass_transform not supported yet [not-supported-yet] -File "dataclasses_transform_class.py", line 103, in : Invalid keyword argument id to function GenericCustomer.__init__ [wrong-keyword-args] -File "dataclasses_transform_class.py", line 106, in : Arguments to dataclass_transform not supported yet [not-supported-yet] +File "dataclasses_transform_class.py", line 60, in : Invalid keyword argument other_name to function Customer1.__init__ [wrong-keyword-args] +File "dataclasses_transform_class.py", line 85, in : Arguments to dataclass_transform not supported yet [not-supported-yet] +File "dataclasses_transform_class.py", line 106, in : Invalid keyword argument id to function GenericCustomer.__init__ [wrong-keyword-args] +File "dataclasses_transform_class.py", line 109, in : Arguments to dataclass_transform not supported yet [not-supported-yet] """ conformance_automated = "Fail" errors_diff = """ -Line 48: Expected 1 errors -Line 60: Expected 1 errors +Line 51: Expected 1 errors Line 63: Expected 1 errors -Line 69: Expected 1 errors -Line 79: Expected 1 errors -Line 119: Expected 1 errors +Line 66: Expected 1 errors +Line 72: Expected 1 errors +Line 82: Expected 1 errors +Line 122: Expected 1 errors Line 23: Unexpected errors ['File "dataclasses_transform_class.py", line 23, in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] -Line 57: Unexpected errors ['File "dataclasses_transform_class.py", line 57, in : Invalid keyword argument other_name to function Customer1.__init__ [wrong-keyword-args]'] -Line 82: Unexpected errors ['File "dataclasses_transform_class.py", line 82, in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] -Line 103: Unexpected errors ['File "dataclasses_transform_class.py", line 103, in : Invalid keyword argument id to function GenericCustomer.__init__ [wrong-keyword-args]'] -Line 106: Unexpected errors ['File "dataclasses_transform_class.py", line 106, in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] +Line 60: Unexpected errors ['File "dataclasses_transform_class.py", line 60, in : Invalid keyword argument other_name to function Customer1.__init__ [wrong-keyword-args]'] +Line 85: Unexpected errors ['File "dataclasses_transform_class.py", line 85, in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] +Line 106: Unexpected errors ['File "dataclasses_transform_class.py", line 106, in : Invalid keyword argument id to function GenericCustomer.__init__ [wrong-keyword-args]'] +Line 109: Unexpected errors ['File "dataclasses_transform_class.py", line 109, in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] """ diff --git a/conformance/results/pytype/dataclasses_transform_meta.toml b/conformance/results/pytype/dataclasses_transform_meta.toml index e89e4f407..bf8168419 100644 --- a/conformance/results/pytype/dataclasses_transform_meta.toml +++ b/conformance/results/pytype/dataclasses_transform_meta.toml @@ -4,18 +4,18 @@ Does not understand @dataclass_transform. """ output = """ File "dataclasses_transform_meta.py", line 21, in : Arguments to dataclass_transform not supported yet [not-supported-yet] -File "dataclasses_transform_meta.py", line 57, in : Invalid keyword argument other_name to function Customer1.__init__ [wrong-keyword-args] -File "dataclasses_transform_meta.py", line 83, in : Arguments to dataclass_transform not supported yet [not-supported-yet] +File "dataclasses_transform_meta.py", line 60, in : Invalid keyword argument other_name to function Customer1.__init__ [wrong-keyword-args] +File "dataclasses_transform_meta.py", line 86, in : Arguments to dataclass_transform not supported yet [not-supported-yet] """ conformance_automated = "Fail" errors_diff = """ -Line 48: Expected 1 errors -Line 60: Expected 1 errors +Line 51: Expected 1 errors Line 63: Expected 1 errors -Line 70: Expected 1 errors -Line 80: Expected 1 errors -Line 100: Expected 1 errors +Line 66: Expected 1 errors +Line 73: Expected 1 errors +Line 83: Expected 1 errors +Line 103: Expected 1 errors Line 21: Unexpected errors ['File "dataclasses_transform_meta.py", line 21, in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] -Line 57: Unexpected errors ['File "dataclasses_transform_meta.py", line 57, in : Invalid keyword argument other_name to function Customer1.__init__ [wrong-keyword-args]'] -Line 83: Unexpected errors ['File "dataclasses_transform_meta.py", line 83, in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] +Line 60: Unexpected errors ['File "dataclasses_transform_meta.py", line 60, in : Invalid keyword argument other_name to function Customer1.__init__ [wrong-keyword-args]'] +Line 86: Unexpected errors ['File "dataclasses_transform_meta.py", line 86, in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] """ diff --git a/conformance/results/pytype/dataclasses_usage.toml b/conformance/results/pytype/dataclasses_usage.toml index 02ba41ee1..6690e24d5 100644 --- a/conformance/results/pytype/dataclasses_usage.toml +++ b/conformance/results/pytype/dataclasses_usage.toml @@ -8,9 +8,9 @@ File "dataclasses_usage.py", line 64, in : In method __init__, non-defau File "dataclasses_usage.py", line 70, in : In method __init__, non-default argument b follows default argument [invalid-function-definition] File "dataclasses_usage.py", line 83, in : Function DC4.__init__ expects 2 arg(s), got 3 [wrong-arg-count] File "dataclasses_usage.py", line 88, in DC5: Type annotation for a does not match type of assignment [annotation-type-mismatch] -File "dataclasses_usage.py", line 126, in : Function DC7.__init__ expects 2 arg(s), got 3 [wrong-arg-count] -File "dataclasses_usage.py", line 129, in : Missing parameter 'y' in call to function DC8.__init__ [missing-parameter] -File "dataclasses_usage.py", line 178, in : Function DC13.__init__ expects 1 arg(s), got 2 [wrong-arg-count] +File "dataclasses_usage.py", line 127, in : Function DC7.__init__ expects 2 arg(s), got 3 [wrong-arg-count] +File "dataclasses_usage.py", line 130, in : Missing parameter 'y' in call to function DC8.__init__ [missing-parameter] +File "dataclasses_usage.py", line 179, in : Function DC13.__init__ expects 1 arg(s), got 2 [wrong-arg-count] """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pytype/enums_members.toml b/conformance/results/pytype/enums_members.toml index 3d3967c88..000700425 100644 --- a/conformance/results/pytype/enums_members.toml +++ b/conformance/results/pytype/enums_members.toml @@ -6,34 +6,35 @@ Does not support `_ignore_` mechanism (optional). """ conformance_automated = "Fail" errors_diff = """ -Line 46: Expected 1 errors -Line 112: Expected 1 errors -Line 125: Expected 1 errors +Line 50: Expected 1 errors +Line 116: Expected 1 errors +Line 129: Expected 1 errors Line 7: Unexpected errors ['File "enums_members.py", line 7, in : enum.nonmember not supported yet [not-supported-yet]', 'File "enums_members.py", line 7, in : enum.member not supported yet [not-supported-yet]'] -Line 31: Unexpected errors ['File "enums_members.py", line 31, in : _enums_members.Pet2 [assert-type]'] -Line 32: Unexpected errors ['File "enums_members.py", line 32, in : _enums_members.Pet2 [assert-type]'] -Line 103: Unexpected errors ['File "enums_members.py", line 103, in Example: Function enum.member expects 0 arg(s), got 1 [wrong-arg-count]'] -Line 104: Unexpected errors ['File "enums_members.py", line 104, in Example: Function enum.nonmember expects 0 arg(s), got 1 [wrong-arg-count]'] -Line 106: Unexpected errors ['File "enums_members.py", line 106, in Example: Function enum.member expects 0 arg(s), got 1 [wrong-arg-count]'] -Line 124: Unexpected errors ['File "enums_members.py", line 124, in method: Example2 [reveal-type]'] +Line 35: Unexpected errors ['File "enums_members.py", line 35, in : _enums_members.Pet2 [assert-type]'] +Line 36: Unexpected errors ['File "enums_members.py", line 36, in : _enums_members.Pet2 [assert-type]'] +Line 107: Unexpected errors ['File "enums_members.py", line 107, in Example: Function enum.member expects 0 arg(s), got 1 [wrong-arg-count]'] +Line 108: Unexpected errors ['File "enums_members.py", line 108, in Example: Function enum.nonmember expects 0 arg(s), got 1 [wrong-arg-count]'] +Line 110: Unexpected errors ['File "enums_members.py", line 110, in Example: Function enum.member expects 0 arg(s), got 1 [wrong-arg-count]'] +Line 128: Unexpected errors ['File "enums_members.py", line 128, in method: Example2 [reveal-type]'] """ output = """ File "enums_members.py", line 7, in : enum.nonmember not supported yet [not-supported-yet] File "enums_members.py", line 7, in : enum.member not supported yet [not-supported-yet] -File "enums_members.py", line 31, in : _enums_members.Pet2 [assert-type] -File "enums_members.py", line 32, in : _enums_members.Pet2 [assert-type] -File "enums_members.py", line 78, in : Invalid type annotation 'Literal' [invalid-annotation] -File "enums_members.py", line 78, in : Callable[[Any], Any] [assert-type] -File "enums_members.py", line 79, in : Invalid type annotation 'Literal' [invalid-annotation] -File "enums_members.py", line 79, in : Callable[[int], int] [assert-type] -File "enums_members.py", line 80, in : property [assert-type] -File "enums_members.py", line 80, in : Invalid type annotation 'Literal' [invalid-annotation] -File "enums_members.py", line 81, in : Invalid type annotation 'Literal' [invalid-annotation] -File "enums_members.py", line 81, in : Callable[[Any], None] [assert-type] -File "enums_members.py", line 103, in Example: Function enum.member expects 0 arg(s), got 1 [wrong-arg-count] -File "enums_members.py", line 104, in Example: Function enum.nonmember expects 0 arg(s), got 1 [wrong-arg-count] -File "enums_members.py", line 106, in Example: Function enum.member expects 0 arg(s), got 1 [wrong-arg-count] -File "enums_members.py", line 124, in method: Example2 [reveal-type] -File "enums_members.py", line 142, in : Pet5 [assert-type] -File "enums_members.py", line 143, in : Pet5 [assert-type] +File "enums_members.py", line 15, in : Function Pet.__init__ was called with the wrong arguments [wrong-arg-types] +File "enums_members.py", line 35, in : _enums_members.Pet2 [assert-type] +File "enums_members.py", line 36, in : _enums_members.Pet2 [assert-type] +File "enums_members.py", line 82, in : Invalid type annotation 'Literal' [invalid-annotation] +File "enums_members.py", line 82, in : Callable[[Any], Any] [assert-type] +File "enums_members.py", line 83, in : Invalid type annotation 'Literal' [invalid-annotation] +File "enums_members.py", line 83, in : Callable[[int], int] [assert-type] +File "enums_members.py", line 84, in : property [assert-type] +File "enums_members.py", line 84, in : Invalid type annotation 'Literal' [invalid-annotation] +File "enums_members.py", line 85, in : Invalid type annotation 'Literal' [invalid-annotation] +File "enums_members.py", line 85, in : Callable[[Any], None] [assert-type] +File "enums_members.py", line 107, in Example: Function enum.member expects 0 arg(s), got 1 [wrong-arg-count] +File "enums_members.py", line 108, in Example: Function enum.nonmember expects 0 arg(s), got 1 [wrong-arg-count] +File "enums_members.py", line 110, in Example: Function enum.member expects 0 arg(s), got 1 [wrong-arg-count] +File "enums_members.py", line 128, in method: Example2 [reveal-type] +File "enums_members.py", line 146, in : Pet5 [assert-type] +File "enums_members.py", line 147, in : Pet5 [assert-type] """ diff --git a/conformance/results/pytype/generics_scoping.toml b/conformance/results/pytype/generics_scoping.toml index a31965cd4..ec46810e8 100644 --- a/conformance/results/pytype/generics_scoping.toml +++ b/conformance/results/pytype/generics_scoping.toml @@ -10,15 +10,17 @@ File "generics_scoping.py", line 54, in Bar: Invalid type annotation 'List[S]' f File "generics_scoping.py", line 63, in fun_4: Invalid type annotation 'T' [invalid-annotation] File "generics_scoping.py", line 74, in : Invalid type annotation 'Outer' [invalid-annotation] File "generics_scoping.py", line 78, in AlsoBad: Invalid type annotation 'List[T]' for x [invalid-annotation] -File "generics_scoping.py", line 88, in : Invalid type annotation 'T' for global_var1 [invalid-annotation] -File "generics_scoping.py", line 89, in : Invalid type annotation 'List[T]' for global_var2 [invalid-annotation] +File "generics_scoping.py", line 80, in AlsoBad: Invalid type annotation 'T' [invalid-annotation] +File "generics_scoping.py", line 94, in : Invalid type annotation 'T' for global_var1 [invalid-annotation] +File "generics_scoping.py", line 95, in : Invalid type annotation 'List[T]' for global_var2 [invalid-annotation] """ conformance_automated = "Fail" errors_diff = """ Line 65: Expected 1 errors Line 75: Expected 1 errors -Line 84: Expected 1 errors -Line 90: Expected 1 errors +Line 87: Expected 1 errors +Line 96: Expected 1 errors Line 63: Unexpected errors ['File "generics_scoping.py", line 63, in fun_4: Invalid type annotation \\'T\\' [invalid-annotation]'] Line 74: Unexpected errors ['File "generics_scoping.py", line 74, in : Invalid type annotation \\'Outer\\' [invalid-annotation]'] +Line 80: Unexpected errors ['File "generics_scoping.py", line 80, in AlsoBad: Invalid type annotation \\'T\\' [invalid-annotation]'] """ diff --git a/conformance/results/pytype/generics_self_basic.toml b/conformance/results/pytype/generics_self_basic.toml index f56e7ede2..717547ba0 100644 --- a/conformance/results/pytype/generics_self_basic.toml +++ b/conformance/results/pytype/generics_self_basic.toml @@ -14,14 +14,14 @@ File "generics_self_basic.py", line 27, in from_config: Type[Circle] [assert-typ Called from (traceback): line 55, in current file File "generics_self_basic.py", line 40, in difference: Shape [assert-type] -File "generics_self_basic.py", line 61, in set_value: bad return type [bad-return-type] +File "generics_self_basic.py", line 64, in set_value: bad return type [bad-return-type] Called from (traceback): - line 72, in object_with_concrete_type -File "generics_self_basic.py", line 61, in set_value: bad return type [bad-return-type] + line 75, in object_with_concrete_type +File "generics_self_basic.py", line 64, in set_value: bad return type [bad-return-type] Called from (traceback): - line 71, in object_with_concrete_type -File "generics_self_basic.py", line 61, in set_value: bad return type [bad-return-type] -File "generics_self_basic.py", line 64, in Container: unsupported operand type(s) for item retrieval: 'Self: TypeVar' and 'int: Type[int]' [unsupported-operands] + line 74, in object_with_concrete_type +File "generics_self_basic.py", line 64, in set_value: bad return type [bad-return-type] +File "generics_self_basic.py", line 67, in Container: unsupported operand type(s) for item retrieval: 'Self: TypeVar' and 'int: Type[int]' [unsupported-operands] """ conformance_automated = "Fail" errors_diff = """ @@ -30,5 +30,5 @@ Line 33: Expected 1 errors Line 14: Unexpected errors ['File "generics_self_basic.py", line 14, in set_scale: Shape [assert-type]', 'File "generics_self_basic.py", line 14, in set_scale: Circle [assert-type]'] Line 27: Unexpected errors ['File "generics_self_basic.py", line 27, in from_config: Type[Shape] [assert-type]', 'File "generics_self_basic.py", line 27, in from_config: Type[Circle] [assert-type]'] Line 40: Unexpected errors ['File "generics_self_basic.py", line 40, in difference: Shape [assert-type]'] -Line 61: Unexpected errors ['File "generics_self_basic.py", line 61, in set_value: bad return type [bad-return-type]', 'File "generics_self_basic.py", line 61, in set_value: bad return type [bad-return-type]', 'File "generics_self_basic.py", line 61, in set_value: bad return type [bad-return-type]'] +Line 64: Unexpected errors ['File "generics_self_basic.py", line 64, in set_value: bad return type [bad-return-type]', 'File "generics_self_basic.py", line 64, in set_value: bad return type [bad-return-type]', 'File "generics_self_basic.py", line 64, in set_value: bad return type [bad-return-type]'] """ diff --git a/conformance/results/pytype/generics_type_erasure.toml b/conformance/results/pytype/generics_type_erasure.toml index c49e01d34..ac5e34ce1 100644 --- a/conformance/results/pytype/generics_type_erasure.toml +++ b/conformance/results/pytype/generics_type_erasure.toml @@ -4,11 +4,11 @@ NotImplementedError: ParameterizedClass """ conformance_automated = "Fail" errors_diff = """ -Line 36: Expected 1 errors Line 38: Expected 1 errors Line 40: Expected 1 errors -Line 41: Expected 1 errors Line 42: Expected 1 errors Line 43: Expected 1 errors Line 44: Expected 1 errors +Line 45: Expected 1 errors +Line 46: Expected 1 errors """ diff --git a/conformance/results/pytype/protocols_class_objects.toml b/conformance/results/pytype/protocols_class_objects.toml index 7efa307ad..47965b7e5 100644 --- a/conformance/results/pytype/protocols_class_objects.toml +++ b/conformance/results/pytype/protocols_class_objects.toml @@ -6,6 +6,7 @@ Fails to report some class objects as incompatible with a protocol. """ output = """ File "protocols_class_objects.py", line 50, in method1: bad return type [bad-return-type] +File "protocols_class_objects.py", line 100, in : Function CMeta.__init__ was called with the wrong arguments [wrong-arg-types] """ conformance_automated = "Fail" errors_diff = """ @@ -13,9 +14,10 @@ Line 29: Expected 1 errors Line 34: Expected 1 errors Line 58: Expected 1 errors Line 74: Expected 1 errors -Line 101: Expected 1 errors -Line 103: Expected 1 errors Line 104: Expected 1 errors -Line 105: Expected 1 errors +Line 106: Expected 1 errors +Line 107: Expected 1 errors +Line 108: Expected 1 errors Line 50: Unexpected errors ['File "protocols_class_objects.py", line 50, in method1: bad return type [bad-return-type]'] +Line 100: Unexpected errors ['File "protocols_class_objects.py", line 100, in : Function CMeta.__init__ was called with the wrong arguments [wrong-arg-types]'] """ diff --git a/conformance/results/pytype/protocols_explicit.toml b/conformance/results/pytype/protocols_explicit.toml index 0cbb6f139..8432b87e8 100644 --- a/conformance/results/pytype/protocols_explicit.toml +++ b/conformance/results/pytype/protocols_explicit.toml @@ -10,15 +10,15 @@ output = """ File "protocols_explicit.py", line 14, in draw: bad return type [bad-return-type] Called from (traceback): line 27, in draw -File "protocols_explicit.py", line 59, in : Can't instantiate Point with abstract methods intensity [not-instantiable] -File "protocols_explicit.py", line 159, in : Can't instantiate Concrete7A with abstract methods method1 [not-instantiable] +File "protocols_explicit.py", line 60, in : Can't instantiate Point with abstract methods intensity [not-instantiable] +File "protocols_explicit.py", line 165, in : Can't instantiate Concrete7A with abstract methods method1 [not-instantiable] """ conformance_automated = "Fail" errors_diff = """ Line 27: Expected 1 errors Line 56: Expected 1 errors -Line 86: Expected 1 errors -Line 104: Expected 1 errors -Line 129: Expected 1 errors +Line 90: Expected 1 errors +Line 110: Expected 1 errors +Line 135: Expected 1 errors Line 14: Unexpected errors ['File "protocols_explicit.py", line 14, in draw: bad return type [bad-return-type]'] """ diff --git a/conformance/results/pytype/specialtypes_never.toml b/conformance/results/pytype/specialtypes_never.toml index b2cb37252..bb2352598 100644 --- a/conformance/results/pytype/specialtypes_never.toml +++ b/conformance/results/pytype/specialtypes_never.toml @@ -5,18 +5,18 @@ Does not understand NoReturn or Never. output = """ File "specialtypes_never.py", line 11, in : argument "covariant" to TypeVar not supported yet [not-supported-yet] File "specialtypes_never.py", line 21, in func1: bad return type [bad-return-type] -File "specialtypes_never.py", line 64, in func6: Type annotation for v1 does not match type of assignment [annotation-type-mismatch] -File "specialtypes_never.py", line 65, in func6: Type annotation for v2 does not match type of assignment [annotation-type-mismatch] -File "specialtypes_never.py", line 66, in func6: Type annotation for v3 does not match type of assignment [annotation-type-mismatch] -File "specialtypes_never.py", line 82, in func8: Type annotation for v3 does not match type of assignment [annotation-type-mismatch] +File "specialtypes_never.py", line 68, in func6: Type annotation for v1 does not match type of assignment [annotation-type-mismatch] +File "specialtypes_never.py", line 69, in func6: Type annotation for v2 does not match type of assignment [annotation-type-mismatch] +File "specialtypes_never.py", line 70, in func6: Type annotation for v3 does not match type of assignment [annotation-type-mismatch] +File "specialtypes_never.py", line 86, in func8: Type annotation for v3 does not match type of assignment [annotation-type-mismatch] """ conformance_automated = "Fail" errors_diff = """ Line 19: Expected 1 errors -Line 101: Expected 1 errors +Line 105: Expected 1 errors Line 11: Unexpected errors ['File "specialtypes_never.py", line 11, in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] Line 21: Unexpected errors ['File "specialtypes_never.py", line 21, in func1: bad return type [bad-return-type]'] -Line 64: Unexpected errors ['File "specialtypes_never.py", line 64, in func6: Type annotation for v1 does not match type of assignment [annotation-type-mismatch]'] -Line 65: Unexpected errors ['File "specialtypes_never.py", line 65, in func6: Type annotation for v2 does not match type of assignment [annotation-type-mismatch]'] -Line 66: Unexpected errors ['File "specialtypes_never.py", line 66, in func6: Type annotation for v3 does not match type of assignment [annotation-type-mismatch]'] +Line 68: Unexpected errors ['File "specialtypes_never.py", line 68, in func6: Type annotation for v1 does not match type of assignment [annotation-type-mismatch]'] +Line 69: Unexpected errors ['File "specialtypes_never.py", line 69, in func6: Type annotation for v2 does not match type of assignment [annotation-type-mismatch]'] +Line 70: Unexpected errors ['File "specialtypes_never.py", line 70, in func6: Type annotation for v3 does not match type of assignment [annotation-type-mismatch]'] """ diff --git a/conformance/results/pytype/typeddicts_class_syntax.toml b/conformance/results/pytype/typeddicts_class_syntax.toml index c6ebfda80..8b43fddd6 100644 --- a/conformance/results/pytype/typeddicts_class_syntax.toml +++ b/conformance/results/pytype/typeddicts_class_syntax.toml @@ -5,7 +5,7 @@ Does not report when metaclass is provided. Does not report when other keyword argument is provided. """ output = """ - +File "typeddicts_class_syntax.py", line 57, in : Invalid base class: Generic[T] [base-class-error] """ conformance_automated = "Fail" errors_diff = """ @@ -14,4 +14,5 @@ Line 33: Expected 1 errors Line 38: Expected 1 errors Line 44: Expected 1 errors Line 49: Expected 1 errors +Line 57: Unexpected errors ['File "typeddicts_class_syntax.py", line 57, in : Invalid base class: Generic[T] [base-class-error]'] """ diff --git a/conformance/results/pytype/typeddicts_required.toml b/conformance/results/pytype/typeddicts_required.toml index 117006670..ff1737fd6 100644 --- a/conformance/results/pytype/typeddicts_required.toml +++ b/conformance/results/pytype/typeddicts_required.toml @@ -10,7 +10,7 @@ RecursionError: maximum recursion depth exceeded conformance_automated = "Fail" errors_diff = """ Line 12: Expected 1 errors -Line 16: Expected 1 errors -Line 59: Expected 1 errors -Line 60: Expected 1 errors +Line 19: Expected 1 errors +Line 62: Expected 1 errors +Line 63: Expected 1 errors """ diff --git a/conformance/results/pytype/version.toml b/conformance/results/pytype/version.toml index 3d4b9cdd9..f93298567 100644 --- a/conformance/results/pytype/version.toml +++ b/conformance/results/pytype/version.toml @@ -1,2 +1,2 @@ version = "pytype 2024.04.11" -test_duration = 31.4 +test_duration = 34.2 diff --git a/conformance/results/results.html b/conformance/results/results.html index b7b4ebd80..bd5dd6d22 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -159,16 +159,16 @@

Python Type System Conformance Test Results

- + @@ -318,12 +318,7 @@

Python Type System Conformance Test Results

  • Prefers to resolve forward references in classes outside of the class instead of end-of-scope
  • - + @@ -355,12 +350,7 @@

    Python Type System Conformance Test Results

  • Prefers to resolve forward references in classes outside of the class instead of end-of-scope
  • - + @@ -416,7 +406,7 @@

    Python Type System Conformance Test Results

    - + @@ -1161,12 +1151,7 @@

    Python Type System Conformance Test Results

    - + @@ -1214,7 +1199,7 @@

    Python Type System Conformance Test Results

    - + @@ -1558,7 +1543,6 @@

    Python Type System Conformance Test Results

    Partial
    • Does not reject invalid argument types to an inherited constructor in a specialized subclass of a generic superclass.
    • -
    • Does not reject class-scoped type variables used in the self annotation.
    @@ -2603,7 +2587,7 @@

    Python Type System Conformance Test Results

    - + diff --git a/conformance/results/ty/aliases_recursive.toml b/conformance/results/ty/aliases_recursive.toml index fb46159ed..c7e470092 100644 --- a/conformance/results/ty/aliases_recursive.toml +++ b/conformance/results/ty/aliases_recursive.toml @@ -1,11 +1,5 @@ -conformance_automated = "Fail" -conformant = "Partial" -notes = """ -Does not reject invalid cyclic type alias definitions. -""" +conformance_automated = "Pass" errors_diff = """ -Line 72: Expected 1 errors -Line 75: Expected 1 errors """ output = """ aliases_recursive.py:19:12: error[invalid-assignment] Object of type `dict[str, None | complex | str | list[Json] | dict[str, Json]]` is not assignable to `Json` @@ -17,4 +11,7 @@ aliases_recursive.py:51:24: error[invalid-assignment] Object of type `dict[str, aliases_recursive.py:52:24: error[invalid-assignment] Object of type `dict[str, str | int | dict[str, str | int | list[int]]]` is not assignable to `RecursiveMapping` aliases_recursive.py:63:30: error[invalid-assignment] Object of type `list[list[GenericTypeAlias1[str] | str] | str | list[list[GenericTypeAlias1[str] | str] | str | float]]` is not assignable to `GenericTypeAlias1[str]` aliases_recursive.py:69:35: error[invalid-assignment] Object of type `list[list[GenericTypeAlias2[str, int] | str | int] | str | int | list[list[GenericTypeAlias2[str, int] | str | int] | str | int | list[list[GenericTypeAlias2[str, int] | str | int] | str | int | list[list[GenericTypeAlias2[str, int] | str | int] | str | float]]]]` is not assignable to `GenericTypeAlias2[str, int]` +aliases_recursive.py:72:29: error[cyclic-type-alias-definition] Type alias `RecursiveUnion` has a circular definition +aliases_recursive.py:75:31: error[cyclic-type-alias-definition] Type alias `MutualReference1` has a circular definition +aliases_recursive.py:75:93: error[cyclic-type-alias-definition] Type alias `MutualReference2` has a circular definition """ diff --git a/conformance/results/ty/aliases_type_statement.toml b/conformance/results/ty/aliases_type_statement.toml index 85594fb95..ecf347637 100644 --- a/conformance/results/ty/aliases_type_statement.toml +++ b/conformance/results/ty/aliases_type_statement.toml @@ -24,8 +24,8 @@ aliases_type_statement.py:53:23: error[unbound-type-variable] Type variable `V` aliases_type_statement.py:58:17: error[unbound-type-variable] Type variable `T1` is not bound to any outer generic context aliases_type_statement.py:68:27: error[invalid-type-arguments] Type `str` is not assignable to upper bound `int` of type variable `S@RecursiveTypeAlias2` aliases_type_statement.py:70:32: error[invalid-type-arguments] Type `int` is not assignable to upper bound `str` of type variable `T@RecursiveTypeAlias2` -aliases_type_statement.py:73:1: error[cyclic-type-alias-definition] Cyclic definition of `RecursiveTypeAlias3` -aliases_type_statement.py:75:1: error[cyclic-type-alias-definition] Cyclic definition of `RecursiveTypeAlias4` -aliases_type_statement.py:79:1: error[cyclic-type-alias-definition] Cyclic definition of `RecursiveTypeAlias6` -aliases_type_statement.py:80:1: error[cyclic-type-alias-definition] Cyclic definition of `RecursiveTypeAlias7` +aliases_type_statement.py:73:28: error[cyclic-type-alias-definition] Type alias `RecursiveTypeAlias3` has a circular definition +aliases_type_statement.py:75:31: error[cyclic-type-alias-definition] Type alias `RecursiveTypeAlias4` has a circular definition +aliases_type_statement.py:79:28: error[cyclic-type-alias-definition] Type alias `RecursiveTypeAlias6` has a circular definition +aliases_type_statement.py:80:28: error[cyclic-type-alias-definition] Type alias `RecursiveTypeAlias7` has a circular definition """ diff --git a/conformance/results/ty/aliases_typealiastype.toml b/conformance/results/ty/aliases_typealiastype.toml index 702b5e90a..e2814fcc2 100644 --- a/conformance/results/ty/aliases_typealiastype.toml +++ b/conformance/results/ty/aliases_typealiastype.toml @@ -7,10 +7,10 @@ aliases_typealiastype.py:40:21: error[invalid-type-arguments] Type `int` is not aliases_typealiastype.py:43:40: error[invalid-type-alias-type] Type parameter `S` used in the alias value must be included in `type_params` aliases_typealiastype.py:44:40: error[invalid-type-alias-type] Type parameter `S` used in the alias value must be included in `type_params` aliases_typealiastype.py:45:57: error[invalid-type-alias-type] The `type_params` argument to `TypeAliasType` must be a tuple literal -aliases_typealiastype.py:46:40: error[cyclic-type-alias-definition] Cyclic definition of `BadAlias4` -aliases_typealiastype.py:47:40: error[cyclic-type-alias-definition] Cyclic definition of `BadAlias5` -aliases_typealiastype.py:48:40: error[cyclic-type-alias-definition] Cyclic definition of `BadAlias6` -aliases_typealiastype.py:49:40: error[cyclic-type-alias-definition] Cyclic definition of `BadAlias7` +aliases_typealiastype.py:46:40: error[cyclic-type-alias-definition] Type alias `BadAlias4` has a circular definition +aliases_typealiastype.py:47:40: error[cyclic-type-alias-definition] Type alias `BadAlias5` has a circular definition +aliases_typealiastype.py:48:40: error[cyclic-type-alias-definition] Type alias `BadAlias6` has a circular definition +aliases_typealiastype.py:49:40: error[cyclic-type-alias-definition] Type alias `BadAlias7` has a circular definition aliases_typealiastype.py:52:40: error[invalid-type-form] Function calls are not allowed in type expressions aliases_typealiastype.py:53:40: error[invalid-type-form] List literals are not allowed in this context in a type expression aliases_typealiastype.py:54:42: error[invalid-type-form] Tuple literals are not allowed in this context in a type expression diff --git a/conformance/results/ty/annotations_forward_refs.toml b/conformance/results/ty/annotations_forward_refs.toml index 2760eb69d..540dc2823 100644 --- a/conformance/results/ty/annotations_forward_refs.toml +++ b/conformance/results/ty/annotations_forward_refs.toml @@ -1,10 +1,5 @@ -conformance_automated = "Fail" -conformant = "Partial" -notes = """ -Fails to reject `str: "str"` forward references -""" +conformance_automated = "Pass" errors_diff = """ -Line 94: Expected 1 errors """ output = """ annotations_forward_refs.py:22:7: error[unresolved-reference] Name `ClassA` used when not defined @@ -29,6 +24,7 @@ annotations_forward_refs.py:55:11: error[invalid-type-form] Module `types` is no annotations_forward_refs.py:65:26: error[unresolved-reference] Name `ClassB` used when not defined annotations_forward_refs.py:83:13: error[unresolved-reference] Name `ClassInner` used when not defined annotations_forward_refs.py:92:14: error[unresolved-reference] Name `ClassF` used when not defined +annotations_forward_refs.py:94:11: error[invalid-type-form] Variable of type `Literal[""]` is not allowed in a type expression annotations_forward_refs.py:96:9: error[invalid-type-form] Function `int` is not valid in a type expression annotations_forward_refs.py:101:8: error[invalid-type-form] Function `int` is not valid in a type expression annotations_forward_refs.py:103:9: error[invalid-type-form] Function `int` is not valid in a type expression diff --git a/conformance/results/ty/annotations_future_import.toml b/conformance/results/ty/annotations_future_import.toml index 9744d55de..73fabcb97 100644 --- a/conformance/results/ty/annotations_future_import.toml +++ b/conformance/results/ty/annotations_future_import.toml @@ -1,12 +1,8 @@ -conformant = "Partial" -notes = """ -Fails to reject `str: "str"` forward references -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 37: Expected 1 errors """ output = """ +annotations_future_import.py:37:10: error[invalid-type-form] Variable of type `Literal[""]` is not allowed in a type expression annotations_future_import.py:39:8: error[invalid-type-form] Function `int` is not valid in a type expression annotations_future_import.py:44:8: error[invalid-type-form] Function `int` is not valid in a type expression annotations_future_import.py:46:9: error[invalid-type-form] Function `int` is not valid in a type expression diff --git a/conformance/results/ty/constructors_call_init.toml b/conformance/results/ty/constructors_call_init.toml index a0284093b..c6b0eb40a 100644 --- a/conformance/results/ty/constructors_call_init.toml +++ b/conformance/results/ty/constructors_call_init.toml @@ -2,14 +2,14 @@ conformance_automated = "Fail" conformant = "Partial" notes = """ Does not reject invalid argument types to an inherited constructor in a specialized subclass of a generic superclass. -Does not reject class-scoped type variables used in the `self` annotation. """ errors_diff = """ Line 42: Expected 1 errors -Line 107: Expected 1 errors """ output = """ constructors_call_init.py:21:13: error[invalid-argument-type] Argument to `Class1.__init__` is incorrect: Expected `int`, found `float*` constructors_call_init.py:56:1: error[invalid-argument-type] Argument to `Class4.__init__` is incorrect: Expected `Class4[int]`, found `Class4[str]` +constructors_call_init.py:107:32: error[invalid-init-type-variable] First parameter of `__init__` cannot use type variable `T2` from an outer scope +constructors_call_init.py:107:36: error[invalid-init-type-variable] First parameter of `__init__` cannot use type variable `T1` from an outer scope constructors_call_init.py:130:9: error[too-many-positional-arguments] Too many positional arguments to `object.__init__`: expected 1, got 2 """ diff --git a/conformance/results/ty/generics_self_usage.toml b/conformance/results/ty/generics_self_usage.toml index a37756092..2433bb63b 100644 --- a/conformance/results/ty/generics_self_usage.toml +++ b/conformance/results/ty/generics_self_usage.toml @@ -9,7 +9,7 @@ generics_self_usage.py:82:54: error[invalid-type-form] `Self` requires `self: Se generics_self_usage.py:87:16: error[invalid-return-type] Return type does not match returned value: expected `Self@return_concrete_type`, found `Foo3` 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] `Self` cannot be used in a type alias +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 diff --git a/conformance/results/ty/tuples_type_form.toml b/conformance/results/ty/tuples_type_form.toml index 1a50c81a7..1130058d6 100644 --- a/conformance/results/ty/tuples_type_form.toml +++ b/conformance/results/ty/tuples_type_form.toml @@ -7,10 +7,10 @@ tuples_type_form.py:14:6: error[invalid-assignment] Object of type `tuple[Litera tuples_type_form.py:15:6: error[invalid-assignment] Object of type `tuple[Literal[1], Literal[""]]` is not assignable to `tuple[int, int]` tuples_type_form.py:25:7: error[invalid-assignment] Object of type `tuple[Literal[1]]` is not assignable to `tuple[()]` tuples_type_form.py:36:7: error[invalid-assignment] Object of type `tuple[Literal[1], Literal[2], Literal[3], Literal[""]]` is not assignable to `tuple[int, ...]` -tuples_type_form.py:40:6: error[invalid-type-form] Invalid `tuple` specialization: `...` can only be used as the second element in a two-element `tuple` specialization -tuples_type_form.py:41:6: error[invalid-type-form] Invalid `tuple` specialization: `...` can only be used as the second element in a two-element `tuple` specialization -tuples_type_form.py:42:6: error[invalid-type-form] Invalid `tuple` specialization: `...` can only be used as the second element in a two-element `tuple` specialization -tuples_type_form.py:43:6: error[invalid-type-form] Invalid `tuple` specialization: `...` can only be used as the second element in a two-element `tuple` specialization -tuples_type_form.py:44:6: error[invalid-type-form] Invalid `tuple` specialization: `...` cannot be used after an unpacked element -tuples_type_form.py:45:6: error[invalid-type-form] Invalid `tuple` specialization: `...` cannot be used after an unpacked element +tuples_type_form.py:40:22: error[invalid-type-form] Invalid `tuple` specialization: `...` can only be used as the second element in a two-element `tuple` specialization +tuples_type_form.py:41:12: error[invalid-type-form] Invalid `tuple` specialization: `...` can only be used as the second element in a two-element `tuple` specialization +tuples_type_form.py:42:12: error[invalid-type-form] Invalid `tuple` specialization: `...` can only be used as the second element in a two-element `tuple` specialization +tuples_type_form.py:43:17: error[invalid-type-form] Invalid `tuple` specialization: `...` can only be used as the second element in a two-element `tuple` specialization +tuples_type_form.py:44:25: error[invalid-type-form] Invalid `tuple` specialization: `...` cannot be used after an unpacked element +tuples_type_form.py:45:30: error[invalid-type-form] Invalid `tuple` specialization: `...` cannot be used after an unpacked element """ diff --git a/conformance/results/ty/version.toml b/conformance/results/ty/version.toml index f5eb57c7f..8aff9887d 100644 --- a/conformance/results/ty/version.toml +++ b/conformance/results/ty/version.toml @@ -1 +1 @@ -version = "ty 0.0.82" +version = "ty 0.0.83" diff --git a/conformance/uv.lock b/conformance/uv.lock index d067e9036..3c2cecd9b 100644 --- a/conformance/uv.lock +++ b/conformance/uv.lock @@ -202,27 +202,27 @@ wheels = [ [[package]] name = "ty" -version = "0.0.82" +version = "0.0.83" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/f6/df/b9f35d0b8860f1bbfcb852fbef363301b5ca4b5590cadc6f2a810646d579/ty-0.0.82.tar.gz", hash = "sha256:586e3bf784cece42113929bb64b4761bed5c2127ae6cea294bb82da670066356", size = 7325958, upload-time = "2026-09-17T19:42:12.243Z" } +sdist = { url = "https://files.pythonhosted.org/packages/3b/7d/2fd9575bce2d14e2281bec82d0713dee68329b0dc944e9c06c2e36b761fe/ty-0.0.83.tar.gz", hash = "sha256:db118de73c05ac476faceb4d42d59782feaeddfc4d721fd3ae8b807a0a2ae4e4", size = 7373076, upload-time = "2026-09-21T22:47:29.207Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/31/0e/259760638b7b1a875743f1f3975253392932ff74397c8e174df7bfb143c3/ty-0.0.82-py3-none-linux_armv6l.whl", hash = "sha256:be58e089e317e1ada7a655216828e76d369386dc958f7a3b3d455ab6dc7f02b6", size = 13833734, upload-time = "2026-09-17T19:41:35.134Z" }, - { url = "https://files.pythonhosted.org/packages/70/f6/c8a1f70989cf44cf2cada5527e268b4216015a7f28f1d8817e4ef1e84a52/ty-0.0.82-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:c080ba9a816cfbb3e34c0d3a0071829c602d14bb992bc799d885d4b30008b4ab", size = 13449689, upload-time = "2026-09-17T19:41:37.65Z" }, - { url = "https://files.pythonhosted.org/packages/d5/eb/31fc4bdecb2ff0053443d4ec1e6719a3f3171636ad6da7a8a642c879a4f4/ty-0.0.82-py3-none-macosx_11_0_arm64.whl", hash = "sha256:4f08bd5b751c3b2c46eabe8aee890e7fa54e3bcd97ffa4b8338b0a2508d928c2", size = 13410140, upload-time = "2026-09-17T19:41:40.024Z" }, - { url = "https://files.pythonhosted.org/packages/e7/14/e2af8c64004cd891691915b1522f105a5d601dd8d76a635fec112911f251/ty-0.0.82-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7f5ef0401743c2eeac8039ef9ff1bc5dd612bd17ed0259b9b0794e19696548a6", size = 13435552, upload-time = "2026-09-17T19:41:42.084Z" }, - { url = "https://files.pythonhosted.org/packages/52/92/b9519a7854189aa8da4309ecb9c6ff5ab8ac91a433e201322b15c98f9388/ty-0.0.82-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:c899643f2a4c1782c06a4bf4959909d1aa2d9d2cac7c1ac3de3161dfcb6909f8", size = 13601427, upload-time = "2026-09-17T19:41:44.242Z" }, - { url = "https://files.pythonhosted.org/packages/ce/be/0c7a39e277a25bca21bbd2dcf640eb4d80cf98f318ef611092cda1222399/ty-0.0.82-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b7aa6e4e157c6e0b770c327a5d966371b2a7bc7ad4f22d662ac068623cba00eb", size = 14457370, upload-time = "2026-09-17T19:41:46.405Z" }, - { url = "https://files.pythonhosted.org/packages/6f/33/86ff8f1e15c71096838eb0fdfe0f5b578dc717575de6cba591d96baf3b06/ty-0.0.82-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:28c141ab481748f1b889eb572e803172ea452af621e514c30a2f30884753b020", size = 14888674, upload-time = "2026-09-17T19:41:48.6Z" }, - { url = "https://files.pythonhosted.org/packages/0a/d2/a1c6315907afd080b4e98d2972441b4803a70c9663a8c7a7f6fd554c7361/ty-0.0.82-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:16fff2729fbaa3998ba1cab536dc7d176aef28927b09200588e50982394c56df", size = 14670369, upload-time = "2026-09-17T19:41:50.963Z" }, - { url = "https://files.pythonhosted.org/packages/ae/cd/956ceae4dbe0b116ebc9ecb75dcbe9a0294c50146f76c4c59004e6eb2d77/ty-0.0.82-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c2024a33209b37525ffa85a29036985e9ef53a013c0ff321231bd8b23987cf71", size = 14107030, upload-time = "2026-09-17T19:41:53.343Z" }, - { url = "https://files.pythonhosted.org/packages/b7/f8/6025627cec4d6370fb34a2c5cdcf36d89dd4e4ac75b023bda68231e17dfc/ty-0.0.82-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:14a0ae8591e08aca5911b545d100e51c9b796350a85b2b36d82219820552d662", size = 14485892, upload-time = "2026-09-17T19:41:55.745Z" }, - { url = "https://files.pythonhosted.org/packages/3a/b6/016f9b36096a9ccd0492ee000380bd75fb51dc4ec7bfef4d6d93f6b3ec2e/ty-0.0.82-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:2964202b09108c72232760119c2680cefc33191c428b09e6f620b6c0ab9c6b0f", size = 13383907, upload-time = "2026-09-17T19:41:57.937Z" }, - { url = "https://files.pythonhosted.org/packages/b4/19/1ccc2429399d6ef3d98180340c7abc6793bd90c5039ad41a9003cb8de6df/ty-0.0.82-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:f4ed8fc714e35dc11ef4209832e73ad461cf29c9161099eb6c2c541c6b9a3e0e", size = 13617005, upload-time = "2026-09-17T19:42:00.018Z" }, - { url = "https://files.pythonhosted.org/packages/d7/9d/a4a487db72e78413bba2ee9cd49f79b8f461be93e7f6c4dd790febae1cd7/ty-0.0.82-py3-none-musllinux_1_2_i686.whl", hash = "sha256:32a3fe7b1a50f20679fe76c85c0087280419365d900300898a7b95cbcfe510fc", size = 13906545, upload-time = "2026-09-17T19:42:01.942Z" }, - { url = "https://files.pythonhosted.org/packages/0c/4e/a58d530c0f5abe7b846e2d05af9e3f1fb44a1b620ae0abe3892cd3f9596c/ty-0.0.82-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:f751044ae63ea9e73ce2eae4c23a839efa4a04d6487d6ea411a590fbe43360b6", size = 14248518, upload-time = "2026-09-17T19:42:04.164Z" }, - { url = "https://files.pythonhosted.org/packages/a6/db/5505229835171d19adcaaeec3a15e0b533b578d24de1329db5da9306c4c6/ty-0.0.82-py3-none-win32.whl", hash = "sha256:0eb66c5ce58434a48d2cae2780d25285c7ca19e07a0d38b1fe39d1a0f75d6fa3", size = 13059890, upload-time = "2026-09-17T19:42:06.161Z" }, - { url = "https://files.pythonhosted.org/packages/13/22/faa427b65baf39915f52a6fa079ece4253e831f3364c567bf91bc1eef65a/ty-0.0.82-py3-none-win_amd64.whl", hash = "sha256:1e4a6c1ca2dc1a6929517d73a47cd626989bb8bd67811425fbe022d06eb2bf73", size = 14003730, upload-time = "2026-09-17T19:42:08.268Z" }, - { url = "https://files.pythonhosted.org/packages/8b/fc/3b95100993d28acb2f3bcf3a49846985f5b2aafab6562627d018f6d23788/ty-0.0.82-py3-none-win_arm64.whl", hash = "sha256:a6f0e8a1f961518746edbccc5986945c01a56a917ebe37117aa028a038d54ae3", size = 13567713, upload-time = "2026-09-17T19:42:10.248Z" }, + { url = "https://files.pythonhosted.org/packages/bf/85/7259431bade2317d8b82fa27220ae4618c21396acf0ca28a7bd75e92afd7/ty-0.0.83-py3-none-linux_armv6l.whl", hash = "sha256:836bc08bad96ecc7e38baf1a6ddaec15aa8c8b46ae99a96365397b5f6481b7a5", size = 13905669, upload-time = "2026-09-21T22:46:36.677Z" }, + { url = "https://files.pythonhosted.org/packages/d2/30/9527386ade8dd71fc52f65cde3c094411af7ad0d505f9063ef0841998702/ty-0.0.83-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:0f1fb029fe076c7dca404d98e38fdb5fdbc2038a09407f89d43be1fdd9b2c459", size = 13499505, upload-time = "2026-09-21T22:46:40.114Z" }, + { url = "https://files.pythonhosted.org/packages/a0/54/63080d8cfd59a53810499a69a2ebc995724be27618b70d7f099e73ace317/ty-0.0.83-py3-none-macosx_11_0_arm64.whl", hash = "sha256:3515776d01ee3b1be974dafa73d449d0bc711afbc12ba341f82f70bc641ff4ee", size = 13498980, upload-time = "2026-09-21T22:46:43.197Z" }, + { url = "https://files.pythonhosted.org/packages/49/78/e647f190bd9513d09db30d45309e9b5df070b5caa44af2de3290fab59fbe/ty-0.0.83-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c5b80d66c7f9c8d60f25ccfd40c6eaebe8fd7c9005074904e0e164dd89c13d03", size = 13494705, upload-time = "2026-09-21T22:46:46.106Z" }, + { url = "https://files.pythonhosted.org/packages/2e/12/aef645b13c5bd15e3e5993537dbc23f7d65475f3cf1755d07b4d3e56850d/ty-0.0.83-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:57eae4aa55dab1af5d1423227c6517ccab1e658fe265c8e5a58caa584ca2876b", size = 13661466, upload-time = "2026-09-21T22:46:49.392Z" }, + { url = "https://files.pythonhosted.org/packages/d4/c4/11872e823653c568468ef7f0c3b23aed7ad2d33652e20144d28d5bfad58a/ty-0.0.83-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:dea3680911340ecf93dff5786dbeefd69c9399df685a22751e1fbd27e6007b50", size = 14479677, upload-time = "2026-09-21T22:46:52.277Z" }, + { url = "https://files.pythonhosted.org/packages/8e/db/5b0d0d24d16d24d781f29ee842ee718903e453dc4068acb02bef860d5540/ty-0.0.83-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8453786c274f48e2a89b78e8a505a4f449323f357f2ce26a9b90a4bd68176f67", size = 14972208, upload-time = "2026-09-21T22:46:55.242Z" }, + { url = "https://files.pythonhosted.org/packages/54/04/0077a53bcf6ceb41365a45d8091b52094c91a5f4b071c2a6d705ed8bb65b/ty-0.0.83-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:7701bdae3b52271cf0835abe4202aa3b23b735425d8c5a3e6a8ca1c68d39ead8", size = 14660550, upload-time = "2026-09-21T22:46:58.256Z" }, + { url = "https://files.pythonhosted.org/packages/d4/ff/b6c879f1c3121387edd19ebdb1fb02af30691f88f632278a5d467fb5f348/ty-0.0.83-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:aa95b4376447e5309fe3ccc98ee75916a9082714e6a029b99427ca62021dc94a", size = 14147376, upload-time = "2026-09-21T22:47:01.167Z" }, + { url = "https://files.pythonhosted.org/packages/0d/bc/82e730247d53cb02acd5a91237c0c62f215b2e0379689a550176d307ed89/ty-0.0.83-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:2a4550a08fc1899a33e4a08787a73ec9daa99d292268df4f0a5f1c24c63854c3", size = 14567502, upload-time = "2026-09-21T22:47:04.344Z" }, + { url = "https://files.pythonhosted.org/packages/67/13/bb6f57923231f51b626931625ada71e219d64541f8fadf96065bc5034358/ty-0.0.83-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:feb72080f0835fa2b27485e3b11fa50dc57c30e0ba73808a3f7d64b56db83f6f", size = 13443051, upload-time = "2026-09-21T22:47:07.316Z" }, + { url = "https://files.pythonhosted.org/packages/50/20/9862431662d4453527cd52cf0f30d5975cd1801aa39e570bf45fb299be77/ty-0.0.83-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:3e5206def2d6e1df93c75ed8dc763255233ccc3153647509d125bada10ad770a", size = 13678908, upload-time = "2026-09-21T22:47:10.714Z" }, + { url = "https://files.pythonhosted.org/packages/d7/e3/94ebbe1573b76660fa09f2dbce96da6d0bb69a2d29c7b6ad538b452979d4/ty-0.0.83-py3-none-musllinux_1_2_i686.whl", hash = "sha256:bdf5dfa157f5c127ba096fe0561b47877e6e79562c7fc2b35906ba5e9f6bb723", size = 13937248, upload-time = "2026-09-21T22:47:14.133Z" }, + { url = "https://files.pythonhosted.org/packages/2f/c0/3ea45c2ec3a82fddb7137e457ccb2a452446905430d225adaa4990cdc338/ty-0.0.83-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:626d6ad00f05a5d9b7ea80de44b12931d0c0fb50e64eab20b7fcc13e9aff2a68", size = 14290826, upload-time = "2026-09-21T22:47:16.874Z" }, + { url = "https://files.pythonhosted.org/packages/d8/b2/c941ce83a59e46ef31dd04bdf6067530e7ec77d5f0cdd1e223fbc6fc351b/ty-0.0.83-py3-none-win32.whl", hash = "sha256:0391017dac6ba3e452e0322301f50bba12fbccadac07d7fd888c46951ad37638", size = 13105291, upload-time = "2026-09-21T22:47:19.807Z" }, + { url = "https://files.pythonhosted.org/packages/b2/8a/5eef9458505698b144643cbd2062f465c5d860d8cf86a8710d74505ad9a0/ty-0.0.83-py3-none-win_amd64.whl", hash = "sha256:1b67d86f5bbad4076ae1a2ff23a6a4493219885d72d4b148cb0193e090390060", size = 13901557, upload-time = "2026-09-21T22:47:23.429Z" }, + { url = "https://files.pythonhosted.org/packages/9f/27/a06061513f1de25569c2e8898018bd552ab7b31afa7cfe818703269b3350/ty-0.0.83-py3-none-win_arm64.whl", hash = "sha256:a916a3d7d68fe30b7aacdb9fe16d461fa944d722e59e96ea0fa9d206a1b6625f", size = 13627960, upload-time = "2026-09-21T22:47:26.305Z" }, ] [[package]] From d44387d4426429de9e0becda96fc639b8d846515 Mon Sep 17 00:00:00 2001 From: David Peter Date: Wed, 23 Sep 2026 19:05:56 +0200 Subject: [PATCH 295/308] Adapt and clarify tests and docs around explicitly annotated receiver parameters (#2363) --- .../results/mypy/protocols_generic.toml | 34 +++---- .../results/pycroscope/protocols_generic.toml | 10 +- .../results/pyrefly/protocols_generic.toml | 6 +- .../results/pyright/protocols_generic.toml | 35 +++---- conformance/results/results.html | 2 +- conformance/results/ty/protocols_generic.toml | 10 +- .../results/zuban/protocols_generic.toml | 34 +++---- conformance/tests/protocols_generic.py | 96 +++++++++++++------ docs/guides/writing_stubs.rst | 13 ++- docs/spec/protocol.rst | 1 + 10 files changed, 132 insertions(+), 109 deletions(-) diff --git a/conformance/results/mypy/protocols_generic.toml b/conformance/results/mypy/protocols_generic.toml index 407eefd55..655434e55 100644 --- a/conformance/results/mypy/protocols_generic.toml +++ b/conformance/results/mypy/protocols_generic.toml @@ -16,25 +16,21 @@ protocols_generic.py:56: error: Incompatible types in assignment (expression has protocols_generic.py:66: error: Incompatible types in assignment (expression has type "Sender[int]", variable has type "Sender[float]") [assignment] protocols_generic.py:74: error: Incompatible types in assignment (expression has type "AttrProto[int]", variable has type "AttrProto[float]") [assignment] protocols_generic.py:75: error: Incompatible types in assignment (expression has type "AttrProto[float]", variable has type "AttrProto[int]") [assignment] -protocols_generic.py:145: error: Incompatible types in assignment (expression has type "ConcreteHasProperty2", variable has type "HasPropertyProto") [assignment] -protocols_generic.py:145: note: Following member(s) of "ConcreteHasProperty2" have conflicts: -protocols_generic.py:145: note: Expected: -protocols_generic.py:145: note: def [T] m(self, item: T, callback: Callable[[T], str]) -> str -protocols_generic.py:145: note: Got: -protocols_generic.py:145: note: def m(self, item: int, callback: Callable[[int], str]) -> str -protocols_generic.py:146: error: Incompatible types in assignment (expression has type "ConcreteHasProperty3", variable has type "HasPropertyProto") [assignment] -protocols_generic.py:146: note: Following member(s) of "ConcreteHasProperty3" have conflicts: -protocols_generic.py:146: note: f: expected "ConcreteHasProperty3", got "int" -protocols_generic.py:146: note: Expected: -protocols_generic.py:146: note: def [T] m(self, item: T, callback: Callable[[T], str]) -> str -protocols_generic.py:146: note: Got: -protocols_generic.py:146: note: def m(self, item: int, callback: Callable[[int], str]) -> str -protocols_generic.py:147: error: Incompatible types in assignment (expression has type "ConcreteHasProperty4", variable has type "HasPropertyProto") [assignment] -protocols_generic.py:147: note: Following member(s) of "ConcreteHasProperty4" have conflicts: -protocols_generic.py:147: note: Expected: -protocols_generic.py:147: note: def [T] m(self, item: T, callback: Callable[[T], str]) -> str -protocols_generic.py:147: note: Got: -protocols_generic.py:147: note: def m(self, item: str, callback: Callable[[int], str]) -> str +protocols_generic.py:133: error: Incompatible types in assignment (expression has type "InvalidParentProperty", variable has type "HasParentProperty") [assignment] +protocols_generic.py:133: note: Following member(s) of "InvalidParentProperty" have conflicts: +protocols_generic.py:133: note: parent: expected "InvalidParentProperty", got "HasParentProperty" +protocols_generic.py:153: error: Incompatible types in assignment (expression has type "InvalidHasMethod", variable has type "HasMethod") [assignment] +protocols_generic.py:153: note: Following member(s) of "InvalidHasMethod" have conflicts: +protocols_generic.py:153: note: Expected: +protocols_generic.py:153: note: def [T] m(self, item: T, callback: Callable[[T], str]) -> str +protocols_generic.py:153: note: Got: +protocols_generic.py:153: note: def m(self, item: int, callback: Callable[[int], str]) -> str +protocols_generic.py:185: error: Incompatible types in assignment (expression has type "InvalidGreaterThan", variable has type "HasGreaterThan") [assignment] +protocols_generic.py:185: note: Following member(s) of "InvalidGreaterThan" have conflicts: +protocols_generic.py:185: note: Expected: +protocols_generic.py:185: note: def __gt__(self, InvalidGreaterThan, /) -> bool +protocols_generic.py:185: note: Got: +protocols_generic.py:185: note: def __gt__(self, int, /) -> bool """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pycroscope/protocols_generic.toml b/conformance/results/pycroscope/protocols_generic.toml index be06306c6..5986ddd50 100644 --- a/conformance/results/pycroscope/protocols_generic.toml +++ b/conformance/results/pycroscope/protocols_generic.toml @@ -4,7 +4,7 @@ Treats global object as a literal. """ conformance_automated = "Fail" errors_diff = """ -Line 96: Unexpected errors ['./protocols_generic.py:96:12: Literal[] is not equivalent to protocols_generic.ConcreteHasParent'] +Line 107: Unexpected errors ['./protocols_generic.py:107:12: Literal[] is not equivalent to protocols_generic.ConcreteHasParent'] """ output = """ ./protocols_generic.py:40:0: Incompatible assignment: expected protocols_generic.Proto1[int, str], got protocols_generic.Concrete1 [incompatible_assignment] @@ -13,8 +13,8 @@ output = """ ./protocols_generic.py:66:4: Incompatible assignment: expected protocols_generic.Sender[float | int], got protocols_generic.Sender[int] [incompatible_assignment] ./protocols_generic.py:74:4: Incompatible assignment: expected protocols_generic.AttrProto[float | int], got protocols_generic.AttrProto[int] [incompatible_assignment] ./protocols_generic.py:75:4: Incompatible assignment: expected protocols_generic.AttrProto[int], got protocols_generic.AttrProto[float | int] [incompatible_assignment] -./protocols_generic.py:96:12: Literal[] is not equivalent to protocols_generic.ConcreteHasParent -./protocols_generic.py:145:0: Incompatible assignment: expected protocols_generic.HasPropertyProto, got protocols_generic.ConcreteHasProperty2 [incompatible_assignment] -./protocols_generic.py:146:0: Incompatible assignment: expected protocols_generic.HasPropertyProto, got protocols_generic.ConcreteHasProperty3 [incompatible_assignment] -./protocols_generic.py:147:0: Incompatible assignment: expected protocols_generic.HasPropertyProto, got protocols_generic.ConcreteHasProperty4 [incompatible_assignment] +./protocols_generic.py:107:12: Literal[] is not equivalent to protocols_generic.ConcreteHasParent +./protocols_generic.py:133:0: Incompatible assignment: expected protocols_generic.HasParentProperty, got protocols_generic.InvalidParentProperty [incompatible_assignment] +./protocols_generic.py:153:0: Incompatible assignment: expected protocols_generic.HasMethod, got protocols_generic.InvalidHasMethod [incompatible_assignment] +./protocols_generic.py:185:0: Incompatible assignment: expected protocols_generic.HasGreaterThan, got protocols_generic.InvalidGreaterThan [incompatible_assignment] """ diff --git a/conformance/results/pyrefly/protocols_generic.toml b/conformance/results/pyrefly/protocols_generic.toml index 634166922..f4344e4ff 100644 --- a/conformance/results/pyrefly/protocols_generic.toml +++ b/conformance/results/pyrefly/protocols_generic.toml @@ -9,7 +9,7 @@ ERROR protocols_generic.py:56:20-29: `Box[float]` is not assignable to `Box[int] ERROR protocols_generic.py:66:25-35: `Sender[int]` is not assignable to `Sender[float]` [bad-assignment] ERROR protocols_generic.py:74:28-36: `AttrProto[int]` is not assignable to `AttrProto[float]` [bad-assignment] ERROR protocols_generic.py:75:26-36: `AttrProto[float]` is not assignable to `AttrProto[int]` [bad-assignment] -ERROR protocols_generic.py:145:25-47: `ConcreteHasProperty2` is not assignable to `HasPropertyProto` [bad-assignment] -ERROR protocols_generic.py:146:25-47: `ConcreteHasProperty3` is not assignable to `HasPropertyProto` [bad-assignment] -ERROR protocols_generic.py:147:25-47: `ConcreteHasProperty4` is not assignable to `HasPropertyProto` [bad-assignment] +ERROR protocols_generic.py:133:26-49: `InvalidParentProperty` is not assignable to `HasParentProperty` [bad-assignment] +ERROR protocols_generic.py:153:18-36: `InvalidHasMethod` is not assignable to `HasMethod` [bad-assignment] +ERROR protocols_generic.py:185:23-43: `InvalidGreaterThan` is not assignable to `HasGreaterThan` [bad-assignment] """ diff --git a/conformance/results/pyright/protocols_generic.toml b/conformance/results/pyright/protocols_generic.toml index f19f84dae..5045dd70a 100644 --- a/conformance/results/pyright/protocols_generic.toml +++ b/conformance/results/pyright/protocols_generic.toml @@ -25,32 +25,27 @@ protocols_generic.py:74:28 - error: Type "AttrProto[int]" is not assignable to d protocols_generic.py:75:26 - error: Type "AttrProto[float]" is not assignable to declared type "AttrProto[int]"   "AttrProto[float]" is not assignable to "AttrProto[int]"     Type parameter "T@AttrProto" is invariant, but "float" is not the same as "int" (reportAssignmentType) -protocols_generic.py:145:25 - error: Type "ConcreteHasProperty2" is not assignable to declared type "HasPropertyProto" -  "ConcreteHasProperty2" is incompatible with protocol "HasPropertyProto" +protocols_generic.py:133:26 - error: Type "InvalidParentProperty" is not assignable to declared type "HasParentProperty" +  "InvalidParentProperty" is incompatible with protocol "HasParentProperty" +    "parent" is an incompatible type +      Type "() -> HasParentProperty" is not assignable to type "() -> InvalidParentProperty" +        "HasParentProperty" is not assignable to "InvalidParentProperty" +        Function return type "HasParentProperty" is incompatible with type "InvalidParentProperty" +          "HasParentProperty" is not assignable to "InvalidParentProperty" (reportAssignmentType) +protocols_generic.py:153:18 - error: Type "InvalidHasMethod" is not assignable to declared type "HasMethod" +  "InvalidHasMethod" is incompatible with protocol "HasMethod"     "m" is an incompatible type       Type "(item: int, callback: (int) -> str) -> str" is not assignable to type "(item: T@m, callback: (T@m) -> str) -> str"         Parameter 1: type "T@m" is incompatible with type "int"           "object*" is not assignable to "int"         Parameter 2: type "(T@m) -> str" is incompatible with type "(int) -> str"           Type "(T@m) -> str" is not assignable to type "(int) -> str" (reportAssignmentType) -protocols_generic.py:146:25 - error: Type "ConcreteHasProperty3" is not assignable to declared type "HasPropertyProto" -  "ConcreteHasProperty3" is incompatible with protocol "HasPropertyProto" -    "f" is an incompatible type -      Type "() -> int" is not assignable to type "() -> HasPropertyProto" -        Function return type "int" is incompatible with type "HasPropertyProto" -          "int" is incompatible with protocol "HasPropertyProto" -    "m" is an incompatible type -      Type "(item: int, callback: (int) -> str) -> str" is not assignable to type "(item: T@m, callback: (T@m) -> str) -> str" -        Parameter 1: type "T@m" is incompatible with type "int" - ... (reportAssignmentType) -protocols_generic.py:147:25 - error: Type "ConcreteHasProperty4" is not assignable to declared type "HasPropertyProto" -  "ConcreteHasProperty4" is incompatible with protocol "HasPropertyProto" -    "m" is an incompatible type -      Type "(item: str, callback: (int) -> str) -> str" is not assignable to type "(item: T@m, callback: (T@m) -> str) -> str" -        Parameter 1: type "T@m" is incompatible with type "str" -          "object*" is not assignable to "str" -        Parameter 2: type "(T@m) -> str" is incompatible with type "(int) -> str" -          Type "(T@m) -> str" is not assignable to type "(int) -> str" (reportAssignmentType) +protocols_generic.py:185:23 - error: Type "InvalidGreaterThan" is not assignable to declared type "HasGreaterThan" +  "InvalidGreaterThan" is incompatible with protocol "HasGreaterThan" +    "__gt__" is an incompatible type +      Type "(other: int) -> bool" is not assignable to type "(other: InvalidGreaterThan) -> bool" +        Parameter 1: type "InvalidGreaterThan" is incompatible with type "int" +          "InvalidGreaterThan" is not assignable to "int" (reportAssignmentType) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/results.html b/conformance/results/results.html index 8c4c16386..3877f3c17 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -1350,7 +1350,7 @@

    Python Type System Conformance Test Results

    diff --git a/conformance/results/ty/protocols_generic.toml b/conformance/results/ty/protocols_generic.toml index 0d955245e..81b16bf33 100644 --- a/conformance/results/ty/protocols_generic.toml +++ b/conformance/results/ty/protocols_generic.toml @@ -1,10 +1,10 @@ conformance_automated = "Fail" conformant = "Partial" notes = """ -Only partially supports `@property` protocol members. +Does not reject incompatible non-generic implementations of generic protocol methods. """ errors_diff = """ -Line 144: Unexpected errors ['protocols_generic.py:144:25: error[invalid-assignment] Object of type `ConcreteHasProperty1` is not assignable to `HasPropertyProto`'] +Line 153: Expected 1 errors """ output = """ protocols_generic.py:40:24: error[invalid-assignment] Object of type `Concrete1` is not assignable to `Proto1[int, str]` @@ -13,8 +13,6 @@ protocols_generic.py:56:20: error[invalid-assignment] Object of type `Box[float] protocols_generic.py:66:25: error[invalid-assignment] Object of type `Sender[int]` is not assignable to `Sender[float]` protocols_generic.py:74:28: error[invalid-assignment] Object of type `AttrProto[int]` is not assignable to `AttrProto[float]` protocols_generic.py:75:26: error[invalid-assignment] Object of type `AttrProto[float]` is not assignable to `AttrProto[int]` -protocols_generic.py:144:25: error[invalid-assignment] Object of type `ConcreteHasProperty1` is not assignable to `HasPropertyProto` -protocols_generic.py:145:25: error[invalid-assignment] Object of type `ConcreteHasProperty2` is not assignable to `HasPropertyProto` -protocols_generic.py:146:25: error[invalid-assignment] Object of type `ConcreteHasProperty3` is not assignable to `HasPropertyProto` -protocols_generic.py:147:25: error[invalid-assignment] Object of type `ConcreteHasProperty4` is not assignable to `HasPropertyProto` +protocols_generic.py:133:26: error[invalid-assignment] Object of type `InvalidParentProperty` is not assignable to `HasParentProperty` +protocols_generic.py:185:23: error[invalid-assignment] Object of type `InvalidGreaterThan` is not assignable to `HasGreaterThan` """ diff --git a/conformance/results/zuban/protocols_generic.toml b/conformance/results/zuban/protocols_generic.toml index 102540dd1..570482769 100644 --- a/conformance/results/zuban/protocols_generic.toml +++ b/conformance/results/zuban/protocols_generic.toml @@ -17,23 +17,19 @@ protocols_generic.py:56: error: Incompatible types in assignment (expression has protocols_generic.py:66: error: Incompatible types in assignment (expression has type "Sender[int]", variable has type "Sender[float]") [assignment] protocols_generic.py:74: error: Incompatible types in assignment (expression has type "AttrProto[int]", variable has type "AttrProto[float]") [assignment] protocols_generic.py:75: error: Incompatible types in assignment (expression has type "AttrProto[float]", variable has type "AttrProto[int]") [assignment] -protocols_generic.py:145: error: Incompatible types in assignment (expression has type "ConcreteHasProperty2", variable has type "HasPropertyProto") [assignment] -protocols_generic.py:145: note: Following member(s) of "ConcreteHasProperty2" have conflicts: -protocols_generic.py:145: note: Expected: -protocols_generic.py:145: note: def [T] m(self, item: T, callback: Callable[[T], str]) -> str -protocols_generic.py:145: note: Got: -protocols_generic.py:145: note: def m(self, item: int, callback: Callable[[int], str]) -> str -protocols_generic.py:146: error: Incompatible types in assignment (expression has type "ConcreteHasProperty3", variable has type "HasPropertyProto") [assignment] -protocols_generic.py:146: note: Following member(s) of "ConcreteHasProperty3" have conflicts: -protocols_generic.py:146: note: f: expected "ConcreteHasProperty3", got "int" -protocols_generic.py:146: note: Expected: -protocols_generic.py:146: note: def [T] m(self, item: T, callback: Callable[[T], str]) -> str -protocols_generic.py:146: note: Got: -protocols_generic.py:146: note: def m(self, item: int, callback: Callable[[int], str]) -> str -protocols_generic.py:147: error: Incompatible types in assignment (expression has type "ConcreteHasProperty4", variable has type "HasPropertyProto") [assignment] -protocols_generic.py:147: note: Following member(s) of "ConcreteHasProperty4" have conflicts: -protocols_generic.py:147: note: Expected: -protocols_generic.py:147: note: def [T] m(self, item: T, callback: Callable[[T], str]) -> str -protocols_generic.py:147: note: Got: -protocols_generic.py:147: note: def m(self, item: str, callback: Callable[[int], str]) -> str +protocols_generic.py:133: error: Incompatible types in assignment (expression has type "InvalidParentProperty", variable has type "HasParentProperty") [assignment] +protocols_generic.py:133: note: Following member(s) of "InvalidParentProperty" have conflicts: +protocols_generic.py:133: note: parent: expected "InvalidParentProperty", got "HasParentProperty" +protocols_generic.py:153: error: Incompatible types in assignment (expression has type "InvalidHasMethod", variable has type "HasMethod") [assignment] +protocols_generic.py:153: note: Following member(s) of "InvalidHasMethod" have conflicts: +protocols_generic.py:153: note: Expected: +protocols_generic.py:153: note: def [T] m(self, item: T, callback: Callable[[T], str]) -> str +protocols_generic.py:153: note: Got: +protocols_generic.py:153: note: def m(self, item: int, callback: Callable[[int], str]) -> str +protocols_generic.py:185: error: Incompatible types in assignment (expression has type "InvalidGreaterThan", variable has type "HasGreaterThan") [assignment] +protocols_generic.py:185: note: Following member(s) of "InvalidGreaterThan" have conflicts: +protocols_generic.py:185: note: Expected: +protocols_generic.py:185: note: def [Self: InvalidGreaterThan] __gt__(self, other: Self) -> bool +protocols_generic.py:185: note: Got: +protocols_generic.py:185: note: def __gt__(self, other: int) -> bool """ diff --git a/conformance/tests/protocols_generic.py b/conformance/tests/protocols_generic.py index b417e00f6..be7525e56 100644 --- a/conformance/tests/protocols_generic.py +++ b/conformance/tests/protocols_generic.py @@ -75,8 +75,19 @@ def func3(attr_int: AttrProto[int], attr_float: AttrProto[float]): v2: AttrProto[int] = attr_float # E +# Specification: https://typing.readthedocs.io/en/latest/spec/protocol.html#self-types-in-protocols +# > The self-types in protocols follow the rules for other methods. +# Specification: https://typing.readthedocs.io/en/latest/spec/annotations.html#annotating-instance-and-class-methods +# > In addition, the first argument in an instance method can be annotated +# > with a type variable. In this case the return type may use the same +# > type variable, thus making that method a generic function. + + +T_bounded = TypeVar("T_bounded", bound="HasParent") + + class HasParent(Protocol): - def get_parent(self: T) -> T: + def get_parent(self: T_bounded) -> T_bounded: ... @@ -96,52 +107,79 @@ def get_parent(self) -> Self: assert_type(parent, ConcreteHasParent) -class HasPropertyProto(Protocol): - @property - def f(self: T) -> T: - ... +# Specification: https://typing.readthedocs.io/en/latest/spec/generics.html#use-in-protocols +# > `Self` is valid within Protocols, similar to its use in classes: - def m(self, item: T, callback: Callable[[T], str]) -> str: + +class HasParentProperty(Protocol): + @property + def parent(self) -> Self: ... -class ConcreteHasProperty1: +class ConcreteParentProperty: @property - def f(self: T) -> T: + def parent(self) -> Self: return self + +class InvalidParentProperty: + @property + def parent(self) -> HasParentProperty: + return ConcreteParentProperty() + + +hp1: HasParentProperty = ConcreteParentProperty() # OK +hp2: HasParentProperty = InvalidParentProperty() # E + + + +class HasMethod(Protocol): def m(self, item: T, callback: Callable[[T], str]) -> str: - return "" + ... -class ConcreteHasProperty2: - @property - def f(self) -> Self: - return self +class ConcreteHasMethod: + def m(self, item: T, callback: Callable[[T], str]) -> str: + return "" + +class InvalidHasMethod: def m(self, item: int, callback: Callable[[int], str]) -> str: return "" -class ConcreteHasProperty3: - @property - def f(self) -> int: - return 0 +hm1: HasMethod = ConcreteHasMethod() # OK +hm2: HasMethod = InvalidHasMethod() # E - def m(self, item: int, callback: Callable[[int], str]) -> str: - return "" +# Specification: https://typing.readthedocs.io/en/latest/spec/generics.html#use-in-protocols +# > Checking a class for assignability to a protocol: If a protocol uses `Self` +# > in methods or attribute annotations, then a class `Foo` is assignable +# > to the protocol if its corresponding methods and attribute annotations use +# > either `Self` or `Foo` or any of `Foo`'s subclasses. -class ConcreteHasProperty4: - @property - def f(self) -> Self: - return self - def m(self, item: str, callback: Callable[[int], str]) -> str: - return "" +class HasGreaterThan(Protocol): + def __gt__(self, other: Self) -> bool: + ... + + +class ConcreteGreaterThan1: + def __gt__(self, other: Self) -> bool: + return False + + +class ConcreteGreaterThan2: + def __gt__(self, other: "ConcreteGreaterThan2") -> bool: + return False + + +class InvalidGreaterThan: + def __gt__(self, other: int) -> bool: + return False -hp1: HasPropertyProto = ConcreteHasProperty1() # OK -hp2: HasPropertyProto = ConcreteHasProperty2() # E -hp3: HasPropertyProto = ConcreteHasProperty3() # E -hp4: HasPropertyProto = ConcreteHasProperty4() # E +hg1: HasGreaterThan = ConcreteGreaterThan1() # OK +hg2: HasGreaterThan = ConcreteGreaterThan2() # OK +hg3: HasGreaterThan = InvalidGreaterThan() # E diff --git a/docs/guides/writing_stubs.rst b/docs/guides/writing_stubs.rst index 3039e8160..c9c642aba 100644 --- a/docs/guides/writing_stubs.rst +++ b/docs/guides/writing_stubs.rst @@ -647,24 +647,23 @@ No:: def foo(x: X = X()) -> None: ... def bar(y: str = None) -> None: ... -Do not annotate ``self`` and ``cls`` in method definitions, except when -referencing a type variable. +Do not annotate ``self`` and ``cls`` in method definitions unless an explicit +annotation is needed to constrain or relax the receiver type. Yes:: - _T = TypeVar("_T") - class Foo: def bar(self) -> None: ... @classmethod - def create(cls: type[_T]) -> _T: ... + def create(cls) -> Self: ... No:: class Foo: - def bar(self: Foo) -> None: ... + def bar1(self: Self) -> None: ... + def bar2(self: Foo) -> None: ... @classmethod - def baz(cls: type[Foo]) -> int: ... + def create(cls: type[Self]) -> Self: ... The bodies of functions and methods should consist of only the ellipsis literal ``...`` on the same line as the closing parenthesis and colon. diff --git a/docs/spec/protocol.rst b/docs/spec/protocol.rst index 2803da0a6..bfa352aa2 100644 --- a/docs/spec/protocol.rst +++ b/docs/spec/protocol.rst @@ -365,6 +365,7 @@ The self-types in protocols follow the class Copyable(Protocol): def copy[C: Copyable](self: C) -> C: + ... class One: def copy(self) -> 'One': From dc0a8a924c99c6d6ab70f5dc4708e8e4017386ae Mon Sep 17 00:00:00 2001 From: David Peter Date: Fri, 25 Sep 2026 17:52:01 +0200 Subject: [PATCH 296/308] Add a useful explicit receiver annotation example (#2364) --- docs/guides/writing_stubs.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/guides/writing_stubs.rst b/docs/guides/writing_stubs.rst index c9c642aba..7964566c9 100644 --- a/docs/guides/writing_stubs.rst +++ b/docs/guides/writing_stubs.rst @@ -657,6 +657,12 @@ Yes:: @classmethod def create(cls) -> Self: ... + _T = TypeVar("_T") + + class Box(Generic[_T]): + # This method is only available on boxes containing strings. + def upper(self: Box[str]) -> str: ... + No:: class Foo: From 835b70f3f795f8e061b1f7621178515b0a77a0ad Mon Sep 17 00:00:00 2001 From: Carl Meyer Date: Fri, 9 Oct 2026 10:25:35 -0700 Subject: [PATCH 297/308] Allow type context for bare generic class specialization (#2366) --- .../generics_defaults_specialization.toml | 10 +++------ .../generics_defaults_specialization.toml | 4 ++-- .../generics_defaults_specialization.toml | 4 ++-- .../generics_defaults_specialization.toml | 10 +++------ conformance/results/results.html | 22 +++++-------------- .../ty/generics_defaults_specialization.toml | 4 ++-- .../generics_defaults_specialization.toml | 4 ++-- .../tests/generics_defaults_specialization.py | 4 +++- 8 files changed, 23 insertions(+), 39 deletions(-) diff --git a/conformance/results/mypy/generics_defaults_specialization.toml b/conformance/results/mypy/generics_defaults_specialization.toml index 1aab9fb8d..6515700dd 100644 --- a/conformance/results/mypy/generics_defaults_specialization.toml +++ b/conformance/results/mypy/generics_defaults_specialization.toml @@ -1,12 +1,8 @@ -conformant = "Partial" -notes = """ -Does not correctly resolve defaults when classes are used directly. -""" +conformant = "Pass" output = """ generics_defaults_specialization.py:30: error: Bad number of arguments for type alias, expected between 0 and 1, given 2 [type-arg] -generics_defaults_specialization.py:56: error: The type "type[Foo]" is not generic and not indexable [misc] +generics_defaults_specialization.py:58: error: The type "type[Foo]" is not generic and not indexable [misc] """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 46: Expected 1 errors """ diff --git a/conformance/results/pycroscope/generics_defaults_specialization.toml b/conformance/results/pycroscope/generics_defaults_specialization.toml index aab3a627d..4aab1f309 100644 --- a/conformance/results/pycroscope/generics_defaults_specialization.toml +++ b/conformance/results/pycroscope/generics_defaults_specialization.toml @@ -3,6 +3,6 @@ errors_diff = """ """ output = """ ./generics_defaults_specialization.py:30:0: Expected 1 type arguments for type alias, got 2 [invalid_specialization] -./generics_defaults_specialization.py:46:0: Incompatible assignment: expected type[./generics_defaults_specialization.py.Bar[int]], got [incompatible_assignment] -./generics_defaults_specialization.py:56:0: ./generics_defaults_specialization.py.Foo cannot be further subscripted [invalid_specialization] +./generics_defaults_specialization.py:48:0: Incompatible assignment: expected type[./generics_defaults_specialization.py.Bar[int]], got [incompatible_assignment] +./generics_defaults_specialization.py:58:0: ./generics_defaults_specialization.py.Foo cannot be further subscripted [invalid_specialization] """ diff --git a/conformance/results/pyrefly/generics_defaults_specialization.toml b/conformance/results/pyrefly/generics_defaults_specialization.toml index 4b087764e..c0783e881 100644 --- a/conformance/results/pyrefly/generics_defaults_specialization.toml +++ b/conformance/results/pyrefly/generics_defaults_specialization.toml @@ -4,6 +4,6 @@ errors_diff = """ """ output = """ ERROR generics_defaults_specialization.py:30:1-19: Expected 1 type argument for `MyAlias`, got 2 [bad-specialization] -ERROR generics_defaults_specialization.py:46:22-25: `type[Bar]` is not assignable to `type[Bar[int]]` [bad-assignment] -ERROR generics_defaults_specialization.py:56:1-9: Expected 0 type arguments for `Foo`, got 1 [bad-specialization] +ERROR generics_defaults_specialization.py:48:22-25: `type[Bar]` is not assignable to `type[Bar[int]]` [bad-assignment] +ERROR generics_defaults_specialization.py:58:1-9: Expected 0 type arguments for `Foo`, got 1 [bad-specialization] """ diff --git a/conformance/results/pyright/generics_defaults_specialization.toml b/conformance/results/pyright/generics_defaults_specialization.toml index f1d5bc216..2beb10f61 100644 --- a/conformance/results/pyright/generics_defaults_specialization.toml +++ b/conformance/results/pyright/generics_defaults_specialization.toml @@ -1,12 +1,8 @@ -conformant = "Partial" -notes = """ -Allows incorrect assignment to `type[]`. -""" +conformant = "Pass" output = """ generics_defaults_specialization.py:30:15 - error: Too many type arguments provided for "MyAlias[DefaultStrT@MyAlias]"; expected 1 but received 2 (reportInvalidTypeForm) -generics_defaults_specialization.py:56:5 - error: Expected no type arguments for class "Foo" (reportInvalidTypeArguments) +generics_defaults_specialization.py:58:5 - error: Expected no type arguments for class "Foo" (reportInvalidTypeArguments) """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 46: Expected 1 errors """ diff --git a/conformance/results/results.html b/conformance/results/results.html index 3877f3c17..8106b6714 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -610,20 +610,10 @@

    Python Type System Conformance Test Results

    - - + + @@ -957,10 +947,10 @@

    Python Type System Conformance Test Results

    - + - + @@ -2583,10 +2573,10 @@

    Python Type System Conformance Test Results

    - + - + diff --git a/conformance/results/ty/generics_defaults_specialization.toml b/conformance/results/ty/generics_defaults_specialization.toml index 0a1b822e0..01b15f588 100644 --- a/conformance/results/ty/generics_defaults_specialization.toml +++ b/conformance/results/ty/generics_defaults_specialization.toml @@ -3,6 +3,6 @@ errors_diff = """ """ output = """ generics_defaults_specialization.py:30:15: error[invalid-type-arguments] Too many type arguments: expected between 0 and 1, got 2 -generics_defaults_specialization.py:46:22: error[invalid-assignment] Object of type `` is not assignable to `type[Bar[int]]` -generics_defaults_specialization.py:56:1: error[not-subscriptable] Cannot specialize non-generic class `Foo` +generics_defaults_specialization.py:48:22: error[invalid-assignment] Object of type `` is not assignable to `type[Bar[int]]` +generics_defaults_specialization.py:58:1: error[not-subscriptable] Cannot specialize non-generic class `Foo` """ diff --git a/conformance/results/zuban/generics_defaults_specialization.toml b/conformance/results/zuban/generics_defaults_specialization.toml index 7592bf2be..a485b047c 100644 --- a/conformance/results/zuban/generics_defaults_specialization.toml +++ b/conformance/results/zuban/generics_defaults_specialization.toml @@ -3,6 +3,6 @@ errors_diff = """ """ output = """ generics_defaults_specialization.py:30: error: Bad number of arguments for type alias, expected between 0 and 1, given 2 [misc] -generics_defaults_specialization.py:46: error: Incompatible types in assignment (expression has type "type[Bar]", variable has type "type[Bar[int]]") [assignment] -generics_defaults_specialization.py:56: error: "Foo" expects no type arguments, but 1 given [type-arg] +generics_defaults_specialization.py:48: error: Incompatible types in assignment (expression has type "type[Bar]", variable has type "type[Bar[int]]") [assignment] +generics_defaults_specialization.py:58: error: "Foo" expects no type arguments, but 1 given [type-arg] """ diff --git a/conformance/tests/generics_defaults_specialization.py b/conformance/tests/generics_defaults_specialization.py index 91db2579b..c131f8e3a 100644 --- a/conformance/tests/generics_defaults_specialization.py +++ b/conformance/tests/generics_defaults_specialization.py @@ -43,7 +43,9 @@ class Bar(SubclassMe[int, DefaultStrT]): ... x1: type[Bar[str]] = Bar # ok -x2: type[Bar[int]] = Bar # E +# Type checkers may take type context into account when deciding how to +# specialize a bare runtime reference to a generic class. +x2: type[Bar[int]] = Bar # E? assert_type(Bar(), Bar[str]) assert_type(Bar[bool](), Bar[bool]) From d06c5dd6bbae4a39eb7cb0210c5b2099aafd8032 Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Wed, 14 Oct 2026 16:16:23 -0700 Subject: [PATCH 298/308] conformance: remove questionable generic syntax test (#2368) We noticed this test from a ty change that (correctly) disallows passing `Foo[T]` where `type[Foo[T]]` is expected: `Foo[T]` is a `GenericAlias`, not a type. But when I looked at the test, I noticed it doesn't really make sense to use a generic here at all. `__init_subclass__` is evaluated at the class level and can't possibly be generic. Probably TypeVars should be disallowed here for the same reason they're disallowed in ClassVars. But adding that to the spec or type checkers seems more trouble than it's worth; for now let's just remove the dubious test. --- .../results/mypy/generics_syntax_scoping.toml | 48 +++++++++---------- .../pycroscope/generics_syntax_scoping.toml | 12 ++--- .../pyrefly/generics_syntax_scoping.toml | 10 ++-- .../pyright/generics_syntax_scoping.toml | 12 ++--- .../results/ty/generics_syntax_scoping.toml | 10 ++-- .../zuban/generics_syntax_scoping.toml | 12 ++--- conformance/tests/generics_syntax_scoping.py | 9 ---- 7 files changed, 52 insertions(+), 61 deletions(-) diff --git a/conformance/results/mypy/generics_syntax_scoping.toml b/conformance/results/mypy/generics_syntax_scoping.toml index 34cc33a00..433b9c67b 100644 --- a/conformance/results/mypy/generics_syntax_scoping.toml +++ b/conformance/results/mypy/generics_syntax_scoping.toml @@ -6,31 +6,31 @@ output = """ generics_syntax_scoping.py:14: error: Name "S" is not defined [name-defined] generics_syntax_scoping.py:18: error: Variable "generics_syntax_scoping.T" is not valid as a type [valid-type] generics_syntax_scoping.py:18: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_scoping.py:35: error: Cannot determine type of "T" [has-type] -generics_syntax_scoping.py:35: error: Name "T" is used before definition [used-before-def] -generics_syntax_scoping.py:44: error: Variable "generics_syntax_scoping.T" is not valid as a type [valid-type] -generics_syntax_scoping.py:44: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_scoping.py:62: error: Expression is of type "Any", not "str" [assert-type] -generics_syntax_scoping.py:62: note: "assert_type" expects everything to be "Any" in unchecked functions -generics_syntax_scoping.py:67: error: Expression is of type "Any", not "int" [assert-type] -generics_syntax_scoping.py:67: note: "assert_type" expects everything to be "Any" in unchecked functions -generics_syntax_scoping.py:92: error: "T" already defined as a type parameter [misc] -generics_syntax_scoping.py:95: error: "T" already defined as a type parameter [misc] -generics_syntax_scoping.py:98: error: "T" already defined as a type parameter [misc] -generics_syntax_scoping.py:98: error: Variable "generics_syntax_scoping.ClassE.T" is not valid as a type [valid-type] -generics_syntax_scoping.py:98: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_scoping.py:117: error: Expression is of type "Any", not "TypeVar" [assert-type] -generics_syntax_scoping.py:117: note: "assert_type" expects everything to be "Any" in unchecked functions -generics_syntax_scoping.py:122: error: Expression is of type "Any", not "complex" [assert-type] -generics_syntax_scoping.py:122: note: "assert_type" expects everything to be "Any" in unchecked functions -generics_syntax_scoping.py:125: error: Expression is of type "Any", not "complex" [assert-type] -generics_syntax_scoping.py:125: note: "assert_type" expects everything to be "Any" in unchecked functions +generics_syntax_scoping.py:26: error: Cannot determine type of "T" [has-type] +generics_syntax_scoping.py:26: error: Name "T" is used before definition [used-before-def] +generics_syntax_scoping.py:35: error: Variable "generics_syntax_scoping.T" is not valid as a type [valid-type] +generics_syntax_scoping.py:35: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_scoping.py:53: error: Expression is of type "Any", not "str" [assert-type] +generics_syntax_scoping.py:53: note: "assert_type" expects everything to be "Any" in unchecked functions +generics_syntax_scoping.py:58: error: Expression is of type "Any", not "int" [assert-type] +generics_syntax_scoping.py:58: note: "assert_type" expects everything to be "Any" in unchecked functions +generics_syntax_scoping.py:83: error: "T" already defined as a type parameter [misc] +generics_syntax_scoping.py:86: error: "T" already defined as a type parameter [misc] +generics_syntax_scoping.py:89: error: "T" already defined as a type parameter [misc] +generics_syntax_scoping.py:89: error: Variable "generics_syntax_scoping.ClassE.T" is not valid as a type [valid-type] +generics_syntax_scoping.py:89: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_scoping.py:108: error: Expression is of type "Any", not "TypeVar" [assert-type] +generics_syntax_scoping.py:108: note: "assert_type" expects everything to be "Any" in unchecked functions +generics_syntax_scoping.py:113: error: Expression is of type "Any", not "complex" [assert-type] +generics_syntax_scoping.py:113: note: "assert_type" expects everything to be "Any" in unchecked functions +generics_syntax_scoping.py:116: error: Expression is of type "Any", not "complex" [assert-type] +generics_syntax_scoping.py:116: note: "assert_type" expects everything to be "Any" in unchecked functions """ conformance_automated = "Fail" errors_diff = """ -Line 62: Unexpected errors ['generics_syntax_scoping.py:62: error: Expression is of type "Any", not "str" [assert-type]'] -Line 67: Unexpected errors ['generics_syntax_scoping.py:67: error: Expression is of type "Any", not "int" [assert-type]'] -Line 117: Unexpected errors ['generics_syntax_scoping.py:117: error: Expression is of type "Any", not "TypeVar" [assert-type]'] -Line 122: Unexpected errors ['generics_syntax_scoping.py:122: error: Expression is of type "Any", not "complex" [assert-type]'] -Line 125: Unexpected errors ['generics_syntax_scoping.py:125: error: Expression is of type "Any", not "complex" [assert-type]'] +Line 53: Unexpected errors ['generics_syntax_scoping.py:53: error: Expression is of type "Any", not "str" [assert-type]'] +Line 58: Unexpected errors ['generics_syntax_scoping.py:58: error: Expression is of type "Any", not "int" [assert-type]'] +Line 108: Unexpected errors ['generics_syntax_scoping.py:108: error: Expression is of type "Any", not "TypeVar" [assert-type]'] +Line 113: Unexpected errors ['generics_syntax_scoping.py:113: error: Expression is of type "Any", not "complex" [assert-type]'] +Line 116: Unexpected errors ['generics_syntax_scoping.py:116: error: Expression is of type "Any", not "complex" [assert-type]'] """ diff --git a/conformance/results/pycroscope/generics_syntax_scoping.toml b/conformance/results/pycroscope/generics_syntax_scoping.toml index 6aa30d4d5..4f2903c6f 100644 --- a/conformance/results/pycroscope/generics_syntax_scoping.toml +++ b/conformance/results/pycroscope/generics_syntax_scoping.toml @@ -4,10 +4,10 @@ errors_diff = """ output = """ ./generics_syntax_scoping.py:14:19: TypeVar bound cannot be parameterized by type variables [invalid_annotation] ./generics_syntax_scoping.py:18:13: Type parameter bound cannot reference a later type parameter [invalid_type_parameter] -./generics_syntax_scoping.py:35:6: Undefined name: T [undefined_name] -./generics_syntax_scoping.py:44:12: Incompatible argument type for x: expected type[./generics_syntax_scoping.py.Foo[~T@./generics_syntax_scoping.py.decorator1..decorator1]] but got types.GenericAlias (partial from [Any[error]]) [incompatible_argument] -./generics_syntax_scoping.py:44:16: Undefined name: T [undefined_name] -./generics_syntax_scoping.py:92:16: Type parameter 'T' is already in use by an outer scope [invalid_type_parameter] -./generics_syntax_scoping.py:95:16: Type parameter 'T' is already in use by an outer scope [invalid_type_parameter] -./generics_syntax_scoping.py:98:16: Type parameter 'T' is already in use by an outer scope [invalid_type_parameter] +./generics_syntax_scoping.py:26:6: Undefined name: T [undefined_name] +./generics_syntax_scoping.py:35:12: Incompatible argument type for x: expected type[./generics_syntax_scoping.py.Foo[~T@./generics_syntax_scoping.py.decorator1..decorator1]] but got types.GenericAlias (partial from [Any[error]]) [incompatible_argument] +./generics_syntax_scoping.py:35:16: Undefined name: T [undefined_name] +./generics_syntax_scoping.py:83:16: Type parameter 'T' is already in use by an outer scope [invalid_type_parameter] +./generics_syntax_scoping.py:86:16: Type parameter 'T' is already in use by an outer scope [invalid_type_parameter] +./generics_syntax_scoping.py:89:16: Type parameter 'T' is already in use by an outer scope [invalid_type_parameter] """ diff --git a/conformance/results/pyrefly/generics_syntax_scoping.toml b/conformance/results/pyrefly/generics_syntax_scoping.toml index 6d7c35a63..2034cb3ed 100644 --- a/conformance/results/pyrefly/generics_syntax_scoping.toml +++ b/conformance/results/pyrefly/generics_syntax_scoping.toml @@ -5,9 +5,9 @@ errors_diff = """ output = """ ERROR generics_syntax_scoping.py:14:20-31: Type variable bounds and constraints must be concrete [invalid-annotation] ERROR generics_syntax_scoping.py:18:26-27: Expected a type form, got instance of `int` [not-a-type] -ERROR generics_syntax_scoping.py:35:7-8: `T` is uninitialized [unbound-name] -ERROR generics_syntax_scoping.py:44:17-18: Expected a type form, got instance of `int` [not-a-type] -ERROR generics_syntax_scoping.py:92:17-18: Type parameter `T` shadows a type parameter of the same name from an enclosing scope [invalid-type-var] -ERROR generics_syntax_scoping.py:95:17-18: Type parameter `T` shadows a type parameter of the same name from an enclosing scope [invalid-type-var] -ERROR generics_syntax_scoping.py:98:17-18: Type parameter `T` shadows a type parameter of the same name from an enclosing scope [invalid-type-var] +ERROR generics_syntax_scoping.py:26:7-8: `T` is uninitialized [unbound-name] +ERROR generics_syntax_scoping.py:35:17-18: Expected a type form, got instance of `int` [not-a-type] +ERROR generics_syntax_scoping.py:83:17-18: Type parameter `T` shadows a type parameter of the same name from an enclosing scope [invalid-type-var] +ERROR generics_syntax_scoping.py:86:17-18: Type parameter `T` shadows a type parameter of the same name from an enclosing scope [invalid-type-var] +ERROR generics_syntax_scoping.py:89:17-18: Type parameter `T` shadows a type parameter of the same name from an enclosing scope [invalid-type-var] """ diff --git a/conformance/results/pyright/generics_syntax_scoping.toml b/conformance/results/pyright/generics_syntax_scoping.toml index 4a8f43c6a..5cc46a887 100644 --- a/conformance/results/pyright/generics_syntax_scoping.toml +++ b/conformance/results/pyright/generics_syntax_scoping.toml @@ -2,12 +2,12 @@ conformant = "Pass" output = """ generics_syntax_scoping.py:14:20 - error: TypeVar constraint type cannot be generic (reportGeneralTypeIssues) generics_syntax_scoping.py:18:17 - error: TypeVar constraint type cannot be generic (reportGeneralTypeIssues) -generics_syntax_scoping.py:35:7 - error: "T" is not defined (reportUndefinedVariable) -generics_syntax_scoping.py:44:17 - error: "T" is not defined (reportUndefinedVariable) -generics_syntax_scoping.py:92:17 - error: TypeVar "T" is already in use by an outer scope (reportGeneralTypeIssues) -generics_syntax_scoping.py:95:17 - error: TypeVar "T" is already in use by an outer scope (reportGeneralTypeIssues) -generics_syntax_scoping.py:98:17 - error: TypeVar "T" is already in use by an outer scope (reportGeneralTypeIssues) -generics_syntax_scoping.py:98:29 - warning: TypeVar "T" appears only once in generic function signature +generics_syntax_scoping.py:26:7 - error: "T" is not defined (reportUndefinedVariable) +generics_syntax_scoping.py:35:17 - error: "T" is not defined (reportUndefinedVariable) +generics_syntax_scoping.py:83:17 - error: TypeVar "T" is already in use by an outer scope (reportGeneralTypeIssues) +generics_syntax_scoping.py:86:17 - error: TypeVar "T" is already in use by an outer scope (reportGeneralTypeIssues) +generics_syntax_scoping.py:89:17 - error: TypeVar "T" is already in use by an outer scope (reportGeneralTypeIssues) +generics_syntax_scoping.py:89:29 - warning: TypeVar "T" appears only once in generic function signature   Use "object" instead (reportInvalidTypeVarUse) """ conformance_automated = "Pass" diff --git a/conformance/results/ty/generics_syntax_scoping.toml b/conformance/results/ty/generics_syntax_scoping.toml index 839a9eda0..b40a2f622 100644 --- a/conformance/results/ty/generics_syntax_scoping.toml +++ b/conformance/results/ty/generics_syntax_scoping.toml @@ -4,9 +4,9 @@ errors_diff = """ output = """ generics_syntax_scoping.py:14:20: error[invalid-type-variable-bound] TypeVar upper bound cannot be generic generics_syntax_scoping.py:18:17: error[invalid-type-variable-bound] TypeVar upper bound cannot be generic -generics_syntax_scoping.py:35:7: error[unresolved-reference] Name `T` used when not defined -generics_syntax_scoping.py:44:17: error[unresolved-reference] Name `T` used when not defined -generics_syntax_scoping.py:92:9: error[shadowed-type-variable] Generic function `method1` uses type variable `T` already bound by an enclosing scope -generics_syntax_scoping.py:95:9: error[shadowed-type-variable] Generic function `method2` uses type variable `T` already bound by an enclosing scope -generics_syntax_scoping.py:98:9: error[shadowed-type-variable] Generic function `method3` uses type variable `T` already bound by an enclosing scope +generics_syntax_scoping.py:26:7: error[unresolved-reference] Name `T` used when not defined +generics_syntax_scoping.py:35:17: error[unresolved-reference] Name `T` used when not defined +generics_syntax_scoping.py:83:9: error[shadowed-type-variable] Generic function `method1` uses type variable `T` already bound by an enclosing scope +generics_syntax_scoping.py:86:9: error[shadowed-type-variable] Generic function `method2` uses type variable `T` already bound by an enclosing scope +generics_syntax_scoping.py:89:9: error[shadowed-type-variable] Generic function `method3` uses type variable `T` already bound by an enclosing scope """ diff --git a/conformance/results/zuban/generics_syntax_scoping.toml b/conformance/results/zuban/generics_syntax_scoping.toml index a0444e813..c72eeb1b0 100644 --- a/conformance/results/zuban/generics_syntax_scoping.toml +++ b/conformance/results/zuban/generics_syntax_scoping.toml @@ -6,11 +6,11 @@ generics_syntax_scoping.py:14: error: Variable "tests.generics_syntax_scoping.S" generics_syntax_scoping.py:14: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases generics_syntax_scoping.py:18: error: Variable "tests.generics_syntax_scoping.T" is not valid as a type [valid-type] generics_syntax_scoping.py:18: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_scoping.py:26: error: Name "T" is used before definition [used-before-def] generics_syntax_scoping.py:35: error: Name "T" is used before definition [used-before-def] -generics_syntax_scoping.py:44: error: Name "T" is used before definition [used-before-def] -generics_syntax_scoping.py:44: error: Variable "tests.generics_syntax_scoping.T" is not valid as a type [valid-type] -generics_syntax_scoping.py:44: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_scoping.py:92: error: "T" already defined as a type parameter [misc] -generics_syntax_scoping.py:95: error: "T" already defined as a type parameter [misc] -generics_syntax_scoping.py:98: error: "T" already defined as a type parameter [misc] +generics_syntax_scoping.py:35: error: Variable "tests.generics_syntax_scoping.T" is not valid as a type [valid-type] +generics_syntax_scoping.py:35: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_scoping.py:83: error: "T" already defined as a type parameter [misc] +generics_syntax_scoping.py:86: error: "T" already defined as a type parameter [misc] +generics_syntax_scoping.py:89: error: "T" already defined as a type parameter [misc] """ diff --git a/conformance/tests/generics_syntax_scoping.py b/conformance/tests/generics_syntax_scoping.py index 768d8fda7..38c277db1 100644 --- a/conformance/tests/generics_syntax_scoping.py +++ b/conformance/tests/generics_syntax_scoping.py @@ -23,15 +23,6 @@ class Foo[T]: ... -class BaseClassC[T]: - def __init_subclass__(cls, param: type[Foo[T]]) -> None: - ... - - -class ClassC[T](BaseClassC[T], param=Foo[T]): # OK - ... - - print(T) # E: Runtime error: 'T' is not defined From af86235d5b58d4b24b88e65c0ef1d39ceda657a7 Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Tue, 20 Oct 2026 14:09:20 -0700 Subject: [PATCH 299/308] typeddict: disallow nesting Required in itself (#2374) Fixes #2372 --- conformance/results/mypy/typeddicts_required.toml | 4 ++-- conformance/results/pycroscope/typeddicts_required.toml | 4 ++-- conformance/results/pyrefly/typeddicts_required.toml | 4 ++-- conformance/results/pyright/typeddicts_required.toml | 2 +- conformance/results/ty/typeddicts_required.toml | 2 +- conformance/results/zuban/typeddicts_required.toml | 4 ++-- conformance/tests/typeddicts_required.py | 3 ++- docs/spec/typeddict.rst | 1 + 8 files changed, 13 insertions(+), 11 deletions(-) diff --git a/conformance/results/mypy/typeddicts_required.toml b/conformance/results/mypy/typeddicts_required.toml index 85c143e90..bbd8da92a 100644 --- a/conformance/results/mypy/typeddicts_required.toml +++ b/conformance/results/mypy/typeddicts_required.toml @@ -2,8 +2,8 @@ conformant = "Pass" output = """ typeddicts_required.py:12: error: Required[] can be only used in a TypedDict definition [valid-type] typeddicts_required.py:16: error: NotRequired[] can be only used in a TypedDict definition [valid-type] -typeddicts_required.py:59: error: "Required[]" type cannot be nested [valid-type] -typeddicts_required.py:60: error: "NotRequired[]" type cannot be nested [valid-type] +typeddicts_required.py:60: error: "Required[]" type cannot be nested [valid-type] +typeddicts_required.py:61: error: "NotRequired[]" type cannot be nested [valid-type] """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pycroscope/typeddicts_required.toml b/conformance/results/pycroscope/typeddicts_required.toml index 47bf31ca8..26527f84a 100644 --- a/conformance/results/pycroscope/typeddicts_required.toml +++ b/conformance/results/pycroscope/typeddicts_required.toml @@ -4,6 +4,6 @@ errors_diff = """ output = """ ./typeddicts_required.py:12:7: Unexpected Required annotation [invalid_qualifier] ./typeddicts_required.py:16:7: Unexpected NotRequired annotation [invalid_qualifier] -./typeddicts_required.py:59:16: Required[] cannot be nested [invalid_qualifier] -./typeddicts_required.py:60:7: Required[] and NotRequired[] cannot be nested [invalid_qualifier] +./typeddicts_required.py:60:16: Required[] cannot be nested [invalid_qualifier] +./typeddicts_required.py:61:7: Required[] and NotRequired[] cannot be nested [invalid_qualifier] """ diff --git a/conformance/results/pyrefly/typeddicts_required.toml b/conformance/results/pyrefly/typeddicts_required.toml index 8a57a6267..765286b13 100644 --- a/conformance/results/pyrefly/typeddicts_required.toml +++ b/conformance/results/pyrefly/typeddicts_required.toml @@ -6,6 +6,6 @@ output = """ ERROR typeddicts_required.py:12:5-6: `Required` may only be used for TypedDict members [invalid-annotation] ERROR typeddicts_required.py:16:8-19: `NotRequired` is only allowed inside a class body [invalid-annotation] ERROR typeddicts_required.py:16:8-24: `NotRequired` is not allowed in this context [invalid-annotation] -ERROR typeddicts_required.py:59:8-31: Duplicate qualifier `Required` [invalid-annotation] -ERROR typeddicts_required.py:60:8-34: Cannot combine `Required` and `NotRequired` for a TypedDict field [invalid-annotation] +ERROR typeddicts_required.py:60:8-31: Duplicate qualifier `Required` [invalid-annotation] +ERROR typeddicts_required.py:61:8-34: Cannot combine `Required` and `NotRequired` for a TypedDict field [invalid-annotation] """ diff --git a/conformance/results/pyright/typeddicts_required.toml b/conformance/results/pyright/typeddicts_required.toml index b612b7c02..25b433e41 100644 --- a/conformance/results/pyright/typeddicts_required.toml +++ b/conformance/results/pyright/typeddicts_required.toml @@ -2,8 +2,8 @@ conformant = "Pass" output = """ typeddicts_required.py:12:8 - error: "Required" is not allowed in this context (reportInvalidTypeForm) typeddicts_required.py:16:8 - error: "NotRequired" is not allowed in this context (reportInvalidTypeForm) -typeddicts_required.py:59:8 - error: "Required" is not allowed in this context (reportInvalidTypeForm) typeddicts_required.py:60:8 - error: "Required" is not allowed in this context (reportInvalidTypeForm) +typeddicts_required.py:61:8 - error: "Required" is not allowed in this context (reportInvalidTypeForm) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/ty/typeddicts_required.toml b/conformance/results/ty/typeddicts_required.toml index 7f3331fb0..0abae1d27 100644 --- a/conformance/results/ty/typeddicts_required.toml +++ b/conformance/results/ty/typeddicts_required.toml @@ -4,6 +4,6 @@ errors_diff = """ output = """ typeddicts_required.py:12:8: error[invalid-type-form] `Required` is only allowed in TypedDict fields typeddicts_required.py:16:8: error[invalid-type-form] Type qualifier `typing.NotRequired` is not allowed in parameter annotations -typeddicts_required.py:59:8: error[invalid-type-form] `typing.Required` cannot be nested inside `Required` or `NotRequired` typeddicts_required.py:60:8: error[invalid-type-form] `typing.Required` cannot be nested inside `Required` or `NotRequired` +typeddicts_required.py:61:8: error[invalid-type-form] `typing.Required` cannot be nested inside `Required` or `NotRequired` """ diff --git a/conformance/results/zuban/typeddicts_required.toml b/conformance/results/zuban/typeddicts_required.toml index c83d715f6..9d0cc227a 100644 --- a/conformance/results/zuban/typeddicts_required.toml +++ b/conformance/results/zuban/typeddicts_required.toml @@ -4,6 +4,6 @@ errors_diff = """ output = """ typeddicts_required.py:12: error: Required[] can be only used in a TypedDict definition [valid-type] typeddicts_required.py:16: error: NotRequired[] can be only used in a TypedDict definition [valid-type] -typeddicts_required.py:59: error: "Required[]" type cannot be nested [misc] -typeddicts_required.py:60: error: "NotRequired[]" type cannot be nested [misc] +typeddicts_required.py:60: error: "Required[]" type cannot be nested [misc] +typeddicts_required.py:61: error: "NotRequired[]" type cannot be nested [misc] """ diff --git a/conformance/tests/typeddicts_required.py b/conformance/tests/typeddicts_required.py index d4cef0142..42cecaae8 100644 --- a/conformance/tests/typeddicts_required.py +++ b/conformance/tests/typeddicts_required.py @@ -56,12 +56,13 @@ class TD5(TypedDict, total=True): class TD6(TypedDict): + # > It is also an error to nest a qualifier within itself (e.g., ``Required[Required[T]]``). a: Required[Required[int]] # E: Nesting not allowed b: Required[NotRequired[int]] # E: Nesting not allowed class TD7(TypedDict): - # > Required[] and NotRequired[] can be used with Annotated[], in any nesting order. + # > These type qualifiers may be nested arbitrarily or wrapped in ``Annotated[]``. x: Annotated[Required[int], ""] y: Required[Annotated[int, ""]] z: Annotated[Required[Annotated[int, ""]], ""] diff --git a/docs/spec/typeddict.rst b/docs/spec/typeddict.rst index cff7e8499..726647ef8 100644 --- a/docs/spec/typeddict.rst +++ b/docs/spec/typeddict.rst @@ -143,6 +143,7 @@ expression contains a :term:`type expression`, optionally qualified with one of :term:`type qualifiers ` ``Required``, ``NotRequired``, or ``ReadOnly``. These type qualifiers may be nested arbitrarily or wrapped in ``Annotated[]``. It is an error to use both ``Required`` and ``NotRequired`` in the same item definition. +It is also an error to nest a qualifier within itself (e.g., ``Required[Required[T]]``). An item is :term:`read-only` if and only if the ``ReadOnly`` qualifier is used. To determine whether an item is :term:`required` or :term:`non-required`, the following From aa8dab0b63a538330362b9fbaf7ab89ec34e9549 Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Sat, 24 Oct 2026 22:36:44 -0400 Subject: [PATCH 300/308] Update ty results for v0.0.91 (#2376) --- conformance/results/results.html | 13 ++----- conformance/results/ty/generics_basic.toml | 12 ++---- .../ty/generics_defaults_specialization.toml | 1 - conformance/results/ty/version.toml | 2 +- conformance/uv.lock | 38 +++++++++---------- 5 files changed, 28 insertions(+), 38 deletions(-) diff --git a/conformance/results/results.html b/conformance/results/results.html index 8106b6714..849148007 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -268,7 +268,7 @@

    Python Type System Conformance Test Results

    - + @@ -564,12 +564,7 @@

    Python Type System Conformance Test Results

    - + @@ -951,7 +946,7 @@

    Python Type System Conformance Test Results

    - + @@ -2577,7 +2572,7 @@

    Python Type System Conformance Test Results

    - + diff --git a/conformance/results/ty/generics_basic.toml b/conformance/results/ty/generics_basic.toml index 4b2b392c1..b700f0fd5 100644 --- a/conformance/results/ty/generics_basic.toml +++ b/conformance/results/ty/generics_basic.toml @@ -1,16 +1,12 @@ -conformance_automated = "Fail" -conformant = "Partial" -notes = """ -Incorrectly allows constrained type variables to be solved to a union of their constraints. -""" +conformance_automated = "Pass" errors_diff = """ -Line 40: Expected 1 errors -Line 41: Expected 1 errors -Line 69: Expected 1 errors """ output = """ +generics_basic.py:40:5: error[invalid-argument-type] Argument to function `concat` is incorrect: Inferred lower bound `str | bytes` does not satisfy constraints (`str`, `bytes`) of type variable `AnyStr` +generics_basic.py:41:5: error[invalid-argument-type] Argument to function `concat` is incorrect: Inferred lower bound `bytes | str` does not satisfy constraints (`str`, `bytes`) of type variable `AnyStr` generics_basic.py:49:44: error[invalid-legacy-type-variable] A `TypeVar` cannot have exactly one constraint generics_basic.py:55:53: error[invalid-type-variable-constraints] TypeVar constraint cannot be generic +generics_basic.py:69:5: error[invalid-argument-type] Argument to function `concat` is incorrect: Inferred lower bound `MyStr | bytes` does not satisfy constraints (`str`, `bytes`) of type variable `AnyStr` generics_basic.py:121:13: error[invalid-generic-class] Type parameter `T` cannot appear multiple times in `Generic` subscription generics_basic.py:157:5: error[invalid-argument-type] Method `__getitem__` of type `bound method MyMap1[str, int].__getitem__(key: str, /) -> int` cannot be called with key of type `Literal[0]` on object of type `MyMap1[str, int]` generics_basic.py:158:5: error[invalid-argument-type] Method `__getitem__` of type `bound method MyMap2[int, str].__getitem__(key: str, /) -> int` cannot be called with key of type `Literal[0]` on object of type `MyMap2[int, str]` diff --git a/conformance/results/ty/generics_defaults_specialization.toml b/conformance/results/ty/generics_defaults_specialization.toml index 01b15f588..4e121cd3d 100644 --- a/conformance/results/ty/generics_defaults_specialization.toml +++ b/conformance/results/ty/generics_defaults_specialization.toml @@ -3,6 +3,5 @@ errors_diff = """ """ output = """ generics_defaults_specialization.py:30:15: error[invalid-type-arguments] Too many type arguments: expected between 0 and 1, got 2 -generics_defaults_specialization.py:48:22: error[invalid-assignment] Object of type `` is not assignable to `type[Bar[int]]` generics_defaults_specialization.py:58:1: error[not-subscriptable] Cannot specialize non-generic class `Foo` """ diff --git a/conformance/results/ty/version.toml b/conformance/results/ty/version.toml index 8aff9887d..1c2f6523e 100644 --- a/conformance/results/ty/version.toml +++ b/conformance/results/ty/version.toml @@ -1 +1 @@ -version = "ty 0.0.83" +version = "ty 0.0.91" diff --git a/conformance/uv.lock b/conformance/uv.lock index 3c2cecd9b..e39c6becf 100644 --- a/conformance/uv.lock +++ b/conformance/uv.lock @@ -202,27 +202,27 @@ wheels = [ [[package]] name = "ty" -version = "0.0.83" +version = "0.0.91" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/3b/7d/2fd9575bce2d14e2281bec82d0713dee68329b0dc944e9c06c2e36b761fe/ty-0.0.83.tar.gz", hash = "sha256:db118de73c05ac476faceb4d42d59782feaeddfc4d721fd3ae8b807a0a2ae4e4", size = 7373076, upload-time = "2026-09-21T22:47:29.207Z" } +sdist = { url = "https://files.pythonhosted.org/packages/08/c0/9e26817a5c94d504aab30bffbbf53f836f4763dd0a947089246ff555eebe/ty-0.0.91.tar.gz", hash = "sha256:b9c434cc1e3b106b6b9353b78ef304d5904c82cf440abcafef7134270a22b41a", size = 8035848, upload-time = "2026-10-22T18:24:52.086Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/bf/85/7259431bade2317d8b82fa27220ae4618c21396acf0ca28a7bd75e92afd7/ty-0.0.83-py3-none-linux_armv6l.whl", hash = "sha256:836bc08bad96ecc7e38baf1a6ddaec15aa8c8b46ae99a96365397b5f6481b7a5", size = 13905669, upload-time = "2026-09-21T22:46:36.677Z" }, - { url = "https://files.pythonhosted.org/packages/d2/30/9527386ade8dd71fc52f65cde3c094411af7ad0d505f9063ef0841998702/ty-0.0.83-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:0f1fb029fe076c7dca404d98e38fdb5fdbc2038a09407f89d43be1fdd9b2c459", size = 13499505, upload-time = "2026-09-21T22:46:40.114Z" }, - { url = "https://files.pythonhosted.org/packages/a0/54/63080d8cfd59a53810499a69a2ebc995724be27618b70d7f099e73ace317/ty-0.0.83-py3-none-macosx_11_0_arm64.whl", hash = "sha256:3515776d01ee3b1be974dafa73d449d0bc711afbc12ba341f82f70bc641ff4ee", size = 13498980, upload-time = "2026-09-21T22:46:43.197Z" }, - { url = "https://files.pythonhosted.org/packages/49/78/e647f190bd9513d09db30d45309e9b5df070b5caa44af2de3290fab59fbe/ty-0.0.83-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c5b80d66c7f9c8d60f25ccfd40c6eaebe8fd7c9005074904e0e164dd89c13d03", size = 13494705, upload-time = "2026-09-21T22:46:46.106Z" }, - { url = "https://files.pythonhosted.org/packages/2e/12/aef645b13c5bd15e3e5993537dbc23f7d65475f3cf1755d07b4d3e56850d/ty-0.0.83-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:57eae4aa55dab1af5d1423227c6517ccab1e658fe265c8e5a58caa584ca2876b", size = 13661466, upload-time = "2026-09-21T22:46:49.392Z" }, - { url = "https://files.pythonhosted.org/packages/d4/c4/11872e823653c568468ef7f0c3b23aed7ad2d33652e20144d28d5bfad58a/ty-0.0.83-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:dea3680911340ecf93dff5786dbeefd69c9399df685a22751e1fbd27e6007b50", size = 14479677, upload-time = "2026-09-21T22:46:52.277Z" }, - { url = "https://files.pythonhosted.org/packages/8e/db/5b0d0d24d16d24d781f29ee842ee718903e453dc4068acb02bef860d5540/ty-0.0.83-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8453786c274f48e2a89b78e8a505a4f449323f357f2ce26a9b90a4bd68176f67", size = 14972208, upload-time = "2026-09-21T22:46:55.242Z" }, - { url = "https://files.pythonhosted.org/packages/54/04/0077a53bcf6ceb41365a45d8091b52094c91a5f4b071c2a6d705ed8bb65b/ty-0.0.83-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:7701bdae3b52271cf0835abe4202aa3b23b735425d8c5a3e6a8ca1c68d39ead8", size = 14660550, upload-time = "2026-09-21T22:46:58.256Z" }, - { url = "https://files.pythonhosted.org/packages/d4/ff/b6c879f1c3121387edd19ebdb1fb02af30691f88f632278a5d467fb5f348/ty-0.0.83-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:aa95b4376447e5309fe3ccc98ee75916a9082714e6a029b99427ca62021dc94a", size = 14147376, upload-time = "2026-09-21T22:47:01.167Z" }, - { url = "https://files.pythonhosted.org/packages/0d/bc/82e730247d53cb02acd5a91237c0c62f215b2e0379689a550176d307ed89/ty-0.0.83-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:2a4550a08fc1899a33e4a08787a73ec9daa99d292268df4f0a5f1c24c63854c3", size = 14567502, upload-time = "2026-09-21T22:47:04.344Z" }, - { url = "https://files.pythonhosted.org/packages/67/13/bb6f57923231f51b626931625ada71e219d64541f8fadf96065bc5034358/ty-0.0.83-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:feb72080f0835fa2b27485e3b11fa50dc57c30e0ba73808a3f7d64b56db83f6f", size = 13443051, upload-time = "2026-09-21T22:47:07.316Z" }, - { url = "https://files.pythonhosted.org/packages/50/20/9862431662d4453527cd52cf0f30d5975cd1801aa39e570bf45fb299be77/ty-0.0.83-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:3e5206def2d6e1df93c75ed8dc763255233ccc3153647509d125bada10ad770a", size = 13678908, upload-time = "2026-09-21T22:47:10.714Z" }, - { url = "https://files.pythonhosted.org/packages/d7/e3/94ebbe1573b76660fa09f2dbce96da6d0bb69a2d29c7b6ad538b452979d4/ty-0.0.83-py3-none-musllinux_1_2_i686.whl", hash = "sha256:bdf5dfa157f5c127ba096fe0561b47877e6e79562c7fc2b35906ba5e9f6bb723", size = 13937248, upload-time = "2026-09-21T22:47:14.133Z" }, - { url = "https://files.pythonhosted.org/packages/2f/c0/3ea45c2ec3a82fddb7137e457ccb2a452446905430d225adaa4990cdc338/ty-0.0.83-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:626d6ad00f05a5d9b7ea80de44b12931d0c0fb50e64eab20b7fcc13e9aff2a68", size = 14290826, upload-time = "2026-09-21T22:47:16.874Z" }, - { url = "https://files.pythonhosted.org/packages/d8/b2/c941ce83a59e46ef31dd04bdf6067530e7ec77d5f0cdd1e223fbc6fc351b/ty-0.0.83-py3-none-win32.whl", hash = "sha256:0391017dac6ba3e452e0322301f50bba12fbccadac07d7fd888c46951ad37638", size = 13105291, upload-time = "2026-09-21T22:47:19.807Z" }, - { url = "https://files.pythonhosted.org/packages/b2/8a/5eef9458505698b144643cbd2062f465c5d860d8cf86a8710d74505ad9a0/ty-0.0.83-py3-none-win_amd64.whl", hash = "sha256:1b67d86f5bbad4076ae1a2ff23a6a4493219885d72d4b148cb0193e090390060", size = 13901557, upload-time = "2026-09-21T22:47:23.429Z" }, - { url = "https://files.pythonhosted.org/packages/9f/27/a06061513f1de25569c2e8898018bd552ab7b31afa7cfe818703269b3350/ty-0.0.83-py3-none-win_arm64.whl", hash = "sha256:a916a3d7d68fe30b7aacdb9fe16d461fa944d722e59e96ea0fa9d206a1b6625f", size = 13627960, upload-time = "2026-09-21T22:47:26.305Z" }, + { url = "https://files.pythonhosted.org/packages/be/ad/0a850c1ca8e6e802e6b0f730f0d59c9769845b2fc956e3acd7f429b665f2/ty-0.0.91-py3-none-linux_armv6l.whl", hash = "sha256:5d39e6e485854838eb7fcdb747495f5b90283d58bce869c17445120fe0c7e40a", size = 14255787, upload-time = "2026-10-22T18:24:11.284Z" }, + { url = "https://files.pythonhosted.org/packages/33/87/9ccfa2d97b8b043e4d6fab10febc50ac7856b02cf7cd64910085db806bbe/ty-0.0.91-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:dcf953e25f90fbccf6cc27ef43fc4ef0961c89f54866e32cd1d7f24891b96084", size = 13822267, upload-time = "2026-10-22T18:24:14.31Z" }, + { url = "https://files.pythonhosted.org/packages/13/33/be8f62444c7840d1b0928c6d174540c0fe6b1b193ae9324c8249e8ed52b9/ty-0.0.91-py3-none-macosx_11_0_arm64.whl", hash = "sha256:78e3e66e88a9ae903afe0981ff9bd225d452ade2aeb070715842510dfcbf6de4", size = 12957620, upload-time = "2026-10-22T18:24:16.961Z" }, + { url = "https://files.pythonhosted.org/packages/31/9f/a742f273c065c4f5a054cc2b44076207136ff1cd346adfb23da38d8894d8/ty-0.0.91-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:89ecaf87b3d7b508f9ea1ef8715d4cf47942719659028c92fad819d82a82ccfa", size = 13746018, upload-time = "2026-10-22T18:24:19.221Z" }, + { url = "https://files.pythonhosted.org/packages/5a/a0/3eecf8717cbe4e05d6e02b53679aebad79f1bfcff6c9c03d7601cb7df5f9/ty-0.0.91-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:0ec8fe4243aab445abece38a2b8e9b3010230d5e6b3f4e15bfa811a914d99e73", size = 13993220, upload-time = "2026-10-22T18:24:21.328Z" }, + { url = "https://files.pythonhosted.org/packages/09/b0/fb3edee2857e97d85b6c735901469fd523cf6792382e4fbbb00b065c186c/ty-0.0.91-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:577701ec2a9cf7a50f6059069399b9437bb8af7a99df24012776e95d8a55831f", size = 14936911, upload-time = "2026-10-22T18:24:24.393Z" }, + { url = "https://files.pythonhosted.org/packages/b7/2c/82f29ee86f4171807af8ab2feaf4e51211143118a3e53e9da2c2e77eca7d/ty-0.0.91-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:fc683f49197d63ec47b2eaa9763ddb32dafb2a31190d938b9bb8ebecc5b25173", size = 15336384, upload-time = "2026-10-22T18:24:26.472Z" }, + { url = "https://files.pythonhosted.org/packages/0b/85/e2419b19577ead84b8afa9137c12eb4bde19f926423bfe01e615db12c52c/ty-0.0.91-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b8bb2784572fa22f77e417844936f6a9f831a6b0ba64749ca1065c407aefcd23", size = 15332319, upload-time = "2026-10-22T18:24:28.979Z" }, + { url = "https://files.pythonhosted.org/packages/83/06/dc28cea0796ee0268bf987d1d6f0f168605bec8898dbdbc7676049d2667b/ty-0.0.91-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f68bb6bfc8171910335a47c7e84070f28bbbc0326bcd6ef08fe3690d0509556b", size = 14600250, upload-time = "2026-10-22T18:24:31.359Z" }, + { url = "https://files.pythonhosted.org/packages/1e/71/83dd28e628698059ba6fe7081acafa7a8f65cfd90fe6573907ca8219d561/ty-0.0.91-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:63f268c80697d614d18e988476d2517177d66ec732ae104d86e57b60f197a416", size = 14812339, upload-time = "2026-10-22T18:24:33.689Z" }, + { url = "https://files.pythonhosted.org/packages/9d/5a/63c0eae2d5b02cef98a9b327b1a16b36287c140b3a7d2306ff7560177f9c/ty-0.0.91-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:b0f34630aa92e222d7754d66222d116f027025cb2b9ed66e1b4b73623de74e84", size = 13703060, upload-time = "2026-10-22T18:24:36.278Z" }, + { url = "https://files.pythonhosted.org/packages/47/ac/fd6d20d00202949d775043c5f70679f38d0e48ea30eeacbffaf6e0a9754e/ty-0.0.91-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:e62f8bbc17d481e01cce39bdfbe36beefda0478cb210e8045ef618d3f674a731", size = 14006236, upload-time = "2026-10-22T18:24:38.464Z" }, + { url = "https://files.pythonhosted.org/packages/fa/26/53dddd4f927dfaa73ea14cd71d97b4d92d685e365b5b037bac457e271403/ty-0.0.91-py3-none-musllinux_1_2_i686.whl", hash = "sha256:f8bf4514a383b13d7cf86eddb55f0eb9f356fc7efeae0de714ad4fe5fc54fee8", size = 14356612, upload-time = "2026-10-22T18:24:40.621Z" }, + { url = "https://files.pythonhosted.org/packages/89/40/ccebba145dd244b2f6058ce2e4a6ff34dea36d4a5b38dd7a6ae983b65a3b/ty-0.0.91-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:a6d93ab988c4c5ed92b52389b888d46ddede78e4646fe28db615bbeff89cdf82", size = 14674843, upload-time = "2026-10-22T18:24:43.325Z" }, + { url = "https://files.pythonhosted.org/packages/08/6f/8a7701adf1f539a893274358f12ba62773d5bb40920bfc53e0d852bfd576/ty-0.0.91-py3-none-win32.whl", hash = "sha256:b9f4bba8486a3d13babc11f8115369d0a0dc8bef127b7cf4f4c5eed9d4dbfa01", size = 13260545, upload-time = "2026-10-22T18:24:45.715Z" }, + { url = "https://files.pythonhosted.org/packages/fc/63/27c8051a72328ee81f47dace5e2c63e7db43bcae935db25a9dbd4d0e59b2/ty-0.0.91-py3-none-win_amd64.whl", hash = "sha256:5ac9eaf938e7fba4dd6c3358f852e6eb3127aa7bde0a76d9807c41f60ad73a29", size = 13759484, upload-time = "2026-10-22T18:24:48.111Z" }, + { url = "https://files.pythonhosted.org/packages/aa/a9/1f6c3694b7b33be4ae9a272f71a99a7dd27ec020c32a22049e9c0e79f576/ty-0.0.91-py3-none-win_arm64.whl", hash = "sha256:35820957639db1fb8c643273670967192c308038836005bdf3bfef111aff64a0", size = 13318343, upload-time = "2026-10-22T18:24:50.116Z" }, ] [[package]] From e6a6061b127b53b3b30a58c63e3714bda3cd22db Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Wed, 28 Oct 2026 09:43:56 -0700 Subject: [PATCH 301/308] Update ty results for v0.0.93 (#2378) --- conformance/results/results.html | 21 +++------- conformance/results/ty/aliases_explicit.toml | 40 +++++++++---------- conformance/results/ty/aliases_implicit.toml | 39 ++++++++---------- .../results/ty/aliases_type_statement.toml | 26 ++++++------ .../results/ty/aliases_typealiastype.toml | 2 +- .../results/ty/annotations_forward_refs.toml | 2 +- .../results/ty/annotations_typeexpr.toml | 2 +- conformance/results/ty/classes_classvar.toml | 2 +- .../results/ty/generics_paramspec_basic.toml | 2 +- .../ty/generics_syntax_declarations.toml | 2 +- .../results/ty/typeforms_typeform.toml | 2 +- conformance/results/ty/version.toml | 2 +- conformance/uv.lock | 38 +++++++++--------- 13 files changed, 80 insertions(+), 100 deletions(-) diff --git a/conformance/results/results.html b/conformance/results/results.html index 849148007..4fefddd4e 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -268,7 +268,7 @@

    Python Type System Conformance Test Results

    - + @@ -1087,12 +1087,7 @@

    Python Type System Conformance Test Results

    - + @@ -1107,13 +1102,7 @@

    Python Type System Conformance Test Results

    - + @@ -1184,7 +1173,7 @@

    Python Type System Conformance Test Results

    - + @@ -2572,7 +2561,7 @@

    Python Type System Conformance Test Results

    - + diff --git a/conformance/results/ty/aliases_explicit.toml b/conformance/results/ty/aliases_explicit.toml index 217de53b7..3c0a12246 100644 --- a/conformance/results/ty/aliases_explicit.toml +++ b/conformance/results/ty/aliases_explicit.toml @@ -1,30 +1,26 @@ -conformance_automated = "Fail" -conformant = "Partial" -notes = """ -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. -""" +conformance_automated = "Pass" errors_diff = """ -Line 100: Expected 1 errors """ output = """ -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:67:9: error[not-subscriptable] Cannot subscript non-generic type `int | None` +aliases_explicit.py:68:9: error[not-subscriptable] Cannot subscript non-generic type `list[int | None]` aliases_explicit.py:69:29: error[invalid-type-arguments] Too many type arguments: expected 1, got 2 aliases_explicit.py:70:29: error[invalid-type-arguments] Too many type arguments: expected 1, got 2 aliases_explicit.py:71:24: error[invalid-type-arguments] Type argument for `ParamSpec` must be either a list of types, `ParamSpec`, `Concatenate`, or `...` -aliases_explicit.py:79:21: error[invalid-type-form] Function calls are not allowed in type alias values -aliases_explicit.py:80:21: error[invalid-type-form] List literals are not allowed in this context in a type alias value -aliases_explicit.py:81:21: error[invalid-type-form] Tuple literals are not allowed in this context in a type alias value -aliases_explicit.py:82:21: error[invalid-type-form] List comprehensions are not allowed in type alias values -aliases_explicit.py:83:21: error[invalid-type-form] Dict literals are not allowed in type alias values -aliases_explicit.py:84:21: error[invalid-type-form] Function calls are not allowed in type alias values -aliases_explicit.py:85:21: error[invalid-type-form] Only simple names and dotted names can be subscripted in type alias values -aliases_explicit.py:86:21: error[invalid-type-form] `if` expressions are not allowed in type alias values -aliases_explicit.py:87:21: error[invalid-type-form] Variable of type `Literal[3]` is not allowed in a type alias value -aliases_explicit.py:88:22: error[invalid-type-form] Boolean literals are not allowed in this context in a type alias value: Did you mean `typing.Literal[True]`? -aliases_explicit.py:89:22: error[invalid-type-form] Int literals are not allowed in this context in a type alias value: Did you mean `typing.Literal[1]`? -aliases_explicit.py:90:22: error[invalid-type-form] Boolean operations are not allowed in type alias values -aliases_explicit.py:91:22: error[invalid-type-form] F-strings are not allowed in type alias values +aliases_explicit.py:79:21: error[invalid-type-form] Function calls are not allowed in type alias definitions +aliases_explicit.py:80:21: error[invalid-type-form] List literals are not allowed in this context in a type alias definition +aliases_explicit.py:81:21: error[invalid-type-form] Tuple literals are not allowed in this context in a type alias definition +aliases_explicit.py:82:21: error[invalid-type-form] List comprehensions are not allowed in type alias definitions +aliases_explicit.py:83:21: error[invalid-type-form] Dict literals are not allowed in type alias definitions +aliases_explicit.py:84:21: error[invalid-type-form] Function calls are not allowed in type alias definitions +aliases_explicit.py:85:21: error[invalid-type-form] Only simple names and dotted names can be subscripted in type alias definitions +aliases_explicit.py:86:21: error[invalid-type-form] `if` expressions are not allowed in type alias definitions +aliases_explicit.py:87:21: error[invalid-type-form] Variable `var1` cannot be used as a type: Variable of type `Literal[3]` is not allowed in a type alias definition +aliases_explicit.py:88:22: error[invalid-type-form] Boolean literals are not allowed in this context in a type alias definition: Did you mean `typing.Literal[True]`? +aliases_explicit.py:89:22: error[invalid-type-form] Int literals are not allowed in this context in a type alias definition: Did you mean `typing.Literal[1]`? +aliases_explicit.py:90:22: error[invalid-type-form] Boolean operations are not allowed in type alias definitions +aliases_explicit.py:91:22: error[invalid-type-form] F-strings are not allowed in type alias definitions +aliases_explicit.py:100:5: error[not-subscriptable] Cannot subscript non-generic type `list[Unknown]` aliases_explicit.py:101:6: error[call-non-callable] Object of type `UnionType` is not callable -aliases_explicit.py:102:5: error[not-subscriptable] Cannot subscript non-generic type `` +aliases_explicit.py:102:5: error[not-subscriptable] Cannot subscript non-generic type `list[Unknown] | set[Unknown]` """ diff --git a/conformance/results/ty/aliases_implicit.toml b/conformance/results/ty/aliases_implicit.toml index 5cd4682e0..740ed43de 100644 --- a/conformance/results/ty/aliases_implicit.toml +++ b/conformance/results/ty/aliases_implicit.toml @@ -1,32 +1,27 @@ -conformance_automated = "Fail" -conformant = "Partial" -notes = """ -Does not reject variables with `Any` or `Unknown` types when used as implicit type aliases. -Falls short on full syntactic validation of type aliases. -""" +conformance_automated = "Pass" errors_diff = """ -Line 106: Expected 1 errors -Line 111: Expected 1 errors -Line 112: Expected 1 errors -Line 113: Expected 1 errors -Line 117: Expected 1 errors """ output = """ -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:76:9: error[not-subscriptable] Cannot subscript non-generic type `int | None` +aliases_implicit.py:77:9: error[not-subscriptable] Cannot subscript non-generic type `list[int | None]` aliases_implicit.py:78:29: error[invalid-type-arguments] Too many type arguments: expected 1, got 2 aliases_implicit.py:79:29: error[invalid-type-arguments] Too many type arguments: expected 1, got 2 aliases_implicit.py:80:24: error[invalid-type-arguments] Type argument for `ParamSpec` must be either a list of types, `ParamSpec`, `Concatenate`, or `...` aliases_implicit.py:81:25: error[invalid-type-arguments] Type `str` is not assignable to upper bound `float` of type variable `TFloat@GoodTypeAlias12` -aliases_implicit.py:107:9: error[invalid-type-form] Variable of type `list[ | ]` is not allowed in a parameter annotation -aliases_implicit.py:108:9: error[invalid-type-form] Variable of type `tuple[tuple[, ]]` is not allowed in a parameter annotation -aliases_implicit.py:109:9: error[invalid-type-form] Variable of type `list[]` is not allowed in a parameter annotation -aliases_implicit.py:110:9: error[invalid-type-form] Variable of type `dict[str, str]` is not allowed in a parameter annotation -aliases_implicit.py:114:9: error[invalid-type-form] Variable of type `Literal[3]` is not allowed in a parameter annotation -aliases_implicit.py:115:10: error[invalid-type-form] Variable of type `Literal[True]` is not allowed in a parameter annotation -aliases_implicit.py:116:10: error[invalid-type-form] Variable of type `Literal[1]` is not allowed in a parameter annotation -aliases_implicit.py:118:10: error[invalid-type-form] Variable of type `Literal["int"]` is not allowed in a parameter annotation +aliases_implicit.py:106:9: error[invalid-type-form] Variable `BadTypeAlias1` cannot be used as a type +aliases_implicit.py:107:9: error[invalid-type-form] Variable `BadTypeAlias2` cannot be used as a type: Variable of type `list[ | ]` is not allowed in a parameter annotation +aliases_implicit.py:108:9: error[invalid-type-form] Variable `BadTypeAlias3` cannot be used as a type: Variable of type `tuple[tuple[, ]]` is not allowed in a parameter annotation +aliases_implicit.py:109:9: error[invalid-type-form] Variable `BadTypeAlias4` cannot be used as a type: Variable of type `list[]` is not allowed in a parameter annotation +aliases_implicit.py:110:9: error[invalid-type-form] Variable `BadTypeAlias5` cannot be used as a type: Variable of type `dict[str, str]` is not allowed in a parameter annotation +aliases_implicit.py:111:9: error[invalid-type-form] Variable `BadTypeAlias6` cannot be used as a type +aliases_implicit.py:112:9: error[invalid-type-form] Variable `BadTypeAlias7` cannot be used as a type +aliases_implicit.py:113:9: error[invalid-type-form] Variable `BadTypeAlias8` cannot be used as a type +aliases_implicit.py:114:9: error[invalid-type-form] Variable `BadTypeAlias9` cannot be used as a type +aliases_implicit.py:115:10: error[invalid-type-form] Variable `BadTypeAlias10` cannot be used as a type: Variable of type `Literal[True]` is not allowed in a parameter annotation +aliases_implicit.py:116:10: error[invalid-type-form] Variable `BadTypeAlias11` cannot be used as a type: Variable of type `Literal[1]` is not allowed in a parameter annotation +aliases_implicit.py:117:10: error[invalid-type-form] Variable `BadTypeAlias12` cannot be used as a type +aliases_implicit.py:118:10: error[invalid-type-form] Variable `BadTypeAlias13` cannot be used as a type: Variable of type `Literal["int"]` is not allowed in a parameter annotation aliases_implicit.py:119:10: error[invalid-type-form] Variable of type `Literal["int | str"]` is not allowed in a parameter annotation aliases_implicit.py:133:6: error[call-non-callable] Object of type `UnionType` is not callable -aliases_implicit.py:135:5: error[not-subscriptable] Cannot subscript non-generic type `` +aliases_implicit.py:135:5: error[not-subscriptable] Cannot subscript non-generic type `list[Unknown] | set[Unknown]` """ diff --git a/conformance/results/ty/aliases_type_statement.toml b/conformance/results/ty/aliases_type_statement.toml index ecf347637..3ad6d2304 100644 --- a/conformance/results/ty/aliases_type_statement.toml +++ b/conformance/results/ty/aliases_type_statement.toml @@ -7,19 +7,19 @@ aliases_type_statement.py:19:1: error[call-non-callable] Object of type `TypeAli aliases_type_statement.py:23:7: error[unresolved-attribute] Object of type `TypeAliasType` has no attribute `other_attrib` aliases_type_statement.py:26:18: error[invalid-base] Invalid class base with type `TypeAliasType` aliases_type_statement.py:31:22: error[invalid-argument-type] Argument to function `isinstance` is incorrect: Expected `_ClassInfo`, found `TypeAliasType` -aliases_type_statement.py:37:22: error[invalid-type-form] Function calls are not allowed in type alias values -aliases_type_statement.py:38:22: error[invalid-type-form] List literals are not allowed in this context in a type alias value -aliases_type_statement.py:39:22: error[invalid-type-form] Tuple literals are not allowed in this context in a type alias value -aliases_type_statement.py:40:22: error[invalid-type-form] List comprehensions are not allowed in type alias values -aliases_type_statement.py:41:22: error[invalid-type-form] Dict literals are not allowed in type alias values -aliases_type_statement.py:42:22: error[invalid-type-form] Function calls are not allowed in type alias values -aliases_type_statement.py:43:22: error[invalid-type-form] Only simple names and dotted names can be subscripted in type alias values -aliases_type_statement.py:44:22: error[invalid-type-form] `if` expressions are not allowed in type alias values -aliases_type_statement.py:45:22: error[invalid-type-form] Variable of type `Literal[1]` is not allowed in a type alias value -aliases_type_statement.py:46:23: error[invalid-type-form] Boolean literals are not allowed in this context in a type alias value: Did you mean `typing.Literal[True]`? -aliases_type_statement.py:47:23: error[invalid-type-form] Int literals are not allowed in this context in a type alias value: Did you mean `typing.Literal[1]`? -aliases_type_statement.py:48:23: error[invalid-type-form] Boolean operations are not allowed in type alias values -aliases_type_statement.py:49:23: error[invalid-type-form] F-strings are not allowed in type alias values +aliases_type_statement.py:37:22: error[invalid-type-form] Function calls are not allowed in type alias definitions +aliases_type_statement.py:38:22: error[invalid-type-form] List literals are not allowed in this context in a type alias definition +aliases_type_statement.py:39:22: error[invalid-type-form] Tuple literals are not allowed in this context in a type alias definition +aliases_type_statement.py:40:22: error[invalid-type-form] List comprehensions are not allowed in type alias definitions +aliases_type_statement.py:41:22: error[invalid-type-form] Dict literals are not allowed in type alias definitions +aliases_type_statement.py:42:22: error[invalid-type-form] Function calls are not allowed in type alias definitions +aliases_type_statement.py:43:22: error[invalid-type-form] Only simple names and dotted names can be subscripted in type alias definitions +aliases_type_statement.py:44:22: error[invalid-type-form] `if` expressions are not allowed in type alias definitions +aliases_type_statement.py:45:22: error[invalid-type-form] Variable `var1` cannot be used as a type: Variable of type `Literal[1]` is not allowed in a type alias definition +aliases_type_statement.py:46:23: error[invalid-type-form] Boolean literals are not allowed in this context in a type alias definition: Did you mean `typing.Literal[True]`? +aliases_type_statement.py:47:23: error[invalid-type-form] Int literals are not allowed in this context in a type alias definition: Did you mean `typing.Literal[1]`? +aliases_type_statement.py:48:23: error[invalid-type-form] Boolean operations are not allowed in type alias definitions +aliases_type_statement.py:49:23: error[invalid-type-form] F-strings are not allowed in type alias definitions aliases_type_statement.py:53:23: error[unbound-type-variable] Type variable `V` is not bound to any outer generic context aliases_type_statement.py:58:17: error[unbound-type-variable] Type variable `T1` is not bound to any outer generic context aliases_type_statement.py:68:27: error[invalid-type-arguments] Type `str` is not assignable to upper bound `int` of type variable `S@RecursiveTypeAlias2` diff --git a/conformance/results/ty/aliases_typealiastype.toml b/conformance/results/ty/aliases_typealiastype.toml index e2814fcc2..db6cdc7c4 100644 --- a/conformance/results/ty/aliases_typealiastype.toml +++ b/conformance/results/ty/aliases_typealiastype.toml @@ -19,7 +19,7 @@ aliases_typealiastype.py:56:42: error[invalid-type-form] Dict literals are not a aliases_typealiastype.py:57:42: error[invalid-type-form] Function calls are not allowed in type expressions aliases_typealiastype.py:58:42: error[invalid-type-form] Only simple names and dotted names can be subscripted in type expressions aliases_typealiastype.py:59:42: error[invalid-type-form] `if` expressions are not allowed in type expressions -aliases_typealiastype.py:60:42: error[invalid-type-form] Variable of type `Literal[3]` is not allowed in a type expression +aliases_typealiastype.py:60:42: error[invalid-type-form] Variable `var1` cannot be used as a type: Variable of type `Literal[3]` is not allowed in a type expression aliases_typealiastype.py:61:42: error[invalid-type-form] Boolean literals are not allowed in this context in a type expression: Did you mean `typing.Literal[True]`? aliases_typealiastype.py:62:42: error[invalid-type-form] Int literals are not allowed in this context in a type expression: Did you mean `typing.Literal[1]`? aliases_typealiastype.py:63:42: error[invalid-type-form] Boolean operations are not allowed in type expressions diff --git a/conformance/results/ty/annotations_forward_refs.toml b/conformance/results/ty/annotations_forward_refs.toml index 540dc2823..5d067ef53 100644 --- a/conformance/results/ty/annotations_forward_refs.toml +++ b/conformance/results/ty/annotations_forward_refs.toml @@ -14,7 +14,7 @@ annotations_forward_refs.py:45:10: error[invalid-type-form] Dict literals are no annotations_forward_refs.py:46:10: error[invalid-type-form] Function calls are not allowed in parameter annotations annotations_forward_refs.py:47:10: error[invalid-type-form] Only simple names and dotted names can be subscripted in parameter annotations annotations_forward_refs.py:48:10: error[invalid-type-form] `if` expressions are not allowed in parameter annotations -annotations_forward_refs.py:49:10: error[invalid-type-form] Variable of type `Literal[1]` is not allowed in a parameter annotation +annotations_forward_refs.py:49:10: error[invalid-type-form] Variable `var1` cannot be used as a type: Variable of type `Literal[1]` is not allowed in a parameter annotation annotations_forward_refs.py:50:11: error[invalid-type-form] Boolean literals are not allowed in this context in a parameter annotation: Did you mean `typing.Literal[True]`? annotations_forward_refs.py:51:11: error[invalid-type-form] Int literals are not allowed in this context in a parameter annotation: Did you mean `typing.Literal[1]`? annotations_forward_refs.py:52:11: error[invalid-type-form] Unary operations are not allowed in parameter annotations diff --git a/conformance/results/ty/annotations_typeexpr.toml b/conformance/results/ty/annotations_typeexpr.toml index 96d3d212d..0242d5dc9 100644 --- a/conformance/results/ty/annotations_typeexpr.toml +++ b/conformance/results/ty/annotations_typeexpr.toml @@ -10,7 +10,7 @@ annotations_typeexpr.py:92:9: error[invalid-type-form] Dict literals are not all annotations_typeexpr.py:93:9: error[invalid-type-form] Function calls are not allowed in parameter annotations annotations_typeexpr.py:94:9: error[invalid-type-form] Only simple names and dotted names can be subscripted in parameter annotations annotations_typeexpr.py:95:9: error[invalid-type-form] `if` expressions are not allowed in parameter annotations -annotations_typeexpr.py:96:9: error[invalid-type-form] Variable of type `Literal[3]` is not allowed in a parameter annotation +annotations_typeexpr.py:96:9: error[invalid-type-form] Variable `var1` cannot be used as a type: Variable of type `Literal[3]` is not allowed in a parameter annotation annotations_typeexpr.py:97:10: error[invalid-type-form] Boolean literals are not allowed in this context in a parameter annotation: Did you mean `typing.Literal[True]`? annotations_typeexpr.py:98:10: error[invalid-type-form] Int literals are not allowed in this context in a parameter annotation: Did you mean `typing.Literal[1]`? annotations_typeexpr.py:99:10: error[invalid-type-form] Unary operations are not allowed in parameter annotations diff --git a/conformance/results/ty/classes_classvar.toml b/conformance/results/ty/classes_classvar.toml index ff909e64b..253329806 100644 --- a/conformance/results/ty/classes_classvar.toml +++ b/conformance/results/ty/classes_classvar.toml @@ -16,7 +16,7 @@ classes_classvar.py:72:12: error[invalid-type-form] `ClassVar` is only allowed i classes_classvar.py:73:18: error[invalid-type-form] `ClassVar` annotations are not allowed for non-name targets classes_classvar.py:75:26: error[invalid-type-form] Type qualifier `typing.ClassVar` is not allowed in return type annotations classes_classvar.py:79:8: error[invalid-type-form] `ClassVar` is only allowed in class bodies -classes_classvar.py:80:20: error[invalid-type-form] Type qualifier `typing.ClassVar` is not allowed in type alias values +classes_classvar.py:80:20: error[invalid-type-form] Type qualifier `typing.ClassVar` is not allowed in type alias definitions classes_classvar.py:89:8: error[invalid-type-form] `ClassVar` is not allowed in TypedDict fields classes_classvar.py:94:5: error[invalid-named-tuple] Type qualifier `ClassVar` is not allowed on NamedTuple field `b` classes_classvar.py:127:1: error[invalid-attribute-access] Cannot assign to ClassVar `stats` from an instance of type `Starship` diff --git a/conformance/results/ty/generics_paramspec_basic.toml b/conformance/results/ty/generics_paramspec_basic.toml index 3c1f8ca1b..8f572fd57 100644 --- a/conformance/results/ty/generics_paramspec_basic.toml +++ b/conformance/results/ty/generics_paramspec_basic.toml @@ -3,7 +3,7 @@ errors_diff = """ """ output = """ generics_paramspec_basic.py:10:23: error[mismatched-type-name] The name passed to `ParamSpec` must match the variable it is assigned to: Expected "WrongName", got "NotIt" -generics_paramspec_basic.py:15:18: error[invalid-type-form] Bare ParamSpec `P` is not valid in this context in a type alias value +generics_paramspec_basic.py:15:18: error[invalid-type-form] Bare ParamSpec `P` is not valid in this context in a type alias definition generics_paramspec_basic.py:23:14: error[invalid-type-form] Bare ParamSpec `P` is not valid in this context in a parameter annotation generics_paramspec_basic.py:23:20: error[invalid-type-form] Bare ParamSpec `P` is not valid in this context in a return type annotation generics_paramspec_basic.py:27:14: error[invalid-type-form] `typing.Concatenate` is not allowed in this context in a parameter annotation diff --git a/conformance/results/ty/generics_syntax_declarations.toml b/conformance/results/ty/generics_syntax_declarations.toml index 39031dc2e..5d2978814 100644 --- a/conformance/results/ty/generics_syntax_declarations.toml +++ b/conformance/results/ty/generics_syntax_declarations.toml @@ -9,7 +9,7 @@ generics_syntax_declarations.py:44:21: error[invalid-type-variable-bound] TypeVa generics_syntax_declarations.py:48:17: error[invalid-type-form] List literals are not allowed in this context in a type expression generics_syntax_declarations.py:60:17: error[invalid-type-variable-constraints] TypeVar must have at least two constrained types generics_syntax_declarations.py:64:17: error[invalid-type-variable-constraints] TypeVar must have at least two constrained types -generics_syntax_declarations.py:71:17: error[invalid-type-form] Variable of type `tuple[, ]` is not allowed in a type expression +generics_syntax_declarations.py:71:17: error[invalid-type-form] Variable `t1` cannot be used as a type: Variable of type `tuple[, ]` is not allowed in a type expression generics_syntax_declarations.py:75:18: error[invalid-type-form] Int literals are not allowed in this context in a type expression: Did you mean `typing.Literal[3]`? generics_syntax_declarations.py:79:23: error[unresolved-reference] Name `S` used when not defined """ diff --git a/conformance/results/ty/typeforms_typeform.toml b/conformance/results/ty/typeforms_typeform.toml index 449d23e0e..129019af8 100644 --- a/conformance/results/ty/typeforms_typeform.toml +++ b/conformance/results/ty/typeforms_typeform.toml @@ -13,7 +13,7 @@ typeforms_typeform.py:71:18: error[invalid-type-form] Type qualifier `typing.Cla typeforms_typeform.py:72:18: error[invalid-type-form] Type qualifier `typing.Final` is not allowed in type expressions (only in annotation expressions) typeforms_typeform.py:73:18: error[invalid-type-form] `Unpack` is not allowed in type expressions typeforms_typeform.py:74:18: error[invalid-type-form] `typing.Optional` requires exactly one argument when used in a type expression -typeforms_typeform.py:75:19: error[invalid-type-form] Invalid binary operator `+` in type annotation +typeforms_typeform.py:75:19: error[invalid-type-form] Invalid binary operator `+` in a type expression typeforms_typeform.py:86:16: error[invalid-type-form] Function calls are not allowed in type expressions typeforms_typeform.py:88:15: error[invalid-type-form] Function calls are not allowed in type expressions typeforms_typeform.py:98:21: error[invalid-assignment] Object of type `TypeForm[int]` is not assignable to `TypeForm[str]` diff --git a/conformance/results/ty/version.toml b/conformance/results/ty/version.toml index 1c2f6523e..de28a49c9 100644 --- a/conformance/results/ty/version.toml +++ b/conformance/results/ty/version.toml @@ -1 +1 @@ -version = "ty 0.0.91" +version = "ty 0.0.93" diff --git a/conformance/uv.lock b/conformance/uv.lock index e39c6becf..2ad9ff23e 100644 --- a/conformance/uv.lock +++ b/conformance/uv.lock @@ -202,27 +202,27 @@ wheels = [ [[package]] name = "ty" -version = "0.0.91" +version = "0.0.93" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/08/c0/9e26817a5c94d504aab30bffbbf53f836f4763dd0a947089246ff555eebe/ty-0.0.91.tar.gz", hash = "sha256:b9c434cc1e3b106b6b9353b78ef304d5904c82cf440abcafef7134270a22b41a", size = 8035848, upload-time = "2026-10-22T18:24:52.086Z" } +sdist = { url = "https://files.pythonhosted.org/packages/78/35/e1cbce56e80f6d911b6b6821d211b4150d0e061d426df038cad78d2800f4/ty-0.0.93.tar.gz", hash = "sha256:18b99060d7f1d601fd4ce1acdcc336d1b3345fea8561307948827e8809c31c25", size = 8105272, upload-time = "2026-10-28T00:52:42.089Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/be/ad/0a850c1ca8e6e802e6b0f730f0d59c9769845b2fc956e3acd7f429b665f2/ty-0.0.91-py3-none-linux_armv6l.whl", hash = "sha256:5d39e6e485854838eb7fcdb747495f5b90283d58bce869c17445120fe0c7e40a", size = 14255787, upload-time = "2026-10-22T18:24:11.284Z" }, - { url = "https://files.pythonhosted.org/packages/33/87/9ccfa2d97b8b043e4d6fab10febc50ac7856b02cf7cd64910085db806bbe/ty-0.0.91-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:dcf953e25f90fbccf6cc27ef43fc4ef0961c89f54866e32cd1d7f24891b96084", size = 13822267, upload-time = "2026-10-22T18:24:14.31Z" }, - { url = "https://files.pythonhosted.org/packages/13/33/be8f62444c7840d1b0928c6d174540c0fe6b1b193ae9324c8249e8ed52b9/ty-0.0.91-py3-none-macosx_11_0_arm64.whl", hash = "sha256:78e3e66e88a9ae903afe0981ff9bd225d452ade2aeb070715842510dfcbf6de4", size = 12957620, upload-time = "2026-10-22T18:24:16.961Z" }, - { url = "https://files.pythonhosted.org/packages/31/9f/a742f273c065c4f5a054cc2b44076207136ff1cd346adfb23da38d8894d8/ty-0.0.91-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:89ecaf87b3d7b508f9ea1ef8715d4cf47942719659028c92fad819d82a82ccfa", size = 13746018, upload-time = "2026-10-22T18:24:19.221Z" }, - { url = "https://files.pythonhosted.org/packages/5a/a0/3eecf8717cbe4e05d6e02b53679aebad79f1bfcff6c9c03d7601cb7df5f9/ty-0.0.91-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:0ec8fe4243aab445abece38a2b8e9b3010230d5e6b3f4e15bfa811a914d99e73", size = 13993220, upload-time = "2026-10-22T18:24:21.328Z" }, - { url = "https://files.pythonhosted.org/packages/09/b0/fb3edee2857e97d85b6c735901469fd523cf6792382e4fbbb00b065c186c/ty-0.0.91-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:577701ec2a9cf7a50f6059069399b9437bb8af7a99df24012776e95d8a55831f", size = 14936911, upload-time = "2026-10-22T18:24:24.393Z" }, - { url = "https://files.pythonhosted.org/packages/b7/2c/82f29ee86f4171807af8ab2feaf4e51211143118a3e53e9da2c2e77eca7d/ty-0.0.91-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:fc683f49197d63ec47b2eaa9763ddb32dafb2a31190d938b9bb8ebecc5b25173", size = 15336384, upload-time = "2026-10-22T18:24:26.472Z" }, - { url = "https://files.pythonhosted.org/packages/0b/85/e2419b19577ead84b8afa9137c12eb4bde19f926423bfe01e615db12c52c/ty-0.0.91-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b8bb2784572fa22f77e417844936f6a9f831a6b0ba64749ca1065c407aefcd23", size = 15332319, upload-time = "2026-10-22T18:24:28.979Z" }, - { url = "https://files.pythonhosted.org/packages/83/06/dc28cea0796ee0268bf987d1d6f0f168605bec8898dbdbc7676049d2667b/ty-0.0.91-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f68bb6bfc8171910335a47c7e84070f28bbbc0326bcd6ef08fe3690d0509556b", size = 14600250, upload-time = "2026-10-22T18:24:31.359Z" }, - { url = "https://files.pythonhosted.org/packages/1e/71/83dd28e628698059ba6fe7081acafa7a8f65cfd90fe6573907ca8219d561/ty-0.0.91-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:63f268c80697d614d18e988476d2517177d66ec732ae104d86e57b60f197a416", size = 14812339, upload-time = "2026-10-22T18:24:33.689Z" }, - { url = "https://files.pythonhosted.org/packages/9d/5a/63c0eae2d5b02cef98a9b327b1a16b36287c140b3a7d2306ff7560177f9c/ty-0.0.91-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:b0f34630aa92e222d7754d66222d116f027025cb2b9ed66e1b4b73623de74e84", size = 13703060, upload-time = "2026-10-22T18:24:36.278Z" }, - { url = "https://files.pythonhosted.org/packages/47/ac/fd6d20d00202949d775043c5f70679f38d0e48ea30eeacbffaf6e0a9754e/ty-0.0.91-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:e62f8bbc17d481e01cce39bdfbe36beefda0478cb210e8045ef618d3f674a731", size = 14006236, upload-time = "2026-10-22T18:24:38.464Z" }, - { url = "https://files.pythonhosted.org/packages/fa/26/53dddd4f927dfaa73ea14cd71d97b4d92d685e365b5b037bac457e271403/ty-0.0.91-py3-none-musllinux_1_2_i686.whl", hash = "sha256:f8bf4514a383b13d7cf86eddb55f0eb9f356fc7efeae0de714ad4fe5fc54fee8", size = 14356612, upload-time = "2026-10-22T18:24:40.621Z" }, - { url = "https://files.pythonhosted.org/packages/89/40/ccebba145dd244b2f6058ce2e4a6ff34dea36d4a5b38dd7a6ae983b65a3b/ty-0.0.91-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:a6d93ab988c4c5ed92b52389b888d46ddede78e4646fe28db615bbeff89cdf82", size = 14674843, upload-time = "2026-10-22T18:24:43.325Z" }, - { url = "https://files.pythonhosted.org/packages/08/6f/8a7701adf1f539a893274358f12ba62773d5bb40920bfc53e0d852bfd576/ty-0.0.91-py3-none-win32.whl", hash = "sha256:b9f4bba8486a3d13babc11f8115369d0a0dc8bef127b7cf4f4c5eed9d4dbfa01", size = 13260545, upload-time = "2026-10-22T18:24:45.715Z" }, - { url = "https://files.pythonhosted.org/packages/fc/63/27c8051a72328ee81f47dace5e2c63e7db43bcae935db25a9dbd4d0e59b2/ty-0.0.91-py3-none-win_amd64.whl", hash = "sha256:5ac9eaf938e7fba4dd6c3358f852e6eb3127aa7bde0a76d9807c41f60ad73a29", size = 13759484, upload-time = "2026-10-22T18:24:48.111Z" }, - { url = "https://files.pythonhosted.org/packages/aa/a9/1f6c3694b7b33be4ae9a272f71a99a7dd27ec020c32a22049e9c0e79f576/ty-0.0.91-py3-none-win_arm64.whl", hash = "sha256:35820957639db1fb8c643273670967192c308038836005bdf3bfef111aff64a0", size = 13318343, upload-time = "2026-10-22T18:24:50.116Z" }, + { url = "https://files.pythonhosted.org/packages/4e/16/5b0766d3de2b531f47d6f24986f21607546b6ee1861d294ccec69a750b45/ty-0.0.93-py3-none-linux_armv6l.whl", hash = "sha256:74fad0e17d96076364be426b15ed3f052f068ec6e37b9d8dbf9c9c424fcb6f0d", size = 14510907, upload-time = "2026-10-28T00:52:04.298Z" }, + { url = "https://files.pythonhosted.org/packages/14/4a/ba4e9586f22b42f86e95c5f06798d30b288e1d6557b29c137384031c561c/ty-0.0.93-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:83beb545d52c38deb910d977679dcac1c274f5cf8ee0a1868b10d390042c40df", size = 14074052, upload-time = "2026-10-28T00:52:07.324Z" }, + { url = "https://files.pythonhosted.org/packages/ce/3c/00e4195634b61a6ec1f53a2c70777df644a3ee79f6579b48c4e2f6e884d0/ty-0.0.93-py3-none-macosx_11_0_arm64.whl", hash = "sha256:47d6be14343a997c6f828d812513f940929c906f6cf83ca4cdd74db6e16ef261", size = 13132684, upload-time = "2026-10-28T00:52:09.528Z" }, + { url = "https://files.pythonhosted.org/packages/3e/f4/36fb44a79e2d7c8b2d5f2c42cab6d2c1d4d0e8b9fb7e51acb82648fc4d3e/ty-0.0.93-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d696b82ade77500826d84874d46658020486daa9d39eabc71b94a641247ce484", size = 13955788, upload-time = "2026-10-28T00:52:11.478Z" }, + { url = "https://files.pythonhosted.org/packages/49/21/ae904789846d93e4b01faa33ef9a73f28657dd88b8b99619dbae05f30f1d/ty-0.0.93-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:9882e7b55ee025feceaf8f1210acda368f931c3f597771385f97a460292a9c8b", size = 14252702, upload-time = "2026-10-28T00:52:13.466Z" }, + { url = "https://files.pythonhosted.org/packages/13/8e/fecf0492b20f1e28fafac944f5a6c7a404d8408f2e6fb0fb5666550f994f/ty-0.0.93-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:318871545c28f22564b445cadd022650e0fa892c913c0c1eb4cf6345d72037a2", size = 15192511, upload-time = "2026-10-28T00:52:15.923Z" }, + { url = "https://files.pythonhosted.org/packages/97/1f/67d3284747800456e96892d51df3fefc9f98b844653a86cfc6312902a490/ty-0.0.93-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1f9c494291a7c83706b380e31606f88b6dcf801499623645861c3099c17edc01", size = 15594668, upload-time = "2026-10-28T00:52:18.133Z" }, + { url = "https://files.pythonhosted.org/packages/ed/1f/2a903b2309c8ea265a0cef1edc00fa9223be42d004171f7f87aded4b1bed/ty-0.0.93-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:43ff1ee239c94260cf2146e23537fb069b7267423723096603051bb7d36ce165", size = 15533756, upload-time = "2026-10-28T00:52:20.271Z" }, + { url = "https://files.pythonhosted.org/packages/dc/75/99bdbbd00220703c51af60160fb1c080f653b45ddb585baf8468588f70ef/ty-0.0.93-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1c278c86adeb82374e0f5142b44bb628e9dcb663d98e8f274707300d926e0997", size = 16236455, upload-time = "2026-10-28T00:52:22.244Z" }, + { url = "https://files.pythonhosted.org/packages/ca/7d/edbcce5e504275b3574272629c2c7d657c666312fd5a74a5a3202f256e0a/ty-0.0.93-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:02c7cc6f1d9d2fe49eff5b230d243c696ac798ecce034998e3d67872ab2a5236", size = 15065832, upload-time = "2026-10-28T00:52:24.23Z" }, + { url = "https://files.pythonhosted.org/packages/e6/ce/201c42e84b49a8bb6473edfd3e16e311b942178cefd9678f98dda36f25a4/ty-0.0.93-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:50c580e31da3e4dd3f1b7ab1969497996ab55e61ee06d90132ab46a2964249ef", size = 13919356, upload-time = "2026-10-28T00:52:26.893Z" }, + { url = "https://files.pythonhosted.org/packages/68/5c/f323a70974bd57274d4315d1894586498557e21d4d78cd35b550deaf7878/ty-0.0.93-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:7f037c1761a6874cc0072c39950a987cd6d1563d6df3c94bb131b3e727e921c9", size = 14258573, upload-time = "2026-10-28T00:52:29.049Z" }, + { url = "https://files.pythonhosted.org/packages/c8/ba/0d2a2f0892d19c91cef7785ac1bac5de555059f1bad2a0009d83f2df1d0d/ty-0.0.93-py3-none-musllinux_1_2_i686.whl", hash = "sha256:a8bfbcc8a715a5497210cc89eb134476f511b2de3004697c96b5f6eaa0f1602b", size = 14613304, upload-time = "2026-10-28T00:52:31.474Z" }, + { url = "https://files.pythonhosted.org/packages/b8/02/b0f7b83ef79c85b8813e54ed73189995e3d4ec2f1dda791a8d0acd051386/ty-0.0.93-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:19ae7e56c9021d7eafbc305926ca174183b431c63c27e9d2b7db342d45142446", size = 14937750, upload-time = "2026-10-28T00:52:33.528Z" }, + { url = "https://files.pythonhosted.org/packages/06/ad/d2ece9e2ec588394d0ea0c12b683ff68540f5534988b4e4412664bb87a56/ty-0.0.93-py3-none-win32.whl", hash = "sha256:1c677be05fb0ef0864a305fa4a5258190fc0fc9d79f53c1ce93a0342256f21f1", size = 13464721, upload-time = "2026-10-28T00:52:35.916Z" }, + { url = "https://files.pythonhosted.org/packages/a9/17/ef0c1180498564f08331f4be35aea9de09b37c6ca12fa50ad1959d9d1e38/ty-0.0.93-py3-none-win_amd64.whl", hash = "sha256:65072e0a71f9af81a31a4656521c96eaf539452c37287b9e14a81504b22e0864", size = 14091561, upload-time = "2026-10-28T00:52:38.008Z" }, + { url = "https://files.pythonhosted.org/packages/ef/f8/13fb149c7c5a33be119ecea9c56033b32cc1f87c5ac84d577f2236b7c964/ty-0.0.93-py3-none-win_arm64.whl", hash = "sha256:47991915f6a2101cc63da1dd07b2f3bbd226ab4a14ff3c858b20764c38376166", size = 13552165, upload-time = "2026-10-28T00:52:40.111Z" }, ] [[package]] From 46f693aaf95358f43447a0e41b7a3172d228bd8d Mon Sep 17 00:00:00 2001 From: Rebecca Chen Date: Wed, 28 Oct 2026 11:58:14 -0700 Subject: [PATCH 302/308] Update conformance results (#2379) Update conformance results. --- conformance/pyproject.toml | 2 +- .../results/mypy/callables_kwargs.toml | 2 +- .../results/mypy/constructors_callable.toml | 4 +- .../results/mypy/dataclasses_kwonly.toml | 6 +- .../mypy/dataclasses_transform_class.toml | 4 +- .../mypy/dataclasses_transform_field.toml | 2 +- .../mypy/dataclasses_transform_func.toml | 6 +- .../mypy/dataclasses_transform_meta.toml | 4 +- .../results/mypy/directives_type_ignore.toml | 4 +- .../results/mypy/generics_defaults.toml | 4 +- .../mypy/generics_defaults_referential.toml | 6 +- .../mypy/generics_syntax_declarations.toml | 9 +- .../generics_typevartuple_specialization.toml | 2 - .../results/mypy/historical_positional.toml | 2 - .../mypy/literals_parameterizations.toml | 2 +- .../results/mypy/specialtypes_sentinels.toml | 27 +-- .../results/mypy/typeddicts_alt_syntax.toml | 2 +- .../results/mypy/typeddicts_extra_items.toml | 24 +-- .../results/mypy/typeddicts_inheritance.toml | 4 +- .../mypy/typeddicts_readonly_inheritance.toml | 29 +-- .../results/mypy/typeforms_typeform.toml | 2 +- conformance/results/mypy/version.toml | 2 +- .../pyrefly/annotations_forward_refs.toml | 4 - .../pyrefly/annotations_future_import.toml | 8 - .../pyrefly/annotations_generators.toml | 1 - .../pyrefly/dataclasses_descriptors.toml | 6 +- .../results/pyrefly/dataclasses_postinit.toml | 4 +- .../results/pyrefly/enums_member_values.toml | 1 - .../results/pyrefly/enums_members.toml | 2 - .../generics_mixed_variance_inference.toml | 9 +- .../pyrefly/generics_paramspec_basic.toml | 12 +- .../pyrefly/generics_paramspec_variance.toml | 22 +-- .../results/pyrefly/generics_scoping.toml | 5 +- .../generics_syntax_compatibility.toml | 4 +- .../pyrefly/generics_syntax_declarations.toml | 2 +- .../generics_typevartuple_variance.toml | 14 -- conformance/results/pyrefly/version.toml | 2 +- .../results/pyright/callables_annotation.toml | 6 +- .../results/pyright/callables_kwargs.toml | 6 +- .../results/pyright/callables_subtyping.toml | 22 +-- .../dataclasses_transform_converter.toml | 8 +- .../pyright/directives_disjoint_base.toml | 24 +-- .../results/pyright/enums_expansion.toml | 13 +- .../generics_defaults_specialization.toml | 4 + .../pyright/generics_paramspec_semantics.toml | 4 +- .../pyright/generics_typevartuple_args.toml | 9 +- .../pyright/generics_typevartuple_basic.toml | 9 +- .../results/pyright/overloads_evaluation.toml | 11 +- .../pyright/protocols_class_objects.toml | 3 +- .../results/pyright/protocols_definition.toml | 9 +- .../pyright/typeddicts_class_syntax.toml | 10 +- .../results/pyright/typeforms_typeform.toml | 72 ++------ conformance/results/pyright/version.toml | 2 +- conformance/results/results.html | 96 ++++------ .../results/zuban/dataclasses_match_args.toml | 9 +- conformance/results/zuban/version.toml | 2 +- conformance/uv.lock | 169 ++++++++++-------- 57 files changed, 275 insertions(+), 458 deletions(-) diff --git a/conformance/pyproject.toml b/conformance/pyproject.toml index c2b42fa73..e433eadb7 100644 --- a/conformance/pyproject.toml +++ b/conformance/pyproject.toml @@ -7,7 +7,7 @@ dependencies = [ "markdown", "mypy", "pycroscope", - "pyrefly==1.3.0.dev1", + "pyrefly", "pyright", "tomlkit", "ty", diff --git a/conformance/results/mypy/callables_kwargs.toml b/conformance/results/mypy/callables_kwargs.toml index 0586ed15b..d34b72732 100644 --- a/conformance/results/mypy/callables_kwargs.toml +++ b/conformance/results/mypy/callables_kwargs.toml @@ -6,7 +6,7 @@ output = """ callables_kwargs.py:46: error: Missing named argument "v1" for "func1" [call-arg] callables_kwargs.py:46: error: Missing named argument "v3" for "func1" [call-arg] callables_kwargs.py:51: error: Unexpected keyword argument "v4" for "func1" [call-arg] -callables_kwargs.py:52: error: Too many positional arguments for "func1" [misc] +callables_kwargs.py:52: error: Too many positional arguments for "func1" [call-arg] callables_kwargs.py:58: error: Argument 1 to "func1" has incompatible type "**dict[str, str]"; expected "int" [arg-type] callables_kwargs.py:61: error: Argument 1 to "func1" has incompatible type "**dict[str, object]"; expected "int" [arg-type] callables_kwargs.py:61: error: Argument 1 to "func1" has incompatible type "**dict[str, object]"; expected "str" [arg-type] diff --git a/conformance/results/mypy/constructors_callable.toml b/conformance/results/mypy/constructors_callable.toml index edf923406..c477fd6b8 100644 --- a/conformance/results/mypy/constructors_callable.toml +++ b/conformance/results/mypy/constructors_callable.toml @@ -9,7 +9,6 @@ errors_diff = """ Line 129: Expected 1 errors Line 146: Expected 1 errors Line 74: Unexpected errors ['constructors_callable.py:74: error: Incompatible return type for "__new__" (returns "int", but must return a subtype of "Class4") [misc]'] -Line 80: Unexpected errors ['constructors_callable.py:80: error: Expression is of type "Class4", not "int" [assert-type]'] Line 102: Unexpected errors ['constructors_callable.py:102: error: Expression is of type "Class5", not "Never" [assert-type]'] Line 107: Unexpected errors ['constructors_callable.py:107: error: Expression is of type "Class5", not "Never" [assert-type]'] Line 118: Unexpected errors ['constructors_callable.py:118: error: Incompatible return type for "__new__" (returns "Class6Proxy", but must return a subtype of "Class6") [misc]'] @@ -27,8 +26,7 @@ constructors_callable.py:66: error: Too few arguments [call-arg] constructors_callable.py:67: error: Unexpected keyword argument "y" [call-arg] constructors_callable.py:68: error: Too many arguments [call-arg] constructors_callable.py:74: error: Incompatible return type for "__new__" (returns "int", but must return a subtype of "Class4") [misc] -constructors_callable.py:79: note: Revealed type is "def (x: int) -> constructors_callable.Class4" -constructors_callable.py:80: error: Expression is of type "Class4", not "int" [assert-type] +constructors_callable.py:79: note: Revealed type is "def (x: int) -> int" constructors_callable.py:81: error: Too few arguments [call-arg] constructors_callable.py:82: error: Unexpected keyword argument "y" [call-arg] constructors_callable.py:99: note: Revealed type is "def (*args: Any, **kwargs: Any) -> constructors_callable.Class5" diff --git a/conformance/results/mypy/dataclasses_kwonly.toml b/conformance/results/mypy/dataclasses_kwonly.toml index 9f83cef04..f0ac9ba4b 100644 --- a/conformance/results/mypy/dataclasses_kwonly.toml +++ b/conformance/results/mypy/dataclasses_kwonly.toml @@ -1,8 +1,8 @@ conformant = "Pass" output = """ -dataclasses_kwonly.py:23: error: Too many positional arguments for "DC1" [misc] -dataclasses_kwonly.py:38: error: Too many positional arguments for "DC2" [misc] -dataclasses_kwonly.py:53: error: Too many positional arguments for "DC3" [misc] +dataclasses_kwonly.py:23: error: Too many positional arguments for "DC1" [call-arg] +dataclasses_kwonly.py:38: error: Too many positional arguments for "DC2" [call-arg] +dataclasses_kwonly.py:53: error: Too many positional arguments for "DC3" [call-arg] """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/mypy/dataclasses_transform_class.toml b/conformance/results/mypy/dataclasses_transform_class.toml index df9f2efd4..3c934ec91 100644 --- a/conformance/results/mypy/dataclasses_transform_class.toml +++ b/conformance/results/mypy/dataclasses_transform_class.toml @@ -2,9 +2,9 @@ conformant = "Pass" output = """ dataclasses_transform_class.py:51: error: Non-frozen dataclass cannot inherit from a frozen dataclass [misc] dataclasses_transform_class.py:63: error: Property "id" defined in "Customer1" is read-only [misc] -dataclasses_transform_class.py:66: error: Too many positional arguments for "Customer1" [misc] +dataclasses_transform_class.py:66: error: Too many positional arguments for "Customer1" [call-arg] dataclasses_transform_class.py:72: error: Unsupported left operand type for < ("Customer1") [operator] -dataclasses_transform_class.py:82: error: Too many positional arguments for "Customer2" [misc] +dataclasses_transform_class.py:82: error: Too many positional arguments for "Customer2" [call-arg] dataclasses_transform_class.py:122: error: Property "id" defined in "Customer3" is read-only [misc] """ conformance_automated = "Pass" diff --git a/conformance/results/mypy/dataclasses_transform_field.toml b/conformance/results/mypy/dataclasses_transform_field.toml index bcc6b6069..6743d00f5 100644 --- a/conformance/results/mypy/dataclasses_transform_field.toml +++ b/conformance/results/mypy/dataclasses_transform_field.toml @@ -4,7 +4,7 @@ Does not properly handle field constructor that has default value for `kw_only` """ output = """ dataclasses_transform_field.py:64: error: Unexpected keyword argument "id" for "CustomerModel1" [call-arg] -dataclasses_transform_field.py:75: error: Too many positional arguments for "CustomerModel2" [misc] +dataclasses_transform_field.py:75: error: Too many positional arguments for "CustomerModel2" [call-arg] dataclasses_transform_field.py:75: error: Missing named argument "name" for "CustomerModel2" [call-arg] dataclasses_transform_field.py:77: error: Missing named argument "id" for "CustomerModel2" [call-arg] """ diff --git a/conformance/results/mypy/dataclasses_transform_func.toml b/conformance/results/mypy/dataclasses_transform_func.toml index 5861a2808..46ba5c856 100644 --- a/conformance/results/mypy/dataclasses_transform_func.toml +++ b/conformance/results/mypy/dataclasses_transform_func.toml @@ -4,15 +4,15 @@ Does not handle `kw_only=False` override when `kw_only_default=True`. Does not report error when `order=False` and comparison operators are used. """ output = """ -dataclasses_transform_func.py:52: error: Too many positional arguments for "Customer1" [misc] +dataclasses_transform_func.py:52: error: Too many positional arguments for "Customer1" [call-arg] dataclasses_transform_func.py:56: error: Incompatible types in assignment (expression has type "int", variable has type "str") [assignment] dataclasses_transform_func.py:64: error: Unexpected keyword argument "salary" for "Customer1" [call-arg] -dataclasses_transform_func.py:70: error: Too many positional arguments for "Customer2" [misc] +dataclasses_transform_func.py:70: error: Too many positional arguments for "Customer2" [call-arg] dataclasses_transform_func.py:89: error: Non-frozen dataclass cannot inherit from a frozen dataclass [misc] dataclasses_transform_func.py:96: error: Property "id" defined in "Customer3" is read-only [misc] """ conformance_automated = "Fail" errors_diff = """ Line 60: Expected 1 errors -Line 52: Unexpected errors ['dataclasses_transform_func.py:52: error: Too many positional arguments for "Customer1" [misc]'] +Line 52: Unexpected errors ['dataclasses_transform_func.py:52: error: Too many positional arguments for "Customer1" [call-arg]'] """ diff --git a/conformance/results/mypy/dataclasses_transform_meta.toml b/conformance/results/mypy/dataclasses_transform_meta.toml index 89585d64a..92bcd1a3d 100644 --- a/conformance/results/mypy/dataclasses_transform_meta.toml +++ b/conformance/results/mypy/dataclasses_transform_meta.toml @@ -2,9 +2,9 @@ conformant = "Pass" output = """ dataclasses_transform_meta.py:51: error: Non-frozen dataclass cannot inherit from a frozen dataclass [misc] dataclasses_transform_meta.py:63: error: Property "id" defined in "Customer1" is read-only [misc] -dataclasses_transform_meta.py:66: error: Too many positional arguments for "Customer1" [misc] +dataclasses_transform_meta.py:66: error: Too many positional arguments for "Customer1" [call-arg] dataclasses_transform_meta.py:73: error: Unsupported left operand type for < ("Customer1") [operator] -dataclasses_transform_meta.py:83: error: Too many positional arguments for "Customer2" [misc] +dataclasses_transform_meta.py:83: error: Too many positional arguments for "Customer2" [call-arg] dataclasses_transform_meta.py:103: error: Property "id" defined in "Customer3" is read-only [misc] """ conformance_automated = "Pass" diff --git a/conformance/results/mypy/directives_type_ignore.toml b/conformance/results/mypy/directives_type_ignore.toml index 576b2b0d9..1da66fa93 100644 --- a/conformance/results/mypy/directives_type_ignore.toml +++ b/conformance/results/mypy/directives_type_ignore.toml @@ -3,12 +3,12 @@ notes = """ Does not honor `# type: ignore` comment if comment includes additional text. """ output = """ -directives_type_ignore.py:11: error: Invalid "type: ignore" comment [syntax] directives_type_ignore.py:11: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_type_ignore.py:11: error: Invalid "type: ignore" comment [syntax] directives_type_ignore.py:16: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] directives_type_ignore.py:16: note: Error code "assignment" not covered by "type: ignore[an-empty-str-is-not-an-int]" comment """ conformance_automated = "Fail" errors_diff = """ -Line 11: Unexpected errors ['directives_type_ignore.py:11: error: Invalid "type: ignore" comment [syntax]', 'directives_type_ignore.py:11: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] +Line 11: Unexpected errors ['directives_type_ignore.py:11: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]', 'directives_type_ignore.py:11: error: Invalid "type: ignore" comment [syntax]'] """ diff --git a/conformance/results/mypy/generics_defaults.toml b/conformance/results/mypy/generics_defaults.toml index ce9174469..d396b7545 100644 --- a/conformance/results/mypy/generics_defaults.toml +++ b/conformance/results/mypy/generics_defaults.toml @@ -6,18 +6,16 @@ Does not fully support defaults on `TypeVarTuple` and `ParamSpec`. output = """ generics_defaults.py:24: error: "T" cannot appear after "DefaultStrT" in type parameter list because it has no default type [misc] generics_defaults.py:66: error: "AllTheDefaults" expects between 2 and 5 type arguments, but 1 given [type-arg] -generics_defaults.py:139: error: Expression is of type "tuple[*tuple[str, int], ...]", not "tuple[str, int]" [assert-type] generics_defaults.py:152: error: TypeVar default must be a subtype of the bound type [misc] generics_defaults.py:159: error: TypeVar default must be one of the constraint types [misc] generics_defaults.py:177: error: Expression is of type "int", not "Any" [assert-type] +generics_defaults.py:188: error: A type variable with default cannot follow TypeVarTuple [type-var] generics_defaults.py:203: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [valid-type] generics_defaults.py:204: error: Expression is of type "tuple[Any, ...]", not "tuple[int, str]" [assert-type] generics_defaults.py:205: error: Expression is of type "def (*Any, **Any) -> None", not "Callable[[float, bool], None]" [assert-type] """ conformance_automated = "Fail" errors_diff = """ -Line 188: Expected 1 errors -Line 139: Unexpected errors ['generics_defaults.py:139: error: Expression is of type "tuple[*tuple[str, int], ...]", not "tuple[str, int]" [assert-type]'] Line 203: Unexpected errors ['generics_defaults.py:203: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [valid-type]'] Line 204: Unexpected errors ['generics_defaults.py:204: error: Expression is of type "tuple[Any, ...]", not "tuple[int, str]" [assert-type]'] Line 205: Unexpected errors ['generics_defaults.py:205: error: Expression is of type "def (*Any, **Any) -> None", not "Callable[[float, bool], None]" [assert-type]'] diff --git a/conformance/results/mypy/generics_defaults_referential.toml b/conformance/results/mypy/generics_defaults_referential.toml index 111df437e..af8f6eb74 100644 --- a/conformance/results/mypy/generics_defaults_referential.toml +++ b/conformance/results/mypy/generics_defaults_referential.toml @@ -3,18 +3,16 @@ notes = """ Does not correctly handle defaults referencing other `TypeVar`s. """ output = """ +generics_defaults_referential.py:36: error: Argument 2 to "Foo" has incompatible type "str"; expected "int" [arg-type] generics_defaults_referential.py:37: error: Argument 1 to "Foo" has incompatible type "str"; expected "int" [arg-type] generics_defaults_referential.py:53: error: Type parameter "Start2T" has a default type that refers to one or more type variables that are out of scope [misc] -generics_defaults_referential.py:60: error: Type variable S1 referenced in the default of S2 is unbound [misc] +generics_defaults_referential.py:60: error: Type parameter "S2" has a default type that refers to one or more type variables that are out of scope [misc] generics_defaults_referential.py:74: error: TypeVar default must be one of the constraint types [misc] generics_defaults_referential.py:77: error: TypeVar default must be one of the constraint types [misc] generics_defaults_referential.py:78: error: TypeVar default must be one of the constraint types [misc] -generics_defaults_referential.py:103: error: Expression is of type "Bar[int, list[Never]]", not "Bar[int, list[int]]" [assert-type] """ conformance_automated = "Fail" errors_diff = """ -Line 36: Expected 1 errors Line 68: Expected 1 errors Line 77: Unexpected errors ['generics_defaults_referential.py:77: error: TypeVar default must be one of the constraint types [misc]'] -Line 103: Unexpected errors ['generics_defaults_referential.py:103: error: Expression is of type "Bar[int, list[Never]]", not "Bar[int, list[int]]" [assert-type]'] """ diff --git a/conformance/results/mypy/generics_syntax_declarations.toml b/conformance/results/mypy/generics_syntax_declarations.toml index 66d51c931..d49de6a11 100644 --- a/conformance/results/mypy/generics_syntax_declarations.toml +++ b/conformance/results/mypy/generics_syntax_declarations.toml @@ -1,17 +1,20 @@ -conformant = "Pass" +conformant = "Partial" +notes = """ +Doesn't flag TypeVar with empty constraints. +""" output = """ generics_syntax_declarations.py:17: error: Generic[...] base class is redundant [misc] generics_syntax_declarations.py:25: error: No arguments expected for "Protocol" base class [misc] generics_syntax_declarations.py:32: error: "T" has no attribute "is_integer" [attr-defined] generics_syntax_declarations.py:44: error: Name "V" is not defined [name-defined] generics_syntax_declarations.py:48: error: Bracketed expression "[...]" is not valid as a type [valid-type] -generics_syntax_declarations.py:60: error: Type variable must have at least two constrained types [misc] generics_syntax_declarations.py:64: error: Type variable must have at least two constrained types [misc] generics_syntax_declarations.py:71: error: Variable "generics_syntax_declarations.t1" is not valid as a type [valid-type] generics_syntax_declarations.py:71: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases generics_syntax_declarations.py:75: error: Invalid type: try using Literal[3] instead? [valid-type] generics_syntax_declarations.py:79: error: Name "S" is not defined [name-defined] """ -conformance_automated = "Pass" +conformance_automated = "Fail" errors_diff = """ +Line 60: Expected 1 errors """ diff --git a/conformance/results/mypy/generics_typevartuple_specialization.toml b/conformance/results/mypy/generics_typevartuple_specialization.toml index 280f9266d..dacfd5951 100644 --- a/conformance/results/mypy/generics_typevartuple_specialization.toml +++ b/conformance/results/mypy/generics_typevartuple_specialization.toml @@ -4,7 +4,6 @@ Incorrectly specializes generic alias that includes a `TypeVar` and `TypeVarTupl Rejects specialization of generic type alias defined as a tuple containing a `TypeVar`. """ output = """ -generics_typevartuple_specialization.py:85: error: Argument 1 to "takes_float_array_with_specific_shape" has incompatible type "Array2[float, *tuple[Any, ...]]"; expected "Array2[float, Height, Width]" [arg-type] generics_typevartuple_specialization.py:108: error: Type application is only supported for generic classes [misc] generics_typevartuple_specialization.py:109: error: Type application is only supported for generic classes [misc] generics_typevartuple_specialization.py:109: error: Unpack is only valid in a variadic position [valid-type] @@ -17,6 +16,5 @@ generics_typevartuple_specialization.py:163: error: TypeVarTuple cannot be split """ conformance_automated = "Fail" errors_diff = """ -Line 85: Unexpected errors ['generics_typevartuple_specialization.py:85: error: Argument 1 to "takes_float_array_with_specific_shape" has incompatible type "Array2[float, *tuple[Any, ...]]"; expected "Array2[float, Height, Width]" [arg-type]'] Line 108: Unexpected errors ['generics_typevartuple_specialization.py:108: error: Type application is only supported for generic classes [misc]'] """ diff --git a/conformance/results/mypy/historical_positional.toml b/conformance/results/mypy/historical_positional.toml index 1338644ef..7bd5cc052 100644 --- a/conformance/results/mypy/historical_positional.toml +++ b/conformance/results/mypy/historical_positional.toml @@ -6,7 +6,6 @@ Applies legacy positional-only rules when PEP 570 syntax is used. """ output = """ historical_positional.py:18: error: Unexpected keyword argument "__x" for "f1" [call-arg] -historical_positional.py:48: error: Unexpected keyword argument "__y" for "f3" [call-arg] historical_positional.py:59: error: Unexpected keyword argument "__x" for "m1" of "A" [call-arg] historical_positional.py:69: error: Unexpected keyword argument "__y" for "f4" [call-arg] """ @@ -14,6 +13,5 @@ conformance_automated = "Fail" errors_diff = """ Line 26: Expected 1 errors Line 54: Expected 1 errors -Line 48: Unexpected errors ['historical_positional.py:48: error: Unexpected keyword argument "__y" for "f3" [call-arg]'] Line 69: Unexpected errors ['historical_positional.py:69: error: Unexpected keyword argument "__y" for "f4" [call-arg]'] """ diff --git a/conformance/results/mypy/literals_parameterizations.toml b/conformance/results/mypy/literals_parameterizations.toml index eac516519..3dfc58304 100644 --- a/conformance/results/mypy/literals_parameterizations.toml +++ b/conformance/results/mypy/literals_parameterizations.toml @@ -12,7 +12,7 @@ literals_parameterizations.py:47: error: Parameter 1 of Literal[...] is invalid literals_parameterizations.py:48: error: Parameter 1 of Literal[...] is invalid [valid-type] literals_parameterizations.py:49: error: Parameter 1 of Literal[...] is invalid [valid-type] literals_parameterizations.py:50: error: Parameter 1 of Literal[...] is invalid [valid-type] -literals_parameterizations.py:51: error: Parameter 1 of Literal[...] cannot be of type "float" [valid-type] +literals_parameterizations.py:51: error: Invalid type: Literal[...] cannot contain arbitrary expressions [valid-type] literals_parameterizations.py:52: error: Parameter 1 of Literal[...] cannot be of type "Any" [valid-type] literals_parameterizations.py:53: error: Parameter 1 of Literal[...] is invalid [valid-type] literals_parameterizations.py:56: error: Invalid type: Literal[...] cannot contain arbitrary expressions [valid-type] diff --git a/conformance/results/mypy/specialtypes_sentinels.toml b/conformance/results/mypy/specialtypes_sentinels.toml index 1ff31a1c9..ef78a42a8 100644 --- a/conformance/results/mypy/specialtypes_sentinels.toml +++ b/conformance/results/mypy/specialtypes_sentinels.toml @@ -1,27 +1,8 @@ -conformant = "Unsupported" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 36: Expected 1 errors -Line 39: Expected 1 errors -Line 20: Unexpected errors ['specialtypes_sentinels.py:20: error: Variable "specialtypes_sentinels.MISSING" is not valid as a type [valid-type]', 'specialtypes_sentinels.py:20: error: Variable "specialtypes_sentinels.SPECIAL" is not valid as a type [valid-type]'] -Line 22: Unexpected errors ['specialtypes_sentinels.py:22: error: Expression is of type "Any", not MISSING? [assert-type]', 'specialtypes_sentinels.py:22: error: Variable "specialtypes_sentinels.MISSING" is not valid as a type [valid-type]'] -Line 24: Unexpected errors ['specialtypes_sentinels.py:24: error: Variable "specialtypes_sentinels.SPECIAL" is not valid as a type [valid-type]'] -Line 26: Unexpected errors ['specialtypes_sentinels.py:26: error: Variable "specialtypes_sentinels.Cls.IN_CLASS" is not valid as a type [valid-type]'] -Line 28: Unexpected errors ['specialtypes_sentinels.py:28: error: Expression is of type "Any", not Cls.IN_CLASS? [assert-type]', 'specialtypes_sentinels.py:28: error: Variable "specialtypes_sentinels.Cls.IN_CLASS" is not valid as a type [valid-type]'] """ output = """ -specialtypes_sentinels.py:14: error: Incompatible default for parameter "x" (default has type "Sentinel", parameter has type "int") [assignment] -specialtypes_sentinels.py:20: error: Variable "specialtypes_sentinels.MISSING" is not valid as a type [valid-type] -specialtypes_sentinels.py:20: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -specialtypes_sentinels.py:20: error: Variable "specialtypes_sentinels.SPECIAL" is not valid as a type [valid-type] -specialtypes_sentinels.py:22: error: Expression is of type "Any", not MISSING? [assert-type] -specialtypes_sentinels.py:22: error: Variable "specialtypes_sentinels.MISSING" is not valid as a type [valid-type] -specialtypes_sentinels.py:22: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -specialtypes_sentinels.py:24: error: Variable "specialtypes_sentinels.SPECIAL" is not valid as a type [valid-type] -specialtypes_sentinels.py:24: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -specialtypes_sentinels.py:26: error: Variable "specialtypes_sentinels.Cls.IN_CLASS" is not valid as a type [valid-type] -specialtypes_sentinels.py:26: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -specialtypes_sentinels.py:28: error: Expression is of type "Any", not Cls.IN_CLASS? [assert-type] -specialtypes_sentinels.py:28: error: Variable "specialtypes_sentinels.Cls.IN_CLASS" is not valid as a type [valid-type] -specialtypes_sentinels.py:28: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +specialtypes_sentinels.py:14: error: Incompatible default for parameter "x" (default has type "MISSING", parameter has type "int") [assignment] +specialtypes_sentinels.py:36: error: Argument 1 to "func2" has incompatible type "Cls.IN_CLASS"; expected "int | MISSING | SPECIAL" [arg-type] +specialtypes_sentinels.py:39: error: Argument 1 to "func3" has incompatible type "MISSING"; expected "int | Cls.IN_CLASS" [arg-type] """ diff --git a/conformance/results/mypy/typeddicts_alt_syntax.toml b/conformance/results/mypy/typeddicts_alt_syntax.toml index 2d1177efa..197eba532 100644 --- a/conformance/results/mypy/typeddicts_alt_syntax.toml +++ b/conformance/results/mypy/typeddicts_alt_syntax.toml @@ -6,7 +6,7 @@ output = """ typeddicts_alt_syntax.py:23: error: TypedDict() expects a dictionary literal as the second argument [misc] typeddicts_alt_syntax.py:27: error: Invalid TypedDict() field name [misc] typeddicts_alt_syntax.py:31: error: First argument "WrongName" to TypedDict() does not match variable name "BadTypedDict3" [name-match] -typeddicts_alt_syntax.py:35: error: Too many arguments for TypedDict() [misc] +typeddicts_alt_syntax.py:35: error: Unexpected keyword argument "other" for "TypedDict" [misc] typeddicts_alt_syntax.py:41: error: Unexpected arguments to TypedDict() [misc] typeddicts_alt_syntax.py:44: error: Extra keys ("name", "year") for TypedDict "Movie2" [typeddict-unknown-key] typeddicts_alt_syntax.py:45: error: Extra keys ("name", "year") for TypedDict "Movie2" [typeddict-unknown-key] diff --git a/conformance/results/mypy/typeddicts_extra_items.toml b/conformance/results/mypy/typeddicts_extra_items.toml index 0938d870e..3853be1bd 100644 --- a/conformance/results/mypy/typeddicts_extra_items.toml +++ b/conformance/results/mypy/typeddicts_extra_items.toml @@ -1,14 +1,14 @@ conformant = "Unsupported" conformance_automated = "Fail" errors_diff = """ +Line 73: Expected 1 errors +Line 109: Expected 1 errors Line 215: Expected 1 errors Line 222: Expected 1 errors Line 242: Expected 1 errors Line 256: Expected 1 errors Line 257: Expected 1 errors Line 268: Expected 1 errors -Lines 91, 92: Expected error (tag 'MovieC') -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') @@ -19,13 +19,8 @@ Line 21: Unexpected errors ['typeddicts_extra_items.py:21: error: Extra keys ("n Line 29: Unexpected errors ['typeddicts_extra_items.py:29: error: Expression is of type "Any", not "bool" [assert-type]', 'typeddicts_extra_items.py:29: error: TypedDict "Movie" has no key "novel_adaptation" [typeddict-item]'] Line 33: Unexpected errors ['typeddicts_extra_items.py:33: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] Line 40: Unexpected errors ['typeddicts_extra_items.py:40: error: Extra key "other_extra_key" for TypedDict "InheritedMovie" [typeddict-unknown-key]'] -Line 55: Unexpected errors ['typeddicts_extra_items.py:55: error: Unexpected keyword argument "closed" for "__init_subclass__" of "TypedDict" [call-arg]'] -Line 64: Unexpected errors ['typeddicts_extra_items.py:64: error: Unexpected keyword argument "closed" for "__init_subclass__" of "TypedDict" [call-arg]'] Line 70: Unexpected errors ['typeddicts_extra_items.py:70: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] -Line 82: Unexpected errors ['typeddicts_extra_items.py:82: error: Unexpected keyword argument "closed" for "__init_subclass__" of "TypedDict" [call-arg]'] -Line 88: Unexpected errors ['typeddicts_extra_items.py:88: error: Unexpected keyword argument "closed" for "__init_subclass__" of "TypedDict" [call-arg]'] Line 100: Unexpected errors ['typeddicts_extra_items.py:100: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] -Line 103: Unexpected errors ['typeddicts_extra_items.py:103: error: Unexpected keyword argument "closed" for "__init_subclass__" of "TypedDict" [call-arg]'] Line 106: Unexpected errors ['typeddicts_extra_items.py:106: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] Line 124: Unexpected errors ['typeddicts_extra_items.py:124: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] Line 129: Unexpected errors ['typeddicts_extra_items.py:129: error: TypedDict "MovieEI" has no key "year" [typeddict-item]'] @@ -50,7 +45,6 @@ Line 255: Unexpected errors ['typeddicts_extra_items.py:255: error: Extra key "d Line 266: Unexpected errors ['typeddicts_extra_items.py:266: error: Extra key "year" for TypedDict "MovieExtraInt" [typeddict-unknown-key]'] Line 280: Unexpected errors ['typeddicts_extra_items.py:280: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] Line 284: Unexpected errors ['typeddicts_extra_items.py:284: error: Extra key "year" for TypedDict "ExtraMovie" [typeddict-unknown-key]'] -Line 289: Unexpected errors ['typeddicts_extra_items.py:289: error: Unexpected keyword argument "closed" for "__init_subclass__" of "TypedDict" [call-arg]'] Line 299: Unexpected errors ['typeddicts_extra_items.py:299: error: Extra key "summary" for TypedDict "MovieExtraStr" [typeddict-unknown-key]'] Line 300: Unexpected errors ['typeddicts_extra_items.py:300: error: Incompatible types in assignment (expression has type "MovieExtraStr", variable has type "Mapping[str, str]") [assignment]'] Line 302: Unexpected errors ['typeddicts_extra_items.py:302: error: Extra key "year" for TypedDict "MovieExtraInt" [typeddict-unknown-key]'] @@ -78,18 +72,13 @@ typeddicts_extra_items.py:29: error: TypedDict "Movie" has no key "novel_adaptat typeddicts_extra_items.py:33: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] typeddicts_extra_items.py:39: error: Incompatible types (expression has type "None", TypedDict item "year" has type "int") [typeddict-item] typeddicts_extra_items.py:40: error: Extra key "other_extra_key" for TypedDict "InheritedMovie" [typeddict-unknown-key] -typeddicts_extra_items.py:49: error: Unexpected keyword argument "closed" for "__init_subclass__" of "TypedDict" [call-arg] -typeddicts_extra_items.py:55: error: Unexpected keyword argument "closed" for "__init_subclass__" of "TypedDict" [call-arg] -typeddicts_extra_items.py:64: error: Unexpected keyword argument "closed" for "__init_subclass__" of "TypedDict" [call-arg] -typeddicts_extra_items.py:67: error: Unexpected keyword argument "closed" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_extra_items.py:49: error: "closed" argument must be a True or False literal [literal-required] +typeddicts_extra_items.py:67: error: Open TypedDict class cannot subclass closed TypedDict class "ClosedBase" [misc] typeddicts_extra_items.py:70: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] -typeddicts_extra_items.py:73: error: Unexpected keyword argument "closed" for "__init_subclass__" of "TypedDict" [call-arg] -typeddicts_extra_items.py:82: error: Unexpected keyword argument "closed" for "__init_subclass__" of "TypedDict" [call-arg] -typeddicts_extra_items.py:88: error: Unexpected keyword argument "closed" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_extra_items.py:92: error: Cannot extend closed base class "MovieA" with new field "age" [misc] +typeddicts_extra_items.py:95: error: Cannot extend closed base class "MovieB" with new field "age" [misc] typeddicts_extra_items.py:100: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] -typeddicts_extra_items.py:103: error: Unexpected keyword argument "closed" for "__init_subclass__" of "TypedDict" [call-arg] typeddicts_extra_items.py:106: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] -typeddicts_extra_items.py:109: error: Unexpected keyword argument "closed" for "__init_subclass__" of "TypedDict" [call-arg] typeddicts_extra_items.py:114: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] typeddicts_extra_items.py:117: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] typeddicts_extra_items.py:124: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] @@ -120,7 +109,6 @@ typeddicts_extra_items.py:278: error: Extra key "year" for TypedDict "NonClosedM typeddicts_extra_items.py:280: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] typeddicts_extra_items.py:284: error: Extra key "year" for TypedDict "ExtraMovie" [typeddict-unknown-key] typeddicts_extra_items.py:285: error: Extra key "language" for TypedDict "ExtraMovie" [typeddict-unknown-key] -typeddicts_extra_items.py:289: error: Unexpected keyword argument "closed" for "__init_subclass__" of "TypedDict" [call-arg] typeddicts_extra_items.py:293: error: Extra key "year" for TypedDict "ClosedMovie" [typeddict-unknown-key] typeddicts_extra_items.py:299: error: Extra key "summary" for TypedDict "MovieExtraStr" [typeddict-unknown-key] typeddicts_extra_items.py:300: error: Incompatible types in assignment (expression has type "MovieExtraStr", variable has type "Mapping[str, str]") [assignment] diff --git a/conformance/results/mypy/typeddicts_inheritance.toml b/conformance/results/mypy/typeddicts_inheritance.toml index 6679cb131..5f89a8c40 100644 --- a/conformance/results/mypy/typeddicts_inheritance.toml +++ b/conformance/results/mypy/typeddicts_inheritance.toml @@ -1,8 +1,8 @@ conformant = "Pass" output = """ typeddicts_inheritance.py:44: error: All bases of a new TypedDict must be TypedDict types [misc] -typeddicts_inheritance.py:55: error: Overwriting TypedDict field "x" while extending [misc] -typeddicts_inheritance.py:65: error: Overwriting TypedDict field "x" while merging [misc] +typeddicts_inheritance.py:55: error: Definition of field "x" incompatible with base class "X1" [misc] +typeddicts_inheritance.py:65: error: Incompatible definitions of field "x" in base classes "Y2" and "X2" [misc] """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/mypy/typeddicts_readonly_inheritance.toml b/conformance/results/mypy/typeddicts_readonly_inheritance.toml index 4bd44ff08..4db3223e6 100644 --- a/conformance/results/mypy/typeddicts_readonly_inheritance.toml +++ b/conformance/results/mypy/typeddicts_readonly_inheritance.toml @@ -5,35 +5,18 @@ Incorrectly rejects override of `ReadOnly` item with another `ReadOnly` item wit Incorrectly rejects override of `NotRequired ReadOnly` item with a `Required ReadOnly` item. """ output = """ -typeddicts_readonly_inheritance.py:19: error: Overwriting TypedDict field "name" while extending [misc] -typeddicts_readonly_inheritance.py:25: error: ReadOnly TypedDict key "name" TypedDict is mutated [typeddict-readonly-mutated] typeddicts_readonly_inheritance.py:36: error: ReadOnly TypedDict key "name" TypedDict is mutated [typeddict-readonly-mutated] -typeddicts_readonly_inheritance.py:49: error: Overwriting TypedDict field "albums" while extending [misc] -typeddicts_readonly_inheritance.py:50: error: Overwriting TypedDict field "alt" while extending [misc] -typeddicts_readonly_inheritance.py:62: error: Overwriting TypedDict field "name" while extending [misc] +typeddicts_readonly_inheritance.py:50: error: Definition of field "alt" incompatible with base class "AlbumCollection" [misc] typeddicts_readonly_inheritance.py:65: error: Missing key "name" for TypedDict "RequiredName" [typeddict-item] -typeddicts_readonly_inheritance.py:76: error: Overwriting TypedDict field "ident" while extending [misc] -typeddicts_readonly_inheritance.py:81: error: ReadOnly TypedDict key "ident" TypedDict is mutated [typeddict-readonly-mutated] -typeddicts_readonly_inheritance.py:82: error: ReadOnly TypedDict key "ident" TypedDict is mutated [typeddict-readonly-mutated] typeddicts_readonly_inheritance.py:82: error: Value of "ident" has incompatible type "int"; expected "str" [typeddict-item] typeddicts_readonly_inheritance.py:83: error: Incompatible types (expression has type "int", TypedDict item "ident" has type "str") [typeddict-item] typeddicts_readonly_inheritance.py:84: error: Missing key "ident" for TypedDict "User" [typeddict-item] -typeddicts_readonly_inheritance.py:94: error: Overwriting TypedDict field "a" while extending [misc] -typeddicts_readonly_inheritance.py:98: error: Overwriting TypedDict field "a" while extending [misc] -typeddicts_readonly_inheritance.py:102: error: Overwriting TypedDict field "b" while extending [misc] -typeddicts_readonly_inheritance.py:106: error: Overwriting TypedDict field "c" while extending [misc] -typeddicts_readonly_inheritance.py:119: error: Overwriting TypedDict field "x" while merging [misc] -typeddicts_readonly_inheritance.py:119: error: Overwriting TypedDict field "y" while merging [misc] -typeddicts_readonly_inheritance.py:132: error: Overwriting TypedDict field "x" while merging [misc] -typeddicts_readonly_inheritance.py:132: error: Overwriting TypedDict field "y" while merging [misc] +typeddicts_readonly_inheritance.py:98: error: Field "a" is required in base class "F1" [misc] +typeddicts_readonly_inheritance.py:119: error: Incompatible definitions of field "x" in base classes "TD_A2" and "TD_A1" [misc] """ conformance_automated = "Fail" errors_diff = """ -Line 19: Unexpected errors ['typeddicts_readonly_inheritance.py:19: error: Overwriting TypedDict field "name" while extending [misc]'] -Line 25: Unexpected errors ['typeddicts_readonly_inheritance.py:25: error: ReadOnly TypedDict key "name" TypedDict is mutated [typeddict-readonly-mutated]'] -Line 49: Unexpected errors ['typeddicts_readonly_inheritance.py:49: error: Overwriting TypedDict field "albums" while extending [misc]'] -Line 62: Unexpected errors ['typeddicts_readonly_inheritance.py:62: error: Overwriting TypedDict field "name" while extending [misc]'] -Line 76: Unexpected errors ['typeddicts_readonly_inheritance.py:76: error: Overwriting TypedDict field "ident" while extending [misc]'] -Line 81: Unexpected errors ['typeddicts_readonly_inheritance.py:81: error: ReadOnly TypedDict key "ident" TypedDict is mutated [typeddict-readonly-mutated]'] -Line 102: Unexpected errors ['typeddicts_readonly_inheritance.py:102: error: Overwriting TypedDict field "b" while extending [misc]'] +Line 94: Expected 1 errors +Line 106: Expected 1 errors +Line 132: Expected 1 errors """ diff --git a/conformance/results/mypy/typeforms_typeform.toml b/conformance/results/mypy/typeforms_typeform.toml index 14f1ba107..ce105569d 100644 --- a/conformance/results/mypy/typeforms_typeform.toml +++ b/conformance/results/mypy/typeforms_typeform.toml @@ -4,6 +4,7 @@ Does not support assigning `Union` and `GenericAlias` objects to their runtime t """ conformance_automated = "Fail" errors_diff = """ +Line 71: Expected 1 errors Line 46: Unexpected errors ['typeforms_typeform.py:46: error: Incompatible types in assignment (expression has type "UnionType | type[str]", variable has type "UnionType") [assignment]'] Line 49: Unexpected errors ['typeforms_typeform.py:49: error: Incompatible types in assignment (expression has type "type[list[int]]", variable has type "GenericAlias") [assignment]'] """ @@ -17,7 +18,6 @@ typeforms_typeform.py:67: error: Incompatible types in assignment (expression ha typeforms_typeform.py:68: error: Incompatible types in assignment (expression has type "tuple[int, int]", variable has type "TypeForm[Any]") [assignment] typeforms_typeform.py:69: error: Incompatible types in assignment (expression has type "int", variable has type "TypeForm[Any]") [assignment] typeforms_typeform.py:70: error: Incompatible types in assignment (expression has type "", variable has type "TypeForm[Any]") [assignment] -typeforms_typeform.py:71: error: Incompatible types in assignment (expression has type "", variable has type "TypeForm[Any]") [assignment] typeforms_typeform.py:72: error: Incompatible types in assignment (expression has type "", variable has type "TypeForm[Any]") [assignment] typeforms_typeform.py:73: error: Incompatible types in assignment (expression has type "", variable has type "TypeForm[Any]") [assignment] typeforms_typeform.py:74: error: Incompatible types in assignment (expression has type "", variable has type "TypeForm[Any]") [assignment] diff --git a/conformance/results/mypy/version.toml b/conformance/results/mypy/version.toml index 4d966c35b..46d35802d 100644 --- a/conformance/results/mypy/version.toml +++ b/conformance/results/mypy/version.toml @@ -1 +1 @@ -version = "mypy 2.1.0" +version = "mypy 2.4.0" diff --git a/conformance/results/pyrefly/annotations_forward_refs.toml b/conformance/results/pyrefly/annotations_forward_refs.toml index f0d3f84fb..bf7260c92 100644 --- a/conformance/results/pyrefly/annotations_forward_refs.toml +++ b/conformance/results/pyrefly/annotations_forward_refs.toml @@ -7,8 +7,6 @@ conformance_automated = "Fail" errors_diff = """ Line 94: Expected 1 errors Line 96: Expected 1 errors -Line 84: Unexpected errors ['Could not find name `ClassInner` [unknown-name]'] -Line 112: Unexpected errors ['assert_type(Unknown, ClassD.ClassInner) failed [assert-type]'] """ output = """ ERROR annotations_forward_refs.py:23:12-18: `ClassA` is uninitialized [unbound-name] @@ -31,10 +29,8 @@ ERROR annotations_forward_refs.py:53:11-21: Boolean operation cannot be used in ERROR annotations_forward_refs.py:54:11-17: F-string cannot be used in annotations [invalid-annotation] ERROR annotations_forward_refs.py:55:11-16: Expected a type form, got instance of `Module[types]` [not-a-type] ERROR annotations_forward_refs.py:83:13-23: Could not find name `ClassInner` [unknown-name] -ERROR annotations_forward_refs.py:84:14-24: Could not find name `ClassInner` [unknown-name] ERROR annotations_forward_refs.py:92:14-20: Could not find name `ClassF` [unknown-name] ERROR annotations_forward_refs.py:101:8-11: Expected a type form, got instance of `(self: Self@ClassD) -> None` [not-a-type] ERROR annotations_forward_refs.py:103:9-12: Expected a type form, got instance of `(self: Self@ClassD) -> None` [not-a-type] ERROR annotations_forward_refs.py:111:16-45: assert_type(Unknown, ClassD.ClassInner) failed [assert-type] -ERROR annotations_forward_refs.py:112:16-45: assert_type(Unknown, ClassD.ClassInner) failed [assert-type] """ diff --git a/conformance/results/pyrefly/annotations_future_import.toml b/conformance/results/pyrefly/annotations_future_import.toml index 83a8ee5ef..f0ba60aec 100644 --- a/conformance/results/pyrefly/annotations_future_import.toml +++ b/conformance/results/pyrefly/annotations_future_import.toml @@ -7,16 +7,8 @@ conformance_automated = "Fail" errors_diff = """ Line 37: Expected 1 errors Line 39: Expected 1 errors -Line 26: Unexpected errors ['Could not find name `ClassInner` [unknown-name]'] -Line 27: Unexpected errors ['Could not find name `ClassInner` [unknown-name]'] -Line 55: Unexpected errors ['assert_type(Unknown, ClassB.ClassInner) failed [assert-type]'] -Line 56: Unexpected errors ['assert_type(Unknown, ClassB.ClassInner) failed [assert-type]'] """ output = """ -ERROR annotations_future_import.py:26:13-23: Could not find name `ClassInner` [unknown-name] -ERROR annotations_future_import.py:27:14-24: Could not find name `ClassInner` [unknown-name] ERROR annotations_future_import.py:44:8-11: Expected a type form, got instance of `(self: Self@ClassB) -> None` [not-a-type] ERROR annotations_future_import.py:46:9-12: Expected a type form, got instance of `(self: Self@ClassB) -> None` [not-a-type] -ERROR annotations_future_import.py:55:16-45: assert_type(Unknown, ClassB.ClassInner) failed [assert-type] -ERROR annotations_future_import.py:56:16-45: assert_type(Unknown, ClassB.ClassInner) failed [assert-type] """ diff --git a/conformance/results/pyrefly/annotations_generators.toml b/conformance/results/pyrefly/annotations_generators.toml index 15f7ef6c3..744cf383f 100644 --- a/conformance/results/pyrefly/annotations_generators.toml +++ b/conformance/results/pyrefly/annotations_generators.toml @@ -7,7 +7,6 @@ ERROR annotations_generators.py:51:21-39: Function declared to return `C`, but o ERROR annotations_generators.py:54:16-21: Returned type `Literal[False]` is not assignable to declared return type `C` [bad-return] ERROR annotations_generators.py:57:15-16: Yielded type `Literal[3]` is not assignable to declared yield type `A` [invalid-yield] ERROR annotations_generators.py:66:15-16: Yielded type `Literal[3]` is not assignable to declared yield type `A` [invalid-yield] -ERROR annotations_generators.py:71:12-16: Returned type `Literal[True]` is not assignable to declared return type `None` [bad-return] ERROR annotations_generators.py:75:11-14: Yielded type `B` is not assignable to declared yield type `A` [invalid-yield] ERROR annotations_generators.py:86:21-24: Generator function should return `Generator` [bad-return] ERROR annotations_generators.py:91:27-30: Async generator function should return `AsyncGenerator` [bad-return] diff --git a/conformance/results/pyrefly/dataclasses_descriptors.toml b/conformance/results/pyrefly/dataclasses_descriptors.toml index 5f36bae96..21e34e3c3 100644 --- a/conformance/results/pyrefly/dataclasses_descriptors.toml +++ b/conformance/results/pyrefly/dataclasses_descriptors.toml @@ -5,10 +5,8 @@ Doesn't allow non-data descriptors or data descriptors with differing `__get__` """ conformance_automated = "Fail" errors_diff = """ -Line 32: Unexpected errors ['Cannot set field `y` to data descriptor `Desc1` with inconsistent types [bad-class-definition]'] -Line 58: Unexpected errors ['Cannot set field `z` to non-data descriptor `Desc2` [bad-class-definition]'] +Line 58: Unexpected errors ['Cannot set field `z` to non-data descriptor `Desc2` [bad-dataclass-descriptor]'] """ output = """ -ERROR dataclasses_descriptors.py:32:5-6: Cannot set field `y` to data descriptor `Desc1` with inconsistent types [bad-class-definition] -ERROR dataclasses_descriptors.py:58:5-6: Cannot set field `z` to non-data descriptor `Desc2` [bad-class-definition] +ERROR dataclasses_descriptors.py:58:5-6: Cannot set field `z` to non-data descriptor `Desc2` [bad-dataclass-descriptor] """ diff --git a/conformance/results/pyrefly/dataclasses_postinit.toml b/conformance/results/pyrefly/dataclasses_postinit.toml index 45efdbd19..8098f3ab8 100644 --- a/conformance/results/pyrefly/dataclasses_postinit.toml +++ b/conformance/results/pyrefly/dataclasses_postinit.toml @@ -3,8 +3,8 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR dataclasses_postinit.py:19:9-22: `__post_init__` type `(self: DC1, x: int, y: int) -> None` is not assignable to expected type `(x: int, y: str) -> object` generated from the dataclass's `InitVar` fields [bad-function-definition] +ERROR dataclasses_postinit.py:19:9-22: `__post_init__` type `(x: int, y: int) -> None` is not assignable to expected type `(x: int, y: str) -> object` generated from the dataclass's `InitVar` fields [bad-function-definition] ERROR dataclasses_postinit.py:28:7-12: Object of class `DC1` has no attribute `x` [missing-attribute] ERROR dataclasses_postinit.py:29:7-12: Object of class `DC1` has no attribute `y` [missing-attribute] -ERROR dataclasses_postinit.py:36:9-22: `__post_init__` type `(self: DC2, x: int) -> None` is not assignable to expected type `(x: int, y: str) -> object` generated from the dataclass's `InitVar` fields [bad-function-definition] +ERROR dataclasses_postinit.py:36:9-22: `__post_init__` type `(x: int) -> None` is not assignable to expected type `(x: int, y: str) -> object` generated from the dataclass's `InitVar` fields [bad-function-definition] """ diff --git a/conformance/results/pyrefly/enums_member_values.toml b/conformance/results/pyrefly/enums_member_values.toml index 5ac05b3dd..93bdb61fb 100644 --- a/conformance/results/pyrefly/enums_member_values.toml +++ b/conformance/results/pyrefly/enums_member_values.toml @@ -3,7 +3,6 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR enums_member_values.py:30:16-51: assert_type(int, Literal[1, 2, 3]) failed [assert-type] ERROR enums_member_values.py:54:12-46: assert_type(Any, Literal[1]) failed [assert-type] ERROR enums_member_values.py:68:12-42: assert_type(int, Literal[1]) failed [assert-type] ERROR enums_member_values.py:78:5-10: Enum member `GREEN` has type `Literal['green']`, must match the `_value_` attribute annotation of `int` [bad-assignment] diff --git a/conformance/results/pyrefly/enums_members.toml b/conformance/results/pyrefly/enums_members.toml index c5352b243..4b81e579b 100644 --- a/conformance/results/pyrefly/enums_members.toml +++ b/conformance/results/pyrefly/enums_members.toml @@ -8,9 +8,7 @@ ERROR enums_members.py:86:20-34: `Pet4.converter` is not a valid enum member [in ERROR enums_members.py:87:20-34: `Pet4.transform` is not a valid enum member [invalid-literal] ERROR enums_members.py:88:18-30: `Pet4.species` is not a valid enum member [invalid-literal] ERROR enums_members.py:89:16-26: `Pet4.speak` is not a valid enum member [invalid-literal] -ERROR enums_members.py:120:12-43: assert_type(int, Unknown) failed [assert-type] ERROR enums_members.py:120:32-41: `Example.b` is not a valid enum member [invalid-literal] -ERROR enums_members.py:133:20-57: assert_type(int, Unknown) failed [assert-type] ERROR enums_members.py:133:43-55: `Example2.__B` is not a valid enum member [invalid-literal] ERROR enums_members.py:150:12-27: assert_type(Literal[Pet5.DOG], int) failed [assert-type] ERROR enums_members.py:151:12-28: assert_type(Literal[Pet5.FISH], int) failed [assert-type] diff --git a/conformance/results/pyrefly/generics_mixed_variance_inference.toml b/conformance/results/pyrefly/generics_mixed_variance_inference.toml index 862cfd90f..910830561 100644 --- a/conformance/results/pyrefly/generics_mixed_variance_inference.toml +++ b/conformance/results/pyrefly/generics_mixed_variance_inference.toml @@ -1,13 +1,8 @@ -conformant = "Unsupported" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 21: Expected 1 errors -Line 17: Unexpected errors ['`Mixed[int, bool, []]` is not assignable to `Mixed[int, int, []]` [bad-assignment]'] -Line 20: Unexpected errors ['`Mixed[int, *tuple[()], [object]]` is not assignable to `Mixed[int, *tuple[()], [int]]` [bad-assignment]'] """ output = """ ERROR generics_mixed_variance_inference.py:13:22-39: `Mixed[bool, *tuple[()], []]` is not assignable to `Mixed[int, *tuple[()], []]` [bad-assignment] ERROR generics_mixed_variance_inference.py:16:27-51: `Mixed[int, object, []]` is not assignable to `Mixed[int, int, []]` [bad-assignment] -ERROR generics_mixed_variance_inference.py:17:27-49: `Mixed[int, bool, []]` is not assignable to `Mixed[int, int, []]` [bad-assignment] -ERROR generics_mixed_variance_inference.py:20:25-47: `Mixed[int, *tuple[()], [object]]` is not assignable to `Mixed[int, *tuple[()], [int]]` [bad-assignment] +ERROR generics_mixed_variance_inference.py:21:25-45: `Mixed[int, *tuple[()], [bool]]` is not assignable to `Mixed[int, *tuple[()], [int]]` [bad-assignment] """ diff --git a/conformance/results/pyrefly/generics_paramspec_basic.toml b/conformance/results/pyrefly/generics_paramspec_basic.toml index b446dd177..75c9f9bb1 100644 --- a/conformance/results/pyrefly/generics_paramspec_basic.toml +++ b/conformance/results/pyrefly/generics_paramspec_basic.toml @@ -4,12 +4,12 @@ errors_diff = """ """ output = """ ERROR generics_paramspec_basic.py:10:13-31: ParamSpec must be assigned to a variable named `NotIt` [invalid-param-spec] -ERROR generics_paramspec_basic.py:15:18-19: `ParamSpec` is not allowed in this context [invalid-annotation] -ERROR generics_paramspec_basic.py:23:14-15: `ParamSpec` is not allowed in this context [invalid-annotation] -ERROR generics_paramspec_basic.py:23:20-21: `ParamSpec` is not allowed in this context [invalid-annotation] +ERROR generics_paramspec_basic.py:15:18-19: `P` is not allowed in this context [invalid-annotation] +ERROR generics_paramspec_basic.py:23:14-15: `P` is not allowed in this context [invalid-annotation] +ERROR generics_paramspec_basic.py:23:20-21: `P` is not allowed in this context [invalid-annotation] ERROR generics_paramspec_basic.py:27:14-33: `Concatenate[int, P]` is not allowed in this context [invalid-annotation] ERROR generics_paramspec_basic.py:31:14-21: `ParamSpec` cannot be used for type parameter [invalid-param-spec] -ERROR generics_paramspec_basic.py:35:35-36: `ParamSpec` is not allowed in this context [invalid-annotation] -ERROR generics_paramspec_basic.py:39:18-19: `ParamSpec` is not allowed in this context [invalid-annotation] -ERROR generics_paramspec_basic.py:39:31-32: `ParamSpec` is not allowed in this context [invalid-annotation] +ERROR generics_paramspec_basic.py:35:35-36: `P` is not allowed in this context [invalid-annotation] +ERROR generics_paramspec_basic.py:39:18-19: `P` is not allowed in this context [invalid-annotation] +ERROR generics_paramspec_basic.py:39:31-32: `P` is not allowed in this context [invalid-annotation] """ diff --git a/conformance/results/pyrefly/generics_paramspec_variance.toml b/conformance/results/pyrefly/generics_paramspec_variance.toml index f68f02249..71f24512f 100644 --- a/conformance/results/pyrefly/generics_paramspec_variance.toml +++ b/conformance/results/pyrefly/generics_paramspec_variance.toml @@ -1,19 +1,8 @@ conformant = "Unsupported" conformance_automated = "Fail" errors_diff = """ -Line 14: Expected 1 errors -Line 21: Expected 1 errors -Line 30: Expected 1 errors -Line 61: Expected 1 errors -Line 63: Expected 1 errors -Line 90: Expected 1 errors Line 117: Expected 1 errors Line 126: Expected 1 errors -Line 22: Unexpected errors ['`ContravariantParamSpec[[object]]` is not assignable to `ContravariantParamSpec[[int]]` [bad-assignment]'] -Line 31: Unexpected errors ['`CovariantParamSpec[[int]]` is not assignable to `CovariantParamSpec[[object]]` [bad-assignment]'] -Line 67: Unexpected errors ['`InitP[[a: int = 1]]` is not assignable to attribute `t` with type `InitP[[a: int]]` [bad-assignment]'] -Line 84: Unexpected errors ['`OutitP[[*, a: int]]` is not assignable to attribute `t` with type `OutitP[[a: int]]` [bad-assignment]'] -Line 86: Unexpected errors ['`OutitP[[a: int, /]]` is not assignable to attribute `t` with type `OutitP[[a: int]]` [bad-assignment]'] Line 97: Unexpected errors ['Unexpected keyword argument `contravariant` to ParamSpec [invalid-param-spec]'] Line 98: Unexpected errors ['Unexpected keyword argument `covariant` to ParamSpec [invalid-param-spec]'] Line 99: Unexpected errors ['Unexpected keyword argument `infer_variance` to ParamSpec [invalid-param-spec]'] @@ -23,15 +12,16 @@ Line 143: Unexpected errors ['`InferredContravariantParamSpecOld[[object]]` is n Line 152: Unexpected errors ['`InferredCovariantParamSpecOld[[int]]` is not assignable to `InferredCovariantParamSpecOld[[object]]` [bad-assignment]'] """ output = """ +ERROR generics_paramspec_variance.py:14:42-67: `InvariantParamSpec[[int]]` is not assignable to `InvariantParamSpec[[object]]` [bad-assignment] ERROR generics_paramspec_variance.py:15:39-67: `InvariantParamSpec[[object]]` is not assignable to `InvariantParamSpec[[int]]` [bad-assignment] -ERROR generics_paramspec_variance.py:22:39-71: `ContravariantParamSpec[[object]]` is not assignable to `ContravariantParamSpec[[int]]` [bad-assignment] -ERROR generics_paramspec_variance.py:31:39-64: `CovariantParamSpec[[int]]` is not assignable to `CovariantParamSpec[[object]]` [bad-assignment] +ERROR generics_paramspec_variance.py:21:42-71: `ContravariantParamSpec[[int]]` is not assignable to `ContravariantParamSpec[[object]]` [bad-assignment] +ERROR generics_paramspec_variance.py:30:36-64: `CovariantParamSpec[[object]]` is not assignable to `CovariantParamSpec[[int]]` [bad-assignment] +ERROR generics_paramspec_variance.py:61:12-19: `InitP[[*, a: int]]` is not assignable to attribute `t` with type `InitP[[a: int]]` [bad-assignment] +ERROR generics_paramspec_variance.py:63:12-20: `InitP[[a: int, /]]` is not assignable to attribute `t` with type `InitP[[a: int]]` [bad-assignment] ERROR generics_paramspec_variance.py:65:12-22: `InitP[[b: int]]` is not assignable to attribute `t` with type `InitP[[a: int]]` [bad-assignment] -ERROR generics_paramspec_variance.py:67:12-24: `InitP[[a: int = 1]]` is not assignable to attribute `t` with type `InitP[[a: int]]` [bad-assignment] ERROR generics_paramspec_variance.py:69:12-22: `InitP[[a: int, b: str]]` is not assignable to attribute `t` with type `InitP[[a: int]]` [bad-assignment] -ERROR generics_paramspec_variance.py:84:13-21: `OutitP[[*, a: int]]` is not assignable to attribute `t` with type `OutitP[[a: int]]` [bad-assignment] -ERROR generics_paramspec_variance.py:86:13-22: `OutitP[[a: int, /]]` is not assignable to attribute `t` with type `OutitP[[a: int]]` [bad-assignment] ERROR generics_paramspec_variance.py:88:13-24: `OutitP[[b: int]]` is not assignable to attribute `t` with type `OutitP[[a: int]]` [bad-assignment] +ERROR generics_paramspec_variance.py:90:13-26: `OutitP[[a: int = 1]]` is not assignable to attribute `t` with type `OutitP[[a: int]]` [bad-assignment] ERROR generics_paramspec_variance.py:92:13-24: `OutitP[[a: int, b: str]]` is not assignable to attribute `t` with type `OutitP[[a: int]]` [bad-assignment] ERROR generics_paramspec_variance.py:97:24-42: Unexpected keyword argument `contravariant` to ParamSpec [invalid-param-spec] ERROR generics_paramspec_variance.py:98:26-40: Unexpected keyword argument `covariant` to ParamSpec [invalid-param-spec] diff --git a/conformance/results/pyrefly/generics_scoping.toml b/conformance/results/pyrefly/generics_scoping.toml index f36ff6a51..151b2f8e5 100644 --- a/conformance/results/pyrefly/generics_scoping.toml +++ b/conformance/results/pyrefly/generics_scoping.toml @@ -10,9 +10,10 @@ ERROR generics_scoping.py:50:12-48: assert_type(str, Literal['abc']) failed [ass ERROR generics_scoping.py:54:12-50: assert_type(bytes, Literal[b'abc']) failed [assert-type] ERROR generics_scoping.py:61:8-15: Type variable `S` is not in scope [invalid-type-var] ERROR generics_scoping.py:65:14-21: Type variable `S` is not in scope [invalid-type-var] -ERROR generics_scoping.py:76:11-20: Redundant type parameter declaration [invalid-type-var] -ERROR generics_scoping.py:86:15-26: Type variable `T` is not in scope [invalid-type-var] +ERROR generics_scoping.py:76:29-30: Type parameter `T` shadows a type parameter of the same name from an enclosing scope [invalid-type-var] +ERROR generics_scoping.py:86:24-25: Type parameter `T` shadows a type parameter of the same name from an enclosing scope [invalid-type-var] ERROR generics_scoping.py:89:12-19: Type variable `T` is not in scope [invalid-type-var] +ERROR generics_scoping.py:91:36-37: Type parameter `T` shadows a type parameter of the same name from an enclosing scope [invalid-type-var] ERROR generics_scoping.py:98:24-31: Type variable `T` is not in scope [invalid-type-var] ERROR generics_scoping.py:105:14-15: Type variable `T` is not in scope [invalid-type-var] ERROR generics_scoping.py:106:14-21: Type variable `T` is not in scope [invalid-type-var] diff --git a/conformance/results/pyrefly/generics_syntax_compatibility.toml b/conformance/results/pyrefly/generics_syntax_compatibility.toml index d6e72a2c5..6dba07458 100644 --- a/conformance/results/pyrefly/generics_syntax_compatibility.toml +++ b/conformance/results/pyrefly/generics_syntax_compatibility.toml @@ -4,6 +4,6 @@ errors_diff = """ """ output = """ ERROR generics_syntax_compatibility.py:14:7-13: Class `ClassA` uses type variables not specified in `Generic` or `Protocol` base [invalid-type-var] -ERROR generics_syntax_compatibility.py:14:22-23: Type parameter K is not included in the type parameter list [invalid-type-var] -ERROR generics_syntax_compatibility.py:26:35-36: Type parameter K is not included in the type parameter list [invalid-type-var] +ERROR generics_syntax_compatibility.py:14:22-23: Type parameter `K` is not included in the type parameter list [invalid-type-var] +ERROR generics_syntax_compatibility.py:26:35-36: Type parameter `K` is not included in the type parameter list [invalid-type-var] """ diff --git a/conformance/results/pyrefly/generics_syntax_declarations.toml b/conformance/results/pyrefly/generics_syntax_declarations.toml index d5b472029..def48a460 100644 --- a/conformance/results/pyrefly/generics_syntax_declarations.toml +++ b/conformance/results/pyrefly/generics_syntax_declarations.toml @@ -6,7 +6,7 @@ output = """ ERROR generics_syntax_declarations.py:17:7-13: Redundant type parameter declaration [invalid-type-var] ERROR generics_syntax_declarations.py:25:7-13: Redundant type parameter declaration [invalid-type-var] ERROR generics_syntax_declarations.py:32:9-21: Object of class `str` has no attribute `is_integer` [missing-attribute] -ERROR generics_syntax_declarations.py:44:21-33: Type variable bounds and constraints must be concrete [invalid-annotation] +ERROR generics_syntax_declarations.py:44:31-32: Type variable `V` is not in scope [invalid-type-var] ERROR generics_syntax_declarations.py:48:17-27: Expected a type form, got instance of `list[type[int] | type[str]]` [not-a-type] ERROR generics_syntax_declarations.py:60:17-19: Expected at least 2 constraints in TypeVar `T`, got 0 [invalid-type-var] ERROR generics_syntax_declarations.py:64:17-23: Expected at least 2 constraints in TypeVar `T`, got 1 [invalid-type-var] diff --git a/conformance/results/pyrefly/generics_typevartuple_variance.toml b/conformance/results/pyrefly/generics_typevartuple_variance.toml index ef2eff062..67528a194 100644 --- a/conformance/results/pyrefly/generics_typevartuple_variance.toml +++ b/conformance/results/pyrefly/generics_typevartuple_variance.toml @@ -3,13 +3,6 @@ conformance_automated = "Fail" errors_diff = """ Line 79: Expected 1 errors Line 90: Expected 1 errors -Line 29: Unexpected errors ['`ContravariantTypeVarTuple[object]` is not assignable to `ContravariantTypeVarTuple[int]` [bad-assignment]'] -Line 30: Unexpected errors ['`ContravariantTypeVarTuple[*tuple[object, ...]]` is not assignable to `ContravariantTypeVarTuple[*tuple[int, ...]]` [bad-assignment]'] -Line 33: Unexpected errors ['`ContravariantTypeVarTuple[*tuple[int, ...]]` is not assignable to `ContravariantTypeVarTuple[int]` [bad-assignment]'] -Line 43: Unexpected errors ['`CovariantTypeVarTuple[int]` is not assignable to `CovariantTypeVarTuple[object]` [bad-assignment]'] -Line 44: Unexpected errors ['`CovariantTypeVarTuple[bool, bool]` is not assignable to `CovariantTypeVarTuple[int, int]` [bad-assignment]'] -Line 49: Unexpected errors ['`CovariantTypeVarTuple[*tuple[int, ...]]` is not assignable to `CovariantTypeVarTuple[*tuple[object, ...]]` [bad-assignment]'] -Line 52: Unexpected errors ['`CovariantTypeVarTuple[int]` is not assignable to `CovariantTypeVarTuple[*tuple[int, ...]]` [bad-assignment]'] Line 55: Unexpected errors ['Unexpected keyword argument `infer_variance` to TypeVarTuple [invalid-type-var-tuple]'] Line 73: Unexpected errors ['Unexpected keyword argument `contravariant` to TypeVarTuple [invalid-type-var-tuple]'] Line 84: Unexpected errors ['`ContravariantTypeVarTupleOld[object]` is not assignable to `ContravariantTypeVarTupleOld[int]` [bad-assignment]'] @@ -26,21 +19,14 @@ ERROR generics_typevartuple_variance.py:18:70-111: `InvariantTypeVarTuple[*tuple ERROR generics_typevartuple_variance.py:20:58-99: `InvariantTypeVarTuple[*tuple[int, ...]]` is not assignable to `InvariantTypeVarTuple[int]` [bad-assignment] ERROR generics_typevartuple_variance.py:21:71-99: `InvariantTypeVarTuple[int]` is not assignable to `InvariantTypeVarTuple[*tuple[int, ...]]` [bad-assignment] ERROR generics_typevartuple_variance.py:28:53-93: `ContravariantTypeVarTuple[object, int]` is not assignable to `ContravariantTypeVarTuple[object, object]` [bad-assignment] -ERROR generics_typevartuple_variance.py:29:42-77: `ContravariantTypeVarTuple[object]` is not assignable to `ContravariantTypeVarTuple[int]` [bad-assignment] -ERROR generics_typevartuple_variance.py:30:64-112: `ContravariantTypeVarTuple[*tuple[object, ...]]` is not assignable to `ContravariantTypeVarTuple[*tuple[int, ...]]` [bad-assignment] ERROR generics_typevartuple_variance.py:31:70-115: `ContravariantTypeVarTuple[*tuple[int, ...]]` is not assignable to `ContravariantTypeVarTuple[*tuple[object, ...]]` [bad-assignment] -ERROR generics_typevartuple_variance.py:33:58-103: `ContravariantTypeVarTuple[*tuple[int, ...]]` is not assignable to `ContravariantTypeVarTuple[int]` [bad-assignment] ERROR generics_typevartuple_variance.py:34:71-103: `ContravariantTypeVarTuple[int]` is not assignable to `ContravariantTypeVarTuple[*tuple[int, ...]]` [bad-assignment] ERROR generics_typevartuple_variance.py:42:39-70: `CovariantTypeVarTuple[object]` is not assignable to `CovariantTypeVarTuple[int]` [bad-assignment] -ERROR generics_typevartuple_variance.py:43:42-70: `CovariantTypeVarTuple[int]` is not assignable to `CovariantTypeVarTuple[object]` [bad-assignment] -ERROR generics_typevartuple_variance.py:44:50-86: `CovariantTypeVarTuple[bool, bool]` is not assignable to `CovariantTypeVarTuple[int, int]` [bad-assignment] ERROR generics_typevartuple_variance.py:45:50-88: `CovariantTypeVarTuple[bool, object]` is not assignable to `CovariantTypeVarTuple[int, int]` [bad-assignment] ERROR generics_typevartuple_variance.py:46:50-88: `CovariantTypeVarTuple[object, bool]` is not assignable to `CovariantTypeVarTuple[int, int]` [bad-assignment] ERROR generics_typevartuple_variance.py:47:50-90: `CovariantTypeVarTuple[object, object]` is not assignable to `CovariantTypeVarTuple[int, int]` [bad-assignment] ERROR generics_typevartuple_variance.py:48:61-105: `CovariantTypeVarTuple[*tuple[object, ...]]` is not assignable to `CovariantTypeVarTuple[*tuple[int, ...]]` [bad-assignment] -ERROR generics_typevartuple_variance.py:49:67-108: `CovariantTypeVarTuple[*tuple[int, ...]]` is not assignable to `CovariantTypeVarTuple[*tuple[object, ...]]` [bad-assignment] ERROR generics_typevartuple_variance.py:51:55-96: `CovariantTypeVarTuple[*tuple[int, ...]]` is not assignable to `CovariantTypeVarTuple[int]` [bad-assignment] -ERROR generics_typevartuple_variance.py:52:68-96: `CovariantTypeVarTuple[int]` is not assignable to `CovariantTypeVarTuple[*tuple[int, ...]]` [bad-assignment] ERROR generics_typevartuple_variance.py:55:35-54: Unexpected keyword argument `infer_variance` to TypeVarTuple [invalid-type-var-tuple] ERROR generics_typevartuple_variance.py:56:33-47: Unexpected keyword argument `covariant` to TypeVarTuple [invalid-type-var-tuple] ERROR generics_typevartuple_variance.py:56:49-67: Unexpected keyword argument `contravariant` to TypeVarTuple [invalid-type-var-tuple] diff --git a/conformance/results/pyrefly/version.toml b/conformance/results/pyrefly/version.toml index 783ceb1cc..017c55769 100644 --- a/conformance/results/pyrefly/version.toml +++ b/conformance/results/pyrefly/version.toml @@ -1 +1 @@ -version = "pyrefly 1.3.0-dev.1" +version = "pyrefly 1.4.0" diff --git a/conformance/results/pyright/callables_annotation.toml b/conformance/results/pyright/callables_annotation.toml index 66fdcb54e..407d0e2b2 100644 --- a/conformance/results/pyright/callables_annotation.toml +++ b/conformance/results/pyright/callables_annotation.toml @@ -14,10 +14,10 @@ callables_annotation.py:58:24 - error: Expected only two type arguments to "Call callables_annotation.py:59:15 - error: "..." is not allowed in this context (reportInvalidTypeForm) callables_annotation.py:91:7 - error: Type "() -> str" is not assignable to declared type "(int, ...) -> str"   Type "() -> str" is not assignable to type "(int, ...) -> str" -    Function accepts too many positional parameters; expected 0 but received 2 (reportAssignmentType) +    Function accepts too few positional parameters; expected 1 but received 0 (reportAssignmentType) callables_annotation.py:93:7 - error: Type "(*, a: int) -> str" is not assignable to declared type "(int, ...) -> str"   Type "(*, a: int) -> str" is not assignable to type "(int, ...) -> str" -    Function accepts too many positional parameters; expected 0 but received 2 (reportAssignmentType) +    Function accepts too few positional parameters; expected 1 but received 0 (reportAssignmentType) callables_annotation.py:159:25 - error: Type "Proto8" is not assignable to declared type "Proto5[Any]"   "Proto8" is incompatible with protocol "Proto5[Any]"     "__call__" is an incompatible type @@ -26,7 +26,7 @@ callables_annotation.py:159:25 - error: Type "Proto8" is not assignable to decla         Parameter "**kwargs" has no corresponding parameter (reportAssignmentType) callables_annotation.py:172:26 - error: Type "() -> str" is not assignable to declared type "Callback2[...]"   Type "() -> str" is not assignable to type "Callback2[...]" -    Function accepts too many positional parameters; expected 0 but received 2 (reportAssignmentType) +    Function accepts too few positional parameters; expected 1 but received 0 (reportAssignmentType) callables_annotation.py:187:48 - error: Type "(int, str) -> str" is not assignable to declared type "(str, ...) -> str"   Type "(int, str) -> str" is not assignable to type "(str, ...) -> str"     Parameter 1: type "str" is incompatible with type "int" diff --git a/conformance/results/pyright/callables_kwargs.toml b/conformance/results/pyright/callables_kwargs.toml index 191d97a58..b04d6a66a 100644 --- a/conformance/results/pyright/callables_kwargs.toml +++ b/conformance/results/pyright/callables_kwargs.toml @@ -22,9 +22,9 @@ callables_kwargs.py:102:19 - error: Type "(**kwargs: **TD2) -> None" is not assi     Extra parameter "v3" (reportAssignmentType) callables_kwargs.py:103:19 - error: Type "(**kwargs: **TD2) -> None" is not assignable to declared type "TDProtocol5"   Type "(**kwargs: **TD2) -> None" is not assignable to type "(v1: int, v3: str) -> None" -    Function accepts too many positional parameters; expected 0 but received 2 -      Extra parameter "v1" -      Extra parameter "v3" (reportAssignmentType) +    Function accepts too few positional parameters; expected 2 but received 0 +      Parameter "v1" is missing default argument +      Parameter "v3" is missing default argument (reportAssignmentType) callables_kwargs.py:111:30 - error: Typed dictionary overlaps with keyword parameter: v1 (reportGeneralTypeIssues) callables_kwargs.py:122:21 - error: Expected TypedDict type argument for Unpack (reportGeneralTypeIssues) callables_kwargs.py:134:19 - error: Type "(*, v1: int, v3: str, v2: str = "") -> None" is not assignable to declared type "TDProtocol6" diff --git a/conformance/results/pyright/callables_subtyping.toml b/conformance/results/pyright/callables_subtyping.toml index 53f09982d..55956770c 100644 --- a/conformance/results/pyright/callables_subtyping.toml +++ b/conformance/results/pyright/callables_subtyping.toml @@ -23,14 +23,14 @@ callables_subtyping.py:52:21 - error: Type "KwOnly2" is not assignable to declar   "KwOnly2" is incompatible with protocol "Standard2"     "__call__" is an incompatible type       Type "(*, b: int, a: int) -> None" is not assignable to type "(a: int, b: int) -> None" -        Function accepts too many positional parameters; expected 0 but received 2 -          Extra parameter "b" -          Extra parameter "a" (reportAssignmentType) +        Function accepts too few positional parameters; expected 2 but received 0 +          Parameter "b" is missing default argument +          Parameter "a" is missing default argument (reportAssignmentType) callables_subtyping.py:55:20 - error: Type "KwOnly2" is not assignable to declared type "PosOnly2"   "KwOnly2" is incompatible with protocol "PosOnly2"     "__call__" is an incompatible type       Type "(*, b: int, a: int) -> None" is not assignable to type "(b: int, a: int, /) -> None" -        Function accepts too many positional parameters; expected 0 but received 2 +        Function accepts too few positional parameters; expected 2 but received 0           Extra parameter "b"           Extra parameter "a" (reportAssignmentType) callables_subtyping.py:58:19 - error: Type "PosOnly2" is not assignable to declared type "KwOnly2" @@ -38,7 +38,7 @@ callables_subtyping.py:58:19 - error: Type "PosOnly2" is not assignable to decla     "__call__" is an incompatible type       Type "(b: int, a: int, /) -> None" is not assignable to type "(*, b: int, a: int) -> None"         Position-only parameter mismatch; expected 2 but received 0 -        Function accepts too few positional parameters; expected 2 but received 0 +        Function accepts too many positional parameters; expected 0 but received 2         Missing keyword parameter "b"         Missing keyword parameter "a" (reportAssignmentType) callables_subtyping.py:82:20 - error: Type "NoArgs3" is not assignable to declared type "IntArgs3" @@ -161,13 +161,13 @@ callables_subtyping.py:196:22 - error: Type "IntStrKwargs6" is not assignable to   "IntStrKwargs6" is incompatible with protocol "Standard6"     "__call__" is an incompatible type       Type "(**kwargs: int | str) -> None" is not assignable to type "(a: int, b: str) -> None" -        Function accepts too many positional parameters; expected 0 but received 2 (reportAssignmentType) +        Function accepts too few positional parameters; expected 2 but received 0 (reportAssignmentType) callables_subtyping.py:197:22 - error: Type "StrKwargs6" is not assignable to declared type "Standard6"   "StrKwargs6" is incompatible with protocol "Standard6"     "__call__" is an incompatible type       Type "(*, a: int, **kwargs: str) -> None" is not assignable to type "(a: int, b: str) -> None" -        Function accepts too many positional parameters; expected 0 but received 2 -          Extra parameter "a" (reportAssignmentType) +        Function accepts too few positional parameters; expected 2 but received 0 +          Parameter "a" is missing default argument (reportAssignmentType) callables_subtyping.py:236:23 - error: Type "NoDefaultArg8" is not assignable to declared type "DefaultArg8"   "NoDefaultArg8" is incompatible with protocol "DefaultArg8"     "__call__" is an incompatible type @@ -177,12 +177,12 @@ callables_subtyping.py:237:23 - error: Type "NoX8" is not assignable to declared   "NoX8" is incompatible with protocol "DefaultArg8"     "__call__" is an incompatible type       Type "() -> None" is not assignable to type "(x: int = 0) -> None" -        Function accepts too many positional parameters; expected 0 but received 1 (reportAssignmentType) +        Function accepts too few positional parameters; expected 1 but received 0 (reportAssignmentType) callables_subtyping.py:240:25 - error: Type "NoX8" is not assignable to declared type "NoDefaultArg8"   "NoX8" is incompatible with protocol "NoDefaultArg8"     "__call__" is an incompatible type       Type "() -> None" is not assignable to type "(x: int) -> None" -        Function accepts too many positional parameters; expected 0 but received 1 (reportAssignmentType) +        Function accepts too few positional parameters; expected 1 but received 0 (reportAssignmentType) callables_subtyping.py:243:16 - error: Type "NoDefaultArg8" is not assignable to declared type "NoX8"   "NoDefaultArg8" is incompatible with protocol "NoX8"     "__call__" is an incompatible type @@ -197,6 +197,6 @@ callables_subtyping.py:297:24 - error: Type "StrArg10" is not assignable to decl     "__call__" is an incompatible type       One or more overloads of "__call__" is not assignable         Type "(x: str) -> complex" is not assignable to type "(x: int, y: str) -> float" -          Function accepts too many positional parameters; expected 1 but received 2 (reportAssignmentType) +          Function accepts too few positional parameters; expected 2 but received 1 (reportAssignmentType) """ conformance_automated = "Pass" diff --git a/conformance/results/pyright/dataclasses_transform_converter.toml b/conformance/results/pyright/dataclasses_transform_converter.toml index ec7db74cb..6ec751736 100644 --- a/conformance/results/pyright/dataclasses_transform_converter.toml +++ b/conformance/results/pyright/dataclasses_transform_converter.toml @@ -5,17 +5,17 @@ errors_diff = """ output = """ dataclasses_transform_converter.py:48:31 - error: Argument of type "() -> int" is not a valid converter for field "field1" of type "int"   Type "() -> int" is not assignable to type "(__converterInput) -> int" -    Function accepts too many positional parameters; expected 0 but received 1 (reportGeneralTypeIssues) +    Function accepts too few positional parameters; expected 1 but received 0 (reportGeneralTypeIssues) dataclasses_transform_converter.py:48:41 - error: Argument of type "() -> int" cannot be assigned to parameter "converter" of type "(S@model_field) -> T@model_field" in function "model_field"   Type "() -> int" is not assignable to type "(S@model_field) -> int" -    Function accepts too many positional parameters; expected 0 but received 1 (reportArgumentType) +    Function accepts too few positional parameters; expected 1 but received 0 (reportArgumentType) dataclasses_transform_converter.py:49:31 - error: Argument of type "(*, x: int) -> int" is not a valid converter for field "field2" of type "int"   Type "(*, x: int) -> int" is not assignable to type "(__converterInput) -> int" -    Function accepts too many positional parameters; expected 0 but received 1 +    Function accepts too few positional parameters; expected 1 but received 0       Extra parameter "x" (reportGeneralTypeIssues) dataclasses_transform_converter.py:49:41 - error: Argument of type "(*, x: int) -> int" cannot be assigned to parameter "converter" of type "(S@model_field) -> T@model_field" in function "model_field"   Type "(*, x: int) -> int" is not assignable to type "(S@model_field) -> int" -    Function accepts too many positional parameters; expected 0 but received 1 +    Function accepts too few positional parameters; expected 1 but received 0       Extra parameter "x" (reportArgumentType) dataclasses_transform_converter.py:107:5 - error: Argument of type "Literal[1]" cannot be assigned to parameter "field0" of type "str" in function "__init__"   "Literal[1]" is not assignable to "str" (reportArgumentType) diff --git a/conformance/results/pyright/directives_disjoint_base.toml b/conformance/results/pyright/directives_disjoint_base.toml index 023812996..3aa39bab8 100644 --- a/conformance/results/pyright/directives_disjoint_base.toml +++ b/conformance/results/pyright/directives_disjoint_base.toml @@ -1,21 +1,15 @@ -conformance_automated = "Fail" -conformant = "Unsupported" -notes = """ -Does not support PEP 800 disjoint-base semantics. -""" +conformance_automated = "Pass" errors_diff = """ -Line 69: Expected 1 errors -Line 73: Expected 1 errors -Line 77: Expected 1 errors -Line 81: Expected 1 errors -Line 105: Expected 1 errors -Line 118: Expected 1 errors -Line 123: Expected 1 errors """ output = """ -directives_disjoint_base.py:113:2 - error: Argument of type "() -> None" cannot be assigned to parameter "cls" of type "_TC@disjoint_base" in function "disjoint_base" -  Type "() -> None" is not assignable to type "type" -    "FunctionType" is not assignable to "type" (reportArgumentType) +directives_disjoint_base.py:69:7 - error: Base classes have incompatible disjoint bases: "Left", "Right" (reportGeneralTypeIssues) +directives_disjoint_base.py:73:7 - error: Base classes have incompatible disjoint bases: "LeftChild", "Right" (reportGeneralTypeIssues) +directives_disjoint_base.py:77:7 - error: Base classes have incompatible disjoint bases: "Left", "Right" (reportGeneralTypeIssues) +directives_disjoint_base.py:81:7 - error: Base classes have incompatible disjoint bases: "Left", "Record" (reportGeneralTypeIssues) +directives_disjoint_base.py:105:7 - error: Base classes have incompatible disjoint bases: "SlotBase1", "SlotBase2" (reportGeneralTypeIssues) +directives_disjoint_base.py:113:2 - error: @disjoint_base cannot be applied to a function (reportGeneralTypeIssues) +directives_disjoint_base.py:118:2 - error: @disjoint_base cannot be applied to a TypedDict class (reportGeneralTypeIssues) +directives_disjoint_base.py:123:2 - error: @disjoint_base cannot be applied to a Protocol class (reportGeneralTypeIssues) directives_disjoint_base.py:135:22 - error: Argument of type "" cannot be assigned to parameter "arg" of type "Never" in function "assert_never"   Type "" is not assignable to type "Never" (reportArgumentType) """ diff --git a/conformance/results/pyright/enums_expansion.toml b/conformance/results/pyright/enums_expansion.toml index ad3e5573a..1e0a7d1d9 100644 --- a/conformance/results/pyright/enums_expansion.toml +++ b/conformance/results/pyright/enums_expansion.toml @@ -1,17 +1,6 @@ -conformant = "Partial" -notes = """ -Does not treat a complete union of all literal members as equivalent to the enum type. -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 85: Unexpected errors ['enums_expansion.py:85:41 - error: Type "Answer" is not assignable to declared type "Literal[Answer.Yes, Answer.No]"'] -Line 86: Unexpected errors ['enums_expansion.py:86:17 - error: "assert_type" mismatch: expected "Literal[Answer.Yes, Answer.No]" but received "Answer" (reportAssertTypeFailure)'] """ output = """ enums_expansion.py:56:21 - error: "assert_type" mismatch: expected "Literal[CustomFlags.FLAG3]" but received "CustomFlags" (reportAssertTypeFailure) -enums_expansion.py:85:41 - error: Type "Answer" is not assignable to declared type "Literal[Answer.Yes, Answer.No]" -  Type "Answer" is not assignable to type "Literal[Answer.Yes, Answer.No]" -    "Answer" is not assignable to type "Literal[Answer.Yes]" -    "Answer" is not assignable to type "Literal[Answer.No]" (reportAssignmentType) -enums_expansion.py:86:17 - error: "assert_type" mismatch: expected "Literal[Answer.Yes, Answer.No]" but received "Answer" (reportAssertTypeFailure) """ diff --git a/conformance/results/pyright/generics_defaults_specialization.toml b/conformance/results/pyright/generics_defaults_specialization.toml index 2beb10f61..298694496 100644 --- a/conformance/results/pyright/generics_defaults_specialization.toml +++ b/conformance/results/pyright/generics_defaults_specialization.toml @@ -1,6 +1,10 @@ conformant = "Pass" output = """ generics_defaults_specialization.py:30:15 - error: Too many type arguments provided for "MyAlias[DefaultStrT@MyAlias]"; expected 1 but received 2 (reportInvalidTypeForm) +generics_defaults_specialization.py:48:22 - error: Type "type[Bar[DefaultStrT@Bar]]" is not assignable to declared type "type[Bar[int]]" +  "type[Bar[str]]" is not assignable to "type[Bar[int]]" +  Type "type[Bar[DefaultStrT@Bar]]" is not assignable to type "type[Bar[int]]" +    Type parameter "DefaultStrT@Bar" is invariant, but "str" is not the same as "int" (reportAssignmentType) generics_defaults_specialization.py:58:5 - error: Expected no type arguments for class "Foo" (reportInvalidTypeArguments) """ conformance_automated = "Pass" diff --git a/conformance/results/pyright/generics_paramspec_semantics.toml b/conformance/results/pyright/generics_paramspec_semantics.toml index ba9b447a9..8c4c4ab54 100644 --- a/conformance/results/pyright/generics_paramspec_semantics.toml +++ b/conformance/results/pyright/generics_paramspec_semantics.toml @@ -26,10 +26,10 @@ generics_paramspec_semantics.py:127:2 - error: Argument of type "(x: str) -> int       "int" is not assignable to "str" (reportArgumentType) generics_paramspec_semantics.py:132:2 - error: Argument of type "(*, x: int) -> int" cannot be assigned to parameter "x" of type "(int, **P@expects_int_first) -> int" in function "expects_int_first"   Type "(*, x: int) -> int" is not assignable to type "(int, **P@expects_int_first) -> int" -    Function accepts too many positional parameters; expected 0 but received 1 (reportArgumentType) +    Function accepts too few positional parameters; expected 1 but received 0 (reportArgumentType) generics_paramspec_semantics.py:137:2 - error: Argument of type "(**kwargs: int) -> int" cannot be assigned to parameter "x" of type "(int, **P@expects_int_first) -> int" in function "expects_int_first"   Type "(**kwargs: int) -> int" is not assignable to type "(int, **P@expects_int_first) -> int" -    Function accepts too many positional parameters; expected 0 but received 1 (reportArgumentType) +    Function accepts too few positional parameters; expected 1 but received 0 (reportArgumentType) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/generics_typevartuple_args.toml b/conformance/results/pyright/generics_typevartuple_args.toml index a2756d559..10459bf1c 100644 --- a/conformance/results/pyright/generics_typevartuple_args.toml +++ b/conformance/results/pyright/generics_typevartuple_args.toml @@ -1,10 +1,5 @@ -conformant = "Partial" -notes = """ -Does not correctly solve `TypeVarTuple` with heterogeneous bounds. -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 76: Unexpected errors ['generics_typevartuple_args.py:76:14 - error: Argument of type "tuple[Literal[\\'1\\']]" cannot be assigned to parameter "args" of type "tuple[*Ts@func4]" in function "func4"'] """ output = """ generics_typevartuple_args.py:33:20 - error: Argument of type "Literal['']" cannot be assigned to parameter of type "Env" in function "exec_le" @@ -21,6 +16,4 @@ generics_typevartuple_args.py:67:1 - error: Argument missing for parameter "args generics_typevartuple_args.py:75:13 - error: Argument of type "tuple[Literal[1], Literal[2]]" cannot be assigned to parameter "args" of type "tuple[*Ts@func4]" in function "func4"   "tuple[Literal[1], Literal[2]]" is not assignable to "tuple[int]"     Tuple size mismatch; expected 1 but received 2 (reportArgumentType) -generics_typevartuple_args.py:76:14 - error: Argument of type "tuple[Literal['1']]" cannot be assigned to parameter "args" of type "tuple[*Ts@func4]" in function "func4" -  "Literal['1']" is not assignable to "int" (reportArgumentType) """ diff --git a/conformance/results/pyright/generics_typevartuple_basic.toml b/conformance/results/pyright/generics_typevartuple_basic.toml index ea0d0a1a8..70edf3f24 100644 --- a/conformance/results/pyright/generics_typevartuple_basic.toml +++ b/conformance/results/pyright/generics_typevartuple_basic.toml @@ -1,10 +1,5 @@ -conformant = "Partial" -notes = """ -Does not correctly solve `TypeVarTuple` with heterogeneous bounds. -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 90: Unexpected errors ['generics_typevartuple_basic.py:90:14 - error: Argument of type "tuple[Literal[\\'0\\']]" cannot be assigned to parameter "arg2" of type "tuple[*Ts@func2]" in function "func2"'] """ output = """ generics_typevartuple_basic.py:43:34 - error: Argument of type "Height" cannot be assigned to parameter "shape" of type "tuple[*Shape@Array]" in function "__init__" @@ -22,8 +17,6 @@ generics_typevartuple_basic.py:60:24 - error: Expected unpacked TypeVarTuple; us generics_typevartuple_basic.py:66:27 - error: TypeVarTuple cannot have value constraints (reportGeneralTypeIssues) generics_typevartuple_basic.py:66:32 - error: TypeVarTuple cannot have value constraints (reportGeneralTypeIssues) generics_typevartuple_basic.py:67:27 - error: "bound" is unknown parameter to TypeVarTuple (reportGeneralTypeIssues) -generics_typevartuple_basic.py:90:14 - error: Argument of type "tuple[Literal['0']]" cannot be assigned to parameter "arg2" of type "tuple[*Ts@func2]" in function "func2" -  "Literal['0']" is not assignable to "int" (reportArgumentType) generics_typevartuple_basic.py:91:15 - error: Argument of type "tuple[Literal[0]]" cannot be assigned to parameter "arg2" of type "tuple[*Ts@func2]" in function "func2"   "tuple[Literal[0]]" is not assignable to "tuple[int, int]"     Tuple size mismatch; expected 2 but received 1 (reportArgumentType) diff --git a/conformance/results/pyright/overloads_evaluation.toml b/conformance/results/pyright/overloads_evaluation.toml index 58c20bfe5..3c23761b0 100644 --- a/conformance/results/pyright/overloads_evaluation.toml +++ b/conformance/results/pyright/overloads_evaluation.toml @@ -1,10 +1,5 @@ -conformant = "Partial" -notes = """ -Infers `list[int]` for ambiguous overloads with `list[Any]` arguments, rejecting use as `list[str]`. -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 290: Unexpected errors ['overloads_evaluation.py:290:27 - error: Type "list[int]" is not assignable to declared type "list[str]"'] """ output = """ overloads_evaluation.py:38:1 - error: No overloads for "example1_1" match the provided arguments @@ -20,8 +15,4 @@ overloads_evaluation.py:116:14 - error: Argument of type "int | str" cannot be a overloads_evaluation.py:116:17 - error: Argument of type "int | str" cannot be assigned to parameter "y" of type "int" in function "example2"   Type "int | str" is not assignable to type "int"     "str" is not assignable to "int" (reportArgumentType) -overloads_evaluation.py:290:27 - error: Type "list[int]" is not assignable to declared type "list[str]" -  "list[int]" is not assignable to "list[str]" -    Type parameter "_T@list" is invariant, but "int" is not the same as "str" -    Consider switching from "list" to "Sequence" which is covariant (reportAssignmentType) """ diff --git a/conformance/results/pyright/protocols_class_objects.toml b/conformance/results/pyright/protocols_class_objects.toml index f68c71e6d..ebfe905db 100644 --- a/conformance/results/pyright/protocols_class_objects.toml +++ b/conformance/results/pyright/protocols_class_objects.toml @@ -11,8 +11,7 @@ protocols_class_objects.py:58:16 - error: Type "type[ConcreteA]" is not assignab     Type "(self: ConcreteA, x: int) -> int" is not assignable to type "(x: int) -> int"       Parameter name mismatch: "x" versus "self"       Parameter 1: type "int" is incompatible with type "ConcreteA" -        "int" is not assignable to "ConcreteA" -      Extra parameter "x" (reportAssignmentType) +        "int" is not assignable to "ConcreteA" (reportAssignmentType) protocols_class_objects.py:74:16 - error: Type "type[ConcreteB]" is not assignable to declared type "ProtoB1"   "prop1" is an incompatible type     "property" is not assignable to "int" (reportAssignmentType) diff --git a/conformance/results/pyright/protocols_definition.toml b/conformance/results/pyright/protocols_definition.toml index 2b983d502..27fd7e88c 100644 --- a/conformance/results/pyright/protocols_definition.toml +++ b/conformance/results/pyright/protocols_definition.toml @@ -65,9 +65,9 @@ protocols_definition.py:287:22 - error: Type "Concrete5_Bad3" is not assignable   "Concrete5_Bad3" is incompatible with protocol "Template5"     "method1" is an incompatible type       Type "(*, a: int, b: int) -> float" is not assignable to type "(a: int, b: int) -> float" -        Function accepts too many positional parameters; expected 0 but received 2 -          Extra parameter "a" -          Extra parameter "b" (reportAssignmentType) +        Function accepts too few positional parameters; expected 2 but received 0 +          Parameter "a" is missing default argument +          Parameter "b" is missing default argument (reportAssignmentType) protocols_definition.py:288:22 - error: Type "Concrete5_Bad4" is not assignable to declared type "Template5"   "Concrete5_Bad4" is incompatible with protocol "Template5"     "method1" is an incompatible type @@ -82,8 +82,7 @@ protocols_definition.py:289:22 - error: Type "Concrete5_Bad5" is not assignable     "method1" is an incompatible type       Type "(self: Unknown, a: int, b: int) -> float" is not assignable to type "(a: int, b: int) -> float"         Parameter name mismatch: "a" versus "self" -        Parameter name mismatch: "b" versus "a" -        Extra parameter "b" (reportAssignmentType) +        Parameter name mismatch: "b" versus "a" (reportAssignmentType) protocols_definition.py:339:22 - error: Type "Concrete6_Bad1" is not assignable to declared type "Template6"   "Concrete6_Bad1" is incompatible with protocol "Template6"     "val1" is an incompatible type diff --git a/conformance/results/pyright/typeddicts_class_syntax.toml b/conformance/results/pyright/typeddicts_class_syntax.toml index b8d248caf..a3e919ddc 100644 --- a/conformance/results/pyright/typeddicts_class_syntax.toml +++ b/conformance/results/pyright/typeddicts_class_syntax.toml @@ -1,20 +1,12 @@ -conformant = "Partial" -notes = """ -Does not support version-conditional items in `TypedDict` definitions. -""" output = """ typeddicts_class_syntax.py:30:5 - error: TypedDict classes can contain only type annotations (reportGeneralTypeIssues) typeddicts_class_syntax.py:34:5 - error: TypedDict classes can contain only type annotations (reportGeneralTypeIssues) typeddicts_class_syntax.py:39:5 - error: TypedDict classes can contain only type annotations (reportGeneralTypeIssues) typeddicts_class_syntax.py:49:32 - error: TypedDict does not support __init_subclass__ parameter "metaclass" (reportGeneralTypeIssues) typeddicts_class_syntax.py:54:32 - error: TypedDict does not support __init_subclass__ parameter "other" (reportGeneralTypeIssues) -typeddicts_class_syntax.py:62:5 - error: TypedDict classes can contain only type annotations (reportGeneralTypeIssues) -typeddicts_class_syntax.py:64:5 - error: TypedDict classes can contain only type annotations (reportGeneralTypeIssues) typeddicts_class_syntax.py:69:1 - error: No overloads for "__init__" match the provided arguments   Argument types: (Literal[1], Literal[2], Literal[3]) (reportCallIssue) """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 62: Unexpected errors ['typeddicts_class_syntax.py:62:5 - error: TypedDict classes can contain only type annotations (reportGeneralTypeIssues)'] -Line 64: Unexpected errors ['typeddicts_class_syntax.py:64:5 - error: TypedDict classes can contain only type annotations (reportGeneralTypeIssues)'] """ diff --git a/conformance/results/pyright/typeforms_typeform.toml b/conformance/results/pyright/typeforms_typeform.toml index 4b75ffd63..71610b09b 100644 --- a/conformance/results/pyright/typeforms_typeform.toml +++ b/conformance/results/pyright/typeforms_typeform.toml @@ -1,70 +1,28 @@ -conformant = "Unsupported" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 70: Expected 1 errors -Line 71: Expected 1 errors -Line 72: Expected 1 errors -Line 74: Expected 1 errors -Line 15: Unexpected errors ['typeforms_typeform.py:15:29 - error: Type "UnionType" is not assignable to declared type "TypeForm[str | None]"'] -Line 17: Unexpected errors ['typeforms_typeform.py:17:29 - error: Type "None" is not assignable to declared type "TypeForm[str | None]"'] -Line 19: Unexpected errors ['typeforms_typeform.py:19:29 - error: Type "UnionType" is not assignable to declared type "TypeForm[str | None]"'] -Line 20: Unexpected errors ['typeforms_typeform.py:20:29 - error: Type "Literal[\\'str | None\\']" is not assignable to declared type "TypeForm[str | None]"'] -Line 21: Unexpected errors ['typeforms_typeform.py:21:29 - error: Type "type[Any]" is not assignable to declared type "TypeForm[str | None]"'] -Line 29: Unexpected errors ['typeforms_typeform.py:29:24 - error: Type "UnionType" is not assignable to declared type "TypeForm[Any]"'] -Line 32: Unexpected errors ['typeforms_typeform.py:32:13 - error: "assert_type" mismatch: expected "TypeForm[str]" but received "type[str]" (reportAssertTypeFailure)'] -Line 47: Unexpected errors ['typeforms_typeform.py:47:38 - error: Type "UnionType" is not assignable to declared type "TypeForm[str | None]"'] -Line 49: Unexpected errors ['typeforms_typeform.py:49:33 - error: Type "type[list[int]]" is not assignable to declared type "GenericAlias"'] -Line 52: Unexpected errors ['typeforms_typeform.py:52:27 - error: Type "Annotated" is not assignable to declared type "TypeForm[int | str]"'] -Line 53: Unexpected errors ['typeforms_typeform.py:53:26 - error: Type "Literal[\\'set[str]\\']" is not assignable to declared type "TypeForm[set[str]]"'] -Line 58: Unexpected errors ['typeforms_typeform.py:58:7 - error: Argument of type "Literal[\\'int\\']" cannot be assigned to parameter "x" of type "TypeForm[Unknown]" in function "func1"'] -Line 81: Unexpected errors ['typeforms_typeform.py:81:13 - error: "assert_type" mismatch: expected "TypeForm[str | None]" but received "UnionType" (reportAssertTypeFailure)'] -Line 84: Unexpected errors ['typeforms_typeform.py:84:13 - error: "assert_type" mismatch: expected "TypeForm[list[int]]" but received "type[list[int]]" (reportAssertTypeFailure)'] """ output = """ -typeforms_typeform.py:15:29 - error: Type "UnionType" is not assignable to declared type "TypeForm[str | None]" -  "UnionType" is not assignable to "TypeForm[str | None]" (reportAssignmentType) -typeforms_typeform.py:17:29 - error: Type "None" is not assignable to declared type "TypeForm[str | None]" -  "None" is not assignable to "TypeForm[str | None]" (reportAssignmentType) -typeforms_typeform.py:19:29 - error: Type "UnionType" is not assignable to declared type "TypeForm[str | None]" -  "UnionType" is not assignable to "TypeForm[str | None]" (reportAssignmentType) -typeforms_typeform.py:20:29 - error: Type "Literal['str | None']" is not assignable to declared type "TypeForm[str | None]" -  "Literal['str | None']" is not assignable to "TypeForm[str | None]" (reportAssignmentType) -typeforms_typeform.py:21:29 - error: Type "type[Any]" is not assignable to declared type "TypeForm[str | None]" -  Type "Any" is not assignable to type "str | None" -    "Any" is not assignable to "str" -    "Any" is not assignable to "None" (reportAssignmentType) typeforms_typeform.py:23:30 - error: Type "UnionType" is not assignable to declared type "TypeForm[str | None]"   "UnionType" is not assignable to "TypeForm[str | None]" (reportAssignmentType) typeforms_typeform.py:24:30 - error: Type "type[list[str | None]]" is not assignable to declared type "TypeForm[str | None]"   Type "list[str | None]" is not assignable to type "str | None"     "list[str | None]" is not assignable to "str"     "list[str | None]" is not assignable to "None" (reportAssignmentType) -typeforms_typeform.py:29:24 - error: Type "UnionType" is not assignable to declared type "TypeForm[Any]" -  "UnionType" is not assignable to "TypeForm[Any]" (reportAssignmentType) -typeforms_typeform.py:32:13 - error: "assert_type" mismatch: expected "TypeForm[str]" but received "type[str]" (reportAssertTypeFailure) -typeforms_typeform.py:47:38 - error: Type "UnionType" is not assignable to declared type "TypeForm[str | None]" -  "UnionType" is not assignable to "TypeForm[str | None]" (reportAssignmentType) -typeforms_typeform.py:49:33 - error: Type "type[list[int]]" is not assignable to declared type "GenericAlias" -  Type "type[list[int]]" is not assignable to type "GenericAlias" (reportAssignmentType) -typeforms_typeform.py:52:27 - error: Type "Annotated" is not assignable to declared type "TypeForm[int | str]" -  "Annotated" is not assignable to "TypeForm[int | str]" (reportAssignmentType) -typeforms_typeform.py:53:26 - error: Type "Literal['set[str]']" is not assignable to declared type "TypeForm[set[str]]" -  "Literal['set[str]']" is not assignable to "TypeForm[set[str]]" (reportAssignmentType) -typeforms_typeform.py:58:7 - error: Argument of type "Literal['int']" cannot be assigned to parameter "x" of type "TypeForm[Unknown]" in function "func1" -  "Literal['int']" is not assignable to "TypeForm[Unknown]" (reportArgumentType) -typeforms_typeform.py:59:7 - error: Argument of type "Literal['not a type']" cannot be assigned to parameter "x" of type "TypeForm[Unknown]" in function "func1" -  "Literal['not a type']" is not assignable to "TypeForm[Unknown]" (reportArgumentType) -typeforms_typeform.py:67:18 - error: Type "tuple[()]" is not assignable to declared type "TypeForm[Unknown]" -  "tuple[()]" is not assignable to "TypeForm[Unknown]" (reportAssignmentType) -typeforms_typeform.py:68:18 - error: Type "tuple[Literal[1], Literal[2]]" is not assignable to declared type "TypeForm[Unknown]" -  "tuple[Literal[1], Literal[2]]" is not assignable to "TypeForm[Unknown]" (reportAssignmentType) -typeforms_typeform.py:69:18 - error: Type "Literal[1]" is not assignable to declared type "TypeForm[Unknown]" -  "Literal[1]" is not assignable to "TypeForm[Unknown]" (reportAssignmentType) +typeforms_typeform.py:59:7 - error: Argument of type "Literal['not a type']" cannot be assigned to parameter "x" of type "TypeForm[Any]" in function "func1" +  "Literal['not a type']" is not assignable to "TypeForm[Any]" (reportArgumentType) +typeforms_typeform.py:67:18 - error: Type "tuple[()]" is not assignable to declared type "TypeForm[Any]" +  "tuple[()]" is not assignable to "TypeForm[Any]" (reportAssignmentType) +typeforms_typeform.py:68:18 - error: Type "tuple[Literal[1], Literal[2]]" is not assignable to declared type "TypeForm[Any]" +  "tuple[Literal[1], Literal[2]]" is not assignable to "TypeForm[Any]" (reportAssignmentType) +typeforms_typeform.py:69:18 - error: Type "Literal[1]" is not assignable to declared type "TypeForm[Any]" +  "Literal[1]" is not assignable to "TypeForm[Any]" (reportAssignmentType) +typeforms_typeform.py:70:18 - error: "Self" is not valid in this context (reportGeneralTypeIssues) +typeforms_typeform.py:71:18 - error: "ClassVar" is not allowed in this context (reportInvalidTypeForm) +typeforms_typeform.py:72:18 - error: "Final" is not allowed in this context (reportInvalidTypeForm) typeforms_typeform.py:73:25 - error: Type variable "Ts" has no meaning in this context (reportGeneralTypeIssues) -typeforms_typeform.py:75:18 - error: Type "Literal['int + str']" is not assignable to declared type "TypeForm[Unknown]" -  "Literal['int + str']" is not assignable to "TypeForm[Unknown]" (reportAssignmentType) -typeforms_typeform.py:81:13 - error: "assert_type" mismatch: expected "TypeForm[str | None]" but received "UnionType" (reportAssertTypeFailure) -typeforms_typeform.py:84:13 - error: "assert_type" mismatch: expected "TypeForm[list[int]]" but received "type[list[int]]" (reportAssertTypeFailure) +typeforms_typeform.py:74:18 - error: Expected one type argument after "Optional" (reportInvalidTypeForm) +typeforms_typeform.py:75:18 - error: Type "Literal['int + str']" is not assignable to declared type "TypeForm[Any]" +  "Literal['int + str']" is not assignable to "TypeForm[Any]" (reportAssignmentType) typeforms_typeform.py:86:16 - error: type() call should not be used in type expression   Use type[T] instead (reportInvalidTypeForm) typeforms_typeform.py:86:16 - error: Call expression not allowed in type expression (reportInvalidTypeForm) diff --git a/conformance/results/pyright/version.toml b/conformance/results/pyright/version.toml index be295091f..0bcd901b3 100644 --- a/conformance/results/pyright/version.toml +++ b/conformance/results/pyright/version.toml @@ -1 +1 @@ -version = "pyright 1.1.410" +version = "pyright 1.1.414" diff --git a/conformance/results/results.html b/conformance/results/results.html index 4fefddd4e..2c8b034f9 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -264,12 +264,12 @@

    Python Type System Conformance Test Results

    - + - - + + - + @@ -431,7 +431,7 @@

    Python Type System Conformance Test Results

    - + @@ -440,7 +440,7 @@

    Python Type System Conformance Test Results

    - + @@ -495,7 +495,7 @@

    Python Type System Conformance Test Results

    - + - + @@ -616,7 +616,7 @@

    Python Type System Conformance Test Results

    - + @@ -749,7 +749,12 @@

    Python Type System Conformance Test Results

    - + @@ -808,12 +813,7 @@

    Python Type System Conformance Test Results

    - + @@ -827,12 +827,7 @@

    Python Type System Conformance Test Results

    - + @@ -942,10 +937,10 @@

    Python Type System Conformance Test Results

    - + + - @@ -1688,12 +1683,7 @@

    Python Type System Conformance Test Results

    - + @@ -1702,7 +1692,7 @@

    Python Type System Conformance Test Results

    - + @@ -1834,7 +1824,12 @@

    Python Type System Conformance Test Results

    - + @@ -1950,7 +1945,7 @@

    Python Type System Conformance Test Results

    - + @@ -1983,12 +1978,7 @@

    Python Type System Conformance Test Results

    - + @@ -2118,7 +2108,7 @@

    Python Type System Conformance Test Results

    - + @@ -2274,12 +2264,7 @@

    Python Type System Conformance Test Results

    - + @@ -2341,7 +2326,7 @@

    Python Type System Conformance Test Results

    - + @@ -2418,12 +2403,7 @@

    Python Type System Conformance Test Results

    - + @@ -2517,7 +2497,7 @@

    Python Type System Conformance Test Results

    - + @@ -2557,12 +2537,12 @@

    Python Type System Conformance Test Results

    - + + + - - - +
     
    mypy 1.10.1
    -
    1.4sec
    +
    1.2sec
    pyright 1.1.371
    -
    1.4sec
    +
    1.5sec
    pyre 0.9.22
    -
    2.8sec
    +
    1.7sec
    pytype 2024.04.11
    -
    31.4sec
    +
    34.2sec
    diff --git a/conformance/tests/annotations_forward_refs.py b/conformance/tests/annotations_forward_refs.py index b64a8e936..24111176f 100644 --- a/conformance/tests/annotations_forward_refs.py +++ b/conformance/tests/annotations_forward_refs.py @@ -88,6 +88,9 @@ def int(self) -> None: # OK y: int = 0 # E: Refers to local int, which isn't a legal type expression + def __init__(self) -> None: + self.ClassC = ClassC() + assert_type(ClassD.str, str) assert_type(ClassD.x, int) diff --git a/conformance/tests/classes_classvar.py b/conformance/tests/classes_classvar.py index 56bb2a7dd..5e0c963b3 100644 --- a/conformance/tests/classes_classvar.py +++ b/conformance/tests/classes_classvar.py @@ -83,6 +83,9 @@ class BasicStarship: damage: int # Instance variable without default stats: ClassVar[dict[str, int]] = {} # Class variable + def __init__(self, damage: int) -> None: + self.damage = damage + class Starship: captain: str = "Picard" diff --git a/conformance/tests/dataclasses_transform_class.py b/conformance/tests/dataclasses_transform_class.py index bb33fbd0c..ad0aa8355 100644 --- a/conformance/tests/dataclasses_transform_class.py +++ b/conformance/tests/dataclasses_transform_class.py @@ -36,6 +36,9 @@ def __init_subclass__( ) -> None: ... + def __init__(self, not_a_field: str) -> None: + self.not_a_field = not_a_field + class Customer1(ModelBase, frozen=True): id: int = model_field() diff --git a/conformance/tests/dataclasses_transform_meta.py b/conformance/tests/dataclasses_transform_meta.py index 4414ce725..dff70a2e4 100644 --- a/conformance/tests/dataclasses_transform_meta.py +++ b/conformance/tests/dataclasses_transform_meta.py @@ -25,6 +25,9 @@ def model_field( class ModelMeta(type): not_a_field: str + def __init__(self, not_a_field: str) -> None: + self.not_a_field = not_a_field + class ModelBase(metaclass=ModelMeta): def __init_subclass__( diff --git a/conformance/tests/dataclasses_usage.py b/conformance/tests/dataclasses_usage.py index 4338cfa02..7dbba033e 100644 --- a/conformance/tests/dataclasses_usage.py +++ b/conformance/tests/dataclasses_usage.py @@ -117,6 +117,7 @@ class DC8(DC7): def __init__(self, a: DC7, y: int): self.__dict__ = a.__dict__ + self.y = y a = DC7(3) @@ -173,7 +174,7 @@ class DC13: x_squared: int -# This should generate an error because there is no +# This should generate an error because there is no matching # override __init__ method and no synthesized __init__. DC13(3) # E diff --git a/conformance/tests/enums_members.py b/conformance/tests/enums_members.py index 505cacfcc..52007e4d4 100644 --- a/conformance/tests/enums_members.py +++ b/conformance/tests/enums_members.py @@ -19,6 +19,10 @@ class Pet(Enum): # E?: Uninitialized attributes (pyre) CAT = 1 # Member attribute DOG = 2 # Member attribute + def __init__(self, genus: str, species: str) -> None: + self.genus = genus + self.species = species + assert_type(Pet.genus, str) assert_type(Pet.species, str) diff --git a/conformance/tests/generics_scoping.py b/conformance/tests/generics_scoping.py index fcdb1957e..9b6ec7d18 100644 --- a/conformance/tests/generics_scoping.py +++ b/conformance/tests/generics_scoping.py @@ -77,12 +77,18 @@ class Bad(Iterable[T]): # E class AlsoBad: x: list[T] # E + def __init__(self, x: list[T]) -> None: + self.x = x + class Inner(Iterable[S]): # OK ... attr: Inner[T] # OK alias: TypeAlias = list[T] # E + def __init__(self, attr: Inner[T]) -> None: + self.attr = attr + # Test unbound type variables at global scope global_var1: T # E diff --git a/conformance/tests/generics_self_basic.py b/conformance/tests/generics_self_basic.py index fd6a78719..b7da6a38d 100644 --- a/conformance/tests/generics_self_basic.py +++ b/conformance/tests/generics_self_basic.py @@ -58,6 +58,9 @@ class Circle(Shape): class Container(Generic[T]): value: T + def __init__(self, value: T) -> None: + self.value = value + def set_value(self, value: T) -> Self: ... # This should generate an error because Self isn't subscriptable. diff --git a/conformance/tests/generics_type_erasure.py b/conformance/tests/generics_type_erasure.py index f88af0e59..c7462259a 100644 --- a/conformance/tests/generics_type_erasure.py +++ b/conformance/tests/generics_type_erasure.py @@ -10,7 +10,9 @@ class Node(Generic[T]): label: T - def __init__(self, label: T | None = None) -> None: ... + def __init__(self, label: T | None = None) -> None: + if label is not None: + self.label = label assert_type(Node(''), Node[str]) assert_type(Node(0), Node[int]) diff --git a/conformance/tests/protocols_class_objects.py b/conformance/tests/protocols_class_objects.py index 73dc35775..7ffc5e7cb 100644 --- a/conformance/tests/protocols_class_objects.py +++ b/conformance/tests/protocols_class_objects.py @@ -93,6 +93,9 @@ class ConcreteC2: class CMeta(type): attr1: int + def __init__(self, attr1: int) -> None: + self.attr1 = attr1 + class ConcreteC3(metaclass=CMeta): pass diff --git a/conformance/tests/protocols_explicit.py b/conformance/tests/protocols_explicit.py index 98f88dce3..1e2763a61 100644 --- a/conformance/tests/protocols_explicit.py +++ b/conformance/tests/protocols_explicit.py @@ -54,6 +54,7 @@ def transparency(self) -> int: class Point(RGB): def __init__(self, red: int, green: int, blue: str) -> None: self.rgb = red, green, blue # E: 'blue' must be 'int' + self.other = 0 p = Point(0, 0, "") # E: Cannot instantiate abstract class @@ -80,7 +81,10 @@ class Proto3(Proto2, Protocol): class Concrete1(Proto1): - ... + def __init__(self): + self.cm1 = 1 + self.im1 = 1 + self.im3 = 3 c1 = Concrete1() # E: cannot instantiate abstract class @@ -98,7 +102,9 @@ class Concrete3(Proto1, Proto3): cm1 = 3 def __init__(self): - im1 = 0 + self.im1 = 0 + self.cm10 = 10 + self.cm11 = 11 c3 = Concrete3() # E: cannot instantiate abstract class diff --git a/conformance/tests/specialtypes_never.py b/conformance/tests/specialtypes_never.py index 339c6f000..41b624e38 100644 --- a/conformance/tests/specialtypes_never.py +++ b/conformance/tests/specialtypes_never.py @@ -56,6 +56,10 @@ class ClassA: x: NoReturn y: list[NoReturn] + def __init__(self, x: NoReturn, y: list[NoReturn]) -> None: + self.x = x + self.y = y + # Never is compatible with all types. diff --git a/conformance/tests/typeddicts_class_syntax.py b/conformance/tests/typeddicts_class_syntax.py index d2983b76a..6c8409b58 100644 --- a/conformance/tests/typeddicts_class_syntax.py +++ b/conformance/tests/typeddicts_class_syntax.py @@ -54,7 +54,7 @@ class BadTypedDict3(TypedDict, other=True): # E T = TypeVar("T") -class GenericTypedDict(Generic[T]): +class GenericTypedDict(TypedDict, Generic[T]): name: str value: T diff --git a/conformance/tests/typeddicts_required.py b/conformance/tests/typeddicts_required.py index d4cef0142..e38e6df86 100644 --- a/conformance/tests/typeddicts_required.py +++ b/conformance/tests/typeddicts_required.py @@ -11,6 +11,9 @@ class NotTypedDict: x: Required[int] # E: Required not allowed in this context + def __init__(self, x: int) -> None: + self.x = x + def func1( x: NotRequired[int], # E: NotRequired not allowed in this context From 5ef8643c668ab9cf36b51f488d3eecf3cbc443e1 Mon Sep 17 00:00:00 2001 From: Danny Yang Date: Tue, 16 Jul 2024 14:00:03 -0400 Subject: [PATCH 028/308] Update conformance test sources to allow some errors in additional positions (#1807) * update conformance tests to initialize uninitialized variables * remove unnecessary __init__ methods * remove __init__ parameter for ClassC in annotations_forward_refs * allow errors on more lines --- conformance/results/mypy/generics_variance.toml | 8 ++------ conformance/results/mypy/tuples_unpacked.toml | 2 +- conformance/results/pyre/generics_variance.toml | 8 ++------ conformance/results/pyre/tuples_unpacked.toml | 2 -- conformance/results/pyre/version.toml | 2 +- .../results/pytype/generics_variance.toml | 8 ++++---- conformance/results/pytype/tuples_unpacked.toml | 2 +- conformance/results/pytype/version.toml | 2 +- conformance/results/results.html | 4 ++-- conformance/tests/generics_variance.py | 16 ++++++++-------- conformance/tests/tuples_unpacked.py | 4 ++-- 11 files changed, 24 insertions(+), 34 deletions(-) diff --git a/conformance/results/mypy/generics_variance.toml b/conformance/results/mypy/generics_variance.toml index 531a60fcc..30810aacf 100644 --- a/conformance/results/mypy/generics_variance.toml +++ b/conformance/results/mypy/generics_variance.toml @@ -14,13 +14,9 @@ generics_variance.py:131: error: Variance of TypeVar "T_contra" incompatible wit conformance_automated = "Fail" errors_diff = """ Line 113: Expected 1 errors -Line 126: Expected 1 errors -Line 132: Expected 1 errors -Line 142: Expected 1 errors Line 163: Expected 1 errors Line 167: Expected 1 errors Line 191: Expected 1 errors -Line 196: Expected 1 errors -Line 125: Unexpected errors ['generics_variance.py:125: error: Variance of TypeVar "T_co" incompatible with variance in parent type [type-var]'] -Line 131: Unexpected errors ['generics_variance.py:131: error: Variance of TypeVar "T_contra" incompatible with variance in parent type [type-var]'] +Lines 141, 142: Expected error (tag 'CoContra_Child5') +Lines 195, 196: Expected error (tag 'ContraToContraToContra_WithTA') """ diff --git a/conformance/results/mypy/tuples_unpacked.toml b/conformance/results/mypy/tuples_unpacked.toml index ad33667a3..5f51cf2b6 100644 --- a/conformance/results/mypy/tuples_unpacked.toml +++ b/conformance/results/mypy/tuples_unpacked.toml @@ -11,5 +11,5 @@ errors_diff = """ Line 40: Expected 1 errors Line 41: Expected 1 errors Line 51: Expected 1 errors -Line 61: Expected 1 errors +Lines 60, 61: Expected error (tag 't14') """ diff --git a/conformance/results/pyre/generics_variance.toml b/conformance/results/pyre/generics_variance.toml index 3bf5ddc0c..3054f35e6 100644 --- a/conformance/results/pyre/generics_variance.toml +++ b/conformance/results/pyre/generics_variance.toml @@ -15,13 +15,9 @@ conformance_automated = "Fail" errors_diff = """ Line 14: Expected 1 errors Line 113: Expected 1 errors -Line 126: Expected 1 errors -Line 132: Expected 1 errors -Line 142: Expected 1 errors Line 163: Expected 1 errors Line 167: Expected 1 errors Line 191: Expected 1 errors -Line 196: Expected 1 errors -Line 125: Unexpected errors ['generics_variance.py:125:0 Invalid type variance [46]: The type variable `Variable[T_co](covariant)` is incompatible with parent class type variable `Variable[T_contra](contravariant)` because subclasses cannot use more permissive type variables than their superclasses.'] -Line 131: Unexpected errors ['generics_variance.py:131:0 Invalid type variance [46]: The type variable `Variable[T_contra](contravariant)` is incompatible with parent class type variable `Variable[T_co](covariant)` because subclasses cannot use more permissive type variables than their superclasses.'] +Lines 141, 142: Expected error (tag 'CoContra_Child5') +Lines 195, 196: Expected error (tag 'ContraToContraToContra_WithTA') """ diff --git a/conformance/results/pyre/tuples_unpacked.toml b/conformance/results/pyre/tuples_unpacked.toml index 19a418572..9e1dd53bd 100644 --- a/conformance/results/pyre/tuples_unpacked.toml +++ b/conformance/results/pyre/tuples_unpacked.toml @@ -21,7 +21,6 @@ tuples_unpacked.py:60:5 Invalid type [31]: Expression `tuple[(typing.Unpack[tupl """ conformance_automated = "Fail" errors_diff = """ -Line 61: Expected 1 errors Line 16: Unexpected errors ['tuples_unpacked.py:16:13 Invalid type [31]: Expression `tuple[(int, *tuple[(bool, bool)], str)]` is not a valid type.'] Line 18: Unexpected errors ['tuples_unpacked.py:18:19 Invalid type [31]: Expression `tuple[(*tuple[(int, bool)], bool, str)]` is not a valid type.'] Line 19: Unexpected errors ['tuples_unpacked.py:19:19 Invalid type [31]: Expression `tuple[(int, bool, *tuple[(bool, str)])]` is not a valid type.'] @@ -32,5 +31,4 @@ Line 38: Unexpected errors ['tuples_unpacked.py:38:4 Invalid type [31]: Expressi Line 39: Unexpected errors ['tuples_unpacked.py:39:4 Invalid type [31]: Expression `tuple[(*tuple[(str, *tuple[(str, ...)])])]` is not a valid type.'] Line 49: Unexpected errors ['tuples_unpacked.py:49:13 Invalid type [31]: Expression `tuple[(*Ts)]` is not a valid type.'] Line 50: Unexpected errors ['tuples_unpacked.py:50:8 Invalid type [31]: Expression `tuple[(*tuple[str], *Ts)]` is not a valid type.'] -Line 60: Unexpected errors ['tuples_unpacked.py:60:5 Invalid type [31]: Expression `tuple[(typing.Unpack[tuple[(str, typing.Unpack[tuple[(str, ...)]])]], typing.Unpack[tuple[(int, ...)]])]` is not a valid type.'] """ diff --git a/conformance/results/pyre/version.toml b/conformance/results/pyre/version.toml index cd590f239..5686e9cb3 100644 --- a/conformance/results/pyre/version.toml +++ b/conformance/results/pyre/version.toml @@ -1,2 +1,2 @@ version = "pyre 0.9.22" -test_duration = 1.7 +test_duration = 1.6 diff --git a/conformance/results/pytype/generics_variance.toml b/conformance/results/pytype/generics_variance.toml index 71f928f3e..92664946c 100644 --- a/conformance/results/pytype/generics_variance.toml +++ b/conformance/results/pytype/generics_variance.toml @@ -17,13 +17,13 @@ Line 81: Expected 1 errors Line 93: Expected 1 errors Line 105: Expected 1 errors Line 113: Expected 1 errors -Line 126: Expected 1 errors -Line 132: Expected 1 errors -Line 142: Expected 1 errors Line 163: Expected 1 errors Line 167: Expected 1 errors Line 191: Expected 1 errors -Line 196: Expected 1 errors +Lines 125, 126: Expected error (tag 'CoContra_Child2') +Lines 131, 132: Expected error (tag 'CoContra_Child3') +Lines 141, 142: Expected error (tag 'CoContra_Child5') +Lines 195, 196: Expected error (tag 'ContraToContraToContra_WithTA') Line 18: Unexpected errors ['File "generics_variance.py", line 18, in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] Line 19: Unexpected errors ['File "generics_variance.py", line 19, in : argument "contravariant" to TypeVar not supported yet [not-supported-yet]'] Line 27: Unexpected errors ['File "generics_variance.py", line 27, in __iter__: bad return type [bad-return-type]'] diff --git a/conformance/results/pytype/tuples_unpacked.toml b/conformance/results/pytype/tuples_unpacked.toml index ff0e3854f..78e943a83 100644 --- a/conformance/results/pytype/tuples_unpacked.toml +++ b/conformance/results/pytype/tuples_unpacked.toml @@ -34,7 +34,7 @@ File "tuples_unpacked.py", line 51, in func3: Invalid type annotation 'tuple[*tu conformance_automated = "Fail" errors_diff = """ Line 59: Expected 1 errors -Line 61: Expected 1 errors +Lines 60, 61: Expected error (tag 't14') Line 13: Unexpected errors ['File "tuples_unpacked.py", line 13, in : typing.Unpack not supported yet [not-supported-yet]', 'File "tuples_unpacked.py", line 13, in : typing.TypeVarTuple not supported yet [not-supported-yet]'] Line 16: Unexpected errors ['File "tuples_unpacked.py", line 16, in : Invalid type annotation \\'\\' [invalid-annotation]'] Line 17: Unexpected errors ['File "tuples_unpacked.py", line 17, in func1: Tuple[Any] [assert-type]'] diff --git a/conformance/results/pytype/version.toml b/conformance/results/pytype/version.toml index f93298567..736e8295e 100644 --- a/conformance/results/pytype/version.toml +++ b/conformance/results/pytype/version.toml @@ -1,2 +1,2 @@ version = "pytype 2024.04.11" -test_duration = 34.2 +test_duration = 34.0 diff --git a/conformance/results/results.html b/conformance/results/results.html index bd5dd6d22..cc7f3a09d 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -165,10 +165,10 @@

    Python Type System Conformance Test Results

    1.5sec
    pyre 0.9.22
    -
    1.7sec
    +
    1.6sec
    pytype 2024.04.11
    -
    34.2sec
    +
    34.0sec
    diff --git a/conformance/tests/generics_variance.py b/conformance/tests/generics_variance.py index c4b8682c4..0b3e732b4 100644 --- a/conformance/tests/generics_variance.py +++ b/conformance/tests/generics_variance.py @@ -122,14 +122,14 @@ class CoContra_Child1(CoContra[T_co, T_contra]): # OK ... -class CoContra_Child2( - CoContra[T_co, T_co] # E: Second type arg must be contravariant +class CoContra_Child2( # E[CoContra_Child2]: Second type arg must be contravariant + CoContra[T_co, T_co] # E[CoContra_Child2]: Second type arg must be contravariant ): ... -class CoContra_Child3( - CoContra[T_contra, T_contra] # E: First type arg must be covariant +class CoContra_Child3( # E[CoContra_Child3]: First type arg must be covariant + CoContra[T_contra, T_contra] # E[CoContra_Child3]: First type arg must be covariant ): ... @@ -138,8 +138,8 @@ class CoContra_Child4(CoContra[T, T]): # OK ... -class CoContra_Child5( - CoContra[Co[T_co], Co[T_co]] # E: Second type arg must be contravariant +class CoContra_Child5( # E[CoContra_Child5]: Second type arg must be contravariant + CoContra[Co[T_co], Co[T_co]] # E[CoContra_Child5]: Second type arg must be contravariant ): ... @@ -192,7 +192,7 @@ class CoToContraToContra_WithTA(Contra_TA[Co_TA[Contra_TA[T_contra]]]): # E ... -class ContraToContraToContra_WithTA( - Contra_TA[Contra_TA[Contra_TA[T_co]]] # E +class ContraToContraToContra_WithTA( # E[ContraToContraToContra_WithTA] + Contra_TA[Contra_TA[Contra_TA[T_co]]] # E[ContraToContraToContra_WithTA] ): ... diff --git a/conformance/tests/tuples_unpacked.py b/conformance/tests/tuples_unpacked.py index ca58af7a7..706b58f83 100644 --- a/conformance/tests/tuples_unpacked.py +++ b/conformance/tests/tuples_unpacked.py @@ -57,6 +57,6 @@ def func3(t: tuple[*Ts]): t11: tuple[Unpack[tuple[str]], Unpack[tuple[str]]] # OK t12: tuple[Unpack[tuple[str, Unpack[tuple[str, ...]]]]] # OK t13: tuple[Unpack[tuple[str, ...]], Unpack[tuple[int, ...]]] # E -t14: tuple[ - Unpack[tuple[str, Unpack[tuple[str, ...]]]], Unpack[tuple[int, ...]] # E +t14: tuple[ # E[t14] + Unpack[tuple[str, Unpack[tuple[str, ...]]]], Unpack[tuple[int, ...]] # E[t14] ] From 69493db808de246c6743ff5410a49f0a296c1cb3 Mon Sep 17 00:00:00 2001 From: Victorien <65306057+Viicos@users.noreply.github.com> Date: Wed, 17 Jul 2024 13:24:44 +0200 Subject: [PATCH 029/308] Replace `Annotation` by `Annotated` (#1808) --- docs/spec/qualifiers.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/spec/qualifiers.rst b/docs/spec/qualifiers.rst index 33c94285e..8cfb476df 100644 --- a/docs/spec/qualifiers.rst +++ b/docs/spec/qualifiers.rst @@ -177,7 +177,7 @@ annotations for function arguments:: ... ``Final`` may be wrapped only by other type qualifiers (e.g. ``ClassVar`` or -``Annotation``). It cannot be used in a type parameter (e.g. +``Annotated``). It cannot be used in a type parameter (e.g. ``list[Final[int]]`` is not permitted.) Note that declaring a name as final only guarantees that the name will From dc105feed71a651a4c68198c44b14916a26a1418 Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Wed, 17 Jul 2024 15:30:14 +0200 Subject: [PATCH 030/308] Turn Sphinx warnings into errors (#1809) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This will – for example – prevent "floating" documents that aren't part of the TOC structure. --- docs/Makefile | 2 +- docs/make.bat | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/Makefile b/docs/Makefile index 4f7c95a88..9c7bc939c 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -10,7 +10,7 @@ PYTHON = python3 VENVDIR = ./venv SPHINXBUILD = PATH=$(VENVDIR)/bin:$$PATH sphinx-build -ALLSPHINXOPTS = -b $(BUILDER) -d build/doctrees $(SPHINXOPTS) . build/$(BUILDER) $(SOURCES) +ALLSPHINXOPTS = -W -b $(BUILDER) -d build/doctrees $(SPHINXOPTS) . build/$(BUILDER) $(SOURCES) .PHONY: help clean build html text venv Makefile diff --git a/docs/make.bat b/docs/make.bat index 2119f5109..11c18e5e6 100644 --- a/docs/make.bat +++ b/docs/make.bat @@ -25,7 +25,7 @@ if errorlevel 9009 ( exit /b 1 ) -%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% +%SPHINXBUILD% -W -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% goto end :help From 28fa5155604457026f576c40eb70fc96313e15d9 Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Thu, 18 Jul 2024 20:56:17 -0700 Subject: [PATCH 031/308] Add guide to type narrowing (#1798) Some of the text derives from the "How to teach this" section of PEP 742. The asyncio example is based on a sample written by Liz King in https://discuss.python.org/t/problems-with-typeis/55410. Co-authored-by: Alex Waygood --- docs/guides/index.rst | 1 + docs/guides/type_narrowing.rst | 342 +++++++++++++++++++++++++++++++++ 2 files changed, 343 insertions(+) create mode 100644 docs/guides/type_narrowing.rst diff --git a/docs/guides/index.rst b/docs/guides/index.rst index 5ba92d4ff..9a3bbe28a 100644 --- a/docs/guides/index.rst +++ b/docs/guides/index.rst @@ -10,4 +10,5 @@ Type System Guides writing_stubs modernizing unreachable + type_narrowing typing_anti_pitch diff --git a/docs/guides/type_narrowing.rst b/docs/guides/type_narrowing.rst new file mode 100644 index 000000000..f900775cf --- /dev/null +++ b/docs/guides/type_narrowing.rst @@ -0,0 +1,342 @@ +************** +Type Narrowing +************** + +Python programs often contain symbols that take on multiple types within a +single given scope and that are distinguished by a conditional check at +runtime. For example, here the variable *name* can be either a ``str`` or +``None``, and the ``if name is not None`` narrows it down to just ``str``:: + + def maybe_greet(name: str | None) -> None: + if name is not None: + print("Hello, " + name) + +This technique is called *type narrowing*. +To avoid false positives on such code, type checkers understand +various kinds of conditional checks that are used to narrow types in Python code. +The exact set of type narrowing constructs that a type checker understands +is not specified and varies across type checkers. Commonly understood +patterns include: + +* ``if x is not None`` +* ``if x`` +* ``if isinstance(x, SomeType)`` +* ``if callable(x)`` + +In addition to narrowing local variables, type checkers usually also support +narrowing instance attributes and sequence members, such as +``if x.some_attribute is not None`` or ``if x[0] is not None``, though the exact +conditions for this behavior differ between type checkers. + +Consult your type checker's documentation for more information on the type +narrowing constructs it supports. + +The type system also includes two ways to create *user-defined* type narrowing +functions: :py:data:`typing.TypeIs` and :py:data:`typing.TypeGuard`. These +are useful if you want to reuse a more complicated check in multiple places, or +you use a check that the type checker doesn't understand. In these cases, you +can define a ``TypeIs`` or ``TypeGuard`` function to perform the check and allow type checkers +to use it to narrow the type of a variable. Between the two, ``TypeIs`` usually +has the more intuitive behavior, so we'll talk about it more; see +:ref:`below ` for a comparison. + +How to use ``TypeIs`` and ``TypeGuard`` +--------------------------------------- + +A ``TypeIs`` function takes a single argument and is annotated as returning +``TypeIs[T]``, where ``T`` is the type that you want to narrow to. The function +must return ``True`` if the argument is of type ``T``, and ``False`` otherwise. +The function can then be used in ``if`` checks, just like you would use ``isinstance()``. +For example:: + + from typing import Literal, TypeIs + + type Direction = Literal["N", "E", "S", "W"] + + def is_direction(x: str) -> TypeIs[Direction]: + return x in {"N", "E", "S", "W"} + + def maybe_direction(x: str) -> None: + if is_direction(x): + print(f"{x} is a cardinal direction") + else: + print(f"{x} is not a cardinal direction") + +A ``TypeGuard`` function looks similar and is used in the same way, but the +type narrowing behavior is different, as dicussed in :ref:`the section below `. + +Depending on the version of Python you are running, you will be able to +import ``TypeIs`` and ``TypeGuard`` either from the standard library :py:mod:`typing` +module or from the third-party ``typing_extensions`` module: + +* ``TypeIs`` is in ``typing`` starting from Python 3.13 and in ``typing_extensions`` + starting from version 4.10.0. +* ``TypeGuard`` is in ``typing`` starting from Python 3.10 and in ``typing_extensions`` + starting from version 3.10.0.0. + + +Writing a correct ``TypeIs`` function +------------------------------------- + +A ``TypeIs`` function allows you to override your type checker's type narrowing +behavior. This is a powerful tool, but it can be dangerous because an incorrectly +written ``TypeIs`` function can lead to unsound type checking, and type checkers +cannot detect such errors. + +For a function returning ``TypeIs[T]`` to be correct, it must return ``True`` if and only if +the argument is of type ``T``, and ``False`` otherwise. If this condition is +not met, the type checker may infer incorrect types. + +Below are some examples of correct and incorrect ``TypeIs`` functions:: + + from typing import TypeIs + + # Correct + def is_int(x: object) -> TypeIs[int]: + return isinstance(x, int) + + # Incorrect: does not return True for all ints + def is_positive_int(x: object) -> TypeIs[int]: + return isinstance(x, int) and x > 0 + + # Incorrect: returns True for some non-ints + def is_real_number(x: object) -> TypeIs[int]: + return isinstance(x, (int, float)) + +This function demonstrates some errors that can occur when using a poorly written +``TypeIs`` function. These errors are not detected by type checkers:: + + def caller(x: int | str, y: int | float) -> None: + if is_positive_int(x): # narrowed to int + print(x + 1) + else: # narrowed to str (incorrectly) + print("Hello " + x) # runtime error if x is a negative int + + if is_real_number(y): # narrowed to int + # Because of the incorrect TypeIs, this branch is taken at runtime if + # y is a float. + print(y.bit_count()) # runtime error: this method exists only on int, not float + else: # narrowed to float (though never executed at runtime) + pass + +Here is an example of a correct ``TypeIs`` function for a more complicated type:: + + from typing import TypedDict, TypeIs + + class Point(TypedDict): + x: int + y: int + + def is_point(obj: object) -> TypeIs[Point]: + return ( + isinstance(obj, dict) + and all(isinstance(key, str) for key in obj) + and isinstance(obj.get("x"), int) + and isinstance(obj.get("y"), int) + ) + +.. _`guide-type-narrowing-typeis-typeguard`: + +``TypeIs`` and ``TypeGuard`` +---------------------------- + +:py:data:`typing.TypeIs` and :py:data:`typing.TypeGuard` are both tools for narrowing the type of a variable +based on a user-defined function. Both can be used to annotate functions that take an +argument and return a boolean depending on whether the input argument is compatible with +the narrowed type. These function can then be used in ``if`` checks to narrow the type +of a variable. + +``TypeIs`` usually has the more intuitive behavior, but it +introduces more restrictions. ``TypeGuard`` is the right tool to use if: + +* You want to narrow to a type that is not :term:`assignable` to the input type, for example + from ``list[object]`` to ``list[int]``. ``TypeIs`` only allows narrowing between + compatible types. +* Your function does not return ``True`` for all input values that are members of + the narrowed type. For example, you could have a ``TypeGuard[int]`` that returns ``True`` + only for positive integers. + +``TypeIs`` and ``TypeGuard`` differ in the following ways: + +* ``TypeIs`` requires the narrowed type to be :term:`assignable` to the input type, while + ``TypeGuard`` does not. +* When a ``TypeGuard`` function returns ``True``, type checkers narrow the type of the + variable to exactly the ``TypeGuard`` type. When a ``TypeIs`` function returns ``True``, + type checkers can infer a more precise type combining the previously known type of the + variable with the ``TypeIs`` type. (This is known as an "intersection type".) +* When a ``TypeGuard`` function returns ``False``, type checkers cannot narrow the type of + the variable at all. When a ``TypeIs`` function returns ``False``, type checkers can narrow + the type of the variable to exclude the ``TypeIs`` type. + +This behavior can be seen in the following example:: + + from typing import TypeGuard, TypeIs, reveal_type, final + + class Base: ... + class Child(Base): ... + @final + class Unrelated: ... + + def is_base_typeguard(x: object) -> TypeGuard[Base]: + return isinstance(x, Base) + + def is_base_typeis(x: object) -> TypeIs[Base]: + return isinstance(x, Base) + + def use_typeguard(x: Child | Unrelated) -> None: + if is_base_typeguard(x): + reveal_type(x) # Base + else: + reveal_type(x) # Child | Unrelated + + def use_typeis(x: Child | Unrelated) -> None: + if is_base_typeis(x): + reveal_type(x) # Child + else: + reveal_type(x) # Unrelated + + +Safety and soundness +-------------------- + +While type narrowing is important for typing real-world Python code, many +forms of type narrowing are unsafe in the presence of mutability. Type checkers +attempt to limit type narrowing in a way that minimizes unsafety while remaining +useful, but not all safety violations can be detected. + +``isinstance()`` and ``issubclass()`` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +While the exact behavior is not standardized, type checkers usually support +narrowing terms based on calls to ``isinstance()`` and ``issubclass()``. However, +these functions have complex runtime behavior that type checkers cannot fully +capture: they call the :py:meth:`__instancecheck__` and :py:meth:`__subclasscheck__` +special methods, which may include arbitrarily complex logic. + +This affects some parts of the standard library that rely on these methods. +:py:class:`abc.ABC` allows registration of subclasses using the ``.register()`` method, +but type checkers usually will not recognize this method. :ref:`Runtime-checkable +protocols ` support runtime ``isinstance()`` checks, but their +behavior does not exactly match the type system (for example, the types of method +parameters are not checked). + +Incorrect ``TypeIs`` and ``TypeGuard`` functions +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Both ``TypeIs`` and ``TypeGuard`` rely on the user writing a function that +returns whether an object is of a particular type. However, the type checker +does not validate whether the function actually behaves as expected. If it +does not, the type checker's narrowing behavior will not match what happens +at runtime.:: + + from typing import TypeIs + + def is_str(x: object) -> TypeIs[str]: + return True + + def takes_str_or_int(x: str | int) -> None: + if is_str(x): + print(x + " is a string") # runtime error + +To avoid this problem, every ``TypeIs`` and ``TypeGuard`` function should be +carefully reviewed and tested. + +Unsound ``TypeGuard`` narrowing +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Unlike ``TypeIs``, ``TypeGuard`` can narrow to a type that is not a subtype of the +original type. This allows for unsafe behavior with invariant data structures:: + + from typing import Any, TypeGuard + + def is_int_list(x: list[Any]) -> TypeGuard[list[int]]: + return all(isinstance(i, int) for i in x) + + def maybe_mutate_list(x: list[Any]) -> None: + if is_int_list(x): + x.append(0) # OK, x is narrowed to list[int] + + def takes_bool_list(x: list[bool]) -> None: + maybe_mutate_list(x) + reveal_type(x) # list[bool] + assert all(isinstance(i, bool) for i in x) # fails at runtime + + takes_bool_list([True, False]) + +To avoid this problem, use ``TypeIs`` instead of ``TypeGuard`` where possible. +If you must use ``TypeGuard``, avoid narrowing across incompatible types. +Prefer using covariant, immutable types in parameter annotations (e.g., +``Sequence`` or ``Iterable`` instead of ``list``). If you do this, it is more likely +that you'll be able to use ``TypeIs`` to implement your type narrowing functions. + +Invalidated assumptions +~~~~~~~~~~~~~~~~~~~~~~~ + +One category of safety issues relates to the fact that type narrowing relies +on a condition that was established at one point in the code and is then relied +on later: we first check ``if x is not None``, then rely on ``x`` not being ``None``. +However, in the meantime other code may have run (for example, in another thread, +another coroutine, or simply some code that was invoked by a function call) and +invalidated the earlier condition. + +Such problems are most likely when narrowing is performed on elements of mutable +objects, but it is possible to construct unsafe examples even using only narrowing +of local variables:: + + def maybe_greet(name: str | None) -> None: + def set_it_to_none(): + nonlocal name + name = None + + if name is not None: + set_it_to_none() + # fails at runtime, no error in current type checkers + print("Hello " + name) + + maybe_greet("Guido") + +A more realistic example might involve multiple coroutines mutating a list:: + + import asyncio + from typing import Sequence, TypeIs + + def is_int_sequence(x: Sequence[object]) -> TypeIs[Sequence[int]]: + return all(isinstance(i, int) for i in x) + + async def takes_seq(x: Sequence[int | None]): + if is_int_sequence(x): + await asyncio.sleep(2) + print("The total is", sum(x)) # fails at runtime + + async def takes_list(x: list[int | None]): + t = asyncio.create_task(takes_seq(x)) + await asyncio.sleep(1) + x.append(None) + await t + + if __name__ == "__main__": + lst: list[int | None] = [1, 2, 3] + asyncio.run(takes_list(lst)) + +These issues unfortunately cannot be fully detected by the current +Python type system. (An example of a different programming language that +does solve this problem is Rust, which uses a system called +`ownership `__.) +To avoid such issues, avoid using type narrowing on objects that are mutated +from other parts of the code. + + +See also +-------- + +* Type checker documentation on type narrowing + + * `Mypy `__ + * `Pyright `__ + +* PEPs related to type narrowing. These contain additional discussion + and motivation for current type checker behaviors. + + * :pep:`647` (introduced ``TypeGuard``) + * (*withdrawn*) :pep:`724` (proposed change to ``TypeGuard`` behavior) + * :pep:`742` (introduced ``TypeIs``) From cef5d6d602557eb8d16c55298eb362eff22a4859 Mon Sep 17 00:00:00 2001 From: Victorien <65306057+Viicos@users.noreply.github.com> Date: Fri, 19 Jul 2024 16:58:56 +0200 Subject: [PATCH 032/308] Fix link to Python docs in dataclasses spec (#1811) Co-authored-by: Jelle Zijlstra --- docs/spec/dataclasses.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/spec/dataclasses.rst b/docs/spec/dataclasses.rst index d3229a5d5..55265e575 100644 --- a/docs/spec/dataclasses.rst +++ b/docs/spec/dataclasses.rst @@ -488,7 +488,7 @@ This includes, but is not limited to, the following semantics: wheel_count: int * Field ordering and inheritance is assumed to follow the rules - specified in `the Python docs `. This includes the effects of + specified in `the Python docs `__. This includes the effects of overrides (redefining a field in a child class that has already been defined in a parent class). From ab074f62364d2ca41bcb95a59ad89386cddd9c98 Mon Sep 17 00:00:00 2001 From: Eric Traut Date: Fri, 19 Jul 2024 13:44:32 -0700 Subject: [PATCH 033/308] Updated conformance test results for mypy 1.11.0 and pyright 1.1.372 (#1812) Updated conformance test results for mypy 1.11.0 and pyright 1.1.372. This version of mypy adds experimental support for some PEP 695 features, which turned many "Unsupported" tests to either "Partial" or "Pass". It also includes fixes for a few enum and namedtuple conformance issues. There were no conformance changes for pyright, just a few tweaks to error messages. --- .../results/mypy/aliases_explicit.toml | 8 +- .../results/mypy/aliases_implicit.toml | 4 +- .../results/mypy/aliases_type_statement.toml | 125 +++++---------- .../results/mypy/aliases_typealiastype.toml | 5 +- .../mypy/annotations_forward_refs.toml | 11 +- .../results/mypy/constructors_call_init.toml | 9 -- .../mypy/constructors_call_metaclass.toml | 4 +- .../results/mypy/constructors_call_new.toml | 4 +- .../results/mypy/constructors_callable.toml | 8 +- conformance/results/mypy/enums_members.toml | 7 +- conformance/results/mypy/generics_basic.toml | 2 +- .../mypy/generics_paramspec_basic.toml | 10 +- .../generics_paramspec_specialization.toml | 2 +- .../results/mypy/generics_self_advanced.toml | 8 +- .../mypy/generics_syntax_compatibility.toml | 20 +-- .../mypy/generics_syntax_declarations.toml | 56 ++----- .../mypy/generics_syntax_infer_variance.toml | 16 +- .../results/mypy/generics_syntax_scoping.toml | 76 ++-------- .../results/mypy/generics_type_erasure.toml | 4 +- .../mypy/generics_variance_inference.toml | 142 ++++-------------- .../mypy/namedtuples_define_functional.toml | 11 +- .../results/mypy/qualifiers_annotated.toml | 6 +- .../results/mypy/specialtypes_never.toml | 4 +- conformance/results/mypy/version.toml | 4 +- conformance/results/pyre/version.toml | 2 +- .../pyright/constructors_call_init.toml | 2 +- .../pyright/constructors_call_type.toml | 4 +- .../results/pyright/dataclasses_usage.toml | 2 +- .../results/pyright/protocols_generic.toml | 2 +- conformance/results/pyright/version.toml | 4 +- conformance/results/pytype/version.toml | 2 +- conformance/results/results.html | 30 ++-- conformance/src/type_checker.py | 11 +- 33 files changed, 173 insertions(+), 432 deletions(-) diff --git a/conformance/results/mypy/aliases_explicit.toml b/conformance/results/mypy/aliases_explicit.toml index a71905fff..bcf03a097 100644 --- a/conformance/results/mypy/aliases_explicit.toml +++ b/conformance/results/mypy/aliases_explicit.toml @@ -7,7 +7,7 @@ aliases_explicit.py:67: error: Bad number of arguments for type alias, expected aliases_explicit.py:68: error: Bad number of arguments for type alias, expected 0, given 1 [type-arg] aliases_explicit.py:69: error: Bad number of arguments for type alias, expected 1, given 2 [type-arg] aliases_explicit.py:70: error: Bad number of arguments for type alias, expected 1, given 2 [type-arg] -aliases_explicit.py:71: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "int" [misc] +aliases_explicit.py:71: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "int" [valid-type] aliases_explicit.py:79: error: Invalid type alias: expression is not a valid type [valid-type] aliases_explicit.py:80: error: Bracketed expression "[...]" is not valid as a type [valid-type] aliases_explicit.py:81: error: Invalid type alias: expression is not a valid type [valid-type] @@ -23,13 +23,11 @@ aliases_explicit.py:89: error: Invalid type: try using Literal[1] instead? [val aliases_explicit.py:90: error: Invalid type alias: expression is not a valid type [valid-type] aliases_explicit.py:90: error: Function "list" could always be true in boolean context [truthy-function] aliases_explicit.py:91: error: Invalid type alias: expression is not a valid type [valid-type] -aliases_explicit.py:101: error: "" not callable [operator] +aliases_explicit.py:101: error: "UnionType[list[Any], set[Any]]" not callable [operator] aliases_explicit.py:102: error: Bad number of arguments for type alias, expected 0, given 1 [type-arg] """ conformance_automated = "Fail" errors_diff = """ Line 100: Expected 1 errors """ -ignore_errors = [ - 'Function "list" could always be true in boolean context', -] +ignore_errors = ["Function \"list\" could always be true in boolean context"] diff --git a/conformance/results/mypy/aliases_implicit.toml b/conformance/results/mypy/aliases_implicit.toml index f20f1a776..98f363428 100644 --- a/conformance/results/mypy/aliases_implicit.toml +++ b/conformance/results/mypy/aliases_implicit.toml @@ -4,7 +4,7 @@ aliases_implicit.py:76: error: Bad number of arguments for type alias, expected aliases_implicit.py:77: error: Bad number of arguments for type alias, expected 0, given 1 [type-arg] aliases_implicit.py:78: error: Bad number of arguments for type alias, expected 1, given 2 [type-arg] aliases_implicit.py:79: error: Bad number of arguments for type alias, expected 1, given 2 [type-arg] -aliases_implicit.py:80: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "int" [misc] +aliases_implicit.py:80: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "int" [valid-type] aliases_implicit.py:81: error: Type argument "str" of "GoodTypeAlias12" must be a subtype of "float" [type-var] aliases_implicit.py:100: error: Function "list" could always be true in boolean context [truthy-function] aliases_implicit.py:106: error: Variable "aliases_implicit.BadTypeAlias1" is not valid as a type [valid-type] @@ -35,7 +35,7 @@ aliases_implicit.py:118: error: Variable "aliases_implicit.BadTypeAlias13" is no aliases_implicit.py:118: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases aliases_implicit.py:119: error: Variable "aliases_implicit.BadTypeAlias14" is not valid as a type [valid-type] aliases_implicit.py:119: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -aliases_implicit.py:133: error: "" not callable [operator] +aliases_implicit.py:133: error: "UnionType[list[Any], set[Any]]" not callable [operator] aliases_implicit.py:135: error: Bad number of arguments for type alias, expected 0, given 1 [type-arg] """ conformance_automated = "Pass" diff --git a/conformance/results/mypy/aliases_type_statement.toml b/conformance/results/mypy/aliases_type_statement.toml index b43771b11..536ef0ce3 100644 --- a/conformance/results/mypy/aliases_type_statement.toml +++ b/conformance/results/mypy/aliases_type_statement.toml @@ -1,97 +1,46 @@ -conformant = "Unsupported" +conformant = "Partial" notes = """ -Does not support `type` statement. +Does not reject use of TypeAliasType as base class. +Does not reject redefinition of type alias defined with type statement. +Does not reject type alias defined in function scope. +Does not reject type alias with circular definition. """ output = """ -aliases_type_statement.py: error: Cannot assign multiple types to name "BadTypeAlias14" without an explicit "Type[...]" annotation [misc] -aliases_type_statement.py:8: error: PEP 695 type aliases are not yet supported [valid-type] -aliases_type_statement.py:9: error: PEP 695 type aliases are not yet supported [valid-type] -aliases_type_statement.py:9: error: Name "S3" is not defined [name-defined] -aliases_type_statement.py:9: error: Name "S1" is not defined [name-defined] -aliases_type_statement.py:9: error: Name "S2" is not defined [name-defined] -aliases_type_statement.py:10: error: PEP 695 type aliases are not yet supported [valid-type] -aliases_type_statement.py:10: error: Value of type "UnionType" is not indexable [index] -aliases_type_statement.py:14: error: PEP 695 type aliases are not yet supported [valid-type] -aliases_type_statement.py:21: error: "type[int]" has no attribute "__value__" [attr-defined] -aliases_type_statement.py:23: error: "type[int]" has no attribute "other_attrib" [attr-defined] -aliases_type_statement.py:37: error: PEP 695 type aliases are not yet supported [valid-type] -aliases_type_statement.py:38: error: PEP 695 type aliases are not yet supported [valid-type] -aliases_type_statement.py:39: error: PEP 695 type aliases are not yet supported [valid-type] -aliases_type_statement.py:40: error: PEP 695 type aliases are not yet supported [valid-type] -aliases_type_statement.py:41: error: PEP 695 type aliases are not yet supported [valid-type] -aliases_type_statement.py:42: error: PEP 695 type aliases are not yet supported [valid-type] -aliases_type_statement.py:43: error: PEP 695 type aliases are not yet supported [valid-type] -aliases_type_statement.py:44: error: PEP 695 type aliases are not yet supported [valid-type] -aliases_type_statement.py:45: error: PEP 695 type aliases are not yet supported [valid-type] -aliases_type_statement.py:46: error: PEP 695 type aliases are not yet supported [valid-type] -aliases_type_statement.py:47: error: PEP 695 type aliases are not yet supported [valid-type] -aliases_type_statement.py:48: error: PEP 695 type aliases are not yet supported [valid-type] -aliases_type_statement.py:48: error: Function "list" could always be true in boolean context [truthy-function] -aliases_type_statement.py:49: error: PEP 695 type aliases are not yet supported [valid-type] -aliases_type_statement.py:52: error: PEP 695 type aliases are not yet supported [valid-type] -aliases_type_statement.py:54: error: PEP 695 type aliases are not yet supported [valid-type] -aliases_type_statement.py:58: error: PEP 695 type aliases are not yet supported [valid-type] -aliases_type_statement.py:64: error: PEP 695 type aliases are not yet supported [valid-type] -aliases_type_statement.py:64: error: Name "K" is not defined [name-defined] -aliases_type_statement.py:69: error: PEP 695 type aliases are not yet supported [valid-type] -aliases_type_statement.py:72: error: PEP 695 type aliases are not yet supported [valid-type] -aliases_type_statement.py:72: error: Name "T" is not defined [name-defined] -aliases_type_statement.py:72: error: Variable "aliases_type_statement.RecursiveTypeAlias1" is not valid as a type [valid-type] -aliases_type_statement.py:72: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -aliases_type_statement.py:74: error: Variable "aliases_type_statement.RecursiveTypeAlias1" is not valid as a type [valid-type] -aliases_type_statement.py:74: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -aliases_type_statement.py:75: error: Variable "aliases_type_statement.RecursiveTypeAlias1" is not valid as a type [valid-type] -aliases_type_statement.py:75: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -aliases_type_statement.py:77: error: PEP 695 type aliases are not yet supported [valid-type] -aliases_type_statement.py:77: error: Name "P" is not defined [name-defined] -aliases_type_statement.py:77: error: Name "T" is not defined [name-defined] -aliases_type_statement.py:77: error: Name "S" is not defined [name-defined] -aliases_type_statement.py:77: error: Variable "aliases_type_statement.RecursiveTypeAlias2" is not valid as a type [valid-type] -aliases_type_statement.py:77: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -aliases_type_statement.py:79: error: Unexpected "..." [misc] -aliases_type_statement.py:79: error: Variable "aliases_type_statement.RecursiveTypeAlias2" is not valid as a type [valid-type] -aliases_type_statement.py:79: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -aliases_type_statement.py:80: error: Unexpected "..." [misc] -aliases_type_statement.py:80: error: Variable "aliases_type_statement.RecursiveTypeAlias2" is not valid as a type [valid-type] -aliases_type_statement.py:80: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -aliases_type_statement.py:81: error: Unexpected "..." [misc] -aliases_type_statement.py:81: error: Variable "aliases_type_statement.RecursiveTypeAlias2" is not valid as a type [valid-type] -aliases_type_statement.py:81: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -aliases_type_statement.py:82: error: Bracketed expression "[...]" is not valid as a type [valid-type] -aliases_type_statement.py:82: error: Variable "aliases_type_statement.RecursiveTypeAlias2" is not valid as a type [valid-type] -aliases_type_statement.py:82: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -aliases_type_statement.py:84: error: PEP 695 type aliases are not yet supported [valid-type] -aliases_type_statement.py:84: error: Name "RecursiveTypeAlias3" is not defined [name-defined] -aliases_type_statement.py:86: error: PEP 695 type aliases are not yet supported [valid-type] -aliases_type_statement.py:86: error: Name "T" is not defined [name-defined] -aliases_type_statement.py:86: error: Cannot determine type of "RecursiveTypeAlias4" [has-type] -aliases_type_statement.py:88: error: PEP 695 type aliases are not yet supported [valid-type] -aliases_type_statement.py:88: error: Name "T" is not defined [name-defined] -aliases_type_statement.py:88: error: Variable "aliases_type_statement.RecursiveTypeAlias5" is not valid as a type [valid-type] -aliases_type_statement.py:88: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -aliases_type_statement.py:90: error: PEP 695 type aliases are not yet supported [valid-type] +aliases_type_statement.py:17: error: "TypeAliasType" has no attribute "bit_count" [attr-defined] +aliases_type_statement.py:19: error: "TypeAliasType" not callable [operator] +aliases_type_statement.py:23: error: "TypeAliasType" has no attribute "other_attrib" [attr-defined] +aliases_type_statement.py:31: error: Parameterized generics cannot be used with class or instance checks [misc] +aliases_type_statement.py:31: error: Argument 2 to "isinstance" has incompatible type "TypeAliasType"; expected "_ClassInfo" [arg-type] +aliases_type_statement.py:37: error: Invalid type alias: expression is not a valid type [valid-type] +aliases_type_statement.py:38: error: Bracketed expression "[...]" is not valid as a type [valid-type] +aliases_type_statement.py:39: error: Invalid type alias: expression is not a valid type [valid-type] +aliases_type_statement.py:40: error: Invalid type alias: expression is not a valid type [valid-type] +aliases_type_statement.py:41: error: Invalid type alias: expression is not a valid type [valid-type] +aliases_type_statement.py:42: error: Invalid type alias: expression is not a valid type [valid-type] +aliases_type_statement.py:43: error: Invalid type alias: expression is not a valid type [valid-type] +aliases_type_statement.py:44: error: Invalid type alias: expression is not a valid type [valid-type] +aliases_type_statement.py:45: error: Variable "aliases_type_statement.var1" is not valid as a type [valid-type] +aliases_type_statement.py:45: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +aliases_type_statement.py:46: error: Invalid type: try using Literal[True] instead? [valid-type] +aliases_type_statement.py:47: error: Invalid type: try using Literal[1] instead? [valid-type] +aliases_type_statement.py:48: error: Invalid type alias: expression is not a valid type [valid-type] +aliases_type_statement.py:49: error: Invalid type alias: expression is not a valid type [valid-type] +aliases_type_statement.py:54: error: Name "BadTypeAlias14" already defined on line 52 [no-redef] +aliases_type_statement.py:64: error: All type parameters should be declared ("V" not declared) [valid-type] +aliases_type_statement.py:69: error: All type parameters should be declared ("T1" not declared) [valid-type] +aliases_type_statement.py:79: error: Type argument "str" of "RecursiveTypeAlias2" must be a subtype of "int" [type-var] +aliases_type_statement.py:81: error: Type argument "int" of "RecursiveTypeAlias2" must be a subtype of "str" [type-var] +aliases_type_statement.py:84: error: Cannot resolve name "RecursiveTypeAlias3" (possible cyclic definition) [misc] +aliases_type_statement.py:86: error: Invalid recursive alias: a union item of itself [misc] +aliases_type_statement.py:90: error: Cannot resolve name "RecursiveTypeAlias6" (possible cyclic definition) [misc] aliases_type_statement.py:90: error: Cannot resolve name "RecursiveTypeAlias7" (possible cyclic definition) [misc] -aliases_type_statement.py:90: error: Name "RecursiveTypeAlias7" is used before definition [used-before-def] -aliases_type_statement.py:91: error: PEP 695 type aliases are not yet supported [valid-type] +aliases_type_statement.py:91: error: Cannot resolve name "RecursiveTypeAlias7" (possible cyclic definition) [misc] """ conformance_automated = "Fail" errors_diff = """ -Line 17: Expected 1 errors -Line 19: Expected 1 errors Line 26: Expected 1 errors -Line 31: Expected 1 errors -Line 8: Unexpected errors ['aliases_type_statement.py:8: error: PEP 695 type aliases are not yet supported [valid-type]'] -Line 9: Unexpected errors ['aliases_type_statement.py:9: error: PEP 695 type aliases are not yet supported [valid-type]', 'aliases_type_statement.py:9: error: Name "S3" is not defined [name-defined]', 'aliases_type_statement.py:9: error: Name "S1" is not defined [name-defined]', 'aliases_type_statement.py:9: error: Name "S2" is not defined [name-defined]'] -Line 10: Unexpected errors ['aliases_type_statement.py:10: error: PEP 695 type aliases are not yet supported [valid-type]', 'aliases_type_statement.py:10: error: Value of type "UnionType" is not indexable [index]'] -Line 14: Unexpected errors ['aliases_type_statement.py:14: error: PEP 695 type aliases are not yet supported [valid-type]'] -Line 21: Unexpected errors ['aliases_type_statement.py:21: error: "type[int]" has no attribute "__value__" [attr-defined]'] -Line 54: Unexpected errors ['aliases_type_statement.py:54: error: PEP 695 type aliases are not yet supported [valid-type]'] -Line 72: Unexpected errors ['aliases_type_statement.py:72: error: PEP 695 type aliases are not yet supported [valid-type]', 'aliases_type_statement.py:72: error: Name "T" is not defined [name-defined]', 'aliases_type_statement.py:72: error: Variable "aliases_type_statement.RecursiveTypeAlias1" is not valid as a type [valid-type]'] -Line 74: Unexpected errors ['aliases_type_statement.py:74: error: Variable "aliases_type_statement.RecursiveTypeAlias1" is not valid as a type [valid-type]'] -Line 75: Unexpected errors ['aliases_type_statement.py:75: error: Variable "aliases_type_statement.RecursiveTypeAlias1" is not valid as a type [valid-type]'] -Line 77: Unexpected errors ['aliases_type_statement.py:77: error: PEP 695 type aliases are not yet supported [valid-type]', 'aliases_type_statement.py:77: error: Name "P" is not defined [name-defined]', 'aliases_type_statement.py:77: error: Name "T" is not defined [name-defined]', 'aliases_type_statement.py:77: error: Name "S" is not defined [name-defined]', 'aliases_type_statement.py:77: error: Variable "aliases_type_statement.RecursiveTypeAlias2" is not valid as a type [valid-type]'] -Line 80: Unexpected errors ['aliases_type_statement.py:80: error: Unexpected "..." [misc]', 'aliases_type_statement.py:80: error: Variable "aliases_type_statement.RecursiveTypeAlias2" is not valid as a type [valid-type]'] -Line 82: Unexpected errors ['aliases_type_statement.py:82: error: Bracketed expression "[...]" is not valid as a type [valid-type]', 'aliases_type_statement.py:82: error: Variable "aliases_type_statement.RecursiveTypeAlias2" is not valid as a type [valid-type]'] -Line 88: Unexpected errors ['aliases_type_statement.py:88: error: PEP 695 type aliases are not yet supported [valid-type]', 'aliases_type_statement.py:88: error: Name "T" is not defined [name-defined]', 'aliases_type_statement.py:88: error: Variable "aliases_type_statement.RecursiveTypeAlias5" is not valid as a type [valid-type]'] -Line 91: Unexpected errors ['aliases_type_statement.py:91: error: PEP 695 type aliases are not yet supported [valid-type]'] +Line 52: Expected 1 errors +Line 58: Expected 1 errors +Line 54: Unexpected errors ['aliases_type_statement.py:54: error: Name "BadTypeAlias14" already defined on line 52 [no-redef]'] +Line 91: Unexpected errors ['aliases_type_statement.py:91: error: Cannot resolve name "RecursiveTypeAlias7" (possible cyclic definition) [misc]'] """ diff --git a/conformance/results/mypy/aliases_typealiastype.toml b/conformance/results/mypy/aliases_typealiastype.toml index 590610a41..fe6dd997a 100644 --- a/conformance/results/mypy/aliases_typealiastype.toml +++ b/conformance/results/mypy/aliases_typealiastype.toml @@ -2,15 +2,13 @@ conformant = "Partial" notes = """ Incorrectly rejects some recursive type aliases using TypeAliasType. Incorrectly rejects the use of a class-scoped TypeVar in a TypeAliasType definition. -Generates error when accessing `__value__` attribute of TypeAliasType. """ output = """ aliases_typealiastype.py:19: error: Cannot resolve name "GoodAlias4" (possible cyclic definition) [misc] aliases_typealiastype.py:20: error: Cannot resolve name "GoodAlias5" (possible cyclic definition) [misc] aliases_typealiastype.py:22: error: Cannot resolve name "GoodAlias5" (possible cyclic definition) [misc] aliases_typealiastype.py:27: error: Type variable "T" is not included in type_params [valid-type] -aliases_typealiastype.py:30: error: "type[int]" has no attribute "__value__" [attr-defined] -aliases_typealiastype.py:32: error: "type[int]" has no attribute "other_attrib" [attr-defined] +aliases_typealiastype.py:32: error: "TypeAliasType" has no attribute "other_attrib" [attr-defined] aliases_typealiastype.py:40: error: Type argument "int" of "GoodAlias5" must be a subtype of "str" [type-var] aliases_typealiastype.py:43: error: Type variable "S" is not included in type_params [valid-type] aliases_typealiastype.py:44: error: Type variable "S" is not included in type_params [valid-type] @@ -43,5 +41,4 @@ Line 19: Unexpected errors ['aliases_typealiastype.py:19: error: Cannot resolve Line 20: Unexpected errors ['aliases_typealiastype.py:20: error: Cannot resolve name "GoodAlias5" (possible cyclic definition) [misc]'] Line 22: Unexpected errors ['aliases_typealiastype.py:22: error: Cannot resolve name "GoodAlias5" (possible cyclic definition) [misc]'] Line 27: Unexpected errors ['aliases_typealiastype.py:27: error: Type variable "T" is not included in type_params [valid-type]'] -Line 30: Unexpected errors ['aliases_typealiastype.py:30: error: "type[int]" has no attribute "__value__" [attr-defined]'] """ diff --git a/conformance/results/mypy/annotations_forward_refs.toml b/conformance/results/mypy/annotations_forward_refs.toml index bee7ebbd0..14d8cb64c 100644 --- a/conformance/results/mypy/annotations_forward_refs.toml +++ b/conformance/results/mypy/annotations_forward_refs.toml @@ -6,8 +6,9 @@ Incorrectly generates error for quoted type defined in class scope. """ output = """ annotations_forward_refs.py:41: error: Invalid type comment or annotation [valid-type] -annotations_forward_refs.py:42: error: Invalid type comment or annotation [valid-type] -annotations_forward_refs.py:43: error: Invalid type comment or annotation [valid-type] +annotations_forward_refs.py:42: error: Bracketed expression "[...]" is not valid as a type [valid-type] +annotations_forward_refs.py:43: error: Syntax error in type annotation [syntax] +annotations_forward_refs.py:43: note: Suggestion: Use Tuple[T1, ..., Tn] instead of (T1, ..., Tn) annotations_forward_refs.py:44: error: Invalid type comment or annotation [valid-type] annotations_forward_refs.py:45: error: Invalid type comment or annotation [valid-type] annotations_forward_refs.py:46: error: Invalid type comment or annotation [valid-type] @@ -15,9 +16,9 @@ annotations_forward_refs.py:47: error: Invalid type comment or annotation [vali annotations_forward_refs.py:48: error: Invalid type comment or annotation [valid-type] annotations_forward_refs.py:49: error: Variable "annotations_forward_refs.var1" is not valid as a type [valid-type] annotations_forward_refs.py:49: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -annotations_forward_refs.py:50: error: Invalid type comment or annotation [valid-type] -annotations_forward_refs.py:51: error: Invalid type comment or annotation [valid-type] -annotations_forward_refs.py:52: error: Invalid type comment or annotation [valid-type] +annotations_forward_refs.py:50: error: Invalid type: try using Literal[True] instead? [valid-type] +annotations_forward_refs.py:51: error: Invalid type: try using Literal[1] instead? [valid-type] +annotations_forward_refs.py:52: error: Invalid type: try using Literal[-1] instead? [valid-type] annotations_forward_refs.py:53: error: Invalid type comment or annotation [valid-type] annotations_forward_refs.py:54: error: Invalid type comment or annotation [valid-type] annotations_forward_refs.py:55: error: Module "types" is not valid as a type [valid-type] diff --git a/conformance/results/mypy/constructors_call_init.toml b/conformance/results/mypy/constructors_call_init.toml index 3bf225988..d8680ec9d 100644 --- a/conformance/results/mypy/constructors_call_init.toml +++ b/conformance/results/mypy/constructors_call_init.toml @@ -1,7 +1,6 @@ conformant = "Partial" notes = """ Does not report errors during binding to self parameter of __init__ method. -Does not support function-scoped TypeVars in self annotation in __init__ method. Does not reject use of class-scoped type variables in annotation of self parameter in __init__ method. """ conformance_automated = "Fail" @@ -9,18 +8,10 @@ errors_diff = """ Line 56: Expected 1 errors Line 107: Expected 1 errors Line 73: Unexpected errors ['constructors_call_init.py:73: error: Expression is of type "Class5[list[int]]", not "Class5[int]" [assert-type]'] -Line 91: Unexpected errors ['constructors_call_init.py:91: error: Expression is of type "Class6[V1, V2]", not "Class6[int, str]" [assert-type]'] -Line 92: Unexpected errors ['constructors_call_init.py:92: error: Expression is of type "Class6[V1, V2]", not "Class6[int, str]" [assert-type]'] -Line 99: Unexpected errors ['constructors_call_init.py:99: error: Expression is of type "Class7[V2, V1]", not "Class7[str, int]" [assert-type]'] -Line 100: Unexpected errors ['constructors_call_init.py:100: error: Expression is of type "Class7[V2, V1]", not "Class7[str, int]" [assert-type]'] """ output = """ constructors_call_init.py:21: error: Argument 1 to "Class1" has incompatible type "float"; expected "int" [arg-type] constructors_call_init.py:42: error: Argument 1 to "Class3" has incompatible type "Class2[Never]"; expected "Class3 | None" [arg-type] constructors_call_init.py:73: error: Expression is of type "Class5[list[int]]", not "Class5[int]" [assert-type] -constructors_call_init.py:91: error: Expression is of type "Class6[V1, V2]", not "Class6[int, str]" [assert-type] -constructors_call_init.py:92: error: Expression is of type "Class6[V1, V2]", not "Class6[int, str]" [assert-type] -constructors_call_init.py:99: error: Expression is of type "Class7[V2, V1]", not "Class7[str, int]" [assert-type] -constructors_call_init.py:100: error: Expression is of type "Class7[V2, V1]", not "Class7[str, int]" [assert-type] constructors_call_init.py:130: error: Too many arguments for "Class11" [call-arg] """ diff --git a/conformance/results/mypy/constructors_call_metaclass.toml b/conformance/results/mypy/constructors_call_metaclass.toml index 1ee25a8e1..355939b52 100644 --- a/conformance/results/mypy/constructors_call_metaclass.toml +++ b/conformance/results/mypy/constructors_call_metaclass.toml @@ -5,12 +5,12 @@ Does not skip evaluation of __new__ and __init__ if custom metaclass call return """ conformance_automated = "Fail" errors_diff = """ -Line 23: Unexpected errors ['constructors_call_metaclass.py:23: error: Expression is of type "Class1", not "NoReturn" [assert-type]', 'constructors_call_metaclass.py:23: error: Missing positional argument "x" in call to "Class1" [call-arg]'] +Line 23: Unexpected errors ['constructors_call_metaclass.py:23: error: Expression is of type "Class1", not "Never" [assert-type]', 'constructors_call_metaclass.py:23: error: Missing positional argument "x" in call to "Class1" [call-arg]'] Line 36: Unexpected errors ['constructors_call_metaclass.py:36: error: Expression is of type "Class2", not "int | Meta2" [assert-type]', 'constructors_call_metaclass.py:36: error: Missing positional argument "x" in call to "Class2" [call-arg]'] Line 43: Unexpected errors ['constructors_call_metaclass.py:43: error: Argument 2 for "super" not an instance of argument 1 [misc]'] """ output = """ -constructors_call_metaclass.py:23: error: Expression is of type "Class1", not "NoReturn" [assert-type] +constructors_call_metaclass.py:23: error: Expression is of type "Class1", not "Never" [assert-type] constructors_call_metaclass.py:23: error: Missing positional argument "x" in call to "Class1" [call-arg] constructors_call_metaclass.py:36: error: Expression is of type "Class2", not "int | Meta2" [assert-type] constructors_call_metaclass.py:36: error: Missing positional argument "x" in call to "Class2" [call-arg] diff --git a/conformance/results/mypy/constructors_call_new.toml b/conformance/results/mypy/constructors_call_new.toml index ce7ce82be..64d15f4b6 100644 --- a/conformance/results/mypy/constructors_call_new.toml +++ b/conformance/results/mypy/constructors_call_new.toml @@ -11,7 +11,7 @@ Line 40: Unexpected errors ['constructors_call_new.py:40: error: Incompatible re Line 49: Unexpected errors ['constructors_call_new.py:49: error: Expression is of type "Class3", not "int" [assert-type]', 'constructors_call_new.py:49: error: Missing positional argument "x" in call to "Class3" [call-arg]'] Line 57: Unexpected errors ['constructors_call_new.py:57: error: "__new__" must return a class instance (got "Class4 | Any") [misc]'] Line 64: Unexpected errors ['constructors_call_new.py:64: error: Expression is of type "Class4", not "Class4 | Any" [assert-type]', 'constructors_call_new.py:64: error: Missing positional argument "x" in call to "Class4" [call-arg]'] -Line 76: Unexpected errors ['constructors_call_new.py:76: error: Expression is of type "Class5", not "NoReturn" [assert-type]', 'constructors_call_new.py:76: error: Missing positional argument "x" in call to "Class5" [call-arg]'] +Line 76: Unexpected errors ['constructors_call_new.py:76: error: Expression is of type "Class5", not "Never" [assert-type]', 'constructors_call_new.py:76: error: Missing positional argument "x" in call to "Class5" [call-arg]'] Line 82: Unexpected errors ['constructors_call_new.py:82: error: "__new__" must return a class instance (got "int | Class6") [misc]'] Line 89: Unexpected errors ['constructors_call_new.py:89: error: Expression is of type "Class6", not "int | Class6" [assert-type]', 'constructors_call_new.py:89: error: Missing positional argument "x" in call to "Class6" [call-arg]'] """ @@ -23,7 +23,7 @@ constructors_call_new.py:49: error: Missing positional argument "x" in call to " constructors_call_new.py:57: error: "__new__" must return a class instance (got "Class4 | Any") [misc] constructors_call_new.py:64: error: Expression is of type "Class4", not "Class4 | Any" [assert-type] constructors_call_new.py:64: error: Missing positional argument "x" in call to "Class4" [call-arg] -constructors_call_new.py:76: error: Expression is of type "Class5", not "NoReturn" [assert-type] +constructors_call_new.py:76: error: Expression is of type "Class5", not "Never" [assert-type] constructors_call_new.py:76: error: Missing positional argument "x" in call to "Class5" [call-arg] constructors_call_new.py:82: error: "__new__" must return a class instance (got "int | Class6") [misc] constructors_call_new.py:89: error: Expression is of type "Class6", not "int | Class6" [assert-type] diff --git a/conformance/results/mypy/constructors_callable.toml b/conformance/results/mypy/constructors_callable.toml index 7f4f19e84..6d3aef710 100644 --- a/conformance/results/mypy/constructors_callable.toml +++ b/conformance/results/mypy/constructors_callable.toml @@ -10,8 +10,8 @@ Line 127: Expected 1 errors Line 144: Expected 1 errors Line 73: Unexpected errors ['constructors_callable.py:73: error: Incompatible return type for "__new__" (returns "int", but must return a subtype of "Class4") [misc]'] Line 78: Unexpected errors ['constructors_callable.py:78: error: Expression is of type "Class4", not "int" [assert-type]'] -Line 100: Unexpected errors ['constructors_callable.py:100: error: Expression is of type "Class5", not "NoReturn" [assert-type]'] -Line 105: Unexpected errors ['constructors_callable.py:105: error: Expression is of type "Class5", not "NoReturn" [assert-type]'] +Line 100: Unexpected errors ['constructors_callable.py:100: error: Expression is of type "Class5", not "Never" [assert-type]'] +Line 105: Unexpected errors ['constructors_callable.py:105: error: Expression is of type "Class5", not "Never" [assert-type]'] Line 116: Unexpected errors ['constructors_callable.py:116: error: Incompatible return type for "__new__" (returns "Class6Proxy", but must return a subtype of "Class6") [misc]'] Line 117: Unexpected errors ['constructors_callable.py:117: error: Incompatible return value type (got "Class6", expected "Class6Proxy") [return-value]'] Line 126: Unexpected errors ['constructors_callable.py:126: error: Expression is of type "Class6", not "Class6Proxy" [assert-type]', 'constructors_callable.py:126: error: Too few arguments [call-arg]'] @@ -33,8 +33,8 @@ constructors_callable.py:78: error: Expression is of type "Class4", not "int" [ constructors_callable.py:79: error: Too few arguments [call-arg] constructors_callable.py:80: error: Unexpected keyword argument "y" [call-arg] constructors_callable.py:97: note: Revealed type is "def (*args: Any, **kwargs: Any) -> constructors_callable.Class5" -constructors_callable.py:100: error: Expression is of type "Class5", not "NoReturn" [assert-type] -constructors_callable.py:105: error: Expression is of type "Class5", not "NoReturn" [assert-type] +constructors_callable.py:100: error: Expression is of type "Class5", not "Never" [assert-type] +constructors_callable.py:105: error: Expression is of type "Class5", not "Never" [assert-type] constructors_callable.py:116: error: Incompatible return type for "__new__" (returns "Class6Proxy", but must return a subtype of "Class6") [misc] constructors_callable.py:117: error: Incompatible return value type (got "Class6", expected "Class6Proxy") [return-value] constructors_callable.py:125: note: Revealed type is "def (x: builtins.int) -> constructors_callable.Class6" diff --git a/conformance/results/mypy/enums_members.toml b/conformance/results/mypy/enums_members.toml index a1d4ac3da..ebac634c3 100644 --- a/conformance/results/mypy/enums_members.toml +++ b/conformance/results/mypy/enums_members.toml @@ -3,17 +3,17 @@ notes = """ Does not treat attribute with annotation and no assignment as non-member. Does not reject use of annotation with enum member. Does not treat callables as non-members. -Does not honor `enum.nonmember` to define non-member attribute. Does not honor `enum.member` as method decorator. Does not properly handle aliased enum members. Does not support `_ignore_` mechanism (optional). +Does not treat attributes with private names as non-members. """ conformance_automated = "Fail" errors_diff = """ Line 50: Expected 1 errors Line 82: Expected 1 errors Line 83: Expected 1 errors -Line 116: Expected 1 errors +Line 129: Expected 1 errors Line 27: Unexpected errors ['enums_members.py:27: error: Expression is of type "Literal[Pet.genus]", not "str" [assert-type]'] Line 28: Unexpected errors ['enums_members.py:28: error: Expression is of type "Literal[Pet.species]", not "str" [assert-type]'] Line 35: Unexpected errors ['enums_members.py:35: error: Expression is of type "Literal[Pet2.genus]", not "str" [assert-type]'] @@ -31,12 +31,11 @@ enums_members.py:84: error: Parameter 1 of Literal[...] is invalid [valid-type] enums_members.py:85: error: Expression is of type "Callable[[Pet4], None]", not "Any" [assert-type] enums_members.py:85: error: Parameter 1 of Literal[...] is invalid [valid-type] enums_members.py:100: error: Expression is of type "Literal[TrafficLight.AMBER]", not "Literal[TrafficLight.YELLOW]" [assert-type] +enums_members.py:116: error: Expression is of type "int", not "Literal[Example.b]" [assert-type] enums_members.py:117: error: Expression is of type "member[Callable[[Example], None]]", not "Any" [assert-type] enums_members.py:117: error: Parameter 1 of Literal[...] is invalid [valid-type] enums_members.py:128: note: Revealed type is "Any" enums_members.py:128: note: 'reveal_type' always outputs 'Any' in unchecked functions -enums_members.py:129: error: Expression is of type "Any", not "Literal[Example2.__B]" [assert-type] -enums_members.py:129: note: "assert_type" expects everything to be "Any" in unchecked functions enums_members.py:146: error: Expression is of type "Literal[Pet5.DOG]", not "int" [assert-type] enums_members.py:147: error: Expression is of type "Literal[Pet5.FISH]", not "int" [assert-type] """ diff --git a/conformance/results/mypy/generics_basic.toml b/conformance/results/mypy/generics_basic.toml index 024c77561..00c824401 100644 --- a/conformance/results/mypy/generics_basic.toml +++ b/conformance/results/mypy/generics_basic.toml @@ -5,7 +5,7 @@ Does not reject the use of a constraint parameterized by another type variable. output = """ generics_basic.py:40: error: Value of type variable "AnyStr" of "concat" cannot be "Sequence[object]" [type-var] generics_basic.py:41: error: Value of type variable "AnyStr" of "concat" cannot be "Sequence[object]" [type-var] -generics_basic.py:49: error: TypeVar cannot have only a single constraint [misc] +generics_basic.py:49: error: Type variable must have at least two constrained types [misc] generics_basic.py:69: error: Value of type variable "AnyStr" of "concat" cannot be "Sequence[object]" [type-var] generics_basic.py:121: error: Duplicate type variables in Generic[...] or Protocol[...] [misc] generics_basic.py:157: error: Invalid index type "int" for "MyMap1[str, int]"; expected type "str" [index] diff --git a/conformance/results/mypy/generics_paramspec_basic.toml b/conformance/results/mypy/generics_paramspec_basic.toml index 1ed2f81d5..53fd4f5ee 100644 --- a/conformance/results/mypy/generics_paramspec_basic.toml +++ b/conformance/results/mypy/generics_paramspec_basic.toml @@ -5,15 +5,15 @@ Does not reject ParamSpec when used "bare" in type alias definition. output = """ generics_paramspec_basic.py:10: error: String argument 1 "NotIt" to ParamSpec(...) does not match variable name "WrongName" [misc] generics_paramspec_basic.py:23: error: Invalid location for ParamSpec "P" [valid-type] -generics_paramspec_basic.py:23: note: You can use ParamSpec as the first argument to Callable, e.g., 'Callable[P, int]' +generics_paramspec_basic.py:23: note: You can use ParamSpec as the first argument to Callable, e.g., "Callable[P, int]" generics_paramspec_basic.py:27: error: Invalid location for Concatenate [valid-type] generics_paramspec_basic.py:27: note: You can use Concatenate as the first argument to Callable -generics_paramspec_basic.py:31: error: Invalid location for ParamSpec "P" [misc] -generics_paramspec_basic.py:31: note: You can use ParamSpec as the first argument to Callable, e.g., 'Callable[P, int]' +generics_paramspec_basic.py:31: error: Invalid location for ParamSpec "P" [valid-type] +generics_paramspec_basic.py:31: note: You can use ParamSpec as the first argument to Callable, e.g., "Callable[P, int]" generics_paramspec_basic.py:35: error: Invalid location for ParamSpec "P" [valid-type] -generics_paramspec_basic.py:35: note: You can use ParamSpec as the first argument to Callable, e.g., 'Callable[P, int]' +generics_paramspec_basic.py:35: note: You can use ParamSpec as the first argument to Callable, e.g., "Callable[P, int]" generics_paramspec_basic.py:39: error: Invalid location for ParamSpec "P" [valid-type] -generics_paramspec_basic.py:39: note: You can use ParamSpec as the first argument to Callable, e.g., 'Callable[P, int]' +generics_paramspec_basic.py:39: note: You can use ParamSpec as the first argument to Callable, e.g., "Callable[P, int]" """ conformance_automated = "Fail" errors_diff = """ diff --git a/conformance/results/mypy/generics_paramspec_specialization.toml b/conformance/results/mypy/generics_paramspec_specialization.toml index c80fc5149..c6d433147 100644 --- a/conformance/results/mypy/generics_paramspec_specialization.toml +++ b/conformance/results/mypy/generics_paramspec_specialization.toml @@ -1,6 +1,6 @@ conformant = "Pass" output = """ -generics_paramspec_specialization.py:44: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "int" [misc] +generics_paramspec_specialization.py:44: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "int" [valid-type] generics_paramspec_specialization.py:54: error: Argument 1 has incompatible type "str"; expected "int" [arg-type] generics_paramspec_specialization.py:55: error: Argument 3 has incompatible type "str"; expected "bool" [arg-type] generics_paramspec_specialization.py:60: error: Argument 1 has incompatible type "str"; expected "int" [arg-type] diff --git a/conformance/results/mypy/generics_self_advanced.toml b/conformance/results/mypy/generics_self_advanced.toml index c6b3cd085..b8cb3c16c 100644 --- a/conformance/results/mypy/generics_self_advanced.toml +++ b/conformance/results/mypy/generics_self_advanced.toml @@ -9,8 +9,8 @@ output = """ generics_self_advanced.py:35: error: Expression is of type "ChildB", not "Self" [assert-type] generics_self_advanced.py:38: error: Expression is of type "ChildB", not "Self" [assert-type] generics_self_advanced.py:42: error: Expression is of type "type[ChildB]", not "type[Self]" [assert-type] -generics_self_advanced.py:43: error: Expression is of type "list[ChildB]", not "list[Self]" [assert-type] -generics_self_advanced.py:44: error: Expression is of type "ChildB", not "Self" [assert-type] +generics_self_advanced.py:43: error: Expression is of type "list[Any]", not "list[Self]" [assert-type] +generics_self_advanced.py:44: error: Expression is of type "Any", not "Self" [assert-type] generics_self_advanced.py:45: error: Expression is of type "ChildB", not "Self" [assert-type] """ conformance_automated = "Fail" @@ -18,7 +18,7 @@ errors_diff = """ Line 35: Unexpected errors ['generics_self_advanced.py:35: error: Expression is of type "ChildB", not "Self" [assert-type]'] Line 38: Unexpected errors ['generics_self_advanced.py:38: error: Expression is of type "ChildB", not "Self" [assert-type]'] Line 42: Unexpected errors ['generics_self_advanced.py:42: error: Expression is of type "type[ChildB]", not "type[Self]" [assert-type]'] -Line 43: Unexpected errors ['generics_self_advanced.py:43: error: Expression is of type "list[ChildB]", not "list[Self]" [assert-type]'] -Line 44: Unexpected errors ['generics_self_advanced.py:44: error: Expression is of type "ChildB", not "Self" [assert-type]'] +Line 43: Unexpected errors ['generics_self_advanced.py:43: error: Expression is of type "list[Any]", not "list[Self]" [assert-type]'] +Line 44: Unexpected errors ['generics_self_advanced.py:44: error: Expression is of type "Any", not "Self" [assert-type]'] Line 45: Unexpected errors ['generics_self_advanced.py:45: error: Expression is of type "ChildB", not "Self" [assert-type]'] """ diff --git a/conformance/results/mypy/generics_syntax_compatibility.toml b/conformance/results/mypy/generics_syntax_compatibility.toml index 233f5e92c..d40eccb49 100644 --- a/conformance/results/mypy/generics_syntax_compatibility.toml +++ b/conformance/results/mypy/generics_syntax_compatibility.toml @@ -1,20 +1,8 @@ -conformant = "Unsupported" -notes = """ -Type parameter syntax not yet support. -""" +conformant = "Pass" output = """ -generics_syntax_compatibility.py:14: error: PEP 695 generics are not yet supported [valid-type] -generics_syntax_compatibility.py:14: error: Name "V" is not defined [name-defined] -generics_syntax_compatibility.py:18: error: PEP 695 generics are not yet supported [valid-type] -generics_syntax_compatibility.py:18: error: Name "V" is not defined [name-defined] -generics_syntax_compatibility.py:22: error: PEP 695 generics are not yet supported [valid-type] -generics_syntax_compatibility.py:23: error: Name "V" is not defined [name-defined] -generics_syntax_compatibility.py:26: error: PEP 695 generics are not yet supported [valid-type] -generics_syntax_compatibility.py:26: error: Name "M" is not defined [name-defined] +generics_syntax_compatibility.py:14: error: All type parameters should be declared ("K" not declared) [valid-type] +generics_syntax_compatibility.py:26: error: All type parameters should be declared ("K" not declared) [valid-type] """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 18: Unexpected errors ['generics_syntax_compatibility.py:18: error: PEP 695 generics are not yet supported [valid-type]', 'generics_syntax_compatibility.py:18: error: Name "V" is not defined [name-defined]'] -Line 22: Unexpected errors ['generics_syntax_compatibility.py:22: error: PEP 695 generics are not yet supported [valid-type]'] -Line 23: Unexpected errors ['generics_syntax_compatibility.py:23: error: Name "V" is not defined [name-defined]'] """ diff --git a/conformance/results/mypy/generics_syntax_declarations.toml b/conformance/results/mypy/generics_syntax_declarations.toml index 229c387a1..91b06d4a0 100644 --- a/conformance/results/mypy/generics_syntax_declarations.toml +++ b/conformance/results/mypy/generics_syntax_declarations.toml @@ -1,53 +1,19 @@ -conformant = "Unsupported" +conformant = "Partial" notes = """ -Type parameter syntax not yet support. +Does not detect many illegal usages of type parameter syntax. """ output = """ -generics_syntax_declarations.py:13: error: PEP 695 generics are not yet supported [valid-type] -generics_syntax_declarations.py:14: error: Expression is of type "Any", not "TypeVar" [assert-type] -generics_syntax_declarations.py:14: error: Name "T" is not defined [name-defined] -generics_syntax_declarations.py:15: error: Expression is of type "Any", not "TypeVarTuple" [assert-type] -generics_syntax_declarations.py:15: error: Name "Ts" is not defined [name-defined] -generics_syntax_declarations.py:16: error: Expression is of type "Any", not "ParamSpec" [assert-type] -generics_syntax_declarations.py:16: error: Name "P" is not defined [name-defined] -generics_syntax_declarations.py:19: error: PEP 695 generics are not yet supported [valid-type] -generics_syntax_declarations.py:19: error: Free type variable expected in Generic[...] [misc] -generics_syntax_declarations.py:19: error: Name "T" is not defined [name-defined] -generics_syntax_declarations.py:23: error: PEP 695 generics are not yet supported [valid-type] -generics_syntax_declarations.py:27: error: PEP 695 generics are not yet supported [valid-type] -generics_syntax_declarations.py:27: error: Free type variable expected in Protocol[...] [misc] -generics_syntax_declarations.py:27: error: Name "S" is not defined [name-defined] -generics_syntax_declarations.py:27: error: Name "T" is not defined [name-defined] -generics_syntax_declarations.py:31: error: PEP 695 generics are not yet supported [valid-type] -generics_syntax_declarations.py:32: error: Name "T" is not defined [name-defined] -generics_syntax_declarations.py:37: error: PEP 695 generics are not yet supported [valid-type] -generics_syntax_declarations.py:41: error: PEP 695 generics are not yet supported [valid-type] -generics_syntax_declarations.py:45: error: PEP 695 generics are not yet supported [valid-type] -generics_syntax_declarations.py:46: error: PEP 695 generics are not yet supported [valid-type] -generics_syntax_declarations.py:50: error: PEP 695 generics are not yet supported [valid-type] -generics_syntax_declarations.py:54: error: PEP 695 generics are not yet supported [valid-type] -generics_syntax_declarations.py:58: error: PEP 695 generics are not yet supported [valid-type] -generics_syntax_declarations.py:62: error: PEP 695 generics are not yet supported [valid-type] -generics_syntax_declarations.py:66: error: PEP 695 generics are not yet supported [valid-type] -generics_syntax_declarations.py:73: error: PEP 695 generics are not yet supported [valid-type] -generics_syntax_declarations.py:77: error: PEP 695 generics are not yet supported [valid-type] -generics_syntax_declarations.py:81: error: PEP 695 generics are not yet supported [valid-type] -generics_syntax_declarations.py:85: error: PEP 695 generics are not yet supported [valid-type] """ conformance_automated = "Fail" errors_diff = """ +Line 19: Expected 1 errors +Line 27: Expected 1 errors Line 34: Expected 1 errors -Line 13: Unexpected errors ['generics_syntax_declarations.py:13: error: PEP 695 generics are not yet supported [valid-type]'] -Line 14: Unexpected errors ['generics_syntax_declarations.py:14: error: Expression is of type "Any", not "TypeVar" [assert-type]', 'generics_syntax_declarations.py:14: error: Name "T" is not defined [name-defined]'] -Line 15: Unexpected errors ['generics_syntax_declarations.py:15: error: Expression is of type "Any", not "TypeVarTuple" [assert-type]', 'generics_syntax_declarations.py:15: error: Name "Ts" is not defined [name-defined]'] -Line 16: Unexpected errors ['generics_syntax_declarations.py:16: error: Expression is of type "Any", not "ParamSpec" [assert-type]', 'generics_syntax_declarations.py:16: error: Name "P" is not defined [name-defined]'] -Line 23: Unexpected errors ['generics_syntax_declarations.py:23: error: PEP 695 generics are not yet supported [valid-type]'] -Line 31: Unexpected errors ['generics_syntax_declarations.py:31: error: PEP 695 generics are not yet supported [valid-type]'] -Line 32: Unexpected errors ['generics_syntax_declarations.py:32: error: Name "T" is not defined [name-defined]'] -Line 37: Unexpected errors ['generics_syntax_declarations.py:37: error: PEP 695 generics are not yet supported [valid-type]'] -Line 41: Unexpected errors ['generics_syntax_declarations.py:41: error: PEP 695 generics are not yet supported [valid-type]'] -Line 45: Unexpected errors ['generics_syntax_declarations.py:45: error: PEP 695 generics are not yet supported [valid-type]'] -Line 54: Unexpected errors ['generics_syntax_declarations.py:54: error: PEP 695 generics are not yet supported [valid-type]'] -Line 58: Unexpected errors ['generics_syntax_declarations.py:58: error: PEP 695 generics are not yet supported [valid-type]'] -Line 85: Unexpected errors ['generics_syntax_declarations.py:85: error: PEP 695 generics are not yet supported [valid-type]'] +Line 46: Expected 1 errors +Line 50: Expected 1 errors +Line 62: Expected 1 errors +Line 66: Expected 1 errors +Line 73: Expected 1 errors +Line 77: Expected 1 errors +Line 81: Expected 1 errors """ diff --git a/conformance/results/mypy/generics_syntax_infer_variance.toml b/conformance/results/mypy/generics_syntax_infer_variance.toml index a780860aa..b354ae226 100644 --- a/conformance/results/mypy/generics_syntax_infer_variance.toml +++ b/conformance/results/mypy/generics_syntax_infer_variance.toml @@ -87,16 +87,8 @@ generics_syntax_infer_variance.py:120: error: "ShouldBeInvariant3" expects no ty generics_syntax_infer_variance.py:120: error: The type "type[ShouldBeInvariant3]" is not generic and not indexable [misc] generics_syntax_infer_variance.py:121: error: "ShouldBeInvariant3" expects no type arguments, but 2 given [type-arg] generics_syntax_infer_variance.py:121: error: The type "type[ShouldBeInvariant3]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:125: error: PEP 695 generics are not yet supported [valid-type] -generics_syntax_infer_variance.py:126: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:126: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:129: error: "ShouldBeInvariant4" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:129: error: The type "type[ShouldBeInvariant4]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:132: error: PEP 695 generics are not yet supported [valid-type] -generics_syntax_infer_variance.py:133: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:133: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:137: error: "ShouldBeInvariant5" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:137: error: The type "type[ShouldBeInvariant5]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:129: error: Incompatible types in assignment (expression has type "ShouldBeInvariant4[int]", variable has type "ShouldBeInvariant4[float]") [assignment] +generics_syntax_infer_variance.py:137: error: Incompatible types in assignment (expression has type "ShouldBeInvariant5[int]", variable has type "ShouldBeInvariant5[float]") [assignment] generics_syntax_infer_variance.py:140: error: Free type variable expected in Generic[...] [misc] generics_syntax_infer_variance.py:141: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] generics_syntax_infer_variance.py:141: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases @@ -140,10 +132,6 @@ Line 100: Unexpected errors ['generics_syntax_infer_variance.py:100: error: Vari Line 103: Unexpected errors ['generics_syntax_infer_variance.py:103: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] Line 106: Unexpected errors ['generics_syntax_infer_variance.py:106: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] Line 114: Unexpected errors ['generics_syntax_infer_variance.py:114: error: Variable "generics_syntax_infer_variance.K" is not valid as a type [valid-type]', 'generics_syntax_infer_variance.py:114: error: Variable "generics_syntax_infer_variance.V" is not valid as a type [valid-type]'] -Line 125: Unexpected errors ['generics_syntax_infer_variance.py:125: error: PEP 695 generics are not yet supported [valid-type]'] -Line 126: Unexpected errors ['generics_syntax_infer_variance.py:126: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 132: Unexpected errors ['generics_syntax_infer_variance.py:132: error: PEP 695 generics are not yet supported [valid-type]'] -Line 133: Unexpected errors ['generics_syntax_infer_variance.py:133: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] Line 140: Unexpected errors ['generics_syntax_infer_variance.py:140: error: Free type variable expected in Generic[...] [misc]'] Line 141: Unexpected errors ['generics_syntax_infer_variance.py:141: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] Line 144: Unexpected errors ['generics_syntax_infer_variance.py:144: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] diff --git a/conformance/results/mypy/generics_syntax_scoping.toml b/conformance/results/mypy/generics_syntax_scoping.toml index 5e961fdcb..1d6ad3e68 100644 --- a/conformance/results/mypy/generics_syntax_scoping.toml +++ b/conformance/results/mypy/generics_syntax_scoping.toml @@ -1,64 +1,25 @@ -conformant = "Unsupported" +conformant = "Partial" notes = """ -Type parameter syntax not yet support. +Does not following runtime scoping rules for type parameters in all cases. """ output = """ -generics_syntax_scoping.py:14: error: PEP 695 generics are not yet supported [valid-type] -generics_syntax_scoping.py:18: error: PEP 695 generics are not yet supported [valid-type] -generics_syntax_scoping.py:22: error: PEP 695 generics are not yet supported [valid-type] -generics_syntax_scoping.py:26: error: PEP 695 generics are not yet supported [valid-type] -generics_syntax_scoping.py:27: error: "Foo" expects no type arguments, but 1 given [type-arg] -generics_syntax_scoping.py:27: error: Variable "generics_syntax_scoping.T" is not valid as a type [valid-type] -generics_syntax_scoping.py:27: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_scoping.py:31: error: PEP 695 generics are not yet supported [valid-type] -generics_syntax_scoping.py:31: error: "BaseClassC" expects no type arguments, but 1 given [type-arg] -generics_syntax_scoping.py:31: error: Variable "generics_syntax_scoping.T" is not valid as a type [valid-type] -generics_syntax_scoping.py:31: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_scoping.py:31: error: The type "type[Foo]" is not generic and not indexable [misc] -generics_syntax_scoping.py:31: error: Cannot determine type of "T" [has-type] +generics_syntax_scoping.py:14: error: Variable "generics_syntax_scoping.S" is not valid as a type [valid-type] +generics_syntax_scoping.py:14: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_scoping.py:18: error: Variable "generics_syntax_scoping.T" is not valid as a type [valid-type] +generics_syntax_scoping.py:18: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases generics_syntax_scoping.py:35: error: Cannot determine type of "T" [has-type] generics_syntax_scoping.py:35: error: Name "T" is used before definition [used-before-def] -generics_syntax_scoping.py:39: error: PEP 695 generics are not yet supported [valid-type] -generics_syntax_scoping.py:40: error: "Foo" expects no type arguments, but 1 given [type-arg] -generics_syntax_scoping.py:40: error: Variable "generics_syntax_scoping.T" is not valid as a type [valid-type] -generics_syntax_scoping.py:40: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_scoping.py:40: error: The first argument to Callable must be a list of types, parameter specification, or "..." [valid-type] -generics_syntax_scoping.py:40: note: See https://mypy.readthedocs.io/en/stable/kinds_of_types.html#callable-types-and-lambdas -generics_syntax_scoping.py:40: error: Name "P" is not defined [name-defined] -generics_syntax_scoping.py:40: error: Name "R" is not defined [name-defined] -generics_syntax_scoping.py:44: error: The type "type[Foo]" is not generic and not indexable [misc] -generics_syntax_scoping.py:44: error: Cannot determine type of "T" [has-type] -generics_syntax_scoping.py:45: error: PEP 695 generics are not yet supported [valid-type] -generics_syntax_scoping.py:49: error: PEP 695 type aliases are not yet supported [valid-type] -generics_syntax_scoping.py:49: error: Name "K" is not defined [name-defined] -generics_syntax_scoping.py:49: error: Name "V" is not defined [name-defined] -generics_syntax_scoping.py:55: error: PEP 695 generics are not yet supported [valid-type] -generics_syntax_scoping.py:59: error: PEP 695 generics are not yet supported [valid-type] +generics_syntax_scoping.py:44: error: Variable "generics_syntax_scoping.T" is not valid as a type [valid-type] +generics_syntax_scoping.py:44: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases generics_syntax_scoping.py:62: error: Expression is of type "Any", not "str" [assert-type] generics_syntax_scoping.py:62: note: "assert_type" expects everything to be "Any" in unchecked functions generics_syntax_scoping.py:67: error: Expression is of type "Any", not "int" [assert-type] generics_syntax_scoping.py:67: note: "assert_type" expects everything to be "Any" in unchecked functions -generics_syntax_scoping.py:74: error: PEP 695 generics are not yet supported [valid-type] -generics_syntax_scoping.py:74: error: Variable "generics_syntax_scoping.T" is not valid as a type [valid-type] -generics_syntax_scoping.py:74: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_scoping.py:77: error: PEP 695 generics are not yet supported [valid-type] -generics_syntax_scoping.py:77: error: "Inner" expects no type arguments, but 1 given [type-arg] -generics_syntax_scoping.py:77: error: Variable "generics_syntax_scoping.T" is not valid as a type [valid-type] -generics_syntax_scoping.py:77: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_scoping.py:81: error: PEP 695 generics are not yet supported [valid-type] -generics_syntax_scoping.py:81: error: The first argument to Callable must be a list of types, parameter specification, or "..." [valid-type] -generics_syntax_scoping.py:81: note: See https://mypy.readthedocs.io/en/stable/kinds_of_types.html#callable-types-and-lambdas -generics_syntax_scoping.py:81: error: Name "P" is not defined [name-defined] -generics_syntax_scoping.py:81: error: Name "R" is not defined [name-defined] -generics_syntax_scoping.py:89: error: PEP 695 generics are not yet supported [valid-type] -generics_syntax_scoping.py:89: error: Variable "generics_syntax_scoping.T" is not valid as a type [valid-type] -generics_syntax_scoping.py:89: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_scoping.py:92: error: PEP 695 generics are not yet supported [valid-type] -generics_syntax_scoping.py:95: error: PEP 695 generics are not yet supported [valid-type] -generics_syntax_scoping.py:98: error: PEP 695 generics are not yet supported [valid-type] +generics_syntax_scoping.py:92: error: "T" already defined as a type parameter [misc] +generics_syntax_scoping.py:95: error: "T" already defined as a type parameter [misc] +generics_syntax_scoping.py:98: error: "T" already defined as a type parameter [misc] generics_syntax_scoping.py:98: error: Variable "generics_syntax_scoping.ClassE.T" is not valid as a type [valid-type] generics_syntax_scoping.py:98: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_scoping.py:105: error: PEP 695 generics are not yet supported [valid-type] generics_syntax_scoping.py:116: error: Expression is of type "Any", not "TypeVar" [assert-type] generics_syntax_scoping.py:116: note: "assert_type" expects everything to be "Any" in unchecked functions generics_syntax_scoping.py:121: error: Expression is of type "Any", not "complex" [assert-type] @@ -68,23 +29,8 @@ generics_syntax_scoping.py:124: note: "assert_type" expects everything to be "An """ conformance_automated = "Fail" errors_diff = """ -Line 22: Unexpected errors ['generics_syntax_scoping.py:22: error: PEP 695 generics are not yet supported [valid-type]'] -Line 26: Unexpected errors ['generics_syntax_scoping.py:26: error: PEP 695 generics are not yet supported [valid-type]'] -Line 27: Unexpected errors ['generics_syntax_scoping.py:27: error: "Foo" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_scoping.py:27: error: Variable "generics_syntax_scoping.T" is not valid as a type [valid-type]'] -Line 31: Unexpected errors ['generics_syntax_scoping.py:31: error: PEP 695 generics are not yet supported [valid-type]', 'generics_syntax_scoping.py:31: error: "BaseClassC" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_scoping.py:31: error: Variable "generics_syntax_scoping.T" is not valid as a type [valid-type]', 'generics_syntax_scoping.py:31: error: The type "type[Foo]" is not generic and not indexable [misc]', 'generics_syntax_scoping.py:31: error: Cannot determine type of "T" [has-type]'] -Line 39: Unexpected errors ['generics_syntax_scoping.py:39: error: PEP 695 generics are not yet supported [valid-type]'] -Line 40: Unexpected errors ['generics_syntax_scoping.py:40: error: "Foo" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_scoping.py:40: error: Variable "generics_syntax_scoping.T" is not valid as a type [valid-type]', 'generics_syntax_scoping.py:40: error: The first argument to Callable must be a list of types, parameter specification, or "..." [valid-type]', 'generics_syntax_scoping.py:40: error: Name "P" is not defined [name-defined]', 'generics_syntax_scoping.py:40: error: Name "R" is not defined [name-defined]'] -Line 45: Unexpected errors ['generics_syntax_scoping.py:45: error: PEP 695 generics are not yet supported [valid-type]'] -Line 49: Unexpected errors ['generics_syntax_scoping.py:49: error: PEP 695 type aliases are not yet supported [valid-type]', 'generics_syntax_scoping.py:49: error: Name "K" is not defined [name-defined]', 'generics_syntax_scoping.py:49: error: Name "V" is not defined [name-defined]'] -Line 55: Unexpected errors ['generics_syntax_scoping.py:55: error: PEP 695 generics are not yet supported [valid-type]'] -Line 59: Unexpected errors ['generics_syntax_scoping.py:59: error: PEP 695 generics are not yet supported [valid-type]'] Line 62: Unexpected errors ['generics_syntax_scoping.py:62: error: Expression is of type "Any", not "str" [assert-type]'] Line 67: Unexpected errors ['generics_syntax_scoping.py:67: error: Expression is of type "Any", not "int" [assert-type]'] -Line 74: Unexpected errors ['generics_syntax_scoping.py:74: error: PEP 695 generics are not yet supported [valid-type]', 'generics_syntax_scoping.py:74: error: Variable "generics_syntax_scoping.T" is not valid as a type [valid-type]'] -Line 77: Unexpected errors ['generics_syntax_scoping.py:77: error: PEP 695 generics are not yet supported [valid-type]', 'generics_syntax_scoping.py:77: error: "Inner" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_scoping.py:77: error: Variable "generics_syntax_scoping.T" is not valid as a type [valid-type]'] -Line 81: Unexpected errors ['generics_syntax_scoping.py:81: error: PEP 695 generics are not yet supported [valid-type]', 'generics_syntax_scoping.py:81: error: The first argument to Callable must be a list of types, parameter specification, or "..." [valid-type]', 'generics_syntax_scoping.py:81: error: Name "P" is not defined [name-defined]', 'generics_syntax_scoping.py:81: error: Name "R" is not defined [name-defined]'] -Line 89: Unexpected errors ['generics_syntax_scoping.py:89: error: PEP 695 generics are not yet supported [valid-type]', 'generics_syntax_scoping.py:89: error: Variable "generics_syntax_scoping.T" is not valid as a type [valid-type]'] -Line 105: Unexpected errors ['generics_syntax_scoping.py:105: error: PEP 695 generics are not yet supported [valid-type]'] Line 116: Unexpected errors ['generics_syntax_scoping.py:116: error: Expression is of type "Any", not "TypeVar" [assert-type]'] Line 121: Unexpected errors ['generics_syntax_scoping.py:121: error: Expression is of type "Any", not "complex" [assert-type]'] Line 124: Unexpected errors ['generics_syntax_scoping.py:124: error: Expression is of type "Any", not "complex" [assert-type]'] diff --git a/conformance/results/mypy/generics_type_erasure.toml b/conformance/results/mypy/generics_type_erasure.toml index 78d330b9a..46c739fee 100644 --- a/conformance/results/mypy/generics_type_erasure.toml +++ b/conformance/results/mypy/generics_type_erasure.toml @@ -5,7 +5,7 @@ False negative on instance attribute access on type(node). """ output = """ generics_type_erasure.py:19: error: Expression is of type "Node[Never]", not "Node[Any]" [assert-type] -generics_type_erasure.py:22: error: Expression is of type Never, not "Any" [assert-type] +generics_type_erasure.py:22: error: Expression is of type "Never", not "Any" [assert-type] generics_type_erasure.py:38: error: Argument 1 to "Node" has incompatible type "str"; expected "int | None" [arg-type] generics_type_erasure.py:40: error: Argument 1 to "Node" has incompatible type "int"; expected "str | None" [arg-type] generics_type_erasure.py:42: error: Access to generic instance variables via class is ambiguous [misc] @@ -17,5 +17,5 @@ conformance_automated = "Fail" errors_diff = """ Line 46: Expected 1 errors Line 19: Unexpected errors ['generics_type_erasure.py:19: error: Expression is of type "Node[Never]", not "Node[Any]" [assert-type]'] -Line 22: Unexpected errors ['generics_type_erasure.py:22: error: Expression is of type Never, not "Any" [assert-type]'] +Line 22: Unexpected errors ['generics_type_erasure.py:22: error: Expression is of type "Never", not "Any" [assert-type]'] """ diff --git a/conformance/results/mypy/generics_variance_inference.toml b/conformance/results/mypy/generics_variance_inference.toml index ecc8609cb..571895100 100644 --- a/conformance/results/mypy/generics_variance_inference.toml +++ b/conformance/results/mypy/generics_variance_inference.toml @@ -1,127 +1,43 @@ -conformant = "Unsupported" +conformant = "Partial" notes = """ -Type parameter syntax not yet support. +Computes incorrect variance in some cases. """ output = """ -generics_variance_inference.py:15: error: PEP 695 generics are not yet supported [valid-type] -generics_variance_inference.py:15: error: Name "T1" is not defined [name-defined] -generics_variance_inference.py:16: error: Name "T2" is not defined [name-defined] -generics_variance_inference.py:19: error: Name "T3" is not defined [name-defined] -generics_variance_inference.py:23: error: "ClassA" expects no type arguments, but 3 given [type-arg] -generics_variance_inference.py:24: error: "ClassA" expects no type arguments, but 3 given [type-arg] -generics_variance_inference.py:25: error: "ClassA" expects no type arguments, but 3 given [type-arg] -generics_variance_inference.py:26: error: "ClassA" expects no type arguments, but 3 given [type-arg] -generics_variance_inference.py:28: error: "ClassA" expects no type arguments, but 3 given [type-arg] -generics_variance_inference.py:29: error: "ClassA" expects no type arguments, but 3 given [type-arg] -generics_variance_inference.py:32: error: PEP 695 generics are not yet supported [valid-type] -generics_variance_inference.py:33: error: A function returning TypeVar should receive at least one argument containing the same TypeVar [type-var] -generics_variance_inference.py:40: error: "ShouldBeCovariant1" expects no type arguments, but 1 given [type-arg] -generics_variance_inference.py:40: error: The type "type[ShouldBeCovariant1]" is not generic and not indexable [misc] -generics_variance_inference.py:41: error: "ShouldBeCovariant1" expects no type arguments, but 1 given [type-arg] -generics_variance_inference.py:41: error: The type "type[ShouldBeCovariant1]" is not generic and not indexable [misc] -generics_variance_inference.py:44: error: PEP 695 generics are not yet supported [valid-type] +generics_variance_inference.py:24: error: Incompatible types in assignment (expression has type "ClassA[float, int, int]", variable has type "ClassA[int, int, int]") [assignment] +generics_variance_inference.py:25: error: Incompatible types in assignment (expression has type "ClassA[float, int, int]", variable has type "ClassA[float, float, int]") [assignment] +generics_variance_inference.py:28: error: Incompatible types in assignment (expression has type "ClassA[int, float, float]", variable has type "ClassA[int, int, int]") [assignment] +generics_variance_inference.py:29: error: Incompatible types in assignment (expression has type "ClassA[int, float, float]", variable has type "ClassA[int, int, float]") [assignment] +generics_variance_inference.py:41: error: Incompatible types in assignment (expression has type "ShouldBeCovariant1[float]", variable has type "ShouldBeCovariant1[int]") [assignment] generics_variance_inference.py:48: error: Cannot instantiate abstract class "ShouldBeCovariant2" with abstract attributes "__getitem__" and "__len__" [abstract] -generics_variance_inference.py:48: error: Incompatible types in assignment (expression has type "ShouldBeCovariant2[int]", variable has type "ShouldBeCovariant2[float]") [assignment] generics_variance_inference.py:49: error: Cannot instantiate abstract class "ShouldBeCovariant2" with abstract attributes "__getitem__" and "__len__" [abstract] generics_variance_inference.py:49: error: Incompatible types in assignment (expression has type "ShouldBeCovariant2[float]", variable has type "ShouldBeCovariant2[int]") [assignment] -generics_variance_inference.py:52: error: PEP 695 generics are not yet supported [valid-type] -generics_variance_inference.py:57: error: "ShouldBeCovariant3" expects no type arguments, but 1 given [type-arg] -generics_variance_inference.py:57: error: The type "type[ShouldBeCovariant3]" is not generic and not indexable [misc] -generics_variance_inference.py:58: error: "ShouldBeCovariant3" expects no type arguments, but 1 given [type-arg] -generics_variance_inference.py:58: error: The type "type[ShouldBeCovariant3]" is not generic and not indexable [misc] -generics_variance_inference.py:62: error: PEP 695 generics are not yet supported [valid-type] -generics_variance_inference.py:63: error: Type variable "generics_variance_inference.T" is unbound [valid-type] -generics_variance_inference.py:63: note: (Hint: Use "Generic[T]" or "Protocol[T]" base class to bind "T" inside a class) -generics_variance_inference.py:63: note: (Hint: Use "T" in function signature to bind "T" inside a function) -generics_variance_inference.py:66: error: "ShouldBeCovariant4" expects no type arguments, but 1 given [type-arg] -generics_variance_inference.py:66: error: The type "type[ShouldBeCovariant4]" is not generic and not indexable [misc] -generics_variance_inference.py:67: error: "ShouldBeCovariant4" expects no type arguments, but 1 given [type-arg] -generics_variance_inference.py:67: error: The type "type[ShouldBeCovariant4]" is not generic and not indexable [misc] -generics_variance_inference.py:70: error: PEP 695 generics are not yet supported [valid-type] -generics_variance_inference.py:75: error: A function returning TypeVar should receive at least one argument containing the same TypeVar [type-var] -generics_variance_inference.py:79: error: "ShouldBeCovariant5" expects no type arguments, but 1 given [type-arg] -generics_variance_inference.py:79: error: The type "type[ShouldBeCovariant5]" is not generic and not indexable [misc] -generics_variance_inference.py:80: error: "ShouldBeCovariant5" expects no type arguments, but 1 given [type-arg] -generics_variance_inference.py:80: error: The type "type[ShouldBeCovariant5]" is not generic and not indexable [misc] -generics_variance_inference.py:83: error: PEP 695 generics are not yet supported [valid-type] -generics_variance_inference.py:96: error: "ShouldBeInvariant1" expects no type arguments, but 1 given [type-arg] -generics_variance_inference.py:96: error: The type "type[ShouldBeInvariant1]" is not generic and not indexable [misc] -generics_variance_inference.py:97: error: "ShouldBeInvariant1" expects no type arguments, but 1 given [type-arg] -generics_variance_inference.py:97: error: The type "type[ShouldBeInvariant1]" is not generic and not indexable [misc] -generics_variance_inference.py:100: error: PEP 695 generics are not yet supported [valid-type] -generics_variance_inference.py:104: error: A function returning TypeVar should receive at least one argument containing the same TypeVar [type-var] -generics_variance_inference.py:111: error: "ShouldBeInvariant2" expects no type arguments, but 1 given [type-arg] -generics_variance_inference.py:111: error: The type "type[ShouldBeInvariant2]" is not generic and not indexable [misc] -generics_variance_inference.py:112: error: "ShouldBeInvariant2" expects no type arguments, but 1 given [type-arg] -generics_variance_inference.py:112: error: The type "type[ShouldBeInvariant2]" is not generic and not indexable [misc] -generics_variance_inference.py:115: error: PEP 695 generics are not yet supported [valid-type] -generics_variance_inference.py:115: error: Name "K" is not defined [name-defined] -generics_variance_inference.py:115: error: Name "V" is not defined [name-defined] -generics_variance_inference.py:119: error: "ShouldBeInvariant3" expects no type arguments, but 2 given [type-arg] -generics_variance_inference.py:119: error: The type "type[ShouldBeInvariant3]" is not generic and not indexable [misc] -generics_variance_inference.py:120: error: "ShouldBeInvariant3" expects no type arguments, but 2 given [type-arg] -generics_variance_inference.py:120: error: The type "type[ShouldBeInvariant3]" is not generic and not indexable [misc] -generics_variance_inference.py:121: error: "ShouldBeInvariant3" expects no type arguments, but 2 given [type-arg] -generics_variance_inference.py:121: error: The type "type[ShouldBeInvariant3]" is not generic and not indexable [misc] -generics_variance_inference.py:122: error: "ShouldBeInvariant3" expects no type arguments, but 2 given [type-arg] -generics_variance_inference.py:122: error: The type "type[ShouldBeInvariant3]" is not generic and not indexable [misc] -generics_variance_inference.py:126: error: PEP 695 generics are not yet supported [valid-type] -generics_variance_inference.py:127: error: Type variable "generics_variance_inference.T" is unbound [valid-type] -generics_variance_inference.py:127: note: (Hint: Use "Generic[T]" or "Protocol[T]" base class to bind "T" inside a class) -generics_variance_inference.py:127: note: (Hint: Use "T" in function signature to bind "T" inside a function) -generics_variance_inference.py:130: error: "ShouldBeInvariant4" expects no type arguments, but 1 given [type-arg] -generics_variance_inference.py:130: error: The type "type[ShouldBeInvariant4]" is not generic and not indexable [misc] -generics_variance_inference.py:133: error: PEP 695 generics are not yet supported [valid-type] -generics_variance_inference.py:138: error: "ShouldBeInvariant5" expects no type arguments, but 1 given [type-arg] -generics_variance_inference.py:138: error: The type "type[ShouldBeInvariant5]" is not generic and not indexable [misc] -generics_variance_inference.py:141: error: PEP 695 generics are not yet supported [valid-type] -generics_variance_inference.py:149: error: "ShouldBeContravariant1" expects no type arguments, but 1 given [type-arg] -generics_variance_inference.py:149: error: The type "type[ShouldBeContravariant1]" is not generic and not indexable [misc] -generics_variance_inference.py:150: error: "ShouldBeContravariant1" expects no type arguments, but 1 given [type-arg] -generics_variance_inference.py:150: error: The type "type[ShouldBeContravariant1]" is not generic and not indexable [misc] -generics_variance_inference.py:165: error: PEP 695 generics are not yet supported [valid-type] +generics_variance_inference.py:58: error: Incompatible types in assignment (expression has type "ShouldBeCovariant3[float]", variable has type "ShouldBeCovariant3[int]") [assignment] +generics_variance_inference.py:66: error: Incompatible types in assignment (expression has type "ShouldBeCovariant4[int]", variable has type "ShouldBeCovariant4[float]") [assignment] +generics_variance_inference.py:67: error: Incompatible types in assignment (expression has type "ShouldBeCovariant4[float]", variable has type "ShouldBeCovariant4[int]") [assignment] +generics_variance_inference.py:79: error: Incompatible types in assignment (expression has type "ShouldBeCovariant5[int]", variable has type "ShouldBeCovariant5[float]") [assignment] +generics_variance_inference.py:80: error: Incompatible types in assignment (expression has type "ShouldBeCovariant5[float]", variable has type "ShouldBeCovariant5[int]") [assignment] +generics_variance_inference.py:96: error: Incompatible types in assignment (expression has type "ShouldBeInvariant1[int]", variable has type "ShouldBeInvariant1[float]") [assignment] +generics_variance_inference.py:97: error: Incompatible types in assignment (expression has type "ShouldBeInvariant1[float]", variable has type "ShouldBeInvariant1[int]") [assignment] +generics_variance_inference.py:111: error: Incompatible types in assignment (expression has type "ShouldBeInvariant2[int]", variable has type "ShouldBeInvariant2[float]") [assignment] +generics_variance_inference.py:112: error: Incompatible types in assignment (expression has type "ShouldBeInvariant2[float]", variable has type "ShouldBeInvariant2[int]") [assignment] +generics_variance_inference.py:119: error: Incompatible types in assignment (expression has type "ShouldBeInvariant3[int, str]", variable has type "ShouldBeInvariant3[float, str]") [assignment] +generics_variance_inference.py:120: error: Incompatible types in assignment (expression has type "ShouldBeInvariant3[float, str]", variable has type "ShouldBeInvariant3[int, str]") [assignment] +generics_variance_inference.py:121: error: Incompatible types in assignment (expression has type "ShouldBeInvariant3[str, int]", variable has type "ShouldBeInvariant3[str, float]") [assignment] +generics_variance_inference.py:122: error: Incompatible types in assignment (expression has type "ShouldBeInvariant3[str, float]", variable has type "ShouldBeInvariant3[str, int]") [assignment] +generics_variance_inference.py:130: error: Incompatible types in assignment (expression has type "ShouldBeInvariant4[int]", variable has type "ShouldBeInvariant4[float]") [assignment] +generics_variance_inference.py:138: error: Incompatible types in assignment (expression has type "ShouldBeInvariant5[int]", variable has type "ShouldBeInvariant5[float]") [assignment] +generics_variance_inference.py:149: error: Incompatible types in assignment (expression has type "ShouldBeContravariant1[int]", variable has type "ShouldBeContravariant1[float]") [assignment] generics_variance_inference.py:169: error: Incompatible types in assignment (expression has type "ShouldBeInvariant6[float]", variable has type "ShouldBeInvariant6[int]") [assignment] -generics_variance_inference.py:170: error: Incompatible types in assignment (expression has type "ShouldBeInvariant6[int]", variable has type "ShouldBeInvariant6[float]") [assignment] -generics_variance_inference.py:177: error: PEP 695 generics are not yet supported [valid-type] generics_variance_inference.py:181: error: Incompatible types in assignment (expression has type "ShouldBeCovariant6[float]", variable has type "ShouldBeCovariant6[int]") [assignment] -generics_variance_inference.py:182: error: Incompatible types in assignment (expression has type "ShouldBeCovariant6[int]", variable has type "ShouldBeCovariant6[float]") [assignment] -generics_variance_inference.py:189: error: PEP 695 generics are not yet supported [valid-type] generics_variance_inference.py:193: error: Incompatible types in assignment (expression has type "ShouldBeContravariant2[float]", variable has type "ShouldBeContravariant2[int]") [assignment] -generics_variance_inference.py:194: error: Incompatible types in assignment (expression has type "ShouldBeContravariant2[int]", variable has type "ShouldBeContravariant2[float]") [assignment] """ conformance_automated = "Fail" errors_diff = """ -Line 15: Unexpected errors ['generics_variance_inference.py:15: error: PEP 695 generics are not yet supported [valid-type]', 'generics_variance_inference.py:15: error: Name "T1" is not defined [name-defined]'] -Line 16: Unexpected errors ['generics_variance_inference.py:16: error: Name "T2" is not defined [name-defined]'] -Line 19: Unexpected errors ['generics_variance_inference.py:19: error: Name "T3" is not defined [name-defined]'] -Line 23: Unexpected errors ['generics_variance_inference.py:23: error: "ClassA" expects no type arguments, but 3 given [type-arg]'] -Line 26: Unexpected errors ['generics_variance_inference.py:26: error: "ClassA" expects no type arguments, but 3 given [type-arg]'] -Line 29: Unexpected errors ['generics_variance_inference.py:29: error: "ClassA" expects no type arguments, but 3 given [type-arg]'] -Line 32: Unexpected errors ['generics_variance_inference.py:32: error: PEP 695 generics are not yet supported [valid-type]'] -Line 33: Unexpected errors ['generics_variance_inference.py:33: error: A function returning TypeVar should receive at least one argument containing the same TypeVar [type-var]'] -Line 40: Unexpected errors ['generics_variance_inference.py:40: error: "ShouldBeCovariant1" expects no type arguments, but 1 given [type-arg]', 'generics_variance_inference.py:40: error: The type "type[ShouldBeCovariant1]" is not generic and not indexable [misc]'] -Line 44: Unexpected errors ['generics_variance_inference.py:44: error: PEP 695 generics are not yet supported [valid-type]'] -Line 48: Unexpected errors ['generics_variance_inference.py:48: error: Cannot instantiate abstract class "ShouldBeCovariant2" with abstract attributes "__getitem__" and "__len__" [abstract]', 'generics_variance_inference.py:48: error: Incompatible types in assignment (expression has type "ShouldBeCovariant2[int]", variable has type "ShouldBeCovariant2[float]") [assignment]'] -Line 52: Unexpected errors ['generics_variance_inference.py:52: error: PEP 695 generics are not yet supported [valid-type]'] -Line 57: Unexpected errors ['generics_variance_inference.py:57: error: "ShouldBeCovariant3" expects no type arguments, but 1 given [type-arg]', 'generics_variance_inference.py:57: error: The type "type[ShouldBeCovariant3]" is not generic and not indexable [misc]'] -Line 62: Unexpected errors ['generics_variance_inference.py:62: error: PEP 695 generics are not yet supported [valid-type]'] -Line 63: Unexpected errors ['generics_variance_inference.py:63: error: Type variable "generics_variance_inference.T" is unbound [valid-type]'] -Line 66: Unexpected errors ['generics_variance_inference.py:66: error: "ShouldBeCovariant4" expects no type arguments, but 1 given [type-arg]', 'generics_variance_inference.py:66: error: The type "type[ShouldBeCovariant4]" is not generic and not indexable [misc]'] -Line 70: Unexpected errors ['generics_variance_inference.py:70: error: PEP 695 generics are not yet supported [valid-type]'] -Line 75: Unexpected errors ['generics_variance_inference.py:75: error: A function returning TypeVar should receive at least one argument containing the same TypeVar [type-var]'] -Line 79: Unexpected errors ['generics_variance_inference.py:79: error: "ShouldBeCovariant5" expects no type arguments, but 1 given [type-arg]', 'generics_variance_inference.py:79: error: The type "type[ShouldBeCovariant5]" is not generic and not indexable [misc]'] -Line 83: Unexpected errors ['generics_variance_inference.py:83: error: PEP 695 generics are not yet supported [valid-type]'] -Line 100: Unexpected errors ['generics_variance_inference.py:100: error: PEP 695 generics are not yet supported [valid-type]'] -Line 104: Unexpected errors ['generics_variance_inference.py:104: error: A function returning TypeVar should receive at least one argument containing the same TypeVar [type-var]'] -Line 115: Unexpected errors ['generics_variance_inference.py:115: error: PEP 695 generics are not yet supported [valid-type]', 'generics_variance_inference.py:115: error: Name "K" is not defined [name-defined]', 'generics_variance_inference.py:115: error: Name "V" is not defined [name-defined]'] -Line 126: Unexpected errors ['generics_variance_inference.py:126: error: PEP 695 generics are not yet supported [valid-type]'] -Line 127: Unexpected errors ['generics_variance_inference.py:127: error: Type variable "generics_variance_inference.T" is unbound [valid-type]'] -Line 133: Unexpected errors ['generics_variance_inference.py:133: error: PEP 695 generics are not yet supported [valid-type]'] -Line 141: Unexpected errors ['generics_variance_inference.py:141: error: PEP 695 generics are not yet supported [valid-type]'] -Line 150: Unexpected errors ['generics_variance_inference.py:150: error: "ShouldBeContravariant1" expects no type arguments, but 1 given [type-arg]', 'generics_variance_inference.py:150: error: The type "type[ShouldBeContravariant1]" is not generic and not indexable [misc]'] -Line 165: Unexpected errors ['generics_variance_inference.py:165: error: PEP 695 generics are not yet supported [valid-type]'] -Line 177: Unexpected errors ['generics_variance_inference.py:177: error: PEP 695 generics are not yet supported [valid-type]'] -Line 182: Unexpected errors ['generics_variance_inference.py:182: error: Incompatible types in assignment (expression has type "ShouldBeCovariant6[int]", variable has type "ShouldBeCovariant6[float]") [assignment]'] -Line 189: Unexpected errors ['generics_variance_inference.py:189: error: PEP 695 generics are not yet supported [valid-type]'] +Line 170: Expected 1 errors +Line 194: Expected 1 errors +Line 29: Unexpected errors ['generics_variance_inference.py:29: error: Incompatible types in assignment (expression has type "ClassA[int, float, float]", variable has type "ClassA[int, int, float]") [assignment]'] +Line 48: Unexpected errors ['generics_variance_inference.py:48: error: Cannot instantiate abstract class "ShouldBeCovariant2" with abstract attributes "__getitem__" and "__len__" [abstract]'] +Line 66: Unexpected errors ['generics_variance_inference.py:66: error: Incompatible types in assignment (expression has type "ShouldBeCovariant4[int]", variable has type "ShouldBeCovariant4[float]") [assignment]'] +Line 79: Unexpected errors ['generics_variance_inference.py:79: error: Incompatible types in assignment (expression has type "ShouldBeCovariant5[int]", variable has type "ShouldBeCovariant5[float]") [assignment]'] Line 193: Unexpected errors ['generics_variance_inference.py:193: error: Incompatible types in assignment (expression has type "ShouldBeContravariant2[float]", variable has type "ShouldBeContravariant2[int]") [assignment]'] """ diff --git a/conformance/results/mypy/namedtuples_define_functional.toml b/conformance/results/mypy/namedtuples_define_functional.toml index 7601d5252..151e6588b 100644 --- a/conformance/results/mypy/namedtuples_define_functional.toml +++ b/conformance/results/mypy/namedtuples_define_functional.toml @@ -1,7 +1,4 @@ conformant = "Pass" -notes = """ -Does not handle illegal named tuple names the same as runtime. -""" output = """ namedtuples_define_functional.py:16: error: Missing positional argument "y" in call to "Point1" [call-arg] namedtuples_define_functional.py:21: error: Missing positional arguments "x", "y" in call to "Point2" [call-arg] @@ -11,11 +8,11 @@ namedtuples_define_functional.py:36: error: Argument 2 to "Point5" has incompati namedtuples_define_functional.py:37: error: Too many arguments for "Point5" [call-arg] namedtuples_define_functional.py:42: error: Argument 2 to "Point6" has incompatible type "str"; expected "int" [arg-type] namedtuples_define_functional.py:43: error: Argument "x" to "Point6" has incompatible type "float"; expected "int" [arg-type] -namedtuples_define_functional.py:52: error: Name "a" already defined (possibly by an import) [no-redef] -namedtuples_define_functional.py:57: error: Unexpected keyword argument "_1" for "NT4" [call-arg] +namedtuples_define_functional.py:52: error: "namedtuple()" has duplicate field name "a" [misc] +namedtuples_define_functional.py:53: error: "namedtuple()" field name "def" is a keyword [misc] +namedtuples_define_functional.py:54: error: "namedtuple()" field name "def" is a keyword [misc] namedtuples_define_functional.py:66: error: Missing positional argument "a" in call to "NT5" [call-arg] """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 57: Unexpected errors ['namedtuples_define_functional.py:57: error: Unexpected keyword argument "_1" for "NT4" [call-arg]'] """ diff --git a/conformance/results/mypy/qualifiers_annotated.toml b/conformance/results/mypy/qualifiers_annotated.toml index 999b512ba..289e9d8be 100644 --- a/conformance/results/mypy/qualifiers_annotated.toml +++ b/conformance/results/mypy/qualifiers_annotated.toml @@ -21,10 +21,10 @@ qualifiers_annotated.py:52: error: Invalid type: try using Literal[1] instead? qualifiers_annotated.py:53: error: Invalid type comment or annotation [valid-type] qualifiers_annotated.py:54: error: Invalid type comment or annotation [valid-type] qualifiers_annotated.py:64: error: Annotated[...] must have exactly one type argument and at least one annotation [valid-type] -qualifiers_annotated.py:76: error: Incompatible types in assignment (expression has type "object", variable has type "type[Any]") [assignment] -qualifiers_annotated.py:84: error: Argument 1 to "func4" has incompatible type "object"; expected "type[Never]" [arg-type] +qualifiers_annotated.py:76: error: Incompatible types in assignment (expression has type "", variable has type "type[Any]") [assignment] +qualifiers_annotated.py:84: error: Argument 1 to "func4" has incompatible type ""; expected "type[Never]" [arg-type] qualifiers_annotated.py:91: error: "" not callable [operator] -qualifiers_annotated.py:92: error: "object" not callable [operator] +qualifiers_annotated.py:92: error: "" not callable [operator] qualifiers_annotated.py:98: error: Invalid type: ClassVar nested inside other type [valid-type] qualifiers_annotated.py:100: error: Final can be only used as an outermost qualifier in a variable annotation [valid-type] qualifiers_annotated.py:110: error: Required[] can be only used in a TypedDict definition [valid-type] diff --git a/conformance/results/mypy/specialtypes_never.toml b/conformance/results/mypy/specialtypes_never.toml index 49ac22f1e..2fd4aa191 100644 --- a/conformance/results/mypy/specialtypes_never.toml +++ b/conformance/results/mypy/specialtypes_never.toml @@ -1,10 +1,10 @@ conformant = "Pass" output = """ specialtypes_never.py:19: error: Implicit return in function which does not return [misc] -specialtypes_never.py:86: error: Incompatible types in assignment (expression has type "list[NoReturn]", variable has type "list[int]") [assignment] +specialtypes_never.py:86: error: Incompatible types in assignment (expression has type "list[Never]", variable has type "list[int]") [assignment] specialtypes_never.py:86: note: "List" is invariant -- see https://mypy.readthedocs.io/en/stable/common_issues.html#variance specialtypes_never.py:86: note: Consider using "Sequence" instead, which is covariant -specialtypes_never.py:105: error: Incompatible return value type (got "ClassC[NoReturn]", expected "ClassC[U]") [return-value] +specialtypes_never.py:105: error: Incompatible return value type (got "ClassC[Never]", expected "ClassC[U]") [return-value] """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/mypy/version.toml b/conformance/results/mypy/version.toml index 39314b44d..374a6c1f7 100644 --- a/conformance/results/mypy/version.toml +++ b/conformance/results/mypy/version.toml @@ -1,2 +1,2 @@ -version = "mypy 1.10.1" -test_duration = 1.2 +version = "mypy 1.11.0" +test_duration = 1.5 diff --git a/conformance/results/pyre/version.toml b/conformance/results/pyre/version.toml index 5686e9cb3..fff2c3f20 100644 --- a/conformance/results/pyre/version.toml +++ b/conformance/results/pyre/version.toml @@ -1,2 +1,2 @@ version = "pyre 0.9.22" -test_duration = 1.6 +test_duration = 2.8 diff --git a/conformance/results/pyright/constructors_call_init.toml b/conformance/results/pyright/constructors_call_init.toml index 1b9371f6c..dc74b3f90 100644 --- a/conformance/results/pyright/constructors_call_init.toml +++ b/conformance/results/pyright/constructors_call_init.toml @@ -14,5 +14,5 @@ constructors_call_init.py:56:1 - error:     "Class4[str]" is incompatible with "Class4[int]"       Type parameter "T@Class4" is invariant, but "str" is not the same as "int" (reportGeneralTypeIssues) constructors_call_init.py:107:24 - warning: Type annotation for "self" parameter of "__init__" method cannot contain class-scoped type variables (reportInvalidTypeVarUse) -constructors_call_init.py:130:1 - error: Expected no arguments to "Class11" constructor (reportCallIssue) +constructors_call_init.py:130:9 - error: Expected 0 positional arguments (reportCallIssue) """ diff --git a/conformance/results/pyright/constructors_call_type.toml b/conformance/results/pyright/constructors_call_type.toml index 536ad6fdc..70f197b88 100644 --- a/conformance/results/pyright/constructors_call_type.toml +++ b/conformance/results/pyright/constructors_call_type.toml @@ -5,8 +5,8 @@ output = """ constructors_call_type.py:30:5 - error: Arguments missing for parameters "x", "y" (reportCallIssue) constructors_call_type.py:40:5 - error: Arguments missing for parameters "x", "y" (reportCallIssue) constructors_call_type.py:50:5 - error: Arguments missing for parameters "x", "y" (reportCallIssue) -constructors_call_type.py:59:5 - error: Expected no arguments to "Class4" constructor (reportCallIssue) -constructors_call_type.py:64:5 - error: Expected no arguments to "object" constructor (reportCallIssue) +constructors_call_type.py:59:9 - error: Expected 0 positional arguments (reportCallIssue) +constructors_call_type.py:64:9 - error: Expected 0 positional arguments (reportCallIssue) constructors_call_type.py:72:5 - error: Arguments missing for parameters "x", "y" (reportCallIssue) constructors_call_type.py:81:5 - error: Argument missing for parameter "y" (reportCallIssue) constructors_call_type.py:82:12 - error: Argument of type "Literal[2]" cannot be assigned to parameter "y" of type "str" in function "__new__" diff --git a/conformance/results/pyright/dataclasses_usage.toml b/conformance/results/pyright/dataclasses_usage.toml index 8a2b626c8..203a1b40d 100644 --- a/conformance/results/pyright/dataclasses_usage.toml +++ b/conformance/results/pyright/dataclasses_usage.toml @@ -12,7 +12,7 @@ dataclasses_usage.py:88:36 - error: Argument of type "type[str]" cannot be assig   No overloaded function matches type "() -> int" (reportArgumentType) dataclasses_usage.py:127:8 - error: Expected 1 positional argument (reportCallIssue) dataclasses_usage.py:130:1 - error: Argument missing for parameter "y" (reportCallIssue) -dataclasses_usage.py:179:1 - error: Expected no arguments to "DC13" constructor (reportCallIssue) +dataclasses_usage.py:179:6 - error: Expected 0 positional arguments (reportCallIssue) dataclasses_usage.py:228:9 - error: Dataclass field without type annotation will cause runtime exception (reportGeneralTypeIssues) """ conformance_automated = "Pass" diff --git a/conformance/results/pyright/protocols_generic.toml b/conformance/results/pyright/protocols_generic.toml index 6e653d432..d91d76bb7 100644 --- a/conformance/results/pyright/protocols_generic.toml +++ b/conformance/results/pyright/protocols_generic.toml @@ -36,7 +36,7 @@ protocols_generic.py:147:25 - error: Expression of type "ConcreteHasProperty4" i     "m" is an incompatible type       Type "(item: str, callback: (int) -> str) -> str" is incompatible with type "(item: T@m, callback: (T@m) -> str) -> str"         Parameter 2: type "(T@m) -> str" is incompatible with type "(int) -> str" -          Type "(str) -> str" is incompatible with type "(int) -> str" (reportAssignmentType) +          Type "(T@m) -> str" is incompatible with type "(int) -> str" (reportAssignmentType) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/version.toml b/conformance/results/pyright/version.toml index b3946bc45..56d968adf 100644 --- a/conformance/results/pyright/version.toml +++ b/conformance/results/pyright/version.toml @@ -1,2 +1,2 @@ -version = "pyright 1.1.371" -test_duration = 1.5 +version = "pyright 1.1.372" +test_duration = 1.4 diff --git a/conformance/results/pytype/version.toml b/conformance/results/pytype/version.toml index 736e8295e..f00d1eab3 100644 --- a/conformance/results/pytype/version.toml +++ b/conformance/results/pytype/version.toml @@ -1,2 +1,2 @@ version = "pytype 2024.04.11" -test_duration = 34.0 +test_duration = 30.9 diff --git a/conformance/results/results.html b/conformance/results/results.html index cc7f3a09d..b9b1894af 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -158,17 +158,17 @@

    Python Type System Conformance Test Results

    - - + - + - + @@ -349,7 +349,7 @@

    Python Type System Conformance Test Results

    - + @@ -415,7 +415,7 @@

    Python Type System Conformance Test Results

    - + @@ -484,13 +484,13 @@

    Python Type System Conformance Test Results

    - + - + @@ -628,7 +628,7 @@

    Python Type System Conformance Test Results

    Constructors - + @@ -880,7 +880,7 @@

    Python Type System Conformance Test Results

    - + @@ -931,7 +931,7 @@

    Python Type System Conformance Test Results

    - + diff --git a/conformance/src/type_checker.py b/conformance/src/type_checker.py index cc64e75e3..f1610617c 100644 --- a/conformance/src/type_checker.py +++ b/conformance/src/type_checker.py @@ -97,11 +97,16 @@ def run_tests(self, test_files: Sequence[str]) -> dict[str, str]: "-m", "mypy", ".", - # Mypy currently crashes when run on the "generics_defaults.py" test case, - # so we need to exclude it for now. Remove this once mypy adds support for - # this functionality. + # Enable experimental support for PEP 695 syntax. + # This can be removed once it's no longer experimental. + "--enable-incomplete-feature=NewGenericSyntax", + # Mypy currently crashes when run on a couple of test cases, + # so we need to exclude them for now. Remove this once mypy adds + # support for this functionality. "--exclude", r"generics_defaults\.py", + "--exclude", + r"generics_syntax_declarations\.py", "--disable-error-code", "empty-body", ] From dc1698d8d006b070cbb3c7404b07f45d3de7ff5e Mon Sep 17 00:00:00 2001 From: Josh Cannon <3956745+thejcannon@users.noreply.github.com> Date: Sat, 20 Jul 2024 10:23:23 -0500 Subject: [PATCH 034/308] Add PEP 712 converters to the `dataclasses` spec (#1783) * Add PEP 712 converters * [pre-commit.ci] auto fixes from pre-commit.com hooks * Apply suggestions from code review Thanks Carl! Co-authored-by: Carl Meyer * Apply suggestions from code review Co-authored-by: Eric Traut * Update dataclasses.rst * [pre-commit.ci] auto fixes from pre-commit.com hooks * Update dataclasses.rst * [pre-commit.ci] auto fixes from pre-commit.com hooks * Update dataclasses.rst * [pre-commit.ci] auto fixes from pre-commit.com hooks * Update dataclasses.rst * Update dataclasses.rst * Update docs/spec/dataclasses.rst * Comments --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Carl Meyer Co-authored-by: Eric Traut --- docs/spec/dataclasses.rst | 48 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/docs/spec/dataclasses.rst b/docs/spec/dataclasses.rst index 55265e575..ed914595c 100644 --- a/docs/spec/dataclasses.rst +++ b/docs/spec/dataclasses.rst @@ -365,6 +365,8 @@ positional and may use other names. * ``alias`` is an optional str parameter that provides an alternative name for the field. This alternative name is used in the synthesized ``__init__`` method. +* ``converter`` is an optional parameter that specifies a + callable used to convert values when assigning to the field. It is an error to specify more than one of ``default``, ``default_factory`` and ``factory``. @@ -526,6 +528,52 @@ This includes, but is not limited to, the following semantics: dataclass must be explicitly annotated as e.g. ``x: ClassVar[Final[int]] = 3``. +Converters +^^^^^^^^^^ + +The ``converter`` parameter can be specified in a field definition to provide a callable +used to convert values when assigning to the associated attribute. This feature allows for automatic type +conversion and validation during attribute assignment. + +Converter behavior: + +* The converter is used for all attribute assignment, including assignment + of default values, assignment in synthesized ``__init__`` methods + and direct attribute setting (e.g., ``obj.attr = value``). +* The converter is not used when reading attributes, as the attributes should already have been converted. + +Typing rules for converters: + +* The ``converter`` must be a callable that must accept a single positional argument + (but may accept other optional arguments, which are ignored for typing purposes). +* The type of the first positional parameter provides the type of the synthesized ``__init__`` parameter + for the field. +* The return type of the callable must be assignable to the field's declared type. +* If ``default`` or ``default_factory`` are provided, the type of the default value should be + assignable to the first positional parameter of the ``converter``. + +Example usage: + +.. code-block:: python + + def str_or_none(x: Any) -> str | None: + return str(x) if x is not None else None + + @custom_dataclass + class Example: + int_field: int = custom_field(converter=int) + str_field: str | None = custom_field(converter=str_or_none) + path_field: pathlib.Path = custom_field( + converter=pathlib.Path, + default="default/path.txt" + ) + + # Usage + example = Example("123", None, "some/path") + # example.int_field == 123 + # example.str_field == None + # example.path_field == pathlib.Path("some/path") + Undefined behavior ^^^^^^^^^^^^^^^^^^ From 75caed75a5f930c674360a5559788bad1b306bd8 Mon Sep 17 00:00:00 2001 From: Eric Traut Date: Sat, 20 Jul 2024 11:45:36 -0700 Subject: [PATCH 035/308] =?UTF-8?q?Added=20conformance=20checking=20for=20?= =?UTF-8?q?the=20"converter"=20field=20specifier=20parame=E2=80=A6=20(#181?= =?UTF-8?q?3)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added conformance checking for the "converter" field specifier parameter in dataclass_transform. None of the type checkers support it currently. --- .../mypy/dataclasses_transform_converter.toml | 48 +++++++ .../pyre/dataclasses_transform_converter.toml | 48 +++++++ conformance/results/pyre/version.toml | 2 +- .../dataclasses_transform_converter.toml | 77 ++++++++++ conformance/results/pyright/version.toml | 2 +- .../dataclasses_transform_converter.toml | 30 ++++ conformance/results/pytype/version.toml | 2 +- conformance/results/results.html | 12 +- .../tests/dataclasses_transform_converter.py | 132 ++++++++++++++++++ 9 files changed, 347 insertions(+), 6 deletions(-) create mode 100644 conformance/results/mypy/dataclasses_transform_converter.toml create mode 100644 conformance/results/pyre/dataclasses_transform_converter.toml create mode 100644 conformance/results/pyright/dataclasses_transform_converter.toml create mode 100644 conformance/results/pytype/dataclasses_transform_converter.toml create mode 100644 conformance/tests/dataclasses_transform_converter.py diff --git a/conformance/results/mypy/dataclasses_transform_converter.toml b/conformance/results/mypy/dataclasses_transform_converter.toml new file mode 100644 index 000000000..483d02021 --- /dev/null +++ b/conformance/results/mypy/dataclasses_transform_converter.toml @@ -0,0 +1,48 @@ +conformant = "Unsupported" +notes = """ +Converter parameter not yet supported. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 47: Expected 1 errors +Line 48: Expected 1 errors +Line 117: Expected 1 errors +Line 129: Expected 1 errors +Line 132: Expected 1 errors +Line 111: Unexpected errors ['dataclasses_transform_converter.py:111: error: Argument 1 to "DC2" has incompatible type "str"; expected "int" [arg-type]', 'dataclasses_transform_converter.py:111: error: Argument 2 to "DC2" has incompatible type "str"; expected "int" [arg-type]', 'dataclasses_transform_converter.py:111: error: Argument 3 to "DC2" has incompatible type "str"; expected "int" [arg-type]', 'dataclasses_transform_converter.py:111: error: Argument 4 to "DC2" has incompatible type "bytes"; expected "ConverterClass" [arg-type]', 'dataclasses_transform_converter.py:111: error: Argument 5 to "DC2" has incompatible type "list[Never]"; expected "int" [arg-type]'] +Line 113: Unexpected errors ['dataclasses_transform_converter.py:113: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] +Line 114: Unexpected errors ['dataclasses_transform_converter.py:114: error: Incompatible types in assignment (expression has type "str", variable has type "ConverterClass") [assignment]'] +Line 115: Unexpected errors ['dataclasses_transform_converter.py:115: error: Incompatible types in assignment (expression has type "bytes", variable has type "ConverterClass") [assignment]'] +Line 120: Unexpected errors ['dataclasses_transform_converter.py:120: error: Argument 1 to "DC2" has incompatible type "str"; expected "int" [arg-type]', 'dataclasses_transform_converter.py:120: error: Argument 2 to "DC2" has incompatible type "str"; expected "int" [arg-type]', 'dataclasses_transform_converter.py:120: error: Argument 3 to "DC2" has incompatible type "str"; expected "int" [arg-type]', 'dataclasses_transform_converter.py:120: error: Argument 4 to "DC2" has incompatible type "str"; expected "ConverterClass" [arg-type]', 'dataclasses_transform_converter.py:120: error: Argument 5 to "DC2" has incompatible type "str"; expected "int" [arg-type]', 'dataclasses_transform_converter.py:120: error: Argument 6 to "DC2" has incompatible type "tuple[tuple[str, str], tuple[str, str]]"; expected "dict[str, str]" [arg-type]'] +""" +output = """ +dataclasses_transform_converter.py:106: error: Argument 2 to "DC2" has incompatible type "str"; expected "int" [arg-type] +dataclasses_transform_converter.py:106: error: Argument 3 to "DC2" has incompatible type "str"; expected "int" [arg-type] +dataclasses_transform_converter.py:106: error: Argument 4 to "DC2" has incompatible type "bytes"; expected "ConverterClass" [arg-type] +dataclasses_transform_converter.py:106: error: Argument 5 to "DC2" has incompatible type "list[Never]"; expected "int" [arg-type] +dataclasses_transform_converter.py:107: error: Argument 1 to "DC2" has incompatible type "str"; expected "int" [arg-type] +dataclasses_transform_converter.py:107: error: Argument 2 to "DC2" has incompatible type "str"; expected "int" [arg-type] +dataclasses_transform_converter.py:107: error: Argument 3 to "DC2" has incompatible type "str"; expected "int" [arg-type] +dataclasses_transform_converter.py:107: error: Argument 4 to "DC2" has incompatible type "int"; expected "ConverterClass" [arg-type] +dataclasses_transform_converter.py:107: error: Argument 5 to "DC2" has incompatible type "list[Never]"; expected "int" [arg-type] +dataclasses_transform_converter.py:108: error: Argument 1 to "DC2" has incompatible type "str"; expected "int" [arg-type] +dataclasses_transform_converter.py:108: error: Argument 2 to "DC2" has incompatible type "str"; expected "int" [arg-type] +dataclasses_transform_converter.py:108: error: Argument 3 to "DC2" has incompatible type "str"; expected "int" [arg-type] +dataclasses_transform_converter.py:108: error: Argument 4 to "DC2" has incompatible type "str"; expected "ConverterClass" [arg-type] +dataclasses_transform_converter.py:108: error: Argument 5 to "DC2" has incompatible type "complex"; expected "int" [arg-type] +dataclasses_transform_converter.py:111: error: Argument 1 to "DC2" has incompatible type "str"; expected "int" [arg-type] +dataclasses_transform_converter.py:111: error: Argument 2 to "DC2" has incompatible type "str"; expected "int" [arg-type] +dataclasses_transform_converter.py:111: error: Argument 3 to "DC2" has incompatible type "str"; expected "int" [arg-type] +dataclasses_transform_converter.py:111: error: Argument 4 to "DC2" has incompatible type "bytes"; expected "ConverterClass" [arg-type] +dataclasses_transform_converter.py:111: error: Argument 5 to "DC2" has incompatible type "list[Never]"; expected "int" [arg-type] +dataclasses_transform_converter.py:113: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +dataclasses_transform_converter.py:114: error: Incompatible types in assignment (expression has type "str", variable has type "ConverterClass") [assignment] +dataclasses_transform_converter.py:115: error: Incompatible types in assignment (expression has type "bytes", variable has type "ConverterClass") [assignment] +dataclasses_transform_converter.py:118: error: Incompatible types in assignment (expression has type "int", variable has type "ConverterClass") [assignment] +dataclasses_transform_converter.py:120: error: Argument 1 to "DC2" has incompatible type "str"; expected "int" [arg-type] +dataclasses_transform_converter.py:120: error: Argument 2 to "DC2" has incompatible type "str"; expected "int" [arg-type] +dataclasses_transform_converter.py:120: error: Argument 3 to "DC2" has incompatible type "str"; expected "int" [arg-type] +dataclasses_transform_converter.py:120: error: Argument 4 to "DC2" has incompatible type "str"; expected "ConverterClass" [arg-type] +dataclasses_transform_converter.py:120: error: Argument 5 to "DC2" has incompatible type "str"; expected "int" [arg-type] +dataclasses_transform_converter.py:120: error: Argument 6 to "DC2" has incompatible type "tuple[tuple[str, str], tuple[str, str]]"; expected "dict[str, str]" [arg-type] +""" diff --git a/conformance/results/pyre/dataclasses_transform_converter.toml b/conformance/results/pyre/dataclasses_transform_converter.toml new file mode 100644 index 000000000..20db71dd6 --- /dev/null +++ b/conformance/results/pyre/dataclasses_transform_converter.toml @@ -0,0 +1,48 @@ +conformant = "Unsupported" +notes = """ +Converter parameter not yet supported. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 47: Expected 1 errors +Line 48: Expected 1 errors +Line 117: Expected 1 errors +Line 129: Expected 1 errors +Line 132: Expected 1 errors +Line 111: Unexpected errors ['dataclasses_transform_converter.py:111:10 Incompatible parameter type [6]: In call `DC2.__init__`, for 1st positional argument, expected `int` but got `str`.', 'dataclasses_transform_converter.py:111:16 Incompatible parameter type [6]: In call `DC2.__init__`, for 2nd positional argument, expected `int` but got `str`.', 'dataclasses_transform_converter.py:111:22 Incompatible parameter type [6]: In call `DC2.__init__`, for 3rd positional argument, expected `int` but got `str`.', 'dataclasses_transform_converter.py:111:28 Incompatible parameter type [6]: In call `DC2.__init__`, for 4th positional argument, expected `ConverterClass` but got `bytes`.', 'dataclasses_transform_converter.py:111:35 Incompatible parameter type [6]: In call `DC2.__init__`, for 5th positional argument, expected `int` but got `List[Variable[_T]]`.'] +Line 113: Unexpected errors ['dataclasses_transform_converter.py:113:0 Incompatible attribute type [8]: Attribute `field0` declared in class `DC2` has type `int` but is used as type `str`.'] +Line 114: Unexpected errors ['dataclasses_transform_converter.py:114:0 Incompatible attribute type [8]: Attribute `field3` declared in class `DC2` has type `ConverterClass` but is used as type `str`.'] +Line 115: Unexpected errors ['dataclasses_transform_converter.py:115:0 Incompatible attribute type [8]: Attribute `field3` declared in class `DC2` has type `ConverterClass` but is used as type `bytes`.'] +Line 120: Unexpected errors ['dataclasses_transform_converter.py:120:10 Incompatible parameter type [6]: In call `DC2.__init__`, for 1st positional argument, expected `int` but got `str`.', 'dataclasses_transform_converter.py:120:16 Incompatible parameter type [6]: In call `DC2.__init__`, for 2nd positional argument, expected `int` but got `str`.', 'dataclasses_transform_converter.py:120:22 Incompatible parameter type [6]: In call `DC2.__init__`, for 3rd positional argument, expected `int` but got `str`.', 'dataclasses_transform_converter.py:120:28 Incompatible parameter type [6]: In call `DC2.__init__`, for 4th positional argument, expected `ConverterClass` but got `str`.', 'dataclasses_transform_converter.py:120:34 Incompatible parameter type [6]: In call `DC2.__init__`, for 5th positional argument, expected `int` but got `str`.', 'dataclasses_transform_converter.py:120:39 Incompatible parameter type [6]: In call `DC2.__init__`, for 6th positional argument, expected `Dict[str, str]` but got `Tuple[Tuple[str, str], Tuple[str, str]]`.'] +""" +output = """ +dataclasses_transform_converter.py:106:7 Incompatible parameter type [6]: In call `DC2.__init__`, for 2nd positional argument, expected `int` but got `str`. +dataclasses_transform_converter.py:106:13 Incompatible parameter type [6]: In call `DC2.__init__`, for 3rd positional argument, expected `int` but got `str`. +dataclasses_transform_converter.py:106:19 Incompatible parameter type [6]: In call `DC2.__init__`, for 4th positional argument, expected `ConverterClass` but got `bytes`. +dataclasses_transform_converter.py:106:26 Incompatible parameter type [6]: In call `DC2.__init__`, for 5th positional argument, expected `int` but got `List[Variable[_T]]`. +dataclasses_transform_converter.py:107:4 Incompatible parameter type [6]: In call `DC2.__init__`, for 1st positional argument, expected `int` but got `str`. +dataclasses_transform_converter.py:107:10 Incompatible parameter type [6]: In call `DC2.__init__`, for 2nd positional argument, expected `int` but got `str`. +dataclasses_transform_converter.py:107:16 Incompatible parameter type [6]: In call `DC2.__init__`, for 3rd positional argument, expected `int` but got `str`. +dataclasses_transform_converter.py:107:22 Incompatible parameter type [6]: In call `DC2.__init__`, for 4th positional argument, expected `ConverterClass` but got `int`. +dataclasses_transform_converter.py:107:25 Incompatible parameter type [6]: In call `DC2.__init__`, for 5th positional argument, expected `int` but got `List[Variable[_T]]`. +dataclasses_transform_converter.py:108:4 Incompatible parameter type [6]: In call `DC2.__init__`, for 1st positional argument, expected `int` but got `str`. +dataclasses_transform_converter.py:108:10 Incompatible parameter type [6]: In call `DC2.__init__`, for 2nd positional argument, expected `int` but got `str`. +dataclasses_transform_converter.py:108:16 Incompatible parameter type [6]: In call `DC2.__init__`, for 3rd positional argument, expected `int` but got `str`. +dataclasses_transform_converter.py:108:22 Incompatible parameter type [6]: In call `DC2.__init__`, for 4th positional argument, expected `ConverterClass` but got `str`. +dataclasses_transform_converter.py:108:28 Incompatible parameter type [6]: In call `DC2.__init__`, for 5th positional argument, expected `int` but got `complex`. +dataclasses_transform_converter.py:111:10 Incompatible parameter type [6]: In call `DC2.__init__`, for 1st positional argument, expected `int` but got `str`. +dataclasses_transform_converter.py:111:16 Incompatible parameter type [6]: In call `DC2.__init__`, for 2nd positional argument, expected `int` but got `str`. +dataclasses_transform_converter.py:111:22 Incompatible parameter type [6]: In call `DC2.__init__`, for 3rd positional argument, expected `int` but got `str`. +dataclasses_transform_converter.py:111:28 Incompatible parameter type [6]: In call `DC2.__init__`, for 4th positional argument, expected `ConverterClass` but got `bytes`. +dataclasses_transform_converter.py:111:35 Incompatible parameter type [6]: In call `DC2.__init__`, for 5th positional argument, expected `int` but got `List[Variable[_T]]`. +dataclasses_transform_converter.py:113:0 Incompatible attribute type [8]: Attribute `field0` declared in class `DC2` has type `int` but is used as type `str`. +dataclasses_transform_converter.py:114:0 Incompatible attribute type [8]: Attribute `field3` declared in class `DC2` has type `ConverterClass` but is used as type `str`. +dataclasses_transform_converter.py:115:0 Incompatible attribute type [8]: Attribute `field3` declared in class `DC2` has type `ConverterClass` but is used as type `bytes`. +dataclasses_transform_converter.py:118:0 Incompatible attribute type [8]: Attribute `field3` declared in class `DC2` has type `ConverterClass` but is used as type `int`. +dataclasses_transform_converter.py:120:10 Incompatible parameter type [6]: In call `DC2.__init__`, for 1st positional argument, expected `int` but got `str`. +dataclasses_transform_converter.py:120:16 Incompatible parameter type [6]: In call `DC2.__init__`, for 2nd positional argument, expected `int` but got `str`. +dataclasses_transform_converter.py:120:22 Incompatible parameter type [6]: In call `DC2.__init__`, for 3rd positional argument, expected `int` but got `str`. +dataclasses_transform_converter.py:120:28 Incompatible parameter type [6]: In call `DC2.__init__`, for 4th positional argument, expected `ConverterClass` but got `str`. +dataclasses_transform_converter.py:120:34 Incompatible parameter type [6]: In call `DC2.__init__`, for 5th positional argument, expected `int` but got `str`. +dataclasses_transform_converter.py:120:39 Incompatible parameter type [6]: In call `DC2.__init__`, for 6th positional argument, expected `Dict[str, str]` but got `Tuple[Tuple[str, str], Tuple[str, str]]`. +""" diff --git a/conformance/results/pyre/version.toml b/conformance/results/pyre/version.toml index fff2c3f20..98d9d6eb2 100644 --- a/conformance/results/pyre/version.toml +++ b/conformance/results/pyre/version.toml @@ -1,2 +1,2 @@ version = "pyre 0.9.22" -test_duration = 2.8 +test_duration = 3.4 diff --git a/conformance/results/pyright/dataclasses_transform_converter.toml b/conformance/results/pyright/dataclasses_transform_converter.toml new file mode 100644 index 000000000..9f1780b36 --- /dev/null +++ b/conformance/results/pyright/dataclasses_transform_converter.toml @@ -0,0 +1,77 @@ +conformant = "Unsupported" +notes = """ +Converter parameter not yet supported. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 47: Expected 1 errors +Line 48: Expected 1 errors +Line 117: Expected 1 errors +Line 129: Expected 1 errors +Line 132: Expected 1 errors +Line 111: Unexpected errors ['dataclasses_transform_converter.py:111:11 - error: Argument of type "Literal[\\'f0\\']" cannot be assigned to parameter "field0" of type "int" in function "__init__"', 'dataclasses_transform_converter.py:111:17 - error: Argument of type "Literal[\\'f1\\']" cannot be assigned to parameter "field1" of type "int" in function "__init__"', 'dataclasses_transform_converter.py:111:23 - error: Argument of type "Literal[\\'f2\\']" cannot be assigned to parameter "field2" of type "int" in function "__init__"', 'dataclasses_transform_converter.py:111:29 - error: Argument of type "Literal[b"f6"]" cannot be assigned to parameter "field3" of type "ConverterClass" in function "__init__"', 'dataclasses_transform_converter.py:111:36 - error: Argument of type "list[Any]" cannot be assigned to parameter "field4" of type "int" in function "__init__"'] +Line 113: Unexpected errors ['dataclasses_transform_converter.py:113:14 - error: Cannot assign to attribute "field0" for class "DC2"'] +Line 114: Unexpected errors ['dataclasses_transform_converter.py:114:14 - error: Cannot assign to attribute "field3" for class "DC2"'] +Line 115: Unexpected errors ['dataclasses_transform_converter.py:115:14 - error: Cannot assign to attribute "field3" for class "DC2"'] +Line 120: Unexpected errors ['dataclasses_transform_converter.py:120:11 - error: Argument of type "Literal[\\'f0\\']" cannot be assigned to parameter "field0" of type "int" in function "__init__"', 'dataclasses_transform_converter.py:120:17 - error: Argument of type "Literal[\\'f1\\']" cannot be assigned to parameter "field1" of type "int" in function "__init__"', 'dataclasses_transform_converter.py:120:23 - error: Argument of type "Literal[\\'f2\\']" cannot be assigned to parameter "field2" of type "int" in function "__init__"', 'dataclasses_transform_converter.py:120:29 - error: Argument of type "Literal[\\'f6\\']" cannot be assigned to parameter "field3" of type "ConverterClass" in function "__init__"', 'dataclasses_transform_converter.py:120:35 - error: Argument of type "Literal[\\'1\\']" cannot be assigned to parameter "field4" of type "int" in function "__init__"', 'dataclasses_transform_converter.py:120:40 - error: Argument of type "tuple[tuple[str, str], tuple[str, str]]" cannot be assigned to parameter "field5" of type "dict[str, str]" in function "__init__"'] +""" +output = """ +dataclasses_transform_converter.py:106:8 - error: Argument of type "Literal['f1']" cannot be assigned to parameter "field1" of type "int" in function "__init__" +  "Literal['f1']" is incompatible with "int" (reportArgumentType) +dataclasses_transform_converter.py:106:14 - error: Argument of type "Literal['f2']" cannot be assigned to parameter "field2" of type "int" in function "__init__" +  "Literal['f2']" is incompatible with "int" (reportArgumentType) +dataclasses_transform_converter.py:106:20 - error: Argument of type "Literal[b"f3"]" cannot be assigned to parameter "field3" of type "ConverterClass" in function "__init__" +  "Literal[b"f3"]" is incompatible with "ConverterClass" (reportArgumentType) +dataclasses_transform_converter.py:106:27 - error: Argument of type "list[Any]" cannot be assigned to parameter "field4" of type "int" in function "__init__" +  "list[Any]" is incompatible with "int" (reportArgumentType) +dataclasses_transform_converter.py:107:5 - error: Argument of type "Literal['f0']" cannot be assigned to parameter "field0" of type "int" in function "__init__" +  "Literal['f0']" is incompatible with "int" (reportArgumentType) +dataclasses_transform_converter.py:107:11 - error: Argument of type "Literal['f1']" cannot be assigned to parameter "field1" of type "int" in function "__init__" +  "Literal['f1']" is incompatible with "int" (reportArgumentType) +dataclasses_transform_converter.py:107:17 - error: Argument of type "Literal['f2']" cannot be assigned to parameter "field2" of type "int" in function "__init__" +  "Literal['f2']" is incompatible with "int" (reportArgumentType) +dataclasses_transform_converter.py:107:23 - error: Argument of type "Literal[1]" cannot be assigned to parameter "field3" of type "ConverterClass" in function "__init__" +  "Literal[1]" is incompatible with "ConverterClass" (reportArgumentType) +dataclasses_transform_converter.py:107:26 - error: Argument of type "list[Any]" cannot be assigned to parameter "field4" of type "int" in function "__init__" +  "list[Any]" is incompatible with "int" (reportArgumentType) +dataclasses_transform_converter.py:108:5 - error: Argument of type "Literal['f0']" cannot be assigned to parameter "field0" of type "int" in function "__init__" +  "Literal['f0']" is incompatible with "int" (reportArgumentType) +dataclasses_transform_converter.py:108:11 - error: Argument of type "Literal['f1']" cannot be assigned to parameter "field1" of type "int" in function "__init__" +  "Literal['f1']" is incompatible with "int" (reportArgumentType) +dataclasses_transform_converter.py:108:17 - error: Argument of type "Literal['f2']" cannot be assigned to parameter "field2" of type "int" in function "__init__" +  "Literal['f2']" is incompatible with "int" (reportArgumentType) +dataclasses_transform_converter.py:108:23 - error: Argument of type "Literal['f3']" cannot be assigned to parameter "field3" of type "ConverterClass" in function "__init__" +  "Literal['f3']" is incompatible with "ConverterClass" (reportArgumentType) +dataclasses_transform_converter.py:108:29 - error: Argument of type "complex" cannot be assigned to parameter "field4" of type "int" in function "__init__" +  "complex" is incompatible with "int" (reportArgumentType) +dataclasses_transform_converter.py:111:11 - error: Argument of type "Literal['f0']" cannot be assigned to parameter "field0" of type "int" in function "__init__" +  "Literal['f0']" is incompatible with "int" (reportArgumentType) +dataclasses_transform_converter.py:111:17 - error: Argument of type "Literal['f1']" cannot be assigned to parameter "field1" of type "int" in function "__init__" +  "Literal['f1']" is incompatible with "int" (reportArgumentType) +dataclasses_transform_converter.py:111:23 - error: Argument of type "Literal['f2']" cannot be assigned to parameter "field2" of type "int" in function "__init__" +  "Literal['f2']" is incompatible with "int" (reportArgumentType) +dataclasses_transform_converter.py:111:29 - error: Argument of type "Literal[b"f6"]" cannot be assigned to parameter "field3" of type "ConverterClass" in function "__init__" +  "Literal[b"f6"]" is incompatible with "ConverterClass" (reportArgumentType) +dataclasses_transform_converter.py:111:36 - error: Argument of type "list[Any]" cannot be assigned to parameter "field4" of type "int" in function "__init__" +  "list[Any]" is incompatible with "int" (reportArgumentType) +dataclasses_transform_converter.py:113:14 - error: Cannot assign to attribute "field0" for class "DC2" +  "Literal['f1']" is incompatible with "int" (reportAttributeAccessIssue) +dataclasses_transform_converter.py:114:14 - error: Cannot assign to attribute "field3" for class "DC2" +  "Literal['f6']" is incompatible with "ConverterClass" (reportAttributeAccessIssue) +dataclasses_transform_converter.py:115:14 - error: Cannot assign to attribute "field3" for class "DC2" +  "Literal[b"f6"]" is incompatible with "ConverterClass" (reportAttributeAccessIssue) +dataclasses_transform_converter.py:118:14 - error: Cannot assign to attribute "field3" for class "DC2" +  "Literal[1]" is incompatible with "ConverterClass" (reportAttributeAccessIssue) +dataclasses_transform_converter.py:120:11 - error: Argument of type "Literal['f0']" cannot be assigned to parameter "field0" of type "int" in function "__init__" +  "Literal['f0']" is incompatible with "int" (reportArgumentType) +dataclasses_transform_converter.py:120:17 - error: Argument of type "Literal['f1']" cannot be assigned to parameter "field1" of type "int" in function "__init__" +  "Literal['f1']" is incompatible with "int" (reportArgumentType) +dataclasses_transform_converter.py:120:23 - error: Argument of type "Literal['f2']" cannot be assigned to parameter "field2" of type "int" in function "__init__" +  "Literal['f2']" is incompatible with "int" (reportArgumentType) +dataclasses_transform_converter.py:120:29 - error: Argument of type "Literal['f6']" cannot be assigned to parameter "field3" of type "ConverterClass" in function "__init__" +  "Literal['f6']" is incompatible with "ConverterClass" (reportArgumentType) +dataclasses_transform_converter.py:120:35 - error: Argument of type "Literal['1']" cannot be assigned to parameter "field4" of type "int" in function "__init__" +  "Literal['1']" is incompatible with "int" (reportArgumentType) +dataclasses_transform_converter.py:120:40 - error: Argument of type "tuple[tuple[str, str], tuple[str, str]]" cannot be assigned to parameter "field5" of type "dict[str, str]" in function "__init__" +  "tuple[tuple[str, str], tuple[str, str]]" is incompatible with "dict[str, str]" (reportArgumentType) +""" diff --git a/conformance/results/pyright/version.toml b/conformance/results/pyright/version.toml index 56d968adf..81d11bfbf 100644 --- a/conformance/results/pyright/version.toml +++ b/conformance/results/pyright/version.toml @@ -1,2 +1,2 @@ version = "pyright 1.1.372" -test_duration = 1.4 +test_duration = 1.5 diff --git a/conformance/results/pytype/dataclasses_transform_converter.toml b/conformance/results/pytype/dataclasses_transform_converter.toml new file mode 100644 index 000000000..03fa070c4 --- /dev/null +++ b/conformance/results/pytype/dataclasses_transform_converter.toml @@ -0,0 +1,30 @@ +conformant = "Unsupported" +notes = """ +Converter parameter not yet supported. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 47: Expected 1 errors +Line 48: Expected 1 errors +Line 117: Expected 1 errors +Line 129: Expected 1 errors +Line 132: Expected 1 errors +Line 28: Unexpected errors ['File "dataclasses_transform_converter.py", line 28, in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] +Line 111: Unexpected errors ['File "dataclasses_transform_converter.py", line 111, in : Function DC2.__init__ was called with the wrong arguments [wrong-arg-types]'] +Line 113: Unexpected errors ['File "dataclasses_transform_converter.py", line 113, in : Type annotation for field0 does not match type of assignment [annotation-type-mismatch]'] +Line 114: Unexpected errors ['File "dataclasses_transform_converter.py", line 114, in : Type annotation for field3 does not match type of assignment [annotation-type-mismatch]'] +Line 115: Unexpected errors ['File "dataclasses_transform_converter.py", line 115, in : Type annotation for field3 does not match type of assignment [annotation-type-mismatch]'] +Line 120: Unexpected errors ['File "dataclasses_transform_converter.py", line 120, in : Function DC2.__init__ was called with the wrong arguments [wrong-arg-types]'] +""" +output = """ +File "dataclasses_transform_converter.py", line 28, in : Arguments to dataclass_transform not supported yet [not-supported-yet] +File "dataclasses_transform_converter.py", line 106, in : Function DC2.__init__ was called with the wrong arguments [wrong-arg-types] +File "dataclasses_transform_converter.py", line 107, in : Function DC2.__init__ was called with the wrong arguments [wrong-arg-types] +File "dataclasses_transform_converter.py", line 108, in : Function DC2.__init__ was called with the wrong arguments [wrong-arg-types] +File "dataclasses_transform_converter.py", line 111, in : Function DC2.__init__ was called with the wrong arguments [wrong-arg-types] +File "dataclasses_transform_converter.py", line 113, in : Type annotation for field0 does not match type of assignment [annotation-type-mismatch] +File "dataclasses_transform_converter.py", line 114, in : Type annotation for field3 does not match type of assignment [annotation-type-mismatch] +File "dataclasses_transform_converter.py", line 115, in : Type annotation for field3 does not match type of assignment [annotation-type-mismatch] +File "dataclasses_transform_converter.py", line 118, in : Type annotation for field3 does not match type of assignment [annotation-type-mismatch] +File "dataclasses_transform_converter.py", line 120, in : Function DC2.__init__ was called with the wrong arguments [wrong-arg-types] +""" diff --git a/conformance/results/pytype/version.toml b/conformance/results/pytype/version.toml index f00d1eab3..8fb93c628 100644 --- a/conformance/results/pytype/version.toml +++ b/conformance/results/pytype/version.toml @@ -1,2 +1,2 @@ version = "pytype 2024.04.11" -test_duration = 30.9 +test_duration = 36.3 diff --git a/conformance/results/results.html b/conformance/results/results.html index b9b1894af..174a9c849 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -162,13 +162,13 @@

    Python Type System Conformance Test Results

    1.5sec
    + + + + + + diff --git a/conformance/tests/dataclasses_transform_converter.py b/conformance/tests/dataclasses_transform_converter.py new file mode 100644 index 000000000..19602c181 --- /dev/null +++ b/conformance/tests/dataclasses_transform_converter.py @@ -0,0 +1,132 @@ +""" +Tests the dataclass_transform mechanism supports the "converter" parameter +in a field specifier class. +""" + +# Specification: https://typing.readthedocs.io/en/latest/spec/dataclasses.html#converters + +from typing import ( + Any, + Callable, + TypeVar, + dataclass_transform, + overload, +) + +T = TypeVar("T") + + +def model_field( + *, + converter: Callable[..., Any], + default: object = None, + default_factory: Callable[..., object] | None = None, +) -> Any: + ... + + +@dataclass_transform(field_specifiers=(model_field,)) +class ModelBase: + ... + + +# > The converter must be a callable that must accept a single positional +# > argument (but may accept other optional arguments, which are ignored for +# > typing purposes). + + +def bad_converter1() -> int: + return 0 + + +def bad_converter2(*, x: int) -> int: + return 0 + + +class DC1(ModelBase): + field1: int = model_field(converter=bad_converter1) # E + field2: int = model_field(converter=bad_converter2) # E + + +# > The type of the first positional parameter provides the type of the +# > synthesized __init__ parameter for the field. + +# > The return type of the callable must be assignable to the field’s +# > declared type. + + +def converter_simple(s: str) -> int: + return int(s) + + +def converter_with_param_before_args(s: str, *args: int, **kwargs: int) -> int: + return int(s) + + +def converter_with_args(*args: str) -> int: + return int(args[0]) + + +@overload +def overloaded_converter(s: str) -> int: + ... + + +@overload +def overloaded_converter(s: list[str]) -> int: + ... + + +def overloaded_converter(s: str | list[str], *args: str) -> int | str: + return 0 + + +class ConverterClass: + @overload + def __init__(self, val: str) -> None: + ... + + @overload + def __init__(self, val: bytes) -> None: + ... + + def __init__(self, val: str | bytes) -> None: + pass + + +class DC2(ModelBase): + field0: int = model_field(converter=converter_simple) + field1: int = model_field(converter=converter_with_param_before_args) + field2: int = model_field(converter=converter_with_args) + field3: ConverterClass = model_field(converter=ConverterClass) + field4: int = model_field(converter=overloaded_converter) + field5: dict[str, str] = model_field(converter=dict, default=()) + + +DC2(1, "f1", "f2", b"f3", []) # E +DC2("f0", "f1", "f2", 1, []) # E +DC2("f0", "f1", "f2", "f3", 3j) # E + + +dc1 = DC2("f0", "f1", "f2", b"f6", []) + +dc1.field0 = "f1" +dc1.field3 = "f6" +dc1.field3 = b"f6" + +dc1.field0 = 1 # E +dc1.field3 = 1 # E + +dc2 = DC2("f0", "f1", "f2", "f6", "1", (("a", "1"), ("b", "2"))) + + +# > If default or default_factory are provided, the type of the default value +# > should be assignable to the first positional parameter of the converter. + + +class DC3(ModelBase): + field0: int = model_field(converter=converter_simple, default="") + field1: int = model_field(converter=converter_simple, default=1) # E + + field2: int = model_field(converter=converter_simple, default_factory=str) + field3: int = model_field(converter=converter_simple, default_factory=int) # E From b908de0205fb208cd2d74fe342ab33f28f35b71b Mon Sep 17 00:00:00 2001 From: Eric Traut Date: Wed, 24 Jul 2024 10:46:05 -0700 Subject: [PATCH 036/308] Updated conformance results for pyright 1.1.373. (#1818) Most of the deltas are due to improvements in error messages. Bugs in two tests were fixed (`constructors_callable` and `dataclasses_transform_converter`). A third test (`generics_typevartuple_basic`) was updated to accommodate small differences in where an error is reported. The only visible change in the conformance report is that pyright now passes the conformance tests for dataclass converters. --- .../results/mypy/constructors_callable.toml | 2 - .../mypy/dataclasses_transform_converter.toml | 66 +++++----- .../mypy/generics_typevartuple_basic.toml | 2 - conformance/results/mypy/version.toml | 2 +- .../results/pyre/constructors_callable.toml | 2 - .../pyre/dataclasses_transform_converter.toml | 72 +++++------ .../pyre/generics_typevartuple_basic.toml | 1 - conformance/results/pyre/version.toml | 2 +- .../results/pyright/aliases_explicit.toml | 6 +- .../results/pyright/aliases_implicit.toml | 8 +- .../results/pyright/aliases_newtype.toml | 2 +- .../pyright/aliases_type_statement.toml | 6 +- .../pyright/aliases_typealiastype.toml | 4 +- .../results/pyright/aliases_variance.toml | 6 +- .../results/pyright/callables_annotation.toml | 12 +- .../results/pyright/classes_classvar.toml | 18 +-- .../pyright/constructors_call_init.toml | 8 +- .../pyright/constructors_consistency.toml | 4 +- .../dataclasses_transform_converter.toml | 113 +++++++----------- .../pyright/directives_assert_type.toml | 4 +- .../pyright/directives_reveal_type.toml | 4 +- .../results/pyright/enums_members.toml | 12 +- .../results/pyright/generics_base_class.toml | 4 +- .../results/pyright/generics_basic.toml | 4 +- .../generics_defaults_specialization.toml | 2 +- .../pyright/generics_paramspec_basic.toml | 16 +-- .../generics_paramspec_components.toml | 18 +-- .../results/pyright/generics_scoping.toml | 2 +- .../pyright/generics_syntax_declarations.toml | 2 +- .../generics_syntax_infer_variance.toml | 4 +- .../pyright/generics_syntax_scoping.toml | 4 +- .../pyright/generics_typevartuple_basic.toml | 31 +++-- .../generics_typevartuple_specialization.toml | 12 +- .../results/pyright/generics_upper_bound.toml | 4 +- .../results/pyright/generics_variance.toml | 6 +- .../pyright/literals_literalstring.toml | 7 +- .../pyright/literals_parameterizations.toml | 32 ++--- .../results/pyright/protocols_definition.toml | 2 +- .../results/pyright/qualifiers_annotated.toml | 8 +- .../pyright/qualifiers_final_annotation.toml | 14 +-- .../pyright/qualifiers_final_decorator.toml | 2 +- .../results/pyright/specialtypes_type.toml | 2 +- .../results/pyright/tuples_type_form.toml | 12 +- .../results/pyright/tuples_unpacked.toml | 10 +- .../pyright/typeddicts_class_syntax.toml | 4 +- .../pyright/typeddicts_inheritance.toml | 2 +- .../results/pyright/typeddicts_required.toml | 8 +- .../results/pyright/typeddicts_usage.toml | 2 +- conformance/results/pyright/version.toml | 4 +- .../results/pytype/constructors_callable.toml | 4 - .../dataclasses_transform_converter.toml | 55 ++++++--- conformance/results/pytype/version.toml | 2 +- conformance/results/results.html | 12 +- conformance/tests/constructors_callable.py | 2 +- .../tests/dataclasses_transform_converter.py | 9 +- .../tests/generics_typevartuple_basic.py | 4 +- 56 files changed, 319 insertions(+), 343 deletions(-) diff --git a/conformance/results/mypy/constructors_callable.toml b/conformance/results/mypy/constructors_callable.toml index 6d3aef710..e492d317a 100644 --- a/conformance/results/mypy/constructors_callable.toml +++ b/conformance/results/mypy/constructors_callable.toml @@ -13,7 +13,6 @@ Line 78: Unexpected errors ['constructors_callable.py:78: error: Expression is o Line 100: Unexpected errors ['constructors_callable.py:100: error: Expression is of type "Class5", not "Never" [assert-type]'] Line 105: Unexpected errors ['constructors_callable.py:105: error: Expression is of type "Class5", not "Never" [assert-type]'] Line 116: Unexpected errors ['constructors_callable.py:116: error: Incompatible return type for "__new__" (returns "Class6Proxy", but must return a subtype of "Class6") [misc]'] -Line 117: Unexpected errors ['constructors_callable.py:117: error: Incompatible return value type (got "Class6", expected "Class6Proxy") [return-value]'] Line 126: Unexpected errors ['constructors_callable.py:126: error: Expression is of type "Class6", not "Class6Proxy" [assert-type]', 'constructors_callable.py:126: error: Too few arguments [call-arg]'] Line 143: Unexpected errors ['constructors_callable.py:143: error: Expression is of type "Class6Any", not "Any" [assert-type]', 'constructors_callable.py:143: error: Too few arguments [call-arg]'] """ @@ -36,7 +35,6 @@ constructors_callable.py:97: note: Revealed type is "def (*args: Any, **kwargs: constructors_callable.py:100: error: Expression is of type "Class5", not "Never" [assert-type] constructors_callable.py:105: error: Expression is of type "Class5", not "Never" [assert-type] constructors_callable.py:116: error: Incompatible return type for "__new__" (returns "Class6Proxy", but must return a subtype of "Class6") [misc] -constructors_callable.py:117: error: Incompatible return value type (got "Class6", expected "Class6Proxy") [return-value] constructors_callable.py:125: note: Revealed type is "def (x: builtins.int) -> constructors_callable.Class6" constructors_callable.py:126: error: Expression is of type "Class6", not "Class6Proxy" [assert-type] constructors_callable.py:126: error: Too few arguments [call-arg] diff --git a/conformance/results/mypy/dataclasses_transform_converter.toml b/conformance/results/mypy/dataclasses_transform_converter.toml index 483d02021..bd9b1b6d5 100644 --- a/conformance/results/mypy/dataclasses_transform_converter.toml +++ b/conformance/results/mypy/dataclasses_transform_converter.toml @@ -4,45 +4,45 @@ Converter parameter not yet supported. """ conformance_automated = "Fail" errors_diff = """ -Line 47: Expected 1 errors -Line 48: Expected 1 errors -Line 117: Expected 1 errors -Line 129: Expected 1 errors -Line 132: Expected 1 errors -Line 111: Unexpected errors ['dataclasses_transform_converter.py:111: error: Argument 1 to "DC2" has incompatible type "str"; expected "int" [arg-type]', 'dataclasses_transform_converter.py:111: error: Argument 2 to "DC2" has incompatible type "str"; expected "int" [arg-type]', 'dataclasses_transform_converter.py:111: error: Argument 3 to "DC2" has incompatible type "str"; expected "int" [arg-type]', 'dataclasses_transform_converter.py:111: error: Argument 4 to "DC2" has incompatible type "bytes"; expected "ConverterClass" [arg-type]', 'dataclasses_transform_converter.py:111: error: Argument 5 to "DC2" has incompatible type "list[Never]"; expected "int" [arg-type]'] -Line 113: Unexpected errors ['dataclasses_transform_converter.py:113: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] -Line 114: Unexpected errors ['dataclasses_transform_converter.py:114: error: Incompatible types in assignment (expression has type "str", variable has type "ConverterClass") [assignment]'] -Line 115: Unexpected errors ['dataclasses_transform_converter.py:115: error: Incompatible types in assignment (expression has type "bytes", variable has type "ConverterClass") [assignment]'] -Line 120: Unexpected errors ['dataclasses_transform_converter.py:120: error: Argument 1 to "DC2" has incompatible type "str"; expected "int" [arg-type]', 'dataclasses_transform_converter.py:120: error: Argument 2 to "DC2" has incompatible type "str"; expected "int" [arg-type]', 'dataclasses_transform_converter.py:120: error: Argument 3 to "DC2" has incompatible type "str"; expected "int" [arg-type]', 'dataclasses_transform_converter.py:120: error: Argument 4 to "DC2" has incompatible type "str"; expected "ConverterClass" [arg-type]', 'dataclasses_transform_converter.py:120: error: Argument 5 to "DC2" has incompatible type "str"; expected "int" [arg-type]', 'dataclasses_transform_converter.py:120: error: Argument 6 to "DC2" has incompatible type "tuple[tuple[str, str], tuple[str, str]]"; expected "dict[str, str]" [arg-type]'] +Line 118: Expected 1 errors +Line 112: Unexpected errors ['dataclasses_transform_converter.py:112: error: Argument 1 to "DC2" has incompatible type "str"; expected "int" [arg-type]', 'dataclasses_transform_converter.py:112: error: Argument 2 to "DC2" has incompatible type "str"; expected "int" [arg-type]', 'dataclasses_transform_converter.py:112: error: Argument 3 to "DC2" has incompatible type "str"; expected "int" [arg-type]', 'dataclasses_transform_converter.py:112: error: Argument 4 to "DC2" has incompatible type "bytes"; expected "ConverterClass" [arg-type]', 'dataclasses_transform_converter.py:112: error: Argument 5 to "DC2" has incompatible type "list[Never]"; expected "int" [arg-type]'] +Line 114: Unexpected errors ['dataclasses_transform_converter.py:114: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] +Line 115: Unexpected errors ['dataclasses_transform_converter.py:115: error: Incompatible types in assignment (expression has type "str", variable has type "ConverterClass") [assignment]'] +Line 116: Unexpected errors ['dataclasses_transform_converter.py:116: error: Incompatible types in assignment (expression has type "bytes", variable has type "ConverterClass") [assignment]'] +Line 121: Unexpected errors ['dataclasses_transform_converter.py:121: error: Argument 1 to "DC2" has incompatible type "str"; expected "int" [arg-type]', 'dataclasses_transform_converter.py:121: error: Argument 2 to "DC2" has incompatible type "str"; expected "int" [arg-type]', 'dataclasses_transform_converter.py:121: error: Argument 3 to "DC2" has incompatible type "str"; expected "int" [arg-type]', 'dataclasses_transform_converter.py:121: error: Argument 4 to "DC2" has incompatible type "str"; expected "ConverterClass" [arg-type]', 'dataclasses_transform_converter.py:121: error: Argument 5 to "DC2" has incompatible type "str"; expected "int" [arg-type]', 'dataclasses_transform_converter.py:121: error: Argument 6 to "DC2" has incompatible type "tuple[tuple[str, str], tuple[str, str]]"; expected "dict[str, str]" [arg-type]'] """ output = """ -dataclasses_transform_converter.py:106: error: Argument 2 to "DC2" has incompatible type "str"; expected "int" [arg-type] -dataclasses_transform_converter.py:106: error: Argument 3 to "DC2" has incompatible type "str"; expected "int" [arg-type] -dataclasses_transform_converter.py:106: error: Argument 4 to "DC2" has incompatible type "bytes"; expected "ConverterClass" [arg-type] -dataclasses_transform_converter.py:106: error: Argument 5 to "DC2" has incompatible type "list[Never]"; expected "int" [arg-type] -dataclasses_transform_converter.py:107: error: Argument 1 to "DC2" has incompatible type "str"; expected "int" [arg-type] +dataclasses_transform_converter.py:48: error: Argument "converter" to "model_field" has incompatible type "Callable[[], int]"; expected "Callable[[Never], int]" [arg-type] +dataclasses_transform_converter.py:49: error: Argument "converter" to "model_field" has incompatible type "Callable[[NamedArg(int, 'x')], int]"; expected "Callable[[Never], int]" [arg-type] dataclasses_transform_converter.py:107: error: Argument 2 to "DC2" has incompatible type "str"; expected "int" [arg-type] dataclasses_transform_converter.py:107: error: Argument 3 to "DC2" has incompatible type "str"; expected "int" [arg-type] -dataclasses_transform_converter.py:107: error: Argument 4 to "DC2" has incompatible type "int"; expected "ConverterClass" [arg-type] +dataclasses_transform_converter.py:107: error: Argument 4 to "DC2" has incompatible type "bytes"; expected "ConverterClass" [arg-type] dataclasses_transform_converter.py:107: error: Argument 5 to "DC2" has incompatible type "list[Never]"; expected "int" [arg-type] dataclasses_transform_converter.py:108: error: Argument 1 to "DC2" has incompatible type "str"; expected "int" [arg-type] dataclasses_transform_converter.py:108: error: Argument 2 to "DC2" has incompatible type "str"; expected "int" [arg-type] dataclasses_transform_converter.py:108: error: Argument 3 to "DC2" has incompatible type "str"; expected "int" [arg-type] -dataclasses_transform_converter.py:108: error: Argument 4 to "DC2" has incompatible type "str"; expected "ConverterClass" [arg-type] -dataclasses_transform_converter.py:108: error: Argument 5 to "DC2" has incompatible type "complex"; expected "int" [arg-type] -dataclasses_transform_converter.py:111: error: Argument 1 to "DC2" has incompatible type "str"; expected "int" [arg-type] -dataclasses_transform_converter.py:111: error: Argument 2 to "DC2" has incompatible type "str"; expected "int" [arg-type] -dataclasses_transform_converter.py:111: error: Argument 3 to "DC2" has incompatible type "str"; expected "int" [arg-type] -dataclasses_transform_converter.py:111: error: Argument 4 to "DC2" has incompatible type "bytes"; expected "ConverterClass" [arg-type] -dataclasses_transform_converter.py:111: error: Argument 5 to "DC2" has incompatible type "list[Never]"; expected "int" [arg-type] -dataclasses_transform_converter.py:113: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] -dataclasses_transform_converter.py:114: error: Incompatible types in assignment (expression has type "str", variable has type "ConverterClass") [assignment] -dataclasses_transform_converter.py:115: error: Incompatible types in assignment (expression has type "bytes", variable has type "ConverterClass") [assignment] -dataclasses_transform_converter.py:118: error: Incompatible types in assignment (expression has type "int", variable has type "ConverterClass") [assignment] -dataclasses_transform_converter.py:120: error: Argument 1 to "DC2" has incompatible type "str"; expected "int" [arg-type] -dataclasses_transform_converter.py:120: error: Argument 2 to "DC2" has incompatible type "str"; expected "int" [arg-type] -dataclasses_transform_converter.py:120: error: Argument 3 to "DC2" has incompatible type "str"; expected "int" [arg-type] -dataclasses_transform_converter.py:120: error: Argument 4 to "DC2" has incompatible type "str"; expected "ConverterClass" [arg-type] -dataclasses_transform_converter.py:120: error: Argument 5 to "DC2" has incompatible type "str"; expected "int" [arg-type] -dataclasses_transform_converter.py:120: error: Argument 6 to "DC2" has incompatible type "tuple[tuple[str, str], tuple[str, str]]"; expected "dict[str, str]" [arg-type] +dataclasses_transform_converter.py:108: error: Argument 4 to "DC2" has incompatible type "int"; expected "ConverterClass" [arg-type] +dataclasses_transform_converter.py:108: error: Argument 5 to "DC2" has incompatible type "list[Never]"; expected "int" [arg-type] +dataclasses_transform_converter.py:109: error: Argument 1 to "DC2" has incompatible type "str"; expected "int" [arg-type] +dataclasses_transform_converter.py:109: error: Argument 2 to "DC2" has incompatible type "str"; expected "int" [arg-type] +dataclasses_transform_converter.py:109: error: Argument 3 to "DC2" has incompatible type "str"; expected "int" [arg-type] +dataclasses_transform_converter.py:109: error: Argument 4 to "DC2" has incompatible type "str"; expected "ConverterClass" [arg-type] +dataclasses_transform_converter.py:109: error: Argument 5 to "DC2" has incompatible type "complex"; expected "int" [arg-type] +dataclasses_transform_converter.py:112: error: Argument 1 to "DC2" has incompatible type "str"; expected "int" [arg-type] +dataclasses_transform_converter.py:112: error: Argument 2 to "DC2" has incompatible type "str"; expected "int" [arg-type] +dataclasses_transform_converter.py:112: error: Argument 3 to "DC2" has incompatible type "str"; expected "int" [arg-type] +dataclasses_transform_converter.py:112: error: Argument 4 to "DC2" has incompatible type "bytes"; expected "ConverterClass" [arg-type] +dataclasses_transform_converter.py:112: error: Argument 5 to "DC2" has incompatible type "list[Never]"; expected "int" [arg-type] +dataclasses_transform_converter.py:114: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +dataclasses_transform_converter.py:115: error: Incompatible types in assignment (expression has type "str", variable has type "ConverterClass") [assignment] +dataclasses_transform_converter.py:116: error: Incompatible types in assignment (expression has type "bytes", variable has type "ConverterClass") [assignment] +dataclasses_transform_converter.py:119: error: Incompatible types in assignment (expression has type "int", variable has type "ConverterClass") [assignment] +dataclasses_transform_converter.py:121: error: Argument 1 to "DC2" has incompatible type "str"; expected "int" [arg-type] +dataclasses_transform_converter.py:121: error: Argument 2 to "DC2" has incompatible type "str"; expected "int" [arg-type] +dataclasses_transform_converter.py:121: error: Argument 3 to "DC2" has incompatible type "str"; expected "int" [arg-type] +dataclasses_transform_converter.py:121: error: Argument 4 to "DC2" has incompatible type "str"; expected "ConverterClass" [arg-type] +dataclasses_transform_converter.py:121: error: Argument 5 to "DC2" has incompatible type "str"; expected "int" [arg-type] +dataclasses_transform_converter.py:121: error: Argument 6 to "DC2" has incompatible type "tuple[tuple[str, str], tuple[str, str]]"; expected "dict[str, str]" [arg-type] +dataclasses_transform_converter.py:130: error: Argument "converter" to "model_field" has incompatible type "Callable[[str], int]"; expected "Callable[[int], int]" [arg-type] +dataclasses_transform_converter.py:133: error: Cannot infer type argument 1 of "model_field" [misc] """ diff --git a/conformance/results/mypy/generics_typevartuple_basic.toml b/conformance/results/mypy/generics_typevartuple_basic.toml index 7319c34cd..1219f7a88 100644 --- a/conformance/results/mypy/generics_typevartuple_basic.toml +++ b/conformance/results/mypy/generics_typevartuple_basic.toml @@ -21,9 +21,7 @@ generics_typevartuple_basic.py:106: error: Can only use one type var tuple in a """ conformance_automated = "Fail" errors_diff = """ -Line 44: Expected 1 errors Line 89: Expected 1 errors Line 90: Expected 1 errors -Line 45: Unexpected errors ['generics_typevartuple_basic.py:45: error: Argument 1 to "Array" has incompatible type "tuple[Time, Batch, Width, Height]"; expected "tuple[Time, Batch, Height, Width]" [arg-type]'] Line 57: Unexpected errors ['generics_typevartuple_basic.py:57: error: Incompatible return value type (got "tuple[*Shape]", expected "tuple[Any]") [return-value]'] """ diff --git a/conformance/results/mypy/version.toml b/conformance/results/mypy/version.toml index 374a6c1f7..8f919ed46 100644 --- a/conformance/results/mypy/version.toml +++ b/conformance/results/mypy/version.toml @@ -1,2 +1,2 @@ version = "mypy 1.11.0" -test_duration = 1.5 +test_duration = 1.0 diff --git a/conformance/results/pyre/constructors_callable.toml b/conformance/results/pyre/constructors_callable.toml index bc7ec6948..6ab0dffa6 100644 --- a/conformance/results/pyre/constructors_callable.toml +++ b/conformance/results/pyre/constructors_callable.toml @@ -17,7 +17,6 @@ Line 63: Unexpected errors ['constructors_callable.py:63:0 Revealed type [-1]: R Line 77: Unexpected errors ['constructors_callable.py:77:0 Revealed type [-1]: Revealed type for `r4` is `typing.Callable[[Named(x, int)], Class4]`.'] Line 78: Unexpected errors ['constructors_callable.py:78:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `Class4`.'] Line 97: Unexpected errors ['constructors_callable.py:97:0 Revealed type [-1]: Revealed type for `r5` is `typing.Callable[[Variable(typing.Any), Keywords(typing.Any)], NoReturn]`.'] -Line 117: Unexpected errors ['constructors_callable.py:117:8 Incompatible return type [7]: Expected `Class6Proxy` but got `Class6`.'] Line 125: Unexpected errors ['constructors_callable.py:125:0 Revealed type [-1]: Revealed type for `r6` is `typing.Callable[[Named(x, int)], Class6]`.'] Line 126: Unexpected errors ['constructors_callable.py:126:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Class6Proxy` but got `Class6`.', 'constructors_callable.py:126:12 Missing argument [20]: PositionalOnly call expects argument `x`.'] Line 142: Unexpected errors ['constructors_callable.py:142:0 Revealed type [-1]: Revealed type for `r6_any` is `typing.Callable[[Named(x, int)], Class6Any]`.'] @@ -49,7 +48,6 @@ constructors_callable.py:78:0 Incompatible parameter type [6]: In call `assert_t constructors_callable.py:79:0 Missing argument [20]: PositionalOnly call expects argument `x`. constructors_callable.py:80:0 Unexpected keyword [28]: Unexpected keyword argument `y` to anonymous call. constructors_callable.py:97:0 Revealed type [-1]: Revealed type for `r5` is `typing.Callable[[Variable(typing.Any), Keywords(typing.Any)], NoReturn]`. -constructors_callable.py:117:8 Incompatible return type [7]: Expected `Class6Proxy` but got `Class6`. constructors_callable.py:125:0 Revealed type [-1]: Revealed type for `r6` is `typing.Callable[[Named(x, int)], Class6]`. constructors_callable.py:126:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Class6Proxy` but got `Class6`. constructors_callable.py:126:12 Missing argument [20]: PositionalOnly call expects argument `x`. diff --git a/conformance/results/pyre/dataclasses_transform_converter.toml b/conformance/results/pyre/dataclasses_transform_converter.toml index 20db71dd6..810debaef 100644 --- a/conformance/results/pyre/dataclasses_transform_converter.toml +++ b/conformance/results/pyre/dataclasses_transform_converter.toml @@ -4,45 +4,45 @@ Converter parameter not yet supported. """ conformance_automated = "Fail" errors_diff = """ -Line 47: Expected 1 errors -Line 48: Expected 1 errors -Line 117: Expected 1 errors -Line 129: Expected 1 errors -Line 132: Expected 1 errors -Line 111: Unexpected errors ['dataclasses_transform_converter.py:111:10 Incompatible parameter type [6]: In call `DC2.__init__`, for 1st positional argument, expected `int` but got `str`.', 'dataclasses_transform_converter.py:111:16 Incompatible parameter type [6]: In call `DC2.__init__`, for 2nd positional argument, expected `int` but got `str`.', 'dataclasses_transform_converter.py:111:22 Incompatible parameter type [6]: In call `DC2.__init__`, for 3rd positional argument, expected `int` but got `str`.', 'dataclasses_transform_converter.py:111:28 Incompatible parameter type [6]: In call `DC2.__init__`, for 4th positional argument, expected `ConverterClass` but got `bytes`.', 'dataclasses_transform_converter.py:111:35 Incompatible parameter type [6]: In call `DC2.__init__`, for 5th positional argument, expected `int` but got `List[Variable[_T]]`.'] -Line 113: Unexpected errors ['dataclasses_transform_converter.py:113:0 Incompatible attribute type [8]: Attribute `field0` declared in class `DC2` has type `int` but is used as type `str`.'] -Line 114: Unexpected errors ['dataclasses_transform_converter.py:114:0 Incompatible attribute type [8]: Attribute `field3` declared in class `DC2` has type `ConverterClass` but is used as type `str`.'] -Line 115: Unexpected errors ['dataclasses_transform_converter.py:115:0 Incompatible attribute type [8]: Attribute `field3` declared in class `DC2` has type `ConverterClass` but is used as type `bytes`.'] -Line 120: Unexpected errors ['dataclasses_transform_converter.py:120:10 Incompatible parameter type [6]: In call `DC2.__init__`, for 1st positional argument, expected `int` but got `str`.', 'dataclasses_transform_converter.py:120:16 Incompatible parameter type [6]: In call `DC2.__init__`, for 2nd positional argument, expected `int` but got `str`.', 'dataclasses_transform_converter.py:120:22 Incompatible parameter type [6]: In call `DC2.__init__`, for 3rd positional argument, expected `int` but got `str`.', 'dataclasses_transform_converter.py:120:28 Incompatible parameter type [6]: In call `DC2.__init__`, for 4th positional argument, expected `ConverterClass` but got `str`.', 'dataclasses_transform_converter.py:120:34 Incompatible parameter type [6]: In call `DC2.__init__`, for 5th positional argument, expected `int` but got `str`.', 'dataclasses_transform_converter.py:120:39 Incompatible parameter type [6]: In call `DC2.__init__`, for 6th positional argument, expected `Dict[str, str]` but got `Tuple[Tuple[str, str], Tuple[str, str]]`.'] +Line 118: Expected 1 errors +Line 112: Unexpected errors ['dataclasses_transform_converter.py:112:10 Incompatible parameter type [6]: In call `DC2.__init__`, for 1st positional argument, expected `int` but got `str`.', 'dataclasses_transform_converter.py:112:16 Incompatible parameter type [6]: In call `DC2.__init__`, for 2nd positional argument, expected `int` but got `str`.', 'dataclasses_transform_converter.py:112:22 Incompatible parameter type [6]: In call `DC2.__init__`, for 3rd positional argument, expected `int` but got `str`.', 'dataclasses_transform_converter.py:112:28 Incompatible parameter type [6]: In call `DC2.__init__`, for 4th positional argument, expected `ConverterClass` but got `bytes`.', 'dataclasses_transform_converter.py:112:35 Incompatible parameter type [6]: In call `DC2.__init__`, for 5th positional argument, expected `int` but got `List[Variable[_T]]`.'] +Line 114: Unexpected errors ['dataclasses_transform_converter.py:114:0 Incompatible attribute type [8]: Attribute `field0` declared in class `DC2` has type `int` but is used as type `str`.'] +Line 115: Unexpected errors ['dataclasses_transform_converter.py:115:0 Incompatible attribute type [8]: Attribute `field3` declared in class `DC2` has type `ConverterClass` but is used as type `str`.'] +Line 116: Unexpected errors ['dataclasses_transform_converter.py:116:0 Incompatible attribute type [8]: Attribute `field3` declared in class `DC2` has type `ConverterClass` but is used as type `bytes`.'] +Line 121: Unexpected errors ['dataclasses_transform_converter.py:121:10 Incompatible parameter type [6]: In call `DC2.__init__`, for 1st positional argument, expected `int` but got `str`.', 'dataclasses_transform_converter.py:121:16 Incompatible parameter type [6]: In call `DC2.__init__`, for 2nd positional argument, expected `int` but got `str`.', 'dataclasses_transform_converter.py:121:22 Incompatible parameter type [6]: In call `DC2.__init__`, for 3rd positional argument, expected `int` but got `str`.', 'dataclasses_transform_converter.py:121:28 Incompatible parameter type [6]: In call `DC2.__init__`, for 4th positional argument, expected `ConverterClass` but got `str`.', 'dataclasses_transform_converter.py:121:34 Incompatible parameter type [6]: In call `DC2.__init__`, for 5th positional argument, expected `int` but got `str`.', 'dataclasses_transform_converter.py:121:39 Incompatible parameter type [6]: In call `DC2.__init__`, for 6th positional argument, expected `Dict[str, str]` but got `Tuple[Tuple[str, str], Tuple[str, str]]`.'] """ output = """ -dataclasses_transform_converter.py:106:7 Incompatible parameter type [6]: In call `DC2.__init__`, for 2nd positional argument, expected `int` but got `str`. -dataclasses_transform_converter.py:106:13 Incompatible parameter type [6]: In call `DC2.__init__`, for 3rd positional argument, expected `int` but got `str`. -dataclasses_transform_converter.py:106:19 Incompatible parameter type [6]: In call `DC2.__init__`, for 4th positional argument, expected `ConverterClass` but got `bytes`. -dataclasses_transform_converter.py:106:26 Incompatible parameter type [6]: In call `DC2.__init__`, for 5th positional argument, expected `int` but got `List[Variable[_T]]`. -dataclasses_transform_converter.py:107:4 Incompatible parameter type [6]: In call `DC2.__init__`, for 1st positional argument, expected `int` but got `str`. -dataclasses_transform_converter.py:107:10 Incompatible parameter type [6]: In call `DC2.__init__`, for 2nd positional argument, expected `int` but got `str`. -dataclasses_transform_converter.py:107:16 Incompatible parameter type [6]: In call `DC2.__init__`, for 3rd positional argument, expected `int` but got `str`. -dataclasses_transform_converter.py:107:22 Incompatible parameter type [6]: In call `DC2.__init__`, for 4th positional argument, expected `ConverterClass` but got `int`. -dataclasses_transform_converter.py:107:25 Incompatible parameter type [6]: In call `DC2.__init__`, for 5th positional argument, expected `int` but got `List[Variable[_T]]`. +dataclasses_transform_converter.py:48:30 Incompatible parameter type [6]: In call `model_field`, for argument `converter`, expected `typing.Callable[[Variable[S]], Variable[T]]` but got `typing.Callable(bad_converter1)[[], int]`. +dataclasses_transform_converter.py:49:30 Incompatible parameter type [6]: In call `model_field`, for argument `converter`, expected `typing.Callable[[Variable[S]], Variable[T]]` but got `typing.Callable(bad_converter2)[[KeywordOnly(x, int)], int]`. +dataclasses_transform_converter.py:107:7 Incompatible parameter type [6]: In call `DC2.__init__`, for 2nd positional argument, expected `int` but got `str`. +dataclasses_transform_converter.py:107:13 Incompatible parameter type [6]: In call `DC2.__init__`, for 3rd positional argument, expected `int` but got `str`. +dataclasses_transform_converter.py:107:19 Incompatible parameter type [6]: In call `DC2.__init__`, for 4th positional argument, expected `ConverterClass` but got `bytes`. +dataclasses_transform_converter.py:107:26 Incompatible parameter type [6]: In call `DC2.__init__`, for 5th positional argument, expected `int` but got `List[Variable[_T]]`. dataclasses_transform_converter.py:108:4 Incompatible parameter type [6]: In call `DC2.__init__`, for 1st positional argument, expected `int` but got `str`. dataclasses_transform_converter.py:108:10 Incompatible parameter type [6]: In call `DC2.__init__`, for 2nd positional argument, expected `int` but got `str`. dataclasses_transform_converter.py:108:16 Incompatible parameter type [6]: In call `DC2.__init__`, for 3rd positional argument, expected `int` but got `str`. -dataclasses_transform_converter.py:108:22 Incompatible parameter type [6]: In call `DC2.__init__`, for 4th positional argument, expected `ConverterClass` but got `str`. -dataclasses_transform_converter.py:108:28 Incompatible parameter type [6]: In call `DC2.__init__`, for 5th positional argument, expected `int` but got `complex`. -dataclasses_transform_converter.py:111:10 Incompatible parameter type [6]: In call `DC2.__init__`, for 1st positional argument, expected `int` but got `str`. -dataclasses_transform_converter.py:111:16 Incompatible parameter type [6]: In call `DC2.__init__`, for 2nd positional argument, expected `int` but got `str`. -dataclasses_transform_converter.py:111:22 Incompatible parameter type [6]: In call `DC2.__init__`, for 3rd positional argument, expected `int` but got `str`. -dataclasses_transform_converter.py:111:28 Incompatible parameter type [6]: In call `DC2.__init__`, for 4th positional argument, expected `ConverterClass` but got `bytes`. -dataclasses_transform_converter.py:111:35 Incompatible parameter type [6]: In call `DC2.__init__`, for 5th positional argument, expected `int` but got `List[Variable[_T]]`. -dataclasses_transform_converter.py:113:0 Incompatible attribute type [8]: Attribute `field0` declared in class `DC2` has type `int` but is used as type `str`. -dataclasses_transform_converter.py:114:0 Incompatible attribute type [8]: Attribute `field3` declared in class `DC2` has type `ConverterClass` but is used as type `str`. -dataclasses_transform_converter.py:115:0 Incompatible attribute type [8]: Attribute `field3` declared in class `DC2` has type `ConverterClass` but is used as type `bytes`. -dataclasses_transform_converter.py:118:0 Incompatible attribute type [8]: Attribute `field3` declared in class `DC2` has type `ConverterClass` but is used as type `int`. -dataclasses_transform_converter.py:120:10 Incompatible parameter type [6]: In call `DC2.__init__`, for 1st positional argument, expected `int` but got `str`. -dataclasses_transform_converter.py:120:16 Incompatible parameter type [6]: In call `DC2.__init__`, for 2nd positional argument, expected `int` but got `str`. -dataclasses_transform_converter.py:120:22 Incompatible parameter type [6]: In call `DC2.__init__`, for 3rd positional argument, expected `int` but got `str`. -dataclasses_transform_converter.py:120:28 Incompatible parameter type [6]: In call `DC2.__init__`, for 4th positional argument, expected `ConverterClass` but got `str`. -dataclasses_transform_converter.py:120:34 Incompatible parameter type [6]: In call `DC2.__init__`, for 5th positional argument, expected `int` but got `str`. -dataclasses_transform_converter.py:120:39 Incompatible parameter type [6]: In call `DC2.__init__`, for 6th positional argument, expected `Dict[str, str]` but got `Tuple[Tuple[str, str], Tuple[str, str]]`. +dataclasses_transform_converter.py:108:22 Incompatible parameter type [6]: In call `DC2.__init__`, for 4th positional argument, expected `ConverterClass` but got `int`. +dataclasses_transform_converter.py:108:25 Incompatible parameter type [6]: In call `DC2.__init__`, for 5th positional argument, expected `int` but got `List[Variable[_T]]`. +dataclasses_transform_converter.py:109:4 Incompatible parameter type [6]: In call `DC2.__init__`, for 1st positional argument, expected `int` but got `str`. +dataclasses_transform_converter.py:109:10 Incompatible parameter type [6]: In call `DC2.__init__`, for 2nd positional argument, expected `int` but got `str`. +dataclasses_transform_converter.py:109:16 Incompatible parameter type [6]: In call `DC2.__init__`, for 3rd positional argument, expected `int` but got `str`. +dataclasses_transform_converter.py:109:22 Incompatible parameter type [6]: In call `DC2.__init__`, for 4th positional argument, expected `ConverterClass` but got `str`. +dataclasses_transform_converter.py:109:28 Incompatible parameter type [6]: In call `DC2.__init__`, for 5th positional argument, expected `int` but got `complex`. +dataclasses_transform_converter.py:112:10 Incompatible parameter type [6]: In call `DC2.__init__`, for 1st positional argument, expected `int` but got `str`. +dataclasses_transform_converter.py:112:16 Incompatible parameter type [6]: In call `DC2.__init__`, for 2nd positional argument, expected `int` but got `str`. +dataclasses_transform_converter.py:112:22 Incompatible parameter type [6]: In call `DC2.__init__`, for 3rd positional argument, expected `int` but got `str`. +dataclasses_transform_converter.py:112:28 Incompatible parameter type [6]: In call `DC2.__init__`, for 4th positional argument, expected `ConverterClass` but got `bytes`. +dataclasses_transform_converter.py:112:35 Incompatible parameter type [6]: In call `DC2.__init__`, for 5th positional argument, expected `int` but got `List[Variable[_T]]`. +dataclasses_transform_converter.py:114:0 Incompatible attribute type [8]: Attribute `field0` declared in class `DC2` has type `int` but is used as type `str`. +dataclasses_transform_converter.py:115:0 Incompatible attribute type [8]: Attribute `field3` declared in class `DC2` has type `ConverterClass` but is used as type `str`. +dataclasses_transform_converter.py:116:0 Incompatible attribute type [8]: Attribute `field3` declared in class `DC2` has type `ConverterClass` but is used as type `bytes`. +dataclasses_transform_converter.py:119:0 Incompatible attribute type [8]: Attribute `field3` declared in class `DC2` has type `ConverterClass` but is used as type `int`. +dataclasses_transform_converter.py:121:10 Incompatible parameter type [6]: In call `DC2.__init__`, for 1st positional argument, expected `int` but got `str`. +dataclasses_transform_converter.py:121:16 Incompatible parameter type [6]: In call `DC2.__init__`, for 2nd positional argument, expected `int` but got `str`. +dataclasses_transform_converter.py:121:22 Incompatible parameter type [6]: In call `DC2.__init__`, for 3rd positional argument, expected `int` but got `str`. +dataclasses_transform_converter.py:121:28 Incompatible parameter type [6]: In call `DC2.__init__`, for 4th positional argument, expected `ConverterClass` but got `str`. +dataclasses_transform_converter.py:121:34 Incompatible parameter type [6]: In call `DC2.__init__`, for 5th positional argument, expected `int` but got `str`. +dataclasses_transform_converter.py:121:39 Incompatible parameter type [6]: In call `DC2.__init__`, for 6th positional argument, expected `Dict[str, str]` but got `Tuple[Tuple[str, str], Tuple[str, str]]`. +dataclasses_transform_converter.py:130:58 Incompatible parameter type [6]: In call `model_field`, for argument `default`, expected `Optional[Variable[S]]` but got `int`. +dataclasses_transform_converter.py:133:58 Incompatible parameter type [6]: In call `model_field`, for argument `default_factory`, expected `Optional[typing.Callable[[], Variable[S]]]` but got `Type[int]`. """ diff --git a/conformance/results/pyre/generics_typevartuple_basic.toml b/conformance/results/pyre/generics_typevartuple_basic.toml index 73053837f..8964996ac 100644 --- a/conformance/results/pyre/generics_typevartuple_basic.toml +++ b/conformance/results/pyre/generics_typevartuple_basic.toml @@ -66,7 +66,6 @@ Line 36: Unexpected errors ['generics_typevartuple_basic.py:36:0 Incompatible va Line 37: Unexpected errors ['generics_typevartuple_basic.py:37:0 Incompatible variable type [9]: v2 is declared to have type `Array[]` but is used as type `Array`.', 'generics_typevartuple_basic.py:37:4 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.', 'generics_typevartuple_basic.py:37:40 Incompatible parameter type [6]: In call `Array.__init__`, for 1st positional argument, expected `Tuple[]` but got `Tuple[Batch, Height, Width]`. Expected has length 1, but actual has length 3.'] Line 38: Unexpected errors ['generics_typevartuple_basic.py:38:0 Incompatible variable type [9]: v3 is declared to have type `Array[]` but is used as type `Array`.', 'generics_typevartuple_basic.py:38:4 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.'] Line 39: Unexpected errors ['generics_typevartuple_basic.py:39:4 Incompatible parameter type [6]: In call `Array.__init__`, for 1st positional argument, expected `Tuple[]` but got `Tuple[Time, Batch, Height, Width]`. Expected has length 1, but actual has length 4.'] -Line 45: Unexpected errors ['generics_typevartuple_basic.py:45:4 Incompatible parameter type [6]: In call `Array.__init__`, for 1st positional argument, expected `Tuple[]` but got `Tuple[Time, Batch, Width, Height]`. Expected has length 1, but actual has length 4.'] Line 54: Unexpected errors ['generics_typevartuple_basic.py:54:21 Invalid type [31]: Expression `tuple[(*Shape)]` is not a valid type.'] Line 75: Unexpected errors ['generics_typevartuple_basic.py:75:16 Invalid type [31]: Expression `tuple[(*Ts)]` is not a valid type.', 'generics_typevartuple_basic.py:75:34 Invalid type [31]: Expression `tuple[(*Ts)]` is not a valid type.', 'generics_typevartuple_basic.py:75:49 Invalid type [31]: Expression `tuple[(*Ts)]` is not a valid type.'] Line 93: Unexpected errors ['generics_typevartuple_basic.py:93:16 Invalid type [31]: Expression `generics_typevartuple_basic.Array[(*Shape)]` is not a valid type.', 'generics_typevartuple_basic.py:93:16 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.', 'generics_typevartuple_basic.py:93:34 Invalid type [31]: Expression `generics_typevartuple_basic.Array[(*Shape)]` is not a valid type.', 'generics_typevartuple_basic.py:93:34 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.', 'generics_typevartuple_basic.py:93:52 Invalid type [31]: Expression `generics_typevartuple_basic.Array[(*Shape)]` is not a valid type.', 'generics_typevartuple_basic.py:93:52 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.'] diff --git a/conformance/results/pyre/version.toml b/conformance/results/pyre/version.toml index 98d9d6eb2..31ee493d9 100644 --- a/conformance/results/pyre/version.toml +++ b/conformance/results/pyre/version.toml @@ -1,2 +1,2 @@ version = "pyre 0.9.22" -test_duration = 3.4 +test_duration = 2.5 diff --git a/conformance/results/pyright/aliases_explicit.toml b/conformance/results/pyright/aliases_explicit.toml index cebb2602c..2d5557190 100644 --- a/conformance/results/pyright/aliases_explicit.toml +++ b/conformance/results/pyright/aliases_explicit.toml @@ -3,9 +3,9 @@ output = """ aliases_explicit.py:67:24 - error: Expected no type arguments for class "int" (reportInvalidTypeArguments) aliases_explicit.py:67:24 - error: Expected no type arguments for class "NoneType" (reportInvalidTypeArguments) aliases_explicit.py:68:9 - error: Type "list[int | None]" is already specialized (reportInvalidTypeArguments) -aliases_explicit.py:69:29 - error: Too many type arguments provided for "GoodTypeAlias4[T@GoodTypeAlias4]"; expected 1 but received 2 -aliases_explicit.py:70:29 - error: Too many type arguments provided for "GoodTypeAlias8[T@GoodTypeAlias8]"; expected 1 but received 2 -aliases_explicit.py:71:24 - error: Expected ParamSpec, ellipsis, or list of types +aliases_explicit.py:69:29 - error: Too many type arguments provided for "GoodTypeAlias4[T@GoodTypeAlias4]"; expected 1 but received 2 (reportInvalidTypeForm) +aliases_explicit.py:70:29 - error: Too many type arguments provided for "GoodTypeAlias8[T@GoodTypeAlias8]"; expected 1 but received 2 (reportInvalidTypeForm) +aliases_explicit.py:71:24 - error: Expected ParamSpec, ellipsis, or list of types (reportInvalidTypeForm) aliases_explicit.py:79:21 - error: Invalid expression form for type alias definition (reportInvalidTypeForm) aliases_explicit.py:79:21 - error: Call expression not allowed in type expression (reportInvalidTypeForm) aliases_explicit.py:80:21 - error: Invalid expression form for type alias definition (reportInvalidTypeForm) diff --git a/conformance/results/pyright/aliases_implicit.toml b/conformance/results/pyright/aliases_implicit.toml index 9c6ffb3c0..fde2e84ca 100644 --- a/conformance/results/pyright/aliases_implicit.toml +++ b/conformance/results/pyright/aliases_implicit.toml @@ -3,12 +3,12 @@ output = """ aliases_implicit.py:76:24 - error: Expected no type arguments for class "int" (reportInvalidTypeArguments) aliases_implicit.py:76:24 - error: Expected no type arguments for class "NoneType" (reportInvalidTypeArguments) aliases_implicit.py:77:9 - error: Type "list[int | None]" is already specialized (reportInvalidTypeArguments) -aliases_implicit.py:78:29 - error: Too many type arguments provided for "GoodTypeAlias4[T@GoodTypeAlias4]"; expected 1 but received 2 -aliases_implicit.py:79:29 - error: Too many type arguments provided for "GoodTypeAlias8[T@GoodTypeAlias8]"; expected 1 but received 2 -aliases_implicit.py:80:24 - error: Expected ParamSpec, ellipsis, or list of types +aliases_implicit.py:78:29 - error: Too many type arguments provided for "GoodTypeAlias4[T@GoodTypeAlias4]"; expected 1 but received 2 (reportInvalidTypeForm) +aliases_implicit.py:79:29 - error: Too many type arguments provided for "GoodTypeAlias8[T@GoodTypeAlias8]"; expected 1 but received 2 (reportInvalidTypeForm) +aliases_implicit.py:80:24 - error: Expected ParamSpec, ellipsis, or list of types (reportInvalidTypeForm) aliases_implicit.py:81:9 - error: Could not specialize type "GoodTypeAlias12[TFloat@GoodTypeAlias12]"   Type "str" is incompatible with type "float" -    "str" is incompatible with "float" +    "str" is incompatible with "float" (reportInvalidTypeForm) aliases_implicit.py:106:9 - error: Variable not allowed in type expression (reportInvalidTypeForm) aliases_implicit.py:107:9 - error: Variable not allowed in type expression (reportInvalidTypeForm) aliases_implicit.py:108:9 - error: Variable not allowed in type expression (reportInvalidTypeForm) diff --git a/conformance/results/pyright/aliases_newtype.toml b/conformance/results/pyright/aliases_newtype.toml index e95cb8ad3..6d46e752d 100644 --- a/conformance/results/pyright/aliases_newtype.toml +++ b/conformance/results/pyright/aliases_newtype.toml @@ -6,7 +6,7 @@ aliases_newtype.py:12:14 - error: Expression of type "Literal[42]" is incompatib   "Literal[42]" is incompatible with "UserId" (reportAssignmentType) aliases_newtype.py:20:16 - error: Second argument to "isinstance" must be a class or tuple of classes   Class created with NewType cannot be used with instance and class checks (reportArgumentType) -aliases_newtype.py:23:21 - error: Base class "UserId" is marked final and cannot be subclassed +aliases_newtype.py:23:21 - error: Base class "UserId" is marked final and cannot be subclassed (reportGeneralTypeIssues) aliases_newtype.py:32:1 - error: NewType must be assigned to a variable with the same name (reportGeneralTypeIssues) aliases_newtype.py:38:19 - error: Expected no type arguments for class "GoodNewType1" (reportInvalidTypeArguments) aliases_newtype.py:44:38 - error: Expected class as second argument to NewType (reportGeneralTypeIssues) diff --git a/conformance/results/pyright/aliases_type_statement.toml b/conformance/results/pyright/aliases_type_statement.toml index 825faaab2..c134a70ef 100644 --- a/conformance/results/pyright/aliases_type_statement.toml +++ b/conformance/results/pyright/aliases_type_statement.toml @@ -6,7 +6,7 @@ aliases_type_statement.py:19:1 - error: Object of type "TypeAliasType" is not ca   Attribute "__call__" is unknown (reportCallIssue) aliases_type_statement.py:23:18 - error: Cannot access attribute "other_attrib" for class "TypeAliasType"   Attribute "other_attrib" is unknown (reportAttributeAccessIssue) -aliases_type_statement.py:26:18 - error: A type alias defined in a "type" statement cannot be used as a base class +aliases_type_statement.py:26:18 - error: A type alias defined in a "type" statement cannot be used as a base class (reportGeneralTypeIssues) aliases_type_statement.py:31:22 - error: Argument of type "TypeAliasType" cannot be assigned to parameter "class_or_tuple" of type "_ClassInfo" in function "isinstance"   Type "TypeAliasType" is incompatible with type "_ClassInfo"     "TypeAliasType" is incompatible with "type" @@ -42,10 +42,10 @@ aliases_type_statement.py:64:23 - error: Type parameter "V" is not included in t aliases_type_statement.py:69:17 - error: Type parameter "T1" is not included in the type parameter list for "TA2" (reportGeneralTypeIssues) aliases_type_statement.py:79:7 - error: Could not specialize type "RecursiveTypeAlias2[S@RecursiveTypeAlias2, T@RecursiveTypeAlias2, P@RecursiveTypeAlias2]"   Type "str" is incompatible with type "int" -    "str" is incompatible with "int" +    "str" is incompatible with "int" (reportInvalidTypeForm) aliases_type_statement.py:81:7 - error: Could not specialize type "RecursiveTypeAlias2[S@RecursiveTypeAlias2, T@RecursiveTypeAlias2, P@RecursiveTypeAlias2]"   Type "int" is incompatible with type "str" -    "int" is incompatible with "str" +    "int" is incompatible with "str" (reportInvalidTypeForm) aliases_type_statement.py:84:28 - error: Type alias "RecursiveTypeAlias3" cannot use itself in its definition (reportGeneralTypeIssues) aliases_type_statement.py:86:31 - error: Type alias "RecursiveTypeAlias4" cannot use itself in its definition (reportGeneralTypeIssues) aliases_type_statement.py:90:28 - error: Type alias "RecursiveTypeAlias6" cannot use itself in its definition (reportGeneralTypeIssues) diff --git a/conformance/results/pyright/aliases_typealiastype.toml b/conformance/results/pyright/aliases_typealiastype.toml index 8b1fda765..dc1e9900f 100644 --- a/conformance/results/pyright/aliases_typealiastype.toml +++ b/conformance/results/pyright/aliases_typealiastype.toml @@ -4,10 +4,10 @@ aliases_typealiastype.py:32:18 - error: Cannot access attribute "other_attrib" f   Attribute "other_attrib" is unknown (reportAttributeAccessIssue) aliases_typealiastype.py:40:5 - error: Could not specialize type "GoodAlias5[S@GoodAlias5, TStr@GoodAlias5, P@GoodAlias5, Ts@GoodAlias5]"   Type "int" is incompatible with type "str" -    "int" is incompatible with "str" +    "int" is incompatible with "str" (reportInvalidTypeForm) aliases_typealiastype.py:43:45 - error: Type variable "S" has no meaning in this context (reportGeneralTypeIssues) aliases_typealiastype.py:44:45 - error: Type variable "S" has no meaning in this context (reportGeneralTypeIssues) -aliases_typealiastype.py:45:57 - error: Type parameter list must be a tuple containing only TypeVar, TypeVarTuple, or ParamSpec +aliases_typealiastype.py:45:57 - error: Type parameter list must be a tuple containing only TypeVar, TypeVarTuple, or ParamSpec (reportGeneralTypeIssues) aliases_typealiastype.py:46:40 - error: Type alias "BadAlias4" cannot use itself in its definition (reportGeneralTypeIssues) aliases_typealiastype.py:47:40 - error: Type alias "BadAlias5" cannot use itself in its definition (reportGeneralTypeIssues) aliases_typealiastype.py:48:40 - error: Type alias "BadAlias6" cannot use itself in its definition (reportGeneralTypeIssues) diff --git a/conformance/results/pyright/aliases_variance.toml b/conformance/results/pyright/aliases_variance.toml index 4536540fb..b653968e9 100644 --- a/conformance/results/pyright/aliases_variance.toml +++ b/conformance/results/pyright/aliases_variance.toml @@ -3,11 +3,11 @@ output = """ aliases_variance.py:24:23 - error: Type "T_co@ClassA_1" cannot be assigned to type variable "T@ClassA"   Variance of type argument "T_co@ClassA_1" is incompatible with base class "ClassA" (reportInvalidTypeArguments) aliases_variance.py:28:26 - error: Could not specialize type "A_Alias_1[T_co@A_Alias_1]" -  Variance of type argument "T_co@ClassA_2" is incompatible with "T_co@A_Alias_1" +  Variance of type argument "T_co@ClassA_2" is incompatible with "T_co@A_Alias_1" (reportInvalidTypeForm) aliases_variance.py:32:26 - error: Could not specialize type "A_Alias_2[T_co@A_Alias_2]" -  Variance of type argument "T_co@ClassA_3" is incompatible with "T_co@A_Alias_2" +  Variance of type argument "T_co@ClassA_3" is incompatible with "T_co@A_Alias_2" (reportInvalidTypeForm) aliases_variance.py:44:26 - error: Could not specialize type "B_Alias_1[T_co@B_Alias_1, T_contra@B_Alias_1]" -  Variance of type argument "T_contra@ClassB_1" is incompatible with "T_co@B_Alias_1" +  Variance of type argument "T_contra@ClassB_1" is incompatible with "T_co@B_Alias_1" (reportInvalidTypeForm) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/callables_annotation.toml b/conformance/results/pyright/callables_annotation.toml index b228ecf40..8da8432a5 100644 --- a/conformance/results/pyright/callables_annotation.toml +++ b/conformance/results/pyright/callables_annotation.toml @@ -6,12 +6,12 @@ callables_annotation.py:26:11 - error: Argument of type "Literal[2]" cannot be a callables_annotation.py:27:15 - error: Expected 2 positional arguments (reportCallIssue) callables_annotation.py:29:10 - error: Expected 2 more positional arguments (reportCallIssue) callables_annotation.py:35:8 - error: Expected 0 positional arguments (reportCallIssue) -callables_annotation.py:55:14 - error: Expected parameter type list or "..." -callables_annotation.py:56:14 - error: Expected parameter type list or "..." -callables_annotation.py:57:18 - error: List expression not allowed for this type argument -callables_annotation.py:58:14 - error: Expected parameter type list or "..." -callables_annotation.py:58:24 - error: Expected only two type arguments to "Callable" -callables_annotation.py:59:15 - error: "..." is not allowed in this context +callables_annotation.py:55:14 - error: Expected parameter type list or "..." (reportInvalidTypeForm) +callables_annotation.py:56:14 - error: Expected parameter type list or "..." (reportInvalidTypeForm) +callables_annotation.py:57:18 - error: List expression not allowed for this type argument (reportInvalidTypeForm) +callables_annotation.py:58:14 - error: Expected parameter type list or "..." (reportInvalidTypeForm) +callables_annotation.py:58:24 - error: Expected only two type arguments to "Callable" (reportInvalidTypeForm) +callables_annotation.py:59:15 - error: "..." is not allowed in this context (reportInvalidTypeForm) callables_annotation.py:91:7 - error: Expression of type "() -> str" is incompatible with declared type "(int, ...) -> str"   Type "() -> str" is incompatible with type "(int, ...) -> str"     Function accepts too many positional parameters; expected 0 but received 2 (reportAssignmentType) diff --git a/conformance/results/pyright/classes_classvar.toml b/conformance/results/pyright/classes_classvar.toml index 641aa6973..f18dfc60e 100644 --- a/conformance/results/pyright/classes_classvar.toml +++ b/conformance/results/pyright/classes_classvar.toml @@ -1,20 +1,20 @@ conformant = "Pass" output = """ -classes_classvar.py:38:25 - error: Expected only one type argument after "ClassVar" +classes_classvar.py:38:25 - error: Expected only one type argument after "ClassVar" (reportInvalidTypeForm) classes_classvar.py:39:14 - error: Expected class but received "Literal[3]" (reportGeneralTypeIssues) classes_classvar.py:40:14 - error: "var" is not defined (reportUndefinedVariable) classes_classvar.py:45:20 - error: "ClassVar" type cannot include type variables (reportGeneralTypeIssues) classes_classvar.py:46:20 - error: "ClassVar" type cannot include type variables (reportGeneralTypeIssues) classes_classvar.py:47:20 - error: "ClassVar" type cannot include type variables (reportGeneralTypeIssues) classes_classvar.py:52:33 - error: Expression of type "dict[Any, Any]" is incompatible with declared type "list[str]" (reportAssignmentType) -classes_classvar.py:54:17 - error: "ClassVar" is not allowed in this context -classes_classvar.py:55:17 - error: "ClassVar" is not allowed in this context -classes_classvar.py:63:26 - error: "ClassVar" is not allowed in this context -classes_classvar.py:64:12 - error: "ClassVar" is not allowed in this context -classes_classvar.py:65:18 - error: "ClassVar" is not allowed in this context -classes_classvar.py:67:26 - error: "ClassVar" is not allowed in this context -classes_classvar.py:71:8 - error: "ClassVar" is not allowed in this context -classes_classvar.py:72:20 - error: "ClassVar" is not allowed in this context +classes_classvar.py:54:17 - error: "ClassVar" is not allowed in this context (reportInvalidTypeForm) +classes_classvar.py:55:17 - error: "ClassVar" is not allowed in this context (reportInvalidTypeForm) +classes_classvar.py:63:26 - error: "ClassVar" is not allowed in this context (reportInvalidTypeForm) +classes_classvar.py:64:12 - error: "ClassVar" is not allowed in this context (reportInvalidTypeForm) +classes_classvar.py:65:18 - error: "ClassVar" is not allowed in this context (reportInvalidTypeForm) +classes_classvar.py:67:26 - error: "ClassVar" is not allowed in this context (reportInvalidTypeForm) +classes_classvar.py:71:8 - error: "ClassVar" is not allowed in this context (reportInvalidTypeForm) +classes_classvar.py:72:20 - error: "ClassVar" is not allowed in this context (reportInvalidTypeForm) classes_classvar.py:105:14 - error: Cannot assign to attribute "stats" for class "Starship"   Attribute "stats" cannot be assigned through a class instance because it is a ClassVar     Attribute "__set__" is unknown (reportAttributeAccessIssue) diff --git a/conformance/results/pyright/constructors_call_init.toml b/conformance/results/pyright/constructors_call_init.toml index dc74b3f90..948899c05 100644 --- a/conformance/results/pyright/constructors_call_init.toml +++ b/conformance/results/pyright/constructors_call_init.toml @@ -5,10 +5,10 @@ errors_diff = """ output = """ constructors_call_init.py:21:13 - error: Argument of type "float" cannot be assigned to parameter "x" of type "int" in function "__init__"   "float" is incompatible with "int" (reportArgumentType) -constructors_call_init.py:42:8 - error: Argument of type "Class2[Unknown]" cannot be assigned to parameter "x" of type "Class3 | None" in function "__init__" -  Type "Class2[Unknown]" is incompatible with type "Class3 | None" -    "Class2[Unknown]" is incompatible with "Class3" -    "Class2[Unknown]" is incompatible with "None" (reportArgumentType) +constructors_call_init.py:42:8 - error: Argument of type "Class2[int]" cannot be assigned to parameter "x" of type "Class3 | None" in function "__init__" +  Type "Class2[int]" is incompatible with type "Class3 | None" +    "Class2[int]" is incompatible with "Class3" +    "Class2[int]" is incompatible with "None" (reportArgumentType) constructors_call_init.py:56:1 - error:   Could not bind method "__init__" because "Class4[str]" is not assignable to parameter "self"     "Class4[str]" is incompatible with "Class4[int]" diff --git a/conformance/results/pyright/constructors_consistency.toml b/conformance/results/pyright/constructors_consistency.toml index e9fee5022..b335fa1ce 100644 --- a/conformance/results/pyright/constructors_consistency.toml +++ b/conformance/results/pyright/constructors_consistency.toml @@ -3,7 +3,7 @@ errors_diff = """ """ output = """ constructors_consistency.py:25:9 - error: Mismatch between signature of __new__ and __init__ in class "Class1" -  Signature of __init__ is "(x: str)" -  Signature of __new__ is "()" (reportInconsistentConstructor) +  Signature of __init__ is "(x: str) -> None" +  Signature of __new__ is "() -> Class1" (reportInconsistentConstructor) """ conformance_automated = "Pass" diff --git a/conformance/results/pyright/dataclasses_transform_converter.toml b/conformance/results/pyright/dataclasses_transform_converter.toml index 9f1780b36..ec34af35b 100644 --- a/conformance/results/pyright/dataclasses_transform_converter.toml +++ b/conformance/results/pyright/dataclasses_transform_converter.toml @@ -1,77 +1,44 @@ -conformant = "Unsupported" -notes = """ -Converter parameter not yet supported. -""" -conformance_automated = "Fail" +conformant = "Pass" +conformance_automated = "Pass" errors_diff = """ -Line 47: Expected 1 errors -Line 48: Expected 1 errors -Line 117: Expected 1 errors -Line 129: Expected 1 errors -Line 132: Expected 1 errors -Line 111: Unexpected errors ['dataclasses_transform_converter.py:111:11 - error: Argument of type "Literal[\\'f0\\']" cannot be assigned to parameter "field0" of type "int" in function "__init__"', 'dataclasses_transform_converter.py:111:17 - error: Argument of type "Literal[\\'f1\\']" cannot be assigned to parameter "field1" of type "int" in function "__init__"', 'dataclasses_transform_converter.py:111:23 - error: Argument of type "Literal[\\'f2\\']" cannot be assigned to parameter "field2" of type "int" in function "__init__"', 'dataclasses_transform_converter.py:111:29 - error: Argument of type "Literal[b"f6"]" cannot be assigned to parameter "field3" of type "ConverterClass" in function "__init__"', 'dataclasses_transform_converter.py:111:36 - error: Argument of type "list[Any]" cannot be assigned to parameter "field4" of type "int" in function "__init__"'] -Line 113: Unexpected errors ['dataclasses_transform_converter.py:113:14 - error: Cannot assign to attribute "field0" for class "DC2"'] -Line 114: Unexpected errors ['dataclasses_transform_converter.py:114:14 - error: Cannot assign to attribute "field3" for class "DC2"'] -Line 115: Unexpected errors ['dataclasses_transform_converter.py:115:14 - error: Cannot assign to attribute "field3" for class "DC2"'] -Line 120: Unexpected errors ['dataclasses_transform_converter.py:120:11 - error: Argument of type "Literal[\\'f0\\']" cannot be assigned to parameter "field0" of type "int" in function "__init__"', 'dataclasses_transform_converter.py:120:17 - error: Argument of type "Literal[\\'f1\\']" cannot be assigned to parameter "field1" of type "int" in function "__init__"', 'dataclasses_transform_converter.py:120:23 - error: Argument of type "Literal[\\'f2\\']" cannot be assigned to parameter "field2" of type "int" in function "__init__"', 'dataclasses_transform_converter.py:120:29 - error: Argument of type "Literal[\\'f6\\']" cannot be assigned to parameter "field3" of type "ConverterClass" in function "__init__"', 'dataclasses_transform_converter.py:120:35 - error: Argument of type "Literal[\\'1\\']" cannot be assigned to parameter "field4" of type "int" in function "__init__"', 'dataclasses_transform_converter.py:120:40 - error: Argument of type "tuple[tuple[str, str], tuple[str, str]]" cannot be assigned to parameter "field5" of type "dict[str, str]" in function "__init__"'] """ output = """ -dataclasses_transform_converter.py:106:8 - error: Argument of type "Literal['f1']" cannot be assigned to parameter "field1" of type "int" in function "__init__" -  "Literal['f1']" is incompatible with "int" (reportArgumentType) -dataclasses_transform_converter.py:106:14 - error: Argument of type "Literal['f2']" cannot be assigned to parameter "field2" of type "int" in function "__init__" -  "Literal['f2']" is incompatible with "int" (reportArgumentType) -dataclasses_transform_converter.py:106:20 - error: Argument of type "Literal[b"f3"]" cannot be assigned to parameter "field3" of type "ConverterClass" in function "__init__" -  "Literal[b"f3"]" is incompatible with "ConverterClass" (reportArgumentType) -dataclasses_transform_converter.py:106:27 - error: Argument of type "list[Any]" cannot be assigned to parameter "field4" of type "int" in function "__init__" -  "list[Any]" is incompatible with "int" (reportArgumentType) -dataclasses_transform_converter.py:107:5 - error: Argument of type "Literal['f0']" cannot be assigned to parameter "field0" of type "int" in function "__init__" -  "Literal['f0']" is incompatible with "int" (reportArgumentType) -dataclasses_transform_converter.py:107:11 - error: Argument of type "Literal['f1']" cannot be assigned to parameter "field1" of type "int" in function "__init__" -  "Literal['f1']" is incompatible with "int" (reportArgumentType) -dataclasses_transform_converter.py:107:17 - error: Argument of type "Literal['f2']" cannot be assigned to parameter "field2" of type "int" in function "__init__" -  "Literal['f2']" is incompatible with "int" (reportArgumentType) -dataclasses_transform_converter.py:107:23 - error: Argument of type "Literal[1]" cannot be assigned to parameter "field3" of type "ConverterClass" in function "__init__" -  "Literal[1]" is incompatible with "ConverterClass" (reportArgumentType) -dataclasses_transform_converter.py:107:26 - error: Argument of type "list[Any]" cannot be assigned to parameter "field4" of type "int" in function "__init__" -  "list[Any]" is incompatible with "int" (reportArgumentType) -dataclasses_transform_converter.py:108:5 - error: Argument of type "Literal['f0']" cannot be assigned to parameter "field0" of type "int" in function "__init__" -  "Literal['f0']" is incompatible with "int" (reportArgumentType) -dataclasses_transform_converter.py:108:11 - error: Argument of type "Literal['f1']" cannot be assigned to parameter "field1" of type "int" in function "__init__" -  "Literal['f1']" is incompatible with "int" (reportArgumentType) -dataclasses_transform_converter.py:108:17 - error: Argument of type "Literal['f2']" cannot be assigned to parameter "field2" of type "int" in function "__init__" -  "Literal['f2']" is incompatible with "int" (reportArgumentType) -dataclasses_transform_converter.py:108:23 - error: Argument of type "Literal['f3']" cannot be assigned to parameter "field3" of type "ConverterClass" in function "__init__" -  "Literal['f3']" is incompatible with "ConverterClass" (reportArgumentType) -dataclasses_transform_converter.py:108:29 - error: Argument of type "complex" cannot be assigned to parameter "field4" of type "int" in function "__init__" -  "complex" is incompatible with "int" (reportArgumentType) -dataclasses_transform_converter.py:111:11 - error: Argument of type "Literal['f0']" cannot be assigned to parameter "field0" of type "int" in function "__init__" -  "Literal['f0']" is incompatible with "int" (reportArgumentType) -dataclasses_transform_converter.py:111:17 - error: Argument of type "Literal['f1']" cannot be assigned to parameter "field1" of type "int" in function "__init__" -  "Literal['f1']" is incompatible with "int" (reportArgumentType) -dataclasses_transform_converter.py:111:23 - error: Argument of type "Literal['f2']" cannot be assigned to parameter "field2" of type "int" in function "__init__" -  "Literal['f2']" is incompatible with "int" (reportArgumentType) -dataclasses_transform_converter.py:111:29 - error: Argument of type "Literal[b"f6"]" cannot be assigned to parameter "field3" of type "ConverterClass" in function "__init__" -  "Literal[b"f6"]" is incompatible with "ConverterClass" (reportArgumentType) -dataclasses_transform_converter.py:111:36 - error: Argument of type "list[Any]" cannot be assigned to parameter "field4" of type "int" in function "__init__" -  "list[Any]" is incompatible with "int" (reportArgumentType) -dataclasses_transform_converter.py:113:14 - error: Cannot assign to attribute "field0" for class "DC2" -  "Literal['f1']" is incompatible with "int" (reportAttributeAccessIssue) -dataclasses_transform_converter.py:114:14 - error: Cannot assign to attribute "field3" for class "DC2" -  "Literal['f6']" is incompatible with "ConverterClass" (reportAttributeAccessIssue) -dataclasses_transform_converter.py:115:14 - error: Cannot assign to attribute "field3" for class "DC2" -  "Literal[b"f6"]" is incompatible with "ConverterClass" (reportAttributeAccessIssue) -dataclasses_transform_converter.py:118:14 - error: Cannot assign to attribute "field3" for class "DC2" -  "Literal[1]" is incompatible with "ConverterClass" (reportAttributeAccessIssue) -dataclasses_transform_converter.py:120:11 - error: Argument of type "Literal['f0']" cannot be assigned to parameter "field0" of type "int" in function "__init__" -  "Literal['f0']" is incompatible with "int" (reportArgumentType) -dataclasses_transform_converter.py:120:17 - error: Argument of type "Literal['f1']" cannot be assigned to parameter "field1" of type "int" in function "__init__" -  "Literal['f1']" is incompatible with "int" (reportArgumentType) -dataclasses_transform_converter.py:120:23 - error: Argument of type "Literal['f2']" cannot be assigned to parameter "field2" of type "int" in function "__init__" -  "Literal['f2']" is incompatible with "int" (reportArgumentType) -dataclasses_transform_converter.py:120:29 - error: Argument of type "Literal['f6']" cannot be assigned to parameter "field3" of type "ConverterClass" in function "__init__" -  "Literal['f6']" is incompatible with "ConverterClass" (reportArgumentType) -dataclasses_transform_converter.py:120:35 - error: Argument of type "Literal['1']" cannot be assigned to parameter "field4" of type "int" in function "__init__" -  "Literal['1']" is incompatible with "int" (reportArgumentType) -dataclasses_transform_converter.py:120:40 - error: Argument of type "tuple[tuple[str, str], tuple[str, str]]" cannot be assigned to parameter "field5" of type "dict[str, str]" in function "__init__" -  "tuple[tuple[str, str], tuple[str, str]]" is incompatible with "dict[str, str]" (reportArgumentType) +dataclasses_transform_converter.py:48:31 - error: Argument of type "() -> int" is not a valid converter for field "field1" of type "int" +  Type "() -> int" is incompatible with type "(__converterInput) -> int" +    Function accepts too many positional parameters; expected 0 but received 1 (reportGeneralTypeIssues) +dataclasses_transform_converter.py:48:41 - error: Argument of type "() -> int" cannot be assigned to parameter "converter" of type "(S@model_field) -> T@model_field" in function "model_field" +  Type "() -> int" is incompatible with type "(S@model_field) -> int" +    Function accepts too many positional parameters; expected 0 but received 1 (reportArgumentType) +dataclasses_transform_converter.py:49:31 - error: Argument of type "(*, x: int) -> int" is not a valid converter for field "field2" of type "int" +  Type "(*, x: int) -> int" is incompatible with type "(__converterInput) -> int" +    Function accepts too many positional parameters; expected 0 but received 1 +      Extra parameter "x" (reportGeneralTypeIssues) +dataclasses_transform_converter.py:49:41 - error: Argument of type "(*, x: int) -> int" cannot be assigned to parameter "converter" of type "(S@model_field) -> T@model_field" in function "model_field" +  Type "(*, x: int) -> int" is incompatible with type "(S@model_field) -> int" +    Function accepts too many positional parameters; expected 0 but received 1 +      Extra parameter "x" (reportArgumentType) +dataclasses_transform_converter.py:107:5 - error: Argument of type "Literal[1]" cannot be assigned to parameter "field0" of type "str" in function "__init__" +  "Literal[1]" is incompatible with "str" (reportArgumentType) +dataclasses_transform_converter.py:108:23 - error: Argument of type "Literal[1]" cannot be assigned to parameter "field3" of type "str | bytes" in function "__init__" +  Type "Literal[1]" is incompatible with type "str | bytes" +    "Literal[1]" is incompatible with "str" +    "Literal[1]" is incompatible with "bytes" (reportArgumentType) +dataclasses_transform_converter.py:109:29 - error: Argument of type "complex" cannot be assigned to parameter "field4" of type "str | list[str]" in function "__init__" +  Type "complex" is incompatible with type "str | list[str]" +    "complex" is incompatible with "str" +    "complex" is incompatible with "list[str]" (reportArgumentType) +dataclasses_transform_converter.py:118:14 - error: Cannot assign to attribute "field0" for class "DC2" +  "Literal[1]" is incompatible with "str" (reportAttributeAccessIssue) +dataclasses_transform_converter.py:119:14 - error: Cannot assign to attribute "field3" for class "DC2" +  Type "Literal[1]" is incompatible with type "str | bytes" +    "Literal[1]" is incompatible with "str" +    "Literal[1]" is incompatible with "bytes" (reportAttributeAccessIssue) +dataclasses_transform_converter.py:130:67 - error: Argument of type "Literal[1]" cannot be assigned to parameter "default" of type "S@model_field | None" in function "model_field" +  Type "Literal[1]" is incompatible with type "str | None" +    "Literal[1]" is incompatible with "str" +    "Literal[1]" is incompatible with "None" (reportArgumentType) +dataclasses_transform_converter.py:133:75 - error: Argument of type "type[int]" cannot be assigned to parameter "default_factory" of type "(() -> S@model_field) | None" in function "model_field" +  Type "type[int]" is incompatible with type "(() -> str) | None" +    No overloaded function matches type "() -> str" +    "type[type]" is incompatible with "type[None]" (reportArgumentType) """ diff --git a/conformance/results/pyright/directives_assert_type.toml b/conformance/results/pyright/directives_assert_type.toml index 993dfb73d..9c37b0b04 100644 --- a/conformance/results/pyright/directives_assert_type.toml +++ b/conformance/results/pyright/directives_assert_type.toml @@ -3,9 +3,9 @@ output = """ directives_assert_type.py:27:17 - error: "assert_type" mismatch: expected "int" but received "int | str" (reportAssertTypeFailure) directives_assert_type.py:28:17 - error: "assert_type" mismatch: expected "int" but received "Any" (reportAssertTypeFailure) directives_assert_type.py:29:17 - error: "assert_type" mismatch: expected "int" but received "Literal[4]" (reportAssertTypeFailure) -directives_assert_type.py:31:5 - error: "assert_type" expects two positional arguments +directives_assert_type.py:31:5 - error: "assert_type" expects two positional arguments (reportCallIssue) directives_assert_type.py:32:17 - error: "assert_type" mismatch: expected "int" but received "Literal['']" (reportAssertTypeFailure) -directives_assert_type.py:33:5 - error: "assert_type" expects two positional arguments +directives_assert_type.py:33:5 - error: "assert_type" expects two positional arguments (reportCallIssue) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/directives_reveal_type.toml b/conformance/results/pyright/directives_reveal_type.toml index 679849716..8f427c3b3 100644 --- a/conformance/results/pyright/directives_reveal_type.toml +++ b/conformance/results/pyright/directives_reveal_type.toml @@ -4,8 +4,8 @@ directives_reveal_type.py:14:17 - information: Type of "a" is "int | str" directives_reveal_type.py:15:17 - information: Type of "b" is "list[int]" directives_reveal_type.py:16:17 - information: Type of "c" is "Any" directives_reveal_type.py:17:17 - information: Type of "d" is "ForwardReference" -directives_reveal_type.py:19:5 - error: Expected a single positional argument for "reveal_type" call -directives_reveal_type.py:20:5 - error: Expected a single positional argument for "reveal_type" call +directives_reveal_type.py:19:5 - error: Expected a single positional argument for "reveal_type" call (reportCallIssue) +directives_reveal_type.py:20:5 - error: Expected a single positional argument for "reveal_type" call (reportCallIssue) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/enums_members.toml b/conformance/results/pyright/enums_members.toml index ef78691b0..54a2c1b82 100644 --- a/conformance/results/pyright/enums_members.toml +++ b/conformance/results/pyright/enums_members.toml @@ -12,20 +12,20 @@ enums_members.py:19:11 - error: Argument missing for parameter "species" (report enums_members.py:20:11 - error: Argument missing for parameter "species" (reportCallIssue) enums_members.py:50:5 - error: Type annotations are not allowed for enum members (reportGeneralTypeIssues) enums_members.py:82:13 - error: "assert_type" mismatch: expected "Unknown" but received "(x: Unknown) -> str" (reportAssertTypeFailure) -enums_members.py:82:37 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value +enums_members.py:82:37 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) enums_members.py:82:42 - error: Variable not allowed in type expression (reportInvalidTypeForm) enums_members.py:83:13 - error: "assert_type" mismatch: expected "Unknown" but received "(x: int) -> int" (reportAssertTypeFailure) -enums_members.py:83:37 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value +enums_members.py:83:37 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) enums_members.py:83:42 - error: Variable not allowed in type expression (reportInvalidTypeForm) enums_members.py:84:13 - error: "assert_type" mismatch: expected "Unknown" but received "property" (reportAssertTypeFailure) -enums_members.py:84:35 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value +enums_members.py:84:35 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) enums_members.py:85:13 - error: "assert_type" mismatch: expected "Unknown" but received "(self: Pet4) -> None" (reportAssertTypeFailure) -enums_members.py:85:33 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value +enums_members.py:85:33 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) enums_members.py:116:13 - error: "assert_type" mismatch: expected "Unknown" but received "int" (reportAssertTypeFailure) -enums_members.py:116:32 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value +enums_members.py:116:32 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) enums_members.py:128:21 - information: Type of "Example2.__B" is "Literal[2]" enums_members.py:129:21 - error: "assert_type" mismatch: expected "Unknown" but received "Literal[2]" (reportAssertTypeFailure) -enums_members.py:129:43 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value +enums_members.py:129:43 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) enums_members.py:129:52 - error: Variable not allowed in type expression (reportInvalidTypeForm) enums_members.py:146:13 - error: "assert_type" mismatch: expected "int" but received "Literal[Pet5.DOG]" (reportAssertTypeFailure) enums_members.py:147:13 - error: "assert_type" mismatch: expected "int" but received "Literal[Pet5.FISH]" (reportAssertTypeFailure) diff --git a/conformance/results/pyright/generics_base_class.toml b/conformance/results/pyright/generics_base_class.toml index 806c4b0f9..a008e5e3f 100644 --- a/conformance/results/pyright/generics_base_class.toml +++ b/conformance/results/pyright/generics_base_class.toml @@ -5,11 +5,11 @@ generics_base_class.py:26:26 - error: Argument of type "SymbolTable" cannot be a     Type parameter "_VT@dict" is invariant, but "list[Node]" is not the same as "list[object]"     Consider switching from "dict" to "Mapping" which is covariant in the value type (reportArgumentType) generics_base_class.py:29:14 - error: "Generic" is not valid in this context (reportGeneralTypeIssues) -generics_base_class.py:30:8 - error: "Generic" requires at least one type argument +generics_base_class.py:30:8 - error: "Generic" requires at least one type argument (reportInvalidTypeForm) generics_base_class.py:30:8 - error: "Generic" is not valid in this context (reportGeneralTypeIssues) generics_base_class.py:49:38 - error: Too many type arguments provided for "LinkedList"; expected 1 but received 2 (reportInvalidTypeArguments) generics_base_class.py:61:30 - error: Too many type arguments provided for "MyDict"; expected 1 but received 2 (reportInvalidTypeArguments) -generics_base_class.py:68:28 - error: Type arguments for "Generic" must be unique +generics_base_class.py:68:28 - error: Type arguments for "Generic" must be unique (reportInvalidTypeForm) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/generics_basic.toml b/conformance/results/pyright/generics_basic.toml index b18ae527c..b57456ed3 100644 --- a/conformance/results/pyright/generics_basic.toml +++ b/conformance/results/pyright/generics_basic.toml @@ -5,10 +5,10 @@ generics_basic.py:40:15 - error: Argument of type "bytes" cannot be assigned to generics_basic.py:41:15 - error: Argument of type "str" cannot be assigned to parameter "y" of type "AnyStr@concat" in function "concat"   "str" is incompatible with "bytes" (reportArgumentType) generics_basic.py:49:44 - error: TypeVar must have at least two constrained types (reportGeneralTypeIssues) -generics_basic.py:55:53 - error: TypeVar constraint type cannot be generic +generics_basic.py:55:53 - error: TypeVar constraint type cannot be generic (reportGeneralTypeIssues) generics_basic.py:69:15 - error: Argument of type "bytes" cannot be assigned to parameter "y" of type "AnyStr@concat" in function "concat"   "bytes" is incompatible with "str" (reportArgumentType) -generics_basic.py:121:24 - error: Type arguments for "Generic" must be unique +generics_basic.py:121:24 - error: Type arguments for "Generic" must be unique (reportInvalidTypeForm) generics_basic.py:157:5 - error: Argument of type "Literal[0]" cannot be assigned to parameter "key" of type "str" in function "__getitem__"   "Literal[0]" is incompatible with "str" (reportArgumentType) generics_basic.py:158:5 - error: Argument of type "Literal[0]" cannot be assigned to parameter "key" of type "str" in function "__getitem__" diff --git a/conformance/results/pyright/generics_defaults_specialization.toml b/conformance/results/pyright/generics_defaults_specialization.toml index 1c8691026..c7ba75826 100644 --- a/conformance/results/pyright/generics_defaults_specialization.toml +++ b/conformance/results/pyright/generics_defaults_specialization.toml @@ -1,6 +1,6 @@ conformant = "Pass" output = """ -generics_defaults_specialization.py:30:15 - error: Too many type arguments provided for "MyAlias[DefaultStrT@MyAlias]"; expected 1 but received 2 +generics_defaults_specialization.py:30:15 - error: Too many type arguments provided for "MyAlias[DefaultStrT@MyAlias]"; expected 1 but received 2 (reportInvalidTypeForm) generics_defaults_specialization.py:55:5 - error: Expected no type arguments for class "Foo" (reportInvalidTypeArguments) """ conformance_automated = "Pass" diff --git a/conformance/results/pyright/generics_paramspec_basic.toml b/conformance/results/pyright/generics_paramspec_basic.toml index 4a0c2b7a5..4a4eed99a 100644 --- a/conformance/results/pyright/generics_paramspec_basic.toml +++ b/conformance/results/pyright/generics_paramspec_basic.toml @@ -1,15 +1,15 @@ conformant = "Pass" output = """ -generics_paramspec_basic.py:10:1 - error: ParamSpec must be assigned to a variable named "NotIt" -generics_paramspec_basic.py:15:18 - error: ParamSpec is not allowed in this context -generics_paramspec_basic.py:23:14 - error: ParamSpec is not allowed in this context -generics_paramspec_basic.py:23:20 - error: ParamSpec is not allowed in this context -generics_paramspec_basic.py:27:14 - error: "Concatenate" is not allowed in this context +generics_paramspec_basic.py:10:1 - error: ParamSpec must be assigned to a variable named "NotIt" (reportGeneralTypeIssues) +generics_paramspec_basic.py:15:18 - error: ParamSpec is not allowed in this context (reportInvalidTypeForm) +generics_paramspec_basic.py:23:14 - error: ParamSpec is not allowed in this context (reportInvalidTypeForm) +generics_paramspec_basic.py:23:20 - error: ParamSpec is not allowed in this context (reportInvalidTypeForm) +generics_paramspec_basic.py:27:14 - error: "Concatenate" is not allowed in this context (reportInvalidTypeForm) generics_paramspec_basic.py:31:19 - error: Type "P@func3" cannot be assigned to type variable "_T@list"   ParamSpec is not allowed in this context (reportInvalidTypeArguments) -generics_paramspec_basic.py:35:35 - error: ParamSpec is not allowed in this context -generics_paramspec_basic.py:39:18 - error: ParamSpec is not allowed in this context -generics_paramspec_basic.py:39:31 - error: ParamSpec is not allowed in this context +generics_paramspec_basic.py:35:35 - error: ParamSpec is not allowed in this context (reportInvalidTypeForm) +generics_paramspec_basic.py:39:18 - error: ParamSpec is not allowed in this context (reportInvalidTypeForm) +generics_paramspec_basic.py:39:31 - error: ParamSpec is not allowed in this context (reportInvalidTypeForm) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/generics_paramspec_components.toml b/conformance/results/pyright/generics_paramspec_components.toml index cb85d165d..19def1687 100644 --- a/conformance/results/pyright/generics_paramspec_components.toml +++ b/conformance/results/pyright/generics_paramspec_components.toml @@ -1,21 +1,21 @@ conformant = "Pass" output = """ -generics_paramspec_components.py:17:25 - error: "kwargs" attribute of ParamSpec is valid only when used with **kwargs parameter -generics_paramspec_components.py:17:45 - error: "args" attribute of ParamSpec is valid only when used with *args parameter -generics_paramspec_components.py:20:23 - error: "args" attribute of ParamSpec is valid only when used with *args parameter +generics_paramspec_components.py:17:25 - error: "kwargs" attribute of ParamSpec is valid only when used with **kwargs parameter (reportInvalidTypeForm) +generics_paramspec_components.py:17:45 - error: "args" attribute of ParamSpec is valid only when used with *args parameter (reportInvalidTypeForm) +generics_paramspec_components.py:20:23 - error: "args" attribute of ParamSpec is valid only when used with *args parameter (reportInvalidTypeForm) generics_paramspec_components.py:23:28 - error: "args" and "kwargs" attributes of ParamSpec must both appear within a function signature (reportGeneralTypeIssues) -generics_paramspec_components.py:23:46 - error: "args" attribute of ParamSpec is valid only when used with *args parameter +generics_paramspec_components.py:23:46 - error: "args" attribute of ParamSpec is valid only when used with *args parameter (reportInvalidTypeForm) generics_paramspec_components.py:26:28 - error: "args" and "kwargs" attributes of ParamSpec must both appear within a function signature (reportGeneralTypeIssues) generics_paramspec_components.py:30:25 - error: ParamSpec "P" has no meaning in this context (reportGeneralTypeIssues) -generics_paramspec_components.py:35:18 - error: "args" attribute of ParamSpec is valid only when used with *args parameter -generics_paramspec_components.py:36:20 - error: "kwargs" attribute of ParamSpec is valid only when used with **kwargs parameter +generics_paramspec_components.py:35:18 - error: "args" attribute of ParamSpec is valid only when used with *args parameter (reportInvalidTypeForm) +generics_paramspec_components.py:36:20 - error: "kwargs" attribute of ParamSpec is valid only when used with **kwargs parameter (reportInvalidTypeForm) generics_paramspec_components.py:38:26 - error: "args" and "kwargs" attributes of ParamSpec must both appear within a function signature (reportGeneralTypeIssues) generics_paramspec_components.py:41:31 - error: "args" and "kwargs" attributes of ParamSpec must both appear within a function signature (reportGeneralTypeIssues) generics_paramspec_components.py:49:9 - error: Arguments for ParamSpec "P@decorator" are missing (reportCallIssue) -generics_paramspec_components.py:51:11 - error: Expected 0 positional arguments (reportCallIssue) +generics_paramspec_components.py:51:11 - error: Arguments for ParamSpec "P@decorator" are missing (reportCallIssue) generics_paramspec_components.py:60:28 - error: Keyword parameter "s" cannot appear in signature after ParamSpec args parameter (reportGeneralTypeIssues) -generics_paramspec_components.py:70:12 - error: Expected 1 positional argument (reportCallIssue) -generics_paramspec_components.py:72:12 - error: Expected 1 positional argument (reportCallIssue) +generics_paramspec_components.py:70:12 - error: Expected 2 positional arguments (reportCallIssue) +generics_paramspec_components.py:72:12 - error: Expected 2 positional arguments (reportCallIssue) generics_paramspec_components.py:83:19 - error: Expected 1 positional argument (reportCallIssue) generics_paramspec_components.py:98:20 - error: Argument of type "Literal['A']" cannot be assigned to parameter "a" of type "int"   "Literal['A']" is incompatible with "int" (reportArgumentType) diff --git a/conformance/results/pyright/generics_scoping.toml b/conformance/results/pyright/generics_scoping.toml index fc1bd87c1..bb679b438 100644 --- a/conformance/results/pyright/generics_scoping.toml +++ b/conformance/results/pyright/generics_scoping.toml @@ -7,7 +7,7 @@ generics_scoping.py:54:19 - error: Type variable "S" has no meaning in this cont generics_scoping.py:65:29 - error: TypeVar "T" is already in use by an outer scope (reportGeneralTypeIssues) generics_scoping.py:75:24 - error: TypeVar "T" is already in use by an outer scope (reportGeneralTypeIssues) generics_scoping.py:78:17 - error: Type variable "T" has no meaning in this context (reportGeneralTypeIssues) -generics_scoping.py:87:5 - error: Generic type alias within class cannot use bound type variables T +generics_scoping.py:87:5 - error: Generic type alias within class cannot use bound type variables T (reportInvalidTypeForm) generics_scoping.py:94:14 - error: Type variable "T" has no meaning in this context (reportGeneralTypeIssues) generics_scoping.py:95:19 - error: Type variable "T" has no meaning in this context (reportGeneralTypeIssues) generics_scoping.py:96:6 - error: Type variable "T" has no meaning in this context (reportGeneralTypeIssues) diff --git a/conformance/results/pyright/generics_syntax_declarations.toml b/conformance/results/pyright/generics_syntax_declarations.toml index 5d3ab52c1..1d8d11f14 100644 --- a/conformance/results/pyright/generics_syntax_declarations.toml +++ b/conformance/results/pyright/generics_syntax_declarations.toml @@ -4,7 +4,7 @@ generics_syntax_declarations.py:19:17 - error: "Generic" base class cannot be us generics_syntax_declarations.py:27:20 - error: Type arguments are not allowed with Protocol class when using type parameter syntax (reportGeneralTypeIssues) generics_syntax_declarations.py:34:11 - error: Cannot access attribute "is_integer" for class "str*"   Attribute "is_integer" is unknown (reportAttributeAccessIssue) -generics_syntax_declarations.py:46:21 - error: TypeVar constraint type cannot be generic +generics_syntax_declarations.py:46:21 - error: TypeVar constraint type cannot be generic (reportGeneralTypeIssues) generics_syntax_declarations.py:50:17 - error: Expected class but received "list[Unknown]" (reportGeneralTypeIssues) generics_syntax_declarations.py:62:17 - error: TypeVar must have at least two constrained types (reportGeneralTypeIssues) generics_syntax_declarations.py:66:17 - error: TypeVar must have at least two constrained types (reportGeneralTypeIssues) diff --git a/conformance/results/pyright/generics_syntax_infer_variance.toml b/conformance/results/pyright/generics_syntax_infer_variance.toml index 355c321a4..d8bd2bd94 100644 --- a/conformance/results/pyright/generics_syntax_infer_variance.toml +++ b/conformance/results/pyright/generics_syntax_infer_variance.toml @@ -1,7 +1,7 @@ conformant = "Pass" output = """ -generics_syntax_infer_variance.py:15:51 - error: TypeVar cannot be both covariant and contravariant -generics_syntax_infer_variance.py:17:55 - error: TypeVar cannot be both covariant and contravariant +generics_syntax_infer_variance.py:15:51 - error: TypeVar cannot be both covariant and contravariant (reportGeneralTypeIssues) +generics_syntax_infer_variance.py:17:55 - error: TypeVar cannot be both covariant and contravariant (reportGeneralTypeIssues) generics_syntax_infer_variance.py:29:35 - error: Expression of type "ShouldBeCovariant1[float]" is incompatible with declared type "ShouldBeCovariant1[int]"   "ShouldBeCovariant1[float]" is incompatible with "ShouldBeCovariant1[int]"     Type parameter "T@ShouldBeCovariant1" is covariant, but "float" is not a subtype of "int" diff --git a/conformance/results/pyright/generics_syntax_scoping.toml b/conformance/results/pyright/generics_syntax_scoping.toml index 1124df499..4a8f43c6a 100644 --- a/conformance/results/pyright/generics_syntax_scoping.toml +++ b/conformance/results/pyright/generics_syntax_scoping.toml @@ -1,7 +1,7 @@ conformant = "Pass" output = """ -generics_syntax_scoping.py:14:20 - error: TypeVar constraint type cannot be generic -generics_syntax_scoping.py:18:17 - error: TypeVar constraint type cannot be generic +generics_syntax_scoping.py:14:20 - error: TypeVar constraint type cannot be generic (reportGeneralTypeIssues) +generics_syntax_scoping.py:18:17 - error: TypeVar constraint type cannot be generic (reportGeneralTypeIssues) generics_syntax_scoping.py:35:7 - error: "T" is not defined (reportUndefinedVariable) generics_syntax_scoping.py:44:17 - error: "T" is not defined (reportUndefinedVariable) generics_syntax_scoping.py:92:17 - error: TypeVar "T" is already in use by an outer scope (reportGeneralTypeIssues) diff --git a/conformance/results/pyright/generics_typevartuple_basic.toml b/conformance/results/pyright/generics_typevartuple_basic.toml index af03b67e2..473996f4d 100644 --- a/conformance/results/pyright/generics_typevartuple_basic.toml +++ b/conformance/results/pyright/generics_typevartuple_basic.toml @@ -1,21 +1,20 @@ conformant = "Pass" output = """ generics_typevartuple_basic.py:42:34 - error: Argument of type "Height" cannot be assigned to parameter "shape" of type "tuple[*Shape@Array]" in function "__init__" -  "Height" is incompatible with "tuple[*Shape@Array]" (reportArgumentType) -generics_typevartuple_basic.py:43:35 - error: Expression of type "Array[Batch, Width]" is incompatible with declared type "Array[Batch, Height, Width]" -  "Array[Batch, Width]" is incompatible with "Array[Batch, Height, Width]" -    Type parameter "Shape@Array" is invariant, but "*tuple[Batch, Width]" is not the same as "*tuple[Batch, Height, Width]" (reportAssignmentType) -generics_typevartuple_basic.py:44:41 - error: Expression of type "Array[Time, Batch, Width, Height]" is incompatible with declared type "Array[Time, Batch, Height, Width]" -  "Array[Time, Batch, Width, Height]" is incompatible with "Array[Time, Batch, Height, Width]" -    Type parameter "Shape@Array" is invariant, but "*tuple[Time, Batch, Width, Height]" is not the same as "*tuple[Time, Batch, Height, Width]" (reportAssignmentType) -generics_typevartuple_basic.py:52:22 - error: Expected unpacked TypeVarTuple; use Unpack[Shape] or *Shape -generics_typevartuple_basic.py:53:37 - error: Expected unpacked TypeVarTuple; use Unpack[Shape] or *Shape -generics_typevartuple_basic.py:56:34 - error: Expected unpacked TypeVarTuple; use Unpack[Shape] or *Shape -generics_typevartuple_basic.py:59:24 - error: Expected unpacked TypeVarTuple; use Unpack[Shape] or *Shape -generics_typevartuple_basic.py:65:27 - error: "covariant" is unknown parameter to TypeVarTuple -generics_typevartuple_basic.py:66:27 - error: TypeVarTuple cannot have value constraints -generics_typevartuple_basic.py:66:32 - error: TypeVarTuple cannot have value constraints -generics_typevartuple_basic.py:67:27 - error: "bound" is unknown parameter to TypeVarTuple +  "Height" is incompatible with "tuple[Height, Width]" (reportArgumentType) +generics_typevartuple_basic.py:43:52 - error: Argument of type "tuple[Batch, Width]" cannot be assigned to parameter "shape" of type "tuple[*Shape@Array]" in function "__init__" +  "Width" is incompatible with "Height" (reportArgumentType) +generics_typevartuple_basic.py:45:5 - error: Argument of type "tuple[Time, Batch, Width, Height]" cannot be assigned to parameter "shape" of type "tuple[*Shape@Array]" in function "__init__" +  "Width" is incompatible with "Height" +  "Height" is incompatible with "Width" (reportArgumentType) +generics_typevartuple_basic.py:52:22 - error: Expected unpacked TypeVarTuple; use Unpack[Shape] or *Shape (reportInvalidTypeForm) +generics_typevartuple_basic.py:53:37 - error: Expected unpacked TypeVarTuple; use Unpack[Shape] or *Shape (reportInvalidTypeForm) +generics_typevartuple_basic.py:56:34 - error: Expected unpacked TypeVarTuple; use Unpack[Shape] or *Shape (reportInvalidTypeForm) +generics_typevartuple_basic.py:59:24 - error: Expected unpacked TypeVarTuple; use Unpack[Shape] or *Shape (reportInvalidTypeForm) +generics_typevartuple_basic.py:65:27 - error: "covariant" is unknown parameter to TypeVarTuple (reportGeneralTypeIssues) +generics_typevartuple_basic.py:66:27 - error: TypeVarTuple cannot have value constraints (reportGeneralTypeIssues) +generics_typevartuple_basic.py:66:32 - error: TypeVarTuple cannot have value constraints (reportGeneralTypeIssues) +generics_typevartuple_basic.py:67:27 - error: "bound" is unknown parameter to TypeVarTuple (reportGeneralTypeIssues) generics_typevartuple_basic.py:89:14 - error: Argument of type "tuple[Literal['0']]" cannot be assigned to parameter "arg2" of type "tuple[*Ts@func2]" in function "func2"   "Literal['0']" is incompatible with "int" (reportArgumentType) generics_typevartuple_basic.py:90:15 - error: Argument of type "tuple[Literal[0]]" cannot be assigned to parameter "arg2" of type "tuple[*Ts@func2]" in function "func2" @@ -28,7 +27,7 @@ generics_typevartuple_basic.py:100:17 - error: Argument of type "Array[Height, W   "Array[Height, Width]" is incompatible with "Array[Height]"     Type parameter "Shape@Array" is invariant, but "*tuple[Height, Width]" is not the same as "*tuple[Height]" (reportArgumentType) generics_typevartuple_basic.py:106:14 - error: Generic class can have at most one TypeVarTuple type parameter but received multiple ("Ts1", "Ts2") (reportGeneralTypeIssues) -generics_typevartuple_basic.py:106:29 - error: Type argument list can have at most one unpacked TypeVarTuple or tuple +generics_typevartuple_basic.py:106:29 - error: Type argument list can have at most one unpacked TypeVarTuple or tuple (reportInvalidTypeForm) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/generics_typevartuple_specialization.toml b/conformance/results/pyright/generics_typevartuple_specialization.toml index bf87f1f32..24066fc5d 100644 --- a/conformance/results/pyright/generics_typevartuple_specialization.toml +++ b/conformance/results/pyright/generics_typevartuple_specialization.toml @@ -2,14 +2,14 @@ conformant = "Pass" output = """ generics_typevartuple_specialization.py:109:18 - error: Type variable "Ts" has no meaning in this context (reportGeneralTypeIssues) generics_typevartuple_specialization.py:109:18 - error: Could not specialize type "IntTupleGeneric[T@IntTupleGeneric]" -  Unpacked arguments cannot be used in this context +  Unpacked arguments cannot be used in this context (reportInvalidTypeForm) generics_typevartuple_specialization.py:110:18 - error: Could not specialize type "IntTupleGeneric[T@IntTupleGeneric]" -  Unpacked arguments cannot be used in this context -generics_typevartuple_specialization.py:121:27 - error: Type argument list can have at most one unpacked TypeVarTuple or tuple -generics_typevartuple_specialization.py:122:27 - error: Type argument list can have at most one unpacked TypeVarTuple or tuple -generics_typevartuple_specialization.py:127:9 - error: Too few type arguments provided for "TA7[*Ts@TA7, T1@TA7, T2@TA7]"; expected 3 but received 2 +  Unpacked arguments cannot be used in this context (reportInvalidTypeForm) +generics_typevartuple_specialization.py:121:27 - error: Type argument list can have at most one unpacked TypeVarTuple or tuple (reportInvalidTypeForm) +generics_typevartuple_specialization.py:122:27 - error: Type argument list can have at most one unpacked TypeVarTuple or tuple (reportInvalidTypeForm) +generics_typevartuple_specialization.py:127:9 - error: Too few type arguments provided for "TA7[*Ts@TA7, T1@TA7, T2@TA7]"; expected 3 but received 2 (reportInvalidTypeForm) generics_typevartuple_specialization.py:163:14 - error: Could not specialize type "TA11[T@TA11, *Ts1@TA11]" -  Unpacked arguments cannot be used in this context +  Unpacked arguments cannot be used in this context (reportInvalidTypeForm) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/generics_upper_bound.toml b/conformance/results/pyright/generics_upper_bound.toml index bd21bd9ca..280be61a7 100644 --- a/conformance/results/pyright/generics_upper_bound.toml +++ b/conformance/results/pyright/generics_upper_bound.toml @@ -1,6 +1,6 @@ conformant = "Pass" output = """ -generics_upper_bound.py:24:38 - error: TypeVar bound type cannot be generic +generics_upper_bound.py:24:38 - error: TypeVar bound type cannot be generic (reportGeneralTypeIssues) generics_upper_bound.py:51:8 - error: Argument of type "Literal[3]" cannot be assigned to parameter "x" of type "ST@longer" in function "longer"   Type "Literal[3]" is incompatible with type "Sized"     "Literal[3]" is incompatible with protocol "Sized" @@ -9,7 +9,7 @@ generics_upper_bound.py:51:11 - error: Argument of type "Literal[3]" cannot be a   Type "Literal[3]" is incompatible with type "Sized"     "Literal[3]" is incompatible with protocol "Sized"       "__len__" is not present (reportArgumentType) -generics_upper_bound.py:56:44 - error: TypeVar cannot be both bound and constrained +generics_upper_bound.py:56:44 - error: TypeVar cannot be both bound and constrained (reportGeneralTypeIssues) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/generics_variance.toml b/conformance/results/pyright/generics_variance.toml index fcfeac246..113a44121 100644 --- a/conformance/results/pyright/generics_variance.toml +++ b/conformance/results/pyright/generics_variance.toml @@ -1,6 +1,6 @@ conformant = "Pass" output = """ -generics_variance.py:14:50 - error: TypeVar cannot be both covariant and contravariant +generics_variance.py:14:50 - error: TypeVar cannot be both covariant and contravariant (reportGeneralTypeIssues) generics_variance.py:77:18 - error: Type "T_co@Class1" cannot be assigned to type variable "T@Inv"   Variance of type argument "T_co@Class1" is incompatible with base class "Inv" (reportInvalidTypeArguments) generics_variance.py:81:18 - error: Type "T_contra@Class2" cannot be assigned to type variable "T@Inv" @@ -22,9 +22,9 @@ generics_variance.py:163:33 - error: Type "Co[Contra[T_contra@CoToContraToContra generics_variance.py:167:37 - error: Type "Contra[Contra[T_co@ContraToContraToContra]]" cannot be assigned to type variable "T_contra@Contra"   Variance of type argument "Contra[Contra[T_co@ContraToContraToContra]]" is incompatible with base class "Contra" (reportInvalidTypeArguments) generics_variance.py:191:43 - error: Could not specialize type "Contra_TA[T_contra@Contra_TA]" -  Variance of type argument "Co_TA[Contra_TA[T_contra@CoToContraToContra_WithTA]]" is incompatible with "T_contra@Contra_TA" +  Variance of type argument "Co_TA[Contra_TA[T_contra@CoToContraToContra_WithTA]]" is incompatible with "T_contra@Contra_TA" (reportInvalidTypeForm) generics_variance.py:196:15 - error: Could not specialize type "Contra_TA[T_contra@Contra_TA]" -  Variance of type argument "Contra_TA[Contra_TA[T_co@ContraToContraToContra_WithTA]]" is incompatible with "T_contra@Contra_TA" +  Variance of type argument "Contra_TA[Contra_TA[T_co@ContraToContraToContra_WithTA]]" is incompatible with "T_contra@Contra_TA" (reportInvalidTypeForm) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/literals_literalstring.toml b/conformance/results/pyright/literals_literalstring.toml index f82f0123d..954e57640 100644 --- a/conformance/results/pyright/literals_literalstring.toml +++ b/conformance/results/pyright/literals_literalstring.toml @@ -1,7 +1,7 @@ conformant = "Pass" output = """ -literals_literalstring.py:36:29 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value -literals_literalstring.py:37:22 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value +literals_literalstring.py:36:29 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) +literals_literalstring.py:37:22 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) literals_literalstring.py:43:23 - error: Expression of type "Literal['two']" is incompatible with declared type "Literal['']"   "Literal['two']" is incompatible with type "Literal['']" (reportAssignmentType) literals_literalstring.py:66:25 - error: Expression of type "str" is incompatible with declared type "LiteralString" @@ -14,8 +14,7 @@ literals_literalstring.py:120:22 - error: Argument of type "str" cannot be assig   Type "str" is incompatible with type "LiteralString"     "str" is incompatible with "LiteralString" (reportArgumentType) literals_literalstring.py:134:51 - error: Argument of type "str" cannot be assigned to parameter "value" of type "T@Container" in function "__init__" -  Type "str" is incompatible with type "LiteralString" -    "str" is incompatible with "LiteralString" (reportArgumentType) +  "str" is incompatible with "LiteralString" (reportArgumentType) literals_literalstring.py:171:21 - error: Expression of type "list[LiteralString]" is incompatible with declared type "list[str]"   "list[LiteralString]" is incompatible with "list[str]"     Type parameter "_T@list" is invariant, but "LiteralString" is not the same as "str" diff --git a/conformance/results/pyright/literals_parameterizations.toml b/conformance/results/pyright/literals_parameterizations.toml index d54dc0937..16811ca13 100644 --- a/conformance/results/pyright/literals_parameterizations.toml +++ b/conformance/results/pyright/literals_parameterizations.toml @@ -1,29 +1,29 @@ conformant = "Pass" output = """ literals_parameterizations.py:41:15 - error: Binary operator not allowed in type annotation (reportInvalidTypeForm) -literals_parameterizations.py:41:15 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value +literals_parameterizations.py:41:15 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) literals_parameterizations.py:42:15 - error: Call expression not allowed in type expression (reportInvalidTypeForm) -literals_parameterizations.py:42:15 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value +literals_parameterizations.py:42:15 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) literals_parameterizations.py:43:15 - error: Binary operator not allowed in type annotation (reportInvalidTypeForm) -literals_parameterizations.py:43:15 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value +literals_parameterizations.py:43:15 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) literals_parameterizations.py:44:15 - error: Unary operator not allowed in type annotation (reportInvalidTypeForm) -literals_parameterizations.py:44:15 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value +literals_parameterizations.py:44:15 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) literals_parameterizations.py:45:15 - error: Unary operator not allowed in type annotation (reportInvalidTypeForm) -literals_parameterizations.py:45:15 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value -literals_parameterizations.py:46:15 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value -literals_parameterizations.py:47:15 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value -literals_parameterizations.py:48:15 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value +literals_parameterizations.py:45:15 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) +literals_parameterizations.py:46:15 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) +literals_parameterizations.py:47:15 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) +literals_parameterizations.py:48:15 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) literals_parameterizations.py:49:15 - error: Variable not allowed in type expression (reportInvalidTypeForm) -literals_parameterizations.py:49:15 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value +literals_parameterizations.py:49:15 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) literals_parameterizations.py:50:16 - error: Type variable "T" has no meaning in this context (reportGeneralTypeIssues) -literals_parameterizations.py:50:16 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value -literals_parameterizations.py:51:16 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value -literals_parameterizations.py:52:16 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value -literals_parameterizations.py:53:16 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value +literals_parameterizations.py:50:16 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) +literals_parameterizations.py:51:16 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) +literals_parameterizations.py:52:16 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) +literals_parameterizations.py:53:16 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) literals_parameterizations.py:56:28 - error: Binary operator not allowed in type annotation (reportInvalidTypeForm) -literals_parameterizations.py:56:28 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value -literals_parameterizations.py:60:4 - error: "Literal" cannot be used in this context without a type argument -literals_parameterizations.py:61:12 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value +literals_parameterizations.py:56:28 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) +literals_parameterizations.py:60:4 - error: "Literal" cannot be used in this context without a type argument (reportInvalidTypeForm) +literals_parameterizations.py:61:12 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) literals_parameterizations.py:65:32 - error: Expression of type "Literal[Color.RED]" is incompatible with declared type "Literal['Color.RED']"   "Literal[Color.RED]" is incompatible with type "Literal['Color.RED']" (reportAssignmentType) """ diff --git a/conformance/results/pyright/protocols_definition.toml b/conformance/results/pyright/protocols_definition.toml index bfc48c1f4..23536ece6 100644 --- a/conformance/results/pyright/protocols_definition.toml +++ b/conformance/results/pyright/protocols_definition.toml @@ -3,7 +3,7 @@ output = """ protocols_definition.py:30:12 - error: Argument of type "list[int]" cannot be assigned to parameter "things" of type "Iterable[SupportsClose]" in function "close_all"   "Literal[1]" is incompatible with protocol "SupportsClose"     "close" is not present (reportArgumentType) -protocols_definition.py:67:14 - error: Instance or class variables within a Protocol class must be explicitly declared within the class body +protocols_definition.py:67:14 - error: Instance or class variables within a Protocol class must be explicitly declared within the class body (reportGeneralTypeIssues) protocols_definition.py:114:22 - error: Expression of type "Concrete2_Bad1" is incompatible with declared type "Template2"   "Concrete2_Bad1" is incompatible with protocol "Template2"     "val1" is not present (reportAssignmentType) diff --git a/conformance/results/pyright/qualifiers_annotated.toml b/conformance/results/pyright/qualifiers_annotated.toml index 8f019a5c2..075ec44e2 100644 --- a/conformance/results/pyright/qualifiers_annotated.toml +++ b/conformance/results/pyright/qualifiers_annotated.toml @@ -1,11 +1,11 @@ conformant = "Pass" output = """ -qualifiers_annotated.py:43:17 - error: List expression not allowed for this type argument +qualifiers_annotated.py:43:17 - error: List expression not allowed for this type argument (reportInvalidTypeForm) qualifiers_annotated.py:44:17 - error: Expected class but received "tuple[tuple[type[int], type[str]]]" (reportGeneralTypeIssues) -qualifiers_annotated.py:45:17 - error: List expression not allowed for this type argument +qualifiers_annotated.py:45:17 - error: List expression not allowed for this type argument (reportInvalidTypeForm) qualifiers_annotated.py:45:18 - error: Expected class but received "Generator[type[int], None, None]" (reportGeneralTypeIssues) qualifiers_annotated.py:46:17 - error: Expected class but received "dict[str, Unknown]" (reportGeneralTypeIssues) -qualifiers_annotated.py:46:17 - error: Dictionary expression not allowed in type annotation +qualifiers_annotated.py:46:17 - error: Dictionary expression not allowed in type annotation (reportInvalidTypeForm) qualifiers_annotated.py:46:24 - error: "b" is not defined (reportUndefinedVariable) qualifiers_annotated.py:47:17 - error: Call expression not allowed in type expression (reportInvalidTypeForm) qualifiers_annotated.py:48:17 - error: List expression not allowed in type annotation @@ -18,7 +18,7 @@ qualifiers_annotated.py:51:17 - error: Expected class but received "Literal[True qualifiers_annotated.py:52:18 - error: Expected class but received "Literal[1]" (reportGeneralTypeIssues) qualifiers_annotated.py:53:18 - error: Binary operator not allowed in type annotation (reportInvalidTypeForm) qualifiers_annotated.py:54:18 - error: Type annotations cannot use format string literals (f-strings) (reportGeneralTypeIssues) -qualifiers_annotated.py:64:8 - error: Expected one type argument and one or more annotations for "Annotated" +qualifiers_annotated.py:64:8 - error: Expected one type argument and one or more annotations for "Annotated" (reportInvalidTypeForm) qualifiers_annotated.py:76:24 - error: Expression of type "type[Annotated]" is incompatible with declared type "type[Any]" (reportAssignmentType) qualifiers_annotated.py:77:24 - error: Expression of type "type[Annotated]" is incompatible with declared type "type[Any]" (reportAssignmentType) qualifiers_annotated.py:84:7 - error: Argument of type "type[Annotated]" cannot be assigned to parameter "x" of type "type[T@func4]" in function "func4" (reportArgumentType) diff --git a/conformance/results/pyright/qualifiers_final_annotation.toml b/conformance/results/pyright/qualifiers_final_annotation.toml index d8ddd04bd..d191ef3e1 100644 --- a/conformance/results/pyright/qualifiers_final_annotation.toml +++ b/conformance/results/pyright/qualifiers_final_annotation.toml @@ -1,15 +1,15 @@ conformant = "Pass" output = """ qualifiers_final_annotation.py:16:1 - error: "BAD1" is declared Final, but value is not assigned (reportGeneralTypeIssues) -qualifiers_final_annotation.py:18:7 - error: Expected a single type argument after "Final" +qualifiers_final_annotation.py:18:7 - error: Expected a single type argument after "Final" (reportInvalidTypeForm) qualifiers_final_annotation.py:34:5 - error: "ID2" is declared Final, but value is not assigned (reportGeneralTypeIssues) qualifiers_final_annotation.py:38:5 - error: "ID3" is declared Final, but value is not assigned (reportGeneralTypeIssues) qualifiers_final_annotation.py:54:14 - error: Cannot assign to attribute "ID5" for class "ClassA*"   Attribute "ID5" cannot be assigned through a class instance because it is a ClassVar   "ID5" is declared as Final and cannot be reassigned     Attribute "__set__" is unknown (reportAttributeAccessIssue) -qualifiers_final_annotation.py:62:19 - error: "Final" is not allowed in this context -qualifiers_final_annotation.py:63:19 - error: "Final" is not allowed in this context +qualifiers_final_annotation.py:62:19 - error: "Final" is not allowed in this context (reportInvalidTypeForm) +qualifiers_final_annotation.py:63:19 - error: "Final" is not allowed in this context (reportInvalidTypeForm) qualifiers_final_annotation.py:63:32 - error: Cannot assign to attribute "id4" for class "ClassA*"   "Literal[1]" is incompatible with "Final" (reportAttributeAccessIssue) qualifiers_final_annotation.py:65:14 - error: Cannot assign to attribute "ID7" for class "ClassA*" @@ -25,10 +25,10 @@ qualifiers_final_annotation.py:81:8 - error: Cannot assign to attribute "DEFAULT   "DEFAULT_ID" is declared as Final and cannot be reassigned     Attribute "__set__" is unknown (reportAttributeAccessIssue) qualifiers_final_annotation.py:94:5 - error: "BORDER_WIDTH" cannot be redeclared because parent class "ClassC" declares it as Final (reportGeneralTypeIssues) -qualifiers_final_annotation.py:107:22 - error: "Final" is not allowed in this context -qualifiers_final_annotation.py:108:19 - error: "ClassVar" is not allowed in this context -qualifiers_final_annotation.py:118:9 - error: "Final" is not allowed in this context -qualifiers_final_annotation.py:121:14 - error: "Final" is not allowed in this context +qualifiers_final_annotation.py:107:22 - error: "Final" is not allowed in this context (reportInvalidTypeForm) +qualifiers_final_annotation.py:108:19 - error: "ClassVar" is not allowed in this context (reportInvalidTypeForm) +qualifiers_final_annotation.py:118:9 - error: "Final" is not allowed in this context (reportInvalidTypeForm) +qualifiers_final_annotation.py:121:14 - error: "Final" is not allowed in this context (reportInvalidTypeForm) qualifiers_final_annotation.py:134:1 - error: Arguments missing for parameters "x", "y" (reportCallIssue) qualifiers_final_annotation.py:134:3 - error: No parameter named "a" (reportCallIssue) qualifiers_final_annotation.py:135:5 - error: Argument of type "Literal['']" cannot be assigned to parameter "x" of type "int" in function "__new__" diff --git a/conformance/results/pyright/qualifiers_final_decorator.toml b/conformance/results/pyright/qualifiers_final_decorator.toml index 54cbee74d..6a3156500 100644 --- a/conformance/results/pyright/qualifiers_final_decorator.toml +++ b/conformance/results/pyright/qualifiers_final_decorator.toml @@ -1,7 +1,7 @@ conformant = "Pass" output = """ qualifiers_final_decorator.py:8:6 - warning: Import "_qualifiers_final_decorator" could not be resolved from source (reportMissingModuleSource) -qualifiers_final_decorator.py:21:16 - error: Base class "Base1" is marked final and cannot be subclassed +qualifiers_final_decorator.py:21:16 - error: Base class "Base1" is marked final and cannot be subclassed (reportGeneralTypeIssues) qualifiers_final_decorator.py:56:9 - error: Method "method1" cannot override final method defined in class "Base2" (reportIncompatibleMethodOverride) qualifiers_final_decorator.py:60:9 - error: Method "method2" cannot override final method defined in class "Base2" (reportIncompatibleMethodOverride) qualifiers_final_decorator.py:64:9 - error: Method "method3" cannot override final method defined in class "Base2" (reportIncompatibleMethodOverride) diff --git a/conformance/results/pyright/specialtypes_type.toml b/conformance/results/pyright/specialtypes_type.toml index 5a64d5e4a..b0b336860 100644 --- a/conformance/results/pyright/specialtypes_type.toml +++ b/conformance/results/pyright/specialtypes_type.toml @@ -7,7 +7,7 @@ specialtypes_type.py:56:7 - error: Argument of type "type[TeamUser]" cannot be a     "type[TeamUser]" is incompatible with "type[ProUser]"     Type "type[TeamUser]" is incompatible with type "type[ProUser]" (reportArgumentType) specialtypes_type.py:70:7 - error: Argument of type "type[Callable]" cannot be assigned to parameter "x" of type "type[T@func5]" in function "func5" (reportArgumentType) -specialtypes_type.py:76:22 - error: Too many type arguments provided for "type"; expected 1 but received 2 +specialtypes_type.py:76:22 - error: Too many type arguments provided for "type"; expected 1 but received 2 (reportInvalidTypeForm) specialtypes_type.py:117:7 - error: Cannot access attribute "unknown" for class "type[object]"   Attribute "unknown" is unknown (reportAttributeAccessIssue) specialtypes_type.py:120:7 - error: Cannot access attribute "unknown" for class "type[object]" diff --git a/conformance/results/pyright/tuples_type_form.toml b/conformance/results/pyright/tuples_type_form.toml index 827bb138d..2bc7070ac 100644 --- a/conformance/results/pyright/tuples_type_form.toml +++ b/conformance/results/pyright/tuples_type_form.toml @@ -13,12 +13,12 @@ tuples_type_form.py:25:7 - error: Expression of type "tuple[Literal[1]]" is inco     Tuple size mismatch; expected 0 but received 1 (reportAssignmentType) tuples_type_form.py:36:17 - error: Expression of type "tuple[Literal[1], Literal[2], Literal[3], Literal['']]" is incompatible with declared type "tuple[int, ...]"   "Literal['']" is incompatible with "int" (reportAssignmentType) -tuples_type_form.py:40:22 - error: "..." is allowed only as the second of two arguments -tuples_type_form.py:41:12 - error: "..." is allowed only as the second of two arguments -tuples_type_form.py:42:12 - error: "..." is allowed only as the second of two arguments -tuples_type_form.py:43:17 - error: "..." is allowed only as the second of two arguments -tuples_type_form.py:44:25 - error: "..." cannot be used with an unpacked TypeVarTuple or tuple -tuples_type_form.py:45:30 - error: "..." cannot be used with an unpacked TypeVarTuple or tuple +tuples_type_form.py:40:22 - error: "..." is allowed only as the second of two arguments (reportInvalidTypeForm) +tuples_type_form.py:41:12 - error: "..." is allowed only as the second of two arguments (reportInvalidTypeForm) +tuples_type_form.py:42:12 - error: "..." is allowed only as the second of two arguments (reportInvalidTypeForm) +tuples_type_form.py:43:17 - error: "..." is allowed only as the second of two arguments (reportInvalidTypeForm) +tuples_type_form.py:44:25 - error: "..." cannot be used with an unpacked TypeVarTuple or tuple (reportInvalidTypeForm) +tuples_type_form.py:45:30 - error: "..." cannot be used with an unpacked TypeVarTuple or tuple (reportInvalidTypeForm) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/tuples_unpacked.toml b/conformance/results/pyright/tuples_unpacked.toml index 71786b74a..d0bf64302 100644 --- a/conformance/results/pyright/tuples_unpacked.toml +++ b/conformance/results/pyright/tuples_unpacked.toml @@ -1,10 +1,10 @@ conformant = "Pass" output = """ -tuples_unpacked.py:40:30 - error: Type argument list can have at most one unpacked TypeVarTuple or tuple -tuples_unpacked.py:41:43 - error: Type argument list can have at most one unpacked TypeVarTuple or tuple -tuples_unpacked.py:51:34 - error: Type argument list can have at most one unpacked TypeVarTuple or tuple -tuples_unpacked.py:59:37 - error: Type argument list can have at most one unpacked TypeVarTuple or tuple -tuples_unpacked.py:61:50 - error: Type argument list can have at most one unpacked TypeVarTuple or tuple +tuples_unpacked.py:40:30 - error: Type argument list can have at most one unpacked TypeVarTuple or tuple (reportInvalidTypeForm) +tuples_unpacked.py:41:43 - error: Type argument list can have at most one unpacked TypeVarTuple or tuple (reportInvalidTypeForm) +tuples_unpacked.py:51:34 - error: Type argument list can have at most one unpacked TypeVarTuple or tuple (reportInvalidTypeForm) +tuples_unpacked.py:59:37 - error: Type argument list can have at most one unpacked TypeVarTuple or tuple (reportInvalidTypeForm) +tuples_unpacked.py:61:50 - error: Type argument list can have at most one unpacked TypeVarTuple or tuple (reportInvalidTypeForm) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/typeddicts_class_syntax.toml b/conformance/results/pyright/typeddicts_class_syntax.toml index 4c4ddb5d8..b518cd64a 100644 --- a/conformance/results/pyright/typeddicts_class_syntax.toml +++ b/conformance/results/pyright/typeddicts_class_syntax.toml @@ -3,8 +3,8 @@ output = """ typeddicts_class_syntax.py:29:5 - error: TypedDict classes can contain only type annotations (reportGeneralTypeIssues) typeddicts_class_syntax.py:33:5 - error: TypedDict classes can contain only type annotations (reportGeneralTypeIssues) typeddicts_class_syntax.py:38:5 - error: TypedDict classes can contain only type annotations (reportGeneralTypeIssues) -typeddicts_class_syntax.py:44:32 - error: TypedDict does not support __init_subclass__ parameter "metaclass" -typeddicts_class_syntax.py:49:32 - error: TypedDict does not support __init_subclass__ parameter "other" +typeddicts_class_syntax.py:44:32 - error: TypedDict does not support __init_subclass__ parameter "metaclass" (reportGeneralTypeIssues) +typeddicts_class_syntax.py:49:32 - error: TypedDict does not support __init_subclass__ parameter "other" (reportGeneralTypeIssues) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/typeddicts_inheritance.toml b/conformance/results/pyright/typeddicts_inheritance.toml index 294dce2c7..a827b06ca 100644 --- a/conformance/results/pyright/typeddicts_inheritance.toml +++ b/conformance/results/pyright/typeddicts_inheritance.toml @@ -1,7 +1,7 @@ conformant = "Pass" output = """ typeddicts_inheritance.py:44:7 - error: All base classes for TypedDict classes must also be TypedDict classes -  Class "NonTypedDict" is not a TypedDict +  Class "NonTypedDict" is not a TypedDict (reportGeneralTypeIssues) typeddicts_inheritance.py:55:4 - error: "x" overrides symbol of same name in class "X1"   Variable is mutable so its type is invariant     Override type "int" is not the same as base type "str" (reportIncompatibleVariableOverride) diff --git a/conformance/results/pyright/typeddicts_required.toml b/conformance/results/pyright/typeddicts_required.toml index 4205fdffe..434466a4b 100644 --- a/conformance/results/pyright/typeddicts_required.toml +++ b/conformance/results/pyright/typeddicts_required.toml @@ -1,11 +1,11 @@ conformant = "Pass" output = """ -typeddicts_required.py:12:8 - error: "Required" is not allowed in this context +typeddicts_required.py:12:8 - error: "Required" is not allowed in this context (reportInvalidTypeForm) typeddicts_required.py:15:18 - error: Cannot assign to attribute "x" for class "NotTypedDict*"   "int" is incompatible with "Required[int]" (reportAttributeAccessIssue) -typeddicts_required.py:19:8 - error: "NotRequired" is not allowed in this context -typeddicts_required.py:62:8 - error: "Required" is not allowed in this context -typeddicts_required.py:63:8 - error: "Required" is not allowed in this context +typeddicts_required.py:19:8 - error: "NotRequired" is not allowed in this context (reportInvalidTypeForm) +typeddicts_required.py:62:8 - error: "Required" is not allowed in this context (reportInvalidTypeForm) +typeddicts_required.py:63:8 - error: "Required" is not allowed in this context (reportInvalidTypeForm) """ conformance_automated = "Fail" errors_diff = """ diff --git a/conformance/results/pyright/typeddicts_usage.toml b/conformance/results/pyright/typeddicts_usage.toml index ee77079b0..447d0ad07 100644 --- a/conformance/results/pyright/typeddicts_usage.toml +++ b/conformance/results/pyright/typeddicts_usage.toml @@ -8,7 +8,7 @@ typeddicts_usage.py:28:18 - error: Expression of type "dict[str, str | int]" is   "title" is an undefined item in type "Movie" (reportAssignmentType) typeddicts_usage.py:35:22 - error: Second argument to "isinstance" must be a class or tuple of classes   TypedDict class not allowed for instance or class checks (reportArgumentType) -typeddicts_usage.py:40:24 - error: "TypedDict" cannot be used in this context +typeddicts_usage.py:40:24 - error: "TypedDict" cannot be used in this context (reportInvalidTypeForm) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/version.toml b/conformance/results/pyright/version.toml index 81d11bfbf..3229acb55 100644 --- a/conformance/results/pyright/version.toml +++ b/conformance/results/pyright/version.toml @@ -1,2 +1,2 @@ -version = "pyright 1.1.372" -test_duration = 1.5 +version = "pyright 1.1.373" +test_duration = 1.4 diff --git a/conformance/results/pytype/constructors_callable.toml b/conformance/results/pytype/constructors_callable.toml index 93ae94e97..e1199f524 100644 --- a/conformance/results/pytype/constructors_callable.toml +++ b/conformance/results/pytype/constructors_callable.toml @@ -21,7 +21,6 @@ Line 78: Unexpected errors ['File "constructors_callable.py", line 78, in : Callable[[Any], Class5] [reveal-type]'] Line 100: Unexpected errors ['File "constructors_callable.py", line 100, in : Function expects 1 arg(s), got 0 [wrong-arg-count]', 'File "constructors_callable.py", line 100, in : Any [assert-type]'] Line 105: Unexpected errors ['File "constructors_callable.py", line 105, in : Invalid keyword argument x to function [wrong-keyword-args]', 'File "constructors_callable.py", line 105, in : Any [assert-type]'] -Line 117: Unexpected errors ['File "constructors_callable.py", line 117, in __new__: bad return type [bad-return-type]'] Line 125: Unexpected errors ['File "constructors_callable.py", line 125, in : Callable[[Any], Class6] [reveal-type]'] Line 126: Unexpected errors ['File "constructors_callable.py", line 126, in : Function expects 1 arg(s), got 0 [wrong-arg-count]', 'File "constructors_callable.py", line 126, in : Any [assert-type]'] Line 142: Unexpected errors ['File "constructors_callable.py", line 142, in : Callable[[Any], Class6Any] [reveal-type]'] @@ -60,9 +59,6 @@ File "constructors_callable.py", line 100, in : Function expe File "constructors_callable.py", line 100, in : Any [assert-type] File "constructors_callable.py", line 105, in : Invalid keyword argument x to function [wrong-keyword-args] File "constructors_callable.py", line 105, in : Any [assert-type] -File "constructors_callable.py", line 117, in __new__: bad return type [bad-return-type] -Called from (traceback): - line 127, in current file File "constructors_callable.py", line 125, in : Callable[[Any], Class6] [reveal-type] File "constructors_callable.py", line 126, in : Function expects 1 arg(s), got 0 [wrong-arg-count] File "constructors_callable.py", line 126, in : Any [assert-type] diff --git a/conformance/results/pytype/dataclasses_transform_converter.toml b/conformance/results/pytype/dataclasses_transform_converter.toml index 03fa070c4..a67010840 100644 --- a/conformance/results/pytype/dataclasses_transform_converter.toml +++ b/conformance/results/pytype/dataclasses_transform_converter.toml @@ -4,27 +4,48 @@ Converter parameter not yet supported. """ conformance_automated = "Fail" errors_diff = """ -Line 47: Expected 1 errors -Line 48: Expected 1 errors -Line 117: Expected 1 errors -Line 129: Expected 1 errors -Line 132: Expected 1 errors -Line 28: Unexpected errors ['File "dataclasses_transform_converter.py", line 28, in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] -Line 111: Unexpected errors ['File "dataclasses_transform_converter.py", line 111, in : Function DC2.__init__ was called with the wrong arguments [wrong-arg-types]'] -Line 113: Unexpected errors ['File "dataclasses_transform_converter.py", line 113, in : Type annotation for field0 does not match type of assignment [annotation-type-mismatch]'] -Line 114: Unexpected errors ['File "dataclasses_transform_converter.py", line 114, in : Type annotation for field3 does not match type of assignment [annotation-type-mismatch]'] +Line 49: Expected 1 errors +Line 118: Expected 1 errors +Line 26: Unexpected errors ['File "dataclasses_transform_converter.py", line 26, in model_field: bad return type [bad-return-type]', 'File "dataclasses_transform_converter.py", line 26, in model_field: bad return type [bad-return-type]', 'File "dataclasses_transform_converter.py", line 26, in model_field: bad return type [bad-return-type]', 'File "dataclasses_transform_converter.py", line 26, in model_field: bad return type [bad-return-type]', 'File "dataclasses_transform_converter.py", line 26, in model_field: bad return type [bad-return-type]'] +Line 29: Unexpected errors ['File "dataclasses_transform_converter.py", line 29, in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] +Line 112: Unexpected errors ['File "dataclasses_transform_converter.py", line 112, in : Function DC2.__init__ was called with the wrong arguments [wrong-arg-types]'] +Line 114: Unexpected errors ['File "dataclasses_transform_converter.py", line 114, in : Type annotation for field0 does not match type of assignment [annotation-type-mismatch]'] Line 115: Unexpected errors ['File "dataclasses_transform_converter.py", line 115, in : Type annotation for field3 does not match type of assignment [annotation-type-mismatch]'] -Line 120: Unexpected errors ['File "dataclasses_transform_converter.py", line 120, in : Function DC2.__init__ was called with the wrong arguments [wrong-arg-types]'] +Line 116: Unexpected errors ['File "dataclasses_transform_converter.py", line 116, in : Type annotation for field3 does not match type of assignment [annotation-type-mismatch]'] +Line 121: Unexpected errors ['File "dataclasses_transform_converter.py", line 121, in : Function DC2.__init__ was called with the wrong arguments [wrong-arg-types]'] """ output = """ -File "dataclasses_transform_converter.py", line 28, in : Arguments to dataclass_transform not supported yet [not-supported-yet] -File "dataclasses_transform_converter.py", line 106, in : Function DC2.__init__ was called with the wrong arguments [wrong-arg-types] +File "dataclasses_transform_converter.py", line 26, in model_field: bad return type [bad-return-type] +Called from (traceback): + line 98, in current file + line 99, in DC2 +File "dataclasses_transform_converter.py", line 26, in model_field: bad return type [bad-return-type] +Called from (traceback): + line 98, in current file + line 104, in DC2 +File "dataclasses_transform_converter.py", line 26, in model_field: bad return type [bad-return-type] +Called from (traceback): + line 98, in current file + line 102, in DC2 +File "dataclasses_transform_converter.py", line 26, in model_field: bad return type [bad-return-type] +Called from (traceback): + line 98, in current file + line 100, in DC2 +File "dataclasses_transform_converter.py", line 26, in model_field: bad return type [bad-return-type] +Called from (traceback): + line 47, in current file + line 49, in DC1 +File "dataclasses_transform_converter.py", line 29, in : Arguments to dataclass_transform not supported yet [not-supported-yet] +File "dataclasses_transform_converter.py", line 48, in DC1: Function model_field was called with the wrong arguments [wrong-arg-types] File "dataclasses_transform_converter.py", line 107, in : Function DC2.__init__ was called with the wrong arguments [wrong-arg-types] File "dataclasses_transform_converter.py", line 108, in : Function DC2.__init__ was called with the wrong arguments [wrong-arg-types] -File "dataclasses_transform_converter.py", line 111, in : Function DC2.__init__ was called with the wrong arguments [wrong-arg-types] -File "dataclasses_transform_converter.py", line 113, in : Type annotation for field0 does not match type of assignment [annotation-type-mismatch] -File "dataclasses_transform_converter.py", line 114, in : Type annotation for field3 does not match type of assignment [annotation-type-mismatch] +File "dataclasses_transform_converter.py", line 109, in : Function DC2.__init__ was called with the wrong arguments [wrong-arg-types] +File "dataclasses_transform_converter.py", line 112, in : Function DC2.__init__ was called with the wrong arguments [wrong-arg-types] +File "dataclasses_transform_converter.py", line 114, in : Type annotation for field0 does not match type of assignment [annotation-type-mismatch] File "dataclasses_transform_converter.py", line 115, in : Type annotation for field3 does not match type of assignment [annotation-type-mismatch] -File "dataclasses_transform_converter.py", line 118, in : Type annotation for field3 does not match type of assignment [annotation-type-mismatch] -File "dataclasses_transform_converter.py", line 120, in : Function DC2.__init__ was called with the wrong arguments [wrong-arg-types] +File "dataclasses_transform_converter.py", line 116, in : Type annotation for field3 does not match type of assignment [annotation-type-mismatch] +File "dataclasses_transform_converter.py", line 119, in : Type annotation for field3 does not match type of assignment [annotation-type-mismatch] +File "dataclasses_transform_converter.py", line 121, in : Function DC2.__init__ was called with the wrong arguments [wrong-arg-types] +File "dataclasses_transform_converter.py", line 130, in DC3: Function model_field was called with the wrong arguments [wrong-arg-types] +File "dataclasses_transform_converter.py", line 133, in DC3: Function model_field was called with the wrong arguments [wrong-arg-types] """ diff --git a/conformance/results/pytype/version.toml b/conformance/results/pytype/version.toml index 8fb93c628..16866283c 100644 --- a/conformance/results/pytype/version.toml +++ b/conformance/results/pytype/version.toml @@ -1,2 +1,2 @@ version = "pytype 2024.04.11" -test_duration = 36.3 +test_duration = 32.7 diff --git a/conformance/results/results.html b/conformance/results/results.html index 174a9c849..04c1a6ab3 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -159,16 +159,16 @@

    Python Type System Conformance Test Results

     
    mypy 1.10.1
    -
    1.2sec
    -
    pyright 1.1.371
    +
    mypy 1.11.0
    1.5sec
    pyright 1.1.372
    +
    1.4sec
    +
    pyre 0.9.22
    -
    1.6sec
    +
    2.8sec
    pytype 2024.04.11
    -
    34.0sec
    +
    30.9sec
    @@ -331,13 +331,13 @@

    Python Type System Conformance Test Results

    Unsupported

    Does not understand `Self` type.

         generics_syntax_compatibility
    Unsupported

    Type parameter syntax not yet support.

    Pass Pass
    Unsupported

    Type parameter syntax not yet support.

    Unsupported

    Type parameter syntax not yet support.

         generics_syntax_declarations
    Unsupported

    Type parameter syntax not yet support.

    Partial

    Does not detect many illegal usages of type parameter syntax.

    Pass
    Unsupported

    Type parameter syntax not yet support.

    Unsupported

    Type parameter syntax not yet support.

    Unsupported

    Type parameter syntax not yet support.

         generics_syntax_scoping
    Unsupported

    Type parameter syntax not yet support.

    Partial

    Does not following runtime scoping rules for type parameters in all cases.

    Pass
    Unsupported

    Type parameter syntax not yet support.

    Unsupported

    Type parameter syntax not yet support.

    Unsupported

    Does not support covariant or contravariant TypeVars.

         generics_variance_inference
    Unsupported

    Type parameter syntax not yet support.

    Partial

    Computes incorrect variance in some cases.

    Pass
    Unsupported

    Type parameter syntax not yet support.

    Unsupported

    Type parameter syntax not yet support.

    Partial

    Does not detect type violation for some deeply-nested types.

    Does not properly handle `|` for unions in some recursive type alias definitions.

    Does not detect cyclical references in recursive type alias definition.

         aliases_type_statement
    Unsupported

    Does not support `type` statement.

    Partial

    Does not reject use of TypeAliasType as base class.

    Does not reject redefinition of type alias defined with type statement.

    Does not reject type alias defined in function scope.

    Does not reject type alias with circular definition.

    Pass
    Unsupported

    Does not support `type` statement.

    Unsupported

    Does not support `type` statement.

         aliases_typealiastype
    Partial

    Incorrectly rejects some recursive type aliases using TypeAliasType.

    Incorrectly rejects the use of a class-scoped TypeVar in a TypeAliasType definition.

    Generates error when accessing `__value__` attribute of TypeAliasType.

    Partial

    Incorrectly rejects some recursive type aliases using TypeAliasType.

    Incorrectly rejects the use of a class-scoped TypeVar in a TypeAliasType definition.

    Pass
    Unsupported

    Support for TypeAliasType is not implemented.

    Unsupported

    Support for TypeAliasType is not implemented.

         constructors_call_init
    Partial

    Does not report errors during binding to self parameter of __init__ method.

    Does not support function-scoped TypeVars in self annotation in __init__ method.

    Does not reject use of class-scoped type variables in annotation of self parameter in __init__ method.

    Partial

    Does not report errors during binding to self parameter of __init__ method.

    Does not reject use of class-scoped type variables in annotation of self parameter in __init__ method.

    Pass
    Partial

    Does not infer type of Self for self parameter of __init__ method.

    Does not report errors during binding to self parameter of __init__ method.

    Does not reject use of class-scoped type variables in annotation of self parameter in __init__ method.

    Partial

    Does not report errors during binding to self parameter of __init__ method.

    Does not infer type of Self for self parameter of __init__ method.

    Rejects valid type annotation for self parameter in __init__ method.

    Does not support function-scoped TypeVars in self annotation in __init__ method.

    Does not reject use of class-scoped type variables in annotation of self parameter in __init__ method.

    Partial

    Incorrectly rejects valid index of named tuple instance when using a negative index.

    Does not evaluate correct type for indexed named tuple instance with slice.

    Does not reject named tuple element with no default value after one with a default.

    Does not reject override of named tuple attribute in child class.

    Evaluates incorrect type for named tuple entry with a generic type.

    Does not reject incorrect argument type passed to specialized generic named tuple constructor.

    Does not reject attempt to use NamedTuple with multiple inheritance.

         namedtuples_define_functional
    Pass*

    Does not handle illegal named tuple names the same as runtime.

    Pass Pass
    Partial

    Does not handle illegal named tuple names the same as runtime.

    Does not handle defined fields correctly when extra flags like `rename` or `default` are used.

    Does not support defaults in functional form.

    Partial

    Does not handle illegal named tuple names the same as runtime.

    Does not support defaults in functional form.

    Partial

    Does not enforce declared type of `_value_`.

    Does not correctly enforce assigned tuple types for enum members (optional).

    Does not evaluate literal types for enum member values (optional).

    Does not evaluate literal types for auto values (optional).

         enums_members
    Partial

    Does not treat attribute with annotation and no assignment as non-member.

    Does not reject use of annotation with enum member.

    Does not treat callables as non-members.

    Does not honor `enum.nonmember` to define non-member attribute.

    Does not honor `enum.member` as method decorator.

    Does not properly handle aliased enum members.

    Does not support `_ignore_` mechanism (optional).

    Partial

    Does not treat attribute with annotation and no assignment as non-member.

    Does not reject use of annotation with enum member.

    Does not treat callables as non-members.

    Does not honor `enum.member` as method decorator.

    Does not properly handle aliased enum members.

    Does not support `_ignore_` mechanism (optional).

    Does not treat attributes with private names as non-members.

    Pass*

    Does not support `_ignore_` mechanism (optional).

    Partial

    Does not reject use of annotation with enum member.

    Does not treat callables as non-members.

    Does not treat annotated attributes as non-members.

    Does not honor `enum.nonmember` to define non-member attribute.

    Does not honor `enum.member` as method decorator.

    Does not properly handle aliased enum members.

    Rejects use of `_ignore_`.

    Does not support `_ignore_` mechanism (optional).

    Partial

    Does not reject use of annotation with enum member.

    Does not support `enum.member` and `enum.nonmember`.

    Does not support `_ignore_` mechanism (optional).

    pyright 1.1.372
    -
    1.4sec
    +
    1.5sec
    pyre 0.9.22
    -
    2.8sec
    +
    3.4sec
    pytype 2024.04.11
    -
    30.9sec
    +
    36.3sec
    @@ -744,6 +744,12 @@

    Python Type System Conformance Test Results

    Partial

    Does not support field specifiers.

    Emits "attribute not initialized" error for dataclass field.

    Unsupported

    Does not understand @dataclass_transform.

         dataclasses_transform_converter
    Unsupported

    Converter parameter not yet supported.

    Unsupported

    Converter parameter not yet supported.

    Unsupported

    Converter parameter not yet supported.

    Unsupported

    Converter parameter not yet supported.

         dataclasses_transform_field
    Partial

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

    Pass
    - - + diff --git a/conformance/tests/constructors_callable.py b/conformance/tests/constructors_callable.py index d50f93c3b..7ad04dcb7 100644 --- a/conformance/tests/constructors_callable.py +++ b/conformance/tests/constructors_callable.py @@ -114,7 +114,7 @@ class Class6: """__new__ that causes __init__ to be ignored""" def __new__(cls) -> Class6Proxy: - return Class6Proxy.__new__(cls) + return Class6Proxy() def __init__(self, x: int) -> None: """This __init__ is ignored for purposes of conversion""" diff --git a/conformance/tests/dataclasses_transform_converter.py b/conformance/tests/dataclasses_transform_converter.py index 19602c181..277998c7f 100644 --- a/conformance/tests/dataclasses_transform_converter.py +++ b/conformance/tests/dataclasses_transform_converter.py @@ -14,14 +14,15 @@ ) T = TypeVar("T") +S = TypeVar("S") def model_field( *, - converter: Callable[..., Any], - default: object = None, - default_factory: Callable[..., object] | None = None, -) -> Any: + converter: Callable[[S], T], + default: S | None = None, + default_factory: Callable[[], S] | None = None, +) -> T: ... diff --git a/conformance/tests/generics_typevartuple_basic.py b/conformance/tests/generics_typevartuple_basic.py index 77a07c1ff..daf504fcf 100644 --- a/conformance/tests/generics_typevartuple_basic.py +++ b/conformance/tests/generics_typevartuple_basic.py @@ -41,8 +41,8 @@ def get_shape(self) -> tuple[*Shape]: v4: Array[Height, Width] = Array(Height(1)) # E v5: Array[Batch, Height, Width] = Array((Batch(1), Width(1))) # E -v6: Array[Time, Batch, Height, Width] = Array( # E - (Time(1), Batch(1), Width(1), Height(1)) +v6: Array[Time, Batch, Height, Width] = Array( # E[v6] + (Time(1), Batch(1), Width(1), Height(1)) # E[v6] ) From 0e576758e76c9e44c375fed4356189a97cca8ce0 Mon Sep 17 00:00:00 2001 From: Rebecca Chen Date: Fri, 26 Jul 2024 02:51:58 -0400 Subject: [PATCH 037/308] Move best practices out of "Type Stubs" doc into guide on writing stubs. (#1817) This is part of an effort to integrate the standalone "Type Stubs" doc into the rest of the typing documentation. See https://github.com/python/typing/pull/1815 for more context. For https://github.com/python/typing/issues/1605. --- docs/guides/writing_stubs.rst | 477 +++++++++++++++++++++++++++++- docs/reference/best_practices.rst | 2 + docs/reference/stubs.rst | 469 +---------------------------- 3 files changed, 483 insertions(+), 465 deletions(-) diff --git a/docs/guides/writing_stubs.rst b/docs/guides/writing_stubs.rst index d463a48b7..08760c8d4 100644 --- a/docs/guides/writing_stubs.rst +++ b/docs/guides/writing_stubs.rst @@ -9,7 +9,7 @@ For a full reference, refer to :ref:`stubs`. Maintaining stubs can be a little cumbersome because they are separated from the implementation. This page lists some tools that make writing and maintaining -stubs less painful. +stubs less painful, as well as some best practices on stub contents and style. Tools for generating stubs ========================== @@ -106,3 +106,478 @@ particularly with false positives. If your package has some particularly complex aspects, you could even consider writing dedicated typing tests for tricky definitions. For more details, see :ref:`testing`. + +Stub Content +============ + +This section documents best practices on what elements to include or +leave out of stub files. + +Modules excluded fom stubs +-------------------------- + +Not all modules should be included in stubs. + +It is recommended to exclude: + +1. Implementation details, with `multiprocessing/popen_spawn_win32.py `_ as a notable example +2. Modules that are not supposed to be imported, such as ``__main__.py`` +3. Protected modules that start with a single ``_`` char. However, when needed protected modules can still be added (see :ref:`undocumented-objects` section below) +4. Tests + +Public Interface +---------------- + +Stubs should include the complete public interface (classes, functions, +constants, etc.) of the module they cover, but it is not always +clear exactly what is part of the interface. + +The following should always be included: + +* All objects listed in the module's documentation. +* All objects included in ``__all__`` (if present). + +Other objects may be included if they are not prefixed with an underscore +or if they are being used in practice. (See the next section.) + +.. _undocumented-objects: + +Undocumented Objects +-------------------- + +Undocumented objects may be included as long as they are marked with a comment +of the form ``# undocumented``. + +Example:: + + def list2cmdline(seq: Sequence[str]) -> str: ... # undocumented + +Such undocumented objects are allowed because omitting objects can confuse +users. Users who see an error like "module X has no attribute Y" will +not know whether the error appeared because their code had a bug or +because the stub is wrong. Although it may also be helpful for a type +checker to point out usage of private objects, false negatives (no errors for +wrong code) are preferable over false positives (type errors +for correct code). In addition, even for private objects a type checker +can be helpful in pointing out that an incorrect type was used. + +``__all__`` +------------ + +A stub file should contain an ``__all__`` variable if and only if it is also +present at runtime. In that case, the contents of ``__all__`` should be +identical in the stub and at runtime. If the runtime dynamically adds +or removes elements (for example if certain functions are only available on +some system configurations), include all possible elements in the stubs. + +Stub-Only Objects +----------------- + +Definitions that do not exist at runtime may be included in stubs to aid in +expressing types. Unless intentionally exposed to users (see below), such +definitions should be marked as private by prefixing their names with an +underscore. + +Yes:: + + _T = TypeVar("_T") + _DictList: TypeAlias = dict[str, list[int | None]] + +No:: + + T = TypeVar("T") + DictList: TypeAlias = dict[str, list[int | None]] + +Sometimes, it is desirable to make a stub-only class available +to a stub's users — for example, to allow them to type the return value of a +public method for which a library does not provided a usable runtime type. Use +the ``typing.type_check_only`` decorator to mark such objects:: + + from typing import Protocol, type_check_only + + @type_check_only + class Readable(Protocol): + def read(self) -> str: ... + + def get_reader() -> Readable: ... + +Structural Types +---------------- + +As seen in the example with ``Readable`` in the previous section, a common use +of stub-only objects is to model types that are best described by their +structure. These objects are called protocols (:pep:`544`), and it is encouraged +to use them freely to describe simple structural types. + +Incomplete Stubs +---------------- + +Partial stubs can be useful, especially for larger packages, but they should +follow the following guidelines: + +* Included functions and methods should list all arguments, but the arguments + can be left unannotated. +* Do not use ``Any`` to mark unannotated or partially annotated values. Leave + function parameters and return values unannotated. In all other cases, use + ``_typeshed.Incomplete`` + (`documentation `_):: + + from _typeshed import Incomplete + + field1: Incomplete + field2: dict[str, Incomplete] + + def foo(x): ... + +* Partial classes should include a ``__getattr__()`` method marked with + ``_typeshed.Incomplete`` (see example below). +* Partial modules (i.e. modules that are missing some or all classes, + functions, or attributes) should include a top-level ``__getattr__()`` + function marked with ``_typeshed.Incomplete`` (see example below). +* Partial packages (i.e. packages that are missing one or more sub-modules) + should have a ``__init__.pyi`` stub that is marked as incomplete (see above). + A better alternative is to create empty stubs for all sub-modules and + mark them as incomplete individually. + +Example of a partial module with a partial class ``Foo`` and a partially +annotated function ``bar()``:: + + from _typeshed import Incomplete + + def __getattr__(name: str) -> Incomplete: ... + + class Foo: + def __getattr__(self, name: str) -> Incomplete: ... + x: int + y: str + + def bar(x: str, y, *, z=...): ... + +Attribute Access +---------------- + +Python has several methods for customizing attribute access: ``__getattr__``, +``__getattribute__``, ``__setattr__``, and ``__delattr__``. Of these, +``__getattr__`` and ``__setattr___`` should sometimes be included in stubs. + +In addition to marking incomplete definitions, ``__getattr__`` should be +included when a class or module allows any name to be accessed. For example, consider +the following class:: + + class Foo: + def __getattribute__(self, name): + return self.__dict__.setdefault(name) + +An appropriate stub definition is:: + + from typing import Any + + class Foo: + def __getattr__(self, name: str) -> Any | None: ... + +Note that only ``__getattr__``, not ``__getattribute__``, is guaranteed to be +supported in stubs. + +On the other hand, ``__getattr__`` should be omitted even if the source code +includes it, if only limited names are allowed. For example, consider this class:: + + class ComplexNumber: + def __init__(self, n): + self._n = n + def __getattr__(self, name): + if name in ("real", "imag"): + return getattr(self._n, name) + raise AttributeError(name) + +In this case, the stub should list the attributes individually:: + + class ComplexNumber: + @property + def real(self) -> float: ... + @property + def imag(self) -> float: ... + def __init__(self, n: complex) -> None: ... + +``__setattr___`` should be included when a class allows any name to be set and +restricts the type. For example:: + + class IntHolder: + def __setattr__(self, name, value): + if isinstance(value, int): + return super().__setattr__(name, value) + raise ValueError(value) + +A good stub definition would be:: + + class IntHolder: + def __setattr__(self, name: str, value: int) -> None: ... + +``__delattr__`` should not be included in stubs. + +Finally, even in the presence of ``__getattr__`` and ``__setattr__``, it is +still recommended to separately define known attributes. + +Constants +--------- + +When the value of a constant is important, mark it as ``Final`` and assign it +to its value. + +Yes:: + + TEL_LANDLINE: Final = "landline" + TEL_MOBILE: Final = "mobile" + DAY_FLAG: Final = 0x01 + NIGHT_FLAG: Final = 0x02 + +No:: + + TEL_LANDLINE: str + TEL_MOBILE: str + DAY_FLAG: int + NIGHT_FLAG: int + +Documentation or Implementation +------------------------------- + +Sometimes a library's documented types will differ from the actual types in the +code. In such cases, stub authors should use their best judgment. Consider these +two examples:: + + def print_elements(x): + """Print every element of list x.""" + for y in x: + print(y) + + def maybe_raise(x): + """Raise an error if x (a boolean) is true.""" + if x: + raise ValueError() + +The implementation of ``print_elements`` takes any iterable, despite the +documented type of ``list``. In this case, annotate the argument as +``Iterable[object]``, to follow the :ref:`best practice` +of preferring abstract types for arguments. + +For ``maybe_raise``, on the other hand, it is better to annotate the argument as +``bool`` even though the implementation accepts any object. This guards against +common mistakes like unintentionally passing in ``None``. + +If in doubt, consider asking the library maintainers about their intent. + +Style Guide +=========== + +The recommendations in this section are aimed at stub authors who wish to +provide a consistent style for stubs. Type checkers should not reject stubs that +do not follow these recommendations, but linters can warn about them. + +Stub files should generally follow the Style Guide for Python Code (:pep:`8`) +and the :ref:`best-practices`. There are a few exceptions, outlined below, that take the +different structure of stub files into account and aim to create +more concise files. + +Maximum Line Length +------------------- + +Stub files should be limited to 130 characters per line. + +Blank Lines +----------- + +Do not use empty lines between functions, methods, and fields, except to +group them with one empty line. Use one empty line around classes with non-empty +bodies. Do not use empty lines between body-less classes, except for grouping. + +Yes:: + + def time_func() -> None: ... + def date_func() -> None: ... + + def ip_func() -> None: ... + + class Foo: + x: int + y: int + def __init__(self) -> None: ... + + class MyError(Exception): ... + class AnotherError(Exception): ... + +No:: + + def time_func() -> None: ... + + def date_func() -> None: ... # do no leave unnecessary empty lines + + def ip_func() -> None: ... + + + class Foo: # leave only one empty line above + x: int + class MyError(Exception): ... # leave an empty line between the classes + +Module Level Attributes +----------------------- + +Do not unnecessarily use an assignment for module-level attributes. + +Yes:: + + CONST: Literal["const"] + x: int + y: Final = 0 # this assignment conveys additional type information + +No:: + + CONST = "const" + x: int = 0 + y: float = ... + z = 0 # type: int + a = ... # type: int + +.. _stub-style-classes: + +Classes +------- + +Classes without bodies should use the ellipsis literal ``...`` in place +of the body on the same line as the class definition. + +Yes:: + + class MyError(Exception): ... + +No:: + + class MyError(Exception): + ... + class AnotherError(Exception): pass + +Instance attributes and class variables follow the same recommendations as +module level attributes: + +Yes:: + + class Foo: + c: ClassVar[str] + x: int + + class Color(Enum): + # An assignment with no type annotation is a convention used to indicate + # an enum member. + RED = 1 + +No:: + + class Foo: + c: ClassVar[str] = "" + d: ClassVar[int] = ... + x = 4 + y: int = ... + +Functions and Methods +--------------------- + +For keyword-only and positional-or-keyword arguments, use the same +argument names as in the implementation, because otherwise using +keyword arguments will fail. + +For default values, use the literal values of "simple" default values (``None``, +bools, ints, bytes, strings, and floats). Use the ellipsis literal ``...`` in +place of more complex default values. Use an explicit ``X | None`` annotation +when the default is ``None``. + +Yes:: + + def foo(x: int = 0) -> None: ... + def bar(y: str | None = None) -> None: ... + +No:: + + def foo(x: X = X()) -> None: ... + def bar(y: str = None) -> None: ... + +Do not annotate ``self`` and ``cls`` in method definitions, except when +referencing a type variable. + +Yes:: + + _T = TypeVar("_T") + + class Foo: + def bar(self) -> None: ... + @classmethod + def create(cls: type[_T]) -> _T: ... + +No:: + + class Foo: + def bar(self: Foo) -> None: ... + @classmethod + def baz(cls: type[Foo]) -> int: ... + +The bodies of functions and methods should consist of only the ellipsis +literal ``...`` on the same line as the closing parenthesis and colon. + +Yes:: + + def to_int1(x: str) -> int: ... + def to_int2( + x: str, + ) -> int: ... + +No:: + + def to_int1(x: str) -> int: + return int(x) + def to_int2(x: str) -> int: + ... + def to_int3(x: str) -> int: pass + +Language Features +----------------- + +Use the latest language features available, even for stubs targeting older +Python versions. Do not use quotes around forward references and do not use +``__future__`` imports. See :ref:`stub-file-syntax` for more information. + +Yes:: + + class Py35Class: + x: int + forward_reference: OtherClass + + class OtherClass: ... + +No:: + + class Py35Class: + x = 0 # type: int + forward_reference: 'OtherClass' + + class OtherClass: ... + +NamedTuple and TypedDict +------------------------ + +Use the class-based syntax for ``typing.NamedTuple`` and +``typing.TypedDict``, following the :ref:`stub-style-classes` section of this style guide. + +Yes:: + + from typing import NamedTuple, TypedDict + + class Point(NamedTuple): + x: float + y: float + + class Thing(TypedDict): + stuff: str + index: int + +No:: + + from typing import NamedTuple, TypedDict + Point = NamedTuple("Point", [('x', float), ('y', float)]) + Thing = TypedDict("Thing", {'stuff': str, 'index': int}) diff --git a/docs/reference/best_practices.rst b/docs/reference/best_practices.rst index 24a6ff880..a6585c07e 100644 --- a/docs/reference/best_practices.rst +++ b/docs/reference/best_practices.rst @@ -59,6 +59,8 @@ annotate it with ``object``:: if isinstance(o, int): cb(o) +.. _argument-return-practices: + Arguments and Return Types -------------------------- diff --git a/docs/reference/stubs.rst b/docs/reference/stubs.rst index 9f207847e..a3a456a04 100644 --- a/docs/reference/stubs.rst +++ b/docs/reference/stubs.rst @@ -22,9 +22,9 @@ Python packages and modules. Type stubs serve multiple purposes: members. This document aims to give guidance to both authors of type stubs and developers -of type checkers and other tools. It describes the constructs that can be used safely in type stubs, -suggests a style guide for them, and lists constructs that type -checkers are expected to support. +of type checkers and other tools. It describes the constructs that can be used +safely in type stubs and lists constructs that type checkers are expected to +support. Type stubs that only use constructs described in this document should work with all type checkers that also follow this document. @@ -39,6 +39,8 @@ can elect to ignore unsupported ones. Additionally type checkers can support constructs not described in this document and tool authors are encouraged to experiment with additional features. +.. _stub-file-syntax: + Syntax ====== @@ -504,467 +506,6 @@ No:: BLUE: int rgb_value: int # no way for type checkers to know that this is not an enum member -Type Stub Content -================= - -This section documents best practices on what elements to include or -leave out of type stubs. - -Modules excluded fom stubs --------------------------- - -Not all modules should be included into stubs. - -It is recommended to exclude: - -1. Implementation details, with `multiprocessing/popen_spawn_win32.py `_ as a notable example -2. Modules that are not supposed to be imported, such as ``__main__.py`` -3. Protected modules that start with a single ``_`` char. However, when needed protected modules can still be added (see :ref:`undocumented-objects` section below) - -Public Interface ----------------- - -Stubs should include the complete public interface (classes, functions, -constants, etc.) of the module they cover, but it is not always -clear exactly what is part of the interface. - -The following should always be included: - -* All objects listed in the module's documentation. -* All objects included in ``__all__`` (if present). - -Other objects may be included if they are not prefixed with an underscore -or if they are being used in practice. (See the next section.) - -.. _undocumented-objects: - -Undocumented Objects --------------------- - -Undocumented objects may be included as long as they are marked with a comment -of the form ``# undocumented``. - -Example:: - - def list2cmdline(seq: Sequence[str]) -> str: ... # undocumented - -Such undocumented objects are allowed because omitting objects can confuse -users. Users who see an error like "module X has no attribute Y" will -not know whether the error appeared because their code had a bug or -because the stub is wrong. Although it may also be helpful for a type -checker to point out usage of private objects, false negatives (no errors for -wrong code) are preferable over false positives (type errors -for correct code). In addition, even for private objects a type checker -can be helpful in pointing out that an incorrect type was used. - -``__all__`` ------------- - -A type stub should contain an ``__all__`` variable if and only if it also -present at runtime. In that case, the contents of ``__all__`` should be -identical in the stub and at runtime. If the runtime dynamically adds -or removes elements (for example if certain functions are only available on -some platforms), include all possible elements in the stubs. - -Stub-Only Objects ------------------ - -Definitions that do not exist at runtime may be included in stubs to aid in -expressing types. Sometimes, it is desirable to make a stub-only class available -to a stub's users - for example, to allow them to type the return value of a -public method for which a library does not provided a usable runtime type:: - - from typing import Protocol - - class _Readable(Protocol): - def read(self) -> str: ... - - def get_reader() -> _Readable: ... - -Structural Types ----------------- - -As seen in the example with ``_Readable`` in the previous section, a common use -of stub-only objects is to model types that are best described by their -structure. These objects are called protocols (:pep:`544`), and it is encouraged -to use them freely to describe simple structural types. - -It is `recommended <#private-definitions>`_ to prefix stubs-only object names with ``_``. - -Incomplete Stubs ----------------- - -Partial stubs can be useful, especially for larger packages, but they should -follow the following guidelines: - -* Included functions and methods should list all arguments, but the arguments - can be left unannotated. -* Do not use ``Any`` to mark unannotated arguments or return values. -* Partial classes should include a ``__getattr__()`` method marked with an - ``# incomplete`` comment (see example below). -* Partial modules (i.e. modules that are missing some or all classes, - functions, or attributes) should include a top-level ``__getattr__()`` - function marked with an ``# incomplete`` comment (see example below). -* Partial packages (i.e. packages that are missing one or more sub-modules) - should have a ``__init__.pyi`` stub that is marked as incomplete (see above). - A better alternative is to create empty stubs for all sub-modules and - mark them as incomplete individually. - -Example of a partial module with a partial class ``Foo`` and a partially -annotated function ``bar()``:: - - def __getattr__(name: str) -> Any: ... # incomplete - - class Foo: - def __getattr__(self, name: str) -> Any: ... # incomplete - x: int - y: str - - def bar(x: str, y, *, z=...): ... - -The ``# incomplete`` comment is mainly intended as a reminder for stub -authors, but can be used by tools to flag such items. - -Attribute Access ----------------- - -Python has several methods for customizing attribute access: ``__getattr__``, -``__getattribute__``, ``__setattr__``, and ``__delattr__``. Of these, -``__getattr__`` and ``__setattr___`` should sometimes be included in stubs. - -In addition to marking incomplete definitions, ``__getattr__`` should be -included when a class or module allows any name to be accessed. For example, consider -the following class:: - - class Foo: - def __getattribute__(self, name): - return self.__dict__.setdefault(name) - -An appropriate stub definition is:: - - from typing import Any - class Foo: - def __getattr__(self, name: str) -> Any | None: ... - -Note that only ``__getattr__``, not ``__getattribute__``, is guaranteed to be -supported in stubs. - -On the other hand, ``__getattr__`` should be omitted even if the source code -includes it, if only limited names are allowed. For example, consider this class:: - - class ComplexNumber: - def __init__(self, n): - self._n = n - def __getattr__(self, name): - if name in ("real", "imag"): - return getattr(self._n, name) - raise AttributeError(name) - -In this case, the stub should list the attributes individually:: - - class ComplexNumber: - @property - def real(self) -> float: ... - @property - def imag(self) -> float: ... - def __init__(self, n: complex) -> None: ... - -``__setattr___`` should be included when a class allows any name to be set and -restricts the type. For example:: - - class IntHolder: - def __setattr__(self, name, value): - if isinstance(value, int): - return super().__setattr__(name, value) - raise ValueError(value) - -A good stub definition would be:: - - class IntHolder: - def __setattr__(self, name: str, value: int) -> None: ... - -``__delattr__`` should not be included in stubs. - -Finally, even in the presence of ``__getattr__`` and ``__setattr__``, it is -still recommended to separately define known attributes. - -Constants ---------- - -When the value of a constant is important, annotate it using ``Literal`` -instead of its type. - -Yes:: - - TEL_LANDLINE: Literal["landline"] - TEL_MOBILE: Literal["mobile"] - DAY_FLAG: Literal[0x01] - NIGHT_FLAG: Literal[0x02] - -No:: - - TEL_LANDLINE: str - TEL_MOBILE: str - DAY_FLAG: int - NIGHT_FLAG: int - -Documentation or Implementation -------------------------------- - -Sometimes a library's documented types will differ from the actual types in the -code. In such cases, type stub authors should use their best judgment. Consider -these two examples:: - - def print_elements(x): - """Print every element of list x.""" - for y in x: - print(y) - - def maybe_raise(x): - """Raise an error if x (a boolean) is true.""" - if x: - raise ValueError() - -The implementation of ``print_elements`` takes any iterable, despite the -documented type of ``list``. In this case, annotate the argument as -``Iterable[Any]``, to follow this PEP's style recommendation of preferring -abstract types. - -For ``maybe_raise``, on the other hand, it is better to annotate the argument as -``bool`` even though the implementation accepts any object. This guards against -common mistakes like unintentionally passing in ``None``. - -If in doubt, consider asking the library maintainers about their intent. - -Style Guide -=========== - -The recommendations in this section are aimed at type stub authors -who wish to provide a consistent style for type stubs. Type checkers -should not reject stubs that do not follow these recommendations, but -linters can warn about them. - -Stub files should generally follow the Style Guide for Python Code (:pep:`8`) -and the :ref:`best-practices`. There are a few exceptions, outlined below, that take the -different structure of stub files into account and are aimed to create -more concise files. - -Maximum Line Length -------------------- - -Type stubs should be limited to 130 characters per line. - -Blank Lines ------------ - -Do not use empty lines between functions, methods, and fields, except to -group them with one empty line. Use one empty line around classes, but do not -use empty lines between body-less classes, except for grouping. - -Yes:: - - def time_func() -> None: ... - def date_func() -> None: ... - - def ip_func() -> None: ... - - class Foo: - x: int - y: int - def __init__(self) -> None: ... - - class MyError(Exception): ... - class AnotherError(Exception): ... - -No:: - - def time_func() -> None: ... - - def date_func() -> None: ... # do no leave unnecessary empty lines - - def ip_func() -> None: ... - - - class Foo: # leave only one empty line above - x: int - class MyError(Exception): ... # leave an empty line between the classes - -Module Level Attributes ------------------------ - -Do not use an assignment for module-level attributes. - -Yes:: - - CONST: Literal["const"] - x: int - -No:: - - CONST = "const" - x: int = 0 - y: float = ... - z = 0 # type: int - a = ... # type: int - -.. _stub-style-classes: - -Classes -------- - -Classes without bodies should use the ellipsis literal ``...`` in place -of the body on the same line as the class definition. - -Yes:: - - class MyError(Exception): ... - -No:: - - class MyError(Exception): - ... - class AnotherError(Exception): pass - -Instance attributes and class variables follow the same recommendations as -module level attributes: - -Yes:: - - class Foo: - c: ClassVar[str] - x: int - -No:: - - class Foo: - c: ClassVar[str] = "" - d: ClassVar[int] = ... - x = 4 - y: int = ... - -Functions and Methods ---------------------- - -Use the same argument names as in the implementation, because -otherwise using keyword arguments will fail. Of course, this -does not apply to positional-only arguments, which are marked with a double -underscore. - -Use the ellipsis literal ``...`` in place of actual default argument -values. Use an explicit ``X | None`` annotation instead of -a ``None`` default. - -Yes:: - - def foo(x: int = ...) -> None: ... - def bar(y: str | None = ...) -> None: ... - -No:: - - def foo(x: int = 0) -> None: ... - def bar(y: str = None) -> None: ... - def baz(z: str | None = None) -> None: ... - -Do not annotate ``self`` and ``cls`` in method definitions, except when -referencing a type variable. - -Yes:: - - _T = TypeVar("_T") - class Foo: - def bar(self) -> None: ... - @classmethod - def create(cls: type[_T]) -> _T: ... - -No:: - - class Foo: - def bar(self: Foo) -> None: ... - @classmethod - def baz(cls: type[Foo]) -> int: ... - -The bodies of functions and methods should consist of only the ellipsis -literal ``...`` on the same line as the closing parenthesis and colon. - -Yes:: - - def to_int1(x: str) -> int: ... - def to_int2( - x: str, - ) -> int: ... - -No:: - - def to_int1(x: str) -> int: - return int(x) - def to_int2(x: str) -> int: - ... - def to_int3(x: str) -> int: pass - -.. _private-definitions: - -Private Definitions -------------------- - -Type variables, type aliases, and other definitions that should not -be used outside the stub should be marked as private by prefixing them -with an underscore. - -Yes:: - - _T = TypeVar("_T") - _DictList = Dict[str, List[Optional[int]] - -No:: - - T = TypeVar("T") - DictList = Dict[str, List[Optional[int]]] - -Language Features ------------------ - -Use the latest language features available as outlined -in the Syntax_ section, even for stubs targeting older Python versions. -Do not use quotes around forward references and do not use ``__future__`` -imports. - -Yes:: - - class Py35Class: - x: int - forward_reference: OtherClass - class OtherClass: ... - -No:: - - class Py35Class: - x = 0 # type: int - forward_reference: 'OtherClass' - class OtherClass: ... - -NamedTuple and TypedDict ------------------------- - -Use the class-based syntax for ``typing.NamedTuple`` and -``typing.TypedDict``, following the :ref:`stub-style-classes` section of this style guide. - -Yes:: - - from typing import NamedTuple, TypedDict - class Point(NamedTuple): - x: float - y: float - - class Thing(TypedDict): - stuff: str - index: int - -No:: - - from typing import NamedTuple, TypedDict - Point = NamedTuple("Point", [('x', float), ('y', float)]) - Thing = TypedDict("Thing", {'stuff': str, 'index': int}) - Copyright ========= From cbf18f81397bd31c7a64fbb99353e0caadc9f6ea Mon Sep 17 00:00:00 2001 From: InSync Date: Sun, 28 Jul 2024 08:17:12 +0700 Subject: [PATCH 038/308] Add conformance tests for PEP 702's `@deprecated` (#1822) * Add conformance tests for PEP 702's `@deprecated` * Reorder testcases to avoid irrelevant errors by Pyright * Address PR reviews * Avoid irrelevant errors * Also rename "library" file * Add manual test results * Add missing punctuations, remove a note * Another period * Rerun on pyre * Update conformance/results/pyre/directives_reveal_type.toml * Add new `__call__()` testcase per PR review * Prefer "OK" to "no error" --------- Co-authored-by: Jelle Zijlstra --- .../results/mypy/directives_deprecated.toml | 20 +++ conformance/results/mypy/version.toml | 2 +- .../results/pyre/directives_deprecated.toml | 20 +++ .../results/pyre/directives_reveal_type.toml | 2 +- conformance/results/pyre/version.toml | 2 +- .../pyright/directives_deprecated.toml | 31 +++++ conformance/results/pyright/version.toml | 2 +- .../results/pytype/directives_deprecated.toml | 26 ++++ conformance/results/pytype/version.toml | 2 +- conformance/results/results.html | 14 ++- .../tests/_directives_deprecated_library.py | 44 +++++++ conformance/tests/directives_deprecated.py | 116 ++++++++++++++++++ 12 files changed, 272 insertions(+), 9 deletions(-) create mode 100644 conformance/results/mypy/directives_deprecated.toml create mode 100644 conformance/results/pyre/directives_deprecated.toml create mode 100644 conformance/results/pyright/directives_deprecated.toml create mode 100644 conformance/results/pytype/directives_deprecated.toml create mode 100644 conformance/tests/_directives_deprecated_library.py create mode 100644 conformance/tests/directives_deprecated.py diff --git a/conformance/results/mypy/directives_deprecated.toml b/conformance/results/mypy/directives_deprecated.toml new file mode 100644 index 000000000..9c7552b54 --- /dev/null +++ b/conformance/results/mypy/directives_deprecated.toml @@ -0,0 +1,20 @@ +conformant = "Unsupported" +notes = """ +Does not support @deprecated. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 15: Expected 1 errors +Line 23: Expected 1 errors +Line 24: Expected 1 errors +Line 29: Expected 1 errors +Line 40: Expected 1 errors +Line 41: Expected 1 errors +Line 43: Expected 1 errors +Line 46: Expected 1 errors +Line 47: Expected 1 errors +Line 57: Expected 1 errors +Line 87: Expected 1 errors +""" +output = """ +""" diff --git a/conformance/results/mypy/version.toml b/conformance/results/mypy/version.toml index 8f919ed46..b79e0a27d 100644 --- a/conformance/results/mypy/version.toml +++ b/conformance/results/mypy/version.toml @@ -1,2 +1,2 @@ version = "mypy 1.11.0" -test_duration = 1.0 +test_duration = 1.4 diff --git a/conformance/results/pyre/directives_deprecated.toml b/conformance/results/pyre/directives_deprecated.toml new file mode 100644 index 000000000..9c7552b54 --- /dev/null +++ b/conformance/results/pyre/directives_deprecated.toml @@ -0,0 +1,20 @@ +conformant = "Unsupported" +notes = """ +Does not support @deprecated. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 15: Expected 1 errors +Line 23: Expected 1 errors +Line 24: Expected 1 errors +Line 29: Expected 1 errors +Line 40: Expected 1 errors +Line 41: Expected 1 errors +Line 43: Expected 1 errors +Line 46: Expected 1 errors +Line 47: Expected 1 errors +Line 57: Expected 1 errors +Line 87: Expected 1 errors +""" +output = """ +""" diff --git a/conformance/results/pyre/directives_reveal_type.toml b/conformance/results/pyre/directives_reveal_type.toml index 92a179946..ed30bc74f 100644 --- a/conformance/results/pyre/directives_reveal_type.toml +++ b/conformance/results/pyre/directives_reveal_type.toml @@ -1,5 +1,5 @@ conformant = "Partial" -notes = """" +notes = """ Produces errors rather than warnings on `reveal_type`. """ output = """ diff --git a/conformance/results/pyre/version.toml b/conformance/results/pyre/version.toml index 31ee493d9..dc6693abb 100644 --- a/conformance/results/pyre/version.toml +++ b/conformance/results/pyre/version.toml @@ -1,2 +1,2 @@ version = "pyre 0.9.22" -test_duration = 2.5 +test_duration = 1.8 diff --git a/conformance/results/pyright/directives_deprecated.toml b/conformance/results/pyright/directives_deprecated.toml new file mode 100644 index 000000000..20cf127ad --- /dev/null +++ b/conformance/results/pyright/directives_deprecated.toml @@ -0,0 +1,31 @@ +conformant = "Partial" +notes = """ +Does not report error for deprecated magic methods. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 40: Expected 1 errors +Line 41: Expected 1 errors +Line 47: Expected 1 errors +Line 33: Unexpected errors ['directives_deprecated.py:33:7 - error: The class "Ham" is deprecated'] +""" +output = """ +directives_deprecated.py:15:44 - error: The class "Ham" is deprecated +  Use Spam instead (reportDeprecated) +directives_deprecated.py:23:9 - error: The function "norwegian_blue" is deprecated +  It is pining for the fiords (reportDeprecated) +directives_deprecated.py:24:13 - error: The function "norwegian_blue" is deprecated +  It is pining for the fiords (reportDeprecated) +directives_deprecated.py:29:9 - error: The function "foo" is deprecated +  Only str will be allowed (reportDeprecated) +directives_deprecated.py:33:7 - error: The class "Ham" is deprecated +  Use Spam instead (reportDeprecated) +directives_deprecated.py:43:6 - error: The getter for property "greasy" is deprecated +  All spam will be equally greasy (reportDeprecated) +directives_deprecated.py:46:6 - error: The setter for property "shape" is deprecated +  Shapes are becoming immutable (reportDeprecated) +directives_deprecated.py:57:9 - error: The function "lorem" is deprecated +  Deprecated (reportDeprecated) +directives_deprecated.py:87:13 - error: The method "foo" in class "Fooable" is deprecated +  Deprecated (reportDeprecated) +""" diff --git a/conformance/results/pyright/version.toml b/conformance/results/pyright/version.toml index 3229acb55..4d7fa4a51 100644 --- a/conformance/results/pyright/version.toml +++ b/conformance/results/pyright/version.toml @@ -1,2 +1,2 @@ version = "pyright 1.1.373" -test_duration = 1.4 +test_duration = 1.2 diff --git a/conformance/results/pytype/directives_deprecated.toml b/conformance/results/pytype/directives_deprecated.toml new file mode 100644 index 000000000..9fb6a4dfa --- /dev/null +++ b/conformance/results/pytype/directives_deprecated.toml @@ -0,0 +1,26 @@ +conformant = "Unsupported" +notes = """ +Does not support @deprecated. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 23: Expected 1 errors +Line 24: Expected 1 errors +Line 29: Expected 1 errors +Line 40: Expected 1 errors +Line 41: Expected 1 errors +Line 43: Expected 1 errors +Line 46: Expected 1 errors +Line 47: Expected 1 errors +Line 57: Expected 1 errors +Line 87: Expected 1 errors +Line 16: Unexpected errors ['File "directives_deprecated.py", line 16, in : Can\\'t find module \\'_directives_deprecated_library\\'. [import-error]'] +Line 18: Unexpected errors ['File "directives_deprecated.py", line 18, in : typing_extensions.deprecated not supported yet [not-supported-yet]'] +Line 66: Unexpected errors ['File "directives_deprecated.py", line 66, in : typing.override not supported yet [not-supported-yet]'] +""" +output = """ +File "directives_deprecated.py", line 15, in : Can't find module '_directives_deprecated_library'. [import-error] +File "directives_deprecated.py", line 16, in : Can't find module '_directives_deprecated_library'. [import-error] +File "directives_deprecated.py", line 18, in : typing_extensions.deprecated not supported yet [not-supported-yet] +File "directives_deprecated.py", line 66, in : typing.override not supported yet [not-supported-yet] +""" diff --git a/conformance/results/pytype/version.toml b/conformance/results/pytype/version.toml index 16866283c..cf4474998 100644 --- a/conformance/results/pytype/version.toml +++ b/conformance/results/pytype/version.toml @@ -1,2 +1,2 @@ version = "pytype 2024.04.11" -test_duration = 32.7 +test_duration = 30.0 diff --git a/conformance/results/results.html b/conformance/results/results.html index 04c1a6ab3..fd3eec957 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -159,16 +159,16 @@

    Python Type System Conformance Test Results

     
    mypy 1.11.0
    -
    1.5sec
    +
    1.0sec
    pyright 1.1.372
    -
    1.5sec
    +
    pyright 1.1.373
    +
    1.4sec
    pyre 0.9.22
    -
    3.4sec
    +
    2.5sec
    pytype 2024.04.11
    -
    36.3sec
    +
    32.7sec
    @@ -746,7 +746,7 @@

    Python Type System Conformance Test Results

         dataclasses_transform_converter
    Unsupported

    Converter parameter not yet supported.

    Unsupported

    Converter parameter not yet supported.

    Pass
    Unsupported

    Converter parameter not yet supported.

    Unsupported

    Converter parameter not yet supported.

    + + + + + + diff --git a/conformance/tests/_directives_deprecated_library.py b/conformance/tests/_directives_deprecated_library.py new file mode 100644 index 000000000..efcc6dcfd --- /dev/null +++ b/conformance/tests/_directives_deprecated_library.py @@ -0,0 +1,44 @@ +""" +Support module for directive_deprecated. +""" + +from typing import Self, overload + +from typing_extensions import deprecated + + +@deprecated("Use Spam instead") +class Ham: ... + + +@deprecated("It is pining for the fiords") +def norwegian_blue(x: int) -> int: ... + + +@overload +@deprecated("Only str will be allowed") +def foo(x: int) -> str: ... + + +@overload +def foo(x: str) -> str: ... + + +def foo(x: int | str) -> str: ... + + +class Spam: + + @deprecated("There is enough spam in the world") + def __add__(self, other: object) -> Self: ... + + @property + @deprecated("All spam will be equally greasy") + def greasy(self) -> float: ... + + @property + def shape(self) -> str: ... + + @shape.setter + @deprecated("Shapes are becoming immutable") + def shape(self, value: str) -> None: ... diff --git a/conformance/tests/directives_deprecated.py b/conformance/tests/directives_deprecated.py new file mode 100644 index 000000000..cbae60547 --- /dev/null +++ b/conformance/tests/directives_deprecated.py @@ -0,0 +1,116 @@ +""" +Tests the warnings.deprecated function. +""" + +# pyright: reportDeprecated=true + +# Specification: https://typing.readthedocs.io/en/latest/spec/directives.html#deprecated +# See also https://peps.python.org/pep-0702/ + +# > Type checkers should produce a diagnostic whenever they encounter a usage of an object +# > marked as deprecated. [...] For deprecated classes and functions, this includes: + +# > * `from` imports + +from _directives_deprecated_library import Ham # E: Use of deprecated class Ham +import _directives_deprecated_library as library + +from typing_extensions import deprecated + + +# > * References through module, class, or instance attributes + +library.norwegian_blue(1) # E: Use of deprecated function norwegian_blue +map(library.norwegian_blue, [1, 2, 3]) # E: Use of deprecated function norwegian_blue + + +# > For deprecated overloads, this includes all calls that resolve to the deprecated overload. + +library.foo(1) # E: Use of deprecated overload for foo +library.foo("x") # OK + + +ham = Ham() # OK (already reported above) + + +# > * Any syntax that indirectly triggers a call to the function. + +spam = library.Spam() + +_ = spam + 1 # E: Use of deprecated method Spam.__add__ +spam += 1 # E: Use of deprecated method Spam.__add__ + +spam.greasy # E: Use of deprecated property Spam.greasy +spam.shape # OK + +spam.shape = "cube" # E: Use of deprecated property setter Spam.shape +spam.shape += "cube" # E: Use of deprecated property setter Spam.shape + + +class Invocable: + + @deprecated("Deprecated") + def __call__(self) -> None: ... + +invocable = Invocable() +invocable() # E: Use of deprecated method __call__ + + +# > * Any usage of deprecated objects in their defining module + +@deprecated("Deprecated") +def lorem() -> None: ... + + +ipsum = lorem() # E: Use of deprecated function lorem + + +# > There are additional scenarios where deprecations could come into play. +# > For example, an object may implement a `typing.Protocol`, +# > but one of the methods required for protocol compliance is deprecated. +# > As scenarios such as this one appear complex and relatively unlikely to come up in practice, +# > this PEP does not mandate that type checkers detect them. + +from typing import Protocol, override + + +class Fooable(Protocol): + + @deprecated("Deprecated") + def foo(self) -> None: ... + + def bar(self) -> None: ... + + +class Fooer(Fooable): + + @override + def foo(self) -> None: # E?: Implementation of deprecated method foo + ... + + def bar(self) -> None: ... + + +def foo_it(fooable: Fooable) -> None: + fooable.foo() # E: Use of deprecated method foo + fooable.bar() + + +# https://github.com/python/typing/pull/1822#discussion_r1693991644 + +class Fooable2(Protocol): + + def foo(self) -> None: ... + + +class Concrete: + + @deprecated("Deprecated") + def foo(self) -> None: ... + + +def take_fooable(f: Fooable2) -> None: ... + + +def caller(c: Concrete) -> None: + take_fooable(c) # E?: Concrete is a Fooable2, but only because of a deprecated method From 55400b5935d1843c182f6cb7522261d269dc4f47 Mon Sep 17 00:00:00 2001 From: Eric Traut Date: Sat, 27 Jul 2024 19:01:05 -0700 Subject: [PATCH 039/308] Did a pass on the new deprecated tests to make them stylistically more consistent with existing tests. (#1823) * Ran code formatter * Moved import statements to top of module * Fixed spelling issues so code passes spell checking * Marked usage of imported deprecated symbol as an optional error --- .../results/mypy/directives_deprecated.toml | 17 ++--- conformance/results/mypy/version.toml | 2 +- .../results/pyre/directives_deprecated.toml | 17 ++--- conformance/results/pyre/version.toml | 2 +- .../pyright/directives_deprecated.toml | 29 +++++---- conformance/results/pyright/version.toml | 2 +- .../results/pytype/directives_deprecated.toml | 29 +++++---- conformance/results/pytype/version.toml | 2 +- conformance/results/results.html | 10 +-- .../tests/_directives_deprecated_library.py | 31 +++++---- conformance/tests/directives_deprecated.py | 64 ++++++++++--------- 11 files changed, 110 insertions(+), 95 deletions(-) diff --git a/conformance/results/mypy/directives_deprecated.toml b/conformance/results/mypy/directives_deprecated.toml index 9c7552b54..2442ee8f9 100644 --- a/conformance/results/mypy/directives_deprecated.toml +++ b/conformance/results/mypy/directives_deprecated.toml @@ -4,17 +4,18 @@ Does not support @deprecated. """ conformance_automated = "Fail" errors_diff = """ -Line 15: Expected 1 errors -Line 23: Expected 1 errors +Line 18: Expected 1 errors Line 24: Expected 1 errors -Line 29: Expected 1 errors -Line 40: Expected 1 errors +Line 25: Expected 1 errors +Line 30: Expected 1 errors Line 41: Expected 1 errors -Line 43: Expected 1 errors -Line 46: Expected 1 errors +Line 42: Expected 1 errors +Line 44: Expected 1 errors Line 47: Expected 1 errors -Line 57: Expected 1 errors -Line 87: Expected 1 errors +Line 48: Expected 1 errors +Line 58: Expected 1 errors +Line 69: Expected 1 errors +Line 98: Expected 1 errors """ output = """ """ diff --git a/conformance/results/mypy/version.toml b/conformance/results/mypy/version.toml index b79e0a27d..572ebc725 100644 --- a/conformance/results/mypy/version.toml +++ b/conformance/results/mypy/version.toml @@ -1,2 +1,2 @@ version = "mypy 1.11.0" -test_duration = 1.4 +test_duration = 1.2 diff --git a/conformance/results/pyre/directives_deprecated.toml b/conformance/results/pyre/directives_deprecated.toml index 9c7552b54..2442ee8f9 100644 --- a/conformance/results/pyre/directives_deprecated.toml +++ b/conformance/results/pyre/directives_deprecated.toml @@ -4,17 +4,18 @@ Does not support @deprecated. """ conformance_automated = "Fail" errors_diff = """ -Line 15: Expected 1 errors -Line 23: Expected 1 errors +Line 18: Expected 1 errors Line 24: Expected 1 errors -Line 29: Expected 1 errors -Line 40: Expected 1 errors +Line 25: Expected 1 errors +Line 30: Expected 1 errors Line 41: Expected 1 errors -Line 43: Expected 1 errors -Line 46: Expected 1 errors +Line 42: Expected 1 errors +Line 44: Expected 1 errors Line 47: Expected 1 errors -Line 57: Expected 1 errors -Line 87: Expected 1 errors +Line 48: Expected 1 errors +Line 58: Expected 1 errors +Line 69: Expected 1 errors +Line 98: Expected 1 errors """ output = """ """ diff --git a/conformance/results/pyre/version.toml b/conformance/results/pyre/version.toml index dc6693abb..001ddabac 100644 --- a/conformance/results/pyre/version.toml +++ b/conformance/results/pyre/version.toml @@ -1,2 +1,2 @@ version = "pyre 0.9.22" -test_duration = 1.8 +test_duration = 2.6 diff --git a/conformance/results/pyright/directives_deprecated.toml b/conformance/results/pyright/directives_deprecated.toml index 20cf127ad..7eabb891c 100644 --- a/conformance/results/pyright/directives_deprecated.toml +++ b/conformance/results/pyright/directives_deprecated.toml @@ -4,28 +4,29 @@ Does not report error for deprecated magic methods. """ conformance_automated = "Fail" errors_diff = """ -Line 40: Expected 1 errors Line 41: Expected 1 errors -Line 47: Expected 1 errors -Line 33: Unexpected errors ['directives_deprecated.py:33:7 - error: The class "Ham" is deprecated'] +Line 42: Expected 1 errors +Line 48: Expected 1 errors """ output = """ -directives_deprecated.py:15:44 - error: The class "Ham" is deprecated +directives_deprecated.py:18:44 - error: The class "Ham" is deprecated   Use Spam instead (reportDeprecated) -directives_deprecated.py:23:9 - error: The function "norwegian_blue" is deprecated -  It is pining for the fiords (reportDeprecated) -directives_deprecated.py:24:13 - error: The function "norwegian_blue" is deprecated -  It is pining for the fiords (reportDeprecated) -directives_deprecated.py:29:9 - error: The function "foo" is deprecated +directives_deprecated.py:24:9 - error: The function "norwegian_blue" is deprecated +  It is pining for the fjords (reportDeprecated) +directives_deprecated.py:25:13 - error: The function "norwegian_blue" is deprecated +  It is pining for the fjords (reportDeprecated) +directives_deprecated.py:30:9 - error: The function "foo" is deprecated   Only str will be allowed (reportDeprecated) -directives_deprecated.py:33:7 - error: The class "Ham" is deprecated +directives_deprecated.py:34:7 - error: The class "Ham" is deprecated   Use Spam instead (reportDeprecated) -directives_deprecated.py:43:6 - error: The getter for property "greasy" is deprecated +directives_deprecated.py:44:6 - error: The getter for property "greasy" is deprecated   All spam will be equally greasy (reportDeprecated) -directives_deprecated.py:46:6 - error: The setter for property "shape" is deprecated +directives_deprecated.py:47:6 - error: The setter for property "shape" is deprecated   Shapes are becoming immutable (reportDeprecated) -directives_deprecated.py:57:9 - error: The function "lorem" is deprecated +directives_deprecated.py:58:1 - error: The function "invocable" is deprecated   Deprecated (reportDeprecated) -directives_deprecated.py:87:13 - error: The method "foo" in class "Fooable" is deprecated +directives_deprecated.py:69:1 - error: The function "lorem" is deprecated +  Deprecated (reportDeprecated) +directives_deprecated.py:98:7 - error: The method "foo" in class "SupportsFoo1" is deprecated   Deprecated (reportDeprecated) """ diff --git a/conformance/results/pyright/version.toml b/conformance/results/pyright/version.toml index 4d7fa4a51..3229acb55 100644 --- a/conformance/results/pyright/version.toml +++ b/conformance/results/pyright/version.toml @@ -1,2 +1,2 @@ version = "pyright 1.1.373" -test_duration = 1.2 +test_duration = 1.4 diff --git a/conformance/results/pytype/directives_deprecated.toml b/conformance/results/pytype/directives_deprecated.toml index 9fb6a4dfa..8928ce99c 100644 --- a/conformance/results/pytype/directives_deprecated.toml +++ b/conformance/results/pytype/directives_deprecated.toml @@ -4,23 +4,24 @@ Does not support @deprecated. """ conformance_automated = "Fail" errors_diff = """ -Line 23: Expected 1 errors Line 24: Expected 1 errors -Line 29: Expected 1 errors -Line 40: Expected 1 errors +Line 25: Expected 1 errors +Line 30: Expected 1 errors Line 41: Expected 1 errors -Line 43: Expected 1 errors -Line 46: Expected 1 errors +Line 42: Expected 1 errors +Line 44: Expected 1 errors Line 47: Expected 1 errors -Line 57: Expected 1 errors -Line 87: Expected 1 errors -Line 16: Unexpected errors ['File "directives_deprecated.py", line 16, in : Can\\'t find module \\'_directives_deprecated_library\\'. [import-error]'] -Line 18: Unexpected errors ['File "directives_deprecated.py", line 18, in : typing_extensions.deprecated not supported yet [not-supported-yet]'] -Line 66: Unexpected errors ['File "directives_deprecated.py", line 66, in : typing.override not supported yet [not-supported-yet]'] +Line 48: Expected 1 errors +Line 58: Expected 1 errors +Line 69: Expected 1 errors +Line 98: Expected 1 errors +Line 10: Unexpected errors ['File "directives_deprecated.py", line 10, in : typing.override not supported yet [not-supported-yet]'] +Line 11: Unexpected errors ['File "directives_deprecated.py", line 11, in : typing_extensions.deprecated not supported yet [not-supported-yet]'] +Line 19: Unexpected errors ['File "directives_deprecated.py", line 19, in : Can\\'t find module \\'_directives_deprecated_library\\'. [import-error]'] """ output = """ -File "directives_deprecated.py", line 15, in : Can't find module '_directives_deprecated_library'. [import-error] -File "directives_deprecated.py", line 16, in : Can't find module '_directives_deprecated_library'. [import-error] -File "directives_deprecated.py", line 18, in : typing_extensions.deprecated not supported yet [not-supported-yet] -File "directives_deprecated.py", line 66, in : typing.override not supported yet [not-supported-yet] +File "directives_deprecated.py", line 10, in : typing.override not supported yet [not-supported-yet] +File "directives_deprecated.py", line 11, in : typing_extensions.deprecated not supported yet [not-supported-yet] +File "directives_deprecated.py", line 18, in : Can't find module '_directives_deprecated_library'. [import-error] +File "directives_deprecated.py", line 19, in : Can't find module '_directives_deprecated_library'. [import-error] """ diff --git a/conformance/results/pytype/version.toml b/conformance/results/pytype/version.toml index cf4474998..9f6eb2bc3 100644 --- a/conformance/results/pytype/version.toml +++ b/conformance/results/pytype/version.toml @@ -1,2 +1,2 @@ version = "pytype 2024.04.11" -test_duration = 30.0 +test_duration = 34.1 diff --git a/conformance/results/results.html b/conformance/results/results.html index fd3eec957..1dd007e00 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -159,16 +159,16 @@

    Python Type System Conformance Test Results

     
    mypy 1.11.0
    -
    1.0sec
    +
    1.4sec
    pyright 1.1.373
    -
    1.4sec
    +
    1.2sec
    pyre 0.9.22
    -
    2.5sec
    +
    1.8sec
    pytype 2024.04.11
    -
    32.7sec
    +
    30.0sec
    @@ -972,6 +972,12 @@

    Python Type System Conformance Test Results

    Pass
    Partial

    Does not reject a call to "cast" with additional arguments.

         directives_deprecated
    Unsupported

    Does not support @deprecated.

    Partial

    Does not report error for deprecated magic methods.

    Unsupported

    Does not support @deprecated.

    Unsupported

    Does not support @deprecated.

         directives_no_type_check
    Partial

    Does not honor `@no_type_check` class decorator (allowed).

    Does not reject invalid call of `@no_type_check` function.

    Pass*

    Does not honor `@no_type_check` class decorator (allowed).

    - + diff --git a/conformance/tests/_directives_deprecated_library.py b/conformance/tests/_directives_deprecated_library.py index efcc6dcfd..454f5d69e 100644 --- a/conformance/tests/_directives_deprecated_library.py +++ b/conformance/tests/_directives_deprecated_library.py @@ -3,42 +3,49 @@ """ from typing import Self, overload - from typing_extensions import deprecated @deprecated("Use Spam instead") -class Ham: ... +class Ham: + ... -@deprecated("It is pining for the fiords") -def norwegian_blue(x: int) -> int: ... +@deprecated("It is pining for the fjords") +def norwegian_blue(x: int) -> int: + ... @overload @deprecated("Only str will be allowed") -def foo(x: int) -> str: ... +def foo(x: int) -> str: + ... @overload -def foo(x: str) -> str: ... +def foo(x: str) -> str: + ... -def foo(x: int | str) -> str: ... +def foo(x: int | str) -> str: + ... class Spam: - @deprecated("There is enough spam in the world") - def __add__(self, other: object) -> Self: ... + def __add__(self, other: object) -> Self: + ... @property @deprecated("All spam will be equally greasy") - def greasy(self) -> float: ... + def greasy(self) -> float: + ... @property - def shape(self) -> str: ... + def shape(self) -> str: + ... @shape.setter @deprecated("Shapes are becoming immutable") - def shape(self, value: str) -> None: ... + def shape(self, value: str) -> None: + ... diff --git a/conformance/tests/directives_deprecated.py b/conformance/tests/directives_deprecated.py index cbae60547..e56b470c4 100644 --- a/conformance/tests/directives_deprecated.py +++ b/conformance/tests/directives_deprecated.py @@ -7,6 +7,9 @@ # Specification: https://typing.readthedocs.io/en/latest/spec/directives.html#deprecated # See also https://peps.python.org/pep-0702/ +from typing import Protocol, override +from typing_extensions import deprecated + # > Type checkers should produce a diagnostic whenever they encounter a usage of an object # > marked as deprecated. [...] For deprecated classes and functions, this includes: @@ -15,8 +18,6 @@ from _directives_deprecated_library import Ham # E: Use of deprecated class Ham import _directives_deprecated_library as library -from typing_extensions import deprecated - # > * References through module, class, or instance attributes @@ -30,7 +31,7 @@ library.foo("x") # OK -ham = Ham() # OK (already reported above) +ham = Ham() # E?: OK (already reported above) # > * Any syntax that indirectly triggers a call to the function. @@ -48,9 +49,10 @@ class Invocable: - @deprecated("Deprecated") - def __call__(self) -> None: ... + def __call__(self) -> None: + ... + invocable = Invocable() invocable() # E: Use of deprecated method __call__ @@ -58,11 +60,13 @@ def __call__(self) -> None: ... # > * Any usage of deprecated objects in their defining module + @deprecated("Deprecated") -def lorem() -> None: ... +def lorem() -> None: + ... -ipsum = lorem() # E: Use of deprecated function lorem +lorem() # E: Use of deprecated function lorem # > There are additional scenarios where deprecations could come into play. @@ -71,46 +75,46 @@ def lorem() -> None: ... # > As scenarios such as this one appear complex and relatively unlikely to come up in practice, # > this PEP does not mandate that type checkers detect them. -from typing import Protocol, override - - -class Fooable(Protocol): +class SupportsFoo1(Protocol): @deprecated("Deprecated") - def foo(self) -> None: ... - - def bar(self) -> None: ... + def foo(self) -> None: + ... + def bar(self) -> None: + ... -class Fooer(Fooable): +class FooConcrete1(SupportsFoo1): @override def foo(self) -> None: # E?: Implementation of deprecated method foo ... - def bar(self) -> None: ... - - -def foo_it(fooable: Fooable) -> None: - fooable.foo() # E: Use of deprecated method foo - fooable.bar() - + def bar(self) -> None: + ... -# https://github.com/python/typing/pull/1822#discussion_r1693991644 -class Fooable2(Protocol): +def foo_it(f: SupportsFoo1) -> None: + f.foo() # E: Use of deprecated method foo + f.bar() - def foo(self) -> None: ... +class SupportsFoo2(Protocol): + def foo(self) -> None: + ... -class Concrete: +class FooConcrete2: @deprecated("Deprecated") - def foo(self) -> None: ... + def foo(self) -> None: + ... -def take_fooable(f: Fooable2) -> None: ... +def takes_foo(f: SupportsFoo2) -> None: + ... -def caller(c: Concrete) -> None: - take_fooable(c) # E?: Concrete is a Fooable2, but only because of a deprecated method +def caller(c: FooConcrete2) -> None: + takes_foo( + c + ) # E?: FooConcrete2 is a SupportsFoo2, but only because of a deprecated method From 9648576f85dc73b7559563ec185c991276c3aa28 Mon Sep 17 00:00:00 2001 From: Eric Traut Date: Wed, 31 Jul 2024 08:39:22 -0700 Subject: [PATCH 040/308] Updated conformance results for pyright 1.1.374. (#1827) This release included a fix for a conformance issue in the `deprecated` test. All other output changes are due to updates to error messages and do not affect conformance results. --- conformance/results/mypy/version.toml | 4 ++-- conformance/results/pyre/version.toml | 2 +- .../results/pyright/constructors_call_init.toml | 8 ++++---- .../results/pyright/dataclasses_usage.toml | 4 ++-- .../results/pyright/directives_deprecated.toml | 16 ++++++++-------- .../pyright/generics_paramspec_components.toml | 6 +++--- .../pyright/generics_syntax_declarations.toml | 4 +++- .../pyright/generics_typevartuple_basic.toml | 13 +++++++------ .../results/pyright/literals_literalstring.toml | 3 ++- .../results/pyright/protocols_generic.toml | 2 +- conformance/results/pyright/version.toml | 2 +- conformance/results/pytype/version.toml | 2 +- conformance/results/results.html | 12 ++++++------ 13 files changed, 41 insertions(+), 37 deletions(-) diff --git a/conformance/results/mypy/version.toml b/conformance/results/mypy/version.toml index 572ebc725..16d49db2c 100644 --- a/conformance/results/mypy/version.toml +++ b/conformance/results/mypy/version.toml @@ -1,2 +1,2 @@ -version = "mypy 1.11.0" -test_duration = 1.2 +version = "mypy 1.11.1" +test_duration = 1.0 diff --git a/conformance/results/pyre/version.toml b/conformance/results/pyre/version.toml index 001ddabac..9edd31afe 100644 --- a/conformance/results/pyre/version.toml +++ b/conformance/results/pyre/version.toml @@ -1,2 +1,2 @@ version = "pyre 0.9.22" -test_duration = 2.6 +test_duration = 1.4 diff --git a/conformance/results/pyright/constructors_call_init.toml b/conformance/results/pyright/constructors_call_init.toml index 948899c05..dc74b3f90 100644 --- a/conformance/results/pyright/constructors_call_init.toml +++ b/conformance/results/pyright/constructors_call_init.toml @@ -5,10 +5,10 @@ errors_diff = """ output = """ constructors_call_init.py:21:13 - error: Argument of type "float" cannot be assigned to parameter "x" of type "int" in function "__init__"   "float" is incompatible with "int" (reportArgumentType) -constructors_call_init.py:42:8 - error: Argument of type "Class2[int]" cannot be assigned to parameter "x" of type "Class3 | None" in function "__init__" -  Type "Class2[int]" is incompatible with type "Class3 | None" -    "Class2[int]" is incompatible with "Class3" -    "Class2[int]" is incompatible with "None" (reportArgumentType) +constructors_call_init.py:42:8 - error: Argument of type "Class2[Unknown]" cannot be assigned to parameter "x" of type "Class3 | None" in function "__init__" +  Type "Class2[Unknown]" is incompatible with type "Class3 | None" +    "Class2[Unknown]" is incompatible with "Class3" +    "Class2[Unknown]" is incompatible with "None" (reportArgumentType) constructors_call_init.py:56:1 - error:   Could not bind method "__init__" because "Class4[str]" is not assignable to parameter "self"     "Class4[str]" is incompatible with "Class4[int]" diff --git a/conformance/results/pyright/dataclasses_usage.toml b/conformance/results/pyright/dataclasses_usage.toml index 203a1b40d..cb3906bf0 100644 --- a/conformance/results/pyright/dataclasses_usage.toml +++ b/conformance/results/pyright/dataclasses_usage.toml @@ -8,8 +8,8 @@ dataclasses_usage.py:61:5 - error: Fields without default values cannot appear a dataclasses_usage.py:67:5 - error: Fields without default values cannot appear after fields with default values (reportGeneralTypeIssues) dataclasses_usage.py:73:5 - error: Fields without default values cannot appear after fields with default values (reportGeneralTypeIssues) dataclasses_usage.py:83:13 - error: Expected 1 positional argument (reportCallIssue) -dataclasses_usage.py:88:36 - error: Argument of type "type[str]" cannot be assigned to parameter "default_factory" of type "() -> _T@field" in function "field" -  No overloaded function matches type "() -> int" (reportArgumentType) +dataclasses_usage.py:88:14 - error: Expression of type "str" is incompatible with declared type "int" +  "str" is incompatible with "int" (reportAssignmentType) dataclasses_usage.py:127:8 - error: Expected 1 positional argument (reportCallIssue) dataclasses_usage.py:130:1 - error: Argument missing for parameter "y" (reportCallIssue) dataclasses_usage.py:179:6 - error: Expected 0 positional arguments (reportCallIssue) diff --git a/conformance/results/pyright/directives_deprecated.toml b/conformance/results/pyright/directives_deprecated.toml index 7eabb891c..21cb8172a 100644 --- a/conformance/results/pyright/directives_deprecated.toml +++ b/conformance/results/pyright/directives_deprecated.toml @@ -1,12 +1,6 @@ -conformant = "Partial" -notes = """ -Does not report error for deprecated magic methods. -""" -conformance_automated = "Fail" +conformant = "Pass" +conformance_automated = "Pass" errors_diff = """ -Line 41: Expected 1 errors -Line 42: Expected 1 errors -Line 48: Expected 1 errors """ output = """ directives_deprecated.py:18:44 - error: The class "Ham" is deprecated @@ -19,10 +13,16 @@ directives_deprecated.py:30:9 - error: The function "foo" is deprecated   Only str will be allowed (reportDeprecated) directives_deprecated.py:34:7 - error: The class "Ham" is deprecated   Use Spam instead (reportDeprecated) +directives_deprecated.py:41:5 - error: The method "__add__" in class "Spam" is deprecated +  There is enough spam in the world (reportDeprecated) +directives_deprecated.py:42:1 - error: The method "__add__" in class "Spam" is deprecated +  There is enough spam in the world (reportDeprecated) directives_deprecated.py:44:6 - error: The getter for property "greasy" is deprecated   All spam will be equally greasy (reportDeprecated) directives_deprecated.py:47:6 - error: The setter for property "shape" is deprecated   Shapes are becoming immutable (reportDeprecated) +directives_deprecated.py:48:6 - error: The setter for property "shape" is deprecated +  Shapes are becoming immutable (reportDeprecated) directives_deprecated.py:58:1 - error: The function "invocable" is deprecated   Deprecated (reportDeprecated) directives_deprecated.py:69:1 - error: The function "lorem" is deprecated diff --git a/conformance/results/pyright/generics_paramspec_components.toml b/conformance/results/pyright/generics_paramspec_components.toml index 19def1687..fb7b7d5b3 100644 --- a/conformance/results/pyright/generics_paramspec_components.toml +++ b/conformance/results/pyright/generics_paramspec_components.toml @@ -12,10 +12,10 @@ generics_paramspec_components.py:36:20 - error: "kwargs" attribute of ParamSpec generics_paramspec_components.py:38:26 - error: "args" and "kwargs" attributes of ParamSpec must both appear within a function signature (reportGeneralTypeIssues) generics_paramspec_components.py:41:31 - error: "args" and "kwargs" attributes of ParamSpec must both appear within a function signature (reportGeneralTypeIssues) generics_paramspec_components.py:49:9 - error: Arguments for ParamSpec "P@decorator" are missing (reportCallIssue) -generics_paramspec_components.py:51:11 - error: Arguments for ParamSpec "P@decorator" are missing (reportCallIssue) +generics_paramspec_components.py:51:11 - error: Expected 0 positional arguments (reportCallIssue) generics_paramspec_components.py:60:28 - error: Keyword parameter "s" cannot appear in signature after ParamSpec args parameter (reportGeneralTypeIssues) -generics_paramspec_components.py:70:12 - error: Expected 2 positional arguments (reportCallIssue) -generics_paramspec_components.py:72:12 - error: Expected 2 positional arguments (reportCallIssue) +generics_paramspec_components.py:70:12 - error: Expected 1 positional argument (reportCallIssue) +generics_paramspec_components.py:72:12 - error: Expected 1 positional argument (reportCallIssue) generics_paramspec_components.py:83:19 - error: Expected 1 positional argument (reportCallIssue) generics_paramspec_components.py:98:20 - error: Argument of type "Literal['A']" cannot be assigned to parameter "a" of type "int"   "Literal['A']" is incompatible with "int" (reportArgumentType) diff --git a/conformance/results/pyright/generics_syntax_declarations.toml b/conformance/results/pyright/generics_syntax_declarations.toml index 1d8d11f14..93995d626 100644 --- a/conformance/results/pyright/generics_syntax_declarations.toml +++ b/conformance/results/pyright/generics_syntax_declarations.toml @@ -5,10 +5,12 @@ generics_syntax_declarations.py:27:20 - error: Type arguments are not allowed wi generics_syntax_declarations.py:34:11 - error: Cannot access attribute "is_integer" for class "str*"   Attribute "is_integer" is unknown (reportAttributeAccessIssue) generics_syntax_declarations.py:46:21 - error: TypeVar constraint type cannot be generic (reportGeneralTypeIssues) +generics_syntax_declarations.py:50:17 - error: List expression not allowed in type annotation +  Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) generics_syntax_declarations.py:50:17 - error: Expected class but received "list[Unknown]" (reportGeneralTypeIssues) generics_syntax_declarations.py:62:17 - error: TypeVar must have at least two constrained types (reportGeneralTypeIssues) generics_syntax_declarations.py:66:17 - error: TypeVar must have at least two constrained types (reportGeneralTypeIssues) -generics_syntax_declarations.py:73:17 - error: Expected class but received "tuple[type[bytes], type[str]]" (reportGeneralTypeIssues) +generics_syntax_declarations.py:73:17 - error: Variable not allowed in type expression (reportInvalidTypeForm) generics_syntax_declarations.py:77:18 - error: Expected class but received "Literal[3]" (reportGeneralTypeIssues) generics_syntax_declarations.py:81:23 - error: "S" is not defined (reportUndefinedVariable) """ diff --git a/conformance/results/pyright/generics_typevartuple_basic.toml b/conformance/results/pyright/generics_typevartuple_basic.toml index 473996f4d..03878ccf0 100644 --- a/conformance/results/pyright/generics_typevartuple_basic.toml +++ b/conformance/results/pyright/generics_typevartuple_basic.toml @@ -1,12 +1,13 @@ conformant = "Pass" output = """ generics_typevartuple_basic.py:42:34 - error: Argument of type "Height" cannot be assigned to parameter "shape" of type "tuple[*Shape@Array]" in function "__init__" -  "Height" is incompatible with "tuple[Height, Width]" (reportArgumentType) -generics_typevartuple_basic.py:43:52 - error: Argument of type "tuple[Batch, Width]" cannot be assigned to parameter "shape" of type "tuple[*Shape@Array]" in function "__init__" -  "Width" is incompatible with "Height" (reportArgumentType) -generics_typevartuple_basic.py:45:5 - error: Argument of type "tuple[Time, Batch, Width, Height]" cannot be assigned to parameter "shape" of type "tuple[*Shape@Array]" in function "__init__" -  "Width" is incompatible with "Height" -  "Height" is incompatible with "Width" (reportArgumentType) +  "Height" is incompatible with "tuple[*Shape@Array]" (reportArgumentType) +generics_typevartuple_basic.py:43:35 - error: Expression of type "Array[Batch, Width]" is incompatible with declared type "Array[Batch, Height, Width]" +  "Array[Batch, Width]" is incompatible with "Array[Batch, Height, Width]" +    Type parameter "Shape@Array" is invariant, but "*tuple[Batch, Width]" is not the same as "*tuple[Batch, Height, Width]" (reportAssignmentType) +generics_typevartuple_basic.py:44:41 - error: Expression of type "Array[Time, Batch, Width, Height]" is incompatible with declared type "Array[Time, Batch, Height, Width]" +  "Array[Time, Batch, Width, Height]" is incompatible with "Array[Time, Batch, Height, Width]" +    Type parameter "Shape@Array" is invariant, but "*tuple[Time, Batch, Width, Height]" is not the same as "*tuple[Time, Batch, Height, Width]" (reportAssignmentType) generics_typevartuple_basic.py:52:22 - error: Expected unpacked TypeVarTuple; use Unpack[Shape] or *Shape (reportInvalidTypeForm) generics_typevartuple_basic.py:53:37 - error: Expected unpacked TypeVarTuple; use Unpack[Shape] or *Shape (reportInvalidTypeForm) generics_typevartuple_basic.py:56:34 - error: Expected unpacked TypeVarTuple; use Unpack[Shape] or *Shape (reportInvalidTypeForm) diff --git a/conformance/results/pyright/literals_literalstring.toml b/conformance/results/pyright/literals_literalstring.toml index 954e57640..7c1778def 100644 --- a/conformance/results/pyright/literals_literalstring.toml +++ b/conformance/results/pyright/literals_literalstring.toml @@ -14,7 +14,8 @@ literals_literalstring.py:120:22 - error: Argument of type "str" cannot be assig   Type "str" is incompatible with type "LiteralString"     "str" is incompatible with "LiteralString" (reportArgumentType) literals_literalstring.py:134:51 - error: Argument of type "str" cannot be assigned to parameter "value" of type "T@Container" in function "__init__" -  "str" is incompatible with "LiteralString" (reportArgumentType) +  Type "str" is incompatible with type "LiteralString" +    "str" is incompatible with "LiteralString" (reportArgumentType) literals_literalstring.py:171:21 - error: Expression of type "list[LiteralString]" is incompatible with declared type "list[str]"   "list[LiteralString]" is incompatible with "list[str]"     Type parameter "_T@list" is invariant, but "LiteralString" is not the same as "str" diff --git a/conformance/results/pyright/protocols_generic.toml b/conformance/results/pyright/protocols_generic.toml index d91d76bb7..6e653d432 100644 --- a/conformance/results/pyright/protocols_generic.toml +++ b/conformance/results/pyright/protocols_generic.toml @@ -36,7 +36,7 @@ protocols_generic.py:147:25 - error: Expression of type "ConcreteHasProperty4" i     "m" is an incompatible type       Type "(item: str, callback: (int) -> str) -> str" is incompatible with type "(item: T@m, callback: (T@m) -> str) -> str"         Parameter 2: type "(T@m) -> str" is incompatible with type "(int) -> str" -          Type "(T@m) -> str" is incompatible with type "(int) -> str" (reportAssignmentType) +          Type "(str) -> str" is incompatible with type "(int) -> str" (reportAssignmentType) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/version.toml b/conformance/results/pyright/version.toml index 3229acb55..d42c58924 100644 --- a/conformance/results/pyright/version.toml +++ b/conformance/results/pyright/version.toml @@ -1,2 +1,2 @@ -version = "pyright 1.1.373" +version = "pyright 1.1.374" test_duration = 1.4 diff --git a/conformance/results/pytype/version.toml b/conformance/results/pytype/version.toml index 9f6eb2bc3..3d4b9cdd9 100644 --- a/conformance/results/pytype/version.toml +++ b/conformance/results/pytype/version.toml @@ -1,2 +1,2 @@ version = "pytype 2024.04.11" -test_duration = 34.1 +test_duration = 31.4 diff --git a/conformance/results/results.html b/conformance/results/results.html index 1dd007e00..6fc374742 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -158,17 +158,17 @@

    Python Type System Conformance Test Results

     
    mypy 1.11.0
    -
    1.4sec
    +
    1.2sec
    pyright 1.1.373
    -
    1.2sec
    +
    1.4sec
    pyre 0.9.22
    -
    1.8sec
    +
    2.6sec
    pytype 2024.04.11
    -
    30.0sec
    +
    34.1sec
    @@ -987,7 +987,7 @@

    Python Type System Conformance Test Results

         directives_reveal_type Pass Pass
    Partial

    "

    Produces errors rather than warnings on `reveal_type`.

    Partial

    Produces errors rather than warnings on `reveal_type`.

    Partial

    Does not reject call to reveal_type with zero arguments.

    Does not reject call to reveal_type with too many arguments.

         directives_type_checking
    - - - + From 947f9e6bef2b23b63ee4de15c35ee0cba8be50fc Mon Sep 17 00:00:00 2001 From: Rebecca Chen Date: Wed, 31 Jul 2024 23:51:42 -0700 Subject: [PATCH 041/308] Move some more stub author guidance from Type Stubs to Writing Stubs. (#1826) See https://github.com/python/typing/pull/1815 for context. --- docs/guides/writing_stubs.rst | 67 +++++++++++++++++++++++++++++++++++ docs/reference/stubs.rst | 59 ++---------------------------- 2 files changed, 69 insertions(+), 57 deletions(-) diff --git a/docs/guides/writing_stubs.rst b/docs/guides/writing_stubs.rst index 08760c8d4..1d1af9172 100644 --- a/docs/guides/writing_stubs.rst +++ b/docs/guides/writing_stubs.rst @@ -337,6 +337,46 @@ No:: DAY_FLAG: int NIGHT_FLAG: int +Overloads +--------- + +All variants of overloaded functions and methods must have an ``@overload`` +decorator. Do not include the implementation's final non-`@overload`-decorated +definition. + +Yes:: + + @overload + def foo(x: str) -> str: ... + @overload + def foo(x: float) -> int: ... + +No:: + + @overload + def foo(x: str) -> str: ... + @overload + def foo(x: float) -> int: ... + def foo(x: str | float) -> Any: ... + +Decorators +---------- + +Include only the decorators listed :ref:`here `, whose effects +are understood by all of the major type checkers. The behavior of other +decorators should instead be incorporated into the types. For example, for the +following function:: + + import contextlib + @contextlib.contextmanager + def f(): + yield 42 + +the stub definition should be:: + + from contextlib import AbstractContextManager + def f() -> AbstractContextManager[int]: ... + Documentation or Implementation ------------------------------- @@ -581,3 +621,30 @@ No:: from typing import NamedTuple, TypedDict Point = NamedTuple("Point", [('x', float), ('y', float)]) Thing = TypedDict("Thing", {'stuff': str, 'index': int}) + +Built-in Generics +----------------- + +:pep:`585` built-in generics are supported and should be used instead +of the corresponding types from ``typing``:: + + from collections import defaultdict + + def foo(t: type[MyClass]) -> list[int]: ... + x: defaultdict[int] + +Using imports from ``collections.abc`` instead of ``typing`` is +generally possible and recommended:: + + from collections.abc import Iterable + + def foo(iter: Iterable[int]) -> None: ... + +Unions +------ + +Declaring unions with the shorthand `|` syntax is recommended and supported by +all type checkers:: + + def foo(x: int | str) -> int | None: ... # recommended + def foo(x: Union[int, str]) -> Optional[int]: ... # ok diff --git a/docs/reference/stubs.rst b/docs/reference/stubs.rst index a3a456a04..aac21f982 100644 --- a/docs/reference/stubs.rst +++ b/docs/reference/stubs.rst @@ -165,33 +165,6 @@ specified in ``__all__`` are imported:: Type checkers support cyclic imports in stub files. -Built-in Generics ------------------ - -:pep:`585` built-in generics are supported and should be used instead -of the corresponding types from ``typing``:: - - from collections import defaultdict - - def foo(t: type[MyClass]) -> list[int]: ... - x: defaultdict[int] - -Using imports from ``collections.abc`` instead of ``typing`` is -generally possible and recommended:: - - from collections.abc import Iterable - - def foo(iter: Iterable[int]) -> None: ... - -Unions ------- - -Declaring unions with the shorthand syntax or ``Union`` and ``Optional`` is -supported by all type checkers:: - - def foo(x: int | str) -> int | None: ... # recommended - def foo(x: Union[int, str]) -> Optional[int]: ... # ok - Module Level Attributes ----------------------- @@ -325,23 +298,6 @@ individual type checkers how to interpret them:: def foo(): ... # compatible def bar(): pass # behavior undefined -All variants of overloaded functions and methods must have an ``@overload`` -decorator:: - - @overload - def foo(x: str) -> str: ... - @overload - def foo(x: float) -> int: ... - -The following (which would be used in the implementation) is wrong in -type stubs:: - - @overload - def foo(x: str) -> str: ... - @overload - def foo(x: float) -> int: ... - def foo(x: str | float) -> Any: ... - Aliases and NewType ------------------- @@ -378,6 +334,8 @@ generic class definitions. ``typing.NewType`` is also supported in stubs. +.. _stub-decorators: + Decorators ---------- @@ -391,19 +349,6 @@ fixed set of additional ones: * ``dataclasses.dataclass`` * ``asyncio.coroutine`` (although ``async`` should be used instead) -The behavior of other decorators should instead be incorporated into the types. -For example, for the following function:: - - import contextlib - @contextlib.contextmanager - def f(): - yield 42 - -the stub definition should be:: - - from contextlib import AbstractContextManager - def f() -> AbstractContextManager[int]: ... - Version and Platform Checks --------------------------- From 0b4e1aabf81ab96aea92a721b3b78c8b7674f5c9 Mon Sep 17 00:00:00 2001 From: Danny Yang Date: Mon, 5 Aug 2024 17:51:03 -0400 Subject: [PATCH 042/308] Ignore reveal_type errors when parsing Pyre output (#1832) --- conformance/results/mypy/version.toml | 2 +- conformance/results/pyre/constructors_callable.toml | 10 ---------- conformance/results/pyre/directives_reveal_type.toml | 5 +---- conformance/results/pyre/enums_members.toml | 1 - conformance/results/pyre/version.toml | 2 +- conformance/results/pyright/version.toml | 2 +- conformance/results/pytype/version.toml | 2 +- conformance/results/results.html | 8 ++++---- conformance/src/type_checker.py | 3 +++ 9 files changed, 12 insertions(+), 23 deletions(-) diff --git a/conformance/results/mypy/version.toml b/conformance/results/mypy/version.toml index 16d49db2c..efd7c7998 100644 --- a/conformance/results/mypy/version.toml +++ b/conformance/results/mypy/version.toml @@ -1,2 +1,2 @@ version = "mypy 1.11.1" -test_duration = 1.0 +test_duration = 13.2 diff --git a/conformance/results/pyre/constructors_callable.toml b/conformance/results/pyre/constructors_callable.toml index 6ab0dffa6..554365e17 100644 --- a/conformance/results/pyre/constructors_callable.toml +++ b/conformance/results/pyre/constructors_callable.toml @@ -11,26 +11,16 @@ Line 127: Expected 1 errors Line 144: Expected 1 errors Line 184: Expected 1 errors Line 195: Expected 1 errors -Line 36: Unexpected errors ['constructors_callable.py:36:0 Revealed type [-1]: Revealed type for `r1` is `typing.Callable[[Named(x, int)], Class1]`.'] -Line 49: Unexpected errors ['constructors_callable.py:49:0 Revealed type [-1]: Revealed type for `r2` is `typing.Callable[[], Class2]`.'] -Line 63: Unexpected errors ['constructors_callable.py:63:0 Revealed type [-1]: Revealed type for `r3` is `typing.Callable[[Named(x, int)], Class3]`.'] -Line 77: Unexpected errors ['constructors_callable.py:77:0 Revealed type [-1]: Revealed type for `r4` is `typing.Callable[[Named(x, int)], Class4]`.'] Line 78: Unexpected errors ['constructors_callable.py:78:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `Class4`.'] -Line 97: Unexpected errors ['constructors_callable.py:97:0 Revealed type [-1]: Revealed type for `r5` is `typing.Callable[[Variable(typing.Any), Keywords(typing.Any)], NoReturn]`.'] -Line 125: Unexpected errors ['constructors_callable.py:125:0 Revealed type [-1]: Revealed type for `r6` is `typing.Callable[[Named(x, int)], Class6]`.'] Line 126: Unexpected errors ['constructors_callable.py:126:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Class6Proxy` but got `Class6`.', 'constructors_callable.py:126:12 Missing argument [20]: PositionalOnly call expects argument `x`.'] -Line 142: Unexpected errors ['constructors_callable.py:142:0 Revealed type [-1]: Revealed type for `r6_any` is `typing.Callable[[Named(x, int)], Class6Any]`.'] Line 143: Unexpected errors ['constructors_callable.py:143:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing.Any` but got `Class6Any`.', 'constructors_callable.py:143:12 Missing argument [20]: PositionalOnly call expects argument `x`.'] Line 153: Unexpected errors ['constructors_callable.py:153:4 Incompatible overload [43]: The implementation of `Class7.__init__` does not accept all possible arguments of overload defined on line `153`.'] Line 155: Unexpected errors ['constructors_callable.py:155:4 Incompatible overload [43]: The implementation of `Class7.__init__` does not accept all possible arguments of overload defined on line `155`.'] -Line 161: Unexpected errors ['constructors_callable.py:161:0 Revealed type [-1]: Revealed type for `r7` is `typing.Callable[[Named(x, int)], Class7[typing.Any]]`.'] Line 164: Unexpected errors ['constructors_callable.py:164:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Class7[int]` but got `Class7[typing.Any]`.'] Line 165: Unexpected errors ['constructors_callable.py:165:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Class7[str]` but got `Class7[typing.Any]`.', 'constructors_callable.py:165:15 Incompatible parameter type [6]: In anonymous call, for 1st positional argument, expected `int` but got `str`.'] Line 181: Unexpected errors ['constructors_callable.py:181:22 Incompatible parameter type [6]: In call `accepts_callable`, for 1st positional argument, expected `typing.Callable[constructors_callable.P, Variable[R]]` but got `Type[Class8]`.'] -Line 182: Unexpected errors ['constructors_callable.py:182:0 Revealed type [-1]: Revealed type for `r8` is `typing.Callable[..., typing.Any]`.'] Line 183: Unexpected errors ['constructors_callable.py:183:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Class8[str]` but got `typing.Any`.'] Line 192: Unexpected errors ['constructors_callable.py:192:22 Incompatible parameter type [6]: In call `accepts_callable`, for 1st positional argument, expected `typing.Callable[constructors_callable.P, Variable[R]]` but got `Type[Class9]`.'] -Line 193: Unexpected errors ['constructors_callable.py:193:0 Revealed type [-1]: Revealed type for `r9` is `typing.Callable[..., typing.Any]`.'] Line 194: Unexpected errors ['constructors_callable.py:194:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Class9` but got `typing.Any`.'] """ output = """ diff --git a/conformance/results/pyre/directives_reveal_type.toml b/conformance/results/pyre/directives_reveal_type.toml index ed30bc74f..492d32b28 100644 --- a/conformance/results/pyre/directives_reveal_type.toml +++ b/conformance/results/pyre/directives_reveal_type.toml @@ -12,8 +12,5 @@ directives_reveal_type.py:20:4 Revealed type [-1]: Revealed type for `a` is `typ """ conformance_automated = "Fail" errors_diff = """ -Line 14: Unexpected errors ['directives_reveal_type.py:14:4 Revealed type [-1]: Revealed type for `a` is `typing.Union[int, str]`.'] -Line 15: Unexpected errors ['directives_reveal_type.py:15:4 Revealed type [-1]: Revealed type for `b` is `typing.List[int]`.'] -Line 16: Unexpected errors ['directives_reveal_type.py:16:4 Revealed type [-1]: Revealed type for `c` is `typing.Any`.'] -Line 17: Unexpected errors ['directives_reveal_type.py:17:4 Revealed type [-1]: Revealed type for `d` is `ForwardReference`.'] +Line 20: Expected 1 errors """ diff --git a/conformance/results/pyre/enums_members.toml b/conformance/results/pyre/enums_members.toml index 914ecb99f..34529ba59 100644 --- a/conformance/results/pyre/enums_members.toml +++ b/conformance/results/pyre/enums_members.toml @@ -22,7 +22,6 @@ Line 35: Unexpected errors ['enums_members.py:35:0 Incompatible parameter type [ Line 36: Unexpected errors ['enums_members.py:36:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `Pet2`.'] Line 100: Unexpected errors ['enums_members.py:100:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[TrafficLight.YELLOW]` but got `typing_extensions.Literal[TrafficLight.AMBER]`.'] Line 117: Unexpected errors ['enums_members.py:117:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[Example.c]` but got `member[typing.Callable(Example.c)[[Named(self, Example)], None]]`.'] -Line 128: Unexpected errors ['enums_members.py:128:8 Revealed type [-1]: Revealed type for `enums_members.Example2._Example2__B` is `typing_extensions.Literal[Example2._Example2__B]` (final).'] Line 139: Unexpected errors ['enums_members.py:139:4 Inconsistent override [15]: `_ignore_` overrides attribute defined in `Enum` inconsistently. Type `Pet5` is not a subtype of the overridden attribute `typing.Union[typing.List[str], str]`.'] """ output = """ diff --git a/conformance/results/pyre/version.toml b/conformance/results/pyre/version.toml index 9edd31afe..9de046bf2 100644 --- a/conformance/results/pyre/version.toml +++ b/conformance/results/pyre/version.toml @@ -1,2 +1,2 @@ version = "pyre 0.9.22" -test_duration = 1.4 +test_duration = 5.4 diff --git a/conformance/results/pyright/version.toml b/conformance/results/pyright/version.toml index d42c58924..7cda8a2ff 100644 --- a/conformance/results/pyright/version.toml +++ b/conformance/results/pyright/version.toml @@ -1,2 +1,2 @@ version = "pyright 1.1.374" -test_duration = 1.4 +test_duration = 1.5 diff --git a/conformance/results/pytype/version.toml b/conformance/results/pytype/version.toml index 3d4b9cdd9..a03e3ca2e 100644 --- a/conformance/results/pytype/version.toml +++ b/conformance/results/pytype/version.toml @@ -1,2 +1,2 @@ version = "pytype 2024.04.11" -test_duration = 31.4 +test_duration = 35.2 diff --git a/conformance/results/results.html b/conformance/results/results.html index 6fc374742..f6bfa00cb 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -159,16 +159,16 @@

    Python Type System Conformance Test Results

     
    mypy 1.11.0
    -
    1.2sec
    +
    mypy 1.11.1
    +
    1.0sec
    pyright 1.1.373
    +
    pyright 1.1.374
    1.4sec
    pyre 0.9.22
    -
    2.6sec
    +
    1.4sec
    pytype 2024.04.11
    -
    34.1sec
    +
    31.4sec
    @@ -974,7 +974,7 @@

    Python Type System Conformance Test Results

         directives_deprecated
    Unsupported

    Does not support @deprecated.

    Partial

    Does not report error for deprecated magic methods.

    Pass
    Unsupported

    Does not support @deprecated.

    Unsupported

    Does not support @deprecated.

    - + @@ -1173,7 +1173,12 @@

    Python Type System Conformance Test Results

    - + @@ -1221,7 +1226,7 @@

    Python Type System Conformance Test Results

    - + @@ -1349,11 +1354,11 @@

    Python Type System Conformance Test Results

    - @@ -1383,12 +1388,7 @@

    Python Type System Conformance Test Results

    - + @@ -1481,7 +1481,7 @@

    Python Type System Conformance Test Results

    - + @@ -2615,7 +2615,7 @@

    Python Type System Conformance Test Results

    - + diff --git a/conformance/results/ty/aliases_newtype.toml b/conformance/results/ty/aliases_newtype.toml index 6b23739e2..5c846860c 100644 --- a/conformance/results/ty/aliases_newtype.toml +++ b/conformance/results/ty/aliases_newtype.toml @@ -5,7 +5,7 @@ output = """ aliases_newtype.py:11:8: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal["user"]` aliases_newtype.py:12:14: error[invalid-assignment] Object of type `Literal[42]` is not assignable to `UserId` aliases_newtype.py:18:11: error[invalid-assignment] Object of type `` is not assignable to `type` -aliases_newtype.py:23:16: error[invalid-argument-type] Argument to function `isinstance` is incorrect: Expected `type | UnionType | tuple[Divergent, ...]`, found `` +aliases_newtype.py:23:16: error[invalid-argument-type] Argument to function `isinstance` is incorrect: Expected `_ClassInfo`, found `` aliases_newtype.py:26:21: error[invalid-base] Cannot subclass an instance of NewType aliases_newtype.py:35:20: error[mismatched-type-name] The name passed to `NewType` must match the variable it is assigned to: Expected "GoodName", got "BadName" aliases_newtype.py:41:6: error[invalid-type-form] `GoodNewType1` is a `NewType` and cannot be specialized diff --git a/conformance/results/ty/aliases_recursive.toml b/conformance/results/ty/aliases_recursive.toml index b74c97b2a..fb46159ed 100644 --- a/conformance/results/ty/aliases_recursive.toml +++ b/conformance/results/ty/aliases_recursive.toml @@ -1,17 +1,20 @@ conformance_automated = "Fail" -conformant = "Unsupported" +conformant = "Partial" +notes = """ +Does not reject invalid cyclic type alias definitions. +""" errors_diff = """ -Line 19: Expected 1 errors -Line 20: Expected 1 errors -Line 38: Expected 1 errors -Line 39: Expected 1 errors -Line 50: Expected 1 errors -Line 51: Expected 1 errors -Line 52: Expected 1 errors -Line 63: Expected 1 errors -Line 69: Expected 1 errors Line 72: Expected 1 errors Line 75: Expected 1 errors """ output = """ +aliases_recursive.py:19:12: error[invalid-assignment] Object of type `dict[str, None | complex | str | list[Json] | dict[str, Json]]` is not assignable to `Json` +aliases_recursive.py:20:12: error[invalid-assignment] Object of type `list[None | complex | str | list[Json] | dict[str, Json]]` is not assignable to `Json` +aliases_recursive.py:38:22: error[invalid-assignment] Object of type `tuple[Literal[1], tuple[Literal["1"], Literal[1]], tuple[Literal[1], tuple[Literal[1], list[int]]]]` is not assignable to `RecursiveTuple` +aliases_recursive.py:39:22: error[invalid-assignment] Object of type `tuple[Literal[1], list[int]]` is not assignable to `RecursiveTuple` +aliases_recursive.py:50:24: error[invalid-assignment] Object of type `dict[str, list[int]]` is not assignable to `RecursiveMapping` +aliases_recursive.py:51:24: error[invalid-assignment] Object of type `dict[str, str | int | list[int]]` is not assignable to `RecursiveMapping` +aliases_recursive.py:52:24: error[invalid-assignment] Object of type `dict[str, str | int | dict[str, str | int | list[int]]]` is not assignable to `RecursiveMapping` +aliases_recursive.py:63:30: error[invalid-assignment] Object of type `list[list[GenericTypeAlias1[str] | str] | str | list[list[GenericTypeAlias1[str] | str] | str | float]]` is not assignable to `GenericTypeAlias1[str]` +aliases_recursive.py:69:35: error[invalid-assignment] Object of type `list[list[GenericTypeAlias2[str, int] | str | int] | str | int | list[list[GenericTypeAlias2[str, int] | str | int] | str | int | list[list[GenericTypeAlias2[str, int] | str | int] | str | int | list[list[GenericTypeAlias2[str, int] | str | int] | str | float]]]]` is not assignable to `GenericTypeAlias2[str, int]` """ diff --git a/conformance/results/ty/aliases_type_statement.toml b/conformance/results/ty/aliases_type_statement.toml index 3619276a9..85594fb95 100644 --- a/conformance/results/ty/aliases_type_statement.toml +++ b/conformance/results/ty/aliases_type_statement.toml @@ -6,7 +6,7 @@ aliases_type_statement.py:17:1: error[unresolved-attribute] Object of type `Type aliases_type_statement.py:19:1: error[call-non-callable] Object of type `TypeAliasType` is not callable aliases_type_statement.py:23:7: error[unresolved-attribute] Object of type `TypeAliasType` has no attribute `other_attrib` aliases_type_statement.py:26:18: error[invalid-base] Invalid class base with type `TypeAliasType` -aliases_type_statement.py:31:22: error[invalid-argument-type] Argument to function `isinstance` is incorrect: Expected `type | UnionType | tuple[Divergent, ...]`, found `TypeAliasType` +aliases_type_statement.py:31:22: error[invalid-argument-type] Argument to function `isinstance` is incorrect: Expected `_ClassInfo`, found `TypeAliasType` aliases_type_statement.py:37:22: error[invalid-type-form] Function calls are not allowed in type alias values aliases_type_statement.py:38:22: error[invalid-type-form] List literals are not allowed in this context in a type alias value aliases_type_statement.py:39:22: error[invalid-type-form] Tuple literals are not allowed in this context in a type alias value diff --git a/conformance/results/ty/protocols_explicit.toml b/conformance/results/ty/protocols_explicit.toml index 24f1e8541..1390ea2cb 100644 --- a/conformance/results/ty/protocols_explicit.toml +++ b/conformance/results/ty/protocols_explicit.toml @@ -1,16 +1,16 @@ conformance_automated = "Fail" -conformant = "Unsupported" +conformant = "Partial" notes = """ -Allows implicitly abstract protocol methods to be called via `super()` on a protocol subclass. -Allows instantiation of abstract subclasses of protocol classes. +Allows abstract protocol methods with no default implementation to be called via `super()` on a protocol subclass. +Allows instantiation of protocol subclasses with uninitialized `ClassVar` members. """ errors_diff = """ Line 27: Expected 1 errors -Line 60: Expected 1 errors Line 89: Expected 1 errors -Line 134: Expected 1 errors -Line 164: Expected 1 errors """ output = """ protocols_explicit.py:56:9: error[invalid-assignment] Object of type `tuple[int, int, str]` is not assignable to attribute `rgb` of type `tuple[int, int, int]` +protocols_explicit.py:60:5: error[call-non-callable] Cannot instantiate `Point` with unimplemented abstract methods `intensity` and `transparency` +protocols_explicit.py:134:6: error[call-non-callable] Cannot instantiate `Concrete5` with unimplemented abstract method `method1` +protocols_explicit.py:164:7: error[call-non-callable] Cannot instantiate `Concrete7A` with unimplemented abstract method `method1` """ diff --git a/conformance/results/ty/protocols_merging.toml b/conformance/results/ty/protocols_merging.toml index f3229e3fc..539c057e8 100644 --- a/conformance/results/ty/protocols_merging.toml +++ b/conformance/results/ty/protocols_merging.toml @@ -1,15 +1,11 @@ -conformance_automated = "Fail" -conformant = "Partial" -notes = """ -Does not reject attempted instantiation of abstract subclasses of protocols. -""" +conformance_automated = "Pass" errors_diff = """ -Line 82: Expected 1 errors """ output = """ protocols_merging.py:52:25: error[invalid-assignment] Object of type `SCConcrete2` is not assignable to `SizedAndClosable1` protocols_merging.py:53:25: error[invalid-assignment] Object of type `SCConcrete2` is not assignable to `SizedAndClosable2` protocols_merging.py:54:25: error[invalid-assignment] Object of type `SCConcrete2` is not assignable to `SizedAndClosable3` protocols_merging.py:67:16: error[invalid-protocol] Protocol class `BadProto` cannot inherit from non-protocol class `SizedAndClosable3` +protocols_merging.py:82:5: error[call-non-callable] Cannot instantiate `SizedAndClosable4` with unimplemented abstract method `close` protocols_merging.py:83:24: error[invalid-assignment] Object of type `SCConcrete1` is not assignable to `SizedAndClosable4` """ diff --git a/conformance/results/ty/version.toml b/conformance/results/ty/version.toml index e63a40e94..f5eb57c7f 100644 --- a/conformance/results/ty/version.toml +++ b/conformance/results/ty/version.toml @@ -1 +1 @@ -version = "ty 0.0.81" +version = "ty 0.0.82" diff --git a/conformance/uv.lock b/conformance/uv.lock index 001de6fde..820d566e6 100644 --- a/conformance/uv.lock +++ b/conformance/uv.lock @@ -202,27 +202,27 @@ wheels = [ [[package]] name = "ty" -version = "0.0.81" +version = "0.0.82" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/61/b7/c9d736f48585f5a711ea47bb97a353d3771834f89481d747ea9687b74fa9/ty-0.0.81.tar.gz", hash = "sha256:ef721aa649bf41d665ba86e1ea726fd3feab6800e2c4887a062a704baf304ca8", size = 7225871, upload-time = "2026-09-15T02:05:29.536Z" } +sdist = { url = "https://files.pythonhosted.org/packages/f6/df/b9f35d0b8860f1bbfcb852fbef363301b5ca4b5590cadc6f2a810646d579/ty-0.0.82.tar.gz", hash = "sha256:586e3bf784cece42113929bb64b4761bed5c2127ae6cea294bb82da670066356", size = 7325958, upload-time = "2026-09-17T19:42:12.243Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/6c/70/649a5ec8fd6cc9dfa731c905523b19e677ad36dd9dcc4fcadfed8235507f/ty-0.0.81-py3-none-linux_armv6l.whl", hash = "sha256:8e9e3dd6edb1462633ddba2bf337d1c05023a5a13c2f315e445565c7ad43d247", size = 13679646, upload-time = "2026-09-15T02:04:51.436Z" }, - { url = "https://files.pythonhosted.org/packages/b5/d0/3769b760918c3dde1bbaeee87422cd442fc550baadb5c8621e479b363282/ty-0.0.81-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:649c350873e4b3e937d856512ee57b8a345d80079cbead73a5308c2cdafe594c", size = 13211367, upload-time = "2026-09-15T02:04:54.18Z" }, - { url = "https://files.pythonhosted.org/packages/f8/5f/b8fe3ab7eee87bbf1f5ff1b65c55526a3f31a9604630bc9e7d84199bbac5/ty-0.0.81-py3-none-macosx_11_0_arm64.whl", hash = "sha256:480c78706ba78239f901d68cf1ba53e98b84aa51e19b9241daa0fb62fdecd2e2", size = 13084312, upload-time = "2026-09-15T02:04:56.133Z" }, - { url = "https://files.pythonhosted.org/packages/7f/d8/ce22278014f14ae8205d2f9622696d39c623a0c9e80056c258bb89bb8322/ty-0.0.81-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7cdbfa4b634b1d21542eedc11e424dedcc4871c2128d0d46b55b0089d3220492", size = 13127965, upload-time = "2026-09-15T02:04:58.306Z" }, - { url = "https://files.pythonhosted.org/packages/82/d0/4e75c61f6a241a0804f25117af4f91a5aaa4a48408b57f8d4c34d8a3d91e/ty-0.0.81-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:5f7a34743a21669d4f3d5fda98c36189cb4d9dceee1415a8a42d7426d55995db", size = 13432523, upload-time = "2026-09-15T02:05:00.471Z" }, - { url = "https://files.pythonhosted.org/packages/0b/02/e0b6b783418515c8ba40c13d5e333da9e0576a7a69582fc2b5831bb7d913/ty-0.0.81-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:742eab849947bc10b4c09810d37bd743afe9502e114b7bcfd6389f0ae3f425aa", size = 14211082, upload-time = "2026-09-15T02:05:02.455Z" }, - { url = "https://files.pythonhosted.org/packages/6b/af/85cb68d13ff617f2b213212d674e1266b933f2d051b63a1e5116e8ca0bfc/ty-0.0.81-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2b4cef395eee7007449aa3fc3fc8dc6bc58fe7a8956d56db078569061741bf52", size = 14692204, upload-time = "2026-09-15T02:05:04.705Z" }, - { url = "https://files.pythonhosted.org/packages/24/c6/791891f3fa8fec91e9ec3e8c9d6774ab903297defe847a3e5d7e047360ad/ty-0.0.81-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:80cf8c34973a1da2ec2a043efcba8f4c0a984d45210957a8ddd2c16f2b8f8e85", size = 14371010, upload-time = "2026-09-15T02:05:06.63Z" }, - { url = "https://files.pythonhosted.org/packages/c7/b2/c9fba5b4ed7f63f26e83432fa2062ca04606b61dce7bbacc1238232af649/ty-0.0.81-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f37a8f66c444eea29f17adfe0664f42062520773f18031fd4913f28eb56d2966", size = 13758537, upload-time = "2026-09-15T02:05:08.722Z" }, - { url = "https://files.pythonhosted.org/packages/77/e6/09c41e96bbcbe53dd18c9a1a6dbd2e456b0d03b94440a4bd9bab55a4e19a/ty-0.0.81-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:e8134cc03e84a27f409877b9b62053fd4aaac9c3ce0ce0fdace8b5ed58d78e04", size = 14280789, upload-time = "2026-09-15T02:05:10.719Z" }, - { url = "https://files.pythonhosted.org/packages/5b/d1/87eb8e01fb17602cde5911cbadb9b11141a04f728dbda0a2a00243f337ca/ty-0.0.81-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:fb6f269c5f14a07047e05cbf3d06dd9a64a048050f736afcf744a180a272f034", size = 13169638, upload-time = "2026-09-15T02:05:12.806Z" }, - { url = "https://files.pythonhosted.org/packages/94/3c/137ceb792858f408c48f20a066d12ee76108e5f28a13242720879c024172/ty-0.0.81-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:38355a5e6294ebd3cee616ed581d051963d61b293a1b3351c248747f73a45b74", size = 13449856, upload-time = "2026-09-15T02:05:15.505Z" }, - { url = "https://files.pythonhosted.org/packages/fe/0a/4a9b31fadfc80a2141f3862316eb31944843e01bc1f6533794291cce767e/ty-0.0.81-py3-none-musllinux_1_2_i686.whl", hash = "sha256:59a35e128a9831423aee19db804aa8a1358ee3ce615b3fc0dec20d40bfd0d733", size = 13675303, upload-time = "2026-09-15T02:05:17.537Z" }, - { url = "https://files.pythonhosted.org/packages/e3/16/dbcd2c10ab80b015a227110a4ec75314468b6720d800261098521df4eee9/ty-0.0.81-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:f0f4219fbc068ea3414fa804c6bd57ef4229a11884ab9ca71cd8308072520aad", size = 14050298, upload-time = "2026-09-15T02:05:20.424Z" }, - { url = "https://files.pythonhosted.org/packages/95/ba/a70ced0c0c078ff09a3a80224d045c4267d07811dbaf125c749af5f72606/ty-0.0.81-py3-none-win32.whl", hash = "sha256:82ff952e64ba4c4da1c0c89723e326c768ae4f9ff20624dee04a51c3f4e4b96c", size = 12866650, upload-time = "2026-09-15T02:05:22.824Z" }, - { url = "https://files.pythonhosted.org/packages/3f/51/4b79453df93dfb9edecb1bd6cb04e772277d8c7260693165358a033b6ed1/ty-0.0.81-py3-none-win_amd64.whl", hash = "sha256:ef82788744da0b7f2a598e4e9776f9c5998df4eef7e2750ae3a5537e7c734b69", size = 13572976, upload-time = "2026-09-15T02:05:24.907Z" }, - { url = "https://files.pythonhosted.org/packages/0a/56/09594d55a0c49543eeac149c0dbc80b9b04409cc26ca48f1c1a9595c0916/ty-0.0.81-py3-none-win_arm64.whl", hash = "sha256:bdb1563990c5d3abfe5a09e7512733f302773ede6a5d3e4e5c6ad46393d8df4d", size = 13364408, upload-time = "2026-09-15T02:05:27.247Z" }, + { url = "https://files.pythonhosted.org/packages/31/0e/259760638b7b1a875743f1f3975253392932ff74397c8e174df7bfb143c3/ty-0.0.82-py3-none-linux_armv6l.whl", hash = "sha256:be58e089e317e1ada7a655216828e76d369386dc958f7a3b3d455ab6dc7f02b6", size = 13833734, upload-time = "2026-09-17T19:41:35.134Z" }, + { url = "https://files.pythonhosted.org/packages/70/f6/c8a1f70989cf44cf2cada5527e268b4216015a7f28f1d8817e4ef1e84a52/ty-0.0.82-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:c080ba9a816cfbb3e34c0d3a0071829c602d14bb992bc799d885d4b30008b4ab", size = 13449689, upload-time = "2026-09-17T19:41:37.65Z" }, + { url = "https://files.pythonhosted.org/packages/d5/eb/31fc4bdecb2ff0053443d4ec1e6719a3f3171636ad6da7a8a642c879a4f4/ty-0.0.82-py3-none-macosx_11_0_arm64.whl", hash = "sha256:4f08bd5b751c3b2c46eabe8aee890e7fa54e3bcd97ffa4b8338b0a2508d928c2", size = 13410140, upload-time = "2026-09-17T19:41:40.024Z" }, + { url = "https://files.pythonhosted.org/packages/e7/14/e2af8c64004cd891691915b1522f105a5d601dd8d76a635fec112911f251/ty-0.0.82-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7f5ef0401743c2eeac8039ef9ff1bc5dd612bd17ed0259b9b0794e19696548a6", size = 13435552, upload-time = "2026-09-17T19:41:42.084Z" }, + { url = "https://files.pythonhosted.org/packages/52/92/b9519a7854189aa8da4309ecb9c6ff5ab8ac91a433e201322b15c98f9388/ty-0.0.82-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:c899643f2a4c1782c06a4bf4959909d1aa2d9d2cac7c1ac3de3161dfcb6909f8", size = 13601427, upload-time = "2026-09-17T19:41:44.242Z" }, + { url = "https://files.pythonhosted.org/packages/ce/be/0c7a39e277a25bca21bbd2dcf640eb4d80cf98f318ef611092cda1222399/ty-0.0.82-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b7aa6e4e157c6e0b770c327a5d966371b2a7bc7ad4f22d662ac068623cba00eb", size = 14457370, upload-time = "2026-09-17T19:41:46.405Z" }, + { url = "https://files.pythonhosted.org/packages/6f/33/86ff8f1e15c71096838eb0fdfe0f5b578dc717575de6cba591d96baf3b06/ty-0.0.82-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:28c141ab481748f1b889eb572e803172ea452af621e514c30a2f30884753b020", size = 14888674, upload-time = "2026-09-17T19:41:48.6Z" }, + { url = "https://files.pythonhosted.org/packages/0a/d2/a1c6315907afd080b4e98d2972441b4803a70c9663a8c7a7f6fd554c7361/ty-0.0.82-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:16fff2729fbaa3998ba1cab536dc7d176aef28927b09200588e50982394c56df", size = 14670369, upload-time = "2026-09-17T19:41:50.963Z" }, + { url = "https://files.pythonhosted.org/packages/ae/cd/956ceae4dbe0b116ebc9ecb75dcbe9a0294c50146f76c4c59004e6eb2d77/ty-0.0.82-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c2024a33209b37525ffa85a29036985e9ef53a013c0ff321231bd8b23987cf71", size = 14107030, upload-time = "2026-09-17T19:41:53.343Z" }, + { url = "https://files.pythonhosted.org/packages/b7/f8/6025627cec4d6370fb34a2c5cdcf36d89dd4e4ac75b023bda68231e17dfc/ty-0.0.82-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:14a0ae8591e08aca5911b545d100e51c9b796350a85b2b36d82219820552d662", size = 14485892, upload-time = "2026-09-17T19:41:55.745Z" }, + { url = "https://files.pythonhosted.org/packages/3a/b6/016f9b36096a9ccd0492ee000380bd75fb51dc4ec7bfef4d6d93f6b3ec2e/ty-0.0.82-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:2964202b09108c72232760119c2680cefc33191c428b09e6f620b6c0ab9c6b0f", size = 13383907, upload-time = "2026-09-17T19:41:57.937Z" }, + { url = "https://files.pythonhosted.org/packages/b4/19/1ccc2429399d6ef3d98180340c7abc6793bd90c5039ad41a9003cb8de6df/ty-0.0.82-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:f4ed8fc714e35dc11ef4209832e73ad461cf29c9161099eb6c2c541c6b9a3e0e", size = 13617005, upload-time = "2026-09-17T19:42:00.018Z" }, + { url = "https://files.pythonhosted.org/packages/d7/9d/a4a487db72e78413bba2ee9cd49f79b8f461be93e7f6c4dd790febae1cd7/ty-0.0.82-py3-none-musllinux_1_2_i686.whl", hash = "sha256:32a3fe7b1a50f20679fe76c85c0087280419365d900300898a7b95cbcfe510fc", size = 13906545, upload-time = "2026-09-17T19:42:01.942Z" }, + { url = "https://files.pythonhosted.org/packages/0c/4e/a58d530c0f5abe7b846e2d05af9e3f1fb44a1b620ae0abe3892cd3f9596c/ty-0.0.82-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:f751044ae63ea9e73ce2eae4c23a839efa4a04d6487d6ea411a590fbe43360b6", size = 14248518, upload-time = "2026-09-17T19:42:04.164Z" }, + { url = "https://files.pythonhosted.org/packages/a6/db/5505229835171d19adcaaeec3a15e0b533b578d24de1329db5da9306c4c6/ty-0.0.82-py3-none-win32.whl", hash = "sha256:0eb66c5ce58434a48d2cae2780d25285c7ca19e07a0d38b1fe39d1a0f75d6fa3", size = 13059890, upload-time = "2026-09-17T19:42:06.161Z" }, + { url = "https://files.pythonhosted.org/packages/13/22/faa427b65baf39915f52a6fa079ece4253e831f3364c567bf91bc1eef65a/ty-0.0.82-py3-none-win_amd64.whl", hash = "sha256:1e4a6c1ca2dc1a6929517d73a47cd626989bb8bd67811425fbe022d06eb2bf73", size = 14003730, upload-time = "2026-09-17T19:42:08.268Z" }, + { url = "https://files.pythonhosted.org/packages/8b/fc/3b95100993d28acb2f3bcf3a49846985f5b2aafab6562627d018f6d23788/ty-0.0.82-py3-none-win_arm64.whl", hash = "sha256:a6f0e8a1f961518746edbccc5986945c01a56a917ebe37117aa028a038d54ae3", size = 13567713, upload-time = "2026-09-17T19:42:10.248Z" }, ] [[package]] From ceb06712e1721f7a2af49bb9a68b0f33e38a1030 Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Sun, 20 Sep 2026 09:41:05 +0000 Subject: [PATCH 293/308] Upgrade zuban to 0.10.0 (#2361) --- conformance/results/results.html | 22 ++++------------ .../zuban/annotations_forward_refs.toml | 16 ++---------- .../zuban/annotations_future_import.toml | 14 +++------- conformance/results/zuban/version.toml | 2 +- conformance/uv.lock | 26 +++++++++---------- 5 files changed, 25 insertions(+), 55 deletions(-) diff --git a/conformance/results/results.html b/conformance/results/results.html index 4f1ac587f..ebb94bf64 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -269,7 +269,7 @@

    Python Type System Conformance Test Results

    - + @@ -324,13 +324,7 @@

    Python Type System Conformance Test Results

  • Fails to reject str: "str" forward references
  • - + @@ -367,13 +361,7 @@

    Python Type System Conformance Test Results

  • Fails to reject str: "str" forward references
  • - + @@ -429,7 +417,7 @@

    Python Type System Conformance Test Results

    - + @@ -2616,7 +2604,7 @@

    Python Type System Conformance Test Results

    - +
     
    mypy 1.11.1
    -
    1.0sec
    +
    13.2sec
    pyright 1.1.374
    -
    1.4sec
    +
    1.5sec
    pyre 0.9.22
    -
    1.4sec
    +
    5.4sec
    pytype 2024.04.11
    -
    31.4sec
    +
    35.2sec
    diff --git a/conformance/src/type_checker.py b/conformance/src/type_checker.py index f1610617c..d4404d12d 100644 --- a/conformance/src/type_checker.py +++ b/conformance/src/type_checker.py @@ -254,6 +254,9 @@ def parse_errors(self, output: Sequence[str]) -> dict[int, list[str]]: # Ignore multi-line errors if ".py:" not in line: continue + # Ignore reveal_type errors + if "Revealed type [-1]" in line: + continue assert line.count(":") >= 2, f"Failed to parse line: {line!r}" _, lineno, _ = line.split(":", maxsplit=2) line_to_errors.setdefault(int(lineno), []).append(line) From e74d9604a5d01c81b9ee3b8392ab4f2efc75c496 Mon Sep 17 00:00:00 2001 From: Rebecca Chen Date: Fri, 9 Aug 2024 01:29:42 -0700 Subject: [PATCH 043/308] writing_stubs: add examples of allowed and disallowed language features (#1837) --- docs/guides/writing_stubs.rst | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/guides/writing_stubs.rst b/docs/guides/writing_stubs.rst index 1d1af9172..703d97495 100644 --- a/docs/guides/writing_stubs.rst +++ b/docs/guides/writing_stubs.rst @@ -579,8 +579,14 @@ Language Features ----------------- Use the latest language features available, even for stubs targeting older -Python versions. Do not use quotes around forward references and do not use -``__future__`` imports. See :ref:`stub-file-syntax` for more information. +Python versions. For example, Python 3.7 added the ``async`` keyword (see +:pep:`492`). Stubs should use it to mark coroutines, even if the implementation +still uses the ``@coroutine`` decorator. On the other hand, the ``type`` soft +keyword from :pep:`695`, introduced in Python 3.12, should not be used in stubs +until Python 3.11 reaches end-of-life in October 2027. + +Do not use quotes around forward references and do not use ``__future__`` +imports. See :ref:`stub-file-syntax` for more information. Yes:: From d2d599f128190acac408faa740b2d1da017c8d90 Mon Sep 17 00:00:00 2001 From: Rebecca Chen Date: Wed, 21 Aug 2024 16:25:48 -0700 Subject: [PATCH 044/308] Merge the specification portion of the "Type Stubs" doc into the spec (#1815) * Type Stubs: move intro and syntax to spec. * Moves some content into spec, deletes duplicate spec content. * Adds placeholders for where remaining content will be moved. It will be split between the spec and the writing_stubs doc. * Move "Stub Contents" to writing_stubs. Moves the section on what to include in stubs with editorial changes only - e.g., changing "type stub" to "stub file" to match surrounding terminology. * Moves "Style Guide" to writing_stubs doc. Moves the style guide with a few updates: * Editorial changes like tweaking code examples to use recommended style. * Attribute declarations can use assignments when needed to convey extra information - e.g., final attributes and enum members. * Tweaks a reference to the double-underscore convention for positional-only arguments to note that it's historical. * Change :ref:`stubs` occurrences to :ref:`stub-files`. * Move a few "Supported Constructs" sections into spec. The only substantive change is an update to "Comments" to note that many formats of error suppression comments are allowed. * Migrated "Imports" and "Module Level Attributes" supported constructs. Added `x: Final = ` to module-level attributes section. No other changes. * Migrate "Enums" supported construct section. Replaces outdated info with a link to the enums section of the spec. * Move "Classes" and "Decorators" supported constructs sections. Added an example of an inner class to "Classes." Removed mention of asyncio.coroutine from "Decorators" as it's very deprecated. Added functions decorated with `@dataclass_transform` to list of decorators that type checkers should recognize. * Port "Functions and Methods" supported constructs section. Removed mention of individual supported/unsupported features from this section. Where we state that all typing features from the latest released version are supported, added a caveat with a link to the typeshed feature tracker. * Adds an "Import Conventions" section (deduplication). * Remove missed reference to deleted stubs doc. * Fix broken refs. * Formatting fix to docs/guides/writing_stubs.rst Co-authored-by: Sebastian Rittau * Reword paragraph on argument names to be more concise. Co-authored-by: Sebastian Rittau * Wording clarification in docs/guides/writing_stubs.rst Co-authored-by: Sebastian Rittau * Modernize code example in docs/guides/writing_stubs.rst Co-authored-by: Sebastian Rittau * Typo fix in docs/spec/distributing.rst Co-authored-by: Sebastian Rittau * Typo fix in docs/spec/distributing.rst Co-authored-by: Sebastian Rittau * Grammar fixes * Property deleters should also be understood. * Address future notes. * Fix silly formatting error. * Undelete stubs.rst. * Address review comments. * Reword some sections to focus on type checker behavior. * Move or remove some sections that fit better in the writing_stubs guide or are redundant. * Address more review comments. Cuts redundant sections, moves things to writing_stubs, tries out a new "these should be supported fully" and "these should be supported to at least the described minimum" structure. * Remove no-longer-needed anchor. * And add back an accidentally deleted newline... * Slight rewording of Decorators advice. * Address more reviewer comments. Moves "Library Interface" into spec, further trims redundant text. * Remove extra colon. * Revert changes to wrting_stubs that should be made separately. * Delete unnecessary sentence. Co-authored-by: Carl Meyer * Clarify some language and terminology. * Address reviewer feedback. * Formatting * Drop "annotation contexts." * Add "in annotation expressions" to newer syntax explanation. * Update docs/spec/distributing.rst Co-authored-by: Jelle Zijlstra * Reword syntax section. * Update docs/spec/distributing.rst Co-authored-by: Jelle Zijlstra * [pre-commit.ci] auto fixes from pre-commit.com hooks --------- Co-authored-by: Sebastian Rittau Co-authored-by: Carl Meyer Co-authored-by: Jelle Zijlstra Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- docs/guides/libraries.rst | 49 +--- docs/guides/writing_stubs.rst | 2 +- docs/reference/index.rst | 1 - docs/reference/stubs.rst | 455 +--------------------------------- docs/spec/directives.rst | 2 + docs/spec/distributing.rst | 245 ++++++++++++++---- docs/spec/literal.rst | 3 + 7 files changed, 209 insertions(+), 548 deletions(-) diff --git a/docs/guides/libraries.rst b/docs/guides/libraries.rst index 376811ad0..4b90da498 100644 --- a/docs/guides/libraries.rst +++ b/docs/guides/libraries.rst @@ -43,7 +43,7 @@ library: Inline type annotations simply refers to the use of annotations within your ``.py`` files. In contrast, with type stub files, type information lives in -separate ``.pyi`` files; see :ref:`stubs` and :ref:`writing_stubs` for more +separate ``.pyi`` files; see :ref:`stub-files` and :ref:`writing_stubs` for more details. We recommend using the inline type annotations approach, since it has the @@ -193,51 +193,8 @@ How much of my library needs types? A "py.typed" library should aim to be type complete so that type checking and inspection can work to their full extent. Here we say that a library is “type complete” if all of the symbols -that comprise its interface have type annotations that refer to types -that are fully known. Private symbols are exempt. - -Library interface (public and private symbols) ----------------------------------------------- - -If a ``py.typed`` module is present, a type checker will treat all modules -within that package (i.e. all files that end in ``.py`` or ``.pyi``) as -importable unless the file name begins with an underscore. These modules -comprise the supported interface for the library. - -Each module exposes a set of symbols. Some of these symbols are -considered "private” — implementation details that are not part of the -library’s interface. Type checkers can use the following rules -to determine which symbols are visible outside of the package. - -- Symbols whose names begin with an underscore (but are not dunder - names) are considered private. -- Imported symbols are considered private by default. If they use the - ``import A as A`` (a redundant module alias), ``from X import A as A`` (a - redundant symbol alias), or ``from . import A`` forms, symbol ``A`` is - not private unless the name begins with an underscore. If a file - ``__init__.py`` uses form ``from .A import X``, symbol ``A`` is treated - likewise. If a wildcard import (of the form ``from X import *``) is - used, all symbols referenced by the wildcard are not private. -- A module can expose an ``__all__`` symbol at the module level that - provides a list of names that are considered part of the interface. - This overrides all other rules above, allowing imported symbols or - symbols whose names begin with an underscore to be included in the - interface. -- Local variables within a function (including nested functions) are - always considered private. - -The following idioms are supported for defining the values contained -within ``__all__``. These restrictions allow type checkers to statically -determine the value of ``__all__``. - -- ``__all__ = ('a', b')`` -- ``__all__ = ['a', b']`` -- ``__all__ += ['a', b']`` -- ``__all__ += submodule.__all__`` -- ``__all__.extend(['a', b'])`` -- ``__all__.extend(submodule.__all__)`` -- ``__all__.append('a')`` -- ``__all__.remove('a')`` +that comprise its :ref:`interface ` have type annotations +that refer to types that are fully known. Private symbols are exempt. Type Completeness ----------------- diff --git a/docs/guides/writing_stubs.rst b/docs/guides/writing_stubs.rst index 703d97495..71d13a71b 100644 --- a/docs/guides/writing_stubs.rst +++ b/docs/guides/writing_stubs.rst @@ -5,7 +5,7 @@ Writing and Maintaining Stub Files ********************************** Stub files are a means of providing type information for Python modules. -For a full reference, refer to :ref:`stubs`. +For a full reference, refer to :ref:`stub-files`. Maintaining stubs can be a little cumbersome because they are separated from the implementation. This page lists some tools that make writing and maintaining diff --git a/docs/reference/index.rst b/docs/reference/index.rst index 010f3b498..720e21277 100644 --- a/docs/reference/index.rst +++ b/docs/reference/index.rst @@ -8,7 +8,6 @@ Type System Reference generics protocols - stubs best_practices quality typing Module Documentation diff --git a/docs/reference/stubs.rst b/docs/reference/stubs.rst index aac21f982..b0ce56711 100644 --- a/docs/reference/stubs.rst +++ b/docs/reference/stubs.rst @@ -1,457 +1,8 @@ -.. _stubs: +:orphan: ********** Type Stubs ********** -Introduction -============ - -*type stubs*, also called *stub files*, provide type information for untyped -Python packages and modules. Type stubs serve multiple purposes: - -* They are the only way to add type information to extension modules. -* They can provide type information for packages that do not wish to - add them inline. -* They can be distributed separately from the implementation. - This allows stubs to be developed at a different pace or by different - authors, which is especially useful when adding type annotations to - existing packages. -* They can act as documentation, succinctly explaining the external - API of a package, without including the implementation or private - members. - -This document aims to give guidance to both authors of type stubs and developers -of type checkers and other tools. It describes the constructs that can be used -safely in type stubs and lists constructs that type checkers are expected to -support. - -Type stubs that only use constructs described in this document should work with -all type checkers that also follow this document. -Type stub authors can elect to use additional constructs, but -must be prepared that some type checkers will not parse them as expected. - -A type checker that conforms to this document will parse a type stub that only uses -constructs described here without error and will not interpret any -construct in a contradictory manner. However, type checkers are not -required to implement checks for all these constructs, and -can elect to ignore unsupported ones. Additionally type checkers -can support constructs not described in this document and tool authors are -encouraged to experiment with additional features. - -.. _stub-file-syntax: - -Syntax -====== - -Type stubs are syntactically valid Python 3.8 files with a ``.pyi`` suffix. -The Python syntax used for type stubs is independent from the Python -versions supported by the implementation, and from the Python version the type -checker runs under (if any). Therefore, type stub authors should use the -latest available syntax features in stubs (up to Python 3.8), even if the -implementation supports older, pre-3.8 Python versions. -Type checker authors are encouraged to support syntax features from -post-3.8 Python versions, although type stub authors should not use such -features if they wish to maintain compatibility with all type checkers. - -For example, Python 3.7 added the ``async`` keyword (see :pep:`492`). -Stub authors should use it to mark coroutines, even if the implementation -still uses the ``@coroutine`` decorator. On the other hand, type stubs should -not use the ``type`` soft keyword from :pep:`695`, introduced in -Python 3.12, although type checker authors are encouraged to support it. - -Stubs are treated as if ``from __future__ import annotations`` is enabled. -In particular, built-in generics, pipe union syntax (``X | Y``), and forward -references can be used. - -The :py:mod:`ast` module from the standard library supports -all syntax features required by this document. - -Distribution -============ - -Type stubs can be distributed with or separately from the implementation; -see :ref:`distributing-type` and :ref:`providing-type-annotations` -for more information. - -Supported Constructs -==================== - -This sections lists constructs that type checkers will accept in type stubs. -Type stub authors can safely use these constructs. If a -construct is marked as "unspecified", type checkers may handle it -as they best see fit or report an error. Linters should usually -flag those constructs. Type stub authors should avoid using them to -ensure compatibility across type checkers. - -Unless otherwise mentioned, type stubs support all features from the -``typing`` module of the latest released Python version. If a stub uses -typing features from a later Python version than what the implementation -supports, these features can be imported from ``typing_extensions`` instead -of ``typing``. - -For example, a stub could use ``Literal``, introduced in Python 3.8, -for a library supporting Python 3.7+:: - - from typing_extensions import Literal - - def foo(x: Literal[""]) -> int: ... - -Comments --------- - -Standard Python comments are accepted everywhere Python syntax allows them. - -Two kinds of structured comments are accepted: - -* A ``# type: X`` comment at the end of a line that defines a variable, - declaring that the variable has type ``X``. However, :pep:`526`-style - variable annotations are preferred over type comments. -* A ``# type: ignore`` comment at the end of any line, which suppresses all type - errors in that line. The type checker mypy supports suppressing certain - type errors by using ``# type: ignore[error-type]``. This is not supported - by other type checkers and should not be used in stubs. - -Imports -------- - -Type stubs distinguish between imports that are re-exported and those -that are only used internally. Imports are re-exported if they use one of these -forms (:pep:`484`): - -* ``import X as X`` -* ``from Y import X as X`` -* ``from Y import *`` - -Here are some examples of imports that make names available for internal use in -a stub but do not re-export them:: - - import X - from Y import X - from Y import X as OtherX - -Type aliases can be used to re-export an import under a different name:: - - from foo import bar as _bar - new_bar = _bar # "bar" gets re-exported with the name "new_bar" - -Sub-modules are always exported when they are imported in a module. -For example, consider the following file structure:: - - foo/ - __init__.pyi - bar.pyi - -Then ``foo`` will export ``bar`` when one of the following constructs is used in -``__init__.pyi``:: - - from . import bar - from .bar import Bar - -Stubs support customizing star import semantics by defining a module-level -variable called ``__all__``. In stubs, this must be a string list literal. -Other types are not supported. Neither is the dynamic creation of this -variable (for example by concatenation). - -By default, ``from foo import *`` imports all names in ``foo`` that -do not begin with an underscore. When ``__all__`` is defined, only those names -specified in ``__all__`` are imported:: - - __all__ = ['public_attr', '_private_looking_public_attr'] - - public_attr: int - _private_looking_public_attr: int - private_attr: int - -Type checkers support cyclic imports in stub files. - -Module Level Attributes ------------------------ - -Module level variables and constants can be annotated using either -type comments or variable annotation syntax:: - - x: int # recommended - x: int = 0 - x = 0 # type: int - x = ... # type: int - -The type of a variable is unspecified when the variable is unannotated or -when the annotation -and the assigned value disagree. As an exception, the ellipsis literal can -stand in for any type:: - - x = 0 # type is unspecified - x = ... # type is unspecified - x: int = "" # type is unspecified - x: int = ... # type is int - -Classes -------- - -Class definition syntax follows general Python syntax, but type checkers -are only expected to understand the following constructs in class bodies: - -* The ellipsis literal ``...`` is ignored and used for empty - class bodies. Using ``pass`` in class bodies is undefined. -* Instance attributes follow the same rules as module level attributes - (see above). -* Method definitions (see below) and properties. -* Method aliases. -* Inner class definitions. - -More complex statements don't need to be supported:: - - class Simple: ... - - class Complex(Base): - read_write: int - @property - def read_only(self) -> int: ... - def do_stuff(self, y: str) -> None: ... - doStuff = do_stuff - -The type of generic classes can be narrowed by annotating the ``self`` -argument of the ``__init__`` method:: - - class Foo(Generic[_T]): - @overload - def __init__(self: Foo[str], type: Literal["s"]) -> None: ... - @overload - def __init__(self: Foo[int], type: Literal["i"]) -> None: ... - @overload - def __init__(self, type: str) -> None: ... - -The class must match the class in which it is declared. Using other classes, -including sub or super classes, will not work. In addition, the ``self`` -annotation cannot contain type variables. - -.. _supported-functions: - -Functions and Methods ---------------------- - -Function and method definition syntax follows general Python syntax. -For backwards compatibility, positional-only parameters can also be marked by -prefixing their name with two underscores (but not suffixing it with two -underscores):: - - # x is positional-only - # y can be used positionally or as keyword argument - # z is keyword-only - def foo(x, /, y, *, z): ... # recommended - def foo(__x, y, *, z): ... # backwards compatible syntax - -If an argument or return type is unannotated, per :pep:`484` its -type is assumed to be ``Any``. It is preferred to leave unknown -types unannotated rather than explicitly marking them as ``Any``, as some -type checkers can optionally warn about unannotated arguments. - -If an argument has a literal or constant default value, it must match the implementation -and the type of the argument (if specified) must match the default value. -Alternatively, ``...`` can be used in place of any default value:: - - # The following arguments all have type Any. - def unannotated(a, b=42, c=...): ... - # The following arguments all have type int. - def annotated(a: int, b: int = 42, c: int = ...): ... - # The following default values are invalid and the types are unspecified. - def invalid(a: int = "", b: Foo = Foo()): ... - -For a class ``C``, the type of the first argument to a classmethod is -assumed to be ``type[C]``, if unannotated. For other non-static methods, -its type is assumed to be ``C``:: - - class Foo: - def do_things(self): ... # self has type Foo - @classmethod - def create_it(cls): ... # cls has type Type[Foo] - @staticmethod - def utility(x): ... # x has type Any - -But:: - - _T = TypeVar("_T") - - class Foo: - def do_things(self: _T) -> _T: ... # self has type _T - @classmethod - def create_it(cls: _T) -> _T: ... # cls has type _T - -:pep:`612` parameter specification variables (``ParamSpec``) -are supported in argument and return types:: - - _P = ParamSpec("_P") - _R = TypeVar("_R") - - def foo(cb: Callable[_P, _R], *args: _P.args, **kwargs: _P.kwargs) -> _R: ... - -However, ``Concatenate`` from PEP 612 is not yet supported; nor is using -a ``ParamSpec`` to parameterize a generic class. - -:pep:`647` type guards are supported. - -Using a function or method body other than the ellipsis literal is currently -unspecified. Stub authors may experiment with other bodies, but it is up to -individual type checkers how to interpret them:: - - def foo(): ... # compatible - def bar(): pass # behavior undefined - -Aliases and NewType -------------------- - -Type checkers should accept module-level type aliases, optionally using -``TypeAlias`` (:pep:`613`), e.g.:: - - _IntList = list[int] - _StrList: TypeAlias = list[str] - -Type checkers should also accept regular module-level or class-level aliases, -e.g.:: - - def a() -> None: ... - b = a - - class C: - def f(self) -> int: ... - g = f - -A type alias may contain type variables. As per :pep:`484`, -all type variables must be substituted when the alias is used:: - - _K = TypeVar("_K") - _V = TypeVar("_V") - _MyMap: TypeAlias = dict[str, dict[_K, _V]] - - # either concrete types or other type variables can be substituted - def f(x: _MyMap[str, _V]) -> _V: ... - # explicitly substitute in Any rather than using a bare alias - def g(x: _MyMap[Any, Any]) -> Any: ... - -Otherwise, type variables in aliases follow the same rules as type variables in -generic class definitions. - -``typing.NewType`` is also supported in stubs. - -.. _stub-decorators: - -Decorators ----------- - -Type stubs may only use decorators defined in the ``typing`` module, plus a -fixed set of additional ones: - -* ``classmethod`` -* ``staticmethod`` -* ``property`` (including ``.setter``) -* ``abc.abstractmethod`` -* ``dataclasses.dataclass`` -* ``asyncio.coroutine`` (although ``async`` should be used instead) - -Version and Platform Checks ---------------------------- - -Type stubs for libraries that support multiple Python versions can use version -checks to supply version-specific type hints. Type stubs for different Python -versions should still conform to the most recent supported Python version's -syntax, as explain in the Syntax_ section above. - -Version checks are if-statements that use ``sys.version_info`` to determine the -current Python version. Version checks should only check against the ``major`` and -``minor`` parts of ``sys.version_info``. Type checkers are only required to -support the tuple-based version check syntax:: - - if sys.version_info >= (3,): - # Python 3-specific type hints. This tuple-based syntax is recommended. - else: - # Python 2-specific type hints. - - if sys.version_info >= (3, 5): - # Specific minor version features can be easily checked with tuples. - - if sys.version_info < (3,): - # This is only necessary when a feature has no Python 3 equivalent. - -Type stubs should avoid checking against ``sys.version_info.major`` -directly and should not use comparison operators other than ``<`` and ``>=``. - -No:: - - if sys.version_info.major >= 3: - # Semantically the same as the first tuple check. - - if sys.version_info[0] >= 3: - # This is also the same. - - if sys.version_info <= (2, 7): - # This does not work because e.g. (2, 7, 1) > (2, 7). - -Some type stubs also may need to specify type hints for different platforms. -Platform checks must be equality comparisons between ``sys.platform`` and the name -of a platform as a string literal: - -Yes:: - - if sys.platform == 'win32': - # Windows-specific type hints. - else: - # Posix-specific type hints. - -No:: - - if sys.platform.startswith('linux'): - # Not necessary since Python 3.3. - - if sys.platform in ['linux', 'cygwin', 'darwin']: - # Only '==' or '!=' should be used in platform checks. - -Version and platform comparisons can be chained using the ``and`` and ``or`` -operators:: - - if sys.platform == 'linux' and (sys.version_info < (3,) or sys,version_info >= (3, 7)): ... - -Enums ------ - -Enum classes are supported in stubs, regardless of the Python version targeted by -the stubs. - -Enum members may be specified just like other forms of assignments, for example as -``x: int``, ``x = 0``, or ``x = ...``. The first syntax is preferred because it -allows type checkers to correctly type the ``.value`` attribute of enum members, -without providing unnecessary information like the runtime value of the enum member. - -Additional properties on enum members should be specified with ``@property``, so they -do not get interpreted by type checkers as enum members. - -Yes:: - - from enum import Enum - - class Color(Enum): - RED: int - BLUE: int - @property - def rgb_value(self) -> int: ... - - class Color(Enum): - # discouraged; type checkers will not understand that Color.RED.value is an int - RED = ... - BLUE = ... - @property - def rgb_value(self) -> int: ... - -No:: - - from enum import Enum - - class Color(Enum): - RED: int - BLUE: int - rgb_value: int # no way for type checkers to know that this is not an enum member - -Copyright -========= - -This document is placed in the public domain or under the CC0-1.0-Universal license, whichever is more permissive. +The contents of this document have been moved to :ref:`stub-files` and +:ref:`writing_stubs`. diff --git a/docs/spec/directives.rst b/docs/spec/directives.rst index 7fca698a3..62e1b3c4f 100644 --- a/docs/spec/directives.rst +++ b/docs/spec/directives.rst @@ -128,6 +128,8 @@ and return type annotations and treat the function as if it were unannotated. The behavior for the ``no_type_check`` decorator when applied to a class is left undefined by the typing spec at this time. +.. _`version-and-platform-checks`: + Version and platform checking ----------------------------- diff --git a/docs/spec/distributing.rst b/docs/spec/distributing.rst index 9bcd3a6f8..57bcc66e2 100644 --- a/docs/spec/distributing.rst +++ b/docs/spec/distributing.rst @@ -10,72 +10,164 @@ Stub files (Originally specified in :pep:`484`.) -Stub files are files containing type hints that are only for use by -the type checker, not at runtime. There are several use cases for -stub files: +*Stub files*, also called *type stubs*, provide type information for untyped +Python packages and modules. Stub files serve multiple purposes: + +* They are the only way to add type information to extension modules. +* They can provide type information for packages that do not wish to + add them inline. +* They can be distributed separately from the package or module that they + provide types for. The latter is referred to as the *implementation*. + This allows stubs to be developed at a different pace or by different + authors, which is especially useful when adding type annotations to + existing packages. +* They can act as documentation, succinctly explaining the external + API of a package, without including implementation details or private + members. + +Stub files use a subset of the constructs used in Python source files, as +described in :ref:`stub-file-supported-constructs` below. Type checkers should +parse a stub that uses only such constructs without error and not interpret any +construct in a manner contradictory to this specification. However, type +checkers are not required to implement checks for all of these constructs and +can elect to ignore unsupported ones. Additionally, type checkers can support +constructs not described here. + +If a stub file is found for a module, the type checker should not read the +corresponding "real" module. See :ref:`mro` for more information. + +.. _stub-file-syntax: + +Syntax +^^^^^^ + +Stub files are syntactically valid Python files with a ``.pyi`` suffix. They +should be parseable (e.g., with :py:func:`ast.parse`) in all Python versions +that are supported by the implementation and that are still supported +by the CPython project. For example, defining a type alias using the +``type`` keyword is only accepted by the Python parser in Python 3.12 and later, +so stubs supporting Python 3.11 or earlier versions should not use this syntax. +This allows type checkers implemented in Python to parse stub files using +functionality from the standard library. +Type checkers may choose to support syntactic features from newer Python versions +in stub files, but stubs that rely on such features may not be portable to all +type checkers. Type checkers may also choose to support Python versions that +are no longer supported by CPython; if so, they cannot rely on standard library +functionality to parse stub files. + +Type checkers should evaluate all :term:`annotation expressions ` as if they are quoted. +Consequently, forward references do not need to be quoted, and type system +features that do not depend on Python syntax changes are supported in stubs regardless +of the Python version supported. For example, the use of the ``|`` operator +to create unions (``X | Y``) was introduced in Python 3.10, but may be used +even in stubs that support Python 3.9 and older versions. + +.. _stub-file-supported-constructs: + +Supported Constructs +^^^^^^^^^^^^^^^^^^^^ + +Type checkers should fully support these constructs: + +* All features from the ``typing`` module of the latest released Python version + that use :ref:`supported syntax ` +* Comments, including type declaration (``# type: X``) and error suppression + (``# type: ignore``) comments +* Import statements, including the standard :ref:`import-conventions` and cyclic + imports +* Aliases, including type aliases, at both the module and class level +* :ref:`Simple version and platform checks ` -* Extension modules +The constructs in the following subsections may be supported in a more limited +fashion, as described below. -* Third-party modules whose authors have not yet added type hints +Value Expressions +""""""""""""""""" -* Standard library modules for which type hints have not yet been - written +In locations where value expressions can appear, such as the right-hand side of +assignment statements and function parameter defaults, type checkers should +support the following expressions: -* Modules that must be compatible with Python 2 and 3 +* The ellipsis literal, ``...``, which can stand in for any value +* Any value that is a + :ref:`legal parameter for typing.Literal ` +* Floating point literals, such as ``3.14`` +* Complex literals, such as ``1 + 2j`` -* Modules that use annotations for other purposes +Module Level Attributes +""""""""""""""""""""""" -Stub files have the same syntax as regular Python modules. There is one -feature of the ``typing`` module that is different in stub files: -the ``@overload`` decorator described below. +Type checkers should support module-level variable annotations, with and without +assignments:: -The type checker should only check function signatures in stub files; -It is recommended that function bodies in stub files just be a single -ellipsis (``...``). + x: int + x: int = 0 + x = 0 # type: int + x = ... # type: int -The type checker should have a configurable search path for stub files. -If a stub file is found the type checker should not read the -corresponding "real" module. +The :ref:`Literal shortcut using Final ` should be +supported:: -While stub files are syntactically valid Python modules, they use the -``.pyi`` extension to make it possible to maintain stub files in the -same directory as the corresponding real module. This also reinforces -the notion that no runtime behavior should be expected of stub files. + x: Final = 0 # type is Literal[0] -Additional notes on stub files: +When the type of a variable is omitted or disagrees from the assigned value, +type checker behavior is undefined:: -* Modules and variables imported into the stub are not considered - exported from the stub unless the import uses the ``import ... as - ...`` form or the equivalent ``from ... import ... as ...`` form. - (*UPDATE:* To clarify, the intention here is that only names - imported using the form ``X as X`` will be exported, i.e. the name - before and after ``as`` must be the same.) + x = 0 # behavior undefined + x: Final = ... # behavior undefined + x: int = "" # behavior undefined -* However, as an exception to the previous bullet, all objects - imported into a stub using ``from ... import *`` are considered - exported. (This makes it easier to re-export all objects from a - given module that may vary by Python version.) +Classes +""""""" -* Just like in `normal Python files `_, submodules - automatically become exported attributes of their parent module - when imported. For example, if the ``spam`` package has the - following directory structure:: +Class definition syntax follows general Python syntax, but type checkers +are expected to understand only the following constructs in class bodies: - spam/ - __init__.pyi - ham.pyi +* The ellipsis literal ``...`` is used for empty class bodies. Using ``pass`` in + class bodies is undefined. +* Instance attributes follow the same rules as module level attributes + (see above). +* Method definitions (see below) and properties. +* Aliases. +* Inner class definitions. - where ``__init__.pyi`` contains a line such as ``from . import ham`` - or ``from .ham import Ham``, then ``ham`` is an exported attribute - of ``spam``. +Yes:: -* Stub files may be incomplete. To make type checkers aware of this, the file - can contain the following code:: + class Simple: ... + + class Complex(Base): + read_write: int + @property + def read_only(self) -> int: ... + def do_stuff(self, y: str) -> None: ... + doStuff = do_stuff + IntList: TypeAlias = list[int] + class Inner: ... + +Functions and Methods +""""""""""""""""""""" - def __getattr__(name) -> Any: ... +Function and method definition follows general Python syntax. Using a function +or method body other than the ellipsis literal is undefined:: - Any identifier not defined in the stub is therefore assumed to be of type - ``Any``. + def foo(): ... # compatible + def bar(): pass # behavior undefined + +.. _stub-decorators: + +Decorators +"""""""""" + +Type checkers are expected to understand the effects of all decorators defined +in the ``typing`` module, plus these additional ones: + + * ``classmethod`` + * ``staticmethod`` + * ``property`` (including ``.setter`` and ``.deleter``) + * ``abc.abstractmethod`` + * ``dataclasses.dataclass`` + * ``warnings.deprecated`` + * functions decorated with ``@typing.dataclass_transform`` The Typeshed Project ^^^^^^^^^^^^^^^^^^^^ @@ -266,3 +358,60 @@ of that Python version. This can be queried e.g. ``pythonX.Y -c 'import site; print(site.getsitepackages())'``. It is also recommended that the type checker allow for the user to point to a particular Python binary, in case it is not in the path. + +.. _library-interface: + +Library interface (public and private symbols) +---------------------------------------------- + +If a ``py.typed`` module is present, a type checker will treat all modules +within that package (i.e. all files that end in ``.py`` or ``.pyi``) as +importable unless the file name begins with an underscore. These modules +comprise the supported interface for the library. + +Each module exposes a set of symbols. Some of these symbols are +considered "private” — implementation details that are not part of the +library’s interface. Type checkers can use the following rules +to determine which symbols are visible outside of the package. + +- Symbols whose names begin with an underscore (but are not dunder + names) are considered private. +- Imported symbols are considered private by default. A fixed set of + :ref:`import forms ` re-export imported symbols. +- A module can expose an ``__all__`` symbol at the module level that + provides a list of names that are considered part of the interface. + This overrides all other rules above, allowing imported symbols or + symbols whose names begin with an underscore to be included in the + interface. +- Local variables within a function (including nested functions) are + always considered private. + +The following idioms are supported for defining the values contained +within ``__all__``. These restrictions allow type checkers to statically +determine the value of ``__all__``. + +- ``__all__ = ('a', b')`` +- ``__all__ = ['a', b']`` +- ``__all__ += ['a', b']`` +- ``__all__ += submodule.__all__`` +- ``__all__.extend(['a', b'])`` +- ``__all__.extend(submodule.__all__)`` +- ``__all__.append('a')`` +- ``__all__.remove('a')`` + +.. _import-conventions: + +Import Conventions +------------------ + +By convention, certain import forms indicate to type checkers that an imported +symbol is re-exported and should be considered part of the importing module's +public interface. All other imported symbols are considered private by default. + +The following import forms re-export symbols: + +* ``import X as X`` (a redundant module alias): re-exports ``X``. +* ``from Y import X as X`` (a redundant symbol alias): re-exports ``X``. +* ``from Y import *``: if ``Y`` defines a module-level ``__all__`` list, + re-exports all names in ``__all__``; otherwise, re-exports all public symbols + in ``Y``'s global scope. diff --git a/docs/spec/literal.rst b/docs/spec/literal.rst index 5cd50a443..564ddaa44 100644 --- a/docs/spec/literal.rst +++ b/docs/spec/literal.rst @@ -93,6 +93,7 @@ what values may and may not be used as parameters. In short, a ``Literal[...]`` type may be parameterized by one or more literal expressions, and nothing else. +.. _literal-legal-parameters: Legal parameters for ``Literal`` at type check time """"""""""""""""""""""""""""""""""""""""""""""""""" @@ -505,6 +506,8 @@ involving Literal bools. For example, we can combine ``Literal[True]``, else: scalar += "foo" # Type checks: type of 'scalar' is narrowed to 'str' +.. _literal-final-interactions: + Interactions with Final """"""""""""""""""""""" From 69ec68bec06940997158d99136340d1faf0afb8b Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Wed, 28 Aug 2024 12:06:15 +0100 Subject: [PATCH 045/308] Spec: fix indentation in `Annotated` bullets (#1849) --- docs/spec/qualifiers.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/spec/qualifiers.rst b/docs/spec/qualifiers.rst index 8cfb476df..4a3bcc9f1 100644 --- a/docs/spec/qualifiers.rst +++ b/docs/spec/qualifiers.rst @@ -225,10 +225,10 @@ Here are the specific details of the syntax: * The base expression (the first argument to ``Annotated``) must be valid in the context where it is being used: - * If ``Annotated`` is used in a place where arbitrary - :term:`annotation expressions ` are allowed, - the base expression may be an annotation expression. - * Otherwise, the base expression must be a valid :term:`type expression`. + * If ``Annotated`` is used in a place where arbitrary + :term:`annotation expressions ` are allowed, + the base expression may be an annotation expression. + * Otherwise, the base expression must be a valid :term:`type expression`. * Multiple metadata elements are supported (``Annotated`` supports variadic arguments):: From 618dbc3fdafa07cc2f5eecad73a6290da658af78 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Mon, 2 Sep 2024 15:51:27 +0300 Subject: [PATCH 046/308] Docs: Add reference to TypeIs to use via InterSphinx (#1852) --- docs/spec/narrowing.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/spec/narrowing.rst b/docs/spec/narrowing.rst index b7c6cc0d9..27094e94c 100644 --- a/docs/spec/narrowing.rst +++ b/docs/spec/narrowing.rst @@ -110,6 +110,8 @@ is not narrowed in the negative case. reveal_type(val) # tuple[str, str] ... +.. _`typeis`: + TypeIs ------ From f816a64b4d468cda3319f2879b16086c3783bb7c Mon Sep 17 00:00:00 2001 From: Shaygan Hooshyari Date: Tue, 3 Sep 2024 12:43:51 -0700 Subject: [PATCH 047/308] Fix type annotation with two string literals (#1853) Co-authored-by: Jelle Zijlstra --- conformance/tests/annotations_forward_refs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conformance/tests/annotations_forward_refs.py b/conformance/tests/annotations_forward_refs.py index 24111176f..18f111e0c 100644 --- a/conformance/tests/annotations_forward_refs.py +++ b/conformance/tests/annotations_forward_refs.py @@ -38,7 +38,7 @@ class ClassA: # The following should all generate errors because they are not legal type # expressions, despite being enclosed in quotes. def invalid_annotations( - p1: "eval(" ".join(map(chr, [105, 110, 116])))", # E + p1: "eval(''.join(map(chr, [105, 110, 116])))", # E p2: "[int, str]", # E p3: "(int, str)", # E p4: "[int for i in range(1)]", # E From d93fba96510bb2f6df59a36fe04558226821220c Mon Sep 17 00:00:00 2001 From: InSync Date: Wed, 18 Sep 2024 04:45:17 +0700 Subject: [PATCH 048/308] Specify that `type[]` distributes over unions (#1841) --- docs/spec/special-types.rst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/spec/special-types.rst b/docs/spec/special-types.rst index 46e1f2bfa..ce6f336bc 100644 --- a/docs/spec/special-types.rst +++ b/docs/spec/special-types.rst @@ -175,7 +175,10 @@ Note that it is legal to use a union of classes as the parameter for user = new_user(user_class) ... -However the actual argument passed in at runtime must still be a +``type[]`` distributes over unions: +``type[A | B]`` is :term:`equivalent` to ``type[A] | type[B]``. + +However, the actual argument passed in at runtime must still be a concrete class object, e.g. in the above example:: new_non_team_user(ProUser) # OK From 0f38667c1424fecf4e42bad6b867702cf6e8ad4b Mon Sep 17 00:00:00 2001 From: Rebecca Chen Date: Fri, 27 Sep 2024 10:08:17 -0700 Subject: [PATCH 049/308] TypedDict: clarify that a non-ReadOnly key cannot be redeclared as ReadOnly. (#1859) This is covered in the conformance tests ( https://github.com/python/typing/blob/d93fba96510bb2f6df59a36fe04558226821220c/conformance/tests/typeddicts_readonly_consistency.py#L38 and https://github.com/python/typing/blob/d93fba96510bb2f6df59a36fe04558226821220c/conformance/tests/typeddicts_readonly_consistency.py#L81 ) but not explicitly stated in the spec. --- docs/spec/typeddict.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/spec/typeddict.rst b/docs/spec/typeddict.rst index 94846172f..38a2e4b8f 100644 --- a/docs/spec/typeddict.rst +++ b/docs/spec/typeddict.rst @@ -749,7 +749,8 @@ only if all of the following are satisfied: * For each item in ``A``, if ``B`` has the corresponding key, the corresponding value type in ``B`` is assignable to the value type in ``A``. * For each non-read-only item in ``A``, its value type is assignable to the - corresponding value type in ``B``. + corresponding value type in ``B``, and the corresponding key is not read-only + in ``B``. * For each required key in ``A``, the corresponding key is required in ``B``. * For each non-required key in ``A``, if the item is not read-only in ``A``, the corresponding key is not required in ``B``. From 70d41820e197b215f62f3f4df492ffd14a864f15 Mon Sep 17 00:00:00 2001 From: Eric Traut Date: Thu, 10 Oct 2024 12:13:48 -0700 Subject: [PATCH 050/308] =?UTF-8?q?Updated=20conformance=20tests=20and=20r?= =?UTF-8?q?esults=20for=20latest=20versions=20of=20type=20che=E2=80=A6=20(?= =?UTF-8?q?#1863)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Updated conformance tests and results for latest versions of type checkers. One test case in the `generics_syntax_infer_variance` was commented out temporarily until we decide how to handle variance inference for dataclasses in Python 3.13. Mypy version was updated from 1.11.1 to 1.11.2. Minor error message change but no other substantive changes to the conformance results. Pyright version was updated from 1.1.374 to 1.1.384. Many error messages changed slightly. Tests also identified three conformance regressions. Pytype version was updated from 2024.04.11 to 2024.09.13. Error message format changed significantly, requiring updates to the test logic. No other substantive changes to conformance results. Changed test infrastructure to make sure old versions of type checkers are uninstalled before installing new to guarantee correct version and increase determinism of timings. * Added "--version" invocation to mypy after installation to eliminate the artificial time associated with malware scanning on MacOS. --- .../mypy/annotations_forward_refs.toml | 11 +- .../mypy/generics_syntax_infer_variance.toml | 165 +++-- conformance/results/mypy/version.toml | 4 +- .../pyre/annotations_forward_refs.toml | 2 +- .../pyre/generics_syntax_infer_variance.toml | 29 +- conformance/results/pyre/version.toml | 2 +- .../results/pyright/aliases_explicit.toml | 20 +- .../results/pyright/aliases_implicit.toml | 7 +- .../results/pyright/aliases_newtype.toml | 10 +- .../results/pyright/aliases_recursive.toml | 122 ++-- .../pyright/aliases_type_statement.toml | 32 +- .../pyright/aliases_typealiastype.toml | 12 +- .../pyright/annotations_forward_refs.toml | 20 +- .../pyright/annotations_generators.toml | 32 +- .../results/pyright/annotations_methods.toml | 2 +- .../results/pyright/annotations_typeexpr.toml | 18 +- .../results/pyright/callables_annotation.toml | 30 +- .../results/pyright/callables_kwargs.toml | 25 +- .../results/pyright/callables_protocol.toml | 68 ++- .../results/pyright/callables_subtyping.toml | 162 ++--- .../results/pyright/classes_classvar.toml | 7 +- .../pyright/constructors_call_init.toml | 10 +- .../pyright/constructors_call_new.toml | 6 +- .../pyright/constructors_call_type.toml | 13 +- .../pyright/constructors_callable.toml | 4 +- .../results/pyright/dataclasses_final.toml | 15 +- .../results/pyright/dataclasses_frozen.toml | 6 +- .../results/pyright/dataclasses_hash.toml | 8 +- .../results/pyright/dataclasses_postinit.toml | 2 +- .../pyright/dataclasses_transform_class.toml | 6 +- .../dataclasses_transform_converter.toml | 40 +- .../pyright/dataclasses_transform_func.toml | 5 +- .../pyright/dataclasses_transform_meta.toml | 6 +- .../results/pyright/dataclasses_usage.toml | 6 +- .../pyright/directives_no_type_check.toml | 4 +- .../pyright/directives_type_ignore_file2.toml | 4 +- .../results/pyright/enums_member_values.toml | 6 +- .../results/pyright/generics_base_class.toml | 2 +- .../results/pyright/generics_basic.toml | 10 +- .../generics_defaults_referential.toml | 4 +- .../generics_paramspec_components.toml | 4 +- .../pyright/generics_paramspec_semantics.toml | 20 +- .../generics_paramspec_specialization.toml | 8 +- .../results/pyright/generics_scoping.toml | 2 +- .../pyright/generics_self_attributes.toml | 14 +- .../results/pyright/generics_self_basic.toml | 8 +- .../pyright/generics_self_protocols.toml | 8 +- .../results/pyright/generics_self_usage.toml | 4 +- .../pyright/generics_syntax_declarations.toml | 2 +- .../generics_syntax_infer_variance.toml | 80 ++- .../pyright/generics_type_erasure.toml | 12 +- .../pyright/generics_typevartuple_args.toml | 21 +- .../pyright/generics_typevartuple_basic.toml | 18 +- .../generics_typevartuple_callable.toml | 4 +- .../pyright/generics_typevartuple_unpack.toml | 2 +- .../results/pyright/generics_upper_bound.toml | 4 +- .../pyright/generics_variance_inference.toml | 119 ++-- .../pyright/literals_literalstring.toml | 28 +- .../pyright/literals_parameterizations.toml | 16 +- .../results/pyright/literals_semantics.toml | 19 +- .../pyright/namedtuples_define_class.toml | 6 +- .../namedtuples_define_functional.toml | 6 +- .../pyright/namedtuples_type_compat.toml | 10 +- .../results/pyright/namedtuples_usage.toml | 6 +- .../results/pyright/narrowing_typeguard.toml | 12 +- .../results/pyright/narrowing_typeis.toml | 30 +- .../results/pyright/overloads_basic.toml | 2 +- .../pyright/protocols_class_objects.toml | 24 +- .../results/pyright/protocols_definition.toml | 68 ++- .../results/pyright/protocols_explicit.toml | 5 +- .../results/pyright/protocols_generic.toml | 62 +- .../results/pyright/protocols_merging.toml | 14 +- .../results/pyright/protocols_modules.toml | 12 +- .../results/pyright/protocols_subtyping.toml | 34 +- .../results/pyright/protocols_variance.toml | 14 +- .../results/pyright/qualifiers_annotated.toml | 27 +- .../pyright/qualifiers_final_annotation.toml | 18 +- .../results/pyright/specialtypes_never.toml | 8 +- .../results/pyright/specialtypes_none.toml | 6 +- .../results/pyright/specialtypes_type.toml | 10 +- .../results/pyright/tuples_type_compat.toml | 66 +- .../results/pyright/tuples_type_form.toml | 20 +- .../pyright/typeddicts_alt_syntax.toml | 4 +- .../pyright/typeddicts_operations.toml | 14 +- .../typeddicts_readonly_consistency.toml | 16 +- .../typeddicts_readonly_inheritance.toml | 12 +- .../pyright/typeddicts_readonly_update.toml | 2 +- .../results/pyright/typeddicts_required.toml | 2 +- .../pyright/typeddicts_type_consistency.toml | 34 +- .../results/pyright/typeddicts_usage.toml | 4 +- conformance/results/pyright/version.toml | 4 +- .../results/pytype/aliases_explicit.toml | 114 +++- .../results/pytype/aliases_implicit.toml | 334 +++++++++- .../results/pytype/aliases_newtype.toml | 24 +- .../results/pytype/aliases_recursive.toml | 126 +++- .../results/pytype/aliases_typealiastype.toml | 69 ++- .../results/pytype/aliases_variance.toml | 16 +- .../pytype/annotations_forward_refs.toml | 445 +++++++++++++- .../pytype/annotations_generators.toml | 80 ++- .../results/pytype/annotations_methods.toml | 6 +- .../results/pytype/annotations_typeexpr.toml | 362 ++++++++++- .../results/pytype/callables_kwargs.toml | 98 ++- .../results/pytype/callables_protocol.toml | 52 +- .../results/pytype/callables_subtyping.toml | 44 +- .../results/pytype/classes_classvar.toml | 123 +++- .../results/pytype/classes_override.toml | 60 +- .../pytype/constructors_call_init.toml | 94 ++- .../pytype/constructors_call_metaclass.toml | 40 +- .../results/pytype/constructors_call_new.toml | 46 +- .../pytype/constructors_call_type.toml | 44 +- .../results/pytype/constructors_callable.toml | 270 ++++++-- .../pytype/dataclasses_descriptors.toml | 66 +- .../results/pytype/dataclasses_final.toml | 26 +- .../results/pytype/dataclasses_kwonly.toml | 50 +- .../results/pytype/dataclasses_postinit.toml | 22 +- .../results/pytype/dataclasses_slots.toml | 28 +- .../pytype/dataclasses_transform_class.toml | 52 +- .../dataclasses_transform_converter.toml | 122 +++- .../pytype/dataclasses_transform_field.toml | 16 +- .../pytype/dataclasses_transform_func.toml | 80 ++- .../pytype/dataclasses_transform_meta.toml | 30 +- .../results/pytype/dataclasses_usage.toml | 66 +- .../pytype/directives_assert_type.toml | 30 +- .../results/pytype/directives_cast.toml | 12 +- .../results/pytype/directives_deprecated.toml | 30 +- .../pytype/directives_no_type_check.toml | 30 +- .../pytype/directives_reveal_type.toml | 38 +- .../pytype/directives_type_ignore.toml | 15 +- .../pytype/directives_version_platform.toml | 18 +- .../results/pytype/enums_definition.toml | 6 +- .../results/pytype/enums_member_values.toml | 66 +- conformance/results/pytype/enums_members.toml | 146 ++++- .../pytype/exceptions_context_managers.toml | 16 +- .../results/pytype/generics_base_class.toml | 26 +- .../results/pytype/generics_basic.toml | 86 ++- .../results/pytype/generics_defaults.toml | 415 ++++++++++--- .../pytype/generics_defaults_referential.toml | 270 ++++++-- .../generics_defaults_specialization.toml | 127 +++- .../generics_paramspec_specialization.toml | 86 ++- .../results/pytype/generics_scoping.toml | 94 ++- .../pytype/generics_self_advanced.toml | 100 ++- .../pytype/generics_self_attributes.toml | 6 +- .../results/pytype/generics_self_basic.toml | 62 +- .../results/pytype/generics_self_usage.toml | 76 ++- .../generics_syntax_infer_variance.toml | 27 +- .../pytype/generics_typevartuple_args.toml | 144 ++++- .../pytype/generics_typevartuple_basic.toml | 358 +++++++++-- .../generics_typevartuple_callable.toml | 148 ++++- .../pytype/generics_typevartuple_concat.toml | 187 ++++-- .../generics_typevartuple_overloads.toml | 81 ++- .../generics_typevartuple_specialization.toml | 575 ++++++++++++++---- .../pytype/generics_typevartuple_unpack.toml | 82 ++- .../results/pytype/generics_upper_bound.toml | 40 +- .../results/pytype/generics_variance.toml | 44 +- .../results/pytype/historical_positional.toml | 6 +- .../results/pytype/literals_interactions.toml | 84 ++- .../pytype/literals_literalstring.toml | 86 ++- .../pytype/literals_parameterizations.toml | 111 +++- .../results/pytype/literals_semantics.toml | 62 +- .../pytype/namedtuples_define_class.toml | 76 ++- .../pytype/namedtuples_define_functional.toml | 74 ++- .../pytype/namedtuples_type_compat.toml | 12 +- .../results/pytype/namedtuples_usage.toml | 40 +- .../results/pytype/narrowing_typeguard.toml | 12 +- .../results/pytype/narrowing_typeis.toml | 40 +- .../results/pytype/overloads_basic.toml | 22 +- .../pytype/protocols_class_objects.toml | 18 +- .../results/pytype/protocols_definition.toml | 50 +- .../results/pytype/protocols_explicit.toml | 20 +- .../results/pytype/protocols_generic.toml | 56 +- .../results/pytype/protocols_merging.toml | 30 +- .../results/pytype/protocols_modules.toml | 16 +- .../results/pytype/protocols_recursive.toml | 24 +- .../results/pytype/protocols_self.toml | 32 +- .../results/pytype/protocols_subtyping.toml | 28 +- .../results/pytype/protocols_variance.toml | 24 +- .../results/pytype/qualifiers_annotated.toml | 68 ++- .../pytype/qualifiers_final_annotation.toml | 123 +++- .../pytype/qualifiers_final_decorator.toml | 268 +++++++- .../results/pytype/specialtypes_never.toml | 47 +- .../results/pytype/specialtypes_none.toml | 12 +- .../pytype/specialtypes_promotions.toml | 6 +- .../results/pytype/specialtypes_type.toml | 90 ++- .../results/pytype/tuples_type_compat.toml | 388 +++++++++--- .../results/pytype/tuples_type_form.toml | 78 ++- .../results/pytype/tuples_unpacked.toml | 196 ++++-- .../results/pytype/typeddicts_alt_syntax.toml | 12 +- .../pytype/typeddicts_class_syntax.toml | 12 +- .../pytype/typeddicts_inheritance.toml | 24 +- .../results/pytype/typeddicts_operations.toml | 32 +- .../results/pytype/typeddicts_readonly.toml | 8 +- .../typeddicts_readonly_consistency.toml | 30 +- .../typeddicts_readonly_inheritance.toml | 148 ++++- .../pytype/typeddicts_readonly_kwargs.toml | 22 +- .../pytype/typeddicts_readonly_update.toml | 8 +- .../pytype/typeddicts_type_consistency.toml | 26 +- .../results/pytype/typeddicts_usage.toml | 18 +- conformance/results/pytype/version.toml | 4 +- conformance/results/results.html | 20 +- conformance/src/type_checker.py | 60 +- .../tests/generics_syntax_infer_variance.py | 11 +- 201 files changed, 8378 insertions(+), 2584 deletions(-) diff --git a/conformance/results/mypy/annotations_forward_refs.toml b/conformance/results/mypy/annotations_forward_refs.toml index 14d8cb64c..bee7ebbd0 100644 --- a/conformance/results/mypy/annotations_forward_refs.toml +++ b/conformance/results/mypy/annotations_forward_refs.toml @@ -6,9 +6,8 @@ Incorrectly generates error for quoted type defined in class scope. """ output = """ annotations_forward_refs.py:41: error: Invalid type comment or annotation [valid-type] -annotations_forward_refs.py:42: error: Bracketed expression "[...]" is not valid as a type [valid-type] -annotations_forward_refs.py:43: error: Syntax error in type annotation [syntax] -annotations_forward_refs.py:43: note: Suggestion: Use Tuple[T1, ..., Tn] instead of (T1, ..., Tn) +annotations_forward_refs.py:42: error: Invalid type comment or annotation [valid-type] +annotations_forward_refs.py:43: error: Invalid type comment or annotation [valid-type] annotations_forward_refs.py:44: error: Invalid type comment or annotation [valid-type] annotations_forward_refs.py:45: error: Invalid type comment or annotation [valid-type] annotations_forward_refs.py:46: error: Invalid type comment or annotation [valid-type] @@ -16,9 +15,9 @@ annotations_forward_refs.py:47: error: Invalid type comment or annotation [vali annotations_forward_refs.py:48: error: Invalid type comment or annotation [valid-type] annotations_forward_refs.py:49: error: Variable "annotations_forward_refs.var1" is not valid as a type [valid-type] annotations_forward_refs.py:49: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -annotations_forward_refs.py:50: error: Invalid type: try using Literal[True] instead? [valid-type] -annotations_forward_refs.py:51: error: Invalid type: try using Literal[1] instead? [valid-type] -annotations_forward_refs.py:52: error: Invalid type: try using Literal[-1] instead? [valid-type] +annotations_forward_refs.py:50: error: Invalid type comment or annotation [valid-type] +annotations_forward_refs.py:51: error: Invalid type comment or annotation [valid-type] +annotations_forward_refs.py:52: error: Invalid type comment or annotation [valid-type] annotations_forward_refs.py:53: error: Invalid type comment or annotation [valid-type] annotations_forward_refs.py:54: error: Invalid type comment or annotation [valid-type] annotations_forward_refs.py:55: error: Module "types" is not valid as a type [valid-type] diff --git a/conformance/results/mypy/generics_syntax_infer_variance.toml b/conformance/results/mypy/generics_syntax_infer_variance.toml index b354ae226..1db3d4a8d 100644 --- a/conformance/results/mypy/generics_syntax_infer_variance.toml +++ b/conformance/results/mypy/generics_syntax_infer_variance.toml @@ -34,70 +34,66 @@ generics_syntax_infer_variance.py:46: error: The type "type[ShouldBeCovariant3]" generics_syntax_infer_variance.py:50: error: Free type variable expected in Generic[...] [misc] generics_syntax_infer_variance.py:51: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] generics_syntax_infer_variance.py:51: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:54: error: "ShouldBeCovariant4" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:54: error: The type "type[ShouldBeCovariant4]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:55: error: "ShouldBeCovariant4" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:55: error: The type "type[ShouldBeCovariant4]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:58: error: Free type variable expected in Generic[...] [misc] -generics_syntax_infer_variance.py:59: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:59: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:63: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:63: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:67: error: "ShouldBeCovariant5" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:67: error: The type "type[ShouldBeCovariant5]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:68: error: "ShouldBeCovariant5" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:68: error: The type "type[ShouldBeCovariant5]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:71: error: Free type variable expected in Generic[...] [misc] -generics_syntax_infer_variance.py:72: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:72: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:74: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:74: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:78: error: "ShouldBeCovariant6" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:78: error: The type "type[ShouldBeCovariant6]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:79: error: "ShouldBeCovariant6" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:79: error: The type "type[ShouldBeCovariant6]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:82: error: Free type variable expected in Generic[...] [misc] -generics_syntax_infer_variance.py:83: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:83: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:91: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:91: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:95: error: "ShouldBeInvariant1" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:95: error: The type "type[ShouldBeInvariant1]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:96: error: "ShouldBeInvariant1" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:96: error: The type "type[ShouldBeInvariant1]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:99: error: Free type variable expected in Generic[...] [misc] -generics_syntax_infer_variance.py:100: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:100: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:103: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:103: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:106: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:106: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:110: error: "ShouldBeInvariant2" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:110: error: The type "type[ShouldBeInvariant2]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:111: error: "ShouldBeInvariant2" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:111: error: The type "type[ShouldBeInvariant2]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:114: error: Variable "generics_syntax_infer_variance.K" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:114: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:114: error: Variable "generics_syntax_infer_variance.V" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:118: error: "ShouldBeInvariant3" expects no type arguments, but 2 given [type-arg] -generics_syntax_infer_variance.py:118: error: The type "type[ShouldBeInvariant3]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:119: error: "ShouldBeInvariant3" expects no type arguments, but 2 given [type-arg] -generics_syntax_infer_variance.py:119: error: The type "type[ShouldBeInvariant3]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:120: error: "ShouldBeInvariant3" expects no type arguments, but 2 given [type-arg] -generics_syntax_infer_variance.py:120: error: The type "type[ShouldBeInvariant3]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:121: error: "ShouldBeInvariant3" expects no type arguments, but 2 given [type-arg] -generics_syntax_infer_variance.py:121: error: The type "type[ShouldBeInvariant3]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:129: error: Incompatible types in assignment (expression has type "ShouldBeInvariant4[int]", variable has type "ShouldBeInvariant4[float]") [assignment] -generics_syntax_infer_variance.py:137: error: Incompatible types in assignment (expression has type "ShouldBeInvariant5[int]", variable has type "ShouldBeInvariant5[float]") [assignment] -generics_syntax_infer_variance.py:140: error: Free type variable expected in Generic[...] [misc] -generics_syntax_infer_variance.py:141: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:141: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:144: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:144: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:148: error: "ShouldBeContravariant1" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:148: error: The type "type[ShouldBeContravariant1]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:149: error: "ShouldBeContravariant1" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:149: error: The type "type[ShouldBeContravariant1]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:65: error: Free type variable expected in Generic[...] [misc] +generics_syntax_infer_variance.py:66: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:66: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:70: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:70: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:74: error: "ShouldBeCovariant5" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:74: error: The type "type[ShouldBeCovariant5]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:75: error: "ShouldBeCovariant5" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:75: error: The type "type[ShouldBeCovariant5]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:78: error: Free type variable expected in Generic[...] [misc] +generics_syntax_infer_variance.py:79: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:79: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:81: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:81: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:85: error: "ShouldBeCovariant6" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:85: error: The type "type[ShouldBeCovariant6]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:86: error: "ShouldBeCovariant6" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:86: error: The type "type[ShouldBeCovariant6]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:89: error: Free type variable expected in Generic[...] [misc] +generics_syntax_infer_variance.py:90: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:90: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:98: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:98: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:102: error: "ShouldBeInvariant1" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:102: error: The type "type[ShouldBeInvariant1]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:103: error: "ShouldBeInvariant1" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:103: error: The type "type[ShouldBeInvariant1]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:106: error: Free type variable expected in Generic[...] [misc] +generics_syntax_infer_variance.py:107: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:107: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:110: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:110: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:113: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:113: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:117: error: "ShouldBeInvariant2" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:117: error: The type "type[ShouldBeInvariant2]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:118: error: "ShouldBeInvariant2" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:118: error: The type "type[ShouldBeInvariant2]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:121: error: Variable "generics_syntax_infer_variance.K" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:121: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:121: error: Variable "generics_syntax_infer_variance.V" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:125: error: "ShouldBeInvariant3" expects no type arguments, but 2 given [type-arg] +generics_syntax_infer_variance.py:125: error: The type "type[ShouldBeInvariant3]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:126: error: "ShouldBeInvariant3" expects no type arguments, but 2 given [type-arg] +generics_syntax_infer_variance.py:126: error: The type "type[ShouldBeInvariant3]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:127: error: "ShouldBeInvariant3" expects no type arguments, but 2 given [type-arg] +generics_syntax_infer_variance.py:127: error: The type "type[ShouldBeInvariant3]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:128: error: "ShouldBeInvariant3" expects no type arguments, but 2 given [type-arg] +generics_syntax_infer_variance.py:128: error: The type "type[ShouldBeInvariant3]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:136: error: Incompatible types in assignment (expression has type "ShouldBeInvariant4[int]", variable has type "ShouldBeInvariant4[float]") [assignment] +generics_syntax_infer_variance.py:144: error: Incompatible types in assignment (expression has type "ShouldBeInvariant5[int]", variable has type "ShouldBeInvariant5[float]") [assignment] +generics_syntax_infer_variance.py:147: error: Free type variable expected in Generic[...] [misc] +generics_syntax_infer_variance.py:148: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:148: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:151: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:151: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:155: error: "ShouldBeContravariant1" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:155: error: The type "type[ShouldBeContravariant1]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:156: error: "ShouldBeContravariant1" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:156: error: The type "type[ShouldBeContravariant1]" is not generic and not indexable [misc] """ conformance_automated = "Fail" errors_diff = """ @@ -115,25 +111,24 @@ Line 41: Unexpected errors ['generics_syntax_infer_variance.py:41: error: Variab Line 45: Unexpected errors ['generics_syntax_infer_variance.py:45: error: "ShouldBeCovariant3" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_infer_variance.py:45: error: The type "type[ShouldBeCovariant3]" is not generic and not indexable [misc]'] Line 50: Unexpected errors ['generics_syntax_infer_variance.py:50: error: Free type variable expected in Generic[...] [misc]'] Line 51: Unexpected errors ['generics_syntax_infer_variance.py:51: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 54: Unexpected errors ['generics_syntax_infer_variance.py:54: error: "ShouldBeCovariant4" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_infer_variance.py:54: error: The type "type[ShouldBeCovariant4]" is not generic and not indexable [misc]'] -Line 58: Unexpected errors ['generics_syntax_infer_variance.py:58: error: Free type variable expected in Generic[...] [misc]'] -Line 59: Unexpected errors ['generics_syntax_infer_variance.py:59: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 63: Unexpected errors ['generics_syntax_infer_variance.py:63: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 67: Unexpected errors ['generics_syntax_infer_variance.py:67: error: "ShouldBeCovariant5" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_infer_variance.py:67: error: The type "type[ShouldBeCovariant5]" is not generic and not indexable [misc]'] -Line 71: Unexpected errors ['generics_syntax_infer_variance.py:71: error: Free type variable expected in Generic[...] [misc]'] -Line 72: Unexpected errors ['generics_syntax_infer_variance.py:72: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 74: Unexpected errors ['generics_syntax_infer_variance.py:74: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 78: Unexpected errors ['generics_syntax_infer_variance.py:78: error: "ShouldBeCovariant6" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_infer_variance.py:78: error: The type "type[ShouldBeCovariant6]" is not generic and not indexable [misc]'] -Line 82: Unexpected errors ['generics_syntax_infer_variance.py:82: error: Free type variable expected in Generic[...] [misc]'] -Line 83: Unexpected errors ['generics_syntax_infer_variance.py:83: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 91: Unexpected errors ['generics_syntax_infer_variance.py:91: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 99: Unexpected errors ['generics_syntax_infer_variance.py:99: error: Free type variable expected in Generic[...] [misc]'] -Line 100: Unexpected errors ['generics_syntax_infer_variance.py:100: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 103: Unexpected errors ['generics_syntax_infer_variance.py:103: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 106: Unexpected errors ['generics_syntax_infer_variance.py:106: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 114: Unexpected errors ['generics_syntax_infer_variance.py:114: error: Variable "generics_syntax_infer_variance.K" is not valid as a type [valid-type]', 'generics_syntax_infer_variance.py:114: error: Variable "generics_syntax_infer_variance.V" is not valid as a type [valid-type]'] -Line 140: Unexpected errors ['generics_syntax_infer_variance.py:140: error: Free type variable expected in Generic[...] [misc]'] -Line 141: Unexpected errors ['generics_syntax_infer_variance.py:141: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 144: Unexpected errors ['generics_syntax_infer_variance.py:144: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 149: Unexpected errors ['generics_syntax_infer_variance.py:149: error: "ShouldBeContravariant1" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_infer_variance.py:149: error: The type "type[ShouldBeContravariant1]" is not generic and not indexable [misc]'] +Line 65: Unexpected errors ['generics_syntax_infer_variance.py:65: error: Free type variable expected in Generic[...] [misc]'] +Line 66: Unexpected errors ['generics_syntax_infer_variance.py:66: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 70: Unexpected errors ['generics_syntax_infer_variance.py:70: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 74: Unexpected errors ['generics_syntax_infer_variance.py:74: error: "ShouldBeCovariant5" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_infer_variance.py:74: error: The type "type[ShouldBeCovariant5]" is not generic and not indexable [misc]'] +Line 78: Unexpected errors ['generics_syntax_infer_variance.py:78: error: Free type variable expected in Generic[...] [misc]'] +Line 79: Unexpected errors ['generics_syntax_infer_variance.py:79: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 81: Unexpected errors ['generics_syntax_infer_variance.py:81: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 85: Unexpected errors ['generics_syntax_infer_variance.py:85: error: "ShouldBeCovariant6" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_infer_variance.py:85: error: The type "type[ShouldBeCovariant6]" is not generic and not indexable [misc]'] +Line 89: Unexpected errors ['generics_syntax_infer_variance.py:89: error: Free type variable expected in Generic[...] [misc]'] +Line 90: Unexpected errors ['generics_syntax_infer_variance.py:90: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 98: Unexpected errors ['generics_syntax_infer_variance.py:98: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 106: Unexpected errors ['generics_syntax_infer_variance.py:106: error: Free type variable expected in Generic[...] [misc]'] +Line 107: Unexpected errors ['generics_syntax_infer_variance.py:107: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 110: Unexpected errors ['generics_syntax_infer_variance.py:110: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 113: Unexpected errors ['generics_syntax_infer_variance.py:113: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 121: Unexpected errors ['generics_syntax_infer_variance.py:121: error: Variable "generics_syntax_infer_variance.K" is not valid as a type [valid-type]', 'generics_syntax_infer_variance.py:121: error: Variable "generics_syntax_infer_variance.V" is not valid as a type [valid-type]'] +Line 147: Unexpected errors ['generics_syntax_infer_variance.py:147: error: Free type variable expected in Generic[...] [misc]'] +Line 148: Unexpected errors ['generics_syntax_infer_variance.py:148: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 151: Unexpected errors ['generics_syntax_infer_variance.py:151: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 156: Unexpected errors ['generics_syntax_infer_variance.py:156: error: "ShouldBeContravariant1" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_infer_variance.py:156: error: The type "type[ShouldBeContravariant1]" is not generic and not indexable [misc]'] """ diff --git a/conformance/results/mypy/version.toml b/conformance/results/mypy/version.toml index efd7c7998..aa90cb33e 100644 --- a/conformance/results/mypy/version.toml +++ b/conformance/results/mypy/version.toml @@ -1,2 +1,2 @@ -version = "mypy 1.11.1" -test_duration = 13.2 +version = "mypy 1.11.2" +test_duration = 1.9 diff --git a/conformance/results/pyre/annotations_forward_refs.toml b/conformance/results/pyre/annotations_forward_refs.toml index 1e4ecf739..6c52e88e7 100644 --- a/conformance/results/pyre/annotations_forward_refs.toml +++ b/conformance/results/pyre/annotations_forward_refs.toml @@ -8,7 +8,7 @@ Does not generate error for unquoted type defined in class scope. Does not treat triple-quoted forward reference annotation as implicitly parenthesized. """ output = """ -annotations_forward_refs.py:41:8 Undefined or invalid type [11]: Annotation `eval(.join(map(chr, [105, 110, 116])))` is not defined as a type. +annotations_forward_refs.py:41:8 Invalid type [31]: Expression `eval("".join(map(chr, [105, 110, 116])))` is not a valid type. annotations_forward_refs.py:42:8 Invalid type [31]: Expression `"[int, str]"` is not a valid type. annotations_forward_refs.py:43:8 Invalid type [31]: Expression `"(int, str)"` is not a valid type. annotations_forward_refs.py:44:8 Undefined or invalid type [11]: Annotation `comprehension(int for generators(generator($target$i in range(1) if )))` is not defined as a type. diff --git a/conformance/results/pyre/generics_syntax_infer_variance.toml b/conformance/results/pyre/generics_syntax_infer_variance.toml index 2a2c10d66..7a8486583 100644 --- a/conformance/results/pyre/generics_syntax_infer_variance.toml +++ b/conformance/results/pyre/generics_syntax_infer_variance.toml @@ -3,7 +3,7 @@ notes = """ Type parameter syntax not yet support. """ output = """ -generics_syntax_infer_variance.py:125:25 Parsing failure [404]: invalid syntax +generics_syntax_infer_variance.py:132:25 Parsing failure [404]: invalid syntax """ conformance_automated = "Fail" errors_diff = """ @@ -12,19 +12,18 @@ Line 17: Expected 1 errors Line 29: Expected 1 errors Line 37: Expected 1 errors Line 46: Expected 1 errors -Line 55: Expected 1 errors -Line 68: Expected 1 errors -Line 79: Expected 1 errors -Line 95: Expected 1 errors -Line 96: Expected 1 errors -Line 110: Expected 1 errors -Line 111: Expected 1 errors +Line 75: Expected 1 errors +Line 86: Expected 1 errors +Line 102: Expected 1 errors +Line 103: Expected 1 errors +Line 117: Expected 1 errors Line 118: Expected 1 errors -Line 119: Expected 1 errors -Line 120: Expected 1 errors -Line 121: Expected 1 errors -Line 129: Expected 1 errors -Line 137: Expected 1 errors -Line 148: Expected 1 errors -Line 125: Unexpected errors ['generics_syntax_infer_variance.py:125:25 Parsing failure [404]: invalid syntax'] +Line 125: Expected 1 errors +Line 126: Expected 1 errors +Line 127: Expected 1 errors +Line 128: Expected 1 errors +Line 136: Expected 1 errors +Line 144: Expected 1 errors +Line 155: Expected 1 errors +Line 132: Unexpected errors ['generics_syntax_infer_variance.py:132:25 Parsing failure [404]: invalid syntax'] """ diff --git a/conformance/results/pyre/version.toml b/conformance/results/pyre/version.toml index 9de046bf2..f4f08845e 100644 --- a/conformance/results/pyre/version.toml +++ b/conformance/results/pyre/version.toml @@ -1,2 +1,2 @@ version = "pyre 0.9.22" -test_duration = 5.4 +test_duration = 4.5 diff --git a/conformance/results/pyright/aliases_explicit.toml b/conformance/results/pyright/aliases_explicit.toml index 2d5557190..a1e82c9eb 100644 --- a/conformance/results/pyright/aliases_explicit.toml +++ b/conformance/results/pyright/aliases_explicit.toml @@ -9,40 +9,40 @@ aliases_explicit.py:71:24 - error: Expected ParamSpec, ellipsis, or list of type aliases_explicit.py:79:21 - error: Invalid expression form for type alias definition (reportInvalidTypeForm) aliases_explicit.py:79:21 - error: Call expression not allowed in type expression (reportInvalidTypeForm) aliases_explicit.py:80:21 - error: Invalid expression form for type alias definition (reportInvalidTypeForm) -aliases_explicit.py:80:21 - error: List expression not allowed in type annotation +aliases_explicit.py:80:21 - error: List expression not allowed in type expression   Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) aliases_explicit.py:80:21 - error: Expected class but received "list[Unknown]" (reportGeneralTypeIssues) aliases_explicit.py:81:21 - error: Invalid expression form for type alias definition (reportInvalidTypeForm) -aliases_explicit.py:81:21 - error: Tuple expression not allowed in type annotation +aliases_explicit.py:81:21 - error: Tuple expression not allowed in type expression   Use tuple[T1, ..., Tn] to indicate a tuple type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) aliases_explicit.py:82:21 - error: Invalid expression form for type alias definition (reportInvalidTypeForm) -aliases_explicit.py:82:21 - error: List expression not allowed in type annotation +aliases_explicit.py:82:21 - error: List expression not allowed in type expression   Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) aliases_explicit.py:82:21 - error: Expected class but received "list[type[int]]" (reportGeneralTypeIssues) aliases_explicit.py:83:21 - error: Invalid expression form for type alias definition (reportInvalidTypeForm) -aliases_explicit.py:83:21 - error: Dictionary expression not allowed in type annotation +aliases_explicit.py:83:21 - error: Dictionary expression not allowed in type expression   Use Dict[T1, T2] to indicate a dictionary type (reportInvalidTypeForm) aliases_explicit.py:83:21 - error: Expected class but received "dict[str, Unknown]" (reportGeneralTypeIssues) aliases_explicit.py:83:28 - error: "b" is not defined (reportUndefinedVariable) aliases_explicit.py:84:21 - error: Invalid expression form for type alias definition (reportInvalidTypeForm) aliases_explicit.py:84:21 - error: Call expression not allowed in type expression (reportInvalidTypeForm) aliases_explicit.py:85:21 - error: Invalid expression form for type alias definition (reportInvalidTypeForm) -aliases_explicit.py:85:21 - error: List expression not allowed in type annotation +aliases_explicit.py:85:21 - error: List expression not allowed in type expression   Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) aliases_explicit.py:85:21 - error: Expected class but received "list[type[int]]" (reportGeneralTypeIssues) aliases_explicit.py:85:27 - error: Expected class but received "Literal[0]" (reportGeneralTypeIssues) aliases_explicit.py:86:21 - error: Invalid expression form for type alias definition (reportInvalidTypeForm) -aliases_explicit.py:86:21 - error: Ternary expression not allowed in type annotation (reportInvalidTypeForm) +aliases_explicit.py:86:21 - error: Ternary expression not allowed in type expression (reportInvalidTypeForm) aliases_explicit.py:87:21 - error: Variable not allowed in type expression (reportInvalidTypeForm) +aliases_explicit.py:88:22 - error: Invalid expression form for type alias definition (reportInvalidTypeForm) aliases_explicit.py:88:22 - error: Expected class but received "Literal[True]" (reportGeneralTypeIssues) aliases_explicit.py:89:22 - error: Invalid expression form for type alias definition (reportInvalidTypeForm) aliases_explicit.py:89:22 - error: Expected class but received "Literal[1]" (reportGeneralTypeIssues) aliases_explicit.py:90:22 - error: Invalid expression form for type alias definition (reportInvalidTypeForm) -aliases_explicit.py:90:22 - error: Binary operator not allowed in type annotation (reportInvalidTypeForm) -aliases_explicit.py:91:22 - error: Type annotations cannot use format string literals (f-strings) (reportGeneralTypeIssues) +aliases_explicit.py:90:22 - error: Binary operator not allowed in type expression (reportInvalidTypeForm) +aliases_explicit.py:91:22 - error: Type expressions cannot use format string literals (f-strings) (reportGeneralTypeIssues) aliases_explicit.py:100:5 - error: Type "list[Unknown]" is already specialized (reportInvalidTypeArguments) -aliases_explicit.py:101:6 - error: Object of type "UnionType" is not callable -  Attribute "__call__" is unknown (reportCallIssue) +aliases_explicit.py:101:6 - error: Object of type "UnionType" is not callable (reportCallIssue) aliases_explicit.py:102:5 - error: Type "list[Unknown]" is already specialized (reportInvalidTypeArguments) aliases_explicit.py:102:5 - error: Type "set[Unknown]" is already specialized (reportInvalidTypeArguments) """ diff --git a/conformance/results/pyright/aliases_implicit.toml b/conformance/results/pyright/aliases_implicit.toml index fde2e84ca..32f2b7be2 100644 --- a/conformance/results/pyright/aliases_implicit.toml +++ b/conformance/results/pyright/aliases_implicit.toml @@ -7,8 +7,8 @@ aliases_implicit.py:78:29 - error: Too many type arguments provided for "GoodTyp aliases_implicit.py:79:29 - error: Too many type arguments provided for "GoodTypeAlias8[T@GoodTypeAlias8]"; expected 1 but received 2 (reportInvalidTypeForm) aliases_implicit.py:80:24 - error: Expected ParamSpec, ellipsis, or list of types (reportInvalidTypeForm) aliases_implicit.py:81:9 - error: Could not specialize type "GoodTypeAlias12[TFloat@GoodTypeAlias12]" -  Type "str" is incompatible with type "float" -    "str" is incompatible with "float" (reportInvalidTypeForm) +  Type "str" is not assignable to type "float" +    "str" is not assignable to "float" (reportInvalidTypeForm) aliases_implicit.py:106:9 - error: Variable not allowed in type expression (reportInvalidTypeForm) aliases_implicit.py:107:9 - error: Variable not allowed in type expression (reportInvalidTypeForm) aliases_implicit.py:108:9 - error: Variable not allowed in type expression (reportInvalidTypeForm) @@ -23,8 +23,7 @@ aliases_implicit.py:116:10 - error: Variable not allowed in type expression (rep aliases_implicit.py:117:10 - error: Variable not allowed in type expression (reportInvalidTypeForm) aliases_implicit.py:118:10 - error: Variable not allowed in type expression (reportInvalidTypeForm) aliases_implicit.py:119:10 - error: Variable not allowed in type expression (reportInvalidTypeForm) -aliases_implicit.py:133:6 - error: Object of type "UnionType" is not callable -  Attribute "__call__" is unknown (reportCallIssue) +aliases_implicit.py:133:6 - error: Object of type "UnionType" is not callable (reportCallIssue) aliases_implicit.py:135:5 - error: Type "list[Unknown]" is already specialized (reportInvalidTypeArguments) aliases_implicit.py:135:5 - error: Type "set[Unknown]" is already specialized (reportInvalidTypeArguments) """ diff --git a/conformance/results/pyright/aliases_newtype.toml b/conformance/results/pyright/aliases_newtype.toml index 6d46e752d..256c13616 100644 --- a/conformance/results/pyright/aliases_newtype.toml +++ b/conformance/results/pyright/aliases_newtype.toml @@ -1,9 +1,9 @@ conformant = "Pass" output = """ aliases_newtype.py:11:8 - error: Argument of type "Literal['user']" cannot be assigned to parameter "_x" of type "int" in function "__init__" -  "Literal['user']" is incompatible with "int" (reportArgumentType) -aliases_newtype.py:12:14 - error: Expression of type "Literal[42]" is incompatible with declared type "UserId" -  "Literal[42]" is incompatible with "UserId" (reportAssignmentType) +  "Literal['user']" is not assignable to "int" (reportArgumentType) +aliases_newtype.py:12:14 - error: Type "Literal[42]" is not assignable to declared type "UserId" +  "Literal[42]" is not assignable to "UserId" (reportAssignmentType) aliases_newtype.py:20:16 - error: Second argument to "isinstance" must be a class or tuple of classes   Class created with NewType cannot be used with instance and class checks (reportArgumentType) aliases_newtype.py:23:21 - error: Base class "UserId" is marked final and cannot be subclassed (reportGeneralTypeIssues) @@ -11,9 +11,9 @@ aliases_newtype.py:32:1 - error: NewType must be assigned to a variable with the aliases_newtype.py:38:19 - error: Expected no type arguments for class "GoodNewType1" (reportInvalidTypeArguments) aliases_newtype.py:44:38 - error: Expected class as second argument to NewType (reportGeneralTypeIssues) aliases_newtype.py:47:43 - error: Type variable "T" has no meaning in this context (reportGeneralTypeIssues) -aliases_newtype.py:49:38 - error: NewType cannot be used with structural type (a protocol or TypedDict class) (reportGeneralTypeIssues) +aliases_newtype.py:49:38 - error: NewType cannot be used with structural type (a Protocol or TypedDict class) (reportGeneralTypeIssues) aliases_newtype.py:51:38 - error: NewType cannot be used with Literal type (reportGeneralTypeIssues) -aliases_newtype.py:58:38 - error: NewType cannot be used with structural type (a protocol or TypedDict class) (reportGeneralTypeIssues) +aliases_newtype.py:58:38 - error: NewType cannot be used with structural type (a Protocol or TypedDict class) (reportGeneralTypeIssues) aliases_newtype.py:60:15 - error: NewType requires two positional arguments (reportCallIssue) aliases_newtype.py:62:38 - error: The second argument to NewType must be a known class, not Any or Unknown (reportGeneralTypeIssues) """ diff --git a/conformance/results/pyright/aliases_recursive.toml b/conformance/results/pyright/aliases_recursive.toml index eafd7b25d..dd135ac2b 100644 --- a/conformance/results/pyright/aliases_recursive.toml +++ b/conformance/results/pyright/aliases_recursive.toml @@ -1,66 +1,74 @@ conformant = "Pass" output = """ -aliases_recursive.py:19:12 - error: Expression of type "dict[str, int | complex]" is incompatible with declared type "Json" -  Type "dict[str, int | complex]" is incompatible with type "Json" -    "dict[str, int | complex]" is incompatible with "None" -    "dict[str, int | complex]" is incompatible with "int" -    "dict[str, int | complex]" is incompatible with "str" -    "dict[str, int | complex]" is incompatible with "float" -    "dict[str, int | complex]" is incompatible with "list[Json]" -    "dict[str, int | complex]" is incompatible with "dict[str, Json]" +aliases_recursive.py:19:12 - error: Type "dict[str, int | complex]" is not assignable to declared type "Json" +  Type "dict[str, int | complex]" is not assignable to type "Json" +    "dict[str, int | complex]" is not assignable to "None" +    "dict[str, int | complex]" is not assignable to "int" +    "dict[str, int | complex]" is not assignable to "str" +    "dict[str, int | complex]" is not assignable to "float" +    "dict[str, int | complex]" is not assignable to "list[Json]" +    "dict[str, int | complex]" is not assignable to "dict[str, Json]"       Type parameter "_VT@dict" is invariant, but "int | complex" is not the same as "Json" ... (reportAssignmentType) -aliases_recursive.py:20:16 - error: Expression of type "list[int | complex]" is incompatible with declared type "Json" -  Type "complex" is incompatible with type "Json" -    "complex" is incompatible with "None" -    "complex" is incompatible with "int" -    "complex" is incompatible with "str" -    "complex" is incompatible with "float" -    "complex" is incompatible with "list[Json]" -    "complex" is incompatible with "dict[str, Json]" (reportAssignmentType) -aliases_recursive.py:38:22 - error: Expression of type "tuple[Literal[1], tuple[str, int], tuple[int, tuple[int, list[int]]]]" is incompatible with declared type "RecursiveTuple" -  Type "tuple[Literal[1], tuple[str, int], tuple[int, tuple[int, list[int]]]]" is incompatible with type "RecursiveTuple" -    "tuple[Literal[1], tuple[str, int], tuple[int, tuple[int, list[int]]]]" is incompatible with "str" -    "tuple[Literal[1], tuple[str, int], tuple[int, tuple[int, list[int]]]]" is incompatible with "int" -    "tuple[Literal[1], tuple[str, int], tuple[int, tuple[int, list[int]]]]" is incompatible with "tuple[RecursiveTuple, ...]" -      Tuple entry 1 is incorrect type (reportAssignmentType) -aliases_recursive.py:39:22 - error: Expression of type "tuple[Literal[1], list[int]]" is incompatible with declared type "RecursiveTuple" -  Type "tuple[Literal[1], list[int]]" is incompatible with type "RecursiveTuple" -    "tuple[Literal[1], list[int]]" is incompatible with "str" -    "tuple[Literal[1], list[int]]" is incompatible with "int" -    "tuple[Literal[1], list[int]]" is incompatible with "tuple[RecursiveTuple, ...]" -      Tuple entry 1 is incorrect type (reportAssignmentType) -aliases_recursive.py:50:24 - error: Expression of type "dict[str, list[int]]" is incompatible with declared type "RecursiveMapping" -  Type "dict[str, list[int]]" is incompatible with type "RecursiveMapping" -    "dict[str, list[int]]" is incompatible with "str" -    "dict[str, list[int]]" is incompatible with "int" -    "dict[str, list[int]]" is incompatible with "Mapping[str, RecursiveMapping]" +aliases_recursive.py:20:16 - error: Type "list[int | complex]" is not assignable to declared type "Json" +  Type "complex" is not assignable to type "Json" +    "complex" is not assignable to "None" +    "complex" is not assignable to "int" +    "complex" is not assignable to "str" +    "complex" is not assignable to "float" +    "complex" is not assignable to "list[Json]" +    "complex" is not assignable to "dict[str, Json]" (reportAssignmentType) +aliases_recursive.py:38:22 - error: Type "tuple[Literal[1], tuple[str, int], tuple[int, tuple[int, list[int]]]]" is not assignable to declared type "RecursiveTuple" +  Type "tuple[Literal[1], tuple[str, int], tuple[int, tuple[int, list[int]]]]" is not assignable to type "RecursiveTuple" +    "tuple[Literal[1], tuple[str, int], tuple[int, tuple[int, list[int]]]]" is not assignable to "str" +    "tuple[Literal[1], tuple[str, int], tuple[int, tuple[int, list[int]]]]" is not assignable to "int" +    "tuple[Literal[1], tuple[str, int], tuple[int, tuple[int, list[int]]]]" is not assignable to "tuple[RecursiveTuple, ...]" +      Tuple entry 1 is incorrect type +        Type "tuple[str, int] | tuple[int, tuple[int, list[int]]] | Literal[1]" is not assignable to type "RecursiveTuple" +          Type "tuple[int, tuple[int, list[int]]]" is not assignable to type "RecursiveTuple" (reportAssignmentType) +aliases_recursive.py:39:22 - error: Type "tuple[Literal[1], list[int]]" is not assignable to declared type "RecursiveTuple" +  Type "tuple[Literal[1], list[int]]" is not assignable to type "RecursiveTuple" +    "tuple[Literal[1], list[int]]" is not assignable to "str" +    "tuple[Literal[1], list[int]]" is not assignable to "int" +    "tuple[Literal[1], list[int]]" is not assignable to "tuple[RecursiveTuple, ...]" +      Tuple entry 1 is incorrect type +        Type "list[int] | Literal[1]" is not assignable to type "RecursiveTuple" +          Type "list[int]" is not assignable to type "RecursiveTuple" (reportAssignmentType) +aliases_recursive.py:50:24 - error: Type "dict[str, list[int]]" is not assignable to declared type "RecursiveMapping" +  Type "dict[str, list[int]]" is not assignable to type "RecursiveMapping" +    "dict[str, list[int]]" is not assignable to "str" +    "dict[str, list[int]]" is not assignable to "int" +    "dict[str, list[int]]" is not assignable to "Mapping[str, RecursiveMapping]"       Type parameter "_VT_co@Mapping" is covariant, but "list[int]" is not a subtype of "RecursiveMapping" -        Type "list[int]" is incompatible with type "RecursiveMapping" -          "list[int]" is incompatible with "str" -          "list[int]" is incompatible with "int" +        Type "list[int]" is not assignable to type "RecursiveMapping" +          "list[int]" is not assignable to "str" +          "list[int]" is not assignable to "int" ... (reportAssignmentType) -aliases_recursive.py:51:24 - error: Expression of type "dict[str, str | int | list[int]]" is incompatible with declared type "RecursiveMapping" -  Type "dict[str, str | int | list[int]]" is incompatible with type "RecursiveMapping" -    "dict[str, str | int | list[int]]" is incompatible with "str" -    "dict[str, str | int | list[int]]" is incompatible with "int" -    "dict[str, str | int | list[int]]" is incompatible with "Mapping[str, RecursiveMapping]" -      Type parameter "_VT_co@Mapping" is covariant, but "str | int | list[int]" is not a subtype of "RecursiveMapping" (reportAssignmentType) -aliases_recursive.py:52:24 - error: Expression of type "dict[str, str | int | dict[str, str | int | list[int]]]" is incompatible with declared type "RecursiveMapping" -  Type "dict[str, str | int | dict[str, str | int | list[int]]]" is incompatible with type "RecursiveMapping" -    "dict[str, str | int | dict[str, str | int | list[int]]]" is incompatible with "str" -    "dict[str, str | int | dict[str, str | int | list[int]]]" is incompatible with "int" -    "dict[str, str | int | dict[str, str | int | list[int]]]" is incompatible with "Mapping[str, RecursiveMapping]" -      Type parameter "_VT_co@Mapping" is covariant, but "str | int | dict[str, str | int | list[int]]" is not a subtype of "RecursiveMapping" (reportAssignmentType) -aliases_recursive.py:63:38 - error: Expression of type "list[str | list[float]]" is incompatible with declared type "GenericTypeAlias1[str]" -  Type "float" is incompatible with type "GenericTypeAlias1[T1@GenericTypeAlias1] | str" -    "float" is incompatible with "list[GenericTypeAlias1 | str]" -    "float" is incompatible with "str" (reportAssignmentType) -aliases_recursive.py:69:51 - error: Expression of type "list[list[int | list[str | int | list[float]]] | str]" is incompatible with declared type "GenericTypeAlias2[str, int]" -  Type "float" is incompatible with type "GenericTypeAlias2[T1@GenericTypeAlias2, T2@GenericTypeAlias2] | str | int" -    "float" is incompatible with "list[GenericTypeAlias2 | str | int]" -    "float" is incompatible with "str" -    "float" is incompatible with "int" (reportAssignmentType) +aliases_recursive.py:51:24 - error: Type "dict[str, str | int | list[int]]" is not assignable to declared type "RecursiveMapping" +  Type "dict[str, str | int | list[int]]" is not assignable to type "RecursiveMapping" +    "dict[str, str | int | list[int]]" is not assignable to "str" +    "dict[str, str | int | list[int]]" is not assignable to "int" +    "dict[str, str | int | list[int]]" is not assignable to "Mapping[str, RecursiveMapping]" +      Type parameter "_VT_co@Mapping" is covariant, but "str | int | list[int]" is not a subtype of "RecursiveMapping" +        Type "str | int | list[int]" is not assignable to type "RecursiveMapping" +          Type "list[int]" is not assignable to type "RecursiveMapping" (reportAssignmentType) +aliases_recursive.py:52:24 - error: Type "dict[str, str | int | dict[str, str | int | list[int]]]" is not assignable to declared type "RecursiveMapping" +  Type "dict[str, str | int | dict[str, str | int | list[int]]]" is not assignable to type "RecursiveMapping" +    "dict[str, str | int | dict[str, str | int | list[int]]]" is not assignable to "str" +    "dict[str, str | int | dict[str, str | int | list[int]]]" is not assignable to "int" +    "dict[str, str | int | dict[str, str | int | list[int]]]" is not assignable to "Mapping[str, RecursiveMapping]" +      Type parameter "_VT_co@Mapping" is covariant, but "str | int | dict[str, str | int | list[int]]" is not a subtype of "RecursiveMapping" +        Type "str | int | dict[str, str | int | list[int]]" is not assignable to type "RecursiveMapping" +          Type "dict[str, str | int | list[int]]" is not assignable to type "RecursiveMapping" (reportAssignmentType) +aliases_recursive.py:63:38 - error: Type "list[str | list[float]]" is not assignable to declared type "GenericTypeAlias1[str]" +  Type "float" is not assignable to type "GenericTypeAlias1[T1@GenericTypeAlias1] | str" +    "float" is not assignable to "list[GenericTypeAlias1 | str]" +    "float" is not assignable to "str" (reportAssignmentType) +aliases_recursive.py:69:51 - error: Type "list[list[int | list[str | int | list[float]]] | str]" is not assignable to declared type "GenericTypeAlias2[str, int]" +  Type "float" is not assignable to type "GenericTypeAlias2[T1@GenericTypeAlias2, T2@GenericTypeAlias2] | str | int" +    "float" is not assignable to "list[GenericTypeAlias2 | str | int]" +    "float" is not assignable to "str" +    "float" is not assignable to "int" (reportAssignmentType) aliases_recursive.py:72:29 - error: Type alias "RecursiveUnion" cannot use itself in its definition (reportGeneralTypeIssues) aliases_recursive.py:75:31 - error: Type alias "MutualReference1" cannot use itself in its definition (reportGeneralTypeIssues) """ diff --git a/conformance/results/pyright/aliases_type_statement.toml b/conformance/results/pyright/aliases_type_statement.toml index c134a70ef..ee9f8f7c3 100644 --- a/conformance/results/pyright/aliases_type_statement.toml +++ b/conformance/results/pyright/aliases_type_statement.toml @@ -8,44 +8,44 @@ aliases_type_statement.py:23:18 - error: Cannot access attribute "other_attrib"   Attribute "other_attrib" is unknown (reportAttributeAccessIssue) aliases_type_statement.py:26:18 - error: A type alias defined in a "type" statement cannot be used as a base class (reportGeneralTypeIssues) aliases_type_statement.py:31:22 - error: Argument of type "TypeAliasType" cannot be assigned to parameter "class_or_tuple" of type "_ClassInfo" in function "isinstance" -  Type "TypeAliasType" is incompatible with type "_ClassInfo" -    "TypeAliasType" is incompatible with "type" -    "TypeAliasType" is incompatible with "UnionType" -    "TypeAliasType" is incompatible with "tuple[_ClassInfo, ...]" (reportArgumentType) +  Type "TypeAliasType" is not assignable to type "_ClassInfo" +    "TypeAliasType" is not assignable to "type" +    "TypeAliasType" is not assignable to "UnionType" +    "TypeAliasType" is not assignable to "tuple[_ClassInfo, ...]" (reportArgumentType) aliases_type_statement.py:37:22 - error: Call expression not allowed in type expression (reportInvalidTypeForm) -aliases_type_statement.py:38:22 - error: List expression not allowed in type annotation +aliases_type_statement.py:38:22 - error: List expression not allowed in type expression   Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) aliases_type_statement.py:38:22 - error: Expected class but received "list[Unknown]" (reportGeneralTypeIssues) -aliases_type_statement.py:39:22 - error: Tuple expression not allowed in type annotation +aliases_type_statement.py:39:22 - error: Tuple expression not allowed in type expression   Use tuple[T1, ..., Tn] to indicate a tuple type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) -aliases_type_statement.py:40:22 - error: List expression not allowed in type annotation +aliases_type_statement.py:40:22 - error: List expression not allowed in type expression   Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) aliases_type_statement.py:40:22 - error: Expected class but received "list[type[int]]" (reportGeneralTypeIssues) -aliases_type_statement.py:41:22 - error: Dictionary expression not allowed in type annotation +aliases_type_statement.py:41:22 - error: Dictionary expression not allowed in type expression   Use Dict[T1, T2] to indicate a dictionary type (reportInvalidTypeForm) aliases_type_statement.py:41:22 - error: Expected class but received "dict[str, Unknown]" (reportGeneralTypeIssues) aliases_type_statement.py:41:29 - error: "b" is not defined (reportUndefinedVariable) aliases_type_statement.py:42:22 - error: Call expression not allowed in type expression (reportInvalidTypeForm) -aliases_type_statement.py:43:22 - error: List expression not allowed in type annotation +aliases_type_statement.py:43:22 - error: List expression not allowed in type expression   Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) aliases_type_statement.py:43:22 - error: Expected class but received "list[type[int]]" (reportGeneralTypeIssues) aliases_type_statement.py:43:28 - error: Expected class but received "Literal[0]" (reportGeneralTypeIssues) -aliases_type_statement.py:44:22 - error: Ternary expression not allowed in type annotation (reportInvalidTypeForm) +aliases_type_statement.py:44:22 - error: Ternary expression not allowed in type expression (reportInvalidTypeForm) aliases_type_statement.py:45:22 - error: Variable not allowed in type expression (reportInvalidTypeForm) aliases_type_statement.py:46:23 - error: Expected class but received "Literal[True]" (reportGeneralTypeIssues) aliases_type_statement.py:47:23 - error: Expected class but received "Literal[1]" (reportGeneralTypeIssues) -aliases_type_statement.py:48:23 - error: Binary operator not allowed in type annotation (reportInvalidTypeForm) -aliases_type_statement.py:49:23 - error: Type annotations cannot use format string literals (f-strings) (reportGeneralTypeIssues) +aliases_type_statement.py:48:23 - error: Binary operator not allowed in type expression (reportInvalidTypeForm) +aliases_type_statement.py:49:23 - error: Type expressions cannot use format string literals (f-strings) (reportGeneralTypeIssues) aliases_type_statement.py:52:10 - error: Type alias declaration "BadTypeAlias14" is obscured by a declaration of the same name (reportRedeclaration) aliases_type_statement.py:58:10 - error: A type statement can be used only within a module or class scope (reportGeneralTypeIssues) aliases_type_statement.py:64:23 - error: Type parameter "V" is not included in the type parameter list for "TA1" (reportGeneralTypeIssues) aliases_type_statement.py:69:17 - error: Type parameter "T1" is not included in the type parameter list for "TA2" (reportGeneralTypeIssues) aliases_type_statement.py:79:7 - error: Could not specialize type "RecursiveTypeAlias2[S@RecursiveTypeAlias2, T@RecursiveTypeAlias2, P@RecursiveTypeAlias2]" -  Type "str" is incompatible with type "int" -    "str" is incompatible with "int" (reportInvalidTypeForm) +  Type "str" is not assignable to type "int" +    "str" is not assignable to "int" (reportInvalidTypeForm) aliases_type_statement.py:81:7 - error: Could not specialize type "RecursiveTypeAlias2[S@RecursiveTypeAlias2, T@RecursiveTypeAlias2, P@RecursiveTypeAlias2]" -  Type "int" is incompatible with type "str" -    "int" is incompatible with "str" (reportInvalidTypeForm) +  Type "int" is not assignable to type "str" +    "int" is not assignable to "str" (reportInvalidTypeForm) aliases_type_statement.py:84:28 - error: Type alias "RecursiveTypeAlias3" cannot use itself in its definition (reportGeneralTypeIssues) aliases_type_statement.py:86:31 - error: Type alias "RecursiveTypeAlias4" cannot use itself in its definition (reportGeneralTypeIssues) aliases_type_statement.py:90:28 - error: Type alias "RecursiveTypeAlias6" cannot use itself in its definition (reportGeneralTypeIssues) diff --git a/conformance/results/pyright/aliases_typealiastype.toml b/conformance/results/pyright/aliases_typealiastype.toml index dc1e9900f..64ebf8cfe 100644 --- a/conformance/results/pyright/aliases_typealiastype.toml +++ b/conformance/results/pyright/aliases_typealiastype.toml @@ -3,8 +3,8 @@ output = """ aliases_typealiastype.py:32:18 - error: Cannot access attribute "other_attrib" for class "TypeAliasType"   Attribute "other_attrib" is unknown (reportAttributeAccessIssue) aliases_typealiastype.py:40:5 - error: Could not specialize type "GoodAlias5[S@GoodAlias5, TStr@GoodAlias5, P@GoodAlias5, Ts@GoodAlias5]" -  Type "int" is incompatible with type "str" -    "int" is incompatible with "str" (reportInvalidTypeForm) +  Type "int" is not assignable to type "str" +    "int" is not assignable to "str" (reportInvalidTypeForm) aliases_typealiastype.py:43:45 - error: Type variable "S" has no meaning in this context (reportGeneralTypeIssues) aliases_typealiastype.py:44:45 - error: Type variable "S" has no meaning in this context (reportGeneralTypeIssues) aliases_typealiastype.py:45:57 - error: Type parameter list must be a tuple containing only TypeVar, TypeVarTuple, or ParamSpec (reportGeneralTypeIssues) @@ -18,16 +18,16 @@ aliases_typealiastype.py:55:42 - error: Expected class but received "list[type[i aliases_typealiastype.py:56:42 - error: Expected class but received "dict[str, Unknown]" (reportGeneralTypeIssues) aliases_typealiastype.py:56:49 - error: "b" is not defined (reportUndefinedVariable) aliases_typealiastype.py:57:42 - error: Call expression not allowed in type expression (reportInvalidTypeForm) -aliases_typealiastype.py:58:42 - error: List expression not allowed in type annotation +aliases_typealiastype.py:58:42 - error: List expression not allowed in type expression   Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) aliases_typealiastype.py:58:42 - error: Expected class but received "list[type[int]]" (reportGeneralTypeIssues) aliases_typealiastype.py:58:48 - error: Expected class but received "Literal[0]" (reportGeneralTypeIssues) -aliases_typealiastype.py:59:42 - error: Ternary expression not allowed in type annotation (reportInvalidTypeForm) +aliases_typealiastype.py:59:42 - error: Ternary expression not allowed in type expression (reportInvalidTypeForm) aliases_typealiastype.py:60:42 - error: Variable not allowed in type expression (reportInvalidTypeForm) aliases_typealiastype.py:61:42 - error: Expected class but received "Literal[True]" (reportGeneralTypeIssues) aliases_typealiastype.py:62:42 - error: Expected class but received "Literal[1]" (reportGeneralTypeIssues) -aliases_typealiastype.py:63:42 - error: Binary operator not allowed in type annotation (reportInvalidTypeForm) -aliases_typealiastype.py:64:42 - error: Type annotations cannot use format string literals (f-strings) (reportGeneralTypeIssues) +aliases_typealiastype.py:63:42 - error: Binary operator not allowed in type expression (reportInvalidTypeForm) +aliases_typealiastype.py:64:42 - error: Type expressions cannot use format string literals (f-strings) (reportGeneralTypeIssues) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/annotations_forward_refs.toml b/conformance/results/pyright/annotations_forward_refs.toml index ae62e5d05..297096740 100644 --- a/conformance/results/pyright/annotations_forward_refs.toml +++ b/conformance/results/pyright/annotations_forward_refs.toml @@ -4,30 +4,30 @@ annotations_forward_refs.py:22:7 - error: "ClassA" is not defined (reportUndefin annotations_forward_refs.py:23:12 - error: "ClassA" is not defined (reportUndefinedVariable) annotations_forward_refs.py:24:7 - error: Union syntax cannot be used with string operand; use quotes around entire expression (reportGeneralTypeIssues) annotations_forward_refs.py:25:13 - error: Union syntax cannot be used with string operand; use quotes around entire expression (reportGeneralTypeIssues) -annotations_forward_refs.py:41:9 - error: Expected type but received a string literal (reportGeneralTypeIssues) -annotations_forward_refs.py:42:10 - error: List expression not allowed in type annotation +annotations_forward_refs.py:41:10 - error: Call expression not allowed in type expression (reportInvalidTypeForm) +annotations_forward_refs.py:42:10 - error: List expression not allowed in type expression   Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) annotations_forward_refs.py:42:10 - error: Expected class but received "list[Unknown]" (reportGeneralTypeIssues) -annotations_forward_refs.py:43:10 - error: Tuple expression not allowed in type annotation +annotations_forward_refs.py:43:10 - error: Tuple expression not allowed in type expression   Use tuple[T1, ..., Tn] to indicate a tuple type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) -annotations_forward_refs.py:44:10 - error: List expression not allowed in type annotation +annotations_forward_refs.py:44:10 - error: List expression not allowed in type expression   Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) annotations_forward_refs.py:44:10 - error: Expected class but received "list[type[int]]" (reportGeneralTypeIssues) -annotations_forward_refs.py:45:10 - error: Dictionary expression not allowed in type annotation +annotations_forward_refs.py:45:10 - error: Dictionary expression not allowed in type expression   Use Dict[T1, T2] to indicate a dictionary type (reportInvalidTypeForm) annotations_forward_refs.py:45:10 - error: Expected class but received "dict[Unknown, Unknown]" (reportGeneralTypeIssues) annotations_forward_refs.py:46:10 - error: Call expression not allowed in type expression (reportInvalidTypeForm) -annotations_forward_refs.py:47:10 - error: List expression not allowed in type annotation +annotations_forward_refs.py:47:10 - error: List expression not allowed in type expression   Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) annotations_forward_refs.py:47:10 - error: Expected class but received "list[type[int]]" (reportGeneralTypeIssues) annotations_forward_refs.py:47:16 - error: Expected class but received "Literal[0]" (reportGeneralTypeIssues) -annotations_forward_refs.py:48:10 - error: Ternary expression not allowed in type annotation (reportInvalidTypeForm) +annotations_forward_refs.py:48:10 - error: Ternary expression not allowed in type expression (reportInvalidTypeForm) annotations_forward_refs.py:49:10 - error: Variable not allowed in type expression (reportInvalidTypeForm) annotations_forward_refs.py:50:11 - error: Expected class but received "Literal[True]" (reportGeneralTypeIssues) annotations_forward_refs.py:51:11 - error: Expected class but received "Literal[1]" (reportGeneralTypeIssues) -annotations_forward_refs.py:52:11 - error: Unary operator not allowed in type annotation (reportInvalidTypeForm) -annotations_forward_refs.py:53:11 - error: Binary operator not allowed in type annotation (reportInvalidTypeForm) -annotations_forward_refs.py:54:11 - error: Type annotations cannot use format string literals (f-strings) (reportGeneralTypeIssues) +annotations_forward_refs.py:52:11 - error: Unary operator not allowed in type expression (reportInvalidTypeForm) +annotations_forward_refs.py:53:11 - error: Binary operator not allowed in type expression (reportInvalidTypeForm) +annotations_forward_refs.py:54:11 - error: Type expressions cannot use format string literals (f-strings) (reportGeneralTypeIssues) annotations_forward_refs.py:55:10 - error: Module cannot be used as a type (reportGeneralTypeIssues) annotations_forward_refs.py:66:26 - error: "ClassB" is not defined (reportUndefinedVariable) annotations_forward_refs.py:80:14 - error: Type of "ClassF" could not be determined because it refers to itself (reportGeneralTypeIssues) diff --git a/conformance/results/pyright/annotations_generators.toml b/conformance/results/pyright/annotations_generators.toml index 23081ff4f..fd4b61db3 100644 --- a/conformance/results/pyright/annotations_generators.toml +++ b/conformance/results/pyright/annotations_generators.toml @@ -1,35 +1,35 @@ conformant = "Pass" output = """ annotations_generators.py:51:21 - error: Function with declared return type "C" must return value on all code paths -  "None" is incompatible with "C" (reportReturnType) -annotations_generators.py:54:16 - error: Expression of type "Literal[False]" is incompatible with return type "C" -  "Literal[False]" is incompatible with "C" (reportReturnType) +  "None" is not assignable to "C" (reportReturnType) +annotations_generators.py:54:16 - error: Type "Literal[False]" is not assignable to return type "C" +  "Literal[False]" is not assignable to "C" (reportReturnType) annotations_generators.py:57:15 - error: Return type of generator function must be compatible with "Generator[Literal[3], Any, Any]" -  "Literal[3]" is incompatible with "A" (reportReturnType) +  "Literal[3]" is not assignable to "A" (reportReturnType) annotations_generators.py:66:15 - error: Return type of generator function must be compatible with "Generator[Literal[3], Any, Any]" -  "Literal[3]" is incompatible with "A" (reportReturnType) +  "Literal[3]" is not assignable to "A" (reportReturnType) annotations_generators.py:75:11 - error: Return type of generator function must be compatible with "Generator[B, Any, Any]" -  "B" is incompatible with "A" (reportReturnType) +  "B" is not assignable to "A" (reportReturnType) annotations_generators.py:86:21 - error: Return type of generator function must be compatible with "Generator[Any, Any, Any]" -  "Generator[Any, Any, Any]" is incompatible with "int" (reportInvalidTypeForm) +  "Generator[Any, Any, Any]" is not assignable to "int" (reportInvalidTypeForm) annotations_generators.py:87:11 - error: Return type of generator function must be compatible with "Generator[None, Any, Any]" -  "Generator[None, Unknown, Unknown]" is incompatible with "int" (reportReturnType) +  "Generator[None, Unknown, Unknown]" is not assignable to "int" (reportReturnType) annotations_generators.py:91:27 - error: Return type of async generator function must be compatible with "AsyncGenerator[Any, Any]" -  "AsyncGenerator[Any, Any, Any]" is incompatible with "int" (reportInvalidTypeForm) +  "AsyncGenerator[Any, Any, Any]" is not assignable to "int" (reportInvalidTypeForm) annotations_generators.py:92:11 - error: Return type of async generator function must be compatible with "AsyncGenerator[None, Any]" -  "AsyncGenerator[None, Unknown, Unknown]" is incompatible with "int" (reportReturnType) +  "AsyncGenerator[None, Unknown, Unknown]" is not assignable to "int" (reportReturnType) annotations_generators.py:118:16 - error: Return type of generator function must be compatible with "Generator[A, Any, Any]" -  "Generator[A, Unknown, Unknown]" is incompatible with "Iterator[B]" +  "Generator[A, Unknown, Unknown]" is not assignable to "Iterator[B]"     Type parameter "_T_co@Iterator" is covariant, but "A" is not a subtype of "B" -      "A" is incompatible with "B" (reportReturnType) +      "A" is not assignable to "B" (reportReturnType) annotations_generators.py:119:16 - error: Return type of generator function must be compatible with "Generator[int, Any, Any]" -  "Generator[int, Unknown, Unknown]" is incompatible with "Iterator[B]" +  "Generator[int, Unknown, Unknown]" is not assignable to "Iterator[B]"     Type parameter "_T_co@Iterator" is covariant, but "int" is not a subtype of "B" -      "int" is incompatible with "B" (reportReturnType) +      "int" is not assignable to "B" (reportReturnType) annotations_generators.py:135:16 - error: Return type of generator function must be compatible with "Generator[None, Any, Any]" -  "Generator[None, int, Unknown]" is incompatible with "Generator[None, str, None]" +  "Generator[None, int, Unknown]" is not assignable to "Generator[None, str, None]"     Type parameter "_SendT_contra@Generator" is contravariant, but "int" is not a supertype of "str" -      "str" is incompatible with "int" (reportReturnType) +      "str" is not assignable to "int" (reportReturnType) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/annotations_methods.toml b/conformance/results/pyright/annotations_methods.toml index 120e85cae..27ff70b96 100644 --- a/conformance/results/pyright/annotations_methods.toml +++ b/conformance/results/pyright/annotations_methods.toml @@ -4,7 +4,7 @@ Type evaluation differs from other type checkers because of ambiguity in the spe """ output = """ annotations_methods.py:46:8 - error: Argument of type "A" cannot be assigned to parameter "self" of type "B" in function "copy" -  "A" is incompatible with "B" (reportArgumentType) +  "A" is not assignable to "B" (reportArgumentType) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/annotations_typeexpr.toml b/conformance/results/pyright/annotations_typeexpr.toml index 9eed10f39..5504e9464 100644 --- a/conformance/results/pyright/annotations_typeexpr.toml +++ b/conformance/results/pyright/annotations_typeexpr.toml @@ -1,29 +1,29 @@ conformant = "Pass" output = """ annotations_typeexpr.py:88:9 - error: Call expression not allowed in type expression (reportInvalidTypeForm) -annotations_typeexpr.py:89:9 - error: List expression not allowed in type annotation +annotations_typeexpr.py:89:9 - error: List expression not allowed in type expression   Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) annotations_typeexpr.py:89:9 - error: Expected class but received "list[Unknown]" (reportGeneralTypeIssues) -annotations_typeexpr.py:90:9 - error: Tuple expression not allowed in type annotation +annotations_typeexpr.py:90:9 - error: Tuple expression not allowed in type expression   Use tuple[T1, ..., Tn] to indicate a tuple type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) -annotations_typeexpr.py:91:9 - error: List expression not allowed in type annotation +annotations_typeexpr.py:91:9 - error: List expression not allowed in type expression   Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) annotations_typeexpr.py:91:9 - error: Expected class but received "list[type[int]]" (reportGeneralTypeIssues) -annotations_typeexpr.py:92:9 - error: Dictionary expression not allowed in type annotation +annotations_typeexpr.py:92:9 - error: Dictionary expression not allowed in type expression   Use Dict[T1, T2] to indicate a dictionary type (reportInvalidTypeForm) annotations_typeexpr.py:92:9 - error: Expected class but received "dict[Unknown, Unknown]" (reportGeneralTypeIssues) annotations_typeexpr.py:93:9 - error: Call expression not allowed in type expression (reportInvalidTypeForm) -annotations_typeexpr.py:94:9 - error: List expression not allowed in type annotation +annotations_typeexpr.py:94:9 - error: List expression not allowed in type expression   Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) annotations_typeexpr.py:94:9 - error: Expected class but received "list[type[int]]" (reportGeneralTypeIssues) annotations_typeexpr.py:94:15 - error: Expected class but received "Literal[0]" (reportGeneralTypeIssues) -annotations_typeexpr.py:95:9 - error: Ternary expression not allowed in type annotation (reportInvalidTypeForm) +annotations_typeexpr.py:95:9 - error: Ternary expression not allowed in type expression (reportInvalidTypeForm) annotations_typeexpr.py:96:9 - error: Variable not allowed in type expression (reportInvalidTypeForm) annotations_typeexpr.py:97:10 - error: Expected class but received "Literal[True]" (reportGeneralTypeIssues) annotations_typeexpr.py:98:10 - error: Expected class but received "Literal[1]" (reportGeneralTypeIssues) -annotations_typeexpr.py:99:10 - error: Unary operator not allowed in type annotation (reportInvalidTypeForm) -annotations_typeexpr.py:100:10 - error: Binary operator not allowed in type annotation (reportInvalidTypeForm) -annotations_typeexpr.py:101:10 - error: Type annotations cannot use format string literals (f-strings) (reportGeneralTypeIssues) +annotations_typeexpr.py:99:10 - error: Unary operator not allowed in type expression (reportInvalidTypeForm) +annotations_typeexpr.py:100:10 - error: Binary operator not allowed in type expression (reportInvalidTypeForm) +annotations_typeexpr.py:101:10 - error: Type expressions cannot use format string literals (f-strings) (reportGeneralTypeIssues) annotations_typeexpr.py:102:10 - error: Module cannot be used as a type (reportGeneralTypeIssues) """ conformance_automated = "Pass" diff --git a/conformance/results/pyright/callables_annotation.toml b/conformance/results/pyright/callables_annotation.toml index 8da8432a5..66fdcb54e 100644 --- a/conformance/results/pyright/callables_annotation.toml +++ b/conformance/results/pyright/callables_annotation.toml @@ -2,7 +2,7 @@ conformant = "Pass" output = """ callables_annotation.py:25:5 - error: Expected 1 more positional argument (reportCallIssue) callables_annotation.py:26:11 - error: Argument of type "Literal[2]" cannot be assigned to parameter of type "str" -  "Literal[2]" is incompatible with "str" (reportArgumentType) +  "Literal[2]" is not assignable to "str" (reportArgumentType) callables_annotation.py:27:15 - error: Expected 2 positional arguments (reportCallIssue) callables_annotation.py:29:10 - error: Expected 2 more positional arguments (reportCallIssue) callables_annotation.py:35:8 - error: Expected 0 positional arguments (reportCallIssue) @@ -12,29 +12,29 @@ callables_annotation.py:57:18 - error: List expression not allowed for this type callables_annotation.py:58:14 - error: Expected parameter type list or "..." (reportInvalidTypeForm) callables_annotation.py:58:24 - error: Expected only two type arguments to "Callable" (reportInvalidTypeForm) callables_annotation.py:59:15 - error: "..." is not allowed in this context (reportInvalidTypeForm) -callables_annotation.py:91:7 - error: Expression of type "() -> str" is incompatible with declared type "(int, ...) -> str" -  Type "() -> str" is incompatible with type "(int, ...) -> str" +callables_annotation.py:91:7 - error: Type "() -> str" is not assignable to declared type "(int, ...) -> str" +  Type "() -> str" is not assignable to type "(int, ...) -> str"     Function accepts too many positional parameters; expected 0 but received 2 (reportAssignmentType) -callables_annotation.py:93:7 - error: Expression of type "(*, a: int) -> str" is incompatible with declared type "(int, ...) -> str" -  Type "(*, a: int) -> str" is incompatible with type "(int, ...) -> str" +callables_annotation.py:93:7 - error: Type "(*, a: int) -> str" is not assignable to declared type "(int, ...) -> str" +  Type "(*, a: int) -> str" is not assignable to type "(int, ...) -> str"     Function accepts too many positional parameters; expected 0 but received 2 (reportAssignmentType) -callables_annotation.py:159:25 - error: Expression of type "Proto8" is incompatible with declared type "Proto5[Any]" +callables_annotation.py:159:25 - error: Type "Proto8" is not assignable to declared type "Proto5[Any]"   "Proto8" is incompatible with protocol "Proto5[Any]"     "__call__" is an incompatible type -      Type "() -> None" is incompatible with type "(*args: T_contra@Proto5, **kwargs: T_contra@Proto5) -> None" +      Type "() -> None" is not assignable to type "(*args: T_contra@Proto5, **kwargs: T_contra@Proto5) -> None"         Parameter "*args" has no corresponding parameter         Parameter "**kwargs" has no corresponding parameter (reportAssignmentType) -callables_annotation.py:172:26 - error: Expression of type "() -> str" is incompatible with declared type "Callback2[...]" -  Type "() -> str" is incompatible with type "Callback2[...]" +callables_annotation.py:172:26 - error: Type "() -> str" is not assignable to declared type "Callback2[...]" +  Type "() -> str" is not assignable to type "Callback2[...]"     Function accepts too many positional parameters; expected 0 but received 2 (reportAssignmentType) -callables_annotation.py:187:48 - error: Expression of type "(int, str) -> str" is incompatible with declared type "(str, ...) -> str" -  Type "(int, str) -> str" is incompatible with type "(str, ...) -> str" +callables_annotation.py:187:48 - error: Type "(int, str) -> str" is not assignable to declared type "(str, ...) -> str" +  Type "(int, str) -> str" is not assignable to type "(str, ...) -> str"     Parameter 1: type "str" is incompatible with type "int" -      "str" is incompatible with "int" (reportAssignmentType) -callables_annotation.py:189:32 - error: Expression of type "(int, str) -> str" is incompatible with declared type "CallbackWithStr[...]" -  Type "(int, str) -> str" is incompatible with type "CallbackWithStr[...]" +      "str" is not assignable to "int" (reportAssignmentType) +callables_annotation.py:189:32 - error: Type "(int, str) -> str" is not assignable to declared type "CallbackWithStr[...]" +  Type "(int, str) -> str" is not assignable to type "CallbackWithStr[...]"     Parameter 1: type "str" is incompatible with type "int" -      "str" is incompatible with "int" (reportAssignmentType) +      "str" is not assignable to "int" (reportAssignmentType) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/callables_kwargs.toml b/conformance/results/pyright/callables_kwargs.toml index 51ad276db..b3e1e6c04 100644 --- a/conformance/results/pyright/callables_kwargs.toml +++ b/conformance/results/pyright/callables_kwargs.toml @@ -1,33 +1,38 @@ -conformant = "Pass" +conformant = "Partial" +notes = """ +Incorrectly handles assert_type for unpacked TypedDict. +""" output = """ callables_kwargs.py:28:5 - error: Could not access item in TypedDict   "v2" is not a required key in "*TD2", so access may result in runtime exception (reportTypedDictNotRequiredAccess) +callables_kwargs.py:41:17 - error: "assert_type" mismatch: expected "TD1" but received "*TD1" (reportAssertTypeFailure) callables_kwargs.py:46:5 - error: Arguments missing for parameters "v1", "v3" (reportCallIssue) callables_kwargs.py:51:32 - error: No parameter named "v4" (reportCallIssue) callables_kwargs.py:52:11 - error: Expected 0 positional arguments (reportCallIssue) callables_kwargs.py:58:13 - error: Argument of type "str" cannot be assigned to parameter "v1" of type "int" in function "func1" -  "str" is incompatible with "int" (reportArgumentType) +  "str" is not assignable to "int" (reportArgumentType) callables_kwargs.py:63:19 - error: Unable to match unpacked TypedDict argument to parameters   Parameter "v1" is already assigned (reportCallIssue) callables_kwargs.py:64:16 - error: Unable to match unpacked TypedDict argument to parameters   Parameter "v3" is already assigned (reportCallIssue) callables_kwargs.py:65:19 - error: Unable to match unpacked TypedDict argument to parameters   Parameter "v1" is already assigned (reportCallIssue) -callables_kwargs.py:101:19 - error: Expression of type "(**kwargs: **TD2) -> None" is incompatible with declared type "TDProtocol3" -  Type "(**kwargs: **TD2) -> None" is incompatible with type "(*, v1: int, v2: int, v3: str) -> None" +callables_kwargs.py:101:19 - error: Type "(**kwargs: **TD2) -> None" is not assignable to declared type "TDProtocol3" +  Type "(**kwargs: **TD2) -> None" is not assignable to type "(*, v1: int, v2: int, v3: str) -> None"     Keyword parameter "v2" of type "int" is incompatible with type "str" -      "int" is incompatible with "str" (reportAssignmentType) -callables_kwargs.py:102:19 - error: Expression of type "(**kwargs: **TD2) -> None" is incompatible with declared type "TDProtocol4" -  Type "(**kwargs: **TD2) -> None" is incompatible with type "(*, v1: int) -> None" +      "int" is not assignable to "str" (reportAssignmentType) +callables_kwargs.py:102:19 - error: Type "(**kwargs: **TD2) -> None" is not assignable to declared type "TDProtocol4" +  Type "(**kwargs: **TD2) -> None" is not assignable to type "(*, v1: int) -> None"     Extra parameter "v3" (reportAssignmentType) -callables_kwargs.py:103:19 - error: Expression of type "(**kwargs: **TD2) -> None" is incompatible with declared type "TDProtocol5" -  Type "(**kwargs: **TD2) -> None" is incompatible with type "(v1: int, v3: str) -> None" +callables_kwargs.py:103:19 - error: Type "(**kwargs: **TD2) -> None" is not assignable to declared type "TDProtocol5" +  Type "(**kwargs: **TD2) -> None" is not assignable to type "(v1: int, v3: str) -> None"     Function accepts too many positional parameters; expected 0 but received 2       Extra parameter "v1"       Extra parameter "v3" (reportAssignmentType) callables_kwargs.py:111:30 - error: Typed dictionary overlaps with keyword parameter: v1 (reportGeneralTypeIssues) callables_kwargs.py:122:21 - error: Expected TypedDict type argument for Unpack (reportGeneralTypeIssues) """ -conformance_automated = "Pass" +conformance_automated = "Fail" errors_diff = """ +Line 41: Unexpected errors ['callables_kwargs.py:41:17 - error: "assert_type" mismatch: expected "TD1" but received "*TD1" (reportAssertTypeFailure)'] """ diff --git a/conformance/results/pyright/callables_protocol.toml b/conformance/results/pyright/callables_protocol.toml index df57b9b31..47af00471 100644 --- a/conformance/results/pyright/callables_protocol.toml +++ b/conformance/results/pyright/callables_protocol.toml @@ -1,62 +1,66 @@ conformant = "Pass" output = """ -callables_protocol.py:35:7 - error: Expression of type "(*vals: bytes, max_items: int | None) -> list[bytes]" is incompatible with declared type "Proto1" -  Type "(*vals: bytes, max_items: int | None) -> list[bytes]" is incompatible with type "(*vals: bytes, max_len: int | None = None) -> list[bytes]" +callables_protocol.py:35:7 - error: Type "(*vals: bytes, max_items: int | None) -> list[bytes]" is not assignable to declared type "Proto1" +  Type "(*vals: bytes, max_items: int | None) -> list[bytes]" is not assignable to type "(*vals: bytes, max_len: int | None = None) -> list[bytes]"     Extra parameter "max_items"     Missing keyword parameter "max_len" (reportAssignmentType) -callables_protocol.py:36:7 - error: Expression of type "(*vals: bytes) -> list[bytes]" is incompatible with declared type "Proto1" -  Type "(*vals: bytes) -> list[bytes]" is incompatible with type "(*vals: bytes, max_len: int | None = None) -> list[bytes]" +callables_protocol.py:36:7 - error: Type "(*vals: bytes) -> list[bytes]" is not assignable to declared type "Proto1" +  Type "(*vals: bytes) -> list[bytes]" is not assignable to type "(*vals: bytes, max_len: int | None = None) -> list[bytes]"     Missing keyword parameter "max_len" (reportAssignmentType) -callables_protocol.py:37:7 - error: Expression of type "(*vals: bytes, max_len: str | None) -> list[bytes]" is incompatible with declared type "Proto1" -  Type "(*vals: bytes, max_len: str | None) -> list[bytes]" is incompatible with type "(*vals: bytes, max_len: int | None = None) -> list[bytes]" +callables_protocol.py:37:7 - error: Type "(*vals: bytes, max_len: str | None) -> list[bytes]" is not assignable to declared type "Proto1" +  Type "(*vals: bytes, max_len: str | None) -> list[bytes]" is not assignable to type "(*vals: bytes, max_len: int | None = None) -> list[bytes]"     Keyword parameter "max_len" of type "int | None" is incompatible with type "str | None" +      Type "int | None" is not assignable to type "str | None" +        Type "int" is not assignable to type "str | None" +          "int" is not assignable to "str" +          "int" is not assignable to "None"     Parameter "max_len" is missing default argument (reportAssignmentType) -callables_protocol.py:67:7 - error: Expression of type "(*a: bytes) -> None" is incompatible with declared type "Proto2" -  Type "(*a: bytes) -> None" is incompatible with type "(*vals: bytes, **kwargs: str) -> None" +callables_protocol.py:67:7 - error: Type "(*a: bytes) -> None" is not assignable to declared type "Proto2" +  Type "(*a: bytes) -> None" is not assignable to type "(*vals: bytes, **kwargs: str) -> None"     Parameter "**kwargs" has no corresponding parameter (reportAssignmentType) -callables_protocol.py:68:7 - error: Expression of type "(*a: str, **b: str) -> None" is incompatible with declared type "Proto2" -  Type "(*a: str, **b: str) -> None" is incompatible with type "(*vals: bytes, **kwargs: str) -> None" +callables_protocol.py:68:7 - error: Type "(*a: str, **b: str) -> None" is not assignable to declared type "Proto2" +  Type "(*a: str, **b: str) -> None" is not assignable to type "(*vals: bytes, **kwargs: str) -> None"     Parameter 1: type "*tuple[bytes, ...]" is incompatible with type "*tuple[str, ...]" -      "*tuple[bytes, ...]" is incompatible with "*tuple[str, ...]" +      "*tuple[bytes, ...]" is not assignable to "*tuple[str, ...]"         Tuple entry 1 is incorrect type -          "bytes" is incompatible with "str" (reportAssignmentType) -callables_protocol.py:69:7 - error: Expression of type "(*a: bytes, **b: bytes) -> None" is incompatible with declared type "Proto2" -  Type "(*a: bytes, **b: bytes) -> None" is incompatible with type "(*vals: bytes, **kwargs: str) -> None" +          "bytes" is not assignable to "str" (reportAssignmentType) +callables_protocol.py:69:7 - error: Type "(*a: bytes, **b: bytes) -> None" is not assignable to declared type "Proto2" +  Type "(*a: bytes, **b: bytes) -> None" is not assignable to type "(*vals: bytes, **kwargs: str) -> None"     Parameter 2: type "str" is incompatible with type "bytes" -      "str" is incompatible with "bytes" (reportAssignmentType) -callables_protocol.py:70:7 - error: Expression of type "(**b: str) -> None" is incompatible with declared type "Proto2" -  Type "(**b: str) -> None" is incompatible with type "(*vals: bytes, **kwargs: str) -> None" +      "str" is not assignable to "bytes" (reportAssignmentType) +callables_protocol.py:70:7 - error: Type "(**b: str) -> None" is not assignable to declared type "Proto2" +  Type "(**b: str) -> None" is not assignable to type "(*vals: bytes, **kwargs: str) -> None"     Parameter "*vals" has no corresponding parameter (reportAssignmentType) -callables_protocol.py:97:16 - error: Expression of type "(x: int) -> None" is incompatible with declared type "Proto4" +callables_protocol.py:97:16 - error: Type "(x: int) -> None" is not assignable to declared type "Proto4"   "function" is incompatible with protocol "Proto4"     "other_attribute" is not present     "__call__" is not present (reportAssignmentType) -callables_protocol.py:121:18 - error: Expression of type "(*vals: bytes, max_len: int | None = None) -> list[bytes]" is incompatible with declared type "NotProto6" -  "function" is incompatible with "NotProto6" (reportAssignmentType) -callables_protocol.py:169:7 - error: Expression of type "(x: int) -> Any" is incompatible with declared type "Proto8" +callables_protocol.py:121:18 - error: Type "(*vals: bytes, max_len: int | None = None) -> list[bytes]" is not assignable to declared type "NotProto6" +  "function" is not assignable to "NotProto6" (reportAssignmentType) +callables_protocol.py:169:7 - error: Type "(x: int) -> Any" is not assignable to declared type "Proto8"   One or more overloads of "__call__" is not assignable -    Type "(x: int) -> Any" is incompatible with type "(x: str) -> str" +    Type "(x: int) -> Any" is not assignable to type "(x: str) -> str"       Parameter 1: type "str" is incompatible with type "int" -        "str" is incompatible with "int" (reportAssignmentType) +        "str" is not assignable to "int" (reportAssignmentType) callables_protocol.py:186:33 - error: Cannot assign to attribute "other_attribute" for class "Proto9[P@decorator1, R@decorator1]" -  "Literal['str']" is incompatible with "int" (reportAttributeAccessIssue) +  "Literal['str']" is not assignable to "int" (reportAttributeAccessIssue) callables_protocol.py:187:15 - error: Cannot assign to attribute "xxx" for class "Proto9[P@decorator1, R@decorator1]"   Attribute "xxx" is unknown (reportAttributeAccessIssue) callables_protocol.py:197:16 - error: Cannot access attribute "other_attribute2" for class "Proto9[(x: int), str]"   Attribute "other_attribute2" is unknown (reportAttributeAccessIssue) -callables_protocol.py:238:8 - error: Expression of type "(x: int, y: str, /) -> Any" is incompatible with declared type "Proto11" -  Type "(x: int, y: str, /) -> Any" is incompatible with type "(x: int, /, y: str) -> Any" +callables_protocol.py:238:8 - error: Type "(x: int, y: str, /) -> Any" is not assignable to declared type "Proto11" +  Type "(x: int, y: str, /) -> Any" is not assignable to type "(x: int, /, y: str) -> Any"     Missing keyword parameter "y"       Position-only parameter mismatch; parameter "y" is not position-only       Position-only parameter mismatch; expected 2 but received 1 (reportAssignmentType) -callables_protocol.py:260:8 - error: Expression of type "(*args: Any, kwarg0: Any) -> None" is incompatible with declared type "Proto12" -  Type "(*args: Any, kwarg0: Any) -> None" is incompatible with type "(*args: Any, kwarg0: Any, kwarg1: Any) -> None" +callables_protocol.py:260:8 - error: Type "(*args: Any, kwarg0: Any) -> None" is not assignable to declared type "Proto12" +  Type "(*args: Any, kwarg0: Any) -> None" is not assignable to type "(*args: Any, kwarg0: Any, kwarg1: Any) -> None"     Missing keyword parameter "kwarg1" (reportAssignmentType) -callables_protocol.py:284:27 - error: Expression of type "(path: str) -> str" is incompatible with declared type "Proto13_Default" -  Type "(path: str) -> str" is incompatible with type "(path: str = ...) -> str" +callables_protocol.py:284:27 - error: Type "(path: str) -> str" is not assignable to declared type "Proto13_Default" +  Type "(path: str) -> str" is not assignable to type "(path: str = ...) -> str"     Parameter "path" is missing default argument (reportAssignmentType) -callables_protocol.py:311:27 - error: Expression of type "(*, path: str) -> str" is incompatible with declared type "Proto14_Default" -  Type "(*, path: str) -> str" is incompatible with type "(*, path: str = ...) -> str" +callables_protocol.py:311:27 - error: Type "(*, path: str) -> str" is not assignable to declared type "Proto14_Default" +  Type "(*, path: str) -> str" is not assignable to type "(*, path: str = ...) -> str"     Parameter "path" is missing default argument (reportAssignmentType) """ conformance_automated = "Pass" diff --git a/conformance/results/pyright/callables_subtyping.toml b/conformance/results/pyright/callables_subtyping.toml index 932c0799b..134de40c9 100644 --- a/conformance/results/pyright/callables_subtyping.toml +++ b/conformance/results/pyright/callables_subtyping.toml @@ -2,199 +2,199 @@ conformant = "Pass" errors_diff = """ """ output = """ -callables_subtyping.py:26:36 - error: Expression of type "(int) -> int" is incompatible with declared type "(float) -> float" -  Type "(int) -> int" is incompatible with type "(float) -> float" +callables_subtyping.py:26:36 - error: Type "(int) -> int" is not assignable to declared type "(float) -> float" +  Type "(int) -> int" is not assignable to type "(float) -> float"     Parameter 1: type "float" is incompatible with type "int" -      "float" is incompatible with "int" (reportAssignmentType) -callables_subtyping.py:29:32 - error: Expression of type "(float) -> float" is incompatible with declared type "(int) -> int" -  Type "(float) -> float" is incompatible with type "(int) -> int" +      "float" is not assignable to "int" (reportAssignmentType) +callables_subtyping.py:29:32 - error: Type "(float) -> float" is not assignable to declared type "(int) -> int" +  Type "(float) -> float" is not assignable to type "(int) -> int"     Function return type "float" is incompatible with type "int" -      "float" is incompatible with "int" (reportAssignmentType) -callables_subtyping.py:51:21 - error: Expression of type "PosOnly2" is incompatible with declared type "Standard2" +      "float" is not assignable to "int" (reportAssignmentType) +callables_subtyping.py:51:21 - error: Type "PosOnly2" is not assignable to declared type "Standard2"   "PosOnly2" is incompatible with protocol "Standard2"     "__call__" is an incompatible type -      Type "(b: int, a: int, /) -> None" is incompatible with type "(a: int, b: int) -> None" +      Type "(b: int, a: int, /) -> None" is not assignable to type "(a: int, b: int) -> None"         Missing keyword parameter "a"         Missing keyword parameter "b"           Position-only parameter mismatch; parameter "a" is not position-only           Position-only parameter mismatch; parameter "b" is not position-only           Position-only parameter mismatch; expected 2 but received 0 (reportAssignmentType) -callables_subtyping.py:52:21 - error: Expression of type "KwOnly2" is incompatible with declared type "Standard2" +callables_subtyping.py:52:21 - error: Type "KwOnly2" is not assignable to declared type "Standard2"   "KwOnly2" is incompatible with protocol "Standard2"     "__call__" is an incompatible type -      Type "(*, b: int, a: int) -> None" is incompatible with type "(a: int, b: int) -> None" +      Type "(*, b: int, a: int) -> None" is not assignable to type "(a: int, b: int) -> None"         Function accepts too many positional parameters; expected 0 but received 2           Extra parameter "b"           Extra parameter "a" (reportAssignmentType) -callables_subtyping.py:55:20 - error: Expression of type "KwOnly2" is incompatible with declared type "PosOnly2" +callables_subtyping.py:55:20 - error: Type "KwOnly2" is not assignable to declared type "PosOnly2"   "KwOnly2" is incompatible with protocol "PosOnly2"     "__call__" is an incompatible type -      Type "(*, b: int, a: int) -> None" is incompatible with type "(b: int, a: int, /) -> None" +      Type "(*, b: int, a: int) -> None" is not assignable to type "(b: int, a: int, /) -> None"         Function accepts too many positional parameters; expected 0 but received 2           Extra parameter "b"           Extra parameter "a" (reportAssignmentType) -callables_subtyping.py:58:19 - error: Expression of type "PosOnly2" is incompatible with declared type "KwOnly2" +callables_subtyping.py:58:19 - error: Type "PosOnly2" is not assignable to declared type "KwOnly2"   "PosOnly2" is incompatible with protocol "KwOnly2"     "__call__" is an incompatible type -      Type "(b: int, a: int, /) -> None" is incompatible with type "(*, b: int, a: int) -> None" +      Type "(b: int, a: int, /) -> None" is not assignable to type "(*, b: int, a: int) -> None"         Position-only parameter mismatch; expected 2 but received 0         Function accepts too few positional parameters; expected 2 but received 0         Missing keyword parameter "b"         Missing keyword parameter "a" (reportAssignmentType) -callables_subtyping.py:82:20 - error: Expression of type "NoArgs3" is incompatible with declared type "IntArgs3" +callables_subtyping.py:82:20 - error: Type "NoArgs3" is not assignable to declared type "IntArgs3"   "NoArgs3" is incompatible with protocol "IntArgs3"     "__call__" is an incompatible type -      Type "() -> None" is incompatible with type "(*args: int) -> None" +      Type "() -> None" is not assignable to type "(*args: int) -> None"         Parameter "*args" has no corresponding parameter (reportAssignmentType) -callables_subtyping.py:85:22 - error: Expression of type "NoArgs3" is incompatible with declared type "FloatArgs3" +callables_subtyping.py:85:22 - error: Type "NoArgs3" is not assignable to declared type "FloatArgs3"   "NoArgs3" is incompatible with protocol "FloatArgs3"     "__call__" is an incompatible type -      Type "() -> None" is incompatible with type "(*args: float) -> None" +      Type "() -> None" is not assignable to type "(*args: float) -> None"         Parameter "*args" has no corresponding parameter (reportAssignmentType) -callables_subtyping.py:86:22 - error: Expression of type "IntArgs3" is incompatible with declared type "FloatArgs3" +callables_subtyping.py:86:22 - error: Type "IntArgs3" is not assignable to declared type "FloatArgs3"   "IntArgs3" is incompatible with protocol "FloatArgs3"     "__call__" is an incompatible type -      Type "(*args: int) -> None" is incompatible with type "(*args: float) -> None" +      Type "(*args: int) -> None" is not assignable to type "(*args: float) -> None"         Parameter 1: type "*tuple[float, ...]" is incompatible with type "*tuple[int, ...]" -          "*tuple[float, ...]" is incompatible with "*tuple[int, ...]" (reportAssignmentType) -callables_subtyping.py:116:20 - error: Expression of type "IntArgs4" is incompatible with declared type "PosOnly4" +          "*tuple[float, ...]" is not assignable to "*tuple[int, ...]" (reportAssignmentType) +callables_subtyping.py:116:20 - error: Type "IntArgs4" is not assignable to declared type "PosOnly4"   "IntArgs4" is incompatible with protocol "PosOnly4"     "__call__" is an incompatible type -      Type "(*args: int) -> None" is incompatible with type "(a: int, b: str, /) -> None" +      Type "(*args: int) -> None" is not assignable to type "(a: int, b: str, /) -> None"         Parameter 2: type "str" is incompatible with type "int" -          "str" is incompatible with "int" (reportAssignmentType) -callables_subtyping.py:119:23 - error: Expression of type "StrArgs4" is incompatible with declared type "IntStrArgs4" +          "str" is not assignable to "int" (reportAssignmentType) +callables_subtyping.py:119:23 - error: Type "StrArgs4" is not assignable to declared type "IntStrArgs4"   "StrArgs4" is incompatible with protocol "IntStrArgs4"     "__call__" is an incompatible type -      Type "(a: int, /, *args: str) -> None" is incompatible with type "(*args: int | str) -> None" +      Type "(a: int, /, *args: str) -> None" is not assignable to type "(*args: int | str) -> None"         Parameter 2: type "int | str" is incompatible with type "str" -          Type "int | str" is incompatible with type "str" +          Type "int | str" is not assignable to type "str"         Parameter 1: type "*tuple[int | str, ...]" is incompatible with type "*tuple[str, ...]" -          "*tuple[int | str, ...]" is incompatible with "*tuple[str, ...]" (reportAssignmentType) -callables_subtyping.py:120:23 - error: Expression of type "IntArgs4" is incompatible with declared type "IntStrArgs4" +          "*tuple[int | str, ...]" is not assignable to "*tuple[str, ...]" (reportAssignmentType) +callables_subtyping.py:120:23 - error: Type "IntArgs4" is not assignable to declared type "IntStrArgs4"   "IntArgs4" is incompatible with protocol "IntStrArgs4"     "__call__" is an incompatible type -      Type "(*args: int) -> None" is incompatible with type "(*args: int | str) -> None" +      Type "(*args: int) -> None" is not assignable to type "(*args: int | str) -> None"         Parameter 1: type "*tuple[int | str, ...]" is incompatible with type "*tuple[int, ...]" -          "*tuple[int | str, ...]" is incompatible with "*tuple[int, ...]" (reportAssignmentType) -callables_subtyping.py:122:20 - error: Expression of type "IntArgs4" is incompatible with declared type "StrArgs4" +          "*tuple[int | str, ...]" is not assignable to "*tuple[int, ...]" (reportAssignmentType) +callables_subtyping.py:122:20 - error: Type "IntArgs4" is not assignable to declared type "StrArgs4"   "IntArgs4" is incompatible with protocol "StrArgs4"     "__call__" is an incompatible type -      Type "(*args: int) -> None" is incompatible with type "(a: int, /, *args: str) -> None" +      Type "(*args: int) -> None" is not assignable to type "(a: int, /, *args: str) -> None"         Parameter 2: type "str" is incompatible with type "int" -          "str" is incompatible with "int" +          "str" is not assignable to "int"         Parameter 3: type "*tuple[str, ...]" is incompatible with type "*tuple[int, ...]" -          "*tuple[str, ...]" is incompatible with "*tuple[int, ...]" (reportAssignmentType) -callables_subtyping.py:124:20 - error: Expression of type "StrArgs4" is incompatible with declared type "IntArgs4" +          "*tuple[str, ...]" is not assignable to "*tuple[int, ...]" (reportAssignmentType) +callables_subtyping.py:124:20 - error: Type "StrArgs4" is not assignable to declared type "IntArgs4"   "StrArgs4" is incompatible with protocol "IntArgs4"     "__call__" is an incompatible type -      Type "(a: int, /, *args: str) -> None" is incompatible with type "(*args: int) -> None" +      Type "(a: int, /, *args: str) -> None" is not assignable to type "(*args: int) -> None"         Parameter 2: type "int" is incompatible with type "str" -          "int" is incompatible with "str" +          "int" is not assignable to "str"         Parameter 1: type "*tuple[int, ...]" is incompatible with type "*tuple[str, ...]" -          "*tuple[int, ...]" is incompatible with "*tuple[str, ...]" (reportAssignmentType) -callables_subtyping.py:125:22 - error: Expression of type "IntStrArgs4" is incompatible with declared type "Standard4" +          "*tuple[int, ...]" is not assignable to "*tuple[str, ...]" (reportAssignmentType) +callables_subtyping.py:125:22 - error: Type "IntStrArgs4" is not assignable to declared type "Standard4"   "IntStrArgs4" is incompatible with protocol "Standard4"     "__call__" is an incompatible type -      Type "(*args: int | str) -> None" is incompatible with type "(a: int, b: str) -> None" +      Type "(*args: int | str) -> None" is not assignable to type "(a: int, b: str) -> None"         Missing keyword parameter "a"         Missing keyword parameter "b" (reportAssignmentType) -callables_subtyping.py:126:22 - error: Expression of type "StrArgs4" is incompatible with declared type "Standard4" +callables_subtyping.py:126:22 - error: Type "StrArgs4" is not assignable to declared type "Standard4"   "StrArgs4" is incompatible with protocol "Standard4"     "__call__" is an incompatible type -      Type "(a: int, /, *args: str) -> None" is incompatible with type "(a: int, b: str) -> None" +      Type "(a: int, /, *args: str) -> None" is not assignable to type "(a: int, b: str) -> None"         Missing keyword parameter "a"         Missing keyword parameter "b"           Position-only parameter mismatch; parameter "a" is not position-only           Position-only parameter mismatch; expected 1 but received 0 (reportAssignmentType) -callables_subtyping.py:151:22 - error: Expression of type "NoKwargs5" is incompatible with declared type "IntKwargs5" +callables_subtyping.py:151:22 - error: Type "NoKwargs5" is not assignable to declared type "IntKwargs5"   "NoKwargs5" is incompatible with protocol "IntKwargs5"     "__call__" is an incompatible type -      Type "() -> None" is incompatible with type "(**kwargs: int) -> None" +      Type "() -> None" is not assignable to type "(**kwargs: int) -> None"         Parameter "**kwargs" has no corresponding parameter (reportAssignmentType) -callables_subtyping.py:154:24 - error: Expression of type "NoKwargs5" is incompatible with declared type "FloatKwargs5" +callables_subtyping.py:154:24 - error: Type "NoKwargs5" is not assignable to declared type "FloatKwargs5"   "NoKwargs5" is incompatible with protocol "FloatKwargs5"     "__call__" is an incompatible type -      Type "() -> None" is incompatible with type "(**kwargs: float) -> None" +      Type "() -> None" is not assignable to type "(**kwargs: float) -> None"         Parameter "**kwargs" has no corresponding parameter (reportAssignmentType) -callables_subtyping.py:155:24 - error: Expression of type "IntKwargs5" is incompatible with declared type "FloatKwargs5" +callables_subtyping.py:155:24 - error: Type "IntKwargs5" is not assignable to declared type "FloatKwargs5"   "IntKwargs5" is incompatible with protocol "FloatKwargs5"     "__call__" is an incompatible type -      Type "(**kwargs: int) -> None" is incompatible with type "(**kwargs: float) -> None" +      Type "(**kwargs: int) -> None" is not assignable to type "(**kwargs: float) -> None"         Parameter 1: type "float" is incompatible with type "int" -          "float" is incompatible with "int" (reportAssignmentType) -callables_subtyping.py:187:19 - error: Expression of type "IntKwargs6" is incompatible with declared type "KwOnly6" +          "float" is not assignable to "int" (reportAssignmentType) +callables_subtyping.py:187:19 - error: Type "IntKwargs6" is not assignable to declared type "KwOnly6"   "IntKwargs6" is incompatible with protocol "KwOnly6"     "__call__" is an incompatible type -      Type "(**kwargs: int) -> None" is incompatible with type "(*, a: int, b: str) -> None" +      Type "(**kwargs: int) -> None" is not assignable to type "(*, a: int, b: str) -> None"         Parameter 3: type "str" is incompatible with type "int" -          "str" is incompatible with "int" (reportAssignmentType) -callables_subtyping.py:190:25 - error: Expression of type "StrKwargs6" is incompatible with declared type "IntStrKwargs6" +          "str" is not assignable to "int" (reportAssignmentType) +callables_subtyping.py:190:25 - error: Type "StrKwargs6" is not assignable to declared type "IntStrKwargs6"   "StrKwargs6" is incompatible with protocol "IntStrKwargs6"     "__call__" is an incompatible type -      Type "(*, a: int, **kwargs: str) -> None" is incompatible with type "(**kwargs: int | str) -> None" +      Type "(*, a: int, **kwargs: str) -> None" is not assignable to type "(**kwargs: int | str) -> None"         Parameter 1: type "int | str" is incompatible with type "int" -          Type "int | str" is incompatible with type "int" +          Type "int | str" is not assignable to type "int"         Parameter 1: type "int | str" is incompatible with type "str" -          Type "int | str" is incompatible with type "str" (reportAssignmentType) -callables_subtyping.py:191:25 - error: Expression of type "IntKwargs6" is incompatible with declared type "IntStrKwargs6" +          Type "int | str" is not assignable to type "str" (reportAssignmentType) +callables_subtyping.py:191:25 - error: Type "IntKwargs6" is not assignable to declared type "IntStrKwargs6"   "IntKwargs6" is incompatible with protocol "IntStrKwargs6"     "__call__" is an incompatible type -      Type "(**kwargs: int) -> None" is incompatible with type "(**kwargs: int | str) -> None" +      Type "(**kwargs: int) -> None" is not assignable to type "(**kwargs: int | str) -> None"         Parameter 1: type "int | str" is incompatible with type "int" -          Type "int | str" is incompatible with type "int" (reportAssignmentType) -callables_subtyping.py:193:22 - error: Expression of type "IntKwargs6" is incompatible with declared type "StrKwargs6" +          Type "int | str" is not assignable to type "int" (reportAssignmentType) +callables_subtyping.py:193:22 - error: Type "IntKwargs6" is not assignable to declared type "StrKwargs6"   "IntKwargs6" is incompatible with protocol "StrKwargs6"     "__call__" is an incompatible type -      Type "(**kwargs: int) -> None" is incompatible with type "(*, a: int, **kwargs: str) -> None" +      Type "(**kwargs: int) -> None" is not assignable to type "(*, a: int, **kwargs: str) -> None"         Parameter 3: type "str" is incompatible with type "int" -          "str" is incompatible with "int" (reportAssignmentType) -callables_subtyping.py:195:22 - error: Expression of type "StrKwargs6" is incompatible with declared type "IntKwargs6" +          "str" is not assignable to "int" (reportAssignmentType) +callables_subtyping.py:195:22 - error: Type "StrKwargs6" is not assignable to declared type "IntKwargs6"   "StrKwargs6" is incompatible with protocol "IntKwargs6"     "__call__" is an incompatible type -      Type "(*, a: int, **kwargs: str) -> None" is incompatible with type "(**kwargs: int) -> None" +      Type "(*, a: int, **kwargs: str) -> None" is not assignable to type "(**kwargs: int) -> None"         Parameter 1: type "int" is incompatible with type "str" -          "int" is incompatible with "str" (reportAssignmentType) -callables_subtyping.py:196:22 - error: Expression of type "IntStrKwargs6" is incompatible with declared type "Standard6" +          "int" is not assignable to "str" (reportAssignmentType) +callables_subtyping.py:196:22 - error: Type "IntStrKwargs6" is not assignable to declared type "Standard6"   "IntStrKwargs6" is incompatible with protocol "Standard6"     "__call__" is an incompatible type -      Type "(**kwargs: int | str) -> None" is incompatible with type "(a: int, b: str) -> None" +      Type "(**kwargs: int | str) -> None" is not assignable to type "(a: int, b: str) -> None"         Function accepts too many positional parameters; expected 0 but received 2 (reportAssignmentType) -callables_subtyping.py:197:22 - error: Expression of type "StrKwargs6" is incompatible with declared type "Standard6" +callables_subtyping.py:197:22 - error: Type "StrKwargs6" is not assignable to declared type "Standard6"   "StrKwargs6" is incompatible with protocol "Standard6"     "__call__" is an incompatible type -      Type "(*, a: int, **kwargs: str) -> None" is incompatible with type "(a: int, b: str) -> None" +      Type "(*, a: int, **kwargs: str) -> None" is not assignable to type "(a: int, b: str) -> None"         Function accepts too many positional parameters; expected 0 but received 2           Extra parameter "a" (reportAssignmentType) -callables_subtyping.py:236:23 - error: Expression of type "NoDefaultArg8" is incompatible with declared type "DefaultArg8" +callables_subtyping.py:236:23 - error: Type "NoDefaultArg8" is not assignable to declared type "DefaultArg8"   "NoDefaultArg8" is incompatible with protocol "DefaultArg8"     "__call__" is an incompatible type -      Type "(x: int) -> None" is incompatible with type "(x: int = 0) -> None" +      Type "(x: int) -> None" is not assignable to type "(x: int = 0) -> None"         Parameter "x" is missing default argument (reportAssignmentType) -callables_subtyping.py:237:23 - error: Expression of type "NoX8" is incompatible with declared type "DefaultArg8" +callables_subtyping.py:237:23 - error: Type "NoX8" is not assignable to declared type "DefaultArg8"   "NoX8" is incompatible with protocol "DefaultArg8"     "__call__" is an incompatible type -      Type "() -> None" is incompatible with type "(x: int = 0) -> None" +      Type "() -> None" is not assignable to type "(x: int = 0) -> None"         Function accepts too many positional parameters; expected 0 but received 1 (reportAssignmentType) -callables_subtyping.py:240:25 - error: Expression of type "NoX8" is incompatible with declared type "NoDefaultArg8" +callables_subtyping.py:240:25 - error: Type "NoX8" is not assignable to declared type "NoDefaultArg8"   "NoX8" is incompatible with protocol "NoDefaultArg8"     "__call__" is an incompatible type -      Type "() -> None" is incompatible with type "(x: int) -> None" +      Type "() -> None" is not assignable to type "(x: int) -> None"         Function accepts too many positional parameters; expected 0 but received 1 (reportAssignmentType) -callables_subtyping.py:243:16 - error: Expression of type "NoDefaultArg8" is incompatible with declared type "NoX8" +callables_subtyping.py:243:16 - error: Type "NoDefaultArg8" is not assignable to declared type "NoX8"   "NoDefaultArg8" is incompatible with protocol "NoX8"     "__call__" is an incompatible type -      Type "(x: int) -> None" is incompatible with type "() -> None" +      Type "(x: int) -> None" is not assignable to type "() -> None"         Extra parameter "x" (reportAssignmentType) -callables_subtyping.py:273:21 - error: Expression of type "Overloaded9" is incompatible with declared type "FloatArg9" +callables_subtyping.py:273:21 - error: Type "Overloaded9" is not assignable to declared type "FloatArg9"   "Overloaded9" is incompatible with protocol "FloatArg9"     "__call__" is an incompatible type       No overloaded function matches type "(x: float) -> float" (reportAssignmentType) -callables_subtyping.py:297:24 - error: Expression of type "StrArg10" is incompatible with declared type "Overloaded10" +callables_subtyping.py:297:24 - error: Type "StrArg10" is not assignable to declared type "Overloaded10"   "StrArg10" is incompatible with protocol "Overloaded10"     "__call__" is an incompatible type       One or more overloads of "__call__" is not assignable -        Type "(x: str) -> complex" is incompatible with type "(x: int, y: str) -> float" +        Type "(x: str) -> complex" is not assignable to type "(x: int, y: str) -> float"           Function accepts too many positional parameters; expected 1 but received 2 (reportAssignmentType) """ conformance_automated = "Pass" diff --git a/conformance/results/pyright/classes_classvar.toml b/conformance/results/pyright/classes_classvar.toml index f18dfc60e..42c7a249c 100644 --- a/conformance/results/pyright/classes_classvar.toml +++ b/conformance/results/pyright/classes_classvar.toml @@ -6,7 +6,7 @@ classes_classvar.py:40:14 - error: "var" is not defined (reportUndefinedVariable classes_classvar.py:45:20 - error: "ClassVar" type cannot include type variables (reportGeneralTypeIssues) classes_classvar.py:46:20 - error: "ClassVar" type cannot include type variables (reportGeneralTypeIssues) classes_classvar.py:47:20 - error: "ClassVar" type cannot include type variables (reportGeneralTypeIssues) -classes_classvar.py:52:33 - error: Expression of type "dict[Any, Any]" is incompatible with declared type "list[str]" (reportAssignmentType) +classes_classvar.py:52:33 - error: Type "dict[Any, Any]" is not assignable to declared type "list[str]" (reportAssignmentType) classes_classvar.py:54:17 - error: "ClassVar" is not allowed in this context (reportInvalidTypeForm) classes_classvar.py:55:17 - error: "ClassVar" is not allowed in this context (reportInvalidTypeForm) classes_classvar.py:63:26 - error: "ClassVar" is not allowed in this context (reportInvalidTypeForm) @@ -16,9 +16,8 @@ classes_classvar.py:67:26 - error: "ClassVar" is not allowed in this context (re classes_classvar.py:71:8 - error: "ClassVar" is not allowed in this context (reportInvalidTypeForm) classes_classvar.py:72:20 - error: "ClassVar" is not allowed in this context (reportInvalidTypeForm) classes_classvar.py:105:14 - error: Cannot assign to attribute "stats" for class "Starship" -  Attribute "stats" cannot be assigned through a class instance because it is a ClassVar -    Attribute "__set__" is unknown (reportAttributeAccessIssue) -classes_classvar.py:134:13 - error: Expression of type "ProtoAImpl" is incompatible with declared type "ProtoA" +  Attribute "stats" cannot be assigned through a class instance because it is a ClassVar (reportAttributeAccessIssue) +classes_classvar.py:134:13 - error: Type "ProtoAImpl" is not assignable to declared type "ProtoA"   "ProtoAImpl" is incompatible with protocol "ProtoA"     "x" is defined as a ClassVar in protocol     "y" is defined as a ClassVar in protocol (reportAssignmentType) diff --git a/conformance/results/pyright/constructors_call_init.toml b/conformance/results/pyright/constructors_call_init.toml index dc74b3f90..4d6672588 100644 --- a/conformance/results/pyright/constructors_call_init.toml +++ b/conformance/results/pyright/constructors_call_init.toml @@ -4,14 +4,14 @@ errors_diff = """ """ output = """ constructors_call_init.py:21:13 - error: Argument of type "float" cannot be assigned to parameter "x" of type "int" in function "__init__" -  "float" is incompatible with "int" (reportArgumentType) +  "float" is not assignable to "int" (reportArgumentType) constructors_call_init.py:42:8 - error: Argument of type "Class2[Unknown]" cannot be assigned to parameter "x" of type "Class3 | None" in function "__init__" -  Type "Class2[Unknown]" is incompatible with type "Class3 | None" -    "Class2[Unknown]" is incompatible with "Class3" -    "Class2[Unknown]" is incompatible with "None" (reportArgumentType) +  Type "Class2[Unknown]" is not assignable to type "Class3 | None" +    "Class2[Unknown]" is not assignable to "Class3" +    "Class2[Unknown]" is not assignable to "None" (reportArgumentType) constructors_call_init.py:56:1 - error:   Could not bind method "__init__" because "Class4[str]" is not assignable to parameter "self" -    "Class4[str]" is incompatible with "Class4[int]" +    "Class4[str]" is not assignable to "Class4[int]"       Type parameter "T@Class4" is invariant, but "str" is not the same as "int" (reportGeneralTypeIssues) constructors_call_init.py:107:24 - warning: Type annotation for "self" parameter of "__init__" method cannot contain class-scoped type variables (reportInvalidTypeVarUse) constructors_call_init.py:130:9 - error: Expected 0 positional arguments (reportCallIssue) diff --git a/conformance/results/pyright/constructors_call_new.toml b/conformance/results/pyright/constructors_call_new.toml index 5880ad7fc..1585d37d1 100644 --- a/conformance/results/pyright/constructors_call_new.toml +++ b/conformance/results/pyright/constructors_call_new.toml @@ -3,11 +3,11 @@ errors_diff = """ """ output = """ constructors_call_new.py:21:13 - error: Argument of type "float" cannot be assigned to parameter "x" of type "int" in function "__new__" -  "float" is incompatible with "int" (reportArgumentType) +  "float" is not assignable to "int" (reportArgumentType) constructors_call_new.py:145:1 - error:   Could not bind method "__new__" because "type[Class11[str]]" is not assignable to parameter "cls" -    "type[Class11[str]]" is incompatible with "type[Class11[int]]" -    Type "type[Class11[str]]" is incompatible with type "type[Class11[int]]" +    "type[Class11[str]]" is not assignable to "type[Class11[int]]" +    Type "type[Class11[str]]" is not assignable to type "type[Class11[int]]"       Type parameter "T@Class11" is invariant, but "str" is not the same as "int" (reportGeneralTypeIssues) """ conformance_automated = "Pass" diff --git a/conformance/results/pyright/constructors_call_type.toml b/conformance/results/pyright/constructors_call_type.toml index 70f197b88..2e33755c3 100644 --- a/conformance/results/pyright/constructors_call_type.toml +++ b/conformance/results/pyright/constructors_call_type.toml @@ -1,15 +1,18 @@ -conformant = "Pass" +conformant = "Partial" +notes = """ +Fails to report error when passing incorrect arguments for metaclass __call__ method. +""" errors_diff = """ +Line 30: Expected 1 errors +Line 72: Expected 1 errors """ output = """ -constructors_call_type.py:30:5 - error: Arguments missing for parameters "x", "y" (reportCallIssue) constructors_call_type.py:40:5 - error: Arguments missing for parameters "x", "y" (reportCallIssue) constructors_call_type.py:50:5 - error: Arguments missing for parameters "x", "y" (reportCallIssue) constructors_call_type.py:59:9 - error: Expected 0 positional arguments (reportCallIssue) constructors_call_type.py:64:9 - error: Expected 0 positional arguments (reportCallIssue) -constructors_call_type.py:72:5 - error: Arguments missing for parameters "x", "y" (reportCallIssue) constructors_call_type.py:81:5 - error: Argument missing for parameter "y" (reportCallIssue) constructors_call_type.py:82:12 - error: Argument of type "Literal[2]" cannot be assigned to parameter "y" of type "str" in function "__new__" -  "Literal[2]" is incompatible with "str" (reportArgumentType) +  "Literal[2]" is not assignable to "str" (reportArgumentType) """ -conformance_automated = "Pass" +conformance_automated = "Fail" diff --git a/conformance/results/pyright/constructors_callable.toml b/conformance/results/pyright/constructors_callable.toml index 6c0039665..708e4555b 100644 --- a/conformance/results/pyright/constructors_callable.toml +++ b/conformance/results/pyright/constructors_callable.toml @@ -26,8 +26,8 @@ constructors_callable.py:144:8 - error: Expected 0 positional arguments (reportC constructors_callable.py:162:5 - information: Type of "r7" is "Overload[(x: int) -> Class7[int], (x: str) -> Class7[str]]" constructors_callable.py:182:13 - information: Type of "r8" is "(x: list[T@Class8], y: list[T@Class8]) -> Class8[T@Class8]" constructors_callable.py:184:10 - error: Argument of type "list[str]" cannot be assigned to parameter "y" of type "list[T@Class8]" -  "Literal['']" is incompatible with "int" (reportArgumentType) +  "Literal['']" is not assignable to "int" (reportArgumentType) constructors_callable.py:193:13 - information: Type of "r9" is "(x: list[T@__init__], y: list[T@__init__]) -> Class9" constructors_callable.py:195:10 - error: Argument of type "list[str]" cannot be assigned to parameter "y" of type "list[T@__init__]" -  "Literal['']" is incompatible with "int" (reportArgumentType) +  "Literal['']" is not assignable to "int" (reportArgumentType) """ diff --git a/conformance/results/pyright/dataclasses_final.toml b/conformance/results/pyright/dataclasses_final.toml index a0ab43daa..9b85ad5ab 100644 --- a/conformance/results/pyright/dataclasses_final.toml +++ b/conformance/results/pyright/dataclasses_final.toml @@ -4,18 +4,13 @@ errors_diff = """ """ output = """ dataclasses_final.py:27:3 - error: Cannot assign to attribute "final_classvar" for class "type[D]" -  "final_classvar" is declared as Final and cannot be reassigned -    Attribute "__set__" is unknown (reportAttributeAccessIssue) +  "final_classvar" is declared as Final and cannot be reassigned (reportAttributeAccessIssue) dataclasses_final.py:35:3 - error: Cannot assign to attribute "final_no_default" for class "D" -  "final_no_default" is declared as Final and cannot be reassigned -    Attribute "__set__" is unknown (reportAttributeAccessIssue) +  "final_no_default" is declared as Final and cannot be reassigned (reportAttributeAccessIssue) dataclasses_final.py:36:3 - error: Cannot assign to attribute "final_with_default" for class "D" -  "final_with_default" is declared as Final and cannot be reassigned -    Attribute "__set__" is unknown (reportAttributeAccessIssue) +  "final_with_default" is declared as Final and cannot be reassigned (reportAttributeAccessIssue) dataclasses_final.py:37:3 - error: Cannot assign to attribute "final_no_default" for class "type[D]" -  "final_no_default" is declared as Final and cannot be reassigned -    Attribute "__set__" is unknown (reportAttributeAccessIssue) +  "final_no_default" is declared as Final and cannot be reassigned (reportAttributeAccessIssue) dataclasses_final.py:38:3 - error: Cannot assign to attribute "final_with_default" for class "type[D]" -  "final_with_default" is declared as Final and cannot be reassigned -    Attribute "__set__" is unknown (reportAttributeAccessIssue) +  "final_with_default" is declared as Final and cannot be reassigned (reportAttributeAccessIssue) """ diff --git a/conformance/results/pyright/dataclasses_frozen.toml b/conformance/results/pyright/dataclasses_frozen.toml index 4175c762d..87a046e23 100644 --- a/conformance/results/pyright/dataclasses_frozen.toml +++ b/conformance/results/pyright/dataclasses_frozen.toml @@ -1,11 +1,9 @@ conformant = "Pass" output = """ dataclasses_frozen.py:16:5 - error: Cannot assign to attribute "a" for class "DC1" -  "DC1" is frozen -    Attribute "__set__" is unknown (reportAttributeAccessIssue) +  Attribute "a" is read-only (reportAttributeAccessIssue) dataclasses_frozen.py:17:5 - error: Cannot assign to attribute "b" for class "DC1" -  "DC1" is frozen -    Attribute "__set__" is unknown (reportAttributeAccessIssue) +  Attribute "b" is read-only (reportAttributeAccessIssue) dataclasses_frozen.py:22:1 - error: A non-frozen class cannot inherit from a class that is frozen (reportGeneralTypeIssues) dataclasses_frozen.py:32:12 - error: A frozen class cannot inherit from a class that is not frozen (reportGeneralTypeIssues) """ diff --git a/conformance/results/pyright/dataclasses_hash.toml b/conformance/results/pyright/dataclasses_hash.toml index 748f32bdb..bd6c15f84 100644 --- a/conformance/results/pyright/dataclasses_hash.toml +++ b/conformance/results/pyright/dataclasses_hash.toml @@ -1,13 +1,13 @@ conformant = "Pass" output = """ -dataclasses_hash.py:15:16 - error: Expression of type "DC1" is incompatible with declared type "Hashable" +dataclasses_hash.py:15:16 - error: Type "DC1" is not assignable to declared type "Hashable"   "DC1" is incompatible with protocol "Hashable"     "__hash__" is an incompatible type -      Type "None" is incompatible with type "() -> int" (reportAssignmentType) -dataclasses_hash.py:32:16 - error: Expression of type "DC3" is incompatible with declared type "Hashable" +      Type "None" is not assignable to type "() -> int" (reportAssignmentType) +dataclasses_hash.py:32:16 - error: Type "DC3" is not assignable to declared type "Hashable"   "DC3" is incompatible with protocol "Hashable"     "__hash__" is an incompatible type -      Type "None" is incompatible with type "() -> int" (reportAssignmentType) +      Type "None" is not assignable to type "() -> int" (reportAssignmentType) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/dataclasses_postinit.toml b/conformance/results/pyright/dataclasses_postinit.toml index 029868bc5..9ba5550ab 100644 --- a/conformance/results/pyright/dataclasses_postinit.toml +++ b/conformance/results/pyright/dataclasses_postinit.toml @@ -1,7 +1,7 @@ conformant = "Pass" output = """ dataclasses_postinit.py:19:40 - error: Dataclass __post_init__ method parameter type mismatch for field "y" -  "str" is incompatible with "int" (reportGeneralTypeIssues) +  "str" is not assignable to "int" (reportGeneralTypeIssues) dataclasses_postinit.py:28:11 - error: Cannot access attribute "x" for class "DC1"   "x" is an init-only field (reportAttributeAccessIssue) dataclasses_postinit.py:29:11 - error: Cannot access attribute "y" for class "DC1" diff --git a/conformance/results/pyright/dataclasses_transform_class.toml b/conformance/results/pyright/dataclasses_transform_class.toml index b7bf3083f..25b8ccc83 100644 --- a/conformance/results/pyright/dataclasses_transform_class.toml +++ b/conformance/results/pyright/dataclasses_transform_class.toml @@ -2,14 +2,12 @@ conformant = "Pass" output = """ dataclasses_transform_class.py:51:7 - error: A non-frozen class cannot inherit from a class that is frozen (reportGeneralTypeIssues) dataclasses_transform_class.py:63:6 - error: Cannot assign to attribute "id" for class "Customer1" -  "Customer1" is frozen -    Attribute "__set__" is unknown (reportAttributeAccessIssue) +  Attribute "id" is read-only (reportAttributeAccessIssue) dataclasses_transform_class.py:66:18 - error: Expected 0 positional arguments (reportCallIssue) dataclasses_transform_class.py:72:6 - error: Operator "<" not supported for types "Customer1" and "Customer1" (reportOperatorIssue) dataclasses_transform_class.py:82:18 - error: Expected 0 positional arguments (reportCallIssue) dataclasses_transform_class.py:122:6 - error: Cannot assign to attribute "id" for class "Customer3" -  "Customer3" is frozen -    Attribute "__set__" is unknown (reportAttributeAccessIssue) +  Attribute "id" is read-only (reportAttributeAccessIssue) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/dataclasses_transform_converter.toml b/conformance/results/pyright/dataclasses_transform_converter.toml index ec34af35b..479f0d759 100644 --- a/conformance/results/pyright/dataclasses_transform_converter.toml +++ b/conformance/results/pyright/dataclasses_transform_converter.toml @@ -4,41 +4,41 @@ errors_diff = """ """ output = """ dataclasses_transform_converter.py:48:31 - error: Argument of type "() -> int" is not a valid converter for field "field1" of type "int" -  Type "() -> int" is incompatible with type "(__converterInput) -> int" +  Type "() -> int" is not assignable to type "(__converterInput) -> int"     Function accepts too many positional parameters; expected 0 but received 1 (reportGeneralTypeIssues) dataclasses_transform_converter.py:48:41 - error: Argument of type "() -> int" cannot be assigned to parameter "converter" of type "(S@model_field) -> T@model_field" in function "model_field" -  Type "() -> int" is incompatible with type "(S@model_field) -> int" +  Type "() -> int" is not assignable to type "(S@model_field) -> int"     Function accepts too many positional parameters; expected 0 but received 1 (reportArgumentType) dataclasses_transform_converter.py:49:31 - error: Argument of type "(*, x: int) -> int" is not a valid converter for field "field2" of type "int" -  Type "(*, x: int) -> int" is incompatible with type "(__converterInput) -> int" +  Type "(*, x: int) -> int" is not assignable to type "(__converterInput) -> int"     Function accepts too many positional parameters; expected 0 but received 1       Extra parameter "x" (reportGeneralTypeIssues) dataclasses_transform_converter.py:49:41 - error: Argument of type "(*, x: int) -> int" cannot be assigned to parameter "converter" of type "(S@model_field) -> T@model_field" in function "model_field" -  Type "(*, x: int) -> int" is incompatible with type "(S@model_field) -> int" +  Type "(*, x: int) -> int" is not assignable to type "(S@model_field) -> int"     Function accepts too many positional parameters; expected 0 but received 1       Extra parameter "x" (reportArgumentType) dataclasses_transform_converter.py:107:5 - error: Argument of type "Literal[1]" cannot be assigned to parameter "field0" of type "str" in function "__init__" -  "Literal[1]" is incompatible with "str" (reportArgumentType) +  "Literal[1]" is not assignable to "str" (reportArgumentType) dataclasses_transform_converter.py:108:23 - error: Argument of type "Literal[1]" cannot be assigned to parameter "field3" of type "str | bytes" in function "__init__" -  Type "Literal[1]" is incompatible with type "str | bytes" -    "Literal[1]" is incompatible with "str" -    "Literal[1]" is incompatible with "bytes" (reportArgumentType) +  Type "Literal[1]" is not assignable to type "str | bytes" +    "Literal[1]" is not assignable to "str" +    "Literal[1]" is not assignable to "bytes" (reportArgumentType) dataclasses_transform_converter.py:109:29 - error: Argument of type "complex" cannot be assigned to parameter "field4" of type "str | list[str]" in function "__init__" -  Type "complex" is incompatible with type "str | list[str]" -    "complex" is incompatible with "str" -    "complex" is incompatible with "list[str]" (reportArgumentType) +  Type "complex" is not assignable to type "str | list[str]" +    "complex" is not assignable to "str" +    "complex" is not assignable to "list[str]" (reportArgumentType) dataclasses_transform_converter.py:118:14 - error: Cannot assign to attribute "field0" for class "DC2" -  "Literal[1]" is incompatible with "str" (reportAttributeAccessIssue) +  "Literal[1]" is not assignable to "str" (reportAttributeAccessIssue) dataclasses_transform_converter.py:119:14 - error: Cannot assign to attribute "field3" for class "DC2" -  Type "Literal[1]" is incompatible with type "str | bytes" -    "Literal[1]" is incompatible with "str" -    "Literal[1]" is incompatible with "bytes" (reportAttributeAccessIssue) +  Type "Literal[1]" is not assignable to type "str | bytes" +    "Literal[1]" is not assignable to "str" +    "Literal[1]" is not assignable to "bytes" (reportAttributeAccessIssue) dataclasses_transform_converter.py:130:67 - error: Argument of type "Literal[1]" cannot be assigned to parameter "default" of type "S@model_field | None" in function "model_field" -  Type "Literal[1]" is incompatible with type "str | None" -    "Literal[1]" is incompatible with "str" -    "Literal[1]" is incompatible with "None" (reportArgumentType) +  Type "Literal[1]" is not assignable to type "str | None" +    "Literal[1]" is not assignable to "str" +    "Literal[1]" is not assignable to "None" (reportArgumentType) dataclasses_transform_converter.py:133:75 - error: Argument of type "type[int]" cannot be assigned to parameter "default_factory" of type "(() -> S@model_field) | None" in function "model_field" -  Type "type[int]" is incompatible with type "(() -> str) | None" +  Type "type[int]" is not assignable to type "(() -> str) | None"     No overloaded function matches type "() -> str" -    "type[type]" is incompatible with "type[None]" (reportArgumentType) +    "type[type]" is not assignable to "type[None]" (reportArgumentType) """ diff --git a/conformance/results/pyright/dataclasses_transform_func.toml b/conformance/results/pyright/dataclasses_transform_func.toml index 55a0df3e3..164f93379 100644 --- a/conformance/results/pyright/dataclasses_transform_func.toml +++ b/conformance/results/pyright/dataclasses_transform_func.toml @@ -1,14 +1,13 @@ conformant = "Pass" output = """ dataclasses_transform_func.py:57:13 - error: Cannot assign to attribute "name" for class "Customer1" -  "Literal[3]" is incompatible with "str" (reportAttributeAccessIssue) +  "Literal[3]" is not assignable to "str" (reportAttributeAccessIssue) dataclasses_transform_func.py:61:6 - error: Operator "<" not supported for types "Customer1" and "Customer1" (reportOperatorIssue) dataclasses_transform_func.py:65:36 - error: No parameter named "salary" (reportCallIssue) dataclasses_transform_func.py:71:18 - error: Expected 0 positional arguments (reportCallIssue) dataclasses_transform_func.py:89:1 - error: A non-frozen class cannot inherit from a class that is frozen (reportGeneralTypeIssues) dataclasses_transform_func.py:97:6 - error: Cannot assign to attribute "id" for class "Customer3" -  "Customer3" is frozen -    Attribute "__set__" is unknown (reportAttributeAccessIssue) +  Attribute "id" is read-only (reportAttributeAccessIssue) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/dataclasses_transform_meta.toml b/conformance/results/pyright/dataclasses_transform_meta.toml index d59747196..392f95a70 100644 --- a/conformance/results/pyright/dataclasses_transform_meta.toml +++ b/conformance/results/pyright/dataclasses_transform_meta.toml @@ -2,14 +2,12 @@ conformant = "Pass" output = """ dataclasses_transform_meta.py:51:36 - error: A non-frozen class cannot inherit from a class that is frozen (reportGeneralTypeIssues) dataclasses_transform_meta.py:63:6 - error: Cannot assign to attribute "id" for class "Customer1" -  "Customer1" is frozen -    Attribute "__set__" is unknown (reportAttributeAccessIssue) +  Attribute "id" is read-only (reportAttributeAccessIssue) dataclasses_transform_meta.py:66:18 - error: Expected 0 positional arguments (reportCallIssue) dataclasses_transform_meta.py:73:6 - error: Operator "<" not supported for types "Customer1" and "Customer1" (reportOperatorIssue) dataclasses_transform_meta.py:83:18 - error: Expected 0 positional arguments (reportCallIssue) dataclasses_transform_meta.py:103:6 - error: Cannot assign to attribute "id" for class "Customer3" -  "Customer3" is frozen -    Attribute "__set__" is unknown (reportAttributeAccessIssue) +  Attribute "id" is read-only (reportAttributeAccessIssue) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/dataclasses_usage.toml b/conformance/results/pyright/dataclasses_usage.toml index cb3906bf0..67ec33f28 100644 --- a/conformance/results/pyright/dataclasses_usage.toml +++ b/conformance/results/pyright/dataclasses_usage.toml @@ -2,14 +2,14 @@ conformant = "Pass" output = """ dataclasses_usage.py:50:6 - error: Argument missing for parameter "unit_price" (reportCallIssue) dataclasses_usage.py:51:28 - error: Argument of type "Literal['price']" cannot be assigned to parameter "unit_price" of type "float" in function "__init__" -  "Literal['price']" is incompatible with "float" (reportArgumentType) +  "Literal['price']" is not assignable to "float" (reportArgumentType) dataclasses_usage.py:52:36 - error: Expected 3 positional arguments (reportCallIssue) dataclasses_usage.py:61:5 - error: Fields without default values cannot appear after fields with default values (reportGeneralTypeIssues) dataclasses_usage.py:67:5 - error: Fields without default values cannot appear after fields with default values (reportGeneralTypeIssues) dataclasses_usage.py:73:5 - error: Fields without default values cannot appear after fields with default values (reportGeneralTypeIssues) dataclasses_usage.py:83:13 - error: Expected 1 positional argument (reportCallIssue) -dataclasses_usage.py:88:14 - error: Expression of type "str" is incompatible with declared type "int" -  "str" is incompatible with "int" (reportAssignmentType) +dataclasses_usage.py:88:14 - error: Type "str" is not assignable to declared type "int" +  "str" is not assignable to "int" (reportAssignmentType) dataclasses_usage.py:127:8 - error: Expected 1 positional argument (reportCallIssue) dataclasses_usage.py:130:1 - error: Argument missing for parameter "y" (reportCallIssue) dataclasses_usage.py:179:6 - error: Expected 0 positional arguments (reportCallIssue) diff --git a/conformance/results/pyright/directives_no_type_check.toml b/conformance/results/pyright/directives_no_type_check.toml index 9f73f7153..858c581eb 100644 --- a/conformance/results/pyright/directives_no_type_check.toml +++ b/conformance/results/pyright/directives_no_type_check.toml @@ -3,8 +3,8 @@ notes = """ Does not honor `@no_type_check` class decorator (allowed). """ output = """ -directives_no_type_check.py:15:14 - error: Expression of type "Literal['']" is incompatible with declared type "int" -  "Literal['']" is incompatible with "int" (reportAssignmentType) +directives_no_type_check.py:15:14 - error: Type "Literal['']" is not assignable to declared type "int" +  "Literal['']" is not assignable to "int" (reportAssignmentType) directives_no_type_check.py:32:1 - error: Arguments missing for parameters "a", "b" (reportCallIssue) """ conformance_automated = "Pass" diff --git a/conformance/results/pyright/directives_type_ignore_file2.toml b/conformance/results/pyright/directives_type_ignore_file2.toml index 21a0a593b..667eeb77b 100644 --- a/conformance/results/pyright/directives_type_ignore_file2.toml +++ b/conformance/results/pyright/directives_type_ignore_file2.toml @@ -1,7 +1,7 @@ conformant = "Pass" output = """ -directives_type_ignore_file2.py:14:10 - error: Expression of type "Literal['']" is incompatible with declared type "int" -  "Literal['']" is incompatible with "int" (reportAssignmentType) +directives_type_ignore_file2.py:14:10 - error: Type "Literal['']" is not assignable to declared type "int" +  "Literal['']" is not assignable to "int" (reportAssignmentType) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/enums_member_values.toml b/conformance/results/pyright/enums_member_values.toml index 566fcd4f5..2efe3d766 100644 --- a/conformance/results/pyright/enums_member_values.toml +++ b/conformance/results/pyright/enums_member_values.toml @@ -7,8 +7,8 @@ enums_member_values.py:50:12 - error: Argument missing for parameter "radius" (r enums_member_values.py:51:15 - error: Arguments missing for parameters "mass", "radius" (reportCallIssue) enums_member_values.py:54:13 - error: "assert_type" mismatch: expected "Literal[1]" but received "Any" (reportAssertTypeFailure) enums_member_values.py:68:13 - error: "assert_type" mismatch: expected "Literal[1]" but received "int" (reportAssertTypeFailure) -enums_member_values.py:78:13 - error: Expression of type "Literal['green']" is incompatible with declared type "int" -  "Literal['green']" is incompatible with "int" (reportAssignmentType) +enums_member_values.py:78:13 - error: Type "Literal['green']" is not assignable to declared type "int" +  "Literal['green']" is not assignable to "int" (reportAssignmentType) enums_member_values.py:85:24 - error: Cannot assign to attribute "_value_" for class "Planet2*" -  "int" is incompatible with "str" (reportAttributeAccessIssue) +  "int" is not assignable to "str" (reportAttributeAccessIssue) """ diff --git a/conformance/results/pyright/generics_base_class.toml b/conformance/results/pyright/generics_base_class.toml index a008e5e3f..fa4abde3d 100644 --- a/conformance/results/pyright/generics_base_class.toml +++ b/conformance/results/pyright/generics_base_class.toml @@ -1,7 +1,7 @@ conformant = "Pass" output = """ generics_base_class.py:26:26 - error: Argument of type "SymbolTable" cannot be assigned to parameter "x" of type "dict[str, list[object]]" in function "takes_dict_incorrect" -  "SymbolTable" is incompatible with "dict[str, list[object]]" +  "SymbolTable" is not assignable to "dict[str, list[object]]"     Type parameter "_VT@dict" is invariant, but "list[Node]" is not the same as "list[object]"     Consider switching from "dict" to "Mapping" which is covariant in the value type (reportArgumentType) generics_base_class.py:29:14 - error: "Generic" is not valid in this context (reportGeneralTypeIssues) diff --git a/conformance/results/pyright/generics_basic.toml b/conformance/results/pyright/generics_basic.toml index b57456ed3..290ffe414 100644 --- a/conformance/results/pyright/generics_basic.toml +++ b/conformance/results/pyright/generics_basic.toml @@ -1,18 +1,18 @@ conformant = "Pass" output = """ generics_basic.py:40:15 - error: Argument of type "bytes" cannot be assigned to parameter "y" of type "AnyStr@concat" in function "concat" -  "bytes" is incompatible with "str" (reportArgumentType) +  "bytes" is not assignable to "str" (reportArgumentType) generics_basic.py:41:15 - error: Argument of type "str" cannot be assigned to parameter "y" of type "AnyStr@concat" in function "concat" -  "str" is incompatible with "bytes" (reportArgumentType) +  "str" is not assignable to "bytes" (reportArgumentType) generics_basic.py:49:44 - error: TypeVar must have at least two constrained types (reportGeneralTypeIssues) generics_basic.py:55:53 - error: TypeVar constraint type cannot be generic (reportGeneralTypeIssues) generics_basic.py:69:15 - error: Argument of type "bytes" cannot be assigned to parameter "y" of type "AnyStr@concat" in function "concat" -  "bytes" is incompatible with "str" (reportArgumentType) +  "bytes" is not assignable to "str" (reportArgumentType) generics_basic.py:121:24 - error: Type arguments for "Generic" must be unique (reportInvalidTypeForm) generics_basic.py:157:5 - error: Argument of type "Literal[0]" cannot be assigned to parameter "key" of type "str" in function "__getitem__" -  "Literal[0]" is incompatible with "str" (reportArgumentType) +  "Literal[0]" is not assignable to "str" (reportArgumentType) generics_basic.py:158:5 - error: Argument of type "Literal[0]" cannot be assigned to parameter "key" of type "str" in function "__getitem__" -  "Literal[0]" is incompatible with "str" (reportArgumentType) +  "Literal[0]" is not assignable to "str" (reportArgumentType) generics_basic.py:191:37 - error: Metaclass cannot be generic (reportGeneralTypeIssues) """ conformance_automated = "Pass" diff --git a/conformance/results/pyright/generics_defaults_referential.toml b/conformance/results/pyright/generics_defaults_referential.toml index ff318bc3e..229c13d30 100644 --- a/conformance/results/pyright/generics_defaults_referential.toml +++ b/conformance/results/pyright/generics_defaults_referential.toml @@ -1,9 +1,9 @@ conformant = "Pass" output = """ generics_defaults_referential.py:36:13 - error: Argument of type "Literal['']" cannot be assigned to parameter "b" of type "int" in function "__init__" -  "Literal['']" is incompatible with "int" (reportArgumentType) +  "Literal['']" is not assignable to "int" (reportArgumentType) generics_defaults_referential.py:37:10 - error: Argument of type "Literal['']" cannot be assigned to parameter "a" of type "int" in function "__init__" -  "Literal['']" is incompatible with "int" (reportArgumentType) +  "Literal['']" is not assignable to "int" (reportArgumentType) generics_defaults_referential.py:53:7 - error: Type parameter "Start2T" has a default type that refers to one or more type variables that are out of scope   Type variable "StopT" is not in scope (reportGeneralTypeIssues) generics_defaults_referential.py:60:11 - error: Type parameter "S2" has a default type that refers to one or more type variables that are out of scope diff --git a/conformance/results/pyright/generics_paramspec_components.toml b/conformance/results/pyright/generics_paramspec_components.toml index fb7b7d5b3..91d07a572 100644 --- a/conformance/results/pyright/generics_paramspec_components.toml +++ b/conformance/results/pyright/generics_paramspec_components.toml @@ -18,9 +18,9 @@ generics_paramspec_components.py:70:12 - error: Expected 1 positional argument ( generics_paramspec_components.py:72:12 - error: Expected 1 positional argument (reportCallIssue) generics_paramspec_components.py:83:19 - error: Expected 1 positional argument (reportCallIssue) generics_paramspec_components.py:98:20 - error: Argument of type "Literal['A']" cannot be assigned to parameter "a" of type "int" -  "Literal['A']" is incompatible with "int" (reportArgumentType) +  "Literal['A']" is not assignable to "int" (reportArgumentType) generics_paramspec_components.py:98:25 - error: Argument of type "Literal[1]" cannot be assigned to parameter "b" of type "str" -  "Literal[1]" is incompatible with "str" (reportArgumentType) +  "Literal[1]" is not assignable to "str" (reportArgumentType) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/generics_paramspec_semantics.toml b/conformance/results/pyright/generics_paramspec_semantics.toml index df1e43dc2..e24a0a9c8 100644 --- a/conformance/results/pyright/generics_paramspec_semantics.toml +++ b/conformance/results/pyright/generics_paramspec_semantics.toml @@ -5,30 +5,30 @@ Constraint solver doesn't find common type for two signatures captured by a sing output = """ generics_paramspec_semantics.py:26:6 - error: Expected 2 more positional arguments (reportCallIssue) generics_paramspec_semantics.py:27:9 - error: Argument of type "Literal['A']" cannot be assigned to parameter "b" of type "bool" -  "Literal['A']" is incompatible with "bool" (reportArgumentType) +  "Literal['A']" is not assignable to "bool" (reportArgumentType) generics_paramspec_semantics.py:46:17 - error: Argument of type "(y: int, x: str) -> int" cannot be assigned to parameter "y" of type "(**P@func1) -> int" in function "func1" -  Type "(y: int, x: str) -> int" is incompatible with type "(x: int, y: str) -> int" +  Type "(y: int, x: str) -> int" is not assignable to type "(x: int, y: str) -> int"     Parameter name mismatch: "x" versus "y"     Parameter name mismatch: "y" versus "x" (reportArgumentType) generics_paramspec_semantics.py:61:23 - error: Argument of type "(*, y: int) -> int" cannot be assigned to parameter "y" of type "(**P@func1) -> int" in function "func1" -  Type "(*, y: int) -> int" is incompatible with type "(*, x: int) -> int" +  Type "(*, y: int) -> int" is not assignable to type "(*, x: int) -> int"     Extra parameter "y"     Missing keyword parameter "x" (reportArgumentType) generics_paramspec_semantics.py:98:4 - error: Argument of type "Literal[1]" cannot be assigned to parameter of type "str" -  "Literal[1]" is incompatible with "str" (reportArgumentType) +  "Literal[1]" is not assignable to "str" (reportArgumentType) generics_paramspec_semantics.py:108:4 - error: Argument of type "Literal[1]" cannot be assigned to parameter "args" of type "bool" -  "Literal[1]" is incompatible with "bool" (reportArgumentType) +  "Literal[1]" is not assignable to "bool" (reportArgumentType) generics_paramspec_semantics.py:120:4 - error: Argument of type "Literal[1]" cannot be assigned to parameter of type "str" -  "Literal[1]" is incompatible with "str" (reportArgumentType) +  "Literal[1]" is not assignable to "str" (reportArgumentType) generics_paramspec_semantics.py:127:2 - error: Argument of type "(x: str) -> int" cannot be assigned to parameter "x" of type "(int, **P@expects_int_first) -> int" in function "expects_int_first" -  Type "(x: str) -> int" is incompatible with type "(int, **P@expects_int_first) -> int" +  Type "(x: str) -> int" is not assignable to type "(int, **P@expects_int_first) -> int"     Parameter 1: type "int" is incompatible with type "str" -      "int" is incompatible with "str" (reportArgumentType) +      "int" is not assignable to "str" (reportArgumentType) generics_paramspec_semantics.py:132:2 - error: Argument of type "(*, x: int) -> int" cannot be assigned to parameter "x" of type "(int, **P@expects_int_first) -> int" in function "expects_int_first" -  Type "(*, x: int) -> int" is incompatible with type "(int, **P@expects_int_first) -> int" +  Type "(*, x: int) -> int" is not assignable to type "(int, **P@expects_int_first) -> int"     Function accepts too many positional parameters; expected 0 but received 1 (reportArgumentType) generics_paramspec_semantics.py:137:2 - error: Argument of type "(**kwargs: int) -> int" cannot be assigned to parameter "x" of type "(int, **P@expects_int_first) -> int" in function "expects_int_first" -  Type "(**kwargs: int) -> int" is incompatible with type "(int, **P@expects_int_first) -> int" +  Type "(**kwargs: int) -> int" is not assignable to type "(int, **P@expects_int_first) -> int"     Function accepts too many positional parameters; expected 0 but received 1 (reportArgumentType) """ conformance_automated = "Pass" diff --git a/conformance/results/pyright/generics_paramspec_specialization.toml b/conformance/results/pyright/generics_paramspec_specialization.toml index 525051f47..af1ab6764 100644 --- a/conformance/results/pyright/generics_paramspec_specialization.toml +++ b/conformance/results/pyright/generics_paramspec_specialization.toml @@ -3,13 +3,13 @@ output = """ generics_paramspec_specialization.py:44:27 - error: Type "int" cannot be assigned to type variable "P1@ClassA"   Type "int" is incompatible with ParamSpec "P1@ClassA" (reportInvalidTypeArguments) generics_paramspec_specialization.py:54:9 - error: Argument of type "Literal['']" cannot be assigned to parameter of type "int" -  "Literal['']" is incompatible with "int" (reportArgumentType) +  "Literal['']" is not assignable to "int" (reportArgumentType) generics_paramspec_specialization.py:55:16 - error: Argument of type "Literal['']" cannot be assigned to parameter of type "bool" -  "Literal['']" is incompatible with "bool" (reportArgumentType) +  "Literal['']" is not assignable to "bool" (reportArgumentType) generics_paramspec_specialization.py:60:9 - error: Argument of type "Literal['']" cannot be assigned to parameter of type "int" -  "Literal['']" is incompatible with "int" (reportArgumentType) +  "Literal['']" is not assignable to "int" (reportArgumentType) generics_paramspec_specialization.py:61:16 - error: Argument of type "Literal['']" cannot be assigned to parameter of type "bool" -  "Literal['']" is incompatible with "bool" (reportArgumentType) +  "Literal['']" is not assignable to "bool" (reportArgumentType) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/generics_scoping.toml b/conformance/results/pyright/generics_scoping.toml index bb679b438..2e352ca74 100644 --- a/conformance/results/pyright/generics_scoping.toml +++ b/conformance/results/pyright/generics_scoping.toml @@ -1,7 +1,7 @@ conformant = "Pass" output = """ generics_scoping.py:29:10 - error: Argument of type "Literal['a']" cannot be assigned to parameter "x" of type "int" in function "meth_2" -  "Literal['a']" is incompatible with "int" (reportArgumentType) +  "Literal['a']" is not assignable to "int" (reportArgumentType) generics_scoping.py:50:13 - error: Type variable "S" has no meaning in this context (reportGeneralTypeIssues) generics_scoping.py:54:19 - error: Type variable "S" has no meaning in this context (reportGeneralTypeIssues) generics_scoping.py:65:29 - error: TypeVar "T" is already in use by an outer scope (reportGeneralTypeIssues) diff --git a/conformance/results/pyright/generics_self_attributes.toml b/conformance/results/pyright/generics_self_attributes.toml index 6b439eb2e..b5c9fe45c 100644 --- a/conformance/results/pyright/generics_self_attributes.toml +++ b/conformance/results/pyright/generics_self_attributes.toml @@ -1,16 +1,14 @@ conformant = "Pass" output = """ generics_self_attributes.py:26:38 - error: Argument of type "LinkedList[int]" cannot be assigned to parameter "next" of type "OrdinalLinkedList | None" in function "__init__" -  Type "LinkedList[int]" is incompatible with type "OrdinalLinkedList | None" -    "LinkedList[int]" is incompatible with "OrdinalLinkedList" -    "LinkedList[int]" is incompatible with "None" (reportArgumentType) +  Type "LinkedList[int]" is not assignable to type "OrdinalLinkedList | None" +    "LinkedList[int]" is not assignable to "OrdinalLinkedList" +    "LinkedList[int]" is not assignable to "None" (reportArgumentType) generics_self_attributes.py:32:8 - error: Cannot assign to attribute "next" for class "OrdinalLinkedList"   Expression of type "LinkedList[int]" cannot be assigned to attribute "next" of class "OrdinalLinkedList" -    Attribute "__set__" is unknown -    Attribute "__set__" is unknown -    Type "LinkedList[int]" is incompatible with type "OrdinalLinkedList | None" -      "LinkedList[int]" is incompatible with "OrdinalLinkedList" -      "LinkedList[int]" is incompatible with "None" (reportAttributeAccessIssue) +    Type "LinkedList[int]" is not assignable to type "OrdinalLinkedList | None" +      "LinkedList[int]" is not assignable to "OrdinalLinkedList" +      "LinkedList[int]" is not assignable to "None" (reportAttributeAccessIssue) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/generics_self_basic.toml b/conformance/results/pyright/generics_self_basic.toml index a7a676071..6ce2caef1 100644 --- a/conformance/results/pyright/generics_self_basic.toml +++ b/conformance/results/pyright/generics_self_basic.toml @@ -1,9 +1,9 @@ conformant = "Pass" output = """ -generics_self_basic.py:20:16 - error: Expression of type "Shape" is incompatible with return type "Self@Shape" -  Type "Shape" is incompatible with type "Self@Shape" (reportReturnType) -generics_self_basic.py:33:16 - error: Expression of type "Shape" is incompatible with return type "Self@Shape" -  Type "Shape" is incompatible with type "Self@Shape" (reportReturnType) +generics_self_basic.py:20:16 - error: Type "Shape" is not assignable to return type "Self@Shape" +  Type "Shape" is not assignable to type "Self@Shape" (reportReturnType) +generics_self_basic.py:33:16 - error: Type "Shape" is not assignable to return type "Self@Shape" +  Type "Shape" is not assignable to type "Self@Shape" (reportReturnType) generics_self_basic.py:67:31 - error: Expected no type arguments for class "Self" (reportInvalidTypeArguments) """ conformance_automated = "Pass" diff --git a/conformance/results/pyright/generics_self_protocols.toml b/conformance/results/pyright/generics_self_protocols.toml index 9f77ef795..aa6455302 100644 --- a/conformance/results/pyright/generics_self_protocols.toml +++ b/conformance/results/pyright/generics_self_protocols.toml @@ -3,15 +3,15 @@ output = """ generics_self_protocols.py:61:19 - error: Argument of type "BadReturnType" cannot be assigned to parameter "shape" of type "ShapeProtocol" in function "accepts_shape"   "BadReturnType" is incompatible with protocol "ShapeProtocol"     "set_scale" is an incompatible type -      Type "(scale: float) -> int" is incompatible with type "(scale: float) -> BadReturnType" +      Type "(scale: float) -> int" is not assignable to type "(scale: float) -> BadReturnType"         Function return type "int" is incompatible with type "BadReturnType" -          "int" is incompatible with "BadReturnType" (reportArgumentType) +          "int" is not assignable to "BadReturnType" (reportArgumentType) generics_self_protocols.py:64:19 - error: Argument of type "ReturnDifferentClass" cannot be assigned to parameter "shape" of type "ShapeProtocol" in function "accepts_shape"   "ReturnDifferentClass" is incompatible with protocol "ShapeProtocol"     "set_scale" is an incompatible type -      Type "(scale: float) -> ReturnConcreteShape" is incompatible with type "(scale: float) -> ReturnDifferentClass" +      Type "(scale: float) -> ReturnConcreteShape" is not assignable to type "(scale: float) -> ReturnDifferentClass"         Function return type "ReturnConcreteShape" is incompatible with type "ReturnDifferentClass" -          "ReturnConcreteShape" is incompatible with "ReturnDifferentClass" (reportArgumentType) +          "ReturnConcreteShape" is not assignable to "ReturnDifferentClass" (reportArgumentType) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/generics_self_usage.toml b/conformance/results/pyright/generics_self_usage.toml index 5e7184bac..95f5ac1a0 100644 --- a/conformance/results/pyright/generics_self_usage.toml +++ b/conformance/results/pyright/generics_self_usage.toml @@ -6,8 +6,8 @@ generics_self_usage.py:76:6 - error: "Self" is not valid in this context (report generics_self_usage.py:82:44 - warning: TypeVar "TFoo2" appears only once in generic function signature   Use "Foo2" instead (reportInvalidTypeVarUse) generics_self_usage.py:82:54 - error: "Self" cannot be used in a function with a `self` or `cls` parameter that has a type annotation other than "Self" (reportGeneralTypeIssues) -generics_self_usage.py:86:16 - error: Expression of type "Foo3" is incompatible with return type "Self@Foo3" -  Type "Foo3" is incompatible with type "Self@Foo3" (reportReturnType) +generics_self_usage.py:86:16 - error: Type "Foo3" is not assignable to return type "Self@Foo3" +  Type "Foo3" is not assignable to type "Self@Foo3" (reportReturnType) generics_self_usage.py:101:15 - error: "Self" is not valid in this context (reportGeneralTypeIssues) generics_self_usage.py:103:12 - error: "Self" is not valid in this context (reportGeneralTypeIssues) generics_self_usage.py:106:30 - error: "Self" is not valid in this context (reportGeneralTypeIssues) diff --git a/conformance/results/pyright/generics_syntax_declarations.toml b/conformance/results/pyright/generics_syntax_declarations.toml index 93995d626..4321bdb36 100644 --- a/conformance/results/pyright/generics_syntax_declarations.toml +++ b/conformance/results/pyright/generics_syntax_declarations.toml @@ -5,7 +5,7 @@ generics_syntax_declarations.py:27:20 - error: Type arguments are not allowed wi generics_syntax_declarations.py:34:11 - error: Cannot access attribute "is_integer" for class "str*"   Attribute "is_integer" is unknown (reportAttributeAccessIssue) generics_syntax_declarations.py:46:21 - error: TypeVar constraint type cannot be generic (reportGeneralTypeIssues) -generics_syntax_declarations.py:50:17 - error: List expression not allowed in type annotation +generics_syntax_declarations.py:50:17 - error: List expression not allowed in type expression   Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) generics_syntax_declarations.py:50:17 - error: Expected class but received "list[Unknown]" (reportGeneralTypeIssues) generics_syntax_declarations.py:62:17 - error: TypeVar must have at least two constrained types (reportGeneralTypeIssues) diff --git a/conformance/results/pyright/generics_syntax_infer_variance.toml b/conformance/results/pyright/generics_syntax_infer_variance.toml index d8bd2bd94..b23985d59 100644 --- a/conformance/results/pyright/generics_syntax_infer_variance.toml +++ b/conformance/results/pyright/generics_syntax_infer_variance.toml @@ -2,64 +2,60 @@ conformant = "Pass" output = """ generics_syntax_infer_variance.py:15:51 - error: TypeVar cannot be both covariant and contravariant (reportGeneralTypeIssues) generics_syntax_infer_variance.py:17:55 - error: TypeVar cannot be both covariant and contravariant (reportGeneralTypeIssues) -generics_syntax_infer_variance.py:29:35 - error: Expression of type "ShouldBeCovariant1[float]" is incompatible with declared type "ShouldBeCovariant1[int]" -  "ShouldBeCovariant1[float]" is incompatible with "ShouldBeCovariant1[int]" +generics_syntax_infer_variance.py:29:35 - error: Type "ShouldBeCovariant1[float]" is not assignable to declared type "ShouldBeCovariant1[int]" +  "ShouldBeCovariant1[float]" is not assignable to "ShouldBeCovariant1[int]"     Type parameter "T@ShouldBeCovariant1" is covariant, but "float" is not a subtype of "int" -      "float" is incompatible with "int" (reportAssignmentType) -generics_syntax_infer_variance.py:37:35 - error: Expression of type "ShouldBeCovariant2[float]" is incompatible with declared type "ShouldBeCovariant2[int]" -  "ShouldBeCovariant2[float]" is incompatible with "ShouldBeCovariant2[int]" +      "float" is not assignable to "int" (reportAssignmentType) +generics_syntax_infer_variance.py:37:35 - error: Type "ShouldBeCovariant2[float]" is not assignable to declared type "ShouldBeCovariant2[int]" +  "ShouldBeCovariant2[float]" is not assignable to "ShouldBeCovariant2[int]"     Type parameter "T@ShouldBeCovariant2" is covariant, but "float" is not a subtype of "int" -      "float" is incompatible with "int" (reportAssignmentType) -generics_syntax_infer_variance.py:46:35 - error: Expression of type "ShouldBeCovariant3[float]" is incompatible with declared type "ShouldBeCovariant3[int]" -  "ShouldBeCovariant3[float]" is incompatible with "ShouldBeCovariant3[int]" +      "float" is not assignable to "int" (reportAssignmentType) +generics_syntax_infer_variance.py:46:35 - error: Type "ShouldBeCovariant3[float]" is not assignable to declared type "ShouldBeCovariant3[int]" +  "ShouldBeCovariant3[float]" is not assignable to "ShouldBeCovariant3[int]"     Type parameter "T@ShouldBeCovariant3" is covariant, but "float" is not a subtype of "int" -      "float" is incompatible with "int" (reportAssignmentType) -generics_syntax_infer_variance.py:55:34 - error: Expression of type "ShouldBeCovariant4[float]" is incompatible with declared type "ShouldBeCovariant4[int]" -  "ShouldBeCovariant4[float]" is incompatible with "ShouldBeCovariant4[int]" -    Type parameter "T@ShouldBeCovariant4" is covariant, but "float" is not a subtype of "int" -      "float" is incompatible with "int" (reportAssignmentType) -generics_syntax_infer_variance.py:68:34 - error: Expression of type "ShouldBeCovariant5[float]" is incompatible with declared type "ShouldBeCovariant5[int]" -  "ShouldBeCovariant5[float]" is incompatible with "ShouldBeCovariant5[int]" +      "float" is not assignable to "int" (reportAssignmentType) +generics_syntax_infer_variance.py:75:34 - error: Type "ShouldBeCovariant5[float]" is not assignable to declared type "ShouldBeCovariant5[int]" +  "ShouldBeCovariant5[float]" is not assignable to "ShouldBeCovariant5[int]"     Type parameter "T@ShouldBeCovariant5" is covariant, but "float" is not a subtype of "int" -      "float" is incompatible with "int" (reportAssignmentType) -generics_syntax_infer_variance.py:79:34 - error: Expression of type "ShouldBeCovariant6[float]" is incompatible with declared type "ShouldBeCovariant6[int]" -  "ShouldBeCovariant6[float]" is incompatible with "ShouldBeCovariant6[int]" +      "float" is not assignable to "int" (reportAssignmentType) +generics_syntax_infer_variance.py:86:34 - error: Type "ShouldBeCovariant6[float]" is not assignable to declared type "ShouldBeCovariant6[int]" +  "ShouldBeCovariant6[float]" is not assignable to "ShouldBeCovariant6[int]"     Type parameter "T@ShouldBeCovariant6" is covariant, but "float" is not a subtype of "int" -      "float" is incompatible with "int" (reportAssignmentType) -generics_syntax_infer_variance.py:95:38 - error: Expression of type "ShouldBeInvariant1[int]" is incompatible with declared type "ShouldBeInvariant1[float]" -  "ShouldBeInvariant1[int]" is incompatible with "ShouldBeInvariant1[float]" +      "float" is not assignable to "int" (reportAssignmentType) +generics_syntax_infer_variance.py:102:38 - error: Type "ShouldBeInvariant1[int]" is not assignable to declared type "ShouldBeInvariant1[float]" +  "ShouldBeInvariant1[int]" is not assignable to "ShouldBeInvariant1[float]"     Type parameter "T@ShouldBeInvariant1" is invariant, but "int" is not the same as "float" (reportAssignmentType) -generics_syntax_infer_variance.py:96:36 - error: Expression of type "ShouldBeInvariant1[float]" is incompatible with declared type "ShouldBeInvariant1[int]" -  "ShouldBeInvariant1[float]" is incompatible with "ShouldBeInvariant1[int]" +generics_syntax_infer_variance.py:103:36 - error: Type "ShouldBeInvariant1[float]" is not assignable to declared type "ShouldBeInvariant1[int]" +  "ShouldBeInvariant1[float]" is not assignable to "ShouldBeInvariant1[int]"     Type parameter "T@ShouldBeInvariant1" is invariant, but "float" is not the same as "int" (reportAssignmentType) -generics_syntax_infer_variance.py:110:38 - error: Expression of type "ShouldBeInvariant2[int]" is incompatible with declared type "ShouldBeInvariant2[float]" -  "ShouldBeInvariant2[int]" is incompatible with "ShouldBeInvariant2[float]" +generics_syntax_infer_variance.py:117:38 - error: Type "ShouldBeInvariant2[int]" is not assignable to declared type "ShouldBeInvariant2[float]" +  "ShouldBeInvariant2[int]" is not assignable to "ShouldBeInvariant2[float]"     Type parameter "T@ShouldBeInvariant2" is invariant, but "int" is not the same as "float" (reportAssignmentType) -generics_syntax_infer_variance.py:111:36 - error: Expression of type "ShouldBeInvariant2[float]" is incompatible with declared type "ShouldBeInvariant2[int]" -  "ShouldBeInvariant2[float]" is incompatible with "ShouldBeInvariant2[int]" +generics_syntax_infer_variance.py:118:36 - error: Type "ShouldBeInvariant2[float]" is not assignable to declared type "ShouldBeInvariant2[int]" +  "ShouldBeInvariant2[float]" is not assignable to "ShouldBeInvariant2[int]"     Type parameter "T@ShouldBeInvariant2" is invariant, but "float" is not the same as "int" (reportAssignmentType) -generics_syntax_infer_variance.py:118:43 - error: Expression of type "ShouldBeInvariant3[int, str]" is incompatible with declared type "ShouldBeInvariant3[float, str]" -  "ShouldBeInvariant3[int, str]" is incompatible with "ShouldBeInvariant3[float, str]" +generics_syntax_infer_variance.py:125:43 - error: Type "ShouldBeInvariant3[int, str]" is not assignable to declared type "ShouldBeInvariant3[float, str]" +  "ShouldBeInvariant3[int, str]" is not assignable to "ShouldBeInvariant3[float, str]"     Type parameter "K@ShouldBeInvariant3" is invariant, but "int" is not the same as "float" (reportAssignmentType) -generics_syntax_infer_variance.py:119:41 - error: Expression of type "ShouldBeInvariant3[float, str]" is incompatible with declared type "ShouldBeInvariant3[int, str]" -  "ShouldBeInvariant3[float, str]" is incompatible with "ShouldBeInvariant3[int, str]" +generics_syntax_infer_variance.py:126:41 - error: Type "ShouldBeInvariant3[float, str]" is not assignable to declared type "ShouldBeInvariant3[int, str]" +  "ShouldBeInvariant3[float, str]" is not assignable to "ShouldBeInvariant3[int, str]"     Type parameter "K@ShouldBeInvariant3" is invariant, but "float" is not the same as "int" (reportAssignmentType) -generics_syntax_infer_variance.py:120:43 - error: Expression of type "ShouldBeInvariant3[str, int]" is incompatible with declared type "ShouldBeInvariant3[str, float]" -  "ShouldBeInvariant3[str, int]" is incompatible with "ShouldBeInvariant3[str, float]" +generics_syntax_infer_variance.py:127:43 - error: Type "ShouldBeInvariant3[str, int]" is not assignable to declared type "ShouldBeInvariant3[str, float]" +  "ShouldBeInvariant3[str, int]" is not assignable to "ShouldBeInvariant3[str, float]"     Type parameter "V@ShouldBeInvariant3" is invariant, but "int" is not the same as "float" (reportAssignmentType) -generics_syntax_infer_variance.py:121:41 - error: Expression of type "ShouldBeInvariant3[str, float]" is incompatible with declared type "ShouldBeInvariant3[str, int]" -  "ShouldBeInvariant3[str, float]" is incompatible with "ShouldBeInvariant3[str, int]" +generics_syntax_infer_variance.py:128:41 - error: Type "ShouldBeInvariant3[str, float]" is not assignable to declared type "ShouldBeInvariant3[str, int]" +  "ShouldBeInvariant3[str, float]" is not assignable to "ShouldBeInvariant3[str, int]"     Type parameter "V@ShouldBeInvariant3" is invariant, but "float" is not the same as "int" (reportAssignmentType) -generics_syntax_infer_variance.py:129:38 - error: Expression of type "ShouldBeInvariant4[int]" is incompatible with declared type "ShouldBeInvariant4[float]" -  "ShouldBeInvariant4[int]" is incompatible with "ShouldBeInvariant4[float]" +generics_syntax_infer_variance.py:136:38 - error: Type "ShouldBeInvariant4[int]" is not assignable to declared type "ShouldBeInvariant4[float]" +  "ShouldBeInvariant4[int]" is not assignable to "ShouldBeInvariant4[float]"     Type parameter "T@ShouldBeInvariant4" is invariant, but "int" is not the same as "float" (reportAssignmentType) -generics_syntax_infer_variance.py:137:38 - error: Expression of type "ShouldBeInvariant5[int]" is incompatible with declared type "ShouldBeInvariant5[float]" -  "ShouldBeInvariant5[int]" is incompatible with "ShouldBeInvariant5[float]" +generics_syntax_infer_variance.py:144:38 - error: Type "ShouldBeInvariant5[int]" is not assignable to declared type "ShouldBeInvariant5[float]" +  "ShouldBeInvariant5[int]" is not assignable to "ShouldBeInvariant5[float]"     Type parameter "T@ShouldBeInvariant5" is invariant, but "int" is not the same as "float" (reportAssignmentType) -generics_syntax_infer_variance.py:148:45 - error: Expression of type "ShouldBeContravariant1[int]" is incompatible with declared type "ShouldBeContravariant1[float]" -  "ShouldBeContravariant1[int]" is incompatible with "ShouldBeContravariant1[float]" +generics_syntax_infer_variance.py:155:45 - error: Type "ShouldBeContravariant1[int]" is not assignable to declared type "ShouldBeContravariant1[float]" +  "ShouldBeContravariant1[int]" is not assignable to "ShouldBeContravariant1[float]"     Type parameter "T@ShouldBeContravariant1" is contravariant, but "int" is not a supertype of "float" -      "float" is incompatible with "int" (reportAssignmentType) +      "float" is not assignable to "int" (reportAssignmentType) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/generics_type_erasure.toml b/conformance/results/pyright/generics_type_erasure.toml index caf122a4e..cbbc0d1c6 100644 --- a/conformance/results/pyright/generics_type_erasure.toml +++ b/conformance/results/pyright/generics_type_erasure.toml @@ -1,13 +1,13 @@ conformant = "Pass" output = """ generics_type_erasure.py:38:16 - error: Argument of type "Literal['']" cannot be assigned to parameter "label" of type "int | None" in function "__init__" -  Type "Literal['']" is incompatible with type "int | None" -    "Literal['']" is incompatible with "int" -    "Literal['']" is incompatible with "None" (reportArgumentType) +  Type "Literal['']" is not assignable to type "int | None" +    "Literal['']" is not assignable to "int" +    "Literal['']" is not assignable to "None" (reportArgumentType) generics_type_erasure.py:40:16 - error: Argument of type "Literal[0]" cannot be assigned to parameter "label" of type "str | None" in function "__init__" -  Type "Literal[0]" is incompatible with type "str | None" -    "Literal[0]" is incompatible with "str" -    "Literal[0]" is incompatible with "None" (reportArgumentType) +  Type "Literal[0]" is not assignable to type "str | None" +    "Literal[0]" is not assignable to "str" +    "Literal[0]" is not assignable to "None" (reportArgumentType) generics_type_erasure.py:42:11 - error: Access to generic instance variable through class is ambiguous (reportGeneralTypeIssues) generics_type_erasure.py:43:11 - error: Access to generic instance variable through class is ambiguous (reportGeneralTypeIssues) generics_type_erasure.py:44:6 - error: Access to generic instance variable through class is ambiguous (reportGeneralTypeIssues) diff --git a/conformance/results/pyright/generics_typevartuple_args.toml b/conformance/results/pyright/generics_typevartuple_args.toml index 6e0ee4b27..04a4cc5b5 100644 --- a/conformance/results/pyright/generics_typevartuple_args.toml +++ b/conformance/results/pyright/generics_typevartuple_args.toml @@ -1,22 +1,23 @@ conformant = "Pass" output = """ generics_typevartuple_args.py:33:16 - error: Argument of type "Literal['']" cannot be assigned to parameter of type "Env" in function "exec_le" -  "Literal['']" is incompatible with "Env" (reportArgumentType) +  "Literal['']" is not assignable to "Env" (reportArgumentType) generics_typevartuple_args.py:34:16 - error: Argument of type "Literal['']" cannot be assigned to parameter of type "Env" in function "exec_le" -  "Literal['']" is incompatible with "Env" (reportArgumentType) +  "Literal['']" is not assignable to "Env" (reportArgumentType) generics_typevartuple_args.py:48:10 - error: Argument of type "Literal['2']" cannot be assigned to parameter of type "int" in function "func1" -  "Literal['2']" is incompatible with "int" (reportArgumentType) +  "Literal['2']" is not assignable to "int" (reportArgumentType) generics_typevartuple_args.py:57:10 - error: Argument of type "Literal[1]" cannot be assigned to parameter of type "str" in function "func2" -  "Literal[1]" is incompatible with "str" (reportArgumentType) -generics_typevartuple_args.py:58:1 - error: Argument missing for parameter "args[2]" (reportCallIssue) -generics_typevartuple_args.py:59:1 - error: Argument missing for parameter "args[2]" (reportCallIssue) -generics_typevartuple_args.py:67:1 - error: Argument missing for parameter "args[1]" (reportCallIssue) +  "Literal[1]" is not assignable to "str" (reportArgumentType) +generics_typevartuple_args.py:59:7 - error: Argument of type "Literal['']" cannot be assigned to parameter of type "int" in function "func2" +  "Literal['']" is not assignable to "int" (reportArgumentType) generics_typevartuple_args.py:75:13 - error: Argument of type "tuple[Literal[1], Literal[2]]" cannot be assigned to parameter "args" of type "tuple[*Ts@func4]" in function "func4" -  "tuple[Literal[1], Literal[2]]" is incompatible with "tuple[int]" +  "tuple[Literal[1], Literal[2]]" is not assignable to "tuple[int]"     Tuple size mismatch; expected 1 but received 2 (reportArgumentType) generics_typevartuple_args.py:76:14 - error: Argument of type "tuple[Literal['1']]" cannot be assigned to parameter "args" of type "tuple[*Ts@func4]" in function "func4" -  "Literal['1']" is incompatible with "int" (reportArgumentType) +  "Literal['1']" is not assignable to "int" (reportArgumentType) """ -conformance_automated = "Pass" +conformance_automated = "Fail" errors_diff = """ +Line 58: Expected 1 errors +Line 67: Expected 1 errors """ diff --git a/conformance/results/pyright/generics_typevartuple_basic.toml b/conformance/results/pyright/generics_typevartuple_basic.toml index 03878ccf0..862827ae0 100644 --- a/conformance/results/pyright/generics_typevartuple_basic.toml +++ b/conformance/results/pyright/generics_typevartuple_basic.toml @@ -1,12 +1,12 @@ conformant = "Pass" output = """ generics_typevartuple_basic.py:42:34 - error: Argument of type "Height" cannot be assigned to parameter "shape" of type "tuple[*Shape@Array]" in function "__init__" -  "Height" is incompatible with "tuple[*Shape@Array]" (reportArgumentType) -generics_typevartuple_basic.py:43:35 - error: Expression of type "Array[Batch, Width]" is incompatible with declared type "Array[Batch, Height, Width]" -  "Array[Batch, Width]" is incompatible with "Array[Batch, Height, Width]" +  "Height" is not assignable to "tuple[*Shape@Array]" (reportArgumentType) +generics_typevartuple_basic.py:43:35 - error: Type "Array[Batch, Width]" is not assignable to declared type "Array[Batch, Height, Width]" +  "Array[Batch, Width]" is not assignable to "Array[Batch, Height, Width]"     Type parameter "Shape@Array" is invariant, but "*tuple[Batch, Width]" is not the same as "*tuple[Batch, Height, Width]" (reportAssignmentType) -generics_typevartuple_basic.py:44:41 - error: Expression of type "Array[Time, Batch, Width, Height]" is incompatible with declared type "Array[Time, Batch, Height, Width]" -  "Array[Time, Batch, Width, Height]" is incompatible with "Array[Time, Batch, Height, Width]" +generics_typevartuple_basic.py:44:41 - error: Type "Array[Time, Batch, Width, Height]" is not assignable to declared type "Array[Time, Batch, Height, Width]" +  "Array[Time, Batch, Width, Height]" is not assignable to "Array[Time, Batch, Height, Width]"     Type parameter "Shape@Array" is invariant, but "*tuple[Time, Batch, Width, Height]" is not the same as "*tuple[Time, Batch, Height, Width]" (reportAssignmentType) generics_typevartuple_basic.py:52:22 - error: Expected unpacked TypeVarTuple; use Unpack[Shape] or *Shape (reportInvalidTypeForm) generics_typevartuple_basic.py:53:37 - error: Expected unpacked TypeVarTuple; use Unpack[Shape] or *Shape (reportInvalidTypeForm) @@ -17,15 +17,15 @@ generics_typevartuple_basic.py:66:27 - error: TypeVarTuple cannot have value con generics_typevartuple_basic.py:66:32 - error: TypeVarTuple cannot have value constraints (reportGeneralTypeIssues) generics_typevartuple_basic.py:67:27 - error: "bound" is unknown parameter to TypeVarTuple (reportGeneralTypeIssues) generics_typevartuple_basic.py:89:14 - error: Argument of type "tuple[Literal['0']]" cannot be assigned to parameter "arg2" of type "tuple[*Ts@func2]" in function "func2" -  "Literal['0']" is incompatible with "int" (reportArgumentType) +  "Literal['0']" is not assignable to "int" (reportArgumentType) generics_typevartuple_basic.py:90:15 - error: Argument of type "tuple[Literal[0]]" cannot be assigned to parameter "arg2" of type "tuple[*Ts@func2]" in function "func2" -  "tuple[Literal[0]]" is incompatible with "tuple[int, int]" +  "tuple[Literal[0]]" is not assignable to "tuple[int, int]"     Tuple size mismatch; expected 2 but received 1 (reportArgumentType) generics_typevartuple_basic.py:99:17 - error: Argument of type "Array[Width]" cannot be assigned to parameter "y" of type "Array[*Shape@multiply]" in function "multiply" -  "Array[Width]" is incompatible with "Array[Height]" +  "Array[Width]" is not assignable to "Array[Height]"     Type parameter "Shape@Array" is invariant, but "*tuple[Width]" is not the same as "*tuple[Height]" (reportArgumentType) generics_typevartuple_basic.py:100:17 - error: Argument of type "Array[Height, Width]" cannot be assigned to parameter "y" of type "Array[*Shape@multiply]" in function "multiply" -  "Array[Height, Width]" is incompatible with "Array[Height]" +  "Array[Height, Width]" is not assignable to "Array[Height]"     Type parameter "Shape@Array" is invariant, but "*tuple[Height, Width]" is not the same as "*tuple[Height]" (reportArgumentType) generics_typevartuple_basic.py:106:14 - error: Generic class can have at most one TypeVarTuple type parameter but received multiple ("Ts1", "Ts2") (reportGeneralTypeIssues) generics_typevartuple_basic.py:106:29 - error: Type argument list can have at most one unpacked TypeVarTuple or tuple (reportInvalidTypeForm) diff --git a/conformance/results/pyright/generics_typevartuple_callable.toml b/conformance/results/pyright/generics_typevartuple_callable.toml index 7c22ef0e8..fb569c88c 100644 --- a/conformance/results/pyright/generics_typevartuple_callable.toml +++ b/conformance/results/pyright/generics_typevartuple_callable.toml @@ -1,8 +1,8 @@ conformant = "Pass" output = """ generics_typevartuple_callable.py:26:28 - error: Argument of type "tuple[Literal[''], Literal[0]]" cannot be assigned to parameter "args" of type "tuple[*Ts@__init__]" in function "__init__" -  "Literal['']" is incompatible with "int" -  "Literal[0]" is incompatible with "str" (reportArgumentType) +  "Literal['']" is not assignable to "int" +  "Literal[0]" is not assignable to "str" (reportArgumentType) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/generics_typevartuple_unpack.toml b/conformance/results/pyright/generics_typevartuple_unpack.toml index 22576b797..a6484a5a2 100644 --- a/conformance/results/pyright/generics_typevartuple_unpack.toml +++ b/conformance/results/pyright/generics_typevartuple_unpack.toml @@ -1,7 +1,7 @@ conformant = "Pass" output = """ generics_typevartuple_unpack.py:30:28 - error: Argument of type "Array[Batch]" cannot be assigned to parameter "x" of type "Array[Batch, *tuple[Any, ...], Channels]" in function "process_batch_channels" -  "Array[Batch]" is incompatible with "Array[Batch, *tuple[Any, ...], Channels]" +  "Array[Batch]" is not assignable to "Array[Batch, *tuple[Any, ...], Channels]"     Type parameter "Ts@Array" is invariant, but "*tuple[Batch]" is not the same as "*tuple[Batch, *tuple[Any, ...], Channels]" (reportArgumentType) """ conformance_automated = "Pass" diff --git a/conformance/results/pyright/generics_upper_bound.toml b/conformance/results/pyright/generics_upper_bound.toml index 280be61a7..ed479279f 100644 --- a/conformance/results/pyright/generics_upper_bound.toml +++ b/conformance/results/pyright/generics_upper_bound.toml @@ -2,11 +2,11 @@ conformant = "Pass" output = """ generics_upper_bound.py:24:38 - error: TypeVar bound type cannot be generic (reportGeneralTypeIssues) generics_upper_bound.py:51:8 - error: Argument of type "Literal[3]" cannot be assigned to parameter "x" of type "ST@longer" in function "longer" -  Type "Literal[3]" is incompatible with type "Sized" +  Type "Literal[3]" is not assignable to type "Sized"     "Literal[3]" is incompatible with protocol "Sized"       "__len__" is not present (reportArgumentType) generics_upper_bound.py:51:11 - error: Argument of type "Literal[3]" cannot be assigned to parameter "y" of type "ST@longer" in function "longer" -  Type "Literal[3]" is incompatible with type "Sized" +  Type "Literal[3]" is not assignable to type "Sized"     "Literal[3]" is incompatible with protocol "Sized"       "__len__" is not present (reportArgumentType) generics_upper_bound.py:56:44 - error: TypeVar cannot be both bound and constrained (reportGeneralTypeIssues) diff --git a/conformance/results/pyright/generics_variance_inference.toml b/conformance/results/pyright/generics_variance_inference.toml index e2b3de347..5c0f32e2a 100644 --- a/conformance/results/pyright/generics_variance_inference.toml +++ b/conformance/results/pyright/generics_variance_inference.toml @@ -1,85 +1,88 @@ conformant = "Pass" output = """ -generics_variance_inference.py:24:33 - error: Expression of type "ClassA[float, int, int]" is incompatible with declared type "ClassA[int, int, int]" -  "ClassA[float, int, int]" is incompatible with "ClassA[int, int, int]" +generics_variance_inference.py:24:33 - error: Type "ClassA[float, int, int]" is not assignable to declared type "ClassA[int, int, int]" +  "ClassA[float, int, int]" is not assignable to "ClassA[int, int, int]"     Type parameter "T1@ClassA" is invariant, but "float" is not the same as "int" (reportAssignmentType) -generics_variance_inference.py:25:37 - error: Expression of type "ClassA[float, int, int]" is incompatible with declared type "ClassA[float, float, int]" -  "ClassA[float, int, int]" is incompatible with "ClassA[float, float, int]" +generics_variance_inference.py:25:37 - error: Type "ClassA[float, int, int]" is not assignable to declared type "ClassA[float, float, int]" +  "ClassA[float, int, int]" is not assignable to "ClassA[float, float, int]"     Type parameter "T2@ClassA" is contravariant, but "int" is not a supertype of "float" -      "float" is incompatible with "int" (reportAssignmentType) -generics_variance_inference.py:28:33 - error: Expression of type "ClassA[int, float, float]" is incompatible with declared type "ClassA[int, int, int]" -  "ClassA[int, float, float]" is incompatible with "ClassA[int, int, int]" +      "float" is not assignable to "int" (reportAssignmentType) +generics_variance_inference.py:28:33 - error: Type "ClassA[int, float, float]" is not assignable to declared type "ClassA[int, int, int]" +  "ClassA[int, float, float]" is not assignable to "ClassA[int, int, int]"     Type parameter "T3@ClassA" is covariant, but "float" is not a subtype of "int" -      "float" is incompatible with "int" (reportAssignmentType) -generics_variance_inference.py:41:35 - error: Expression of type "ShouldBeCovariant1[float]" is incompatible with declared type "ShouldBeCovariant1[int]" -  "ShouldBeCovariant1[float]" is incompatible with "ShouldBeCovariant1[int]" +      "float" is not assignable to "int" (reportAssignmentType) +generics_variance_inference.py:41:35 - error: Type "ShouldBeCovariant1[float]" is not assignable to declared type "ShouldBeCovariant1[int]" +  "ShouldBeCovariant1[float]" is not assignable to "ShouldBeCovariant1[int]"     Type parameter "T@ShouldBeCovariant1" is covariant, but "float" is not a subtype of "int" -      "float" is incompatible with "int" (reportAssignmentType) -generics_variance_inference.py:49:35 - error: Expression of type "ShouldBeCovariant2[float]" is incompatible with declared type "ShouldBeCovariant2[int]" -  "ShouldBeCovariant2[float]" is incompatible with "ShouldBeCovariant2[int]" +      "float" is not assignable to "int" (reportAssignmentType) +generics_variance_inference.py:49:35 - error: Type "ShouldBeCovariant2[float]" is not assignable to declared type "ShouldBeCovariant2[int]" +  "ShouldBeCovariant2[float]" is not assignable to "ShouldBeCovariant2[int]"     Type parameter "T@ShouldBeCovariant2" is covariant, but "float" is not a subtype of "int" -      "float" is incompatible with "int" (reportAssignmentType) -generics_variance_inference.py:58:35 - error: Expression of type "ShouldBeCovariant3[float]" is incompatible with declared type "ShouldBeCovariant3[int]" -  "ShouldBeCovariant3[float]" is incompatible with "ShouldBeCovariant3[int]" +      "float" is not assignable to "int" (reportAssignmentType) +generics_variance_inference.py:58:35 - error: Type "ShouldBeCovariant3[float]" is not assignable to declared type "ShouldBeCovariant3[int]" +  "ShouldBeCovariant3[float]" is not assignable to "ShouldBeCovariant3[int]"     Type parameter "T@ShouldBeCovariant3" is covariant, but "float" is not a subtype of "int" -      "float" is incompatible with "int" (reportAssignmentType) -generics_variance_inference.py:67:34 - error: Expression of type "ShouldBeCovariant4[float]" is incompatible with declared type "ShouldBeCovariant4[int]" -  "ShouldBeCovariant4[float]" is incompatible with "ShouldBeCovariant4[int]" -    Type parameter "T@ShouldBeCovariant4" is covariant, but "float" is not a subtype of "int" -      "float" is incompatible with "int" (reportAssignmentType) -generics_variance_inference.py:80:34 - error: Expression of type "ShouldBeCovariant5[float]" is incompatible with declared type "ShouldBeCovariant5[int]" -  "ShouldBeCovariant5[float]" is incompatible with "ShouldBeCovariant5[int]" +      "float" is not assignable to "int" (reportAssignmentType) +generics_variance_inference.py:66:36 - error: Type "ShouldBeCovariant4[int]" is not assignable to declared type "ShouldBeCovariant4[float]" +  "ShouldBeCovariant4[int]" is not assignable to "ShouldBeCovariant4[float]" +    Type parameter "T@ShouldBeCovariant4" is invariant, but "int" is not the same as "float" (reportAssignmentType) +generics_variance_inference.py:67:34 - error: Type "ShouldBeCovariant4[float]" is not assignable to declared type "ShouldBeCovariant4[int]" +  "ShouldBeCovariant4[float]" is not assignable to "ShouldBeCovariant4[int]" +    Type parameter "T@ShouldBeCovariant4" is invariant, but "float" is not the same as "int" (reportAssignmentType) +generics_variance_inference.py:80:34 - error: Type "ShouldBeCovariant5[float]" is not assignable to declared type "ShouldBeCovariant5[int]" +  "ShouldBeCovariant5[float]" is not assignable to "ShouldBeCovariant5[int]"     Type parameter "T@ShouldBeCovariant5" is covariant, but "float" is not a subtype of "int" -      "float" is incompatible with "int" (reportAssignmentType) -generics_variance_inference.py:96:38 - error: Expression of type "ShouldBeInvariant1[int]" is incompatible with declared type "ShouldBeInvariant1[float]" -  "ShouldBeInvariant1[int]" is incompatible with "ShouldBeInvariant1[float]" +      "float" is not assignable to "int" (reportAssignmentType) +generics_variance_inference.py:96:38 - error: Type "ShouldBeInvariant1[int]" is not assignable to declared type "ShouldBeInvariant1[float]" +  "ShouldBeInvariant1[int]" is not assignable to "ShouldBeInvariant1[float]"     Type parameter "T@ShouldBeInvariant1" is invariant, but "int" is not the same as "float" (reportAssignmentType) -generics_variance_inference.py:97:36 - error: Expression of type "ShouldBeInvariant1[float]" is incompatible with declared type "ShouldBeInvariant1[int]" -  "ShouldBeInvariant1[float]" is incompatible with "ShouldBeInvariant1[int]" +generics_variance_inference.py:97:36 - error: Type "ShouldBeInvariant1[float]" is not assignable to declared type "ShouldBeInvariant1[int]" +  "ShouldBeInvariant1[float]" is not assignable to "ShouldBeInvariant1[int]"     Type parameter "T@ShouldBeInvariant1" is invariant, but "float" is not the same as "int" (reportAssignmentType) -generics_variance_inference.py:111:38 - error: Expression of type "ShouldBeInvariant2[int]" is incompatible with declared type "ShouldBeInvariant2[float]" -  "ShouldBeInvariant2[int]" is incompatible with "ShouldBeInvariant2[float]" +generics_variance_inference.py:111:38 - error: Type "ShouldBeInvariant2[int]" is not assignable to declared type "ShouldBeInvariant2[float]" +  "ShouldBeInvariant2[int]" is not assignable to "ShouldBeInvariant2[float]"     Type parameter "T@ShouldBeInvariant2" is invariant, but "int" is not the same as "float" (reportAssignmentType) -generics_variance_inference.py:112:36 - error: Expression of type "ShouldBeInvariant2[float]" is incompatible with declared type "ShouldBeInvariant2[int]" -  "ShouldBeInvariant2[float]" is incompatible with "ShouldBeInvariant2[int]" +generics_variance_inference.py:112:36 - error: Type "ShouldBeInvariant2[float]" is not assignable to declared type "ShouldBeInvariant2[int]" +  "ShouldBeInvariant2[float]" is not assignable to "ShouldBeInvariant2[int]"     Type parameter "T@ShouldBeInvariant2" is invariant, but "float" is not the same as "int" (reportAssignmentType) -generics_variance_inference.py:119:43 - error: Expression of type "ShouldBeInvariant3[int, str]" is incompatible with declared type "ShouldBeInvariant3[float, str]" -  "ShouldBeInvariant3[int, str]" is incompatible with "ShouldBeInvariant3[float, str]" +generics_variance_inference.py:119:43 - error: Type "ShouldBeInvariant3[int, str]" is not assignable to declared type "ShouldBeInvariant3[float, str]" +  "ShouldBeInvariant3[int, str]" is not assignable to "ShouldBeInvariant3[float, str]"     Type parameter "K@ShouldBeInvariant3" is invariant, but "int" is not the same as "float" (reportAssignmentType) -generics_variance_inference.py:120:41 - error: Expression of type "ShouldBeInvariant3[float, str]" is incompatible with declared type "ShouldBeInvariant3[int, str]" -  "ShouldBeInvariant3[float, str]" is incompatible with "ShouldBeInvariant3[int, str]" +generics_variance_inference.py:120:41 - error: Type "ShouldBeInvariant3[float, str]" is not assignable to declared type "ShouldBeInvariant3[int, str]" +  "ShouldBeInvariant3[float, str]" is not assignable to "ShouldBeInvariant3[int, str]"     Type parameter "K@ShouldBeInvariant3" is invariant, but "float" is not the same as "int" (reportAssignmentType) -generics_variance_inference.py:121:43 - error: Expression of type "ShouldBeInvariant3[str, int]" is incompatible with declared type "ShouldBeInvariant3[str, float]" -  "ShouldBeInvariant3[str, int]" is incompatible with "ShouldBeInvariant3[str, float]" +generics_variance_inference.py:121:43 - error: Type "ShouldBeInvariant3[str, int]" is not assignable to declared type "ShouldBeInvariant3[str, float]" +  "ShouldBeInvariant3[str, int]" is not assignable to "ShouldBeInvariant3[str, float]"     Type parameter "V@ShouldBeInvariant3" is invariant, but "int" is not the same as "float" (reportAssignmentType) -generics_variance_inference.py:122:41 - error: Expression of type "ShouldBeInvariant3[str, float]" is incompatible with declared type "ShouldBeInvariant3[str, int]" -  "ShouldBeInvariant3[str, float]" is incompatible with "ShouldBeInvariant3[str, int]" +generics_variance_inference.py:122:41 - error: Type "ShouldBeInvariant3[str, float]" is not assignable to declared type "ShouldBeInvariant3[str, int]" +  "ShouldBeInvariant3[str, float]" is not assignable to "ShouldBeInvariant3[str, int]"     Type parameter "V@ShouldBeInvariant3" is invariant, but "float" is not the same as "int" (reportAssignmentType) -generics_variance_inference.py:130:38 - error: Expression of type "ShouldBeInvariant4[int]" is incompatible with declared type "ShouldBeInvariant4[float]" -  "ShouldBeInvariant4[int]" is incompatible with "ShouldBeInvariant4[float]" +generics_variance_inference.py:130:38 - error: Type "ShouldBeInvariant4[int]" is not assignable to declared type "ShouldBeInvariant4[float]" +  "ShouldBeInvariant4[int]" is not assignable to "ShouldBeInvariant4[float]"     Type parameter "T@ShouldBeInvariant4" is invariant, but "int" is not the same as "float" (reportAssignmentType) -generics_variance_inference.py:138:38 - error: Expression of type "ShouldBeInvariant5[int]" is incompatible with declared type "ShouldBeInvariant5[float]" -  "ShouldBeInvariant5[int]" is incompatible with "ShouldBeInvariant5[float]" +generics_variance_inference.py:138:38 - error: Type "ShouldBeInvariant5[int]" is not assignable to declared type "ShouldBeInvariant5[float]" +  "ShouldBeInvariant5[int]" is not assignable to "ShouldBeInvariant5[float]"     Type parameter "T@ShouldBeInvariant5" is invariant, but "int" is not the same as "float" (reportAssignmentType) -generics_variance_inference.py:149:45 - error: Expression of type "ShouldBeContravariant1[int]" is incompatible with declared type "ShouldBeContravariant1[float]" -  "ShouldBeContravariant1[int]" is incompatible with "ShouldBeContravariant1[float]" +generics_variance_inference.py:149:45 - error: Type "ShouldBeContravariant1[int]" is not assignable to declared type "ShouldBeContravariant1[float]" +  "ShouldBeContravariant1[int]" is not assignable to "ShouldBeContravariant1[float]"     Type parameter "T@ShouldBeContravariant1" is contravariant, but "int" is not a supertype of "float" -      "float" is incompatible with "int" (reportAssignmentType) -generics_variance_inference.py:169:31 - error: Expression of type "ShouldBeInvariant6[float]" is incompatible with declared type "ShouldBeInvariant6[int]" -  "ShouldBeInvariant6[float]" is incompatible with "ShouldBeInvariant6[int]" +      "float" is not assignable to "int" (reportAssignmentType) +generics_variance_inference.py:169:31 - error: Type "ShouldBeInvariant6[float]" is not assignable to declared type "ShouldBeInvariant6[int]" +  "ShouldBeInvariant6[float]" is not assignable to "ShouldBeInvariant6[int]"     Type parameter "T@ShouldBeInvariant6" is invariant, but "float" is not the same as "int" (reportAssignmentType) -generics_variance_inference.py:170:33 - error: Expression of type "ShouldBeInvariant6[int]" is incompatible with declared type "ShouldBeInvariant6[float]" -  "ShouldBeInvariant6[int]" is incompatible with "ShouldBeInvariant6[float]" +generics_variance_inference.py:170:33 - error: Type "ShouldBeInvariant6[int]" is not assignable to declared type "ShouldBeInvariant6[float]" +  "ShouldBeInvariant6[int]" is not assignable to "ShouldBeInvariant6[float]"     Type parameter "T@ShouldBeInvariant6" is invariant, but "int" is not the same as "float" (reportAssignmentType) -generics_variance_inference.py:181:31 - error: Expression of type "ShouldBeCovariant6[float]" is incompatible with declared type "ShouldBeCovariant6[int]" -  "ShouldBeCovariant6[float]" is incompatible with "ShouldBeCovariant6[int]" +generics_variance_inference.py:181:31 - error: Type "ShouldBeCovariant6[float]" is not assignable to declared type "ShouldBeCovariant6[int]" +  "ShouldBeCovariant6[float]" is not assignable to "ShouldBeCovariant6[int]"     Type parameter "T@ShouldBeCovariant6" is covariant, but "float" is not a subtype of "int" -      "float" is incompatible with "int" (reportAssignmentType) -generics_variance_inference.py:194:37 - error: Expression of type "ShouldBeContravariant2[int]" is incompatible with declared type "ShouldBeContravariant2[float]" -  "ShouldBeContravariant2[int]" is incompatible with "ShouldBeContravariant2[float]" +      "float" is not assignable to "int" (reportAssignmentType) +generics_variance_inference.py:194:37 - error: Type "ShouldBeContravariant2[int]" is not assignable to declared type "ShouldBeContravariant2[float]" +  "ShouldBeContravariant2[int]" is not assignable to "ShouldBeContravariant2[float]"     Type parameter "T@ShouldBeContravariant2" is contravariant, but "int" is not a supertype of "float" -      "float" is incompatible with "int" (reportAssignmentType) +      "float" is not assignable to "int" (reportAssignmentType) """ -conformance_automated = "Pass" +conformance_automated = "Fail" errors_diff = """ +Line 66: Unexpected errors ['generics_variance_inference.py:66:36 - error: Type "ShouldBeCovariant4[int]" is not assignable to declared type "ShouldBeCovariant4[float]"'] """ diff --git a/conformance/results/pyright/literals_literalstring.toml b/conformance/results/pyright/literals_literalstring.toml index 7c1778def..2146bdb47 100644 --- a/conformance/results/pyright/literals_literalstring.toml +++ b/conformance/results/pyright/literals_literalstring.toml @@ -2,22 +2,22 @@ conformant = "Pass" output = """ literals_literalstring.py:36:29 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) literals_literalstring.py:37:22 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) -literals_literalstring.py:43:23 - error: Expression of type "Literal['two']" is incompatible with declared type "Literal['']" -  "Literal['two']" is incompatible with type "Literal['']" (reportAssignmentType) -literals_literalstring.py:66:25 - error: Expression of type "str" is incompatible with declared type "LiteralString" -  "str" is incompatible with "LiteralString" (reportAssignmentType) -literals_literalstring.py:74:25 - error: Expression of type "Literal[3]" is incompatible with declared type "LiteralString" -  "Literal[3]" is incompatible with "LiteralString" (reportAssignmentType) -literals_literalstring.py:75:25 - error: Expression of type "Literal[b"test"]" is incompatible with declared type "LiteralString" -  "Literal[b"test"]" is incompatible with "LiteralString" (reportAssignmentType) +literals_literalstring.py:43:23 - error: Type "Literal['two']" is not assignable to declared type "Literal['']" +  "Literal['two']" is not assignable to type "Literal['']" (reportAssignmentType) +literals_literalstring.py:66:25 - error: Type "str" is not assignable to declared type "LiteralString" +  "str" is not assignable to "LiteralString" (reportAssignmentType) +literals_literalstring.py:74:25 - error: Type "Literal[3]" is not assignable to declared type "LiteralString" +  "Literal[3]" is not assignable to "LiteralString" (reportAssignmentType) +literals_literalstring.py:75:25 - error: Type "Literal[b"test"]" is not assignable to declared type "LiteralString" +  "Literal[b"test"]" is not assignable to "LiteralString" (reportAssignmentType) literals_literalstring.py:120:22 - error: Argument of type "str" cannot be assigned to parameter "s" of type "TLiteral@literal_identity" in function "literal_identity" -  Type "str" is incompatible with type "LiteralString" -    "str" is incompatible with "LiteralString" (reportArgumentType) +  Type "str" is not assignable to type "LiteralString" +    "str" is not assignable to "LiteralString" (reportArgumentType) literals_literalstring.py:134:51 - error: Argument of type "str" cannot be assigned to parameter "value" of type "T@Container" in function "__init__" -  Type "str" is incompatible with type "LiteralString" -    "str" is incompatible with "LiteralString" (reportArgumentType) -literals_literalstring.py:171:21 - error: Expression of type "list[LiteralString]" is incompatible with declared type "list[str]" -  "list[LiteralString]" is incompatible with "list[str]" +  Type "str" is not assignable to type "LiteralString" +    "str" is not assignable to "LiteralString" (reportArgumentType) +literals_literalstring.py:171:21 - error: Type "list[LiteralString]" is not assignable to declared type "list[str]" +  "list[LiteralString]" is not assignable to "list[str]"     Type parameter "_T@list" is invariant, but "LiteralString" is not the same as "str"     Consider switching from "list" to "Sequence" which is covariant (reportAssignmentType) """ diff --git a/conformance/results/pyright/literals_parameterizations.toml b/conformance/results/pyright/literals_parameterizations.toml index 16811ca13..bad4ec5e3 100644 --- a/conformance/results/pyright/literals_parameterizations.toml +++ b/conformance/results/pyright/literals_parameterizations.toml @@ -1,31 +1,31 @@ conformant = "Pass" output = """ -literals_parameterizations.py:41:15 - error: Binary operator not allowed in type annotation (reportInvalidTypeForm) +literals_parameterizations.py:41:15 - error: Binary operator not allowed in type expression (reportInvalidTypeForm) literals_parameterizations.py:41:15 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) literals_parameterizations.py:42:15 - error: Call expression not allowed in type expression (reportInvalidTypeForm) literals_parameterizations.py:42:15 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) -literals_parameterizations.py:43:15 - error: Binary operator not allowed in type annotation (reportInvalidTypeForm) +literals_parameterizations.py:43:15 - error: Binary operator not allowed in type expression (reportInvalidTypeForm) literals_parameterizations.py:43:15 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) -literals_parameterizations.py:44:15 - error: Unary operator not allowed in type annotation (reportInvalidTypeForm) +literals_parameterizations.py:44:15 - error: Unary operator not allowed in type expression (reportInvalidTypeForm) literals_parameterizations.py:44:15 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) -literals_parameterizations.py:45:15 - error: Unary operator not allowed in type annotation (reportInvalidTypeForm) +literals_parameterizations.py:45:15 - error: Unary operator not allowed in type expression (reportInvalidTypeForm) literals_parameterizations.py:45:15 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) literals_parameterizations.py:46:15 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) literals_parameterizations.py:47:15 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) literals_parameterizations.py:48:15 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) literals_parameterizations.py:49:15 - error: Variable not allowed in type expression (reportInvalidTypeForm) literals_parameterizations.py:49:15 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) -literals_parameterizations.py:50:16 - error: Type variable "T" has no meaning in this context (reportGeneralTypeIssues) literals_parameterizations.py:50:16 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) literals_parameterizations.py:51:16 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) literals_parameterizations.py:52:16 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) +literals_parameterizations.py:53:16 - error: "..." is not allowed in this context (reportInvalidTypeForm) literals_parameterizations.py:53:16 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) -literals_parameterizations.py:56:28 - error: Binary operator not allowed in type annotation (reportInvalidTypeForm) +literals_parameterizations.py:56:28 - error: Binary operator not allowed in type expression (reportInvalidTypeForm) literals_parameterizations.py:56:28 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) literals_parameterizations.py:60:4 - error: "Literal" cannot be used in this context without a type argument (reportInvalidTypeForm) literals_parameterizations.py:61:12 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) -literals_parameterizations.py:65:32 - error: Expression of type "Literal[Color.RED]" is incompatible with declared type "Literal['Color.RED']" -  "Literal[Color.RED]" is incompatible with type "Literal['Color.RED']" (reportAssignmentType) +literals_parameterizations.py:65:32 - error: Type "Literal[Color.RED]" is not assignable to declared type "Literal['Color.RED']" +  "Literal[Color.RED]" is not assignable to "Literal['Color.RED']" (reportAssignmentType) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/literals_semantics.toml b/conformance/results/pyright/literals_semantics.toml index 2606d3f0e..7d8b8af5f 100644 --- a/conformance/results/pyright/literals_semantics.toml +++ b/conformance/results/pyright/literals_semantics.toml @@ -1,12 +1,17 @@ conformant = "Pass" output = """ -literals_semantics.py:10:18 - error: Expression of type "Literal[4]" is incompatible with declared type "Literal[3]" -  "Literal[4]" is incompatible with type "Literal[3]" (reportAssignmentType) -literals_semantics.py:24:26 - error: Expression of type "Literal[0]" is incompatible with declared type "Literal[False]" -  "Literal[0]" is incompatible with type "Literal[False]" (reportAssignmentType) -literals_semantics.py:25:22 - error: Expression of type "Literal[False]" is incompatible with declared type "Literal[0]" -  "Literal[False]" is incompatible with type "Literal[0]" (reportAssignmentType) -literals_semantics.py:33:10 - error: Expression of type "Literal[6, 7, 8]" is incompatible with declared type "Literal[3, 4, 5]" (reportAssignmentType) +literals_semantics.py:10:18 - error: Type "Literal[4]" is not assignable to declared type "Literal[3]" +  "Literal[4]" is not assignable to type "Literal[3]" (reportAssignmentType) +literals_semantics.py:24:26 - error: Type "Literal[0]" is not assignable to declared type "Literal[False]" +  "Literal[0]" is not assignable to "Literal[False]" (reportAssignmentType) +literals_semantics.py:25:22 - error: Type "Literal[False]" is not assignable to declared type "Literal[0]" +  "Literal[False]" is not assignable to "Literal[0]" (reportAssignmentType) +literals_semantics.py:33:10 - error: Type "Literal[6, 7, 8]" is not assignable to declared type "Literal[3, 4, 5]" +  Type "Literal[6, 7, 8]" is not assignable to type "Literal[3, 4, 5]" +    Type "Literal[6]" is not assignable to type "Literal[3, 4, 5]" +      "Literal[6]" is not assignable to type "Literal[3]" +      "Literal[6]" is not assignable to type "Literal[4]" +      "Literal[6]" is not assignable to type "Literal[5]" (reportAssignmentType) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/namedtuples_define_class.toml b/conformance/results/pyright/namedtuples_define_class.toml index 2da523d93..19f9aadcb 100644 --- a/conformance/results/pyright/namedtuples_define_class.toml +++ b/conformance/results/pyright/namedtuples_define_class.toml @@ -5,15 +5,15 @@ namedtuples_define_class.py:33:7 - error: Index -4 is out of range for type Poin namedtuples_define_class.py:44:6 - error: Argument missing for parameter "y" (reportCallIssue) namedtuples_define_class.py:45:6 - error: Argument missing for parameter "y" (reportCallIssue) namedtuples_define_class.py:46:15 - error: Argument of type "Literal['']" cannot be assigned to parameter "y" of type "int" in function "__new__" -  "Literal['']" is incompatible with "int" (reportArgumentType) +  "Literal['']" is not assignable to "int" (reportArgumentType) namedtuples_define_class.py:47:24 - error: Argument of type "Literal[3]" cannot be assigned to parameter "units" of type "str" in function "__new__" -  "Literal[3]" is incompatible with "str" (reportArgumentType) +  "Literal[3]" is not assignable to "str" (reportArgumentType) namedtuples_define_class.py:48:22 - error: Expected 3 positional arguments (reportCallIssue) namedtuples_define_class.py:49:23 - error: No parameter named "other" (reportCallIssue) namedtuples_define_class.py:59:5 - error: Fields without default values cannot appear after fields with default values (reportGeneralTypeIssues) namedtuples_define_class.py:79:5 - error: Cannot override "x" because parent class "Point" is a named tuple (reportIncompatibleVariableOverride) namedtuples_define_class.py:98:19 - error: Argument of type "float" cannot be assigned to parameter "value" of type "str" in function "__new__" -  "float" is incompatible with "str" (reportArgumentType) +  "float" is not assignable to "str" (reportArgumentType) namedtuples_define_class.py:105:7 - error: Multiple inheritance with NamedTuple is not supported (reportGeneralTypeIssues) """ conformance_automated = "Pass" diff --git a/conformance/results/pyright/namedtuples_define_functional.toml b/conformance/results/pyright/namedtuples_define_functional.toml index c76f18e84..07c432045 100644 --- a/conformance/results/pyright/namedtuples_define_functional.toml +++ b/conformance/results/pyright/namedtuples_define_functional.toml @@ -6,12 +6,12 @@ namedtuples_define_functional.py:26:21 - error: Expected 2 positional arguments namedtuples_define_functional.py:31:8 - error: Argument missing for parameter "y" (reportCallIssue) namedtuples_define_functional.py:31:18 - error: No parameter named "z" (reportCallIssue) namedtuples_define_functional.py:36:18 - error: Argument of type "Literal['1']" cannot be assigned to parameter "y" of type "int" in function "__new__" -  "Literal['1']" is incompatible with "int" (reportArgumentType) +  "Literal['1']" is not assignable to "int" (reportArgumentType) namedtuples_define_functional.py:37:21 - error: Expected 2 positional arguments (reportCallIssue) namedtuples_define_functional.py:42:18 - error: Argument of type "Literal['1']" cannot be assigned to parameter "y" of type "int" in function "__new__" -  "Literal['1']" is incompatible with "int" (reportArgumentType) +  "Literal['1']" is not assignable to "int" (reportArgumentType) namedtuples_define_functional.py:43:17 - error: Argument of type "float" cannot be assigned to parameter "x" of type "int" in function "__new__" -  "float" is incompatible with "int" (reportArgumentType) +  "float" is not assignable to "int" (reportArgumentType) namedtuples_define_functional.py:52:31 - error: Names within a named tuple must be unique (reportGeneralTypeIssues) namedtuples_define_functional.py:53:33 - error: Field names cannot be a keyword (reportGeneralTypeIssues) namedtuples_define_functional.py:54:33 - error: Field names cannot be a keyword (reportGeneralTypeIssues) diff --git a/conformance/results/pyright/namedtuples_type_compat.toml b/conformance/results/pyright/namedtuples_type_compat.toml index aa8f69e63..c31192fc8 100644 --- a/conformance/results/pyright/namedtuples_type_compat.toml +++ b/conformance/results/pyright/namedtuples_type_compat.toml @@ -1,12 +1,12 @@ conformant = "Pass" output = """ -namedtuples_type_compat.py:22:23 - error: Expression of type "Point" is incompatible with declared type "tuple[int, int]" -  "Point" is incompatible with "tuple[int, int]" +namedtuples_type_compat.py:22:23 - error: Type "Point" is not assignable to declared type "tuple[int, int]" +  "Point" is not assignable to "tuple[int, int]"     Tuple size mismatch; expected 2 but received 3 (reportAssignmentType) -namedtuples_type_compat.py:23:28 - error: Expression of type "Point" is incompatible with declared type "tuple[int, str, str]" -  "Point" is incompatible with "tuple[int, str, str]" +namedtuples_type_compat.py:23:28 - error: Type "Point" is not assignable to declared type "tuple[int, str, str]" +  "Point" is not assignable to "tuple[int, str, str]"     Tuple entry 2 is incorrect type -      "int" is incompatible with "str" (reportAssignmentType) +      "int" is not assignable to "str" (reportAssignmentType) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/namedtuples_usage.toml b/conformance/results/pyright/namedtuples_usage.toml index 693e8c389..76f53162e 100644 --- a/conformance/results/pyright/namedtuples_usage.toml +++ b/conformance/results/pyright/namedtuples_usage.toml @@ -3,12 +3,10 @@ output = """ namedtuples_usage.py:34:7 - error: Index 3 is out of range for type Point (reportGeneralTypeIssues) namedtuples_usage.py:35:7 - error: Index -4 is out of range for type Point (reportGeneralTypeIssues) namedtuples_usage.py:40:3 - error: Cannot assign to attribute "x" for class "Point" -  Attribute "x" is read-only -    Attribute "__set__" is unknown (reportAttributeAccessIssue) +  Attribute "x" is read-only (reportAttributeAccessIssue) namedtuples_usage.py:41:1 - error: "__setitem__" method not defined on type "Point" (reportIndexIssue) namedtuples_usage.py:42:7 - error: Cannot delete attribute "x" for class "Point" -  Attribute "x" is read-only -    Attribute "__delete__" is unknown (reportAttributeAccessIssue) +  Attribute "x" is read-only (reportAttributeAccessIssue) namedtuples_usage.py:43:5 - error: "__delitem__" method not defined on type "Point" (reportIndexIssue) namedtuples_usage.py:52:1 - error: Expression with type "Point" cannot be assigned to target tuple   Type "Point" is incompatible with target tuple diff --git a/conformance/results/pyright/narrowing_typeguard.toml b/conformance/results/pyright/narrowing_typeguard.toml index ecab95858..a363ec8f3 100644 --- a/conformance/results/pyright/narrowing_typeguard.toml +++ b/conformance/results/pyright/narrowing_typeguard.toml @@ -3,15 +3,15 @@ output = """ narrowing_typeguard.py:102:9 - error: User-defined type guard functions and methods must have at least one input parameter (reportGeneralTypeIssues) narrowing_typeguard.py:107:9 - error: User-defined type guard functions and methods must have at least one input parameter (reportGeneralTypeIssues) narrowing_typeguard.py:128:20 - error: Argument of type "(val: object) -> TypeGuard[int]" cannot be assigned to parameter "f" of type "(object) -> str" in function "takes_callable_str" -  Type "(val: object) -> TypeGuard[int]" is incompatible with type "(object) -> str" +  Type "(val: object) -> TypeGuard[int]" is not assignable to type "(object) -> str"     Function return type "TypeGuard[int]" is incompatible with type "str" -      "TypeGuard[int]" is incompatible with "str" -      "bool" is incompatible with "str" (reportArgumentType) +      "TypeGuard[int]" is not assignable to "str" +      "bool" is not assignable to "str" (reportArgumentType) narrowing_typeguard.py:148:26 - error: Argument of type "(val: object) -> TypeGuard[int]" cannot be assigned to parameter "f" of type "CallableStrProto" in function "takes_callable_str_proto" -  Type "(val: object) -> TypeGuard[int]" is incompatible with type "(val: object) -> str" +  Type "(val: object) -> TypeGuard[int]" is not assignable to type "(val: object) -> str"     Function return type "TypeGuard[int]" is incompatible with type "str" -      "TypeGuard[int]" is incompatible with "str" -      "bool" is incompatible with "str" (reportArgumentType) +      "TypeGuard[int]" is not assignable to "str" +      "bool" is not assignable to "str" (reportArgumentType) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/narrowing_typeis.toml b/conformance/results/pyright/narrowing_typeis.toml index 731a636e8..ca6a42a9e 100644 --- a/conformance/results/pyright/narrowing_typeis.toml +++ b/conformance/results/pyright/narrowing_typeis.toml @@ -6,31 +6,31 @@ output = """ narrowing_typeis.py:105:9 - error: User-defined type guard functions and methods must have at least one input parameter (reportGeneralTypeIssues) narrowing_typeis.py:110:9 - error: User-defined type guard functions and methods must have at least one input parameter (reportGeneralTypeIssues) narrowing_typeis.py:132:20 - error: Argument of type "(val: object) -> TypeIs[int]" cannot be assigned to parameter "f" of type "(object) -> str" in function "takes_callable_str" -  Type "(val: object) -> TypeIs[int]" is incompatible with type "(object) -> str" +  Type "(val: object) -> TypeIs[int]" is not assignable to type "(object) -> str"     Function return type "TypeIs[int]" is incompatible with type "str" -      "TypeIs[int]" is incompatible with "str" -      "bool" is incompatible with "str" (reportArgumentType) +      "TypeIs[int]" is not assignable to "str" +      "bool" is not assignable to "str" (reportArgumentType) narrowing_typeis.py:152:26 - error: Argument of type "(val: object) -> TypeIs[int]" cannot be assigned to parameter "f" of type "CallableStrProto" in function "takes_callable_str_proto" -  Type "(val: object) -> TypeIs[int]" is incompatible with type "(val: object) -> str" +  Type "(val: object) -> TypeIs[int]" is not assignable to type "(val: object) -> str"     Function return type "TypeIs[int]" is incompatible with type "str" -      "TypeIs[int]" is incompatible with "str" -      "bool" is incompatible with "str" (reportArgumentType) +      "TypeIs[int]" is not assignable to "str" +      "bool" is not assignable to "str" (reportArgumentType) narrowing_typeis.py:169:17 - error: Argument of type "(val: object) -> TypeIs[int]" cannot be assigned to parameter "f" of type "(object) -> TypeGuard[int]" in function "takes_typeguard" -  Type "(val: object) -> TypeIs[int]" is incompatible with type "(object) -> TypeGuard[int]" +  Type "(val: object) -> TypeIs[int]" is not assignable to type "(object) -> TypeGuard[int]"     Function return type "TypeIs[int]" is incompatible with type "TypeGuard[int]" -      "TypeIs[int]" is incompatible with "TypeGuard[int]" -      "bool" is incompatible with "TypeGuard[int]" (reportArgumentType) +      "TypeIs[int]" is not assignable to "TypeGuard[int]" +      "bool" is not assignable to "TypeGuard[int]" (reportArgumentType) narrowing_typeis.py:170:14 - error: Argument of type "(val: object) -> TypeGuard[int]" cannot be assigned to parameter "f" of type "(object) -> TypeIs[int]" in function "takes_typeis" -  Type "(val: object) -> TypeGuard[int]" is incompatible with type "(object) -> TypeIs[int]" +  Type "(val: object) -> TypeGuard[int]" is not assignable to type "(object) -> TypeIs[int]"     Function return type "TypeGuard[int]" is incompatible with type "TypeIs[int]" -      "TypeGuard[int]" is incompatible with "TypeIs[int]" -      "bool" is incompatible with "TypeIs[int]" (reportArgumentType) +      "TypeGuard[int]" is not assignable to "TypeIs[int]" +      "bool" is not assignable to "TypeIs[int]" (reportArgumentType) narrowing_typeis.py:191:18 - error: Argument of type "(val: object) -> TypeIs[bool]" cannot be assigned to parameter "f" of type "(object) -> TypeIs[int]" in function "takes_int_typeis" -  Type "(val: object) -> TypeIs[bool]" is incompatible with type "(object) -> TypeIs[int]" +  Type "(val: object) -> TypeIs[bool]" is not assignable to type "(object) -> TypeIs[int]"     Function return type "TypeIs[bool]" is incompatible with type "TypeIs[int]" -      "TypeIs[bool]" is incompatible with "TypeIs[int]" +      "TypeIs[bool]" is not assignable to "TypeIs[int]"         Type parameter "T@TypeIs" is invariant, but "bool" is not the same as "int" -      "bool" is incompatible with "TypeIs[int]" (reportArgumentType) +      "bool" is not assignable to "TypeIs[int]" (reportArgumentType) narrowing_typeis.py:195:27 - error: Return type of TypeIs ("str") is not consistent with value parameter type ("int") (reportGeneralTypeIssues) narrowing_typeis.py:199:45 - error: Return type of TypeIs ("list[int]") is not consistent with value parameter type ("list[object]") (reportGeneralTypeIssues) """ diff --git a/conformance/results/pyright/overloads_basic.toml b/conformance/results/pyright/overloads_basic.toml index a4f03e2f5..b4148bcc8 100644 --- a/conformance/results/pyright/overloads_basic.toml +++ b/conformance/results/pyright/overloads_basic.toml @@ -2,7 +2,7 @@ conformant = "Pass" output = """ overloads_basic.py:37:1 - error: No overloads for "__getitem__" match the provided arguments (reportCallIssue) overloads_basic.py:37:1 - error: Argument of type "Literal['']" cannot be assigned to parameter "__s" of type "slice" in function "__getitem__" -  "Literal['']" is incompatible with "slice" (reportArgumentType) +  "Literal['']" is not assignable to "slice" (reportArgumentType) overloads_basic.py:63:5 - error: "func1" is marked as overload, but additional overloads are missing (reportInconsistentOverload) overloads_basic.py:75:5 - error: "func2" is marked as overload, but no implementation is provided (reportNoOverloadImplementation) """ diff --git a/conformance/results/pyright/protocols_class_objects.toml b/conformance/results/pyright/protocols_class_objects.toml index 47e31dabf..2c3bfe0f6 100644 --- a/conformance/results/pyright/protocols_class_objects.toml +++ b/conformance/results/pyright/protocols_class_objects.toml @@ -2,27 +2,27 @@ conformant = "Pass" output = """ protocols_class_objects.py:29:5 - error: Argument of type "type[Proto]" cannot be assigned to parameter "cls" of type "type[Proto]" in function "fun"   "Proto" is not a concrete class type and cannot be assigned to type "type[Proto]" (reportArgumentType) -protocols_class_objects.py:34:7 - error: Expression of type "type[Proto]" is incompatible with declared type "type[Proto]" +protocols_class_objects.py:34:7 - error: Type "type[Proto]" is not assignable to declared type "type[Proto]"   "Proto" is not a concrete class type and cannot be assigned to type "type[Proto]" (reportAssignmentType) -protocols_class_objects.py:58:16 - error: Expression of type "type[ConcreteA]" is incompatible with declared type "ProtoA1" -  "type[type]" is incompatible with "type[ConcreteA]" -  "type[type]" is incompatible with "type[ConcreteA]" +protocols_class_objects.py:58:16 - error: Type "type[ConcreteA]" is not assignable to declared type "ProtoA1" +  "type[type]" is not assignable to "type[ConcreteA]" +  "type[type]" is not assignable to "type[ConcreteA]"   "method1" is an incompatible type -    Type "(self: ConcreteA, x: int) -> int" is incompatible with type "(x: int) -> int" +    Type "(self: ConcreteA, x: int) -> int" is not assignable to type "(x: int) -> int"       Parameter name mismatch: "x" versus "self"       Parameter 1: type "int" is incompatible with type "ConcreteA" -        "int" is incompatible with "ConcreteA" +        "int" is not assignable to "ConcreteA"       Extra parameter "x" (reportAssignmentType) -protocols_class_objects.py:74:16 - error: Expression of type "type[ConcreteB]" is incompatible with declared type "ProtoB1" +protocols_class_objects.py:74:16 - error: Type "type[ConcreteB]" is not assignable to declared type "ProtoB1"   "prop1" is an incompatible type -    "property" is incompatible with "int" (reportAssignmentType) -protocols_class_objects.py:104:16 - error: Expression of type "type[ConcreteC1]" is incompatible with declared type "ProtoC1" +    "property" is not assignable to "int" (reportAssignmentType) +protocols_class_objects.py:104:16 - error: Type "type[ConcreteC1]" is not assignable to declared type "ProtoC1"   "attr1" is defined as a ClassVar in protocol (reportAssignmentType) -protocols_class_objects.py:106:16 - error: Expression of type "type[ConcreteC2]" is incompatible with declared type "ProtoC1" +protocols_class_objects.py:106:16 - error: Type "type[ConcreteC2]" is not assignable to declared type "ProtoC1"   "attr1" is defined as a ClassVar in protocol (reportAssignmentType) -protocols_class_objects.py:107:16 - error: Expression of type "type[ConcreteC2]" is incompatible with declared type "ProtoC2" +protocols_class_objects.py:107:16 - error: Type "type[ConcreteC2]" is not assignable to declared type "ProtoC2"   "attr1" must be defined as a ClassVar to be compatible with protocol (reportAssignmentType) -protocols_class_objects.py:108:16 - error: Expression of type "type[ConcreteC3]" is incompatible with declared type "ProtoC1" +protocols_class_objects.py:108:16 - error: Type "type[ConcreteC3]" is not assignable to declared type "ProtoC1"   "attr1" is defined as a ClassVar in protocol (reportAssignmentType) """ conformance_automated = "Pass" diff --git a/conformance/results/pyright/protocols_definition.toml b/conformance/results/pyright/protocols_definition.toml index 23536ece6..c27a3753d 100644 --- a/conformance/results/pyright/protocols_definition.toml +++ b/conformance/results/pyright/protocols_definition.toml @@ -4,97 +4,99 @@ protocols_definition.py:30:12 - error: Argument of type "list[int]" cannot be as   "Literal[1]" is incompatible with protocol "SupportsClose"     "close" is not present (reportArgumentType) protocols_definition.py:67:14 - error: Instance or class variables within a Protocol class must be explicitly declared within the class body (reportGeneralTypeIssues) -protocols_definition.py:114:22 - error: Expression of type "Concrete2_Bad1" is incompatible with declared type "Template2" +protocols_definition.py:114:22 - error: Type "Concrete2_Bad1" is not assignable to declared type "Template2"   "Concrete2_Bad1" is incompatible with protocol "Template2"     "val1" is not present (reportAssignmentType) -protocols_definition.py:115:22 - error: Expression of type "Concrete2_Bad2" is incompatible with declared type "Template2" +protocols_definition.py:115:22 - error: Type "Concrete2_Bad2" is not assignable to declared type "Template2"   "Concrete2_Bad2" is incompatible with protocol "Template2"     "val1" is invariant because it is mutable     "val1" is an incompatible type     "val1" is defined as a ClassVar in protocol -      "Sequence[float]" is incompatible with "Sequence[int]" (reportAssignmentType) -protocols_definition.py:116:22 - error: Expression of type "Concrete2_Bad3" is incompatible with declared type "Template2" +      "Sequence[float]" is not assignable to "Sequence[int]" (reportAssignmentType) +protocols_definition.py:116:22 - error: Type "Concrete2_Bad3" is not assignable to declared type "Template2"   "Concrete2_Bad3" is incompatible with protocol "Template2"     "val1" is invariant because it is mutable     "val1" is an incompatible type     "val1" is defined as a ClassVar in protocol -      "list[int]" is incompatible with "Sequence[int]" (reportAssignmentType) -protocols_definition.py:117:22 - error: Expression of type "Concrete2_Bad4" is incompatible with declared type "Template2" +      "list[int]" is not assignable to "Sequence[int]" (reportAssignmentType) +protocols_definition.py:117:22 - error: Type "Concrete2_Bad4" is not assignable to declared type "Template2"   "Concrete2_Bad4" is incompatible with protocol "Template2"     "val1" is defined as a ClassVar in protocol (reportAssignmentType) -protocols_definition.py:156:22 - error: Expression of type "Concrete3_Bad1" is incompatible with declared type "Template3" +protocols_definition.py:156:22 - error: Type "Concrete3_Bad1" is not assignable to declared type "Template3"   "Concrete3_Bad1" is incompatible with protocol "Template3"     "val1" is not present (reportAssignmentType) -protocols_definition.py:157:22 - error: Expression of type "Concrete3_Bad2" is incompatible with declared type "Template3" +protocols_definition.py:157:22 - error: Type "Concrete3_Bad2" is not assignable to declared type "Template3"   "Concrete3_Bad2" is incompatible with protocol "Template3"     "val1" is not defined as a ClassVar in protocol (reportAssignmentType) -protocols_definition.py:158:22 - error: Expression of type "Concrete3_Bad3" is incompatible with declared type "Template3" +protocols_definition.py:158:22 - error: Type "Concrete3_Bad3" is not assignable to declared type "Template3"   "Concrete3_Bad3" is incompatible with protocol "Template3"     "val1" is invariant because it is mutable     "val1" is an incompatible type -      "property" is incompatible with "Sequence[int]" (reportAssignmentType) -protocols_definition.py:159:22 - error: Expression of type "Concrete3_Bad4" is incompatible with declared type "Template3" +      "property" is not assignable to "Sequence[int]" (reportAssignmentType) +protocols_definition.py:159:22 - error: Type "Concrete3_Bad4" is not assignable to declared type "Template3"   "Concrete3_Bad4" is incompatible with protocol "Template3"     "val1" is invariant because it is mutable     "val1" is an incompatible type -      "Sequence[float]" is incompatible with "Sequence[int]" (reportAssignmentType) -protocols_definition.py:160:22 - error: Expression of type "Concrete3_Bad5" is incompatible with declared type "Template3" +      "Sequence[float]" is not assignable to "Sequence[int]" (reportAssignmentType) +protocols_definition.py:160:22 - error: Type "Concrete3_Bad5" is not assignable to declared type "Template3"   "Concrete3_Bad5" is incompatible with protocol "Template3"     "val1" is invariant because it is mutable     "val1" is an incompatible type -      "list[int]" is incompatible with "Sequence[int]" (reportAssignmentType) -protocols_definition.py:218:22 - error: Expression of type "Concrete4_Bad1" is incompatible with declared type "Template4" +      "list[int]" is not assignable to "Sequence[int]" (reportAssignmentType) +protocols_definition.py:218:22 - error: Type "Concrete4_Bad1" is not assignable to declared type "Template4"   "Concrete4_Bad1" is incompatible with protocol "Template4"     "val1" is an incompatible type -      "function" is incompatible with "Sequence[float]" (reportAssignmentType) -protocols_definition.py:219:22 - error: Expression of type "Concrete4_Bad2" is incompatible with declared type "Template4" +      "function" is not assignable to "Sequence[float]" (reportAssignmentType) +protocols_definition.py:219:22 - error: Type "Concrete4_Bad2" is not assignable to declared type "Template4"   "Concrete4_Bad2" is incompatible with protocol "Template4"     "val1" is not present (reportAssignmentType) protocols_definition.py:276:17 - warning: Static methods should not take a "self" or "cls" parameter (reportSelfClsParameterName) -protocols_definition.py:285:22 - error: Expression of type "Concrete5_Bad1" is incompatible with declared type "Template5" +protocols_definition.py:285:22 - error: Type "Concrete5_Bad1" is not assignable to declared type "Template5"   "Concrete5_Bad1" is incompatible with protocol "Template5"     "method1" is an incompatible type -      Type "(a: Unknown, c: Unknown) -> int" is incompatible with type "(a: int, b: int) -> float" +      Type "(a: Unknown, c: Unknown) -> int" is not assignable to type "(a: int, b: int) -> float"         Parameter name mismatch: "b" versus "c" (reportAssignmentType) -protocols_definition.py:286:22 - error: Expression of type "Concrete5_Bad2" is incompatible with declared type "Template5" +protocols_definition.py:286:22 - error: Type "Concrete5_Bad2" is not assignable to declared type "Template5"   "Concrete5_Bad2" is incompatible with protocol "Template5"     "method1" is an incompatible type -      Type "(a: int, c: int) -> int" is incompatible with type "(a: int, b: int) -> float" +      Type "(a: int, c: int) -> int" is not assignable to type "(a: int, b: int) -> float"         Parameter name mismatch: "b" versus "c" (reportAssignmentType) -protocols_definition.py:287:22 - error: Expression of type "Concrete5_Bad3" is incompatible with declared type "Template5" +protocols_definition.py:287:22 - error: Type "Concrete5_Bad3" is not assignable to declared type "Template5"   "Concrete5_Bad3" is incompatible with protocol "Template5"     "method1" is an incompatible type -      Type "(*, a: int, b: int) -> float" is incompatible with type "(a: int, b: int) -> float" +      Type "(*, a: int, b: int) -> float" is not assignable to type "(a: int, b: int) -> float"         Function accepts too many positional parameters; expected 0 but received 2           Extra parameter "a"           Extra parameter "b" (reportAssignmentType) -protocols_definition.py:288:22 - error: Expression of type "Concrete5_Bad4" is incompatible with declared type "Template5" +protocols_definition.py:288:22 - error: Type "Concrete5_Bad4" is not assignable to declared type "Template5"   "Concrete5_Bad4" is incompatible with protocol "Template5"     "method1" is an incompatible type -      Type "(a: int, b: int, /) -> float" is incompatible with type "(a: int, b: int) -> float" +      Type "(a: int, b: int, /) -> float" is not assignable to type "(a: int, b: int) -> float"         Missing keyword parameter "a"         Missing keyword parameter "b"           Position-only parameter mismatch; parameter "a" is not position-only           Position-only parameter mismatch; parameter "b" is not position-only           Position-only parameter mismatch; expected 2 but received 0 (reportAssignmentType) -protocols_definition.py:289:22 - error: Expression of type "Concrete5_Bad5" is incompatible with declared type "Template5" +protocols_definition.py:289:22 - error: Type "Concrete5_Bad5" is not assignable to declared type "Template5"   "Concrete5_Bad5" is incompatible with protocol "Template5"     "method1" is an incompatible type -      Type "(self: Unknown, a: int, b: int) -> float" is incompatible with type "(a: int, b: int) -> float" +      Type "(self: Unknown, a: int, b: int) -> float" is not assignable to type "(a: int, b: int) -> float"         Parameter name mismatch: "a" versus "self"         Parameter name mismatch: "b" versus "a"         Extra parameter "b" (reportAssignmentType) -protocols_definition.py:339:22 - error: Expression of type "Concrete6_Bad1" is incompatible with declared type "Template6" +protocols_definition.py:339:22 - error: Type "Concrete6_Bad1" is not assignable to declared type "Template6"   "Concrete6_Bad1" is incompatible with protocol "Template6"     "val1" is an incompatible type       Property setter method is missing -        "Template6" is incompatible with "Concrete6_Bad1" (reportAssignmentType) -protocols_definition.py:340:22 - error: Expression of type "Concrete6_Bad2" is incompatible with declared type "Template6" +        "Template6" is not assignable to "Concrete6_Bad1" (reportAssignmentType) +protocols_definition.py:340:22 - error: Type "Concrete6_Bad2" is not assignable to declared type "Template6"   "Concrete6_Bad2" is incompatible with protocol "Template6" -    "val1" is writable in protocol (reportAssignmentType) -protocols_definition.py:341:22 - error: Expression of type "Concrete6_Bad3" is incompatible with declared type "Template6" +    "val1" is writable in protocol +    "val1" is not read-only in protocol (reportAssignmentType) +protocols_definition.py:341:22 - error: Type "Concrete6_Bad3" is not assignable to declared type "Template6"   "Concrete6_Bad3" is incompatible with protocol "Template6" -    "val1" is writable in protocol (reportAssignmentType) +    "val1" is writable in protocol +    "val1" is not read-only in protocol (reportAssignmentType) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/protocols_explicit.toml b/conformance/results/pyright/protocols_explicit.toml index 4ee4fca06..cdb926916 100644 --- a/conformance/results/pyright/protocols_explicit.toml +++ b/conformance/results/pyright/protocols_explicit.toml @@ -2,13 +2,12 @@ conformant = "Pass" output = """ protocols_explicit.py:27:16 - error: Method "draw" cannot be called because it is abstract and unimplemented (reportAbstractUsage) protocols_explicit.py:56:32 - error: Cannot assign to attribute "rgb" for class "Point*" -  "str" is incompatible with "int" (reportAttributeAccessIssue) +  "str" is not assignable to "int" (reportAttributeAccessIssue) protocols_explicit.py:60:5 - error: Cannot instantiate abstract class "Point"   "RGB.intensity" is not implemented   "RGB.transparency" is not implemented (reportAbstractUsage) protocols_explicit.py:85:14 - error: Cannot assign to attribute "cm1" for class "Concrete1*" -  Attribute "cm1" cannot be assigned through a class instance because it is a ClassVar -    Attribute "__set__" is unknown (reportAttributeAccessIssue) +  Attribute "cm1" cannot be assigned through a class instance because it is a ClassVar (reportAttributeAccessIssue) protocols_explicit.py:135:6 - error: Cannot instantiate abstract class "Concrete5"   "Proto5.method1" is not implemented (reportAbstractUsage) protocols_explicit.py:165:7 - error: Cannot instantiate abstract class "Concrete7A" diff --git a/conformance/results/pyright/protocols_generic.toml b/conformance/results/pyright/protocols_generic.toml index 6e653d432..d15dd1cea 100644 --- a/conformance/results/pyright/protocols_generic.toml +++ b/conformance/results/pyright/protocols_generic.toml @@ -1,43 +1,61 @@ -conformant = "Pass" +conformant = "Partial" +notes = """ +Incorrectly generates type violation for protocol that uses method-scoped type variables. +""" output = """ -protocols_generic.py:40:24 - error: Expression of type "Concrete1" is incompatible with declared type "Proto1[int, str]" +protocols_generic.py:40:24 - error: Type "Concrete1" is not assignable to declared type "Proto1[int, str]"   "Concrete1" is incompatible with protocol "Proto1[int, str]"     "method1" is an incompatible type -      Type "(x: str) -> str" is incompatible with type "(x: S@Proto1) -> S@Proto1" +      Type "(x: str) -> str" is not assignable to type "(x: S@Proto1) -> S@Proto1"         Parameter 1: type "S@Proto1" is incompatible with type "str" -          "int" is incompatible with "str" +          "int" is not assignable to "str"         Function return type "str" is incompatible with type "S@Proto1" -          Type "int | str" is incompatible with type "int" +          Type "int | str" is not assignable to type "int"     "__iter__" is an incompatible type ... (reportAssignmentType) protocols_generic.py:44:30 - error: Only one Generic[...] or Protocol[...] base class allowed (reportGeneralTypeIssues) -protocols_generic.py:56:20 - error: Expression of type "Box[float]" is incompatible with declared type "Box[int]" -  "Box[float]" is incompatible with "Box[int]" +protocols_generic.py:56:20 - error: Type "Box[float]" is not assignable to declared type "Box[int]" +  "Box[float]" is not assignable to "Box[int]"     Type parameter "T_co@Box" is covariant, but "float" is not a subtype of "int" -      "float" is incompatible with "int" (reportAssignmentType) -protocols_generic.py:66:25 - error: Expression of type "Sender[int]" is incompatible with declared type "Sender[float]" -  "Sender[int]" is incompatible with "Sender[float]" +      "float" is not assignable to "int" (reportAssignmentType) +protocols_generic.py:66:25 - error: Type "Sender[int]" is not assignable to declared type "Sender[float]" +  "Sender[int]" is not assignable to "Sender[float]"     Type parameter "T_contra@Sender" is contravariant, but "int" is not a supertype of "float" -      "float" is incompatible with "int" (reportAssignmentType) -protocols_generic.py:74:28 - error: Expression of type "AttrProto[int]" is incompatible with declared type "AttrProto[float]" -  "AttrProto[int]" is incompatible with "AttrProto[float]" +      "float" is not assignable to "int" (reportAssignmentType) +protocols_generic.py:74:28 - error: Type "AttrProto[int]" is not assignable to declared type "AttrProto[float]" +  "AttrProto[int]" is not assignable to "AttrProto[float]"     Type parameter "T@AttrProto" is invariant, but "int" is not the same as "float" (reportAssignmentType) -protocols_generic.py:75:26 - error: Expression of type "AttrProto[float]" is incompatible with declared type "AttrProto[int]" -  "AttrProto[float]" is incompatible with "AttrProto[int]" +protocols_generic.py:75:26 - error: Type "AttrProto[float]" is not assignable to declared type "AttrProto[int]" +  "AttrProto[float]" is not assignable to "AttrProto[int]"     Type parameter "T@AttrProto" is invariant, but "float" is not the same as "int" (reportAssignmentType) -protocols_generic.py:146:25 - error: Expression of type "ConcreteHasProperty3" is incompatible with declared type "HasPropertyProto" +protocols_generic.py:145:25 - error: Type "ConcreteHasProperty2" is not assignable to declared type "HasPropertyProto" +  "ConcreteHasProperty2" is incompatible with protocol "HasPropertyProto" +    "m" is an incompatible type +      Type "(item: int, callback: (int) -> str) -> str" is not assignable to type "(item: T@m, callback: (T@m) -> str) -> str" +        Parameter 1: type "T@m" is incompatible with type "int" +          "object*" is not assignable to "int" +        Parameter 2: type "(T@m) -> str" is incompatible with type "(int) -> str" +          Type "(T@m) -> str" is not assignable to type "(int) -> str" (reportAssignmentType) +protocols_generic.py:146:25 - error: Type "ConcreteHasProperty3" is not assignable to declared type "HasPropertyProto"   "ConcreteHasProperty3" is incompatible with protocol "HasPropertyProto"     "f" is an incompatible type -      Type "() -> int" is incompatible with type "() -> HasPropertyProto" +      Type "() -> int" is not assignable to type "() -> HasPropertyProto"         Function return type "int" is incompatible with type "HasPropertyProto" -          "int" is incompatible with protocol "HasPropertyProto" (reportAssignmentType) -protocols_generic.py:147:25 - error: Expression of type "ConcreteHasProperty4" is incompatible with declared type "HasPropertyProto" +          "int" is incompatible with protocol "HasPropertyProto" +    "m" is an incompatible type +      Type "(item: int, callback: (int) -> str) -> str" is not assignable to type "(item: T@m, callback: (T@m) -> str) -> str" +        Parameter 1: type "T@m" is incompatible with type "int" + ... (reportAssignmentType) +protocols_generic.py:147:25 - error: Type "ConcreteHasProperty4" is not assignable to declared type "HasPropertyProto"   "ConcreteHasProperty4" is incompatible with protocol "HasPropertyProto"     "m" is an incompatible type -      Type "(item: str, callback: (int) -> str) -> str" is incompatible with type "(item: T@m, callback: (T@m) -> str) -> str" +      Type "(item: str, callback: (int) -> str) -> str" is not assignable to type "(item: T@m, callback: (T@m) -> str) -> str" +        Parameter 1: type "T@m" is incompatible with type "str" +          "object*" is not assignable to "str"         Parameter 2: type "(T@m) -> str" is incompatible with type "(int) -> str" -          Type "(str) -> str" is incompatible with type "(int) -> str" (reportAssignmentType) +          Type "(T@m) -> str" is not assignable to type "(int) -> str" (reportAssignmentType) """ -conformance_automated = "Pass" +conformance_automated = "Fail" errors_diff = """ +Line 145: Unexpected errors ['protocols_generic.py:145:25 - error: Type "ConcreteHasProperty2" is not assignable to declared type "HasPropertyProto"'] """ diff --git a/conformance/results/pyright/protocols_merging.toml b/conformance/results/pyright/protocols_merging.toml index cb43e377f..1baa74a77 100644 --- a/conformance/results/pyright/protocols_merging.toml +++ b/conformance/results/pyright/protocols_merging.toml @@ -1,18 +1,18 @@ conformant = "Pass" output = """ -protocols_merging.py:52:25 - error: Expression of type "SCConcrete2" is incompatible with declared type "SizedAndClosable1" +protocols_merging.py:52:25 - error: Type "SCConcrete2" is not assignable to declared type "SizedAndClosable1"   "SCConcrete2" is incompatible with protocol "SizedAndClosable1"     "__len__" is not present (reportAssignmentType) -protocols_merging.py:53:25 - error: Expression of type "SCConcrete2" is incompatible with declared type "SizedAndClosable2" +protocols_merging.py:53:25 - error: Type "SCConcrete2" is not assignable to declared type "SizedAndClosable2"   "SCConcrete2" is incompatible with protocol "SizedAndClosable2"     "__len__" is not present (reportAssignmentType) -protocols_merging.py:54:25 - error: Expression of type "SCConcrete2" is incompatible with declared type "SizedAndClosable3" -  "SCConcrete2" is incompatible with "SizedAndClosable3" (reportAssignmentType) -protocols_merging.py:67:16 - error: Protocol class "BadProto" cannot derive from non-protocol class "SizedAndClosable3" (reportGeneralTypeIssues) +protocols_merging.py:54:25 - error: Type "SCConcrete2" is not assignable to declared type "SizedAndClosable3" +  "SCConcrete2" is not assignable to "SizedAndClosable3" (reportAssignmentType) +protocols_merging.py:67:16 - error: Protocol class "BadProto" cannot derive from non-Protocol class "SizedAndClosable3" (reportGeneralTypeIssues) protocols_merging.py:82:5 - error: Cannot instantiate abstract class "SizedAndClosable4"   "SizedAndClosable4.close" is not implemented (reportAbstractUsage) -protocols_merging.py:83:24 - error: Expression of type "SCConcrete1" is incompatible with declared type "SizedAndClosable4" -  "SCConcrete1" is incompatible with "SizedAndClosable4" (reportAssignmentType) +protocols_merging.py:83:24 - error: Type "SCConcrete1" is not assignable to declared type "SizedAndClosable4" +  "SCConcrete1" is not assignable to "SizedAndClosable4" (reportAssignmentType) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/protocols_modules.toml b/conformance/results/pyright/protocols_modules.toml index 646b6ba13..570cd977d 100644 --- a/conformance/results/pyright/protocols_modules.toml +++ b/conformance/results/pyright/protocols_modules.toml @@ -1,15 +1,15 @@ conformant = "Pass" output = """ -protocols_modules.py:26:17 - error: Expression of type "Module("_protocols_modules1")" is incompatible with declared type "Options2" +protocols_modules.py:26:17 - error: Type "Module("_protocols_modules1")" is not assignable to declared type "Options2"   "timeout" is invariant because it is mutable   "timeout" is an incompatible type -    "int" is incompatible with "str" (reportAssignmentType) -protocols_modules.py:48:18 - error: Expression of type "Module("_protocols_modules2")" is incompatible with declared type "Reporter2" +    "int" is not assignable to "str" (reportAssignmentType) +protocols_modules.py:48:18 - error: Type "Module("_protocols_modules2")" is not assignable to declared type "Reporter2"   "on_error" is an incompatible type -    Type "(x: int) -> None" is incompatible with type "(x: int) -> int" +    Type "(x: int) -> None" is not assignable to type "(x: int) -> int"       Function return type "None" is incompatible with type "int" -        "None" is incompatible with "int" (reportAssignmentType) -protocols_modules.py:49:18 - error: Expression of type "Module("_protocols_modules2")" is incompatible with declared type "Reporter3" +        "None" is not assignable to "int" (reportAssignmentType) +protocols_modules.py:49:18 - error: Type "Module("_protocols_modules2")" is not assignable to declared type "Reporter3"   "not_implemented" is not present (reportAssignmentType) """ conformance_automated = "Pass" diff --git a/conformance/results/pyright/protocols_subtyping.toml b/conformance/results/pyright/protocols_subtyping.toml index a7b394f5e..84a70f745 100644 --- a/conformance/results/pyright/protocols_subtyping.toml +++ b/conformance/results/pyright/protocols_subtyping.toml @@ -1,37 +1,37 @@ conformant = "Pass" output = """ -protocols_subtyping.py:16:6 - error: Cannot instantiate protocol class "Proto1" (reportAbstractUsage) -protocols_subtyping.py:38:21 - error: Expression of type "Proto2" is incompatible with declared type "Concrete2" -  "Proto2" is incompatible with "Concrete2" (reportAssignmentType) -protocols_subtyping.py:55:18 - error: Expression of type "Proto2" is incompatible with declared type "Proto3" +protocols_subtyping.py:16:6 - error: Cannot instantiate Protocol class "Proto1" (reportAbstractUsage) +protocols_subtyping.py:38:21 - error: Type "Proto2" is not assignable to declared type "Concrete2" +  "Proto2" is not assignable to "Concrete2" (reportAssignmentType) +protocols_subtyping.py:55:18 - error: Type "Proto2" is not assignable to declared type "Proto3"   "Proto2" is incompatible with protocol "Proto3"     "method2" is not present (reportAssignmentType) -protocols_subtyping.py:79:30 - error: Expression of type "Proto5[int]" is incompatible with declared type "Proto4[int, float]" +protocols_subtyping.py:79:30 - error: Type "Proto5[int]" is not assignable to declared type "Proto4[int, float]"   "Proto5[int]" is incompatible with protocol "Proto4[int, float]"     "method1" is an incompatible type -      Type "(a: int, b: int) -> tuple[int, int]" is incompatible with type "(a: S@Proto4, b: T@Proto4) -> tuple[S@Proto4, T@Proto4]" +      Type "(a: int, b: int) -> tuple[int, int]" is not assignable to type "(a: S@Proto4, b: T@Proto4) -> tuple[S@Proto4, T@Proto4]"         Parameter 2: type "T@Proto4" is incompatible with type "int" -          "float" is incompatible with "int" (reportAssignmentType) -protocols_subtyping.py:80:25 - error: Expression of type "Proto4[int, int]" is incompatible with declared type "Proto5[float]" +          "float" is not assignable to "int" (reportAssignmentType) +protocols_subtyping.py:80:25 - error: Type "Proto4[int, int]" is not assignable to declared type "Proto5[float]"   "Proto4[int, int]" is incompatible with protocol "Proto5[float]"     "method1" is an incompatible type -      Type "(a: int, b: int) -> tuple[int, int]" is incompatible with type "(a: T@Proto5, b: T@Proto5) -> tuple[T@Proto5, T@Proto5]" +      Type "(a: int, b: int) -> tuple[int, int]" is not assignable to type "(a: T@Proto5, b: T@Proto5) -> tuple[T@Proto5, T@Proto5]"         Parameter 1: type "T@Proto5" is incompatible with type "int" -          "float" is incompatible with "int" +          "float" is not assignable to "int"         Parameter 2: type "T@Proto5" is incompatible with type "int" -          "float" is incompatible with "int" (reportAssignmentType) -protocols_subtyping.py:102:30 - error: Expression of type "Proto6[float, float]" is incompatible with declared type "Proto7[int, float]" +          "float" is not assignable to "int" (reportAssignmentType) +protocols_subtyping.py:102:30 - error: Type "Proto6[float, float]" is not assignable to declared type "Proto7[int, float]"   "Proto6[float, float]" is incompatible with protocol "Proto7[int, float]"     "method1" is an incompatible type -      Type "(a: float) -> Sequence[float]" is incompatible with type "(a: T_contra@Proto7) -> Sequence[S_co@Proto7]" +      Type "(a: float) -> Sequence[float]" is not assignable to type "(a: T_contra@Proto7) -> Sequence[S_co@Proto7]"         Function return type "Sequence[float]" is incompatible with type "Sequence[S_co@Proto7]" -          "Sequence[float]" is incompatible with "Sequence[S_co@Proto7]" (reportAssignmentType) -protocols_subtyping.py:103:33 - error: Expression of type "Proto6[float, float]" is incompatible with declared type "Proto7[float, object]" +          "Sequence[float]" is not assignable to "Sequence[S_co@Proto7]" (reportAssignmentType) +protocols_subtyping.py:103:33 - error: Type "Proto6[float, float]" is not assignable to declared type "Proto7[float, object]"   "Proto6[float, float]" is incompatible with protocol "Proto7[float, object]"     "method1" is an incompatible type -      Type "(a: float) -> Sequence[float]" is incompatible with type "(a: T_contra@Proto7) -> Sequence[S_co@Proto7]" +      Type "(a: float) -> Sequence[float]" is not assignable to type "(a: T_contra@Proto7) -> Sequence[S_co@Proto7]"         Parameter 1: type "T_contra@Proto7" is incompatible with type "float" -          "object" is incompatible with "float" (reportAssignmentType) +          "object" is not assignable to "float" (reportAssignmentType) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/protocols_variance.toml b/conformance/results/pyright/protocols_variance.toml index 041ce276a..108fd9d99 100644 --- a/conformance/results/pyright/protocols_variance.toml +++ b/conformance/results/pyright/protocols_variance.toml @@ -1,14 +1,14 @@ conformant = "Pass" output = """ -protocols_variance.py:21:7 - warning: Type variable "T1" used in generic protocol "AnotherBox" should be covariant (reportInvalidTypeVarUse) -protocols_variance.py:40:7 - warning: Type variable "T3" used in generic protocol "Protocol2" should be contravariant (reportInvalidTypeVarUse) -protocols_variance.py:56:7 - warning: Type variable "T1" used in generic protocol "Protocol4" should be contravariant (reportInvalidTypeVarUse) -protocols_variance.py:61:7 - warning: Type variable "T1_co" used in generic protocol "Protocol5" should be contravariant (reportInvalidTypeVarUse) +protocols_variance.py:21:7 - warning: Type variable "T1" used in generic Protocol "AnotherBox" should be covariant (reportInvalidTypeVarUse) +protocols_variance.py:40:7 - warning: Type variable "T3" used in generic Protocol "Protocol2" should be contravariant (reportInvalidTypeVarUse) +protocols_variance.py:56:7 - warning: Type variable "T1" used in generic Protocol "Protocol4" should be contravariant (reportInvalidTypeVarUse) +protocols_variance.py:61:7 - warning: Type variable "T1_co" used in generic Protocol "Protocol5" should be contravariant (reportInvalidTypeVarUse) protocols_variance.py:62:22 - error: Covariant type variable cannot be used in parameter type (reportGeneralTypeIssues) -protocols_variance.py:66:7 - warning: Type variable "T1" used in generic protocol "Protocol6" should be covariant (reportInvalidTypeVarUse) -protocols_variance.py:71:7 - warning: Type variable "T1_contra" used in generic protocol "Protocol7" should be covariant (reportInvalidTypeVarUse) +protocols_variance.py:66:7 - warning: Type variable "T1" used in generic Protocol "Protocol6" should be covariant (reportInvalidTypeVarUse) +protocols_variance.py:71:7 - warning: Type variable "T1_contra" used in generic Protocol "Protocol7" should be covariant (reportInvalidTypeVarUse) protocols_variance.py:72:21 - error: Contravariant type variable cannot be used in return type (reportGeneralTypeIssues) -protocols_variance.py:104:7 - warning: Type variable "T1" used in generic protocol "Protocol12" should be covariant (reportInvalidTypeVarUse) +protocols_variance.py:104:7 - warning: Type variable "T1" used in generic Protocol "Protocol12" should be covariant (reportInvalidTypeVarUse) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/qualifiers_annotated.toml b/conformance/results/pyright/qualifiers_annotated.toml index 075ec44e2..b8c271f0e 100644 --- a/conformance/results/pyright/qualifiers_annotated.toml +++ b/conformance/results/pyright/qualifiers_annotated.toml @@ -5,27 +5,32 @@ qualifiers_annotated.py:44:17 - error: Expected class but received "tuple[tuple[ qualifiers_annotated.py:45:17 - error: List expression not allowed for this type argument (reportInvalidTypeForm) qualifiers_annotated.py:45:18 - error: Expected class but received "Generator[type[int], None, None]" (reportGeneralTypeIssues) qualifiers_annotated.py:46:17 - error: Expected class but received "dict[str, Unknown]" (reportGeneralTypeIssues) -qualifiers_annotated.py:46:17 - error: Dictionary expression not allowed in type annotation (reportInvalidTypeForm) +qualifiers_annotated.py:46:17 - error: Dictionary expression not allowed in type expression (reportInvalidTypeForm) qualifiers_annotated.py:46:24 - error: "b" is not defined (reportUndefinedVariable) qualifiers_annotated.py:47:17 - error: Call expression not allowed in type expression (reportInvalidTypeForm) -qualifiers_annotated.py:48:17 - error: List expression not allowed in type annotation +qualifiers_annotated.py:48:17 - error: List expression not allowed in type expression   Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) qualifiers_annotated.py:48:17 - error: Expected class but received "list[type[int]]" (reportGeneralTypeIssues) qualifiers_annotated.py:48:23 - error: Expected class but received "Literal[0]" (reportGeneralTypeIssues) -qualifiers_annotated.py:49:17 - error: Ternary expression not allowed in type annotation (reportInvalidTypeForm) +qualifiers_annotated.py:49:17 - error: Ternary expression not allowed in type expression (reportInvalidTypeForm) qualifiers_annotated.py:50:17 - error: "var1" is not defined (reportUndefinedVariable) qualifiers_annotated.py:51:17 - error: Expected class but received "Literal[True]" (reportGeneralTypeIssues) qualifiers_annotated.py:52:18 - error: Expected class but received "Literal[1]" (reportGeneralTypeIssues) -qualifiers_annotated.py:53:18 - error: Binary operator not allowed in type annotation (reportInvalidTypeForm) -qualifiers_annotated.py:54:18 - error: Type annotations cannot use format string literals (f-strings) (reportGeneralTypeIssues) +qualifiers_annotated.py:53:18 - error: Binary operator not allowed in type expression (reportInvalidTypeForm) +qualifiers_annotated.py:54:18 - error: Type expressions cannot use format string literals (f-strings) (reportGeneralTypeIssues) qualifiers_annotated.py:64:8 - error: Expected one type argument and one or more annotations for "Annotated" (reportInvalidTypeForm) -qualifiers_annotated.py:76:24 - error: Expression of type "type[Annotated]" is incompatible with declared type "type[Any]" (reportAssignmentType) -qualifiers_annotated.py:77:24 - error: Expression of type "type[Annotated]" is incompatible with declared type "type[Any]" (reportAssignmentType) -qualifiers_annotated.py:84:7 - error: Argument of type "type[Annotated]" cannot be assigned to parameter "x" of type "type[T@func4]" in function "func4" (reportArgumentType) -qualifiers_annotated.py:85:7 - error: Argument of type "type[Annotated]" cannot be assigned to parameter "x" of type "type[T@func4]" in function "func4" (reportArgumentType) +qualifiers_annotated.py:76:24 - error: Type "Annotated" is not assignable to declared type "type[Any]" +  "Annotated" is not assignable to "type[Any]" (reportAssignmentType) +qualifiers_annotated.py:77:24 - error: Type "SmallInt" is not assignable to declared type "type[Any]" +  "Annotated" is not assignable to "type[Any]" (reportAssignmentType) +qualifiers_annotated.py:84:7 - error: Argument of type "Annotated" cannot be assigned to parameter "x" of type "type[T@func4]" in function "func4" +  Type "Annotated" is not assignable to type "type[T@func4]" (reportArgumentType) +qualifiers_annotated.py:85:7 - error: Argument of type "SmallInt" cannot be assigned to parameter "x" of type "type[T@func4]" in function "func4" +  Type "Annotated" is not assignable to type "type[T@func4]" (reportArgumentType) qualifiers_annotated.py:91:1 - error: "Annotated" cannot be instantiated (reportCallIssue) -qualifiers_annotated.py:92:1 - error: "Annotated" cannot be instantiated (reportCallIssue) -qualifiers_annotated.py:93:1 - error: "Annotated" cannot be instantiated (reportCallIssue) +qualifiers_annotated.py:92:1 - error: Object of type "Annotated" is not callable +  Attribute "__call__" is unknown (reportCallIssue) +qualifiers_annotated.py:93:1 - error: Object of type "Annotated" is not callable (reportCallIssue) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/qualifiers_final_annotation.toml b/conformance/results/pyright/qualifiers_final_annotation.toml index d191ef3e1..7918a7498 100644 --- a/conformance/results/pyright/qualifiers_final_annotation.toml +++ b/conformance/results/pyright/qualifiers_final_annotation.toml @@ -6,24 +6,20 @@ qualifiers_final_annotation.py:34:5 - error: "ID2" is declared Final, but value qualifiers_final_annotation.py:38:5 - error: "ID3" is declared Final, but value is not assigned (reportGeneralTypeIssues) qualifiers_final_annotation.py:54:14 - error: Cannot assign to attribute "ID5" for class "ClassA*"   Attribute "ID5" cannot be assigned through a class instance because it is a ClassVar -  "ID5" is declared as Final and cannot be reassigned -    Attribute "__set__" is unknown (reportAttributeAccessIssue) +  "ID5" is declared as Final and cannot be reassigned (reportAttributeAccessIssue) qualifiers_final_annotation.py:62:19 - error: "Final" is not allowed in this context (reportInvalidTypeForm) qualifiers_final_annotation.py:63:19 - error: "Final" is not allowed in this context (reportInvalidTypeForm) qualifiers_final_annotation.py:63:32 - error: Cannot assign to attribute "id4" for class "ClassA*" -  "Literal[1]" is incompatible with "Final" (reportAttributeAccessIssue) +  "Literal[1]" is not assignable to "Final" (reportAttributeAccessIssue) qualifiers_final_annotation.py:65:14 - error: Cannot assign to attribute "ID7" for class "ClassA*"   Attribute "ID7" cannot be assigned through a class instance because it is a ClassVar -  "ID7" is declared as Final and cannot be reassigned -    Attribute "__set__" is unknown (reportAttributeAccessIssue) +  "ID7" is declared as Final and cannot be reassigned (reportAttributeAccessIssue) qualifiers_final_annotation.py:67:14 - error: Cannot assign to attribute "ID7" for class "ClassA*"   Attribute "ID7" cannot be assigned through a class instance because it is a ClassVar -  "ID7" is declared as Final and cannot be reassigned -    Attribute "__set__" is unknown (reportAttributeAccessIssue) +  "ID7" is declared as Final and cannot be reassigned (reportAttributeAccessIssue) qualifiers_final_annotation.py:71:1 - error: "RATE" is declared as Final and cannot be reassigned (reportGeneralTypeIssues) qualifiers_final_annotation.py:81:8 - error: Cannot assign to attribute "DEFAULT_ID" for class "type[ClassB]" -  "DEFAULT_ID" is declared as Final and cannot be reassigned -    Attribute "__set__" is unknown (reportAttributeAccessIssue) +  "DEFAULT_ID" is declared as Final and cannot be reassigned (reportAttributeAccessIssue) qualifiers_final_annotation.py:94:5 - error: "BORDER_WIDTH" cannot be redeclared because parent class "ClassC" declares it as Final (reportGeneralTypeIssues) qualifiers_final_annotation.py:107:22 - error: "Final" is not allowed in this context (reportInvalidTypeForm) qualifiers_final_annotation.py:108:19 - error: "ClassVar" is not allowed in this context (reportInvalidTypeForm) @@ -32,9 +28,9 @@ qualifiers_final_annotation.py:121:14 - error: "Final" is not allowed in this co qualifiers_final_annotation.py:134:1 - error: Arguments missing for parameters "x", "y" (reportCallIssue) qualifiers_final_annotation.py:134:3 - error: No parameter named "a" (reportCallIssue) qualifiers_final_annotation.py:135:5 - error: Argument of type "Literal['']" cannot be assigned to parameter "x" of type "int" in function "__new__" -  "Literal['']" is incompatible with "int" (reportArgumentType) +  "Literal['']" is not assignable to "int" (reportArgumentType) qualifiers_final_annotation.py:135:11 - error: Argument of type "Literal['']" cannot be assigned to parameter "y" of type "int" in function "__new__" -  "Literal['']" is incompatible with "int" (reportArgumentType) +  "Literal['']" is not assignable to "int" (reportArgumentType) qualifiers_final_annotation.py:141:5 - error: "ID1" is declared as Final and cannot be reassigned (reportGeneralTypeIssues) qualifiers_final_annotation.py:145:5 - error: "x" is declared as Final and cannot be reassigned (reportGeneralTypeIssues) qualifiers_final_annotation.py:147:10 - error: "x" is declared as Final and cannot be reassigned (reportGeneralTypeIssues) diff --git a/conformance/results/pyright/specialtypes_never.toml b/conformance/results/pyright/specialtypes_never.toml index b72b75c74..d4e0cc4df 100644 --- a/conformance/results/pyright/specialtypes_never.toml +++ b/conformance/results/pyright/specialtypes_never.toml @@ -1,12 +1,12 @@ conformant = "Pass" output = """ specialtypes_never.py:19:22 - error: Function with declared return type "NoReturn" cannot return "None" (reportReturnType) -specialtypes_never.py:86:21 - error: Expression of type "list[Never]" is incompatible with declared type "list[int]" -  "list[Never]" is incompatible with "list[int]" +specialtypes_never.py:86:21 - error: Type "list[Never]" is not assignable to declared type "list[int]" +  "list[Never]" is not assignable to "list[int]"     Type parameter "_T@list" is invariant, but "Never" is not the same as "int"     Consider switching from "list" to "Sequence" which is covariant (reportAssignmentType) -specialtypes_never.py:105:12 - error: Expression of type "ClassC[Never]" is incompatible with return type "ClassC[U@func10]" -  "ClassC[Never]" is incompatible with "ClassC[U@func10]" +specialtypes_never.py:105:12 - error: Type "ClassC[Never]" is not assignable to return type "ClassC[U@func10]" +  "ClassC[Never]" is not assignable to "ClassC[U@func10]"     Type parameter "T@ClassC" is invariant, but "Never" is not the same as "U@func10" (reportReturnType) """ conformance_automated = "Pass" diff --git a/conformance/results/pyright/specialtypes_none.toml b/conformance/results/pyright/specialtypes_none.toml index fe9033f6f..94561c886 100644 --- a/conformance/results/pyright/specialtypes_none.toml +++ b/conformance/results/pyright/specialtypes_none.toml @@ -1,12 +1,12 @@ conformant = "Pass" output = """ specialtypes_none.py:21:7 - error: Argument of type "type[None]" cannot be assigned to parameter "val1" of type "None" in function "func1" -  "type[type]" is incompatible with "type[None]" (reportArgumentType) -specialtypes_none.py:27:19 - error: Expression of type "None" is incompatible with declared type "Iterable[Unknown]" +  "type[type]" is not assignable to "type[None]" (reportArgumentType) +specialtypes_none.py:27:19 - error: Type "None" is not assignable to declared type "Iterable[Unknown]"   "None" is incompatible with protocol "Iterable[Unknown]"     "__iter__" is not present (reportAssignmentType) specialtypes_none.py:41:7 - error: Argument of type "None" cannot be assigned to parameter "val1" of type "type[None]" in function "func2" -  Type "None" is incompatible with type "type[None]" (reportArgumentType) +  Type "None" is not assignable to type "type[None]" (reportArgumentType) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/specialtypes_type.toml b/conformance/results/pyright/specialtypes_type.toml index b0b336860..904c541a0 100644 --- a/conformance/results/pyright/specialtypes_type.toml +++ b/conformance/results/pyright/specialtypes_type.toml @@ -1,11 +1,11 @@ conformant = "Pass" output = """ specialtypes_type.py:56:7 - error: Argument of type "type[TeamUser]" cannot be assigned to parameter "user_class" of type "type[BasicUser] | type[ProUser]" in function "func4" -  Type "type[TeamUser]" is incompatible with type "type[BasicUser] | type[ProUser]" -    "type[TeamUser]" is incompatible with "type[BasicUser]" -    Type "type[TeamUser]" is incompatible with type "type[BasicUser]" -    "type[TeamUser]" is incompatible with "type[ProUser]" -    Type "type[TeamUser]" is incompatible with type "type[ProUser]" (reportArgumentType) +  Type "type[TeamUser]" is not assignable to type "type[BasicUser] | type[ProUser]" +    "type[TeamUser]" is not assignable to "type[BasicUser]" +    Type "type[TeamUser]" is not assignable to type "type[BasicUser]" +    "type[TeamUser]" is not assignable to "type[ProUser]" +    Type "type[TeamUser]" is not assignable to type "type[ProUser]" (reportArgumentType) specialtypes_type.py:70:7 - error: Argument of type "type[Callable]" cannot be assigned to parameter "x" of type "type[T@func5]" in function "func5" (reportArgumentType) specialtypes_type.py:76:22 - error: Too many type arguments provided for "type"; expected 1 but received 2 (reportInvalidTypeForm) specialtypes_type.py:117:7 - error: Cannot access attribute "unknown" for class "type[object]" diff --git a/conformance/results/pyright/tuples_type_compat.toml b/conformance/results/pyright/tuples_type_compat.toml index 184606a6b..02eac2977 100644 --- a/conformance/results/pyright/tuples_type_compat.toml +++ b/conformance/results/pyright/tuples_type_compat.toml @@ -1,47 +1,47 @@ conformant = "Pass" output = """ -tuples_type_compat.py:15:27 - error: Expression of type "tuple[float, complex]" is incompatible with declared type "tuple[int, int]" -  "tuple[float, complex]" is incompatible with "tuple[int, int]" +tuples_type_compat.py:15:27 - error: Type "tuple[float, complex]" is not assignable to declared type "tuple[int, int]" +  "tuple[float, complex]" is not assignable to "tuple[int, int]"     Tuple entry 1 is incorrect type -      "float" is incompatible with "int" (reportAssignmentType) -tuples_type_compat.py:29:10 - error: Expression of type "tuple[int, ...]" is incompatible with declared type "tuple[int, *tuple[int, ...]]" -  "tuple[int, ...]" is incompatible with "tuple[int, *tuple[int, ...]]" +      "float" is not assignable to "int" (reportAssignmentType) +tuples_type_compat.py:29:10 - error: Type "tuple[int, ...]" is not assignable to declared type "tuple[int, *tuple[int, ...]]" +  "tuple[int, ...]" is not assignable to "tuple[int, *tuple[int, ...]]"     Tuple size mismatch; expected 1 or more but received indeterminate (reportAssignmentType) -tuples_type_compat.py:32:10 - error: Expression of type "tuple[int, *tuple[int, ...]]" is incompatible with declared type "tuple[int]" -  "tuple[int, *tuple[int, ...]]" is incompatible with "tuple[int]" +tuples_type_compat.py:32:10 - error: Type "tuple[int, *tuple[int, ...]]" is not assignable to declared type "tuple[int]" +  "tuple[int, *tuple[int, ...]]" is not assignable to "tuple[int]"     Tuple size mismatch; expected 1 but received indeterminate (reportAssignmentType) -tuples_type_compat.py:33:10 - error: Expression of type "tuple[int, ...]" is incompatible with declared type "tuple[int]" -  "tuple[int, ...]" is incompatible with "tuple[int]" +tuples_type_compat.py:33:10 - error: Type "tuple[int, ...]" is not assignable to declared type "tuple[int]" +  "tuple[int, ...]" is not assignable to "tuple[int]"     Tuple size mismatch; expected 1 but received indeterminate (reportAssignmentType) -tuples_type_compat.py:43:22 - error: Expression of type "tuple[int, ...]" is incompatible with declared type "tuple[int]" -  "tuple[int, ...]" is incompatible with "tuple[int]" +tuples_type_compat.py:43:22 - error: Type "tuple[int, ...]" is not assignable to declared type "tuple[int]" +  "tuple[int, ...]" is not assignable to "tuple[int]"     Tuple size mismatch; expected 1 but received indeterminate (reportAssignmentType) -tuples_type_compat.py:62:26 - error: Expression of type "tuple[int, ...]" is incompatible with declared type "tuple[int, int]" -  "tuple[int, ...]" is incompatible with "tuple[int, int]" +tuples_type_compat.py:62:26 - error: Type "tuple[int, ...]" is not assignable to declared type "tuple[int, int]" +  "tuple[int, ...]" is not assignable to "tuple[int, int]"     Tuple size mismatch; expected 2 but received indeterminate (reportAssignmentType) -tuples_type_compat.py:144:6 - error: Expression of type "tuple[Literal[1], Literal[''], Literal['']]" is incompatible with declared type "tuple[int, str]" -  "tuple[Literal[1], Literal[''], Literal['']]" is incompatible with "tuple[int, str]" +tuples_type_compat.py:144:6 - error: Type "tuple[Literal[1], Literal[''], Literal['']]" is not assignable to declared type "tuple[int, str]" +  "tuple[Literal[1], Literal[''], Literal['']]" is not assignable to "tuple[int, str]"     Tuple size mismatch; expected 2 but received 3 (reportAssignmentType) -tuples_type_compat.py:149:10 - error: Expression of type "tuple[Literal[1], Literal[1], Literal['']]" is incompatible with declared type "tuple[int, *tuple[str, ...]]" -  "Literal[1]" is incompatible with "str" (reportAssignmentType) -tuples_type_compat.py:150:14 - error: Expression of type "tuple[Literal[1], Literal[''], Literal[1]]" is incompatible with declared type "tuple[int, *tuple[str, ...]]" -  "Literal[1]" is incompatible with "str" (reportAssignmentType) -tuples_type_compat.py:156:14 - error: Expression of type "tuple[Literal[1], Literal[''], Literal['']]" is incompatible with declared type "tuple[int, *tuple[str, ...], int]" -  "Literal['']" is incompatible with "int" (reportAssignmentType) -tuples_type_compat.py:157:18 - error: Expression of type "tuple[Literal[1], Literal[''], Literal[''], float]" is incompatible with declared type "tuple[int, *tuple[str, ...], int]" -  "float" is incompatible with "int" (reportAssignmentType) -tuples_type_compat.py:162:7 - error: Expression of type "tuple[Literal[1], Literal[''], Literal[1]]" is incompatible with declared type "tuple[*tuple[str, ...], int]" -  "Literal[1]" is incompatible with "str" (reportAssignmentType) -tuples_type_compat.py:163:15 - error: Expression of type "tuple[Literal[''], Literal[''], float]" is incompatible with declared type "tuple[*tuple[str, ...], int]" -  "float" is incompatible with "int" (reportAssignmentType) -tuples_type_compat.py:168:40 - error: Expression of type "tuple[str, str]" is incompatible with declared type "tuple[str, str, int]" -  "tuple[str, str]" is incompatible with "tuple[str, str, int]" +tuples_type_compat.py:149:10 - error: Type "tuple[Literal[1], Literal[1], Literal['']]" is not assignable to declared type "tuple[int, *tuple[str, ...]]" +  "Literal[1]" is not assignable to "str" (reportAssignmentType) +tuples_type_compat.py:150:14 - error: Type "tuple[Literal[1], Literal[''], Literal[1]]" is not assignable to declared type "tuple[int, *tuple[str, ...]]" +  "Literal[1]" is not assignable to "str" (reportAssignmentType) +tuples_type_compat.py:156:14 - error: Type "tuple[Literal[1], Literal[''], Literal['']]" is not assignable to declared type "tuple[int, *tuple[str, ...], int]" +  "Literal['']" is not assignable to "int" (reportAssignmentType) +tuples_type_compat.py:157:18 - error: Type "tuple[Literal[1], Literal[''], Literal[''], float]" is not assignable to declared type "tuple[int, *tuple[str, ...], int]" +  "float" is not assignable to "int" (reportAssignmentType) +tuples_type_compat.py:162:7 - error: Type "tuple[Literal[1], Literal[''], Literal[1]]" is not assignable to declared type "tuple[*tuple[str, ...], int]" +  "Literal[1]" is not assignable to "str" (reportAssignmentType) +tuples_type_compat.py:163:15 - error: Type "tuple[Literal[''], Literal[''], float]" is not assignable to declared type "tuple[*tuple[str, ...], int]" +  "float" is not assignable to "int" (reportAssignmentType) +tuples_type_compat.py:168:40 - error: Type "tuple[str, str]" is not assignable to declared type "tuple[str, str, int]" +  "tuple[str, str]" is not assignable to "tuple[str, str, int]"     Tuple size mismatch; expected 3 but received 2 (reportAssignmentType) -tuples_type_compat.py:171:50 - error: Expression of type "tuple[str, str]" is incompatible with declared type "tuple[str, str, str, *tuple[str, ...]]" -  "tuple[str, str]" is incompatible with "tuple[str, str, str, *tuple[str, ...]]" +tuples_type_compat.py:171:50 - error: Type "tuple[str, str]" is not assignable to declared type "tuple[str, str, str, *tuple[str, ...]]" +  "tuple[str, str]" is not assignable to "tuple[str, str, str, *tuple[str, ...]]"     Tuple size mismatch; expected 3 or more but received 2 (reportAssignmentType) -tuples_type_compat.py:175:50 - error: Expression of type "tuple[str, str]" is incompatible with declared type "tuple[*tuple[str, ...], str, str, str]" -  "tuple[str, str]" is incompatible with "tuple[*tuple[str, ...], str, str, str]" +tuples_type_compat.py:175:50 - error: Type "tuple[str, str]" is not assignable to declared type "tuple[*tuple[str, ...], str, str, str]" +  "tuple[str, str]" is not assignable to "tuple[*tuple[str, ...], str, str, str]"     Tuple size mismatch; expected 3 or more but received 2 (reportAssignmentType) """ conformance_automated = "Pass" diff --git a/conformance/results/pyright/tuples_type_form.toml b/conformance/results/pyright/tuples_type_form.toml index 2bc7070ac..ca0d3792f 100644 --- a/conformance/results/pyright/tuples_type_form.toml +++ b/conformance/results/pyright/tuples_type_form.toml @@ -1,18 +1,18 @@ conformant = "Pass" output = """ -tuples_type_form.py:12:6 - error: Expression of type "tuple[Literal[1], Literal[2]]" is incompatible with declared type "tuple[int]" -  "tuple[Literal[1], Literal[2]]" is incompatible with "tuple[int]" +tuples_type_form.py:12:6 - error: Type "tuple[Literal[1], Literal[2]]" is not assignable to declared type "tuple[int]" +  "tuple[Literal[1], Literal[2]]" is not assignable to "tuple[int]"     Tuple size mismatch; expected 1 but received 2 (reportAssignmentType) -tuples_type_form.py:14:6 - error: Expression of type "tuple[Literal[1]]" is incompatible with declared type "tuple[int, int]" -  "tuple[Literal[1]]" is incompatible with "tuple[int, int]" +tuples_type_form.py:14:6 - error: Type "tuple[Literal[1]]" is not assignable to declared type "tuple[int, int]" +  "tuple[Literal[1]]" is not assignable to "tuple[int, int]"     Tuple size mismatch; expected 2 but received 1 (reportAssignmentType) -tuples_type_form.py:15:10 - error: Expression of type "tuple[Literal[1], Literal['']]" is incompatible with declared type "tuple[int, int]" -  "Literal['']" is incompatible with "int" (reportAssignmentType) -tuples_type_form.py:25:7 - error: Expression of type "tuple[Literal[1]]" is incompatible with declared type "tuple[()]" -  "tuple[Literal[1]]" is incompatible with "tuple[()]" +tuples_type_form.py:15:10 - error: Type "tuple[Literal[1], Literal['']]" is not assignable to declared type "tuple[int, int]" +  "Literal['']" is not assignable to "int" (reportAssignmentType) +tuples_type_form.py:25:7 - error: Type "tuple[Literal[1]]" is not assignable to declared type "tuple[()]" +  "tuple[Literal[1]]" is not assignable to "tuple[()]"     Tuple size mismatch; expected 0 but received 1 (reportAssignmentType) -tuples_type_form.py:36:17 - error: Expression of type "tuple[Literal[1], Literal[2], Literal[3], Literal['']]" is incompatible with declared type "tuple[int, ...]" -  "Literal['']" is incompatible with "int" (reportAssignmentType) +tuples_type_form.py:36:17 - error: Type "tuple[Literal[1], Literal[2], Literal[3], Literal['']]" is not assignable to declared type "tuple[int, ...]" +  "Literal['']" is not assignable to "int" (reportAssignmentType) tuples_type_form.py:40:22 - error: "..." is allowed only as the second of two arguments (reportInvalidTypeForm) tuples_type_form.py:41:12 - error: "..." is allowed only as the second of two arguments (reportInvalidTypeForm) tuples_type_form.py:42:12 - error: "..." is allowed only as the second of two arguments (reportInvalidTypeForm) diff --git a/conformance/results/pyright/typeddicts_alt_syntax.toml b/conformance/results/pyright/typeddicts_alt_syntax.toml index ed85c45e0..8137309ea 100644 --- a/conformance/results/pyright/typeddicts_alt_syntax.toml +++ b/conformance/results/pyright/typeddicts_alt_syntax.toml @@ -4,8 +4,8 @@ typeddicts_alt_syntax.py:23:17 - error: Expected dict or keyword parameter as se typeddicts_alt_syntax.py:27:45 - error: Expected string literal for dictionary entry name (reportGeneralTypeIssues) typeddicts_alt_syntax.py:31:1 - error: TypedDict must be assigned to a variable named "WrongName" (reportGeneralTypeIssues) typeddicts_alt_syntax.py:35:78 - error: Extra TypedDict arguments not supported (reportCallIssue) -typeddicts_alt_syntax.py:45:43 - error: Expression of type "dict[str, str]" is incompatible with declared type "Movie2" -  "Literal['']" is incompatible with "int" (reportAssignmentType) +typeddicts_alt_syntax.py:45:43 - error: Type "dict[str, str]" is not assignable to declared type "Movie2" +  "Literal['']" is not assignable to "int" (reportAssignmentType) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/typeddicts_operations.toml b/conformance/results/pyright/typeddicts_operations.toml index f98bba88d..9eae54519 100644 --- a/conformance/results/pyright/typeddicts_operations.toml +++ b/conformance/results/pyright/typeddicts_operations.toml @@ -1,20 +1,20 @@ conformant = "Pass" output = """ typeddicts_operations.py:22:1 - error: Could not assign item in TypedDict -  "Literal[1982]" is incompatible with "str" (reportGeneralTypeIssues) +  "Literal[1982]" is not assignable to "str" (reportGeneralTypeIssues) typeddicts_operations.py:23:1 - error: Could not assign item in TypedDict -  "Literal['']" is incompatible with "int" (reportGeneralTypeIssues) +  "Literal['']" is not assignable to "int" (reportGeneralTypeIssues) typeddicts_operations.py:24:1 - error: Could not assign item in TypedDict   "other" is not a defined key in "Movie" (reportGeneralTypeIssues) typeddicts_operations.py:26:7 - error: Could not access item in TypedDict   "other" is not a defined key in "Movie" (reportGeneralTypeIssues) -typeddicts_operations.py:28:9 - error: Expression of type "dict[str, str]" is incompatible with declared type "Movie" +typeddicts_operations.py:28:9 - error: Type "dict[str, str]" is not assignable to declared type "Movie"   "year" is required in "Movie" (reportAssignmentType) -typeddicts_operations.py:29:42 - error: Expression of type "dict[str, str | float]" is incompatible with declared type "Movie" -  "float" is incompatible with "int" (reportAssignmentType) -typeddicts_operations.py:32:36 - error: Expression of type "dict[str, str | int]" is incompatible with declared type "Movie" +typeddicts_operations.py:29:42 - error: Type "dict[str, str | float]" is not assignable to declared type "Movie" +  "float" is not assignable to "int" (reportAssignmentType) +typeddicts_operations.py:32:36 - error: Type "dict[str, str | int]" is not assignable to declared type "Movie"   "other" is an undefined item in type "Movie" (reportAssignmentType) -typeddicts_operations.py:37:20 - error: Expression of type "dict[str, str | int]" is incompatible with declared type "Movie" (reportAssignmentType) +typeddicts_operations.py:37:20 - error: Type "dict[str, str | int]" is not assignable to declared type "Movie" (reportAssignmentType) typeddicts_operations.py:47:7 - error: Cannot access attribute "clear" for class "Movie"   Attribute "clear" is unknown (reportAttributeAccessIssue) typeddicts_operations.py:49:5 - error: Could not delete item in TypedDict diff --git a/conformance/results/pyright/typeddicts_readonly_consistency.toml b/conformance/results/pyright/typeddicts_readonly_consistency.toml index c295c4779..bb53197cc 100644 --- a/conformance/results/pyright/typeddicts_readonly_consistency.toml +++ b/conformance/results/pyright/typeddicts_readonly_consistency.toml @@ -1,20 +1,20 @@ conformant = "Pass" output = """ -typeddicts_readonly_consistency.py:37:14 - error: Expression of type "A1" is incompatible with declared type "B1" +typeddicts_readonly_consistency.py:37:14 - error: Type "A1" is not assignable to declared type "B1"   "y" is missing from "A1" (reportAssignmentType) -typeddicts_readonly_consistency.py:38:14 - error: Expression of type "C1" is incompatible with declared type "B1" +typeddicts_readonly_consistency.py:38:14 - error: Type "C1" is not assignable to declared type "B1"   "y" is not read-only in "B1" (reportAssignmentType) -typeddicts_readonly_consistency.py:40:14 - error: Expression of type "A1" is incompatible with declared type "C1" +typeddicts_readonly_consistency.py:40:14 - error: Type "A1" is not assignable to declared type "C1"   "y" is an incompatible type -    "object" is incompatible with "str" (reportAssignmentType) -typeddicts_readonly_consistency.py:81:14 - error: Expression of type "A2" is incompatible with declared type "B2" +    "object" is not assignable to "str" (reportAssignmentType) +typeddicts_readonly_consistency.py:81:14 - error: Type "A2" is not assignable to declared type "B2"   "x" is not read-only in "B2" (reportAssignmentType) -typeddicts_readonly_consistency.py:82:14 - error: Expression of type "C2" is incompatible with declared type "B2" +typeddicts_readonly_consistency.py:82:14 - error: Type "C2" is not assignable to declared type "B2"   "x" is not required in "B2" (reportAssignmentType) -typeddicts_readonly_consistency.py:84:14 - error: Expression of type "A2" is incompatible with declared type "C2" +typeddicts_readonly_consistency.py:84:14 - error: Type "A2" is not assignable to declared type "C2"   "x" is required in "C2"   "x" is not read-only in "C2" (reportAssignmentType) -typeddicts_readonly_consistency.py:85:14 - error: Expression of type "B2" is incompatible with declared type "C2" +typeddicts_readonly_consistency.py:85:14 - error: Type "B2" is not assignable to declared type "C2"   "x" is required in "C2" (reportAssignmentType) """ conformance_automated = "Pass" diff --git a/conformance/results/pyright/typeddicts_readonly_inheritance.toml b/conformance/results/pyright/typeddicts_readonly_inheritance.toml index a77014bc5..d9e432b89 100644 --- a/conformance/results/pyright/typeddicts_readonly_inheritance.toml +++ b/conformance/results/pyright/typeddicts_readonly_inheritance.toml @@ -3,16 +3,16 @@ output = """ typeddicts_readonly_inheritance.py:36:1 - error: Could not assign item in TypedDict   "name" is a read-only key in "Album2" (reportTypedDictNotRequiredAccess) typeddicts_readonly_inheritance.py:50:5 - error: "alt" overrides symbol of same name in class "AlbumCollection" -  "list[str]" is incompatible with "list[str | int]" +  "list[str]" is not assignable to "list[str | int]"     Type parameter "_T@list" is invariant, but "str" is not the same as "str | int"     Consider switching from "list" to "Sequence" which is covariant (reportIncompatibleVariableOverride) -typeddicts_readonly_inheritance.py:65:19 - error: Expression of type "dict[Any, Any]" is incompatible with declared type "RequiredName" +typeddicts_readonly_inheritance.py:65:19 - error: Type "dict[Any, Any]" is not assignable to declared type "RequiredName"   "name" is required in "RequiredName" (reportAssignmentType) typeddicts_readonly_inheritance.py:82:1 - error: Could not assign item in TypedDict -  "Literal[3]" is incompatible with "str" (reportGeneralTypeIssues) -typeddicts_readonly_inheritance.py:83:15 - error: Expression of type "dict[str, int]" is incompatible with declared type "User" -  "Literal[3]" is incompatible with "str" (reportAssignmentType) -typeddicts_readonly_inheritance.py:84:5 - error: Expression of type "dict[Any, Any]" is incompatible with declared type "User" +  "Literal[3]" is not assignable to "str" (reportGeneralTypeIssues) +typeddicts_readonly_inheritance.py:83:15 - error: Type "dict[str, int]" is not assignable to declared type "User" +  "Literal[3]" is not assignable to "str" (reportAssignmentType) +typeddicts_readonly_inheritance.py:84:5 - error: Type "dict[Any, Any]" is not assignable to declared type "User"   "ident" is required in "User" (reportAssignmentType) typeddicts_readonly_inheritance.py:94:5 - error: TypedDict item "a" cannot be redefined as ReadOnly (reportGeneralTypeIssues) typeddicts_readonly_inheritance.py:98:5 - error: TypedDict item "a" cannot be redefined as NotRequired (reportGeneralTypeIssues) diff --git a/conformance/results/pyright/typeddicts_readonly_update.toml b/conformance/results/pyright/typeddicts_readonly_update.toml index 405e1acca..650894094 100644 --- a/conformance/results/pyright/typeddicts_readonly_update.toml +++ b/conformance/results/pyright/typeddicts_readonly_update.toml @@ -3,7 +3,7 @@ output = """ typeddicts_readonly_update.py:23:1 - error: No overloads for "update" match the provided arguments (reportCallIssue) typeddicts_readonly_update.py:23:11 - error: Argument of type "A" cannot be assigned to parameter "__m" of type "Partial[A]" in function "update"   "x" is an incompatible type -    Type "int" is incompatible with type "Never" (reportArgumentType) +    Type "int" is not assignable to type "Never" (reportArgumentType) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/typeddicts_required.toml b/conformance/results/pyright/typeddicts_required.toml index 434466a4b..9f041f9fc 100644 --- a/conformance/results/pyright/typeddicts_required.toml +++ b/conformance/results/pyright/typeddicts_required.toml @@ -2,7 +2,7 @@ conformant = "Pass" output = """ typeddicts_required.py:12:8 - error: "Required" is not allowed in this context (reportInvalidTypeForm) typeddicts_required.py:15:18 - error: Cannot assign to attribute "x" for class "NotTypedDict*" -  "int" is incompatible with "Required[int]" (reportAttributeAccessIssue) +  "int" is not assignable to "Required" (reportAttributeAccessIssue) typeddicts_required.py:19:8 - error: "NotRequired" is not allowed in this context (reportInvalidTypeForm) typeddicts_required.py:62:8 - error: "Required" is not allowed in this context (reportInvalidTypeForm) typeddicts_required.py:63:8 - error: "Required" is not allowed in this context (reportInvalidTypeForm) diff --git a/conformance/results/pyright/typeddicts_type_consistency.toml b/conformance/results/pyright/typeddicts_type_consistency.toml index dcda72179..328b8b937 100644 --- a/conformance/results/pyright/typeddicts_type_consistency.toml +++ b/conformance/results/pyright/typeddicts_type_consistency.toml @@ -1,27 +1,27 @@ conformant = "Pass" output = """ -typeddicts_type_consistency.py:21:10 - error: Expression of type "B1" is incompatible with declared type "A1" +typeddicts_type_consistency.py:21:10 - error: Type "B1" is not assignable to declared type "A1"   "x" is an incompatible type -    Type "int" is incompatible with type "int | None" -      "int" is incompatible with "None" (reportAssignmentType) -typeddicts_type_consistency.py:38:10 - error: Expression of type "B2" is incompatible with declared type "A2" +    Type "int" is not assignable to type "int | None" +      "int" is not assignable to "None" (reportAssignmentType) +typeddicts_type_consistency.py:38:10 - error: Type "B2" is not assignable to declared type "A2"   "x" is not required in "A2" (reportAssignmentType) -typeddicts_type_consistency.py:65:6 - error: Expression of type "A3" is incompatible with declared type "B3" +typeddicts_type_consistency.py:65:6 - error: Type "A3" is not assignable to declared type "B3"   "y" is missing from "A3" (reportAssignmentType) -typeddicts_type_consistency.py:69:21 - error: Expression of type "dict[str, int]" is incompatible with declared type "A3" +typeddicts_type_consistency.py:69:21 - error: Type "dict[str, int]" is not assignable to declared type "A3"   "y" is an undefined item in type "A3" (reportAssignmentType) -typeddicts_type_consistency.py:76:22 - error: Expression of type "B3" is incompatible with declared type "dict[str, int]" -  "B3" is incompatible with "dict[str, int]" (reportAssignmentType) -typeddicts_type_consistency.py:77:25 - error: Expression of type "B3" is incompatible with declared type "dict[str, object]" -  "B3" is incompatible with "dict[str, object]" (reportAssignmentType) -typeddicts_type_consistency.py:78:22 - error: Expression of type "B3" is incompatible with declared type "dict[Any, Any]" -  "B3" is incompatible with "dict[Any, Any]" (reportAssignmentType) -typeddicts_type_consistency.py:82:25 - error: Expression of type "B3" is incompatible with declared type "Mapping[str, int]" -  "B3" is incompatible with "Mapping[str, int]" +typeddicts_type_consistency.py:76:22 - error: Type "B3" is not assignable to declared type "dict[str, int]" +  "B3" is not assignable to "dict[str, int]" (reportAssignmentType) +typeddicts_type_consistency.py:77:25 - error: Type "B3" is not assignable to declared type "dict[str, object]" +  "B3" is not assignable to "dict[str, object]" (reportAssignmentType) +typeddicts_type_consistency.py:78:22 - error: Type "B3" is not assignable to declared type "dict[Any, Any]" +  "B3" is not assignable to "dict[Any, Any]" (reportAssignmentType) +typeddicts_type_consistency.py:82:25 - error: Type "B3" is not assignable to declared type "Mapping[str, int]" +  "B3" is not assignable to "Mapping[str, int]"     Type parameter "_VT_co@Mapping" is covariant, but "object" is not a subtype of "int" -      "object" is incompatible with "int" (reportAssignmentType) -typeddicts_type_consistency.py:126:56 - error: Expression of type "dict[str, dict[str, dict[str, int]]]" is incompatible with declared type "Outer1" -  "Literal[1]" is incompatible with "str" (reportAssignmentType) +      "object" is not assignable to "int" (reportAssignmentType) +typeddicts_type_consistency.py:126:56 - error: Type "dict[str, dict[str, dict[str, int]]]" is not assignable to declared type "Outer1" +  "Literal[1]" is not assignable to "str" (reportAssignmentType) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/typeddicts_usage.toml b/conformance/results/pyright/typeddicts_usage.toml index 447d0ad07..ce846f1dd 100644 --- a/conformance/results/pyright/typeddicts_usage.toml +++ b/conformance/results/pyright/typeddicts_usage.toml @@ -3,8 +3,8 @@ output = """ typeddicts_usage.py:23:1 - error: Could not assign item in TypedDict   "director" is not a defined key in "Movie" (reportGeneralTypeIssues) typeddicts_usage.py:24:1 - error: Could not assign item in TypedDict -  "Literal['1982']" is incompatible with "int" (reportGeneralTypeIssues) -typeddicts_usage.py:28:18 - error: Expression of type "dict[str, str | int]" is incompatible with declared type "Movie" +  "Literal['1982']" is not assignable to "int" (reportGeneralTypeIssues) +typeddicts_usage.py:28:18 - error: Type "dict[str, str | int]" is not assignable to declared type "Movie"   "title" is an undefined item in type "Movie" (reportAssignmentType) typeddicts_usage.py:35:22 - error: Second argument to "isinstance" must be a class or tuple of classes   TypedDict class not allowed for instance or class checks (reportArgumentType) diff --git a/conformance/results/pyright/version.toml b/conformance/results/pyright/version.toml index 7cda8a2ff..a90f554cf 100644 --- a/conformance/results/pyright/version.toml +++ b/conformance/results/pyright/version.toml @@ -1,2 +1,2 @@ -version = "pyright 1.1.374" -test_duration = 1.5 +version = "pyright 1.1.384" +test_duration = 1.3 diff --git a/conformance/results/pytype/aliases_explicit.toml b/conformance/results/pytype/aliases_explicit.toml index 48f40da98..27f65cc61 100644 --- a/conformance/results/pytype/aliases_explicit.toml +++ b/conformance/results/pytype/aliases_explicit.toml @@ -7,24 +7,96 @@ Does not report some illegal annotation forms as invalid type aliases. Does not report invalid specialization of already-specialized generic type alias. """ output = """ -File "aliases_explicit.py", line 41, in : Invalid type annotation '[str, str]' [invalid-annotation] -File "aliases_explicit.py", line 41, in : Invalid type annotation 'Callable[Concatenate[int, P], R][[str, str], None]' [invalid-annotation] -File "aliases_explicit.py", line 57, in good_type_aliases: Callable[Concatenate, Any] [assert-type] -File "aliases_explicit.py", line 60, in good_type_aliases: Callable[[Any], None] [assert-type] -File "aliases_explicit.py", line 67, in : Invalid type annotation 'Optional[int][int]' [invalid-annotation] -File "aliases_explicit.py", line 68, in : Invalid type annotation 'List[Optional[int]][int]' [invalid-annotation] -File "aliases_explicit.py", line 69, in : Invalid type annotation 'List[T][int, int]' [invalid-annotation] -File "aliases_explicit.py", line 70, in : Invalid type annotation 'Callable[[int, T], T][int, int]' [invalid-annotation] -File "aliases_explicit.py", line 71, in : Invalid type annotation 'Callable[Concatenate[int, P], R][int, int]' [invalid-annotation] -File "aliases_explicit.py", line 80, in : Invalid type annotation '[int, str]' for BadTypeAlias2 [invalid-annotation] -File "aliases_explicit.py", line 81, in : Invalid type annotation '((int, str),)' for BadTypeAlias3 [invalid-annotation] -File "aliases_explicit.py", line 82, in : Invalid type annotation '' for BadTypeAlias4 [invalid-annotation] -File "aliases_explicit.py", line 83, in : Invalid type annotation "{'a': 'b'}" for BadTypeAlias5 [invalid-annotation] -File "aliases_explicit.py", line 87, in : Invalid type annotation '3' for BadTypeAlias9 [invalid-annotation] -File "aliases_explicit.py", line 88, in : Invalid type annotation 'True' for BadTypeAlias10 [invalid-annotation] -File "aliases_explicit.py", line 89, in : Invalid type annotation '1' for BadTypeAlias11 [invalid-annotation] -File "aliases_explicit.py", line 91, in : Invalid type annotation '' for BadTypeAlias13 [invalid-annotation] -File "aliases_explicit.py", line 102, in : Invalid type annotation 'Union[list, set][int]' [invalid-annotation] +aliases_explicit.py:41:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '[str, str]' [invalid-annotation] + + p9: GoodTypeAlias9[[str, str], None], + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_explicit.py:41:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Callable[Concatenate[int, P], R][[str, str], None]' [invalid-annotation] + + p9: GoodTypeAlias9[[str, str], None], + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_explicit.py:57:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in good_type_aliases: Callable[Concatenate, Any] [assert-type] + + assert_type(p9, Callable[[int, str, str], None]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_explicit.py:60:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in good_type_aliases: Callable[[Any], None] [assert-type] + + assert_type(p12, Callable[..., None]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_explicit.py:67:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Optional[int][int]' [invalid-annotation] + + p1: GoodTypeAlias2[int], # E: type alias is not generic + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_explicit.py:68:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'List[Optional[int]][int]' [invalid-annotation] + + p2: GoodTypeAlias3[int], # E: type alias is already specialized + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_explicit.py:69:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'List[T][int, int]' [invalid-annotation] + + p3: GoodTypeAlias4[int, int], # E: too many type arguments + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_explicit.py:70:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Callable[[int, T], T][int, int]' [invalid-annotation] + + p4: GoodTypeAlias8[int, int], # E: too many type arguments + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_explicit.py:71:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Callable[Concatenate[int, P], R][int, int]' [invalid-annotation] + + p5: GoodTypeAlias9[int, int], # E: bad type argument for ParamSpec + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_explicit.py:80:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '[int, str]' for BadTypeAlias2 [invalid-annotation] + +BadTypeAlias2: TA = [int, str] # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_explicit.py:81:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '((int, str),)' for BadTypeAlias3 [invalid-annotation] + +BadTypeAlias3: TA = ((int, str),) # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_explicit.py:82:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' for BadTypeAlias4 [invalid-annotation] + +BadTypeAlias4: TA = [int for i in range(1)] # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_explicit.py:83:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation "{'a': 'b'}" for BadTypeAlias5 [invalid-annotation] + +BadTypeAlias5: TA = {"a": "b"} # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_explicit.py:87:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '3' for BadTypeAlias9 [invalid-annotation] + +BadTypeAlias9: TA = var1 # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_explicit.py:88:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'True' for BadTypeAlias10 [invalid-annotation] + +BadTypeAlias10: TA = True # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_explicit.py:89:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '1' for BadTypeAlias11 [invalid-annotation] + +BadTypeAlias11: TA = 1 # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_explicit.py:91:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' for BadTypeAlias13 [invalid-annotation] + +BadTypeAlias13: TA = f"{'int'}" # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_explicit.py:102:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Union[list, set][int]' [invalid-annotation] + +x4: ListOrSetAlias[int] # E: already specialized + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -35,7 +107,7 @@ Line 86: Expected 1 errors Line 90: Expected 1 errors Line 100: Expected 1 errors Line 101: Expected 1 errors -Line 41: Unexpected errors ['File "aliases_explicit.py", line 41, in : Invalid type annotation \\'[str, str]\\' [invalid-annotation]', 'File "aliases_explicit.py", line 41, in : Invalid type annotation \\'Callable[Concatenate[int, P], R][[str, str], None]\\' [invalid-annotation]'] -Line 57: Unexpected errors ['File "aliases_explicit.py", line 57, in good_type_aliases: Callable[Concatenate, Any] [assert-type]'] -Line 60: Unexpected errors ['File "aliases_explicit.py", line 60, in good_type_aliases: Callable[[Any], None] [assert-type]'] +Line 41: Unexpected errors ["aliases_explicit.py:41:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '[str, str]' [invalid-annotation]", "aliases_explicit.py:41:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Callable[Concatenate[int, P], R][[str, str], None]' [invalid-annotation]"] +Line 57: Unexpected errors ['aliases_explicit.py:57:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in good_type_aliases: Callable[Concatenate, Any] [assert-type]'] +Line 60: Unexpected errors ['aliases_explicit.py:60:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in good_type_aliases: Callable[[Any], None] [assert-type]'] """ diff --git a/conformance/results/pytype/aliases_implicit.toml b/conformance/results/pytype/aliases_implicit.toml index 26f6b5aa2..64e38336b 100644 --- a/conformance/results/pytype/aliases_implicit.toml +++ b/conformance/results/pytype/aliases_implicit.toml @@ -7,23 +7,315 @@ Allows some illegal annotation forms to be interpreted as valid type aliases. Does not report invalid specialization of already-specialized generic type alias. """ output = """ -File "aliases_implicit.py", line 54, in : Invalid type annotation '[str, str]' [invalid-annotation] -File "aliases_implicit.py", line 54, in : Invalid type annotation 'Callable[Concatenate[int, P], R][[str, str], None]' [invalid-annotation] -File "aliases_implicit.py", line 68, in good_type_aliases: Callable[Concatenate, Any] [assert-type] -File "aliases_implicit.py", line 72, in good_type_aliases: Callable[[Any], None] [assert-type] -File "aliases_implicit.py", line 76, in : Invalid type annotation 'Optional[int][int]' [invalid-annotation] -File "aliases_implicit.py", line 77, in : Invalid type annotation 'List[Optional[int]][int]' [invalid-annotation] -File "aliases_implicit.py", line 78, in : Invalid type annotation 'List[T][int, int]' [invalid-annotation] -File "aliases_implicit.py", line 79, in : Invalid type annotation 'Callable[[int, T], T][int, int]' [invalid-annotation] -File "aliases_implicit.py", line 80, in : Invalid type annotation 'Callable[Concatenate[int, P], R][int, int]' [invalid-annotation] -File "aliases_implicit.py", line 105, in : Invalid type annotation '[int, str]' for p2 [invalid-annotation] -File "aliases_implicit.py", line 105, in : Invalid type annotation 'True' for p10 [invalid-annotation] -File "aliases_implicit.py", line 105, in : Invalid type annotation '' for p4 [invalid-annotation] -File "aliases_implicit.py", line 105, in : Invalid type annotation '3' for p9 [invalid-annotation] -File "aliases_implicit.py", line 105, in : Invalid type annotation '1' for p11 [invalid-annotation] -File "aliases_implicit.py", line 105, in : Invalid type annotation '((int, str),)' for p3 [invalid-annotation] -File "aliases_implicit.py", line 105, in : Invalid type annotation "{'a': 'b'}" for p5 [invalid-annotation] -File "aliases_implicit.py", line 135, in : Invalid type annotation 'Union[list, set][int]' [invalid-annotation] +aliases_implicit.py:54:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '[str, str]' [invalid-annotation] + + p9: GoodTypeAlias9[[str, str], None], + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_implicit.py:54:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Callable[Concatenate[int, P], R][[str, str], None]' [invalid-annotation] + + p9: GoodTypeAlias9[[str, str], None], + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_implicit.py:68:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in good_type_aliases: Callable[Concatenate, Any] [assert-type] + + assert_type(p9, Callable[[int, str, str], None]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_implicit.py:72:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in good_type_aliases: Callable[[Any], None] [assert-type] + + assert_type(p13, Callable[..., None]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_implicit.py:76:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Optional[int][int]' [invalid-annotation] + + p1: GoodTypeAlias2[int], # E: type alias is not generic + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_implicit.py:77:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'List[Optional[int]][int]' [invalid-annotation] + + p2: GoodTypeAlias3[int], # E: type alias is already specialized + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_implicit.py:78:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'List[T][int, int]' [invalid-annotation] + + p3: GoodTypeAlias4[int, int], # E: too many type arguments + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_implicit.py:79:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Callable[[int, T], T][int, int]' [invalid-annotation] + + p4: GoodTypeAlias8[int, int], # E: too many type arguments + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_implicit.py:80:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Callable[Concatenate[int, P], R][int, int]' [invalid-annotation] + + p5: GoodTypeAlias9[int, int], # E: bad type argument for ParamSpec + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_implicit.py:105:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '[int, str]' for p2 [invalid-annotation] + +def bad_type_aliases( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p1: BadTypeAlias1, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p2: BadTypeAlias2, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p3: BadTypeAlias3, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p4: BadTypeAlias4, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p5: BadTypeAlias5, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p6: BadTypeAlias6, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p7: BadTypeAlias7, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p8: BadTypeAlias8, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p9: BadTypeAlias9, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p10: BadTypeAlias10, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p11: BadTypeAlias11, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p12: BadTypeAlias12, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p13: BadTypeAlias13, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p14: BadTypeAlias14, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +): +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +aliases_implicit.py:105:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'True' for p10 [invalid-annotation] + +def bad_type_aliases( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p1: BadTypeAlias1, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p2: BadTypeAlias2, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p3: BadTypeAlias3, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p4: BadTypeAlias4, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p5: BadTypeAlias5, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p6: BadTypeAlias6, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p7: BadTypeAlias7, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p8: BadTypeAlias8, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p9: BadTypeAlias9, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p10: BadTypeAlias10, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p11: BadTypeAlias11, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p12: BadTypeAlias12, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p13: BadTypeAlias13, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p14: BadTypeAlias14, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +): +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +aliases_implicit.py:105:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' for p4 [invalid-annotation] + +def bad_type_aliases( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p1: BadTypeAlias1, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p2: BadTypeAlias2, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p3: BadTypeAlias3, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p4: BadTypeAlias4, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p5: BadTypeAlias5, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p6: BadTypeAlias6, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p7: BadTypeAlias7, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p8: BadTypeAlias8, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p9: BadTypeAlias9, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p10: BadTypeAlias10, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p11: BadTypeAlias11, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p12: BadTypeAlias12, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p13: BadTypeAlias13, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p14: BadTypeAlias14, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +): +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +aliases_implicit.py:105:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '3' for p9 [invalid-annotation] + +def bad_type_aliases( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p1: BadTypeAlias1, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p2: BadTypeAlias2, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p3: BadTypeAlias3, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p4: BadTypeAlias4, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p5: BadTypeAlias5, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p6: BadTypeAlias6, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p7: BadTypeAlias7, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p8: BadTypeAlias8, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p9: BadTypeAlias9, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p10: BadTypeAlias10, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p11: BadTypeAlias11, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p12: BadTypeAlias12, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p13: BadTypeAlias13, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p14: BadTypeAlias14, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +): +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +aliases_implicit.py:105:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '1' for p11 [invalid-annotation] + +def bad_type_aliases( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p1: BadTypeAlias1, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p2: BadTypeAlias2, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p3: BadTypeAlias3, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p4: BadTypeAlias4, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p5: BadTypeAlias5, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p6: BadTypeAlias6, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p7: BadTypeAlias7, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p8: BadTypeAlias8, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p9: BadTypeAlias9, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p10: BadTypeAlias10, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p11: BadTypeAlias11, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p12: BadTypeAlias12, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p13: BadTypeAlias13, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p14: BadTypeAlias14, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +): +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +aliases_implicit.py:105:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '((int, str),)' for p3 [invalid-annotation] + +def bad_type_aliases( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p1: BadTypeAlias1, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p2: BadTypeAlias2, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p3: BadTypeAlias3, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p4: BadTypeAlias4, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p5: BadTypeAlias5, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p6: BadTypeAlias6, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p7: BadTypeAlias7, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p8: BadTypeAlias8, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p9: BadTypeAlias9, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p10: BadTypeAlias10, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p11: BadTypeAlias11, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p12: BadTypeAlias12, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p13: BadTypeAlias13, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p14: BadTypeAlias14, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +): +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +aliases_implicit.py:105:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation "{'a': 'b'}" for p5 [invalid-annotation] + +def bad_type_aliases( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p1: BadTypeAlias1, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p2: BadTypeAlias2, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p3: BadTypeAlias3, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p4: BadTypeAlias4, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p5: BadTypeAlias5, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p6: BadTypeAlias6, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p7: BadTypeAlias7, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p8: BadTypeAlias8, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p9: BadTypeAlias9, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p10: BadTypeAlias10, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p11: BadTypeAlias11, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p12: BadTypeAlias12, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p13: BadTypeAlias13, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p14: BadTypeAlias14, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +): +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +aliases_implicit.py:135:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Union[list, set][int]' [invalid-annotation] + +x4: ListOrSetAlias[int] # E: already specialized + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -43,8 +335,8 @@ Line 117: Expected 1 errors Line 118: Expected 1 errors Line 119: Expected 1 errors Line 133: Expected 1 errors -Line 54: Unexpected errors ['File "aliases_implicit.py", line 54, in : Invalid type annotation \\'[str, str]\\' [invalid-annotation]', 'File "aliases_implicit.py", line 54, in : Invalid type annotation \\'Callable[Concatenate[int, P], R][[str, str], None]\\' [invalid-annotation]'] -Line 68: Unexpected errors ['File "aliases_implicit.py", line 68, in good_type_aliases: Callable[Concatenate, Any] [assert-type]'] -Line 72: Unexpected errors ['File "aliases_implicit.py", line 72, in good_type_aliases: Callable[[Any], None] [assert-type]'] -Line 105: Unexpected errors ['File "aliases_implicit.py", line 105, in : Invalid type annotation \\'[int, str]\\' for p2 [invalid-annotation]', 'File "aliases_implicit.py", line 105, in : Invalid type annotation \\'True\\' for p10 [invalid-annotation]', 'File "aliases_implicit.py", line 105, in : Invalid type annotation \\'\\' for p4 [invalid-annotation]', 'File "aliases_implicit.py", line 105, in : Invalid type annotation \\'3\\' for p9 [invalid-annotation]', 'File "aliases_implicit.py", line 105, in : Invalid type annotation \\'1\\' for p11 [invalid-annotation]', 'File "aliases_implicit.py", line 105, in : Invalid type annotation \\'((int, str),)\\' for p3 [invalid-annotation]', 'File "aliases_implicit.py", line 105, in : Invalid type annotation "{\\'a\\': \\'b\\'}" for p5 [invalid-annotation]'] +Line 54: Unexpected errors ["aliases_implicit.py:54:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '[str, str]' [invalid-annotation]", "aliases_implicit.py:54:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Callable[Concatenate[int, P], R][[str, str], None]' [invalid-annotation]"] +Line 68: Unexpected errors ['aliases_implicit.py:68:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in good_type_aliases: Callable[Concatenate, Any] [assert-type]'] +Line 72: Unexpected errors ['aliases_implicit.py:72:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in good_type_aliases: Callable[[Any], None] [assert-type]'] +Line 105: Unexpected errors ["aliases_implicit.py:105:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '[int, str]' for p2 [invalid-annotation]", "aliases_implicit.py:105:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'True' for p10 [invalid-annotation]", "aliases_implicit.py:105:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' for p4 [invalid-annotation]", "aliases_implicit.py:105:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '3' for p9 [invalid-annotation]", "aliases_implicit.py:105:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '1' for p11 [invalid-annotation]", "aliases_implicit.py:105:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '((int, str),)' for p3 [invalid-annotation]", 'aliases_implicit.py:105:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation "{\\'a\\': \\'b\\'}" for p5 [invalid-annotation]'] """ diff --git a/conformance/results/pytype/aliases_newtype.toml b/conformance/results/pytype/aliases_newtype.toml index fc07d9bcf..996e17771 100644 --- a/conformance/results/pytype/aliases_newtype.toml +++ b/conformance/results/pytype/aliases_newtype.toml @@ -9,10 +9,26 @@ Does not reject use of NewType with TypedDict class. Does not reject use of NewType with Any. """ output = """ -File "aliases_newtype.py", line 11, in : Function UserId.__init__ was called with the wrong arguments [wrong-arg-types] -File "aliases_newtype.py", line 12, in : Type annotation for u1 does not match type of assignment [annotation-type-mismatch] -File "aliases_newtype.py", line 38, in : class GoodNewType1 is not indexable [not-indexable] -File "aliases_newtype.py", line 60, in : Function typing.NewType expects 2 arg(s), got 3 [wrong-arg-count] +aliases_newtype.py:11:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function UserId.__init__ was called with the wrong arguments [wrong-arg-types] + +UserId("user") # E: incorrect type +\u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_newtype.py:12:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for u1 does not match type of assignment [annotation-type-mismatch] + +u1: UserId = 42 # E: incorrect type +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +aliases_newtype.py:38:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class GoodNewType1 is not indexable [not-indexable] + +nt1: GoodNewType1[int] # E: NewType cannot be generic + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_newtype.py:60:15: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function typing.NewType expects 2 arg(s), got 3 [wrong-arg-count] + +BadNewType6 = NewType("BadNewType6", int, int) # E: too many arguments + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ diff --git a/conformance/results/pytype/aliases_recursive.toml b/conformance/results/pytype/aliases_recursive.toml index e65418915..10e318a6b 100644 --- a/conformance/results/pytype/aliases_recursive.toml +++ b/conformance/results/pytype/aliases_recursive.toml @@ -5,35 +5,111 @@ Does not properly handle `|` for unions in some recursive type alias definitions Does not detect cyclical references in recursive type alias definition. """ output = """ -File "aliases_recursive.py", line 19, in : Type annotation for j4 does not match type of assignment [annotation-type-mismatch] -File "aliases_recursive.py", line 20, in : Type annotation for j5 does not match type of assignment [annotation-type-mismatch] -File "aliases_recursive.py", line 38, in : Type annotation for t6 does not match type of assignment [annotation-type-mismatch] -File "aliases_recursive.py", line 39, in : Type annotation for t6 does not match type of assignment [annotation-type-mismatch] -File "aliases_recursive.py", line 50, in : Type annotation for m7 does not match type of assignment [annotation-type-mismatch] -File "aliases_recursive.py", line 51, in : Type annotation for m8 does not match type of assignment [annotation-type-mismatch] -File "aliases_recursive.py", line 58, in : unsupported operand type(s) for |: ''GenericTypeAlias1[T1]': str' and 'T1: TypeVar' [unsupported-operands] -File "aliases_recursive.py", line 59, in : Invalid type annotation 'list[str]' [invalid-annotation] -File "aliases_recursive.py", line 62, in : Invalid type annotation 'list[str]' [invalid-annotation] -File "aliases_recursive.py", line 62, in : Invalid type annotation 'GenericTypeAlias1[str]' [invalid-annotation] -File "aliases_recursive.py", line 63, in : Invalid type annotation 'list[str]' [invalid-annotation] -File "aliases_recursive.py", line 63, in : Invalid type annotation 'GenericTypeAlias1[str]' [invalid-annotation] -File "aliases_recursive.py", line 65, in : unsupported operand type(s) for |: ''GenericTypeAlias2[T1, T2]': str' and 'T1: TypeVar' [unsupported-operands] -File "aliases_recursive.py", line 67, in : Invalid type annotation 'list[str, int]' [invalid-annotation] -File "aliases_recursive.py", line 67, in : Invalid type annotation 'GenericTypeAlias2[str, int]' [invalid-annotation] -File "aliases_recursive.py", line 68, in : Invalid type annotation 'list[str, float]' [invalid-annotation] -File "aliases_recursive.py", line 68, in : Invalid type annotation 'GenericTypeAlias2[str, float]' [invalid-annotation] -File "aliases_recursive.py", line 69, in : Invalid type annotation 'list[str, int]' [invalid-annotation] -File "aliases_recursive.py", line 69, in : Invalid type annotation 'GenericTypeAlias2[str, int]' [invalid-annotation] +aliases_recursive.py:19:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for j4 does not match type of assignment [annotation-type-mismatch] + +j4: Json = {"a": 1, "b": 3j} # E: incompatible type +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +aliases_recursive.py:20:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for j5 does not match type of assignment [annotation-type-mismatch] + +j5: Json = [2, 3j] # E: incompatible type +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +aliases_recursive.py:38:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t6 does not match type of assignment [annotation-type-mismatch] + +t6: RecursiveTuple = (1, ("1", 1), (1, (1, [2]))) # E +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +aliases_recursive.py:39:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t6 does not match type of assignment [annotation-type-mismatch] + +t6: RecursiveTuple = (1, [1]) # E +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +aliases_recursive.py:50:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for m7 does not match type of assignment [annotation-type-mismatch] + +m7: RecursiveMapping = {"1": [1]} # E +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +aliases_recursive.py:51:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for m8 does not match type of assignment [annotation-type-mismatch] + +m8: RecursiveMapping = {"1": "1", "2": 1, "3": [1, 2]} # E +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +aliases_recursive.py:58:26: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : unsupported operand type(s) for |: ''GenericTypeAlias1[T1]': str' and 'T1: TypeVar' [unsupported-operands] + +GenericTypeAlias1 = list["GenericTypeAlias1[T1]" | T1] + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_recursive.py:59:25: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'list[str]' [invalid-annotation] + +SpecializedTypeAlias1 = GenericTypeAlias1[str] + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_recursive.py:62:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'list[str]' [invalid-annotation] + +g2: GenericTypeAlias1[str] = ["hi", "bye", [""], [["hi"]]] # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_recursive.py:62:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'GenericTypeAlias1[str]' [invalid-annotation] + +g2: GenericTypeAlias1[str] = ["hi", "bye", [""], [["hi"]]] # OK +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +aliases_recursive.py:63:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'list[str]' [invalid-annotation] + +g3: GenericTypeAlias1[str] = ["hi", [2.4]] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_recursive.py:63:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'GenericTypeAlias1[str]' [invalid-annotation] + +g3: GenericTypeAlias1[str] = ["hi", [2.4]] # E +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +aliases_recursive.py:65:26: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : unsupported operand type(s) for |: ''GenericTypeAlias2[T1, T2]': str' and 'T1: TypeVar' [unsupported-operands] + +GenericTypeAlias2 = list["GenericTypeAlias2[T1, T2]" | T1 | T2] + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_recursive.py:67:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'list[str, int]' [invalid-annotation] + +g4: GenericTypeAlias2[str, int] = [[3, ["hi"]], "hi"] # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_recursive.py:67:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'GenericTypeAlias2[str, int]' [invalid-annotation] + +g4: GenericTypeAlias2[str, int] = [[3, ["hi"]], "hi"] # OK +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +aliases_recursive.py:68:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'list[str, float]' [invalid-annotation] + +g5: GenericTypeAlias2[str, float] = [[3, ["hi", 3.4, [3.4]]], "hi"] # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_recursive.py:68:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'GenericTypeAlias2[str, float]' [invalid-annotation] + +g5: GenericTypeAlias2[str, float] = [[3, ["hi", 3.4, [3.4]]], "hi"] # OK +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +aliases_recursive.py:69:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'list[str, int]' [invalid-annotation] + +g6: GenericTypeAlias2[str, int] = [[3, ["hi", 3, [3.4]]], "hi"] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_recursive.py:69:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'GenericTypeAlias2[str, int]' [invalid-annotation] + +g6: GenericTypeAlias2[str, int] = [[3, ["hi", 3, [3.4]]], "hi"] # E +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ Line 52: Expected 1 errors Line 72: Expected 1 errors Line 75: Expected 1 errors -Line 58: Unexpected errors ['File "aliases_recursive.py", line 58, in : unsupported operand type(s) for |: \\'\\'GenericTypeAlias1[T1]\\': str\\' and \\'T1: TypeVar\\' [unsupported-operands]'] -Line 59: Unexpected errors ['File "aliases_recursive.py", line 59, in : Invalid type annotation \\'list[str]\\' [invalid-annotation]'] -Line 62: Unexpected errors ['File "aliases_recursive.py", line 62, in : Invalid type annotation \\'list[str]\\' [invalid-annotation]', 'File "aliases_recursive.py", line 62, in : Invalid type annotation \\'GenericTypeAlias1[str]\\' [invalid-annotation]'] -Line 65: Unexpected errors ['File "aliases_recursive.py", line 65, in : unsupported operand type(s) for |: \\'\\'GenericTypeAlias2[T1, T2]\\': str\\' and \\'T1: TypeVar\\' [unsupported-operands]'] -Line 67: Unexpected errors ['File "aliases_recursive.py", line 67, in : Invalid type annotation \\'list[str, int]\\' [invalid-annotation]', 'File "aliases_recursive.py", line 67, in : Invalid type annotation \\'GenericTypeAlias2[str, int]\\' [invalid-annotation]'] -Line 68: Unexpected errors ['File "aliases_recursive.py", line 68, in : Invalid type annotation \\'list[str, float]\\' [invalid-annotation]', 'File "aliases_recursive.py", line 68, in : Invalid type annotation \\'GenericTypeAlias2[str, float]\\' [invalid-annotation]'] +Line 58: Unexpected errors ["aliases_recursive.py:58:26: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : unsupported operand type(s) for |: ''GenericTypeAlias1[T1]': str' and 'T1: TypeVar' [unsupported-operands]"] +Line 59: Unexpected errors ["aliases_recursive.py:59:25: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'list[str]' [invalid-annotation]"] +Line 62: Unexpected errors ["aliases_recursive.py:62:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'list[str]' [invalid-annotation]", "aliases_recursive.py:62:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'GenericTypeAlias1[str]' [invalid-annotation]"] +Line 65: Unexpected errors ["aliases_recursive.py:65:26: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : unsupported operand type(s) for |: ''GenericTypeAlias2[T1, T2]': str' and 'T1: TypeVar' [unsupported-operands]"] +Line 67: Unexpected errors ["aliases_recursive.py:67:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'list[str, int]' [invalid-annotation]", "aliases_recursive.py:67:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'GenericTypeAlias2[str, int]' [invalid-annotation]"] +Line 68: Unexpected errors ["aliases_recursive.py:68:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'list[str, float]' [invalid-annotation]", "aliases_recursive.py:68:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'GenericTypeAlias2[str, float]' [invalid-annotation]"] """ diff --git a/conformance/results/pytype/aliases_typealiastype.toml b/conformance/results/pytype/aliases_typealiastype.toml index f2c6d2414..9e13b0358 100644 --- a/conformance/results/pytype/aliases_typealiastype.toml +++ b/conformance/results/pytype/aliases_typealiastype.toml @@ -3,19 +3,59 @@ notes = """ Support for TypeAliasType is not implemented. """ output = """ -File "aliases_typealiastype.py", line 5, in : typing.TypeVarTuple not supported yet [not-supported-yet] -File "aliases_typealiastype.py", line 5, in : Can't find module 'typing.TypeAliasType'. [import-error] -File "aliases_typealiastype.py", line 11, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] -File "aliases_typealiastype.py", line 19, in : Name 'GoodAlias4' is not defined [name-error] -File "aliases_typealiastype.py", line 22, in : Name 'GoodAlias5' is not defined [name-error] -File "aliases_typealiastype.py", line 22, in : Invalid type annotation '' [invalid-annotation] -File "aliases_typealiastype.py", line 46, in : Name 'BadAlias4' is not defined [name-error] -File "aliases_typealiastype.py", line 47, in : Name 'BadAlias5' is not defined [name-error] -File "aliases_typealiastype.py", line 48, in : Name 'BadAlias7' is not defined [name-error] +aliases_typealiastype.py:5:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet] + +from typing import Callable, Generic, ParamSpec, TypeAliasType, TypeVar, TypeVarTuple +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_typealiastype.py:11:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] + +Ts = TypeVarTuple("Ts") + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_typealiastype.py:16:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +GoodAlias1 = TypeAliasType("GoodAlias1", int) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_typealiastype.py:19:51: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Name 'GoodAlias4' is not defined [name-error] + +GoodAlias4 = TypeAliasType("GoodAlias4", T | list[GoodAlias4[T]], type_params=(T,)) + \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_typealiastype.py:22:40: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Name 'GoodAlias5' is not defined [name-error] + + Callable[P, TStr] | list[S] | list[GoodAlias5[S, TStr, P]] | tuple[*Ts], + \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_typealiastype.py:22:66: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + + Callable[P, TStr] | list[S] | list[GoodAlias5[S, TStr, P]] | tuple[*Ts], + \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_typealiastype.py:32:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : No attribute 'other_attrib' on TypeAliasType [attribute-error] + +print(GoodAlias1.other_attrib) # E: unknown attribute + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_typealiastype.py:46:40: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Name 'BadAlias4' is not defined [name-error] + +BadAlias4 = TypeAliasType("BadAlias4", BadAlias4) # E: circular dependency + \u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m + +aliases_typealiastype.py:47:44: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Name 'BadAlias5' is not defined [name-error] + +BadAlias5 = TypeAliasType("BadAlias5", T | BadAlias5[str], type_params=(T,)) # E: circular dependency + \u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m + +aliases_typealiastype.py:48:40: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Name 'BadAlias7' is not defined [name-error] + +BadAlias6 = TypeAliasType("BadAlias6", BadAlias7) # E: circular dependency + \u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ -Line 32: Expected 1 errors Line 40: Expected 1 errors Line 43: Expected 1 errors Line 44: Expected 1 errors @@ -33,8 +73,9 @@ Line 61: Expected 1 errors Line 62: Expected 1 errors Line 63: Expected 1 errors Line 64: Expected 1 errors -Line 5: Unexpected errors ['File "aliases_typealiastype.py", line 5, in : typing.TypeVarTuple not supported yet [not-supported-yet]', 'File "aliases_typealiastype.py", line 5, in : Can\\'t find module \\'typing.TypeAliasType\\'. [import-error]'] -Line 11: Unexpected errors ['File "aliases_typealiastype.py", line 11, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] -Line 19: Unexpected errors ['File "aliases_typealiastype.py", line 19, in : Name \\'GoodAlias4\\' is not defined [name-error]'] -Line 22: Unexpected errors ['File "aliases_typealiastype.py", line 22, in : Name \\'GoodAlias5\\' is not defined [name-error]', 'File "aliases_typealiastype.py", line 22, in : Invalid type annotation \\'\\' [invalid-annotation]'] +Line 5: Unexpected errors ['aliases_typealiastype.py:5:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet]'] +Line 11: Unexpected errors ['aliases_typealiastype.py:11:6: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] +Line 16: Unexpected errors ["aliases_typealiastype.py:16:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 19: Unexpected errors ["aliases_typealiastype.py:19:51: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Name 'GoodAlias4' is not defined [name-error]"] +Line 22: Unexpected errors ["aliases_typealiastype.py:22:40: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Name 'GoodAlias5' is not defined [name-error]", "aliases_typealiastype.py:22:66: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] """ diff --git a/conformance/results/pytype/aliases_variance.toml b/conformance/results/pytype/aliases_variance.toml index 2bb30ee50..89093dfe8 100644 --- a/conformance/results/pytype/aliases_variance.toml +++ b/conformance/results/pytype/aliases_variance.toml @@ -3,8 +3,16 @@ notes = """ Does not detect variance incompatibility. """ output = """ -File "aliases_variance.py", line 9, in : argument "covariant" to TypeVar not supported yet [not-supported-yet] -File "aliases_variance.py", line 10, in : argument "contravariant" to TypeVar not supported yet [not-supported-yet] +aliases_variance.py:9:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet] + +T_co = TypeVar("T_co", covariant=True) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_variance.py:10:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "contravariant" to TypeVar not supported yet [not-supported-yet] + +T_contra = TypeVar("T_contra", contravariant=True) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -12,6 +20,6 @@ Line 24: Expected 1 errors Line 28: Expected 1 errors Line 32: Expected 1 errors Line 44: Expected 1 errors -Line 9: Unexpected errors ['File "aliases_variance.py", line 9, in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] -Line 10: Unexpected errors ['File "aliases_variance.py", line 10, in : argument "contravariant" to TypeVar not supported yet [not-supported-yet]'] +Line 9: Unexpected errors ['aliases_variance.py:9:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] +Line 10: Unexpected errors ['aliases_variance.py:10:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "contravariant" to TypeVar not supported yet [not-supported-yet]'] """ diff --git a/conformance/results/pytype/annotations_forward_refs.toml b/conformance/results/pytype/annotations_forward_refs.toml index 016f08a29..b493b07e0 100644 --- a/conformance/results/pytype/annotations_forward_refs.toml +++ b/conformance/results/pytype/annotations_forward_refs.toml @@ -6,27 +6,420 @@ Evaluates incorrect type for class variable annotated with quoted type expressio Does not treat triple-quoted forward reference annotation as implicitly parenthesized. """ output = """ -File "annotations_forward_refs.py", line 22, in : Name 'ClassA' is not defined [name-error] -File "annotations_forward_refs.py", line 23, in : Name 'ClassA' is not defined [name-error] -File "annotations_forward_refs.py", line 24, in : unsupported operand type(s) for |: ''ClassA': str' and 'int: Type[int]' [unsupported-operands] -File "annotations_forward_refs.py", line 25, in : Missing parameter 'y' in call to function int.__or__ [missing-parameter] -File "annotations_forward_refs.py", line 40, in : invalid syntax [python-compiler-error] -File "annotations_forward_refs.py", line 40, in : Invalid type annotation '{}' for p5 [invalid-annotation] -File "annotations_forward_refs.py", line 40, in : Invalid type annotation '[int, str]' for p2 [invalid-annotation] -File "annotations_forward_refs.py", line 40, in : Invalid type annotation 'True' for p10 [invalid-annotation] -File "annotations_forward_refs.py", line 40, in : Invalid type annotation '' for p15 [invalid-annotation] -File "annotations_forward_refs.py", line 40, in : Invalid type annotation '' for p4 [invalid-annotation] -File "annotations_forward_refs.py", line 40, in : Invalid type annotation '1' for p9 [invalid-annotation] -File "annotations_forward_refs.py", line 40, in : Invalid type annotation '1' for p11 [invalid-annotation] -File "annotations_forward_refs.py", line 40, in : Invalid type annotation '-1' for p12 [invalid-annotation] -File "annotations_forward_refs.py", line 40, in : Invalid type annotation '(int, str)' for p3 [invalid-annotation] -File "annotations_forward_refs.py", line 66, in ClassB: Name 'ClassB' is not defined [name-error] -File "annotations_forward_refs.py", line 80, in ClassD: Name 'ClassF' is not defined [name-error] -File "annotations_forward_refs.py", line 82, in ClassD: Invalid type annotation '' for str [invalid-annotation] -File "annotations_forward_refs.py", line 87, in ClassD: Invalid type annotation '' for x [invalid-annotation] -File "annotations_forward_refs.py", line 89, in ClassD: Invalid type annotation '' for y [invalid-annotation] -File "annotations_forward_refs.py", line 96, in : Any [assert-type] -File "annotations_forward_refs.py", line 103, in : unexpected indent [python-compiler-error] +annotations_forward_refs.py:22:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Name 'ClassA' is not defined [name-error] + +bad1: ClassA # E: Runtime error: requires quotes + \u001b[1m\u001b[31m~~~~~~\u001b[39m\u001b[0m + +annotations_forward_refs.py:23:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Name 'ClassA' is not defined [name-error] + +bad2: list[ClassA] # E: Runtime error: requires quotes + \u001b[1m\u001b[31m~~~~~~\u001b[39m\u001b[0m + +annotations_forward_refs.py:24:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : unsupported operand type(s) for |: ''ClassA': str' and 'int: Type[int]' [unsupported-operands] + +bad3: "ClassA" | int # E: Runtime error + \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +annotations_forward_refs.py:25:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'y' in call to function int.__or__ [missing-parameter] + +bad4: int | "ClassA" # E: Runtime error + \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +annotations_forward_refs.py:40:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '{}' for p5 [invalid-annotation] + +def invalid_annotations( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p1: "eval(''.join(map(chr, [105, 110, 116])))", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p2: "[int, str]", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p3: "(int, str)", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p4: "[int for i in range(1)]", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p5: "{}", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p6: "(lambda : int)()", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p7: "[int][0]", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p8: "int if 1 < 3 else str", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p9: "var1", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p10: "True", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p11: "1", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p12: "-1", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p13: "int or str", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p14: 'f"int"', # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p15: "types", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +): +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +annotations_forward_refs.py:40:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '[int, str]' for p2 [invalid-annotation] + +def invalid_annotations( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p1: "eval(''.join(map(chr, [105, 110, 116])))", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p2: "[int, str]", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p3: "(int, str)", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p4: "[int for i in range(1)]", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p5: "{}", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p6: "(lambda : int)()", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p7: "[int][0]", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p8: "int if 1 < 3 else str", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p9: "var1", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p10: "True", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p11: "1", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p12: "-1", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p13: "int or str", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p14: 'f"int"', # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p15: "types", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +): +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +annotations_forward_refs.py:40:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'True' for p10 [invalid-annotation] + +def invalid_annotations( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p1: "eval(''.join(map(chr, [105, 110, 116])))", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p2: "[int, str]", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p3: "(int, str)", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p4: "[int for i in range(1)]", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p5: "{}", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p6: "(lambda : int)()", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p7: "[int][0]", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p8: "int if 1 < 3 else str", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p9: "var1", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p10: "True", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p11: "1", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p12: "-1", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p13: "int or str", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p14: 'f"int"', # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p15: "types", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +): +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +annotations_forward_refs.py:40:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' for p15 [invalid-annotation] + +def invalid_annotations( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p1: "eval(''.join(map(chr, [105, 110, 116])))", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p2: "[int, str]", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p3: "(int, str)", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p4: "[int for i in range(1)]", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p5: "{}", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p6: "(lambda : int)()", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p7: "[int][0]", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p8: "int if 1 < 3 else str", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p9: "var1", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p10: "True", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p11: "1", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p12: "-1", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p13: "int or str", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p14: 'f"int"', # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p15: "types", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +): +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +annotations_forward_refs.py:40:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' for p4 [invalid-annotation] + +def invalid_annotations( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p1: "eval(''.join(map(chr, [105, 110, 116])))", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p2: "[int, str]", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p3: "(int, str)", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p4: "[int for i in range(1)]", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p5: "{}", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p6: "(lambda : int)()", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p7: "[int][0]", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p8: "int if 1 < 3 else str", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p9: "var1", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p10: "True", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p11: "1", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p12: "-1", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p13: "int or str", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p14: 'f"int"', # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p15: "types", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +): +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +annotations_forward_refs.py:40:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '1' for p9 [invalid-annotation] + +def invalid_annotations( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p1: "eval(''.join(map(chr, [105, 110, 116])))", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p2: "[int, str]", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p3: "(int, str)", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p4: "[int for i in range(1)]", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p5: "{}", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p6: "(lambda : int)()", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p7: "[int][0]", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p8: "int if 1 < 3 else str", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p9: "var1", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p10: "True", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p11: "1", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p12: "-1", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p13: "int or str", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p14: 'f"int"', # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p15: "types", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +): +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +annotations_forward_refs.py:40:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '1' for p11 [invalid-annotation] + +def invalid_annotations( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p1: "eval(''.join(map(chr, [105, 110, 116])))", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p2: "[int, str]", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p3: "(int, str)", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p4: "[int for i in range(1)]", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p5: "{}", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p6: "(lambda : int)()", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p7: "[int][0]", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p8: "int if 1 < 3 else str", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p9: "var1", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p10: "True", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p11: "1", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p12: "-1", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p13: "int or str", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p14: 'f"int"', # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p15: "types", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +): +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +annotations_forward_refs.py:40:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '-1' for p12 [invalid-annotation] + +def invalid_annotations( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p1: "eval(''.join(map(chr, [105, 110, 116])))", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p2: "[int, str]", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p3: "(int, str)", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p4: "[int for i in range(1)]", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p5: "{}", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p6: "(lambda : int)()", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p7: "[int][0]", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p8: "int if 1 < 3 else str", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p9: "var1", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p10: "True", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p11: "1", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p12: "-1", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p13: "int or str", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p14: 'f"int"', # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p15: "types", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +): +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +annotations_forward_refs.py:40:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '(int, str)' for p3 [invalid-annotation] + +def invalid_annotations( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p1: "eval(''.join(map(chr, [105, 110, 116])))", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p2: "[int, str]", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p3: "(int, str)", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p4: "[int for i in range(1)]", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p5: "{}", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p6: "(lambda : int)()", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p7: "[int][0]", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p8: "int if 1 < 3 else str", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p9: "var1", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p10: "True", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p11: "1", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p12: "-1", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p13: "int or str", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p14: 'f"int"', # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p15: "types", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +): +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +annotations_forward_refs.py:66:26: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassB: Name 'ClassB' is not defined [name-error] + + def method1(self) -> ClassB: # E: Runtime error + \u001b[1m\u001b[31m~~~~~~\u001b[39m\u001b[0m + +annotations_forward_refs.py:80:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassD: Name 'ClassF' is not defined [name-error] + + ClassF: "ClassF" # E: circular reference + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +annotations_forward_refs.py:82:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassD: Invalid type annotation '' for str [invalid-annotation] + + str: "str" = "" # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +annotations_forward_refs.py:87:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassD: Invalid type annotation '' for x [invalid-annotation] + + x: "int" = 0 # OK + \u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +annotations_forward_refs.py:89:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassD: Invalid type annotation '' for y [invalid-annotation] + + y: int = 0 # E: Refers to local int, which isn't a legal type expression + \u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +annotations_forward_refs.py:96:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Any [assert-type] + +assert_type(ClassD.x, int) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +annotations_forward_refs.py:103:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : unexpected indent [python-compiler-error] + +value: ""\" +\u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + int | +\u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m + str | +\u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m + list[int] +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m +""\" +\u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -45,9 +438,9 @@ Line 52: Expected 1 errors Line 53: Expected 1 errors Line 54: Expected 1 errors Line 55: Expected 1 errors -Line 40: Unexpected errors ['File "annotations_forward_refs.py", line 40, in : invalid syntax [python-compiler-error]', 'File "annotations_forward_refs.py", line 40, in : Invalid type annotation \\'{}\\' for p5 [invalid-annotation]', 'File "annotations_forward_refs.py", line 40, in : Invalid type annotation \\'[int, str]\\' for p2 [invalid-annotation]', 'File "annotations_forward_refs.py", line 40, in : Invalid type annotation \\'True\\' for p10 [invalid-annotation]', 'File "annotations_forward_refs.py", line 40, in : Invalid type annotation \\'\\' for p15 [invalid-annotation]', 'File "annotations_forward_refs.py", line 40, in : Invalid type annotation \\'\\' for p4 [invalid-annotation]', 'File "annotations_forward_refs.py", line 40, in : Invalid type annotation \\'1\\' for p9 [invalid-annotation]', 'File "annotations_forward_refs.py", line 40, in : Invalid type annotation \\'1\\' for p11 [invalid-annotation]', 'File "annotations_forward_refs.py", line 40, in : Invalid type annotation \\'-1\\' for p12 [invalid-annotation]', 'File "annotations_forward_refs.py", line 40, in : Invalid type annotation \\'(int, str)\\' for p3 [invalid-annotation]'] -Line 82: Unexpected errors ['File "annotations_forward_refs.py", line 82, in ClassD: Invalid type annotation \\'\\' for str [invalid-annotation]'] -Line 87: Unexpected errors ['File "annotations_forward_refs.py", line 87, in ClassD: Invalid type annotation \\'\\' for x [invalid-annotation]'] -Line 96: Unexpected errors ['File "annotations_forward_refs.py", line 96, in : Any [assert-type]'] -Line 103: Unexpected errors ['File "annotations_forward_refs.py", line 103, in : unexpected indent [python-compiler-error]'] +Line 40: Unexpected errors ["annotations_forward_refs.py:40:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '{}' for p5 [invalid-annotation]", "annotations_forward_refs.py:40:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '[int, str]' for p2 [invalid-annotation]", "annotations_forward_refs.py:40:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'True' for p10 [invalid-annotation]", "annotations_forward_refs.py:40:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' for p15 [invalid-annotation]", "annotations_forward_refs.py:40:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' for p4 [invalid-annotation]", "annotations_forward_refs.py:40:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '1' for p9 [invalid-annotation]", "annotations_forward_refs.py:40:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '1' for p11 [invalid-annotation]", "annotations_forward_refs.py:40:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '-1' for p12 [invalid-annotation]", "annotations_forward_refs.py:40:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '(int, str)' for p3 [invalid-annotation]"] +Line 82: Unexpected errors ["annotations_forward_refs.py:82:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in ClassD: Invalid type annotation '' for str [invalid-annotation]"] +Line 87: Unexpected errors ["annotations_forward_refs.py:87:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in ClassD: Invalid type annotation '' for x [invalid-annotation]"] +Line 96: Unexpected errors ['annotations_forward_refs.py:96:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Any [assert-type]'] +Line 103: Unexpected errors ['annotations_forward_refs.py:103:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : unexpected indent [python-compiler-error]'] """ diff --git a/conformance/results/pytype/annotations_generators.toml b/conformance/results/pytype/annotations_generators.toml index 4be5d0125..50bb6423c 100644 --- a/conformance/results/pytype/annotations_generators.toml +++ b/conformance/results/pytype/annotations_generators.toml @@ -5,17 +5,71 @@ Reports invalid error when return type of generator is annotated as a compatible Does not report type violation in `yield from` statement. """ output = """ -File "annotations_generators.py", line 54, in generator2: bad return type [bad-return-type] -File "annotations_generators.py", line 57, in generator2: bad return type [bad-return-type] -File "annotations_generators.py", line 57, in generator2: bad return type [bad-return-type] -File "annotations_generators.py", line 66, in generator3: bad return type [bad-return-type] -File "annotations_generators.py", line 75, in generator5: bad return type [bad-return-type] -File "annotations_generators.py", line 86, in : Bad return type 'int' for generator function generator8 [bad-yield-annotation] -File "annotations_generators.py", line 91, in : Bad return type 'int' for async generator function generator9 [bad-yield-annotation] -File "annotations_generators.py", line 100, in : Bad return type 'IntIterator' for generator function generator15 [bad-yield-annotation] -File "annotations_generators.py", line 109, in : Bad return type 'AsyncIntIterator' for async generator function generator16 [bad-yield-annotation] -File "annotations_generators.py", line 118, in generator18: bad return type [bad-return-type] -File "annotations_generators.py", line 119, in generator18: bad return type [bad-return-type] +annotations_generators.py:54:16: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in generator2: bad return type [bad-return-type] + + return False # E: incompatible return type + \u001b[1m\u001b[31m~~~~~\u001b[39m\u001b[0m + +annotations_generators.py:57:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in generator2: bad return type [bad-return-type] + + yield 3 # E: incompatible yield type + \u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +annotations_generators.py:57:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in generator2: bad return type [bad-return-type] + + yield 3 # E: incompatible yield type + \u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +annotations_generators.py:66:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in generator3: bad return type [bad-return-type] + + yield 3 # E: Incompatible yield type + \u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +annotations_generators.py:75:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in generator5: bad return type [bad-return-type] + + yield B() # E: incompatible yield type + \u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m + +annotations_generators.py:86:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Bad return type 'int' for generator function generator8 [bad-yield-annotation] + +def generator8() -> int: # E: incompatible return type +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + yield None # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + return 0 +\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +annotations_generators.py:91:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Bad return type 'int' for async generator function generator9 [bad-yield-annotation] + +async def generator9() -> int: # E: incompatible return type +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + yield None # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +annotations_generators.py:100:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Bad return type 'IntIterator' for generator function generator15 [bad-yield-annotation] + +def generator15() -> IntIterator: # OK +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + yield 0 +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +annotations_generators.py:109:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Bad return type 'AsyncIntIterator' for async generator function generator16 [bad-yield-annotation] + +async def generator16() -> AsyncIntIterator: # OK +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + yield 0 +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +annotations_generators.py:118:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in generator18: bad return type [bad-return-type] + + yield from generator17() # E: incompatible generator type + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +annotations_generators.py:119:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in generator18: bad return type [bad-return-type] + + yield from [1] # E: incompatible generator type + \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -23,6 +77,6 @@ Line 51: Expected 1 errors Line 87: Expected 1 errors Line 92: Expected 1 errors Line 135: Expected 1 errors -Line 100: Unexpected errors ['File "annotations_generators.py", line 100, in : Bad return type \\'IntIterator\\' for generator function generator15 [bad-yield-annotation]'] -Line 109: Unexpected errors ['File "annotations_generators.py", line 109, in : Bad return type \\'AsyncIntIterator\\' for async generator function generator16 [bad-yield-annotation]'] +Line 100: Unexpected errors ["annotations_generators.py:100:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Bad return type 'IntIterator' for generator function generator15 [bad-yield-annotation]"] +Line 109: Unexpected errors ["annotations_generators.py:109:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Bad return type 'AsyncIntIterator' for async generator function generator16 [bad-yield-annotation]"] """ diff --git a/conformance/results/pytype/annotations_methods.toml b/conformance/results/pytype/annotations_methods.toml index f86e18674..4a773d055 100644 --- a/conformance/results/pytype/annotations_methods.toml +++ b/conformance/results/pytype/annotations_methods.toml @@ -3,7 +3,11 @@ notes = """ Type evaluation differs from other type checkers because of ambiguity in the spec related to method bindings. """ output = """ -File "annotations_methods.py", line 42, in : B [assert-type] +annotations_methods.py:42:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : B [assert-type] + +assert_type(A.copy(B()), A) # E? +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pytype/annotations_typeexpr.toml b/conformance/results/pytype/annotations_typeexpr.toml index bfefd545b..87fa1060c 100644 --- a/conformance/results/pytype/annotations_typeexpr.toml +++ b/conformance/results/pytype/annotations_typeexpr.toml @@ -8,15 +8,357 @@ Does not reject f-string in type annotation. Does not reject module in type annotation. """ output = """ -File "annotations_typeexpr.py", line 87, in : Invalid type annotation '{}' for p5 [invalid-annotation] -File "annotations_typeexpr.py", line 87, in : Invalid type annotation '[int, str]' for p2 [invalid-annotation] -File "annotations_typeexpr.py", line 87, in : Invalid type annotation 'True' for p10 [invalid-annotation] -File "annotations_typeexpr.py", line 87, in : Invalid type annotation '' for p15 [invalid-annotation] -File "annotations_typeexpr.py", line 87, in : Invalid type annotation '' for p4 [invalid-annotation] -File "annotations_typeexpr.py", line 87, in : Invalid type annotation '3' for p9 [invalid-annotation] -File "annotations_typeexpr.py", line 87, in : Invalid type annotation '1' for p11 [invalid-annotation] -File "annotations_typeexpr.py", line 87, in : Invalid type annotation '-1' for p12 [invalid-annotation] -File "annotations_typeexpr.py", line 87, in : Invalid type annotation '(int, str)' for p3 [invalid-annotation] +annotations_typeexpr.py:87:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '{}' for p5 [invalid-annotation] + +def invalid_annotations( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p1: eval("".join(map(chr, [105, 110, 116]))), # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p2: [int, str], # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p3: (int, str), # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p4: [int for i in range(1)], # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p5: {}, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p6: (lambda: int)(), # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p7: [int][0], # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p8: int if 1 < 3 else str, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p9: var1, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p10: True, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p11: 1, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p12: -1, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p13: int or str, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p14: f"int", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p15: types, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +): +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +annotations_typeexpr.py:87:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '[int, str]' for p2 [invalid-annotation] + +def invalid_annotations( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p1: eval("".join(map(chr, [105, 110, 116]))), # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p2: [int, str], # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p3: (int, str), # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p4: [int for i in range(1)], # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p5: {}, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p6: (lambda: int)(), # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p7: [int][0], # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p8: int if 1 < 3 else str, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p9: var1, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p10: True, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p11: 1, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p12: -1, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p13: int or str, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p14: f"int", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p15: types, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +): +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +annotations_typeexpr.py:87:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'True' for p10 [invalid-annotation] + +def invalid_annotations( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p1: eval("".join(map(chr, [105, 110, 116]))), # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p2: [int, str], # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p3: (int, str), # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p4: [int for i in range(1)], # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p5: {}, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p6: (lambda: int)(), # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p7: [int][0], # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p8: int if 1 < 3 else str, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p9: var1, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p10: True, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p11: 1, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p12: -1, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p13: int or str, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p14: f"int", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p15: types, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +): +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +annotations_typeexpr.py:87:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' for p15 [invalid-annotation] + +def invalid_annotations( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p1: eval("".join(map(chr, [105, 110, 116]))), # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p2: [int, str], # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p3: (int, str), # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p4: [int for i in range(1)], # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p5: {}, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p6: (lambda: int)(), # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p7: [int][0], # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p8: int if 1 < 3 else str, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p9: var1, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p10: True, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p11: 1, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p12: -1, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p13: int or str, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p14: f"int", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p15: types, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +): +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +annotations_typeexpr.py:87:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' for p4 [invalid-annotation] + +def invalid_annotations( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p1: eval("".join(map(chr, [105, 110, 116]))), # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p2: [int, str], # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p3: (int, str), # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p4: [int for i in range(1)], # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p5: {}, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p6: (lambda: int)(), # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p7: [int][0], # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p8: int if 1 < 3 else str, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p9: var1, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p10: True, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p11: 1, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p12: -1, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p13: int or str, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p14: f"int", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p15: types, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +): +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +annotations_typeexpr.py:87:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '3' for p9 [invalid-annotation] + +def invalid_annotations( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p1: eval("".join(map(chr, [105, 110, 116]))), # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p2: [int, str], # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p3: (int, str), # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p4: [int for i in range(1)], # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p5: {}, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p6: (lambda: int)(), # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p7: [int][0], # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p8: int if 1 < 3 else str, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p9: var1, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p10: True, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p11: 1, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p12: -1, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p13: int or str, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p14: f"int", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p15: types, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +): +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +annotations_typeexpr.py:87:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '1' for p11 [invalid-annotation] + +def invalid_annotations( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p1: eval("".join(map(chr, [105, 110, 116]))), # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p2: [int, str], # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p3: (int, str), # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p4: [int for i in range(1)], # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p5: {}, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p6: (lambda: int)(), # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p7: [int][0], # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p8: int if 1 < 3 else str, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p9: var1, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p10: True, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p11: 1, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p12: -1, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p13: int or str, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p14: f"int", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p15: types, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +): +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +annotations_typeexpr.py:87:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '-1' for p12 [invalid-annotation] + +def invalid_annotations( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p1: eval("".join(map(chr, [105, 110, 116]))), # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p2: [int, str], # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p3: (int, str), # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p4: [int for i in range(1)], # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p5: {}, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p6: (lambda: int)(), # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p7: [int][0], # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p8: int if 1 < 3 else str, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p9: var1, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p10: True, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p11: 1, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p12: -1, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p13: int or str, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p14: f"int", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p15: types, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +): +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +annotations_typeexpr.py:87:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '(int, str)' for p3 [invalid-annotation] + +def invalid_annotations( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p1: eval("".join(map(chr, [105, 110, 116]))), # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p2: [int, str], # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p3: (int, str), # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p4: [int for i in range(1)], # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p5: {}, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p6: (lambda: int)(), # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p7: [int][0], # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p8: int if 1 < 3 else str, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p9: var1, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p10: True, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p11: 1, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p12: -1, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p13: int or str, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p14: f"int", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p15: types, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +): +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -35,5 +377,5 @@ Line 99: Expected 1 errors Line 100: Expected 1 errors Line 101: Expected 1 errors Line 102: Expected 1 errors -Line 87: Unexpected errors ['File "annotations_typeexpr.py", line 87, in : Invalid type annotation \\'{}\\' for p5 [invalid-annotation]', 'File "annotations_typeexpr.py", line 87, in : Invalid type annotation \\'[int, str]\\' for p2 [invalid-annotation]', 'File "annotations_typeexpr.py", line 87, in : Invalid type annotation \\'True\\' for p10 [invalid-annotation]', 'File "annotations_typeexpr.py", line 87, in : Invalid type annotation \\'\\' for p15 [invalid-annotation]', 'File "annotations_typeexpr.py", line 87, in : Invalid type annotation \\'\\' for p4 [invalid-annotation]', 'File "annotations_typeexpr.py", line 87, in : Invalid type annotation \\'3\\' for p9 [invalid-annotation]', 'File "annotations_typeexpr.py", line 87, in : Invalid type annotation \\'1\\' for p11 [invalid-annotation]', 'File "annotations_typeexpr.py", line 87, in : Invalid type annotation \\'-1\\' for p12 [invalid-annotation]', 'File "annotations_typeexpr.py", line 87, in : Invalid type annotation \\'(int, str)\\' for p3 [invalid-annotation]'] +Line 87: Unexpected errors ["annotations_typeexpr.py:87:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '{}' for p5 [invalid-annotation]", "annotations_typeexpr.py:87:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '[int, str]' for p2 [invalid-annotation]", "annotations_typeexpr.py:87:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'True' for p10 [invalid-annotation]", "annotations_typeexpr.py:87:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' for p15 [invalid-annotation]", "annotations_typeexpr.py:87:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' for p4 [invalid-annotation]", "annotations_typeexpr.py:87:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '3' for p9 [invalid-annotation]", "annotations_typeexpr.py:87:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '1' for p11 [invalid-annotation]", "annotations_typeexpr.py:87:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '-1' for p12 [invalid-annotation]", "annotations_typeexpr.py:87:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '(int, str)' for p3 [invalid-annotation]"] """ diff --git a/conformance/results/pytype/callables_kwargs.toml b/conformance/results/pytype/callables_kwargs.toml index 3723069b8..ae052884d 100644 --- a/conformance/results/pytype/callables_kwargs.toml +++ b/conformance/results/pytype/callables_kwargs.toml @@ -3,20 +3,76 @@ notes = """ Does not understand Unpack in the context of **kwargs annotation. """ output = """ -File "callables_kwargs.py", line 10, in : typing.Unpack not supported yet [not-supported-yet] -File "callables_kwargs.py", line 24, in func1: Unpack[TD2] [assert-type] -File "callables_kwargs.py", line 32, in func1: Unpack[TD2] [assert-type] -File "callables_kwargs.py", line 35, in func1: Unpack[TD2] [assert-type] -File "callables_kwargs.py", line 41, in func2: Dict[str, Unpack[TD1]] [assert-type] -File "callables_kwargs.py", line 47, in func3: Function func1 was called with the wrong arguments [wrong-arg-types] -File "callables_kwargs.py", line 49, in func3: Missing parameter 'v2' in call to function TD2.__init__ [missing-parameter] -File "callables_kwargs.py", line 51, in func3: Function func1 was called with the wrong arguments [wrong-arg-types] -File "callables_kwargs.py", line 52, in func3: Function func1 expects 0 arg(s), got 3 [wrong-arg-count] -File "callables_kwargs.py", line 58, in func3: Function func1 was called with the wrong arguments [wrong-arg-types] -File "callables_kwargs.py", line 61, in func3: Function func1 was called with the wrong arguments [wrong-arg-types] -File "callables_kwargs.py", line 63, in func3: Function func1 was called with the wrong arguments [wrong-arg-types] -File "callables_kwargs.py", line 64, in func3: Function func2 was called with the wrong arguments [wrong-arg-types] -File "callables_kwargs.py", line 65, in func3: Function func2 was called with the wrong arguments [wrong-arg-types] +callables_kwargs.py:10:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing.Unpack not supported yet [not-supported-yet] + +from typing import Protocol, TypeVar, TypedDict, NotRequired, Required, Unpack, assert_type +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +callables_kwargs.py:24:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Unpack[TD2] [assert-type] + + assert_type(v1, int) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +callables_kwargs.py:32:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Unpack[TD2] [assert-type] + + assert_type(v2, str) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +callables_kwargs.py:35:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Unpack[TD2] [assert-type] + + assert_type(v3, str) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +callables_kwargs.py:41:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func2: Dict[str, Unpack[TD1]] [assert-type] + + assert_type(kwargs, TD1) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +callables_kwargs.py:47:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func3: Function func1 was called with the wrong arguments [wrong-arg-types] + + func1(v1=1, v2="", v3="5") # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +callables_kwargs.py:49:11: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func3: Missing parameter 'v2' in call to function TD2.__init__ [missing-parameter] + + td2 = TD2(v1=2, v3="4") + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +callables_kwargs.py:51:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func3: Function func1 was called with the wrong arguments [wrong-arg-types] + + func1(v1=1, v2="", v3="5", v4=5) # E: v4 is not in TD2 + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +callables_kwargs.py:52:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func3: Function func1 expects 0 arg(s), got 3 [wrong-arg-count] + + func1(1, "", "5") # E: args not passed by position + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +callables_kwargs.py:58:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func3: Function func1 was called with the wrong arguments [wrong-arg-types] + + func1(**my_dict) # E: untyped dict + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +callables_kwargs.py:61:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func3: Function func1 was called with the wrong arguments [wrong-arg-types] + + func1(**d1) # E?: OK or Type error (spec allows either) + \u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +callables_kwargs.py:63:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func3: Function func1 was called with the wrong arguments [wrong-arg-types] + + func1(v1=2, **td2) # E: v1 is already specified + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +callables_kwargs.py:64:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func3: Function func2 was called with the wrong arguments [wrong-arg-types] + + func2(1, **td2) # E: v1 is already specified + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +callables_kwargs.py:65:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func3: Function func2 was called with the wrong arguments [wrong-arg-types] + + func2(v1=1, **td2) # E: v1 is already specified + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -26,11 +82,11 @@ Line 102: Expected 1 errors Line 103: Expected 1 errors Line 111: Expected 1 errors Line 122: Expected 1 errors -Line 10: Unexpected errors ['File "callables_kwargs.py", line 10, in : typing.Unpack not supported yet [not-supported-yet]'] -Line 24: Unexpected errors ['File "callables_kwargs.py", line 24, in func1: Unpack[TD2] [assert-type]'] -Line 32: Unexpected errors ['File "callables_kwargs.py", line 32, in func1: Unpack[TD2] [assert-type]'] -Line 35: Unexpected errors ['File "callables_kwargs.py", line 35, in func1: Unpack[TD2] [assert-type]'] -Line 41: Unexpected errors ['File "callables_kwargs.py", line 41, in func2: Dict[str, Unpack[TD1]] [assert-type]'] -Line 47: Unexpected errors ['File "callables_kwargs.py", line 47, in func3: Function func1 was called with the wrong arguments [wrong-arg-types]'] -Line 49: Unexpected errors ['File "callables_kwargs.py", line 49, in func3: Missing parameter \\'v2\\' in call to function TD2.__init__ [missing-parameter]'] +Line 10: Unexpected errors ['callables_kwargs.py:10:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.Unpack not supported yet [not-supported-yet]'] +Line 24: Unexpected errors ['callables_kwargs.py:24:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: Unpack[TD2] [assert-type]'] +Line 32: Unexpected errors ['callables_kwargs.py:32:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: Unpack[TD2] [assert-type]'] +Line 35: Unexpected errors ['callables_kwargs.py:35:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: Unpack[TD2] [assert-type]'] +Line 41: Unexpected errors ['callables_kwargs.py:41:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func2: Dict[str, Unpack[TD1]] [assert-type]'] +Line 47: Unexpected errors ['callables_kwargs.py:47:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func3: Function func1 was called with the wrong arguments [wrong-arg-types]'] +Line 49: Unexpected errors ["callables_kwargs.py:49:11: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func3: Missing parameter 'v2' in call to function TD2.__init__ [missing-parameter]"] """ diff --git a/conformance/results/pytype/callables_protocol.toml b/conformance/results/pytype/callables_protocol.toml index c80c657f1..1f20354ff 100644 --- a/conformance/results/pytype/callables_protocol.toml +++ b/conformance/results/pytype/callables_protocol.toml @@ -3,15 +3,43 @@ notes = """ Does not properly handle type compatibility checks with callback protocols. """ output = """ -File "callables_protocol.py", line 9, in : argument "contravariant" to TypeVar not supported yet [not-supported-yet] -File "callables_protocol.py", line 10, in : argument "covariant" to TypeVar not supported yet [not-supported-yet] -File "callables_protocol.py", line 121, in : Type annotation for cb6 does not match type of assignment [annotation-type-mismatch] -File "callables_protocol.py", line 173, in : argument "covariant" to TypeVar not supported yet [not-supported-yet] -File "callables_protocol.py", line 188, in decorator1: bad return type [bad-return-type] +callables_protocol.py:9:10: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "contravariant" to TypeVar not supported yet [not-supported-yet] + +InputT = TypeVar("InputT", contravariant=True) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +callables_protocol.py:10:11: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet] + +OutputT = TypeVar("OutputT", covariant=True) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +callables_protocol.py:121:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for cb6 does not match type of assignment [annotation-type-mismatch] + +cb6: NotProto6 = cb6_bad1 # E: NotProto6 isn't a protocol class +\u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +callables_protocol.py:173:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet] + +R = TypeVar("R", covariant=True) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +callables_protocol.py:188:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in decorator1: bad return type [bad-return-type] + + return converted + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + Called from (traceback): line 191, in current file -File "callables_protocol.py", line 197, in : No attribute 'other_attribute2' on Proto9[Any, str] [attribute-error] -File "callables_protocol.py", line 199, in : Function Proto9.__call__ was called with the wrong arguments [wrong-arg-types] +callables_protocol.py:197:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : No attribute 'other_attribute2' on Proto9[Any, str] [attribute-error] + +print(cb9_good.other_attribute2) # E: unknown attribute + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +callables_protocol.py:199:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Proto9.__call__ was called with the wrong arguments [wrong-arg-types] + +cb9_good(x=3) +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -30,9 +58,9 @@ Line 238: Expected 1 errors Line 260: Expected 1 errors Line 284: Expected 1 errors Line 311: Expected 1 errors -Line 9: Unexpected errors ['File "callables_protocol.py", line 9, in : argument "contravariant" to TypeVar not supported yet [not-supported-yet]'] -Line 10: Unexpected errors ['File "callables_protocol.py", line 10, in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] -Line 173: Unexpected errors ['File "callables_protocol.py", line 173, in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] -Line 188: Unexpected errors ['File "callables_protocol.py", line 188, in decorator1: bad return type [bad-return-type]'] -Line 199: Unexpected errors ['File "callables_protocol.py", line 199, in : Function Proto9.__call__ was called with the wrong arguments [wrong-arg-types]'] +Line 9: Unexpected errors ['callables_protocol.py:9:10: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "contravariant" to TypeVar not supported yet [not-supported-yet]'] +Line 10: Unexpected errors ['callables_protocol.py:10:11: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] +Line 173: Unexpected errors ['callables_protocol.py:173:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] +Line 188: Unexpected errors ['callables_protocol.py:188:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in decorator1: bad return type [bad-return-type]'] +Line 199: Unexpected errors ['callables_protocol.py:199:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function Proto9.__call__ was called with the wrong arguments [wrong-arg-types]'] """ diff --git a/conformance/results/pytype/callables_subtyping.toml b/conformance/results/pytype/callables_subtyping.toml index 43e7ac96b..9d940c4ab 100644 --- a/conformance/results/pytype/callables_subtyping.toml +++ b/conformance/results/pytype/callables_subtyping.toml @@ -34,17 +34,41 @@ Line 240: Expected 1 errors Line 243: Expected 1 errors Line 273: Expected 1 errors Line 297: Expected 1 errors -Line 211: Unexpected errors ['File "callables_subtyping.py", line 211, in : Invalid type annotation \\'Callable[[P], None][P]\\' [invalid-annotation]'] -Line 213: Unexpected errors ['File "callables_subtyping.py", line 213, in func7: Invalid type annotation \\'TypeAliasWithP[P]\\' [invalid-annotation]'] -Line 255: Unexpected errors ['File "callables_subtyping.py", line 255, in __call__: @typing.overload-decorated \\'Overloaded9.__call__\\' object is not callable [not-callable]'] -Line 284: Unexpected errors ['File "callables_subtyping.py", line 284, in __call__: @typing.overload-decorated \\'Overloaded10.__call__\\' object is not callable [not-callable]'] +Line 211: Unexpected errors ["callables_subtyping.py:211:40: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Callable[[P], None][P]' [invalid-annotation]"] +Line 213: Unexpected errors ["callables_subtyping.py:213:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func7: Invalid type annotation 'TypeAliasWithP[P]' [invalid-annotation]"] +Line 255: Unexpected errors ["callables_subtyping.py:255:40: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __call__: @typing.overload-decorated 'Overloaded9.__call__' object is not callable [not-callable]"] +Line 284: Unexpected errors ["callables_subtyping.py:284:44: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __call__: @typing.overload-decorated 'Overloaded10.__call__' object is not callable [not-callable]"] """ output = """ -File "callables_subtyping.py", line 26, in func1: Type annotation for f6 does not match type of assignment [annotation-type-mismatch] -File "callables_subtyping.py", line 29, in func1: Type annotation for f8 does not match type of assignment [annotation-type-mismatch] -File "callables_subtyping.py", line 211, in : Invalid type annotation 'Callable[[P], None][P]' [invalid-annotation] -File "callables_subtyping.py", line 213, in func7: Invalid type annotation 'TypeAliasWithP[P]' [invalid-annotation] -File "callables_subtyping.py", line 255, in __call__: @typing.overload-decorated 'Overloaded9.__call__' object is not callable [not-callable] -File "callables_subtyping.py", line 284, in __call__: @typing.overload-decorated 'Overloaded10.__call__' object is not callable [not-callable] +callables_subtyping.py:26:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Type annotation for f6 does not match type of assignment [annotation-type-mismatch] + + f6: Callable[[float], float] = cb3 # E + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +callables_subtyping.py:29:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Type annotation for f8 does not match type of assignment [annotation-type-mismatch] + + f8: Callable[[int], int] = cb2 # E + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +callables_subtyping.py:211:40: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Callable[[P], None][P]' [invalid-annotation] + +def func7(proto: ProtocolWithP[P], ta: TypeAliasWithP[P]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +callables_subtyping.py:213:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func7: Invalid type annotation 'TypeAliasWithP[P]' [invalid-annotation] + + f1: TypeAliasWithP[P] = proto # OK + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +callables_subtyping.py:255:40: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __call__: @typing.overload-decorated 'Overloaded9.__call__' object is not callable [not-callable] + + def __call__(self, x: str) -> str: ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +callables_subtyping.py:284:44: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __call__: @typing.overload-decorated 'Overloaded10.__call__' object is not callable [not-callable] + + def __call__(self, x: str) -> complex: ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" diff --git a/conformance/results/pytype/classes_classvar.toml b/conformance/results/pytype/classes_classvar.toml index c79f592cb..d042ebf8d 100644 --- a/conformance/results/pytype/classes_classvar.toml +++ b/conformance/results/pytype/classes_classvar.toml @@ -12,19 +12,104 @@ Does not reject use of ClassVar in type alias definition. Does not reject assignment of ClassVar through instance of class. """ output = """ -File "classes_classvar.py", line 7, in : typing.TypeVarTuple not supported yet [not-supported-yet] -File "classes_classvar.py", line 29, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] -File "classes_classvar.py", line 38, in ClassA: Invalid type annotation 'ClassVar[int, str]' [invalid-annotation] -File "classes_classvar.py", line 38, in ClassA: Invalid type annotation 'ClassVar[int, str]' [invalid-annotation] -File "classes_classvar.py", line 39, in ClassA: class ClassVar is not indexable [not-indexable] -File "classes_classvar.py", line 39, in ClassA: Invalid type annotation 'CV[3]' [invalid-annotation] -File "classes_classvar.py", line 40, in ClassA: Name 'var' is not defined [name-error] -File "classes_classvar.py", line 52, in ClassA: Type annotation for bad8 does not match type of assignment [annotation-type-mismatch] -File "classes_classvar.py", line 60, in ClassA: Type annotation for good4 does not match type of assignment [annotation-type-mismatch] -File "classes_classvar.py", line 68, in method2: bad return type [bad-return-type] -File "classes_classvar.py", line 78, in : ClassVar [assert-type] -File "classes_classvar.py", line 124, in ProtoA: Type annotation for z does not match type of assignment [annotation-type-mismatch] -File "classes_classvar.py", line 134, in : Type annotation for a does not match type of assignment [annotation-type-mismatch] +classes_classvar.py:7:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet] + +from typing import ( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + Annotated, +\u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + Any, +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + Callable, +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + ClassVar, +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + Final, +\u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + Generic, +\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + ParamSpec, +\u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + Protocol, +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + TypeAlias, +\u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + TypeVar, +\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + TypeVarTuple, +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + assert_type, +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + cast, +\u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m +) +\u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +classes_classvar.py:29:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] + +Ts = TypeVarTuple("Ts") + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +classes_classvar.py:38:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassA: Invalid type annotation 'ClassVar[int, str]' [invalid-annotation] + + bad1: ClassVar[int, str] = cast(Any, 0) # E: too many arguments + \u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m + +classes_classvar.py:38:11: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassA: Invalid type annotation 'ClassVar[int, str]' [invalid-annotation] + + bad1: ClassVar[int, str] = cast(Any, 0) # E: too many arguments + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +classes_classvar.py:39:11: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassA: class ClassVar is not indexable [not-indexable] + + bad2: CV[3] = cast(Any, 0) # E: invalid type + \u001b[1m\u001b[31m~~~~~\u001b[39m\u001b[0m + +classes_classvar.py:39:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassA: Invalid type annotation 'CV[3]' [invalid-annotation] + + bad2: CV[3] = cast(Any, 0) # E: invalid type + \u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m + +classes_classvar.py:40:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassA: Name 'var' is not defined [name-error] + + bad3: CV[var] = cast(Any, 0) # E: invalid type + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +classes_classvar.py:40:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassA: Name 'var' is not defined [name-error] + + bad3: CV[var] = cast(Any, 0) # E: invalid type + \u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m + +classes_classvar.py:52:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassA: Type annotation for bad8 does not match type of assignment [annotation-type-mismatch] + + bad8: ClassVar[list[str]] = {} # E: type violation in initialization + \u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m + +classes_classvar.py:60:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassA: Type annotation for good4 does not match type of assignment [annotation-type-mismatch] + + good4: ClassVar = 3.1 + \u001b[1m\u001b[31m~~~~~\u001b[39m\u001b[0m + +classes_classvar.py:68:16: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method2: bad return type [bad-return-type] + + return 3 + \u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +classes_classvar.py:78:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : ClassVar [assert-type] + +assert_type(ClassA.good4, float) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +classes_classvar.py:124:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ProtoA: Type annotation for z does not match type of assignment [annotation-type-mismatch] + + z: CV = [""] + \u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +classes_classvar.py:134:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for a does not match type of assignment [annotation-type-mismatch] + +a: ProtoA = ProtoAImpl() # E: y is not a ClassVar +\u001b[1m\u001b[31m~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -40,10 +125,10 @@ Line 67: Expected 1 errors Line 71: Expected 1 errors Line 72: Expected 1 errors Line 105: Expected 1 errors -Line 7: Unexpected errors ['File "classes_classvar.py", line 7, in : typing.TypeVarTuple not supported yet [not-supported-yet]'] -Line 29: Unexpected errors ['File "classes_classvar.py", line 29, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] -Line 60: Unexpected errors ['File "classes_classvar.py", line 60, in ClassA: Type annotation for good4 does not match type of assignment [annotation-type-mismatch]'] -Line 68: Unexpected errors ['File "classes_classvar.py", line 68, in method2: bad return type [bad-return-type]'] -Line 78: Unexpected errors ['File "classes_classvar.py", line 78, in : ClassVar [assert-type]'] -Line 124: Unexpected errors ['File "classes_classvar.py", line 124, in ProtoA: Type annotation for z does not match type of assignment [annotation-type-mismatch]'] +Line 7: Unexpected errors ['classes_classvar.py:7:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet]'] +Line 29: Unexpected errors ['classes_classvar.py:29:6: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] +Line 60: Unexpected errors ['classes_classvar.py:60:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in ClassA: Type annotation for good4 does not match type of assignment [annotation-type-mismatch]'] +Line 68: Unexpected errors ['classes_classvar.py:68:16: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method2: bad return type [bad-return-type]'] +Line 78: Unexpected errors ['classes_classvar.py:78:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : ClassVar [assert-type]'] +Line 124: Unexpected errors ['classes_classvar.py:124:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in ProtoA: Type annotation for z does not match type of assignment [annotation-type-mismatch]'] """ diff --git a/conformance/results/pytype/classes_override.toml b/conformance/results/pytype/classes_override.toml index 8395e9206..b3daac6bc 100644 --- a/conformance/results/pytype/classes_override.toml +++ b/conformance/results/pytype/classes_override.toml @@ -3,13 +3,47 @@ notes = """ Does not yet support the @override decorator. """ output = """ -File "classes_override.py", line 7, in : typing.override not supported yet [not-supported-yet] -File "classes_override.py", line 30, in method2: bad return type [bad-return-type] -File "classes_override.py", line 50, in method2: bad return type [bad-return-type] -File "classes_override.py", line 53, in ChildA: Attribute 'method3' not found on any parent class [override-error] -File "classes_override.py", line 57, in ChildA: Attribute 'method4' not found on any parent class [override-error] -File "classes_override.py", line 66, in method4: bad return type [bad-return-type] -File "classes_override.py", line 101, in ChildB: Attribute 'method1' not found on any parent class [override-error] +classes_override.py:7:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing.override not supported yet [not-supported-yet] + +from typing import Any, Callable, overload, override +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +classes_override.py:30:16: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method2: bad return type [bad-return-type] + + return 0 + \u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +classes_override.py:50:16: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method2: bad return type [bad-return-type] + + return 0 + \u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +classes_override.py:53:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ChildA: Attribute 'method3' not found on any parent class [override-error] + + def method3(self) -> int: # E: no matching signature in ancestor + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + return 1 +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +classes_override.py:57:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ChildA: Attribute 'method4' not found on any parent class [override-error] + + def method4(self, x: int) -> int: + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +classes_override.py:66:16: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method4: bad return type [bad-return-type] + + return 0 + \u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +classes_override.py:101:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ChildB: Attribute 'method1' not found on any parent class [override-error] + + def method1(self) -> None: # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -17,10 +51,10 @@ Line 79: Expected 1 errors Line 84: Expected 1 errors Line 89: Expected 1 errors Lines 56, 65: Expected error (tag 'method4') -Line 7: Unexpected errors ['File "classes_override.py", line 7, in : typing.override not supported yet [not-supported-yet]'] -Line 30: Unexpected errors ['File "classes_override.py", line 30, in method2: bad return type [bad-return-type]'] -Line 50: Unexpected errors ['File "classes_override.py", line 50, in method2: bad return type [bad-return-type]'] -Line 57: Unexpected errors ['File "classes_override.py", line 57, in ChildA: Attribute \\'method4\\' not found on any parent class [override-error]'] -Line 66: Unexpected errors ['File "classes_override.py", line 66, in method4: bad return type [bad-return-type]'] -Line 101: Unexpected errors ['File "classes_override.py", line 101, in ChildB: Attribute \\'method1\\' not found on any parent class [override-error]'] +Line 7: Unexpected errors ['classes_override.py:7:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.override not supported yet [not-supported-yet]'] +Line 30: Unexpected errors ['classes_override.py:30:16: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method2: bad return type [bad-return-type]'] +Line 50: Unexpected errors ['classes_override.py:50:16: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method2: bad return type [bad-return-type]'] +Line 57: Unexpected errors ["classes_override.py:57:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in ChildA: Attribute 'method4' not found on any parent class [override-error]"] +Line 66: Unexpected errors ['classes_override.py:66:16: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method4: bad return type [bad-return-type]'] +Line 101: Unexpected errors ["classes_override.py:101:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in ChildB: Attribute 'method1' not found on any parent class [override-error]"] """ diff --git a/conformance/results/pytype/constructors_call_init.toml b/conformance/results/pytype/constructors_call_init.toml index 0b8000993..b52f3b5b2 100644 --- a/conformance/results/pytype/constructors_call_init.toml +++ b/conformance/results/pytype/constructors_call_init.toml @@ -12,27 +12,79 @@ Line 21: Expected 1 errors Line 42: Expected 1 errors Line 56: Expected 1 errors Line 107: Expected 1 errors -Line 51: Unexpected errors ['File "constructors_call_init.py", line 51, in __init__: Invalid type annotation \\'Class4[int]\\' for self [invalid-annotation]'] -Line 72: Unexpected errors ['File "constructors_call_init.py", line 72, in : Class5 [assert-type]'] -Line 74: Unexpected errors ['File "constructors_call_init.py", line 74, in : Class5 [assert-type]'] -Line 88: Unexpected errors ['File "constructors_call_init.py", line 88, in Class6: Invalid type annotation \\'V2\\' [invalid-annotation]', 'File "constructors_call_init.py", line 88, in Class6: Invalid type annotation \\'V1\\' [invalid-annotation]', 'File "constructors_call_init.py", line 88, in __init__: Invalid type annotation \\'Class6[V1, V2]\\' for self [invalid-annotation]'] -Line 91: Unexpected errors ['File "constructors_call_init.py", line 91, in : Class6 [assert-type]'] -Line 96: Unexpected errors ['File "constructors_call_init.py", line 96, in Class7: Invalid type annotation \\'V2\\' [invalid-annotation]', 'File "constructors_call_init.py", line 96, in Class7: Invalid type annotation \\'V1\\' [invalid-annotation]', 'File "constructors_call_init.py", line 96, in __init__: Invalid type annotation \\'Class7[V2, V1]\\' for self [invalid-annotation]'] -Line 99: Unexpected errors ['File "constructors_call_init.py", line 99, in : Class7 [assert-type]'] -Line 108: Unexpected errors ['File "constructors_call_init.py", line 108, in __init__: Invalid type annotation \\'Class8[T2, T1]\\' for self [invalid-annotation]'] +Line 51: Unexpected errors ["constructors_call_init.py:51:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __init__: Invalid type annotation 'Class4[int]' for self [invalid-annotation]"] +Line 72: Unexpected errors ['constructors_call_init.py:72:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Class5 [assert-type]'] +Line 74: Unexpected errors ['constructors_call_init.py:74:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Class5 [assert-type]'] +Line 88: Unexpected errors ["constructors_call_init.py:88:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in Class6: Invalid type annotation 'V2' [invalid-annotation]", "constructors_call_init.py:88:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in Class6: Invalid type annotation 'V1' [invalid-annotation]", "constructors_call_init.py:88:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __init__: Invalid type annotation 'Class6[V1, V2]' for self [invalid-annotation]"] +Line 91: Unexpected errors ['constructors_call_init.py:91:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Class6 [assert-type]'] +Line 96: Unexpected errors ["constructors_call_init.py:96:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in Class7: Invalid type annotation 'V2' [invalid-annotation]", "constructors_call_init.py:96:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in Class7: Invalid type annotation 'V1' [invalid-annotation]", "constructors_call_init.py:96:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __init__: Invalid type annotation 'Class7[V2, V1]' for self [invalid-annotation]"] +Line 99: Unexpected errors ['constructors_call_init.py:99:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Class7 [assert-type]'] +Line 108: Unexpected errors ["constructors_call_init.py:108:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __init__: Invalid type annotation 'Class8[T2, T1]' for self [invalid-annotation]"] """ output = """ -File "constructors_call_init.py", line 51, in __init__: Invalid type annotation 'Class4[int]' for self [invalid-annotation] -File "constructors_call_init.py", line 72, in : Class5 [assert-type] -File "constructors_call_init.py", line 74, in : Class5 [assert-type] -File "constructors_call_init.py", line 88, in Class6: Invalid type annotation 'V2' [invalid-annotation] -File "constructors_call_init.py", line 88, in Class6: Invalid type annotation 'V1' [invalid-annotation] -File "constructors_call_init.py", line 88, in __init__: Invalid type annotation 'Class6[V1, V2]' for self [invalid-annotation] -File "constructors_call_init.py", line 91, in : Class6 [assert-type] -File "constructors_call_init.py", line 96, in Class7: Invalid type annotation 'V2' [invalid-annotation] -File "constructors_call_init.py", line 96, in Class7: Invalid type annotation 'V1' [invalid-annotation] -File "constructors_call_init.py", line 96, in __init__: Invalid type annotation 'Class7[V2, V1]' for self [invalid-annotation] -File "constructors_call_init.py", line 99, in : Class7 [assert-type] -File "constructors_call_init.py", line 108, in __init__: Invalid type annotation 'Class8[T2, T1]' for self [invalid-annotation] -File "constructors_call_init.py", line 130, in : Function Class11.__init__ expects 1 arg(s), got 2 [wrong-arg-count] +constructors_call_init.py:51:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __init__: Invalid type annotation 'Class4[int]' for self [invalid-annotation] + + def __init__(self: "Class4[int]") -> None: ... +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + +constructors_call_init.py:72:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Class5 [assert-type] + +assert_type(Class5(0), Class5[list[int]]) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_call_init.py:74:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Class5 [assert-type] + +assert_type(Class5(""), Class5[set[str]]) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_call_init.py:88:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Class6: Invalid type annotation 'V2' [invalid-annotation] + + def __init__(self: "Class6[V1, V2]", value1: V1, value2: V2) -> None: ... + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_call_init.py:88:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Class6: Invalid type annotation 'V1' [invalid-annotation] + + def __init__(self: "Class6[V1, V2]", value1: V1, value2: V2) -> None: ... + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_call_init.py:88:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __init__: Invalid type annotation 'Class6[V1, V2]' for self [invalid-annotation] + + def __init__(self: "Class6[V1, V2]", value1: V1, value2: V2) -> None: ... +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + +constructors_call_init.py:91:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Class6 [assert-type] + +assert_type(Class6(0, ""), Class6[int, str]) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_call_init.py:96:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Class7: Invalid type annotation 'V2' [invalid-annotation] + + def __init__(self: "Class7[V2, V1]", value1: V1, value2: V2) -> None: ... + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_call_init.py:96:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Class7: Invalid type annotation 'V1' [invalid-annotation] + + def __init__(self: "Class7[V2, V1]", value1: V1, value2: V2) -> None: ... + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_call_init.py:96:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __init__: Invalid type annotation 'Class7[V2, V1]' for self [invalid-annotation] + + def __init__(self: "Class7[V2, V1]", value1: V1, value2: V2) -> None: ... +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + +constructors_call_init.py:99:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Class7 [assert-type] + +assert_type(Class7(0, ""), Class7[str, int]) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_call_init.py:108:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __init__: Invalid type annotation 'Class8[T2, T1]' for self [invalid-annotation] + + pass + \u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m + +constructors_call_init.py:130:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Class11.__init__ expects 1 arg(s), got 2 [wrong-arg-count] + +Class11(1) # E +\u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + """ diff --git a/conformance/results/pytype/constructors_call_metaclass.toml b/conformance/results/pytype/constructors_call_metaclass.toml index 377ea2840..3fe225c40 100644 --- a/conformance/results/pytype/constructors_call_metaclass.toml +++ b/conformance/results/pytype/constructors_call_metaclass.toml @@ -4,14 +4,38 @@ Does not honor metaclass __call__ method when evaluating constructor call. """ conformance_automated = "Fail" errors_diff = """ -Line 23: Unexpected errors ['File "constructors_call_metaclass.py", line 23, in : Missing parameter \\'x\\' in call to function Class1.__new__ [missing-parameter]', 'File "constructors_call_metaclass.py", line 23, in : Any [assert-type]'] -Line 36: Unexpected errors ['File "constructors_call_metaclass.py", line 36, in : Missing parameter \\'x\\' in call to function Class2.__new__ [missing-parameter]', 'File "constructors_call_metaclass.py", line 36, in : Any [assert-type]'] +Line 23: Unexpected errors ["constructors_call_metaclass.py:23:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Missing parameter 'x' in call to function Class1.__new__ [missing-parameter]", 'constructors_call_metaclass.py:23:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Any [assert-type]'] +Line 36: Unexpected errors ["constructors_call_metaclass.py:36:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Missing parameter 'x' in call to function Class2.__new__ [missing-parameter]", 'constructors_call_metaclass.py:36:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Any [assert-type]'] """ output = """ -File "constructors_call_metaclass.py", line 23, in : Missing parameter 'x' in call to function Class1.__new__ [missing-parameter] -File "constructors_call_metaclass.py", line 23, in : Any [assert-type] -File "constructors_call_metaclass.py", line 36, in : Missing parameter 'x' in call to function Class2.__new__ [missing-parameter] -File "constructors_call_metaclass.py", line 36, in : Any [assert-type] -File "constructors_call_metaclass.py", line 51, in : Missing parameter 'x' in call to function Class3.__new__ [missing-parameter] -File "constructors_call_metaclass.py", line 65, in : Missing parameter 'x' in call to function Class4.__new__ [missing-parameter] +constructors_call_metaclass.py:23:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'x' in call to function Class1.__new__ [missing-parameter] + +assert_type(Class1(), NoReturn) + \u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +constructors_call_metaclass.py:23:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Any [assert-type] + +assert_type(Class1(), NoReturn) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_call_metaclass.py:36:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'x' in call to function Class2.__new__ [missing-parameter] + +assert_type(Class2(), int | Meta2) + \u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +constructors_call_metaclass.py:36:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Any [assert-type] + +assert_type(Class2(), int | Meta2) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_call_metaclass.py:51:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'x' in call to function Class3.__new__ [missing-parameter] + +Class3() # E: Missing argument for 'x' parameter in __new__ +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +constructors_call_metaclass.py:65:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'x' in call to function Class4.__new__ [missing-parameter] + +Class4() # E: Missing argument for 'x' parameter in __new__ +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + """ diff --git a/conformance/results/pytype/constructors_call_new.toml b/conformance/results/pytype/constructors_call_new.toml index 022364fe5..970a8bbe3 100644 --- a/conformance/results/pytype/constructors_call_new.toml +++ b/conformance/results/pytype/constructors_call_new.toml @@ -7,19 +7,43 @@ Does not skip evaluation of __init__ based on __new__ return type. conformance_automated = "Fail" errors_diff = """ Line 21: Expected 1 errors -Line 76: Unexpected errors ['File "constructors_call_new.py", line 76, in : Any [assert-type]'] -Line 89: Unexpected errors ['File "constructors_call_new.py", line 89, in : Missing parameter \\'x\\' in call to function Class6.__init__ [missing-parameter]'] -Line 113: Unexpected errors ['File "constructors_call_new.py", line 113, in __new__: bad return type [bad-return-type]'] -Line 125: Unexpected errors ['File "constructors_call_new.py", line 125, in __new__: bad return type [bad-return-type]'] -Line 140: Unexpected errors ['File "constructors_call_new.py", line 140, in __new__: bad return type [bad-return-type]'] +Line 76: Unexpected errors ['constructors_call_new.py:76:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Any [assert-type]'] +Line 89: Unexpected errors ["constructors_call_new.py:89:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Missing parameter 'x' in call to function Class6.__init__ [missing-parameter]"] +Line 113: Unexpected errors ['constructors_call_new.py:113:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __new__: bad return type [bad-return-type]'] +Line 125: Unexpected errors ['constructors_call_new.py:125:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __new__: bad return type [bad-return-type]'] +Line 140: Unexpected errors ['constructors_call_new.py:140:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __new__: bad return type [bad-return-type]'] """ output = """ -File "constructors_call_new.py", line 76, in : Any [assert-type] -File "constructors_call_new.py", line 89, in : Missing parameter 'x' in call to function Class6.__init__ [missing-parameter] -File "constructors_call_new.py", line 113, in __new__: bad return type [bad-return-type] -File "constructors_call_new.py", line 125, in __new__: bad return type [bad-return-type] -File "constructors_call_new.py", line 140, in __new__: bad return type [bad-return-type] +constructors_call_new.py:76:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Any [assert-type] + + assert_type(Class5(), NoReturn) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_call_new.py:89:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'x' in call to function Class6.__init__ [missing-parameter] + +assert_type(Class6(), int | Class6) + \u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +constructors_call_new.py:113:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __new__: bad return type [bad-return-type] + + def __new__(cls, *args, **kwargs) -> "Class8[list[T]]": ... +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + +constructors_call_new.py:125:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __new__: bad return type [bad-return-type] + + def __new__(cls, *args, **kwargs) -> Self: ... +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + +constructors_call_new.py:140:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __new__: bad return type [bad-return-type] + + def __new__(cls: "type[Class11[int]]") -> "Class11[int]": ... +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + Called from (traceback): line 143, in current file -File "constructors_call_new.py", line 145, in : Function Class11.__new__ was called with the wrong arguments [wrong-arg-types] +constructors_call_new.py:145:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Class11.__new__ was called with the wrong arguments [wrong-arg-types] + +Class11[str]() # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ diff --git a/conformance/results/pytype/constructors_call_type.toml b/conformance/results/pytype/constructors_call_type.toml index 7c07a5f50..9af05589a 100644 --- a/conformance/results/pytype/constructors_call_type.toml +++ b/conformance/results/pytype/constructors_call_type.toml @@ -9,18 +9,46 @@ Line 64: Expected 1 errors Line 72: Expected 1 errors Line 81: Expected 1 errors Line 82: Expected 1 errors -Line 25: Unexpected errors ['File "constructors_call_type.py", line 25, in __new__: Missing parameter \\'cls\\' in call to function object.__new__ [missing-parameter]', 'File "constructors_call_type.py", line 25, in __new__: Invalid keyword arguments (x, y) to function object.__new__ [wrong-keyword-args]'] -Line 62: Unexpected errors ['File "constructors_call_type.py", line 62, in : Invalid type annotation \\'T\\' [invalid-annotation]'] +Line 25: Unexpected errors ["constructors_call_type.py:25:16: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __new__: Missing parameter 'cls' in call to function object.__new__ [missing-parameter]", 'constructors_call_type.py:25:16: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __new__: Invalid keyword arguments (x, y) to function object.__new__ [wrong-keyword-args]'] +Line 62: Unexpected errors ["constructors_call_type.py:62:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'T' [invalid-annotation]"] """ output = """ -File "constructors_call_type.py", line 25, in __new__: Missing parameter 'cls' in call to function object.__new__ [missing-parameter] +constructors_call_type.py:25:16: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __new__: Missing parameter 'cls' in call to function object.__new__ [missing-parameter] + + return super().__new__(*args, **kwargs) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + Called from (traceback): line 30, in func1 -File "constructors_call_type.py", line 25, in __new__: Invalid keyword arguments (x, y) to function object.__new__ [wrong-keyword-args] +constructors_call_type.py:25:16: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __new__: Invalid keyword arguments (x, y) to function object.__new__ [wrong-keyword-args] + + return super().__new__(*args, **kwargs) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + Called from (traceback): line 29, in func1 -File "constructors_call_type.py", line 40, in func2: Missing parameter 'x' in call to function Class2.__new__ [missing-parameter] -File "constructors_call_type.py", line 50, in func3: Missing parameter 'x' in call to function Class3.__init__ [missing-parameter] -File "constructors_call_type.py", line 59, in func4: Function Class4.__init__ expects 1 arg(s), got 2 [wrong-arg-count] -File "constructors_call_type.py", line 62, in : Invalid type annotation 'T' [invalid-annotation] +constructors_call_type.py:40:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func2: Missing parameter 'x' in call to function Class2.__new__ [missing-parameter] + + cls() # E + \u001b[1m\u001b[31m~~~~~\u001b[39m\u001b[0m + +constructors_call_type.py:50:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func3: Missing parameter 'x' in call to function Class3.__init__ [missing-parameter] + + cls() # E + \u001b[1m\u001b[31m~~~~~\u001b[39m\u001b[0m + +constructors_call_type.py:59:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func4: Function Class4.__init__ expects 1 arg(s), got 2 [wrong-arg-count] + + cls(1) # E + \u001b[1m\u001b[31m~~~~~~\u001b[39m\u001b[0m + +constructors_call_type.py:62:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'T' [invalid-annotation] + +def func5(cls: type[T]): +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + cls() # OK +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + cls(1) # E +\u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + """ diff --git a/conformance/results/pytype/constructors_callable.toml b/conformance/results/pytype/constructors_callable.toml index e1199f524..0074fa180 100644 --- a/conformance/results/pytype/constructors_callable.toml +++ b/conformance/results/pytype/constructors_callable.toml @@ -10,69 +10,221 @@ errors_diff = """ Line 51: Expected 1 errors Line 127: Expected 1 errors Line 144: Expected 1 errors -Line 36: Unexpected errors ['File "constructors_callable.py", line 36, in : Callable[[Any], Class1] [reveal-type]'] -Line 49: Unexpected errors ['File "constructors_callable.py", line 49, in : Callable[[Any], Class2] [reveal-type]'] -Line 50: Unexpected errors ['File "constructors_callable.py", line 50, in : Function expects 1 arg(s), got 0 [wrong-arg-count]', 'File "constructors_callable.py", line 50, in : Any [assert-type]'] -Line 57: Unexpected errors ['File "constructors_callable.py", line 57, in __new__: bad return type [bad-return-type]'] -Line 63: Unexpected errors ['File "constructors_callable.py", line 63, in : Callable[[Any], Class3] [reveal-type]'] -Line 73: Unexpected errors ['File "constructors_callable.py", line 73, in __new__: bad return type [bad-return-type]'] -Line 77: Unexpected errors ['File "constructors_callable.py", line 77, in : Callable[[Any], Class4] [reveal-type]'] -Line 78: Unexpected errors ['File "constructors_callable.py", line 78, in : nothing [assert-type]'] -Line 97: Unexpected errors ['File "constructors_callable.py", line 97, in : Callable[[Any], Class5] [reveal-type]'] -Line 100: Unexpected errors ['File "constructors_callable.py", line 100, in : Function expects 1 arg(s), got 0 [wrong-arg-count]', 'File "constructors_callable.py", line 100, in : Any [assert-type]'] -Line 105: Unexpected errors ['File "constructors_callable.py", line 105, in : Invalid keyword argument x to function [wrong-keyword-args]', 'File "constructors_callable.py", line 105, in : Any [assert-type]'] -Line 125: Unexpected errors ['File "constructors_callable.py", line 125, in : Callable[[Any], Class6] [reveal-type]'] -Line 126: Unexpected errors ['File "constructors_callable.py", line 126, in : Function expects 1 arg(s), got 0 [wrong-arg-count]', 'File "constructors_callable.py", line 126, in : Any [assert-type]'] -Line 142: Unexpected errors ['File "constructors_callable.py", line 142, in : Callable[[Any], Class6Any] [reveal-type]'] -Line 143: Unexpected errors ['File "constructors_callable.py", line 143, in : Function expects 1 arg(s), got 0 [wrong-arg-count]'] -Line 161: Unexpected errors ['File "constructors_callable.py", line 161, in : Callable[[Any], Class7] [reveal-type]'] -Line 164: Unexpected errors ['File "constructors_callable.py", line 164, in : Class7 [assert-type]'] -Line 165: Unexpected errors ['File "constructors_callable.py", line 165, in : Class7 [assert-type]'] -Line 182: Unexpected errors ['File "constructors_callable.py", line 182, in : Callable[[Any], Class8[nothing]] [reveal-type]'] -Line 183: Unexpected errors ['File "constructors_callable.py", line 183, in : Function expects 1 arg(s), got 2 [wrong-arg-count]', 'File "constructors_callable.py", line 183, in : Any [assert-type]'] -Line 193: Unexpected errors ['File "constructors_callable.py", line 193, in : Callable[[Any], Class9] [reveal-type]'] -Line 194: Unexpected errors ['File "constructors_callable.py", line 194, in : Function expects 1 arg(s), got 2 [wrong-arg-count]', 'File "constructors_callable.py", line 194, in : Any [assert-type]'] +Line 36: Unexpected errors ['constructors_callable.py:36:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Callable[[Any], Class1] [reveal-type]'] +Line 49: Unexpected errors ['constructors_callable.py:49:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Callable[[Any], Class2] [reveal-type]'] +Line 50: Unexpected errors ['constructors_callable.py:50:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function expects 1 arg(s), got 0 [wrong-arg-count]', 'constructors_callable.py:50:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Any [assert-type]'] +Line 57: Unexpected errors ['constructors_callable.py:57:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __new__: bad return type [bad-return-type]'] +Line 63: Unexpected errors ['constructors_callable.py:63:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Callable[[Any], Class3] [reveal-type]'] +Line 73: Unexpected errors ['constructors_callable.py:73:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __new__: bad return type [bad-return-type]'] +Line 77: Unexpected errors ['constructors_callable.py:77:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Callable[[Any], Class4] [reveal-type]'] +Line 78: Unexpected errors ['constructors_callable.py:78:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : nothing [assert-type]'] +Line 97: Unexpected errors ['constructors_callable.py:97:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Callable[[Any], Class5] [reveal-type]'] +Line 100: Unexpected errors ['constructors_callable.py:100:17: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function expects 1 arg(s), got 0 [wrong-arg-count]', 'constructors_callable.py:100:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Any [assert-type]'] +Line 105: Unexpected errors ['constructors_callable.py:105:17: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid keyword argument x to function [wrong-keyword-args]', 'constructors_callable.py:105:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Any [assert-type]'] +Line 125: Unexpected errors ['constructors_callable.py:125:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Callable[[Any], Class6] [reveal-type]'] +Line 126: Unexpected errors ['constructors_callable.py:126:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function expects 1 arg(s), got 0 [wrong-arg-count]', 'constructors_callable.py:126:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Any [assert-type]'] +Line 142: Unexpected errors ['constructors_callable.py:142:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Callable[[Any], Class6Any] [reveal-type]'] +Line 143: Unexpected errors ['constructors_callable.py:143:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function expects 1 arg(s), got 0 [wrong-arg-count]'] +Line 161: Unexpected errors ['constructors_callable.py:161:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Callable[[Any], Class7] [reveal-type]'] +Line 164: Unexpected errors ['constructors_callable.py:164:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Class7 [assert-type]'] +Line 165: Unexpected errors ['constructors_callable.py:165:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Class7 [assert-type]'] +Line 182: Unexpected errors ['constructors_callable.py:182:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Callable[[Any], Class8[nothing]] [reveal-type]'] +Line 183: Unexpected errors ['constructors_callable.py:183:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function expects 1 arg(s), got 2 [wrong-arg-count]', 'constructors_callable.py:183:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Any [assert-type]'] +Line 193: Unexpected errors ['constructors_callable.py:193:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Callable[[Any], Class9] [reveal-type]'] +Line 194: Unexpected errors ['constructors_callable.py:194:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function expects 1 arg(s), got 2 [wrong-arg-count]', 'constructors_callable.py:194:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Any [assert-type]'] """ output = """ -File "constructors_callable.py", line 36, in : Callable[[Any], Class1] [reveal-type] -File "constructors_callable.py", line 38, in : Function expects 1 arg(s), got 0 [wrong-arg-count] -File "constructors_callable.py", line 39, in : Invalid keyword argument y to function [wrong-keyword-args] -File "constructors_callable.py", line 49, in : Callable[[Any], Class2] [reveal-type] -File "constructors_callable.py", line 50, in : Function expects 1 arg(s), got 0 [wrong-arg-count] -File "constructors_callable.py", line 50, in : Any [assert-type] -File "constructors_callable.py", line 57, in __new__: bad return type [bad-return-type] +constructors_callable.py:36:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Callable[[Any], Class1] [reveal-type] + +reveal_type(r1) # `def (x: int) -> Class1` +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_callable.py:38:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function expects 1 arg(s), got 0 [wrong-arg-count] + +r1() # E +\u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m + +constructors_callable.py:39:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid keyword argument y to function [wrong-keyword-args] + +r1(y=1) # E +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +constructors_callable.py:49:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Callable[[Any], Class2] [reveal-type] + +reveal_type(r2) # `def () -> Class2` +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_callable.py:50:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function expects 1 arg(s), got 0 [wrong-arg-count] + +assert_type(r2(), Class2) + \u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m + +constructors_callable.py:50:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Any [assert-type] + +assert_type(r2(), Class2) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_callable.py:57:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __new__: bad return type [bad-return-type] + + def __new__(cls, *args, **kwargs) -> Self: ... +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + Called from (traceback): line 64, in current file -File "constructors_callable.py", line 63, in : Callable[[Any], Class3] [reveal-type] -File "constructors_callable.py", line 65, in : Function expects 1 arg(s), got 0 [wrong-arg-count] -File "constructors_callable.py", line 66, in : Invalid keyword argument y to function [wrong-keyword-args] -File "constructors_callable.py", line 67, in : Function expects 1 arg(s), got 2 [wrong-arg-count] -File "constructors_callable.py", line 73, in __new__: bad return type [bad-return-type] +constructors_callable.py:63:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Callable[[Any], Class3] [reveal-type] + +reveal_type(r3) # `def (x: int) -> Class3` +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_callable.py:65:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function expects 1 arg(s), got 0 [wrong-arg-count] + +r3() # E +\u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m + +constructors_callable.py:66:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid keyword argument y to function [wrong-keyword-args] + +r3(y=1) # E +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +constructors_callable.py:67:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function expects 1 arg(s), got 2 [wrong-arg-count] + +r3(1, 2) # E +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +constructors_callable.py:73:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __new__: bad return type [bad-return-type] + + def __new__(cls, x: int) -> int: ... +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + Called from (traceback): line 78, in current file -File "constructors_callable.py", line 77, in : Callable[[Any], Class4] [reveal-type] -File "constructors_callable.py", line 78, in : nothing [assert-type] -File "constructors_callable.py", line 79, in : Function expects 1 arg(s), got 0 [wrong-arg-count] -File "constructors_callable.py", line 80, in : Invalid keyword argument y to function [wrong-keyword-args] -File "constructors_callable.py", line 97, in : Callable[[Any], Class5] [reveal-type] -File "constructors_callable.py", line 100, in : Function expects 1 arg(s), got 0 [wrong-arg-count] -File "constructors_callable.py", line 100, in : Any [assert-type] -File "constructors_callable.py", line 105, in : Invalid keyword argument x to function [wrong-keyword-args] -File "constructors_callable.py", line 105, in : Any [assert-type] -File "constructors_callable.py", line 125, in : Callable[[Any], Class6] [reveal-type] -File "constructors_callable.py", line 126, in : Function expects 1 arg(s), got 0 [wrong-arg-count] -File "constructors_callable.py", line 126, in : Any [assert-type] -File "constructors_callable.py", line 142, in : Callable[[Any], Class6Any] [reveal-type] -File "constructors_callable.py", line 143, in : Function expects 1 arg(s), got 0 [wrong-arg-count] -File "constructors_callable.py", line 161, in : Callable[[Any], Class7] [reveal-type] -File "constructors_callable.py", line 164, in : Class7 [assert-type] -File "constructors_callable.py", line 165, in : Class7 [assert-type] -File "constructors_callable.py", line 182, in : Callable[[Any], Class8[nothing]] [reveal-type] -File "constructors_callable.py", line 183, in : Function expects 1 arg(s), got 2 [wrong-arg-count] -File "constructors_callable.py", line 183, in : Any [assert-type] -File "constructors_callable.py", line 184, in : Function expects 1 arg(s), got 2 [wrong-arg-count] -File "constructors_callable.py", line 193, in : Callable[[Any], Class9] [reveal-type] -File "constructors_callable.py", line 194, in : Function expects 1 arg(s), got 2 [wrong-arg-count] -File "constructors_callable.py", line 194, in : Any [assert-type] -File "constructors_callable.py", line 195, in : Function expects 1 arg(s), got 2 [wrong-arg-count] +constructors_callable.py:77:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Callable[[Any], Class4] [reveal-type] + +reveal_type(r4) # `def (x: int) -> int` +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_callable.py:78:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : nothing [assert-type] + +assert_type(r4(1), int) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_callable.py:79:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function expects 1 arg(s), got 0 [wrong-arg-count] + +r4() # E +\u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m + +constructors_callable.py:80:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid keyword argument y to function [wrong-keyword-args] + +r4(y=1) # E +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +constructors_callable.py:97:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Callable[[Any], Class5] [reveal-type] + +reveal_type(r5) # `def (*args: Any, **kwargs: Any) -> NoReturn` +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_callable.py:100:17: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function expects 1 arg(s), got 0 [wrong-arg-count] + + assert_type(r5(), NoReturn) + \u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m + +constructors_callable.py:100:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Any [assert-type] + + assert_type(r5(), NoReturn) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_callable.py:105:17: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid keyword argument x to function [wrong-keyword-args] + + assert_type(r5(1, x=1), NoReturn) + \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_callable.py:105:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Any [assert-type] + + assert_type(r5(1, x=1), NoReturn) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_callable.py:125:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Callable[[Any], Class6] [reveal-type] + +reveal_type(r6) # `def () -> Class6Proxy` +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_callable.py:126:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function expects 1 arg(s), got 0 [wrong-arg-count] + +assert_type(r6(), Class6Proxy) + \u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m + +constructors_callable.py:126:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Any [assert-type] + +assert_type(r6(), Class6Proxy) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_callable.py:142:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Callable[[Any], Class6Any] [reveal-type] + +reveal_type(r6_any) # `def () -> Any` +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_callable.py:143:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function expects 1 arg(s), got 0 [wrong-arg-count] + +assert_type(r6_any(), Any) + \u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +constructors_callable.py:161:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Callable[[Any], Class7] [reveal-type] + +reveal_type( +\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + r7 +\u001b[1m\u001b[31m~~~~~~\u001b[39m\u001b[0m +) # overload of `def (x: int) -> Class7[int]` and `def (x: str) -> Class7[str]` +\u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +constructors_callable.py:164:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Class7 [assert-type] + +assert_type(r7(0), Class7[int]) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_callable.py:165:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Class7 [assert-type] + +assert_type(r7(""), Class7[str]) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_callable.py:182:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Callable[[Any], Class8[nothing]] [reveal-type] + +reveal_type(r8) # `def [T] (x: T, y: list[T]) -> Class8[T]` +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_callable.py:183:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function expects 1 arg(s), got 2 [wrong-arg-count] + +assert_type(r8([""], [""]), Class8[str]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_callable.py:183:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Any [assert-type] + +assert_type(r8([""], [""]), Class8[str]) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_callable.py:184:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function expects 1 arg(s), got 2 [wrong-arg-count] + +r8([1], [""]) # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_callable.py:193:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Callable[[Any], Class9] [reveal-type] + +reveal_type(r9) # `def [T] (x: list[T], y: list[T]) -> Class9` +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_callable.py:194:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function expects 1 arg(s), got 2 [wrong-arg-count] + +assert_type(r9([""], [""]), Class9) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_callable.py:194:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Any [assert-type] + +assert_type(r9([""], [""]), Class9) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_callable.py:195:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function expects 1 arg(s), got 2 [wrong-arg-count] + +r9([1], [""]) # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ diff --git a/conformance/results/pytype/dataclasses_descriptors.toml b/conformance/results/pytype/dataclasses_descriptors.toml index f27186ccd..04f115500 100644 --- a/conformance/results/pytype/dataclasses_descriptors.toml +++ b/conformance/results/pytype/dataclasses_descriptors.toml @@ -3,36 +3,76 @@ notes = """ Does not understand descriptor objects in dataclass. """ output = """ -File "dataclasses_descriptors.py", line 24, in __get__: bad return type [bad-return-type] +dataclasses_descriptors.py:24:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __get__: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + Called from (traceback): line 38, in current file -File "dataclasses_descriptors.py", line 24, in __get__: bad return type [bad-return-type] +dataclasses_descriptors.py:24:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __get__: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + Called from (traceback): line 37, in current file -File "dataclasses_descriptors.py", line 35, in : Function DC1.__init__ was called with the wrong arguments [wrong-arg-types] -File "dataclasses_descriptors.py", line 51, in __get__: bad return type [bad-return-type] +dataclasses_descriptors.py:35:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function DC1.__init__ was called with the wrong arguments [wrong-arg-types] + +dc1 = DC1(3) + \u001b[1m\u001b[31m~~~~~~\u001b[39m\u001b[0m + +dataclasses_descriptors.py:51:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __get__: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + Called from (traceback): line 68, in current file -File "dataclasses_descriptors.py", line 51, in __get__: bad return type [bad-return-type] +dataclasses_descriptors.py:51:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __get__: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + Called from (traceback): line 67, in current file -File "dataclasses_descriptors.py", line 51, in __get__: bad return type [bad-return-type] +dataclasses_descriptors.py:51:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __get__: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + Called from (traceback): line 66, in current file -File "dataclasses_descriptors.py", line 51, in __get__: bad return type [bad-return-type] +dataclasses_descriptors.py:51:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __get__: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + Called from (traceback): line 63, in current file -File "dataclasses_descriptors.py", line 51, in __get__: bad return type [bad-return-type] +dataclasses_descriptors.py:51:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __get__: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + Called from (traceback): line 62, in current file -File "dataclasses_descriptors.py", line 51, in __get__: bad return type [bad-return-type] +dataclasses_descriptors.py:51:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __get__: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + Called from (traceback): line 61, in current file -File "dataclasses_descriptors.py", line 51, in __get__: bad return type [bad-return-type] +dataclasses_descriptors.py:51:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __get__: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ -Line 24: Unexpected errors ['File "dataclasses_descriptors.py", line 24, in __get__: bad return type [bad-return-type]', 'File "dataclasses_descriptors.py", line 24, in __get__: bad return type [bad-return-type]'] -Line 35: Unexpected errors ['File "dataclasses_descriptors.py", line 35, in : Function DC1.__init__ was called with the wrong arguments [wrong-arg-types]'] -Line 51: Unexpected errors ['File "dataclasses_descriptors.py", line 51, in __get__: bad return type [bad-return-type]', 'File "dataclasses_descriptors.py", line 51, in __get__: bad return type [bad-return-type]', 'File "dataclasses_descriptors.py", line 51, in __get__: bad return type [bad-return-type]', 'File "dataclasses_descriptors.py", line 51, in __get__: bad return type [bad-return-type]', 'File "dataclasses_descriptors.py", line 51, in __get__: bad return type [bad-return-type]', 'File "dataclasses_descriptors.py", line 51, in __get__: bad return type [bad-return-type]', 'File "dataclasses_descriptors.py", line 51, in __get__: bad return type [bad-return-type]'] +Line 24: Unexpected errors ['dataclasses_descriptors.py:24:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __get__: bad return type [bad-return-type]', 'dataclasses_descriptors.py:24:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __get__: bad return type [bad-return-type]'] +Line 35: Unexpected errors ['dataclasses_descriptors.py:35:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function DC1.__init__ was called with the wrong arguments [wrong-arg-types]'] +Line 51: Unexpected errors ['dataclasses_descriptors.py:51:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __get__: bad return type [bad-return-type]', 'dataclasses_descriptors.py:51:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __get__: bad return type [bad-return-type]', 'dataclasses_descriptors.py:51:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __get__: bad return type [bad-return-type]', 'dataclasses_descriptors.py:51:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __get__: bad return type [bad-return-type]', 'dataclasses_descriptors.py:51:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __get__: bad return type [bad-return-type]', 'dataclasses_descriptors.py:51:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __get__: bad return type [bad-return-type]', 'dataclasses_descriptors.py:51:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __get__: bad return type [bad-return-type]'] """ diff --git a/conformance/results/pytype/dataclasses_final.toml b/conformance/results/pytype/dataclasses_final.toml index 3e6e604f3..7d9d915f0 100644 --- a/conformance/results/pytype/dataclasses_final.toml +++ b/conformance/results/pytype/dataclasses_final.toml @@ -6,12 +6,28 @@ errors_diff = """ Line 27: Expected 1 errors Line 35: Expected 1 errors Line 37: Expected 1 errors -Line 18: Unexpected errors ['File "dataclasses_final.py", line 18, in D: Invalid use of typing.Final [final-error]', 'File "dataclasses_final.py", line 18, in D: Invalid type annotation \\'ClassVar[Final[int]]\\' [invalid-annotation]'] +Line 18: Unexpected errors ['dataclasses_final.py:18:21: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in D: Invalid use of typing.Final [final-error]', "dataclasses_final.py:18:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in D: Invalid type annotation 'ClassVar[Final[int]]' [invalid-annotation]"] """ output = """ -File "dataclasses_final.py", line 18, in D: Invalid use of typing.Final [final-error] -File "dataclasses_final.py", line 18, in D: Invalid type annotation 'ClassVar[Final[int]]' [invalid-annotation] -File "dataclasses_final.py", line 36, in : Assigning to attribute final_with_default, which was annotated with Final [final-error] -File "dataclasses_final.py", line 38, in : Assigning to attribute final_with_default, which was annotated with Final [final-error] +dataclasses_final.py:18:21: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in D: Invalid use of typing.Final [final-error] + + final_classvar: ClassVar[Final[int]] = 4 + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_final.py:18:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in D: Invalid type annotation 'ClassVar[Final[int]]' [invalid-annotation] + + final_classvar: ClassVar[Final[int]] = 4 + \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_final.py:36:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Assigning to attribute final_with_default, which was annotated with Final [final-error] + +d.final_with_default = "baz" # E: can't assign to final attribute +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_final.py:38:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Assigning to attribute final_with_default, which was annotated with Final [final-error] + +D.final_with_default = "baz" # E: can't assign to final attribute +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" diff --git a/conformance/results/pytype/dataclasses_kwonly.toml b/conformance/results/pytype/dataclasses_kwonly.toml index 76a22f8af..4166e7030 100644 --- a/conformance/results/pytype/dataclasses_kwonly.toml +++ b/conformance/results/pytype/dataclasses_kwonly.toml @@ -4,18 +4,46 @@ Incorrectly reports error when kw_only field has default value. Incorrectly rejects kw_only field with default before positional field. """ output = """ -File "dataclasses_kwonly.py", line 23, in : Function DC1.__init__ expects 2 arg(s), got 3 [wrong-arg-count] -File "dataclasses_kwonly.py", line 38, in : Function DC2.__init__ expects 2 arg(s), got 3 [wrong-arg-count] -File "dataclasses_kwonly.py", line 47, in : Missing parameter 'a' in call to function DC3.__init__ [missing-parameter] -File "dataclasses_kwonly.py", line 50, in : Missing parameter 'a' in call to function DC3.__init__ [missing-parameter] -File "dataclasses_kwonly.py", line 53, in : Missing parameter 'a' in call to function DC3.__init__ [missing-parameter] -File "dataclasses_kwonly.py", line 56, in : In method __init__, non-default argument c follows default argument [invalid-function-definition] -File "dataclasses_kwonly.py", line 61, in : function DC4.__init__ got multiple values for keyword argument 'b' [duplicate-keyword-argument] +dataclasses_kwonly.py:23:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function DC1.__init__ expects 2 arg(s), got 3 [wrong-arg-count] + +DC1("hi", 1) # E +\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_kwonly.py:38:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function DC2.__init__ expects 2 arg(s), got 3 [wrong-arg-count] + +DC2("hi", 1) # E +\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_kwonly.py:47:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'a' in call to function DC3.__init__ [missing-parameter] + +DC3("hi") +\u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_kwonly.py:50:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'a' in call to function DC3.__init__ [missing-parameter] + +DC3("hi", b=1) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_kwonly.py:53:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'a' in call to function DC3.__init__ [missing-parameter] + +DC3("hi", 1) # E +\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_kwonly.py:56:2: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : In method __init__, non-default argument c follows default argument [invalid-function-definition] + +@dataclass + \u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_kwonly.py:61:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : function DC4.__init__ got multiple values for keyword argument 'b' [duplicate-keyword-argument] + +DC4("", 0.2, b=3) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ -Line 47: Unexpected errors ['File "dataclasses_kwonly.py", line 47, in : Missing parameter \\'a\\' in call to function DC3.__init__ [missing-parameter]'] -Line 50: Unexpected errors ['File "dataclasses_kwonly.py", line 50, in : Missing parameter \\'a\\' in call to function DC3.__init__ [missing-parameter]'] -Line 56: Unexpected errors ['File "dataclasses_kwonly.py", line 56, in : In method __init__, non-default argument c follows default argument [invalid-function-definition]'] -Line 61: Unexpected errors ['File "dataclasses_kwonly.py", line 61, in : function DC4.__init__ got multiple values for keyword argument \\'b\\' [duplicate-keyword-argument]'] +Line 47: Unexpected errors ["dataclasses_kwonly.py:47:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Missing parameter 'a' in call to function DC3.__init__ [missing-parameter]"] +Line 50: Unexpected errors ["dataclasses_kwonly.py:50:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Missing parameter 'a' in call to function DC3.__init__ [missing-parameter]"] +Line 56: Unexpected errors ['dataclasses_kwonly.py:56:2: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : In method __init__, non-default argument c follows default argument [invalid-function-definition]'] +Line 61: Unexpected errors ["dataclasses_kwonly.py:61:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : function DC4.__init__ got multiple values for keyword argument 'b' [duplicate-keyword-argument]"] """ diff --git a/conformance/results/pytype/dataclasses_postinit.toml b/conformance/results/pytype/dataclasses_postinit.toml index cf8fa0720..286e7a3d9 100644 --- a/conformance/results/pytype/dataclasses_postinit.toml +++ b/conformance/results/pytype/dataclasses_postinit.toml @@ -4,13 +4,27 @@ Does not validate `__post_init__` method. Reports incorrect error for incompatible `__post_init__` method override. """ output = """ -File "dataclasses_postinit.py", line 28, in : No attribute 'x' on DC1 [attribute-error] -File "dataclasses_postinit.py", line 29, in : No attribute 'y' on DC1 [attribute-error] -File "dataclasses_postinit.py", line 54, in DC4: Overriding method signature mismatch [signature-mismatch] +dataclasses_postinit.py:28:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : No attribute 'x' on DC1 [attribute-error] + +print(dc1.x) # E: cannot access InitVar + \u001b[1m\u001b[31m~~~~~\u001b[39m\u001b[0m + +dataclasses_postinit.py:29:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : No attribute 'y' on DC1 [attribute-error] + +print(dc1.y) # E: cannot access InitVar + \u001b[1m\u001b[31m~~~~~\u001b[39m\u001b[0m + +dataclasses_postinit.py:54:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in DC4: Overriding method signature mismatch [signature-mismatch] + + def __post_init__(self, _name: str, _age: int): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ Line 19: Expected 1 errors Line 36: Expected 1 errors -Line 54: Unexpected errors ['File "dataclasses_postinit.py", line 54, in DC4: Overriding method signature mismatch [signature-mismatch]'] +Line 54: Unexpected errors ['dataclasses_postinit.py:54:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in DC4: Overriding method signature mismatch [signature-mismatch]'] """ diff --git a/conformance/results/pytype/dataclasses_slots.toml b/conformance/results/pytype/dataclasses_slots.toml index e9c80134a..be10aba0c 100644 --- a/conformance/results/pytype/dataclasses_slots.toml +++ b/conformance/results/pytype/dataclasses_slots.toml @@ -5,16 +5,32 @@ Does not reject write to instance variable that is not defined in __slots__. Incorrectly reports error when accessing `__slots__` when `slots=True`. """ output = """ -File "dataclasses_slots.py", line 56, in : No attribute '__slots__' on Type[DC5] [attribute-error] -File "dataclasses_slots.py", line 57, in : No attribute '__slots__' on DC5 [attribute-error] -File "dataclasses_slots.py", line 66, in : No attribute '__slots__' on Type[DC6] [attribute-error] -File "dataclasses_slots.py", line 69, in : No attribute '__slots__' on DC6 [attribute-error] +dataclasses_slots.py:56:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : No attribute '__slots__' on Type[DC5] [attribute-error] + +DC5.__slots__ +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_slots.py:57:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : No attribute '__slots__' on DC5 [attribute-error] + +DC5(1).__slots__ +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_slots.py:66:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : No attribute '__slots__' on Type[DC6] [attribute-error] + +DC6.__slots__ # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_slots.py:69:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : No attribute '__slots__' on DC6 [attribute-error] + +DC6(1).__slots__ # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ Line 25: Expected 1 errors Line 38: Expected 1 errors Lines 10, 11: Expected error (tag 'DC1') -Line 56: Unexpected errors ['File "dataclasses_slots.py", line 56, in : No attribute \\'__slots__\\' on Type[DC5] [attribute-error]'] -Line 57: Unexpected errors ['File "dataclasses_slots.py", line 57, in : No attribute \\'__slots__\\' on DC5 [attribute-error]'] +Line 56: Unexpected errors ["dataclasses_slots.py:56:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : No attribute '__slots__' on Type[DC5] [attribute-error]"] +Line 57: Unexpected errors ["dataclasses_slots.py:57:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : No attribute '__slots__' on DC5 [attribute-error]"] """ diff --git a/conformance/results/pytype/dataclasses_transform_class.toml b/conformance/results/pytype/dataclasses_transform_class.toml index 8d25adeb7..5bbaceedc 100644 --- a/conformance/results/pytype/dataclasses_transform_class.toml +++ b/conformance/results/pytype/dataclasses_transform_class.toml @@ -3,11 +3,43 @@ notes = """ Does not understand @dataclass_transform. """ output = """ -File "dataclasses_transform_class.py", line 23, in : Arguments to dataclass_transform not supported yet [not-supported-yet] -File "dataclasses_transform_class.py", line 60, in : Invalid keyword argument other_name to function Customer1.__init__ [wrong-keyword-args] -File "dataclasses_transform_class.py", line 85, in : Arguments to dataclass_transform not supported yet [not-supported-yet] -File "dataclasses_transform_class.py", line 106, in : Invalid keyword argument id to function GenericCustomer.__init__ [wrong-keyword-args] -File "dataclasses_transform_class.py", line 109, in : Arguments to dataclass_transform not supported yet [not-supported-yet] +dataclasses_transform_class.py:23:2: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Arguments to dataclass_transform not supported yet [not-supported-yet] + +@dataclass_transform( + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + kw_only_default=True, +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + field_specifiers=(ModelField, model_field), +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +) +\u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +dataclasses_transform_class.py:60:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid keyword argument other_name to function Customer1.__init__ [wrong-keyword-args] + +c1_1 = Customer1(id=3, name="Sue", other_name="Susan") + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_transform_class.py:85:2: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Arguments to dataclass_transform not supported yet [not-supported-yet] + +@dataclass_transform( + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + kw_only_default=True, +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + field_specifiers=(ModelField, model_field), +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +) +\u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +dataclasses_transform_class.py:106:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid keyword argument id to function GenericCustomer.__init__ [wrong-keyword-args] + +gc_1 = GenericCustomer(id=3) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_transform_class.py:109:2: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Arguments to dataclass_transform not supported yet [not-supported-yet] + +@dataclass_transform(frozen_default=True) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -17,9 +49,9 @@ Line 66: Expected 1 errors Line 72: Expected 1 errors Line 82: Expected 1 errors Line 122: Expected 1 errors -Line 23: Unexpected errors ['File "dataclasses_transform_class.py", line 23, in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] -Line 60: Unexpected errors ['File "dataclasses_transform_class.py", line 60, in : Invalid keyword argument other_name to function Customer1.__init__ [wrong-keyword-args]'] -Line 85: Unexpected errors ['File "dataclasses_transform_class.py", line 85, in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] -Line 106: Unexpected errors ['File "dataclasses_transform_class.py", line 106, in : Invalid keyword argument id to function GenericCustomer.__init__ [wrong-keyword-args]'] -Line 109: Unexpected errors ['File "dataclasses_transform_class.py", line 109, in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] +Line 23: Unexpected errors ['dataclasses_transform_class.py:23:2: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] +Line 60: Unexpected errors ['dataclasses_transform_class.py:60:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid keyword argument other_name to function Customer1.__init__ [wrong-keyword-args]'] +Line 85: Unexpected errors ['dataclasses_transform_class.py:85:2: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] +Line 106: Unexpected errors ['dataclasses_transform_class.py:106:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid keyword argument id to function GenericCustomer.__init__ [wrong-keyword-args]'] +Line 109: Unexpected errors ['dataclasses_transform_class.py:109:2: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] """ diff --git a/conformance/results/pytype/dataclasses_transform_converter.toml b/conformance/results/pytype/dataclasses_transform_converter.toml index a67010840..14fa83e82 100644 --- a/conformance/results/pytype/dataclasses_transform_converter.toml +++ b/conformance/results/pytype/dataclasses_transform_converter.toml @@ -6,46 +6,118 @@ conformance_automated = "Fail" errors_diff = """ Line 49: Expected 1 errors Line 118: Expected 1 errors -Line 26: Unexpected errors ['File "dataclasses_transform_converter.py", line 26, in model_field: bad return type [bad-return-type]', 'File "dataclasses_transform_converter.py", line 26, in model_field: bad return type [bad-return-type]', 'File "dataclasses_transform_converter.py", line 26, in model_field: bad return type [bad-return-type]', 'File "dataclasses_transform_converter.py", line 26, in model_field: bad return type [bad-return-type]', 'File "dataclasses_transform_converter.py", line 26, in model_field: bad return type [bad-return-type]'] -Line 29: Unexpected errors ['File "dataclasses_transform_converter.py", line 29, in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] -Line 112: Unexpected errors ['File "dataclasses_transform_converter.py", line 112, in : Function DC2.__init__ was called with the wrong arguments [wrong-arg-types]'] -Line 114: Unexpected errors ['File "dataclasses_transform_converter.py", line 114, in : Type annotation for field0 does not match type of assignment [annotation-type-mismatch]'] -Line 115: Unexpected errors ['File "dataclasses_transform_converter.py", line 115, in : Type annotation for field3 does not match type of assignment [annotation-type-mismatch]'] -Line 116: Unexpected errors ['File "dataclasses_transform_converter.py", line 116, in : Type annotation for field3 does not match type of assignment [annotation-type-mismatch]'] -Line 121: Unexpected errors ['File "dataclasses_transform_converter.py", line 121, in : Function DC2.__init__ was called with the wrong arguments [wrong-arg-types]'] +Line 26: Unexpected errors ['dataclasses_transform_converter.py:26:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in model_field: bad return type [bad-return-type]', 'dataclasses_transform_converter.py:26:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in model_field: bad return type [bad-return-type]', 'dataclasses_transform_converter.py:26:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in model_field: bad return type [bad-return-type]', 'dataclasses_transform_converter.py:26:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in model_field: bad return type [bad-return-type]', 'dataclasses_transform_converter.py:26:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in model_field: bad return type [bad-return-type]'] +Line 29: Unexpected errors ['dataclasses_transform_converter.py:29:2: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] +Line 112: Unexpected errors ['dataclasses_transform_converter.py:112:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function DC2.__init__ was called with the wrong arguments [wrong-arg-types]'] +Line 114: Unexpected errors ['dataclasses_transform_converter.py:114:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for field0 does not match type of assignment [annotation-type-mismatch]'] +Line 115: Unexpected errors ['dataclasses_transform_converter.py:115:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for field3 does not match type of assignment [annotation-type-mismatch]'] +Line 116: Unexpected errors ['dataclasses_transform_converter.py:116:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for field3 does not match type of assignment [annotation-type-mismatch]'] +Line 121: Unexpected errors ['dataclasses_transform_converter.py:121:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function DC2.__init__ was called with the wrong arguments [wrong-arg-types]'] """ output = """ -File "dataclasses_transform_converter.py", line 26, in model_field: bad return type [bad-return-type] +dataclasses_transform_converter.py:26:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in model_field: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + Called from (traceback): line 98, in current file line 99, in DC2 -File "dataclasses_transform_converter.py", line 26, in model_field: bad return type [bad-return-type] +dataclasses_transform_converter.py:26:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in model_field: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + Called from (traceback): line 98, in current file line 104, in DC2 -File "dataclasses_transform_converter.py", line 26, in model_field: bad return type [bad-return-type] +dataclasses_transform_converter.py:26:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in model_field: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + Called from (traceback): line 98, in current file line 102, in DC2 -File "dataclasses_transform_converter.py", line 26, in model_field: bad return type [bad-return-type] +dataclasses_transform_converter.py:26:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in model_field: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + Called from (traceback): line 98, in current file line 100, in DC2 -File "dataclasses_transform_converter.py", line 26, in model_field: bad return type [bad-return-type] +dataclasses_transform_converter.py:26:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in model_field: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + Called from (traceback): line 47, in current file line 49, in DC1 -File "dataclasses_transform_converter.py", line 29, in : Arguments to dataclass_transform not supported yet [not-supported-yet] -File "dataclasses_transform_converter.py", line 48, in DC1: Function model_field was called with the wrong arguments [wrong-arg-types] -File "dataclasses_transform_converter.py", line 107, in : Function DC2.__init__ was called with the wrong arguments [wrong-arg-types] -File "dataclasses_transform_converter.py", line 108, in : Function DC2.__init__ was called with the wrong arguments [wrong-arg-types] -File "dataclasses_transform_converter.py", line 109, in : Function DC2.__init__ was called with the wrong arguments [wrong-arg-types] -File "dataclasses_transform_converter.py", line 112, in : Function DC2.__init__ was called with the wrong arguments [wrong-arg-types] -File "dataclasses_transform_converter.py", line 114, in : Type annotation for field0 does not match type of assignment [annotation-type-mismatch] -File "dataclasses_transform_converter.py", line 115, in : Type annotation for field3 does not match type of assignment [annotation-type-mismatch] -File "dataclasses_transform_converter.py", line 116, in : Type annotation for field3 does not match type of assignment [annotation-type-mismatch] -File "dataclasses_transform_converter.py", line 119, in : Type annotation for field3 does not match type of assignment [annotation-type-mismatch] -File "dataclasses_transform_converter.py", line 121, in : Function DC2.__init__ was called with the wrong arguments [wrong-arg-types] -File "dataclasses_transform_converter.py", line 130, in DC3: Function model_field was called with the wrong arguments [wrong-arg-types] -File "dataclasses_transform_converter.py", line 133, in DC3: Function model_field was called with the wrong arguments [wrong-arg-types] +dataclasses_transform_converter.py:29:2: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Arguments to dataclass_transform not supported yet [not-supported-yet] + +@dataclass_transform(field_specifiers=(model_field,)) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_transform_converter.py:48:19: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in DC1: Function model_field was called with the wrong arguments [wrong-arg-types] + + field1: int = model_field(converter=bad_converter1) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_transform_converter.py:107:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function DC2.__init__ was called with the wrong arguments [wrong-arg-types] + +DC2(1, "f1", "f2", b"f3", []) # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_transform_converter.py:108:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function DC2.__init__ was called with the wrong arguments [wrong-arg-types] + +DC2("f0", "f1", "f2", 1, []) # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_transform_converter.py:109:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function DC2.__init__ was called with the wrong arguments [wrong-arg-types] + +DC2("f0", "f1", "f2", "f3", 3j) # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_transform_converter.py:112:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function DC2.__init__ was called with the wrong arguments [wrong-arg-types] + +dc1 = DC2("f0", "f1", "f2", b"f6", []) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_transform_converter.py:114:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for field0 does not match type of assignment [annotation-type-mismatch] + +dc1.field0 = "f1" +\u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_transform_converter.py:115:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for field3 does not match type of assignment [annotation-type-mismatch] + +dc1.field3 = "f6" +\u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_transform_converter.py:116:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for field3 does not match type of assignment [annotation-type-mismatch] + +dc1.field3 = b"f6" +\u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_transform_converter.py:119:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for field3 does not match type of assignment [annotation-type-mismatch] + +dc1.field3 = 1 # E +\u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_transform_converter.py:121:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function DC2.__init__ was called with the wrong arguments [wrong-arg-types] + +dc2 = DC2("f0", "f1", "f2", "f6", "1", (("a", "1"), ("b", "2"))) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_transform_converter.py:130:19: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in DC3: Function model_field was called with the wrong arguments [wrong-arg-types] + + field1: int = model_field(converter=converter_simple, default=1) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_transform_converter.py:133:19: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in DC3: Function model_field was called with the wrong arguments [wrong-arg-types] + + field3: int = model_field(converter=converter_simple, default_factory=int) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ diff --git a/conformance/results/pytype/dataclasses_transform_field.toml b/conformance/results/pytype/dataclasses_transform_field.toml index 26f330ebc..62c34fded 100644 --- a/conformance/results/pytype/dataclasses_transform_field.toml +++ b/conformance/results/pytype/dataclasses_transform_field.toml @@ -3,13 +3,21 @@ notes = """ Does not understand @dataclass_transform. """ output = """ -File "dataclasses_transform_field.py", line 48, in : Arguments to dataclass_transform not supported yet [not-supported-yet] -File "dataclasses_transform_field.py", line 50, in create_model: bad return type [bad-return-type] +dataclasses_transform_field.py:48:2: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Arguments to dataclass_transform not supported yet [not-supported-yet] + +@dataclass_transform(kw_only_default=True, field_specifiers=(field1, field2)) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_transform_field.py:50:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in create_model: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ Line 64: Expected 1 errors Line 75: Expected 1 errors -Line 48: Unexpected errors ['File "dataclasses_transform_field.py", line 48, in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] -Line 50: Unexpected errors ['File "dataclasses_transform_field.py", line 50, in create_model: bad return type [bad-return-type]'] +Line 48: Unexpected errors ['dataclasses_transform_field.py:48:2: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] +Line 50: Unexpected errors ['dataclasses_transform_field.py:50:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in create_model: bad return type [bad-return-type]'] """ diff --git a/conformance/results/pytype/dataclasses_transform_func.toml b/conformance/results/pytype/dataclasses_transform_func.toml index 89a1ae2ee..1479e2bcb 100644 --- a/conformance/results/pytype/dataclasses_transform_func.toml +++ b/conformance/results/pytype/dataclasses_transform_func.toml @@ -3,30 +3,74 @@ notes = """ Does not understand @dataclass_transform. """ output = """ -File "dataclasses_transform_func.py", line 13, in : Arguments to dataclass_transform not supported yet [not-supported-yet] -File "dataclasses_transform_func.py", line 19, in : Arguments to dataclass_transform not supported yet [not-supported-yet] -File "dataclasses_transform_func.py", line 30, in create_model: bad return type [bad-return-type] +dataclasses_transform_func.py:13:2: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Arguments to dataclass_transform not supported yet [not-supported-yet] + +@dataclass_transform(kw_only_default=True, order_default=True) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_transform_func.py:19:2: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Arguments to dataclass_transform not supported yet [not-supported-yet] + +@dataclass_transform(kw_only_default=True, order_default=True) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_transform_func.py:30:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in create_model: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + Called from (traceback): line 89, in current file -File "dataclasses_transform_func.py", line 30, in create_model: bad return type [bad-return-type] -File "dataclasses_transform_func.py", line 50, in : Invalid keyword arguments (id, name) to function Customer1.__init__ [wrong-keyword-args] -File "dataclasses_transform_func.py", line 53, in : Function Customer1.__init__ expects 1 arg(s), got 3 [wrong-arg-count] -File "dataclasses_transform_func.py", line 57, in : Type annotation for name does not match type of assignment [annotation-type-mismatch] -File "dataclasses_transform_func.py", line 65, in : Invalid keyword arguments (id, name, salary) to function Customer1.__init__ [wrong-keyword-args] -File "dataclasses_transform_func.py", line 67, in : Invalid keyword arguments (id, name) to function Customer2.__init__ [wrong-keyword-args] -File "dataclasses_transform_func.py", line 71, in : Function Customer2.__init__ expects 1 arg(s), got 3 [wrong-arg-count] -File "dataclasses_transform_func.py", line 76, in : Arguments to dataclass_transform not supported yet [not-supported-yet] +dataclasses_transform_func.py:30:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in create_model: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +dataclasses_transform_func.py:50:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid keyword arguments (id, name) to function Customer1.__init__ [wrong-keyword-args] + +c1_1 = Customer1(id=3, name="Sue") + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_transform_func.py:53:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Customer1.__init__ expects 1 arg(s), got 3 [wrong-arg-count] + +c1_2 = Customer1(3, "Sue") + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_transform_func.py:57:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for name does not match type of assignment [annotation-type-mismatch] + +c1_2.name = 3 # E +\u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_transform_func.py:65:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid keyword arguments (id, name, salary) to function Customer1.__init__ [wrong-keyword-args] + +c1_3 = Customer1(id=3, name="Sue", salary=40000) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_transform_func.py:67:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid keyword arguments (id, name) to function Customer2.__init__ [wrong-keyword-args] + +c2_1 = Customer2(id=0, name="John") + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_transform_func.py:71:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Customer2.__init__ expects 1 arg(s), got 3 [wrong-arg-count] + +c2_2 = Customer2(0, "John") # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_transform_func.py:76:2: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Arguments to dataclass_transform not supported yet [not-supported-yet] + +@dataclass_transform(kw_only_default=True, order_default=True, frozen_default=True) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ Line 61: Expected 1 errors Line 97: Expected 1 errors Lines 89, 90: Expected error (tag 'Customer3Subclass') -Line 13: Unexpected errors ['File "dataclasses_transform_func.py", line 13, in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] -Line 19: Unexpected errors ['File "dataclasses_transform_func.py", line 19, in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] -Line 30: Unexpected errors ['File "dataclasses_transform_func.py", line 30, in create_model: bad return type [bad-return-type]', 'File "dataclasses_transform_func.py", line 30, in create_model: bad return type [bad-return-type]'] -Line 50: Unexpected errors ['File "dataclasses_transform_func.py", line 50, in : Invalid keyword arguments (id, name) to function Customer1.__init__ [wrong-keyword-args]'] -Line 53: Unexpected errors ['File "dataclasses_transform_func.py", line 53, in : Function Customer1.__init__ expects 1 arg(s), got 3 [wrong-arg-count]'] -Line 67: Unexpected errors ['File "dataclasses_transform_func.py", line 67, in : Invalid keyword arguments (id, name) to function Customer2.__init__ [wrong-keyword-args]'] -Line 76: Unexpected errors ['File "dataclasses_transform_func.py", line 76, in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] +Line 13: Unexpected errors ['dataclasses_transform_func.py:13:2: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] +Line 19: Unexpected errors ['dataclasses_transform_func.py:19:2: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] +Line 30: Unexpected errors ['dataclasses_transform_func.py:30:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in create_model: bad return type [bad-return-type]', 'dataclasses_transform_func.py:30:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in create_model: bad return type [bad-return-type]'] +Line 50: Unexpected errors ['dataclasses_transform_func.py:50:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid keyword arguments (id, name) to function Customer1.__init__ [wrong-keyword-args]'] +Line 53: Unexpected errors ['dataclasses_transform_func.py:53:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function Customer1.__init__ expects 1 arg(s), got 3 [wrong-arg-count]'] +Line 67: Unexpected errors ['dataclasses_transform_func.py:67:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid keyword arguments (id, name) to function Customer2.__init__ [wrong-keyword-args]'] +Line 76: Unexpected errors ['dataclasses_transform_func.py:76:2: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] """ diff --git a/conformance/results/pytype/dataclasses_transform_meta.toml b/conformance/results/pytype/dataclasses_transform_meta.toml index bf8168419..93cf0058c 100644 --- a/conformance/results/pytype/dataclasses_transform_meta.toml +++ b/conformance/results/pytype/dataclasses_transform_meta.toml @@ -3,9 +3,27 @@ notes = """ Does not understand @dataclass_transform. """ output = """ -File "dataclasses_transform_meta.py", line 21, in : Arguments to dataclass_transform not supported yet [not-supported-yet] -File "dataclasses_transform_meta.py", line 60, in : Invalid keyword argument other_name to function Customer1.__init__ [wrong-keyword-args] -File "dataclasses_transform_meta.py", line 86, in : Arguments to dataclass_transform not supported yet [not-supported-yet] +dataclasses_transform_meta.py:21:2: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Arguments to dataclass_transform not supported yet [not-supported-yet] + +@dataclass_transform( + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + kw_only_default=True, +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + field_specifiers=(ModelField, model_field), +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +) +\u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +dataclasses_transform_meta.py:60:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid keyword argument other_name to function Customer1.__init__ [wrong-keyword-args] + +c1_1 = Customer1(id=3, name="Sue", other_name="Susan") + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_transform_meta.py:86:2: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Arguments to dataclass_transform not supported yet [not-supported-yet] + +@dataclass_transform(frozen_default=True) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -15,7 +33,7 @@ Line 66: Expected 1 errors Line 73: Expected 1 errors Line 83: Expected 1 errors Line 103: Expected 1 errors -Line 21: Unexpected errors ['File "dataclasses_transform_meta.py", line 21, in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] -Line 60: Unexpected errors ['File "dataclasses_transform_meta.py", line 60, in : Invalid keyword argument other_name to function Customer1.__init__ [wrong-keyword-args]'] -Line 86: Unexpected errors ['File "dataclasses_transform_meta.py", line 86, in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] +Line 21: Unexpected errors ['dataclasses_transform_meta.py:21:2: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] +Line 60: Unexpected errors ['dataclasses_transform_meta.py:60:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid keyword argument other_name to function Customer1.__init__ [wrong-keyword-args]'] +Line 86: Unexpected errors ['dataclasses_transform_meta.py:86:2: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] """ diff --git a/conformance/results/pytype/dataclasses_usage.toml b/conformance/results/pytype/dataclasses_usage.toml index 6690e24d5..cc9e6e713 100644 --- a/conformance/results/pytype/dataclasses_usage.toml +++ b/conformance/results/pytype/dataclasses_usage.toml @@ -1,16 +1,60 @@ conformant = "Pass" output = """ -File "dataclasses_usage.py", line 50, in : Missing parameter 'unit_price' in call to function InventoryItem.__init__ [missing-parameter] -File "dataclasses_usage.py", line 51, in : Function InventoryItem.__init__ was called with the wrong arguments [wrong-arg-types] -File "dataclasses_usage.py", line 52, in : Function InventoryItem.__init__ expects 3 arg(s), got 5 [wrong-arg-count] -File "dataclasses_usage.py", line 58, in : In method __init__, non-default argument b follows default argument [invalid-function-definition] -File "dataclasses_usage.py", line 64, in : In method __init__, non-default argument b follows default argument [invalid-function-definition] -File "dataclasses_usage.py", line 70, in : In method __init__, non-default argument b follows default argument [invalid-function-definition] -File "dataclasses_usage.py", line 83, in : Function DC4.__init__ expects 2 arg(s), got 3 [wrong-arg-count] -File "dataclasses_usage.py", line 88, in DC5: Type annotation for a does not match type of assignment [annotation-type-mismatch] -File "dataclasses_usage.py", line 127, in : Function DC7.__init__ expects 2 arg(s), got 3 [wrong-arg-count] -File "dataclasses_usage.py", line 130, in : Missing parameter 'y' in call to function DC8.__init__ [missing-parameter] -File "dataclasses_usage.py", line 179, in : Function DC13.__init__ expects 1 arg(s), got 2 [wrong-arg-count] +dataclasses_usage.py:50:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'unit_price' in call to function InventoryItem.__init__ [missing-parameter] + +v2 = InventoryItem("name") # E: missing unit_price + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_usage.py:51:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function InventoryItem.__init__ was called with the wrong arguments [wrong-arg-types] + +v3 = InventoryItem("name", "price") # E: incorrect type for unit_price + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_usage.py:52:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function InventoryItem.__init__ expects 3 arg(s), got 5 [wrong-arg-count] + +v4 = InventoryItem("name", 3.1, 3, 4) # E: too many arguments + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_usage.py:58:2: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : In method __init__, non-default argument b follows default argument [invalid-function-definition] + +@dataclass # E[DC1] + \u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_usage.py:64:2: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : In method __init__, non-default argument b follows default argument [invalid-function-definition] + +@dataclass # E[DC2] + \u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_usage.py:70:2: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : In method __init__, non-default argument b follows default argument [invalid-function-definition] + +@dataclass # E[DC3] + \u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_usage.py:83:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function DC4.__init__ expects 2 arg(s), got 3 [wrong-arg-count] + +v6 = DC4(0, 1) # E: too many parameters + \u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_usage.py:88:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in DC5: Type annotation for a does not match type of assignment [annotation-type-mismatch] + + a: int = field(default_factory=str) # E: type mismatch + \u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +dataclasses_usage.py:127:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function DC7.__init__ expects 2 arg(s), got 3 [wrong-arg-count] + +DC7(3, 4) # E +\u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_usage.py:130:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'y' in call to function DC8.__init__ [missing-parameter] + +DC8(a) # E +\u001b[1m\u001b[31m~~~~~~\u001b[39m\u001b[0m + +dataclasses_usage.py:179:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function DC13.__init__ expects 1 arg(s), got 2 [wrong-arg-count] + +DC13(3) # E +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pytype/directives_assert_type.toml b/conformance/results/pytype/directives_assert_type.toml index a77a3f9ec..288cc6558 100644 --- a/conformance/results/pytype/directives_assert_type.toml +++ b/conformance/results/pytype/directives_assert_type.toml @@ -3,11 +3,31 @@ notes = """ Incorrectly allows assert(x, int) where x is a Literal. """ output = """ -File "directives_assert_type.py", line 27, in func1: Union[int, str] [assert-type] -File "directives_assert_type.py", line 28, in func1: Any [assert-type] -File "directives_assert_type.py", line 31, in func1: Function assert_type expects 2 arg(s), got 0 [wrong-arg-count] -File "directives_assert_type.py", line 32, in func1: str [assert-type] -File "directives_assert_type.py", line 33, in func1: Function assert_type expects 2 arg(s), got 3 [wrong-arg-count] +directives_assert_type.py:27:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Union[int, str] [assert-type] + + assert_type(a, int) # E: Type mismatch + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +directives_assert_type.py:28:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Any [assert-type] + + assert_type(c, int) # E: Type mismatch + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +directives_assert_type.py:31:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Function assert_type expects 2 arg(s), got 0 [wrong-arg-count] + + assert_type() # E: not enough arguments + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +directives_assert_type.py:32:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: str [assert-type] + + assert_type("", int) # E: wrong argument type + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +directives_assert_type.py:33:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Function assert_type expects 2 arg(s), got 3 [wrong-arg-count] + + assert_type(a, int | str, a) # E: too many arguments + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ diff --git a/conformance/results/pytype/directives_cast.toml b/conformance/results/pytype/directives_cast.toml index 28cc3470d..edb229b98 100644 --- a/conformance/results/pytype/directives_cast.toml +++ b/conformance/results/pytype/directives_cast.toml @@ -3,8 +3,16 @@ notes = """ Does not reject a call to "cast" with additional arguments. """ output = """ -File "directives_cast.py", line 15, in : Missing parameter 'typ' in call to function typing.cast [missing-parameter] -File "directives_cast.py", line 16, in : Invalid type annotation '1' for typing.cast [invalid-annotation] +directives_cast.py:15:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'typ' in call to function typing.cast [missing-parameter] + +bad1 = cast() # E: Too few arguments + \u001b[1m\u001b[31m~~~~~~\u001b[39m\u001b[0m + +directives_cast.py:16:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '1' for typing.cast [invalid-annotation] + +bad2 = cast(1, "") # E: Bad first argument type + \u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ diff --git a/conformance/results/pytype/directives_deprecated.toml b/conformance/results/pytype/directives_deprecated.toml index 8928ce99c..26c189937 100644 --- a/conformance/results/pytype/directives_deprecated.toml +++ b/conformance/results/pytype/directives_deprecated.toml @@ -15,13 +15,29 @@ Line 48: Expected 1 errors Line 58: Expected 1 errors Line 69: Expected 1 errors Line 98: Expected 1 errors -Line 10: Unexpected errors ['File "directives_deprecated.py", line 10, in : typing.override not supported yet [not-supported-yet]'] -Line 11: Unexpected errors ['File "directives_deprecated.py", line 11, in : typing_extensions.deprecated not supported yet [not-supported-yet]'] -Line 19: Unexpected errors ['File "directives_deprecated.py", line 19, in : Can\\'t find module \\'_directives_deprecated_library\\'. [import-error]'] +Line 10: Unexpected errors ['directives_deprecated.py:10:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.override not supported yet [not-supported-yet]'] +Line 11: Unexpected errors ['directives_deprecated.py:11:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing_extensions.deprecated not supported yet [not-supported-yet]'] +Line 19: Unexpected errors ["directives_deprecated.py:19:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Can't find module '_directives_deprecated_library'. [import-error]"] """ output = """ -File "directives_deprecated.py", line 10, in : typing.override not supported yet [not-supported-yet] -File "directives_deprecated.py", line 11, in : typing_extensions.deprecated not supported yet [not-supported-yet] -File "directives_deprecated.py", line 18, in : Can't find module '_directives_deprecated_library'. [import-error] -File "directives_deprecated.py", line 19, in : Can't find module '_directives_deprecated_library'. [import-error] +directives_deprecated.py:10:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing.override not supported yet [not-supported-yet] + +from typing import Protocol, override +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +directives_deprecated.py:11:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing_extensions.deprecated not supported yet [not-supported-yet] + +from typing_extensions import deprecated +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +directives_deprecated.py:18:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Can't find module '_directives_deprecated_library'. [import-error] + +from _directives_deprecated_library import Ham # E: Use of deprecated class Ham +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +directives_deprecated.py:19:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Can't find module '_directives_deprecated_library'. [import-error] + +import _directives_deprecated_library as library +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ diff --git a/conformance/results/pytype/directives_no_type_check.toml b/conformance/results/pytype/directives_no_type_check.toml index b90eb6f63..22229130f 100644 --- a/conformance/results/pytype/directives_no_type_check.toml +++ b/conformance/results/pytype/directives_no_type_check.toml @@ -3,11 +3,31 @@ notes = """ Does not honor @no_type_check decorator. """ output = """ -File "directives_no_type_check.py", line 15, in ClassA: Type annotation for x does not match type of assignment [annotation-type-mismatch] -File "directives_no_type_check.py", line 25, in func1: unsupported operand type(s) for +: int and str [unsupported-operands] -File "directives_no_type_check.py", line 26, in func1: bad return type [bad-return-type] -File "directives_no_type_check.py", line 29, in : Function func1 was called with the wrong arguments [wrong-arg-types] -File "directives_no_type_check.py", line 32, in : Missing parameter 'a' in call to function func1 [missing-parameter] +directives_no_type_check.py:15:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassA: Type annotation for x does not match type of assignment [annotation-type-mismatch] + + x: int = "" # E?: No error should be reported + \u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +directives_no_type_check.py:25:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: unsupported operand type(s) for +: int and str [unsupported-operands] + + c = a + b # E?: No error should be reported + \u001b[1m\u001b[31m~~~~~\u001b[39m\u001b[0m + +directives_no_type_check.py:26:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: bad return type [bad-return-type] + + return 1 # E?: No error should be reported + \u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +directives_no_type_check.py:29:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function func1 was called with the wrong arguments [wrong-arg-types] + +func1(b"invalid", b"arguments") # E?: No error should be reported +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +directives_no_type_check.py:32:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'a' in call to function func1 [missing-parameter] + +func1() # E: incorrect arguments for parameters +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pytype/directives_reveal_type.toml b/conformance/results/pytype/directives_reveal_type.toml index 38e08038c..a18c7d076 100644 --- a/conformance/results/pytype/directives_reveal_type.toml +++ b/conformance/results/pytype/directives_reveal_type.toml @@ -4,17 +4,37 @@ Does not reject call to reveal_type with zero arguments. Does not reject call to reveal_type with too many arguments. """ output = """ -File "directives_reveal_type.py", line 14, in func1: Union[int, str] [reveal-type] -File "directives_reveal_type.py", line 15, in func1: List[int] [reveal-type] -File "directives_reveal_type.py", line 16, in func1: Any [reveal-type] -File "directives_reveal_type.py", line 17, in func1: ForwardReference [reveal-type] -File "directives_reveal_type.py", line 20, in func1: Union[int, str] [reveal-type] +directives_reveal_type.py:14:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Union[int, str] [reveal-type] + + reveal_type(a) # Revealed type is "int | str" + \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +directives_reveal_type.py:15:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: List[int] [reveal-type] + + reveal_type(b) # Revealed type is "list[int]" + \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +directives_reveal_type.py:16:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Any [reveal-type] + + reveal_type(c) # Revealed type is "Any" + \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +directives_reveal_type.py:17:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: ForwardReference [reveal-type] + + reveal_type(d) # Revealed type is "ForwardReference" + \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +directives_reveal_type.py:20:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Union[int, str] [reveal-type] + + reveal_type(a, a) # E: Too many arguments + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ Line 19: Expected 1 errors -Line 14: Unexpected errors ['File "directives_reveal_type.py", line 14, in func1: Union[int, str] [reveal-type]'] -Line 15: Unexpected errors ['File "directives_reveal_type.py", line 15, in func1: List[int] [reveal-type]'] -Line 16: Unexpected errors ['File "directives_reveal_type.py", line 16, in func1: Any [reveal-type]'] -Line 17: Unexpected errors ['File "directives_reveal_type.py", line 17, in func1: ForwardReference [reveal-type]'] +Line 14: Unexpected errors ['directives_reveal_type.py:14:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: Union[int, str] [reveal-type]'] +Line 15: Unexpected errors ['directives_reveal_type.py:15:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: List[int] [reveal-type]'] +Line 16: Unexpected errors ['directives_reveal_type.py:16:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: Any [reveal-type]'] +Line 17: Unexpected errors ['directives_reveal_type.py:17:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: ForwardReference [reveal-type]'] """ diff --git a/conformance/results/pytype/directives_type_ignore.toml b/conformance/results/pytype/directives_type_ignore.toml index 70b1732e5..0fd583385 100644 --- a/conformance/results/pytype/directives_type_ignore.toml +++ b/conformance/results/pytype/directives_type_ignore.toml @@ -3,10 +3,19 @@ notes = """ Does not honor "# type: ignore" comment if comment includes additional text. """ output = """ -File "directives_type_ignore.py", line 11, in : Type annotation for y does not match type of assignment [annotation-type-mismatch] -File "directives_type_ignore.py", line 11: Stray type comment: ignore - additional stuff [ignored-type-comment] +directives_type_ignore.py:11:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for y does not match type of assignment [annotation-type-mismatch] + +y: int = "" # type: ignore - additional stuff +\u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +directives_type_ignore.py:11:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: : Stray type comment: ignore - additional stuff [ignored-type-comment] + +y: int = "" # type: ignore - additional stuff\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +y: int = "" # type: ignore - additional stuff +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ -Line 11: Unexpected errors ['File "directives_type_ignore.py", line 11, in : Type annotation for y does not match type of assignment [annotation-type-mismatch]', 'File "directives_type_ignore.py", line 11: Stray type comment: ignore - additional stuff [ignored-type-comment]'] +Line 11: Unexpected errors ['directives_type_ignore.py:11:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for y does not match type of assignment [annotation-type-mismatch]', 'directives_type_ignore.py:11:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: : Stray type comment: ignore - additional stuff [ignored-type-comment]'] """ diff --git a/conformance/results/pytype/directives_version_platform.toml b/conformance/results/pytype/directives_version_platform.toml index 6d9473c7f..dd6558f4b 100644 --- a/conformance/results/pytype/directives_version_platform.toml +++ b/conformance/results/pytype/directives_version_platform.toml @@ -4,9 +4,21 @@ Does not understand three-element form of sys.version checks. Does not understand os.name checks. """ output = """ -File "directives_version_platform.py", line 27, in : Type annotation for val3 does not match type of assignment [annotation-type-mismatch] -File "directives_version_platform.py", line 40, in : Type annotation for val7 does not match type of assignment [annotation-type-mismatch] -File "directives_version_platform.py", line 45, in : Type annotation for val8 does not match type of assignment [annotation-type-mismatch] +directives_version_platform.py:27:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for val3 does not match type of assignment [annotation-type-mismatch] + + val3: int = "" # E?: May not generate an error (support for three-element sys.version is optional) + \u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m + +directives_version_platform.py:40:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for val7 does not match type of assignment [annotation-type-mismatch] + + val7: int = "" # E?: May not generate an error (support for os.name is optional) + \u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m + +directives_version_platform.py:45:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for val8 does not match type of assignment [annotation-type-mismatch] + + val8: int = "" # E?: May not generate an error (support for os.name is optional) + \u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pytype/enums_definition.toml b/conformance/results/pytype/enums_definition.toml index 29c66d614..bc2a8230e 100644 --- a/conformance/results/pytype/enums_definition.toml +++ b/conformance/results/pytype/enums_definition.toml @@ -5,6 +5,10 @@ Does not support some functional forms for Enum class definitions (optional). errors_diff = """ """ output = """ -File "enums_definition.py", line 24, in : Function unsolveable.__new__ was called with the wrong arguments [wrong-arg-types] +enums_definition.py:24:10: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function unsolveable.__new__ was called with the wrong arguments [wrong-arg-types] + +Color2 = Enum("Color2", "RED", "GREEN", "BLUE") # E? + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Pass" diff --git a/conformance/results/pytype/enums_member_values.toml b/conformance/results/pytype/enums_member_values.toml index c562dce2a..bf9325764 100644 --- a/conformance/results/pytype/enums_member_values.toml +++ b/conformance/results/pytype/enums_member_values.toml @@ -8,11 +8,67 @@ Does not evaluate literal types for auto values (optional). conformance_automated = "Fail" errors_diff = """ Line 78: Expected 1 errors -Line 41: Unexpected errors ['File "enums_member_values.py", line 41, in : Missing parameter \\'mass\\' in call to function Planet.__init__ [missing-parameter]', 'File "enums_member_values.py", line 41, in : Function Planet.__init__ was called with the wrong arguments [wrong-arg-types]'] +Line 41: Unexpected errors ["enums_member_values.py:41:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Missing parameter 'mass' in call to function Planet.__init__ [missing-parameter]", 'enums_member_values.py:41:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function Planet.__init__ was called with the wrong arguments [wrong-arg-types]'] """ output = """ -File "enums_member_values.py", line 41, in : Missing parameter 'mass' in call to function Planet.__init__ [missing-parameter] -File "enums_member_values.py", line 41, in : Function Planet.__init__ was called with the wrong arguments [wrong-arg-types] -File "enums_member_values.py", line 85, in __init__: Type annotation for _value_ does not match type of assignment [annotation-type-mismatch] -File "enums_member_values.py", line 96, in : Any [assert-type] +enums_member_values.py:41:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'mass' in call to function Planet.__init__ [missing-parameter] + +class Planet(Enum): +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + def __init__(self, value: int, mass: float, radius: float): +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + self._value_ = value +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + self.mass = mass +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + self.radius = radius +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + MERCURY = (1, 3.303e23, 2.4397e6) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + VENUS = (2, 4.869e24, 6.0518e6) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + EARTH = (3, 5.976e24, 6.37814e6) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + MARS = (6.421e23, 3.3972e6) # E?: Type checker error (optional) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + JUPITER = 5 # E?: Type checker error (optional) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +enums_member_values.py:41:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Planet.__init__ was called with the wrong arguments [wrong-arg-types] + +class Planet(Enum): +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + def __init__(self, value: int, mass: float, radius: float): +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + self._value_ = value +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + self.mass = mass +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + self.radius = radius +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + MERCURY = (1, 3.303e23, 2.4397e6) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + VENUS = (2, 4.869e24, 6.0518e6) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + EARTH = (3, 5.976e24, 6.37814e6) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + MARS = (6.421e23, 3.3972e6) # E?: Type checker error (optional) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + JUPITER = 5 # E?: Type checker error (optional) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +enums_member_values.py:85:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __init__: Type annotation for _value_ does not match type of assignment [annotation-type-mismatch] + + self._value_ = value # E + \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +enums_member_values.py:96:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Any [assert-type] + +assert_type(ColumnType.DORIC.value, int) # E? +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ diff --git a/conformance/results/pytype/enums_members.toml b/conformance/results/pytype/enums_members.toml index 000700425..2f5eb964d 100644 --- a/conformance/results/pytype/enums_members.toml +++ b/conformance/results/pytype/enums_members.toml @@ -9,32 +9,126 @@ errors_diff = """ Line 50: Expected 1 errors Line 116: Expected 1 errors Line 129: Expected 1 errors -Line 7: Unexpected errors ['File "enums_members.py", line 7, in : enum.nonmember not supported yet [not-supported-yet]', 'File "enums_members.py", line 7, in : enum.member not supported yet [not-supported-yet]'] -Line 35: Unexpected errors ['File "enums_members.py", line 35, in : _enums_members.Pet2 [assert-type]'] -Line 36: Unexpected errors ['File "enums_members.py", line 36, in : _enums_members.Pet2 [assert-type]'] -Line 107: Unexpected errors ['File "enums_members.py", line 107, in Example: Function enum.member expects 0 arg(s), got 1 [wrong-arg-count]'] -Line 108: Unexpected errors ['File "enums_members.py", line 108, in Example: Function enum.nonmember expects 0 arg(s), got 1 [wrong-arg-count]'] -Line 110: Unexpected errors ['File "enums_members.py", line 110, in Example: Function enum.member expects 0 arg(s), got 1 [wrong-arg-count]'] -Line 128: Unexpected errors ['File "enums_members.py", line 128, in method: Example2 [reveal-type]'] +Line 7: Unexpected errors ['enums_members.py:7:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : enum.nonmember not supported yet [not-supported-yet]', 'enums_members.py:7:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : enum.member not supported yet [not-supported-yet]'] +Line 35: Unexpected errors ['enums_members.py:35:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : _enums_members.Pet2 [assert-type]'] +Line 36: Unexpected errors ['enums_members.py:36:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : _enums_members.Pet2 [assert-type]'] +Line 107: Unexpected errors ['enums_members.py:107:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in Example: Function enum.member expects 0 arg(s), got 1 [wrong-arg-count]'] +Line 108: Unexpected errors ['enums_members.py:108:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in Example: Function enum.nonmember expects 0 arg(s), got 1 [wrong-arg-count]'] +Line 110: Unexpected errors ['enums_members.py:110:6: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in Example: Function enum.member expects 0 arg(s), got 1 [wrong-arg-count]'] +Line 128: Unexpected errors ['enums_members.py:128:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method: Example2 [reveal-type]'] """ output = """ -File "enums_members.py", line 7, in : enum.nonmember not supported yet [not-supported-yet] -File "enums_members.py", line 7, in : enum.member not supported yet [not-supported-yet] -File "enums_members.py", line 15, in : Function Pet.__init__ was called with the wrong arguments [wrong-arg-types] -File "enums_members.py", line 35, in : _enums_members.Pet2 [assert-type] -File "enums_members.py", line 36, in : _enums_members.Pet2 [assert-type] -File "enums_members.py", line 82, in : Invalid type annotation 'Literal' [invalid-annotation] -File "enums_members.py", line 82, in : Callable[[Any], Any] [assert-type] -File "enums_members.py", line 83, in : Invalid type annotation 'Literal' [invalid-annotation] -File "enums_members.py", line 83, in : Callable[[int], int] [assert-type] -File "enums_members.py", line 84, in : property [assert-type] -File "enums_members.py", line 84, in : Invalid type annotation 'Literal' [invalid-annotation] -File "enums_members.py", line 85, in : Invalid type annotation 'Literal' [invalid-annotation] -File "enums_members.py", line 85, in : Callable[[Any], None] [assert-type] -File "enums_members.py", line 107, in Example: Function enum.member expects 0 arg(s), got 1 [wrong-arg-count] -File "enums_members.py", line 108, in Example: Function enum.nonmember expects 0 arg(s), got 1 [wrong-arg-count] -File "enums_members.py", line 110, in Example: Function enum.member expects 0 arg(s), got 1 [wrong-arg-count] -File "enums_members.py", line 128, in method: Example2 [reveal-type] -File "enums_members.py", line 146, in : Pet5 [assert-type] -File "enums_members.py", line 147, in : Pet5 [assert-type] +enums_members.py:7:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : enum.nonmember not supported yet [not-supported-yet] + +from enum import Enum, member, nonmember +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +enums_members.py:7:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : enum.member not supported yet [not-supported-yet] + +from enum import Enum, member, nonmember +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +enums_members.py:15:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Pet.__init__ was called with the wrong arguments [wrong-arg-types] + +class Pet(Enum): # E?: Uninitialized attributes (pyre) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + genus: str # Non-member attribute +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + species: str # Non-member attribute +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + CAT = 1 # Member attribute +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + DOG = 2 # Member attribute +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + def __init__(self, genus: str, species: str) -> None: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + self.genus = genus +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + self.species = species +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +enums_members.py:35:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : _enums_members.Pet2 [assert-type] + +assert_type(Pet2.genus, str) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +enums_members.py:36:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : _enums_members.Pet2 [assert-type] + +assert_type(Pet2.species, str) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +enums_members.py:82:29: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] + +assert_type(Pet4.converter, Literal[Pet4.converter]) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +enums_members.py:82:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Callable[[Any], Any] [assert-type] + +assert_type(Pet4.converter, Literal[Pet4.converter]) # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +enums_members.py:83:29: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] + +assert_type(Pet4.transform, Literal[Pet4.transform]) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +enums_members.py:83:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Callable[[int], int] [assert-type] + +assert_type(Pet4.transform, Literal[Pet4.transform]) # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +enums_members.py:84:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : property [assert-type] + +assert_type(Pet4.species, Literal[Pet4.species]) # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +enums_members.py:84:27: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] + +assert_type(Pet4.species, Literal[Pet4.species]) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +enums_members.py:85:25: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] + +assert_type(Pet4.speak, Literal[Pet4.speak]) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +enums_members.py:85:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Callable[[Any], None] [assert-type] + +assert_type(Pet4.speak, Literal[Pet4.speak]) # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +enums_members.py:107:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Example: Function enum.member expects 0 arg(s), got 1 [wrong-arg-count] + + a = member(1) # Member attribute + \u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m + +enums_members.py:108:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Example: Function enum.nonmember expects 0 arg(s), got 1 [wrong-arg-count] + + b = nonmember(2) # Non-member attribute + \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +enums_members.py:110:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Example: Function enum.member expects 0 arg(s), got 1 [wrong-arg-count] + + @member + \u001b[1m\u001b[31m~~~~~~\u001b[39m\u001b[0m + +enums_members.py:128:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method: Example2 [reveal-type] + + reveal_type(Example2.__B) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +enums_members.py:146:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Pet5 [assert-type] + +assert_type(Pet5.DOG, int) # E?: Literal[2] is also acceptable +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +enums_members.py:147:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Pet5 [assert-type] + +assert_type(Pet5.FISH, int) # E?: Literal[3] is also acceptable +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ diff --git a/conformance/results/pytype/exceptions_context_managers.toml b/conformance/results/pytype/exceptions_context_managers.toml index 5abf283a5..4d195209d 100644 --- a/conformance/results/pytype/exceptions_context_managers.toml +++ b/conformance/results/pytype/exceptions_context_managers.toml @@ -4,10 +4,18 @@ Does not support code flow analysis. """ conformance_automated = "Fail" errors_diff = """ -Line 50: Unexpected errors ['File "exceptions_context_managers.py", line 50, in suppress1: str [assert-type]'] -Line 57: Unexpected errors ['File "exceptions_context_managers.py", line 57, in suppress2: str [assert-type]'] +Line 50: Unexpected errors ['exceptions_context_managers.py:50:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in suppress1: str [assert-type]'] +Line 57: Unexpected errors ['exceptions_context_managers.py:57:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in suppress2: str [assert-type]'] """ output = """ -File "exceptions_context_managers.py", line 50, in suppress1: str [assert-type] -File "exceptions_context_managers.py", line 57, in suppress2: str [assert-type] +exceptions_context_managers.py:50:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in suppress1: str [assert-type] + + assert_type(x, int | str) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +exceptions_context_managers.py:57:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in suppress2: str [assert-type] + + assert_type(x, int | str) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ diff --git a/conformance/results/pytype/generics_base_class.toml b/conformance/results/pytype/generics_base_class.toml index b108aa62e..096f7d009 100644 --- a/conformance/results/pytype/generics_base_class.toml +++ b/conformance/results/pytype/generics_base_class.toml @@ -4,10 +4,28 @@ False negative on passing SymbolTable to dict[str, list[object]]. Does not reject illegal use of Generic. """ output = """ -File "generics_base_class.py", line 29, in : Invalid type annotation 'T' [invalid-annotation] -File "generics_base_class.py", line 49, in : Invalid type annotation 'LinkedList[int, int]' [invalid-annotation] -File "generics_base_class.py", line 61, in : Invalid type annotation 'MyDict[int, int]' [invalid-annotation] -File "generics_base_class.py", line 68, in : Invalid type annotation 'Generic' [invalid-annotation] +generics_base_class.py:29:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'T' [invalid-annotation] + +def func1(y: Generic[T]): # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + x: Generic # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_base_class.py:49:22: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'LinkedList[int, int]' [invalid-annotation] + +linked_list_invalid: LinkedList[int, int] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_base_class.py:61:18: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'MyDict[int, int]' [invalid-annotation] + +my_dict_invalid: MyDict[int, int] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_base_class.py:68:17: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class BadClass1(Generic[T, T]): # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ diff --git a/conformance/results/pytype/generics_basic.toml b/conformance/results/pytype/generics_basic.toml index 2089cc5d7..5ab2769bc 100644 --- a/conformance/results/pytype/generics_basic.toml +++ b/conformance/results/pytype/generics_basic.toml @@ -4,27 +4,79 @@ False positives in examples using constrained type variables. False negative for generic metaclass. """ output = """ -File "generics_basic.py", line 34, in concat: bad return type [bad-return-type] +generics_basic.py:34:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in concat: bad return type [bad-return-type] + + return x + y + \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + Called from (traceback): line 67, in test_concat_subtype -File "generics_basic.py", line 40, in test_concat: Function concat was called with the wrong arguments [wrong-arg-types] -File "generics_basic.py", line 41, in test_concat: Function concat was called with the wrong arguments [wrong-arg-types] -File "generics_basic.py", line 49, in : Invalid TypeVar: the number of constraints must be 0 or more than 1 [invalid-typevar] -File "generics_basic.py", line 55, in Test: Invalid TypeVar: constraint cannot contain TypeVars [invalid-typevar] -File "generics_basic.py", line 67, in test_concat_subtype: MyStr [assert-type] -File "generics_basic.py", line 68, in test_concat_subtype: Function concat was called with the wrong arguments [wrong-arg-types] -File "generics_basic.py", line 68, in test_concat_subtype: Any [assert-type] -File "generics_basic.py", line 69, in test_concat_subtype: Function concat was called with the wrong arguments [wrong-arg-types] -File "generics_basic.py", line 121, in : Invalid type annotation 'Generic' [invalid-annotation] -File "generics_basic.py", line 157, in test_my_map: unsupported operand type(s) for item retrieval: MyMap1[str, int] and int [unsupported-operands] -File "generics_basic.py", line 158, in test_my_map: unsupported operand type(s) for item retrieval: MyMap2[int, str] and int [unsupported-operands] -File "generics_basic.py", line 182, in test_my_iterable_any: Iterator[nothing] [assert-type] +generics_basic.py:40:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in test_concat: Function concat was called with the wrong arguments [wrong-arg-types] + + concat(s, b) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_basic.py:41:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in test_concat: Function concat was called with the wrong arguments [wrong-arg-types] + + concat(b, s) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_basic.py:49:18: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid TypeVar: the number of constraints must be 0 or more than 1 [invalid-typevar] + +BadConstraint1 = TypeVar("BadConstraint1", str) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_basic.py:55:22: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Test: Invalid TypeVar: constraint cannot contain TypeVars [invalid-typevar] + + BadConstraint2 = TypeVar("BadConstraint2", str, list[T]) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_basic.py:67:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in test_concat_subtype: MyStr [assert-type] + + assert_type(concat(m, m), str) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_basic.py:68:17: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in test_concat_subtype: Function concat was called with the wrong arguments [wrong-arg-types] + + assert_type(concat(m, s), str) + \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_basic.py:68:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in test_concat_subtype: Any [assert-type] + + assert_type(concat(m, s), str) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_basic.py:69:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in test_concat_subtype: Function concat was called with the wrong arguments [wrong-arg-types] + + concat(m, b) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_basic.py:121:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class Pair2(Generic[T, T]): # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_basic.py:157:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in test_my_map: unsupported operand type(s) for item retrieval: MyMap1[str, int] and int [unsupported-operands] + + m1[0] # E + \u001b[1m\u001b[31m~~~~~\u001b[39m\u001b[0m + +generics_basic.py:158:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in test_my_map: unsupported operand type(s) for item retrieval: MyMap2[int, str] and int [unsupported-operands] + + m2[0] # E + \u001b[1m\u001b[31m~~~~~\u001b[39m\u001b[0m + +generics_basic.py:182:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in test_my_iterable_any: Iterator[nothing] [assert-type] + + assert_type(iter(m), Iterator[Any]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ Line 191: Expected 1 errors -Line 34: Unexpected errors ['File "generics_basic.py", line 34, in concat: bad return type [bad-return-type]'] -Line 67: Unexpected errors ['File "generics_basic.py", line 67, in test_concat_subtype: MyStr [assert-type]'] -Line 68: Unexpected errors ['File "generics_basic.py", line 68, in test_concat_subtype: Function concat was called with the wrong arguments [wrong-arg-types]', 'File "generics_basic.py", line 68, in test_concat_subtype: Any [assert-type]'] -Line 182: Unexpected errors ['File "generics_basic.py", line 182, in test_my_iterable_any: Iterator[nothing] [assert-type]'] +Line 34: Unexpected errors ['generics_basic.py:34:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in concat: bad return type [bad-return-type]'] +Line 67: Unexpected errors ['generics_basic.py:67:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in test_concat_subtype: MyStr [assert-type]'] +Line 68: Unexpected errors ['generics_basic.py:68:17: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in test_concat_subtype: Function concat was called with the wrong arguments [wrong-arg-types]', 'generics_basic.py:68:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in test_concat_subtype: Any [assert-type]'] +Line 182: Unexpected errors ['generics_basic.py:182:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in test_my_iterable_any: Iterator[nothing] [assert-type]'] """ diff --git a/conformance/results/pytype/generics_defaults.toml b/conformance/results/pytype/generics_defaults.toml index 64fb88a2e..f5258ae43 100644 --- a/conformance/results/pytype/generics_defaults.toml +++ b/conformance/results/pytype/generics_defaults.toml @@ -1,98 +1,329 @@ conformant = "Unsupported" output = """ -File "generics_defaults.py", line 7, in : typing.Unpack not supported yet [not-supported-yet] -File "generics_defaults.py", line 8, in : typing_extensions.TypeVarTuple not supported yet [not-supported-yet] -File "generics_defaults.py", line 11, in : wrong arguments [invalid-typevar] -File "generics_defaults.py", line 12, in : wrong arguments [invalid-typevar] -File "generics_defaults.py", line 13, in : wrong arguments [invalid-typevar] -File "generics_defaults.py", line 24, in : Invalid type annotation 'Generic' [invalid-annotation] -File "generics_defaults.py", line 27, in : Invalid type annotation 'Generic' [invalid-annotation] -File "generics_defaults.py", line 30, in : class NoNonDefaults is not indexable [not-indexable] -File "generics_defaults.py", line 31, in : class NoNonDefaults is not indexable [not-indexable] -File "generics_defaults.py", line 32, in : class NoNonDefaults is not indexable [not-indexable] -File "generics_defaults.py", line 35, in : Invalid type annotation 'Generic' [invalid-annotation] -File "generics_defaults.py", line 38, in : Invalid type annotation 'OneDefault[float, bool]' [invalid-annotation] -File "generics_defaults.py", line 39, in : Invalid type annotation 'OneDefault[float, bool]' [invalid-annotation] -File "generics_defaults.py", line 42, in : Invalid type annotation 'Generic' [invalid-annotation] -File "generics_defaults.py", line 45, in : Invalid type annotation 'AllTheDefaults[Any, Any, str, int, bool]' [invalid-annotation] -File "generics_defaults.py", line 47, in : Invalid type annotation 'AllTheDefaults[int, complex, str, int, bool]' [invalid-annotation] -File "generics_defaults.py", line 50, in : Invalid type annotation 'AllTheDefaults[int]' [invalid-annotation] -File "generics_defaults.py", line 53, in : Invalid type annotation 'AllTheDefaults[int, complex, str, int, bool]' [invalid-annotation] -File "generics_defaults.py", line 56, in : Invalid type annotation 'AllTheDefaults[int, complex, str]' [invalid-annotation] -File "generics_defaults.py", line 57, in : Invalid type annotation 'AllTheDefaults[int, complex, str, int, bool]' [invalid-annotation] -File "generics_defaults.py", line 60, in : Invalid type annotation 'AllTheDefaults[int, complex, str, int]' [invalid-annotation] -File "generics_defaults.py", line 61, in : Invalid type annotation 'AllTheDefaults[int, complex, str, int, bool]' [invalid-annotation] -File "generics_defaults.py", line 64, in : Invalid type annotation 'AllTheDefaults[int, complex, str, int, bool]' [invalid-annotation] -File "generics_defaults.py", line 65, in : Invalid type annotation 'AllTheDefaults[int, complex, str, int, bool]' [invalid-annotation] -File "generics_defaults.py", line 73, in : wrong arguments [invalid-typevar] -File "generics_defaults.py", line 76, in : Invalid type annotation 'Generic' [invalid-annotation] -File "generics_defaults.py", line 79, in : class Class_ParamSpec is not indexable [not-indexable] -File "generics_defaults.py", line 80, in : class Class_ParamSpec is not indexable [not-indexable] -File "generics_defaults.py", line 81, in : class Class_ParamSpec is not indexable [not-indexable] -File "generics_defaults.py", line 91, in : Invalid type annotation 'Generic' [invalid-annotation] -File "generics_defaults.py", line 94, in : class Class_TypeVarTuple is not indexable [not-indexable] -File "generics_defaults.py", line 95, in : class Class_TypeVarTuple is not indexable [not-indexable] -File "generics_defaults.py", line 96, in : class Class_TypeVarTuple is not indexable [not-indexable] -File "generics_defaults.py", line 103, in : wrong arguments [invalid-typevar] -File "generics_defaults.py", line 104, in : wrong arguments [invalid-typevar] -File "generics_defaults.py", line 110, in : wrong arguments [invalid-typevar] -File "generics_defaults.py", line 111, in : wrong arguments [invalid-typevar] -File "generics_defaults.py", line 121, in : wrong arguments [invalid-typevar] -File "generics_defaults.py", line 127, in : Any [assert-type] -File "generics_defaults.py", line 135, in : wrong arguments [invalid-typevar] -File "generics_defaults.py", line 138, in : Invalid type annotation 'Generic' [invalid-annotation] -File "generics_defaults.py", line 145, in : wrong arguments [invalid-typevar] -File "generics_defaults.py", line 148, in : Invalid type annotation 'Generic' [invalid-annotation] -File "generics_defaults.py", line 151, in : class Foo6 is not indexable [not-indexable] -File "generics_defaults.py", line 152, in : class Foo6 is not indexable [not-indexable] -File "generics_defaults.py", line 159, in : Invalid type annotation 'Generic' [invalid-annotation] -File "generics_defaults.py", line 166, in : class Foo7 is not indexable [not-indexable] -File "generics_defaults.py", line 166, in : Callable[[Any], Self] [assert-type] -File "generics_defaults.py", line 167, in : Any [assert-type] +generics_defaults.py:7:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing.Unpack not supported yet [not-supported-yet] + +from typing import Any, Callable, Generic, Self, Unpack, assert_type +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:8:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing_extensions.TypeVarTuple not supported yet [not-supported-yet] + +from typing_extensions import TypeVar, ParamSpec, TypeVarTuple +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:11:15: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +DefaultStrT = TypeVar("DefaultStrT", default=str) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:12:15: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +DefaultIntT = TypeVar("DefaultIntT", default=int) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:13:16: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +DefaultBoolT = TypeVar("DefaultBoolT", default=bool) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:24:32: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class NonDefaultFollowsDefault(Generic[DefaultStrT, T]): ... # E: non-default TypeVars cannot follow ones with defaults + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:27:21: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class NoNonDefaults(Generic[DefaultStrT, DefaultIntT]): ... + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:30:33: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class NoNonDefaults is not indexable [not-indexable] + +assert_type(NoNonDefaults, type[NoNonDefaults[str, int]]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:31:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class NoNonDefaults is not indexable [not-indexable] + +assert_type(NoNonDefaults[str], type[NoNonDefaults[str, int]]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:31:38: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class NoNonDefaults is not indexable [not-indexable] + +assert_type(NoNonDefaults[str], type[NoNonDefaults[str, int]]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:32:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class NoNonDefaults is not indexable [not-indexable] + +assert_type(NoNonDefaults[str, int], type[NoNonDefaults[str, int]]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:32:43: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class NoNonDefaults is not indexable [not-indexable] + +assert_type(NoNonDefaults[str, int], type[NoNonDefaults[str, int]]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:35:18: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class OneDefault(Generic[T, DefaultBoolT]): ... + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:38:37: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'OneDefault[float, bool]' [invalid-annotation] + +assert_type(OneDefault[float], type[OneDefault[float, bool]]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:39:34: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'OneDefault[float, bool]' [invalid-annotation] + +assert_type(OneDefault[float](), OneDefault[float, bool]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:42:22: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class AllTheDefaults(Generic[T1, T2, DefaultStrT, DefaultIntT, DefaultBoolT]): ... + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:45:34: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'AllTheDefaults[Any, Any, str, int, bool]' [invalid-annotation] + +assert_type(AllTheDefaults, type[AllTheDefaults[Any, Any, str, int, bool]]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:47:40: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'AllTheDefaults[int, complex, str, int, bool]' [invalid-annotation] + + AllTheDefaults[int, complex], type[AllTheDefaults[int, complex, str, int, bool]] + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:50:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'AllTheDefaults[int]' [invalid-annotation] + +AllTheDefaults[int] # E: expected 2 arguments to AllTheDefaults +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:53:40: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'AllTheDefaults[int, complex, str, int, bool]' [invalid-annotation] + + AllTheDefaults[int, complex], type[AllTheDefaults[int, complex, str, int, bool]] + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:56:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'AllTheDefaults[int, complex, str]' [invalid-annotation] + + AllTheDefaults[int, complex, str], + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:57:10: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'AllTheDefaults[int, complex, str, int, bool]' [invalid-annotation] + + type[AllTheDefaults[int, complex, str, int, bool]], + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:60:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'AllTheDefaults[int, complex, str, int]' [invalid-annotation] + + AllTheDefaults[int, complex, str, int], + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:61:10: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'AllTheDefaults[int, complex, str, int, bool]' [invalid-annotation] + + type[AllTheDefaults[int, complex, str, int, bool]], + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:64:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'AllTheDefaults[int, complex, str, int, bool]' [invalid-annotation] + + AllTheDefaults[int, complex, str, int, bool], + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:65:10: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'AllTheDefaults[int, complex, str, int, bool]' [invalid-annotation] + + type[AllTheDefaults[int, complex, str, int, bool]], + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:73:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +DefaultP = ParamSpec("DefaultP", default=[str, int]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:76:23: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class Class_ParamSpec(Generic[DefaultP]): ... + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:79:35: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Class_ParamSpec is not indexable [not-indexable] + +assert_type(Class_ParamSpec, type[Class_ParamSpec[str, int]]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:80:32: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Class_ParamSpec is not indexable [not-indexable] + +assert_type(Class_ParamSpec(), Class_ParamSpec[str, int]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:81:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Class_ParamSpec is not indexable [not-indexable] + +assert_type(Class_ParamSpec[[bool, bool]](), Class_ParamSpec[bool, bool]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:81:46: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Class_ParamSpec is not indexable [not-indexable] + +assert_type(Class_ParamSpec[[bool, bool]](), Class_ParamSpec[bool, bool]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:91:26: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class Class_TypeVarTuple(Generic[*DefaultTs]): ... + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:94:38: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Class_TypeVarTuple is not indexable [not-indexable] + +assert_type(Class_TypeVarTuple, type[Class_TypeVarTuple[*tuple[str, int]]]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:95:35: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Class_TypeVarTuple is not indexable [not-indexable] + +assert_type(Class_TypeVarTuple(), Class_TypeVarTuple[str, int]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:96:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Class_TypeVarTuple is not indexable [not-indexable] + +assert_type(Class_TypeVarTuple[int, bool](), Class_TypeVarTuple[int, bool]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:96:46: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Class_TypeVarTuple is not indexable [not-indexable] + +assert_type(Class_TypeVarTuple[int, bool](), Class_TypeVarTuple[int, bool]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:103:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +TypeVar("Ok", bound=float, default=int) # OK +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:104:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +TypeVar("Invalid", bound=str, default=int) # E: the bound and default are incompatible +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:110:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +TypeVar("Ok", float, str, default=float) # OK +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:111:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +TypeVar("Invalid", float, str, default=int) # E: expected one of float or str got int +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:121:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +T4 = TypeVar("T4", default=int) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:127:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Any [assert-type] + +assert_type(func1(0), int) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:135:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +T5 = TypeVar("T5", default=bool) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:138:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class Foo5(Generic[*Ts, T5]): ... # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:145:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +P = ParamSpec("P", default=[float, bool]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:148:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class Foo6(Generic[*Ts, P]): ... # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:151:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Foo6 is not indexable [not-indexable] + +assert_type(Foo6[int, str], type[Foo6[int, str, [float, bool]]]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:151:34: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Foo6 is not indexable [not-indexable] + +assert_type(Foo6[int, str], type[Foo6[int, str, [float, bool]]]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:152:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Foo6 is not indexable [not-indexable] + +assert_type(Foo6[int, str, [bytes]], type[Foo6[int, str, [bytes]]]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:152:43: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Foo6 is not indexable [not-indexable] + +assert_type(Foo6[int, str, [bytes]], type[Foo6[int, str, [bytes]]]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:159:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class Foo7(Generic[DefaultIntT]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:166:34: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Foo7 is not indexable [not-indexable] + +assert_type(Foo7.meth, Callable[[Foo7[int]], Foo7[int]]) + \u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:166:46: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Foo7 is not indexable [not-indexable] + +assert_type(Foo7.meth, Callable[[Foo7[int]], Foo7[int]]) + \u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:166:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Callable[[Any], Self] [assert-type] + +assert_type(Foo7.meth, Callable[[Foo7[int]], Foo7[int]]) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:167:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Any [assert-type] + +assert_type(Foo7.attr, int) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ -Line 7: Unexpected errors ['File "generics_defaults.py", line 7, in : typing.Unpack not supported yet [not-supported-yet]'] -Line 8: Unexpected errors ['File "generics_defaults.py", line 8, in : typing_extensions.TypeVarTuple not supported yet [not-supported-yet]'] -Line 11: Unexpected errors ['File "generics_defaults.py", line 11, in : wrong arguments [invalid-typevar]'] -Line 12: Unexpected errors ['File "generics_defaults.py", line 12, in : wrong arguments [invalid-typevar]'] -Line 13: Unexpected errors ['File "generics_defaults.py", line 13, in : wrong arguments [invalid-typevar]'] -Line 27: Unexpected errors ['File "generics_defaults.py", line 27, in : Invalid type annotation \\'Generic\\' [invalid-annotation]'] -Line 30: Unexpected errors ['File "generics_defaults.py", line 30, in : class NoNonDefaults is not indexable [not-indexable]'] -Line 31: Unexpected errors ['File "generics_defaults.py", line 31, in : class NoNonDefaults is not indexable [not-indexable]'] -Line 32: Unexpected errors ['File "generics_defaults.py", line 32, in : class NoNonDefaults is not indexable [not-indexable]'] -Line 35: Unexpected errors ['File "generics_defaults.py", line 35, in : Invalid type annotation \\'Generic\\' [invalid-annotation]'] -Line 38: Unexpected errors ['File "generics_defaults.py", line 38, in : Invalid type annotation \\'OneDefault[float, bool]\\' [invalid-annotation]'] -Line 39: Unexpected errors ['File "generics_defaults.py", line 39, in : Invalid type annotation \\'OneDefault[float, bool]\\' [invalid-annotation]'] -Line 42: Unexpected errors ['File "generics_defaults.py", line 42, in : Invalid type annotation \\'Generic\\' [invalid-annotation]'] -Line 45: Unexpected errors ['File "generics_defaults.py", line 45, in : Invalid type annotation \\'AllTheDefaults[Any, Any, str, int, bool]\\' [invalid-annotation]'] -Line 47: Unexpected errors ['File "generics_defaults.py", line 47, in : Invalid type annotation \\'AllTheDefaults[int, complex, str, int, bool]\\' [invalid-annotation]'] -Line 53: Unexpected errors ['File "generics_defaults.py", line 53, in : Invalid type annotation \\'AllTheDefaults[int, complex, str, int, bool]\\' [invalid-annotation]'] -Line 56: Unexpected errors ['File "generics_defaults.py", line 56, in : Invalid type annotation \\'AllTheDefaults[int, complex, str]\\' [invalid-annotation]'] -Line 57: Unexpected errors ['File "generics_defaults.py", line 57, in : Invalid type annotation \\'AllTheDefaults[int, complex, str, int, bool]\\' [invalid-annotation]'] -Line 60: Unexpected errors ['File "generics_defaults.py", line 60, in : Invalid type annotation \\'AllTheDefaults[int, complex, str, int]\\' [invalid-annotation]'] -Line 61: Unexpected errors ['File "generics_defaults.py", line 61, in : Invalid type annotation \\'AllTheDefaults[int, complex, str, int, bool]\\' [invalid-annotation]'] -Line 64: Unexpected errors ['File "generics_defaults.py", line 64, in : Invalid type annotation \\'AllTheDefaults[int, complex, str, int, bool]\\' [invalid-annotation]'] -Line 65: Unexpected errors ['File "generics_defaults.py", line 65, in : Invalid type annotation \\'AllTheDefaults[int, complex, str, int, bool]\\' [invalid-annotation]'] -Line 73: Unexpected errors ['File "generics_defaults.py", line 73, in : wrong arguments [invalid-typevar]'] -Line 76: Unexpected errors ['File "generics_defaults.py", line 76, in : Invalid type annotation \\'Generic\\' [invalid-annotation]'] -Line 79: Unexpected errors ['File "generics_defaults.py", line 79, in : class Class_ParamSpec is not indexable [not-indexable]'] -Line 80: Unexpected errors ['File "generics_defaults.py", line 80, in : class Class_ParamSpec is not indexable [not-indexable]'] -Line 81: Unexpected errors ['File "generics_defaults.py", line 81, in : class Class_ParamSpec is not indexable [not-indexable]'] -Line 91: Unexpected errors ['File "generics_defaults.py", line 91, in : Invalid type annotation \\'Generic\\' [invalid-annotation]'] -Line 94: Unexpected errors ['File "generics_defaults.py", line 94, in : class Class_TypeVarTuple is not indexable [not-indexable]'] -Line 95: Unexpected errors ['File "generics_defaults.py", line 95, in : class Class_TypeVarTuple is not indexable [not-indexable]'] -Line 96: Unexpected errors ['File "generics_defaults.py", line 96, in : class Class_TypeVarTuple is not indexable [not-indexable]'] -Line 103: Unexpected errors ['File "generics_defaults.py", line 103, in : wrong arguments [invalid-typevar]'] -Line 110: Unexpected errors ['File "generics_defaults.py", line 110, in : wrong arguments [invalid-typevar]'] -Line 121: Unexpected errors ['File "generics_defaults.py", line 121, in : wrong arguments [invalid-typevar]'] -Line 127: Unexpected errors ['File "generics_defaults.py", line 127, in : Any [assert-type]'] -Line 135: Unexpected errors ['File "generics_defaults.py", line 135, in : wrong arguments [invalid-typevar]'] -Line 145: Unexpected errors ['File "generics_defaults.py", line 145, in : wrong arguments [invalid-typevar]'] -Line 148: Unexpected errors ['File "generics_defaults.py", line 148, in : Invalid type annotation \\'Generic\\' [invalid-annotation]'] -Line 151: Unexpected errors ['File "generics_defaults.py", line 151, in : class Foo6 is not indexable [not-indexable]'] -Line 152: Unexpected errors ['File "generics_defaults.py", line 152, in : class Foo6 is not indexable [not-indexable]'] -Line 159: Unexpected errors ['File "generics_defaults.py", line 159, in : Invalid type annotation \\'Generic\\' [invalid-annotation]'] -Line 166: Unexpected errors ['File "generics_defaults.py", line 166, in : class Foo7 is not indexable [not-indexable]', 'File "generics_defaults.py", line 166, in : Callable[[Any], Self] [assert-type]'] -Line 167: Unexpected errors ['File "generics_defaults.py", line 167, in : Any [assert-type]'] +Line 7: Unexpected errors ['generics_defaults.py:7:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.Unpack not supported yet [not-supported-yet]'] +Line 8: Unexpected errors ['generics_defaults.py:8:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing_extensions.TypeVarTuple not supported yet [not-supported-yet]'] +Line 11: Unexpected errors ['generics_defaults.py:11:15: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] +Line 12: Unexpected errors ['generics_defaults.py:12:15: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] +Line 13: Unexpected errors ['generics_defaults.py:13:16: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] +Line 27: Unexpected errors ["generics_defaults.py:27:21: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] +Line 30: Unexpected errors ['generics_defaults.py:30:33: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class NoNonDefaults is not indexable [not-indexable]'] +Line 31: Unexpected errors ['generics_defaults.py:31:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class NoNonDefaults is not indexable [not-indexable]', 'generics_defaults.py:31:38: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class NoNonDefaults is not indexable [not-indexable]'] +Line 32: Unexpected errors ['generics_defaults.py:32:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class NoNonDefaults is not indexable [not-indexable]', 'generics_defaults.py:32:43: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class NoNonDefaults is not indexable [not-indexable]'] +Line 35: Unexpected errors ["generics_defaults.py:35:18: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] +Line 38: Unexpected errors ["generics_defaults.py:38:37: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'OneDefault[float, bool]' [invalid-annotation]"] +Line 39: Unexpected errors ["generics_defaults.py:39:34: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'OneDefault[float, bool]' [invalid-annotation]"] +Line 42: Unexpected errors ["generics_defaults.py:42:22: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] +Line 45: Unexpected errors ["generics_defaults.py:45:34: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'AllTheDefaults[Any, Any, str, int, bool]' [invalid-annotation]"] +Line 47: Unexpected errors ["generics_defaults.py:47:40: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'AllTheDefaults[int, complex, str, int, bool]' [invalid-annotation]"] +Line 53: Unexpected errors ["generics_defaults.py:53:40: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'AllTheDefaults[int, complex, str, int, bool]' [invalid-annotation]"] +Line 56: Unexpected errors ["generics_defaults.py:56:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'AllTheDefaults[int, complex, str]' [invalid-annotation]"] +Line 57: Unexpected errors ["generics_defaults.py:57:10: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'AllTheDefaults[int, complex, str, int, bool]' [invalid-annotation]"] +Line 60: Unexpected errors ["generics_defaults.py:60:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'AllTheDefaults[int, complex, str, int]' [invalid-annotation]"] +Line 61: Unexpected errors ["generics_defaults.py:61:10: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'AllTheDefaults[int, complex, str, int, bool]' [invalid-annotation]"] +Line 64: Unexpected errors ["generics_defaults.py:64:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'AllTheDefaults[int, complex, str, int, bool]' [invalid-annotation]"] +Line 65: Unexpected errors ["generics_defaults.py:65:10: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'AllTheDefaults[int, complex, str, int, bool]' [invalid-annotation]"] +Line 73: Unexpected errors ['generics_defaults.py:73:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] +Line 76: Unexpected errors ["generics_defaults.py:76:23: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] +Line 79: Unexpected errors ['generics_defaults.py:79:35: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Class_ParamSpec is not indexable [not-indexable]'] +Line 80: Unexpected errors ['generics_defaults.py:80:32: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Class_ParamSpec is not indexable [not-indexable]'] +Line 81: Unexpected errors ['generics_defaults.py:81:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Class_ParamSpec is not indexable [not-indexable]', 'generics_defaults.py:81:46: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Class_ParamSpec is not indexable [not-indexable]'] +Line 91: Unexpected errors ["generics_defaults.py:91:26: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] +Line 94: Unexpected errors ['generics_defaults.py:94:38: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Class_TypeVarTuple is not indexable [not-indexable]'] +Line 95: Unexpected errors ['generics_defaults.py:95:35: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Class_TypeVarTuple is not indexable [not-indexable]'] +Line 96: Unexpected errors ['generics_defaults.py:96:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Class_TypeVarTuple is not indexable [not-indexable]', 'generics_defaults.py:96:46: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Class_TypeVarTuple is not indexable [not-indexable]'] +Line 103: Unexpected errors ['generics_defaults.py:103:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] +Line 110: Unexpected errors ['generics_defaults.py:110:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] +Line 121: Unexpected errors ['generics_defaults.py:121:6: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] +Line 127: Unexpected errors ['generics_defaults.py:127:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Any [assert-type]'] +Line 135: Unexpected errors ['generics_defaults.py:135:6: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] +Line 145: Unexpected errors ['generics_defaults.py:145:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] +Line 148: Unexpected errors ["generics_defaults.py:148:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] +Line 151: Unexpected errors ['generics_defaults.py:151:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Foo6 is not indexable [not-indexable]', 'generics_defaults.py:151:34: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Foo6 is not indexable [not-indexable]'] +Line 152: Unexpected errors ['generics_defaults.py:152:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Foo6 is not indexable [not-indexable]', 'generics_defaults.py:152:43: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Foo6 is not indexable [not-indexable]'] +Line 159: Unexpected errors ["generics_defaults.py:159:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] +Line 166: Unexpected errors ['generics_defaults.py:166:34: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Foo7 is not indexable [not-indexable]', 'generics_defaults.py:166:46: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Foo7 is not indexable [not-indexable]', 'generics_defaults.py:166:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Callable[[Any], Self] [assert-type]'] +Line 167: Unexpected errors ['generics_defaults.py:167:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Any [assert-type]'] """ diff --git a/conformance/results/pytype/generics_defaults_referential.toml b/conformance/results/pytype/generics_defaults_referential.toml index 133bd7943..2a72e5070 100644 --- a/conformance/results/pytype/generics_defaults_referential.toml +++ b/conformance/results/pytype/generics_defaults_referential.toml @@ -1,65 +1,217 @@ conformant = "Unsupported" output = """ -File "generics_defaults_referential.py", line 14, in : wrong arguments [invalid-typevar] -File "generics_defaults_referential.py", line 15, in : wrong arguments [invalid-typevar] -File "generics_defaults_referential.py", line 16, in : wrong arguments [invalid-typevar] -File "generics_defaults_referential.py", line 17, in : wrong arguments [invalid-typevar] -File "generics_defaults_referential.py", line 20, in : Invalid type annotation 'Generic' [invalid-annotation] -File "generics_defaults_referential.py", line 23, in : class slice is not indexable [not-indexable] -File "generics_defaults_referential.py", line 24, in : class slice is not indexable [not-indexable] -File "generics_defaults_referential.py", line 25, in : class slice is not indexable [not-indexable] -File "generics_defaults_referential.py", line 26, in : class slice is not indexable [not-indexable] -File "generics_defaults_referential.py", line 28, in : wrong arguments [invalid-typevar] -File "generics_defaults_referential.py", line 31, in : Invalid type annotation 'Generic' [invalid-annotation] -File "generics_defaults_referential.py", line 35, in : class Foo is not indexable [not-indexable] -File "generics_defaults_referential.py", line 36, in : class Foo is not indexable [not-indexable] -File "generics_defaults_referential.py", line 37, in : class Foo is not indexable [not-indexable] -File "generics_defaults_referential.py", line 43, in : wrong arguments [invalid-typevar] -File "generics_defaults_referential.py", line 46, in : Invalid type annotation 'Generic' [invalid-annotation] -File "generics_defaults_referential.py", line 49, in : wrong arguments [invalid-typevar] -File "generics_defaults_referential.py", line 50, in : wrong arguments [invalid-typevar] -File "generics_defaults_referential.py", line 53, in : Invalid type annotation 'Generic' [invalid-annotation] -File "generics_defaults_referential.py", line 60, in Foo3: Invalid type annotation 'Generic' [invalid-annotation] -File "generics_defaults_referential.py", line 66, in : wrong arguments [invalid-typevar] -File "generics_defaults_referential.py", line 67, in : wrong arguments [invalid-typevar] -File "generics_defaults_referential.py", line 68, in : wrong arguments [invalid-typevar] -File "generics_defaults_referential.py", line 74, in : wrong arguments [invalid-typevar] -File "generics_defaults_referential.py", line 77, in : wrong arguments [invalid-typevar] -File "generics_defaults_referential.py", line 78, in : wrong arguments [invalid-typevar] -File "generics_defaults_referential.py", line 87, in : wrong arguments [invalid-typevar] -File "generics_defaults_referential.py", line 90, in : Invalid type annotation 'Generic' [invalid-annotation] -File "generics_defaults_referential.py", line 94, in : Invalid type annotation 'Bar[Any, list]' [invalid-annotation] -File "generics_defaults_referential.py", line 95, in : Invalid type annotation 'Bar[int, List[int]]' [invalid-annotation] -File "generics_defaults_referential.py", line 96, in : Invalid type annotation 'Bar[int, List[int]]' [invalid-annotation] -File "generics_defaults_referential.py", line 97, in : Invalid type annotation 'Bar[int, List[str]]' [invalid-annotation] -File "generics_defaults_referential.py", line 98, in : Invalid type annotation 'Bar[int, str]' [invalid-annotation] +generics_defaults_referential.py:14:15: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +DefaultStrT = TypeVar("DefaultStrT", default=str) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:15:10: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +StartT = TypeVar("StartT", default=int) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:16:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +StopT = TypeVar("StopT", default=StartT) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:17:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +StepT = TypeVar("StepT", default=int | None) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:20:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class slice(Generic[StartT, StopT, StepT]): ... + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:23:25: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class slice is not indexable [not-indexable] + +assert_type(slice, type[slice[int, int, int | None]]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:24:22: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class slice is not indexable [not-indexable] + +assert_type(slice(), slice[int, int, int | None]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:25:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class slice is not indexable [not-indexable] + +assert_type(slice[str](), slice[str, str, int | None]) + \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:25:27: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class slice is not indexable [not-indexable] + +assert_type(slice[str](), slice[str, str, int | None]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:26:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class slice is not indexable [not-indexable] + +assert_type(slice[str, bool, complex](), slice[str, bool, complex]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:26:42: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class slice is not indexable [not-indexable] + +assert_type(slice[str, bool, complex](), slice[str, bool, complex]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:28:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +T2 = TypeVar("T2", default=DefaultStrT) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:31:11: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class Foo(Generic[DefaultStrT, T2]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:35:25: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Foo is not indexable [not-indexable] + +assert_type(Foo(1, ""), Foo[int, str]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:36:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Foo is not indexable [not-indexable] + +Foo[int](1, "") # E: Foo[int, str] cannot be assigned to self: Foo[int, int] in Foo.__init__ +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:37:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Foo is not indexable [not-indexable] + +Foo[int]("", 1) # E: Foo[str, int] cannot be assigned to self: Foo[int, int] in Foo.__init__ +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:43:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +S2 = TypeVar("S2", default=S1) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:46:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class Foo2(Generic[S1, S2]): ... # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:49:11: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +Start2T = TypeVar("Start2T", default="StopT") + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:50:10: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +Stop2T = TypeVar("Stop2T", default=int) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:53:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class slice2(Generic[Start2T, Stop2T, StepT]): ... # E: bad ordering + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:60:16: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Foo3: Invalid type annotation 'Generic' [invalid-annotation] + + class Bar2(Generic[S2]): ... # E + \u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:66:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +TypeVar("Ok1", default=X1, bound=float) # OK +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:67:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +TypeVar("AlsoOk1", default=X1, bound=int) # OK +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:68:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +TypeVar("Invalid1", default=X1, bound=str) # E: int is not a subtype of str +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:74:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +TypeVar("Invalid2", float, str, default=Y1) # E: upper bound int is incompatible with constraints float or str +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:77:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +TypeVar("AlsoOk2", int, str, bool, default=Y2) # OK +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:78:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +TypeVar("AlsoInvalid2", bool, complex, default=Y2) # E: {bool, complex} is not a superset of {int, str} +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:87:16: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +ListDefaultT = TypeVar("ListDefaultT", default=list[Z1]) # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:90:11: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class Bar(Generic[Z1, ListDefaultT]): # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:94:23: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Bar[Any, list]' [invalid-annotation] + +assert_type(Bar, type[Bar[Any, list[Any]]]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:95:28: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Bar[int, List[int]]' [invalid-annotation] + +assert_type(Bar[int], type[Bar[int, list[int]]]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:96:30: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Bar[int, List[int]]' [invalid-annotation] + +assert_type(Bar[int](0, []), Bar[int, list[int]]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:97:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Bar[int, List[str]]' [invalid-annotation] + +assert_type(Bar[int, list[str]](0, []), Bar[int, list[str]]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:97:41: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Bar[int, List[str]]' [invalid-annotation] + +assert_type(Bar[int, list[str]](0, []), Bar[int, list[str]]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:98:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Bar[int, str]' [invalid-annotation] + +assert_type(Bar[int, str](0, ""), Bar[int, str]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:98:35: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Bar[int, str]' [invalid-annotation] + +assert_type(Bar[int, str](0, ""), Bar[int, str]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ -Line 14: Unexpected errors ['File "generics_defaults_referential.py", line 14, in : wrong arguments [invalid-typevar]'] -Line 15: Unexpected errors ['File "generics_defaults_referential.py", line 15, in : wrong arguments [invalid-typevar]'] -Line 16: Unexpected errors ['File "generics_defaults_referential.py", line 16, in : wrong arguments [invalid-typevar]'] -Line 17: Unexpected errors ['File "generics_defaults_referential.py", line 17, in : wrong arguments [invalid-typevar]'] -Line 20: Unexpected errors ['File "generics_defaults_referential.py", line 20, in : Invalid type annotation \\'Generic\\' [invalid-annotation]'] -Line 23: Unexpected errors ['File "generics_defaults_referential.py", line 23, in : class slice is not indexable [not-indexable]'] -Line 24: Unexpected errors ['File "generics_defaults_referential.py", line 24, in : class slice is not indexable [not-indexable]'] -Line 25: Unexpected errors ['File "generics_defaults_referential.py", line 25, in : class slice is not indexable [not-indexable]'] -Line 26: Unexpected errors ['File "generics_defaults_referential.py", line 26, in : class slice is not indexable [not-indexable]'] -Line 28: Unexpected errors ['File "generics_defaults_referential.py", line 28, in : wrong arguments [invalid-typevar]'] -Line 31: Unexpected errors ['File "generics_defaults_referential.py", line 31, in : Invalid type annotation \\'Generic\\' [invalid-annotation]'] -Line 35: Unexpected errors ['File "generics_defaults_referential.py", line 35, in : class Foo is not indexable [not-indexable]'] -Line 43: Unexpected errors ['File "generics_defaults_referential.py", line 43, in : wrong arguments [invalid-typevar]'] -Line 46: Unexpected errors ['File "generics_defaults_referential.py", line 46, in : Invalid type annotation \\'Generic\\' [invalid-annotation]'] -Line 49: Unexpected errors ['File "generics_defaults_referential.py", line 49, in : wrong arguments [invalid-typevar]'] -Line 50: Unexpected errors ['File "generics_defaults_referential.py", line 50, in : wrong arguments [invalid-typevar]'] -Line 66: Unexpected errors ['File "generics_defaults_referential.py", line 66, in : wrong arguments [invalid-typevar]'] -Line 67: Unexpected errors ['File "generics_defaults_referential.py", line 67, in : wrong arguments [invalid-typevar]'] -Line 77: Unexpected errors ['File "generics_defaults_referential.py", line 77, in : wrong arguments [invalid-typevar]'] -Line 87: Unexpected errors ['File "generics_defaults_referential.py", line 87, in : wrong arguments [invalid-typevar]'] -Line 90: Unexpected errors ['File "generics_defaults_referential.py", line 90, in : Invalid type annotation \\'Generic\\' [invalid-annotation]'] -Line 94: Unexpected errors ['File "generics_defaults_referential.py", line 94, in : Invalid type annotation \\'Bar[Any, list]\\' [invalid-annotation]'] -Line 95: Unexpected errors ['File "generics_defaults_referential.py", line 95, in : Invalid type annotation \\'Bar[int, List[int]]\\' [invalid-annotation]'] -Line 96: Unexpected errors ['File "generics_defaults_referential.py", line 96, in : Invalid type annotation \\'Bar[int, List[int]]\\' [invalid-annotation]'] -Line 97: Unexpected errors ['File "generics_defaults_referential.py", line 97, in : Invalid type annotation \\'Bar[int, List[str]]\\' [invalid-annotation]'] -Line 98: Unexpected errors ['File "generics_defaults_referential.py", line 98, in : Invalid type annotation \\'Bar[int, str]\\' [invalid-annotation]'] +Line 14: Unexpected errors ['generics_defaults_referential.py:14:15: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] +Line 15: Unexpected errors ['generics_defaults_referential.py:15:10: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] +Line 16: Unexpected errors ['generics_defaults_referential.py:16:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] +Line 17: Unexpected errors ['generics_defaults_referential.py:17:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] +Line 20: Unexpected errors ["generics_defaults_referential.py:20:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] +Line 23: Unexpected errors ['generics_defaults_referential.py:23:25: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class slice is not indexable [not-indexable]'] +Line 24: Unexpected errors ['generics_defaults_referential.py:24:22: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class slice is not indexable [not-indexable]'] +Line 25: Unexpected errors ['generics_defaults_referential.py:25:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class slice is not indexable [not-indexable]', 'generics_defaults_referential.py:25:27: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class slice is not indexable [not-indexable]'] +Line 26: Unexpected errors ['generics_defaults_referential.py:26:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class slice is not indexable [not-indexable]', 'generics_defaults_referential.py:26:42: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class slice is not indexable [not-indexable]'] +Line 28: Unexpected errors ['generics_defaults_referential.py:28:6: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] +Line 31: Unexpected errors ["generics_defaults_referential.py:31:11: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] +Line 35: Unexpected errors ['generics_defaults_referential.py:35:25: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Foo is not indexable [not-indexable]'] +Line 43: Unexpected errors ['generics_defaults_referential.py:43:6: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] +Line 46: Unexpected errors ["generics_defaults_referential.py:46:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] +Line 49: Unexpected errors ['generics_defaults_referential.py:49:11: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] +Line 50: Unexpected errors ['generics_defaults_referential.py:50:10: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] +Line 66: Unexpected errors ['generics_defaults_referential.py:66:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] +Line 67: Unexpected errors ['generics_defaults_referential.py:67:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] +Line 77: Unexpected errors ['generics_defaults_referential.py:77:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] +Line 87: Unexpected errors ['generics_defaults_referential.py:87:16: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] +Line 90: Unexpected errors ["generics_defaults_referential.py:90:11: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] +Line 94: Unexpected errors ["generics_defaults_referential.py:94:23: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Bar[Any, list]' [invalid-annotation]"] +Line 95: Unexpected errors ["generics_defaults_referential.py:95:28: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Bar[int, List[int]]' [invalid-annotation]"] +Line 96: Unexpected errors ["generics_defaults_referential.py:96:30: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Bar[int, List[int]]' [invalid-annotation]"] +Line 97: Unexpected errors ["generics_defaults_referential.py:97:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Bar[int, List[str]]' [invalid-annotation]", "generics_defaults_referential.py:97:41: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Bar[int, List[str]]' [invalid-annotation]"] +Line 98: Unexpected errors ["generics_defaults_referential.py:98:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Bar[int, str]' [invalid-annotation]", "generics_defaults_referential.py:98:35: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Bar[int, str]' [invalid-annotation]"] """ diff --git a/conformance/results/pytype/generics_defaults_specialization.toml b/conformance/results/pytype/generics_defaults_specialization.toml index 2256fad5c..2b77a0a3e 100644 --- a/conformance/results/pytype/generics_defaults_specialization.toml +++ b/conformance/results/pytype/generics_defaults_specialization.toml @@ -1,35 +1,104 @@ conformant = "Unsupported" output = """ -File "generics_defaults_specialization.py", line 15, in : wrong arguments [invalid-typevar] -File "generics_defaults_specialization.py", line 16, in : wrong arguments [invalid-typevar] -File "generics_defaults_specialization.py", line 25, in : Invalid type annotation 'SomethingWithNoDefaults[int, Any][bool]' [invalid-annotation] -File "generics_defaults_specialization.py", line 26, in func1: SomethingWithNoDefaults[int, Any] [assert-type] -File "generics_defaults_specialization.py", line 27, in func1: SomethingWithNoDefaults[int, Any] [assert-type] -File "generics_defaults_specialization.py", line 30, in : Invalid type annotation 'SomethingWithNoDefaults[int, Any][bool, int]' [invalid-annotation] -File "generics_defaults_specialization.py", line 38, in : Invalid type annotation 'Generic' [invalid-annotation] -File "generics_defaults_specialization.py", line 42, in : Invalid type annotation 'SubclassMe[int, Any]' [invalid-annotation] -File "generics_defaults_specialization.py", line 45, in : class Bar is not indexable [not-indexable] -File "generics_defaults_specialization.py", line 46, in : class Bar is not indexable [not-indexable] -File "generics_defaults_specialization.py", line 47, in : class Bar is not indexable [not-indexable] -File "generics_defaults_specialization.py", line 53, in : Any [assert-type] -File "generics_defaults_specialization.py", line 55, in : class Foo is not indexable [not-indexable] -File "generics_defaults_specialization.py", line 58, in : Invalid type annotation 'Generic' [invalid-annotation] -File "generics_defaults_specialization.py", line 65, in : class Baz is not indexable [not-indexable] -File "generics_defaults_specialization.py", line 65, in : Invalid type annotation 'Baz[int, str]' [invalid-annotation] +generics_defaults_specialization.py:15:15: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +DefaultIntT = TypeVar("DefaultIntT", default=int) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_specialization.py:16:15: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +DefaultStrT = TypeVar("DefaultStrT", default=str) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_specialization.py:25:28: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'SomethingWithNoDefaults[int, Any][bool]' [invalid-annotation] + +def func1(p1: MyAlias, p2: MyAlias[bool]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_specialization.py:26:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: SomethingWithNoDefaults[int, Any] [assert-type] + + assert_type(p1, SomethingWithNoDefaults[int, str]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_specialization.py:27:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: SomethingWithNoDefaults[int, Any] [assert-type] + + assert_type(p2, SomethingWithNoDefaults[int, bool]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_specialization.py:30:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'SomethingWithNoDefaults[int, Any][bool, int]' [invalid-annotation] + +MyAlias[bool, int] # E: too many arguments passed to MyAlias +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_specialization.py:38:18: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class SubclassMe(Generic[T1, DefaultStrT]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_specialization.py:42:11: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'SubclassMe[int, Any]' [invalid-annotation] + +class Bar(SubclassMe[int, DefaultStrT]): ... + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_specialization.py:45:23: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Bar is not indexable [not-indexable] + +assert_type(Bar, type[Bar[str]]) + \u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_specialization.py:46:20: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Bar is not indexable [not-indexable] + +assert_type(Bar(), Bar[str]) + \u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_specialization.py:47:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Bar is not indexable [not-indexable] + +assert_type(Bar[bool](), Bar[bool]) + \u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_specialization.py:47:26: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Bar is not indexable [not-indexable] + +assert_type(Bar[bool](), Bar[bool]) + \u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_specialization.py:53:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Any [assert-type] + +assert_type(Foo().x, str) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_specialization.py:55:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Foo is not indexable [not-indexable] + +Foo[str] # E: Foo cannot be further subscripted +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_specialization.py:58:11: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class Baz(Generic[DefaultIntT, DefaultStrT]): ... + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_specialization.py:65:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Baz is not indexable [not-indexable] + +v1: Baz[int, str] = Spam() + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_specialization.py:65:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Baz[int, str]' [invalid-annotation] + +v1: Baz[int, str] = Spam() +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ -Line 15: Unexpected errors ['File "generics_defaults_specialization.py", line 15, in : wrong arguments [invalid-typevar]'] -Line 16: Unexpected errors ['File "generics_defaults_specialization.py", line 16, in : wrong arguments [invalid-typevar]'] -Line 25: Unexpected errors ['File "generics_defaults_specialization.py", line 25, in : Invalid type annotation \\'SomethingWithNoDefaults[int, Any][bool]\\' [invalid-annotation]'] -Line 26: Unexpected errors ['File "generics_defaults_specialization.py", line 26, in func1: SomethingWithNoDefaults[int, Any] [assert-type]'] -Line 27: Unexpected errors ['File "generics_defaults_specialization.py", line 27, in func1: SomethingWithNoDefaults[int, Any] [assert-type]'] -Line 38: Unexpected errors ['File "generics_defaults_specialization.py", line 38, in : Invalid type annotation \\'Generic\\' [invalid-annotation]'] -Line 42: Unexpected errors ['File "generics_defaults_specialization.py", line 42, in : Invalid type annotation \\'SubclassMe[int, Any]\\' [invalid-annotation]'] -Line 45: Unexpected errors ['File "generics_defaults_specialization.py", line 45, in : class Bar is not indexable [not-indexable]'] -Line 46: Unexpected errors ['File "generics_defaults_specialization.py", line 46, in : class Bar is not indexable [not-indexable]'] -Line 47: Unexpected errors ['File "generics_defaults_specialization.py", line 47, in : class Bar is not indexable [not-indexable]'] -Line 53: Unexpected errors ['File "generics_defaults_specialization.py", line 53, in : Any [assert-type]'] -Line 58: Unexpected errors ['File "generics_defaults_specialization.py", line 58, in : Invalid type annotation \\'Generic\\' [invalid-annotation]'] -Line 65: Unexpected errors ['File "generics_defaults_specialization.py", line 65, in : class Baz is not indexable [not-indexable]', 'File "generics_defaults_specialization.py", line 65, in : Invalid type annotation \\'Baz[int, str]\\' [invalid-annotation]'] +Line 15: Unexpected errors ['generics_defaults_specialization.py:15:15: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] +Line 16: Unexpected errors ['generics_defaults_specialization.py:16:15: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] +Line 25: Unexpected errors ["generics_defaults_specialization.py:25:28: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'SomethingWithNoDefaults[int, Any][bool]' [invalid-annotation]"] +Line 26: Unexpected errors ['generics_defaults_specialization.py:26:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: SomethingWithNoDefaults[int, Any] [assert-type]'] +Line 27: Unexpected errors ['generics_defaults_specialization.py:27:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: SomethingWithNoDefaults[int, Any] [assert-type]'] +Line 38: Unexpected errors ["generics_defaults_specialization.py:38:18: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] +Line 42: Unexpected errors ["generics_defaults_specialization.py:42:11: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'SubclassMe[int, Any]' [invalid-annotation]"] +Line 45: Unexpected errors ['generics_defaults_specialization.py:45:23: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Bar is not indexable [not-indexable]'] +Line 46: Unexpected errors ['generics_defaults_specialization.py:46:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Bar is not indexable [not-indexable]'] +Line 47: Unexpected errors ['generics_defaults_specialization.py:47:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Bar is not indexable [not-indexable]', 'generics_defaults_specialization.py:47:26: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Bar is not indexable [not-indexable]'] +Line 53: Unexpected errors ['generics_defaults_specialization.py:53:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Any [assert-type]'] +Line 58: Unexpected errors ["generics_defaults_specialization.py:58:11: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] +Line 65: Unexpected errors ['generics_defaults_specialization.py:65:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Baz is not indexable [not-indexable]', "generics_defaults_specialization.py:65:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Baz[int, str]' [invalid-annotation]"] """ diff --git a/conformance/results/pytype/generics_paramspec_specialization.toml b/conformance/results/pytype/generics_paramspec_specialization.toml index e4e920c9b..cbe272e96 100644 --- a/conformance/results/pytype/generics_paramspec_specialization.toml +++ b/conformance/results/pytype/generics_paramspec_specialization.toml @@ -5,27 +5,75 @@ Does not reject invalid specialization of class with both TypeVar and ParamSpec. Reports error for valid method call involving ParamSpec. """ output = """ -File "generics_paramspec_specialization.py", line 32, in : Invalid type annotation '[int, bool]' [invalid-annotation] -File "generics_paramspec_specialization.py", line 32, in : Invalid type annotation 'Ellipsis' [invalid-annotation] -File "generics_paramspec_specialization.py", line 36, in : Invalid type annotation 'Ellipsis' [invalid-annotation] -File "generics_paramspec_specialization.py", line 40, in : Invalid type annotation '[]' [invalid-annotation] -File "generics_paramspec_specialization.py", line 52, in : Invalid type annotation '[int, str, bool]' [invalid-annotation] -File "generics_paramspec_specialization.py", line 53, in func30: Function expects 1 arg(s), got 3 [wrong-arg-count] -File "generics_paramspec_specialization.py", line 54, in func30: Function expects 1 arg(s), got 3 [wrong-arg-count] -File "generics_paramspec_specialization.py", line 55, in func30: Function expects 1 arg(s), got 3 [wrong-arg-count] -File "generics_paramspec_specialization.py", line 58, in : Invalid type annotation 'ClassC[int, str, bool]' [invalid-annotation] -File "generics_paramspec_specialization.py", line 59, in func31: Function expects 1 arg(s), got 3 [wrong-arg-count] -File "generics_paramspec_specialization.py", line 60, in func31: Function expects 1 arg(s), got 3 [wrong-arg-count] -File "generics_paramspec_specialization.py", line 61, in func31: Function expects 1 arg(s), got 3 [wrong-arg-count] +generics_paramspec_specialization.py:32:15: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '[int, bool]' [invalid-annotation] + +def func22(x: ClassB[int, [int, bool], ...]) -> str: # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_paramspec_specialization.py:32:15: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Ellipsis' [invalid-annotation] + +def func22(x: ClassB[int, [int, bool], ...]) -> str: # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_paramspec_specialization.py:36:15: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Ellipsis' [invalid-annotation] + +def func23(x: ClassA[int, ...]) -> str: # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_paramspec_specialization.py:40:15: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '[]' [invalid-annotation] + +def func24(x: ClassB[int, [], []]) -> str: # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_paramspec_specialization.py:52:15: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '[int, str, bool]' [invalid-annotation] + +def func30(x: ClassC[[int, str, bool]]) -> None: # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_paramspec_specialization.py:53:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func30: Function expects 1 arg(s), got 3 [wrong-arg-count] + + x.f(0, "", True) # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_paramspec_specialization.py:54:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func30: Function expects 1 arg(s), got 3 [wrong-arg-count] + + x.f("", "", True) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_paramspec_specialization.py:55:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func30: Function expects 1 arg(s), got 3 [wrong-arg-count] + + x.f(0, "", "") # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_paramspec_specialization.py:58:15: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'ClassC[int, str, bool]' [invalid-annotation] + +def func31(x: ClassC[int, str, bool]) -> None: # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_paramspec_specialization.py:59:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func31: Function expects 1 arg(s), got 3 [wrong-arg-count] + + x.f(0, "", True) # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_paramspec_specialization.py:60:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func31: Function expects 1 arg(s), got 3 [wrong-arg-count] + + x.f("", "", True) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_paramspec_specialization.py:61:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func31: Function expects 1 arg(s), got 3 [wrong-arg-count] + + x.f(0, "", "") # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ Line 44: Expected 1 errors -Line 32: Unexpected errors ['File "generics_paramspec_specialization.py", line 32, in : Invalid type annotation \\'[int, bool]\\' [invalid-annotation]', 'File "generics_paramspec_specialization.py", line 32, in : Invalid type annotation \\'Ellipsis\\' [invalid-annotation]'] -Line 36: Unexpected errors ['File "generics_paramspec_specialization.py", line 36, in : Invalid type annotation \\'Ellipsis\\' [invalid-annotation]'] -Line 40: Unexpected errors ['File "generics_paramspec_specialization.py", line 40, in : Invalid type annotation \\'[]\\' [invalid-annotation]'] -Line 52: Unexpected errors ['File "generics_paramspec_specialization.py", line 52, in : Invalid type annotation \\'[int, str, bool]\\' [invalid-annotation]'] -Line 53: Unexpected errors ['File "generics_paramspec_specialization.py", line 53, in func30: Function expects 1 arg(s), got 3 [wrong-arg-count]'] -Line 58: Unexpected errors ['File "generics_paramspec_specialization.py", line 58, in : Invalid type annotation \\'ClassC[int, str, bool]\\' [invalid-annotation]'] -Line 59: Unexpected errors ['File "generics_paramspec_specialization.py", line 59, in func31: Function expects 1 arg(s), got 3 [wrong-arg-count]'] +Line 32: Unexpected errors ["generics_paramspec_specialization.py:32:15: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '[int, bool]' [invalid-annotation]", "generics_paramspec_specialization.py:32:15: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Ellipsis' [invalid-annotation]"] +Line 36: Unexpected errors ["generics_paramspec_specialization.py:36:15: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Ellipsis' [invalid-annotation]"] +Line 40: Unexpected errors ["generics_paramspec_specialization.py:40:15: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '[]' [invalid-annotation]"] +Line 52: Unexpected errors ["generics_paramspec_specialization.py:52:15: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '[int, str, bool]' [invalid-annotation]"] +Line 53: Unexpected errors ['generics_paramspec_specialization.py:53:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func30: Function expects 1 arg(s), got 3 [wrong-arg-count]'] +Line 58: Unexpected errors ["generics_paramspec_specialization.py:58:15: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'ClassC[int, str, bool]' [invalid-annotation]"] +Line 59: Unexpected errors ['generics_paramspec_specialization.py:59:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func31: Function expects 1 arg(s), got 3 [wrong-arg-count]'] """ diff --git a/conformance/results/pytype/generics_scoping.toml b/conformance/results/pytype/generics_scoping.toml index ec46810e8..d9f7e61d4 100644 --- a/conformance/results/pytype/generics_scoping.toml +++ b/conformance/results/pytype/generics_scoping.toml @@ -4,15 +4,85 @@ Fails to reject type alias within generic class that uses class's type variable. Fails to reject unbound type variable in constructor call in global scope. """ output = """ -File "generics_scoping.py", line 29, in : Function MyClass.meth_2 was called with the wrong arguments [wrong-arg-types] -File "generics_scoping.py", line 50, in fun_3: Invalid type annotation 'List[S]' for z [invalid-annotation] -File "generics_scoping.py", line 54, in Bar: Invalid type annotation 'List[S]' for an_attr [invalid-annotation] -File "generics_scoping.py", line 63, in fun_4: Invalid type annotation 'T' [invalid-annotation] -File "generics_scoping.py", line 74, in : Invalid type annotation 'Outer' [invalid-annotation] -File "generics_scoping.py", line 78, in AlsoBad: Invalid type annotation 'List[T]' for x [invalid-annotation] -File "generics_scoping.py", line 80, in AlsoBad: Invalid type annotation 'T' [invalid-annotation] -File "generics_scoping.py", line 94, in : Invalid type annotation 'T' for global_var1 [invalid-annotation] -File "generics_scoping.py", line 95, in : Invalid type annotation 'List[T]' for global_var2 [invalid-annotation] +generics_scoping.py:29:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function MyClass.meth_2 was called with the wrong arguments [wrong-arg-types] + +a.meth_2('a') # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_scoping.py:50:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in fun_3: Invalid type annotation 'List[S]' for z [invalid-annotation] + + z: list[S] = [] # E + \u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +generics_scoping.py:54:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Bar: Invalid type annotation 'List[S]' for an_attr [invalid-annotation] + + an_attr: list[S] = [] # E + \u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +generics_scoping.py:63:23: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in fun_4: Invalid type annotation 'T' [invalid-annotation] + + a_list: list[T] = [] # OK + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +generics_scoping.py:74:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Outer' [invalid-annotation] + +class Outer(Generic[T]): +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + class Bad(Iterable[T]): # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + class AlsoBad: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + x: list[T] # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + def __init__(self, x: list[T]) -> None: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + self.x = x +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + class Inner(Iterable[S]): # OK +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + attr: Inner[T] # OK +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + alias: TypeAlias = list[T] # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + def __init__(self, attr: Inner[T]) -> None: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + self.attr = attr +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_scoping.py:78:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in AlsoBad: Invalid type annotation 'List[T]' for x [invalid-annotation] + + x: list[T] # E + \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + +generics_scoping.py:80:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in AlsoBad: Invalid type annotation 'T' [invalid-annotation] + + def __init__(self, x: list[T]) -> None: + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + self.x = x +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_scoping.py:94:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'T' for global_var1 [invalid-annotation] + +global_var1: T # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_scoping.py:95:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'List[T]' for global_var2 [invalid-annotation] + +global_var2: list[T] = [] # E +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -20,7 +90,7 @@ Line 65: Expected 1 errors Line 75: Expected 1 errors Line 87: Expected 1 errors Line 96: Expected 1 errors -Line 63: Unexpected errors ['File "generics_scoping.py", line 63, in fun_4: Invalid type annotation \\'T\\' [invalid-annotation]'] -Line 74: Unexpected errors ['File "generics_scoping.py", line 74, in : Invalid type annotation \\'Outer\\' [invalid-annotation]'] -Line 80: Unexpected errors ['File "generics_scoping.py", line 80, in AlsoBad: Invalid type annotation \\'T\\' [invalid-annotation]'] +Line 63: Unexpected errors ["generics_scoping.py:63:23: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in fun_4: Invalid type annotation 'T' [invalid-annotation]"] +Line 74: Unexpected errors ["generics_scoping.py:74:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Outer' [invalid-annotation]"] +Line 80: Unexpected errors ["generics_scoping.py:80:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in AlsoBad: Invalid type annotation 'T' [invalid-annotation]"] """ diff --git a/conformance/results/pytype/generics_self_advanced.toml b/conformance/results/pytype/generics_self_advanced.toml index 253ce01a6..9a818632f 100644 --- a/conformance/results/pytype/generics_self_advanced.toml +++ b/conformance/results/pytype/generics_self_advanced.toml @@ -3,37 +3,89 @@ notes = """ Does not understand `Self` type. """ output = """ -File "generics_self_advanced.py", line 12, in prop1: bad return type [bad-return-type] +generics_self_advanced.py:12:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in prop1: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + Called from (traceback): line 19, in current file -File "generics_self_advanced.py", line 12, in prop1: bad return type [bad-return-type] +generics_self_advanced.py:12:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in prop1: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + Called from (traceback): line 18, in current file -File "generics_self_advanced.py", line 19, in : ParentA [assert-type] -File "generics_self_advanced.py", line 29, in method1: bad return type [bad-return-type] +generics_self_advanced.py:19:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : ParentA [assert-type] + +assert_type(ChildA().prop1, ChildA) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_self_advanced.py:29:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method1: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + Called from (traceback): line 38, in method2 -File "generics_self_advanced.py", line 29, in method1: bad return type [bad-return-type] -File "generics_self_advanced.py", line 35, in method2: ChildB [assert-type] -File "generics_self_advanced.py", line 36, in method2: List[ChildB] [assert-type] -File "generics_self_advanced.py", line 37, in method2: ChildB [assert-type] -File "generics_self_advanced.py", line 38, in method2: ChildB [assert-type] -File "generics_self_advanced.py", line 42, in method3: Type[ChildB] [assert-type] -File "generics_self_advanced.py", line 43, in method3: List[ChildB] [assert-type] -File "generics_self_advanced.py", line 44, in method3: ChildB [assert-type] -File "generics_self_advanced.py", line 45, in method3: ChildB [assert-type] +generics_self_advanced.py:29:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method1: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +generics_self_advanced.py:35:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method2: ChildB [assert-type] + + assert_type(self, Self) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_self_advanced.py:36:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method2: List[ChildB] [assert-type] + + assert_type(self.a, list[Self]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_self_advanced.py:37:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method2: ChildB [assert-type] + + assert_type(self.a[0], Self) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_self_advanced.py:38:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method2: ChildB [assert-type] + + assert_type(self.method1(), Self) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_self_advanced.py:42:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method3: Type[ChildB] [assert-type] + + assert_type(cls, type[Self]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_self_advanced.py:43:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method3: List[ChildB] [assert-type] + + assert_type(cls.a, list[Self]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_self_advanced.py:44:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method3: ChildB [assert-type] + + assert_type(cls.a[0], Self) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_self_advanced.py:45:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method3: ChildB [assert-type] + + assert_type(cls.method1(), Self) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ -Line 12: Unexpected errors ['File "generics_self_advanced.py", line 12, in prop1: bad return type [bad-return-type]', 'File "generics_self_advanced.py", line 12, in prop1: bad return type [bad-return-type]'] -Line 19: Unexpected errors ['File "generics_self_advanced.py", line 19, in : ParentA [assert-type]'] -Line 29: Unexpected errors ['File "generics_self_advanced.py", line 29, in method1: bad return type [bad-return-type]', 'File "generics_self_advanced.py", line 29, in method1: bad return type [bad-return-type]'] -Line 35: Unexpected errors ['File "generics_self_advanced.py", line 35, in method2: ChildB [assert-type]'] -Line 36: Unexpected errors ['File "generics_self_advanced.py", line 36, in method2: List[ChildB] [assert-type]'] -Line 37: Unexpected errors ['File "generics_self_advanced.py", line 37, in method2: ChildB [assert-type]'] -Line 38: Unexpected errors ['File "generics_self_advanced.py", line 38, in method2: ChildB [assert-type]'] -Line 42: Unexpected errors ['File "generics_self_advanced.py", line 42, in method3: Type[ChildB] [assert-type]'] -Line 43: Unexpected errors ['File "generics_self_advanced.py", line 43, in method3: List[ChildB] [assert-type]'] -Line 44: Unexpected errors ['File "generics_self_advanced.py", line 44, in method3: ChildB [assert-type]'] -Line 45: Unexpected errors ['File "generics_self_advanced.py", line 45, in method3: ChildB [assert-type]'] +Line 12: Unexpected errors ['generics_self_advanced.py:12:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in prop1: bad return type [bad-return-type]', 'generics_self_advanced.py:12:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in prop1: bad return type [bad-return-type]'] +Line 19: Unexpected errors ['generics_self_advanced.py:19:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : ParentA [assert-type]'] +Line 29: Unexpected errors ['generics_self_advanced.py:29:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method1: bad return type [bad-return-type]', 'generics_self_advanced.py:29:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method1: bad return type [bad-return-type]'] +Line 35: Unexpected errors ['generics_self_advanced.py:35:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method2: ChildB [assert-type]'] +Line 36: Unexpected errors ['generics_self_advanced.py:36:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method2: List[ChildB] [assert-type]'] +Line 37: Unexpected errors ['generics_self_advanced.py:37:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method2: ChildB [assert-type]'] +Line 38: Unexpected errors ['generics_self_advanced.py:38:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method2: ChildB [assert-type]'] +Line 42: Unexpected errors ['generics_self_advanced.py:42:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method3: Type[ChildB] [assert-type]'] +Line 43: Unexpected errors ['generics_self_advanced.py:43:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method3: List[ChildB] [assert-type]'] +Line 44: Unexpected errors ['generics_self_advanced.py:44:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method3: ChildB [assert-type]'] +Line 45: Unexpected errors ['generics_self_advanced.py:45:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method3: ChildB [assert-type]'] """ diff --git a/conformance/results/pytype/generics_self_attributes.toml b/conformance/results/pytype/generics_self_attributes.toml index 940249455..8079a601d 100644 --- a/conformance/results/pytype/generics_self_attributes.toml +++ b/conformance/results/pytype/generics_self_attributes.toml @@ -3,7 +3,11 @@ notes = """ Does not understand `Self` type. """ output = """ -File "generics_self_attributes.py", line 26, in : Function OrdinalLinkedList.__init__ was called with the wrong arguments [wrong-arg-types] +generics_self_attributes.py:26:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function OrdinalLinkedList.__init__ was called with the wrong arguments [wrong-arg-types] + +xs = OrdinalLinkedList(value=1, next=LinkedList[int](value=2)) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ diff --git a/conformance/results/pytype/generics_self_basic.toml b/conformance/results/pytype/generics_self_basic.toml index 717547ba0..0eb9ab43e 100644 --- a/conformance/results/pytype/generics_self_basic.toml +++ b/conformance/results/pytype/generics_self_basic.toml @@ -3,32 +3,68 @@ notes = """ Does not understand `Self` type. """ output = """ -File "generics_self_basic.py", line 14, in set_scale: Shape [assert-type] -File "generics_self_basic.py", line 14, in set_scale: Circle [assert-type] +generics_self_basic.py:14:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in set_scale: Shape [assert-type] + + assert_type(self, Self) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_self_basic.py:14:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in set_scale: Circle [assert-type] + + assert_type(self, Self) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + Called from (traceback): line 52, in current file -File "generics_self_basic.py", line 27, in from_config: Type[Shape] [assert-type] +generics_self_basic.py:27:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in from_config: Type[Shape] [assert-type] + + assert_type(cls, type[Self]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + Called from (traceback): line 54, in current file -File "generics_self_basic.py", line 27, in from_config: Type[Circle] [assert-type] +generics_self_basic.py:27:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in from_config: Type[Circle] [assert-type] + + assert_type(cls, type[Self]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + Called from (traceback): line 55, in current file -File "generics_self_basic.py", line 40, in difference: Shape [assert-type] -File "generics_self_basic.py", line 64, in set_value: bad return type [bad-return-type] +generics_self_basic.py:40:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in difference: Shape [assert-type] + + assert_type(other, Self) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_self_basic.py:64:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in set_value: bad return type [bad-return-type] + + def set_value(self, value: T) -> Self: ... +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + Called from (traceback): line 75, in object_with_concrete_type -File "generics_self_basic.py", line 64, in set_value: bad return type [bad-return-type] +generics_self_basic.py:64:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in set_value: bad return type [bad-return-type] + + def set_value(self, value: T) -> Self: ... +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + Called from (traceback): line 74, in object_with_concrete_type -File "generics_self_basic.py", line 64, in set_value: bad return type [bad-return-type] -File "generics_self_basic.py", line 67, in Container: unsupported operand type(s) for item retrieval: 'Self: TypeVar' and 'int: Type[int]' [unsupported-operands] +generics_self_basic.py:64:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in set_value: bad return type [bad-return-type] + + def set_value(self, value: T) -> Self: ... +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + +generics_self_basic.py:67:26: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Container: unsupported operand type(s) for item retrieval: 'Self: TypeVar' and 'int: Type[int]' [unsupported-operands] + + def foo(self, other: Self[int]) -> None: # E + \u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ Line 20: Expected 1 errors Line 33: Expected 1 errors -Line 14: Unexpected errors ['File "generics_self_basic.py", line 14, in set_scale: Shape [assert-type]', 'File "generics_self_basic.py", line 14, in set_scale: Circle [assert-type]'] -Line 27: Unexpected errors ['File "generics_self_basic.py", line 27, in from_config: Type[Shape] [assert-type]', 'File "generics_self_basic.py", line 27, in from_config: Type[Circle] [assert-type]'] -Line 40: Unexpected errors ['File "generics_self_basic.py", line 40, in difference: Shape [assert-type]'] -Line 64: Unexpected errors ['File "generics_self_basic.py", line 64, in set_value: bad return type [bad-return-type]', 'File "generics_self_basic.py", line 64, in set_value: bad return type [bad-return-type]', 'File "generics_self_basic.py", line 64, in set_value: bad return type [bad-return-type]'] +Line 14: Unexpected errors ['generics_self_basic.py:14:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in set_scale: Shape [assert-type]', 'generics_self_basic.py:14:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in set_scale: Circle [assert-type]'] +Line 27: Unexpected errors ['generics_self_basic.py:27:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in from_config: Type[Shape] [assert-type]', 'generics_self_basic.py:27:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in from_config: Type[Circle] [assert-type]'] +Line 40: Unexpected errors ['generics_self_basic.py:40:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in difference: Shape [assert-type]'] +Line 64: Unexpected errors ['generics_self_basic.py:64:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in set_value: bad return type [bad-return-type]', 'generics_self_basic.py:64:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in set_value: bad return type [bad-return-type]', 'generics_self_basic.py:64:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in set_value: bad return type [bad-return-type]'] """ diff --git a/conformance/results/pytype/generics_self_usage.toml b/conformance/results/pytype/generics_self_usage.toml index d0a2b4aa4..84de50aed 100644 --- a/conformance/results/pytype/generics_self_usage.toml +++ b/conformance/results/pytype/generics_self_usage.toml @@ -3,18 +3,68 @@ notes = """ Does not understand `Self` type. """ output = """ -File "generics_self_usage.py", line 58, in foo: Invalid type annotation 'Self' [invalid-annotation] -File "generics_self_usage.py", line 73, in : Invalid type annotation 'Self' [invalid-annotation] -File "generics_self_usage.py", line 76, in : Invalid type annotation 'Self' for bar [invalid-annotation] -File "generics_self_usage.py", line 82, in has_existing_self_annotation: bad return type [bad-return-type] -File "generics_self_usage.py", line 86, in return_concrete_type: bad return type [bad-return-type] +generics_self_usage.py:58:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in foo: Invalid type annotation 'Self' [invalid-annotation] + + def nested(z: int, inner_self: Self) -> Self: + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + print(z) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + print(inner_self.x) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + return inner_self +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_self_usage.py:73:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Self' [invalid-annotation] + +def foo(bar: Self) -> Self: ... # E: not within a class +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_self_usage.py:76:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Self' for bar [invalid-annotation] + +bar: Self # E: not within a class +\u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m + +generics_self_usage.py:82:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in has_existing_self_annotation: bad return type [bad-return-type] + + def has_existing_self_annotation(self: TFoo2) -> Self: ... # E +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + +generics_self_usage.py:86:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in return_concrete_type: bad return type [bad-return-type] + + return Foo3() # E (see FooChild below for rationale) + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + Called from (traceback): line 92, in child_method -File "generics_self_usage.py", line 103, in : Invalid base class: Self [base-class-error] -File "generics_self_usage.py", line 111, in Base: Invalid type annotation 'Self' [invalid-annotation] -File "generics_self_usage.py", line 116, in Base: Invalid type annotation 'Self' [invalid-annotation] -File "generics_self_usage.py", line 122, in __new__: bad return type [bad-return-type] -File "generics_self_usage.py", line 126, in __mul__: bad return type [bad-return-type] +generics_self_usage.py:103:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid base class: Self [base-class-error] + +class Baz2(Self): ... # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_self_usage.py:111:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Base: Invalid type annotation 'Self' [invalid-annotation] + + def make() -> Self: # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_self_usage.py:116:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Base: Invalid type annotation 'Self' [invalid-annotation] + + def return_parameter(foo: Self) -> Self: # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_self_usage.py:122:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __new__: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +generics_self_usage.py:126:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __mul__: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -22,7 +72,7 @@ Line 101: Expected 1 errors Line 106: Expected 1 errors Line 121: Expected 1 errors Line 125: Expected 1 errors -Line 58: Unexpected errors ['File "generics_self_usage.py", line 58, in foo: Invalid type annotation \\'Self\\' [invalid-annotation]'] -Line 122: Unexpected errors ['File "generics_self_usage.py", line 122, in __new__: bad return type [bad-return-type]'] -Line 126: Unexpected errors ['File "generics_self_usage.py", line 126, in __mul__: bad return type [bad-return-type]'] +Line 58: Unexpected errors ["generics_self_usage.py:58:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in foo: Invalid type annotation 'Self' [invalid-annotation]"] +Line 122: Unexpected errors ['generics_self_usage.py:122:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __new__: bad return type [bad-return-type]'] +Line 126: Unexpected errors ['generics_self_usage.py:126:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __mul__: bad return type [bad-return-type]'] """ diff --git a/conformance/results/pytype/generics_syntax_infer_variance.toml b/conformance/results/pytype/generics_syntax_infer_variance.toml index ba30a2890..05c5d9bee 100644 --- a/conformance/results/pytype/generics_syntax_infer_variance.toml +++ b/conformance/results/pytype/generics_syntax_infer_variance.toml @@ -3,7 +3,7 @@ notes = """ Type parameter syntax not yet support. """ output = """ -SyntaxError: Type parameter lists are only supported in Python 3.12 and greater (, line 125) +SyntaxError: Type parameter lists are only supported in Python 3.12 and greater (, line 132) """ conformance_automated = "Fail" errors_diff = """ @@ -12,18 +12,17 @@ Line 17: Expected 1 errors Line 29: Expected 1 errors Line 37: Expected 1 errors Line 46: Expected 1 errors -Line 55: Expected 1 errors -Line 68: Expected 1 errors -Line 79: Expected 1 errors -Line 95: Expected 1 errors -Line 96: Expected 1 errors -Line 110: Expected 1 errors -Line 111: Expected 1 errors +Line 75: Expected 1 errors +Line 86: Expected 1 errors +Line 102: Expected 1 errors +Line 103: Expected 1 errors +Line 117: Expected 1 errors Line 118: Expected 1 errors -Line 119: Expected 1 errors -Line 120: Expected 1 errors -Line 121: Expected 1 errors -Line 129: Expected 1 errors -Line 137: Expected 1 errors -Line 148: Expected 1 errors +Line 125: Expected 1 errors +Line 126: Expected 1 errors +Line 127: Expected 1 errors +Line 128: Expected 1 errors +Line 136: Expected 1 errors +Line 144: Expected 1 errors +Line 155: Expected 1 errors """ diff --git a/conformance/results/pytype/generics_typevartuple_args.toml b/conformance/results/pytype/generics_typevartuple_args.toml index f74bb0691..91227fe9d 100644 --- a/conformance/results/pytype/generics_typevartuple_args.toml +++ b/conformance/results/pytype/generics_typevartuple_args.toml @@ -3,28 +3,110 @@ notes = """ Does not support TypeVarTuple. """ output = """ -File "generics_typevartuple_args.py", line 10, in : typing.TypeVarTuple not supported yet [not-supported-yet] -File "generics_typevartuple_args.py", line 13, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] -File "generics_typevartuple_args.py", line 16, in : No attribute '__iter__' on TypeVarTuple [attribute-error] -File "generics_typevartuple_args.py", line 16, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_args.py", line 17, in args_to_tuple: bad return type [bad-return-type] +generics_typevartuple_args.py:10:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet] + +from typing import TypeVarTuple, assert_type +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_args.py:13:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] + +Ts = TypeVarTuple("Ts") + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_args.py:16:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : No attribute '__iter__' on TypeVarTuple [attribute-error] + +def args_to_tuple(*args: *Ts) -> tuple[*Ts]: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_args.py:16:34: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +def args_to_tuple(*args: *Ts) -> tuple[*Ts]: + \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_args.py:17:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in args_to_tuple: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + Called from (traceback): line 20, in current file -File "generics_typevartuple_args.py", line 20, in : Tuple[Any] [assert-type] -File "generics_typevartuple_args.py", line 27, in : Missing parameter 'self' in call to function tuple.__iter__ [missing-parameter] -File "generics_typevartuple_args.py", line 27, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_args.py", line 27, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_args.py", line 28, in exec_le: bad return type [bad-return-type] +generics_typevartuple_args.py:20:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Tuple[Any] [assert-type] + +assert_type(args_to_tuple(1, "a"), tuple[int, str]) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_args.py:27:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'self' in call to function tuple.__iter__ [missing-parameter] + +def exec_le(path: str, *args: * tuple[*Ts, Env], env: Env | None = None) -> tuple[*Ts]: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_args.py:27:77: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +def exec_le(path: str, *args: * tuple[*Ts, Env], env: Env | None = None) -> tuple[*Ts]: + \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_args.py:27:33: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +def exec_le(path: str, *args: * tuple[*Ts, Env], env: Env | None = None) -> tuple[*Ts]: + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_args.py:28:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in exec_le: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + Called from (traceback): line 31, in current file -File "generics_typevartuple_args.py", line 31, in : Tuple[Any] [assert-type] -File "generics_typevartuple_args.py", line 32, in : Tuple[Any] [assert-type] -File "generics_typevartuple_args.py", line 42, in : Missing parameter 'self' in call to function tuple.__iter__ [missing-parameter] -File "generics_typevartuple_args.py", line 51, in : Missing parameter 'self' in call to function tuple.__iter__ [missing-parameter] -File "generics_typevartuple_args.py", line 51, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_args.py", line 62, in : Missing parameter 'self' in call to function tuple.__iter__ [missing-parameter] -File "generics_typevartuple_args.py", line 70, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_args.py", line 75, in : Function func4 was called with the wrong arguments [wrong-arg-types] +generics_typevartuple_args.py:31:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Tuple[Any] [assert-type] + +assert_type(exec_le("", Env()), tuple[()]) # OK +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_args.py:32:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Tuple[Any] [assert-type] + +assert_type(exec_le("", 0, "", Env()), tuple[int, str]) # OK +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_args.py:42:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'self' in call to function tuple.__iter__ [missing-parameter] + +def func1(*args: * tuple[int, ...]) -> None: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_args.py:51:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'self' in call to function tuple.__iter__ [missing-parameter] + +def func2(*args: * tuple[int, *tuple[str, ...], str]) -> None: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_args.py:51:20: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +def func2(*args: * tuple[int, *tuple[str, ...], str]) -> None: + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_args.py:62:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'self' in call to function tuple.__iter__ [missing-parameter] + +def func3(*args: * tuple[int, str]) -> None: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_args.py:70:18: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +def func4(*args: tuple[*Ts]): + \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_args.py:75:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function func4 was called with the wrong arguments [wrong-arg-types] + +func4((0,), (1, 2)) # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -36,17 +118,17 @@ Line 58: Expected 1 errors Line 59: Expected 1 errors Line 67: Expected 1 errors Line 76: Expected 1 errors -Line 10: Unexpected errors ['File "generics_typevartuple_args.py", line 10, in : typing.TypeVarTuple not supported yet [not-supported-yet]'] -Line 13: Unexpected errors ['File "generics_typevartuple_args.py", line 13, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] -Line 16: Unexpected errors ['File "generics_typevartuple_args.py", line 16, in : No attribute \\'__iter__\\' on TypeVarTuple [attribute-error]', 'File "generics_typevartuple_args.py", line 16, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 17: Unexpected errors ['File "generics_typevartuple_args.py", line 17, in args_to_tuple: bad return type [bad-return-type]'] -Line 20: Unexpected errors ['File "generics_typevartuple_args.py", line 20, in : Tuple[Any] [assert-type]'] -Line 27: Unexpected errors ['File "generics_typevartuple_args.py", line 27, in : Missing parameter \\'self\\' in call to function tuple.__iter__ [missing-parameter]', 'File "generics_typevartuple_args.py", line 27, in : Invalid type annotation \\'\\' [invalid-annotation]', 'File "generics_typevartuple_args.py", line 27, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 28: Unexpected errors ['File "generics_typevartuple_args.py", line 28, in exec_le: bad return type [bad-return-type]'] -Line 31: Unexpected errors ['File "generics_typevartuple_args.py", line 31, in : Tuple[Any] [assert-type]'] -Line 32: Unexpected errors ['File "generics_typevartuple_args.py", line 32, in : Tuple[Any] [assert-type]'] -Line 42: Unexpected errors ['File "generics_typevartuple_args.py", line 42, in : Missing parameter \\'self\\' in call to function tuple.__iter__ [missing-parameter]'] -Line 51: Unexpected errors ['File "generics_typevartuple_args.py", line 51, in : Missing parameter \\'self\\' in call to function tuple.__iter__ [missing-parameter]', 'File "generics_typevartuple_args.py", line 51, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 62: Unexpected errors ['File "generics_typevartuple_args.py", line 62, in : Missing parameter \\'self\\' in call to function tuple.__iter__ [missing-parameter]'] -Line 70: Unexpected errors ['File "generics_typevartuple_args.py", line 70, in : Invalid type annotation \\'\\' [invalid-annotation]'] +Line 10: Unexpected errors ['generics_typevartuple_args.py:10:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet]'] +Line 13: Unexpected errors ['generics_typevartuple_args.py:13:6: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] +Line 16: Unexpected errors ["generics_typevartuple_args.py:16:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : No attribute '__iter__' on TypeVarTuple [attribute-error]", "generics_typevartuple_args.py:16:34: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 17: Unexpected errors ['generics_typevartuple_args.py:17:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in args_to_tuple: bad return type [bad-return-type]'] +Line 20: Unexpected errors ['generics_typevartuple_args.py:20:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Tuple[Any] [assert-type]'] +Line 27: Unexpected errors ["generics_typevartuple_args.py:27:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Missing parameter 'self' in call to function tuple.__iter__ [missing-parameter]", "generics_typevartuple_args.py:27:77: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", "generics_typevartuple_args.py:27:33: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 28: Unexpected errors ['generics_typevartuple_args.py:28:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in exec_le: bad return type [bad-return-type]'] +Line 31: Unexpected errors ['generics_typevartuple_args.py:31:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Tuple[Any] [assert-type]'] +Line 32: Unexpected errors ['generics_typevartuple_args.py:32:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Tuple[Any] [assert-type]'] +Line 42: Unexpected errors ["generics_typevartuple_args.py:42:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Missing parameter 'self' in call to function tuple.__iter__ [missing-parameter]"] +Line 51: Unexpected errors ["generics_typevartuple_args.py:51:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Missing parameter 'self' in call to function tuple.__iter__ [missing-parameter]", "generics_typevartuple_args.py:51:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 62: Unexpected errors ["generics_typevartuple_args.py:62:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Missing parameter 'self' in call to function tuple.__iter__ [missing-parameter]"] +Line 70: Unexpected errors ["generics_typevartuple_args.py:70:18: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] """ diff --git a/conformance/results/pytype/generics_typevartuple_basic.toml b/conformance/results/pytype/generics_typevartuple_basic.toml index 3116b579d..8bd98126e 100644 --- a/conformance/results/pytype/generics_typevartuple_basic.toml +++ b/conformance/results/pytype/generics_typevartuple_basic.toml @@ -3,78 +3,304 @@ notes = """ Does not support TypeVarTuple. """ output = """ -File "generics_typevartuple_basic.py", line 7, in : typing.TypeVarTuple not supported yet [not-supported-yet] -File "generics_typevartuple_basic.py", line 9, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] -File "generics_typevartuple_basic.py", line 12, in : Invalid type annotation 'Generic' [invalid-annotation] -File "generics_typevartuple_basic.py", line 16, in : No attribute '__iter__' on TypeVarTuple [attribute-error] -File "generics_typevartuple_basic.py", line 16, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_basic.py", line 17, in func1: bad return type [bad-return-type] -File "generics_typevartuple_basic.py", line 20, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] -File "generics_typevartuple_basic.py", line 23, in : Invalid type annotation 'Generic' [invalid-annotation] -File "generics_typevartuple_basic.py", line 24, in Array: Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_basic.py", line 25, in __init__: Invalid type annotation 'tuple[*Shape,]' [invalid-annotation] -File "generics_typevartuple_basic.py", line 27, in Array: Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_basic.py", line 36, in : class Array is not indexable [not-indexable] -File "generics_typevartuple_basic.py", line 36, in : Invalid type annotation 'Array[Height, Width]' [invalid-annotation] -File "generics_typevartuple_basic.py", line 36, in : Function Array.__init__ was called with the wrong arguments [wrong-arg-types] -File "generics_typevartuple_basic.py", line 37, in : class Array is not indexable [not-indexable] -File "generics_typevartuple_basic.py", line 37, in : Invalid type annotation 'Array[Batch, Height, Width]' [invalid-annotation] -File "generics_typevartuple_basic.py", line 37, in : Function Array.__init__ was called with the wrong arguments [wrong-arg-types] -File "generics_typevartuple_basic.py", line 38, in : class Array is not indexable [not-indexable] -File "generics_typevartuple_basic.py", line 38, in : Invalid type annotation 'Array[Time, Batch, Height, Width]' [invalid-annotation] -File "generics_typevartuple_basic.py", line 38, in : Function Array.__init__ was called with the wrong arguments [wrong-arg-types] -File "generics_typevartuple_basic.py", line 42, in : class Array is not indexable [not-indexable] -File "generics_typevartuple_basic.py", line 42, in : Invalid type annotation 'Array[Height, Width]' [invalid-annotation] -File "generics_typevartuple_basic.py", line 42, in : Function Array.__init__ was called with the wrong arguments [wrong-arg-types] -File "generics_typevartuple_basic.py", line 43, in : class Array is not indexable [not-indexable] -File "generics_typevartuple_basic.py", line 43, in : Invalid type annotation 'Array[Batch, Height, Width]' [invalid-annotation] -File "generics_typevartuple_basic.py", line 43, in : Function Array.__init__ was called with the wrong arguments [wrong-arg-types] -File "generics_typevartuple_basic.py", line 44, in : class Array is not indexable [not-indexable] -File "generics_typevartuple_basic.py", line 44, in : Invalid type annotation 'Array[Time, Batch, Height, Width]' [invalid-annotation] -File "generics_typevartuple_basic.py", line 44, in : Function Array.__init__ was called with the wrong arguments [wrong-arg-types] -File "generics_typevartuple_basic.py", line 52, in : Invalid type annotation 'Generic' [invalid-annotation] -File "generics_typevartuple_basic.py", line 53, in ClassA: Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_basic.py", line 54, in __init__: Invalid type annotation 'tuple[*Shape,]' [invalid-annotation] -File "generics_typevartuple_basic.py", line 56, in ClassA: Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_basic.py", line 59, in ClassA: Invalid type annotation '' for args [invalid-annotation] -File "generics_typevartuple_basic.py", line 65, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 3 [wrong-arg-count] -File "generics_typevartuple_basic.py", line 66, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 4 [wrong-arg-count] -File "generics_typevartuple_basic.py", line 67, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 3 [wrong-arg-count] -File "generics_typevartuple_basic.py", line 75, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_basic.py", line 76, in func2: bad return type [bad-return-type] +generics_typevartuple_basic.py:7:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet] + +from typing import Generic, NewType, TypeVarTuple, assert_type +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:9:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] + +Ts = TypeVarTuple("Ts") + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:12:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class Array1(Generic[*Ts]): + \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:16:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : No attribute '__iter__' on TypeVarTuple [attribute-error] + +def func1(*args: *Ts) -> tuple[*Ts]: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:16:26: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +def func1(*args: *Ts) -> tuple[*Ts]: + \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:17:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:20:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] + +Shape = TypeVarTuple("Shape") + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:23:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class Array(Generic[*Shape]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:24:31: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Array: Invalid type annotation '' [invalid-annotation] + + def __init__(self, shape: tuple[*Shape]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:25:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __init__: Invalid type annotation 'tuple[*Shape,]' [invalid-annotation] + + self._shape: tuple[*Shape] = shape + \u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:27:28: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Array: Invalid type annotation '' [invalid-annotation] + + def get_shape(self) -> tuple[*Shape]: + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:36:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +v1: Array[Height, Width] = Array((Height(1), Width(2))) # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:36:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Array[Height, Width]' [invalid-annotation] + +v1: Array[Height, Width] = Array((Height(1), Width(2))) # OK +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:36:28: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Array.__init__ was called with the wrong arguments [wrong-arg-types] + +v1: Array[Height, Width] = Array((Height(1), Width(2))) # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:37:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +v2: Array[Batch, Height, Width] = Array((Batch(1), Height(1), Width(1))) # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:37:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Array[Batch, Height, Width]' [invalid-annotation] + +v2: Array[Batch, Height, Width] = Array((Batch(1), Height(1), Width(1))) # OK +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:37:35: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Array.__init__ was called with the wrong arguments [wrong-arg-types] + +v2: Array[Batch, Height, Width] = Array((Batch(1), Height(1), Width(1))) # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:38:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +v3: Array[Time, Batch, Height, Width] = Array( + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:38:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Array[Time, Batch, Height, Width]' [invalid-annotation] + +v3: Array[Time, Batch, Height, Width] = Array( +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:38:41: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Array.__init__ was called with the wrong arguments [wrong-arg-types] + +v3: Array[Time, Batch, Height, Width] = Array( + \u001b[1m\u001b[31m~~~~~~\u001b[39m\u001b[0m + (Time(1), Batch(1), Height(1), Width(1)) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +) # OK +\u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:42:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +v4: Array[Height, Width] = Array(Height(1)) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:42:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Array[Height, Width]' [invalid-annotation] + +v4: Array[Height, Width] = Array(Height(1)) # E +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:42:28: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Array.__init__ was called with the wrong arguments [wrong-arg-types] + +v4: Array[Height, Width] = Array(Height(1)) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:43:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +v5: Array[Batch, Height, Width] = Array((Batch(1), Width(1))) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:43:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Array[Batch, Height, Width]' [invalid-annotation] + +v5: Array[Batch, Height, Width] = Array((Batch(1), Width(1))) # E +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:43:35: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Array.__init__ was called with the wrong arguments [wrong-arg-types] + +v5: Array[Batch, Height, Width] = Array((Batch(1), Width(1))) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:44:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +v6: Array[Time, Batch, Height, Width] = Array( # E[v6] + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:44:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Array[Time, Batch, Height, Width]' [invalid-annotation] + +v6: Array[Time, Batch, Height, Width] = Array( # E[v6] +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:44:41: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Array.__init__ was called with the wrong arguments [wrong-arg-types] + +v6: Array[Time, Batch, Height, Width] = Array( # E[v6] + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + (Time(1), Batch(1), Width(1), Height(1)) # E[v6] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +) +\u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:52:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class ClassA(Generic[Shape]): # E: not unpacked + \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:53:31: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassA: Invalid type annotation '' [invalid-annotation] + + def __init__(self, shape: tuple[Shape]): # E: not unpacked + \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:54:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __init__: Invalid type annotation 'tuple[*Shape,]' [invalid-annotation] + + self._shape: tuple[*Shape] = shape + \u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:56:28: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassA: Invalid type annotation '' [invalid-annotation] + + def get_shape(self) -> tuple[Shape]: # E: not unpacked + \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:59:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassA: Invalid type annotation '' for args [invalid-annotation] + + def method1(*args: Shape) -> None: # E: not unpacked + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:65:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 3 [wrong-arg-count] + +Ts1 = TypeVarTuple("Ts1", covariant=True) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:66:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 4 [wrong-arg-count] + +Ts2 = TypeVarTuple("Ts2", int, float) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:67:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 3 [wrong-arg-count] + +Ts3 = TypeVarTuple("Ts3", bound=int) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:75:17: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +def func2(arg1: tuple[*Ts], arg2: tuple[*Ts]) -> tuple[*Ts]: + \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:75:35: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +def func2(arg1: tuple[*Ts], arg2: tuple[*Ts]) -> tuple[*Ts]: + \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:75:50: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +def func2(arg1: tuple[*Ts], arg2: tuple[*Ts]) -> tuple[*Ts]: + \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:76:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func2: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + Called from (traceback): line 84, in current file -File "generics_typevartuple_basic.py", line 84, in : Tuple[Any] [assert-type] -File "generics_typevartuple_basic.py", line 90, in : Function func2 was called with the wrong arguments [wrong-arg-types] -File "generics_typevartuple_basic.py", line 93, in : class Array is not indexable [not-indexable] -File "generics_typevartuple_basic.py", line 94, in multiply: bad return type [bad-return-type] -File "generics_typevartuple_basic.py", line 97, in : class Array is not indexable [not-indexable] -File "generics_typevartuple_basic.py", line 106, in : Invalid type annotation 'Generic' [invalid-annotation] -File "generics_typevartuple_basic.py", line 106, in : Function list.extend was called with the wrong arguments [wrong-arg-types] +generics_typevartuple_basic.py:84:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Tuple[Any] [assert-type] + +assert_type(func2((0,), (1,)), tuple[int]) # OK +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:90:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function func2 was called with the wrong arguments [wrong-arg-types] + +func2((0, 0), (0,)) # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:93:17: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +def multiply(x: Array[*Shape], y: Array[*Shape]) -> Array[*Shape]: + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:93:35: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +def multiply(x: Array[*Shape], y: Array[*Shape]) -> Array[*Shape]: + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:93:53: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +def multiply(x: Array[*Shape], y: Array[*Shape]) -> Array[*Shape]: + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:94:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in multiply: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:97:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +def func3(x: Array[Height], y: Array[Width], z: Array[Height, Width]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:97:32: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +def func3(x: Array[Height], y: Array[Width], z: Array[Height, Width]): + \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:97:49: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +def func3(x: Array[Height], y: Array[Width], z: Array[Height, Width]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:106:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class Array3(Generic[*Ts1, *Ts2]): # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:106:22: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function list.extend was called with the wrong arguments [wrong-arg-types] + +class Array3(Generic[*Ts1, *Ts2]): # E + \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ Line 89: Expected 1 errors Line 99: Expected 1 errors Line 100: Expected 1 errors -Line 7: Unexpected errors ['File "generics_typevartuple_basic.py", line 7, in : typing.TypeVarTuple not supported yet [not-supported-yet]'] -Line 9: Unexpected errors ['File "generics_typevartuple_basic.py", line 9, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] -Line 12: Unexpected errors ['File "generics_typevartuple_basic.py", line 12, in : Invalid type annotation \\'Generic\\' [invalid-annotation]'] -Line 16: Unexpected errors ['File "generics_typevartuple_basic.py", line 16, in : No attribute \\'__iter__\\' on TypeVarTuple [attribute-error]', 'File "generics_typevartuple_basic.py", line 16, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 17: Unexpected errors ['File "generics_typevartuple_basic.py", line 17, in func1: bad return type [bad-return-type]'] -Line 20: Unexpected errors ['File "generics_typevartuple_basic.py", line 20, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] -Line 23: Unexpected errors ['File "generics_typevartuple_basic.py", line 23, in : Invalid type annotation \\'Generic\\' [invalid-annotation]'] -Line 24: Unexpected errors ['File "generics_typevartuple_basic.py", line 24, in Array: Invalid type annotation \\'\\' [invalid-annotation]'] -Line 25: Unexpected errors ['File "generics_typevartuple_basic.py", line 25, in __init__: Invalid type annotation \\'tuple[*Shape,]\\' [invalid-annotation]'] -Line 27: Unexpected errors ['File "generics_typevartuple_basic.py", line 27, in Array: Invalid type annotation \\'\\' [invalid-annotation]'] -Line 36: Unexpected errors ['File "generics_typevartuple_basic.py", line 36, in : class Array is not indexable [not-indexable]', 'File "generics_typevartuple_basic.py", line 36, in : Invalid type annotation \\'Array[Height, Width]\\' [invalid-annotation]', 'File "generics_typevartuple_basic.py", line 36, in : Function Array.__init__ was called with the wrong arguments [wrong-arg-types]'] -Line 37: Unexpected errors ['File "generics_typevartuple_basic.py", line 37, in : class Array is not indexable [not-indexable]', 'File "generics_typevartuple_basic.py", line 37, in : Invalid type annotation \\'Array[Batch, Height, Width]\\' [invalid-annotation]', 'File "generics_typevartuple_basic.py", line 37, in : Function Array.__init__ was called with the wrong arguments [wrong-arg-types]'] -Line 38: Unexpected errors ['File "generics_typevartuple_basic.py", line 38, in : class Array is not indexable [not-indexable]', 'File "generics_typevartuple_basic.py", line 38, in : Invalid type annotation \\'Array[Time, Batch, Height, Width]\\' [invalid-annotation]', 'File "generics_typevartuple_basic.py", line 38, in : Function Array.__init__ was called with the wrong arguments [wrong-arg-types]'] -Line 54: Unexpected errors ['File "generics_typevartuple_basic.py", line 54, in __init__: Invalid type annotation \\'tuple[*Shape,]\\' [invalid-annotation]'] -Line 75: Unexpected errors ['File "generics_typevartuple_basic.py", line 75, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 76: Unexpected errors ['File "generics_typevartuple_basic.py", line 76, in func2: bad return type [bad-return-type]'] -Line 84: Unexpected errors ['File "generics_typevartuple_basic.py", line 84, in : Tuple[Any] [assert-type]'] -Line 93: Unexpected errors ['File "generics_typevartuple_basic.py", line 93, in : class Array is not indexable [not-indexable]'] -Line 94: Unexpected errors ['File "generics_typevartuple_basic.py", line 94, in multiply: bad return type [bad-return-type]'] -Line 97: Unexpected errors ['File "generics_typevartuple_basic.py", line 97, in : class Array is not indexable [not-indexable]'] +Line 7: Unexpected errors ['generics_typevartuple_basic.py:7:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet]'] +Line 9: Unexpected errors ['generics_typevartuple_basic.py:9:6: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] +Line 12: Unexpected errors ["generics_typevartuple_basic.py:12:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] +Line 16: Unexpected errors ["generics_typevartuple_basic.py:16:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : No attribute '__iter__' on TypeVarTuple [attribute-error]", "generics_typevartuple_basic.py:16:26: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 17: Unexpected errors ['generics_typevartuple_basic.py:17:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: bad return type [bad-return-type]'] +Line 20: Unexpected errors ['generics_typevartuple_basic.py:20:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] +Line 23: Unexpected errors ["generics_typevartuple_basic.py:23:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] +Line 24: Unexpected errors ["generics_typevartuple_basic.py:24:31: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in Array: Invalid type annotation '' [invalid-annotation]"] +Line 25: Unexpected errors ["generics_typevartuple_basic.py:25:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __init__: Invalid type annotation 'tuple[*Shape,]' [invalid-annotation]"] +Line 27: Unexpected errors ["generics_typevartuple_basic.py:27:28: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in Array: Invalid type annotation '' [invalid-annotation]"] +Line 36: Unexpected errors ['generics_typevartuple_basic.py:36:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]', "generics_typevartuple_basic.py:36:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Array[Height, Width]' [invalid-annotation]", 'generics_typevartuple_basic.py:36:28: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function Array.__init__ was called with the wrong arguments [wrong-arg-types]'] +Line 37: Unexpected errors ['generics_typevartuple_basic.py:37:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]', "generics_typevartuple_basic.py:37:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Array[Batch, Height, Width]' [invalid-annotation]", 'generics_typevartuple_basic.py:37:35: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function Array.__init__ was called with the wrong arguments [wrong-arg-types]'] +Line 38: Unexpected errors ['generics_typevartuple_basic.py:38:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]', "generics_typevartuple_basic.py:38:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Array[Time, Batch, Height, Width]' [invalid-annotation]", 'generics_typevartuple_basic.py:38:41: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function Array.__init__ was called with the wrong arguments [wrong-arg-types]'] +Line 54: Unexpected errors ["generics_typevartuple_basic.py:54:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __init__: Invalid type annotation 'tuple[*Shape,]' [invalid-annotation]"] +Line 75: Unexpected errors ["generics_typevartuple_basic.py:75:17: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", "generics_typevartuple_basic.py:75:35: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", "generics_typevartuple_basic.py:75:50: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 76: Unexpected errors ['generics_typevartuple_basic.py:76:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func2: bad return type [bad-return-type]'] +Line 84: Unexpected errors ['generics_typevartuple_basic.py:84:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Tuple[Any] [assert-type]'] +Line 93: Unexpected errors ['generics_typevartuple_basic.py:93:17: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]', 'generics_typevartuple_basic.py:93:35: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]', 'generics_typevartuple_basic.py:93:53: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]'] +Line 94: Unexpected errors ['generics_typevartuple_basic.py:94:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in multiply: bad return type [bad-return-type]'] +Line 97: Unexpected errors ['generics_typevartuple_basic.py:97:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]', 'generics_typevartuple_basic.py:97:32: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]', 'generics_typevartuple_basic.py:97:49: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]'] """ diff --git a/conformance/results/pytype/generics_typevartuple_callable.toml b/conformance/results/pytype/generics_typevartuple_callable.toml index 1d934a260..6abb21790 100644 --- a/conformance/results/pytype/generics_typevartuple_callable.toml +++ b/conformance/results/pytype/generics_typevartuple_callable.toml @@ -3,44 +3,126 @@ notes = """ Does not support TypeVarTuple. """ output = """ -File "generics_typevartuple_callable.py", line 10, in : typing.TypeVarTuple not supported yet [not-supported-yet] -File "generics_typevartuple_callable.py", line 12, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] -File "generics_typevartuple_callable.py", line 17, in Process: Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_callable.py", line 17, in Process: Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_callable.py", line 25, in : Function Process.__init__ was called with the wrong arguments [wrong-arg-types] -File "generics_typevartuple_callable.py", line 26, in : Function Process.__init__ was called with the wrong arguments [wrong-arg-types] -File "generics_typevartuple_callable.py", line 29, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_callable.py", line 29, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_callable.py", line 29, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_callable.py", line 30, in func2: bad return type [bad-return-type] +generics_typevartuple_callable.py:10:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet] + +from typing import Callable, TypeVar, TypeVarTuple, assert_type +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_callable.py:12:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] + +Ts = TypeVarTuple("Ts") + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_callable.py:17:61: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Process: Invalid type annotation '' [invalid-annotation] + + def __init__(self, target: Callable[[*Ts], None], args: tuple[*Ts]) -> None: + \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_callable.py:17:32: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Process: Invalid type annotation '' [invalid-annotation] + + def __init__(self, target: Callable[[*Ts], None], args: tuple[*Ts]) -> None: + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_callable.py:25:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Process.__init__ was called with the wrong arguments [wrong-arg-types] + +Process(target=func1, args=(0, "")) # OK +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_callable.py:26:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Process.__init__ was called with the wrong arguments [wrong-arg-types] + +Process(target=func1, args=("", 0)) # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_callable.py:29:57: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +def func2(f: Callable[[int, *Ts, T], tuple[T, *Ts]]) -> tuple[*Ts, T]: + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_callable.py:29:38: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +def func2(f: Callable[[int, *Ts, T], tuple[T, *Ts]]) -> tuple[*Ts, T]: + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_callable.py:29:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +def func2(f: Callable[[int, *Ts, T], tuple[T, *Ts]]) -> tuple[*Ts, T]: + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_callable.py:30:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func2: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + Called from (traceback): line 42, in current file -File "generics_typevartuple_callable.py", line 34, in callback1: bad return type [bad-return-type] -File "generics_typevartuple_callable.py", line 38, in callback2: bad return type [bad-return-type] -File "generics_typevartuple_callable.py", line 41, in : Function func2 was called with the wrong arguments [wrong-arg-types] -File "generics_typevartuple_callable.py", line 41, in : Any [assert-type] -File "generics_typevartuple_callable.py", line 42, in : Tuple[Any] [assert-type] -File "generics_typevartuple_callable.py", line 45, in : Missing parameter 'self' in call to function tuple.__iter__ [missing-parameter] -File "generics_typevartuple_callable.py", line 45, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_callable.py", line 45, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_callable.py", line 46, in func3: bad return type [bad-return-type] +generics_typevartuple_callable.py:34:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in callback1: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +generics_typevartuple_callable.py:38:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in callback2: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +generics_typevartuple_callable.py:41:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function func2 was called with the wrong arguments [wrong-arg-types] + +assert_type(func2(callback1), tuple[str, int, complex]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_callable.py:41:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Any [assert-type] + +assert_type(func2(callback1), tuple[str, int, complex]) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_callable.py:42:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Tuple[Any] [assert-type] + +assert_type(func2(callback2), tuple[str]) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_callable.py:45:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'self' in call to function tuple.__iter__ [missing-parameter] + +def func3(*args: * tuple[int, *Ts, T]) -> tuple[T, *Ts]: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_callable.py:45:20: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +def func3(*args: * tuple[int, *Ts, T]) -> tuple[T, *Ts]: + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_callable.py:45:43: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +def func3(*args: * tuple[int, *Ts, T]) -> tuple[T, *Ts]: + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_callable.py:46:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func3: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + Called from (traceback): line 49, in current file -File "generics_typevartuple_callable.py", line 49, in : Tuple[Any] [assert-type] +generics_typevartuple_callable.py:49:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Tuple[Any] [assert-type] + +assert_type(func3(1, "", 3j, 3.4), tuple[float, str, complex]) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ -Line 10: Unexpected errors ['File "generics_typevartuple_callable.py", line 10, in : typing.TypeVarTuple not supported yet [not-supported-yet]'] -Line 12: Unexpected errors ['File "generics_typevartuple_callable.py", line 12, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] -Line 17: Unexpected errors ['File "generics_typevartuple_callable.py", line 17, in Process: Invalid type annotation \\'\\' [invalid-annotation]', 'File "generics_typevartuple_callable.py", line 17, in Process: Invalid type annotation \\'\\' [invalid-annotation]'] -Line 25: Unexpected errors ['File "generics_typevartuple_callable.py", line 25, in : Function Process.__init__ was called with the wrong arguments [wrong-arg-types]'] -Line 29: Unexpected errors ['File "generics_typevartuple_callable.py", line 29, in : Invalid type annotation \\'\\' [invalid-annotation]', 'File "generics_typevartuple_callable.py", line 29, in : Invalid type annotation \\'\\' [invalid-annotation]', 'File "generics_typevartuple_callable.py", line 29, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 30: Unexpected errors ['File "generics_typevartuple_callable.py", line 30, in func2: bad return type [bad-return-type]'] -Line 34: Unexpected errors ['File "generics_typevartuple_callable.py", line 34, in callback1: bad return type [bad-return-type]'] -Line 38: Unexpected errors ['File "generics_typevartuple_callable.py", line 38, in callback2: bad return type [bad-return-type]'] -Line 41: Unexpected errors ['File "generics_typevartuple_callable.py", line 41, in : Function func2 was called with the wrong arguments [wrong-arg-types]', 'File "generics_typevartuple_callable.py", line 41, in : Any [assert-type]'] -Line 42: Unexpected errors ['File "generics_typevartuple_callable.py", line 42, in : Tuple[Any] [assert-type]'] -Line 45: Unexpected errors ['File "generics_typevartuple_callable.py", line 45, in : Missing parameter \\'self\\' in call to function tuple.__iter__ [missing-parameter]', 'File "generics_typevartuple_callable.py", line 45, in : Invalid type annotation \\'\\' [invalid-annotation]', 'File "generics_typevartuple_callable.py", line 45, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 46: Unexpected errors ['File "generics_typevartuple_callable.py", line 46, in func3: bad return type [bad-return-type]'] -Line 49: Unexpected errors ['File "generics_typevartuple_callable.py", line 49, in : Tuple[Any] [assert-type]'] +Line 10: Unexpected errors ['generics_typevartuple_callable.py:10:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet]'] +Line 12: Unexpected errors ['generics_typevartuple_callable.py:12:6: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] +Line 17: Unexpected errors ["generics_typevartuple_callable.py:17:61: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in Process: Invalid type annotation '' [invalid-annotation]", "generics_typevartuple_callable.py:17:32: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in Process: Invalid type annotation '' [invalid-annotation]"] +Line 25: Unexpected errors ['generics_typevartuple_callable.py:25:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function Process.__init__ was called with the wrong arguments [wrong-arg-types]'] +Line 29: Unexpected errors ["generics_typevartuple_callable.py:29:57: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", "generics_typevartuple_callable.py:29:38: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", "generics_typevartuple_callable.py:29:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 30: Unexpected errors ['generics_typevartuple_callable.py:30:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func2: bad return type [bad-return-type]'] +Line 34: Unexpected errors ['generics_typevartuple_callable.py:34:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in callback1: bad return type [bad-return-type]'] +Line 38: Unexpected errors ['generics_typevartuple_callable.py:38:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in callback2: bad return type [bad-return-type]'] +Line 41: Unexpected errors ['generics_typevartuple_callable.py:41:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function func2 was called with the wrong arguments [wrong-arg-types]', 'generics_typevartuple_callable.py:41:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Any [assert-type]'] +Line 42: Unexpected errors ['generics_typevartuple_callable.py:42:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Tuple[Any] [assert-type]'] +Line 45: Unexpected errors ["generics_typevartuple_callable.py:45:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Missing parameter 'self' in call to function tuple.__iter__ [missing-parameter]", "generics_typevartuple_callable.py:45:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", "generics_typevartuple_callable.py:45:43: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 46: Unexpected errors ['generics_typevartuple_callable.py:46:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func3: bad return type [bad-return-type]'] +Line 49: Unexpected errors ['generics_typevartuple_callable.py:49:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Tuple[Any] [assert-type]'] """ diff --git a/conformance/results/pytype/generics_typevartuple_concat.toml b/conformance/results/pytype/generics_typevartuple_concat.toml index 2ec72d803..38a84f716 100644 --- a/conformance/results/pytype/generics_typevartuple_concat.toml +++ b/conformance/results/pytype/generics_typevartuple_concat.toml @@ -3,48 +3,153 @@ notes = """ Does not support TypeVarTuple. """ output = """ -File "generics_typevartuple_concat.py", line 9, in : typing.TypeVarTuple not supported yet [not-supported-yet] -File "generics_typevartuple_concat.py", line 17, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] -File "generics_typevartuple_concat.py", line 18, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] -File "generics_typevartuple_concat.py", line 22, in : Invalid type annotation 'Generic' [invalid-annotation] -File "generics_typevartuple_concat.py", line 26, in : class Array is not indexable [not-indexable] -File "generics_typevartuple_concat.py", line 27, in add_batch_axis: bad return type [bad-return-type] -File "generics_typevartuple_concat.py", line 30, in : class Array is not indexable [not-indexable] -File "generics_typevartuple_concat.py", line 31, in del_batch_axis: bad return type [bad-return-type] -File "generics_typevartuple_concat.py", line 34, in : class Array is not indexable [not-indexable] -File "generics_typevartuple_concat.py", line 35, in add_batch_channels: bad return type [bad-return-type] -File "generics_typevartuple_concat.py", line 38, in : class Array is not indexable [not-indexable] -File "generics_typevartuple_concat.py", line 40, in func1: class Array is not indexable [not-indexable] -File "generics_typevartuple_concat.py", line 42, in func1: class Array is not indexable [not-indexable] -File "generics_typevartuple_concat.py", line 44, in func1: class Array is not indexable [not-indexable] -File "generics_typevartuple_concat.py", line 47, in : Invalid type annotation 'T' [invalid-annotation] -File "generics_typevartuple_concat.py", line 47, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_concat.py", line 47, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_concat.py", line 48, in prefix_tuple: bad return type [bad-return-type] -File "generics_typevartuple_concat.py", line 51, in : Function prefix_tuple was called with the wrong arguments [wrong-arg-types] -File "generics_typevartuple_concat.py", line 52, in : Any [assert-type] -File "generics_typevartuple_concat.py", line 55, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_concat.py", line 55, in : Invalid type annotation '' [invalid-annotation] +generics_typevartuple_concat.py:9:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet] + +from typing import Generic, NewType, TypeVar, TypeVarTuple, assert_type +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_concat.py:17:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] + +Shape = TypeVarTuple("Shape") + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_concat.py:18:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] + +Ts = TypeVarTuple("Ts") + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_concat.py:22:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class Array(Generic[*Ts]): + \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_concat.py:26:23: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +def add_batch_axis(x: Array[*Shape]) -> Array[Batch, *Shape]: + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_concat.py:26:41: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +def add_batch_axis(x: Array[*Shape]) -> Array[Batch, *Shape]: + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_concat.py:27:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in add_batch_axis: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +generics_typevartuple_concat.py:30:23: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +def del_batch_axis(x: Array[Batch, *Shape]) -> Array[*Shape]: + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_concat.py:30:48: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +def del_batch_axis(x: Array[Batch, *Shape]) -> Array[*Shape]: + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_concat.py:31:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in del_batch_axis: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +generics_typevartuple_concat.py:34:27: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +def add_batch_channels(x: Array[*Shape]) -> Array[Batch, *Shape, Channels]: + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_concat.py:34:45: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +def add_batch_channels(x: Array[*Shape]) -> Array[Batch, *Shape, Channels]: + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_concat.py:35:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in add_batch_channels: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +generics_typevartuple_concat.py:38:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +def func1(a: Array[Height, Width]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_concat.py:40:20: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: class Array is not indexable [not-indexable] + + assert_type(b, Array[Batch, Height, Width]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_concat.py:42:20: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: class Array is not indexable [not-indexable] + + assert_type(c, Array[Height, Width]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_concat.py:44:20: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: class Array is not indexable [not-indexable] + + assert_type(d, Array[Batch, Height, Width, Channels]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_concat.py:47:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'T' [invalid-annotation] + +def prefix_tuple(x: T, y: tuple[*Ts]) -> tuple[T, *Ts]: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_concat.py:47:27: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +def prefix_tuple(x: T, y: tuple[*Ts]) -> tuple[T, *Ts]: + \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_concat.py:47:42: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +def prefix_tuple(x: T, y: tuple[*Ts]) -> tuple[T, *Ts]: + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_concat.py:48:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in prefix_tuple: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +generics_typevartuple_concat.py:51:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function prefix_tuple was called with the wrong arguments [wrong-arg-types] + +z = prefix_tuple(x=0, y=(True, "a")) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_concat.py:52:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Any [assert-type] + +assert_type(z, tuple[int, bool, str]) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_concat.py:55:55: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +def move_first_element_to_last(tup: tuple[T, *Ts]) -> tuple[*Ts, T]: + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_concat.py:55:37: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +def move_first_element_to_last(tup: tuple[T, *Ts]) -> tuple[*Ts, T]: + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ -Line 9: Unexpected errors ['File "generics_typevartuple_concat.py", line 9, in : typing.TypeVarTuple not supported yet [not-supported-yet]'] -Line 17: Unexpected errors ['File "generics_typevartuple_concat.py", line 17, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] -Line 18: Unexpected errors ['File "generics_typevartuple_concat.py", line 18, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] -Line 22: Unexpected errors ['File "generics_typevartuple_concat.py", line 22, in : Invalid type annotation \\'Generic\\' [invalid-annotation]'] -Line 26: Unexpected errors ['File "generics_typevartuple_concat.py", line 26, in : class Array is not indexable [not-indexable]'] -Line 27: Unexpected errors ['File "generics_typevartuple_concat.py", line 27, in add_batch_axis: bad return type [bad-return-type]'] -Line 30: Unexpected errors ['File "generics_typevartuple_concat.py", line 30, in : class Array is not indexable [not-indexable]'] -Line 31: Unexpected errors ['File "generics_typevartuple_concat.py", line 31, in del_batch_axis: bad return type [bad-return-type]'] -Line 34: Unexpected errors ['File "generics_typevartuple_concat.py", line 34, in : class Array is not indexable [not-indexable]'] -Line 35: Unexpected errors ['File "generics_typevartuple_concat.py", line 35, in add_batch_channels: bad return type [bad-return-type]'] -Line 38: Unexpected errors ['File "generics_typevartuple_concat.py", line 38, in : class Array is not indexable [not-indexable]'] -Line 40: Unexpected errors ['File "generics_typevartuple_concat.py", line 40, in func1: class Array is not indexable [not-indexable]'] -Line 42: Unexpected errors ['File "generics_typevartuple_concat.py", line 42, in func1: class Array is not indexable [not-indexable]'] -Line 44: Unexpected errors ['File "generics_typevartuple_concat.py", line 44, in func1: class Array is not indexable [not-indexable]'] -Line 47: Unexpected errors ['File "generics_typevartuple_concat.py", line 47, in : Invalid type annotation \\'T\\' [invalid-annotation]', 'File "generics_typevartuple_concat.py", line 47, in : Invalid type annotation \\'\\' [invalid-annotation]', 'File "generics_typevartuple_concat.py", line 47, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 48: Unexpected errors ['File "generics_typevartuple_concat.py", line 48, in prefix_tuple: bad return type [bad-return-type]'] -Line 51: Unexpected errors ['File "generics_typevartuple_concat.py", line 51, in : Function prefix_tuple was called with the wrong arguments [wrong-arg-types]'] -Line 52: Unexpected errors ['File "generics_typevartuple_concat.py", line 52, in : Any [assert-type]'] -Line 55: Unexpected errors ['File "generics_typevartuple_concat.py", line 55, in : Invalid type annotation \\'\\' [invalid-annotation]', 'File "generics_typevartuple_concat.py", line 55, in : Invalid type annotation \\'\\' [invalid-annotation]'] +Line 9: Unexpected errors ['generics_typevartuple_concat.py:9:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet]'] +Line 17: Unexpected errors ['generics_typevartuple_concat.py:17:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] +Line 18: Unexpected errors ['generics_typevartuple_concat.py:18:6: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] +Line 22: Unexpected errors ["generics_typevartuple_concat.py:22:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] +Line 26: Unexpected errors ['generics_typevartuple_concat.py:26:23: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]', 'generics_typevartuple_concat.py:26:41: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]'] +Line 27: Unexpected errors ['generics_typevartuple_concat.py:27:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in add_batch_axis: bad return type [bad-return-type]'] +Line 30: Unexpected errors ['generics_typevartuple_concat.py:30:23: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]', 'generics_typevartuple_concat.py:30:48: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]'] +Line 31: Unexpected errors ['generics_typevartuple_concat.py:31:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in del_batch_axis: bad return type [bad-return-type]'] +Line 34: Unexpected errors ['generics_typevartuple_concat.py:34:27: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]', 'generics_typevartuple_concat.py:34:45: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]'] +Line 35: Unexpected errors ['generics_typevartuple_concat.py:35:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in add_batch_channels: bad return type [bad-return-type]'] +Line 38: Unexpected errors ['generics_typevartuple_concat.py:38:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]'] +Line 40: Unexpected errors ['generics_typevartuple_concat.py:40:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: class Array is not indexable [not-indexable]'] +Line 42: Unexpected errors ['generics_typevartuple_concat.py:42:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: class Array is not indexable [not-indexable]'] +Line 44: Unexpected errors ['generics_typevartuple_concat.py:44:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: class Array is not indexable [not-indexable]'] +Line 47: Unexpected errors ["generics_typevartuple_concat.py:47:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'T' [invalid-annotation]", "generics_typevartuple_concat.py:47:27: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", "generics_typevartuple_concat.py:47:42: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 48: Unexpected errors ['generics_typevartuple_concat.py:48:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in prefix_tuple: bad return type [bad-return-type]'] +Line 51: Unexpected errors ['generics_typevartuple_concat.py:51:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function prefix_tuple was called with the wrong arguments [wrong-arg-types]'] +Line 52: Unexpected errors ['generics_typevartuple_concat.py:52:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Any [assert-type]'] +Line 55: Unexpected errors ["generics_typevartuple_concat.py:55:55: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", "generics_typevartuple_concat.py:55:37: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] """ diff --git a/conformance/results/pytype/generics_typevartuple_overloads.toml b/conformance/results/pytype/generics_typevartuple_overloads.toml index 0dd84622f..6a56bcbe6 100644 --- a/conformance/results/pytype/generics_typevartuple_overloads.toml +++ b/conformance/results/pytype/generics_typevartuple_overloads.toml @@ -3,25 +3,70 @@ notes = """ Does not support TypeVarTuple. """ output = """ -File "generics_typevartuple_overloads.py", line 7, in : typing.TypeVarTuple not supported yet [not-supported-yet] -File "generics_typevartuple_overloads.py", line 10, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] -File "generics_typevartuple_overloads.py", line 16, in : Invalid type annotation 'Generic' [invalid-annotation] -File "generics_typevartuple_overloads.py", line 18, in Array: class Array is not indexable [not-indexable] -File "generics_typevartuple_overloads.py", line 22, in Array: class Array is not indexable [not-indexable] -File "generics_typevartuple_overloads.py", line 26, in transpose: bad return type [bad-return-type] -File "generics_typevartuple_overloads.py", line 29, in : class Array is not indexable [not-indexable] -File "generics_typevartuple_overloads.py", line 30, in func1: class Array is not indexable [not-indexable] -File "generics_typevartuple_overloads.py", line 31, in func1: class Array is not indexable [not-indexable] +generics_typevartuple_overloads.py:7:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet] + +from typing import Any, Generic, TypeVar, TypeVarTuple, assert_type, overload +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_overloads.py:10:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] + +Shape = TypeVarTuple("Shape") + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_overloads.py:16:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class Array(Generic[*Shape]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_overloads.py:18:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Array: class Array is not indexable [not-indexable] + + def transpose(self: "Array[Axis1, Axis2]") -> "Array[Axis2, Axis1]": + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_overloads.py:22:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Array: class Array is not indexable [not-indexable] + + def transpose(self: "Array[Axis1, Axis2, Axis3]") -> "Array[Axis3, Axis2, Axis1]": + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_overloads.py:26:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in transpose: bad return type [bad-return-type] + + pass + \u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m + +generics_typevartuple_overloads.py:29:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +def func1(a: Array[Axis1, Axis2], b: Array[Axis1, Axis2, Axis3]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_overloads.py:29:38: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +def func1(a: Array[Axis1, Axis2], b: Array[Axis1, Axis2, Axis3]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_overloads.py:30:32: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: class Array is not indexable [not-indexable] + + assert_type(a.transpose(), Array[Axis2, Axis1]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_overloads.py:31:32: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: class Array is not indexable [not-indexable] + + assert_type(b.transpose(), Array[Axis3, Axis2, Axis1]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ -Line 7: Unexpected errors ['File "generics_typevartuple_overloads.py", line 7, in : typing.TypeVarTuple not supported yet [not-supported-yet]'] -Line 10: Unexpected errors ['File "generics_typevartuple_overloads.py", line 10, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] -Line 16: Unexpected errors ['File "generics_typevartuple_overloads.py", line 16, in : Invalid type annotation \\'Generic\\' [invalid-annotation]'] -Line 18: Unexpected errors ['File "generics_typevartuple_overloads.py", line 18, in Array: class Array is not indexable [not-indexable]'] -Line 22: Unexpected errors ['File "generics_typevartuple_overloads.py", line 22, in Array: class Array is not indexable [not-indexable]'] -Line 26: Unexpected errors ['File "generics_typevartuple_overloads.py", line 26, in transpose: bad return type [bad-return-type]'] -Line 29: Unexpected errors ['File "generics_typevartuple_overloads.py", line 29, in : class Array is not indexable [not-indexable]'] -Line 30: Unexpected errors ['File "generics_typevartuple_overloads.py", line 30, in func1: class Array is not indexable [not-indexable]'] -Line 31: Unexpected errors ['File "generics_typevartuple_overloads.py", line 31, in func1: class Array is not indexable [not-indexable]'] +Line 7: Unexpected errors ['generics_typevartuple_overloads.py:7:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet]'] +Line 10: Unexpected errors ['generics_typevartuple_overloads.py:10:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] +Line 16: Unexpected errors ["generics_typevartuple_overloads.py:16:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] +Line 18: Unexpected errors ['generics_typevartuple_overloads.py:18:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in Array: class Array is not indexable [not-indexable]'] +Line 22: Unexpected errors ['generics_typevartuple_overloads.py:22:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in Array: class Array is not indexable [not-indexable]'] +Line 26: Unexpected errors ['generics_typevartuple_overloads.py:26:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in transpose: bad return type [bad-return-type]'] +Line 29: Unexpected errors ['generics_typevartuple_overloads.py:29:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]', 'generics_typevartuple_overloads.py:29:38: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]'] +Line 30: Unexpected errors ['generics_typevartuple_overloads.py:30:32: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: class Array is not indexable [not-indexable]'] +Line 31: Unexpected errors ['generics_typevartuple_overloads.py:31:32: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: class Array is not indexable [not-indexable]'] """ diff --git a/conformance/results/pytype/generics_typevartuple_specialization.toml b/conformance/results/pytype/generics_typevartuple_specialization.toml index a9d75caa2..992d68c45 100644 --- a/conformance/results/pytype/generics_typevartuple_specialization.toml +++ b/conformance/results/pytype/generics_typevartuple_specialization.toml @@ -3,137 +3,452 @@ notes = """ Does not support TypeVarTuple. """ output = """ -File "generics_typevartuple_specialization.py", line 7, in : typing.TypeVarTuple not supported yet [not-supported-yet] -File "generics_typevartuple_specialization.py", line 10, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] -File "generics_typevartuple_specialization.py", line 16, in : Invalid type annotation 'Generic' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 24, in : class Array is not indexable [not-indexable] -File "generics_typevartuple_specialization.py", line 28, in : class Array is not indexable [not-indexable] -File "generics_typevartuple_specialization.py", line 33, in : class Array is not indexable [not-indexable] -File "generics_typevartuple_specialization.py", line 41, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 42, in : class Array is not indexable [not-indexable] -File "generics_typevartuple_specialization.py", line 45, in : Invalid type annotation 'Tuple[str, Array][Height]' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 45, in : Invalid type annotation 'Tuple[Any][float, bool]' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 46, in func3: Tuple[Any] [assert-type] -File "generics_typevartuple_specialization.py", line 47, in func3: class Array is not indexable [not-indexable] -File "generics_typevartuple_specialization.py", line 51, in func4: Tuple[Any] [assert-type] -File "generics_typevartuple_specialization.py", line 55, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] -File "generics_typevartuple_specialization.py", line 59, in : Invalid type annotation 'Generic' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 63, in : class Array2 is not indexable [not-indexable] -File "generics_typevartuple_specialization.py", line 64, in : class Array2 is not indexable [not-indexable] -File "generics_typevartuple_specialization.py", line 67, in : class Array2 is not indexable [not-indexable] -File "generics_typevartuple_specialization.py", line 68, in func5_0: class Array2 is not indexable [not-indexable] -File "generics_typevartuple_specialization.py", line 69, in func5_0: class Array2 is not indexable [not-indexable] -File "generics_typevartuple_specialization.py", line 76, in : class Array2 is not indexable [not-indexable] -File "generics_typevartuple_specialization.py", line 80, in : class Array2 is not indexable [not-indexable] -File "generics_typevartuple_specialization.py", line 89, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 92, in : Invalid type annotation 'Tuple[Any][str, int]' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 92, in : Invalid type annotation 'Tuple[Any][float]' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 93, in func6: Tuple[Any] [assert-type] -File "generics_typevartuple_specialization.py", line 94, in func6: Tuple[Any] [assert-type] -File "generics_typevartuple_specialization.py", line 95, in func6: Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 98, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] -File "generics_typevartuple_specialization.py", line 99, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] -File "generics_typevartuple_specialization.py", line 101, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 102, in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 103, in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 109, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 110, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 117, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 118, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 119, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 120, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 121, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 121, in : Function list.extend was called with the wrong arguments [wrong-arg-types] -File "generics_typevartuple_specialization.py", line 122, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 122, in : Function list.extend was called with the wrong arguments [wrong-arg-types] -File "generics_typevartuple_specialization.py", line 125, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 127, in : Invalid type annotation 'Tuple[Any][int]' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 130, in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 130, in : Invalid type annotation 'T2' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 130, in : Invalid type annotation 'T1' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 130, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 131, in func7: bad return type [bad-return-type] -File "generics_typevartuple_specialization.py", line 134, in : Invalid type annotation 'Tuple[Any][str, bool]' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 134, in : Invalid type annotation 'Tuple[Any][str, bool, float]' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 134, in : Invalid type annotation 'Tuple[Any][str, bool, float, int]' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 135, in func8: Tuple[Tuple[Any], Any, Any] [assert-type] -File "generics_typevartuple_specialization.py", line 136, in func8: Tuple[Tuple[Any], Any, Any] [assert-type] -File "generics_typevartuple_specialization.py", line 137, in func8: Tuple[Tuple[Any], Any, Any] [assert-type] -File "generics_typevartuple_specialization.py", line 140, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 143, in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 143, in : Invalid type annotation 'T3' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 143, in : Invalid type annotation 'T2' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 143, in : Invalid type annotation 'T1' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 143, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 144, in func9: bad return type [bad-return-type] -File "generics_typevartuple_specialization.py", line 147, in : Invalid type annotation 'Tuple[Any][str, bool, float]' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 147, in : Invalid type annotation 'Tuple[Any][str, bool, float, int]' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 148, in func10: Tuple[Tuple[Any], Any, Any, Any] [assert-type] -File "generics_typevartuple_specialization.py", line 149, in func10: Tuple[Tuple[Any], Any, Any, Any] [assert-type] -File "generics_typevartuple_specialization.py", line 152, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 153, in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 156, in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 157, in func11: Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 158, in func11: Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 159, in func11: Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 162, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 163, in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation] +generics_typevartuple_specialization.py:7:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet] + +from typing import Any, Generic, NewType, TypeVar, TypeVarTuple, assert_type +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:10:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] + +Ts = TypeVarTuple("Ts") + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:16:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class Array(Generic[*Ts]): + \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:24:27: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +def takes_any_array2(arr: Array[*tuple[Any, ...]]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:28:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +def func1(x: Array[Height, Width]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:33:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +def func2(y: Array[Time, Height, Width]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:41:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +IntTuple = tuple[int, *Ts] + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:42:25: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +NamedArray = tuple[str, Array[*Ts]] + \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:45:40: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[str, Array][Height]' [invalid-annotation] + +def func3(a: IntTuple[float, bool], b: NamedArray[Height]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:45:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][float, bool]' [invalid-annotation] + +def func3(a: IntTuple[float, bool], b: NamedArray[Height]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:46:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func3: Tuple[Any] [assert-type] + + assert_type(a, tuple[int, float, bool]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:47:31: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func3: class Array is not indexable [not-indexable] + + assert_type(b, tuple[str, Array[Height]]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:51:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func4: Tuple[Any] [assert-type] + + assert_type(a, tuple[int]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:55:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] + +Shape = TypeVarTuple("Shape") + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:59:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class Array2(Generic[DType, *Shape]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:63:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array2 is not indexable [not-indexable] + +FloatArray = Array2[float, *Shape] + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:64:11: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array2 is not indexable [not-indexable] + +Array1D = Array2[DType, Any] + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:67:28: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array2 is not indexable [not-indexable] + +def func5_0(a: Array1D, b: Array1D[int]): + \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:68:20: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func5_0: class Array2 is not indexable [not-indexable] + + assert_type(a, Array2[Any, Any]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:69:20: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func5_0: class Array2 is not indexable [not-indexable] + + assert_type(b, Array2[int, Any]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:76:16: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array2 is not indexable [not-indexable] + +def func5_1(x: FloatArray[Height, Width]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:80:46: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array2 is not indexable [not-indexable] + +def takes_float_array_with_specific_shape(y: FloatArray[Height, Width]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:89:17: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +VariadicTuple = tuple[T, *Ts] + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:92:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][str, int]' [invalid-annotation] + +def func6(a: VariadicTuple[str, int], b: VariadicTuple[float], c: VariadicTuple): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:92:42: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][float]' [invalid-annotation] + +def func6(a: VariadicTuple[str, int], b: VariadicTuple[float], c: VariadicTuple): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:93:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func6: Tuple[Any] [assert-type] + + assert_type(a, tuple[str, int]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:94:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func6: Tuple[Any] [assert-type] + + assert_type(b, tuple[float]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:95:20: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func6: Invalid type annotation '' [invalid-annotation] + + assert_type(c, tuple[Any, *tuple[Any, ...]]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:98:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] + +Ts1 = TypeVarTuple("Ts1") + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:99:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] + +Ts2 = TypeVarTuple("Ts2") + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:101:15: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +IntTupleVar = tuple[int, *Ts1] # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:102:20: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation] + +IntFloatTupleVar = IntTupleVar[float, *Ts2] # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:103:21: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation] + +IntFloatsTupleVar = IntTupleVar[*tuple[float, ...]] # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:109:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +IntTupleGeneric[*Ts] # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:110:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +IntTupleGeneric[*tuple[float, ...]] # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:117:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +TA1 = tuple[*Ts, T1, T2] # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:118:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +TA2 = tuple[T1, T2, *Ts] # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:119:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +TA3 = tuple[T1, *Ts, T2, T3] # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:120:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +TA4 = tuple[T1, T2, *tuple[int, ...]] # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:121:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +TA5 = tuple[T1, *Ts, T2, *Ts] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:121:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function list.extend was called with the wrong arguments [wrong-arg-types] + +TA5 = tuple[T1, *Ts, T2, *Ts] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:122:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +TA6 = tuple[T1, *Ts, T2, *tuple[int, ...]] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:122:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function list.extend was called with the wrong arguments [wrong-arg-types] + +TA6 = tuple[T1, *Ts, T2, *tuple[int, ...]] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:125:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +TA7 = tuple[*Ts, T1, T2] + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:127:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][int]' [invalid-annotation] + +v1: TA7[int] # E: requires at least two type arguments + \u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:130:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation] + +def func7(a: TA7[*Ts, T1, T2]) -> tuple[tuple[*Ts], T1, T2]: + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:130:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'T2' [invalid-annotation] + +def func7(a: TA7[*Ts, T1, T2]) -> tuple[tuple[*Ts], T1, T2]: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:130:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'T1' [invalid-annotation] + +def func7(a: TA7[*Ts, T1, T2]) -> tuple[tuple[*Ts], T1, T2]: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:130:41: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +def func7(a: TA7[*Ts, T1, T2]) -> tuple[tuple[*Ts], T1, T2]: + \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:131:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func7: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:134:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][str, bool]' [invalid-annotation] + +def func8(a: TA7[str, bool], b: TA7[str, bool, float], c: TA7[str, bool, float, int]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:134:33: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][str, bool, float]' [invalid-annotation] + +def func8(a: TA7[str, bool], b: TA7[str, bool, float], c: TA7[str, bool, float, int]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:134:59: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][str, bool, float, int]' [invalid-annotation] + +def func8(a: TA7[str, bool], b: TA7[str, bool, float], c: TA7[str, bool, float, int]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:135:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func8: Tuple[Tuple[Any], Any, Any] [assert-type] + + assert_type(func7(a), tuple[tuple[()], str, bool]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:136:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func8: Tuple[Tuple[Any], Any, Any] [assert-type] + + assert_type(func7(b), tuple[tuple[str], bool, float]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:137:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func8: Tuple[Tuple[Any], Any, Any] [assert-type] + + assert_type(func7(c), tuple[tuple[str, bool], float, int]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:140:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +TA8 = tuple[T1, *Ts, T2, T3] + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:143:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation] + +def func9(a: TA8[T1, *Ts, T2, T3]) -> tuple[tuple[*Ts], T1, T2, T3]: + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:143:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'T3' [invalid-annotation] + +def func9(a: TA8[T1, *Ts, T2, T3]) -> tuple[tuple[*Ts], T1, T2, T3]: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:143:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'T2' [invalid-annotation] + +def func9(a: TA8[T1, *Ts, T2, T3]) -> tuple[tuple[*Ts], T1, T2, T3]: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:143:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'T1' [invalid-annotation] + +def func9(a: TA8[T1, *Ts, T2, T3]) -> tuple[tuple[*Ts], T1, T2, T3]: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:143:45: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +def func9(a: TA8[T1, *Ts, T2, T3]) -> tuple[tuple[*Ts], T1, T2, T3]: + \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:144:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:147:15: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][str, bool, float]' [invalid-annotation] + +def func10(a: TA8[str, bool, float], b: TA8[str, bool, float, int]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:147:41: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][str, bool, float, int]' [invalid-annotation] + +def func10(a: TA8[str, bool, float], b: TA8[str, bool, float, int]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:148:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func10: Tuple[Tuple[Any], Any, Any, Any] [assert-type] + + assert_type(func9(a), tuple[tuple[()], str, bool, float]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:149:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func10: Tuple[Tuple[Any], Any, Any, Any] [assert-type] + + assert_type(func9(b), tuple[tuple[bool], str, float, int]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:152:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +TA9 = tuple[*Ts, T1] + \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:153:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation] + +TA10 = TA9[*tuple[int, ...]] # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:156:24: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation] + +def func11(a: TA10, b: TA9[*tuple[int, ...], str], c: TA9[*tuple[int, ...], str]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:156:55: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation] + +def func11(a: TA10, b: TA9[*tuple[int, ...], str], c: TA9[*tuple[int, ...], str]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:157:20: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func11: Invalid type annotation '' [invalid-annotation] + + assert_type(a, tuple[*tuple[int, ...], int]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:158:20: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func11: Invalid type annotation '' [invalid-annotation] + + assert_type(b, tuple[*tuple[int, ...], str]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:159:20: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func11: Invalid type annotation '' [invalid-annotation] + + assert_type(c, tuple[*tuple[int, ...], str]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:162:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +TA11 = tuple[T, *Ts1] + \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:163:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation] + +TA12 = TA11[*Ts2] # E + \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ -Line 7: Unexpected errors ['File "generics_typevartuple_specialization.py", line 7, in : typing.TypeVarTuple not supported yet [not-supported-yet]'] -Line 10: Unexpected errors ['File "generics_typevartuple_specialization.py", line 10, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] -Line 16: Unexpected errors ['File "generics_typevartuple_specialization.py", line 16, in : Invalid type annotation \\'Generic\\' [invalid-annotation]'] -Line 24: Unexpected errors ['File "generics_typevartuple_specialization.py", line 24, in : class Array is not indexable [not-indexable]'] -Line 28: Unexpected errors ['File "generics_typevartuple_specialization.py", line 28, in : class Array is not indexable [not-indexable]'] -Line 33: Unexpected errors ['File "generics_typevartuple_specialization.py", line 33, in : class Array is not indexable [not-indexable]'] -Line 41: Unexpected errors ['File "generics_typevartuple_specialization.py", line 41, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 42: Unexpected errors ['File "generics_typevartuple_specialization.py", line 42, in : class Array is not indexable [not-indexable]'] -Line 45: Unexpected errors ['File "generics_typevartuple_specialization.py", line 45, in : Invalid type annotation \\'Tuple[str, Array][Height]\\' [invalid-annotation]', 'File "generics_typevartuple_specialization.py", line 45, in : Invalid type annotation \\'Tuple[Any][float, bool]\\' [invalid-annotation]'] -Line 46: Unexpected errors ['File "generics_typevartuple_specialization.py", line 46, in func3: Tuple[Any] [assert-type]'] -Line 47: Unexpected errors ['File "generics_typevartuple_specialization.py", line 47, in func3: class Array is not indexable [not-indexable]'] -Line 51: Unexpected errors ['File "generics_typevartuple_specialization.py", line 51, in func4: Tuple[Any] [assert-type]'] -Line 55: Unexpected errors ['File "generics_typevartuple_specialization.py", line 55, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] -Line 59: Unexpected errors ['File "generics_typevartuple_specialization.py", line 59, in : Invalid type annotation \\'Generic\\' [invalid-annotation]'] -Line 63: Unexpected errors ['File "generics_typevartuple_specialization.py", line 63, in : class Array2 is not indexable [not-indexable]'] -Line 64: Unexpected errors ['File "generics_typevartuple_specialization.py", line 64, in : class Array2 is not indexable [not-indexable]'] -Line 67: Unexpected errors ['File "generics_typevartuple_specialization.py", line 67, in : class Array2 is not indexable [not-indexable]'] -Line 68: Unexpected errors ['File "generics_typevartuple_specialization.py", line 68, in func5_0: class Array2 is not indexable [not-indexable]'] -Line 69: Unexpected errors ['File "generics_typevartuple_specialization.py", line 69, in func5_0: class Array2 is not indexable [not-indexable]'] -Line 76: Unexpected errors ['File "generics_typevartuple_specialization.py", line 76, in : class Array2 is not indexable [not-indexable]'] -Line 80: Unexpected errors ['File "generics_typevartuple_specialization.py", line 80, in : class Array2 is not indexable [not-indexable]'] -Line 89: Unexpected errors ['File "generics_typevartuple_specialization.py", line 89, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 92: Unexpected errors ['File "generics_typevartuple_specialization.py", line 92, in : Invalid type annotation \\'Tuple[Any][str, int]\\' [invalid-annotation]', 'File "generics_typevartuple_specialization.py", line 92, in : Invalid type annotation \\'Tuple[Any][float]\\' [invalid-annotation]'] -Line 93: Unexpected errors ['File "generics_typevartuple_specialization.py", line 93, in func6: Tuple[Any] [assert-type]'] -Line 94: Unexpected errors ['File "generics_typevartuple_specialization.py", line 94, in func6: Tuple[Any] [assert-type]'] -Line 95: Unexpected errors ['File "generics_typevartuple_specialization.py", line 95, in func6: Invalid type annotation \\'\\' [invalid-annotation]'] -Line 98: Unexpected errors ['File "generics_typevartuple_specialization.py", line 98, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] -Line 99: Unexpected errors ['File "generics_typevartuple_specialization.py", line 99, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] -Line 101: Unexpected errors ['File "generics_typevartuple_specialization.py", line 101, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 102: Unexpected errors ['File "generics_typevartuple_specialization.py", line 102, in : Invalid type annotation \\'Tuple[Any][]\\' [invalid-annotation]'] -Line 103: Unexpected errors ['File "generics_typevartuple_specialization.py", line 103, in : Invalid type annotation \\'Tuple[Any][]\\' [invalid-annotation]'] -Line 117: Unexpected errors ['File "generics_typevartuple_specialization.py", line 117, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 118: Unexpected errors ['File "generics_typevartuple_specialization.py", line 118, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 119: Unexpected errors ['File "generics_typevartuple_specialization.py", line 119, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 120: Unexpected errors ['File "generics_typevartuple_specialization.py", line 120, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 125: Unexpected errors ['File "generics_typevartuple_specialization.py", line 125, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 130: Unexpected errors ['File "generics_typevartuple_specialization.py", line 130, in : Invalid type annotation \\'Tuple[Any][]\\' [invalid-annotation]', 'File "generics_typevartuple_specialization.py", line 130, in : Invalid type annotation \\'T2\\' [invalid-annotation]', 'File "generics_typevartuple_specialization.py", line 130, in : Invalid type annotation \\'T1\\' [invalid-annotation]', 'File "generics_typevartuple_specialization.py", line 130, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 131: Unexpected errors ['File "generics_typevartuple_specialization.py", line 131, in func7: bad return type [bad-return-type]'] -Line 134: Unexpected errors ['File "generics_typevartuple_specialization.py", line 134, in : Invalid type annotation \\'Tuple[Any][str, bool]\\' [invalid-annotation]', 'File "generics_typevartuple_specialization.py", line 134, in : Invalid type annotation \\'Tuple[Any][str, bool, float]\\' [invalid-annotation]', 'File "generics_typevartuple_specialization.py", line 134, in : Invalid type annotation \\'Tuple[Any][str, bool, float, int]\\' [invalid-annotation]'] -Line 135: Unexpected errors ['File "generics_typevartuple_specialization.py", line 135, in func8: Tuple[Tuple[Any], Any, Any] [assert-type]'] -Line 136: Unexpected errors ['File "generics_typevartuple_specialization.py", line 136, in func8: Tuple[Tuple[Any], Any, Any] [assert-type]'] -Line 137: Unexpected errors ['File "generics_typevartuple_specialization.py", line 137, in func8: Tuple[Tuple[Any], Any, Any] [assert-type]'] -Line 140: Unexpected errors ['File "generics_typevartuple_specialization.py", line 140, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 143: Unexpected errors ['File "generics_typevartuple_specialization.py", line 143, in : Invalid type annotation \\'Tuple[Any][]\\' [invalid-annotation]', 'File "generics_typevartuple_specialization.py", line 143, in : Invalid type annotation \\'T3\\' [invalid-annotation]', 'File "generics_typevartuple_specialization.py", line 143, in : Invalid type annotation \\'T2\\' [invalid-annotation]', 'File "generics_typevartuple_specialization.py", line 143, in : Invalid type annotation \\'T1\\' [invalid-annotation]', 'File "generics_typevartuple_specialization.py", line 143, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 144: Unexpected errors ['File "generics_typevartuple_specialization.py", line 144, in func9: bad return type [bad-return-type]'] -Line 147: Unexpected errors ['File "generics_typevartuple_specialization.py", line 147, in : Invalid type annotation \\'Tuple[Any][str, bool, float]\\' [invalid-annotation]', 'File "generics_typevartuple_specialization.py", line 147, in : Invalid type annotation \\'Tuple[Any][str, bool, float, int]\\' [invalid-annotation]'] -Line 148: Unexpected errors ['File "generics_typevartuple_specialization.py", line 148, in func10: Tuple[Tuple[Any], Any, Any, Any] [assert-type]'] -Line 149: Unexpected errors ['File "generics_typevartuple_specialization.py", line 149, in func10: Tuple[Tuple[Any], Any, Any, Any] [assert-type]'] -Line 152: Unexpected errors ['File "generics_typevartuple_specialization.py", line 152, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 153: Unexpected errors ['File "generics_typevartuple_specialization.py", line 153, in : Invalid type annotation \\'Tuple[Any][]\\' [invalid-annotation]'] -Line 156: Unexpected errors ['File "generics_typevartuple_specialization.py", line 156, in : Invalid type annotation \\'Tuple[Any][]\\' [invalid-annotation]'] -Line 157: Unexpected errors ['File "generics_typevartuple_specialization.py", line 157, in func11: Invalid type annotation \\'\\' [invalid-annotation]'] -Line 158: Unexpected errors ['File "generics_typevartuple_specialization.py", line 158, in func11: Invalid type annotation \\'\\' [invalid-annotation]'] -Line 159: Unexpected errors ['File "generics_typevartuple_specialization.py", line 159, in func11: Invalid type annotation \\'\\' [invalid-annotation]'] -Line 162: Unexpected errors ['File "generics_typevartuple_specialization.py", line 162, in : Invalid type annotation \\'\\' [invalid-annotation]'] +Line 7: Unexpected errors ['generics_typevartuple_specialization.py:7:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet]'] +Line 10: Unexpected errors ['generics_typevartuple_specialization.py:10:6: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] +Line 16: Unexpected errors ["generics_typevartuple_specialization.py:16:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] +Line 24: Unexpected errors ['generics_typevartuple_specialization.py:24:27: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]'] +Line 28: Unexpected errors ['generics_typevartuple_specialization.py:28:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]'] +Line 33: Unexpected errors ['generics_typevartuple_specialization.py:33:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]'] +Line 41: Unexpected errors ["generics_typevartuple_specialization.py:41:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 42: Unexpected errors ['generics_typevartuple_specialization.py:42:25: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]'] +Line 45: Unexpected errors ["generics_typevartuple_specialization.py:45:40: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Tuple[str, Array][Height]' [invalid-annotation]", "generics_typevartuple_specialization.py:45:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Tuple[Any][float, bool]' [invalid-annotation]"] +Line 46: Unexpected errors ['generics_typevartuple_specialization.py:46:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func3: Tuple[Any] [assert-type]'] +Line 47: Unexpected errors ['generics_typevartuple_specialization.py:47:31: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func3: class Array is not indexable [not-indexable]'] +Line 51: Unexpected errors ['generics_typevartuple_specialization.py:51:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func4: Tuple[Any] [assert-type]'] +Line 55: Unexpected errors ['generics_typevartuple_specialization.py:55:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] +Line 59: Unexpected errors ["generics_typevartuple_specialization.py:59:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] +Line 63: Unexpected errors ['generics_typevartuple_specialization.py:63:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array2 is not indexable [not-indexable]'] +Line 64: Unexpected errors ['generics_typevartuple_specialization.py:64:11: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array2 is not indexable [not-indexable]'] +Line 67: Unexpected errors ['generics_typevartuple_specialization.py:67:28: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array2 is not indexable [not-indexable]'] +Line 68: Unexpected errors ['generics_typevartuple_specialization.py:68:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func5_0: class Array2 is not indexable [not-indexable]'] +Line 69: Unexpected errors ['generics_typevartuple_specialization.py:69:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func5_0: class Array2 is not indexable [not-indexable]'] +Line 76: Unexpected errors ['generics_typevartuple_specialization.py:76:16: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array2 is not indexable [not-indexable]'] +Line 80: Unexpected errors ['generics_typevartuple_specialization.py:80:46: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array2 is not indexable [not-indexable]'] +Line 89: Unexpected errors ["generics_typevartuple_specialization.py:89:17: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 92: Unexpected errors ["generics_typevartuple_specialization.py:92:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Tuple[Any][str, int]' [invalid-annotation]", "generics_typevartuple_specialization.py:92:42: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Tuple[Any][float]' [invalid-annotation]"] +Line 93: Unexpected errors ['generics_typevartuple_specialization.py:93:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func6: Tuple[Any] [assert-type]'] +Line 94: Unexpected errors ['generics_typevartuple_specialization.py:94:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func6: Tuple[Any] [assert-type]'] +Line 95: Unexpected errors ["generics_typevartuple_specialization.py:95:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func6: Invalid type annotation '' [invalid-annotation]"] +Line 98: Unexpected errors ['generics_typevartuple_specialization.py:98:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] +Line 99: Unexpected errors ['generics_typevartuple_specialization.py:99:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] +Line 101: Unexpected errors ["generics_typevartuple_specialization.py:101:15: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 102: Unexpected errors ["generics_typevartuple_specialization.py:102:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation]"] +Line 103: Unexpected errors ["generics_typevartuple_specialization.py:103:21: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation]"] +Line 117: Unexpected errors ["generics_typevartuple_specialization.py:117:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 118: Unexpected errors ["generics_typevartuple_specialization.py:118:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 119: Unexpected errors ["generics_typevartuple_specialization.py:119:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 120: Unexpected errors ["generics_typevartuple_specialization.py:120:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 125: Unexpected errors ["generics_typevartuple_specialization.py:125:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 130: Unexpected errors ["generics_typevartuple_specialization.py:130:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation]", "generics_typevartuple_specialization.py:130:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'T2' [invalid-annotation]", "generics_typevartuple_specialization.py:130:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'T1' [invalid-annotation]", "generics_typevartuple_specialization.py:130:41: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 131: Unexpected errors ['generics_typevartuple_specialization.py:131:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func7: bad return type [bad-return-type]'] +Line 134: Unexpected errors ["generics_typevartuple_specialization.py:134:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Tuple[Any][str, bool]' [invalid-annotation]", "generics_typevartuple_specialization.py:134:33: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Tuple[Any][str, bool, float]' [invalid-annotation]", "generics_typevartuple_specialization.py:134:59: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Tuple[Any][str, bool, float, int]' [invalid-annotation]"] +Line 135: Unexpected errors ['generics_typevartuple_specialization.py:135:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func8: Tuple[Tuple[Any], Any, Any] [assert-type]'] +Line 136: Unexpected errors ['generics_typevartuple_specialization.py:136:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func8: Tuple[Tuple[Any], Any, Any] [assert-type]'] +Line 137: Unexpected errors ['generics_typevartuple_specialization.py:137:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func8: Tuple[Tuple[Any], Any, Any] [assert-type]'] +Line 140: Unexpected errors ["generics_typevartuple_specialization.py:140:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 143: Unexpected errors ["generics_typevartuple_specialization.py:143:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation]", "generics_typevartuple_specialization.py:143:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'T3' [invalid-annotation]", "generics_typevartuple_specialization.py:143:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'T2' [invalid-annotation]", "generics_typevartuple_specialization.py:143:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'T1' [invalid-annotation]", "generics_typevartuple_specialization.py:143:45: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 144: Unexpected errors ['generics_typevartuple_specialization.py:144:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func9: bad return type [bad-return-type]'] +Line 147: Unexpected errors ["generics_typevartuple_specialization.py:147:15: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Tuple[Any][str, bool, float]' [invalid-annotation]", "generics_typevartuple_specialization.py:147:41: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Tuple[Any][str, bool, float, int]' [invalid-annotation]"] +Line 148: Unexpected errors ['generics_typevartuple_specialization.py:148:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func10: Tuple[Tuple[Any], Any, Any, Any] [assert-type]'] +Line 149: Unexpected errors ['generics_typevartuple_specialization.py:149:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func10: Tuple[Tuple[Any], Any, Any, Any] [assert-type]'] +Line 152: Unexpected errors ["generics_typevartuple_specialization.py:152:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 153: Unexpected errors ["generics_typevartuple_specialization.py:153:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation]"] +Line 156: Unexpected errors ["generics_typevartuple_specialization.py:156:24: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation]", "generics_typevartuple_specialization.py:156:55: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation]"] +Line 157: Unexpected errors ["generics_typevartuple_specialization.py:157:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func11: Invalid type annotation '' [invalid-annotation]"] +Line 158: Unexpected errors ["generics_typevartuple_specialization.py:158:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func11: Invalid type annotation '' [invalid-annotation]"] +Line 159: Unexpected errors ["generics_typevartuple_specialization.py:159:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func11: Invalid type annotation '' [invalid-annotation]"] +Line 162: Unexpected errors ["generics_typevartuple_specialization.py:162:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] """ diff --git a/conformance/results/pytype/generics_typevartuple_unpack.toml b/conformance/results/pytype/generics_typevartuple_unpack.toml index 8a58f520b..b19a75825 100644 --- a/conformance/results/pytype/generics_typevartuple_unpack.toml +++ b/conformance/results/pytype/generics_typevartuple_unpack.toml @@ -3,26 +3,72 @@ notes = """ Does not support TypeVarTuple. """ output = """ -File "generics_typevartuple_unpack.py", line 7, in : typing.TypeVarTuple not supported yet [not-supported-yet] -File "generics_typevartuple_unpack.py", line 14, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] -File "generics_typevartuple_unpack.py", line 17, in : Invalid type annotation 'Generic' [invalid-annotation] -File "generics_typevartuple_unpack.py", line 21, in : class Array is not indexable [not-indexable] -File "generics_typevartuple_unpack.py", line 26, in : class Array is not indexable [not-indexable] -File "generics_typevartuple_unpack.py", line 33, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] -File "generics_typevartuple_unpack.py", line 36, in : class Array is not indexable [not-indexable] -File "generics_typevartuple_unpack.py", line 40, in : class Array is not indexable [not-indexable] -File "generics_typevartuple_unpack.py", line 44, in : class Array is not indexable [not-indexable] +generics_typevartuple_unpack.py:7:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet] + +from typing import Any, Generic, NewType, TypeVarTuple +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_unpack.py:14:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] + +Ts = TypeVarTuple("Ts") + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_unpack.py:17:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class Array(Generic[*Ts]): + \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_unpack.py:21:31: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +def process_batch_channels(x: Array[Batch, *tuple[Any, ...], Channels]) -> None: + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_unpack.py:26:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + + x: Array[Batch, Height, Width, Channels], y: Array[Batch, Channels], z: Array[Batch] + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_unpack.py:26:50: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + + x: Array[Batch, Height, Width, Channels], y: Array[Batch, Channels], z: Array[Batch] + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_unpack.py:26:77: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + + x: Array[Batch, Height, Width, Channels], y: Array[Batch, Channels], z: Array[Batch] + \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_unpack.py:33:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] + +Shape = TypeVarTuple("Shape") + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_unpack.py:36:30: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +def expect_variadic_array(x: Array[Batch, *Shape]) -> None: + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_unpack.py:40:29: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +def expect_precise_array(x: Array[Batch, Height, Width, Channels]) -> None: + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_unpack.py:44:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +def func4(y: Array[*tuple[Any, ...]]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ Line 30: Expected 1 errors -Line 7: Unexpected errors ['File "generics_typevartuple_unpack.py", line 7, in : typing.TypeVarTuple not supported yet [not-supported-yet]'] -Line 14: Unexpected errors ['File "generics_typevartuple_unpack.py", line 14, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] -Line 17: Unexpected errors ['File "generics_typevartuple_unpack.py", line 17, in : Invalid type annotation \\'Generic\\' [invalid-annotation]'] -Line 21: Unexpected errors ['File "generics_typevartuple_unpack.py", line 21, in : class Array is not indexable [not-indexable]'] -Line 26: Unexpected errors ['File "generics_typevartuple_unpack.py", line 26, in : class Array is not indexable [not-indexable]'] -Line 33: Unexpected errors ['File "generics_typevartuple_unpack.py", line 33, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] -Line 36: Unexpected errors ['File "generics_typevartuple_unpack.py", line 36, in : class Array is not indexable [not-indexable]'] -Line 40: Unexpected errors ['File "generics_typevartuple_unpack.py", line 40, in : class Array is not indexable [not-indexable]'] -Line 44: Unexpected errors ['File "generics_typevartuple_unpack.py", line 44, in : class Array is not indexable [not-indexable]'] +Line 7: Unexpected errors ['generics_typevartuple_unpack.py:7:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet]'] +Line 14: Unexpected errors ['generics_typevartuple_unpack.py:14:6: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] +Line 17: Unexpected errors ["generics_typevartuple_unpack.py:17:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] +Line 21: Unexpected errors ['generics_typevartuple_unpack.py:21:31: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]'] +Line 26: Unexpected errors ['generics_typevartuple_unpack.py:26:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]', 'generics_typevartuple_unpack.py:26:50: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]', 'generics_typevartuple_unpack.py:26:77: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]'] +Line 33: Unexpected errors ['generics_typevartuple_unpack.py:33:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] +Line 36: Unexpected errors ['generics_typevartuple_unpack.py:36:30: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]'] +Line 40: Unexpected errors ['generics_typevartuple_unpack.py:40:29: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]'] +Line 44: Unexpected errors ['generics_typevartuple_unpack.py:44:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]'] """ diff --git a/conformance/results/pytype/generics_upper_bound.toml b/conformance/results/pytype/generics_upper_bound.toml index a999a23b4..756776a8e 100644 --- a/conformance/results/pytype/generics_upper_bound.toml +++ b/conformance/results/pytype/generics_upper_bound.toml @@ -3,15 +3,39 @@ notes = """ Does not properly support assert_type. """ output = """ -File "generics_upper_bound.py", line 24, in Test: Invalid TypeVar: bound cannot contain TypeVars [invalid-typevar] -File "generics_upper_bound.py", line 37, in : list [assert-type] -File "generics_upper_bound.py", line 38, in : set [assert-type] -File "generics_upper_bound.py", line 43, in : Union[list, set] [assert-type] -File "generics_upper_bound.py", line 51, in : Function longer was called with the wrong arguments [wrong-arg-types] -File "generics_upper_bound.py", line 56, in : Invalid TypeVar: constraints and a bound are mutually exclusive [invalid-typevar] +generics_upper_bound.py:24:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Test: Invalid TypeVar: bound cannot contain TypeVars [invalid-typevar] + + T_Bad1 = TypeVar("T_Bad1", bound=list[T]) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_upper_bound.py:37:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : list [assert-type] + +assert_type(longer([1], [1, 2]), list[int]) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_upper_bound.py:38:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : set [assert-type] + +assert_type(longer({1}, {1, 2}), set[int]) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_upper_bound.py:43:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Union[list, set] [assert-type] + +assert_type(longer([1], {1, 2}), list[int] | set[int]) # E? +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_upper_bound.py:51:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function longer was called with the wrong arguments [wrong-arg-types] + +longer(3, 3) # E +\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_upper_bound.py:56:10: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid TypeVar: constraints and a bound are mutually exclusive [invalid-typevar] + +T_Bad2 = TypeVar("T_Bad2", str, int, bound="int") # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ -Line 37: Unexpected errors ['File "generics_upper_bound.py", line 37, in : list [assert-type]'] -Line 38: Unexpected errors ['File "generics_upper_bound.py", line 38, in : set [assert-type]'] +Line 37: Unexpected errors ['generics_upper_bound.py:37:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : list [assert-type]'] +Line 38: Unexpected errors ['generics_upper_bound.py:38:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : set [assert-type]'] """ diff --git a/conformance/results/pytype/generics_variance.toml b/conformance/results/pytype/generics_variance.toml index 92664946c..46ec8ed46 100644 --- a/conformance/results/pytype/generics_variance.toml +++ b/conformance/results/pytype/generics_variance.toml @@ -3,12 +3,36 @@ notes = """ Does not support covariant or contravariant TypeVars. """ output = """ -File "generics_variance.py", line 14, in : argument "covariant" to TypeVar not supported yet [not-supported-yet] -File "generics_variance.py", line 14, in : argument "contravariant" to TypeVar not supported yet [not-supported-yet] -File "generics_variance.py", line 18, in : argument "covariant" to TypeVar not supported yet [not-supported-yet] -File "generics_variance.py", line 19, in : argument "contravariant" to TypeVar not supported yet [not-supported-yet] -File "generics_variance.py", line 27, in __iter__: bad return type [bad-return-type] -File "generics_variance.py", line 52, in : argument "covariant" to TypeVar not supported yet [not-supported-yet] +generics_variance.py:14:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet] + +X1 = TypeVar("X1", covariant=True, contravariant=True) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_variance.py:14:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "contravariant" to TypeVar not supported yet [not-supported-yet] + +X1 = TypeVar("X1", covariant=True, contravariant=True) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_variance.py:18:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet] + +T_co = TypeVar("T_co", covariant=True) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_variance.py:19:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "contravariant" to TypeVar not supported yet [not-supported-yet] + +T_contra = TypeVar("T_contra", contravariant=True) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_variance.py:27:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __iter__: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +generics_variance.py:52:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet] + +B_co = TypeVar("B_co", covariant=True) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -24,8 +48,8 @@ Lines 125, 126: Expected error (tag 'CoContra_Child2') Lines 131, 132: Expected error (tag 'CoContra_Child3') Lines 141, 142: Expected error (tag 'CoContra_Child5') Lines 195, 196: Expected error (tag 'ContraToContraToContra_WithTA') -Line 18: Unexpected errors ['File "generics_variance.py", line 18, in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] -Line 19: Unexpected errors ['File "generics_variance.py", line 19, in : argument "contravariant" to TypeVar not supported yet [not-supported-yet]'] -Line 27: Unexpected errors ['File "generics_variance.py", line 27, in __iter__: bad return type [bad-return-type]'] -Line 52: Unexpected errors ['File "generics_variance.py", line 52, in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] +Line 18: Unexpected errors ['generics_variance.py:18:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] +Line 19: Unexpected errors ['generics_variance.py:19:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "contravariant" to TypeVar not supported yet [not-supported-yet]'] +Line 27: Unexpected errors ['generics_variance.py:27:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __iter__: bad return type [bad-return-type]'] +Line 52: Unexpected errors ['generics_variance.py:52:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] """ diff --git a/conformance/results/pytype/historical_positional.toml b/conformance/results/pytype/historical_positional.toml index 2c02fbd84..563658c06 100644 --- a/conformance/results/pytype/historical_positional.toml +++ b/conformance/results/pytype/historical_positional.toml @@ -4,7 +4,11 @@ Does not apply rules for pre-3.8 positional-only parameters in some cases. Does not reject positional-only parameter after non-positional-only parameter. """ output = """ -File "historical_positional.py", line 43, in : Invalid keyword argument __x to function A.m1 [wrong-keyword-args] +historical_positional.py:43:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid keyword argument __x to function A.m1 [wrong-keyword-args] + +a.m1(__x=3) # E +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ diff --git a/conformance/results/pytype/literals_interactions.toml b/conformance/results/pytype/literals_interactions.toml index abe6af209..a9a4375b2 100644 --- a/conformance/results/pytype/literals_interactions.toml +++ b/conformance/results/pytype/literals_interactions.toml @@ -7,23 +7,67 @@ Does not narrow based on `x is Literal` type guard pattern. Does not narrow based on `x == Literal` type guard pattern. """ output = """ -File "literals_interactions.py", line 11, in : Invalid type annotation 'Literal' [invalid-annotation] -File "literals_interactions.py", line 46, in open: bad return type [bad-return-type] +literals_interactions.py:11:76: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] + +def func1(v: tuple[int, str, list[bool]], a: Literal[0], b: Literal[5], c: Literal[-5]): + \u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +literals_interactions.py:46:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in open: bad return type [bad-return-type] + + pass + \u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m + Called from (traceback): line 51, in current file -File "literals_interactions.py", line 46, in open: bad return type [bad-return-type] +literals_interactions.py:46:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in open: bad return type [bad-return-type] + + pass + \u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m + Called from (traceback): line 50, in current file -File "literals_interactions.py", line 46, in open: bad return type [bad-return-type] +literals_interactions.py:46:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in open: bad return type [bad-return-type] + + pass + \u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m + Called from (traceback): line 49, in current file -File "literals_interactions.py", line 61, in __add__: bad return type [bad-return-type] -File "literals_interactions.py", line 64, in __matmul__: bad return type [bad-return-type] -File "literals_interactions.py", line 67, in transpose: bad return type [bad-return-type] -File "literals_interactions.py", line 72, in func2: Matrix[Any, int] [assert-type] -File "literals_interactions.py", line 93, in parse_status1: Union[Status, str] [assert-type] -File "literals_interactions.py", line 106, in parse_status2: Function expects_bad_status was called with the wrong arguments [wrong-arg-types] -File "literals_interactions.py", line 109, in parse_status2: Function expects_pending_status was called with the wrong arguments [wrong-arg-types] +literals_interactions.py:61:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __add__: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +literals_interactions.py:64:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __matmul__: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +literals_interactions.py:67:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in transpose: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +literals_interactions.py:72:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func2: Matrix[Any, int] [assert-type] + + assert_type(c, Matrix[Literal[2], Literal[7]]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +literals_interactions.py:93:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in parse_status1: Union[Status, str] [assert-type] + + assert_type(s, str) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +literals_interactions.py:106:16: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in parse_status2: Function expects_bad_status was called with the wrong arguments [wrong-arg-types] + + return expects_bad_status(status) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +literals_interactions.py:109:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in parse_status2: Function expects_pending_status was called with the wrong arguments [wrong-arg-types] + + expects_pending_status(status) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -31,13 +75,13 @@ Line 15: Expected 1 errors Line 16: Expected 1 errors Line 17: Expected 1 errors Line 18: Expected 1 errors -Line 11: Unexpected errors ['File "literals_interactions.py", line 11, in : Invalid type annotation \\'Literal\\' [invalid-annotation]'] -Line 46: Unexpected errors ['File "literals_interactions.py", line 46, in open: bad return type [bad-return-type]', 'File "literals_interactions.py", line 46, in open: bad return type [bad-return-type]', 'File "literals_interactions.py", line 46, in open: bad return type [bad-return-type]'] -Line 61: Unexpected errors ['File "literals_interactions.py", line 61, in __add__: bad return type [bad-return-type]'] -Line 64: Unexpected errors ['File "literals_interactions.py", line 64, in __matmul__: bad return type [bad-return-type]'] -Line 67: Unexpected errors ['File "literals_interactions.py", line 67, in transpose: bad return type [bad-return-type]'] -Line 72: Unexpected errors ['File "literals_interactions.py", line 72, in func2: Matrix[Any, int] [assert-type]'] -Line 93: Unexpected errors ['File "literals_interactions.py", line 93, in parse_status1: Union[Status, str] [assert-type]'] -Line 106: Unexpected errors ['File "literals_interactions.py", line 106, in parse_status2: Function expects_bad_status was called with the wrong arguments [wrong-arg-types]'] -Line 109: Unexpected errors ['File "literals_interactions.py", line 109, in parse_status2: Function expects_pending_status was called with the wrong arguments [wrong-arg-types]'] +Line 11: Unexpected errors ["literals_interactions.py:11:76: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Literal' [invalid-annotation]"] +Line 46: Unexpected errors ['literals_interactions.py:46:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in open: bad return type [bad-return-type]', 'literals_interactions.py:46:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in open: bad return type [bad-return-type]', 'literals_interactions.py:46:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in open: bad return type [bad-return-type]'] +Line 61: Unexpected errors ['literals_interactions.py:61:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __add__: bad return type [bad-return-type]'] +Line 64: Unexpected errors ['literals_interactions.py:64:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __matmul__: bad return type [bad-return-type]'] +Line 67: Unexpected errors ['literals_interactions.py:67:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in transpose: bad return type [bad-return-type]'] +Line 72: Unexpected errors ['literals_interactions.py:72:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func2: Matrix[Any, int] [assert-type]'] +Line 93: Unexpected errors ['literals_interactions.py:93:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in parse_status1: Union[Status, str] [assert-type]'] +Line 106: Unexpected errors ['literals_interactions.py:106:16: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in parse_status2: Function expects_bad_status was called with the wrong arguments [wrong-arg-types]'] +Line 109: Unexpected errors ['literals_interactions.py:109:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in parse_status2: Function expects_pending_status was called with the wrong arguments [wrong-arg-types]'] """ diff --git a/conformance/results/pytype/literals_literalstring.toml b/conformance/results/pytype/literals_literalstring.toml index 32d16477f..1a86e0b8c 100644 --- a/conformance/results/pytype/literals_literalstring.toml +++ b/conformance/results/pytype/literals_literalstring.toml @@ -3,20 +3,78 @@ notes = """ Does not understand `LiteralString` special form. """ output = """ -File "literals_literalstring.py", line 8, in : typing.LiteralString not supported yet [not-supported-yet] -File "literals_literalstring.py", line 24, in my_function: bad return type [bad-return-type] -File "literals_literalstring.py", line 36, in : Invalid type annotation 'Literal' [invalid-annotation] -File "literals_literalstring.py", line 37, in : Invalid type annotation 'Literal' [invalid-annotation] -File "literals_literalstring.py", line 43, in func1: Type annotation for x2 does not match type of assignment [annotation-type-mismatch] -File "literals_literalstring.py", line 74, in func2: Type annotation for x3 does not match type of assignment [annotation-type-mismatch] -File "literals_literalstring.py", line 75, in func2: Type annotation for x4 does not match type of assignment [annotation-type-mismatch] -File "literals_literalstring.py", line 162, in func8: bad return type [bad-return-type] +literals_literalstring.py:8:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing.LiteralString not supported yet [not-supported-yet] + +from typing import ( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + Any, +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + Generic, +\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + Literal, +\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + LiteralString, +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + Sequence, +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + TypeVar, +\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + assert_type, +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + overload, +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m +) +\u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +literals_literalstring.py:24:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in my_function: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +literals_literalstring.py:36:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] + +bad_union: Literal["hello", LiteralString] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +literals_literalstring.py:37:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] + +bad_nesting: Literal[LiteralString] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +literals_literalstring.py:43:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Type annotation for x2 does not match type of assignment [annotation-type-mismatch] + + x2: Literal[""] = b # E + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +literals_literalstring.py:74:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func2: Type annotation for x3 does not match type of assignment [annotation-type-mismatch] + + x3: LiteralString = 3 # E + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +literals_literalstring.py:75:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func2: Type annotation for x4 does not match type of assignment [annotation-type-mismatch] + + x4: LiteralString = b"test" # E + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +literals_literalstring.py:162:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func8: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + Called from (traceback): line 166, in current file -File "literals_literalstring.py", line 162, in func8: bad return type [bad-return-type] +literals_literalstring.py:162:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func8: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + Called from (traceback): line 165, in current file -File "literals_literalstring.py", line 167, in : B [assert-type] +literals_literalstring.py:167:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : B [assert-type] + +assert_type(func8(str(1)), A) # Third overload +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -24,8 +82,8 @@ Line 66: Expected 1 errors Line 120: Expected 1 errors Line 134: Expected 1 errors Line 171: Expected 1 errors -Line 8: Unexpected errors ['File "literals_literalstring.py", line 8, in : typing.LiteralString not supported yet [not-supported-yet]'] -Line 24: Unexpected errors ['File "literals_literalstring.py", line 24, in my_function: bad return type [bad-return-type]'] -Line 162: Unexpected errors ['File "literals_literalstring.py", line 162, in func8: bad return type [bad-return-type]', 'File "literals_literalstring.py", line 162, in func8: bad return type [bad-return-type]'] -Line 167: Unexpected errors ['File "literals_literalstring.py", line 167, in : B [assert-type]'] +Line 8: Unexpected errors ['literals_literalstring.py:8:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.LiteralString not supported yet [not-supported-yet]'] +Line 24: Unexpected errors ['literals_literalstring.py:24:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in my_function: bad return type [bad-return-type]'] +Line 162: Unexpected errors ['literals_literalstring.py:162:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func8: bad return type [bad-return-type]', 'literals_literalstring.py:162:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func8: bad return type [bad-return-type]'] +Line 167: Unexpected errors ['literals_literalstring.py:167:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : B [assert-type]'] """ diff --git a/conformance/results/pytype/literals_parameterizations.toml b/conformance/results/pytype/literals_parameterizations.toml index 1cc9d9b30..a1751be55 100644 --- a/conformance/results/pytype/literals_parameterizations.toml +++ b/conformance/results/pytype/literals_parameterizations.toml @@ -3,22 +3,91 @@ notes = """ Does not understand `Literal` type annotation. """ output = """ -File "literals_parameterizations.py", line 17, in : Invalid type annotation 'Literal' [invalid-annotation] -File "literals_parameterizations.py", line 18, in : Invalid type annotation 'Literal' [invalid-annotation] -File "literals_parameterizations.py", line 19, in : Invalid type annotation 'Literal' [invalid-annotation] -File "literals_parameterizations.py", line 33, in : Invalid type annotation 'Literal' [invalid-annotation] -File "literals_parameterizations.py", line 35, in : Invalid type annotation 'Literal' [invalid-annotation] -File "literals_parameterizations.py", line 42, in : Invalid type annotation 'Literal' [invalid-annotation] -File "literals_parameterizations.py", line 43, in : Invalid type annotation 'Literal' [invalid-annotation] -File "literals_parameterizations.py", line 44, in : Invalid type annotation 'Literal' [invalid-annotation] -File "literals_parameterizations.py", line 47, in : Invalid type annotation 'Literal' [invalid-annotation] -File "literals_parameterizations.py", line 48, in : Invalid type annotation 'Literal' [invalid-annotation] -File "literals_parameterizations.py", line 50, in : Invalid type annotation 'Literal' [invalid-annotation] -File "literals_parameterizations.py", line 51, in : Invalid type annotation 'Literal' [invalid-annotation] -File "literals_parameterizations.py", line 53, in : Invalid type annotation 'Literal' [invalid-annotation] -File "literals_parameterizations.py", line 61, in : Invalid type annotation 'Literal[my_function]' [invalid-annotation] -File "literals_parameterizations.py", line 61, in : Invalid type annotation 'Literal' [invalid-annotation] -File "literals_parameterizations.py", line 65, in func2: Type annotation for x1 does not match type of assignment [annotation-type-mismatch] +literals_parameterizations.py:17:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] + +good1: Literal[26] + \u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +literals_parameterizations.py:18:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] + +good2: Literal[0x1A] + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +literals_parameterizations.py:19:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] + +good3: Literal[-4] + \u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +literals_parameterizations.py:33:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] + +AllModes = Literal[ReadOnlyMode, WriteAndTruncateMode, WriteNoTruncateMode, AppendMode] + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +literals_parameterizations.py:35:17: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] + +good11: Literal[Literal[Literal[1, 2, 3], "foo"], 5, None] + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +literals_parameterizations.py:35:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] + +good11: Literal[Literal[Literal[1, 2, 3], "foo"], 5, None] + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +literals_parameterizations.py:42:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] + +bad2: Literal["foo".replace("o", "b")] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +literals_parameterizations.py:43:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] + +bad3: Literal[4 + 3j] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +literals_parameterizations.py:44:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] + +bad4: Literal[~5] # E + \u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +literals_parameterizations.py:47:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] + +bad7: Literal[{"a": "b", "c": "d"}] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +literals_parameterizations.py:48:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] + +bad8: Literal[int] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +literals_parameterizations.py:50:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] + +bad10: Literal[T] # E + \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + +literals_parameterizations.py:51:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] + +bad11: Literal[3.14] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +literals_parameterizations.py:53:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] + +bad13: Literal[...] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +literals_parameterizations.py:61:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal[my_function]' [invalid-annotation] + +y: Literal[my_function] = my_function # E +\u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +literals_parameterizations.py:61:4: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] + +y: Literal[my_function] = my_function # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +literals_parameterizations.py:65:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func2: Type annotation for x1 does not match type of assignment [annotation-type-mismatch] + + x1: Literal["Color.RED"] = a # E + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -29,9 +98,9 @@ Line 49: Expected 1 errors Line 52: Expected 1 errors Line 56: Expected 1 errors Line 60: Expected 1 errors -Line 17: Unexpected errors ['File "literals_parameterizations.py", line 17, in : Invalid type annotation \\'Literal\\' [invalid-annotation]'] -Line 18: Unexpected errors ['File "literals_parameterizations.py", line 18, in : Invalid type annotation \\'Literal\\' [invalid-annotation]'] -Line 19: Unexpected errors ['File "literals_parameterizations.py", line 19, in : Invalid type annotation \\'Literal\\' [invalid-annotation]'] -Line 33: Unexpected errors ['File "literals_parameterizations.py", line 33, in : Invalid type annotation \\'Literal\\' [invalid-annotation]'] -Line 35: Unexpected errors ['File "literals_parameterizations.py", line 35, in : Invalid type annotation \\'Literal\\' [invalid-annotation]'] +Line 17: Unexpected errors ["literals_parameterizations.py:17:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Literal' [invalid-annotation]"] +Line 18: Unexpected errors ["literals_parameterizations.py:18:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Literal' [invalid-annotation]"] +Line 19: Unexpected errors ["literals_parameterizations.py:19:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Literal' [invalid-annotation]"] +Line 33: Unexpected errors ["literals_parameterizations.py:33:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Literal' [invalid-annotation]"] +Line 35: Unexpected errors ["literals_parameterizations.py:35:17: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Literal' [invalid-annotation]", "literals_parameterizations.py:35:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Literal' [invalid-annotation]"] """ diff --git a/conformance/results/pytype/literals_semantics.toml b/conformance/results/pytype/literals_semantics.toml index afe670975..e443c9509 100644 --- a/conformance/results/pytype/literals_semantics.toml +++ b/conformance/results/pytype/literals_semantics.toml @@ -3,22 +3,60 @@ notes = """ Does not understand `Literal` type annotation. """ output = """ -File "literals_semantics.py", line 10, in : Type annotation for v2 does not match type of assignment [annotation-type-mismatch] -File "literals_semantics.py", line 12, in : Invalid type annotation 'Literal' [invalid-annotation] -File "literals_semantics.py", line 12, in : Invalid type annotation 'L[-3]' [invalid-annotation] -File "literals_semantics.py", line 16, in : Invalid type annotation 'Literal' [invalid-annotation] -File "literals_semantics.py", line 17, in func1: Invalid type annotation 'Literal[20]' [invalid-annotation] -File "literals_semantics.py", line 18, in func1: Invalid type annotation 'Literal[20]' [invalid-annotation] -File "literals_semantics.py", line 19, in func1: Invalid type annotation 'Literal[20]' [invalid-annotation] +literals_semantics.py:10:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for v2 does not match type of assignment [annotation-type-mismatch] + +v2: Literal[3] = 4 # E +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +literals_semantics.py:12:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] + +v3: L[-3] = -3 + \u001b[1m\u001b[31m~~~~~\u001b[39m\u001b[0m + +literals_semantics.py:12:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'L[-3]' [invalid-annotation] + +v3: L[-3] = -3 +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +literals_semantics.py:16:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] + +def func1(a: Literal[20], b: Literal[0x14], c: Literal[0b10100]): + \u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +literals_semantics.py:16:30: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] + +def func1(a: Literal[20], b: Literal[0x14], c: Literal[0b10100]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +literals_semantics.py:16:48: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] + +def func1(a: Literal[20], b: Literal[0x14], c: Literal[0b10100]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +literals_semantics.py:17:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Invalid type annotation 'Literal[20]' [invalid-annotation] + + x1: Literal[0x14] = a + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +literals_semantics.py:18:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Invalid type annotation 'Literal[20]' [invalid-annotation] + + x2: Literal[0x14] = b + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +literals_semantics.py:19:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Invalid type annotation 'Literal[20]' [invalid-annotation] + + x3: Literal[0x14] = c + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ Line 24: Expected 1 errors Line 25: Expected 1 errors Line 33: Expected 1 errors -Line 12: Unexpected errors ['File "literals_semantics.py", line 12, in : Invalid type annotation \\'Literal\\' [invalid-annotation]', 'File "literals_semantics.py", line 12, in : Invalid type annotation \\'L[-3]\\' [invalid-annotation]'] -Line 16: Unexpected errors ['File "literals_semantics.py", line 16, in : Invalid type annotation \\'Literal\\' [invalid-annotation]'] -Line 17: Unexpected errors ['File "literals_semantics.py", line 17, in func1: Invalid type annotation \\'Literal[20]\\' [invalid-annotation]'] -Line 18: Unexpected errors ['File "literals_semantics.py", line 18, in func1: Invalid type annotation \\'Literal[20]\\' [invalid-annotation]'] -Line 19: Unexpected errors ['File "literals_semantics.py", line 19, in func1: Invalid type annotation \\'Literal[20]\\' [invalid-annotation]'] +Line 12: Unexpected errors ["literals_semantics.py:12:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Literal' [invalid-annotation]", "literals_semantics.py:12:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'L[-3]' [invalid-annotation]"] +Line 16: Unexpected errors ["literals_semantics.py:16:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Literal' [invalid-annotation]", "literals_semantics.py:16:30: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Literal' [invalid-annotation]", "literals_semantics.py:16:48: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Literal' [invalid-annotation]"] +Line 17: Unexpected errors ["literals_semantics.py:17:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: Invalid type annotation 'Literal[20]' [invalid-annotation]"] +Line 18: Unexpected errors ["literals_semantics.py:18:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: Invalid type annotation 'Literal[20]' [invalid-annotation]"] +Line 19: Unexpected errors ["literals_semantics.py:19:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: Invalid type annotation 'Literal[20]' [invalid-annotation]"] """ diff --git a/conformance/results/pytype/namedtuples_define_class.toml b/conformance/results/pytype/namedtuples_define_class.toml index 354819a99..bad1600de 100644 --- a/conformance/results/pytype/namedtuples_define_class.toml +++ b/conformance/results/pytype/namedtuples_define_class.toml @@ -9,17 +9,61 @@ Does not reject incorrect argument type passed to specialized generic named tupl Does not reject attempt to use NamedTuple with multiple inheritance. """ output = """ -File "namedtuples_define_class.py", line 27, in : Union[int, str] [assert-type] -File "namedtuples_define_class.py", line 28, in : Union[int, str] [assert-type] -File "namedtuples_define_class.py", line 29, in : Tuple[Union[int, str], ...] [assert-type] -File "namedtuples_define_class.py", line 30, in : Tuple[Union[int, str], ...] [assert-type] -File "namedtuples_define_class.py", line 44, in : Missing parameter 'y' in call to function Point.__new__ [missing-parameter] -File "namedtuples_define_class.py", line 45, in : Missing parameter 'y' in call to function Point.__new__ [missing-parameter] -File "namedtuples_define_class.py", line 46, in : Function Point.__new__ was called with the wrong arguments [wrong-arg-types] -File "namedtuples_define_class.py", line 47, in : Function Point.__new__ was called with the wrong arguments [wrong-arg-types] -File "namedtuples_define_class.py", line 48, in : Function Point.__new__ expects 3 arg(s), got 5 [wrong-arg-count] -File "namedtuples_define_class.py", line 49, in : Invalid keyword argument other to function Point.__new__ [wrong-keyword-args] -File "namedtuples_define_class.py", line 95, in : Any [assert-type] +namedtuples_define_class.py:27:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Union[int, str] [assert-type] + +assert_type(p1[-2], int) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +namedtuples_define_class.py:28:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Union[int, str] [assert-type] + +assert_type(p1[-3], int) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +namedtuples_define_class.py:29:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Tuple[Union[int, str], ...] [assert-type] + +assert_type(p1[0:2], tuple[int, int]) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +namedtuples_define_class.py:30:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Tuple[Union[int, str], ...] [assert-type] + +assert_type(p1[0:], tuple[int, int, str]) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +namedtuples_define_class.py:44:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'y' in call to function Point.__new__ [missing-parameter] + +p5 = Point(1) # E + \u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +namedtuples_define_class.py:45:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'y' in call to function Point.__new__ [missing-parameter] + +p6 = Point(x=1) # E + \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + +namedtuples_define_class.py:46:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Point.__new__ was called with the wrong arguments [wrong-arg-types] + +p7 = Point(1, "") # E + \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +namedtuples_define_class.py:47:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Point.__new__ was called with the wrong arguments [wrong-arg-types] + +p8 = Point(1, 2, units=3) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +namedtuples_define_class.py:48:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Point.__new__ expects 3 arg(s), got 5 [wrong-arg-count] + +p9 = Point(1, 2, "", "") # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +namedtuples_define_class.py:49:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid keyword argument other to function Point.__new__ [wrong-keyword-args] + +p10 = Point(1, 2, "", other="") # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +namedtuples_define_class.py:95:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Any [assert-type] + +assert_type(pr1[1], float) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -29,9 +73,9 @@ Line 59: Expected 1 errors Line 79: Expected 1 errors Line 98: Expected 1 errors Line 105: Expected 1 errors -Line 27: Unexpected errors ['File "namedtuples_define_class.py", line 27, in : Union[int, str] [assert-type]'] -Line 28: Unexpected errors ['File "namedtuples_define_class.py", line 28, in : Union[int, str] [assert-type]'] -Line 29: Unexpected errors ['File "namedtuples_define_class.py", line 29, in : Tuple[Union[int, str], ...] [assert-type]'] -Line 30: Unexpected errors ['File "namedtuples_define_class.py", line 30, in : Tuple[Union[int, str], ...] [assert-type]'] -Line 95: Unexpected errors ['File "namedtuples_define_class.py", line 95, in : Any [assert-type]'] +Line 27: Unexpected errors ['namedtuples_define_class.py:27:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Union[int, str] [assert-type]'] +Line 28: Unexpected errors ['namedtuples_define_class.py:28:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Union[int, str] [assert-type]'] +Line 29: Unexpected errors ['namedtuples_define_class.py:29:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Tuple[Union[int, str], ...] [assert-type]'] +Line 30: Unexpected errors ['namedtuples_define_class.py:30:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Tuple[Union[int, str], ...] [assert-type]'] +Line 95: Unexpected errors ['namedtuples_define_class.py:95:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Any [assert-type]'] """ diff --git a/conformance/results/pytype/namedtuples_define_functional.toml b/conformance/results/pytype/namedtuples_define_functional.toml index ab1f06c02..f18a771b4 100644 --- a/conformance/results/pytype/namedtuples_define_functional.toml +++ b/conformance/results/pytype/namedtuples_define_functional.toml @@ -4,21 +4,69 @@ Does not handle illegal named tuple names the same as runtime. Does not support defaults in functional form. """ output = """ -File "namedtuples_define_functional.py", line 16, in : Missing parameter 'y' in call to function Point1.__new__ [missing-parameter] -File "namedtuples_define_functional.py", line 21, in : Missing parameter 'x' in call to function Point2.__new__ [missing-parameter] -File "namedtuples_define_functional.py", line 26, in : Function Point3.__new__ expects 3 arg(s), got 4 [wrong-arg-count] -File "namedtuples_define_functional.py", line 31, in : Invalid keyword argument z to function Point4.__new__ [wrong-keyword-args] -File "namedtuples_define_functional.py", line 36, in : Function Point5.__new__ was called with the wrong arguments [wrong-arg-types] -File "namedtuples_define_functional.py", line 37, in : Function Point5.__new__ expects 3 arg(s), got 4 [wrong-arg-count] -File "namedtuples_define_functional.py", line 42, in : Function Point6.__new__ was called with the wrong arguments [wrong-arg-types] -File "namedtuples_define_functional.py", line 43, in : Function Point6.__new__ was called with the wrong arguments [wrong-arg-types] -File "namedtuples_define_functional.py", line 52, in : collections.namedtuple argument 'a' is not a valid typename or field name. [invalid-namedtuple-arg] -File "namedtuples_define_functional.py", line 53, in : collections.namedtuple argument 'def' is not a valid typename or field name. [invalid-namedtuple-arg] -File "namedtuples_define_functional.py", line 54, in : collections.namedtuple argument 'def' is not a valid typename or field name. [invalid-namedtuple-arg] -File "namedtuples_define_functional.py", line 63, in : Function collections.namedtuple was called with the wrong arguments [wrong-arg-types] +namedtuples_define_functional.py:16:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'y' in call to function Point1.__new__ [missing-parameter] + +p1_3 = Point1(2.3) # E + \u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +namedtuples_define_functional.py:21:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'x' in call to function Point2.__new__ [missing-parameter] + +p2_3 = Point2() # E + \u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +namedtuples_define_functional.py:26:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Point3.__new__ expects 3 arg(s), got 4 [wrong-arg-count] + +p3_3 = Point3(1, 2, 3) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +namedtuples_define_functional.py:31:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid keyword argument z to function Point4.__new__ [wrong-keyword-args] + +p4_3 = Point4(1, z=3) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +namedtuples_define_functional.py:36:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Point5.__new__ was called with the wrong arguments [wrong-arg-types] + +p5_3 = Point5(2, "1") # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +namedtuples_define_functional.py:37:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Point5.__new__ expects 3 arg(s), got 4 [wrong-arg-count] + +p5_4 = Point5(1, 2, 3) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +namedtuples_define_functional.py:42:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Point6.__new__ was called with the wrong arguments [wrong-arg-types] + +p6_3 = Point6(2, "1") # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +namedtuples_define_functional.py:43:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Point6.__new__ was called with the wrong arguments [wrong-arg-types] + +p6_4 = Point6(x=1.1, y=2) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +namedtuples_define_functional.py:52:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : collections.namedtuple argument 'a' is not a valid typename or field name. [invalid-namedtuple-arg] + +NT1 = namedtuple("NT1", ["a", "a"]) # E?: duplicate field name + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +namedtuples_define_functional.py:53:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : collections.namedtuple argument 'def' is not a valid typename or field name. [invalid-namedtuple-arg] + +NT2 = namedtuple("NT2", ["abc", "def"]) # E?: illegal field name + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +namedtuples_define_functional.py:54:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : collections.namedtuple argument 'def' is not a valid typename or field name. [invalid-namedtuple-arg] + +NT3 = namedtuple("NT3", ["abc", "def"], rename=False) # E?: illegal field name + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +namedtuples_define_functional.py:63:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function collections.namedtuple was called with the wrong arguments [wrong-arg-types] + +NT5 = namedtuple("NT5", "a b c", defaults=(1, 2)) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ Line 66: Expected 1 errors -Line 63: Unexpected errors ['File "namedtuples_define_functional.py", line 63, in : Function collections.namedtuple was called with the wrong arguments [wrong-arg-types]'] +Line 63: Unexpected errors ['namedtuples_define_functional.py:63:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function collections.namedtuple was called with the wrong arguments [wrong-arg-types]'] """ diff --git a/conformance/results/pytype/namedtuples_type_compat.toml b/conformance/results/pytype/namedtuples_type_compat.toml index 240a90347..a649efd7f 100644 --- a/conformance/results/pytype/namedtuples_type_compat.toml +++ b/conformance/results/pytype/namedtuples_type_compat.toml @@ -1,7 +1,15 @@ conformant = "Pass" output = """ -File "namedtuples_type_compat.py", line 22, in : Type annotation for v3 does not match type of assignment [annotation-type-mismatch] -File "namedtuples_type_compat.py", line 23, in : Type annotation for v4 does not match type of assignment [annotation-type-mismatch] +namedtuples_type_compat.py:22:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for v3 does not match type of assignment [annotation-type-mismatch] + +v3: tuple[int, int] = p # E: too few elements +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +namedtuples_type_compat.py:23:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for v4 does not match type of assignment [annotation-type-mismatch] + +v4: tuple[int, str, str] = p # E: incompatible element type +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pytype/namedtuples_usage.toml b/conformance/results/pytype/namedtuples_usage.toml index d1a376f6b..91aabf28c 100644 --- a/conformance/results/pytype/namedtuples_usage.toml +++ b/conformance/results/pytype/namedtuples_usage.toml @@ -6,12 +6,36 @@ Does not reject attempt to overwrite named tuple entry by name. Does not reject attempt to delete named tuple entry by name. """ output = """ -File "namedtuples_usage.py", line 31, in : Union[int, str] [assert-type] -File "namedtuples_usage.py", line 32, in : Union[int, str] [assert-type] -File "namedtuples_usage.py", line 41, in : unsupported operand type(s) for item assignment: Point [unsupported-operands] -File "namedtuples_usage.py", line 43, in : unsupported operand type(s) for item deletion: Point [unsupported-operands] -File "namedtuples_usage.py", line 52, in : Cannot unpack 3 values into 2 variables [bad-unpacking] -File "namedtuples_usage.py", line 53, in : Cannot unpack 3 values into 4 variables [bad-unpacking] +namedtuples_usage.py:31:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Union[int, str] [assert-type] + +assert_type(p[-2], int) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +namedtuples_usage.py:32:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Union[int, str] [assert-type] + +assert_type(p[-3], int) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +namedtuples_usage.py:41:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : unsupported operand type(s) for item assignment: Point [unsupported-operands] + +p[0] = 3 # E +\u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m + +namedtuples_usage.py:43:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : unsupported operand type(s) for item deletion: Point [unsupported-operands] + +del p[0] # E + \u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m + +namedtuples_usage.py:52:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Cannot unpack 3 values into 2 variables [bad-unpacking] + +x2, y2 = p # E: too few values to unpack +\u001b[1m\u001b[31m~~~~~~\u001b[39m\u001b[0m + +namedtuples_usage.py:53:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Cannot unpack 3 values into 4 variables [bad-unpacking] + +x3, y3, unit3, other = p # E: too many values to unpack +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -19,6 +43,6 @@ Line 34: Expected 1 errors Line 35: Expected 1 errors Line 40: Expected 1 errors Line 42: Expected 1 errors -Line 31: Unexpected errors ['File "namedtuples_usage.py", line 31, in : Union[int, str] [assert-type]'] -Line 32: Unexpected errors ['File "namedtuples_usage.py", line 32, in : Union[int, str] [assert-type]'] +Line 31: Unexpected errors ['namedtuples_usage.py:31:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Union[int, str] [assert-type]'] +Line 32: Unexpected errors ['namedtuples_usage.py:32:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Union[int, str] [assert-type]'] """ diff --git a/conformance/results/pytype/narrowing_typeguard.toml b/conformance/results/pytype/narrowing_typeguard.toml index a95dd8d5e..da2f78df4 100644 --- a/conformance/results/pytype/narrowing_typeguard.toml +++ b/conformance/results/pytype/narrowing_typeguard.toml @@ -3,8 +3,16 @@ notes = """ Does not reject TypeGuard method with too few parameters. """ output = """ -File "narrowing_typeguard.py", line 128, in : Function takes_callable_str was called with the wrong arguments [wrong-arg-types] -File "narrowing_typeguard.py", line 148, in : Function takes_callable_str_proto was called with the wrong arguments [wrong-arg-types] +narrowing_typeguard.py:128:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function takes_callable_str was called with the wrong arguments [wrong-arg-types] + +takes_callable_str(simple_typeguard) # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +narrowing_typeguard.py:148:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function takes_callable_str_proto was called with the wrong arguments [wrong-arg-types] + +takes_callable_str_proto(simple_typeguard) # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ diff --git a/conformance/results/pytype/narrowing_typeis.toml b/conformance/results/pytype/narrowing_typeis.toml index 3af03cc86..e5f70078b 100644 --- a/conformance/results/pytype/narrowing_typeis.toml +++ b/conformance/results/pytype/narrowing_typeis.toml @@ -5,12 +5,38 @@ Does not reject covariant use of TypeIs. Does not reject TypeIs where return type is not consistent with input type due to variance. """ output = """ -File "narrowing_typeis.py", line 19, in func1: Tuple[str, ...] [assert-type] -File "narrowing_typeis.py", line 132, in : Function takes_callable_str was called with the wrong arguments [wrong-arg-types] -File "narrowing_typeis.py", line 152, in : Function takes_callable_str_proto was called with the wrong arguments [wrong-arg-types] -File "narrowing_typeis.py", line 169, in : Function takes_typeguard was called with the wrong arguments [wrong-arg-types] -File "narrowing_typeis.py", line 170, in : Function takes_typeis was called with the wrong arguments [wrong-arg-types] -File "narrowing_typeis.py", line 195, in : TypeIs[str] is not consistent with input type int [invalid-function-definition] +narrowing_typeis.py:19:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Tuple[str, ...] [assert-type] + + assert_type(names, tuple[str, str]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +narrowing_typeis.py:132:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function takes_callable_str was called with the wrong arguments [wrong-arg-types] + +takes_callable_str(simple_typeguard) # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +narrowing_typeis.py:152:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function takes_callable_str_proto was called with the wrong arguments [wrong-arg-types] + +takes_callable_str_proto(simple_typeguard) # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +narrowing_typeis.py:169:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function takes_typeguard was called with the wrong arguments [wrong-arg-types] + +takes_typeguard(is_int_typeis) # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +narrowing_typeis.py:170:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function takes_typeis was called with the wrong arguments [wrong-arg-types] + +takes_typeis(is_int_typeguard) # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +narrowing_typeis.py:195:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : TypeIs[str] is not consistent with input type int [invalid-function-definition] + +def bad_typeis(x: int) -> TypeIs[str]: # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + return isinstance(x, str) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -18,5 +44,5 @@ Line 105: Expected 1 errors Line 110: Expected 1 errors Line 191: Expected 1 errors Line 199: Expected 1 errors -Line 19: Unexpected errors ['File "narrowing_typeis.py", line 19, in func1: Tuple[str, ...] [assert-type]'] +Line 19: Unexpected errors ['narrowing_typeis.py:19:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: Tuple[str, ...] [assert-type]'] """ diff --git a/conformance/results/pytype/overloads_basic.toml b/conformance/results/pytype/overloads_basic.toml index 8d90cba20..06e69b8cb 100644 --- a/conformance/results/pytype/overloads_basic.toml +++ b/conformance/results/pytype/overloads_basic.toml @@ -4,14 +4,26 @@ Does not reject a function with a single @overload signature. Does not reject a function with @overload signature but no implementation. """ output = """ -File "overloads_basic.py", line 31, in __getitem__: bad return type [bad-return-type] -File "overloads_basic.py", line 37, in : unsupported operand type(s) for item retrieval: Bytes and str [unsupported-operands] -File "overloads_basic.py", line 58, in map: bad return type [bad-return-type] +overloads_basic.py:31:20: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __getitem__: bad return type [bad-return-type] + + return b"" + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +overloads_basic.py:37:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : unsupported operand type(s) for item retrieval: Bytes and str [unsupported-operands] + +b[""] # E: no matching overload +\u001b[1m\u001b[31m~~~~~\u001b[39m\u001b[0m + +overloads_basic.py:58:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in map: bad return type [bad-return-type] + + pass + \u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ Lines 62, 63: Expected error (tag 'func1') Lines 74, 75: Expected error (tag 'func2') -Line 31: Unexpected errors ['File "overloads_basic.py", line 31, in __getitem__: bad return type [bad-return-type]'] -Line 58: Unexpected errors ['File "overloads_basic.py", line 58, in map: bad return type [bad-return-type]'] +Line 31: Unexpected errors ['overloads_basic.py:31:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __getitem__: bad return type [bad-return-type]'] +Line 58: Unexpected errors ['overloads_basic.py:58:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in map: bad return type [bad-return-type]'] """ diff --git a/conformance/results/pytype/protocols_class_objects.toml b/conformance/results/pytype/protocols_class_objects.toml index 47965b7e5..f294b7008 100644 --- a/conformance/results/pytype/protocols_class_objects.toml +++ b/conformance/results/pytype/protocols_class_objects.toml @@ -5,8 +5,18 @@ Incorrectly reports some class objects as incompatible with a protocol. Fails to report some class objects as incompatible with a protocol. """ output = """ -File "protocols_class_objects.py", line 50, in method1: bad return type [bad-return-type] -File "protocols_class_objects.py", line 100, in : Function CMeta.__init__ was called with the wrong arguments [wrong-arg-types] +protocols_class_objects.py:50:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method1: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +protocols_class_objects.py:100:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function CMeta.__init__ was called with the wrong arguments [wrong-arg-types] + +class ConcreteC3(metaclass=CMeta): +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -18,6 +28,6 @@ Line 104: Expected 1 errors Line 106: Expected 1 errors Line 107: Expected 1 errors Line 108: Expected 1 errors -Line 50: Unexpected errors ['File "protocols_class_objects.py", line 50, in method1: bad return type [bad-return-type]'] -Line 100: Unexpected errors ['File "protocols_class_objects.py", line 100, in : Function CMeta.__init__ was called with the wrong arguments [wrong-arg-types]'] +Line 50: Unexpected errors ['protocols_class_objects.py:50:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method1: bad return type [bad-return-type]'] +Line 100: Unexpected errors ['protocols_class_objects.py:100:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function CMeta.__init__ was called with the wrong arguments [wrong-arg-types]'] """ diff --git a/conformance/results/pytype/protocols_definition.toml b/conformance/results/pytype/protocols_definition.toml index a50220bbd..0c6fb35eb 100644 --- a/conformance/results/pytype/protocols_definition.toml +++ b/conformance/results/pytype/protocols_definition.toml @@ -16,14 +16,46 @@ Does not reject immutable named tuple attribute in concrete class when protocol Does not reject immutable frozen dataclass attribute in concrete class when protocol attribute is mutable. """ output = """ -File "protocols_definition.py", line 30, in : Function close_all was called with the wrong arguments [wrong-arg-types] -File "protocols_definition.py", line 45, in third: bad return type [bad-return-type] -File "protocols_definition.py", line 114, in : Type annotation for v2_bad1 does not match type of assignment [annotation-type-mismatch] -File "protocols_definition.py", line 115, in : Type annotation for v2_bad2 does not match type of assignment [annotation-type-mismatch] -File "protocols_definition.py", line 156, in : Type annotation for v3_bad1 does not match type of assignment [annotation-type-mismatch] -File "protocols_definition.py", line 159, in : Type annotation for v3_bad4 does not match type of assignment [annotation-type-mismatch] -File "protocols_definition.py", line 218, in : Type annotation for v4_bad1 does not match type of assignment [annotation-type-mismatch] -File "protocols_definition.py", line 219, in : Type annotation for v4_bad2 does not match type of assignment [annotation-type-mismatch] +protocols_definition.py:30:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function close_all was called with the wrong arguments [wrong-arg-types] + +close_all([1]) # E: 'int' has no 'close' method +\u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +protocols_definition.py:45:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in third: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +protocols_definition.py:114:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for v2_bad1 does not match type of assignment [annotation-type-mismatch] + +v2_bad1: Template2 = Concrete2_Bad1() # E +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +protocols_definition.py:115:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for v2_bad2 does not match type of assignment [annotation-type-mismatch] + +v2_bad2: Template2 = Concrete2_Bad2() # E +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +protocols_definition.py:156:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for v3_bad1 does not match type of assignment [annotation-type-mismatch] + +v3_bad1: Template3 = Concrete3_Bad1() # E +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +protocols_definition.py:159:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for v3_bad4 does not match type of assignment [annotation-type-mismatch] + +v3_bad4: Template3 = Concrete3_Bad4() # E +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +protocols_definition.py:218:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for v4_bad1 does not match type of assignment [annotation-type-mismatch] + +v4_bad1: Template4 = Concrete4_Bad1() # E +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +protocols_definition.py:219:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for v4_bad2 does not match type of assignment [annotation-type-mismatch] + +v4_bad2: Template4 = Concrete4_Bad2() # E +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -41,5 +73,5 @@ Line 289: Expected 1 errors Line 339: Expected 1 errors Line 340: Expected 1 errors Line 341: Expected 1 errors -Line 45: Unexpected errors ['File "protocols_definition.py", line 45, in third: bad return type [bad-return-type]'] +Line 45: Unexpected errors ['protocols_definition.py:45:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in third: bad return type [bad-return-type]'] """ diff --git a/conformance/results/pytype/protocols_explicit.toml b/conformance/results/pytype/protocols_explicit.toml index 8432b87e8..5dbd6b44e 100644 --- a/conformance/results/pytype/protocols_explicit.toml +++ b/conformance/results/pytype/protocols_explicit.toml @@ -7,11 +7,23 @@ Does not reject instantiation of class that derives from protocol but doesn't im Does not report instantiation of class that derives from protocol but doesn't implement method. """ output = """ -File "protocols_explicit.py", line 14, in draw: bad return type [bad-return-type] +protocols_explicit.py:14:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in draw: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + Called from (traceback): line 27, in draw -File "protocols_explicit.py", line 60, in : Can't instantiate Point with abstract methods intensity [not-instantiable] -File "protocols_explicit.py", line 165, in : Can't instantiate Concrete7A with abstract methods method1 [not-instantiable] +protocols_explicit.py:60:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Can't instantiate Point with abstract methods intensity [not-instantiable] + +p = Point(0, 0, "") # E: Cannot instantiate abstract class + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +protocols_explicit.py:165:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Can't instantiate Concrete7A with abstract methods method1 [not-instantiable] + +c7a = Concrete7A() # E: cannot instantiate abstract class + \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -20,5 +32,5 @@ Line 56: Expected 1 errors Line 90: Expected 1 errors Line 110: Expected 1 errors Line 135: Expected 1 errors -Line 14: Unexpected errors ['File "protocols_explicit.py", line 14, in draw: bad return type [bad-return-type]'] +Line 14: Unexpected errors ['protocols_explicit.py:14:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in draw: bad return type [bad-return-type]'] """ diff --git a/conformance/results/pytype/protocols_generic.toml b/conformance/results/pytype/protocols_generic.toml index c2d3728ac..2ab4a9378 100644 --- a/conformance/results/pytype/protocols_generic.toml +++ b/conformance/results/pytype/protocols_generic.toml @@ -5,21 +5,55 @@ Does not correctly enforce invariance in protocol type compatibility tests. Does not detect protocol mismatch when method-scoped TypeVar is used in protocol. """ output = """ -File "protocols_generic.py", line 12, in : argument "covariant" to TypeVar not supported yet [not-supported-yet] -File "protocols_generic.py", line 13, in : argument "contravariant" to TypeVar not supported yet [not-supported-yet] -File "protocols_generic.py", line 40, in : Type annotation for p2 does not match type of assignment [annotation-type-mismatch] -File "protocols_generic.py", line 44, in : Invalid type annotation 'Proto2' [invalid-annotation] -File "protocols_generic.py", line 56, in func1: Type annotation for v2 does not match type of assignment [annotation-type-mismatch] -File "protocols_generic.py", line 65, in func2: Type annotation for v1 does not match type of assignment [annotation-type-mismatch] -File "protocols_generic.py", line 75, in func3: Type annotation for v2 does not match type of assignment [annotation-type-mismatch] -File "protocols_generic.py", line 146, in : Type annotation for hp3 does not match type of assignment [annotation-type-mismatch] +protocols_generic.py:12:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet] + +T_co = TypeVar("T_co", covariant=True) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +protocols_generic.py:13:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "contravariant" to TypeVar not supported yet [not-supported-yet] + +T_contra = TypeVar("T_contra", contravariant=True) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +protocols_generic.py:40:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for p2 does not match type of assignment [annotation-type-mismatch] + +p2: Proto1[int, str] = Concrete1() # E: incompatible type +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +protocols_generic.py:44:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Proto2' [invalid-annotation] + +class Proto2(Protocol[T_co], Generic[T_co]): # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +protocols_generic.py:56:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Type annotation for v2 does not match type of assignment [annotation-type-mismatch] + + v2: Box[int] = box_float # E + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +protocols_generic.py:65:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func2: Type annotation for v1 does not match type of assignment [annotation-type-mismatch] + + v1: Sender[int] = sender_float # OK + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +protocols_generic.py:75:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func3: Type annotation for v2 does not match type of assignment [annotation-type-mismatch] + + v2: AttrProto[int] = attr_float # E + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +protocols_generic.py:146:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for hp3 does not match type of assignment [annotation-type-mismatch] + +hp3: HasPropertyProto = ConcreteHasProperty3() # E +\u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ Line 66: Expected 1 errors Line 74: Expected 1 errors Line 147: Expected 1 errors -Line 12: Unexpected errors ['File "protocols_generic.py", line 12, in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] -Line 13: Unexpected errors ['File "protocols_generic.py", line 13, in : argument "contravariant" to TypeVar not supported yet [not-supported-yet]'] -Line 65: Unexpected errors ['File "protocols_generic.py", line 65, in func2: Type annotation for v1 does not match type of assignment [annotation-type-mismatch]'] +Line 12: Unexpected errors ['protocols_generic.py:12:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] +Line 13: Unexpected errors ['protocols_generic.py:13:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "contravariant" to TypeVar not supported yet [not-supported-yet]'] +Line 65: Unexpected errors ['protocols_generic.py:65:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func2: Type annotation for v1 does not match type of assignment [annotation-type-mismatch]'] """ diff --git a/conformance/results/pytype/protocols_merging.toml b/conformance/results/pytype/protocols_merging.toml index bf9e4eab4..a3102a965 100644 --- a/conformance/results/pytype/protocols_merging.toml +++ b/conformance/results/pytype/protocols_merging.toml @@ -4,11 +4,31 @@ Does not reject a protocol class that derives from a non-protocol class. Does not report attempt to instantiate abstract class downgraded from protocol class. """ output = """ -File "protocols_merging.py", line 52, in : Type annotation for s6 does not match type of assignment [annotation-type-mismatch] -File "protocols_merging.py", line 53, in : Type annotation for s7 does not match type of assignment [annotation-type-mismatch] -File "protocols_merging.py", line 54, in : Type annotation for s8 does not match type of assignment [annotation-type-mismatch] -File "protocols_merging.py", line 82, in : Can't instantiate SizedAndClosable4 with abstract methods close [not-instantiable] -File "protocols_merging.py", line 83, in : Type annotation for y does not match type of assignment [annotation-type-mismatch] +protocols_merging.py:52:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for s6 does not match type of assignment [annotation-type-mismatch] + +s6: SizedAndClosable1 = SCConcrete2() # E: doesn't implement close +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +protocols_merging.py:53:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for s7 does not match type of assignment [annotation-type-mismatch] + +s7: SizedAndClosable2 = SCConcrete2() # E: doesn't implement close +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +protocols_merging.py:54:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for s8 does not match type of assignment [annotation-type-mismatch] + +s8: SizedAndClosable3 = SCConcrete2() # E: SizedAndClosable3 is not a protocol +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +protocols_merging.py:82:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Can't instantiate SizedAndClosable4 with abstract methods close [not-instantiable] + +x = SizedAndClosable4() # E: cannot instantiate abstract class + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +protocols_merging.py:83:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for y does not match type of assignment [annotation-type-mismatch] + +y: SizedAndClosable4 = SCConcrete1() # E +\u001b[1m\u001b[31m~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ diff --git a/conformance/results/pytype/protocols_modules.toml b/conformance/results/pytype/protocols_modules.toml index 1c5af9060..77c9ae318 100644 --- a/conformance/results/pytype/protocols_modules.toml +++ b/conformance/results/pytype/protocols_modules.toml @@ -3,14 +3,22 @@ notes = """ Does not report incompatibilities for protocol methods. """ output = """ -File "protocols_modules.py", line 10, in : Can't find module '_protocols_modules1'. [import-error] -File "protocols_modules.py", line 11, in : Can't find module '_protocols_modules2'. [import-error] +protocols_modules.py:10:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Can't find module '_protocols_modules1'. [import-error] + +import _protocols_modules1 +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +protocols_modules.py:11:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Can't find module '_protocols_modules2'. [import-error] + +import _protocols_modules2 +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ Line 26: Expected 1 errors Line 48: Expected 1 errors Line 49: Expected 1 errors -Line 10: Unexpected errors ['File "protocols_modules.py", line 10, in : Can\\'t find module \\'_protocols_modules1\\'. [import-error]'] -Line 11: Unexpected errors ['File "protocols_modules.py", line 11, in : Can\\'t find module \\'_protocols_modules2\\'. [import-error]'] +Line 10: Unexpected errors ["protocols_modules.py:10:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Can't find module '_protocols_modules1'. [import-error]"] +Line 11: Unexpected errors ["protocols_modules.py:11:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Can't find module '_protocols_modules2'. [import-error]"] """ diff --git a/conformance/results/pytype/protocols_recursive.toml b/conformance/results/pytype/protocols_recursive.toml index 05142931d..419fa160b 100644 --- a/conformance/results/pytype/protocols_recursive.toml +++ b/conformance/results/pytype/protocols_recursive.toml @@ -3,13 +3,25 @@ notes = """ Incorrectly reports type error for some recursive protocols. """ output = """ -File "protocols_recursive.py", line 11, in : argument "covariant" to TypeVar not supported yet [not-supported-yet] -File "protocols_recursive.py", line 12, in : argument "contravariant" to TypeVar not supported yet [not-supported-yet] -File "protocols_recursive.py", line 81, in : Any [assert-type] +protocols_recursive.py:11:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet] + +T_co = TypeVar("T_co", covariant=True) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +protocols_recursive.py:12:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "contravariant" to TypeVar not supported yet [not-supported-yet] + +T_contra = TypeVar("T_contra", contravariant=True) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +protocols_recursive.py:81:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Any [assert-type] + +assert_type(v1, list[int]) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ -Line 11: Unexpected errors ['File "protocols_recursive.py", line 11, in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] -Line 12: Unexpected errors ['File "protocols_recursive.py", line 12, in : argument "contravariant" to TypeVar not supported yet [not-supported-yet]'] -Line 81: Unexpected errors ['File "protocols_recursive.py", line 81, in : Any [assert-type]'] +Line 11: Unexpected errors ['protocols_recursive.py:11:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] +Line 12: Unexpected errors ['protocols_recursive.py:12:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "contravariant" to TypeVar not supported yet [not-supported-yet]'] +Line 81: Unexpected errors ['protocols_recursive.py:81:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Any [assert-type]'] """ diff --git a/conformance/results/pytype/protocols_self.toml b/conformance/results/pytype/protocols_self.toml index ec7dd2b3e..a6a63cb46 100644 --- a/conformance/results/pytype/protocols_self.toml +++ b/conformance/results/pytype/protocols_self.toml @@ -3,15 +3,31 @@ notes = """ Does not properly handle Self type within a protocol. """ output = """ -File "protocols_self.py", line 36, in : argument "covariant" to TypeVar not supported yet [not-supported-yet] -File "protocols_self.py", line 37, in : argument "covariant" to TypeVar not supported yet [not-supported-yet] -File "protocols_self.py", line 72, in : Type annotation for a2 does not match type of assignment [annotation-type-mismatch] -File "protocols_self.py", line 73, in : Type annotation for b2 does not match type of assignment [annotation-type-mismatch] +protocols_self.py:36:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet] + +T1_co = TypeVar("T1_co", covariant=True) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +protocols_self.py:37:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet] + +T2_co = TypeVar("T2_co", covariant=True) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +protocols_self.py:72:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for a2 does not match type of assignment [annotation-type-mismatch] + +a2: P2Parent[str] = C2[str]() # OK +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +protocols_self.py:73:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for b2 does not match type of assignment [annotation-type-mismatch] + +b2: P2Child[str] = C2[str]() # OK +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ -Line 36: Unexpected errors ['File "protocols_self.py", line 36, in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] -Line 37: Unexpected errors ['File "protocols_self.py", line 37, in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] -Line 72: Unexpected errors ['File "protocols_self.py", line 72, in : Type annotation for a2 does not match type of assignment [annotation-type-mismatch]'] -Line 73: Unexpected errors ['File "protocols_self.py", line 73, in : Type annotation for b2 does not match type of assignment [annotation-type-mismatch]'] +Line 36: Unexpected errors ['protocols_self.py:36:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] +Line 37: Unexpected errors ['protocols_self.py:37:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] +Line 72: Unexpected errors ['protocols_self.py:72:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for a2 does not match type of assignment [annotation-type-mismatch]'] +Line 73: Unexpected errors ['protocols_self.py:73:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for b2 does not match type of assignment [annotation-type-mismatch]'] """ diff --git a/conformance/results/pytype/protocols_subtyping.toml b/conformance/results/pytype/protocols_subtyping.toml index c364fc59a..2908ac1b0 100644 --- a/conformance/results/pytype/protocols_subtyping.toml +++ b/conformance/results/pytype/protocols_subtyping.toml @@ -4,10 +4,26 @@ Does not reject attempt to instantiate protocol class. Does not report some protocol type compatibility violations involving contravariance. """ output = """ -File "protocols_subtyping.py", line 38, in func1: Type annotation for v2 does not match type of assignment [annotation-type-mismatch] -File "protocols_subtyping.py", line 55, in func2: Type annotation for v2 does not match type of assignment [annotation-type-mismatch] -File "protocols_subtyping.py", line 83, in : argument "covariant" to TypeVar not supported yet [not-supported-yet] -File "protocols_subtyping.py", line 84, in : argument "contravariant" to TypeVar not supported yet [not-supported-yet] +protocols_subtyping.py:38:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Type annotation for v2 does not match type of assignment [annotation-type-mismatch] + + v2: Concrete2 = p2 # E + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +protocols_subtyping.py:55:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func2: Type annotation for v2 does not match type of assignment [annotation-type-mismatch] + + v2: Proto3 = p2 # E + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +protocols_subtyping.py:83:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet] + +S_co = TypeVar("S_co", covariant=True) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +protocols_subtyping.py:84:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "contravariant" to TypeVar not supported yet [not-supported-yet] + +T_contra = TypeVar("T_contra", contravariant=True) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -16,6 +32,6 @@ Line 79: Expected 1 errors Line 80: Expected 1 errors Line 102: Expected 1 errors Line 103: Expected 1 errors -Line 83: Unexpected errors ['File "protocols_subtyping.py", line 83, in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] -Line 84: Unexpected errors ['File "protocols_subtyping.py", line 84, in : argument "contravariant" to TypeVar not supported yet [not-supported-yet]'] +Line 83: Unexpected errors ['protocols_subtyping.py:83:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] +Line 84: Unexpected errors ['protocols_subtyping.py:84:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "contravariant" to TypeVar not supported yet [not-supported-yet]'] """ diff --git a/conformance/results/pytype/protocols_variance.toml b/conformance/results/pytype/protocols_variance.toml index 9eb9e2845..a3089e61a 100644 --- a/conformance/results/pytype/protocols_variance.toml +++ b/conformance/results/pytype/protocols_variance.toml @@ -3,9 +3,21 @@ notes = """ Does not detect incorrect TypeVar variance within generic protocols. """ output = """ -File "protocols_variance.py", line 12, in : argument "covariant" to TypeVar not supported yet [not-supported-yet] -File "protocols_variance.py", line 13, in : argument "contravariant" to TypeVar not supported yet [not-supported-yet] -File "protocols_variance.py", line 15, in : argument "covariant" to TypeVar not supported yet [not-supported-yet] +protocols_variance.py:12:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet] + +T1_co = TypeVar("T1_co", covariant=True) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +protocols_variance.py:13:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "contravariant" to TypeVar not supported yet [not-supported-yet] + +T1_contra = TypeVar("T1_contra", contravariant=True) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +protocols_variance.py:15:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet] + +R = TypeVar("R", covariant=True) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -16,7 +28,7 @@ Line 61: Expected 1 errors Line 66: Expected 1 errors Line 71: Expected 1 errors Line 104: Expected 1 errors -Line 12: Unexpected errors ['File "protocols_variance.py", line 12, in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] -Line 13: Unexpected errors ['File "protocols_variance.py", line 13, in : argument "contravariant" to TypeVar not supported yet [not-supported-yet]'] -Line 15: Unexpected errors ['File "protocols_variance.py", line 15, in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] +Line 12: Unexpected errors ['protocols_variance.py:12:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] +Line 13: Unexpected errors ['protocols_variance.py:13:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "contravariant" to TypeVar not supported yet [not-supported-yet]'] +Line 15: Unexpected errors ['protocols_variance.py:15:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] """ diff --git a/conformance/results/pytype/qualifiers_annotated.toml b/conformance/results/pytype/qualifiers_annotated.toml index 9a0642022..4b5d16f83 100644 --- a/conformance/results/pytype/qualifiers_annotated.toml +++ b/conformance/results/pytype/qualifiers_annotated.toml @@ -6,17 +6,61 @@ Does not reject call of Annotated. Does not allow TypeVar to be used in type alias when wrapped with Annotated. """ output = """ -File "qualifiers_annotated.py", line 43, in : Invalid type annotation '[int, str]' for Bad1 [invalid-annotation] -File "qualifiers_annotated.py", line 44, in : Invalid type annotation '((int, str),)' for Bad2 [invalid-annotation] -File "qualifiers_annotated.py", line 45, in : Invalid type annotation '' for Bad3 [invalid-annotation] -File "qualifiers_annotated.py", line 46, in : Invalid type annotation "{'a': 'b'}" for Bad4 [invalid-annotation] -File "qualifiers_annotated.py", line 50, in : Name 'var1' is not defined [name-error] -File "qualifiers_annotated.py", line 51, in : Invalid type annotation 'True' for Bad9 [invalid-annotation] -File "qualifiers_annotated.py", line 52, in : Invalid type annotation '1' for Bad10 [invalid-annotation] -File "qualifiers_annotated.py", line 54, in : Invalid type annotation '' for Bad12 [invalid-annotation] -File "qualifiers_annotated.py", line 64, in : Invalid type annotation 'Annotated' [invalid-annotation] -File "qualifiers_annotated.py", line 91, in : 'Annotated' object is not callable [not-callable] -File "qualifiers_annotated.py", line 121, in : Invalid TypeVar: TypeVar('T') must be stored as 'T', not 'TA3' [invalid-typevar] +qualifiers_annotated.py:43:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '[int, str]' for Bad1 [invalid-annotation] + +Bad1: Annotated[[int, str], ""] # E: invalid type expression +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +qualifiers_annotated.py:44:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '((int, str),)' for Bad2 [invalid-annotation] + +Bad2: Annotated[((int, str),), ""] # E: invalid type expression +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +qualifiers_annotated.py:45:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' for Bad3 [invalid-annotation] + +Bad3: Annotated[[int for i in range(1)], ""] # E: invalid type expression +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +qualifiers_annotated.py:46:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation "{'a': 'b'}" for Bad4 [invalid-annotation] + +Bad4: Annotated[{"a": "b"}, ""] # E: invalid type expression +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +qualifiers_annotated.py:50:17: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Name 'var1' is not defined [name-error] + +Bad8: Annotated[var1, ""] # E: invalid type expression + \u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m + +qualifiers_annotated.py:51:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'True' for Bad9 [invalid-annotation] + +Bad9: Annotated[True, ""] # E: invalid type expression +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +qualifiers_annotated.py:52:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '1' for Bad10 [invalid-annotation] + +Bad10: Annotated[1, ""] # E: invalid type expression +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +qualifiers_annotated.py:54:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' for Bad12 [invalid-annotation] + +Bad12: Annotated[f"{'int'}", ""] # E: invalid type expression +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +qualifiers_annotated.py:64:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Annotated' [invalid-annotation] + +Bad13: Annotated[int] # E: requires at least two arguments + \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +qualifiers_annotated.py:91:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : 'Annotated' object is not callable [not-callable] + +Annotated() # E +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +qualifiers_annotated.py:121:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid TypeVar: TypeVar('T') must be stored as 'T', not 'TA3' [invalid-typevar] + +TA3 = Annotated[T, ""] +\u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -30,5 +74,5 @@ Line 84: Expected 1 errors Line 85: Expected 1 errors Line 92: Expected 1 errors Line 93: Expected 1 errors -Line 121: Unexpected errors ['File "qualifiers_annotated.py", line 121, in : Invalid TypeVar: TypeVar(\\'T\\') must be stored as \\'T\\', not \\'TA3\\' [invalid-typevar]'] +Line 121: Unexpected errors ["qualifiers_annotated.py:121:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid TypeVar: TypeVar('T') must be stored as 'T', not 'TA3' [invalid-typevar]"] """ diff --git a/conformance/results/pytype/qualifiers_final_annotation.toml b/conformance/results/pytype/qualifiers_final_annotation.toml index 9d3a3d450..59ff384d8 100644 --- a/conformance/results/pytype/qualifiers_final_annotation.toml +++ b/conformance/results/pytype/qualifiers_final_annotation.toml @@ -6,24 +6,109 @@ Does not reject modification of global variable declared Final. Does not reject modification of local variable declared Final. """ output = """ -File "qualifiers_final_annotation.py", line 18, in : Invalid type annotation 'Final[str, int]' [invalid-annotation] -File "qualifiers_final_annotation.py", line 18, in : Invalid type annotation 'Final' [invalid-annotation] -File "qualifiers_final_annotation.py", line 54, in __init__: Assigning to attribute ID5, which was annotated with Final [final-error] -File "qualifiers_final_annotation.py", line 65, in method1: Assigning to attribute ID7, which was annotated with Final [final-error] -File "qualifiers_final_annotation.py", line 67, in method1: Assigning to attribute ID7, which was annotated with Final [final-error] -File "qualifiers_final_annotation.py", line 71, in : Assigning to variable RATE, which was annotated with Final [final-error] -File "qualifiers_final_annotation.py", line 81, in : Assigning to attribute DEFAULT_ID, which was annotated with Final [final-error] -File "qualifiers_final_annotation.py", line 93, in : Class ClassCChild overrides final class attribute BORDER_WIDTH, defined in base class ClassC [final-error] -File "qualifiers_final_annotation.py", line 107, in ClassD: Type annotation for VALUE2 does not match type of assignment [annotation-type-mismatch] -File "qualifiers_final_annotation.py", line 107, in ClassD: Invalid use of typing.Final [final-error] -File "qualifiers_final_annotation.py", line 107, in ClassD: Invalid type annotation 'ClassVar[Final]' [invalid-annotation] -File "qualifiers_final_annotation.py", line 108, in ClassD: Type annotation for VALUE3 does not match type of assignment [annotation-type-mismatch] -File "qualifiers_final_annotation.py", line 118, in : Invalid use of typing.Final [final-error] -File "qualifiers_final_annotation.py", line 118, in : Invalid type annotation 'list[Final[int]]' [invalid-annotation] -File "qualifiers_final_annotation.py", line 121, in : Invalid use of typing.Final [final-error] -File "qualifiers_final_annotation.py", line 134, in : Invalid keyword argument a to function N.__new__ [wrong-keyword-args] -File "qualifiers_final_annotation.py", line 135, in : Function N.__new__ was called with the wrong arguments [wrong-arg-types] -File "qualifiers_final_annotation.py", line 145, in func2: Assigning to variable x, which was annotated with Final [final-error] +qualifiers_final_annotation.py:18:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Final[str, int]' [invalid-annotation] + +BAD2: Final[str, int] = "" # E: only one type argument allowed +\u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m + +qualifiers_final_annotation.py:18:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Final' [invalid-annotation] + +BAD2: Final[str, int] = "" # E: only one type argument allowed + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +qualifiers_final_annotation.py:54:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __init__: Assigning to attribute ID5, which was annotated with Final [final-error] + + self.ID5 = 0 # E: Already initialized + \u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +qualifiers_final_annotation.py:65:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method1: Assigning to attribute ID7, which was annotated with Final [final-error] + + self.ID7 = 0 # E: cannot modify Final value + \u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +qualifiers_final_annotation.py:67:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method1: Assigning to attribute ID7, which was annotated with Final [final-error] + + self.ID7 += 1 # E: cannot modify Final value + \u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +qualifiers_final_annotation.py:71:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Assigning to variable RATE, which was annotated with Final [final-error] + +RATE = 300 # E: Cannot redefine Final value +\u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m + +qualifiers_final_annotation.py:81:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Assigning to attribute DEFAULT_ID, which was annotated with Final [final-error] + +ClassB.DEFAULT_ID = 0 # E: Cannot redefined value +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +qualifiers_final_annotation.py:93:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Class ClassCChild overrides final class attribute BORDER_WIDTH, defined in base class ClassC [final-error] + +class ClassCChild(ClassC): +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + BORDER_WIDTH = 2.5 # E: Cannot override Final value +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + __private = 0 # OK +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +qualifiers_final_annotation.py:107:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassD: Type annotation for VALUE2 does not match type of assignment [annotation-type-mismatch] + + VALUE2: ClassVar[Final] = 1 # E: Final cannot be used with ClassVar + \u001b[1m\u001b[31m~~~~~~\u001b[39m\u001b[0m + +qualifiers_final_annotation.py:107:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassD: Invalid use of typing.Final [final-error] + + VALUE2: ClassVar[Final] = 1 # E: Final cannot be used with ClassVar + \u001b[1m\u001b[31m~~~~~~\u001b[39m\u001b[0m + +qualifiers_final_annotation.py:107:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassD: Invalid use of typing.Final [final-error] + + VALUE2: ClassVar[Final] = 1 # E: Final cannot be used with ClassVar + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +qualifiers_final_annotation.py:107:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassD: Invalid type annotation 'ClassVar[Final]' [invalid-annotation] + + VALUE2: ClassVar[Final] = 1 # E: Final cannot be used with ClassVar + \u001b[1m\u001b[31m~~~~~~\u001b[39m\u001b[0m + +qualifiers_final_annotation.py:108:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassD: Type annotation for VALUE3 does not match type of assignment [annotation-type-mismatch] + + VALUE3: Final[ClassVar] = 1 # E: Final cannot be used with ClassVar + \u001b[1m\u001b[31m~~~~~~\u001b[39m\u001b[0m + +qualifiers_final_annotation.py:118:4: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid use of typing.Final [final-error] + +x: list[Final[int]] = [] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +qualifiers_final_annotation.py:118:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'list[Final[int]]' [invalid-annotation] + +x: list[Final[int]] = [] # E +\u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +qualifiers_final_annotation.py:121:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid use of typing.Final [final-error] + +def func1(x: Final[list[int]]) -> None: # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +qualifiers_final_annotation.py:134:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid keyword argument a to function N.__new__ [wrong-keyword-args] + +N(a=1) # E +\u001b[1m\u001b[31m~~~~~~\u001b[39m\u001b[0m + +qualifiers_final_annotation.py:135:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function N.__new__ was called with the wrong arguments [wrong-arg-types] + +N(x="", y="") # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +qualifiers_final_annotation.py:145:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func2: Assigning to variable x, which was annotated with Final [final-error] + + x += 1 # E: cannot modify Final value + \u001b[1m\u001b[31m~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -38,5 +123,5 @@ Line 147: Expected 1 errors Line 149: Expected 1 errors Line 152: Expected 1 errors Line 155: Expected 1 errors -Line 93: Unexpected errors ['File "qualifiers_final_annotation.py", line 93, in : Class ClassCChild overrides final class attribute BORDER_WIDTH, defined in base class ClassC [final-error]'] +Line 93: Unexpected errors ['qualifiers_final_annotation.py:93:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Class ClassCChild overrides final class attribute BORDER_WIDTH, defined in base class ClassC [final-error]'] """ diff --git a/conformance/results/pytype/qualifiers_final_decorator.toml b/conformance/results/pytype/qualifiers_final_decorator.toml index ca2fa29cd..3910ac781 100644 --- a/conformance/results/pytype/qualifiers_final_decorator.toml +++ b/conformance/results/pytype/qualifiers_final_decorator.toml @@ -4,19 +4,247 @@ Does not report error for overloaded @final method defined in stub file. Does not report error for overload that is marked @final when implementation is not. """ output = """ -File "qualifiers_final_decorator.py", line 8, in : Couldn't import pyi for '_qualifiers_final_decorator' [pyi-error] -File "qualifiers_final_decorator.py", line 21, in : Cannot subclass final class: Base1 [final-error] -File "qualifiers_final_decorator.py", line 52, in method4: bad return type [bad-return-type] -File "qualifiers_final_decorator.py", line 55, in : Class Derived2 overrides final method method4, defined in base class Base2 [final-error] -File "qualifiers_final_decorator.py", line 55, in : Class Derived2 overrides final method method3, defined in base class Base2 [final-error] -File "qualifiers_final_decorator.py", line 55, in : Class Derived2 overrides final method method2, defined in base class Base2 [final-error] -File "qualifiers_final_decorator.py", line 55, in : Class Derived2 overrides final method method1, defined in base class Base2 [final-error] -File "qualifiers_final_decorator.py", line 76, in method4: bad return type [bad-return-type] -File "qualifiers_final_decorator.py", line 90, in method: bad return type [bad-return-type] -File "qualifiers_final_decorator.py", line 103, in method: bad return type [bad-return-type] -File "qualifiers_final_decorator.py", line 117, in : Class Derived5 overrides final method method, defined in base class Base5_2 [final-error] -File "qualifiers_final_decorator.py", line 118, in Derived5: Overriding method signature mismatch [signature-mismatch] -File "qualifiers_final_decorator.py", line 125, in : Cannot apply @final decorator to func1 [final-error] +qualifiers_final_decorator.py:8:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Couldn't import pyi for '_qualifiers_final_decorator' [pyi-error] + +from _qualifiers_final_decorator import Base3, Base4 +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +qualifiers_final_decorator.py:21:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Cannot subclass final class: Base1 [final-error] + +class Derived1(Base1): # E: Cannot inherit from final class "Base" +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +qualifiers_final_decorator.py:52:16: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method4: bad return type [bad-return-type] + + return 0 + \u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +qualifiers_final_decorator.py:55:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Class Derived2 overrides final method method4, defined in base class Base2 [final-error] + +class Derived2(Base2): +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + def method1(self) -> None: # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + @classmethod # E[method2] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + def method2(cls) -> None: # E[method2] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + @staticmethod # E[method3] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + def method3() -> None: # E[method3] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + @overload # E[method4] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + def method4(self, x: int) -> int: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + @overload +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + def method4(self, x: str) -> str: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + def method4(self, x: int | str) -> int | str: # E[method4] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + return 0 +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +qualifiers_final_decorator.py:55:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Class Derived2 overrides final method method3, defined in base class Base2 [final-error] + +class Derived2(Base2): +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + def method1(self) -> None: # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + @classmethod # E[method2] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + def method2(cls) -> None: # E[method2] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + @staticmethod # E[method3] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + def method3() -> None: # E[method3] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + @overload # E[method4] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + def method4(self, x: int) -> int: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + @overload +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + def method4(self, x: str) -> str: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + def method4(self, x: int | str) -> int | str: # E[method4] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + return 0 +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +qualifiers_final_decorator.py:55:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Class Derived2 overrides final method method2, defined in base class Base2 [final-error] + +class Derived2(Base2): +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + def method1(self) -> None: # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + @classmethod # E[method2] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + def method2(cls) -> None: # E[method2] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + @staticmethod # E[method3] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + def method3() -> None: # E[method3] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + @overload # E[method4] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + def method4(self, x: int) -> int: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + @overload +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + def method4(self, x: str) -> str: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + def method4(self, x: int | str) -> int | str: # E[method4] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + return 0 +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +qualifiers_final_decorator.py:55:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Class Derived2 overrides final method method1, defined in base class Base2 [final-error] + +class Derived2(Base2): +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + def method1(self) -> None: # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + @classmethod # E[method2] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + def method2(cls) -> None: # E[method2] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + @staticmethod # E[method3] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + def method3() -> None: # E[method3] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + @overload # E[method4] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + def method4(self, x: int) -> int: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + @overload +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + def method4(self, x: str) -> str: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + def method4(self, x: int | str) -> int | str: # E[method4] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + return 0 +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +qualifiers_final_decorator.py:76:16: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method4: bad return type [bad-return-type] + + return 0 + \u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +qualifiers_final_decorator.py:90:16: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method: bad return type [bad-return-type] + + return 0 + \u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +qualifiers_final_decorator.py:103:16: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method: bad return type [bad-return-type] + + return 0 + \u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +qualifiers_final_decorator.py:117:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Class Derived5 overrides final method method, defined in base class Base5_2 [final-error] + +class Derived5(Base5_1, Base5_2): +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + def method(self) -> None: # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +qualifiers_final_decorator.py:118:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Derived5: Overriding method signature mismatch [signature-mismatch] + + def method(self) -> None: # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +qualifiers_final_decorator.py:125:2: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Cannot apply @final decorator to func1 [final-error] + +@final # E[func]: not allowed on non-method function. + \u001b[1m\u001b[31m~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -27,11 +255,11 @@ Lines 67, 75: Expected error (tag 'method4') Lines 80, 89: Expected error (tag 'Derived3') Lines 84, 85, 86: Expected error (tag 'Derived3-2') Lines 94, 102: Expected error (tag 'Derived4') -Line 8: Unexpected errors ['File "qualifiers_final_decorator.py", line 8, in : Couldn\\'t import pyi for \\'_qualifiers_final_decorator\\' [pyi-error]'] -Line 52: Unexpected errors ['File "qualifiers_final_decorator.py", line 52, in method4: bad return type [bad-return-type]'] -Line 55: Unexpected errors ['File "qualifiers_final_decorator.py", line 55, in : Class Derived2 overrides final method method4, defined in base class Base2 [final-error]', 'File "qualifiers_final_decorator.py", line 55, in : Class Derived2 overrides final method method3, defined in base class Base2 [final-error]', 'File "qualifiers_final_decorator.py", line 55, in : Class Derived2 overrides final method method2, defined in base class Base2 [final-error]', 'File "qualifiers_final_decorator.py", line 55, in : Class Derived2 overrides final method method1, defined in base class Base2 [final-error]'] -Line 76: Unexpected errors ['File "qualifiers_final_decorator.py", line 76, in method4: bad return type [bad-return-type]'] -Line 90: Unexpected errors ['File "qualifiers_final_decorator.py", line 90, in method: bad return type [bad-return-type]'] -Line 103: Unexpected errors ['File "qualifiers_final_decorator.py", line 103, in method: bad return type [bad-return-type]'] -Line 117: Unexpected errors ['File "qualifiers_final_decorator.py", line 117, in : Class Derived5 overrides final method method, defined in base class Base5_2 [final-error]'] +Line 8: Unexpected errors ["qualifiers_final_decorator.py:8:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Couldn't import pyi for '_qualifiers_final_decorator' [pyi-error]"] +Line 52: Unexpected errors ['qualifiers_final_decorator.py:52:16: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method4: bad return type [bad-return-type]'] +Line 55: Unexpected errors ['qualifiers_final_decorator.py:55:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Class Derived2 overrides final method method4, defined in base class Base2 [final-error]', 'qualifiers_final_decorator.py:55:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Class Derived2 overrides final method method3, defined in base class Base2 [final-error]', 'qualifiers_final_decorator.py:55:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Class Derived2 overrides final method method2, defined in base class Base2 [final-error]', 'qualifiers_final_decorator.py:55:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Class Derived2 overrides final method method1, defined in base class Base2 [final-error]'] +Line 76: Unexpected errors ['qualifiers_final_decorator.py:76:16: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method4: bad return type [bad-return-type]'] +Line 90: Unexpected errors ['qualifiers_final_decorator.py:90:16: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method: bad return type [bad-return-type]'] +Line 103: Unexpected errors ['qualifiers_final_decorator.py:103:16: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method: bad return type [bad-return-type]'] +Line 117: Unexpected errors ['qualifiers_final_decorator.py:117:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Class Derived5 overrides final method method, defined in base class Base5_2 [final-error]'] """ diff --git a/conformance/results/pytype/specialtypes_never.toml b/conformance/results/pytype/specialtypes_never.toml index bb2352598..7a2318585 100644 --- a/conformance/results/pytype/specialtypes_never.toml +++ b/conformance/results/pytype/specialtypes_never.toml @@ -3,20 +3,45 @@ notes = """ Does not understand NoReturn or Never. """ output = """ -File "specialtypes_never.py", line 11, in : argument "covariant" to TypeVar not supported yet [not-supported-yet] -File "specialtypes_never.py", line 21, in func1: bad return type [bad-return-type] -File "specialtypes_never.py", line 68, in func6: Type annotation for v1 does not match type of assignment [annotation-type-mismatch] -File "specialtypes_never.py", line 69, in func6: Type annotation for v2 does not match type of assignment [annotation-type-mismatch] -File "specialtypes_never.py", line 70, in func6: Type annotation for v3 does not match type of assignment [annotation-type-mismatch] -File "specialtypes_never.py", line 86, in func8: Type annotation for v3 does not match type of assignment [annotation-type-mismatch] +specialtypes_never.py:11:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet] + +T_co = TypeVar("T_co", covariant=True) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +specialtypes_never.py:21:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: bad return type [bad-return-type] + + sys.exit(1) \u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + sys.exit(1) +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +specialtypes_never.py:68:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func6: Type annotation for v1 does not match type of assignment [annotation-type-mismatch] + + v1: int = a # OK + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +specialtypes_never.py:69:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func6: Type annotation for v2 does not match type of assignment [annotation-type-mismatch] + + v2: str = a # OK + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +specialtypes_never.py:70:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func6: Type annotation for v3 does not match type of assignment [annotation-type-mismatch] + + v3: list[str] = a # OK + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +specialtypes_never.py:86:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func8: Type annotation for v3 does not match type of assignment [annotation-type-mismatch] + + v3: list[int] = c # E + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ Line 19: Expected 1 errors Line 105: Expected 1 errors -Line 11: Unexpected errors ['File "specialtypes_never.py", line 11, in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] -Line 21: Unexpected errors ['File "specialtypes_never.py", line 21, in func1: bad return type [bad-return-type]'] -Line 68: Unexpected errors ['File "specialtypes_never.py", line 68, in func6: Type annotation for v1 does not match type of assignment [annotation-type-mismatch]'] -Line 69: Unexpected errors ['File "specialtypes_never.py", line 69, in func6: Type annotation for v2 does not match type of assignment [annotation-type-mismatch]'] -Line 70: Unexpected errors ['File "specialtypes_never.py", line 70, in func6: Type annotation for v3 does not match type of assignment [annotation-type-mismatch]'] +Line 11: Unexpected errors ['specialtypes_never.py:11:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] +Line 21: Unexpected errors ['specialtypes_never.py:21:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: bad return type [bad-return-type]'] +Line 68: Unexpected errors ['specialtypes_never.py:68:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func6: Type annotation for v1 does not match type of assignment [annotation-type-mismatch]'] +Line 69: Unexpected errors ['specialtypes_never.py:69:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func6: Type annotation for v2 does not match type of assignment [annotation-type-mismatch]'] +Line 70: Unexpected errors ['specialtypes_never.py:70:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func6: Type annotation for v3 does not match type of assignment [annotation-type-mismatch]'] """ diff --git a/conformance/results/pytype/specialtypes_none.toml b/conformance/results/pytype/specialtypes_none.toml index 1c1b30f21..03a38e99d 100644 --- a/conformance/results/pytype/specialtypes_none.toml +++ b/conformance/results/pytype/specialtypes_none.toml @@ -4,8 +4,16 @@ Does not detect type incompatibility between None and type[None]. Does not detect type incompatibility between None and incompatible protocol. """ output = """ -File "specialtypes_none.py", line 21, in : Function func1 was called with the wrong arguments [wrong-arg-types] -File "specialtypes_none.py", line 41, in : Function func2 was called with the wrong arguments [wrong-arg-types] +specialtypes_none.py:21:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function func1 was called with the wrong arguments [wrong-arg-types] + +func1(type(None)) # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +specialtypes_none.py:41:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function func2 was called with the wrong arguments [wrong-arg-types] + +func2(None) # E: not compatible +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ diff --git a/conformance/results/pytype/specialtypes_promotions.toml b/conformance/results/pytype/specialtypes_promotions.toml index dc20943f2..8380712e2 100644 --- a/conformance/results/pytype/specialtypes_promotions.toml +++ b/conformance/results/pytype/specialtypes_promotions.toml @@ -1,6 +1,10 @@ conformant = "Pass" output = """ -File "specialtypes_promotions.py", line 13, in func1: No attribute 'numerator' on float [attribute-error] +specialtypes_promotions.py:13:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: No attribute 'numerator' on float [attribute-error] + + f.numerator # E + \u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pytype/specialtypes_type.toml b/conformance/results/pytype/specialtypes_type.toml index 3a00c1aa9..c9ad20353 100644 --- a/conformance/results/pytype/specialtypes_type.toml +++ b/conformance/results/pytype/specialtypes_type.toml @@ -4,26 +4,80 @@ Does not reject Callable when passed to type[T]. Does not allow access to known attributes from object of type `type[Any]`. """ output = """ -File "specialtypes_type.py", line 56, in : Function func4 was called with the wrong arguments [wrong-arg-types] -File "specialtypes_type.py", line 64, in : Invalid type annotation 'T' [invalid-annotation] -File "specialtypes_type.py", line 76, in : Invalid type annotation 'type[int, str]' [invalid-annotation] -File "specialtypes_type.py", line 98, in func7: Any [assert-type] -File "specialtypes_type.py", line 102, in func7: Any [assert-type] -File "specialtypes_type.py", line 106, in func7: Any [assert-type] -File "specialtypes_type.py", line 110, in func7: Any [assert-type] -File "specialtypes_type.py", line 117, in func8: No attribute 'unknown' on Type[object] [attribute-error] -File "specialtypes_type.py", line 120, in func8: No attribute 'unknown' on Type[object] [attribute-error] -File "specialtypes_type.py", line 143, in : No attribute 'unknown' on Type[type] [attribute-error] -File "specialtypes_type.py", line 144, in : No attribute 'unknown' on Type[type] [attribute-error] -File "specialtypes_type.py", line 145, in : No attribute 'unknown' on Type[type] [attribute-error] -File "specialtypes_type.py", line 146, in : No attribute 'unknown' on Type[type] [attribute-error] +specialtypes_type.py:56:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function func4 was called with the wrong arguments [wrong-arg-types] + +func4(TeamUser) # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +specialtypes_type.py:64:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'T' [invalid-annotation] + +def func5(x: type[T]) -> None: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +specialtypes_type.py:76:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'type[int, str]' [invalid-annotation] + +bad_type1: type[int, str] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +specialtypes_type.py:98:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func7: Any [assert-type] + + assert_type(a.__mro__, tuple[type, ...]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +specialtypes_type.py:102:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func7: Any [assert-type] + + assert_type(b.__mro__, tuple[type, ...]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +specialtypes_type.py:106:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func7: Any [assert-type] + + assert_type(c.__mro__, tuple[type, ...]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +specialtypes_type.py:110:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func7: Any [assert-type] + + assert_type(d.__mro__, tuple[type, ...]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +specialtypes_type.py:117:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func8: No attribute 'unknown' on Type[object] [attribute-error] + + a.unknown # E + \u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m + +specialtypes_type.py:120:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func8: No attribute 'unknown' on Type[object] [attribute-error] + + b.unknown # E + \u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m + +specialtypes_type.py:143:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : No attribute 'unknown' on Type[type] [attribute-error] + +TA1.unknown # E +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +specialtypes_type.py:144:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : No attribute 'unknown' on Type[type] [attribute-error] + +TA2.unknown # E +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +specialtypes_type.py:145:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : No attribute 'unknown' on Type[type] [attribute-error] + +TA3.unknown # E +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +specialtypes_type.py:146:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : No attribute 'unknown' on Type[type] [attribute-error] + +TA4.unknown # E +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ Line 70: Expected 1 errors -Line 64: Unexpected errors ['File "specialtypes_type.py", line 64, in : Invalid type annotation \\'T\\' [invalid-annotation]'] -Line 98: Unexpected errors ['File "specialtypes_type.py", line 98, in func7: Any [assert-type]'] -Line 102: Unexpected errors ['File "specialtypes_type.py", line 102, in func7: Any [assert-type]'] -Line 106: Unexpected errors ['File "specialtypes_type.py", line 106, in func7: Any [assert-type]'] -Line 110: Unexpected errors ['File "specialtypes_type.py", line 110, in func7: Any [assert-type]'] +Line 64: Unexpected errors ["specialtypes_type.py:64:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'T' [invalid-annotation]"] +Line 98: Unexpected errors ['specialtypes_type.py:98:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func7: Any [assert-type]'] +Line 102: Unexpected errors ['specialtypes_type.py:102:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func7: Any [assert-type]'] +Line 106: Unexpected errors ['specialtypes_type.py:106:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func7: Any [assert-type]'] +Line 110: Unexpected errors ['specialtypes_type.py:110:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func7: Any [assert-type]'] """ diff --git a/conformance/results/pytype/tuples_type_compat.toml b/conformance/results/pytype/tuples_type_compat.toml index 638c5bf2e..c198de7ad 100644 --- a/conformance/results/pytype/tuples_type_compat.toml +++ b/conformance/results/pytype/tuples_type_compat.toml @@ -5,61 +5,281 @@ Does not report type violation when assigning `tuple[int, ...]` to `tuple[int]`. Does not support tuple narrowing based on `len()` type guard (optional). """ output = """ -File "tuples_type_compat.py", line 15, in func1: Type annotation for v2 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_compat.py", line 22, in : Invalid type annotation '' [invalid-annotation] -File "tuples_type_compat.py", line 27, in func2: Invalid type annotation 'tuple[int, *tuple[int, ...]]' [invalid-annotation] -File "tuples_type_compat.py", line 47, in func3: Invalid type annotation 'tuple[int, *tuple[str, ...]]' [invalid-annotation] -File "tuples_type_compat.py", line 71, in : Invalid type annotation '' [invalid-annotation] -File "tuples_type_compat.py", line 74, in func5: tuple [assert-type] -File "tuples_type_compat.py", line 78, in func5: tuple [assert-type] -File "tuples_type_compat.py", line 82, in func5: tuple [assert-type] -File "tuples_type_compat.py", line 91, in : Invalid type annotation '' [invalid-annotation] -File "tuples_type_compat.py", line 115, in func7: Tuple[Union[int, str], Union[int, str]] [assert-type] -File "tuples_type_compat.py", line 117, in func7: Tuple[Union[int, str], Union[int, str]] [assert-type] -File "tuples_type_compat.py", line 134, in : Invalid type annotation '' [invalid-annotation] -File "tuples_type_compat.py", line 139, in func8: Sequence [assert-type] -File "tuples_type_compat.py", line 140, in func8: Sequence [assert-type] -File "tuples_type_compat.py", line 143, in : Type annotation for t1 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_compat.py", line 143, in : Invalid type annotation 'tuple[int, *tuple[str]]' [invalid-annotation] -File "tuples_type_compat.py", line 143, in : Invalid type annotation '' [invalid-annotation] -File "tuples_type_compat.py", line 144, in : Type annotation for t1 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_compat.py", line 146, in : Invalid type annotation 'tuple[int, *tuple[str, ...]]' [invalid-annotation] -File "tuples_type_compat.py", line 146, in : Invalid type annotation '' [invalid-annotation] -File "tuples_type_compat.py", line 147, in : Type annotation for t2 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_compat.py", line 148, in : Type annotation for t2 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_compat.py", line 149, in : Type annotation for t2 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_compat.py", line 150, in : Type annotation for t2 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_compat.py", line 153, in : Type annotation for t3 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_compat.py", line 153, in : Invalid type annotation 'tuple[int, *tuple[str, ...], int]' [invalid-annotation] -File "tuples_type_compat.py", line 153, in : Invalid type annotation '' [invalid-annotation] -File "tuples_type_compat.py", line 154, in : Type annotation for t3 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_compat.py", line 155, in : Type annotation for t3 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_compat.py", line 156, in : Type annotation for t3 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_compat.py", line 157, in : Type annotation for t3 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_compat.py", line 159, in : Invalid type annotation 'tuple[*tuple[str, ...], int]' [invalid-annotation] -File "tuples_type_compat.py", line 159, in : Invalid type annotation '' [invalid-annotation] -File "tuples_type_compat.py", line 160, in : Type annotation for t4 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_compat.py", line 161, in : Type annotation for t4 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_compat.py", line 162, in : Type annotation for t4 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_compat.py", line 163, in : Type annotation for t4 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_compat.py", line 167, in func9: Type annotation for t1 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_compat.py", line 167, in func9: Invalid type annotation 'tuple[str, str, *tuple[int, ...]]' [invalid-annotation] -File "tuples_type_compat.py", line 168, in func9: Type annotation for t2 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_compat.py", line 168, in func9: Invalid type annotation 'tuple[str, str, *tuple[int]]' [invalid-annotation] -File "tuples_type_compat.py", line 169, in func9: Type annotation for t3 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_compat.py", line 169, in func9: Invalid type annotation 'tuple[str, *tuple[str, ...]]' [invalid-annotation] -File "tuples_type_compat.py", line 170, in func9: Type annotation for t4 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_compat.py", line 170, in func9: Invalid type annotation 'tuple[str, str, *tuple[str, ...]]' [invalid-annotation] -File "tuples_type_compat.py", line 171, in func9: Type annotation for t5 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_compat.py", line 171, in func9: Invalid type annotation 'tuple[str, str, str, *tuple[str, ...]]' [invalid-annotation] -File "tuples_type_compat.py", line 172, in func9: Type annotation for t6 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_compat.py", line 172, in func9: Invalid type annotation 'tuple[str, *tuple[int, ...], str]' [invalid-annotation] -File "tuples_type_compat.py", line 173, in func9: Type annotation for t7 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_compat.py", line 173, in func9: Invalid type annotation 'tuple[*tuple[str, ...], str]' [invalid-annotation] -File "tuples_type_compat.py", line 174, in func9: Type annotation for t8 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_compat.py", line 174, in func9: Invalid type annotation 'tuple[*tuple[str, ...], str]' [invalid-annotation] -File "tuples_type_compat.py", line 175, in func9: Type annotation for t9 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_compat.py", line 175, in func9: Invalid type annotation 'tuple[*tuple[str, ...], str, str, str]' [invalid-annotation] +tuples_type_compat.py:15:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Type annotation for v2 does not match type of assignment [annotation-type-mismatch] + + v2: tuple[int, int] = t1 # E + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:22:31: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +def func2(t1: tuple[int], t2: tuple[int, *tuple[int, ...]], t3: tuple[int, ...]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_type_compat.py:27:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func2: Invalid type annotation 'tuple[int, *tuple[int, ...]]' [invalid-annotation] + + v2: tuple[int, *tuple[int, ...]] + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:47:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func3: Invalid type annotation 'tuple[int, *tuple[str, ...]]' [invalid-annotation] + + v6: tuple[int, *tuple[str, ...]] = t3 # OK + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:71:47: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +def func5(val: tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_type_compat.py:74:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func5: tuple [assert-type] + + assert_type(val, tuple[int]) # tuple[int] + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_type_compat.py:78:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func5: tuple [assert-type] + + assert_type(val, tuple[str, str] | tuple[int, int]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_type_compat.py:82:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func5: tuple [assert-type] + + assert_type(val, tuple[int, str, int]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_type_compat.py:91:47: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +def func6(val: tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_type_compat.py:115:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func7: Tuple[Union[int, str], Union[int, str]] [assert-type] + + assert_type(subj, tuple[int | str, str]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_type_compat.py:117:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func7: Tuple[Union[int, str], Union[int, str]] [assert-type] + + assert_type(subj, tuple[int | str, int]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_type_compat.py:134:40: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + + t1: tuple[complex, list[int]], t2: tuple[int, *tuple[str, ...]], t3: tuple[()] + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_type_compat.py:139:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func8: Sequence [assert-type] + + assert_type(test_seq(t2), Sequence[int | str]) # Could be Sequence[object] + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_type_compat.py:140:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func8: Sequence [assert-type] + + assert_type(test_seq(t3), Sequence[Never]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_type_compat.py:143:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t1 does not match type of assignment [annotation-type-mismatch] + +t1: tuple[int, *tuple[str]] = (1, "") # OK +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:143:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[int, *tuple[str]]' [invalid-annotation] + +t1: tuple[int, *tuple[str]] = (1, "") # OK +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:143:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +t1: tuple[int, *tuple[str]] = (1, "") # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_type_compat.py:144:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t1 does not match type of assignment [annotation-type-mismatch] + +t1 = (1, "", "") # E +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:146:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[int, *tuple[str, ...]]' [invalid-annotation] + +t2: tuple[int, *tuple[str, ...]] = (1,) # OK +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:146:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +t2: tuple[int, *tuple[str, ...]] = (1,) # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_type_compat.py:147:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t2 does not match type of assignment [annotation-type-mismatch] + +t2 = (1, "") # OK +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:148:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t2 does not match type of assignment [annotation-type-mismatch] + +t2 = (1, "", "") # OK +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:149:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t2 does not match type of assignment [annotation-type-mismatch] + +t2 = (1, 1, "") # E +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:150:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t2 does not match type of assignment [annotation-type-mismatch] + +t2 = (1, "", 1) # E +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:153:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t3 does not match type of assignment [annotation-type-mismatch] + +t3: tuple[int, *tuple[str, ...], int] = (1, 2) # OK +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:153:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[int, *tuple[str, ...], int]' [invalid-annotation] + +t3: tuple[int, *tuple[str, ...], int] = (1, 2) # OK +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:153:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +t3: tuple[int, *tuple[str, ...], int] = (1, 2) # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_type_compat.py:154:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t3 does not match type of assignment [annotation-type-mismatch] + +t3 = (1, "", 2) # OK +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:155:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t3 does not match type of assignment [annotation-type-mismatch] + +t3 = (1, "", "", 2) # OK +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:156:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t3 does not match type of assignment [annotation-type-mismatch] + +t3 = (1, "", "") # E +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:157:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t3 does not match type of assignment [annotation-type-mismatch] + +t3 = (1, "", "", 1.2) # E +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:159:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[*tuple[str, ...], int]' [invalid-annotation] + +t4: tuple[*tuple[str, ...], int] = (1,) # OK +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:159:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +t4: tuple[*tuple[str, ...], int] = (1,) # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_type_compat.py:160:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t4 does not match type of assignment [annotation-type-mismatch] + +t4 = ("", 1) # OK +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:161:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t4 does not match type of assignment [annotation-type-mismatch] + +t4 = ("", "", 1) # OK +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:162:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t4 does not match type of assignment [annotation-type-mismatch] + +t4 = (1, "", 1) # E +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:163:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t4 does not match type of assignment [annotation-type-mismatch] + +t4 = ("", "", 1.2) # E +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:167:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Type annotation for t1 does not match type of assignment [annotation-type-mismatch] + + t1: tuple[str, str, *tuple[int, ...]] = a # OK + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:167:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Invalid type annotation 'tuple[str, str, *tuple[int, ...]]' [invalid-annotation] + + t1: tuple[str, str, *tuple[int, ...]] = a # OK + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:168:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Type annotation for t2 does not match type of assignment [annotation-type-mismatch] + + t2: tuple[str, str, *tuple[int]] = a # E + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:168:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Invalid type annotation 'tuple[str, str, *tuple[int]]' [invalid-annotation] + + t2: tuple[str, str, *tuple[int]] = a # E + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:169:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Type annotation for t3 does not match type of assignment [annotation-type-mismatch] + + t3: tuple[str, *tuple[str, ...]] = a # OK + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:169:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Invalid type annotation 'tuple[str, *tuple[str, ...]]' [invalid-annotation] + + t3: tuple[str, *tuple[str, ...]] = a # OK + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:170:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Type annotation for t4 does not match type of assignment [annotation-type-mismatch] + + t4: tuple[str, str, *tuple[str, ...]] = a # OK + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:170:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Invalid type annotation 'tuple[str, str, *tuple[str, ...]]' [invalid-annotation] + + t4: tuple[str, str, *tuple[str, ...]] = a # OK + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:171:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Type annotation for t5 does not match type of assignment [annotation-type-mismatch] + + t5: tuple[str, str, str, *tuple[str, ...]] = a # E + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:171:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Invalid type annotation 'tuple[str, str, str, *tuple[str, ...]]' [invalid-annotation] + + t5: tuple[str, str, str, *tuple[str, ...]] = a # E + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:172:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Type annotation for t6 does not match type of assignment [annotation-type-mismatch] + + t6: tuple[str, *tuple[int, ...], str] = a # OK + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:172:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Invalid type annotation 'tuple[str, *tuple[int, ...], str]' [invalid-annotation] + + t6: tuple[str, *tuple[int, ...], str] = a # OK + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:173:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Type annotation for t7 does not match type of assignment [annotation-type-mismatch] + + t7: tuple[*tuple[str, ...], str] = a # OK + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:173:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Invalid type annotation 'tuple[*tuple[str, ...], str]' [invalid-annotation] + + t7: tuple[*tuple[str, ...], str] = a # OK + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:174:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Type annotation for t8 does not match type of assignment [annotation-type-mismatch] + + t8: tuple[*tuple[str, ...], str] = a # OK + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:174:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Invalid type annotation 'tuple[*tuple[str, ...], str]' [invalid-annotation] + + t8: tuple[*tuple[str, ...], str] = a # OK + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:175:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Type annotation for t9 does not match type of assignment [annotation-type-mismatch] + + t9: tuple[*tuple[str, ...], str, str, str] = a # E + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:175:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Invalid type annotation 'tuple[*tuple[str, ...], str, str, str]' [invalid-annotation] + + t9: tuple[*tuple[str, ...], str, str, str] = a # E + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -68,33 +288,33 @@ Line 32: Expected 1 errors Line 33: Expected 1 errors Line 43: Expected 1 errors Line 62: Expected 1 errors -Line 22: Unexpected errors ['File "tuples_type_compat.py", line 22, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 27: Unexpected errors ['File "tuples_type_compat.py", line 27, in func2: Invalid type annotation \\'tuple[int, *tuple[int, ...]]\\' [invalid-annotation]'] -Line 47: Unexpected errors ['File "tuples_type_compat.py", line 47, in func3: Invalid type annotation \\'tuple[int, *tuple[str, ...]]\\' [invalid-annotation]'] -Line 71: Unexpected errors ['File "tuples_type_compat.py", line 71, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 74: Unexpected errors ['File "tuples_type_compat.py", line 74, in func5: tuple [assert-type]'] -Line 78: Unexpected errors ['File "tuples_type_compat.py", line 78, in func5: tuple [assert-type]'] -Line 82: Unexpected errors ['File "tuples_type_compat.py", line 82, in func5: tuple [assert-type]'] -Line 91: Unexpected errors ['File "tuples_type_compat.py", line 91, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 115: Unexpected errors ['File "tuples_type_compat.py", line 115, in func7: Tuple[Union[int, str], Union[int, str]] [assert-type]'] -Line 117: Unexpected errors ['File "tuples_type_compat.py", line 117, in func7: Tuple[Union[int, str], Union[int, str]] [assert-type]'] -Line 134: Unexpected errors ['File "tuples_type_compat.py", line 134, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 139: Unexpected errors ['File "tuples_type_compat.py", line 139, in func8: Sequence [assert-type]'] -Line 140: Unexpected errors ['File "tuples_type_compat.py", line 140, in func8: Sequence [assert-type]'] -Line 143: Unexpected errors ['File "tuples_type_compat.py", line 143, in : Type annotation for t1 does not match type of assignment [annotation-type-mismatch]', 'File "tuples_type_compat.py", line 143, in : Invalid type annotation \\'tuple[int, *tuple[str]]\\' [invalid-annotation]', 'File "tuples_type_compat.py", line 143, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 146: Unexpected errors ['File "tuples_type_compat.py", line 146, in : Invalid type annotation \\'tuple[int, *tuple[str, ...]]\\' [invalid-annotation]', 'File "tuples_type_compat.py", line 146, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 147: Unexpected errors ['File "tuples_type_compat.py", line 147, in : Type annotation for t2 does not match type of assignment [annotation-type-mismatch]'] -Line 148: Unexpected errors ['File "tuples_type_compat.py", line 148, in : Type annotation for t2 does not match type of assignment [annotation-type-mismatch]'] -Line 153: Unexpected errors ['File "tuples_type_compat.py", line 153, in : Type annotation for t3 does not match type of assignment [annotation-type-mismatch]', 'File "tuples_type_compat.py", line 153, in : Invalid type annotation \\'tuple[int, *tuple[str, ...], int]\\' [invalid-annotation]', 'File "tuples_type_compat.py", line 153, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 154: Unexpected errors ['File "tuples_type_compat.py", line 154, in : Type annotation for t3 does not match type of assignment [annotation-type-mismatch]'] -Line 155: Unexpected errors ['File "tuples_type_compat.py", line 155, in : Type annotation for t3 does not match type of assignment [annotation-type-mismatch]'] -Line 159: Unexpected errors ['File "tuples_type_compat.py", line 159, in : Invalid type annotation \\'tuple[*tuple[str, ...], int]\\' [invalid-annotation]', 'File "tuples_type_compat.py", line 159, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 160: Unexpected errors ['File "tuples_type_compat.py", line 160, in : Type annotation for t4 does not match type of assignment [annotation-type-mismatch]'] -Line 161: Unexpected errors ['File "tuples_type_compat.py", line 161, in : Type annotation for t4 does not match type of assignment [annotation-type-mismatch]'] -Line 167: Unexpected errors ['File "tuples_type_compat.py", line 167, in func9: Type annotation for t1 does not match type of assignment [annotation-type-mismatch]', 'File "tuples_type_compat.py", line 167, in func9: Invalid type annotation \\'tuple[str, str, *tuple[int, ...]]\\' [invalid-annotation]'] -Line 169: Unexpected errors ['File "tuples_type_compat.py", line 169, in func9: Type annotation for t3 does not match type of assignment [annotation-type-mismatch]', 'File "tuples_type_compat.py", line 169, in func9: Invalid type annotation \\'tuple[str, *tuple[str, ...]]\\' [invalid-annotation]'] -Line 170: Unexpected errors ['File "tuples_type_compat.py", line 170, in func9: Type annotation for t4 does not match type of assignment [annotation-type-mismatch]', 'File "tuples_type_compat.py", line 170, in func9: Invalid type annotation \\'tuple[str, str, *tuple[str, ...]]\\' [invalid-annotation]'] -Line 172: Unexpected errors ['File "tuples_type_compat.py", line 172, in func9: Type annotation for t6 does not match type of assignment [annotation-type-mismatch]', 'File "tuples_type_compat.py", line 172, in func9: Invalid type annotation \\'tuple[str, *tuple[int, ...], str]\\' [invalid-annotation]'] -Line 173: Unexpected errors ['File "tuples_type_compat.py", line 173, in func9: Type annotation for t7 does not match type of assignment [annotation-type-mismatch]', 'File "tuples_type_compat.py", line 173, in func9: Invalid type annotation \\'tuple[*tuple[str, ...], str]\\' [invalid-annotation]'] -Line 174: Unexpected errors ['File "tuples_type_compat.py", line 174, in func9: Type annotation for t8 does not match type of assignment [annotation-type-mismatch]', 'File "tuples_type_compat.py", line 174, in func9: Invalid type annotation \\'tuple[*tuple[str, ...], str]\\' [invalid-annotation]'] +Line 22: Unexpected errors ["tuples_type_compat.py:22:31: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 27: Unexpected errors ["tuples_type_compat.py:27:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func2: Invalid type annotation 'tuple[int, *tuple[int, ...]]' [invalid-annotation]"] +Line 47: Unexpected errors ["tuples_type_compat.py:47:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func3: Invalid type annotation 'tuple[int, *tuple[str, ...]]' [invalid-annotation]"] +Line 71: Unexpected errors ["tuples_type_compat.py:71:47: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 74: Unexpected errors ['tuples_type_compat.py:74:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func5: tuple [assert-type]'] +Line 78: Unexpected errors ['tuples_type_compat.py:78:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func5: tuple [assert-type]'] +Line 82: Unexpected errors ['tuples_type_compat.py:82:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func5: tuple [assert-type]'] +Line 91: Unexpected errors ["tuples_type_compat.py:91:47: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 115: Unexpected errors ['tuples_type_compat.py:115:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func7: Tuple[Union[int, str], Union[int, str]] [assert-type]'] +Line 117: Unexpected errors ['tuples_type_compat.py:117:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func7: Tuple[Union[int, str], Union[int, str]] [assert-type]'] +Line 134: Unexpected errors ["tuples_type_compat.py:134:40: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 139: Unexpected errors ['tuples_type_compat.py:139:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func8: Sequence [assert-type]'] +Line 140: Unexpected errors ['tuples_type_compat.py:140:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func8: Sequence [assert-type]'] +Line 143: Unexpected errors ['tuples_type_compat.py:143:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for t1 does not match type of assignment [annotation-type-mismatch]', "tuples_type_compat.py:143:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'tuple[int, *tuple[str]]' [invalid-annotation]", "tuples_type_compat.py:143:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 146: Unexpected errors ["tuples_type_compat.py:146:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'tuple[int, *tuple[str, ...]]' [invalid-annotation]", "tuples_type_compat.py:146:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 147: Unexpected errors ['tuples_type_compat.py:147:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for t2 does not match type of assignment [annotation-type-mismatch]'] +Line 148: Unexpected errors ['tuples_type_compat.py:148:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for t2 does not match type of assignment [annotation-type-mismatch]'] +Line 153: Unexpected errors ['tuples_type_compat.py:153:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for t3 does not match type of assignment [annotation-type-mismatch]', "tuples_type_compat.py:153:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'tuple[int, *tuple[str, ...], int]' [invalid-annotation]", "tuples_type_compat.py:153:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 154: Unexpected errors ['tuples_type_compat.py:154:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for t3 does not match type of assignment [annotation-type-mismatch]'] +Line 155: Unexpected errors ['tuples_type_compat.py:155:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for t3 does not match type of assignment [annotation-type-mismatch]'] +Line 159: Unexpected errors ["tuples_type_compat.py:159:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'tuple[*tuple[str, ...], int]' [invalid-annotation]", "tuples_type_compat.py:159:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 160: Unexpected errors ['tuples_type_compat.py:160:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for t4 does not match type of assignment [annotation-type-mismatch]'] +Line 161: Unexpected errors ['tuples_type_compat.py:161:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for t4 does not match type of assignment [annotation-type-mismatch]'] +Line 167: Unexpected errors ['tuples_type_compat.py:167:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func9: Type annotation for t1 does not match type of assignment [annotation-type-mismatch]', "tuples_type_compat.py:167:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func9: Invalid type annotation 'tuple[str, str, *tuple[int, ...]]' [invalid-annotation]"] +Line 169: Unexpected errors ['tuples_type_compat.py:169:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func9: Type annotation for t3 does not match type of assignment [annotation-type-mismatch]', "tuples_type_compat.py:169:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func9: Invalid type annotation 'tuple[str, *tuple[str, ...]]' [invalid-annotation]"] +Line 170: Unexpected errors ['tuples_type_compat.py:170:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func9: Type annotation for t4 does not match type of assignment [annotation-type-mismatch]', "tuples_type_compat.py:170:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func9: Invalid type annotation 'tuple[str, str, *tuple[str, ...]]' [invalid-annotation]"] +Line 172: Unexpected errors ['tuples_type_compat.py:172:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func9: Type annotation for t6 does not match type of assignment [annotation-type-mismatch]', "tuples_type_compat.py:172:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func9: Invalid type annotation 'tuple[str, *tuple[int, ...], str]' [invalid-annotation]"] +Line 173: Unexpected errors ['tuples_type_compat.py:173:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func9: Type annotation for t7 does not match type of assignment [annotation-type-mismatch]', "tuples_type_compat.py:173:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func9: Invalid type annotation 'tuple[*tuple[str, ...], str]' [invalid-annotation]"] +Line 174: Unexpected errors ['tuples_type_compat.py:174:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func9: Type annotation for t8 does not match type of assignment [annotation-type-mismatch]', "tuples_type_compat.py:174:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func9: Invalid type annotation 'tuple[*tuple[str, ...], str]' [invalid-annotation]"] """ diff --git a/conformance/results/pytype/tuples_type_form.toml b/conformance/results/pytype/tuples_type_form.toml index f8bb94391..8ecf9d221 100644 --- a/conformance/results/pytype/tuples_type_form.toml +++ b/conformance/results/pytype/tuples_type_form.toml @@ -1,18 +1,70 @@ conformant = "Pass" output = """ -File "tuples_type_form.py", line 12, in : Type annotation for t1 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_form.py", line 14, in : Type annotation for t2 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_form.py", line 15, in : Type annotation for t2 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_form.py", line 25, in : Type annotation for t10 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_form.py", line 36, in : Type annotation for t20 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_form.py", line 40, in : Invalid type annotation 'tuple[int, int, Any]' [invalid-annotation] -File "tuples_type_form.py", line 41, in : Invalid type annotation 'Ellipsis' [invalid-annotation] -File "tuples_type_form.py", line 42, in : Invalid type annotation 'tuple[Any, int]' [invalid-annotation] -File "tuples_type_form.py", line 42, in : Invalid type annotation 'Ellipsis' [invalid-annotation] -File "tuples_type_form.py", line 43, in : Invalid type annotation 'tuple[int, Any, int]' [invalid-annotation] -File "tuples_type_form.py", line 43, in : Invalid type annotation 'Ellipsis' [invalid-annotation] -File "tuples_type_form.py", line 44, in : Invalid type annotation '' [invalid-annotation] -File "tuples_type_form.py", line 45, in : Invalid type annotation '' [invalid-annotation] +tuples_type_form.py:12:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t1 does not match type of assignment [annotation-type-mismatch] + +t1 = (1, 2) # E +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_form.py:14:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t2 does not match type of assignment [annotation-type-mismatch] + +t2 = (1,) # E +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_form.py:15:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t2 does not match type of assignment [annotation-type-mismatch] + +t2 = (1, "") # E +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_form.py:25:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t10 does not match type of assignment [annotation-type-mismatch] + +t10 = (1,) # E +\u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +tuples_type_form.py:36:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t20 does not match type of assignment [annotation-type-mismatch] + +t20 = (1, 2, 3, "") # E +\u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +tuples_type_form.py:40:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[int, int, Any]' [invalid-annotation] + +t31: tuple[int, int, ...] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_type_form.py:41:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Ellipsis' [invalid-annotation] + +t32: tuple[...] # E + \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_type_form.py:42:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[Any, int]' [invalid-annotation] + +t33: tuple[..., int] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_type_form.py:42:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Ellipsis' [invalid-annotation] + +t33: tuple[..., int] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_type_form.py:43:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[int, Any, int]' [invalid-annotation] + +t34: tuple[int, ..., int] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_type_form.py:43:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Ellipsis' [invalid-annotation] + +t34: tuple[int, ..., int] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_type_form.py:44:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +t35: tuple[*tuple[str], ...] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_type_form.py:45:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +t36: tuple[*tuple[str, ...], ...] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pytype/tuples_unpacked.toml b/conformance/results/pytype/tuples_unpacked.toml index 78e943a83..9b4b5b55b 100644 --- a/conformance/results/pytype/tuples_unpacked.toml +++ b/conformance/results/pytype/tuples_unpacked.toml @@ -4,50 +4,164 @@ Does not support `typing.Unpack`. Does not support unpacked tuples within a tuple type form. """ output = """ -File "tuples_unpacked.py", line 13, in : typing.Unpack not supported yet [not-supported-yet] -File "tuples_unpacked.py", line 13, in : typing.TypeVarTuple not supported yet [not-supported-yet] -File "tuples_unpacked.py", line 16, in : Invalid type annotation '' [invalid-annotation] -File "tuples_unpacked.py", line 17, in func1: Tuple[Any] [assert-type] -File "tuples_unpacked.py", line 18, in func1: Invalid type annotation '' [invalid-annotation] -File "tuples_unpacked.py", line 19, in func1: Invalid type annotation '' [invalid-annotation] -File "tuples_unpacked.py", line 25, in : Invalid type annotation '' [invalid-annotation] -File "tuples_unpacked.py", line 26, in func2: Invalid type annotation '' [invalid-annotation] -File "tuples_unpacked.py", line 31, in : Type annotation for u1 does not match type of assignment [annotation-type-mismatch] -File "tuples_unpacked.py", line 31, in : Invalid type annotation 'tuple[*tuple[int], *tuple[int]]' [invalid-annotation] -File "tuples_unpacked.py", line 31, in : Invalid type annotation '' [invalid-annotation] -File "tuples_unpacked.py", line 31, in : Function list.extend was called with the wrong arguments [wrong-arg-types] -File "tuples_unpacked.py", line 32, in : Tuple[Any] [assert-type] -File "tuples_unpacked.py", line 33, in : Invalid type annotation '' [invalid-annotation] -File "tuples_unpacked.py", line 33, in : Function list.extend was called with the wrong arguments [wrong-arg-types] -File "tuples_unpacked.py", line 38, in : Invalid type annotation '' [invalid-annotation] -File "tuples_unpacked.py", line 38, in : Function list.extend was called with the wrong arguments [wrong-arg-types] -File "tuples_unpacked.py", line 39, in : Invalid type annotation '' [invalid-annotation] -File "tuples_unpacked.py", line 40, in : Invalid type annotation '' [invalid-annotation] -File "tuples_unpacked.py", line 40, in : Function list.extend was called with the wrong arguments [wrong-arg-types] -File "tuples_unpacked.py", line 41, in : Invalid type annotation '' [invalid-annotation] -File "tuples_unpacked.py", line 41, in : Function list.extend was called with the wrong arguments [wrong-arg-types] -File "tuples_unpacked.py", line 46, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] -File "tuples_unpacked.py", line 49, in : Invalid type annotation '' [invalid-annotation] -File "tuples_unpacked.py", line 50, in func3: Invalid type annotation 'tuple[*tuple[str], *Ts]' [invalid-annotation] -File "tuples_unpacked.py", line 51, in func3: Invalid type annotation 'tuple[*tuple[str, ...], *Ts]' [invalid-annotation] +tuples_unpacked.py:13:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing.Unpack not supported yet [not-supported-yet] + +from typing import TypeVarTuple, Unpack, assert_type +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_unpacked.py:13:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet] + +from typing import TypeVarTuple, Unpack, assert_type +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_unpacked.py:16:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +def func1(x: tuple[int, *tuple[bool, bool], str]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_unpacked.py:17:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Tuple[Any] [assert-type] + + assert_type(x, tuple[int, bool, bool, str]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_unpacked.py:18:20: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Invalid type annotation '' [invalid-annotation] + + assert_type(x, tuple[*tuple[int, bool], bool, str]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_unpacked.py:19:20: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Invalid type annotation '' [invalid-annotation] + + assert_type(x, tuple[int, bool, *tuple[bool, str]]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_unpacked.py:25:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +def func2(x: tuple[int, *tuple[bool, ...], str]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_unpacked.py:26:20: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func2: Invalid type annotation '' [invalid-annotation] + + assert_type(x, tuple[int, *tuple[bool, ...], str]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_unpacked.py:31:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for u1 does not match type of assignment [annotation-type-mismatch] + +u1: tuple[*tuple[int], *tuple[int]] = (int(1), int(1)) # OK +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_unpacked.py:31:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[*tuple[int], *tuple[int]]' [invalid-annotation] + +u1: tuple[*tuple[int], *tuple[int]] = (int(1), int(1)) # OK +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_unpacked.py:31:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +u1: tuple[*tuple[int], *tuple[int]] = (int(1), int(1)) # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_unpacked.py:31:11: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function list.extend was called with the wrong arguments [wrong-arg-types] + +u1: tuple[*tuple[int], *tuple[int]] = (int(1), int(1)) # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_unpacked.py:32:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Tuple[Any] [assert-type] + +assert_type(u1, tuple[int, int]) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_unpacked.py:33:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +u2: tuple[*tuple[int, ...], *tuple[int]] # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_unpacked.py:33:11: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function list.extend was called with the wrong arguments [wrong-arg-types] + +u2: tuple[*tuple[int, ...], *tuple[int]] # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_unpacked.py:38:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +t1: tuple[*tuple[str], *tuple[str]] # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_unpacked.py:38:11: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function list.extend was called with the wrong arguments [wrong-arg-types] + +t1: tuple[*tuple[str], *tuple[str]] # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_unpacked.py:39:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +t2: tuple[*tuple[str, *tuple[str, ...]]] # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_unpacked.py:39:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +t2: tuple[*tuple[str, *tuple[str, ...]]] # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_unpacked.py:40:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +t3: tuple[*tuple[str, ...], *tuple[int, ...]] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_unpacked.py:40:11: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function list.extend was called with the wrong arguments [wrong-arg-types] + +t3: tuple[*tuple[str, ...], *tuple[int, ...]] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_unpacked.py:41:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +t4: tuple[*tuple[str, *tuple[str, ...]], *tuple[int, ...]] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_unpacked.py:41:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +t4: tuple[*tuple[str, *tuple[str, ...]], *tuple[int, ...]] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_unpacked.py:41:11: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function list.extend was called with the wrong arguments [wrong-arg-types] + +t4: tuple[*tuple[str, *tuple[str, ...]], *tuple[int, ...]] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_unpacked.py:46:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] + +Ts = TypeVarTuple("Ts") + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_unpacked.py:49:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +def func3(t: tuple[*Ts]): + \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_unpacked.py:50:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func3: Invalid type annotation 'tuple[*tuple[str], *Ts]' [invalid-annotation] + + t5: tuple[*tuple[str], *Ts] # OK + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_unpacked.py:51:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func3: Invalid type annotation 'tuple[*tuple[str, ...], *Ts]' [invalid-annotation] + + t6: tuple[*tuple[str, ...], *Ts] # E + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ Line 59: Expected 1 errors Lines 60, 61: Expected error (tag 't14') -Line 13: Unexpected errors ['File "tuples_unpacked.py", line 13, in : typing.Unpack not supported yet [not-supported-yet]', 'File "tuples_unpacked.py", line 13, in : typing.TypeVarTuple not supported yet [not-supported-yet]'] -Line 16: Unexpected errors ['File "tuples_unpacked.py", line 16, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 17: Unexpected errors ['File "tuples_unpacked.py", line 17, in func1: Tuple[Any] [assert-type]'] -Line 18: Unexpected errors ['File "tuples_unpacked.py", line 18, in func1: Invalid type annotation \\'\\' [invalid-annotation]'] -Line 19: Unexpected errors ['File "tuples_unpacked.py", line 19, in func1: Invalid type annotation \\'\\' [invalid-annotation]'] -Line 25: Unexpected errors ['File "tuples_unpacked.py", line 25, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 26: Unexpected errors ['File "tuples_unpacked.py", line 26, in func2: Invalid type annotation \\'\\' [invalid-annotation]'] -Line 31: Unexpected errors ['File "tuples_unpacked.py", line 31, in : Type annotation for u1 does not match type of assignment [annotation-type-mismatch]', 'File "tuples_unpacked.py", line 31, in : Invalid type annotation \\'tuple[*tuple[int], *tuple[int]]\\' [invalid-annotation]', 'File "tuples_unpacked.py", line 31, in : Invalid type annotation \\'\\' [invalid-annotation]', 'File "tuples_unpacked.py", line 31, in : Function list.extend was called with the wrong arguments [wrong-arg-types]'] -Line 32: Unexpected errors ['File "tuples_unpacked.py", line 32, in : Tuple[Any] [assert-type]'] -Line 33: Unexpected errors ['File "tuples_unpacked.py", line 33, in : Invalid type annotation \\'\\' [invalid-annotation]', 'File "tuples_unpacked.py", line 33, in : Function list.extend was called with the wrong arguments [wrong-arg-types]'] -Line 38: Unexpected errors ['File "tuples_unpacked.py", line 38, in : Invalid type annotation \\'\\' [invalid-annotation]', 'File "tuples_unpacked.py", line 38, in : Function list.extend was called with the wrong arguments [wrong-arg-types]'] -Line 39: Unexpected errors ['File "tuples_unpacked.py", line 39, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 46: Unexpected errors ['File "tuples_unpacked.py", line 46, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] -Line 49: Unexpected errors ['File "tuples_unpacked.py", line 49, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 50: Unexpected errors ['File "tuples_unpacked.py", line 50, in func3: Invalid type annotation \\'tuple[*tuple[str], *Ts]\\' [invalid-annotation]'] +Line 13: Unexpected errors ['tuples_unpacked.py:13:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.Unpack not supported yet [not-supported-yet]', 'tuples_unpacked.py:13:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet]'] +Line 16: Unexpected errors ["tuples_unpacked.py:16:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 17: Unexpected errors ['tuples_unpacked.py:17:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: Tuple[Any] [assert-type]'] +Line 18: Unexpected errors ["tuples_unpacked.py:18:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: Invalid type annotation '' [invalid-annotation]"] +Line 19: Unexpected errors ["tuples_unpacked.py:19:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: Invalid type annotation '' [invalid-annotation]"] +Line 25: Unexpected errors ["tuples_unpacked.py:25:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 26: Unexpected errors ["tuples_unpacked.py:26:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func2: Invalid type annotation '' [invalid-annotation]"] +Line 31: Unexpected errors ['tuples_unpacked.py:31:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for u1 does not match type of assignment [annotation-type-mismatch]', "tuples_unpacked.py:31:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'tuple[*tuple[int], *tuple[int]]' [invalid-annotation]", "tuples_unpacked.py:31:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", 'tuples_unpacked.py:31:11: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function list.extend was called with the wrong arguments [wrong-arg-types]'] +Line 32: Unexpected errors ['tuples_unpacked.py:32:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Tuple[Any] [assert-type]'] +Line 33: Unexpected errors ["tuples_unpacked.py:33:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", 'tuples_unpacked.py:33:11: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function list.extend was called with the wrong arguments [wrong-arg-types]'] +Line 38: Unexpected errors ["tuples_unpacked.py:38:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", 'tuples_unpacked.py:38:11: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function list.extend was called with the wrong arguments [wrong-arg-types]'] +Line 39: Unexpected errors ["tuples_unpacked.py:39:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", "tuples_unpacked.py:39:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 46: Unexpected errors ['tuples_unpacked.py:46:6: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] +Line 49: Unexpected errors ["tuples_unpacked.py:49:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 50: Unexpected errors ["tuples_unpacked.py:50:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func3: Invalid type annotation 'tuple[*tuple[str], *Ts]' [invalid-annotation]"] """ diff --git a/conformance/results/pytype/typeddicts_alt_syntax.toml b/conformance/results/pytype/typeddicts_alt_syntax.toml index cb4b223d3..62574fb06 100644 --- a/conformance/results/pytype/typeddicts_alt_syntax.toml +++ b/conformance/results/pytype/typeddicts_alt_syntax.toml @@ -5,8 +5,16 @@ Does not report when name of TypedDict doesn't match assigned identifier name. Does not support keyword-argument form of alternative syntax (deprecated in 3.11). """ output = """ -File "typeddicts_alt_syntax.py", line 27, in : Function typing.TypedDict was called with the wrong arguments [wrong-arg-types] -File "typeddicts_alt_syntax.py", line 41, in : Function typing.TypedDict expects 2 arg(s), got 3 [wrong-arg-count] +typeddicts_alt_syntax.py:27:17: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function typing.TypedDict was called with the wrong arguments [wrong-arg-types] + +BadTypedDict2 = TypedDict("BadTypedDict2", {1: str}) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +typeddicts_alt_syntax.py:41:10: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function typing.TypedDict expects 2 arg(s), got 3 [wrong-arg-count] + +Movie2 = TypedDict("Movie2", name=str, year=int) # E? + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ diff --git a/conformance/results/pytype/typeddicts_class_syntax.toml b/conformance/results/pytype/typeddicts_class_syntax.toml index 8b43fddd6..c60ade248 100644 --- a/conformance/results/pytype/typeddicts_class_syntax.toml +++ b/conformance/results/pytype/typeddicts_class_syntax.toml @@ -5,7 +5,15 @@ Does not report when metaclass is provided. Does not report when other keyword argument is provided. """ output = """ -File "typeddicts_class_syntax.py", line 57, in : Invalid base class: Generic[T] [base-class-error] +typeddicts_class_syntax.py:57:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid base class: Generic[T] [base-class-error] + +class GenericTypedDict(TypedDict, Generic[T]): +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + name: str +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + value: T +\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -14,5 +22,5 @@ Line 33: Expected 1 errors Line 38: Expected 1 errors Line 44: Expected 1 errors Line 49: Expected 1 errors -Line 57: Unexpected errors ['File "typeddicts_class_syntax.py", line 57, in : Invalid base class: Generic[T] [base-class-error]'] +Line 57: Unexpected errors ['typeddicts_class_syntax.py:57:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid base class: Generic[T] [base-class-error]'] """ diff --git a/conformance/results/pytype/typeddicts_inheritance.toml b/conformance/results/pytype/typeddicts_inheritance.toml index 12f674766..ca9002699 100644 --- a/conformance/results/pytype/typeddicts_inheritance.toml +++ b/conformance/results/pytype/typeddicts_inheritance.toml @@ -1,8 +1,26 @@ conformant = "Pass" output = """ -File "typeddicts_inheritance.py", line 44, in : Invalid base class: NonTypedDict [base-class-error] -File "typeddicts_inheritance.py", line 54, in : Invalid base class: X1 [base-class-error] -File "typeddicts_inheritance.py", line 65, in : Invalid base class: Y2 [base-class-error] +typeddicts_inheritance.py:44:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid base class: NonTypedDict [base-class-error] + +class BadTypedDict(TypedDict, NonTypedDict): # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +typeddicts_inheritance.py:54:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid base class: X1 [base-class-error] + +class Y1(X1): # E[Y1] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + x: int # E[Y1]: cannot overwrite TypedDict field "x" +\u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m + +typeddicts_inheritance.py:65:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid base class: Y2 [base-class-error] + +class XYZ2(X2, Y2): # E: cannot overwrite TypedDict field "x" while merging +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + xyz: bool +\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pytype/typeddicts_operations.toml b/conformance/results/pytype/typeddicts_operations.toml index 8ed3fcdc5..a01d0edeb 100644 --- a/conformance/results/pytype/typeddicts_operations.toml +++ b/conformance/results/pytype/typeddicts_operations.toml @@ -6,11 +6,31 @@ Does not reject `clear` method on TypedDict with required keys. Does not reject delete operation for required key in TypedDict. """ output = """ -File "typeddicts_operations.py", line 28, in : Type annotation for movie does not match type of assignment [annotation-type-mismatch] -File "typeddicts_operations.py", line 29, in : Type annotation for movie does not match type of assignment [annotation-type-mismatch] -File "typeddicts_operations.py", line 32, in : Type annotation for movie does not match type of assignment [annotation-type-mismatch] -File "typeddicts_operations.py", line 37, in func1: Type annotation for movie does not match type of assignment [annotation-type-mismatch] -File "typeddicts_operations.py", line 60, in : str [assert-type] +typeddicts_operations.py:28:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for movie does not match type of assignment [annotation-type-mismatch] + +movie = {"name": "Blade Runner"} # E: year is missing +\u001b[1m\u001b[31m~~~~~\u001b[39m\u001b[0m + +typeddicts_operations.py:29:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for movie does not match type of assignment [annotation-type-mismatch] + +movie = {"name": "Blade Runner", "year": 1982.1} # E: year is wrong type +\u001b[1m\u001b[31m~~~~~\u001b[39m\u001b[0m + +typeddicts_operations.py:32:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for movie does not match type of assignment [annotation-type-mismatch] + +movie = {"name": "", "year": 1900, "other": 2} # E: extra key +\u001b[1m\u001b[31m~~~~~\u001b[39m\u001b[0m + +typeddicts_operations.py:37:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Type annotation for movie does not match type of assignment [annotation-type-mismatch] + + movie: Movie = {variable_key: "", "year": 1900} # E: variable key + \u001b[1m\u001b[31m~~~~~\u001b[39m\u001b[0m + +typeddicts_operations.py:60:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : str [assert-type] + +assert_type(movie_optional.get("name"), str | None) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -21,5 +41,5 @@ Line 26: Expected 1 errors Line 47: Expected 1 errors Line 49: Expected 1 errors Line 62: Expected 1 errors -Line 60: Unexpected errors ['File "typeddicts_operations.py", line 60, in : str [assert-type]'] +Line 60: Unexpected errors ['typeddicts_operations.py:60:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : str [assert-type]'] """ diff --git a/conformance/results/pytype/typeddicts_readonly.toml b/conformance/results/pytype/typeddicts_readonly.toml index 6dc215d71..fdf00b964 100644 --- a/conformance/results/pytype/typeddicts_readonly.toml +++ b/conformance/results/pytype/typeddicts_readonly.toml @@ -1,6 +1,10 @@ conformant = "Unsupported" output = """ -File "typeddicts_readonly.py", line 8, in : typing_extensions.ReadOnly not supported yet [not-supported-yet] +typeddicts_readonly.py:8:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing_extensions.ReadOnly not supported yet [not-supported-yet] + +from typing_extensions import ReadOnly +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -10,5 +14,5 @@ Line 50: Expected 1 errors Line 51: Expected 1 errors Line 60: Expected 1 errors Line 61: Expected 1 errors -Line 8: Unexpected errors ['File "typeddicts_readonly.py", line 8, in : typing_extensions.ReadOnly not supported yet [not-supported-yet]'] +Line 8: Unexpected errors ['typeddicts_readonly.py:8:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing_extensions.ReadOnly not supported yet [not-supported-yet]'] """ diff --git a/conformance/results/pytype/typeddicts_readonly_consistency.toml b/conformance/results/pytype/typeddicts_readonly_consistency.toml index 6d3b171ff..466a0505e 100644 --- a/conformance/results/pytype/typeddicts_readonly_consistency.toml +++ b/conformance/results/pytype/typeddicts_readonly_consistency.toml @@ -1,9 +1,25 @@ conformant = "Unsupported" output = """ -File "typeddicts_readonly_consistency.py", line 8, in : typing_extensions.ReadOnly not supported yet [not-supported-yet] -File "typeddicts_readonly_consistency.py", line 34, in func1: Type annotation for v1 does not match type of assignment [annotation-type-mismatch] -File "typeddicts_readonly_consistency.py", line 35, in func1: Type annotation for v2 does not match type of assignment [annotation-type-mismatch] -File "typeddicts_readonly_consistency.py", line 40, in func1: Type annotation for v5 does not match type of assignment [annotation-type-mismatch] +typeddicts_readonly_consistency.py:8:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing_extensions.ReadOnly not supported yet [not-supported-yet] + +from typing_extensions import ReadOnly +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +typeddicts_readonly_consistency.py:34:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Type annotation for v1 does not match type of assignment [annotation-type-mismatch] + + v1: A1 = b # OK + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +typeddicts_readonly_consistency.py:35:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Type annotation for v2 does not match type of assignment [annotation-type-mismatch] + + v2: A1 = c # OK + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +typeddicts_readonly_consistency.py:40:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Type annotation for v5 does not match type of assignment [annotation-type-mismatch] + + v5: C1 = a # E + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -13,7 +29,7 @@ Line 81: Expected 1 errors Line 82: Expected 1 errors Line 84: Expected 1 errors Line 85: Expected 1 errors -Line 8: Unexpected errors ['File "typeddicts_readonly_consistency.py", line 8, in : typing_extensions.ReadOnly not supported yet [not-supported-yet]'] -Line 34: Unexpected errors ['File "typeddicts_readonly_consistency.py", line 34, in func1: Type annotation for v1 does not match type of assignment [annotation-type-mismatch]'] -Line 35: Unexpected errors ['File "typeddicts_readonly_consistency.py", line 35, in func1: Type annotation for v2 does not match type of assignment [annotation-type-mismatch]'] +Line 8: Unexpected errors ['typeddicts_readonly_consistency.py:8:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing_extensions.ReadOnly not supported yet [not-supported-yet]'] +Line 34: Unexpected errors ['typeddicts_readonly_consistency.py:34:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: Type annotation for v1 does not match type of assignment [annotation-type-mismatch]'] +Line 35: Unexpected errors ['typeddicts_readonly_consistency.py:35:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: Type annotation for v2 does not match type of assignment [annotation-type-mismatch]'] """ diff --git a/conformance/results/pytype/typeddicts_readonly_inheritance.toml b/conformance/results/pytype/typeddicts_readonly_inheritance.toml index 83fb06ba8..c8e735abb 100644 --- a/conformance/results/pytype/typeddicts_readonly_inheritance.toml +++ b/conformance/results/pytype/typeddicts_readonly_inheritance.toml @@ -1,22 +1,118 @@ conformant = "Unsupported" output = """ -File "typeddicts_readonly_inheritance.py", line 8, in : typing_extensions.ReadOnly not supported yet [not-supported-yet] -File "typeddicts_readonly_inheritance.py", line 18, in : Invalid base class: NamedDict [base-class-error] -File "typeddicts_readonly_inheritance.py", line 47, in : Invalid base class: AlbumCollection [base-class-error] -File "typeddicts_readonly_inheritance.py", line 47, in : Invalid base class: AlbumCollection [base-class-error] -File "typeddicts_readonly_inheritance.py", line 61, in : Invalid base class: OptionalName [base-class-error] -File "typeddicts_readonly_inheritance.py", line 65, in : Type annotation for d does not match type of assignment [annotation-type-mismatch] -File "typeddicts_readonly_inheritance.py", line 75, in : Invalid base class: OptionalIdent [base-class-error] -File "typeddicts_readonly_inheritance.py", line 83, in : Type annotation for u does not match type of assignment [annotation-type-mismatch] -File "typeddicts_readonly_inheritance.py", line 84, in : Type annotation for u does not match type of assignment [annotation-type-mismatch] -File "typeddicts_readonly_inheritance.py", line 93, in : Invalid base class: F1 [base-class-error] -File "typeddicts_readonly_inheritance.py", line 97, in : Invalid base class: F1 [base-class-error] -File "typeddicts_readonly_inheritance.py", line 101, in : Invalid base class: F1 [base-class-error] -File "typeddicts_readonly_inheritance.py", line 105, in : Invalid base class: F1 [base-class-error] -File "typeddicts_readonly_inheritance.py", line 119, in : Invalid base class: TD_A2 [base-class-error] -File "typeddicts_readonly_inheritance.py", line 119, in : Invalid base class: TD_A2 [base-class-error] -File "typeddicts_readonly_inheritance.py", line 132, in : Invalid base class: TD_B2 [base-class-error] -File "typeddicts_readonly_inheritance.py", line 132, in : Invalid base class: TD_B2 [base-class-error] +typeddicts_readonly_inheritance.py:8:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing_extensions.ReadOnly not supported yet [not-supported-yet] + +from typing_extensions import ReadOnly +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +typeddicts_readonly_inheritance.py:18:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid base class: NamedDict [base-class-error] + +class Album1(NamedDict): +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + name: str +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + year: int +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +typeddicts_readonly_inheritance.py:47:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid base class: AlbumCollection [base-class-error] + +class RecordShop(AlbumCollection): +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + name: str +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + albums: ReadOnly[list[Album1]] # OK +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + alt: ReadOnly[list[str]] # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +typeddicts_readonly_inheritance.py:47:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid base class: AlbumCollection [base-class-error] + +class RecordShop(AlbumCollection): +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + name: str +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + albums: ReadOnly[list[Album1]] # OK +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + alt: ReadOnly[list[str]] # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +typeddicts_readonly_inheritance.py:61:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid base class: OptionalName [base-class-error] + +class RequiredName(OptionalName): +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + name: ReadOnly[Required[str]] # OK +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +typeddicts_readonly_inheritance.py:65:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for d does not match type of assignment [annotation-type-mismatch] + +d: RequiredName = {} # E +\u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +typeddicts_readonly_inheritance.py:75:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid base class: OptionalIdent [base-class-error] + +class User(OptionalIdent): +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ident: str # Required, mutable, and not an int +\u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +typeddicts_readonly_inheritance.py:83:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for u does not match type of assignment [annotation-type-mismatch] + +u = {"ident": 3} # E +\u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +typeddicts_readonly_inheritance.py:84:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for u does not match type of assignment [annotation-type-mismatch] + +u = {} # E +\u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +typeddicts_readonly_inheritance.py:93:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid base class: F1 [base-class-error] + +class F3(F1): +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + a: ReadOnly[int] # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +typeddicts_readonly_inheritance.py:97:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid base class: F1 [base-class-error] + +class F4(F1): +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + a: NotRequired[int] # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +typeddicts_readonly_inheritance.py:101:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid base class: F1 [base-class-error] + +class F5(F1): +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + b: ReadOnly[Required[int]] # OK +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +typeddicts_readonly_inheritance.py:105:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid base class: F1 [base-class-error] + +class F6(F1): +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + c: ReadOnly[NotRequired[int]] # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +typeddicts_readonly_inheritance.py:119:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid base class: TD_A2 [base-class-error] + +class TD_A(TD_A1, TD_A2): ... # E: x is incompatible +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +typeddicts_readonly_inheritance.py:119:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid base class: TD_A2 [base-class-error] + +class TD_A(TD_A1, TD_A2): ... # E: x is incompatible +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +typeddicts_readonly_inheritance.py:132:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid base class: TD_B2 [base-class-error] + +class TD_B(TD_B1, TD_B2): ... # E: x is incompatible +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +typeddicts_readonly_inheritance.py:132:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid base class: TD_B2 [base-class-error] + +class TD_B(TD_B1, TD_B2): ... # E: x is incompatible +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -26,13 +122,13 @@ Line 82: Expected 1 errors Line 94: Expected 1 errors Line 98: Expected 1 errors Line 106: Expected 1 errors -Line 8: Unexpected errors ['File "typeddicts_readonly_inheritance.py", line 8, in : typing_extensions.ReadOnly not supported yet [not-supported-yet]'] -Line 18: Unexpected errors ['File "typeddicts_readonly_inheritance.py", line 18, in : Invalid base class: NamedDict [base-class-error]'] -Line 47: Unexpected errors ['File "typeddicts_readonly_inheritance.py", line 47, in : Invalid base class: AlbumCollection [base-class-error]', 'File "typeddicts_readonly_inheritance.py", line 47, in : Invalid base class: AlbumCollection [base-class-error]'] -Line 61: Unexpected errors ['File "typeddicts_readonly_inheritance.py", line 61, in : Invalid base class: OptionalName [base-class-error]'] -Line 75: Unexpected errors ['File "typeddicts_readonly_inheritance.py", line 75, in : Invalid base class: OptionalIdent [base-class-error]'] -Line 93: Unexpected errors ['File "typeddicts_readonly_inheritance.py", line 93, in : Invalid base class: F1 [base-class-error]'] -Line 97: Unexpected errors ['File "typeddicts_readonly_inheritance.py", line 97, in : Invalid base class: F1 [base-class-error]'] -Line 101: Unexpected errors ['File "typeddicts_readonly_inheritance.py", line 101, in : Invalid base class: F1 [base-class-error]'] -Line 105: Unexpected errors ['File "typeddicts_readonly_inheritance.py", line 105, in : Invalid base class: F1 [base-class-error]'] +Line 8: Unexpected errors ['typeddicts_readonly_inheritance.py:8:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing_extensions.ReadOnly not supported yet [not-supported-yet]'] +Line 18: Unexpected errors ['typeddicts_readonly_inheritance.py:18:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid base class: NamedDict [base-class-error]'] +Line 47: Unexpected errors ['typeddicts_readonly_inheritance.py:47:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid base class: AlbumCollection [base-class-error]', 'typeddicts_readonly_inheritance.py:47:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid base class: AlbumCollection [base-class-error]'] +Line 61: Unexpected errors ['typeddicts_readonly_inheritance.py:61:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid base class: OptionalName [base-class-error]'] +Line 75: Unexpected errors ['typeddicts_readonly_inheritance.py:75:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid base class: OptionalIdent [base-class-error]'] +Line 93: Unexpected errors ['typeddicts_readonly_inheritance.py:93:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid base class: F1 [base-class-error]'] +Line 97: Unexpected errors ['typeddicts_readonly_inheritance.py:97:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid base class: F1 [base-class-error]'] +Line 101: Unexpected errors ['typeddicts_readonly_inheritance.py:101:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid base class: F1 [base-class-error]'] +Line 105: Unexpected errors ['typeddicts_readonly_inheritance.py:105:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid base class: F1 [base-class-error]'] """ diff --git a/conformance/results/pytype/typeddicts_readonly_kwargs.toml b/conformance/results/pytype/typeddicts_readonly_kwargs.toml index 891f4fb7b..d9462a9c7 100644 --- a/conformance/results/pytype/typeddicts_readonly_kwargs.toml +++ b/conformance/results/pytype/typeddicts_readonly_kwargs.toml @@ -1,11 +1,23 @@ conformant = "Unsupported" output = """ -File "typeddicts_readonly_kwargs.py", line 8, in : typing.Unpack not supported yet [not-supported-yet] -File "typeddicts_readonly_kwargs.py", line 9, in : typing_extensions.ReadOnly not supported yet [not-supported-yet] -File "typeddicts_readonly_kwargs.py", line 33, in impl: New container type for kwargs does not match type annotation [container-type-mismatch] +typeddicts_readonly_kwargs.py:8:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing.Unpack not supported yet [not-supported-yet] + +from typing import Protocol, TypedDict, Unpack +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +typeddicts_readonly_kwargs.py:9:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing_extensions.ReadOnly not supported yet [not-supported-yet] + +from typing_extensions import ReadOnly +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +typeddicts_readonly_kwargs.py:33:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in impl: New container type for kwargs does not match type annotation [container-type-mismatch] + + kwargs["key1"] = 3 # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ -Line 8: Unexpected errors ['File "typeddicts_readonly_kwargs.py", line 8, in : typing.Unpack not supported yet [not-supported-yet]'] -Line 9: Unexpected errors ['File "typeddicts_readonly_kwargs.py", line 9, in : typing_extensions.ReadOnly not supported yet [not-supported-yet]'] +Line 8: Unexpected errors ['typeddicts_readonly_kwargs.py:8:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.Unpack not supported yet [not-supported-yet]'] +Line 9: Unexpected errors ['typeddicts_readonly_kwargs.py:9:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing_extensions.ReadOnly not supported yet [not-supported-yet]'] """ diff --git a/conformance/results/pytype/typeddicts_readonly_update.toml b/conformance/results/pytype/typeddicts_readonly_update.toml index 0ffc04761..081375bd7 100644 --- a/conformance/results/pytype/typeddicts_readonly_update.toml +++ b/conformance/results/pytype/typeddicts_readonly_update.toml @@ -1,9 +1,13 @@ conformant = "Unsupported" output = """ -File "typeddicts_readonly_update.py", line 9, in : typing_extensions.ReadOnly not supported yet [not-supported-yet] +typeddicts_readonly_update.py:9:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing_extensions.ReadOnly not supported yet [not-supported-yet] + +from typing_extensions import ReadOnly +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ Line 23: Expected 1 errors -Line 9: Unexpected errors ['File "typeddicts_readonly_update.py", line 9, in : typing_extensions.ReadOnly not supported yet [not-supported-yet]'] +Line 9: Unexpected errors ['typeddicts_readonly_update.py:9:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing_extensions.ReadOnly not supported yet [not-supported-yet]'] """ diff --git a/conformance/results/pytype/typeddicts_type_consistency.toml b/conformance/results/pytype/typeddicts_type_consistency.toml index 24d50b716..f5be59879 100644 --- a/conformance/results/pytype/typeddicts_type_consistency.toml +++ b/conformance/results/pytype/typeddicts_type_consistency.toml @@ -5,10 +5,26 @@ Incorrectly reports type violation in cases where there is none. Does not report type incompatibility between TypedDict and `dict[str, Any]`. """ output = """ -File "typeddicts_type_consistency.py", line 62, in : Type annotation for a3 does not match type of assignment [annotation-type-mismatch] -File "typeddicts_type_consistency.py", line 65, in : Type annotation for b3 does not match type of assignment [annotation-type-mismatch] -File "typeddicts_type_consistency.py", line 69, in : Type annotation for a3_1 does not match type of assignment [annotation-type-mismatch] -File "typeddicts_type_consistency.py", line 126, in : Type annotation for o2 does not match type of assignment [annotation-type-mismatch] +typeddicts_type_consistency.py:62:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for a3 does not match type of assignment [annotation-type-mismatch] + +a3: A3 = b3 +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +typeddicts_type_consistency.py:65:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for b3 does not match type of assignment [annotation-type-mismatch] + +b3 = a3 # E +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +typeddicts_type_consistency.py:69:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for a3_1 does not match type of assignment [annotation-type-mismatch] + +a3_1: A3 = {"x": 0, "y": 0} # E +\u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m + +typeddicts_type_consistency.py:126:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for o2 does not match type of assignment [annotation-type-mismatch] + +o2: Outer1 = {"outer_key": {"inner_key": {"inner_key": 1}}} # E +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -18,5 +34,5 @@ Line 76: Expected 1 errors Line 77: Expected 1 errors Line 78: Expected 1 errors Line 82: Expected 1 errors -Line 62: Unexpected errors ['File "typeddicts_type_consistency.py", line 62, in : Type annotation for a3 does not match type of assignment [annotation-type-mismatch]'] +Line 62: Unexpected errors ['typeddicts_type_consistency.py:62:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for a3 does not match type of assignment [annotation-type-mismatch]'] """ diff --git a/conformance/results/pytype/typeddicts_usage.toml b/conformance/results/pytype/typeddicts_usage.toml index 746ab3414..09e50f725 100644 --- a/conformance/results/pytype/typeddicts_usage.toml +++ b/conformance/results/pytype/typeddicts_usage.toml @@ -4,9 +4,21 @@ Does not report errant use of TypedDict in `isinstance` call. Does not reject use of TypedDict as TypeVar bound. """ output = """ -File "typeddicts_usage.py", line 23, in : TypedDict Movie does not contain key director [typed-dict-error] -File "typeddicts_usage.py", line 24, in : Type annotation for key year in TypedDict Movie does not match type of assignment [annotation-type-mismatch] -File "typeddicts_usage.py", line 28, in : Type annotation for movie2 does not match type of assignment [annotation-type-mismatch] +typeddicts_usage.py:23:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : TypedDict Movie does not contain key director [typed-dict-error] + +movie["director"] = "Ridley Scott" # E: invalid key 'director' +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +typeddicts_usage.py:24:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for key year in TypedDict Movie does not match type of assignment [annotation-type-mismatch] + +movie["year"] = "1982" # E: invalid value type ("int" expected) +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +typeddicts_usage.py:28:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for movie2 does not match type of assignment [annotation-type-mismatch] + +movie2: Movie = {"title": "Blade Runner", "year": 1982} # E +\u001b[1m\u001b[31m~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ diff --git a/conformance/results/pytype/version.toml b/conformance/results/pytype/version.toml index a03e3ca2e..19259c3aa 100644 --- a/conformance/results/pytype/version.toml +++ b/conformance/results/pytype/version.toml @@ -1,2 +1,2 @@ -version = "pytype 2024.04.11" -test_duration = 35.2 +version = "pytype 2024.09.13" +test_duration = 32.8 diff --git a/conformance/results/results.html b/conformance/results/results.html index f6bfa00cb..cffa1e37f 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -158,17 +158,17 @@

    Python Type System Conformance Test Results

    - - - - + @@ -608,7 +608,7 @@

    Python Type System Conformance Test Results

    - + @@ -647,7 +647,7 @@

    Python Type System Conformance Test Results

    - + diff --git a/conformance/src/type_checker.py b/conformance/src/type_checker.py index d4404d12d..c8955c0fa 100644 --- a/conformance/src/type_checker.py +++ b/conformance/src/type_checker.py @@ -74,10 +74,22 @@ def install(self) -> bool: pass try: + # Uninstall any existing version if present. run( - [sys.executable, "-m", "pip", "install", "mypy", "--upgrade"], + [sys.executable, "-m", "pip", "uninstall", "mypy", "-y"], check=True, ) + + # Install the latest version. + run( + [sys.executable, "-m", "pip", "install", "mypy"], + check=True, + ) + + # Run "mypy --version" to ensure that it's installed and to work + # around timing issues caused by malware scanners on some systems. + self.get_version() + return True except CalledProcessError: print("Unable to install mypy") @@ -142,9 +154,15 @@ def name(self) -> str: def install(self) -> bool: try: - # Install the Python wrapper if it's not installed. + # Uninstall any old version if present. + run( + [sys.executable, "-m", "pip", "uninstall", "pyright", "-y"], + check=True, + ) + + # Install the latest version. run( - [sys.executable, "-m", "pip", "install", "pyright", "--upgrade"], + [sys.executable, "-m", "pip", "install", "pyright"], check=True, ) @@ -214,8 +232,15 @@ def install(self) -> bool: pass try: + # Uninstall any existing version if present. run( - [sys.executable, "-m", "pip", "install", "pyre-check", "--upgrade"], + [sys.executable, "-m", "pip", "uninstall", "pyre-check", "-y"], + check=True, + ) + + # Install the latest version. + run( + [sys.executable, "-m", "pip", "install", "pyre-check"], check=True, ) @@ -270,10 +295,18 @@ def name(self) -> str: def install(self) -> bool: try: + # Uninstall any existing version if present. run( - [sys.executable, "-m", "pip", "install", "pytype", "--upgrade"], + [sys.executable, "-m", "pip", "uninstall", "pytype", "-y"], check=True, ) + + # Install the latest version. + run( + [sys.executable, "-m", "pip", "install", "pytype"], + check=True, + ) + return True except CalledProcessError: print("Unable to install pytype on this platform") @@ -331,7 +364,7 @@ def __init__(self, err: pytype_errors.Error) -> None: self._err = err def __lt__(self, other: "ErrorSorter", /) -> bool: - lineno_diff = self._err.lineno - other._err.lineno + lineno_diff = self._err.line - other._err.line if lineno_diff != 0: return lineno_diff < 0 return other._err.message < self._err.message @@ -339,7 +372,7 @@ def __lt__(self, other: "ErrorSorter", /) -> bool: def __eq__(self, other: object, /) -> bool: return ( isinstance(other, ErrorSorter) - and self._err.lineno == other._err.lineno + and self._err.line == other._err.line and other._err.message == self._err.message ) @@ -350,16 +383,13 @@ def __eq__(self, other: object, /) -> bool: return "\n".join(map(str, errors)) + "\n" def parse_errors(self, output: Sequence[str]) -> dict[int, list[str]]: - # File "narrowing_typeguard.py", line 128, in : Function takes_callable_str was called with the wrong arguments [wrong-arg-types] - # File "directives_type_ignore.py", line 11: Stray type comment: ignore - additional stuff [ignored-type-comment]' + # annotations_forward_refs.py:103:1: unexpected indent [python-compiler-error] line_to_errors: dict[int, list[str]] = {} for line in output: - if '.py", line ' not in line: - continue - match = re.search(r"^File \"[^\"]+?\", line (\d+)", line) - assert match is not None, f"Failed to parse line number from: {line!r}" - lineno = int(match.group(1)) - line_to_errors.setdefault(int(lineno), []).append(line) + match = re.search(r"^[a-zA-Z0-9_]+.py:(\d+):(\d+): ", line) + if match is not None: + lineno = int(match.group(1)) + line_to_errors.setdefault(int(lineno), []).append(line) return line_to_errors diff --git a/conformance/tests/generics_syntax_infer_variance.py b/conformance/tests/generics_syntax_infer_variance.py index f19b6a181..7df2e64e8 100644 --- a/conformance/tests/generics_syntax_infer_variance.py +++ b/conformance/tests/generics_syntax_infer_variance.py @@ -51,8 +51,15 @@ class ShouldBeCovariant4(Generic[T]): x: T -vo4_1: ShouldBeCovariant4[float] = ShouldBeCovariant4[int](1) # OK -vo4_4: ShouldBeCovariant4[int] = ShouldBeCovariant4[float](1.0) # E +# This test is problematic as of Python 3.13 because of the +# newly synthesized "__replace__" method, which causes the type +# variable to be inferred as invariant rather than covariant. +# See https://github.com/python/mypy/issues/17623#issuecomment-2266312738 +# for details. Until we sort this out, we'll leave this test commented +# out. + +# vo4_1: ShouldBeCovariant4[float] = ShouldBeCovariant4[int](1) # OK +# vo4_4: ShouldBeCovariant4[int] = ShouldBeCovariant4[float](1.0) # E class ShouldBeCovariant5(Generic[T]): From c5e52dd704b9792196f7d2acdf8824772f2da827 Mon Sep 17 00:00:00 2001 From: Eric Traut Date: Fri, 11 Oct 2024 13:38:19 -0700 Subject: [PATCH 051/308] =?UTF-8?q?Fixed=20a=20bug=20in=20the=20protocols?= =?UTF-8?q?=5Fgeneric.py=20test=20related=20to=20protocol=20matc=E2=80=A6?= =?UTF-8?q?=20(#1864)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixed a bug in the protocols_generic.py test related to protocol matching when method-scoped type variables were used. Both pyright and mypy were previously reported as failing this test, but they were actually working correctly. This was a bug in the original test case (which I wrote). Updated to the latest version of pytest (2024.10.11). It updates many error messages but has no substantive changes to the conformance results. --- .../results/mypy/protocols_generic.toml | 8 +- conformance/results/mypy/version.toml | 2 +- .../results/pyre/protocols_generic.toml | 1 + .../results/pyright/protocols_generic.toml | 8 +- conformance/results/pyright/version.toml | 2 +- .../results/pytype/aliases_explicit.toml | 6 +- .../results/pytype/aliases_implicit.toml | 8 +- .../results/pytype/aliases_typealiastype.toml | 4 +- .../pytype/annotations_forward_refs.toml | 6 +- .../results/pytype/annotations_typeexpr.toml | 4 +- .../results/pytype/callables_kwargs.toml | 4 +- .../results/pytype/dataclasses_slots.toml | 6 +- .../pytype/directives_reveal_type.toml | 4 +- .../pytype/generics_defaults_referential.toml | 14 +- .../results/pytype/generics_scoping.toml | 8 +- .../pytype/generics_self_advanced.toml | 12 +- .../results/pytype/generics_self_basic.toml | 8 +- .../pytype/generics_typevartuple_args.toml | 30 ++-- .../pytype/generics_typevartuple_basic.toml | 24 +-- .../generics_typevartuple_callable.toml | 28 ++-- .../pytype/generics_typevartuple_concat.toml | 12 +- .../generics_typevartuple_specialization.toml | 142 +++++++++--------- .../pytype/namedtuples_define_class.toml | 8 +- .../results/pytype/narrowing_typeis.toml | 4 +- .../results/pytype/protocols_generic.toml | 1 + .../results/pytype/qualifiers_annotated.toml | 2 +- .../results/pytype/specialtypes_type.toml | 12 +- .../results/pytype/tuples_type_compat.toml | 8 +- .../results/pytype/tuples_unpacked.toml | 12 +- conformance/results/pytype/version.toml | 4 +- conformance/results/results.html | 12 +- conformance/tests/protocols_generic.py | 2 +- 32 files changed, 200 insertions(+), 206 deletions(-) diff --git a/conformance/results/mypy/protocols_generic.toml b/conformance/results/mypy/protocols_generic.toml index 68b145e39..407eefd55 100644 --- a/conformance/results/mypy/protocols_generic.toml +++ b/conformance/results/mypy/protocols_generic.toml @@ -1,7 +1,4 @@ -conformant = "Partial" -notes = """ -Fails protocol matching when method-scoped TypeVar is used in protocol. -""" +conformant = "Pass" output = """ protocols_generic.py:40: error: Incompatible types in assignment (expression has type "Concrete1", variable has type "Proto1[int, str]") [assignment] protocols_generic.py:40: note: Following member(s) of "Concrete1" have conflicts: @@ -39,7 +36,6 @@ protocols_generic.py:147: note: def [T] m(self, item: T, callback: Calla protocols_generic.py:147: note: Got: protocols_generic.py:147: note: def m(self, item: str, callback: Callable[[int], str]) -> str """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 145: Unexpected errors ['protocols_generic.py:145: error: Incompatible types in assignment (expression has type "ConcreteHasProperty2", variable has type "HasPropertyProto") [assignment]'] """ diff --git a/conformance/results/mypy/version.toml b/conformance/results/mypy/version.toml index aa90cb33e..f2673d1c6 100644 --- a/conformance/results/mypy/version.toml +++ b/conformance/results/mypy/version.toml @@ -1,2 +1,2 @@ version = "mypy 1.11.2" -test_duration = 1.9 +test_duration = 1.6 diff --git a/conformance/results/pyre/protocols_generic.toml b/conformance/results/pyre/protocols_generic.toml index f1370fa7c..0f071ec3d 100644 --- a/conformance/results/pyre/protocols_generic.toml +++ b/conformance/results/pyre/protocols_generic.toml @@ -14,5 +14,6 @@ protocols_generic.py:146:0 Incompatible variable type [9]: hp3 is declared to ha conformance_automated = "Fail" errors_diff = """ Line 44: Expected 1 errors +Line 145: Expected 1 errors Line 147: Expected 1 errors """ diff --git a/conformance/results/pyright/protocols_generic.toml b/conformance/results/pyright/protocols_generic.toml index d15dd1cea..f19f84dae 100644 --- a/conformance/results/pyright/protocols_generic.toml +++ b/conformance/results/pyright/protocols_generic.toml @@ -1,7 +1,4 @@ -conformant = "Partial" -notes = """ -Incorrectly generates type violation for protocol that uses method-scoped type variables. -""" +conformant = "Pass" output = """ protocols_generic.py:40:24 - error: Type "Concrete1" is not assignable to declared type "Proto1[int, str]"   "Concrete1" is incompatible with protocol "Proto1[int, str]" @@ -55,7 +52,6 @@ protocols_generic.py:147:25 - error: Type "ConcreteHasProperty4" is not assignab         Parameter 2: type "(T@m) -> str" is incompatible with type "(int) -> str"           Type "(T@m) -> str" is not assignable to type "(int) -> str" (reportAssignmentType) """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 145: Unexpected errors ['protocols_generic.py:145:25 - error: Type "ConcreteHasProperty2" is not assignable to declared type "HasPropertyProto"'] """ diff --git a/conformance/results/pyright/version.toml b/conformance/results/pyright/version.toml index a90f554cf..17fcd9132 100644 --- a/conformance/results/pyright/version.toml +++ b/conformance/results/pyright/version.toml @@ -1,2 +1,2 @@ version = "pyright 1.1.384" -test_duration = 1.3 +test_duration = 1.2 diff --git a/conformance/results/pytype/aliases_explicit.toml b/conformance/results/pytype/aliases_explicit.toml index 27f65cc61..c46571aff 100644 --- a/conformance/results/pytype/aliases_explicit.toml +++ b/conformance/results/pytype/aliases_explicit.toml @@ -32,12 +32,12 @@ aliases_explicit.py:67:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'List[Optional[int]][int]' [invalid-annotation] +aliases_explicit.py:68:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'list[Optional[int]][int]' [invalid-annotation] p2: GoodTypeAlias3[int], # E: type alias is already specialized \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -aliases_explicit.py:69:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'List[T][int, int]' [invalid-annotation] +aliases_explicit.py:69:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'list[T][int, int]' [invalid-annotation] p3: GoodTypeAlias4[int, int], # E: too many type arguments \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -62,7 +62,7 @@ aliases_explicit.py:81:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' for BadTypeAlias4 [invalid-annotation] +aliases_explicit.py:82:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' for BadTypeAlias4 [invalid-annotation] BadTypeAlias4: TA = [int for i in range(1)] # E \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m diff --git a/conformance/results/pytype/aliases_implicit.toml b/conformance/results/pytype/aliases_implicit.toml index 64e38336b..2be1cfd68 100644 --- a/conformance/results/pytype/aliases_implicit.toml +++ b/conformance/results/pytype/aliases_implicit.toml @@ -32,12 +32,12 @@ aliases_implicit.py:76:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'List[Optional[int]][int]' [invalid-annotation] +aliases_implicit.py:77:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'list[Optional[int]][int]' [invalid-annotation] p2: GoodTypeAlias3[int], # E: type alias is already specialized \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -aliases_implicit.py:78:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'List[T][int, int]' [invalid-annotation] +aliases_implicit.py:78:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'list[T][int, int]' [invalid-annotation] p3: GoodTypeAlias4[int, int], # E: too many type arguments \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -126,7 +126,7 @@ def bad_type_aliases( pass \u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m -aliases_implicit.py:105:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' for p4 [invalid-annotation] +aliases_implicit.py:105:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' for p4 [invalid-annotation] def bad_type_aliases( \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -338,5 +338,5 @@ Line 133: Expected 1 errors Line 54: Unexpected errors ["aliases_implicit.py:54:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '[str, str]' [invalid-annotation]", "aliases_implicit.py:54:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Callable[Concatenate[int, P], R][[str, str], None]' [invalid-annotation]"] Line 68: Unexpected errors ['aliases_implicit.py:68:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in good_type_aliases: Callable[Concatenate, Any] [assert-type]'] Line 72: Unexpected errors ['aliases_implicit.py:72:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in good_type_aliases: Callable[[Any], None] [assert-type]'] -Line 105: Unexpected errors ["aliases_implicit.py:105:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '[int, str]' for p2 [invalid-annotation]", "aliases_implicit.py:105:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'True' for p10 [invalid-annotation]", "aliases_implicit.py:105:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' for p4 [invalid-annotation]", "aliases_implicit.py:105:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '3' for p9 [invalid-annotation]", "aliases_implicit.py:105:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '1' for p11 [invalid-annotation]", "aliases_implicit.py:105:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '((int, str),)' for p3 [invalid-annotation]", 'aliases_implicit.py:105:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation "{\\'a\\': \\'b\\'}" for p5 [invalid-annotation]'] +Line 105: Unexpected errors ["aliases_implicit.py:105:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '[int, str]' for p2 [invalid-annotation]", "aliases_implicit.py:105:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'True' for p10 [invalid-annotation]", "aliases_implicit.py:105:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' for p4 [invalid-annotation]", "aliases_implicit.py:105:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '3' for p9 [invalid-annotation]", "aliases_implicit.py:105:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '1' for p11 [invalid-annotation]", "aliases_implicit.py:105:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '((int, str),)' for p3 [invalid-annotation]", 'aliases_implicit.py:105:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation "{\\'a\\': \\'b\\'}" for p5 [invalid-annotation]'] """ diff --git a/conformance/results/pytype/aliases_typealiastype.toml b/conformance/results/pytype/aliases_typealiastype.toml index 9e13b0358..a9d4ad6b4 100644 --- a/conformance/results/pytype/aliases_typealiastype.toml +++ b/conformance/results/pytype/aliases_typealiastype.toml @@ -28,7 +28,7 @@ aliases_typealiastype.py:22:40: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Callable[P, TStr] | list[S] | list[GoodAlias5[S, TStr, P]] | tuple[*Ts], \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m -aliases_typealiastype.py:22:66: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] +aliases_typealiastype.py:22:66: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] Callable[P, TStr] | list[S] | list[GoodAlias5[S, TStr, P]] | tuple[*Ts], \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m @@ -77,5 +77,5 @@ Line 5: Unexpected errors ['aliases_typealiastype.py:5:1: \\x1b[1m\\x1b[31merror Line 11: Unexpected errors ['aliases_typealiastype.py:11:6: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] Line 16: Unexpected errors ["aliases_typealiastype.py:16:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] Line 19: Unexpected errors ["aliases_typealiastype.py:19:51: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Name 'GoodAlias4' is not defined [name-error]"] -Line 22: Unexpected errors ["aliases_typealiastype.py:22:40: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Name 'GoodAlias5' is not defined [name-error]", "aliases_typealiastype.py:22:66: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 22: Unexpected errors ["aliases_typealiastype.py:22:40: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Name 'GoodAlias5' is not defined [name-error]", "aliases_typealiastype.py:22:66: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] """ diff --git a/conformance/results/pytype/annotations_forward_refs.toml b/conformance/results/pytype/annotations_forward_refs.toml index b493b07e0..c8757a0c1 100644 --- a/conformance/results/pytype/annotations_forward_refs.toml +++ b/conformance/results/pytype/annotations_forward_refs.toml @@ -16,7 +16,7 @@ annotations_forward_refs.py:23:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: bad2: list[ClassA] # E: Runtime error: requires quotes \u001b[1m\u001b[31m~~~~~~\u001b[39m\u001b[0m -annotations_forward_refs.py:24:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : unsupported operand type(s) for |: ''ClassA': str' and 'int: Type[int]' [unsupported-operands] +annotations_forward_refs.py:24:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : unsupported operand type(s) for |: ''ClassA': str' and 'int: type[int]' [unsupported-operands] bad3: "ClassA" | int # E: Runtime error \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -182,7 +182,7 @@ def invalid_annotations( pass \u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m -annotations_forward_refs.py:40:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' for p4 [invalid-annotation] +annotations_forward_refs.py:40:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' for p4 [invalid-annotation] def invalid_annotations( \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -438,7 +438,7 @@ Line 52: Expected 1 errors Line 53: Expected 1 errors Line 54: Expected 1 errors Line 55: Expected 1 errors -Line 40: Unexpected errors ["annotations_forward_refs.py:40:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '{}' for p5 [invalid-annotation]", "annotations_forward_refs.py:40:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '[int, str]' for p2 [invalid-annotation]", "annotations_forward_refs.py:40:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'True' for p10 [invalid-annotation]", "annotations_forward_refs.py:40:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' for p15 [invalid-annotation]", "annotations_forward_refs.py:40:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' for p4 [invalid-annotation]", "annotations_forward_refs.py:40:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '1' for p9 [invalid-annotation]", "annotations_forward_refs.py:40:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '1' for p11 [invalid-annotation]", "annotations_forward_refs.py:40:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '-1' for p12 [invalid-annotation]", "annotations_forward_refs.py:40:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '(int, str)' for p3 [invalid-annotation]"] +Line 40: Unexpected errors ["annotations_forward_refs.py:40:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '{}' for p5 [invalid-annotation]", "annotations_forward_refs.py:40:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '[int, str]' for p2 [invalid-annotation]", "annotations_forward_refs.py:40:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'True' for p10 [invalid-annotation]", "annotations_forward_refs.py:40:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' for p15 [invalid-annotation]", "annotations_forward_refs.py:40:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' for p4 [invalid-annotation]", "annotations_forward_refs.py:40:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '1' for p9 [invalid-annotation]", "annotations_forward_refs.py:40:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '1' for p11 [invalid-annotation]", "annotations_forward_refs.py:40:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '-1' for p12 [invalid-annotation]", "annotations_forward_refs.py:40:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '(int, str)' for p3 [invalid-annotation]"] Line 82: Unexpected errors ["annotations_forward_refs.py:82:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in ClassD: Invalid type annotation '' for str [invalid-annotation]"] Line 87: Unexpected errors ["annotations_forward_refs.py:87:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in ClassD: Invalid type annotation '' for x [invalid-annotation]"] Line 96: Unexpected errors ['annotations_forward_refs.py:96:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Any [assert-type]'] diff --git a/conformance/results/pytype/annotations_typeexpr.toml b/conformance/results/pytype/annotations_typeexpr.toml index 87fa1060c..322d352c5 100644 --- a/conformance/results/pytype/annotations_typeexpr.toml +++ b/conformance/results/pytype/annotations_typeexpr.toml @@ -164,7 +164,7 @@ def invalid_annotations( pass \u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m -annotations_typeexpr.py:87:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' for p4 [invalid-annotation] +annotations_typeexpr.py:87:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' for p4 [invalid-annotation] def invalid_annotations( \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -377,5 +377,5 @@ Line 99: Expected 1 errors Line 100: Expected 1 errors Line 101: Expected 1 errors Line 102: Expected 1 errors -Line 87: Unexpected errors ["annotations_typeexpr.py:87:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '{}' for p5 [invalid-annotation]", "annotations_typeexpr.py:87:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '[int, str]' for p2 [invalid-annotation]", "annotations_typeexpr.py:87:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'True' for p10 [invalid-annotation]", "annotations_typeexpr.py:87:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' for p15 [invalid-annotation]", "annotations_typeexpr.py:87:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' for p4 [invalid-annotation]", "annotations_typeexpr.py:87:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '3' for p9 [invalid-annotation]", "annotations_typeexpr.py:87:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '1' for p11 [invalid-annotation]", "annotations_typeexpr.py:87:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '-1' for p12 [invalid-annotation]", "annotations_typeexpr.py:87:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '(int, str)' for p3 [invalid-annotation]"] +Line 87: Unexpected errors ["annotations_typeexpr.py:87:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '{}' for p5 [invalid-annotation]", "annotations_typeexpr.py:87:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '[int, str]' for p2 [invalid-annotation]", "annotations_typeexpr.py:87:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'True' for p10 [invalid-annotation]", "annotations_typeexpr.py:87:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' for p15 [invalid-annotation]", "annotations_typeexpr.py:87:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' for p4 [invalid-annotation]", "annotations_typeexpr.py:87:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '3' for p9 [invalid-annotation]", "annotations_typeexpr.py:87:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '1' for p11 [invalid-annotation]", "annotations_typeexpr.py:87:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '-1' for p12 [invalid-annotation]", "annotations_typeexpr.py:87:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '(int, str)' for p3 [invalid-annotation]"] """ diff --git a/conformance/results/pytype/callables_kwargs.toml b/conformance/results/pytype/callables_kwargs.toml index ae052884d..a44b3c5c5 100644 --- a/conformance/results/pytype/callables_kwargs.toml +++ b/conformance/results/pytype/callables_kwargs.toml @@ -23,7 +23,7 @@ callables_kwargs.py:35:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: assert_type(v3, str) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -callables_kwargs.py:41:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func2: Dict[str, Unpack[TD1]] [assert-type] +callables_kwargs.py:41:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func2: dict[str, Unpack[TD1]] [assert-type] assert_type(kwargs, TD1) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -86,7 +86,7 @@ Line 10: Unexpected errors ['callables_kwargs.py:10:1: \\x1b[1m\\x1b[31merror\\x Line 24: Unexpected errors ['callables_kwargs.py:24:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: Unpack[TD2] [assert-type]'] Line 32: Unexpected errors ['callables_kwargs.py:32:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: Unpack[TD2] [assert-type]'] Line 35: Unexpected errors ['callables_kwargs.py:35:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: Unpack[TD2] [assert-type]'] -Line 41: Unexpected errors ['callables_kwargs.py:41:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func2: Dict[str, Unpack[TD1]] [assert-type]'] +Line 41: Unexpected errors ['callables_kwargs.py:41:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func2: dict[str, Unpack[TD1]] [assert-type]'] Line 47: Unexpected errors ['callables_kwargs.py:47:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func3: Function func1 was called with the wrong arguments [wrong-arg-types]'] Line 49: Unexpected errors ["callables_kwargs.py:49:11: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func3: Missing parameter 'v2' in call to function TD2.__init__ [missing-parameter]"] """ diff --git a/conformance/results/pytype/dataclasses_slots.toml b/conformance/results/pytype/dataclasses_slots.toml index be10aba0c..c3318af84 100644 --- a/conformance/results/pytype/dataclasses_slots.toml +++ b/conformance/results/pytype/dataclasses_slots.toml @@ -5,7 +5,7 @@ Does not reject write to instance variable that is not defined in __slots__. Incorrectly reports error when accessing `__slots__` when `slots=True`. """ output = """ -dataclasses_slots.py:56:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : No attribute '__slots__' on Type[DC5] [attribute-error] +dataclasses_slots.py:56:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : No attribute '__slots__' on type[DC5] [attribute-error] DC5.__slots__ \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -15,7 +15,7 @@ dataclasses_slots.py:57:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : No attribute '__slots__' on Type[DC6] [attribute-error] +dataclasses_slots.py:66:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : No attribute '__slots__' on type[DC6] [attribute-error] DC6.__slots__ # E \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -31,6 +31,6 @@ errors_diff = """ Line 25: Expected 1 errors Line 38: Expected 1 errors Lines 10, 11: Expected error (tag 'DC1') -Line 56: Unexpected errors ["dataclasses_slots.py:56:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : No attribute '__slots__' on Type[DC5] [attribute-error]"] +Line 56: Unexpected errors ["dataclasses_slots.py:56:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : No attribute '__slots__' on type[DC5] [attribute-error]"] Line 57: Unexpected errors ["dataclasses_slots.py:57:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : No attribute '__slots__' on DC5 [attribute-error]"] """ diff --git a/conformance/results/pytype/directives_reveal_type.toml b/conformance/results/pytype/directives_reveal_type.toml index a18c7d076..05358bc89 100644 --- a/conformance/results/pytype/directives_reveal_type.toml +++ b/conformance/results/pytype/directives_reveal_type.toml @@ -9,7 +9,7 @@ directives_reveal_type.py:14:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in reveal_type(a) # Revealed type is "int | str" \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m -directives_reveal_type.py:15:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: List[int] [reveal-type] +directives_reveal_type.py:15:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: list[int] [reveal-type] reveal_type(b) # Revealed type is "list[int]" \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -34,7 +34,7 @@ conformance_automated = "Fail" errors_diff = """ Line 19: Expected 1 errors Line 14: Unexpected errors ['directives_reveal_type.py:14:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: Union[int, str] [reveal-type]'] -Line 15: Unexpected errors ['directives_reveal_type.py:15:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: List[int] [reveal-type]'] +Line 15: Unexpected errors ['directives_reveal_type.py:15:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: list[int] [reveal-type]'] Line 16: Unexpected errors ['directives_reveal_type.py:16:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: Any [reveal-type]'] Line 17: Unexpected errors ['directives_reveal_type.py:17:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: ForwardReference [reveal-type]'] """ diff --git a/conformance/results/pytype/generics_defaults_referential.toml b/conformance/results/pytype/generics_defaults_referential.toml index 2a72e5070..713d5a104 100644 --- a/conformance/results/pytype/generics_defaults_referential.toml +++ b/conformance/results/pytype/generics_defaults_referential.toml @@ -155,22 +155,22 @@ generics_defaults_referential.py:94:23: \u001b[1m\u001b[31merror\u001b[39m\u001b assert_type(Bar, type[Bar[Any, list[Any]]]) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_defaults_referential.py:95:28: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Bar[int, List[int]]' [invalid-annotation] +generics_defaults_referential.py:95:28: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Bar[int, list[int]]' [invalid-annotation] assert_type(Bar[int], type[Bar[int, list[int]]]) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_defaults_referential.py:96:30: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Bar[int, List[int]]' [invalid-annotation] +generics_defaults_referential.py:96:30: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Bar[int, list[int]]' [invalid-annotation] assert_type(Bar[int](0, []), Bar[int, list[int]]) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_defaults_referential.py:97:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Bar[int, List[str]]' [invalid-annotation] +generics_defaults_referential.py:97:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Bar[int, list[str]]' [invalid-annotation] assert_type(Bar[int, list[str]](0, []), Bar[int, list[str]]) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_defaults_referential.py:97:41: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Bar[int, List[str]]' [invalid-annotation] +generics_defaults_referential.py:97:41: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Bar[int, list[str]]' [invalid-annotation] assert_type(Bar[int, list[str]](0, []), Bar[int, list[str]]) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -210,8 +210,8 @@ Line 77: Unexpected errors ['generics_defaults_referential.py:77:1: \\x1b[1m\\x1 Line 87: Unexpected errors ['generics_defaults_referential.py:87:16: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] Line 90: Unexpected errors ["generics_defaults_referential.py:90:11: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] Line 94: Unexpected errors ["generics_defaults_referential.py:94:23: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Bar[Any, list]' [invalid-annotation]"] -Line 95: Unexpected errors ["generics_defaults_referential.py:95:28: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Bar[int, List[int]]' [invalid-annotation]"] -Line 96: Unexpected errors ["generics_defaults_referential.py:96:30: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Bar[int, List[int]]' [invalid-annotation]"] -Line 97: Unexpected errors ["generics_defaults_referential.py:97:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Bar[int, List[str]]' [invalid-annotation]", "generics_defaults_referential.py:97:41: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Bar[int, List[str]]' [invalid-annotation]"] +Line 95: Unexpected errors ["generics_defaults_referential.py:95:28: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Bar[int, list[int]]' [invalid-annotation]"] +Line 96: Unexpected errors ["generics_defaults_referential.py:96:30: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Bar[int, list[int]]' [invalid-annotation]"] +Line 97: Unexpected errors ["generics_defaults_referential.py:97:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Bar[int, list[str]]' [invalid-annotation]", "generics_defaults_referential.py:97:41: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Bar[int, list[str]]' [invalid-annotation]"] Line 98: Unexpected errors ["generics_defaults_referential.py:98:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Bar[int, str]' [invalid-annotation]", "generics_defaults_referential.py:98:35: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Bar[int, str]' [invalid-annotation]"] """ diff --git a/conformance/results/pytype/generics_scoping.toml b/conformance/results/pytype/generics_scoping.toml index d9f7e61d4..32c0fd18d 100644 --- a/conformance/results/pytype/generics_scoping.toml +++ b/conformance/results/pytype/generics_scoping.toml @@ -9,12 +9,12 @@ generics_scoping.py:29:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'List[T]' for global_var2 [invalid-annotation] +generics_scoping.py:95:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'list[T]' for global_var2 [invalid-annotation] global_var2: list[T] = [] # E \u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m diff --git a/conformance/results/pytype/generics_self_advanced.toml b/conformance/results/pytype/generics_self_advanced.toml index 9a818632f..c2cc90e86 100644 --- a/conformance/results/pytype/generics_self_advanced.toml +++ b/conformance/results/pytype/generics_self_advanced.toml @@ -39,7 +39,7 @@ generics_self_advanced.py:35:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in assert_type(self, Self) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_self_advanced.py:36:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method2: List[ChildB] [assert-type] +generics_self_advanced.py:36:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method2: list[ChildB] [assert-type] assert_type(self.a, list[Self]) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -54,12 +54,12 @@ generics_self_advanced.py:38:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in assert_type(self.method1(), Self) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_self_advanced.py:42:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method3: Type[ChildB] [assert-type] +generics_self_advanced.py:42:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method3: type[ChildB] [assert-type] assert_type(cls, type[Self]) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_self_advanced.py:43:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method3: List[ChildB] [assert-type] +generics_self_advanced.py:43:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method3: list[ChildB] [assert-type] assert_type(cls.a, list[Self]) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -81,11 +81,11 @@ Line 12: Unexpected errors ['generics_self_advanced.py:12:9: \\x1b[1m\\x1b[31mer Line 19: Unexpected errors ['generics_self_advanced.py:19:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : ParentA [assert-type]'] Line 29: Unexpected errors ['generics_self_advanced.py:29:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method1: bad return type [bad-return-type]', 'generics_self_advanced.py:29:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method1: bad return type [bad-return-type]'] Line 35: Unexpected errors ['generics_self_advanced.py:35:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method2: ChildB [assert-type]'] -Line 36: Unexpected errors ['generics_self_advanced.py:36:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method2: List[ChildB] [assert-type]'] +Line 36: Unexpected errors ['generics_self_advanced.py:36:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method2: list[ChildB] [assert-type]'] Line 37: Unexpected errors ['generics_self_advanced.py:37:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method2: ChildB [assert-type]'] Line 38: Unexpected errors ['generics_self_advanced.py:38:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method2: ChildB [assert-type]'] -Line 42: Unexpected errors ['generics_self_advanced.py:42:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method3: Type[ChildB] [assert-type]'] -Line 43: Unexpected errors ['generics_self_advanced.py:43:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method3: List[ChildB] [assert-type]'] +Line 42: Unexpected errors ['generics_self_advanced.py:42:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method3: type[ChildB] [assert-type]'] +Line 43: Unexpected errors ['generics_self_advanced.py:43:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method3: list[ChildB] [assert-type]'] Line 44: Unexpected errors ['generics_self_advanced.py:44:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method3: ChildB [assert-type]'] Line 45: Unexpected errors ['generics_self_advanced.py:45:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method3: ChildB [assert-type]'] """ diff --git a/conformance/results/pytype/generics_self_basic.toml b/conformance/results/pytype/generics_self_basic.toml index 0eb9ab43e..28ff372ae 100644 --- a/conformance/results/pytype/generics_self_basic.toml +++ b/conformance/results/pytype/generics_self_basic.toml @@ -15,14 +15,14 @@ generics_self_basic.py:14:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in set Called from (traceback): line 52, in current file -generics_self_basic.py:27:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in from_config: Type[Shape] [assert-type] +generics_self_basic.py:27:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in from_config: type[Shape] [assert-type] assert_type(cls, type[Self]) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m Called from (traceback): line 54, in current file -generics_self_basic.py:27:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in from_config: Type[Circle] [assert-type] +generics_self_basic.py:27:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in from_config: type[Circle] [assert-type] assert_type(cls, type[Self]) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -53,7 +53,7 @@ generics_self_basic.py:64:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in set def set_value(self, value: T) -> Self: ... \u001b[1m\u001b[31m\u001b[39m\u001b[0m -generics_self_basic.py:67:26: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Container: unsupported operand type(s) for item retrieval: 'Self: TypeVar' and 'int: Type[int]' [unsupported-operands] +generics_self_basic.py:67:26: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Container: unsupported operand type(s) for item retrieval: 'Self: TypeVar' and 'int: type[int]' [unsupported-operands] def foo(self, other: Self[int]) -> None: # E \u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m @@ -64,7 +64,7 @@ errors_diff = """ Line 20: Expected 1 errors Line 33: Expected 1 errors Line 14: Unexpected errors ['generics_self_basic.py:14:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in set_scale: Shape [assert-type]', 'generics_self_basic.py:14:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in set_scale: Circle [assert-type]'] -Line 27: Unexpected errors ['generics_self_basic.py:27:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in from_config: Type[Shape] [assert-type]', 'generics_self_basic.py:27:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in from_config: Type[Circle] [assert-type]'] +Line 27: Unexpected errors ['generics_self_basic.py:27:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in from_config: type[Shape] [assert-type]', 'generics_self_basic.py:27:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in from_config: type[Circle] [assert-type]'] Line 40: Unexpected errors ['generics_self_basic.py:40:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in difference: Shape [assert-type]'] Line 64: Unexpected errors ['generics_self_basic.py:64:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in set_value: bad return type [bad-return-type]', 'generics_self_basic.py:64:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in set_value: bad return type [bad-return-type]', 'generics_self_basic.py:64:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in set_value: bad return type [bad-return-type]'] """ diff --git a/conformance/results/pytype/generics_typevartuple_args.toml b/conformance/results/pytype/generics_typevartuple_args.toml index 91227fe9d..f49671e37 100644 --- a/conformance/results/pytype/generics_typevartuple_args.toml +++ b/conformance/results/pytype/generics_typevartuple_args.toml @@ -20,7 +20,7 @@ def args_to_tuple(*args: *Ts) -> tuple[*Ts]: ... \u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_args.py:16:34: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] +generics_typevartuple_args.py:16:34: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] def args_to_tuple(*args: *Ts) -> tuple[*Ts]: \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m @@ -32,7 +32,7 @@ generics_typevartuple_args.py:17:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: Called from (traceback): line 20, in current file -generics_typevartuple_args.py:20:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Tuple[Any] [assert-type] +generics_typevartuple_args.py:20:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : tuple[Any] [assert-type] assert_type(args_to_tuple(1, "a"), tuple[int, str]) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -44,15 +44,15 @@ def exec_le(path: str, *args: * tuple[*Ts, Env], env: Env | None = None) -> tupl ... \u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_args.py:27:77: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] +generics_typevartuple_args.py:27:33: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] def exec_le(path: str, *args: * tuple[*Ts, Env], env: Env | None = None) -> tuple[*Ts]: - \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_args.py:27:33: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] +generics_typevartuple_args.py:27:77: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] def exec_le(path: str, *args: * tuple[*Ts, Env], env: Env | None = None) -> tuple[*Ts]: - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m generics_typevartuple_args.py:28:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in exec_le: bad return type [bad-return-type] @@ -61,12 +61,12 @@ generics_typevartuple_args.py:28:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: Called from (traceback): line 31, in current file -generics_typevartuple_args.py:31:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Tuple[Any] [assert-type] +generics_typevartuple_args.py:31:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : tuple[Any] [assert-type] assert_type(exec_le("", Env()), tuple[()]) # OK \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_args.py:32:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Tuple[Any] [assert-type] +generics_typevartuple_args.py:32:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : tuple[Any] [assert-type] assert_type(exec_le("", 0, "", Env()), tuple[int, str]) # OK \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -97,7 +97,7 @@ def func3(*args: * tuple[int, str]) -> None: ... \u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_args.py:70:18: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] +generics_typevartuple_args.py:70:18: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] def func4(*args: tuple[*Ts]): \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m @@ -120,15 +120,15 @@ Line 67: Expected 1 errors Line 76: Expected 1 errors Line 10: Unexpected errors ['generics_typevartuple_args.py:10:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet]'] Line 13: Unexpected errors ['generics_typevartuple_args.py:13:6: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] -Line 16: Unexpected errors ["generics_typevartuple_args.py:16:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : No attribute '__iter__' on TypeVarTuple [attribute-error]", "generics_typevartuple_args.py:16:34: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 16: Unexpected errors ["generics_typevartuple_args.py:16:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : No attribute '__iter__' on TypeVarTuple [attribute-error]", "generics_typevartuple_args.py:16:34: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] Line 17: Unexpected errors ['generics_typevartuple_args.py:17:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in args_to_tuple: bad return type [bad-return-type]'] -Line 20: Unexpected errors ['generics_typevartuple_args.py:20:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Tuple[Any] [assert-type]'] -Line 27: Unexpected errors ["generics_typevartuple_args.py:27:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Missing parameter 'self' in call to function tuple.__iter__ [missing-parameter]", "generics_typevartuple_args.py:27:77: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", "generics_typevartuple_args.py:27:33: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 20: Unexpected errors ['generics_typevartuple_args.py:20:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : tuple[Any] [assert-type]'] +Line 27: Unexpected errors ["generics_typevartuple_args.py:27:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Missing parameter 'self' in call to function tuple.__iter__ [missing-parameter]", "generics_typevartuple_args.py:27:33: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", "generics_typevartuple_args.py:27:77: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] Line 28: Unexpected errors ['generics_typevartuple_args.py:28:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in exec_le: bad return type [bad-return-type]'] -Line 31: Unexpected errors ['generics_typevartuple_args.py:31:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Tuple[Any] [assert-type]'] -Line 32: Unexpected errors ['generics_typevartuple_args.py:32:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Tuple[Any] [assert-type]'] +Line 31: Unexpected errors ['generics_typevartuple_args.py:31:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : tuple[Any] [assert-type]'] +Line 32: Unexpected errors ['generics_typevartuple_args.py:32:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : tuple[Any] [assert-type]'] Line 42: Unexpected errors ["generics_typevartuple_args.py:42:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Missing parameter 'self' in call to function tuple.__iter__ [missing-parameter]"] Line 51: Unexpected errors ["generics_typevartuple_args.py:51:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Missing parameter 'self' in call to function tuple.__iter__ [missing-parameter]", "generics_typevartuple_args.py:51:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] Line 62: Unexpected errors ["generics_typevartuple_args.py:62:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Missing parameter 'self' in call to function tuple.__iter__ [missing-parameter]"] -Line 70: Unexpected errors ["generics_typevartuple_args.py:70:18: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 70: Unexpected errors ["generics_typevartuple_args.py:70:18: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] """ diff --git a/conformance/results/pytype/generics_typevartuple_basic.toml b/conformance/results/pytype/generics_typevartuple_basic.toml index 8bd98126e..0b78be1c5 100644 --- a/conformance/results/pytype/generics_typevartuple_basic.toml +++ b/conformance/results/pytype/generics_typevartuple_basic.toml @@ -25,7 +25,7 @@ def func1(*args: *Ts) -> tuple[*Ts]: ... \u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_basic.py:16:26: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] +generics_typevartuple_basic.py:16:26: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] def func1(*args: *Ts) -> tuple[*Ts]: \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m @@ -45,7 +45,7 @@ generics_typevartuple_basic.py:23:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0 class Array(Generic[*Shape]): \u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_basic.py:24:31: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Array: Invalid type annotation '' [invalid-annotation] +generics_typevartuple_basic.py:24:31: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Array: Invalid type annotation '' [invalid-annotation] def __init__(self, shape: tuple[*Shape]): \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -55,7 +55,7 @@ generics_typevartuple_basic.py:25:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m self._shape: tuple[*Shape] = shape \u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_basic.py:27:28: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Array: Invalid type annotation '' [invalid-annotation] +generics_typevartuple_basic.py:27:28: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Array: Invalid type annotation '' [invalid-annotation] def get_shape(self) -> tuple[*Shape]: \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -200,17 +200,17 @@ generics_typevartuple_basic.py:67:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m Ts3 = TypeVarTuple("Ts3", bound=int) # E \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_basic.py:75:17: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] +generics_typevartuple_basic.py:75:17: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] def func2(arg1: tuple[*Ts], arg2: tuple[*Ts]) -> tuple[*Ts]: \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_basic.py:75:35: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] +generics_typevartuple_basic.py:75:35: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] def func2(arg1: tuple[*Ts], arg2: tuple[*Ts]) -> tuple[*Ts]: \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_basic.py:75:50: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] +generics_typevartuple_basic.py:75:50: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] def func2(arg1: tuple[*Ts], arg2: tuple[*Ts]) -> tuple[*Ts]: \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m @@ -222,7 +222,7 @@ generics_typevartuple_basic.py:76:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m Called from (traceback): line 84, in current file -generics_typevartuple_basic.py:84:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Tuple[Any] [assert-type] +generics_typevartuple_basic.py:84:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : tuple[Any] [assert-type] assert_type(func2((0,), (1,)), tuple[int]) # OK \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -286,20 +286,20 @@ Line 100: Expected 1 errors Line 7: Unexpected errors ['generics_typevartuple_basic.py:7:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet]'] Line 9: Unexpected errors ['generics_typevartuple_basic.py:9:6: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] Line 12: Unexpected errors ["generics_typevartuple_basic.py:12:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] -Line 16: Unexpected errors ["generics_typevartuple_basic.py:16:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : No attribute '__iter__' on TypeVarTuple [attribute-error]", "generics_typevartuple_basic.py:16:26: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 16: Unexpected errors ["generics_typevartuple_basic.py:16:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : No attribute '__iter__' on TypeVarTuple [attribute-error]", "generics_typevartuple_basic.py:16:26: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] Line 17: Unexpected errors ['generics_typevartuple_basic.py:17:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: bad return type [bad-return-type]'] Line 20: Unexpected errors ['generics_typevartuple_basic.py:20:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] Line 23: Unexpected errors ["generics_typevartuple_basic.py:23:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] -Line 24: Unexpected errors ["generics_typevartuple_basic.py:24:31: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in Array: Invalid type annotation '' [invalid-annotation]"] +Line 24: Unexpected errors ["generics_typevartuple_basic.py:24:31: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in Array: Invalid type annotation '' [invalid-annotation]"] Line 25: Unexpected errors ["generics_typevartuple_basic.py:25:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __init__: Invalid type annotation 'tuple[*Shape,]' [invalid-annotation]"] -Line 27: Unexpected errors ["generics_typevartuple_basic.py:27:28: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in Array: Invalid type annotation '' [invalid-annotation]"] +Line 27: Unexpected errors ["generics_typevartuple_basic.py:27:28: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in Array: Invalid type annotation '' [invalid-annotation]"] Line 36: Unexpected errors ['generics_typevartuple_basic.py:36:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]', "generics_typevartuple_basic.py:36:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Array[Height, Width]' [invalid-annotation]", 'generics_typevartuple_basic.py:36:28: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function Array.__init__ was called with the wrong arguments [wrong-arg-types]'] Line 37: Unexpected errors ['generics_typevartuple_basic.py:37:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]', "generics_typevartuple_basic.py:37:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Array[Batch, Height, Width]' [invalid-annotation]", 'generics_typevartuple_basic.py:37:35: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function Array.__init__ was called with the wrong arguments [wrong-arg-types]'] Line 38: Unexpected errors ['generics_typevartuple_basic.py:38:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]', "generics_typevartuple_basic.py:38:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Array[Time, Batch, Height, Width]' [invalid-annotation]", 'generics_typevartuple_basic.py:38:41: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function Array.__init__ was called with the wrong arguments [wrong-arg-types]'] Line 54: Unexpected errors ["generics_typevartuple_basic.py:54:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __init__: Invalid type annotation 'tuple[*Shape,]' [invalid-annotation]"] -Line 75: Unexpected errors ["generics_typevartuple_basic.py:75:17: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", "generics_typevartuple_basic.py:75:35: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", "generics_typevartuple_basic.py:75:50: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 75: Unexpected errors ["generics_typevartuple_basic.py:75:17: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", "generics_typevartuple_basic.py:75:35: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", "generics_typevartuple_basic.py:75:50: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] Line 76: Unexpected errors ['generics_typevartuple_basic.py:76:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func2: bad return type [bad-return-type]'] -Line 84: Unexpected errors ['generics_typevartuple_basic.py:84:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Tuple[Any] [assert-type]'] +Line 84: Unexpected errors ['generics_typevartuple_basic.py:84:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : tuple[Any] [assert-type]'] Line 93: Unexpected errors ['generics_typevartuple_basic.py:93:17: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]', 'generics_typevartuple_basic.py:93:35: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]', 'generics_typevartuple_basic.py:93:53: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]'] Line 94: Unexpected errors ['generics_typevartuple_basic.py:94:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in multiply: bad return type [bad-return-type]'] Line 97: Unexpected errors ['generics_typevartuple_basic.py:97:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]', 'generics_typevartuple_basic.py:97:32: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]', 'generics_typevartuple_basic.py:97:49: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]'] diff --git a/conformance/results/pytype/generics_typevartuple_callable.toml b/conformance/results/pytype/generics_typevartuple_callable.toml index 6abb21790..c2cf17829 100644 --- a/conformance/results/pytype/generics_typevartuple_callable.toml +++ b/conformance/results/pytype/generics_typevartuple_callable.toml @@ -13,12 +13,12 @@ generics_typevartuple_callable.py:12:6: \u001b[1m\u001b[31merror\u001b[39m\u001b Ts = TypeVarTuple("Ts") \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_callable.py:17:61: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Process: Invalid type annotation '' [invalid-annotation] +generics_typevartuple_callable.py:17:61: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Process: Invalid type annotation '' [invalid-annotation] def __init__(self, target: Callable[[*Ts], None], args: tuple[*Ts]) -> None: \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_callable.py:17:32: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Process: Invalid type annotation '' [invalid-annotation] +generics_typevartuple_callable.py:17:32: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Process: Invalid type annotation '' [invalid-annotation] def __init__(self, target: Callable[[*Ts], None], args: tuple[*Ts]) -> None: \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -33,17 +33,17 @@ generics_typevartuple_callable.py:26:1: \u001b[1m\u001b[31merror\u001b[39m\u001b Process(target=func1, args=("", 0)) # E \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_callable.py:29:57: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] +generics_typevartuple_callable.py:29:57: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] def func2(f: Callable[[int, *Ts, T], tuple[T, *Ts]]) -> tuple[*Ts, T]: \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_callable.py:29:38: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] +generics_typevartuple_callable.py:29:38: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] def func2(f: Callable[[int, *Ts, T], tuple[T, *Ts]]) -> tuple[*Ts, T]: \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_callable.py:29:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] +generics_typevartuple_callable.py:29:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] def func2(f: Callable[[int, *Ts, T], tuple[T, *Ts]]) -> tuple[*Ts, T]: \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -75,7 +75,7 @@ generics_typevartuple_callable.py:41:1: \u001b[1m\u001b[31merror\u001b[39m\u001b assert_type(func2(callback1), tuple[str, int, complex]) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_callable.py:42:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Tuple[Any] [assert-type] +generics_typevartuple_callable.py:42:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : tuple[Any] [assert-type] assert_type(func2(callback2), tuple[str]) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -87,12 +87,12 @@ def func3(*args: * tuple[int, *Ts, T]) -> tuple[T, *Ts]: ... \u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_callable.py:45:20: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] +generics_typevartuple_callable.py:45:20: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] def func3(*args: * tuple[int, *Ts, T]) -> tuple[T, *Ts]: \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_callable.py:45:43: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] +generics_typevartuple_callable.py:45:43: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] def func3(*args: * tuple[int, *Ts, T]) -> tuple[T, *Ts]: \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -104,7 +104,7 @@ generics_typevartuple_callable.py:46:5: \u001b[1m\u001b[31merror\u001b[39m\u001b Called from (traceback): line 49, in current file -generics_typevartuple_callable.py:49:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Tuple[Any] [assert-type] +generics_typevartuple_callable.py:49:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : tuple[Any] [assert-type] assert_type(func3(1, "", 3j, 3.4), tuple[float, str, complex]) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -114,15 +114,15 @@ conformance_automated = "Fail" errors_diff = """ Line 10: Unexpected errors ['generics_typevartuple_callable.py:10:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet]'] Line 12: Unexpected errors ['generics_typevartuple_callable.py:12:6: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] -Line 17: Unexpected errors ["generics_typevartuple_callable.py:17:61: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in Process: Invalid type annotation '' [invalid-annotation]", "generics_typevartuple_callable.py:17:32: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in Process: Invalid type annotation '' [invalid-annotation]"] +Line 17: Unexpected errors ["generics_typevartuple_callable.py:17:61: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in Process: Invalid type annotation '' [invalid-annotation]", "generics_typevartuple_callable.py:17:32: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in Process: Invalid type annotation '' [invalid-annotation]"] Line 25: Unexpected errors ['generics_typevartuple_callable.py:25:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function Process.__init__ was called with the wrong arguments [wrong-arg-types]'] -Line 29: Unexpected errors ["generics_typevartuple_callable.py:29:57: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", "generics_typevartuple_callable.py:29:38: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", "generics_typevartuple_callable.py:29:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 29: Unexpected errors ["generics_typevartuple_callable.py:29:57: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", "generics_typevartuple_callable.py:29:38: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", "generics_typevartuple_callable.py:29:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] Line 30: Unexpected errors ['generics_typevartuple_callable.py:30:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func2: bad return type [bad-return-type]'] Line 34: Unexpected errors ['generics_typevartuple_callable.py:34:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in callback1: bad return type [bad-return-type]'] Line 38: Unexpected errors ['generics_typevartuple_callable.py:38:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in callback2: bad return type [bad-return-type]'] Line 41: Unexpected errors ['generics_typevartuple_callable.py:41:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function func2 was called with the wrong arguments [wrong-arg-types]', 'generics_typevartuple_callable.py:41:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Any [assert-type]'] -Line 42: Unexpected errors ['generics_typevartuple_callable.py:42:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Tuple[Any] [assert-type]'] -Line 45: Unexpected errors ["generics_typevartuple_callable.py:45:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Missing parameter 'self' in call to function tuple.__iter__ [missing-parameter]", "generics_typevartuple_callable.py:45:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", "generics_typevartuple_callable.py:45:43: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 42: Unexpected errors ['generics_typevartuple_callable.py:42:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : tuple[Any] [assert-type]'] +Line 45: Unexpected errors ["generics_typevartuple_callable.py:45:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Missing parameter 'self' in call to function tuple.__iter__ [missing-parameter]", "generics_typevartuple_callable.py:45:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", "generics_typevartuple_callable.py:45:43: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] Line 46: Unexpected errors ['generics_typevartuple_callable.py:46:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func3: bad return type [bad-return-type]'] -Line 49: Unexpected errors ['generics_typevartuple_callable.py:49:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Tuple[Any] [assert-type]'] +Line 49: Unexpected errors ['generics_typevartuple_callable.py:49:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : tuple[Any] [assert-type]'] """ diff --git a/conformance/results/pytype/generics_typevartuple_concat.toml b/conformance/results/pytype/generics_typevartuple_concat.toml index 38a84f716..aa1708948 100644 --- a/conformance/results/pytype/generics_typevartuple_concat.toml +++ b/conformance/results/pytype/generics_typevartuple_concat.toml @@ -95,12 +95,12 @@ def prefix_tuple(x: T, y: tuple[*Ts]) -> tuple[T, *Ts]: ... \u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_concat.py:47:27: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] +generics_typevartuple_concat.py:47:27: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] def prefix_tuple(x: T, y: tuple[*Ts]) -> tuple[T, *Ts]: \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_concat.py:47:42: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] +generics_typevartuple_concat.py:47:42: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] def prefix_tuple(x: T, y: tuple[*Ts]) -> tuple[T, *Ts]: \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -120,12 +120,12 @@ generics_typevartuple_concat.py:52:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0 assert_type(z, tuple[int, bool, str]) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_concat.py:55:55: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] +generics_typevartuple_concat.py:55:55: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] def move_first_element_to_last(tup: tuple[T, *Ts]) -> tuple[*Ts, T]: \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_concat.py:55:37: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] +generics_typevartuple_concat.py:55:37: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] def move_first_element_to_last(tup: tuple[T, *Ts]) -> tuple[*Ts, T]: \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -147,9 +147,9 @@ Line 38: Unexpected errors ['generics_typevartuple_concat.py:38:14: \\x1b[1m\\x1 Line 40: Unexpected errors ['generics_typevartuple_concat.py:40:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: class Array is not indexable [not-indexable]'] Line 42: Unexpected errors ['generics_typevartuple_concat.py:42:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: class Array is not indexable [not-indexable]'] Line 44: Unexpected errors ['generics_typevartuple_concat.py:44:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: class Array is not indexable [not-indexable]'] -Line 47: Unexpected errors ["generics_typevartuple_concat.py:47:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'T' [invalid-annotation]", "generics_typevartuple_concat.py:47:27: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", "generics_typevartuple_concat.py:47:42: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 47: Unexpected errors ["generics_typevartuple_concat.py:47:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'T' [invalid-annotation]", "generics_typevartuple_concat.py:47:27: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", "generics_typevartuple_concat.py:47:42: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] Line 48: Unexpected errors ['generics_typevartuple_concat.py:48:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in prefix_tuple: bad return type [bad-return-type]'] Line 51: Unexpected errors ['generics_typevartuple_concat.py:51:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function prefix_tuple was called with the wrong arguments [wrong-arg-types]'] Line 52: Unexpected errors ['generics_typevartuple_concat.py:52:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Any [assert-type]'] -Line 55: Unexpected errors ["generics_typevartuple_concat.py:55:55: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", "generics_typevartuple_concat.py:55:37: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 55: Unexpected errors ["generics_typevartuple_concat.py:55:55: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", "generics_typevartuple_concat.py:55:37: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] """ diff --git a/conformance/results/pytype/generics_typevartuple_specialization.toml b/conformance/results/pytype/generics_typevartuple_specialization.toml index 992d68c45..ea620c39e 100644 --- a/conformance/results/pytype/generics_typevartuple_specialization.toml +++ b/conformance/results/pytype/generics_typevartuple_specialization.toml @@ -33,7 +33,7 @@ generics_typevartuple_specialization.py:33:14: \u001b[1m\u001b[31merror\u001b[39 def func2(y: Array[Time, Height, Width]): \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:41:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] +generics_typevartuple_specialization.py:41:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] IntTuple = tuple[int, *Ts] \u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -43,17 +43,17 @@ generics_typevartuple_specialization.py:42:25: \u001b[1m\u001b[31merror\u001b[39 NamedArray = tuple[str, Array[*Ts]] \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:45:40: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[str, Array][Height]' [invalid-annotation] +generics_typevartuple_specialization.py:45:40: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[str, Array][Height]' [invalid-annotation] def func3(a: IntTuple[float, bool], b: NamedArray[Height]): \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:45:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][float, bool]' [invalid-annotation] +generics_typevartuple_specialization.py:45:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[Any][float, bool]' [invalid-annotation] def func3(a: IntTuple[float, bool], b: NamedArray[Height]): \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:46:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func3: Tuple[Any] [assert-type] +generics_typevartuple_specialization.py:46:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func3: tuple[Any] [assert-type] assert_type(a, tuple[int, float, bool]) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -63,7 +63,7 @@ generics_typevartuple_specialization.py:47:31: \u001b[1m\u001b[31merror\u001b[39 assert_type(b, tuple[str, Array[Height]]) \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:51:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func4: Tuple[Any] [assert-type] +generics_typevartuple_specialization.py:51:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func4: tuple[Any] [assert-type] assert_type(a, tuple[int]) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -113,27 +113,27 @@ generics_typevartuple_specialization.py:80:46: \u001b[1m\u001b[31merror\u001b[39 def takes_float_array_with_specific_shape(y: FloatArray[Height, Width]): \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:89:17: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] +generics_typevartuple_specialization.py:89:17: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] VariadicTuple = tuple[T, *Ts] \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:92:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][str, int]' [invalid-annotation] +generics_typevartuple_specialization.py:92:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[Any][str, int]' [invalid-annotation] def func6(a: VariadicTuple[str, int], b: VariadicTuple[float], c: VariadicTuple): \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:92:42: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][float]' [invalid-annotation] +generics_typevartuple_specialization.py:92:42: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[Any][float]' [invalid-annotation] def func6(a: VariadicTuple[str, int], b: VariadicTuple[float], c: VariadicTuple): \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:93:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func6: Tuple[Any] [assert-type] +generics_typevartuple_specialization.py:93:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func6: tuple[Any] [assert-type] assert_type(a, tuple[str, int]) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:94:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func6: Tuple[Any] [assert-type] +generics_typevartuple_specialization.py:94:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func6: tuple[Any] [assert-type] assert_type(b, tuple[float]) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -153,22 +153,22 @@ generics_typevartuple_specialization.py:99:7: \u001b[1m\u001b[31merror\u001b[39m Ts2 = TypeVarTuple("Ts2") \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:101:15: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] +generics_typevartuple_specialization.py:101:15: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] IntTupleVar = tuple[int, *Ts1] # OK \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:102:20: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation] +generics_typevartuple_specialization.py:102:20: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[Any][]' [invalid-annotation] IntFloatTupleVar = IntTupleVar[float, *Ts2] # OK \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:103:21: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation] +generics_typevartuple_specialization.py:103:21: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[Any][]' [invalid-annotation] IntFloatsTupleVar = IntTupleVar[*tuple[float, ...]] # OK \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:109:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] +generics_typevartuple_specialization.py:109:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] IntTupleGeneric[*Ts] # E \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -178,17 +178,17 @@ generics_typevartuple_specialization.py:110:1: \u001b[1m\u001b[31merror\u001b[39 IntTupleGeneric[*tuple[float, ...]] # E \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:117:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] +generics_typevartuple_specialization.py:117:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] TA1 = tuple[*Ts, T1, T2] # OK \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:118:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] +generics_typevartuple_specialization.py:118:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] TA2 = tuple[T1, T2, *Ts] # OK \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:119:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] +generics_typevartuple_specialization.py:119:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] TA3 = tuple[T1, *Ts, T2, T3] # OK \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -198,7 +198,7 @@ generics_typevartuple_specialization.py:120:7: \u001b[1m\u001b[31merror\u001b[39 TA4 = tuple[T1, T2, *tuple[int, ...]] # OK \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:121:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] +generics_typevartuple_specialization.py:121:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] TA5 = tuple[T1, *Ts, T2, *Ts] # E \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -208,7 +208,7 @@ generics_typevartuple_specialization.py:121:13: \u001b[1m\u001b[31merror\u001b[3 TA5 = tuple[T1, *Ts, T2, *Ts] # E \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:122:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] +generics_typevartuple_specialization.py:122:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] TA6 = tuple[T1, *Ts, T2, *tuple[int, ...]] # E \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -218,17 +218,17 @@ generics_typevartuple_specialization.py:122:13: \u001b[1m\u001b[31merror\u001b[3 TA6 = tuple[T1, *Ts, T2, *tuple[int, ...]] # E \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:125:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] +generics_typevartuple_specialization.py:125:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] TA7 = tuple[*Ts, T1, T2] \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:127:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][int]' [invalid-annotation] +generics_typevartuple_specialization.py:127:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[Any][int]' [invalid-annotation] v1: TA7[int] # E: requires at least two type arguments \u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:130:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation] +generics_typevartuple_specialization.py:130:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[Any][]' [invalid-annotation] def func7(a: TA7[*Ts, T1, T2]) -> tuple[tuple[*Ts], T1, T2]: \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -247,7 +247,7 @@ def func7(a: TA7[*Ts, T1, T2]) -> tuple[tuple[*Ts], T1, T2]: ... \u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:130:41: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] +generics_typevartuple_specialization.py:130:41: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] def func7(a: TA7[*Ts, T1, T2]) -> tuple[tuple[*Ts], T1, T2]: \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m @@ -257,42 +257,42 @@ generics_typevartuple_specialization.py:131:5: \u001b[1m\u001b[31merror\u001b[39 ... \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:134:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][str, bool]' [invalid-annotation] +generics_typevartuple_specialization.py:134:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[Any][str, bool]' [invalid-annotation] def func8(a: TA7[str, bool], b: TA7[str, bool, float], c: TA7[str, bool, float, int]): \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:134:33: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][str, bool, float]' [invalid-annotation] +generics_typevartuple_specialization.py:134:33: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[Any][str, bool, float]' [invalid-annotation] def func8(a: TA7[str, bool], b: TA7[str, bool, float], c: TA7[str, bool, float, int]): \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:134:59: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][str, bool, float, int]' [invalid-annotation] +generics_typevartuple_specialization.py:134:59: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[Any][str, bool, float, int]' [invalid-annotation] def func8(a: TA7[str, bool], b: TA7[str, bool, float], c: TA7[str, bool, float, int]): \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:135:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func8: Tuple[Tuple[Any], Any, Any] [assert-type] +generics_typevartuple_specialization.py:135:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func8: tuple[tuple[Any], Any, Any] [assert-type] assert_type(func7(a), tuple[tuple[()], str, bool]) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:136:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func8: Tuple[Tuple[Any], Any, Any] [assert-type] +generics_typevartuple_specialization.py:136:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func8: tuple[tuple[Any], Any, Any] [assert-type] assert_type(func7(b), tuple[tuple[str], bool, float]) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:137:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func8: Tuple[Tuple[Any], Any, Any] [assert-type] +generics_typevartuple_specialization.py:137:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func8: tuple[tuple[Any], Any, Any] [assert-type] assert_type(func7(c), tuple[tuple[str, bool], float, int]) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:140:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] +generics_typevartuple_specialization.py:140:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] TA8 = tuple[T1, *Ts, T2, T3] \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:143:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation] +generics_typevartuple_specialization.py:143:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[Any][]' [invalid-annotation] def func9(a: TA8[T1, *Ts, T2, T3]) -> tuple[tuple[*Ts], T1, T2, T3]: \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -318,7 +318,7 @@ def func9(a: TA8[T1, *Ts, T2, T3]) -> tuple[tuple[*Ts], T1, T2, T3]: ... \u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:143:45: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] +generics_typevartuple_specialization.py:143:45: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] def func9(a: TA8[T1, *Ts, T2, T3]) -> tuple[tuple[*Ts], T1, T2, T3]: \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m @@ -328,42 +328,42 @@ generics_typevartuple_specialization.py:144:5: \u001b[1m\u001b[31merror\u001b[39 ... \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:147:15: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][str, bool, float]' [invalid-annotation] +generics_typevartuple_specialization.py:147:15: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[Any][str, bool, float]' [invalid-annotation] def func10(a: TA8[str, bool, float], b: TA8[str, bool, float, int]): \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:147:41: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][str, bool, float, int]' [invalid-annotation] +generics_typevartuple_specialization.py:147:41: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[Any][str, bool, float, int]' [invalid-annotation] def func10(a: TA8[str, bool, float], b: TA8[str, bool, float, int]): \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:148:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func10: Tuple[Tuple[Any], Any, Any, Any] [assert-type] +generics_typevartuple_specialization.py:148:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func10: tuple[tuple[Any], Any, Any, Any] [assert-type] assert_type(func9(a), tuple[tuple[()], str, bool, float]) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:149:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func10: Tuple[Tuple[Any], Any, Any, Any] [assert-type] +generics_typevartuple_specialization.py:149:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func10: tuple[tuple[Any], Any, Any, Any] [assert-type] assert_type(func9(b), tuple[tuple[bool], str, float, int]) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:152:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] +generics_typevartuple_specialization.py:152:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] TA9 = tuple[*Ts, T1] \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:153:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation] +generics_typevartuple_specialization.py:153:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[Any][]' [invalid-annotation] TA10 = TA9[*tuple[int, ...]] # OK \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:156:24: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation] +generics_typevartuple_specialization.py:156:24: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[Any][]' [invalid-annotation] def func11(a: TA10, b: TA9[*tuple[int, ...], str], c: TA9[*tuple[int, ...], str]): \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:156:55: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation] +generics_typevartuple_specialization.py:156:55: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[Any][]' [invalid-annotation] def func11(a: TA10, b: TA9[*tuple[int, ...], str], c: TA9[*tuple[int, ...], str]): \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -383,12 +383,12 @@ generics_typevartuple_specialization.py:159:20: \u001b[1m\u001b[31merror\u001b[3 assert_type(c, tuple[*tuple[int, ...], str]) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:162:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] +generics_typevartuple_specialization.py:162:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] TA11 = tuple[T, *Ts1] \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:163:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation] +generics_typevartuple_specialization.py:163:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[Any][]' [invalid-annotation] TA12 = TA11[*Ts2] # E \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m @@ -402,12 +402,12 @@ Line 16: Unexpected errors ["generics_typevartuple_specialization.py:16:13: \\x1 Line 24: Unexpected errors ['generics_typevartuple_specialization.py:24:27: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]'] Line 28: Unexpected errors ['generics_typevartuple_specialization.py:28:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]'] Line 33: Unexpected errors ['generics_typevartuple_specialization.py:33:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]'] -Line 41: Unexpected errors ["generics_typevartuple_specialization.py:41:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 41: Unexpected errors ["generics_typevartuple_specialization.py:41:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] Line 42: Unexpected errors ['generics_typevartuple_specialization.py:42:25: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]'] -Line 45: Unexpected errors ["generics_typevartuple_specialization.py:45:40: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Tuple[str, Array][Height]' [invalid-annotation]", "generics_typevartuple_specialization.py:45:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Tuple[Any][float, bool]' [invalid-annotation]"] -Line 46: Unexpected errors ['generics_typevartuple_specialization.py:46:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func3: Tuple[Any] [assert-type]'] +Line 45: Unexpected errors ["generics_typevartuple_specialization.py:45:40: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'tuple[str, Array][Height]' [invalid-annotation]", "generics_typevartuple_specialization.py:45:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'tuple[Any][float, bool]' [invalid-annotation]"] +Line 46: Unexpected errors ['generics_typevartuple_specialization.py:46:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func3: tuple[Any] [assert-type]'] Line 47: Unexpected errors ['generics_typevartuple_specialization.py:47:31: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func3: class Array is not indexable [not-indexable]'] -Line 51: Unexpected errors ['generics_typevartuple_specialization.py:51:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func4: Tuple[Any] [assert-type]'] +Line 51: Unexpected errors ['generics_typevartuple_specialization.py:51:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func4: tuple[Any] [assert-type]'] Line 55: Unexpected errors ['generics_typevartuple_specialization.py:55:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] Line 59: Unexpected errors ["generics_typevartuple_specialization.py:59:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] Line 63: Unexpected errors ['generics_typevartuple_specialization.py:63:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array2 is not indexable [not-indexable]'] @@ -417,38 +417,38 @@ Line 68: Unexpected errors ['generics_typevartuple_specialization.py:68:20: \\x1 Line 69: Unexpected errors ['generics_typevartuple_specialization.py:69:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func5_0: class Array2 is not indexable [not-indexable]'] Line 76: Unexpected errors ['generics_typevartuple_specialization.py:76:16: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array2 is not indexable [not-indexable]'] Line 80: Unexpected errors ['generics_typevartuple_specialization.py:80:46: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array2 is not indexable [not-indexable]'] -Line 89: Unexpected errors ["generics_typevartuple_specialization.py:89:17: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] -Line 92: Unexpected errors ["generics_typevartuple_specialization.py:92:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Tuple[Any][str, int]' [invalid-annotation]", "generics_typevartuple_specialization.py:92:42: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Tuple[Any][float]' [invalid-annotation]"] -Line 93: Unexpected errors ['generics_typevartuple_specialization.py:93:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func6: Tuple[Any] [assert-type]'] -Line 94: Unexpected errors ['generics_typevartuple_specialization.py:94:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func6: Tuple[Any] [assert-type]'] +Line 89: Unexpected errors ["generics_typevartuple_specialization.py:89:17: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 92: Unexpected errors ["generics_typevartuple_specialization.py:92:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'tuple[Any][str, int]' [invalid-annotation]", "generics_typevartuple_specialization.py:92:42: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'tuple[Any][float]' [invalid-annotation]"] +Line 93: Unexpected errors ['generics_typevartuple_specialization.py:93:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func6: tuple[Any] [assert-type]'] +Line 94: Unexpected errors ['generics_typevartuple_specialization.py:94:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func6: tuple[Any] [assert-type]'] Line 95: Unexpected errors ["generics_typevartuple_specialization.py:95:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func6: Invalid type annotation '' [invalid-annotation]"] Line 98: Unexpected errors ['generics_typevartuple_specialization.py:98:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] Line 99: Unexpected errors ['generics_typevartuple_specialization.py:99:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] -Line 101: Unexpected errors ["generics_typevartuple_specialization.py:101:15: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] -Line 102: Unexpected errors ["generics_typevartuple_specialization.py:102:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation]"] -Line 103: Unexpected errors ["generics_typevartuple_specialization.py:103:21: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation]"] -Line 117: Unexpected errors ["generics_typevartuple_specialization.py:117:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] -Line 118: Unexpected errors ["generics_typevartuple_specialization.py:118:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] -Line 119: Unexpected errors ["generics_typevartuple_specialization.py:119:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 101: Unexpected errors ["generics_typevartuple_specialization.py:101:15: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 102: Unexpected errors ["generics_typevartuple_specialization.py:102:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'tuple[Any][]' [invalid-annotation]"] +Line 103: Unexpected errors ["generics_typevartuple_specialization.py:103:21: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'tuple[Any][]' [invalid-annotation]"] +Line 117: Unexpected errors ["generics_typevartuple_specialization.py:117:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 118: Unexpected errors ["generics_typevartuple_specialization.py:118:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 119: Unexpected errors ["generics_typevartuple_specialization.py:119:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] Line 120: Unexpected errors ["generics_typevartuple_specialization.py:120:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] -Line 125: Unexpected errors ["generics_typevartuple_specialization.py:125:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] -Line 130: Unexpected errors ["generics_typevartuple_specialization.py:130:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation]", "generics_typevartuple_specialization.py:130:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'T2' [invalid-annotation]", "generics_typevartuple_specialization.py:130:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'T1' [invalid-annotation]", "generics_typevartuple_specialization.py:130:41: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 125: Unexpected errors ["generics_typevartuple_specialization.py:125:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 130: Unexpected errors ["generics_typevartuple_specialization.py:130:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'tuple[Any][]' [invalid-annotation]", "generics_typevartuple_specialization.py:130:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'T2' [invalid-annotation]", "generics_typevartuple_specialization.py:130:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'T1' [invalid-annotation]", "generics_typevartuple_specialization.py:130:41: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] Line 131: Unexpected errors ['generics_typevartuple_specialization.py:131:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func7: bad return type [bad-return-type]'] -Line 134: Unexpected errors ["generics_typevartuple_specialization.py:134:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Tuple[Any][str, bool]' [invalid-annotation]", "generics_typevartuple_specialization.py:134:33: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Tuple[Any][str, bool, float]' [invalid-annotation]", "generics_typevartuple_specialization.py:134:59: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Tuple[Any][str, bool, float, int]' [invalid-annotation]"] -Line 135: Unexpected errors ['generics_typevartuple_specialization.py:135:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func8: Tuple[Tuple[Any], Any, Any] [assert-type]'] -Line 136: Unexpected errors ['generics_typevartuple_specialization.py:136:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func8: Tuple[Tuple[Any], Any, Any] [assert-type]'] -Line 137: Unexpected errors ['generics_typevartuple_specialization.py:137:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func8: Tuple[Tuple[Any], Any, Any] [assert-type]'] -Line 140: Unexpected errors ["generics_typevartuple_specialization.py:140:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] -Line 143: Unexpected errors ["generics_typevartuple_specialization.py:143:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation]", "generics_typevartuple_specialization.py:143:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'T3' [invalid-annotation]", "generics_typevartuple_specialization.py:143:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'T2' [invalid-annotation]", "generics_typevartuple_specialization.py:143:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'T1' [invalid-annotation]", "generics_typevartuple_specialization.py:143:45: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 134: Unexpected errors ["generics_typevartuple_specialization.py:134:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'tuple[Any][str, bool]' [invalid-annotation]", "generics_typevartuple_specialization.py:134:33: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'tuple[Any][str, bool, float]' [invalid-annotation]", "generics_typevartuple_specialization.py:134:59: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'tuple[Any][str, bool, float, int]' [invalid-annotation]"] +Line 135: Unexpected errors ['generics_typevartuple_specialization.py:135:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func8: tuple[tuple[Any], Any, Any] [assert-type]'] +Line 136: Unexpected errors ['generics_typevartuple_specialization.py:136:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func8: tuple[tuple[Any], Any, Any] [assert-type]'] +Line 137: Unexpected errors ['generics_typevartuple_specialization.py:137:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func8: tuple[tuple[Any], Any, Any] [assert-type]'] +Line 140: Unexpected errors ["generics_typevartuple_specialization.py:140:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 143: Unexpected errors ["generics_typevartuple_specialization.py:143:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'tuple[Any][]' [invalid-annotation]", "generics_typevartuple_specialization.py:143:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'T3' [invalid-annotation]", "generics_typevartuple_specialization.py:143:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'T2' [invalid-annotation]", "generics_typevartuple_specialization.py:143:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'T1' [invalid-annotation]", "generics_typevartuple_specialization.py:143:45: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] Line 144: Unexpected errors ['generics_typevartuple_specialization.py:144:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func9: bad return type [bad-return-type]'] -Line 147: Unexpected errors ["generics_typevartuple_specialization.py:147:15: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Tuple[Any][str, bool, float]' [invalid-annotation]", "generics_typevartuple_specialization.py:147:41: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Tuple[Any][str, bool, float, int]' [invalid-annotation]"] -Line 148: Unexpected errors ['generics_typevartuple_specialization.py:148:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func10: Tuple[Tuple[Any], Any, Any, Any] [assert-type]'] -Line 149: Unexpected errors ['generics_typevartuple_specialization.py:149:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func10: Tuple[Tuple[Any], Any, Any, Any] [assert-type]'] -Line 152: Unexpected errors ["generics_typevartuple_specialization.py:152:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] -Line 153: Unexpected errors ["generics_typevartuple_specialization.py:153:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation]"] -Line 156: Unexpected errors ["generics_typevartuple_specialization.py:156:24: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation]", "generics_typevartuple_specialization.py:156:55: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation]"] +Line 147: Unexpected errors ["generics_typevartuple_specialization.py:147:15: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'tuple[Any][str, bool, float]' [invalid-annotation]", "generics_typevartuple_specialization.py:147:41: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'tuple[Any][str, bool, float, int]' [invalid-annotation]"] +Line 148: Unexpected errors ['generics_typevartuple_specialization.py:148:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func10: tuple[tuple[Any], Any, Any, Any] [assert-type]'] +Line 149: Unexpected errors ['generics_typevartuple_specialization.py:149:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func10: tuple[tuple[Any], Any, Any, Any] [assert-type]'] +Line 152: Unexpected errors ["generics_typevartuple_specialization.py:152:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 153: Unexpected errors ["generics_typevartuple_specialization.py:153:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'tuple[Any][]' [invalid-annotation]"] +Line 156: Unexpected errors ["generics_typevartuple_specialization.py:156:24: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'tuple[Any][]' [invalid-annotation]", "generics_typevartuple_specialization.py:156:55: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'tuple[Any][]' [invalid-annotation]"] Line 157: Unexpected errors ["generics_typevartuple_specialization.py:157:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func11: Invalid type annotation '' [invalid-annotation]"] Line 158: Unexpected errors ["generics_typevartuple_specialization.py:158:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func11: Invalid type annotation '' [invalid-annotation]"] Line 159: Unexpected errors ["generics_typevartuple_specialization.py:159:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func11: Invalid type annotation '' [invalid-annotation]"] -Line 162: Unexpected errors ["generics_typevartuple_specialization.py:162:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 162: Unexpected errors ["generics_typevartuple_specialization.py:162:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] """ diff --git a/conformance/results/pytype/namedtuples_define_class.toml b/conformance/results/pytype/namedtuples_define_class.toml index bad1600de..189add7c1 100644 --- a/conformance/results/pytype/namedtuples_define_class.toml +++ b/conformance/results/pytype/namedtuples_define_class.toml @@ -19,12 +19,12 @@ namedtuples_define_class.py:28:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: i assert_type(p1[-3], int) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -namedtuples_define_class.py:29:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Tuple[Union[int, str], ...] [assert-type] +namedtuples_define_class.py:29:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : tuple[Union[int, str], ...] [assert-type] assert_type(p1[0:2], tuple[int, int]) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -namedtuples_define_class.py:30:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Tuple[Union[int, str], ...] [assert-type] +namedtuples_define_class.py:30:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : tuple[Union[int, str], ...] [assert-type] assert_type(p1[0:], tuple[int, int, str]) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -75,7 +75,7 @@ Line 98: Expected 1 errors Line 105: Expected 1 errors Line 27: Unexpected errors ['namedtuples_define_class.py:27:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Union[int, str] [assert-type]'] Line 28: Unexpected errors ['namedtuples_define_class.py:28:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Union[int, str] [assert-type]'] -Line 29: Unexpected errors ['namedtuples_define_class.py:29:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Tuple[Union[int, str], ...] [assert-type]'] -Line 30: Unexpected errors ['namedtuples_define_class.py:30:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Tuple[Union[int, str], ...] [assert-type]'] +Line 29: Unexpected errors ['namedtuples_define_class.py:29:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : tuple[Union[int, str], ...] [assert-type]'] +Line 30: Unexpected errors ['namedtuples_define_class.py:30:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : tuple[Union[int, str], ...] [assert-type]'] Line 95: Unexpected errors ['namedtuples_define_class.py:95:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Any [assert-type]'] """ diff --git a/conformance/results/pytype/narrowing_typeis.toml b/conformance/results/pytype/narrowing_typeis.toml index e5f70078b..7101206c1 100644 --- a/conformance/results/pytype/narrowing_typeis.toml +++ b/conformance/results/pytype/narrowing_typeis.toml @@ -5,7 +5,7 @@ Does not reject covariant use of TypeIs. Does not reject TypeIs where return type is not consistent with input type due to variance. """ output = """ -narrowing_typeis.py:19:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Tuple[str, ...] [assert-type] +narrowing_typeis.py:19:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: tuple[str, ...] [assert-type] assert_type(names, tuple[str, str]) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -44,5 +44,5 @@ Line 105: Expected 1 errors Line 110: Expected 1 errors Line 191: Expected 1 errors Line 199: Expected 1 errors -Line 19: Unexpected errors ['narrowing_typeis.py:19:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: Tuple[str, ...] [assert-type]'] +Line 19: Unexpected errors ['narrowing_typeis.py:19:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: tuple[str, ...] [assert-type]'] """ diff --git a/conformance/results/pytype/protocols_generic.toml b/conformance/results/pytype/protocols_generic.toml index 2ab4a9378..3de697592 100644 --- a/conformance/results/pytype/protocols_generic.toml +++ b/conformance/results/pytype/protocols_generic.toml @@ -52,6 +52,7 @@ conformance_automated = "Fail" errors_diff = """ Line 66: Expected 1 errors Line 74: Expected 1 errors +Line 145: Expected 1 errors Line 147: Expected 1 errors Line 12: Unexpected errors ['protocols_generic.py:12:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] Line 13: Unexpected errors ['protocols_generic.py:13:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "contravariant" to TypeVar not supported yet [not-supported-yet]'] diff --git a/conformance/results/pytype/qualifiers_annotated.toml b/conformance/results/pytype/qualifiers_annotated.toml index 4b5d16f83..86e4ce6b4 100644 --- a/conformance/results/pytype/qualifiers_annotated.toml +++ b/conformance/results/pytype/qualifiers_annotated.toml @@ -16,7 +16,7 @@ qualifiers_annotated.py:44:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' for Bad3 [invalid-annotation] +qualifiers_annotated.py:45:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' for Bad3 [invalid-annotation] Bad3: Annotated[[int for i in range(1)], ""] # E: invalid type expression \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m diff --git a/conformance/results/pytype/specialtypes_type.toml b/conformance/results/pytype/specialtypes_type.toml index c9ad20353..98f8ffbb2 100644 --- a/conformance/results/pytype/specialtypes_type.toml +++ b/conformance/results/pytype/specialtypes_type.toml @@ -41,32 +41,32 @@ specialtypes_type.py:110:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func assert_type(d.__mro__, tuple[type, ...]) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -specialtypes_type.py:117:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func8: No attribute 'unknown' on Type[object] [attribute-error] +specialtypes_type.py:117:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func8: No attribute 'unknown' on type[object] [attribute-error] a.unknown # E \u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m -specialtypes_type.py:120:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func8: No attribute 'unknown' on Type[object] [attribute-error] +specialtypes_type.py:120:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func8: No attribute 'unknown' on type[object] [attribute-error] b.unknown # E \u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m -specialtypes_type.py:143:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : No attribute 'unknown' on Type[type] [attribute-error] +specialtypes_type.py:143:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : No attribute 'unknown' on type[type] [attribute-error] TA1.unknown # E \u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m -specialtypes_type.py:144:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : No attribute 'unknown' on Type[type] [attribute-error] +specialtypes_type.py:144:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : No attribute 'unknown' on type[type] [attribute-error] TA2.unknown # E \u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m -specialtypes_type.py:145:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : No attribute 'unknown' on Type[type] [attribute-error] +specialtypes_type.py:145:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : No attribute 'unknown' on type[type] [attribute-error] TA3.unknown # E \u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m -specialtypes_type.py:146:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : No attribute 'unknown' on Type[type] [attribute-error] +specialtypes_type.py:146:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : No attribute 'unknown' on type[type] [attribute-error] TA4.unknown # E \u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m diff --git a/conformance/results/pytype/tuples_type_compat.toml b/conformance/results/pytype/tuples_type_compat.toml index c198de7ad..029eb7134 100644 --- a/conformance/results/pytype/tuples_type_compat.toml +++ b/conformance/results/pytype/tuples_type_compat.toml @@ -50,12 +50,12 @@ tuples_type_compat.py:91:47: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation]"] -Line 115: Unexpected errors ['tuples_type_compat.py:115:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func7: Tuple[Union[int, str], Union[int, str]] [assert-type]'] -Line 117: Unexpected errors ['tuples_type_compat.py:117:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func7: Tuple[Union[int, str], Union[int, str]] [assert-type]'] +Line 115: Unexpected errors ['tuples_type_compat.py:115:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func7: tuple[Union[int, str], Union[int, str]] [assert-type]'] +Line 117: Unexpected errors ['tuples_type_compat.py:117:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func7: tuple[Union[int, str], Union[int, str]] [assert-type]'] Line 134: Unexpected errors ["tuples_type_compat.py:134:40: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] Line 139: Unexpected errors ['tuples_type_compat.py:139:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func8: Sequence [assert-type]'] Line 140: Unexpected errors ['tuples_type_compat.py:140:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func8: Sequence [assert-type]'] diff --git a/conformance/results/pytype/tuples_unpacked.toml b/conformance/results/pytype/tuples_unpacked.toml index 9b4b5b55b..1b2f6febd 100644 --- a/conformance/results/pytype/tuples_unpacked.toml +++ b/conformance/results/pytype/tuples_unpacked.toml @@ -19,7 +19,7 @@ tuples_unpacked.py:16:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Tuple[Any] [assert-type] +tuples_unpacked.py:32:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : tuple[Any] [assert-type] assert_type(u1, tuple[int, int]) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -129,7 +129,7 @@ tuples_unpacked.py:46:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] +tuples_unpacked.py:49:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] def func3(t: tuple[*Ts]): \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m @@ -151,17 +151,17 @@ Line 59: Expected 1 errors Lines 60, 61: Expected error (tag 't14') Line 13: Unexpected errors ['tuples_unpacked.py:13:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.Unpack not supported yet [not-supported-yet]', 'tuples_unpacked.py:13:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet]'] Line 16: Unexpected errors ["tuples_unpacked.py:16:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] -Line 17: Unexpected errors ['tuples_unpacked.py:17:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: Tuple[Any] [assert-type]'] +Line 17: Unexpected errors ['tuples_unpacked.py:17:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: tuple[Any] [assert-type]'] Line 18: Unexpected errors ["tuples_unpacked.py:18:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: Invalid type annotation '' [invalid-annotation]"] Line 19: Unexpected errors ["tuples_unpacked.py:19:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: Invalid type annotation '' [invalid-annotation]"] Line 25: Unexpected errors ["tuples_unpacked.py:25:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] Line 26: Unexpected errors ["tuples_unpacked.py:26:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func2: Invalid type annotation '' [invalid-annotation]"] Line 31: Unexpected errors ['tuples_unpacked.py:31:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for u1 does not match type of assignment [annotation-type-mismatch]', "tuples_unpacked.py:31:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'tuple[*tuple[int], *tuple[int]]' [invalid-annotation]", "tuples_unpacked.py:31:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", 'tuples_unpacked.py:31:11: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function list.extend was called with the wrong arguments [wrong-arg-types]'] -Line 32: Unexpected errors ['tuples_unpacked.py:32:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Tuple[Any] [assert-type]'] +Line 32: Unexpected errors ['tuples_unpacked.py:32:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : tuple[Any] [assert-type]'] Line 33: Unexpected errors ["tuples_unpacked.py:33:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", 'tuples_unpacked.py:33:11: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function list.extend was called with the wrong arguments [wrong-arg-types]'] Line 38: Unexpected errors ["tuples_unpacked.py:38:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", 'tuples_unpacked.py:38:11: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function list.extend was called with the wrong arguments [wrong-arg-types]'] Line 39: Unexpected errors ["tuples_unpacked.py:39:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", "tuples_unpacked.py:39:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] Line 46: Unexpected errors ['tuples_unpacked.py:46:6: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] -Line 49: Unexpected errors ["tuples_unpacked.py:49:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 49: Unexpected errors ["tuples_unpacked.py:49:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] Line 50: Unexpected errors ["tuples_unpacked.py:50:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func3: Invalid type annotation 'tuple[*tuple[str], *Ts]' [invalid-annotation]"] """ diff --git a/conformance/results/pytype/version.toml b/conformance/results/pytype/version.toml index 19259c3aa..79ea03461 100644 --- a/conformance/results/pytype/version.toml +++ b/conformance/results/pytype/version.toml @@ -1,2 +1,2 @@ -version = "pytype 2024.09.13" -test_duration = 32.8 +version = "pytype 2024.10.11" +test_duration = 31.9 diff --git a/conformance/results/results.html b/conformance/results/results.html index cffa1e37f..ec61d4b08 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -159,16 +159,16 @@

    Python Type System Conformance Test Results

     
    mypy 1.11.1
    -
    13.2sec
    +
    mypy 1.11.2
    +
    1.9sec
    pyright 1.1.374
    -
    1.5sec
    +
    pyright 1.1.384
    +
    1.3sec
    pyre 0.9.22
    -
    5.4sec
    +
    4.5sec
    pytype 2024.04.11
    -
    35.2sec
    +
    pytype 2024.09.13
    +
    32.8sec
    @@ -551,7 +551,7 @@

    Python Type System Conformance Test Results

         protocols_generic
    Partial

    Fails protocol matching when method-scoped TypeVar is used in protocol.

    Pass
    Partial

    Incorrectly generates type violation for protocol that uses method-scoped type variables.

    Partial

    Does not reject the use of Protocol and Generic together as base classes.

    Does not detect protocol mismatch when method-scoped TypeVar is used in protocol.

    Partial

    Does not correctly enforce contravariance in protocol type compatibility tests.

    Does not correctly enforce invariance in protocol type compatibility tests.

    Does not detect protocol mismatch when method-scoped TypeVar is used in protocol.

         callables_kwargs PassPass
    Partial

    Incorrectly handles assert_type for unpacked TypedDict.

    Unsupported

    Does not understand Unpack in the context of **kwargs annotation.

    Unsupported

    Does not understand Unpack in the context of **kwargs annotation.

         constructors_call_type
    Partial

    Does not validate call to custom metaclass __call__ method through type[T].

    Pass
    Partial

    Fails to report error when passing incorrect arguments for metaclass __call__ method.

    Pass
    Partial

    Does not validate call to custom metaclass __call__ method through type[T].

    - - - + + diff --git a/conformance/tests/protocols_generic.py b/conformance/tests/protocols_generic.py index d3bbf8a0c..958864285 100644 --- a/conformance/tests/protocols_generic.py +++ b/conformance/tests/protocols_generic.py @@ -142,6 +142,6 @@ def m(self, item: str, callback: Callable[[int], str]) -> str: hp1: HasPropertyProto = ConcreteHasProperty1() # OK -hp2: HasPropertyProto = ConcreteHasProperty2() # OK +hp2: HasPropertyProto = ConcreteHasProperty2() # E hp3: HasPropertyProto = ConcreteHasProperty3() # E hp4: HasPropertyProto = ConcreteHasProperty4() # E From f86459c750258648578acffe7c59f9f4ee033097 Mon Sep 17 00:00:00 2001 From: Eric Traut Date: Mon, 14 Oct 2024 20:28:19 -0700 Subject: [PATCH 052/308] Updated conformance results for mypy 1.12. (#1866) * Fixes bugs that previously caused a crash when running generics_defaults and generics_syntax_declarations tests. * Fixes conformance issues in the following tests: aliases_type_statement, generics_paramspec_components, generics_syntax_declarations, generics_variance_inference, tuples_type_compat. * Adds support for functionality covered by tests: typeddicts_readonly, typeddicts_readonly_consistency, typeddicts_readonly_inheritance, typeddicts_readonly_kwargs, typeddicts_readonly_update. Fixed bugs in a couple of tests that were uncovered by mypy update. * The aliases_type_statement test assumed errors would be reported on a particular line. * The generics_syntax_declarations test assumed certain unspecified behaviors when evaluating the type of a type parameter. * The generics_variance_inference test was missing a return type annotation. --- .../results/mypy/aliases_explicit.toml | 3 +- .../results/mypy/aliases_type_statement.toml | 33 ++++---- .../results/mypy/aliases_typealiastype.toml | 3 +- .../results/mypy/generics_defaults.toml | 35 +++++++- .../mypy/generics_paramspec_components.toml | 3 +- .../mypy/generics_syntax_declarations.toml | 28 +++---- .../mypy/generics_variance_inference.toml | 22 +---- .../results/mypy/literals_literalstring.toml | 4 +- .../mypy/literals_parameterizations.toml | 2 +- .../results/mypy/qualifiers_annotated.toml | 3 +- .../mypy/qualifiers_final_annotation.toml | 2 +- .../results/mypy/tuples_type_compat.toml | 3 - .../results/mypy/typeddicts_readonly.toml | 36 ++------ .../mypy/typeddicts_readonly_consistency.toml | 16 ++-- .../mypy/typeddicts_readonly_inheritance.toml | 82 ++++--------------- .../mypy/typeddicts_readonly_kwargs.toml | 12 +-- .../mypy/typeddicts_readonly_update.toml | 14 ++-- .../results/mypy/typeddicts_required.toml | 4 +- conformance/results/mypy/version.toml | 4 +- .../results/pyre/aliases_type_statement.toml | 14 ++-- .../pyre/generics_syntax_declarations.toml | 20 ++--- conformance/results/pyre/version.toml | 2 +- .../pyright/aliases_type_statement.toml | 18 ++-- .../pyright/generics_syntax_declarations.toml | 22 ++--- conformance/results/pyright/version.toml | 2 +- .../pytype/aliases_type_statement.toml | 14 ++-- .../pytype/generics_syntax_declarations.toml | 20 ++--- conformance/results/pytype/version.toml | 2 +- conformance/results/results.html | 30 +++---- conformance/src/type_checker.py | 10 --- conformance/tests/aliases_type_statement.py | 10 +-- .../tests/generics_syntax_declarations.py | 6 +- .../tests/generics_variance_inference.py | 4 +- 33 files changed, 198 insertions(+), 285 deletions(-) diff --git a/conformance/results/mypy/aliases_explicit.toml b/conformance/results/mypy/aliases_explicit.toml index bcf03a097..ee057629f 100644 --- a/conformance/results/mypy/aliases_explicit.toml +++ b/conformance/results/mypy/aliases_explicit.toml @@ -12,7 +12,8 @@ aliases_explicit.py:79: error: Invalid type alias: expression is not a valid typ aliases_explicit.py:80: error: Bracketed expression "[...]" is not valid as a type [valid-type] aliases_explicit.py:81: error: Invalid type alias: expression is not a valid type [valid-type] aliases_explicit.py:82: error: Invalid type alias: expression is not a valid type [valid-type] -aliases_explicit.py:83: error: Invalid type alias: expression is not a valid type [valid-type] +aliases_explicit.py:83: error: Inline TypedDict is experimental, must be enabled with --enable-incomplete-feature=InlineTypedDict [misc] +aliases_explicit.py:83: error: Name "b" is not defined [name-defined] aliases_explicit.py:84: error: Invalid type alias: expression is not a valid type [valid-type] aliases_explicit.py:85: error: Invalid type alias: expression is not a valid type [valid-type] aliases_explicit.py:86: error: Invalid type alias: expression is not a valid type [valid-type] diff --git a/conformance/results/mypy/aliases_type_statement.toml b/conformance/results/mypy/aliases_type_statement.toml index 536ef0ce3..d33d02759 100644 --- a/conformance/results/mypy/aliases_type_statement.toml +++ b/conformance/results/mypy/aliases_type_statement.toml @@ -1,21 +1,20 @@ conformant = "Partial" notes = """ -Does not reject use of TypeAliasType as base class. -Does not reject redefinition of type alias defined with type statement. Does not reject type alias defined in function scope. -Does not reject type alias with circular definition. """ output = """ aliases_type_statement.py:17: error: "TypeAliasType" has no attribute "bit_count" [attr-defined] aliases_type_statement.py:19: error: "TypeAliasType" not callable [operator] aliases_type_statement.py:23: error: "TypeAliasType" has no attribute "other_attrib" [attr-defined] +aliases_type_statement.py:26: error: Type alias defined using "type" statement not valid as base class [misc] aliases_type_statement.py:31: error: Parameterized generics cannot be used with class or instance checks [misc] aliases_type_statement.py:31: error: Argument 2 to "isinstance" has incompatible type "TypeAliasType"; expected "_ClassInfo" [arg-type] aliases_type_statement.py:37: error: Invalid type alias: expression is not a valid type [valid-type] aliases_type_statement.py:38: error: Bracketed expression "[...]" is not valid as a type [valid-type] aliases_type_statement.py:39: error: Invalid type alias: expression is not a valid type [valid-type] aliases_type_statement.py:40: error: Invalid type alias: expression is not a valid type [valid-type] -aliases_type_statement.py:41: error: Invalid type alias: expression is not a valid type [valid-type] +aliases_type_statement.py:41: error: Inline TypedDict is experimental, must be enabled with --enable-incomplete-feature=InlineTypedDict [misc] +aliases_type_statement.py:41: error: Name "b" is not defined [name-defined] aliases_type_statement.py:42: error: Invalid type alias: expression is not a valid type [valid-type] aliases_type_statement.py:43: error: Invalid type alias: expression is not a valid type [valid-type] aliases_type_statement.py:44: error: Invalid type alias: expression is not a valid type [valid-type] @@ -25,22 +24,18 @@ aliases_type_statement.py:46: error: Invalid type: try using Literal[True] inste aliases_type_statement.py:47: error: Invalid type: try using Literal[1] instead? [valid-type] aliases_type_statement.py:48: error: Invalid type alias: expression is not a valid type [valid-type] aliases_type_statement.py:49: error: Invalid type alias: expression is not a valid type [valid-type] -aliases_type_statement.py:54: error: Name "BadTypeAlias14" already defined on line 52 [no-redef] -aliases_type_statement.py:64: error: All type parameters should be declared ("V" not declared) [valid-type] -aliases_type_statement.py:69: error: All type parameters should be declared ("T1" not declared) [valid-type] -aliases_type_statement.py:79: error: Type argument "str" of "RecursiveTypeAlias2" must be a subtype of "int" [type-var] -aliases_type_statement.py:81: error: Type argument "int" of "RecursiveTypeAlias2" must be a subtype of "str" [type-var] -aliases_type_statement.py:84: error: Cannot resolve name "RecursiveTypeAlias3" (possible cyclic definition) [misc] -aliases_type_statement.py:86: error: Invalid recursive alias: a union item of itself [misc] -aliases_type_statement.py:90: error: Cannot resolve name "RecursiveTypeAlias6" (possible cyclic definition) [misc] -aliases_type_statement.py:90: error: Cannot resolve name "RecursiveTypeAlias7" (possible cyclic definition) [misc] -aliases_type_statement.py:91: error: Cannot resolve name "RecursiveTypeAlias7" (possible cyclic definition) [misc] +aliases_type_statement.py:52: error: Name "BadTypeAlias14" already defined on line 51 [no-redef] +aliases_type_statement.py:62: error: All type parameters should be declared ("V" not declared) [valid-type] +aliases_type_statement.py:67: error: All type parameters should be declared ("T1" not declared) [valid-type] +aliases_type_statement.py:77: error: Type argument "str" of "RecursiveTypeAlias2" must be a subtype of "int" [type-var] +aliases_type_statement.py:79: error: Type argument "int" of "RecursiveTypeAlias2" must be a subtype of "str" [type-var] +aliases_type_statement.py:82: error: Cannot resolve name "RecursiveTypeAlias3" (possible cyclic definition) [misc] +aliases_type_statement.py:84: error: Invalid recursive alias: a union item of itself [misc] +aliases_type_statement.py:88: error: Cannot resolve name "RecursiveTypeAlias6" (possible cyclic definition) [misc] +aliases_type_statement.py:88: error: Cannot resolve name "RecursiveTypeAlias7" (possible cyclic definition) [misc] +aliases_type_statement.py:89: error: Cannot resolve name "RecursiveTypeAlias7" (possible cyclic definition) [misc] """ conformance_automated = "Fail" errors_diff = """ -Line 26: Expected 1 errors -Line 52: Expected 1 errors -Line 58: Expected 1 errors -Line 54: Unexpected errors ['aliases_type_statement.py:54: error: Name "BadTypeAlias14" already defined on line 52 [no-redef]'] -Line 91: Unexpected errors ['aliases_type_statement.py:91: error: Cannot resolve name "RecursiveTypeAlias7" (possible cyclic definition) [misc]'] +Line 56: Expected 1 errors """ diff --git a/conformance/results/mypy/aliases_typealiastype.toml b/conformance/results/mypy/aliases_typealiastype.toml index fe6dd997a..078f99616 100644 --- a/conformance/results/mypy/aliases_typealiastype.toml +++ b/conformance/results/mypy/aliases_typealiastype.toml @@ -23,7 +23,8 @@ aliases_typealiastype.py:52: error: Invalid type alias: expression is not a vali aliases_typealiastype.py:53: error: Bracketed expression "[...]" is not valid as a type [valid-type] aliases_typealiastype.py:54: error: Invalid type alias: expression is not a valid type [valid-type] aliases_typealiastype.py:55: error: Invalid type alias: expression is not a valid type [valid-type] -aliases_typealiastype.py:56: error: Invalid type alias: expression is not a valid type [valid-type] +aliases_typealiastype.py:56: error: Inline TypedDict is experimental, must be enabled with --enable-incomplete-feature=InlineTypedDict [misc] +aliases_typealiastype.py:56: error: Name "b" is not defined [name-defined] aliases_typealiastype.py:57: error: Invalid type alias: expression is not a valid type [valid-type] aliases_typealiastype.py:58: error: Invalid type alias: expression is not a valid type [valid-type] aliases_typealiastype.py:59: error: Invalid type alias: expression is not a valid type [valid-type] diff --git a/conformance/results/mypy/generics_defaults.toml b/conformance/results/mypy/generics_defaults.toml index 19633b6f5..b8fb5b0f7 100644 --- a/conformance/results/mypy/generics_defaults.toml +++ b/conformance/results/mypy/generics_defaults.toml @@ -1,11 +1,42 @@ conformant = "Unsupported" output = """ +generics_defaults.py:24: error: "T" cannot appear after "DefaultStrT" in type parameter list because it has no default type [misc] +generics_defaults.py:30: error: Expression is of type "type[NoNonDefaults[Any, Any]]", not "type[NoNonDefaults[str, int]]" [assert-type] +generics_defaults.py:31: error: Expression is of type "type[NoNonDefaults[Any, Any]]", not "type[NoNonDefaults[str, int]]" [assert-type] +generics_defaults.py:38: error: Expression is of type "type[OneDefault[Any, Any]]", not "type[OneDefault[float, bool]]" [assert-type] +generics_defaults.py:45: error: Expression is of type "type[AllTheDefaults[Any, Any, Any, Any, Any]]", not "type[AllTheDefaults[Any, Any, str, int, bool]]" [assert-type] +generics_defaults.py:46: error: Expression is of type "type[AllTheDefaults[Any, Any, Any, Any, Any]]", not "type[AllTheDefaults[int, complex, str, int, bool]]" [assert-type] +generics_defaults.py:50: error: Type application has too few types (expected between 2 and 5) [misc] +generics_defaults.py:52: error: Expression is of type "type[AllTheDefaults[Any, Any, Any, Any, Any]]", not "type[AllTheDefaults[int, complex, str, int, bool]]" [assert-type] +generics_defaults.py:55: error: Expression is of type "type[AllTheDefaults[Any, Any, Any, Any, Any]]", not "type[AllTheDefaults[int, complex, str, int, bool]]" [assert-type] +generics_defaults.py:59: error: Expression is of type "type[AllTheDefaults[Any, Any, Any, Any, Any]]", not "type[AllTheDefaults[int, complex, str, int, bool]]" [assert-type] +generics_defaults.py:79: error: Expression is of type "type[Class_ParamSpec[Any]]", not "type[Class_ParamSpec[[str, int]]]" [assert-type] +generics_defaults.py:94: error: Expression is of type "type[Class_TypeVarTuple[*tuple[Any, ...]]]", not "type[Class_TypeVarTuple[str, int]]" [assert-type] +generics_defaults.py:151: error: Expression is of type "type[Foo6[*tuple[Any, ...], Any]]", not "type[Foo6[int, str, [float, bool]]]" [assert-type] +generics_defaults.py:151: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [misc] +generics_defaults.py:152: error: Expression is of type "type[Foo6[*tuple[Any, ...], Any]]", not "type[Foo6[int, str, [bytes]]]" [assert-type] +generics_defaults.py:152: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [misc] +generics_defaults.py:166: error: Expression is of type "Callable[[Self], Self]", not "Callable[[Foo7[int]], Foo7[int]]" [assert-type] +generics_defaults.py:167: error: Expression is of type "Any", not "int" [assert-type] +generics_defaults.py:167: error: Access to generic instance variables via class is ambiguous [misc] """ conformance_automated = "Fail" errors_diff = """ -Line 24: Expected 1 errors -Line 50: Expected 1 errors Line 104: Expected 1 errors Line 111: Expected 1 errors Line 138: Expected 1 errors +Line 30: Unexpected errors ['generics_defaults.py:30: error: Expression is of type "type[NoNonDefaults[Any, Any]]", not "type[NoNonDefaults[str, int]]" [assert-type]'] +Line 31: Unexpected errors ['generics_defaults.py:31: error: Expression is of type "type[NoNonDefaults[Any, Any]]", not "type[NoNonDefaults[str, int]]" [assert-type]'] +Line 38: Unexpected errors ['generics_defaults.py:38: error: Expression is of type "type[OneDefault[Any, Any]]", not "type[OneDefault[float, bool]]" [assert-type]'] +Line 45: Unexpected errors ['generics_defaults.py:45: error: Expression is of type "type[AllTheDefaults[Any, Any, Any, Any, Any]]", not "type[AllTheDefaults[Any, Any, str, int, bool]]" [assert-type]'] +Line 46: Unexpected errors ['generics_defaults.py:46: error: Expression is of type "type[AllTheDefaults[Any, Any, Any, Any, Any]]", not "type[AllTheDefaults[int, complex, str, int, bool]]" [assert-type]'] +Line 52: Unexpected errors ['generics_defaults.py:52: error: Expression is of type "type[AllTheDefaults[Any, Any, Any, Any, Any]]", not "type[AllTheDefaults[int, complex, str, int, bool]]" [assert-type]'] +Line 55: Unexpected errors ['generics_defaults.py:55: error: Expression is of type "type[AllTheDefaults[Any, Any, Any, Any, Any]]", not "type[AllTheDefaults[int, complex, str, int, bool]]" [assert-type]'] +Line 59: Unexpected errors ['generics_defaults.py:59: error: Expression is of type "type[AllTheDefaults[Any, Any, Any, Any, Any]]", not "type[AllTheDefaults[int, complex, str, int, bool]]" [assert-type]'] +Line 79: Unexpected errors ['generics_defaults.py:79: error: Expression is of type "type[Class_ParamSpec[Any]]", not "type[Class_ParamSpec[[str, int]]]" [assert-type]'] +Line 94: Unexpected errors ['generics_defaults.py:94: error: Expression is of type "type[Class_TypeVarTuple[*tuple[Any, ...]]]", not "type[Class_TypeVarTuple[str, int]]" [assert-type]'] +Line 151: Unexpected errors ['generics_defaults.py:151: error: Expression is of type "type[Foo6[*tuple[Any, ...], Any]]", not "type[Foo6[int, str, [float, bool]]]" [assert-type]', 'generics_defaults.py:151: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [misc]'] +Line 152: Unexpected errors ['generics_defaults.py:152: error: Expression is of type "type[Foo6[*tuple[Any, ...], Any]]", not "type[Foo6[int, str, [bytes]]]" [assert-type]', 'generics_defaults.py:152: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [misc]'] +Line 166: Unexpected errors ['generics_defaults.py:166: error: Expression is of type "Callable[[Self], Self]", not "Callable[[Foo7[int]], Foo7[int]]" [assert-type]'] +Line 167: Unexpected errors ['generics_defaults.py:167: error: Expression is of type "Any", not "int" [assert-type]', 'generics_defaults.py:167: error: Access to generic instance variables via class is ambiguous [misc]'] """ diff --git a/conformance/results/mypy/generics_paramspec_components.toml b/conformance/results/mypy/generics_paramspec_components.toml index 0cfb13a94..66a386ad0 100644 --- a/conformance/results/mypy/generics_paramspec_components.toml +++ b/conformance/results/mypy/generics_paramspec_components.toml @@ -4,7 +4,6 @@ Does not report illegal use of "P.args" on normal parameter. Does not report error when P.args is specified but P.kwargs is missing. Does not report error when P is out of scope and P.args and P.kwargs is used. Does not report error when keyword argument is specified between P.args and P.kwargs. -Does not report error when calling callable and argument is missing for concatenated parameters. """ output = """ generics_paramspec_components.py:17: error: Use "P.args" for variadic "*" parameter [valid-type] @@ -15,6 +14,7 @@ generics_paramspec_components.py:49: error: Argument 2 has incompatible type "** generics_paramspec_components.py:51: error: Argument 1 has incompatible type "int"; expected "P.args" [arg-type] generics_paramspec_components.py:70: error: Argument 1 has incompatible type "*P.args"; expected "int" [arg-type] generics_paramspec_components.py:70: error: Argument 2 has incompatible type "int"; expected "P.args" [arg-type] +generics_paramspec_components.py:72: error: Argument 1 has incompatible type "*P.args"; expected "int" [arg-type] generics_paramspec_components.py:83: error: "foo" gets multiple values for keyword argument "x" [misc] generics_paramspec_components.py:83: error: Argument 1 to "foo" has incompatible type "*P.args"; expected "int" [arg-type] generics_paramspec_components.py:83: error: Argument 3 to "foo" has incompatible type "**P.kwargs"; expected "int" [arg-type] @@ -31,5 +31,4 @@ Line 36: Expected 1 errors Line 38: Expected 1 errors Line 41: Expected 1 errors Line 60: Expected 1 errors -Line 72: Expected 1 errors """ diff --git a/conformance/results/mypy/generics_syntax_declarations.toml b/conformance/results/mypy/generics_syntax_declarations.toml index 91b06d4a0..66d51c931 100644 --- a/conformance/results/mypy/generics_syntax_declarations.toml +++ b/conformance/results/mypy/generics_syntax_declarations.toml @@ -1,19 +1,17 @@ -conformant = "Partial" -notes = """ -Does not detect many illegal usages of type parameter syntax. -""" +conformant = "Pass" output = """ +generics_syntax_declarations.py:17: error: Generic[...] base class is redundant [misc] +generics_syntax_declarations.py:25: error: No arguments expected for "Protocol" base class [misc] +generics_syntax_declarations.py:32: error: "T" has no attribute "is_integer" [attr-defined] +generics_syntax_declarations.py:44: error: Name "V" is not defined [name-defined] +generics_syntax_declarations.py:48: error: Bracketed expression "[...]" is not valid as a type [valid-type] +generics_syntax_declarations.py:60: error: Type variable must have at least two constrained types [misc] +generics_syntax_declarations.py:64: error: Type variable must have at least two constrained types [misc] +generics_syntax_declarations.py:71: error: Variable "generics_syntax_declarations.t1" is not valid as a type [valid-type] +generics_syntax_declarations.py:71: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_declarations.py:75: error: Invalid type: try using Literal[3] instead? [valid-type] +generics_syntax_declarations.py:79: error: Name "S" is not defined [name-defined] """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 19: Expected 1 errors -Line 27: Expected 1 errors -Line 34: Expected 1 errors -Line 46: Expected 1 errors -Line 50: Expected 1 errors -Line 62: Expected 1 errors -Line 66: Expected 1 errors -Line 73: Expected 1 errors -Line 77: Expected 1 errors -Line 81: Expected 1 errors """ diff --git a/conformance/results/mypy/generics_variance_inference.toml b/conformance/results/mypy/generics_variance_inference.toml index 571895100..b1158c7e9 100644 --- a/conformance/results/mypy/generics_variance_inference.toml +++ b/conformance/results/mypy/generics_variance_inference.toml @@ -1,20 +1,12 @@ -conformant = "Partial" -notes = """ -Computes incorrect variance in some cases. -""" +conformant = "Pass" output = """ generics_variance_inference.py:24: error: Incompatible types in assignment (expression has type "ClassA[float, int, int]", variable has type "ClassA[int, int, int]") [assignment] generics_variance_inference.py:25: error: Incompatible types in assignment (expression has type "ClassA[float, int, int]", variable has type "ClassA[float, float, int]") [assignment] generics_variance_inference.py:28: error: Incompatible types in assignment (expression has type "ClassA[int, float, float]", variable has type "ClassA[int, int, int]") [assignment] -generics_variance_inference.py:29: error: Incompatible types in assignment (expression has type "ClassA[int, float, float]", variable has type "ClassA[int, int, float]") [assignment] generics_variance_inference.py:41: error: Incompatible types in assignment (expression has type "ShouldBeCovariant1[float]", variable has type "ShouldBeCovariant1[int]") [assignment] -generics_variance_inference.py:48: error: Cannot instantiate abstract class "ShouldBeCovariant2" with abstract attributes "__getitem__" and "__len__" [abstract] -generics_variance_inference.py:49: error: Cannot instantiate abstract class "ShouldBeCovariant2" with abstract attributes "__getitem__" and "__len__" [abstract] generics_variance_inference.py:49: error: Incompatible types in assignment (expression has type "ShouldBeCovariant2[float]", variable has type "ShouldBeCovariant2[int]") [assignment] generics_variance_inference.py:58: error: Incompatible types in assignment (expression has type "ShouldBeCovariant3[float]", variable has type "ShouldBeCovariant3[int]") [assignment] -generics_variance_inference.py:66: error: Incompatible types in assignment (expression has type "ShouldBeCovariant4[int]", variable has type "ShouldBeCovariant4[float]") [assignment] generics_variance_inference.py:67: error: Incompatible types in assignment (expression has type "ShouldBeCovariant4[float]", variable has type "ShouldBeCovariant4[int]") [assignment] -generics_variance_inference.py:79: error: Incompatible types in assignment (expression has type "ShouldBeCovariant5[int]", variable has type "ShouldBeCovariant5[float]") [assignment] generics_variance_inference.py:80: error: Incompatible types in assignment (expression has type "ShouldBeCovariant5[float]", variable has type "ShouldBeCovariant5[int]") [assignment] generics_variance_inference.py:96: error: Incompatible types in assignment (expression has type "ShouldBeInvariant1[int]", variable has type "ShouldBeInvariant1[float]") [assignment] generics_variance_inference.py:97: error: Incompatible types in assignment (expression has type "ShouldBeInvariant1[float]", variable has type "ShouldBeInvariant1[int]") [assignment] @@ -28,16 +20,10 @@ generics_variance_inference.py:130: error: Incompatible types in assignment (exp generics_variance_inference.py:138: error: Incompatible types in assignment (expression has type "ShouldBeInvariant5[int]", variable has type "ShouldBeInvariant5[float]") [assignment] generics_variance_inference.py:149: error: Incompatible types in assignment (expression has type "ShouldBeContravariant1[int]", variable has type "ShouldBeContravariant1[float]") [assignment] generics_variance_inference.py:169: error: Incompatible types in assignment (expression has type "ShouldBeInvariant6[float]", variable has type "ShouldBeInvariant6[int]") [assignment] +generics_variance_inference.py:170: error: Incompatible types in assignment (expression has type "ShouldBeInvariant6[int]", variable has type "ShouldBeInvariant6[float]") [assignment] generics_variance_inference.py:181: error: Incompatible types in assignment (expression has type "ShouldBeCovariant6[float]", variable has type "ShouldBeCovariant6[int]") [assignment] -generics_variance_inference.py:193: error: Incompatible types in assignment (expression has type "ShouldBeContravariant2[float]", variable has type "ShouldBeContravariant2[int]") [assignment] +generics_variance_inference.py:194: error: Incompatible types in assignment (expression has type "ShouldBeContravariant2[int]", variable has type "ShouldBeContravariant2[float]") [assignment] """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 170: Expected 1 errors -Line 194: Expected 1 errors -Line 29: Unexpected errors ['generics_variance_inference.py:29: error: Incompatible types in assignment (expression has type "ClassA[int, float, float]", variable has type "ClassA[int, int, float]") [assignment]'] -Line 48: Unexpected errors ['generics_variance_inference.py:48: error: Cannot instantiate abstract class "ShouldBeCovariant2" with abstract attributes "__getitem__" and "__len__" [abstract]'] -Line 66: Unexpected errors ['generics_variance_inference.py:66: error: Incompatible types in assignment (expression has type "ShouldBeCovariant4[int]", variable has type "ShouldBeCovariant4[float]") [assignment]'] -Line 79: Unexpected errors ['generics_variance_inference.py:79: error: Incompatible types in assignment (expression has type "ShouldBeCovariant5[int]", variable has type "ShouldBeCovariant5[float]") [assignment]'] -Line 193: Unexpected errors ['generics_variance_inference.py:193: error: Incompatible types in assignment (expression has type "ShouldBeContravariant2[float]", variable has type "ShouldBeContravariant2[int]") [assignment]'] """ diff --git a/conformance/results/mypy/literals_literalstring.toml b/conformance/results/mypy/literals_literalstring.toml index b6554e3f6..5258d2549 100644 --- a/conformance/results/mypy/literals_literalstring.toml +++ b/conformance/results/mypy/literals_literalstring.toml @@ -8,7 +8,7 @@ literals_literalstring.py:37: error: Parameter 1 of Literal[...] is invalid [va literals_literalstring.py:43: error: Incompatible types in assignment (expression has type "Literal['two']", variable has type "Literal['']") [assignment] literals_literalstring.py:74: error: Incompatible types in assignment (expression has type "int", variable has type "str") [assignment] literals_literalstring.py:75: error: Incompatible types in assignment (expression has type "bytes", variable has type "str") [assignment] -literals_literalstring.py:157: error: Overloaded function signature 3 will never be matched: signature 2's parameter type(s) are the same or broader [misc] +literals_literalstring.py:157: error: Overloaded function signature 3 will never be matched: signature 2's parameter type(s) are the same or broader [overload-cannot-match] literals_literalstring.py:167: error: Expression is of type "B", not "A" [assert-type] """ conformance_automated = "Fail" @@ -17,6 +17,6 @@ Line 66: Expected 1 errors Line 120: Expected 1 errors Line 134: Expected 1 errors Line 171: Expected 1 errors -Line 157: Unexpected errors ["literals_literalstring.py:157: error: Overloaded function signature 3 will never be matched: signature 2's parameter type(s) are the same or broader [misc]"] +Line 157: Unexpected errors ["literals_literalstring.py:157: error: Overloaded function signature 3 will never be matched: signature 2's parameter type(s) are the same or broader [overload-cannot-match]"] Line 167: Unexpected errors ['literals_literalstring.py:167: error: Expression is of type "B", not "A" [assert-type]'] """ diff --git a/conformance/results/mypy/literals_parameterizations.toml b/conformance/results/mypy/literals_parameterizations.toml index b5a992641..730d531db 100644 --- a/conformance/results/mypy/literals_parameterizations.toml +++ b/conformance/results/mypy/literals_parameterizations.toml @@ -8,7 +8,7 @@ literals_parameterizations.py:42: error: Invalid type: Literal[...] cannot conta literals_parameterizations.py:43: error: Invalid type: Literal[...] cannot contain arbitrary expressions [valid-type] literals_parameterizations.py:44: error: Invalid type: Literal[...] cannot contain arbitrary expressions [valid-type] literals_parameterizations.py:45: error: Invalid type: Literal[...] cannot contain arbitrary expressions [valid-type] -literals_parameterizations.py:47: error: Invalid type: Literal[...] cannot contain arbitrary expressions [valid-type] +literals_parameterizations.py:47: error: Parameter 1 of Literal[...] is invalid [valid-type] literals_parameterizations.py:48: error: Parameter 1 of Literal[...] is invalid [valid-type] literals_parameterizations.py:49: error: Parameter 1 of Literal[...] is invalid [valid-type] literals_parameterizations.py:50: error: Parameter 1 of Literal[...] is invalid [valid-type] diff --git a/conformance/results/mypy/qualifiers_annotated.toml b/conformance/results/mypy/qualifiers_annotated.toml index 289e9d8be..f2a37363a 100644 --- a/conformance/results/mypy/qualifiers_annotated.toml +++ b/conformance/results/mypy/qualifiers_annotated.toml @@ -11,7 +11,8 @@ qualifiers_annotated.py:43: error: Bracketed expression "[...]" is not valid as qualifiers_annotated.py:44: error: Syntax error in type annotation [syntax] qualifiers_annotated.py:44: note: Suggestion: Is there a spurious trailing comma? qualifiers_annotated.py:45: error: Invalid type comment or annotation [valid-type] -qualifiers_annotated.py:46: error: Invalid type comment or annotation [valid-type] +qualifiers_annotated.py:46: error: Inline TypedDict is experimental, must be enabled with --enable-incomplete-feature=InlineTypedDict [misc] +qualifiers_annotated.py:46: error: Name "b" is not defined [name-defined] qualifiers_annotated.py:47: error: Invalid type comment or annotation [valid-type] qualifiers_annotated.py:48: error: Invalid type comment or annotation [valid-type] qualifiers_annotated.py:49: error: Invalid type comment or annotation [valid-type] diff --git a/conformance/results/mypy/qualifiers_final_annotation.toml b/conformance/results/mypy/qualifiers_final_annotation.toml index eecb8fd05..d0898be41 100644 --- a/conformance/results/mypy/qualifiers_final_annotation.toml +++ b/conformance/results/mypy/qualifiers_final_annotation.toml @@ -33,7 +33,7 @@ qualifiers_final_annotation.py:135: error: Unexpected keyword argument "y" for " qualifiers_final_annotation.py:141: error: Cannot assign to final name "ID1" [misc] qualifiers_final_annotation.py:145: error: Cannot assign to final name "x" [misc] qualifiers_final_annotation.py:147: error: Cannot assign to final name "x" [misc] -qualifiers_final_annotation.py:152: error: Incompatible types in assignment (expression has type "TextIOWrapper", variable has type "int") [assignment] +qualifiers_final_annotation.py:152: error: Incompatible types in assignment (expression has type "TextIOWrapper[_WrappedBuffer]", variable has type "int") [assignment] qualifiers_final_annotation.py:155: error: Cannot assign to final name "x" [misc] """ conformance_automated = "Fail" diff --git a/conformance/results/mypy/tuples_type_compat.toml b/conformance/results/mypy/tuples_type_compat.toml index 55d7bf4de..3882ed3f3 100644 --- a/conformance/results/mypy/tuples_type_compat.toml +++ b/conformance/results/mypy/tuples_type_compat.toml @@ -1,7 +1,6 @@ conformant = "Partial" notes = """ Does not support tuple narrowing based on `len()` type guard (optional). -Incorrectly narrows tuple based on sequence patterns. """ output = """ tuples_type_compat.py:15: error: Incompatible types in assignment (expression has type "tuple[float, complex]", variable has type "tuple[int, int]") [assignment] @@ -13,7 +12,6 @@ tuples_type_compat.py:62: error: Incompatible types in assignment (expression ha tuples_type_compat.py:95: error: Expression is of type "tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]", not "tuple[int]" [assert-type] tuples_type_compat.py:99: error: Expression is of type "tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]", not "tuple[str, str] | tuple[int, int]" [assert-type] tuples_type_compat.py:103: error: Expression is of type "tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]", not "tuple[int, str, int]" [assert-type] -tuples_type_compat.py:117: error: Expression is of type "tuple[Never, int]", not "tuple[int | str, int]" [assert-type] tuples_type_compat.py:136: error: Expression is of type "Sequence[object]", not "Sequence[complex | list[int]]" [assert-type] tuples_type_compat.py:139: error: Expression is of type "Sequence[object]", not "Sequence[int | str]" [assert-type] tuples_type_compat.py:144: error: Incompatible types in assignment (expression has type "tuple[int, str, str]", variable has type "tuple[int, str]") [assignment] @@ -32,7 +30,6 @@ errors_diff = """ Line 95: Unexpected errors ['tuples_type_compat.py:95: error: Expression is of type "tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]", not "tuple[int]" [assert-type]'] Line 99: Unexpected errors ['tuples_type_compat.py:99: error: Expression is of type "tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]", not "tuple[str, str] | tuple[int, int]" [assert-type]'] Line 103: Unexpected errors ['tuples_type_compat.py:103: error: Expression is of type "tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]", not "tuple[int, str, int]" [assert-type]'] -Line 117: Unexpected errors ['tuples_type_compat.py:117: error: Expression is of type "tuple[Never, int]", not "tuple[int | str, int]" [assert-type]'] Line 136: Unexpected errors ['tuples_type_compat.py:136: error: Expression is of type "Sequence[object]", not "Sequence[complex | list[int]]" [assert-type]'] Line 139: Unexpected errors ['tuples_type_compat.py:139: error: Expression is of type "Sequence[object]", not "Sequence[int | str]" [assert-type]'] """ diff --git a/conformance/results/mypy/typeddicts_readonly.toml b/conformance/results/mypy/typeddicts_readonly.toml index 8af1a3a9c..6dc58bb6e 100644 --- a/conformance/results/mypy/typeddicts_readonly.toml +++ b/conformance/results/mypy/typeddicts_readonly.toml @@ -1,35 +1,17 @@ -conformant = "Unsupported" +conformant = "Partial" +notes = """ +Incorrectly rejects NotRequired directive when used in an Annotated annotation. +""" output = """ -typeddicts_readonly.py:18: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type] -typeddicts_readonly.py:18: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -typeddicts_readonly.py:25: error: "ReadOnly?[builtins.list[builtins.str]]" has no attribute "append" [attr-defined] -typeddicts_readonly.py:31: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type] -typeddicts_readonly.py:31: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -typeddicts_readonly.py:37: error: "ReadOnly?[builtins.list[builtins.str]]" has no attribute "append" [attr-defined] -typeddicts_readonly.py:45: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type] -typeddicts_readonly.py:45: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -typeddicts_readonly.py:45: error: Required[] can be only used in a TypedDict definition [valid-type] -typeddicts_readonly.py:46: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type] -typeddicts_readonly.py:46: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -typeddicts_readonly.py:46: error: NotRequired[] can be only used in a TypedDict definition [valid-type] -typeddicts_readonly.py:55: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type] -typeddicts_readonly.py:55: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +typeddicts_readonly.py:24: error: ReadOnly TypedDict key "members" TypedDict is mutated [typeddict-readonly-mutated] +typeddicts_readonly.py:36: error: ReadOnly TypedDict key "members" TypedDict is mutated [typeddict-readonly-mutated] +typeddicts_readonly.py:50: error: ReadOnly TypedDict key "title" TypedDict is mutated [typeddict-readonly-mutated] +typeddicts_readonly.py:51: error: ReadOnly TypedDict key "year" TypedDict is mutated [typeddict-readonly-mutated] typeddicts_readonly.py:56: error: NotRequired[] can be only used in a TypedDict definition [valid-type] +typeddicts_readonly.py:60: error: ReadOnly TypedDict key "title" TypedDict is mutated [typeddict-readonly-mutated] """ conformance_automated = "Fail" errors_diff = """ -Line 24: Expected 1 errors -Line 36: Expected 1 errors -Line 50: Expected 1 errors -Line 51: Expected 1 errors -Line 60: Expected 1 errors Line 61: Expected 1 errors -Line 18: Unexpected errors ['typeddicts_readonly.py:18: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type]'] -Line 25: Unexpected errors ['typeddicts_readonly.py:25: error: "ReadOnly?[builtins.list[builtins.str]]" has no attribute "append" [attr-defined]'] -Line 31: Unexpected errors ['typeddicts_readonly.py:31: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type]'] -Line 37: Unexpected errors ['typeddicts_readonly.py:37: error: "ReadOnly?[builtins.list[builtins.str]]" has no attribute "append" [attr-defined]'] -Line 45: Unexpected errors ['typeddicts_readonly.py:45: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type]', 'typeddicts_readonly.py:45: error: Required[] can be only used in a TypedDict definition [valid-type]'] -Line 46: Unexpected errors ['typeddicts_readonly.py:46: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type]', 'typeddicts_readonly.py:46: error: NotRequired[] can be only used in a TypedDict definition [valid-type]'] -Line 55: Unexpected errors ['typeddicts_readonly.py:55: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type]'] Line 56: Unexpected errors ['typeddicts_readonly.py:56: error: NotRequired[] can be only used in a TypedDict definition [valid-type]'] """ diff --git a/conformance/results/mypy/typeddicts_readonly_consistency.toml b/conformance/results/mypy/typeddicts_readonly_consistency.toml index 9228d1630..ea01b2dc6 100644 --- a/conformance/results/mypy/typeddicts_readonly_consistency.toml +++ b/conformance/results/mypy/typeddicts_readonly_consistency.toml @@ -1,24 +1,18 @@ -conformant = "Unsupported" +conformant = "Partial" +notes = """ +Incorrectly rejects assignment of required item to not-required read-only item. +""" output = """ -typeddicts_readonly_consistency.py:30: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type] -typeddicts_readonly_consistency.py:30: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -typeddicts_readonly_consistency.py:30: error: NotRequired[] can be only used in a TypedDict definition [valid-type] typeddicts_readonly_consistency.py:37: error: Incompatible types in assignment (expression has type "A1", variable has type "B1") [assignment] typeddicts_readonly_consistency.py:38: error: Incompatible types in assignment (expression has type "C1", variable has type "B1") [assignment] typeddicts_readonly_consistency.py:40: error: Incompatible types in assignment (expression has type "A1", variable has type "C1") [assignment] -typeddicts_readonly_consistency.py:41: error: Incompatible types in assignment (expression has type "B1", variable has type "C1") [assignment] -typeddicts_readonly_consistency.py:66: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type] -typeddicts_readonly_consistency.py:66: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases typeddicts_readonly_consistency.py:79: error: Incompatible types in assignment (expression has type "C2", variable has type "A2") [assignment] +typeddicts_readonly_consistency.py:81: error: Incompatible types in assignment (expression has type "A2", variable has type "B2") [assignment] typeddicts_readonly_consistency.py:82: error: Incompatible types in assignment (expression has type "C2", variable has type "B2") [assignment] typeddicts_readonly_consistency.py:84: error: Incompatible types in assignment (expression has type "A2", variable has type "C2") [assignment] typeddicts_readonly_consistency.py:85: error: Incompatible types in assignment (expression has type "B2", variable has type "C2") [assignment] """ conformance_automated = "Fail" errors_diff = """ -Line 81: Expected 1 errors -Line 30: Unexpected errors ['typeddicts_readonly_consistency.py:30: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type]', 'typeddicts_readonly_consistency.py:30: error: NotRequired[] can be only used in a TypedDict definition [valid-type]'] -Line 41: Unexpected errors ['typeddicts_readonly_consistency.py:41: error: Incompatible types in assignment (expression has type "B1", variable has type "C1") [assignment]'] -Line 66: Unexpected errors ['typeddicts_readonly_consistency.py:66: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type]'] Line 79: Unexpected errors ['typeddicts_readonly_consistency.py:79: error: Incompatible types in assignment (expression has type "C2", variable has type "A2") [assignment]'] """ diff --git a/conformance/results/mypy/typeddicts_readonly_inheritance.toml b/conformance/results/mypy/typeddicts_readonly_inheritance.toml index 609c0abf9..46bc4ce00 100644 --- a/conformance/results/mypy/typeddicts_readonly_inheritance.toml +++ b/conformance/results/mypy/typeddicts_readonly_inheritance.toml @@ -1,91 +1,39 @@ -conformant = "Unsupported" +conformant = "Partial" +notes = """ +Incorrectly rejects non-ReadOnly override of ReadOnly item. +Incorrectly rejects override of ReadOnly item with another ReadOnly item with narrower type. +Incorrectly rejects override of NotRequired ReadOnly item with a Required ReadOnly item. +""" output = """ -typeddicts_readonly_inheritance.py:15: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type] -typeddicts_readonly_inheritance.py:15: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases typeddicts_readonly_inheritance.py:19: error: Overwriting TypedDict field "name" while extending [misc] -typeddicts_readonly_inheritance.py:43: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type] -typeddicts_readonly_inheritance.py:43: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -typeddicts_readonly_inheritance.py:44: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type] -typeddicts_readonly_inheritance.py:44: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +typeddicts_readonly_inheritance.py:25: error: ReadOnly TypedDict key "name" TypedDict is mutated [typeddict-readonly-mutated] +typeddicts_readonly_inheritance.py:36: error: ReadOnly TypedDict key "name" TypedDict is mutated [typeddict-readonly-mutated] typeddicts_readonly_inheritance.py:49: error: Overwriting TypedDict field "albums" while extending [misc] -typeddicts_readonly_inheritance.py:49: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type] -typeddicts_readonly_inheritance.py:49: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases typeddicts_readonly_inheritance.py:50: error: Overwriting TypedDict field "alt" while extending [misc] -typeddicts_readonly_inheritance.py:50: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type] -typeddicts_readonly_inheritance.py:50: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -typeddicts_readonly_inheritance.py:58: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type] -typeddicts_readonly_inheritance.py:58: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -typeddicts_readonly_inheritance.py:58: error: NotRequired[] can be only used in a TypedDict definition [valid-type] typeddicts_readonly_inheritance.py:62: error: Overwriting TypedDict field "name" while extending [misc] -typeddicts_readonly_inheritance.py:62: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type] -typeddicts_readonly_inheritance.py:62: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -typeddicts_readonly_inheritance.py:62: error: Required[] can be only used in a TypedDict definition [valid-type] typeddicts_readonly_inheritance.py:65: error: Missing key "name" for TypedDict "RequiredName" [typeddict-item] -typeddicts_readonly_inheritance.py:72: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type] -typeddicts_readonly_inheritance.py:72: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -typeddicts_readonly_inheritance.py:72: error: NotRequired[] can be only used in a TypedDict definition [valid-type] typeddicts_readonly_inheritance.py:76: error: Overwriting TypedDict field "ident" while extending [misc] +typeddicts_readonly_inheritance.py:81: error: ReadOnly TypedDict key "ident" TypedDict is mutated [typeddict-readonly-mutated] +typeddicts_readonly_inheritance.py:82: error: ReadOnly TypedDict key "ident" TypedDict is mutated [typeddict-readonly-mutated] typeddicts_readonly_inheritance.py:82: error: Value of "ident" has incompatible type "int"; expected "str" [typeddict-item] typeddicts_readonly_inheritance.py:83: error: Incompatible types (expression has type "int", TypedDict item "ident" has type "str") [typeddict-item] typeddicts_readonly_inheritance.py:84: error: Missing key "ident" for TypedDict "User" [typeddict-item] -typeddicts_readonly_inheritance.py:89: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type] -typeddicts_readonly_inheritance.py:89: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -typeddicts_readonly_inheritance.py:89: error: NotRequired[] can be only used in a TypedDict definition [valid-type] -typeddicts_readonly_inheritance.py:90: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type] -typeddicts_readonly_inheritance.py:90: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -typeddicts_readonly_inheritance.py:90: error: Required[] can be only used in a TypedDict definition [valid-type] typeddicts_readonly_inheritance.py:94: error: Overwriting TypedDict field "a" while extending [misc] -typeddicts_readonly_inheritance.py:94: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type] -typeddicts_readonly_inheritance.py:94: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases typeddicts_readonly_inheritance.py:98: error: Overwriting TypedDict field "a" while extending [misc] typeddicts_readonly_inheritance.py:102: error: Overwriting TypedDict field "b" while extending [misc] -typeddicts_readonly_inheritance.py:102: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type] -typeddicts_readonly_inheritance.py:102: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -typeddicts_readonly_inheritance.py:102: error: Required[] can be only used in a TypedDict definition [valid-type] typeddicts_readonly_inheritance.py:106: error: Overwriting TypedDict field "c" while extending [misc] -typeddicts_readonly_inheritance.py:106: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type] -typeddicts_readonly_inheritance.py:106: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -typeddicts_readonly_inheritance.py:106: error: NotRequired[] can be only used in a TypedDict definition [valid-type] -typeddicts_readonly_inheritance.py:111: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type] -typeddicts_readonly_inheritance.py:111: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -typeddicts_readonly_inheritance.py:116: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type] -typeddicts_readonly_inheritance.py:116: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases typeddicts_readonly_inheritance.py:119: error: Overwriting TypedDict field "x" while merging [misc] typeddicts_readonly_inheritance.py:119: error: Overwriting TypedDict field "y" while merging [misc] -typeddicts_readonly_inheritance.py:123: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type] -typeddicts_readonly_inheritance.py:123: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -typeddicts_readonly_inheritance.py:123: error: NotRequired[] can be only used in a TypedDict definition [valid-type] -typeddicts_readonly_inheritance.py:124: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type] -typeddicts_readonly_inheritance.py:124: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -typeddicts_readonly_inheritance.py:124: error: Required[] can be only used in a TypedDict definition [valid-type] -typeddicts_readonly_inheritance.py:128: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type] -typeddicts_readonly_inheritance.py:128: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -typeddicts_readonly_inheritance.py:128: error: Required[] can be only used in a TypedDict definition [valid-type] -typeddicts_readonly_inheritance.py:129: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type] -typeddicts_readonly_inheritance.py:129: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -typeddicts_readonly_inheritance.py:129: error: NotRequired[] can be only used in a TypedDict definition [valid-type] typeddicts_readonly_inheritance.py:132: error: Overwriting TypedDict field "x" while merging [misc] typeddicts_readonly_inheritance.py:132: error: Overwriting TypedDict field "y" while merging [misc] """ conformance_automated = "Fail" errors_diff = """ -Line 36: Expected 1 errors -Line 15: Unexpected errors ['typeddicts_readonly_inheritance.py:15: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type]'] Line 19: Unexpected errors ['typeddicts_readonly_inheritance.py:19: error: Overwriting TypedDict field "name" while extending [misc]'] -Line 43: Unexpected errors ['typeddicts_readonly_inheritance.py:43: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type]'] -Line 44: Unexpected errors ['typeddicts_readonly_inheritance.py:44: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type]'] -Line 49: Unexpected errors ['typeddicts_readonly_inheritance.py:49: error: Overwriting TypedDict field "albums" while extending [misc]', 'typeddicts_readonly_inheritance.py:49: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type]'] -Line 58: Unexpected errors ['typeddicts_readonly_inheritance.py:58: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type]', 'typeddicts_readonly_inheritance.py:58: error: NotRequired[] can be only used in a TypedDict definition [valid-type]'] -Line 62: Unexpected errors ['typeddicts_readonly_inheritance.py:62: error: Overwriting TypedDict field "name" while extending [misc]', 'typeddicts_readonly_inheritance.py:62: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type]', 'typeddicts_readonly_inheritance.py:62: error: Required[] can be only used in a TypedDict definition [valid-type]'] -Line 72: Unexpected errors ['typeddicts_readonly_inheritance.py:72: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type]', 'typeddicts_readonly_inheritance.py:72: error: NotRequired[] can be only used in a TypedDict definition [valid-type]'] +Line 25: Unexpected errors ['typeddicts_readonly_inheritance.py:25: error: ReadOnly TypedDict key "name" TypedDict is mutated [typeddict-readonly-mutated]'] +Line 49: Unexpected errors ['typeddicts_readonly_inheritance.py:49: error: Overwriting TypedDict field "albums" while extending [misc]'] +Line 62: Unexpected errors ['typeddicts_readonly_inheritance.py:62: error: Overwriting TypedDict field "name" while extending [misc]'] Line 76: Unexpected errors ['typeddicts_readonly_inheritance.py:76: error: Overwriting TypedDict field "ident" while extending [misc]'] -Line 89: Unexpected errors ['typeddicts_readonly_inheritance.py:89: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type]', 'typeddicts_readonly_inheritance.py:89: error: NotRequired[] can be only used in a TypedDict definition [valid-type]'] -Line 90: Unexpected errors ['typeddicts_readonly_inheritance.py:90: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type]', 'typeddicts_readonly_inheritance.py:90: error: Required[] can be only used in a TypedDict definition [valid-type]'] -Line 102: Unexpected errors ['typeddicts_readonly_inheritance.py:102: error: Overwriting TypedDict field "b" while extending [misc]', 'typeddicts_readonly_inheritance.py:102: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type]', 'typeddicts_readonly_inheritance.py:102: error: Required[] can be only used in a TypedDict definition [valid-type]'] -Line 111: Unexpected errors ['typeddicts_readonly_inheritance.py:111: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type]'] -Line 116: Unexpected errors ['typeddicts_readonly_inheritance.py:116: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type]'] -Line 123: Unexpected errors ['typeddicts_readonly_inheritance.py:123: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type]', 'typeddicts_readonly_inheritance.py:123: error: NotRequired[] can be only used in a TypedDict definition [valid-type]'] -Line 124: Unexpected errors ['typeddicts_readonly_inheritance.py:124: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type]', 'typeddicts_readonly_inheritance.py:124: error: Required[] can be only used in a TypedDict definition [valid-type]'] -Line 128: Unexpected errors ['typeddicts_readonly_inheritance.py:128: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type]', 'typeddicts_readonly_inheritance.py:128: error: Required[] can be only used in a TypedDict definition [valid-type]'] -Line 129: Unexpected errors ['typeddicts_readonly_inheritance.py:129: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type]', 'typeddicts_readonly_inheritance.py:129: error: NotRequired[] can be only used in a TypedDict definition [valid-type]'] +Line 81: Unexpected errors ['typeddicts_readonly_inheritance.py:81: error: ReadOnly TypedDict key "ident" TypedDict is mutated [typeddict-readonly-mutated]'] +Line 102: Unexpected errors ['typeddicts_readonly_inheritance.py:102: error: Overwriting TypedDict field "b" while extending [misc]'] """ diff --git a/conformance/results/mypy/typeddicts_readonly_kwargs.toml b/conformance/results/mypy/typeddicts_readonly_kwargs.toml index cc8dcd749..a90e015f1 100644 --- a/conformance/results/mypy/typeddicts_readonly_kwargs.toml +++ b/conformance/results/mypy/typeddicts_readonly_kwargs.toml @@ -1,13 +1,7 @@ -conformant = "Unsupported" +conformant = "Pass" output = """ -typeddicts_readonly_kwargs.py:24: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type] -typeddicts_readonly_kwargs.py:24: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -typeddicts_readonly_kwargs.py:25: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type] -typeddicts_readonly_kwargs.py:25: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +typeddicts_readonly_kwargs.py:33: error: ReadOnly TypedDict key "key1" TypedDict is mutated [typeddict-readonly-mutated] """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 33: Expected 1 errors -Line 24: Unexpected errors ['typeddicts_readonly_kwargs.py:24: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type]'] -Line 25: Unexpected errors ['typeddicts_readonly_kwargs.py:25: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type]'] """ diff --git a/conformance/results/mypy/typeddicts_readonly_update.toml b/conformance/results/mypy/typeddicts_readonly_update.toml index dfb56389c..c53706fc4 100644 --- a/conformance/results/mypy/typeddicts_readonly_update.toml +++ b/conformance/results/mypy/typeddicts_readonly_update.toml @@ -1,13 +1,13 @@ -conformant = "Unsupported" +conformant = "Partial" +notes = """ +Incorrectly allows update of ReadOnly item. +Incorrectly rejects update involving an item with Never type. +""" output = """ -typeddicts_readonly_update.py:17: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type] -typeddicts_readonly_update.py:17: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -typeddicts_readonly_update.py:30: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type] -typeddicts_readonly_update.py:30: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +typeddicts_readonly_update.py:34: error: Argument 1 to "update" of "TypedDict" has incompatible type "B"; expected "TypedDict({'x'?=: int, 'y': int})" [typeddict-item] """ conformance_automated = "Fail" errors_diff = """ Line 23: Expected 1 errors -Line 17: Unexpected errors ['typeddicts_readonly_update.py:17: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type]'] -Line 30: Unexpected errors ['typeddicts_readonly_update.py:30: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type]'] +Line 34: Unexpected errors ['typeddicts_readonly_update.py:34: error: Argument 1 to "update" of "TypedDict" has incompatible type "B"; expected "TypedDict({\\'x\\'?=: int, \\'y\\': int})" [typeddict-item]'] """ diff --git a/conformance/results/mypy/typeddicts_required.toml b/conformance/results/mypy/typeddicts_required.toml index 885bf8575..7cf6994d7 100644 --- a/conformance/results/mypy/typeddicts_required.toml +++ b/conformance/results/mypy/typeddicts_required.toml @@ -5,8 +5,8 @@ Does not support nesting of `Annotated` and `Required` or `NotRequired`. output = """ typeddicts_required.py:12: error: Required[] can be only used in a TypedDict definition [valid-type] typeddicts_required.py:19: error: NotRequired[] can be only used in a TypedDict definition [valid-type] -typeddicts_required.py:62: error: Required[] can be only used in a TypedDict definition [valid-type] -typeddicts_required.py:63: error: NotRequired[] can be only used in a TypedDict definition [valid-type] +typeddicts_required.py:62: error: "Required[]" type cannot be nested [valid-type] +typeddicts_required.py:63: error: "NotRequired[]" type cannot be nested [valid-type] typeddicts_required.py:68: error: Required[] can be only used in a TypedDict definition [valid-type] typeddicts_required.py:70: error: Required[] can be only used in a TypedDict definition [valid-type] """ diff --git a/conformance/results/mypy/version.toml b/conformance/results/mypy/version.toml index f2673d1c6..cdbafd594 100644 --- a/conformance/results/mypy/version.toml +++ b/conformance/results/mypy/version.toml @@ -1,2 +1,2 @@ -version = "mypy 1.11.2" -test_duration = 1.6 +version = "mypy 1.12.0" +test_duration = 1.7 diff --git a/conformance/results/pyre/aliases_type_statement.toml b/conformance/results/pyre/aliases_type_statement.toml index 02d923e11..31559fcb5 100644 --- a/conformance/results/pyre/aliases_type_statement.toml +++ b/conformance/results/pyre/aliases_type_statement.toml @@ -25,14 +25,14 @@ Line 46: Expected 1 errors Line 47: Expected 1 errors Line 48: Expected 1 errors Line 49: Expected 1 errors -Line 52: Expected 1 errors -Line 58: Expected 1 errors -Line 64: Expected 1 errors -Line 69: Expected 1 errors +Line 56: Expected 1 errors +Line 62: Expected 1 errors +Line 67: Expected 1 errors +Line 77: Expected 1 errors Line 79: Expected 1 errors -Line 81: Expected 1 errors +Line 82: Expected 1 errors Line 84: Expected 1 errors -Line 86: Expected 1 errors -Line 90: Expected 1 errors +Lines 51, 52: Expected error (tag 'TA14') +Lines 88, 89: Expected error (tag 'RTA6') Line 8: Unexpected errors ['aliases_type_statement.py:8:6 Parsing failure [404]: invalid syntax'] """ diff --git a/conformance/results/pyre/generics_syntax_declarations.toml b/conformance/results/pyre/generics_syntax_declarations.toml index 59b938d56..410811065 100644 --- a/conformance/results/pyre/generics_syntax_declarations.toml +++ b/conformance/results/pyre/generics_syntax_declarations.toml @@ -7,15 +7,15 @@ generics_syntax_declarations.py:13:17 Parsing failure [404]: invalid syntax """ conformance_automated = "Fail" errors_diff = """ -Line 19: Expected 1 errors -Line 27: Expected 1 errors -Line 34: Expected 1 errors -Line 46: Expected 1 errors -Line 50: Expected 1 errors -Line 62: Expected 1 errors -Line 66: Expected 1 errors -Line 73: Expected 1 errors -Line 77: Expected 1 errors -Line 81: Expected 1 errors +Line 17: Expected 1 errors +Line 25: Expected 1 errors +Line 32: Expected 1 errors +Line 44: Expected 1 errors +Line 48: Expected 1 errors +Line 60: Expected 1 errors +Line 64: Expected 1 errors +Line 71: Expected 1 errors +Line 75: Expected 1 errors +Line 79: Expected 1 errors Line 13: Unexpected errors ['generics_syntax_declarations.py:13:17 Parsing failure [404]: invalid syntax'] """ diff --git a/conformance/results/pyre/version.toml b/conformance/results/pyre/version.toml index f4f08845e..4c6e11616 100644 --- a/conformance/results/pyre/version.toml +++ b/conformance/results/pyre/version.toml @@ -1,2 +1,2 @@ version = "pyre 0.9.22" -test_duration = 4.5 +test_duration = 4.6 diff --git a/conformance/results/pyright/aliases_type_statement.toml b/conformance/results/pyright/aliases_type_statement.toml index ee9f8f7c3..4556366e6 100644 --- a/conformance/results/pyright/aliases_type_statement.toml +++ b/conformance/results/pyright/aliases_type_statement.toml @@ -36,19 +36,19 @@ aliases_type_statement.py:46:23 - error: Expected class but received "Literal[Tr aliases_type_statement.py:47:23 - error: Expected class but received "Literal[1]" (reportGeneralTypeIssues) aliases_type_statement.py:48:23 - error: Binary operator not allowed in type expression (reportInvalidTypeForm) aliases_type_statement.py:49:23 - error: Type expressions cannot use format string literals (f-strings) (reportGeneralTypeIssues) -aliases_type_statement.py:52:10 - error: Type alias declaration "BadTypeAlias14" is obscured by a declaration of the same name (reportRedeclaration) -aliases_type_statement.py:58:10 - error: A type statement can be used only within a module or class scope (reportGeneralTypeIssues) -aliases_type_statement.py:64:23 - error: Type parameter "V" is not included in the type parameter list for "TA1" (reportGeneralTypeIssues) -aliases_type_statement.py:69:17 - error: Type parameter "T1" is not included in the type parameter list for "TA2" (reportGeneralTypeIssues) -aliases_type_statement.py:79:7 - error: Could not specialize type "RecursiveTypeAlias2[S@RecursiveTypeAlias2, T@RecursiveTypeAlias2, P@RecursiveTypeAlias2]" +aliases_type_statement.py:51:6 - error: Type alias declaration "BadTypeAlias14" is obscured by a declaration of the same name (reportRedeclaration) +aliases_type_statement.py:56:10 - error: A type statement can be used only within a module or class scope (reportGeneralTypeIssues) +aliases_type_statement.py:62:23 - error: Type parameter "V" is not included in the type parameter list for "TA1" (reportGeneralTypeIssues) +aliases_type_statement.py:67:17 - error: Type parameter "T1" is not included in the type parameter list for "TA2" (reportGeneralTypeIssues) +aliases_type_statement.py:77:7 - error: Could not specialize type "RecursiveTypeAlias2[S@RecursiveTypeAlias2, T@RecursiveTypeAlias2, P@RecursiveTypeAlias2]"   Type "str" is not assignable to type "int"     "str" is not assignable to "int" (reportInvalidTypeForm) -aliases_type_statement.py:81:7 - error: Could not specialize type "RecursiveTypeAlias2[S@RecursiveTypeAlias2, T@RecursiveTypeAlias2, P@RecursiveTypeAlias2]" +aliases_type_statement.py:79:7 - error: Could not specialize type "RecursiveTypeAlias2[S@RecursiveTypeAlias2, T@RecursiveTypeAlias2, P@RecursiveTypeAlias2]"   Type "int" is not assignable to type "str"     "int" is not assignable to "str" (reportInvalidTypeForm) -aliases_type_statement.py:84:28 - error: Type alias "RecursiveTypeAlias3" cannot use itself in its definition (reportGeneralTypeIssues) -aliases_type_statement.py:86:31 - error: Type alias "RecursiveTypeAlias4" cannot use itself in its definition (reportGeneralTypeIssues) -aliases_type_statement.py:90:28 - error: Type alias "RecursiveTypeAlias6" cannot use itself in its definition (reportGeneralTypeIssues) +aliases_type_statement.py:82:28 - error: Type alias "RecursiveTypeAlias3" cannot use itself in its definition (reportGeneralTypeIssues) +aliases_type_statement.py:84:31 - error: Type alias "RecursiveTypeAlias4" cannot use itself in its definition (reportGeneralTypeIssues) +aliases_type_statement.py:88:28 - error: Type alias "RecursiveTypeAlias6" cannot use itself in its definition (reportGeneralTypeIssues) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/generics_syntax_declarations.toml b/conformance/results/pyright/generics_syntax_declarations.toml index 4321bdb36..25db91523 100644 --- a/conformance/results/pyright/generics_syntax_declarations.toml +++ b/conformance/results/pyright/generics_syntax_declarations.toml @@ -1,18 +1,18 @@ conformant = "Pass" output = """ -generics_syntax_declarations.py:19:17 - error: "Generic" base class cannot be used with type parameter syntax (reportGeneralTypeIssues) -generics_syntax_declarations.py:27:20 - error: Type arguments are not allowed with Protocol class when using type parameter syntax (reportGeneralTypeIssues) -generics_syntax_declarations.py:34:11 - error: Cannot access attribute "is_integer" for class "str*" +generics_syntax_declarations.py:17:17 - error: "Generic" base class cannot be used with type parameter syntax (reportGeneralTypeIssues) +generics_syntax_declarations.py:25:20 - error: Type arguments are not allowed with Protocol class when using type parameter syntax (reportGeneralTypeIssues) +generics_syntax_declarations.py:32:11 - error: Cannot access attribute "is_integer" for class "str*"   Attribute "is_integer" is unknown (reportAttributeAccessIssue) -generics_syntax_declarations.py:46:21 - error: TypeVar constraint type cannot be generic (reportGeneralTypeIssues) -generics_syntax_declarations.py:50:17 - error: List expression not allowed in type expression +generics_syntax_declarations.py:44:21 - error: TypeVar constraint type cannot be generic (reportGeneralTypeIssues) +generics_syntax_declarations.py:48:17 - error: List expression not allowed in type expression   Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) -generics_syntax_declarations.py:50:17 - error: Expected class but received "list[Unknown]" (reportGeneralTypeIssues) -generics_syntax_declarations.py:62:17 - error: TypeVar must have at least two constrained types (reportGeneralTypeIssues) -generics_syntax_declarations.py:66:17 - error: TypeVar must have at least two constrained types (reportGeneralTypeIssues) -generics_syntax_declarations.py:73:17 - error: Variable not allowed in type expression (reportInvalidTypeForm) -generics_syntax_declarations.py:77:18 - error: Expected class but received "Literal[3]" (reportGeneralTypeIssues) -generics_syntax_declarations.py:81:23 - error: "S" is not defined (reportUndefinedVariable) +generics_syntax_declarations.py:48:17 - error: Expected class but received "list[Unknown]" (reportGeneralTypeIssues) +generics_syntax_declarations.py:60:17 - error: TypeVar must have at least two constrained types (reportGeneralTypeIssues) +generics_syntax_declarations.py:64:17 - error: TypeVar must have at least two constrained types (reportGeneralTypeIssues) +generics_syntax_declarations.py:71:17 - error: Variable not allowed in type expression (reportInvalidTypeForm) +generics_syntax_declarations.py:75:18 - error: Expected class but received "Literal[3]" (reportGeneralTypeIssues) +generics_syntax_declarations.py:79:23 - error: "S" is not defined (reportUndefinedVariable) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/version.toml b/conformance/results/pyright/version.toml index 17fcd9132..a90f554cf 100644 --- a/conformance/results/pyright/version.toml +++ b/conformance/results/pyright/version.toml @@ -1,2 +1,2 @@ version = "pyright 1.1.384" -test_duration = 1.2 +test_duration = 1.3 diff --git a/conformance/results/pytype/aliases_type_statement.toml b/conformance/results/pytype/aliases_type_statement.toml index cd7ae2953..84f4bc313 100644 --- a/conformance/results/pytype/aliases_type_statement.toml +++ b/conformance/results/pytype/aliases_type_statement.toml @@ -25,13 +25,13 @@ Line 46: Expected 1 errors Line 47: Expected 1 errors Line 48: Expected 1 errors Line 49: Expected 1 errors -Line 52: Expected 1 errors -Line 58: Expected 1 errors -Line 64: Expected 1 errors -Line 69: Expected 1 errors +Line 56: Expected 1 errors +Line 62: Expected 1 errors +Line 67: Expected 1 errors +Line 77: Expected 1 errors Line 79: Expected 1 errors -Line 81: Expected 1 errors +Line 82: Expected 1 errors Line 84: Expected 1 errors -Line 86: Expected 1 errors -Line 90: Expected 1 errors +Lines 51, 52: Expected error (tag 'TA14') +Lines 88, 89: Expected error (tag 'RTA6') """ diff --git a/conformance/results/pytype/generics_syntax_declarations.toml b/conformance/results/pytype/generics_syntax_declarations.toml index 3eeb56529..3960f34b1 100644 --- a/conformance/results/pytype/generics_syntax_declarations.toml +++ b/conformance/results/pytype/generics_syntax_declarations.toml @@ -7,14 +7,14 @@ SyntaxError: Type parameter lists are only supported in Python 3.12 and greater """ conformance_automated = "Fail" errors_diff = """ -Line 19: Expected 1 errors -Line 27: Expected 1 errors -Line 34: Expected 1 errors -Line 46: Expected 1 errors -Line 50: Expected 1 errors -Line 62: Expected 1 errors -Line 66: Expected 1 errors -Line 73: Expected 1 errors -Line 77: Expected 1 errors -Line 81: Expected 1 errors +Line 17: Expected 1 errors +Line 25: Expected 1 errors +Line 32: Expected 1 errors +Line 44: Expected 1 errors +Line 48: Expected 1 errors +Line 60: Expected 1 errors +Line 64: Expected 1 errors +Line 71: Expected 1 errors +Line 75: Expected 1 errors +Line 79: Expected 1 errors """ diff --git a/conformance/results/pytype/version.toml b/conformance/results/pytype/version.toml index 79ea03461..a314c2a01 100644 --- a/conformance/results/pytype/version.toml +++ b/conformance/results/pytype/version.toml @@ -1,2 +1,2 @@ version = "pytype 2024.10.11" -test_duration = 31.9 +test_duration = 33.1 diff --git a/conformance/results/results.html b/conformance/results/results.html index ec61d4b08..eb55cda3e 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -158,17 +158,17 @@

    Python Type System Conformance Test Results

     
    mypy 1.11.2
    -
    1.9sec
    +
    1.6sec
    pyright 1.1.384
    -
    1.3sec
    +
    1.2sec
    pyre 0.9.22
    4.5sec
    pytype 2024.09.13
    -
    32.8sec
    +
    pytype 2024.10.11
    +
    31.9sec
    @@ -550,8 +550,8 @@

    Python Type System Conformance Test Results

    Partial

    Reports errors for protocol static method with "..." implementation.

    Does not report error when calling unimplemented protocol method from derived class.

    Does not report type incompatibility when assigning to attribute defined in protocol.

    Does not reject instantiation of class that derives from protocol but doesn't implement attribute.

    Does not report instantiation of class that derives from protocol but doesn't implement method.

         protocols_generic
    Partial

    Fails protocol matching when method-scoped TypeVar is used in protocol.

    Partial

    Incorrectly generates type violation for protocol that uses method-scoped type variables.

    PassPass
    Partial

    Does not reject the use of Protocol and Generic together as base classes.

    Does not detect protocol mismatch when method-scoped TypeVar is used in protocol.

    Partial

    Does not correctly enforce contravariance in protocol type compatibility tests.

    Does not correctly enforce invariance in protocol type compatibility tests.

    Does not detect protocol mismatch when method-scoped TypeVar is used in protocol.

    - - + @@ -337,7 +337,7 @@

    Python Type System Conformance Test Results

    - + @@ -415,7 +415,7 @@

    Python Type System Conformance Test Results

    - + @@ -484,7 +484,7 @@

    Python Type System Conformance Test Results

    - + @@ -808,31 +808,31 @@

    Python Type System Conformance Test Results

    - + - + - + - + - + @@ -859,7 +859,7 @@

    Python Type System Conformance Test Results

    Tuples - + diff --git a/conformance/src/type_checker.py b/conformance/src/type_checker.py index c8955c0fa..185a3a0cb 100644 --- a/conformance/src/type_checker.py +++ b/conformance/src/type_checker.py @@ -109,16 +109,6 @@ def run_tests(self, test_files: Sequence[str]) -> dict[str, str]: "-m", "mypy", ".", - # Enable experimental support for PEP 695 syntax. - # This can be removed once it's no longer experimental. - "--enable-incomplete-feature=NewGenericSyntax", - # Mypy currently crashes when run on a couple of test cases, - # so we need to exclude them for now. Remove this once mypy adds - # support for this functionality. - "--exclude", - r"generics_defaults\.py", - "--exclude", - r"generics_syntax_declarations\.py", "--disable-error-code", "empty-body", ] diff --git a/conformance/tests/aliases_type_statement.py b/conformance/tests/aliases_type_statement.py index 23fe137cb..024b4098a 100644 --- a/conformance/tests/aliases_type_statement.py +++ b/conformance/tests/aliases_type_statement.py @@ -48,10 +48,8 @@ def func2(x: object): type BadTypeAlias12 = list or set # E type BadTypeAlias13 = f"{'int'}" # E -if 1 < 2: - type BadTypeAlias14 = int # E: redeclared -else: - type BadTypeAlias14 = int +type BadTypeAlias14 = int # E[TA14]: redeclared +type BadTypeAlias14 = int # E[TA14]: redeclared def func3(): @@ -87,5 +85,5 @@ def func3(): type RecursiveTypeAlias5[T] = T | list[RecursiveTypeAlias5[T]] -type RecursiveTypeAlias6 = RecursiveTypeAlias7 # E: circular definition -type RecursiveTypeAlias7 = RecursiveTypeAlias6 +type RecursiveTypeAlias6 = RecursiveTypeAlias7 # E[RTA6]: circular definition +type RecursiveTypeAlias7 = RecursiveTypeAlias6 # E[RTA6]: circular definition diff --git a/conformance/tests/generics_syntax_declarations.py b/conformance/tests/generics_syntax_declarations.py index 21ab84cba..62d2d1019 100644 --- a/conformance/tests/generics_syntax_declarations.py +++ b/conformance/tests/generics_syntax_declarations.py @@ -7,13 +7,11 @@ # This generic class is parameterized by a TypeVar T, a # TypeVarTuple Ts, and a ParamSpec P. -from typing import Generic, ParamSpec, Protocol, TypeVar, TypeVarTuple, assert_type +from typing import Generic, Protocol class ChildClass[T, *Ts, **P]: - assert_type(T, TypeVar) - assert_type(Ts, TypeVarTuple) - assert_type(P, ParamSpec) + pass class ClassA[T](Generic[T]): # E: Runtime error diff --git a/conformance/tests/generics_variance_inference.py b/conformance/tests/generics_variance_inference.py index c2de93767..c7e09760b 100644 --- a/conformance/tests/generics_variance_inference.py +++ b/conformance/tests/generics_variance_inference.py @@ -41,7 +41,7 @@ def __iter__(self) -> Iterator[T]: vco1_2: ShouldBeCovariant1[int] = ShouldBeCovariant1[float]() # E -class ShouldBeCovariant2[T](Sequence[T]): +class ShouldBeCovariant2[T](ShouldBeCovariant1[T]): pass @@ -85,7 +85,7 @@ def __init__(self, value: T) -> None: self._value = value @property - def value(self): + def value(self) -> T: return self._value @value.setter From f516a434a7ac22aba321f97dd6aafd3dbfd9834f Mon Sep 17 00:00:00 2001 From: Eric Traut Date: Wed, 16 Oct 2024 08:51:13 -0700 Subject: [PATCH 053/308] Updated conformance results for pyright 1.1.385. (#1867) * Fixes regression caught by constructors_call_type test * Fixes regression caught by generics_typevartuple_args test --- .../results/pyright/constructors_call_type.toml | 11 ++++------- .../results/pyright/generics_typevartuple_args.toml | 9 ++++----- conformance/results/pyright/version.toml | 4 ++-- conformance/results/results.html | 6 +++--- 4 files changed, 13 insertions(+), 17 deletions(-) diff --git a/conformance/results/pyright/constructors_call_type.toml b/conformance/results/pyright/constructors_call_type.toml index 2e33755c3..da804d72e 100644 --- a/conformance/results/pyright/constructors_call_type.toml +++ b/conformance/results/pyright/constructors_call_type.toml @@ -1,18 +1,15 @@ -conformant = "Partial" -notes = """ -Fails to report error when passing incorrect arguments for metaclass __call__ method. -""" +conformant = "Pass" errors_diff = """ -Line 30: Expected 1 errors -Line 72: Expected 1 errors """ output = """ +constructors_call_type.py:30:5 - error: Arguments missing for parameters "x", "y" (reportCallIssue) constructors_call_type.py:40:5 - error: Arguments missing for parameters "x", "y" (reportCallIssue) constructors_call_type.py:50:5 - error: Arguments missing for parameters "x", "y" (reportCallIssue) constructors_call_type.py:59:9 - error: Expected 0 positional arguments (reportCallIssue) constructors_call_type.py:64:9 - error: Expected 0 positional arguments (reportCallIssue) +constructors_call_type.py:72:5 - error: Arguments missing for parameters "x", "y" (reportCallIssue) constructors_call_type.py:81:5 - error: Argument missing for parameter "y" (reportCallIssue) constructors_call_type.py:82:12 - error: Argument of type "Literal[2]" cannot be assigned to parameter "y" of type "str" in function "__new__"   "Literal[2]" is not assignable to "str" (reportArgumentType) """ -conformance_automated = "Fail" +conformance_automated = "Pass" diff --git a/conformance/results/pyright/generics_typevartuple_args.toml b/conformance/results/pyright/generics_typevartuple_args.toml index 04a4cc5b5..2ef2c70e2 100644 --- a/conformance/results/pyright/generics_typevartuple_args.toml +++ b/conformance/results/pyright/generics_typevartuple_args.toml @@ -8,16 +8,15 @@ generics_typevartuple_args.py:48:10 - error: Argument of type "Literal['2']" can   "Literal['2']" is not assignable to "int" (reportArgumentType) generics_typevartuple_args.py:57:10 - error: Argument of type "Literal[1]" cannot be assigned to parameter of type "str" in function "func2"   "Literal[1]" is not assignable to "str" (reportArgumentType) -generics_typevartuple_args.py:59:7 - error: Argument of type "Literal['']" cannot be assigned to parameter of type "int" in function "func2" -  "Literal['']" is not assignable to "int" (reportArgumentType) +generics_typevartuple_args.py:58:1 - error: Argument missing for parameter "args[2]" (reportCallIssue) +generics_typevartuple_args.py:59:1 - error: Argument missing for parameter "args[2]" (reportCallIssue) +generics_typevartuple_args.py:67:1 - error: Argument missing for parameter "args[1]" (reportCallIssue) generics_typevartuple_args.py:75:13 - error: Argument of type "tuple[Literal[1], Literal[2]]" cannot be assigned to parameter "args" of type "tuple[*Ts@func4]" in function "func4"   "tuple[Literal[1], Literal[2]]" is not assignable to "tuple[int]"     Tuple size mismatch; expected 1 but received 2 (reportArgumentType) generics_typevartuple_args.py:76:14 - error: Argument of type "tuple[Literal['1']]" cannot be assigned to parameter "args" of type "tuple[*Ts@func4]" in function "func4"   "Literal['1']" is not assignable to "int" (reportArgumentType) """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 58: Expected 1 errors -Line 67: Expected 1 errors """ diff --git a/conformance/results/pyright/version.toml b/conformance/results/pyright/version.toml index a90f554cf..4849f62d8 100644 --- a/conformance/results/pyright/version.toml +++ b/conformance/results/pyright/version.toml @@ -1,2 +1,2 @@ -version = "pyright 1.1.384" -test_duration = 1.3 +version = "pyright 1.1.385" +test_duration = 1.2 diff --git a/conformance/results/results.html b/conformance/results/results.html index eb55cda3e..c6515ec37 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -161,8 +161,8 @@

    Python Type System Conformance Test Results

    - - + From af4693a02a22a2517b8cc23a90a341e2f6f67fec Mon Sep 17 00:00:00 2001 From: Zac Hatfield-Dodds Date: Tue, 22 Oct 2024 18:39:27 -0700 Subject: [PATCH 054/308] Suggest `pyupgrade` or `ruff` for modernizing superseded typing features (#1868) Suggest `pyupgrade` or `ruff` for modernizing --- docs/guides/modernizing.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/guides/modernizing.rst b/docs/guides/modernizing.rst index 0c6309a3d..db5d81e82 100644 --- a/docs/guides/modernizing.rst +++ b/docs/guides/modernizing.rst @@ -24,6 +24,12 @@ Each section states the minimum Python version required to use the feature, whether it is available in typing-extensions, and whether it is available using quoting. +.. tip:: + + Tools such as `pyupgrade `__ or + `ruff `__ can automatically perform + these refactorings for you. + .. note:: The latest version of typing-extensions is available for all Python From adc675fa9209ec1830fcea3c622562e722b60b44 Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Wed, 23 Oct 2024 14:54:21 +0100 Subject: [PATCH 055/308] Modernizing guide: also mention `com2ann` (#1869) Small followup to #1868 This guide mentions type comments as one of the older typing features that you might like to modernize; as far as I know, `com2ann` is still the best tool for auto-converting these to Python-3 type annotations. --- docs/guides/modernizing.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/guides/modernizing.rst b/docs/guides/modernizing.rst index db5d81e82..279febd6a 100644 --- a/docs/guides/modernizing.rst +++ b/docs/guides/modernizing.rst @@ -26,8 +26,9 @@ available using quoting. .. tip:: - Tools such as `pyupgrade `__ or - `ruff `__ can automatically perform + Tools such as `pyupgrade `__, + `ruff `__ and/or + `com2ann `__ can automatically perform these refactorings for you. .. note:: From b4b9c4e7e249aab777ad5b46cd529e5e9bc8861b Mon Sep 17 00:00:00 2001 From: Eric Traut Date: Wed, 23 Oct 2024 09:49:54 -0700 Subject: [PATCH 056/308] Updated conformance results for mypy 1.13 and pyright 1.1.386 (#1870) Pyright fixed one conformance bug in callables_kwargs test. Mypy results did not change. --- conformance/results/mypy/version.toml | 4 ++-- conformance/results/pyre/version.toml | 2 +- conformance/results/pyright/callables_kwargs.toml | 11 +++-------- .../results/pyright/typeddicts_readonly_kwargs.toml | 2 +- conformance/results/pyright/version.toml | 2 +- conformance/results/results.html | 10 +++++----- 6 files changed, 13 insertions(+), 18 deletions(-) diff --git a/conformance/results/mypy/version.toml b/conformance/results/mypy/version.toml index cdbafd594..6f12777c4 100644 --- a/conformance/results/mypy/version.toml +++ b/conformance/results/mypy/version.toml @@ -1,2 +1,2 @@ -version = "mypy 1.12.0" -test_duration = 1.7 +version = "mypy 1.13.0" +test_duration = 1.5 diff --git a/conformance/results/pyre/version.toml b/conformance/results/pyre/version.toml index 4c6e11616..48f19eaac 100644 --- a/conformance/results/pyre/version.toml +++ b/conformance/results/pyre/version.toml @@ -1,2 +1,2 @@ version = "pyre 0.9.22" -test_duration = 4.6 +test_duration = 4.4 diff --git a/conformance/results/pyright/callables_kwargs.toml b/conformance/results/pyright/callables_kwargs.toml index b3e1e6c04..9dea95b60 100644 --- a/conformance/results/pyright/callables_kwargs.toml +++ b/conformance/results/pyright/callables_kwargs.toml @@ -1,11 +1,7 @@ -conformant = "Partial" -notes = """ -Incorrectly handles assert_type for unpacked TypedDict. -""" +conformant = "Pass" output = """ callables_kwargs.py:28:5 - error: Could not access item in TypedDict -  "v2" is not a required key in "*TD2", so access may result in runtime exception (reportTypedDictNotRequiredAccess) -callables_kwargs.py:41:17 - error: "assert_type" mismatch: expected "TD1" but received "*TD1" (reportAssertTypeFailure) +  "v2" is not a required key in "TD2", so access may result in runtime exception (reportTypedDictNotRequiredAccess) callables_kwargs.py:46:5 - error: Arguments missing for parameters "v1", "v3" (reportCallIssue) callables_kwargs.py:51:32 - error: No parameter named "v4" (reportCallIssue) callables_kwargs.py:52:11 - error: Expected 0 positional arguments (reportCallIssue) @@ -32,7 +28,6 @@ callables_kwargs.py:103:19 - error: Type "(**kwargs: **TD2) -> None" is not assi callables_kwargs.py:111:30 - error: Typed dictionary overlaps with keyword parameter: v1 (reportGeneralTypeIssues) callables_kwargs.py:122:21 - error: Expected TypedDict type argument for Unpack (reportGeneralTypeIssues) """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 41: Unexpected errors ['callables_kwargs.py:41:17 - error: "assert_type" mismatch: expected "TD1" but received "*TD1" (reportAssertTypeFailure)'] """ diff --git a/conformance/results/pyright/typeddicts_readonly_kwargs.toml b/conformance/results/pyright/typeddicts_readonly_kwargs.toml index 6ef10226e..4a2e2d220 100644 --- a/conformance/results/pyright/typeddicts_readonly_kwargs.toml +++ b/conformance/results/pyright/typeddicts_readonly_kwargs.toml @@ -1,7 +1,7 @@ conformant = "Pass" output = """ typeddicts_readonly_kwargs.py:33:5 - error: Could not assign item in TypedDict -  "key1" is a read-only key in "*ReadOnlyArgs" (reportTypedDictNotRequiredAccess) +  "key1" is a read-only key in "ReadOnlyArgs" (reportTypedDictNotRequiredAccess) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/version.toml b/conformance/results/pyright/version.toml index 4849f62d8..49cfb8012 100644 --- a/conformance/results/pyright/version.toml +++ b/conformance/results/pyright/version.toml @@ -1,2 +1,2 @@ -version = "pyright 1.1.385" +version = "pyright 1.1.386" test_duration = 1.2 diff --git a/conformance/results/results.html b/conformance/results/results.html index c6515ec37..3211c84f1 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -158,14 +158,14 @@

    Python Type System Conformance Test Results

     
    mypy 1.11.2
    -
    1.6sec
    +
    mypy 1.12.0
    +
    1.7sec
    pyright 1.1.384
    -
    1.2sec
    +
    1.3sec
    pyre 0.9.22
    -
    4.5sec
    +
    4.6sec
    pytype 2024.10.11
    -
    31.9sec
    +
    33.1sec
    @@ -277,7 +277,7 @@

    Python Type System Conformance Test Results

    Unsupported

    Does not support ParamSpec.

         generics_paramspec_components
    Partial

    Does not report illegal use of "P.args" on normal parameter.

    Does not report error when P.args is specified but P.kwargs is missing.

    Does not report error when P is out of scope and P.args and P.kwargs is used.

    Does not report error when keyword argument is specified between P.args and P.kwargs.

    Does not report error when calling callable and argument is missing for concatenated parameters.

    Partial

    Does not report illegal use of "P.args" on normal parameter.

    Does not report error when P.args is specified but P.kwargs is missing.

    Does not report error when P is out of scope and P.args and P.kwargs is used.

    Does not report error when keyword argument is specified between P.args and P.kwargs.

    Pass
    Partial

    Does not report illegal use of "P.args" on normal parameter.

    Does not report error when P.args is specified but P.kwargs is missing.

    Does not report error when P is out of scope and P.args and P.kwargs is used.

    Does not report error when calling callback defined with ParamSpec with incorrect arguments.

    Does not report error when keyword argument is specified between P.args and P.kwargs.

    Does not report error when calling callable and argument is missing for concatenated parameters.

    Unsupported

    Does not support ParamSpec.

    Unsupported

    Type parameter syntax not yet support.

         generics_syntax_declarations
    Partial

    Does not detect many illegal usages of type parameter syntax.

    Pass Pass
    Unsupported

    Type parameter syntax not yet support.

    Unsupported

    Type parameter syntax not yet support.

    Unsupported

    Does not support covariant or contravariant TypeVars.

         generics_variance_inference
    Partial

    Computes incorrect variance in some cases.

    Pass Pass
    Unsupported

    Type parameter syntax not yet support.

    Unsupported

    Type parameter syntax not yet support.

    Partial

    Does not detect type violation for some deeply-nested types.

    Does not properly handle `|` for unions in some recursive type alias definitions.

    Does not detect cyclical references in recursive type alias definition.

         aliases_type_statement
    Partial

    Does not reject use of TypeAliasType as base class.

    Does not reject redefinition of type alias defined with type statement.

    Does not reject type alias defined in function scope.

    Does not reject type alias with circular definition.

    Partial

    Does not reject type alias defined in function scope.

    Pass
    Unsupported

    Does not support `type` statement.

    Unsupported

    Does not support `type` statement.

    Partial

    Does not report type violation with TypedDict value assignment.

    Does not report reference to unknown key in TypedDict.

    Does not reject `clear` method on TypedDict with required keys.

    Does not reject delete operation for required key in TypedDict.

         typeddicts_readonlyUnsupported
    Partial

    Incorrectly rejects NotRequired directive when used in an Annotated annotation.

    Pass Unsupported Unsupported
         typeddicts_readonly_consistencyUnsupported
    Partial

    Incorrectly rejects assignment of required item to not-required read-only item.

    Pass Unsupported Unsupported
         typeddicts_readonly_inheritanceUnsupported
    Partial

    Incorrectly rejects non-ReadOnly override of ReadOnly item.

    Incorrectly rejects override of ReadOnly item with another ReadOnly item with narrower type.

    Incorrectly rejects override of NotRequired ReadOnly item with a Required ReadOnly item.

    Pass Unsupported Unsupported
         typeddicts_readonly_kwargsUnsupportedPass Pass Unsupported Unsupported
         typeddicts_readonly_updateUnsupported
    Partial

    Incorrectly allows update of ReadOnly item.

    Incorrectly rejects update involving an item with Never type.

    Pass Unsupported Unsupported
         tuples_type_compat
    Partial

    Does not support tuple narrowing based on `len()` type guard (optional).

    Incorrectly narrows tuple based on sequence patterns.

    Partial

    Does not support tuple narrowing based on `len()` type guard (optional).

    Pass
    Partial

    Does not support some unpacked tuple forms.

    Does not report type violation when assigning `tuple[int, ...]` to `tuple[int]`.

    Does not support tuple narrowing based on `len()` type guard (optional).

    Does not correctly evaluate `Sequence[Never]` for `tuple[()]`.

    Partial

    Does not support unpacked tuple forms.

    Does not report type violation when assigning `tuple[int, ...]` to `tuple[int]`.

    Does not support tuple narrowing based on `len()` type guard (optional).

    mypy 1.12.0
    1.7sec
    pyright 1.1.384
    -
    1.3sec
    +
    pyright 1.1.385
    +
    1.2sec
    pyre 0.9.22
    4.6sec
    @@ -647,7 +647,7 @@

    Python Type System Conformance Test Results

         constructors_call_type
    Partial

    Does not validate call to custom metaclass __call__ method through type[T].

    Partial

    Fails to report error when passing incorrect arguments for metaclass __call__ method.

    Pass Pass
    Partial

    Does not validate call to custom metaclass __call__ method through type[T].

    - - - + From 02b385a9b1205be6c2e8122a740ddd0bb30c6fa7 Mon Sep 17 00:00:00 2001 From: migeed-z Date: Thu, 24 Oct 2024 11:37:59 -0700 Subject: [PATCH 057/308] Add missing return type to generic_syntax_infer_variance.py (#1871) * add missing return type to generic_syntax_infer_variance.py * update generics_syntax_infer_variance.py --- .../results/mypy/generics_syntax_infer_variance.toml | 3 +++ conformance/results/mypy/version.toml | 2 +- conformance/results/pyre/version.toml | 2 +- conformance/results/pyright/version.toml | 2 +- conformance/results/pytype/specialtypes_never.toml | 7 +++---- conformance/results/pytype/version.toml | 2 +- conformance/results/results.html | 8 ++++---- conformance/tests/generics_syntax_infer_variance.py | 2 +- 8 files changed, 15 insertions(+), 13 deletions(-) diff --git a/conformance/results/mypy/generics_syntax_infer_variance.toml b/conformance/results/mypy/generics_syntax_infer_variance.toml index 1db3d4a8d..4a4ecc71f 100644 --- a/conformance/results/mypy/generics_syntax_infer_variance.toml +++ b/conformance/results/mypy/generics_syntax_infer_variance.toml @@ -55,6 +55,8 @@ generics_syntax_infer_variance.py:86: error: The type "type[ShouldBeCovariant6]" generics_syntax_infer_variance.py:89: error: Free type variable expected in Generic[...] [misc] generics_syntax_infer_variance.py:90: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] generics_syntax_infer_variance.py:90: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:94: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:94: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases generics_syntax_infer_variance.py:98: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] generics_syntax_infer_variance.py:98: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases generics_syntax_infer_variance.py:102: error: "ShouldBeInvariant1" expects no type arguments, but 1 given [type-arg] @@ -121,6 +123,7 @@ Line 81: Unexpected errors ['generics_syntax_infer_variance.py:81: error: Variab Line 85: Unexpected errors ['generics_syntax_infer_variance.py:85: error: "ShouldBeCovariant6" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_infer_variance.py:85: error: The type "type[ShouldBeCovariant6]" is not generic and not indexable [misc]'] Line 89: Unexpected errors ['generics_syntax_infer_variance.py:89: error: Free type variable expected in Generic[...] [misc]'] Line 90: Unexpected errors ['generics_syntax_infer_variance.py:90: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 94: Unexpected errors ['generics_syntax_infer_variance.py:94: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] Line 98: Unexpected errors ['generics_syntax_infer_variance.py:98: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] Line 106: Unexpected errors ['generics_syntax_infer_variance.py:106: error: Free type variable expected in Generic[...] [misc]'] Line 107: Unexpected errors ['generics_syntax_infer_variance.py:107: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] diff --git a/conformance/results/mypy/version.toml b/conformance/results/mypy/version.toml index 6f12777c4..33181f435 100644 --- a/conformance/results/mypy/version.toml +++ b/conformance/results/mypy/version.toml @@ -1,2 +1,2 @@ version = "mypy 1.13.0" -test_duration = 1.5 +test_duration = 2.6 diff --git a/conformance/results/pyre/version.toml b/conformance/results/pyre/version.toml index 48f19eaac..9b63b04fd 100644 --- a/conformance/results/pyre/version.toml +++ b/conformance/results/pyre/version.toml @@ -1,2 +1,2 @@ version = "pyre 0.9.22" -test_duration = 4.4 +test_duration = 6.5 diff --git a/conformance/results/pyright/version.toml b/conformance/results/pyright/version.toml index 49cfb8012..9430b168b 100644 --- a/conformance/results/pyright/version.toml +++ b/conformance/results/pyright/version.toml @@ -1,2 +1,2 @@ version = "pyright 1.1.386" -test_duration = 1.2 +test_duration = 1.9 diff --git a/conformance/results/pytype/specialtypes_never.toml b/conformance/results/pytype/specialtypes_never.toml index 7a2318585..be27a72ae 100644 --- a/conformance/results/pytype/specialtypes_never.toml +++ b/conformance/results/pytype/specialtypes_never.toml @@ -8,11 +8,10 @@ specialtypes_never.py:11:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] -Line 21: Unexpected errors ['specialtypes_never.py:21:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: bad return type [bad-return-type]'] +Line 21: Unexpected errors ['specialtypes_never.py:21:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: bad return type [bad-return-type]'] Line 68: Unexpected errors ['specialtypes_never.py:68:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func6: Type annotation for v1 does not match type of assignment [annotation-type-mismatch]'] Line 69: Unexpected errors ['specialtypes_never.py:69:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func6: Type annotation for v2 does not match type of assignment [annotation-type-mismatch]'] Line 70: Unexpected errors ['specialtypes_never.py:70:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func6: Type annotation for v3 does not match type of assignment [annotation-type-mismatch]'] diff --git a/conformance/results/pytype/version.toml b/conformance/results/pytype/version.toml index a314c2a01..47fa98ffe 100644 --- a/conformance/results/pytype/version.toml +++ b/conformance/results/pytype/version.toml @@ -1,2 +1,2 @@ version = "pytype 2024.10.11" -test_duration = 33.1 +test_duration = 50.2 diff --git a/conformance/results/results.html b/conformance/results/results.html index 3211c84f1..98e570341 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -159,16 +159,16 @@

    Python Type System Conformance Test Results

     
    mypy 1.12.0
    -
    1.7sec
    +
    mypy 1.13.0
    +
    1.5sec
    pyright 1.1.385
    +
    pyright 1.1.386
    1.2sec
    pyre 0.9.22
    -
    4.6sec
    +
    4.4sec
    pytype 2024.10.11
    33.1sec
    @@ -608,7 +608,7 @@

    Python Type System Conformance Test Results

         callables_kwargs Pass
    Partial

    Incorrectly handles assert_type for unpacked TypedDict.

    Pass
    Unsupported

    Does not understand Unpack in the context of **kwargs annotation.

    Unsupported

    Does not understand Unpack in the context of **kwargs annotation.

    - + @@ -1501,7 +1501,7 @@

    Python Type System Conformance Test Results

  • Doesn't support variance keyword arguments to ParamSpec.
  • - + @@ -1510,7 +1510,7 @@

    Python Type System Conformance Test Results

    - + @@ -2481,12 +2481,7 @@

    Python Type System Conformance Test Results

    - + @@ -2495,7 +2490,7 @@

    Python Type System Conformance Test Results

    - + @@ -2692,7 +2687,7 @@

    Python Type System Conformance Test Results

    - + diff --git a/conformance/results/ty/narrowing_typeis.toml b/conformance/results/ty/narrowing_typeis.toml index 936ee07ac..d4882af5b 100644 --- a/conformance/results/ty/narrowing_typeis.toml +++ b/conformance/results/ty/narrowing_typeis.toml @@ -1,13 +1,7 @@ -conformance_automated = "Fail" -conformant = "Partial" -notes = """ -Does not fully simplify the negative branch of `TypeIs` narrowing for a union of fixed-length tuple types. -""" +conformance_automated = "Pass" errors_diff = """ -Line 21: Unexpected errors ['narrowing_typeis.py:21:9: error[type-assertion-failure] Type `(tuple[str, str] & ~tuple[Unknown, Unknown]) | tuple[str, str, str]` does not match asserted type `tuple[str, str, str]`'] """ output = """ -narrowing_typeis.py:21:9: error[type-assertion-failure] Type `(tuple[str, str] & ~tuple[Unknown, Unknown]) | tuple[str, str, str]` does not match asserted type `tuple[str, str, str]` narrowing_typeis.py:110:23: error[invalid-type-guard-definition] `TypeIs` function must have a parameter to narrow narrowing_typeis.py:115:22: error[invalid-type-guard-definition] `TypeIs` function must have a parameter to narrow narrowing_typeis.py:137:20: error[invalid-argument-type] Argument to function `takes_callable_str` is incorrect: Expected `(object, /) -> str`, found `def simple_typeguard(val: object) -> TypeIs[int]` diff --git a/conformance/results/ty/protocols_variance.toml b/conformance/results/ty/protocols_variance.toml index 7e595c1a9..fb6d606cd 100644 --- a/conformance/results/ty/protocols_variance.toml +++ b/conformance/results/ty/protocols_variance.toml @@ -1,13 +1,12 @@ -conformance_automated = "Fail" -conformant = "Unsupported" +conformance_automated = "Pass" errors_diff = """ -Line 22: Expected 1 errors -Line 41: Expected 1 errors -Line 57: Expected 1 errors -Line 67: Expected 1 errors -Line 105: Expected 1 errors -Lines 62, 63: Expected error (tag 'covariant_in_input') -Lines 72, 73: Expected error (tag 'contravariant_in_output') """ output = """ +protocols_variance.py:22:7: error[invalid-protocol] Type variable `T1` in protocol `AnotherBox` should be covariant, but is invariant +protocols_variance.py:41:7: error[invalid-protocol] Type variable `T3` in protocol `Protocol2` should be contravariant, but is invariant +protocols_variance.py:57:7: error[invalid-protocol] Type variable `T1` in protocol `Protocol4` should be contravariant, but is invariant +protocols_variance.py:62:7: error[invalid-protocol] Type variable `T1_co` in protocol `Protocol5` should be contravariant, but is covariant +protocols_variance.py:67:7: error[invalid-protocol] Type variable `T1` in protocol `Protocol6` should be covariant, but is invariant +protocols_variance.py:72:7: error[invalid-protocol] Type variable `T1_contra` in protocol `Protocol7` should be covariant, but is contravariant +protocols_variance.py:105:7: error[invalid-protocol] Type variable `T1` in protocol `Protocol12` should be covariant, but is invariant """ diff --git a/conformance/results/ty/version.toml b/conformance/results/ty/version.toml index 56a7045d9..7d9601eff 100644 --- a/conformance/results/ty/version.toml +++ b/conformance/results/ty/version.toml @@ -1 +1 @@ -version = "ty 0.0.74" +version = "ty 0.0.75" diff --git a/conformance/uv.lock b/conformance/uv.lock index 2b3c979e4..f638ac45a 100644 --- a/conformance/uv.lock +++ b/conformance/uv.lock @@ -202,27 +202,27 @@ wheels = [ [[package]] name = "ty" -version = "0.0.74" +version = "0.0.75" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/88/0f/c767853e88567a2ec7e996dd95e3105b1bc62c95d103689311ef0f4a603c/ty-0.0.74.tar.gz", hash = "sha256:da14344fc8625fc9ff359bafb856ad575636ea86d9bb6a629b146bff27b380e6", size = 6786318, upload-time = "2026-08-22T15:05:54.054Z" } +sdist = { url = "https://files.pythonhosted.org/packages/81/d0/d0c96f898d6974a4a3569ab3efdf9512c04ad99f9203effb55f72497fe97/ty-0.0.75.tar.gz", hash = "sha256:4c5eead33dfbf6e2ebb4f400f74b51ffc9bab702a6f23ddb648a1cbb740387e3", size = 6868326, upload-time = "2026-08-26T20:23:40.399Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/2c/95/6ded58bc97885c6d88fa1f9cd815031489200738f961cbf0466663213f80/ty-0.0.74-py3-none-linux_armv6l.whl", hash = "sha256:8969ef4e508debf00cf58f9ea85a539f799b1732c59cdfcecd037630b9755b30", size = 12790043, upload-time = "2026-08-22T15:05:05.015Z" }, - { url = "https://files.pythonhosted.org/packages/d9/8a/5e323603b6ab8731144421877ee8a0f8ac5a5511e67857127caa09f6730e/ty-0.0.74-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:51fb6cf5b98e1e1140825b2430943f78d744876a735231656eafbb4c3f7eca3c", size = 12371748, upload-time = "2026-08-22T15:05:08.609Z" }, - { url = "https://files.pythonhosted.org/packages/d0/44/ee72e08cb705281e8d8c42917dd577aa598a8a098008495fda5176ee3f6e/ty-0.0.74-py3-none-macosx_11_0_arm64.whl", hash = "sha256:8ebe60b1f0a948c793d6c77fc9e9ddda599e4f023c04ab16e8e03bcb428c3fa0", size = 12282403, upload-time = "2026-08-22T15:05:11.448Z" }, - { url = "https://files.pythonhosted.org/packages/da/b3/fd935b694ff68bc278af50f7ad04770b36ce6306399baef7e1847b553a9d/ty-0.0.74-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:aa97f407a695c890a53615966a663c7d2167e2cabe88db7ca1a24d62635cdfc8", size = 12345164, upload-time = "2026-08-22T15:05:14.19Z" }, - { url = "https://files.pythonhosted.org/packages/54/5c/5b5825268e029ebb164c909780103dbbae367f069801410068bf1cef29b3/ty-0.0.74-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:673ddb733d4a0db31385ba1ed9ff1f6bd9dc5565413ce57b1ca5ac4c7803da5d", size = 12556646, upload-time = "2026-08-22T15:05:16.994Z" }, - { url = "https://files.pythonhosted.org/packages/56/e7/515914e571d62ce0101744fed3f881936eeb1b30dc37beb72b4f7ca1e289/ty-0.0.74-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1028e7c6b4f6145e9704552f43a5fffdcd51b42263ffdcd9c9677762bc395a4a", size = 13311653, upload-time = "2026-08-22T15:05:20.254Z" }, - { url = "https://files.pythonhosted.org/packages/b0/07/d1452babb6f9266c2122cabc095180b70ed306fb770b2996753814d2237d/ty-0.0.74-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:79841a8890493021fb308772474983316eb91f7b56cb227a6a05a06b262a36f0", size = 13768284, upload-time = "2026-08-22T15:05:23.197Z" }, - { url = "https://files.pythonhosted.org/packages/b1/60/8d4a2fc7842a47210a1cb0a16a187d9de39ad5d509a00fb74c1c073afcde/ty-0.0.74-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:94859d321f3c6a6c8f7bfc3f40e8319cda7e6e012e613440f3dfd145d5010e2e", size = 13422306, upload-time = "2026-08-22T15:05:26.248Z" }, - { url = "https://files.pythonhosted.org/packages/de/76/ebbc269a8c4efcc4d44624993bd188145f20d60ebda9680b15aaec42cc50/ty-0.0.74-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:970a8b2c09ff3be04c8a1c6767332d861be4fce85efe7bb205e4ade7c8655274", size = 12970637, upload-time = "2026-08-22T15:05:29.15Z" }, - { url = "https://files.pythonhosted.org/packages/9e/dd/b99f7236acbf856780ca1779a48143d2d9f2c24d7f531a0ce15a022b8a87/ty-0.0.74-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:795f763b3ded85574c2c2846a6fb8acf2aa76e9e83d761143e92b1f0c7ffa2cd", size = 13344891, upload-time = "2026-08-22T15:05:32.033Z" }, - { url = "https://files.pythonhosted.org/packages/0b/d7/9ff7449a4c7e6428f2c6f298e74cf24b70668f29d45c249507a723ff3782/ty-0.0.74-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:dc086db5367d912c31c0cc872deb7387290e779a4b9b54fcb944673a7cd52c7b", size = 12395272, upload-time = "2026-08-22T15:05:34.702Z" }, - { url = "https://files.pythonhosted.org/packages/b1/dd/b23a5b6b35d37df89dc8dc5daa09efd9245a668b50c4c81c25de21567dc1/ty-0.0.74-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:0314d7b391cf684e47c2fa093d2ce4c597cfc9b01d9a315fe204aed6359b271b", size = 12573079, upload-time = "2026-08-22T15:05:37.683Z" }, - { url = "https://files.pythonhosted.org/packages/23/c5/ccba16239d6129533c8b3603458d0f4dd2ba69478e47059073968e74261d/ty-0.0.74-py3-none-musllinux_1_2_i686.whl", hash = "sha256:c4a45dd2e991e8bdae82ba78c8cd051b253f60bc71a6536598fa3ef580b4fc9b", size = 12832506, upload-time = "2026-08-22T15:05:40.505Z" }, - { url = "https://files.pythonhosted.org/packages/6d/1c/2390912634dff4f341f97b397f2aee341ff062be0a66cda37d59375454f2/ty-0.0.74-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:210e2eac6b018fb934e2b8dac3956a0ba076a3fb1fa6f135058c825e5b759b81", size = 13154752, upload-time = "2026-08-22T15:05:43.355Z" }, - { url = "https://files.pythonhosted.org/packages/c4/33/a8c12188227e6f74f91853a7374e01ed81d6ad21c16c8b70e92dbebfe46a/ty-0.0.74-py3-none-win32.whl", hash = "sha256:db0bb6a8f098ef9bd1be861f73b4f7c0320d40d4c05c7ae0a8677d4e7aa4f6e5", size = 12130002, upload-time = "2026-08-22T15:05:46.058Z" }, - { url = "https://files.pythonhosted.org/packages/21/5c/064f28ccb9c234cfce5a2f7aa69a256663d5ae5bb0290b3a9706cc4d1e4c/ty-0.0.74-py3-none-win_amd64.whl", hash = "sha256:bebff181515255b3c78bd2e7693ae66fab6064ad4feea2065c68bc01022aa678", size = 12771435, upload-time = "2026-08-22T15:05:48.811Z" }, - { url = "https://files.pythonhosted.org/packages/fe/06/d6becdaca0315346c26b6df97cb0eafa81de4f870945d6989e88704374ed/ty-0.0.74-py3-none-win_arm64.whl", hash = "sha256:1a3469eaaf8c85b1c0a15bede25d36daea4b09fce1d913e965b24e24b3f1d6c6", size = 12558299, upload-time = "2026-08-22T15:05:51.543Z" }, + { url = "https://files.pythonhosted.org/packages/cb/6c/b12d03505f17581f0cfa3c12273fe34c1d67b36dfda1bc561a6bdc16512b/ty-0.0.75-py3-none-linux_armv6l.whl", hash = "sha256:e5409f50db2246fd4bd039d93d261e0cfa1daa554a4fb77256f91072c570349a", size = 12972606, upload-time = "2026-08-26T20:22:59.716Z" }, + { url = "https://files.pythonhosted.org/packages/d1/aa/30f11eecd9215a9f87e8fe8baaf48f3ce905f5d75b8e4aac70f0091f130c/ty-0.0.75-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:5e7b8b3472fb9bb2eeab314984b265df08a7a9d518867a9e6020eebc06570be2", size = 12527158, upload-time = "2026-08-26T20:23:02.767Z" }, + { url = "https://files.pythonhosted.org/packages/f2/11/7fd7001b0b5c6610bfbad7357e47d5fe6f82d4e84e94c53776a478f5e9f8/ty-0.0.75-py3-none-macosx_11_0_arm64.whl", hash = "sha256:c6ccf34169821fe0d23e3360deeef981d217963412f1d087b9bdd32ec57f7a57", size = 12400533, upload-time = "2026-08-26T20:23:04.965Z" }, + { url = "https://files.pythonhosted.org/packages/fd/7f/1e284ea3d348d7be02f12d83bc22ed9ef193033f863f05b64db99027f141/ty-0.0.75-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:842ebb41e9c6c334b40768704e20b1a69d5c6b08805b289d5e0e2565f49f2de1", size = 12420592, upload-time = "2026-08-26T20:23:07.427Z" }, + { url = "https://files.pythonhosted.org/packages/2d/ab/d813271543370c47fd74b5118f2066ab32b0983e907b1821f3f9a6d0fa7f/ty-0.0.75-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:cf7a5a723c5f1e0fab4ffbfe9bd95123a526ed48f206e5f25cb2161ca294007a", size = 12739219, upload-time = "2026-08-26T20:23:09.809Z" }, + { url = "https://files.pythonhosted.org/packages/31/5b/95b49cc5570fd92a7bf63732f649b31906158721e03c7fcb1b5be74ee3bf/ty-0.0.75-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:54382f98e5da292fcd7104391afef5105c35bb2f312e29bea6f5fa419935255c", size = 13494046, upload-time = "2026-08-26T20:23:12.191Z" }, + { url = "https://files.pythonhosted.org/packages/2c/0d/502d2dd68173cf020e1ad2bdbab9544c86776de0b0e2ed15f8c2fe006e3d/ty-0.0.75-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ac13b180dc2aade2cd243f56b01650e78bf091a2e522ad3bc947245d7837c613", size = 13938899, upload-time = "2026-08-26T20:23:14.764Z" }, + { url = "https://files.pythonhosted.org/packages/20/5b/f3b12a25c07224456219fc2bd20db0ad7e40b304be0ff6aad728da0135f9/ty-0.0.75-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:752df7951a443219d7f1ff817e3723c85d428565ff449e08a7a93ba821661526", size = 13656711, upload-time = "2026-08-26T20:23:17.145Z" }, + { url = "https://files.pythonhosted.org/packages/51/7b/f090ad306e2b15a07b332d647138c5264b89d9758855ecce8b8a10bcb153/ty-0.0.75-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1fd399feedf7cee816563c1baec45fc1c0b3c89f1ea42364920b688004b5b7da", size = 13093499, upload-time = "2026-08-26T20:23:19.489Z" }, + { url = "https://files.pythonhosted.org/packages/f1/4b/f69b99aaaca0c7c65d5f114b186b26b21666f767b0c69eec99a2bdccc061/ty-0.0.75-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:d7625f6f56c7dc1e873579fdc9e432a0e21e302afe847ab60704d2303442a92e", size = 13520580, upload-time = "2026-08-26T20:23:21.789Z" }, + { url = "https://files.pythonhosted.org/packages/b6/e7/692c5f905c0345a15d2255fc74066d660f030254ae8dcdaf33f5a5c2f279/ty-0.0.75-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:89e7d527e95a2534b70cae29e94c104b84082760ea05927d23bb87280969c104", size = 12524095, upload-time = "2026-08-26T20:23:24.026Z" }, + { url = "https://files.pythonhosted.org/packages/ba/9a/f42b12cf265ea95344bf554764c4791cfb273bdd628aadd7c209af7cadc3/ty-0.0.75-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:0843f134440740706e01bee5f88f4cfc10e9b018bddb9e4ef4c12dc9fc0c9aef", size = 12756591, upload-time = "2026-08-26T20:23:26.126Z" }, + { url = "https://files.pythonhosted.org/packages/7c/5e/9b180c133cb9cce48179a7d2bf9e1802d992aa8176a918e0e05205760b42/ty-0.0.75-py3-none-musllinux_1_2_i686.whl", hash = "sha256:1bd0ec0e50ee1376875c88891efe6f549c3560fa5b2ddad79a425cd5a6218b9c", size = 12998754, upload-time = "2026-08-26T20:23:28.353Z" }, + { url = "https://files.pythonhosted.org/packages/39/f6/3c6ef5dd550103e29905121c67fb96a374564f31a2f44c6faa1af98c2d61/ty-0.0.75-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:1f9eafd561f90110d5e29f589ec3e956c4686e2f6631348d99276436f5cbe4d1", size = 13316474, upload-time = "2026-08-26T20:23:30.857Z" }, + { url = "https://files.pythonhosted.org/packages/bb/52/12776337874c821076bd5368e352ccd9e67174790abe3b856f749cb3524b/ty-0.0.75-py3-none-win32.whl", hash = "sha256:05063a6fafe2154b794a7f964515d148e51acd186d72d4a3acd347ee9fa19336", size = 12316315, upload-time = "2026-08-26T20:23:33.528Z" }, + { url = "https://files.pythonhosted.org/packages/53/e6/bb51e16af5c7138c9f52f8f3d0a401a371c6798d092e3b74926f186a9814/ty-0.0.75-py3-none-win_amd64.whl", hash = "sha256:81cf1ba5f6b7536ad56747865214255d9bc8e80533a689dbb9ddeaad464b09f1", size = 12917267, upload-time = "2026-08-26T20:23:35.978Z" }, + { url = "https://files.pythonhosted.org/packages/39/73/4542f829107468b5de4231af67f29927c093bfad11f3c1e5b2c08fb1206b/ty-0.0.75-py3-none-win_arm64.whl", hash = "sha256:541c9af5b7a0ad23d15ec315a7da81150833c359f48124ed3789ff25eacd6f42", size = 12711024, upload-time = "2026-08-26T20:23:38.159Z" }, ] [[package]] From cf943ccbea5596ef969eec6e2260097ff697b7ba Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Thu, 27 Aug 2026 11:25:13 -0700 Subject: [PATCH 287/308] Update pycroscope to 0.5.0 and refresh conformance results (#2349) --- .../results/pycroscope/aliases_implicit.toml | 4 - .../pycroscope/aliases_type_statement.toml | 3 + .../pycroscope/aliases_typealiastype.toml | 8 +- .../pycroscope/callables_annotation.toml | 13 +- .../pycroscope/callables_protocol.toml | 9 +- .../pycroscope/callables_subtyping.toml | 11 +- .../results/pycroscope/classes_classvar.toml | 8 +- .../results/pycroscope/classes_override.toml | 11 +- .../pycroscope/directives_disjoint_base.toml | 22 ++- .../results/pycroscope/enums_definition.toml | 8 +- .../results/pycroscope/generics_defaults.toml | 43 +----- .../generics_defaults_referential.toml | 20 +-- .../generics_mixed_variance_inference.toml | 20 +-- .../generics_paramspec_semantics.toml | 6 +- .../generics_paramspec_variance.toml | 68 +++------ .../generics_syntax_infer_variance.toml | 4 +- .../pycroscope/generics_syntax_scoping.toml | 23 +-- .../generics_typevartuple_basic.toml | 8 +- .../generics_typevartuple_variance.toml | 47 ++---- .../pycroscope/namedtuples_define_class.toml | 10 +- .../pycroscope/protocols_definition.toml | 8 +- .../results/pycroscope/protocols_generic.toml | 3 +- .../typeddicts_type_consistency.toml | 12 +- conformance/results/pycroscope/version.toml | 2 +- conformance/results/results.html | 136 ++++-------------- conformance/uv.lock | 6 +- 26 files changed, 129 insertions(+), 384 deletions(-) diff --git a/conformance/results/pycroscope/aliases_implicit.toml b/conformance/results/pycroscope/aliases_implicit.toml index 51e2e303d..9bdc116fc 100644 --- a/conformance/results/pycroscope/aliases_implicit.toml +++ b/conformance/results/pycroscope/aliases_implicit.toml @@ -13,16 +13,12 @@ Line 113: Expected 1 errors Line 117: Expected 1 errors Line 118: Expected 1 errors Line 119: Expected 1 errors -Line 68: Unexpected errors ['./aliases_implicit.py:68:16: .GoodTypeAlias9[, None] = (int, /, ****P) -> ~R is not equivalent to (int, str, str, /) -> None'] Line 70: Unexpected errors ['./aliases_implicit.py:70:16: Any[from_another] is not equivalent to int | str | list[list[int]] | None'] -Line 72: Unexpected errors ['./aliases_implicit.py:72:16: .GoodTypeAlias13 = (**__P: **P) -> None is not equivalent to (...) -> None'] Line 95: Unexpected errors ["./aliases_implicit.py:95:16: Cannot resolve subscripted annotation: [invalid_annotation]"] Line 100: Unexpected errors ["./aliases_implicit.py:100:17: Annotated[type 'list', (<+list is_truthy None> == NullConstraint())] is always True because it does not provide __bool__ [type_always_true]"] """ output = """ -./aliases_implicit.py:68:16: .GoodTypeAlias9[, None] = (int, /, ****P) -> ~R is not equivalent to (int, str, str, /) -> None ./aliases_implicit.py:70:16: Any[from_another] is not equivalent to int | str | list[list[int]] | None -./aliases_implicit.py:72:16: .GoodTypeAlias13 = (**__P: **P) -> None is not equivalent to (...) -> None ./aliases_implicit.py:77:8: Unrecognized annotation types.GenericAlias [invalid_annotation] ./aliases_implicit.py:78:8: Expected 1 type arguments for type alias, got 2 [invalid_specialization] ./aliases_implicit.py:79:8: Expected 1 type arguments for type alias, got 2 [invalid_specialization] diff --git a/conformance/results/pycroscope/aliases_type_statement.toml b/conformance/results/pycroscope/aliases_type_statement.toml index 9961849bc..d22c1deb9 100644 --- a/conformance/results/pycroscope/aliases_type_statement.toml +++ b/conformance/results/pycroscope/aliases_type_statement.toml @@ -1,6 +1,7 @@ conformant = "Partial" notes = """ Fails to reject various weird annotations. +Rejects a valid recursive generic type alias. """ conformance_automated = "Fail" errors_diff = """ @@ -16,6 +17,7 @@ Line 45: Expected 1 errors Line 46: Expected 1 errors Line 47: Expected 1 errors Line 49: Expected 1 errors +Line 61: Unexpected errors ['./aliases_type_statement.py:61:0: Unrecognized annotation typing._SpecialForm [invalid_annotation]'] """ output = """ ./aliases_type_statement.py:17:0: typing.TypeAliasType has no attribute 'bit_count' [undefined_attribute] @@ -26,6 +28,7 @@ output = """ ./aliases_type_statement.py:48:22: Annotated[type 'list', (<+list is_truthy None> == NullConstraint())] is always True because it does not provide __bool__ [type_always_true] ./aliases_type_statement.py:53:22: Type alias cannot combine old-style TypeVar declarations with type statement parameters [invalid_type_alias] ./aliases_type_statement.py:58:16: Type alias must declare type parameters in the type statement [invalid_type_alias] +./aliases_type_statement.py:61:0: Unrecognized annotation typing._SpecialForm [invalid_annotation] ./aliases_type_statement.py:68:6: Type argument str is not compatible with ~S@./aliases_type_statement.py.RecursiveTypeAlias2 [invalid_specialization] ./aliases_type_statement.py:70:6: Type argument int is not compatible with ~T@./aliases_type_statement.py.RecursiveTypeAlias2 [invalid_specialization] ./aliases_type_statement.py:73:0: Type alias RecursiveTypeAlias3 has a circular definition [invalid_type_alias] diff --git a/conformance/results/pycroscope/aliases_typealiastype.toml b/conformance/results/pycroscope/aliases_typealiastype.toml index 09556fcfd..9aae0a048 100644 --- a/conformance/results/pycroscope/aliases_typealiastype.toml +++ b/conformance/results/pycroscope/aliases_typealiastype.toml @@ -1,14 +1,8 @@ -conformant = "Partial" -notes = """ -Rejects valid `ParamSpec` specialization. -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 39: Unexpected errors ["./aliases_typealiastype.py:39:4: Unrecognized annotation [invalid_annotation]"] """ output = """ ./aliases_typealiastype.py:32:6: typing.TypeAliasType has no attribute 'other_attrib' [undefined_attribute] -./aliases_typealiastype.py:39:4: Unrecognized annotation [invalid_annotation] ./aliases_typealiastype.py:40:4: Type argument int is not compatible with ~TStr@./aliases_typealiastype.py.GoodAlias5 [invalid_specialization] ./aliases_typealiastype.py:43:44: Type alias cannot combine old-style TypeVar declarations with type statement parameters [invalid_type_alias] ./aliases_typealiastype.py:44:44: Type alias must declare type parameters in the type statement [invalid_type_alias] diff --git a/conformance/results/pycroscope/callables_annotation.toml b/conformance/results/pycroscope/callables_annotation.toml index 4eac45be1..d74b67611 100644 --- a/conformance/results/pycroscope/callables_annotation.toml +++ b/conformance/results/pycroscope/callables_annotation.toml @@ -1,10 +1,5 @@ -conformant = "Partial" -notes = """ -Does not support callback protocols with PEP 695 ParamSpec type parameters. -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 115: Unexpected errors ['./callables_annotation.py:115:38: Traceback (most recent call last):', './callables_annotation.py:115:4: Traceback (most recent call last):'] """ output = """ ./callables_annotation.py:25:4: Missing required positional argument at position 1 [incompatible_call] @@ -19,10 +14,8 @@ output = """ ./callables_annotation.py:59:4: Ellipsis must be used directly in Callable[..., T], not in Callable[[...], T] [invalid_annotation] ./callables_annotation.py:91:0: Incompatible assignment: expected (int, /, **Any[explicit]) -> str, got () -> str [incompatible_assignment] ./callables_annotation.py:93:0: Incompatible assignment: expected (int, /, **Any[explicit]) -> str, got (*, a: int) -> str [incompatible_assignment] -./callables_annotation.py:115:38: Traceback (most recent call last): -./callables_annotation.py:115:4: Traceback (most recent call last): ./callables_annotation.py:159:4: Incompatible assignment: expected ./callables_annotation.py.Proto5[Any[explicit]], got ./callables_annotation.py.Proto8 [incompatible_assignment] -./callables_annotation.py:172:4: Incompatible assignment: expected .Callback2[Any[ellipsis_callable]] = (int, /, ****P) -> str, got () -> str [incompatible_assignment] +./callables_annotation.py:172:4: Incompatible assignment: expected .Callback2[AnySig()] = (int, /, ****P) -> str, got () -> str [incompatible_assignment] ./callables_annotation.py:187:4: Incompatible assignment: expected (str, /, **Any[explicit]) -> str, got (int, str, /) -> str [incompatible_assignment] -./callables_annotation.py:189:4: Incompatible assignment: expected .CallbackWithStr[Any[ellipsis_callable]] = (str, /, ****P) -> str, got (int, str, /) -> str [incompatible_assignment] +./callables_annotation.py:189:4: Incompatible assignment: expected .CallbackWithStr[AnySig()] = (str, /, ****P) -> str, got (int, str, /) -> str [incompatible_assignment] """ diff --git a/conformance/results/pycroscope/callables_protocol.toml b/conformance/results/pycroscope/callables_protocol.toml index 8bc4c7dff..658e045ad 100644 --- a/conformance/results/pycroscope/callables_protocol.toml +++ b/conformance/results/pycroscope/callables_protocol.toml @@ -1,10 +1,5 @@ -conformant = "Partial" -notes = """ -Does not support callback protocols with PEP 695 ParamSpec type parameters. -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 179: Unexpected errors ['./callables_protocol.py:179:30: Traceback (most recent call last):', './callables_protocol.py:179:4: Traceback (most recent call last):'] """ output = """ ./callables_protocol.py:35:0: Incompatible assignment: expected ./callables_protocol.py.Proto1, got (*vals: tuple[bytes, ...], max_items: int | None) -> list[bytes] [incompatible_assignment] @@ -17,8 +12,6 @@ output = """ ./callables_protocol.py:97:0: Incompatible assignment: expected ./callables_protocol.py.Proto4, got (x: int) -> None [incompatible_assignment] ./callables_protocol.py:121:0: Incompatible assignment: expected ./callables_protocol.py.NotProto6, got (*vals: tuple[bytes, ...], max_len: int | None = None) -> list[bytes] [incompatible_assignment] ./callables_protocol.py:169:0: Incompatible assignment: expected ./callables_protocol.py.Proto8, got (x: int) -> Any[explicit] [incompatible_assignment] -./callables_protocol.py:179:30: Traceback (most recent call last): -./callables_protocol.py:179:4: Traceback (most recent call last): ./callables_protocol.py:186:4: Incompatible types in assignment to attribute 'other_attribute': expected int, got Literal['str'] [incompatible_assignment] ./callables_protocol.py:187:4: ./callables_protocol.py.Proto9[**P@./callables_protocol.py.decorator1..decorator1, +R@./callables_protocol.py.decorator1..decorator1] has no attribute 'xxx' [undefined_attribute] ./callables_protocol.py:197:6: ./callables_protocol.py.Proto9[(x: int) -> Any[unannotated], str] has no attribute 'other_attribute2' [undefined_attribute] diff --git a/conformance/results/pycroscope/callables_subtyping.toml b/conformance/results/pycroscope/callables_subtyping.toml index ad3adb9b2..548cae50e 100644 --- a/conformance/results/pycroscope/callables_subtyping.toml +++ b/conformance/results/pycroscope/callables_subtyping.toml @@ -1,11 +1,5 @@ -conformant = "Partial" -notes = """ -Does not support callback protocols with PEP 695 ParamSpec type parameters. -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 205: Unexpected errors ['./callables_subtyping.py:205:30: Traceback (most recent call last):', './callables_subtyping.py:205:4: Traceback (most recent call last):'] -Line 214: Unexpected errors ['./callables_subtyping.py:214:4: Incompatible assignment: expected callables_subtyping.ProtocolWithP[**P@callables_subtyping.func7..func7], got callables_subtyping.TypeAliasWithP[**P@callables_subtyping.func7..func7] = (**__P: **P) -> None [incompatible_assignment]'] """ output = """ ./callables_subtyping.py:26:4: Incompatible assignment: expected (float | int, /) -> float | int, got (int, /) -> int [incompatible_assignment] @@ -34,9 +28,6 @@ output = """ ./callables_subtyping.py:195:4: Incompatible assignment: expected callables_subtyping.IntKwargs6, got callables_subtyping.StrKwargs6 [incompatible_assignment] ./callables_subtyping.py:196:4: Incompatible assignment: expected callables_subtyping.Standard6, got callables_subtyping.IntStrKwargs6 [incompatible_assignment] ./callables_subtyping.py:197:4: Incompatible assignment: expected callables_subtyping.Standard6, got callables_subtyping.StrKwargs6 [incompatible_assignment] -./callables_subtyping.py:205:30: Traceback (most recent call last): -./callables_subtyping.py:205:4: Traceback (most recent call last): -./callables_subtyping.py:214:4: Incompatible assignment: expected callables_subtyping.ProtocolWithP[**P@callables_subtyping.func7..func7], got callables_subtyping.TypeAliasWithP[**P@callables_subtyping.func7..func7] = (**__P: **P) -> None [incompatible_assignment] ./callables_subtyping.py:236:4: Incompatible assignment: expected callables_subtyping.DefaultArg8, got callables_subtyping.NoDefaultArg8 [incompatible_assignment] ./callables_subtyping.py:237:4: Incompatible assignment: expected callables_subtyping.DefaultArg8, got callables_subtyping.NoX8 [incompatible_assignment] ./callables_subtyping.py:240:4: Incompatible assignment: expected callables_subtyping.NoDefaultArg8, got callables_subtyping.NoX8 [incompatible_assignment] diff --git a/conformance/results/pycroscope/classes_classvar.toml b/conformance/results/pycroscope/classes_classvar.toml index 23479ff47..4d3f0e1dd 100644 --- a/conformance/results/pycroscope/classes_classvar.toml +++ b/conformance/results/pycroscope/classes_classvar.toml @@ -1,10 +1,5 @@ -conformant = "Partial" -notes = """ -Does not reject use of `ClassVar` as a qualifier for a NamedTuple field. -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 94: Expected 1 errors """ output = """ ./classes_classvar.py:40:10: Invalid type annotation (, ) [invalid_annotation] @@ -23,6 +18,7 @@ output = """ ./classes_classvar.py:79:7: ClassVar can only be used for assignments in class body [invalid_qualifier] ./classes_classvar.py:80:19: ClassVar cannot be used in type aliases [invalid_qualifier] ./classes_classvar.py:89:7: Unexpected ClassVar annotation [invalid_qualifier] +./classes_classvar.py:94:7: ClassVar cannot be used for NamedTuple fields [invalid_qualifier] ./classes_classvar.py:127:0: Cannot assign to class variable 'stats' via instance [incompatible_assignment] ./classes_classvar.py:156:0: Incompatible assignment: expected ./classes_classvar.py.ProtoA, got ./classes_classvar.py.ProtoAImpl [incompatible_assignment] """ diff --git a/conformance/results/pycroscope/classes_override.toml b/conformance/results/pycroscope/classes_override.toml index b5c0ee4fe..b140ec840 100644 --- a/conformance/results/pycroscope/classes_override.toml +++ b/conformance/results/pycroscope/classes_override.toml @@ -1,12 +1,5 @@ -conformant = "Partial" -notes = """ -Does not honor `@override` compatibility checks for `__init__` and `__new__`: -the incompatible constructor overrides in `ChildC2` are not flagged. -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Lines 134, 135: Expected error (tag 'init') -Lines 137, 138: Expected error (tag 'new') """ output = """ ./classes_override.py:53:4: Method does not override any base method [override_does_not_override] @@ -14,4 +7,6 @@ output = """ ./classes_override.py:79:4: Method does not override any base method [override_does_not_override] ./classes_override.py:84:4: Method does not override any base method [override_does_not_override] ./classes_override.py:89:4: Method does not override any base method [override_does_not_override] +./classes_override.py:135:4: Value of __init__ incompatible with base class classes_override.ParentC [incompatible_override] +./classes_override.py:138:4: Value of __new__ incompatible with base class classes_override.ParentC [incompatible_override] """ diff --git a/conformance/results/pycroscope/directives_disjoint_base.toml b/conformance/results/pycroscope/directives_disjoint_base.toml index 96a30b849..f58404656 100644 --- a/conformance/results/pycroscope/directives_disjoint_base.toml +++ b/conformance/results/pycroscope/directives_disjoint_base.toml @@ -1,17 +1,13 @@ -conformant = "Partial" -notes = """ -Does not reject invalid class definitions due to disjoint bases, but uses disjoint base information in type narrowing. -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 69: Expected 1 errors -Line 73: Expected 1 errors -Line 77: Expected 1 errors -Line 81: Expected 1 errors -Line 105: Expected 1 errors -Line 118: Expected 1 errors -Line 123: Expected 1 errors """ output = """ -./directives_disjoint_base.py:113:1: Incompatible argument type for cls: expected ~_TC but got () -> None [incompatible_argument] +./directives_disjoint_base.py:69:0: Class has incompatible disjoint bases [invalid_base] +./directives_disjoint_base.py:73:0: Class has incompatible disjoint bases [invalid_base] +./directives_disjoint_base.py:77:0: Class has incompatible disjoint bases [invalid_base] +./directives_disjoint_base.py:81:0: Class has incompatible disjoint bases [invalid_base] +./directives_disjoint_base.py:105:0: Class has incompatible disjoint bases [invalid_base] +./directives_disjoint_base.py:113:1: disjoint_base cannot be applied to a function [invalid_disjoint_base] +./directives_disjoint_base.py:118:1: disjoint_base cannot be applied to a TypedDict [invalid_disjoint_base] +./directives_disjoint_base.py:123:1: disjoint_base cannot be applied to a Protocol [invalid_disjoint_base] """ diff --git a/conformance/results/pycroscope/enums_definition.toml b/conformance/results/pycroscope/enums_definition.toml index 896d77db6..622573cae 100644 --- a/conformance/results/pycroscope/enums_definition.toml +++ b/conformance/results/pycroscope/enums_definition.toml @@ -1,10 +1,5 @@ -conformant = "Partial" -notes = """ -Does not allow enum members to be conditional on version/platform checks. -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 91: Unexpected errors ['./enums_definition.py:91:12: ./enums_definition.py.Color12 is not equivalent to Any[unannotated]'] """ output = """ ./enums_definition.py:34:12: enum.Enum has no attribute 'RED' [undefined_attribute] @@ -23,6 +18,5 @@ output = """ ./enums_definition.py:40:32: type[enum.Enum] has no attribute 'RED' [undefined_attribute] ./enums_definition.py:41:12: type[enum.Enum] has no attribute 'RED' [undefined_attribute] ./enums_definition.py:41:32: type[enum.Enum] has no attribute 'RED' [undefined_attribute] -./enums_definition.py:91:12: ./enums_definition.py.Color12 is not equivalent to Any[unannotated] ./enums_definition.py:92:0: has no attribute 'BLUE' [undefined_attribute] """ diff --git a/conformance/results/pycroscope/generics_defaults.toml b/conformance/results/pycroscope/generics_defaults.toml index 3e3cc4f3a..70c20747d 100644 --- a/conformance/results/pycroscope/generics_defaults.toml +++ b/conformance/results/pycroscope/generics_defaults.toml @@ -1,44 +1,11 @@ -conformant = "Partial" -notes = """ -Numerous issues; does not support `TypeVarTuple` and `ParamSpec` defaults. -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 33: Unexpected errors ['./generics_defaults.py:33:16: ~DefaultStrT@./generics_defaults.py.NoNonDefaults is not equivalent to str'] -Line 34: Unexpected errors ['./generics_defaults.py:34:16: ~DefaultIntT@./generics_defaults.py.NoNonDefaults is not equivalent to int'] -Line 73: Unexpected errors ['./generics_defaults.py:73:16: ~T1@./generics_defaults.py.AllTheDefaults is not equivalent to Any[explicit]'] -Line 74: Unexpected errors ['./generics_defaults.py:74:16: ~T2@./generics_defaults.py.AllTheDefaults is not equivalent to Any[explicit]'] -Line 75: Unexpected errors ['./generics_defaults.py:75:16: ~DefaultStrT@./generics_defaults.py.NoNonDefaults is not equivalent to str'] -Line 76: Unexpected errors ['./generics_defaults.py:76:16: ~DefaultIntT@./generics_defaults.py.NoNonDefaults is not equivalent to int'] -Line 77: Unexpected errors ['./generics_defaults.py:77:16: ~DefaultBoolT@./generics_defaults.py.AllTheDefaults is not equivalent to bool'] -Line 122: Unexpected errors ['./generics_defaults.py:122:16: (**__P: **DefaultP@./generics_defaults.py.Class_ParamSpec) -> None is not equivalent to (str, int, /) -> None'] -Line 124: Unexpected errors ['./generics_defaults.py:124:16: ./generics_defaults.py.Class_ParamSpec[AnySig()] is not equivalent to ./generics_defaults.py.Class_ParamSpec[tuple[bool, bool]]'] -Line 144: Unexpected errors ['./generics_defaults.py:144:60: Incompatible argument type for default: expected TypeForm[object] but got Literal[typing.Unpack[DefaultTs]] [incompatible_argument]'] -Line 203: Unexpected errors ["./generics_defaults.py:203:36: Invalid type annotation [] [invalid_annotation]", './generics_defaults.py:203:17: ParamSpec specialization must use list form, Concatenate[..., P], P, or ... [invalid_annotation]'] -Line 204: Unexpected errors ['./generics_defaults.py:204:16: tuple[int] is not equivalent to tuple[int, str]'] -Line 205: Unexpected errors ['./generics_defaults.py:205:16: (...) -> None is not equivalent to (float | int, bool, /) -> None'] -Line 208: Unexpected errors ['./generics_defaults.py:208:16: (...) -> None is not equivalent to (bytes, /) -> None'] """ output = """ -./generics_defaults.py:24:0: non-default TypeVars cannot follow ones with defaults [invalid_type_parameter] -./generics_defaults.py:33:16: ~DefaultStrT@./generics_defaults.py.NoNonDefaults is not equivalent to str -./generics_defaults.py:34:16: ~DefaultIntT@./generics_defaults.py.NoNonDefaults is not equivalent to int +./generics_defaults.py:24:0: non-default TypeVars cannot follow ones with defaults [invalid_type_parameter_default] ./generics_defaults.py:66:7: Expected at least 2 type arguments for ./generics_defaults.py.AllTheDefaults [invalid_specialization] -./generics_defaults.py:73:16: ~T1@./generics_defaults.py.AllTheDefaults is not equivalent to Any[explicit] -./generics_defaults.py:74:16: ~T2@./generics_defaults.py.AllTheDefaults is not equivalent to Any[explicit] -./generics_defaults.py:75:16: ~DefaultStrT@./generics_defaults.py.NoNonDefaults is not equivalent to str -./generics_defaults.py:76:16: ~DefaultIntT@./generics_defaults.py.NoNonDefaults is not equivalent to int -./generics_defaults.py:77:16: ~DefaultBoolT@./generics_defaults.py.AllTheDefaults is not equivalent to bool -./generics_defaults.py:122:16: (**__P: **DefaultP@./generics_defaults.py.Class_ParamSpec) -> None is not equivalent to (str, int, /) -> None -./generics_defaults.py:124:16: ./generics_defaults.py.Class_ParamSpec[AnySig()] is not equivalent to ./generics_defaults.py.Class_ParamSpec[tuple[bool, bool]] -./generics_defaults.py:144:60: Incompatible argument type for default: expected TypeForm[object] but got Literal[typing.Unpack[DefaultTs]] [incompatible_argument] -./generics_defaults.py:152:50: TypeVar default must be assignable to its bound [incompatible_call] -./generics_defaults.py:159:51: TypeVar default must be one of its constraints [incompatible_call] +./generics_defaults.py:152:50: TypeVar default must be assignable to its bound [invalid_type_parameter_default] +./generics_defaults.py:159:51: TypeVar default must be one of its constraints [invalid_type_parameter_default] ./generics_defaults.py:176:12: Any[generic_argument] is not equivalent to int -./generics_defaults.py:188:0: TypeVars with defaults cannot follow TypeVarTuples [invalid_type_parameter] -./generics_defaults.py:203:36: Invalid type annotation [] [invalid_annotation] -./generics_defaults.py:203:17: ParamSpec specialization must use list form, Concatenate[..., P], P, or ... [invalid_annotation] -./generics_defaults.py:204:16: tuple[int] is not equivalent to tuple[int, str] -./generics_defaults.py:205:16: (...) -> None is not equivalent to (float | int, bool, /) -> None -./generics_defaults.py:208:16: (...) -> None is not equivalent to (bytes, /) -> None +./generics_defaults.py:188:0: TypeVars with defaults cannot follow TypeVarTuples [invalid_type_parameter_default] """ diff --git a/conformance/results/pycroscope/generics_defaults_referential.toml b/conformance/results/pycroscope/generics_defaults_referential.toml index 9bde8f604..d6d2e1b4e 100644 --- a/conformance/results/pycroscope/generics_defaults_referential.toml +++ b/conformance/results/pycroscope/generics_defaults_referential.toml @@ -1,20 +1,12 @@ -conformant = "Partial" -notes = """ -Fails to apply default specializations in some cases. -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 97: Unexpected errors ['./generics_defaults_referential.py:97:16: ~Z1@generics_defaults_referential.Bar is not equivalent to Any[explicit]'] -Line 98: Unexpected errors ['./generics_defaults_referential.py:98:16: ~ListDefaultT@generics_defaults_referential.Bar is not equivalent to list[Any[explicit]]'] """ output = """ ./generics_defaults_referential.py:36:16: Incompatible argument type for b: expected int but got str [incompatible_argument] ./generics_defaults_referential.py:37:13: Incompatible argument type for a: expected int but got str [incompatible_argument] -./generics_defaults_referential.py:53:0: Type parameter defaults can reference only earlier type parameters from the same class [invalid_type_parameter] -./generics_defaults_referential.py:60:4: Type parameter defaults can reference only earlier type parameters from the same class [invalid_type_parameter] -./generics_defaults_referential.py:68:39: TypeVar default must be assignable to its bound [incompatible_call] -./generics_defaults_referential.py:74:51: TypeVar default must be one of its constraints [incompatible_call] -./generics_defaults_referential.py:78:62: TypeVar default must be one of its constraints [incompatible_call] -./generics_defaults_referential.py:97:16: ~Z1@generics_defaults_referential.Bar is not equivalent to Any[explicit] -./generics_defaults_referential.py:98:16: ~ListDefaultT@generics_defaults_referential.Bar is not equivalent to list[Any[explicit]] +./generics_defaults_referential.py:53:0: Type parameter defaults can reference only earlier type parameters from the same class [invalid_type_parameter_default] +./generics_defaults_referential.py:60:4: Type parameter defaults can reference only earlier type parameters from the same class [invalid_type_parameter_default] +./generics_defaults_referential.py:68:39: TypeVar default must be assignable to its bound [invalid_type_parameter_default] +./generics_defaults_referential.py:74:51: TypeVar default must be one of its constraints [invalid_type_parameter_default] +./generics_defaults_referential.py:78:62: TypeVar default must be one of its constraints [invalid_type_parameter_default] """ diff --git a/conformance/results/pycroscope/generics_mixed_variance_inference.toml b/conformance/results/pycroscope/generics_mixed_variance_inference.toml index 6aa55eb89..679f6f667 100644 --- a/conformance/results/pycroscope/generics_mixed_variance_inference.toml +++ b/conformance/results/pycroscope/generics_mixed_variance_inference.toml @@ -1,20 +1,8 @@ -conformant = "Unsupported" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 8: Unexpected errors ['./generics_mixed_variance_inference.py:8:32: Traceback (most recent call last):', './generics_mixed_variance_inference.py:8:4: Traceback (most recent call last):'] -Line 12: Unexpected errors ['./generics_mixed_variance_inference.py:12:0: Incompatible assignment: expected generics_mixed_variance_inference.Mixed[int, Any[error]], got generics_mixed_variance_inference.Mixed[object, AnySig()] [incompatible_assignment]', './generics_mixed_variance_inference.py:12:4: Invalid type annotation [] [invalid_annotation]'] -Line 17: Unexpected errors ['./generics_mixed_variance_inference.py:17:0: Incompatible assignment: expected generics_mixed_variance_inference.Mixed[int, int, ], got generics_mixed_variance_inference.Mixed[int, bool, AnySig()] [incompatible_assignment]'] -Line 20: Unexpected errors ["./generics_mixed_variance_inference.py:20:4: Invalid type annotation [] [invalid_annotation]"] """ output = """ -./generics_mixed_variance_inference.py:8:32: Traceback (most recent call last): -./generics_mixed_variance_inference.py:8:4: Traceback (most recent call last): -./generics_mixed_variance_inference.py:12:0: Incompatible assignment: expected generics_mixed_variance_inference.Mixed[int, Any[error]], got generics_mixed_variance_inference.Mixed[object, AnySig()] [incompatible_assignment] -./generics_mixed_variance_inference.py:12:4: Invalid type annotation [] [invalid_annotation] -./generics_mixed_variance_inference.py:13:0: Incompatible assignment: expected generics_mixed_variance_inference.Mixed[int, Any[error]], got generics_mixed_variance_inference.Mixed[bool, AnySig()] [incompatible_assignment] -./generics_mixed_variance_inference.py:13:4: Invalid type annotation [] [invalid_annotation] -./generics_mixed_variance_inference.py:16:0: Incompatible assignment: expected generics_mixed_variance_inference.Mixed[int, int, ], got generics_mixed_variance_inference.Mixed[int, object, AnySig()] [incompatible_assignment] -./generics_mixed_variance_inference.py:17:0: Incompatible assignment: expected generics_mixed_variance_inference.Mixed[int, int, ], got generics_mixed_variance_inference.Mixed[int, bool, AnySig()] [incompatible_assignment] -./generics_mixed_variance_inference.py:20:4: Invalid type annotation [] [invalid_annotation] -./generics_mixed_variance_inference.py:21:4: Invalid type annotation [] [invalid_annotation] +./generics_mixed_variance_inference.py:13:0: Incompatible assignment: expected generics_mixed_variance_inference.Mixed[int, tuple[()], () -> Any[generic_argument]], got generics_mixed_variance_inference.Mixed[bool, () -> Any[generic_argument]] [incompatible_assignment] +./generics_mixed_variance_inference.py:16:0: Incompatible assignment: expected generics_mixed_variance_inference.Mixed[int, int, () -> Any[generic_argument]], got generics_mixed_variance_inference.Mixed[int, object, () -> Any[generic_argument]] [incompatible_assignment] +./generics_mixed_variance_inference.py:21:0: Incompatible assignment: expected generics_mixed_variance_inference.Mixed[int, tuple[()], (int, /) -> Any[generic_argument]], got generics_mixed_variance_inference.Mixed[int, (bool, /) -> Any[generic_argument]] [incompatible_assignment] """ diff --git a/conformance/results/pycroscope/generics_paramspec_semantics.toml b/conformance/results/pycroscope/generics_paramspec_semantics.toml index dfaf3a3c1..c332d805f 100644 --- a/conformance/results/pycroscope/generics_paramspec_semantics.toml +++ b/conformance/results/pycroscope/generics_paramspec_semantics.toml @@ -9,7 +9,7 @@ output = """ ./generics_paramspec_semantics.py:98:3: Incompatible argument type for @0: expected str but got Literal[1] [incompatible_argument] ./generics_paramspec_semantics.py:108:0: Incompatible argument type for args: expected tuple[bool, ...] but got tuple[Literal[1]] [incompatible_argument] ./generics_paramspec_semantics.py:120:3: Incompatible argument type for @0: expected str but got Literal[1] [incompatible_argument] -./generics_paramspec_semantics.py:127:1: Incompatible argument type for x: expected (int, /, ****P@./generics_paramspec_semantics.py.expects_int_first..expects_int_first) -> int but got (x: str) -> int [incompatible_argument] -./generics_paramspec_semantics.py:132:1: Incompatible argument type for x: expected (int, /, ****P@./generics_paramspec_semantics.py.expects_int_first..expects_int_first) -> int but got (*, x: int) -> int [incompatible_argument] -./generics_paramspec_semantics.py:137:1: Incompatible argument type for x: expected (int, /, ****P@./generics_paramspec_semantics.py.expects_int_first..expects_int_first) -> int but got (**kwargs: dict[str, int]) -> int [incompatible_argument] +./generics_paramspec_semantics.py:127:1: Incompatible argument type for x: expected (int, /, ****P) -> int but got (x: str) -> int [incompatible_argument] +./generics_paramspec_semantics.py:132:1: Incompatible argument type for x: expected (int, /, ****P) -> int but got (*, x: int) -> int [incompatible_argument] +./generics_paramspec_semantics.py:137:1: Incompatible argument type for x: expected (int, /, ****P) -> int but got (**kwargs: dict[str, int]) -> int [incompatible_argument] """ diff --git a/conformance/results/pycroscope/generics_paramspec_variance.toml b/conformance/results/pycroscope/generics_paramspec_variance.toml index 9a83d5184..edfa0a813 100644 --- a/conformance/results/pycroscope/generics_paramspec_variance.toml +++ b/conformance/results/pycroscope/generics_paramspec_variance.toml @@ -1,49 +1,27 @@ -conformant = "Unsupported" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 90: Expected 1 errors -Line 117: Expected 1 errors -Line 126: Expected 1 errors -Line 19: Unexpected errors ['./generics_paramspec_variance.py:19:23: Traceback (most recent call last):', './generics_paramspec_variance.py:19:4: Traceback (most recent call last):'] -Line 22: Unexpected errors ['./generics_paramspec_variance.py:22:38: Traceback (most recent call last):'] -Line 31: Unexpected errors ['./generics_paramspec_variance.py:31:38: Traceback (most recent call last):'] -Line 84: Unexpected errors ["./generics_paramspec_variance.py:84:0: Incompatible types in assignment to attribute 't': expected ./generics_paramspec_variance.py.OutitP~[(a: int) -> Any[unannotated]], got ./generics_paramspec_variance.py.OutitP~[(*, a: int) -> Any[unannotated]] [incompatible_assignment]"] -Line 86: Unexpected errors ["./generics_paramspec_variance.py:86:0: Incompatible types in assignment to attribute 't': expected ./generics_paramspec_variance.py.OutitP~[(a: int) -> Any[unannotated]], got ./generics_paramspec_variance.py.OutitP~[(a: int, /) -> Any[unannotated]] [incompatible_assignment]"] -Line 109: Unexpected errors ['./generics_paramspec_variance.py:109:13: Traceback (most recent call last):'] -Line 122: Unexpected errors ['./generics_paramspec_variance.py:122:45: Traceback (most recent call last):'] -Line 133: Unexpected errors ['./generics_paramspec_variance.py:133:45: Traceback (most recent call last):'] -Line 143: Unexpected errors ['./generics_paramspec_variance.py:143:59: Traceback (most recent call last):'] -Line 152: Unexpected errors ['./generics_paramspec_variance.py:152:59: Traceback (most recent call last):'] """ output = """ -./generics_paramspec_variance.py:14:41: Traceback (most recent call last): -./generics_paramspec_variance.py:15:38: Traceback (most recent call last): -./generics_paramspec_variance.py:19:23: Traceback (most recent call last): -./generics_paramspec_variance.py:19:4: Traceback (most recent call last): -./generics_paramspec_variance.py:21:41: Traceback (most recent call last): -./generics_paramspec_variance.py:22:38: Traceback (most recent call last): -./generics_paramspec_variance.py:30:35: Traceback (most recent call last): -./generics_paramspec_variance.py:31:38: Traceback (most recent call last): -./generics_paramspec_variance.py:61:0: Incompatible types in assignment to attribute 't': expected ./generics_paramspec_variance.py.InitP~[(a: int) -> Any[unannotated]], got ./generics_paramspec_variance.py.InitP~[(*, a: int) -> Any[unannotated]] [incompatible_assignment] -./generics_paramspec_variance.py:63:0: Incompatible types in assignment to attribute 't': expected ./generics_paramspec_variance.py.InitP~[(a: int) -> Any[unannotated]], got ./generics_paramspec_variance.py.InitP~[(a: int, /) -> Any[unannotated]] [incompatible_assignment] -./generics_paramspec_variance.py:65:0: Incompatible types in assignment to attribute 't': expected ./generics_paramspec_variance.py.InitP~[(a: int) -> Any[unannotated]], got ./generics_paramspec_variance.py.InitP~[(b: int) -> Any[unannotated]] [incompatible_assignment] -./generics_paramspec_variance.py:69:0: Incompatible types in assignment to attribute 't': expected ./generics_paramspec_variance.py.InitP~[(a: int) -> Any[unannotated]], got ./generics_paramspec_variance.py.InitP~[(a: int, b: str) -> Any[unannotated]] [incompatible_assignment] -./generics_paramspec_variance.py:84:0: Incompatible types in assignment to attribute 't': expected ./generics_paramspec_variance.py.OutitP~[(a: int) -> Any[unannotated]], got ./generics_paramspec_variance.py.OutitP~[(*, a: int) -> Any[unannotated]] [incompatible_assignment] -./generics_paramspec_variance.py:86:0: Incompatible types in assignment to attribute 't': expected ./generics_paramspec_variance.py.OutitP~[(a: int) -> Any[unannotated]], got ./generics_paramspec_variance.py.OutitP~[(a: int, /) -> Any[unannotated]] [incompatible_assignment] -./generics_paramspec_variance.py:88:0: Incompatible types in assignment to attribute 't': expected ./generics_paramspec_variance.py.OutitP~[(a: int) -> Any[unannotated]], got ./generics_paramspec_variance.py.OutitP~[(b: int) -> Any[unannotated]] [incompatible_assignment] -./generics_paramspec_variance.py:92:0: Incompatible types in assignment to attribute 't': expected ./generics_paramspec_variance.py.OutitP~[(a: int) -> Any[unannotated]], got ./generics_paramspec_variance.py.OutitP~[(a: int, b: str) -> Any[unannotated]] [incompatible_assignment] -./generics_paramspec_variance.py:100:8: Error calling (name: str, /, *, bound: object = no argument given, covariant: bool = Literal[False], contravariant: bool = Literal[False], infer_variance: bool = Literal[False], default: object = no argument given) -> typing.ParamSpec (with impl): Bivariant types are not supported. [incompatible_call] -./generics_paramspec_variance.py:101:8: Error calling (name: str, /, *, bound: object = no argument given, covariant: bool = Literal[False], contravariant: bool = Literal[False], infer_variance: bool = Literal[False], default: object = no argument given) -> typing.ParamSpec (with impl): Variance cannot be specified with infer_variance. [incompatible_call] -./generics_paramspec_variance.py:102:8: Error calling (name: str, /, *, bound: object = no argument given, covariant: bool = Literal[False], contravariant: bool = Literal[False], infer_variance: bool = Literal[False], default: object = no argument given) -> typing.ParamSpec (with impl): Variance cannot be specified with infer_variance. [incompatible_call] -./generics_paramspec_variance.py:109:13: Traceback (most recent call last): -./generics_paramspec_variance.py:110:13: Traceback (most recent call last): -./generics_paramspec_variance.py:111:13: Traceback (most recent call last): -./generics_paramspec_variance.py:121:48: Traceback (most recent call last): -./generics_paramspec_variance.py:122:45: Traceback (most recent call last): -./generics_paramspec_variance.py:132:42: Traceback (most recent call last): -./generics_paramspec_variance.py:133:45: Traceback (most recent call last): -./generics_paramspec_variance.py:142:62: Traceback (most recent call last): -./generics_paramspec_variance.py:143:59: Traceback (most recent call last): -./generics_paramspec_variance.py:151:56: Traceback (most recent call last): -./generics_paramspec_variance.py:152:59: Traceback (most recent call last): +./generics_paramspec_variance.py:14:0: Incompatible assignment: expected ./generics_paramspec_variance.py.InvariantParamSpec[(object, /) -> Any[generic_argument]], got ./generics_paramspec_variance.py.InvariantParamSpec[(int, /) -> Any[generic_argument]] [incompatible_assignment] +./generics_paramspec_variance.py:15:0: Incompatible assignment: expected ./generics_paramspec_variance.py.InvariantParamSpec[(int, /) -> Any[generic_argument]], got ./generics_paramspec_variance.py.InvariantParamSpec[(object, /) -> Any[generic_argument]] [incompatible_assignment] +./generics_paramspec_variance.py:21:0: Incompatible assignment: expected ./generics_paramspec_variance.py.ContravariantParamSpec[(object, /) -> Any[generic_argument]], got ./generics_paramspec_variance.py.ContravariantParamSpec[(int, /) -> Any[generic_argument]] [incompatible_assignment] +./generics_paramspec_variance.py:30:0: Incompatible assignment: expected ./generics_paramspec_variance.py.CovariantParamSpec[(int, /) -> Any[generic_argument]], got ./generics_paramspec_variance.py.CovariantParamSpec[(object, /) -> Any[generic_argument]] [incompatible_assignment] +./generics_paramspec_variance.py:61:0: Incompatible types in assignment to attribute 't': expected ./generics_paramspec_variance.py.InitP[(a: int) -> Any[unannotated]], got ./generics_paramspec_variance.py.InitP[(*, a: int) -> Any[unannotated]] [incompatible_assignment] +./generics_paramspec_variance.py:63:0: Incompatible types in assignment to attribute 't': expected ./generics_paramspec_variance.py.InitP[(a: int) -> Any[unannotated]], got ./generics_paramspec_variance.py.InitP[(a: int, /) -> Any[unannotated]] [incompatible_assignment] +./generics_paramspec_variance.py:65:0: Incompatible types in assignment to attribute 't': expected ./generics_paramspec_variance.py.InitP[(a: int) -> Any[unannotated]], got ./generics_paramspec_variance.py.InitP[(b: int) -> Any[unannotated]] [incompatible_assignment] +./generics_paramspec_variance.py:69:0: Incompatible types in assignment to attribute 't': expected ./generics_paramspec_variance.py.InitP[(a: int) -> Any[unannotated]], got ./generics_paramspec_variance.py.InitP[(a: int, b: str) -> Any[unannotated]] [incompatible_assignment] +./generics_paramspec_variance.py:88:0: Incompatible types in assignment to attribute 't': expected ./generics_paramspec_variance.py.OutitP[(a: int) -> Any[unannotated]], got ./generics_paramspec_variance.py.OutitP[(b: int) -> Any[unannotated]] [incompatible_assignment] +./generics_paramspec_variance.py:90:0: Incompatible types in assignment to attribute 't': expected ./generics_paramspec_variance.py.OutitP[(a: int) -> Any[unannotated]], got ./generics_paramspec_variance.py.OutitP[(a: int = Literal[1]) -> Any[unannotated]] [incompatible_assignment] +./generics_paramspec_variance.py:92:0: Incompatible types in assignment to attribute 't': expected ./generics_paramspec_variance.py.OutitP[(a: int) -> Any[unannotated]], got ./generics_paramspec_variance.py.OutitP[(a: int, b: str) -> Any[unannotated]] [incompatible_assignment] +./generics_paramspec_variance.py:100:8: Bivariant types are not supported [incompatible_call] +./generics_paramspec_variance.py:101:8: Type parameter cannot combine infer_variance with explicit variance [incompatible_call] +./generics_paramspec_variance.py:102:8: Type parameter cannot combine infer_variance with explicit variance [incompatible_call] +./generics_paramspec_variance.py:110:0: Incompatible assignment: expected ./generics_paramspec_variance.py.InvariantParamSpecOld[(int, /) -> Any[generic_argument]], got ./generics_paramspec_variance.py.InvariantParamSpecOld[(bool, /) -> Any[generic_argument]] [incompatible_assignment] +./generics_paramspec_variance.py:111:0: Incompatible assignment: expected ./generics_paramspec_variance.py.InvariantParamSpecOld[(int, /) -> Any[generic_argument]], got ./generics_paramspec_variance.py.InvariantParamSpecOld[(object, /) -> Any[generic_argument]] [incompatible_assignment] +./generics_paramspec_variance.py:117:4: InP has incompatible variance in method [invalid_annotation] +./generics_paramspec_variance.py:121:0: Incompatible assignment: expected ./generics_paramspec_variance.py.ContravariantParamSpecOld[(object, /) -> Any[generic_argument]], got ./generics_paramspec_variance.py.ContravariantParamSpecOld[(int, /) -> Any[generic_argument]] [incompatible_assignment] +./generics_paramspec_variance.py:126:4: OutP has incompatible variance in method [invalid_annotation] +./generics_paramspec_variance.py:132:0: Incompatible assignment: expected ./generics_paramspec_variance.py.CovariantParamSpecOld[(int, /) -> Any[generic_argument]], got ./generics_paramspec_variance.py.CovariantParamSpecOld[(object, /) -> Any[generic_argument]] [incompatible_assignment] +./generics_paramspec_variance.py:142:0: Incompatible assignment: expected ./generics_paramspec_variance.py.InferredContravariantParamSpecOld[(object, /) -> Any[generic_argument]], got ./generics_paramspec_variance.py.InferredContravariantParamSpecOld[(int, /) -> Any[generic_argument]] [incompatible_assignment] +./generics_paramspec_variance.py:151:0: Incompatible assignment: expected ./generics_paramspec_variance.py.InferredCovariantParamSpecOld[(int, /) -> Any[generic_argument]], got ./generics_paramspec_variance.py.InferredCovariantParamSpecOld[(object, /) -> Any[generic_argument]] [incompatible_assignment] """ diff --git a/conformance/results/pycroscope/generics_syntax_infer_variance.toml b/conformance/results/pycroscope/generics_syntax_infer_variance.toml index fdae01c6a..df6ccefcf 100644 --- a/conformance/results/pycroscope/generics_syntax_infer_variance.toml +++ b/conformance/results/pycroscope/generics_syntax_infer_variance.toml @@ -2,8 +2,8 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -./generics_syntax_infer_variance.py:15:5: TypeVar cannot combine infer_variance with explicit variance [incompatible_call] -./generics_syntax_infer_variance.py:17:5: TypeVar cannot combine infer_variance with explicit variance [incompatible_call] +./generics_syntax_infer_variance.py:15:5: Type parameter cannot combine infer_variance with explicit variance [incompatible_call] +./generics_syntax_infer_variance.py:17:5: Type parameter cannot combine infer_variance with explicit variance [incompatible_call] ./generics_syntax_infer_variance.py:29:0: Incompatible assignment: expected ./generics_syntax_infer_variance.py.ShouldBeCovariant1[int], got ./generics_syntax_infer_variance.py.ShouldBeCovariant1[float | int] [incompatible_assignment] ./generics_syntax_infer_variance.py:47:0: Incompatible assignment: expected ./generics_syntax_infer_variance.py.ShouldBeCovariant2[int], got ./generics_syntax_infer_variance.py.ShouldBeCovariant2[float | int] [incompatible_assignment] ./generics_syntax_infer_variance.py:56:0: Incompatible assignment: expected ./generics_syntax_infer_variance.py.ShouldBeCovariant3[int], got ./generics_syntax_infer_variance.py.ShouldBeCovariant3[float | int] [incompatible_assignment] diff --git a/conformance/results/pycroscope/generics_syntax_scoping.toml b/conformance/results/pycroscope/generics_syntax_scoping.toml index 3bff89f05..6aa30d4d5 100644 --- a/conformance/results/pycroscope/generics_syntax_scoping.toml +++ b/conformance/results/pycroscope/generics_syntax_scoping.toml @@ -1,24 +1,13 @@ -conformant = "Partial" -notes = """ -Misses some details of scoping rules. -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 18: Expected 1 errors -Line 92: Expected 1 errors -Line 95: Expected 1 errors -Line 98: Expected 1 errors -Line 74: Unexpected errors ['./generics_syntax_scoping.py:74:19: Undefined name: Private [undefined_name]'] -Line 88: Unexpected errors ['./generics_syntax_scoping.py:88:1: Undefined name: decorator2 [undefined_name]'] -Line 117: Unexpected errors ['./generics_syntax_scoping.py:117:28: ~T@./generics_syntax_scoping.py.f..Outer2 is not equivalent to typing.TypeVar', './generics_syntax_scoping.py:117:28: Type parameter is not valid in this annotation context [invalid_annotation]'] """ output = """ ./generics_syntax_scoping.py:14:19: TypeVar bound cannot be parameterized by type variables [invalid_annotation] +./generics_syntax_scoping.py:18:13: Type parameter bound cannot reference a later type parameter [invalid_type_parameter] ./generics_syntax_scoping.py:35:6: Undefined name: T [undefined_name] +./generics_syntax_scoping.py:44:12: Incompatible argument type for x: expected type[./generics_syntax_scoping.py.Foo[~T@./generics_syntax_scoping.py.decorator1..decorator1]] but got types.GenericAlias (partial from [Any[error]]) [incompatible_argument] ./generics_syntax_scoping.py:44:16: Undefined name: T [undefined_name] -./generics_syntax_scoping.py:44:1: Undefined name: decorator1 [undefined_name] -./generics_syntax_scoping.py:74:19: Undefined name: Private [undefined_name] -./generics_syntax_scoping.py:88:1: Undefined name: decorator2 [undefined_name] -./generics_syntax_scoping.py:117:28: ~T@./generics_syntax_scoping.py.f..Outer2 is not equivalent to typing.TypeVar -./generics_syntax_scoping.py:117:28: Type parameter is not valid in this annotation context [invalid_annotation] +./generics_syntax_scoping.py:92:16: Type parameter 'T' is already in use by an outer scope [invalid_type_parameter] +./generics_syntax_scoping.py:95:16: Type parameter 'T' is already in use by an outer scope [invalid_type_parameter] +./generics_syntax_scoping.py:98:16: Type parameter 'T' is already in use by an outer scope [invalid_type_parameter] """ diff --git a/conformance/results/pycroscope/generics_typevartuple_basic.toml b/conformance/results/pycroscope/generics_typevartuple_basic.toml index 6685db31f..482d88b8c 100644 --- a/conformance/results/pycroscope/generics_typevartuple_basic.toml +++ b/conformance/results/pycroscope/generics_typevartuple_basic.toml @@ -1,10 +1,5 @@ -conformant = "Partial" -conformance_automated = "Fail" -notes = """ -Doesn't error when multiple type variable tuples appear in a PEP 695 type parameter list; only detects the `Generic[...]` form. -""" +conformance_automated = "Pass" errors_diff = """ -Line 111: Expected 1 errors """ output = """ ./generics_typevartuple_basic.py:43:33: Incompatible argument type for shape: expected tuple[*tuple[Shape, ...]] but got NewType('Height', int) [incompatible_argument] @@ -20,4 +15,5 @@ output = """ ./generics_typevartuple_basic.py:100:4: Cannot resolve type variables [incompatible_call] ./generics_typevartuple_basic.py:101:4: Cannot resolve type variables [incompatible_call] ./generics_typevartuple_basic.py:107:21: Only one TypeVarTuple can be used in a type parameter list [invalid_base] +./generics_typevartuple_basic.py:111:19: Only one TypeVarTuple may appear in a type parameter list [invalid_type_parameter] """ diff --git a/conformance/results/pycroscope/generics_typevartuple_variance.toml b/conformance/results/pycroscope/generics_typevartuple_variance.toml index f53bb15ad..74e9e79f4 100644 --- a/conformance/results/pycroscope/generics_typevartuple_variance.toml +++ b/conformance/results/pycroscope/generics_typevartuple_variance.toml @@ -1,54 +1,31 @@ -conformant = "Unsupported" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 56: Expected 1 errors -Line 57: Expected 1 errors -Line 58: Expected 1 errors -Line 79: Expected 1 errors -Line 90: Expected 1 errors -Line 29: Unexpected errors ['./generics_typevartuple_variance.py:29:0: Incompatible assignment: expected generics_typevartuple_variance.ContravariantTypeVarTuple[int], got generics_typevartuple_variance.ContravariantTypeVarTuple[object] [incompatible_assignment]'] -Line 30: Unexpected errors ['./generics_typevartuple_variance.py:30:0: Incompatible assignment: expected generics_typevartuple_variance.ContravariantTypeVarTuple[*tuple[int, ...]], got generics_typevartuple_variance.ContravariantTypeVarTuple[tuple[object, ...]] [incompatible_assignment]'] -Line 33: Unexpected errors ['./generics_typevartuple_variance.py:33:0: Incompatible assignment: expected generics_typevartuple_variance.ContravariantTypeVarTuple[int], got generics_typevartuple_variance.ContravariantTypeVarTuple[tuple[int, ...]] [incompatible_assignment]'] -Line 43: Unexpected errors ['./generics_typevartuple_variance.py:43:0: Incompatible assignment: expected generics_typevartuple_variance.CovariantTypeVarTuple[object], got generics_typevartuple_variance.CovariantTypeVarTuple[int] [incompatible_assignment]'] -Line 44: Unexpected errors ['./generics_typevartuple_variance.py:44:0: Incompatible assignment: expected generics_typevartuple_variance.CovariantTypeVarTuple[int, int], got generics_typevartuple_variance.CovariantTypeVarTuple[bool, bool] [incompatible_assignment]'] -Line 49: Unexpected errors ['./generics_typevartuple_variance.py:49:0: Incompatible assignment: expected generics_typevartuple_variance.CovariantTypeVarTuple[*tuple[object, ...]], got generics_typevartuple_variance.CovariantTypeVarTuple[tuple[int, ...]] [incompatible_assignment]'] -Line 52: Unexpected errors ['./generics_typevartuple_variance.py:52:0: Incompatible assignment: expected generics_typevartuple_variance.CovariantTypeVarTuple[*tuple[int, ...]], got generics_typevartuple_variance.CovariantTypeVarTuple[int] [incompatible_assignment]'] -Line 84: Unexpected errors ['./generics_typevartuple_variance.py:84:0: Incompatible assignment: expected generics_typevartuple_variance.ContravariantTypeVarTupleOld[int], got generics_typevartuple_variance.ContravariantTypeVarTupleOld[object] [incompatible_assignment]'] -Line 98: Unexpected errors ['./generics_typevartuple_variance.py:98:0: Incompatible assignment: expected generics_typevartuple_variance.CovariantTypeVarTupleOld[object], got generics_typevartuple_variance.CovariantTypeVarTupleOld[int] [incompatible_assignment]'] -Line 108: Unexpected errors ['./generics_typevartuple_variance.py:108:0: Incompatible assignment: expected generics_typevartuple_variance.InferredContravariantTypeVarTupleOld[int], got generics_typevartuple_variance.InferredContravariantTypeVarTupleOld[object] [incompatible_assignment]'] -Line 117: Unexpected errors ['./generics_typevartuple_variance.py:117:0: Incompatible assignment: expected generics_typevartuple_variance.InferredCovariantTypeVarTupleOld[object], got generics_typevartuple_variance.InferredCovariantTypeVarTupleOld[int] [incompatible_assignment]'] """ output = """ ./generics_typevartuple_variance.py:14:0: Incompatible assignment: expected generics_typevartuple_variance.InvariantTypeVarTuple[object], got generics_typevartuple_variance.InvariantTypeVarTuple[int] [incompatible_assignment] ./generics_typevartuple_variance.py:15:0: Incompatible assignment: expected generics_typevartuple_variance.InvariantTypeVarTuple[int], got generics_typevartuple_variance.InvariantTypeVarTuple[object] [incompatible_assignment] -./generics_typevartuple_variance.py:17:0: Incompatible assignment: expected generics_typevartuple_variance.InvariantTypeVarTuple[*tuple[int, ...]], got generics_typevartuple_variance.InvariantTypeVarTuple[tuple[object, ...]] [incompatible_assignment] -./generics_typevartuple_variance.py:18:0: Incompatible assignment: expected generics_typevartuple_variance.InvariantTypeVarTuple[*tuple[object, ...]], got generics_typevartuple_variance.InvariantTypeVarTuple[tuple[int, ...]] [incompatible_assignment] -./generics_typevartuple_variance.py:20:0: Incompatible assignment: expected generics_typevartuple_variance.InvariantTypeVarTuple[int], got generics_typevartuple_variance.InvariantTypeVarTuple[tuple[int, ...]] [incompatible_assignment] +./generics_typevartuple_variance.py:17:0: Incompatible assignment: expected generics_typevartuple_variance.InvariantTypeVarTuple[*tuple[int, ...]], got generics_typevartuple_variance.InvariantTypeVarTuple[*tuple[object, ...]] [incompatible_assignment] +./generics_typevartuple_variance.py:18:0: Incompatible assignment: expected generics_typevartuple_variance.InvariantTypeVarTuple[*tuple[object, ...]], got generics_typevartuple_variance.InvariantTypeVarTuple[*tuple[int, ...]] [incompatible_assignment] +./generics_typevartuple_variance.py:20:0: Incompatible assignment: expected generics_typevartuple_variance.InvariantTypeVarTuple[int], got generics_typevartuple_variance.InvariantTypeVarTuple[*tuple[int, ...]] [incompatible_assignment] ./generics_typevartuple_variance.py:21:0: Incompatible assignment: expected generics_typevartuple_variance.InvariantTypeVarTuple[*tuple[int, ...]], got generics_typevartuple_variance.InvariantTypeVarTuple[int] [incompatible_assignment] ./generics_typevartuple_variance.py:28:0: Incompatible assignment: expected generics_typevartuple_variance.ContravariantTypeVarTuple[object, object], got generics_typevartuple_variance.ContravariantTypeVarTuple[object, int] [incompatible_assignment] -./generics_typevartuple_variance.py:29:0: Incompatible assignment: expected generics_typevartuple_variance.ContravariantTypeVarTuple[int], got generics_typevartuple_variance.ContravariantTypeVarTuple[object] [incompatible_assignment] -./generics_typevartuple_variance.py:30:0: Incompatible assignment: expected generics_typevartuple_variance.ContravariantTypeVarTuple[*tuple[int, ...]], got generics_typevartuple_variance.ContravariantTypeVarTuple[tuple[object, ...]] [incompatible_assignment] -./generics_typevartuple_variance.py:31:0: Incompatible assignment: expected generics_typevartuple_variance.ContravariantTypeVarTuple[*tuple[object, ...]], got generics_typevartuple_variance.ContravariantTypeVarTuple[tuple[int, ...]] [incompatible_assignment] -./generics_typevartuple_variance.py:33:0: Incompatible assignment: expected generics_typevartuple_variance.ContravariantTypeVarTuple[int], got generics_typevartuple_variance.ContravariantTypeVarTuple[tuple[int, ...]] [incompatible_assignment] +./generics_typevartuple_variance.py:31:0: Incompatible assignment: expected generics_typevartuple_variance.ContravariantTypeVarTuple[*tuple[object, ...]], got generics_typevartuple_variance.ContravariantTypeVarTuple[*tuple[int, ...]] [incompatible_assignment] ./generics_typevartuple_variance.py:34:0: Incompatible assignment: expected generics_typevartuple_variance.ContravariantTypeVarTuple[*tuple[int, ...]], got generics_typevartuple_variance.ContravariantTypeVarTuple[int] [incompatible_assignment] ./generics_typevartuple_variance.py:42:0: Incompatible assignment: expected generics_typevartuple_variance.CovariantTypeVarTuple[int], got generics_typevartuple_variance.CovariantTypeVarTuple[object] [incompatible_assignment] -./generics_typevartuple_variance.py:43:0: Incompatible assignment: expected generics_typevartuple_variance.CovariantTypeVarTuple[object], got generics_typevartuple_variance.CovariantTypeVarTuple[int] [incompatible_assignment] -./generics_typevartuple_variance.py:44:0: Incompatible assignment: expected generics_typevartuple_variance.CovariantTypeVarTuple[int, int], got generics_typevartuple_variance.CovariantTypeVarTuple[bool, bool] [incompatible_assignment] ./generics_typevartuple_variance.py:45:0: Incompatible assignment: expected generics_typevartuple_variance.CovariantTypeVarTuple[int, int], got generics_typevartuple_variance.CovariantTypeVarTuple[bool, object] [incompatible_assignment] ./generics_typevartuple_variance.py:46:0: Incompatible assignment: expected generics_typevartuple_variance.CovariantTypeVarTuple[int, int], got generics_typevartuple_variance.CovariantTypeVarTuple[object, bool] [incompatible_assignment] ./generics_typevartuple_variance.py:47:0: Incompatible assignment: expected generics_typevartuple_variance.CovariantTypeVarTuple[int, int], got generics_typevartuple_variance.CovariantTypeVarTuple[object, object] [incompatible_assignment] -./generics_typevartuple_variance.py:48:0: Incompatible assignment: expected generics_typevartuple_variance.CovariantTypeVarTuple[*tuple[int, ...]], got generics_typevartuple_variance.CovariantTypeVarTuple[tuple[object, ...]] [incompatible_assignment] -./generics_typevartuple_variance.py:49:0: Incompatible assignment: expected generics_typevartuple_variance.CovariantTypeVarTuple[*tuple[object, ...]], got generics_typevartuple_variance.CovariantTypeVarTuple[tuple[int, ...]] [incompatible_assignment] -./generics_typevartuple_variance.py:51:0: Incompatible assignment: expected generics_typevartuple_variance.CovariantTypeVarTuple[int], got generics_typevartuple_variance.CovariantTypeVarTuple[tuple[int, ...]] [incompatible_assignment] -./generics_typevartuple_variance.py:52:0: Incompatible assignment: expected generics_typevartuple_variance.CovariantTypeVarTuple[*tuple[int, ...]], got generics_typevartuple_variance.CovariantTypeVarTuple[int] [incompatible_assignment] +./generics_typevartuple_variance.py:48:0: Incompatible assignment: expected generics_typevartuple_variance.CovariantTypeVarTuple[*tuple[int, ...]], got generics_typevartuple_variance.CovariantTypeVarTuple[*tuple[object, ...]] [incompatible_assignment] +./generics_typevartuple_variance.py:51:0: Incompatible assignment: expected generics_typevartuple_variance.CovariantTypeVarTuple[int], got generics_typevartuple_variance.CovariantTypeVarTuple[*tuple[int, ...]] [incompatible_assignment] +./generics_typevartuple_variance.py:56:9: Bivariant types are not supported [incompatible_call] +./generics_typevartuple_variance.py:57:9: Type parameter cannot combine infer_variance with explicit variance [incompatible_call] +./generics_typevartuple_variance.py:58:9: Type parameter cannot combine infer_variance with explicit variance [incompatible_call] ./generics_typevartuple_variance.py:68:0: Incompatible assignment: expected generics_typevartuple_variance.InvariantTypeVarTupleOld[object], got generics_typevartuple_variance.InvariantTypeVarTupleOld[int] [incompatible_assignment] ./generics_typevartuple_variance.py:69:0: Incompatible assignment: expected generics_typevartuple_variance.InvariantTypeVarTupleOld[int], got generics_typevartuple_variance.InvariantTypeVarTupleOld[object] [incompatible_assignment] +./generics_typevartuple_variance.py:79:4: InTs has incompatible variance in method [invalid_annotation] ./generics_typevartuple_variance.py:83:0: Incompatible assignment: expected generics_typevartuple_variance.ContravariantTypeVarTupleOld[object], got generics_typevartuple_variance.ContravariantTypeVarTupleOld[int] [incompatible_assignment] -./generics_typevartuple_variance.py:84:0: Incompatible assignment: expected generics_typevartuple_variance.ContravariantTypeVarTupleOld[int], got generics_typevartuple_variance.ContravariantTypeVarTupleOld[object] [incompatible_assignment] +./generics_typevartuple_variance.py:90:4: OutTs has incompatible variance in method [invalid_annotation] ./generics_typevartuple_variance.py:97:0: Incompatible assignment: expected generics_typevartuple_variance.CovariantTypeVarTupleOld[int], got generics_typevartuple_variance.CovariantTypeVarTupleOld[object] [incompatible_assignment] -./generics_typevartuple_variance.py:98:0: Incompatible assignment: expected generics_typevartuple_variance.CovariantTypeVarTupleOld[object], got generics_typevartuple_variance.CovariantTypeVarTupleOld[int] [incompatible_assignment] ./generics_typevartuple_variance.py:107:0: Incompatible assignment: expected generics_typevartuple_variance.InferredContravariantTypeVarTupleOld[object], got generics_typevartuple_variance.InferredContravariantTypeVarTupleOld[int] [incompatible_assignment] -./generics_typevartuple_variance.py:108:0: Incompatible assignment: expected generics_typevartuple_variance.InferredContravariantTypeVarTupleOld[int], got generics_typevartuple_variance.InferredContravariantTypeVarTupleOld[object] [incompatible_assignment] ./generics_typevartuple_variance.py:116:0: Incompatible assignment: expected generics_typevartuple_variance.InferredCovariantTypeVarTupleOld[int], got generics_typevartuple_variance.InferredCovariantTypeVarTupleOld[object] [incompatible_assignment] -./generics_typevartuple_variance.py:117:0: Incompatible assignment: expected generics_typevartuple_variance.InferredCovariantTypeVarTupleOld[object], got generics_typevartuple_variance.InferredCovariantTypeVarTupleOld[int] [incompatible_assignment] """ diff --git a/conformance/results/pycroscope/namedtuples_define_class.toml b/conformance/results/pycroscope/namedtuples_define_class.toml index 8cd3f9ab2..b09002fc2 100644 --- a/conformance/results/pycroscope/namedtuples_define_class.toml +++ b/conformance/results/pycroscope/namedtuples_define_class.toml @@ -1,15 +1,7 @@ -conformant = "Partial" -notes = """ -Does not support precise type inference for slices over namedtuples. -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 30: Unexpected errors ['./namedtuples_define_class.py:30:12: tuple is not equivalent to tuple[int, int]'] -Line 31: Unexpected errors ['./namedtuples_define_class.py:31:12: tuple is not equivalent to tuple[int, int, str]'] """ output = """ -./namedtuples_define_class.py:30:12: tuple is not equivalent to tuple[int, int] -./namedtuples_define_class.py:31:12: tuple is not equivalent to tuple[int, int, str] ./namedtuples_define_class.py:33:6: Tuple index out of range: Literal[3] [incompatible_call] ./namedtuples_define_class.py:34:6: Tuple index out of range: Literal[-4] [incompatible_call] ./namedtuples_define_class.py:45:5: Missing required argument 'y' [incompatible_call] diff --git a/conformance/results/pycroscope/protocols_definition.toml b/conformance/results/pycroscope/protocols_definition.toml index d5e5f2dc7..ee40e33ff 100644 --- a/conformance/results/pycroscope/protocols_definition.toml +++ b/conformance/results/pycroscope/protocols_definition.toml @@ -1,10 +1,5 @@ -conformance_automated = "Fail" -conformant = "Partial" -notes = """ -Incorrectly accepts an instance-only attribute as satisfying a `ClassVar` protocol member. -""" +conformance_automated = "Pass" errors_diff = """ -Line 369: Expected 1 errors """ output = """ ./protocols_definition.py:30:10: Incompatible argument type for things: expected collections.abc.Iterable[./protocols_definition.py.SupportsClose] but got Literal[[1]] [incompatible_argument] @@ -28,5 +23,6 @@ output = """ ./protocols_definition.py:339:0: Incompatible assignment: expected ./protocols_definition.py.Template6, got ./protocols_definition.py.Concrete6_Bad1 [incompatible_assignment] ./protocols_definition.py:340:0: Incompatible assignment: expected ./protocols_definition.py.Template6, got ./protocols_definition.py.Concrete6_Bad2 [incompatible_assignment] ./protocols_definition.py:341:0: Incompatible assignment: expected ./protocols_definition.py.Template6, got ./protocols_definition.py.Concrete6_Bad3 [incompatible_assignment] +./protocols_definition.py:369:0: Incompatible assignment: expected ./protocols_definition.py.Template7, got ./protocols_definition.py.Concrete7_Bad1 [incompatible_assignment] ./protocols_definition.py:370:0: Incompatible assignment: expected ./protocols_definition.py.Template7, got ./protocols_definition.py.Concrete7_Bad2 [incompatible_assignment] """ diff --git a/conformance/results/pycroscope/protocols_generic.toml b/conformance/results/pycroscope/protocols_generic.toml index 9882a5578..be06306c6 100644 --- a/conformance/results/pycroscope/protocols_generic.toml +++ b/conformance/results/pycroscope/protocols_generic.toml @@ -1,15 +1,14 @@ conformant = "Partial" notes = """ -Fails to reject duplicate generic/protocol bases. Treats global object as a literal. """ conformance_automated = "Fail" errors_diff = """ -Line 44: Expected 1 errors Line 96: Unexpected errors ['./protocols_generic.py:96:12: Literal[] is not equivalent to protocols_generic.ConcreteHasParent'] """ output = """ ./protocols_generic.py:40:0: Incompatible assignment: expected protocols_generic.Proto1[int, str], got protocols_generic.Concrete1 [incompatible_assignment] +./protocols_generic.py:44:0: Protocol type parameter shorthand cannot be combined with Generic [invalid_base] ./protocols_generic.py:56:4: Incompatible assignment: expected protocols_generic.Box[int], got protocols_generic.Box[float | int] [incompatible_assignment] ./protocols_generic.py:66:4: Incompatible assignment: expected protocols_generic.Sender[float | int], got protocols_generic.Sender[int] [incompatible_assignment] ./protocols_generic.py:74:4: Incompatible assignment: expected protocols_generic.AttrProto[float | int], got protocols_generic.AttrProto[int] [incompatible_assignment] diff --git a/conformance/results/pycroscope/typeddicts_type_consistency.toml b/conformance/results/pycroscope/typeddicts_type_consistency.toml index cf2aaa072..06f5d3185 100644 --- a/conformance/results/pycroscope/typeddicts_type_consistency.toml +++ b/conformance/results/pycroscope/typeddicts_type_consistency.toml @@ -1,18 +1,14 @@ -conformant = "Partial" -notes = """ -Considers `TypedDict`s to be assignable to plain `dict` types. -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 76: Expected 1 errors -Line 78: Expected 1 errors -Line 82: Expected 1 errors """ output = """ ./typeddicts_type_consistency.py:21:0: Incompatible assignment: expected TypedDict({"x": int | None}), got TypedDict({"x": int}) [incompatible_assignment] ./typeddicts_type_consistency.py:38:0: Incompatible assignment: expected TypedDict({"x": NotRequired[int]}), got TypedDict({"x": int}) [incompatible_assignment] ./typeddicts_type_consistency.py:65:0: Incompatible assignment: expected TypedDict({"x": int, "y": int}), got TypedDict({"x": int}) [incompatible_assignment] ./typeddicts_type_consistency.py:69:0: Incompatible assignment: expected TypedDict({"x": int}), got Literal[{'x': 0, 'y': 0}] [incompatible_assignment] +./typeddicts_type_consistency.py:76:0: Incompatible assignment: expected dict[str, int], got TypedDict({"x": int, "y": int}) [incompatible_assignment] ./typeddicts_type_consistency.py:77:0: Incompatible assignment: expected dict[str, object], got TypedDict({"x": int, "y": int}) [incompatible_assignment] +./typeddicts_type_consistency.py:78:0: Incompatible assignment: expected dict[Any[explicit], Any[explicit]], got TypedDict({"x": int, "y": int}) [incompatible_assignment] +./typeddicts_type_consistency.py:82:0: Incompatible assignment: expected collections.abc.Mapping[str, int], got TypedDict({"x": int, "y": int}) [incompatible_assignment] ./typeddicts_type_consistency.py:126:0: Incompatible assignment: expected TypedDict({"outer_key": TypedDict({"inner_key": TypedDict({"inner_key": str})})}), got Literal[{'outer_key': {'inner_key': {'inner_key': 1}}}] [incompatible_assignment] """ diff --git a/conformance/results/pycroscope/version.toml b/conformance/results/pycroscope/version.toml index 8060c0669..e5d8a823f 100644 --- a/conformance/results/pycroscope/version.toml +++ b/conformance/results/pycroscope/version.toml @@ -1 +1 @@ -version = "pycroscope 0.4.0" +version = "pycroscope 0.5.0" diff --git a/conformance/results/results.html b/conformance/results/results.html index 0d37f6225..7915147fd 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -265,7 +265,7 @@

    Python Type System Conformance Test Results

    - + @@ -554,12 +554,7 @@

    Python Type System Conformance Test Results

  • Does not fully support defaults on TypeVarTuple and ParamSpec.
  • - + - + @@ -613,7 +603,7 @@

    Python Type System Conformance Test Results

    - + @@ -663,7 +653,7 @@

    Python Type System Conformance Test Results

    - + - + @@ -844,12 +829,7 @@

    Python Type System Conformance Test Results

  • Does not enforce that tuples captured by TypeVarTuple are same length.
  • - + - + - + @@ -1062,12 +1042,7 @@

    Python Type System Conformance Test Results

  • Does not reject use of ClassVar in TypeAlias definition.
  • - + @@ -1082,13 +1057,7 @@

    Python Type System Conformance Test Results

  • the incompatible constructor overrides in ChildC2 are not flagged.
  • - + - + @@ -1192,6 +1161,7 @@

    Python Type System Conformance Test Results

    Partial
    • Fails to reject various weird annotations.
    • +
    • Rejects a valid recursive generic type alias.
    @@ -1213,12 +1183,7 @@

    Python Type System Conformance Test Results

  • Incorrectly rejects the use of a class-scoped TypeVar in a TypeAliasType definition.
  • - + - + @@ -1355,12 +1320,7 @@

    Python Type System Conformance Test Results

  • Does not detect protocol mismatch if concrete method's parameters are position-only.
  • - + @@ -1392,7 +1352,6 @@

    Python Type System Conformance Test Results

    @@ -1507,7 +1466,7 @@

    Python Type System Conformance Test Results

    - + @@ -1529,12 +1488,7 @@

    Python Type System Conformance Test Results

  • Does not treat *args: Any, **kargs: Any as ... when separated by keyword parameter.
  • - + @@ -1557,12 +1511,7 @@

    Python Type System Conformance Test Results

    - + @@ -1571,12 +1520,7 @@

    Python Type System Conformance Test Results

    - + @@ -1585,7 +1529,7 @@

    Python Type System Conformance Test Results

    - + @@ -2197,12 +2141,7 @@

    Python Type System Conformance Test Results

    - + @@ -2220,7 +2159,7 @@

    Python Type System Conformance Test Results

    - + @@ -2296,12 +2235,7 @@

    Python Type System Conformance Test Results

  • Does not support version-conditional fields.
  • - + @@ -2342,7 +2276,7 @@

    Python Type System Conformance Test Results

    - + @@ -2367,12 +2301,7 @@

    Python Type System Conformance Test Results

    - + @@ -2453,7 +2382,7 @@

    Python Type System Conformance Test Results

    - + @@ -2537,12 +2466,7 @@

    Python Type System Conformance Test Results

    - + - + @@ -2684,7 +2608,7 @@

    Python Type System Conformance Test Results

    - + diff --git a/conformance/uv.lock b/conformance/uv.lock index f638ac45a..dcf5fc26d 100644 --- a/conformance/uv.lock +++ b/conformance/uv.lock @@ -148,15 +148,15 @@ wheels = [ [[package]] name = "pycroscope" -version = "0.4.0" +version = "0.5.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "typeshed-client" }, { name = "typing-extensions" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/7c/8e/284fdc4027bf9a7c92f8256ff07006a50456ccd2ce5506d040e6ed2f2f1b/pycroscope-0.4.0.tar.gz", hash = "sha256:14b40e36f6186dd2eff712c8da91d02eb89a263a257472b49f4c59153ff380fb", size = 662901, upload-time = "2026-05-02T14:00:43.775Z" } +sdist = { url = "https://files.pythonhosted.org/packages/9d/67/c5cb4c78c1f50f905902fb8f5ff7dcd5c321b75f1ee123354ae9f26b364f/pycroscope-0.5.0.tar.gz", hash = "sha256:573eb605f49b97e6ff5d85af115de0406b475a239d9cb3db00ccec2ef97a62ba", size = 696137, upload-time = "2026-08-27T18:13:38.707Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/50/5f/c172c08b69e29d4094e1466b63260d8daf61a3ed3c689de7936f952f1663/pycroscope-0.4.0-py3-none-any.whl", hash = "sha256:cb7440b44ed16ed927995c33867cab22503f4bff7efe504964b81fb967183223", size = 714256, upload-time = "2026-05-02T14:00:41.891Z" }, + { url = "https://files.pythonhosted.org/packages/4c/d1/873dac15d2a9f059b5dfb2fdae56d57378023f137d73d61bea5d085e0835/pycroscope-0.5.0-py3-none-any.whl", hash = "sha256:effc2fc347c2b6175bacdd5aad8e242392eba075d22832b441c0c6ecbc7f6517", size = 747967, upload-time = "2026-08-27T18:13:37.043Z" }, ] [[package]] From 1eada48c6fc354d3fe05524686f8b109cac2b8aa Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Wed, 2 Sep 2026 23:57:57 -0400 Subject: [PATCH 288/308] Update ty results for v0.0.78 (#2357) --- conformance/results/results.html | 62 ++++--------------- .../results/ty/aliases_type_statement.toml | 8 +-- .../results/ty/aliases_typealiastype.toml | 13 ++-- .../results/ty/directives_deprecated.toml | 22 +++---- .../ty/generics_paramspec_variance.toml | 10 +-- conformance/results/ty/generics_scoping.toml | 11 +--- .../results/ty/generics_type_erasure.toml | 14 ++--- .../ty/generics_typevartuple_variance.toml | 10 +-- conformance/results/ty/version.toml | 2 +- conformance/uv.lock | 38 ++++++------ 10 files changed, 61 insertions(+), 129 deletions(-) diff --git a/conformance/results/results.html b/conformance/results/results.html index 7915147fd..c15076c46 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -268,7 +268,7 @@

    Python Type System Conformance Test Results

    - + @@ -656,12 +656,7 @@

    Python Type System Conformance Test Results

    - + @@ -670,13 +665,7 @@

    Python Type System Conformance Test Results

    - + @@ -794,12 +783,7 @@

    Python Type System Conformance Test Results

    - + @@ -897,12 +881,7 @@

    Python Type System Conformance Test Results

    - + @@ -955,7 +934,7 @@

    Python Type System Conformance Test Results

    - + @@ -1166,12 +1145,7 @@

    Python Type System Conformance Test Results

    - + @@ -1186,12 +1160,7 @@

    Python Type System Conformance Test Results

    - + @@ -1209,7 +1178,7 @@

    Python Type System Conformance Test Results

    - + @@ -2453,14 +2422,7 @@

    Python Type System Conformance Test Results

    - + @@ -2568,7 +2530,7 @@

    Python Type System Conformance Test Results

    - + @@ -2611,7 +2573,7 @@

    Python Type System Conformance Test Results

    - + diff --git a/conformance/results/ty/aliases_type_statement.toml b/conformance/results/ty/aliases_type_statement.toml index c317800bb..3619276a9 100644 --- a/conformance/results/ty/aliases_type_statement.toml +++ b/conformance/results/ty/aliases_type_statement.toml @@ -1,10 +1,5 @@ -conformance_automated = "Fail" -conformant = "Partial" -notes = """ -Does not reject a generic type alias that recursively specializes itself with different type arguments. -""" +conformance_automated = "Pass" errors_diff = """ -Line 75: Expected 1 errors """ output = """ aliases_type_statement.py:17:1: error[unresolved-attribute] Object of type `TypeAliasType` has no attribute `bit_count` @@ -30,6 +25,7 @@ aliases_type_statement.py:58:17: error[unbound-type-variable] Type variable `T1` aliases_type_statement.py:68:27: error[invalid-type-arguments] Type `str` is not assignable to upper bound `int` of type variable `S@RecursiveTypeAlias2` aliases_type_statement.py:70:32: error[invalid-type-arguments] Type `int` is not assignable to upper bound `str` of type variable `T@RecursiveTypeAlias2` aliases_type_statement.py:73:1: error[cyclic-type-alias-definition] Cyclic definition of `RecursiveTypeAlias3` +aliases_type_statement.py:75:1: error[cyclic-type-alias-definition] Cyclic definition of `RecursiveTypeAlias4` aliases_type_statement.py:79:1: error[cyclic-type-alias-definition] Cyclic definition of `RecursiveTypeAlias6` aliases_type_statement.py:80:1: error[cyclic-type-alias-definition] Cyclic definition of `RecursiveTypeAlias7` """ diff --git a/conformance/results/ty/aliases_typealiastype.toml b/conformance/results/ty/aliases_typealiastype.toml index 672ec33f6..702b5e90a 100644 --- a/conformance/results/ty/aliases_typealiastype.toml +++ b/conformance/results/ty/aliases_typealiastype.toml @@ -1,12 +1,5 @@ -conformance_automated = "Fail" -conformant = "Partial" -notes = """ -Does not reject cyclically defined `TypeAliasType` aliases. -""" +conformance_automated = "Pass" errors_diff = """ -Line 46: Expected 1 errors -Line 47: Expected 1 errors -Line 48: Expected 1 errors """ output = """ aliases_typealiastype.py:32:7: error[unresolved-attribute] Object of type `TypeAliasType` has no attribute `other_attrib` @@ -14,6 +7,10 @@ aliases_typealiastype.py:40:21: error[invalid-type-arguments] Type `int` is not aliases_typealiastype.py:43:40: error[invalid-type-alias-type] Type parameter `S` used in the alias value must be included in `type_params` aliases_typealiastype.py:44:40: error[invalid-type-alias-type] Type parameter `S` used in the alias value must be included in `type_params` aliases_typealiastype.py:45:57: error[invalid-type-alias-type] The `type_params` argument to `TypeAliasType` must be a tuple literal +aliases_typealiastype.py:46:40: error[cyclic-type-alias-definition] Cyclic definition of `BadAlias4` +aliases_typealiastype.py:47:40: error[cyclic-type-alias-definition] Cyclic definition of `BadAlias5` +aliases_typealiastype.py:48:40: error[cyclic-type-alias-definition] Cyclic definition of `BadAlias6` +aliases_typealiastype.py:49:40: error[cyclic-type-alias-definition] Cyclic definition of `BadAlias7` aliases_typealiastype.py:52:40: error[invalid-type-form] Function calls are not allowed in type expressions aliases_typealiastype.py:53:40: error[invalid-type-form] List literals are not allowed in this context in a type expression aliases_typealiastype.py:54:42: error[invalid-type-form] Tuple literals are not allowed in this context in a type expression diff --git a/conformance/results/ty/directives_deprecated.toml b/conformance/results/ty/directives_deprecated.toml index 45177b364..501efb1e3 100644 --- a/conformance/results/ty/directives_deprecated.toml +++ b/conformance/results/ty/directives_deprecated.toml @@ -1,24 +1,18 @@ -conformance_automated = "Fail" -conformant = "Partial" -notes = """ -Does not detect calls to deprecated overloads. -Does not detect implicit calls to deprecated dunder methods, for example via operators. -Does not detect accesses of, or attempts to set, deprecated properties. -""" +conformance_automated = "Pass" errors_diff = """ -Line 30: Expected 1 errors -Line 41: Expected 1 errors -Line 42: Expected 1 errors -Line 44: Expected 1 errors -Line 47: Expected 1 errors -Line 48: Expected 1 errors -Line 58: Expected 1 errors """ output = """ directives_deprecated.py:18:44: error[deprecated] The class `Ham` is deprecated: Use Spam instead directives_deprecated.py:24:9: error[deprecated] The function `norwegian_blue` is deprecated: It is pining for the fjords directives_deprecated.py:25:13: error[deprecated] The function `norwegian_blue` is deprecated: It is pining for the fjords +directives_deprecated.py:30:1: error[deprecated] The overload of `foo` is deprecated: Only str will be allowed directives_deprecated.py:34:7: error[deprecated] The class `Ham` is deprecated: Use Spam instead +directives_deprecated.py:41:5: error[deprecated] The function `__add__` is deprecated: There is enough spam in the world +directives_deprecated.py:42:1: error[deprecated] The function `__add__` is deprecated: There is enough spam in the world +directives_deprecated.py:44:6: error[deprecated] The function `greasy` is deprecated: All spam will be equally greasy +directives_deprecated.py:47:6: error[deprecated] The function `shape` is deprecated: Shapes are becoming immutable +directives_deprecated.py:48:6: error[deprecated] The function `shape` is deprecated: Shapes are becoming immutable +directives_deprecated.py:58:1: error[deprecated] The function `__call__` is deprecated: Deprecated directives_deprecated.py:69:1: error[deprecated] The function `lorem` is deprecated: Deprecated directives_deprecated.py:98:7: error[deprecated] The function `foo` is deprecated: Deprecated """ diff --git a/conformance/results/ty/generics_paramspec_variance.toml b/conformance/results/ty/generics_paramspec_variance.toml index ea6750cbf..6abc5f5b4 100644 --- a/conformance/results/ty/generics_paramspec_variance.toml +++ b/conformance/results/ty/generics_paramspec_variance.toml @@ -1,11 +1,5 @@ -conformant = "Partial" -notes = """ -Does not error when a ParamSpec is used in a position that violates its explicit variance. -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 117: Expected 1 errors -Line 126: Expected 1 errors """ output = """ generics_paramspec_variance.py:14:42: error[invalid-assignment] Object of type `InvariantParamSpec[(int, /)]` is not assignable to `InvariantParamSpec[(object, /)]` @@ -24,7 +18,9 @@ generics_paramspec_variance.py:101:9: error[invalid-paramspec] A `ParamSpec` can generics_paramspec_variance.py:102:9: error[invalid-paramspec] A `ParamSpec` cannot specify variance when `infer_variance=True` generics_paramspec_variance.py:110:14: error[invalid-assignment] Object of type `InvariantParamSpecOld[(bool, /)]` is not assignable to `InvariantParamSpecOld[(int, /)]` generics_paramspec_variance.py:111:14: error[invalid-assignment] Object of type `InvariantParamSpecOld[(object, /)]` is not assignable to `InvariantParamSpecOld[(int, /)]` +generics_paramspec_variance.py:117:25: error[invalid-generic-class] Variance of type variable `InP` is incompatible with method `out_f` generics_paramspec_variance.py:121:49: error[invalid-assignment] Object of type `ContravariantParamSpecOld[(int, /)]` is not assignable to `ContravariantParamSpecOld[(object, /)]` +generics_paramspec_variance.py:126:23: error[invalid-generic-class] Variance of type variable `OutP` is incompatible with method `in_f` generics_paramspec_variance.py:132:43: error[invalid-assignment] Object of type `CovariantParamSpecOld[(object, /)]` is not assignable to `CovariantParamSpecOld[(int, /)]` generics_paramspec_variance.py:142:63: error[invalid-assignment] Object of type `InferredContravariantParamSpecOld[(int, /)]` is not assignable to `InferredContravariantParamSpecOld[(object, /)]` generics_paramspec_variance.py:151:57: error[invalid-assignment] Object of type `InferredCovariantParamSpecOld[(object, /)]` is not assignable to `InferredCovariantParamSpecOld[(int, /)]` diff --git a/conformance/results/ty/generics_scoping.toml b/conformance/results/ty/generics_scoping.toml index 330fcd0a8..996b0dca3 100644 --- a/conformance/results/ty/generics_scoping.toml +++ b/conformance/results/ty/generics_scoping.toml @@ -1,12 +1,5 @@ -conformance_automated = "Fail" -conformant = "Partial" -notes = """ -Does not reject `list[T]()` in the global scope, where `T` is an unbound type variable. -Does not reject `alias: TypeAlias = list[T]` in the body scope of a class generic over a type variable `T`. -""" +conformance_automated = "Pass" errors_diff = """ -Line 98: Expected 1 errors -Line 107: Expected 1 errors """ output = """ generics_scoping.py:15:1: error[type-assertion-failure] Type `Literal[1]` does not match asserted type `int` @@ -20,6 +13,8 @@ generics_scoping.py:76:11: error[shadowed-type-variable] Generic class `MyGeneri generics_scoping.py:76:11: error[shadowed-type-variable] Generic class `MyGeneric` uses type variable `T` already bound by an enclosing scope generics_scoping.py:86:11: error[shadowed-type-variable] Generic class `Bad` uses type variable `T` already bound by an enclosing scope generics_scoping.py:89:17: error[unbound-type-variable] Type variable `T` is not bound to any outer generic context +generics_scoping.py:98:29: error[invalid-type-form] Type alias cannot capture class-scoped type variable `T` generics_scoping.py:105:14: error[unbound-type-variable] Type variable `T` is not bound to any outer generic context generics_scoping.py:106:19: error[unbound-type-variable] Type variable `T` is not bound to any outer generic context +generics_scoping.py:107:6: error[unbound-type-variable] Type variable `T` is not bound to any outer generic context """ diff --git a/conformance/results/ty/generics_type_erasure.toml b/conformance/results/ty/generics_type_erasure.toml index 0348dcfd2..2d4625c5b 100644 --- a/conformance/results/ty/generics_type_erasure.toml +++ b/conformance/results/ty/generics_type_erasure.toml @@ -1,15 +1,11 @@ -conformance_automated = "Fail" -conformant = "Partial" -notes = """ -Does not reject access of generic instance variable from the class object. -""" +conformance_automated = "Pass" errors_diff = """ -Line 42: Expected 1 errors -Line 43: Expected 1 errors -Line 44: Expected 1 errors -Line 45: Expected 1 errors """ output = """ generics_type_erasure.py:38:16: error[invalid-argument-type] Argument to `Node.__init__` is incorrect: Expected `int | None`, found `Literal[""]` generics_type_erasure.py:40:16: error[invalid-argument-type] Argument to `Node.__init__` is incorrect: Expected `str | None`, found `Literal[0]` +generics_type_erasure.py:42:1: error[invalid-attribute-access] Cannot access generic instance attribute `label` through a class +generics_type_erasure.py:43:1: error[invalid-attribute-access] Cannot access generic instance attribute `label` through a class +generics_type_erasure.py:44:1: error[invalid-attribute-access] Cannot access generic instance attribute `label` through a class +generics_type_erasure.py:45:1: error[invalid-attribute-access] Cannot access generic instance attribute `label` through a class """ diff --git a/conformance/results/ty/generics_typevartuple_variance.toml b/conformance/results/ty/generics_typevartuple_variance.toml index a09b5fa8e..51e215aa0 100644 --- a/conformance/results/ty/generics_typevartuple_variance.toml +++ b/conformance/results/ty/generics_typevartuple_variance.toml @@ -1,11 +1,5 @@ -conformant = "Partial" -conformance_automated = "Fail" -notes = """ -Does not error when a TypeVarTuple is used in a position that violates its explicit variance. -""" +conformance_automated = "Pass" errors_diff = """ -Line 79: Expected 1 errors -Line 90: Expected 1 errors """ output = """ generics_typevartuple_variance.py:14:45: error[invalid-assignment] Object of type `InvariantTypeVarTuple[int]` is not assignable to `InvariantTypeVarTuple[object]` @@ -28,7 +22,9 @@ generics_typevartuple_variance.py:57:10: error[invalid-legacy-type-variable] A ` generics_typevartuple_variance.py:58:10: error[invalid-legacy-type-variable] A `TypeVarTuple` cannot specify variance when `infer_variance=True` generics_typevartuple_variance.py:68:45: error[invalid-assignment] Object of type `InvariantTypeVarTupleOld[int]` is not assignable to `InvariantTypeVarTupleOld[object]` generics_typevartuple_variance.py:69:42: error[invalid-assignment] Object of type `InvariantTypeVarTupleOld[object]` is not assignable to `InvariantTypeVarTupleOld[int]` +generics_typevartuple_variance.py:79:24: error[invalid-generic-class] Variance of type variable `InTs` is incompatible with method `out_f` generics_typevartuple_variance.py:83:52: error[invalid-assignment] Object of type `ContravariantTypeVarTupleOld[int]` is not assignable to `ContravariantTypeVarTupleOld[object]` +generics_typevartuple_variance.py:90:27: error[invalid-generic-class] Variance of type variable `OutTs` is incompatible with method `in_f` generics_typevartuple_variance.py:97:46: error[invalid-assignment] Object of type `CovariantTypeVarTupleOld[object]` is not assignable to `CovariantTypeVarTupleOld[int]` generics_typevartuple_variance.py:107:66: error[invalid-assignment] Object of type `InferredContravariantTypeVarTupleOld[int]` is not assignable to `InferredContravariantTypeVarTupleOld[object]` generics_typevartuple_variance.py:116:60: error[invalid-assignment] Object of type `InferredCovariantTypeVarTupleOld[object]` is not assignable to `InferredCovariantTypeVarTupleOld[int]` diff --git a/conformance/results/ty/version.toml b/conformance/results/ty/version.toml index 7d9601eff..db3be9a74 100644 --- a/conformance/results/ty/version.toml +++ b/conformance/results/ty/version.toml @@ -1 +1 @@ -version = "ty 0.0.75" +version = "ty 0.0.78" diff --git a/conformance/uv.lock b/conformance/uv.lock index dcf5fc26d..911eebdf6 100644 --- a/conformance/uv.lock +++ b/conformance/uv.lock @@ -202,27 +202,27 @@ wheels = [ [[package]] name = "ty" -version = "0.0.75" +version = "0.0.78" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/81/d0/d0c96f898d6974a4a3569ab3efdf9512c04ad99f9203effb55f72497fe97/ty-0.0.75.tar.gz", hash = "sha256:4c5eead33dfbf6e2ebb4f400f74b51ffc9bab702a6f23ddb648a1cbb740387e3", size = 6868326, upload-time = "2026-08-26T20:23:40.399Z" } +sdist = { url = "https://files.pythonhosted.org/packages/d8/c7/2ba0861384c5b5097ac354383abb98188112cb330208c21d5197e98a29e5/ty-0.0.78.tar.gz", hash = "sha256:770b45854f85fa11595208f08c0f28df80943164d10a2832d86be6ac29f135b2", size = 7050609, upload-time = "2026-09-02T22:41:33.92Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/cb/6c/b12d03505f17581f0cfa3c12273fe34c1d67b36dfda1bc561a6bdc16512b/ty-0.0.75-py3-none-linux_armv6l.whl", hash = "sha256:e5409f50db2246fd4bd039d93d261e0cfa1daa554a4fb77256f91072c570349a", size = 12972606, upload-time = "2026-08-26T20:22:59.716Z" }, - { url = "https://files.pythonhosted.org/packages/d1/aa/30f11eecd9215a9f87e8fe8baaf48f3ce905f5d75b8e4aac70f0091f130c/ty-0.0.75-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:5e7b8b3472fb9bb2eeab314984b265df08a7a9d518867a9e6020eebc06570be2", size = 12527158, upload-time = "2026-08-26T20:23:02.767Z" }, - { url = "https://files.pythonhosted.org/packages/f2/11/7fd7001b0b5c6610bfbad7357e47d5fe6f82d4e84e94c53776a478f5e9f8/ty-0.0.75-py3-none-macosx_11_0_arm64.whl", hash = "sha256:c6ccf34169821fe0d23e3360deeef981d217963412f1d087b9bdd32ec57f7a57", size = 12400533, upload-time = "2026-08-26T20:23:04.965Z" }, - { url = "https://files.pythonhosted.org/packages/fd/7f/1e284ea3d348d7be02f12d83bc22ed9ef193033f863f05b64db99027f141/ty-0.0.75-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:842ebb41e9c6c334b40768704e20b1a69d5c6b08805b289d5e0e2565f49f2de1", size = 12420592, upload-time = "2026-08-26T20:23:07.427Z" }, - { url = "https://files.pythonhosted.org/packages/2d/ab/d813271543370c47fd74b5118f2066ab32b0983e907b1821f3f9a6d0fa7f/ty-0.0.75-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:cf7a5a723c5f1e0fab4ffbfe9bd95123a526ed48f206e5f25cb2161ca294007a", size = 12739219, upload-time = "2026-08-26T20:23:09.809Z" }, - { url = "https://files.pythonhosted.org/packages/31/5b/95b49cc5570fd92a7bf63732f649b31906158721e03c7fcb1b5be74ee3bf/ty-0.0.75-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:54382f98e5da292fcd7104391afef5105c35bb2f312e29bea6f5fa419935255c", size = 13494046, upload-time = "2026-08-26T20:23:12.191Z" }, - { url = "https://files.pythonhosted.org/packages/2c/0d/502d2dd68173cf020e1ad2bdbab9544c86776de0b0e2ed15f8c2fe006e3d/ty-0.0.75-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ac13b180dc2aade2cd243f56b01650e78bf091a2e522ad3bc947245d7837c613", size = 13938899, upload-time = "2026-08-26T20:23:14.764Z" }, - { url = "https://files.pythonhosted.org/packages/20/5b/f3b12a25c07224456219fc2bd20db0ad7e40b304be0ff6aad728da0135f9/ty-0.0.75-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:752df7951a443219d7f1ff817e3723c85d428565ff449e08a7a93ba821661526", size = 13656711, upload-time = "2026-08-26T20:23:17.145Z" }, - { url = "https://files.pythonhosted.org/packages/51/7b/f090ad306e2b15a07b332d647138c5264b89d9758855ecce8b8a10bcb153/ty-0.0.75-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1fd399feedf7cee816563c1baec45fc1c0b3c89f1ea42364920b688004b5b7da", size = 13093499, upload-time = "2026-08-26T20:23:19.489Z" }, - { url = "https://files.pythonhosted.org/packages/f1/4b/f69b99aaaca0c7c65d5f114b186b26b21666f767b0c69eec99a2bdccc061/ty-0.0.75-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:d7625f6f56c7dc1e873579fdc9e432a0e21e302afe847ab60704d2303442a92e", size = 13520580, upload-time = "2026-08-26T20:23:21.789Z" }, - { url = "https://files.pythonhosted.org/packages/b6/e7/692c5f905c0345a15d2255fc74066d660f030254ae8dcdaf33f5a5c2f279/ty-0.0.75-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:89e7d527e95a2534b70cae29e94c104b84082760ea05927d23bb87280969c104", size = 12524095, upload-time = "2026-08-26T20:23:24.026Z" }, - { url = "https://files.pythonhosted.org/packages/ba/9a/f42b12cf265ea95344bf554764c4791cfb273bdd628aadd7c209af7cadc3/ty-0.0.75-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:0843f134440740706e01bee5f88f4cfc10e9b018bddb9e4ef4c12dc9fc0c9aef", size = 12756591, upload-time = "2026-08-26T20:23:26.126Z" }, - { url = "https://files.pythonhosted.org/packages/7c/5e/9b180c133cb9cce48179a7d2bf9e1802d992aa8176a918e0e05205760b42/ty-0.0.75-py3-none-musllinux_1_2_i686.whl", hash = "sha256:1bd0ec0e50ee1376875c88891efe6f549c3560fa5b2ddad79a425cd5a6218b9c", size = 12998754, upload-time = "2026-08-26T20:23:28.353Z" }, - { url = "https://files.pythonhosted.org/packages/39/f6/3c6ef5dd550103e29905121c67fb96a374564f31a2f44c6faa1af98c2d61/ty-0.0.75-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:1f9eafd561f90110d5e29f589ec3e956c4686e2f6631348d99276436f5cbe4d1", size = 13316474, upload-time = "2026-08-26T20:23:30.857Z" }, - { url = "https://files.pythonhosted.org/packages/bb/52/12776337874c821076bd5368e352ccd9e67174790abe3b856f749cb3524b/ty-0.0.75-py3-none-win32.whl", hash = "sha256:05063a6fafe2154b794a7f964515d148e51acd186d72d4a3acd347ee9fa19336", size = 12316315, upload-time = "2026-08-26T20:23:33.528Z" }, - { url = "https://files.pythonhosted.org/packages/53/e6/bb51e16af5c7138c9f52f8f3d0a401a371c6798d092e3b74926f186a9814/ty-0.0.75-py3-none-win_amd64.whl", hash = "sha256:81cf1ba5f6b7536ad56747865214255d9bc8e80533a689dbb9ddeaad464b09f1", size = 12917267, upload-time = "2026-08-26T20:23:35.978Z" }, - { url = "https://files.pythonhosted.org/packages/39/73/4542f829107468b5de4231af67f29927c093bfad11f3c1e5b2c08fb1206b/ty-0.0.75-py3-none-win_arm64.whl", hash = "sha256:541c9af5b7a0ad23d15ec315a7da81150833c359f48124ed3789ff25eacd6f42", size = 12711024, upload-time = "2026-08-26T20:23:38.159Z" }, + { url = "https://files.pythonhosted.org/packages/ea/ed/f34cfc06a9ba72979df219e48dae1a0b6a6c74a340763ccd30a547edf913/ty-0.0.78-py3-none-linux_armv6l.whl", hash = "sha256:122700b98f9d45785c1ce91a9418154562e7f64f4bf34679f6f7b38c5b97453f", size = 13304624, upload-time = "2026-09-02T22:40:56.649Z" }, + { url = "https://files.pythonhosted.org/packages/1c/28/5576e2a08b57676d9b2a736d528f077a6c6e32c3d1de2d75dbbe28346966/ty-0.0.78-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:cbe7e3709ccf29ef3d9f58f5914cc30ec36fb647008a5a4ff8483abe401bfe8d", size = 12928383, upload-time = "2026-09-02T22:40:59.162Z" }, + { url = "https://files.pythonhosted.org/packages/8e/e0/027d49c3da5235e634da3d3fc52c4874ec89f50830388c9c259f8fb71e0e/ty-0.0.78-py3-none-macosx_11_0_arm64.whl", hash = "sha256:c3528897b3ab9d3589561bc2b5e61a4d5d686de527a4400bb09a439b922a6c70", size = 12730058, upload-time = "2026-09-02T22:41:01.235Z" }, + { url = "https://files.pythonhosted.org/packages/bb/bc/6bf8ffefd8063730a70ae889cf85def72bc155fd1453135ebf8a09c2f1c2/ty-0.0.78-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8bfba4c44a06484093f527b8ef43a317abcf91395b49396170266629eedf74aa", size = 12813321, upload-time = "2026-09-02T22:41:03.251Z" }, + { url = "https://files.pythonhosted.org/packages/6d/c0/b3cdf26f82108908d92fdb7ddb741019c446ceb666cf204d4dbf611bde33/ty-0.0.78-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:5f903c06fdee17baf8373173039ab28f1bce28e66b1c734929a5f50b37eb54d9", size = 13072219, upload-time = "2026-09-02T22:41:05.225Z" }, + { url = "https://files.pythonhosted.org/packages/4d/36/16bfb0abdd178dae11dbc4b57b9a86c2b62642a18c1103fd2c2930aa5879/ty-0.0.78-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:dd83e5fe3f07291d1bd4e591f8d2607c204f3eab53bcb1b8060c40e876e1aa61", size = 13903958, upload-time = "2026-09-02T22:41:07.333Z" }, + { url = "https://files.pythonhosted.org/packages/0f/0c/74d3b1f0344b13156c719dd68a7edf7e48c2051718c9f326ba3cbf45ea53/ty-0.0.78-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:325285377319cf7168a2b8b771ae5027f411530e3c7eab1faf4583cdd72fd7c9", size = 14355581, upload-time = "2026-09-02T22:41:09.56Z" }, + { url = "https://files.pythonhosted.org/packages/8d/d7/7ca0359e1e61b15b8b02328c8d120db3c507876b9b7c6bd9f26935353e0e/ty-0.0.78-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:54b7846a404da6492697b524a769755ee9bee157d67674063ecd9c5f69dc52ff", size = 14044749, upload-time = "2026-09-02T22:41:11.678Z" }, + { url = "https://files.pythonhosted.org/packages/3b/6a/731f16ff42c5fc96e742c2f4e0a6915356bae114ae02ae4af6f33502175f/ty-0.0.78-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:169d3b9d134c0b48fe1af8a844142d374655552054a9d6c15a4b6e51bb0382ea", size = 13391647, upload-time = "2026-09-02T22:41:13.928Z" }, + { url = "https://files.pythonhosted.org/packages/0c/af/250cc29daf310e837188509ea4d78460c495d8a74c4fb84b4152d9ef2d4f/ty-0.0.78-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:6108cb3b2d28dac5981d4e25008a0a5547d8c877a67f6da9e8c38e7e946be44f", size = 13945020, upload-time = "2026-09-02T22:41:15.968Z" }, + { url = "https://files.pythonhosted.org/packages/b8/f9/96aab1dee4535e66554e8dc7657c69f6c61c181d8e70b9c3527908e93ef4/ty-0.0.78-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:589ad03608d9d2975ef4b23c41c4f847e325bcc7686f51d4c66066b8dbc18a2a", size = 12851149, upload-time = "2026-09-02T22:41:18.06Z" }, + { url = "https://files.pythonhosted.org/packages/85/b0/53d8fe9a847534ef5fe2165c7d5292cb853b29dfd7011cbfb1cdb90a8012/ty-0.0.78-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:b3fa0786edc1af06030f872d83499c0cea7c261dbbb651e0aee8306bf2c8a869", size = 13091464, upload-time = "2026-09-02T22:41:20.227Z" }, + { url = "https://files.pythonhosted.org/packages/21/65/94a4e5a02de559f6c6c0ee7a14b88660b4eee058ec6fec5c0ff6ecfbf5cc/ty-0.0.78-py3-none-musllinux_1_2_i686.whl", hash = "sha256:92c5639befc577578c8abd4e5a7fccf98d828db98b09e8d4dd81605dc0e54aef", size = 13389389, upload-time = "2026-09-02T22:41:22.27Z" }, + { url = "https://files.pythonhosted.org/packages/2e/b6/d0c7fe6be64ca5a15100c4b1f0e39c19660d53bc544f609fa117b346e661/ty-0.0.78-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:0dce70bc51652b2775debd1d1e422fb0179f5207c73deb4d5d0aca37e5f61695", size = 13691928, upload-time = "2026-09-02T22:41:24.292Z" }, + { url = "https://files.pythonhosted.org/packages/0a/5d/36081205611ba3fa802efc4ad63e4b1e949bda2f7bb37b34ac9bb6c00db0/ty-0.0.78-py3-none-win32.whl", hash = "sha256:1c80976ca9185d7a9d1baab1fb57240331b8dac58d3b11e46200284086a6de8d", size = 12647346, upload-time = "2026-09-02T22:41:26.699Z" }, + { url = "https://files.pythonhosted.org/packages/f1/89/b925fe1ea1bc56fc7f11d2496e29072fdd2ceb7b389884fc7b2d07cf0c41/ty-0.0.78-py3-none-win_amd64.whl", hash = "sha256:32e82b704471eab34f67b51c151660ca8a00815977b28278905d76fba54f7415", size = 13241810, upload-time = "2026-09-02T22:41:28.857Z" }, + { url = "https://files.pythonhosted.org/packages/91/f1/090ef7b52355bcedfbfbff6ce70fa81ba5bd5f6ed3f8d99ae05e6f2fe75b/ty-0.0.78-py3-none-win_arm64.whl", hash = "sha256:3a14d641a3c04fa9a80f2a46be1531d915f60d4fb79d4b894627bbe46bb35d64", size = 13077433, upload-time = "2026-09-02T22:41:31.525Z" }, ] [[package]] From 7eff3311191bf6cf6f33aeba192f4cbe88d3d2a1 Mon Sep 17 00:00:00 2001 From: Carl Meyer Date: Thu, 3 Sep 2026 19:11:41 -0700 Subject: [PATCH 289/308] Allow non-Any gradual return types for ambiguous overloads (#2350) Allow gradual return types for ambiguous overloads --- .../results/mypy/overloads_evaluation.toml | 11 ++------ .../results/pyright/overloads_evaluation.toml | 9 ++++-- conformance/results/results.html | 3 +- conformance/tests/overloads_evaluation.py | 28 +++++++++++++++++-- docs/spec/overload.rst | 13 +++++++-- 5 files changed, 45 insertions(+), 19 deletions(-) diff --git a/conformance/results/mypy/overloads_evaluation.toml b/conformance/results/mypy/overloads_evaluation.toml index 61c5af6a8..2c9c60487 100644 --- a/conformance/results/mypy/overloads_evaluation.toml +++ b/conformance/results/mypy/overloads_evaluation.toml @@ -3,7 +3,6 @@ notes = """ Does not expand boolean arguments to `Literal[True]` and `Literal[False]`. Does not expand enum arguments to literal variants. Does not expand tuple arguments to possible combinations. -Does not evaluate `Any` in some cases where overload is ambiguous. Evaluates `Any` in some cases where overload is not ambiguous. """ conformance_automated = "Fail" @@ -14,10 +13,7 @@ Line 161: Unexpected errors ['overloads_evaluation.py:161: error: No overload va Line 162: Unexpected errors ['overloads_evaluation.py:162: error: Expression is of type "Any", not "Literal[0, 1]" [assert-type]'] Line 205: Unexpected errors ['overloads_evaluation.py:205: error: Argument 1 to "expand_tuple" has incompatible type "tuple[int, int | str]"; expected "tuple[int, int]" [arg-type]'] Line 206: Unexpected errors ['overloads_evaluation.py:206: error: Expression is of type "int", not "int | str" [assert-type]'] -Line 265: Unexpected errors ['overloads_evaluation.py:265: error: Expression is of type "list[Any]", not "Any" [assert-type]'] -Line 281: Unexpected errors ['overloads_evaluation.py:281: error: Expression is of type "list[Any]", not "Any" [assert-type]'] -Line 303: Unexpected errors ['overloads_evaluation.py:303: error: Expression is of type "Any", not "float" [assert-type]'] -Line 347: Unexpected errors ['overloads_evaluation.py:347: error: Expression is of type "list[Any]", not "Any" [assert-type]'] +Line 312: Unexpected errors ['overloads_evaluation.py:312: error: Expression is of type "Any", not "float" [assert-type]'] """ output = """ overloads_evaluation.py:38: error: All overload variants of "example1_1" require at least one argument [call-overload] @@ -46,8 +42,5 @@ overloads_evaluation.py:161: note: def expand_enum(x: Literal[Color.BLUE]) - overloads_evaluation.py:162: error: Expression is of type "Any", not "Literal[0, 1]" [assert-type] overloads_evaluation.py:205: error: Argument 1 to "expand_tuple" has incompatible type "tuple[int, int | str]"; expected "tuple[int, int]" [arg-type] overloads_evaluation.py:206: error: Expression is of type "int", not "int | str" [assert-type] -overloads_evaluation.py:265: error: Expression is of type "list[Any]", not "Any" [assert-type] -overloads_evaluation.py:281: error: Expression is of type "list[Any]", not "Any" [assert-type] -overloads_evaluation.py:303: error: Expression is of type "Any", not "float" [assert-type] -overloads_evaluation.py:347: error: Expression is of type "list[Any]", not "Any" [assert-type] +overloads_evaluation.py:312: error: Expression is of type "Any", not "float" [assert-type] """ diff --git a/conformance/results/pyright/overloads_evaluation.toml b/conformance/results/pyright/overloads_evaluation.toml index cb63679bf..58c20bfe5 100644 --- a/conformance/results/pyright/overloads_evaluation.toml +++ b/conformance/results/pyright/overloads_evaluation.toml @@ -1,10 +1,10 @@ conformant = "Partial" notes = """ -Does not evaluate `Any` in some cases where overload is ambiguous. +Infers `list[int]` for ambiguous overloads with `list[Any]` arguments, rejecting use as `list[str]`. """ conformance_automated = "Fail" errors_diff = """ -Line 281: Unexpected errors ['overloads_evaluation.py:281:17 - error: "assert_type" mismatch: expected "Any" but received "list[int]" (reportAssertTypeFailure)'] +Line 290: Unexpected errors ['overloads_evaluation.py:290:27 - error: Type "list[int]" is not assignable to declared type "list[str]"'] """ output = """ overloads_evaluation.py:38:1 - error: No overloads for "example1_1" match the provided arguments @@ -20,5 +20,8 @@ overloads_evaluation.py:116:14 - error: Argument of type "int | str" cannot be a overloads_evaluation.py:116:17 - error: Argument of type "int | str" cannot be assigned to parameter "y" of type "int" in function "example2"   Type "int | str" is not assignable to type "int"     "str" is not assignable to "int" (reportArgumentType) -overloads_evaluation.py:281:17 - error: "assert_type" mismatch: expected "Any" but received "list[int]" (reportAssertTypeFailure) +overloads_evaluation.py:290:27 - error: Type "list[int]" is not assignable to declared type "list[str]" +  "list[int]" is not assignable to "list[str]" +    Type parameter "_T@list" is invariant, but "int" is not the same as "str" +    Consider switching from "list" to "Sequence" which is covariant (reportAssignmentType) """ diff --git a/conformance/results/results.html b/conformance/results/results.html index c15076c46..9ec07bb1c 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -1694,7 +1694,6 @@

    Python Type System Conformance Test Results

  • Does not expand boolean arguments to Literal[True] and Literal[False].
  • Does not expand enum arguments to literal variants.
  • Does not expand tuple arguments to possible combinations.
  • -
  • Does not evaluate Any in some cases where overload is ambiguous.
  • Evaluates Any in some cases where overload is not ambiguous.
  • @@ -1703,7 +1702,7 @@

    Python Type System Conformance Test Results

    diff --git a/conformance/tests/overloads_evaluation.py b/conformance/tests/overloads_evaluation.py index c89f9d0ba..d9ba88d56 100644 --- a/conformance/tests/overloads_evaluation.py +++ b/conformance/tests/overloads_evaluation.py @@ -239,6 +239,12 @@ def check_variadic(v: list[int]) -> None: # > :term:`materializations ` of the argument's type are assignable to # > the corresponding parameter type for each of the remaining overloads. If so, # > eliminate all of the subsequent remaining overloads. +# > +# > If the return types are not equivalent, overload matching is ambiguous. In +# > this case, infer a return type that is :term:`assignable` to each of the +# > remaining return types and permits operations supported by any of them without +# > errors, then stop. A type checker may infer ``Any`` or a more precise gradual +# > type that satisfies these requirements. @overload @@ -262,7 +268,8 @@ def check_example4(v1: list[Any], v2: Any) -> None: assert_type(ret1, list[int]) ret2 = example4(v2, 1) - assert_type(ret2, Any) + int_list: list[int] = ret2 + str_list: list[str] = ret2 @overload @@ -278,7 +285,9 @@ def example5(obj: Any) -> list[Any]: def check_example5(b: list[Any]) -> None: - assert_type(example5(b), Any) + ret = example5(b) + int_list: list[int] = ret + str_list: list[str] = ret @overload @@ -344,4 +353,17 @@ def check_example7(v1: list[Any], v2: Any) -> None: assert_type(ret2, list[str]) ret3 = example7(v1, v2) - assert_type(ret3, Any) + int_list: list[int] = ret3 + str_list: list[str] = ret3 + + +# The earlier ambiguity cases check assignability of list return types. This +# checks distinct scalar return types and operations specific to each type. + + +def check_ambiguous_scalar_return(v: Any) -> None: + ret = example2(1, v, 1) + int_result: int = ret + str_result: str = ret + _ = ret + 1 + ret.upper() diff --git a/docs/spec/overload.rst b/docs/spec/overload.rst index 7d9ef1bc1..85e8acb62 100644 --- a/docs/spec/overload.rst +++ b/docs/spec/overload.rst @@ -300,7 +300,15 @@ they should be replaced with their solved types. If the resulting return types for all remaining overloads are :term:`equivalent`, proceed to step 6. If the return types are not equivalent, overload matching is ambiguous. In -this case, assume a return type of ``Any`` and stop. +this case, infer a return type that is :term:`assignable` to each of the +remaining return types and permits operations supported by any of them without +errors, then stop. A type checker may infer ``Any`` or a more precise gradual +type that satisfies these requirements. + +For example, if the remaining return types are ``int`` and ``str``, the result +should be assignable to both ``int`` and ``str``, and both ``result + 1`` and +``result.upper()`` should be accepted. Inferring the ordinary union ``int | str`` +would not satisfy these requirements. Step 6 ~~~~~~ @@ -395,7 +403,8 @@ Example 4:: # both apply and are ambiguous due to Any, and # the return types are inconsistent. r2 = example4(v2, 1) - reveal_type(r2) # Should reveal Any + int_result: int = r2 # OK + list_result: list[int] = r2 # OK .. _argument-type-expansion: From 5ab19c913e08cba03e2ea1e84b71c3e65ffad5ac Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Mon, 14 Sep 2026 22:26:20 -0400 Subject: [PATCH 290/308] Update ty results for v0.0.81 (#2359) --- conformance/results/results.html | 15 ++------ conformance/results/ty/classes_override.toml | 11 ++---- conformance/results/ty/specialtypes_type.toml | 5 +-- conformance/results/ty/version.toml | 2 +- conformance/uv.lock | 38 +++++++++---------- 5 files changed, 29 insertions(+), 42 deletions(-) diff --git a/conformance/results/results.html b/conformance/results/results.html index 9ec07bb1c..08d7cd197 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -268,7 +268,7 @@

    Python Type System Conformance Test Results

    - + @@ -495,7 +495,6 @@

    Python Type System Conformance Test Results

    @@ -1045,13 +1044,7 @@

    Python Type System Conformance Test Results

  • the incompatible constructor overrides in ChildC2 are not flagged.
  • - + @@ -1060,7 +1053,7 @@

    Python Type System Conformance Test Results

    - + @@ -2572,7 +2565,7 @@

    Python Type System Conformance Test Results

    - + diff --git a/conformance/results/ty/classes_override.toml b/conformance/results/ty/classes_override.toml index 90cb245d6..4da491953 100644 --- a/conformance/results/ty/classes_override.toml +++ b/conformance/results/ty/classes_override.toml @@ -1,12 +1,5 @@ -conformant = "Partial" -notes = """ -Does not honor `@override` compatibility checks for `__init__` and `__new__`: -the incompatible constructor overrides in `ChildC2` are not flagged. -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Lines 134, 135: Expected error (tag 'init') -Lines 137, 138: Expected error (tag 'new') """ output = """ classes_override.py:53:9: error[invalid-explicit-override] Method `method3` is decorated with `@override` but does not override anything @@ -14,4 +7,6 @@ classes_override.py:65:9: error[invalid-explicit-override] Method `method4` is d classes_override.py:79:9: error[invalid-explicit-override] Method `static_method1` is decorated with `@override` but does not override anything classes_override.py:84:9: error[invalid-explicit-override] Method `class_method1` is decorated with `@override` but does not override anything classes_override.py:89:9: error[invalid-explicit-override] Method `property1` is decorated with `@override` but does not override anything +classes_override.py:135:9: error[invalid-method-override] Invalid override of method `__init__`: Definition is incompatible with `ParentC.__init__` +classes_override.py:138:9: error[invalid-method-override] Invalid override of method `__new__`: Definition is incompatible with `ParentC.__new__` """ diff --git a/conformance/results/ty/specialtypes_type.toml b/conformance/results/ty/specialtypes_type.toml index 20b222ad6..b059eb5e5 100644 --- a/conformance/results/ty/specialtypes_type.toml +++ b/conformance/results/ty/specialtypes_type.toml @@ -1,12 +1,9 @@ conformance_automated = "Fail" conformant = "Partial" notes = """ -Allows arbitrary attributes to be accessed on `TA` where `TA = typing.Type[typing.Any]` or `TA = type[typing.Any]`. Treats `type` equivalently to `type[object]` rather than `type[typing.Any]`. """ errors_diff = """ -Line 144: Expected 1 errors -Line 146: Expected 1 errors Line 84: Unexpected errors ['specialtypes_type.py:84:5: error[type-assertion-failure] Type `type` does not match asserted type `type[Any]`'] Line 99: Unexpected errors ['specialtypes_type.py:99:17: error[unresolved-attribute] Object of type `type` has no attribute `unknown`'] Line 100: Unexpected errors ['specialtypes_type.py:100:17: error[unresolved-attribute] Object of type `type` has no attribute `unknown`'] @@ -31,7 +28,9 @@ specialtypes_type.py:120:5: error[unresolved-attribute] Object of type `type` ha specialtypes_type.py:137:5: error[type-assertion-failure] Type `type` does not match asserted type `type[Any]` specialtypes_type.py:139:5: error[type-assertion-failure] Type `type` does not match asserted type `type[Any]` specialtypes_type.py:143:1: error[unresolved-attribute] Special form `typing.Type` has no attribute `unknown` +specialtypes_type.py:144:1: error[unresolved-attribute] Object of type `` has no attribute `unknown` specialtypes_type.py:145:1: error[unresolved-attribute] Class `type` has no attribute `unknown` +specialtypes_type.py:146:1: error[unresolved-attribute] Object of type `` has no attribute `unknown` specialtypes_type.py:169:21: error[invalid-assignment] Object of type `type` is not assignable to `type[int]` specialtypes_type.py:175:16: error[invalid-return-type] Return type does not match returned value: expected `type[T@ClassA]`, found `type` """ diff --git a/conformance/results/ty/version.toml b/conformance/results/ty/version.toml index db3be9a74..e63a40e94 100644 --- a/conformance/results/ty/version.toml +++ b/conformance/results/ty/version.toml @@ -1 +1 @@ -version = "ty 0.0.78" +version = "ty 0.0.81" diff --git a/conformance/uv.lock b/conformance/uv.lock index 911eebdf6..001de6fde 100644 --- a/conformance/uv.lock +++ b/conformance/uv.lock @@ -202,27 +202,27 @@ wheels = [ [[package]] name = "ty" -version = "0.0.78" +version = "0.0.81" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/d8/c7/2ba0861384c5b5097ac354383abb98188112cb330208c21d5197e98a29e5/ty-0.0.78.tar.gz", hash = "sha256:770b45854f85fa11595208f08c0f28df80943164d10a2832d86be6ac29f135b2", size = 7050609, upload-time = "2026-09-02T22:41:33.92Z" } +sdist = { url = "https://files.pythonhosted.org/packages/61/b7/c9d736f48585f5a711ea47bb97a353d3771834f89481d747ea9687b74fa9/ty-0.0.81.tar.gz", hash = "sha256:ef721aa649bf41d665ba86e1ea726fd3feab6800e2c4887a062a704baf304ca8", size = 7225871, upload-time = "2026-09-15T02:05:29.536Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/ea/ed/f34cfc06a9ba72979df219e48dae1a0b6a6c74a340763ccd30a547edf913/ty-0.0.78-py3-none-linux_armv6l.whl", hash = "sha256:122700b98f9d45785c1ce91a9418154562e7f64f4bf34679f6f7b38c5b97453f", size = 13304624, upload-time = "2026-09-02T22:40:56.649Z" }, - { url = "https://files.pythonhosted.org/packages/1c/28/5576e2a08b57676d9b2a736d528f077a6c6e32c3d1de2d75dbbe28346966/ty-0.0.78-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:cbe7e3709ccf29ef3d9f58f5914cc30ec36fb647008a5a4ff8483abe401bfe8d", size = 12928383, upload-time = "2026-09-02T22:40:59.162Z" }, - { url = "https://files.pythonhosted.org/packages/8e/e0/027d49c3da5235e634da3d3fc52c4874ec89f50830388c9c259f8fb71e0e/ty-0.0.78-py3-none-macosx_11_0_arm64.whl", hash = "sha256:c3528897b3ab9d3589561bc2b5e61a4d5d686de527a4400bb09a439b922a6c70", size = 12730058, upload-time = "2026-09-02T22:41:01.235Z" }, - { url = "https://files.pythonhosted.org/packages/bb/bc/6bf8ffefd8063730a70ae889cf85def72bc155fd1453135ebf8a09c2f1c2/ty-0.0.78-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8bfba4c44a06484093f527b8ef43a317abcf91395b49396170266629eedf74aa", size = 12813321, upload-time = "2026-09-02T22:41:03.251Z" }, - { url = "https://files.pythonhosted.org/packages/6d/c0/b3cdf26f82108908d92fdb7ddb741019c446ceb666cf204d4dbf611bde33/ty-0.0.78-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:5f903c06fdee17baf8373173039ab28f1bce28e66b1c734929a5f50b37eb54d9", size = 13072219, upload-time = "2026-09-02T22:41:05.225Z" }, - { url = "https://files.pythonhosted.org/packages/4d/36/16bfb0abdd178dae11dbc4b57b9a86c2b62642a18c1103fd2c2930aa5879/ty-0.0.78-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:dd83e5fe3f07291d1bd4e591f8d2607c204f3eab53bcb1b8060c40e876e1aa61", size = 13903958, upload-time = "2026-09-02T22:41:07.333Z" }, - { url = "https://files.pythonhosted.org/packages/0f/0c/74d3b1f0344b13156c719dd68a7edf7e48c2051718c9f326ba3cbf45ea53/ty-0.0.78-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:325285377319cf7168a2b8b771ae5027f411530e3c7eab1faf4583cdd72fd7c9", size = 14355581, upload-time = "2026-09-02T22:41:09.56Z" }, - { url = "https://files.pythonhosted.org/packages/8d/d7/7ca0359e1e61b15b8b02328c8d120db3c507876b9b7c6bd9f26935353e0e/ty-0.0.78-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:54b7846a404da6492697b524a769755ee9bee157d67674063ecd9c5f69dc52ff", size = 14044749, upload-time = "2026-09-02T22:41:11.678Z" }, - { url = "https://files.pythonhosted.org/packages/3b/6a/731f16ff42c5fc96e742c2f4e0a6915356bae114ae02ae4af6f33502175f/ty-0.0.78-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:169d3b9d134c0b48fe1af8a844142d374655552054a9d6c15a4b6e51bb0382ea", size = 13391647, upload-time = "2026-09-02T22:41:13.928Z" }, - { url = "https://files.pythonhosted.org/packages/0c/af/250cc29daf310e837188509ea4d78460c495d8a74c4fb84b4152d9ef2d4f/ty-0.0.78-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:6108cb3b2d28dac5981d4e25008a0a5547d8c877a67f6da9e8c38e7e946be44f", size = 13945020, upload-time = "2026-09-02T22:41:15.968Z" }, - { url = "https://files.pythonhosted.org/packages/b8/f9/96aab1dee4535e66554e8dc7657c69f6c61c181d8e70b9c3527908e93ef4/ty-0.0.78-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:589ad03608d9d2975ef4b23c41c4f847e325bcc7686f51d4c66066b8dbc18a2a", size = 12851149, upload-time = "2026-09-02T22:41:18.06Z" }, - { url = "https://files.pythonhosted.org/packages/85/b0/53d8fe9a847534ef5fe2165c7d5292cb853b29dfd7011cbfb1cdb90a8012/ty-0.0.78-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:b3fa0786edc1af06030f872d83499c0cea7c261dbbb651e0aee8306bf2c8a869", size = 13091464, upload-time = "2026-09-02T22:41:20.227Z" }, - { url = "https://files.pythonhosted.org/packages/21/65/94a4e5a02de559f6c6c0ee7a14b88660b4eee058ec6fec5c0ff6ecfbf5cc/ty-0.0.78-py3-none-musllinux_1_2_i686.whl", hash = "sha256:92c5639befc577578c8abd4e5a7fccf98d828db98b09e8d4dd81605dc0e54aef", size = 13389389, upload-time = "2026-09-02T22:41:22.27Z" }, - { url = "https://files.pythonhosted.org/packages/2e/b6/d0c7fe6be64ca5a15100c4b1f0e39c19660d53bc544f609fa117b346e661/ty-0.0.78-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:0dce70bc51652b2775debd1d1e422fb0179f5207c73deb4d5d0aca37e5f61695", size = 13691928, upload-time = "2026-09-02T22:41:24.292Z" }, - { url = "https://files.pythonhosted.org/packages/0a/5d/36081205611ba3fa802efc4ad63e4b1e949bda2f7bb37b34ac9bb6c00db0/ty-0.0.78-py3-none-win32.whl", hash = "sha256:1c80976ca9185d7a9d1baab1fb57240331b8dac58d3b11e46200284086a6de8d", size = 12647346, upload-time = "2026-09-02T22:41:26.699Z" }, - { url = "https://files.pythonhosted.org/packages/f1/89/b925fe1ea1bc56fc7f11d2496e29072fdd2ceb7b389884fc7b2d07cf0c41/ty-0.0.78-py3-none-win_amd64.whl", hash = "sha256:32e82b704471eab34f67b51c151660ca8a00815977b28278905d76fba54f7415", size = 13241810, upload-time = "2026-09-02T22:41:28.857Z" }, - { url = "https://files.pythonhosted.org/packages/91/f1/090ef7b52355bcedfbfbff6ce70fa81ba5bd5f6ed3f8d99ae05e6f2fe75b/ty-0.0.78-py3-none-win_arm64.whl", hash = "sha256:3a14d641a3c04fa9a80f2a46be1531d915f60d4fb79d4b894627bbe46bb35d64", size = 13077433, upload-time = "2026-09-02T22:41:31.525Z" }, + { url = "https://files.pythonhosted.org/packages/6c/70/649a5ec8fd6cc9dfa731c905523b19e677ad36dd9dcc4fcadfed8235507f/ty-0.0.81-py3-none-linux_armv6l.whl", hash = "sha256:8e9e3dd6edb1462633ddba2bf337d1c05023a5a13c2f315e445565c7ad43d247", size = 13679646, upload-time = "2026-09-15T02:04:51.436Z" }, + { url = "https://files.pythonhosted.org/packages/b5/d0/3769b760918c3dde1bbaeee87422cd442fc550baadb5c8621e479b363282/ty-0.0.81-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:649c350873e4b3e937d856512ee57b8a345d80079cbead73a5308c2cdafe594c", size = 13211367, upload-time = "2026-09-15T02:04:54.18Z" }, + { url = "https://files.pythonhosted.org/packages/f8/5f/b8fe3ab7eee87bbf1f5ff1b65c55526a3f31a9604630bc9e7d84199bbac5/ty-0.0.81-py3-none-macosx_11_0_arm64.whl", hash = "sha256:480c78706ba78239f901d68cf1ba53e98b84aa51e19b9241daa0fb62fdecd2e2", size = 13084312, upload-time = "2026-09-15T02:04:56.133Z" }, + { url = "https://files.pythonhosted.org/packages/7f/d8/ce22278014f14ae8205d2f9622696d39c623a0c9e80056c258bb89bb8322/ty-0.0.81-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7cdbfa4b634b1d21542eedc11e424dedcc4871c2128d0d46b55b0089d3220492", size = 13127965, upload-time = "2026-09-15T02:04:58.306Z" }, + { url = "https://files.pythonhosted.org/packages/82/d0/4e75c61f6a241a0804f25117af4f91a5aaa4a48408b57f8d4c34d8a3d91e/ty-0.0.81-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:5f7a34743a21669d4f3d5fda98c36189cb4d9dceee1415a8a42d7426d55995db", size = 13432523, upload-time = "2026-09-15T02:05:00.471Z" }, + { url = "https://files.pythonhosted.org/packages/0b/02/e0b6b783418515c8ba40c13d5e333da9e0576a7a69582fc2b5831bb7d913/ty-0.0.81-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:742eab849947bc10b4c09810d37bd743afe9502e114b7bcfd6389f0ae3f425aa", size = 14211082, upload-time = "2026-09-15T02:05:02.455Z" }, + { url = "https://files.pythonhosted.org/packages/6b/af/85cb68d13ff617f2b213212d674e1266b933f2d051b63a1e5116e8ca0bfc/ty-0.0.81-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2b4cef395eee7007449aa3fc3fc8dc6bc58fe7a8956d56db078569061741bf52", size = 14692204, upload-time = "2026-09-15T02:05:04.705Z" }, + { url = "https://files.pythonhosted.org/packages/24/c6/791891f3fa8fec91e9ec3e8c9d6774ab903297defe847a3e5d7e047360ad/ty-0.0.81-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:80cf8c34973a1da2ec2a043efcba8f4c0a984d45210957a8ddd2c16f2b8f8e85", size = 14371010, upload-time = "2026-09-15T02:05:06.63Z" }, + { url = "https://files.pythonhosted.org/packages/c7/b2/c9fba5b4ed7f63f26e83432fa2062ca04606b61dce7bbacc1238232af649/ty-0.0.81-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f37a8f66c444eea29f17adfe0664f42062520773f18031fd4913f28eb56d2966", size = 13758537, upload-time = "2026-09-15T02:05:08.722Z" }, + { url = "https://files.pythonhosted.org/packages/77/e6/09c41e96bbcbe53dd18c9a1a6dbd2e456b0d03b94440a4bd9bab55a4e19a/ty-0.0.81-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:e8134cc03e84a27f409877b9b62053fd4aaac9c3ce0ce0fdace8b5ed58d78e04", size = 14280789, upload-time = "2026-09-15T02:05:10.719Z" }, + { url = "https://files.pythonhosted.org/packages/5b/d1/87eb8e01fb17602cde5911cbadb9b11141a04f728dbda0a2a00243f337ca/ty-0.0.81-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:fb6f269c5f14a07047e05cbf3d06dd9a64a048050f736afcf744a180a272f034", size = 13169638, upload-time = "2026-09-15T02:05:12.806Z" }, + { url = "https://files.pythonhosted.org/packages/94/3c/137ceb792858f408c48f20a066d12ee76108e5f28a13242720879c024172/ty-0.0.81-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:38355a5e6294ebd3cee616ed581d051963d61b293a1b3351c248747f73a45b74", size = 13449856, upload-time = "2026-09-15T02:05:15.505Z" }, + { url = "https://files.pythonhosted.org/packages/fe/0a/4a9b31fadfc80a2141f3862316eb31944843e01bc1f6533794291cce767e/ty-0.0.81-py3-none-musllinux_1_2_i686.whl", hash = "sha256:59a35e128a9831423aee19db804aa8a1358ee3ce615b3fc0dec20d40bfd0d733", size = 13675303, upload-time = "2026-09-15T02:05:17.537Z" }, + { url = "https://files.pythonhosted.org/packages/e3/16/dbcd2c10ab80b015a227110a4ec75314468b6720d800261098521df4eee9/ty-0.0.81-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:f0f4219fbc068ea3414fa804c6bd57ef4229a11884ab9ca71cd8308072520aad", size = 14050298, upload-time = "2026-09-15T02:05:20.424Z" }, + { url = "https://files.pythonhosted.org/packages/95/ba/a70ced0c0c078ff09a3a80224d045c4267d07811dbaf125c749af5f72606/ty-0.0.81-py3-none-win32.whl", hash = "sha256:82ff952e64ba4c4da1c0c89723e326c768ae4f9ff20624dee04a51c3f4e4b96c", size = 12866650, upload-time = "2026-09-15T02:05:22.824Z" }, + { url = "https://files.pythonhosted.org/packages/3f/51/4b79453df93dfb9edecb1bd6cb04e772277d8c7260693165358a033b6ed1/ty-0.0.81-py3-none-win_amd64.whl", hash = "sha256:ef82788744da0b7f2a598e4e9776f9c5998df4eef7e2750ae3a5537e7c734b69", size = 13572976, upload-time = "2026-09-15T02:05:24.907Z" }, + { url = "https://files.pythonhosted.org/packages/0a/56/09594d55a0c49543eeac149c0dbc80b9b04409cc26ca48f1c1a9595c0916/ty-0.0.81-py3-none-win_arm64.whl", hash = "sha256:bdb1563990c5d3abfe5a09e7512733f302773ede6a5d3e4e5c6ad46393d8df4d", size = 13364408, upload-time = "2026-09-15T02:05:27.247Z" }, ] [[package]] From 7f321cd4198e428a25a2c30c4d8653d3067428f4 Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Tue, 15 Sep 2026 19:47:01 +0000 Subject: [PATCH 291/308] Change the typing spec around string annotations (#2144) * Improve the wording around string references in the spec * Ensure that forward annotations don't depend on the position in the scope * Add spec definition for: from __future__ import annotations * Test from __future__ annotations name resolution --------- Co-authored-by: Jelle Zijlstra Co-authored-by: Carl Meyer --- .../mypy/annotations_forward_refs.toml | 27 +++--- .../mypy/annotations_future_import.toml | 15 ++++ .../pycroscope/annotations_forward_refs.toml | 18 ++-- .../pycroscope/annotations_future_import.toml | 27 ++++++ .../pyrefly/annotations_forward_refs.toml | 21 +++-- .../pyrefly/annotations_future_import.toml | 22 +++++ .../pyright/annotations_forward_refs.toml | 24 ++++-- .../pyright/annotations_future_import.toml | 13 +++ conformance/results/results.html | 86 +++++++++++++++---- .../results/ty/annotations_forward_refs.toml | 19 ++-- .../results/ty/annotations_future_import.toml | 13 +++ .../zuban/annotations_forward_refs.toml | 30 ++++--- .../zuban/annotations_future_import.toml | 18 ++++ conformance/tests/annotations_forward_refs.py | 54 +++++++++--- .../tests/annotations_future_import.py | 58 +++++++++++++ docs/spec/annotations.rst | 41 ++++----- 16 files changed, 373 insertions(+), 113 deletions(-) create mode 100644 conformance/results/mypy/annotations_future_import.toml create mode 100644 conformance/results/pycroscope/annotations_future_import.toml create mode 100644 conformance/results/pyrefly/annotations_future_import.toml create mode 100644 conformance/results/pyright/annotations_future_import.toml create mode 100644 conformance/results/ty/annotations_future_import.toml create mode 100644 conformance/results/zuban/annotations_future_import.toml create mode 100644 conformance/tests/annotations_future_import.py diff --git a/conformance/results/mypy/annotations_forward_refs.toml b/conformance/results/mypy/annotations_forward_refs.toml index 15211054e..b74ef2246 100644 --- a/conformance/results/mypy/annotations_forward_refs.toml +++ b/conformance/results/mypy/annotations_forward_refs.toml @@ -2,7 +2,14 @@ conformant = "Partial" notes = """ Does not report error for a forward reference that is not enclosed in quotes. Does not report error for use of quoted type with `|` operator (runtime error). -Incorrectly generates error for quoted type defined in class scope. +Resolves some forward references in type annotations in classes at the point of definition instead of end-of-scope +""" +conformance_automated = "Fail" +errors_diff = """ +Line 24: Expected 1 errors +Line 25: Expected 1 errors +Line 94: Expected 1 errors +Line 96: Expected 1 errors """ output = """ annotations_forward_refs.py:41: error: Invalid type comment or annotation [valid-type] @@ -22,17 +29,9 @@ annotations_forward_refs.py:53: error: Invalid type comment or annotation [vali annotations_forward_refs.py:54: error: Invalid type comment or annotation [valid-type] annotations_forward_refs.py:55: error: Module "types" is not valid as a type [valid-type] annotations_forward_refs.py:55: note: Perhaps you meant to use a protocol matching the module structure? -annotations_forward_refs.py:80: error: Name "ClassF" is not defined; did you mean "ClassA", "ClassB", or "ClassC"? [name-defined] -annotations_forward_refs.py:87: error: Function "annotations_forward_refs.ClassD.int" is not valid as a type [valid-type] -annotations_forward_refs.py:87: note: Perhaps you need "Callable[...]" or a callback protocol? -annotations_forward_refs.py:89: error: Function "annotations_forward_refs.ClassD.int" is not valid as a type [valid-type] -annotations_forward_refs.py:89: note: Perhaps you need "Callable[...]" or a callback protocol? -annotations_forward_refs.py:96: error: Expression is of type int?, not "int" [assert-type] -""" -conformance_automated = "Fail" -errors_diff = """ -Line 24: Expected 1 errors -Line 25: Expected 1 errors -Line 87: Unexpected errors ['annotations_forward_refs.py:87: error: Function "annotations_forward_refs.ClassD.int" is not valid as a type [valid-type]'] -Line 96: Unexpected errors ['annotations_forward_refs.py:96: error: Expression is of type int?, not "int" [assert-type]'] +annotations_forward_refs.py:92: error: Name "ClassF" is not defined; did you mean "ClassA", "ClassB", or "ClassC"? [name-defined] +annotations_forward_refs.py:101: error: Function "annotations_forward_refs.ClassD.int" is not valid as a type [valid-type] +annotations_forward_refs.py:101: note: Perhaps you need "Callable[...]" or a callback protocol? +annotations_forward_refs.py:103: error: Function "annotations_forward_refs.ClassD.int" is not valid as a type [valid-type] +annotations_forward_refs.py:103: note: Perhaps you need "Callable[...]" or a callback protocol? """ diff --git a/conformance/results/mypy/annotations_future_import.toml b/conformance/results/mypy/annotations_future_import.toml new file mode 100644 index 000000000..88012982f --- /dev/null +++ b/conformance/results/mypy/annotations_future_import.toml @@ -0,0 +1,15 @@ +conformant = "Partial" +notes = """ +Resolves some forward references in type annotations in classes at the point of definition instead of end-of-scope +""" +conformance_automated = "Fail" +errors_diff = """ +Line 37: Expected 1 errors +Line 39: Expected 1 errors +""" +output = """ +annotations_future_import.py:44: error: Function "annotations_future_import.ClassB.int" is not valid as a type [valid-type] +annotations_future_import.py:44: note: Perhaps you need "Callable[...]" or a callback protocol? +annotations_future_import.py:46: error: Function "annotations_future_import.ClassB.int" is not valid as a type [valid-type] +annotations_future_import.py:46: note: Perhaps you need "Callable[...]" or a callback protocol? +""" diff --git a/conformance/results/pycroscope/annotations_forward_refs.toml b/conformance/results/pycroscope/annotations_forward_refs.toml index 63fbfc009..f1bdcad94 100644 --- a/conformance/results/pycroscope/annotations_forward_refs.toml +++ b/conformance/results/pycroscope/annotations_forward_refs.toml @@ -1,19 +1,22 @@ conformant = "Partial" notes = """ Fails to reject `"x" | int` annotations that fail at runtime. +Resolves forward references in type annotations in classes at the point of definition instead of end-of-scope Rejects some valid quoted annotations. """ conformance_automated = "Fail" errors_diff = """ Line 24: Expected 1 errors Line 25: Expected 1 errors +Line 94: Expected 1 errors +Line 96: Expected 1 errors Line 14: Unexpected errors ['./annotations_forward_refs.py:14:8: Undefined name: ClassA [undefined_name]', './annotations_forward_refs.py:14:22: Undefined name: ClassA [undefined_name]', './annotations_forward_refs.py:14:42: Undefined name: ClassA [undefined_name]', './annotations_forward_refs.py:14:62: Undefined name: ClassA [undefined_name]'] Line 16: Unexpected errors ['./annotations_forward_refs.py:16:16: Any[error] is not equivalent to ./annotations_forward_refs.py.ClassA'] Line 17: Unexpected errors ['./annotations_forward_refs.py:17:16: list[Any[error]] is not equivalent to list[./annotations_forward_refs.py.ClassA]'] Line 18: Unexpected errors ['./annotations_forward_refs.py:18:16: list[Any[error]] is not equivalent to list[./annotations_forward_refs.py.ClassA]'] Line 19: Unexpected errors ['./annotations_forward_refs.py:19:16: list[int | Any[error]] is not equivalent to list[./annotations_forward_refs.py.ClassA | int]'] -Line 87: Unexpected errors ['./annotations_forward_refs.py:87:7: Unrecognized annotation (self: ./annotations_forward_refs.py.ClassD) -> None [invalid_annotation]'] -Line 96: Unexpected errors ['./annotations_forward_refs.py:96:12: Any[error] is not equivalent to int'] +Line 84: Unexpected errors ['./annotations_forward_refs.py:84:12: Undefined name: ClassInner [undefined_name]'] +Line 112: Unexpected errors ['./annotations_forward_refs.py:112:16: Any[error] is not equivalent to ./annotations_forward_refs.py.ClassD.ClassInner'] """ output = """ ./annotations_forward_refs.py:14:8: Undefined name: ClassA [undefined_name] @@ -41,8 +44,11 @@ output = """ ./annotations_forward_refs.py:53:0: Invalid type annotation [invalid_annotation] ./annotations_forward_refs.py:54:0: Invalid type annotation [invalid_annotation] ./annotations_forward_refs.py:55:9: Invalid type annotation [invalid_annotation] -./annotations_forward_refs.py:80:12: Undefined name: ClassF [undefined_name] -./annotations_forward_refs.py:87:7: Unrecognized annotation (self: ./annotations_forward_refs.py.ClassD) -> None [invalid_annotation] -./annotations_forward_refs.py:89:7: Unrecognized annotation (self: ./annotations_forward_refs.py.ClassD) -> None [invalid_annotation] -./annotations_forward_refs.py:96:12: Any[error] is not equivalent to int +./annotations_forward_refs.py:83:12: Undefined name: ClassInner [undefined_name] +./annotations_forward_refs.py:84:12: Undefined name: ClassInner [undefined_name] +./annotations_forward_refs.py:92:12: Undefined name: ClassF [undefined_name] +./annotations_forward_refs.py:101:7: Unrecognized annotation (self: ./annotations_forward_refs.py.ClassD) -> None [invalid_annotation] +./annotations_forward_refs.py:103:7: Unrecognized annotation (self: ./annotations_forward_refs.py.ClassD) -> None [invalid_annotation] +./annotations_forward_refs.py:111:16: Any[error] is not equivalent to ./annotations_forward_refs.py.ClassD.ClassInner +./annotations_forward_refs.py:112:16: Any[error] is not equivalent to ./annotations_forward_refs.py.ClassD.ClassInner """ diff --git a/conformance/results/pycroscope/annotations_future_import.toml b/conformance/results/pycroscope/annotations_future_import.toml new file mode 100644 index 000000000..7576dc678 --- /dev/null +++ b/conformance/results/pycroscope/annotations_future_import.toml @@ -0,0 +1,27 @@ +conformant = "Partial" +notes = """ +Forward references to nested classes are not resolved +Nested classes are resolved, but its type is Any +Resolves some class annotations to outer names instead of shadowing class bindings +""" +conformance_automated = "Fail" +errors_diff = """ +Line 37: Expected 1 errors +Line 39: Expected 1 errors +Line 26: Unexpected errors ['./annotations_future_import.py:26:12: Undefined name: ClassInner [undefined_name]'] +Line 27: Unexpected errors ['./annotations_future_import.py:27:12: Undefined name: ClassInner [undefined_name]'] +Line 55: Unexpected errors ['./annotations_future_import.py:55:16: Any[inference] is not equivalent to annotations_future_import.ClassB.ClassInner'] +Line 56: Unexpected errors ['./annotations_future_import.py:56:16: Any[inference] is not equivalent to annotations_future_import.ClassB.ClassInner'] +Line 57: Unexpected errors ['./annotations_future_import.py:57:16: Any[inference] is not equivalent to annotations_future_import.ClassB.ClassInner'] +Line 58: Unexpected errors ['./annotations_future_import.py:58:16: Any[inference] is not equivalent to annotations_future_import.ClassB.ClassInner'] +""" +output = """ +./annotations_future_import.py:26:12: Undefined name: ClassInner [undefined_name] +./annotations_future_import.py:27:12: Undefined name: ClassInner [undefined_name] +./annotations_future_import.py:44:7: Invalid type annotation [invalid_annotation] +./annotations_future_import.py:46:7: Invalid type annotation [invalid_annotation] +./annotations_future_import.py:55:16: Any[inference] is not equivalent to annotations_future_import.ClassB.ClassInner +./annotations_future_import.py:56:16: Any[inference] is not equivalent to annotations_future_import.ClassB.ClassInner +./annotations_future_import.py:57:16: Any[inference] is not equivalent to annotations_future_import.ClassB.ClassInner +./annotations_future_import.py:58:16: Any[inference] is not equivalent to annotations_future_import.ClassB.ClassInner +""" diff --git a/conformance/results/pyrefly/annotations_forward_refs.toml b/conformance/results/pyrefly/annotations_forward_refs.toml index 8807cb346..f0d3f84fb 100644 --- a/conformance/results/pyrefly/annotations_forward_refs.toml +++ b/conformance/results/pyrefly/annotations_forward_refs.toml @@ -1,12 +1,14 @@ conformant = "Partial" notes = """ -Types in quotes incorrectly refer to shadowing class member. -Does not reject some type forms that require quotes. +Resolves forward references in type annotations in classes at the point of definition instead of end-of-scope +Fails to resolve a forward reference to a nested class """ conformance_automated = "Fail" errors_diff = """ -Line 87: Unexpected errors ['Expected a type form, got instance of `(self: Self@ClassD) -> None` [not-a-type]'] -Line 96: Unexpected errors ['assert_type(Unknown, int) failed [assert-type]'] +Line 94: Expected 1 errors +Line 96: Expected 1 errors +Line 84: Unexpected errors ['Could not find name `ClassInner` [unknown-name]'] +Line 112: Unexpected errors ['assert_type(Unknown, ClassD.ClassInner) failed [assert-type]'] """ output = """ ERROR annotations_forward_refs.py:23:12-18: `ClassA` is uninitialized [unbound-name] @@ -28,8 +30,11 @@ ERROR annotations_forward_refs.py:52:11-13: Unary operation cannot be used in an ERROR annotations_forward_refs.py:53:11-21: Boolean operation cannot be used in annotations [invalid-annotation] ERROR annotations_forward_refs.py:54:11-17: F-string cannot be used in annotations [invalid-annotation] ERROR annotations_forward_refs.py:55:11-16: Expected a type form, got instance of `Module[types]` [not-a-type] -ERROR annotations_forward_refs.py:80:14-20: Could not find name `ClassF` [unknown-name] -ERROR annotations_forward_refs.py:87:9-12: Expected a type form, got instance of `(self: Self@ClassD) -> None` [not-a-type] -ERROR annotations_forward_refs.py:89:8-11: Expected a type form, got instance of `(self: Self@ClassD) -> None` [not-a-type] -ERROR annotations_forward_refs.py:96:12-27: assert_type(Unknown, int) failed [assert-type] +ERROR annotations_forward_refs.py:83:13-23: Could not find name `ClassInner` [unknown-name] +ERROR annotations_forward_refs.py:84:14-24: Could not find name `ClassInner` [unknown-name] +ERROR annotations_forward_refs.py:92:14-20: Could not find name `ClassF` [unknown-name] +ERROR annotations_forward_refs.py:101:8-11: Expected a type form, got instance of `(self: Self@ClassD) -> None` [not-a-type] +ERROR annotations_forward_refs.py:103:9-12: Expected a type form, got instance of `(self: Self@ClassD) -> None` [not-a-type] +ERROR annotations_forward_refs.py:111:16-45: assert_type(Unknown, ClassD.ClassInner) failed [assert-type] +ERROR annotations_forward_refs.py:112:16-45: assert_type(Unknown, ClassD.ClassInner) failed [assert-type] """ diff --git a/conformance/results/pyrefly/annotations_future_import.toml b/conformance/results/pyrefly/annotations_future_import.toml new file mode 100644 index 000000000..83a8ee5ef --- /dev/null +++ b/conformance/results/pyrefly/annotations_future_import.toml @@ -0,0 +1,22 @@ +conformant = "Partial" +notes = """ +Forward references to nested classes are not resolved +Resolves forward references in type annotations in classes at the point of definition instead of end-of-scope +""" +conformance_automated = "Fail" +errors_diff = """ +Line 37: Expected 1 errors +Line 39: Expected 1 errors +Line 26: Unexpected errors ['Could not find name `ClassInner` [unknown-name]'] +Line 27: Unexpected errors ['Could not find name `ClassInner` [unknown-name]'] +Line 55: Unexpected errors ['assert_type(Unknown, ClassB.ClassInner) failed [assert-type]'] +Line 56: Unexpected errors ['assert_type(Unknown, ClassB.ClassInner) failed [assert-type]'] +""" +output = """ +ERROR annotations_future_import.py:26:13-23: Could not find name `ClassInner` [unknown-name] +ERROR annotations_future_import.py:27:14-24: Could not find name `ClassInner` [unknown-name] +ERROR annotations_future_import.py:44:8-11: Expected a type form, got instance of `(self: Self@ClassB) -> None` [not-a-type] +ERROR annotations_future_import.py:46:9-12: Expected a type form, got instance of `(self: Self@ClassB) -> None` [not-a-type] +ERROR annotations_future_import.py:55:16-45: assert_type(Unknown, ClassB.ClassInner) failed [assert-type] +ERROR annotations_future_import.py:56:16-45: assert_type(Unknown, ClassB.ClassInner) failed [assert-type] +""" diff --git a/conformance/results/pyright/annotations_forward_refs.toml b/conformance/results/pyright/annotations_forward_refs.toml index ca35b5bb1..cb4a1a727 100644 --- a/conformance/results/pyright/annotations_forward_refs.toml +++ b/conformance/results/pyright/annotations_forward_refs.toml @@ -1,4 +1,13 @@ -conformant = "Pass" +conformant = "Partial" +notes = """ +Prefers to resolve forward references in classes outside of the class instead of end-of-scope +""" +conformance_automated = "Fail" +errors_diff = """ +Line 94: Expected 1 errors +Line 96: Expected 1 errors +Line 103: Expected 1 errors +""" output = """ annotations_forward_refs.py:22:7 - error: "ClassA" is not defined (reportUndefinedVariable) annotations_forward_refs.py:23:12 - error: "ClassA" is not defined (reportUndefinedVariable) @@ -29,11 +38,10 @@ annotations_forward_refs.py:52:11 - error: Unary operator not allowed in type ex annotations_forward_refs.py:53:11 - error: Binary operator not allowed in type expression (reportInvalidTypeForm) annotations_forward_refs.py:54:11 - error: Type expressions cannot use format string literals (f-strings) (reportGeneralTypeIssues) annotations_forward_refs.py:55:10 - error: Module cannot be used as a type (reportGeneralTypeIssues) -annotations_forward_refs.py:66:26 - error: "ClassB" is not defined (reportUndefinedVariable) -annotations_forward_refs.py:80:14 - error: Type of "ClassF" could not be determined because it refers to itself (reportGeneralTypeIssues) -annotations_forward_refs.py:80:14 - error: Variable not allowed in type expression (reportInvalidTypeForm) -annotations_forward_refs.py:89:8 - error: Expected class but received "(self: Self@ClassD) -> None" (reportGeneralTypeIssues) -""" -conformance_automated = "Pass" -errors_diff = """ +annotations_forward_refs.py:65:26 - error: "ClassB" is not defined (reportUndefinedVariable) +annotations_forward_refs.py:83:13 - error: "ClassInner" is not defined (reportUndefinedVariable) +annotations_forward_refs.py:92:14 - error: Type of "ClassF" could not be determined because it refers to itself (reportGeneralTypeIssues) +annotations_forward_refs.py:92:14 - error: Variable not allowed in type expression (reportInvalidTypeForm) +annotations_forward_refs.py:101:8 - error: Expected class but received "(self: Self@ClassD) -> None" (reportGeneralTypeIssues) +annotations_forward_refs.py:111:17 - error: "assert_type" mismatch: expected "ClassInner" but received "Unknown" (reportAssertTypeFailure) """ diff --git a/conformance/results/pyright/annotations_future_import.toml b/conformance/results/pyright/annotations_future_import.toml new file mode 100644 index 000000000..baa4287eb --- /dev/null +++ b/conformance/results/pyright/annotations_future_import.toml @@ -0,0 +1,13 @@ +conformant = "Partial" +notes = """ +Prefers to resolve forward references in classes outside of the class instead of end-of-scope +""" +conformance_automated = "Fail" +errors_diff = """ +Line 37: Expected 1 errors +Line 39: Expected 1 errors +Line 44: Expected 1 errors +Line 46: Expected 1 errors +""" +output = """ +""" diff --git a/conformance/results/results.html b/conformance/results/results.html index 08d7cd197..48c3631b7 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -294,34 +294,84 @@

    Python Type System Conformance Test Results

    • Does not report error for a forward reference that is not enclosed in quotes.
    • Does not report error for use of quoted type with | operator (runtime error).
    • -
    • Incorrectly generates error for quoted type defined in class scope.
    • +
    • Resolves some forward references in type annotations in classes at the point of definition instead of end-of-scope
    + + + + + + + + + + - @@ -374,12 +424,12 @@

    Python Type System Conformance Test Results

    - - - - - - + + + + + + @@ -2561,12 +2611,12 @@

    Python Type System Conformance Test Results

    - - - - - - + + + + + +
     
    mypy 1.13.0
    -
    1.5sec
    +
    2.6sec
    pyright 1.1.386
    -
    1.2sec
    +
    1.9sec
    pyre 0.9.22
    -
    4.4sec
    +
    6.5sec
    pytype 2024.10.11
    -
    33.1sec
    +
    50.2sec
    diff --git a/conformance/tests/generics_syntax_infer_variance.py b/conformance/tests/generics_syntax_infer_variance.py index 7df2e64e8..62d14ccb5 100644 --- a/conformance/tests/generics_syntax_infer_variance.py +++ b/conformance/tests/generics_syntax_infer_variance.py @@ -91,7 +91,7 @@ def __init__(self, value: T) -> None: self._value = value @property - def value(self): + def value(self) -> T: return self._value @value.setter From b633be4d316274d9dbd05709068a61e7cb1d417d Mon Sep 17 00:00:00 2001 From: Victorien <65306057+Viicos@users.noreply.github.com> Date: Fri, 25 Oct 2024 15:28:07 +0200 Subject: [PATCH 058/308] Add a label for typed dictionaries class-based syntax (#1873) --- docs/spec/typeddict.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/spec/typeddict.rst b/docs/spec/typeddict.rst index 38a2e4b8f..15d9aeaad 100644 --- a/docs/spec/typeddict.rst +++ b/docs/spec/typeddict.rst @@ -35,6 +35,7 @@ particular, :term:`assignability ` should be :term:`structural`: a more specific TypedDict type can be assignable to a more general TypedDict type, without any inheritance relationship between them. +.. _typeddict-class-based-syntax: Class-based Syntax ^^^^^^^^^^^^^^^^^^ From d19b1b233125e02e10f8b26bc625a8f6885d98d9 Mon Sep 17 00:00:00 2001 From: Zeina Migeed Date: Tue, 29 Oct 2024 16:24:34 -0700 Subject: [PATCH 059/308] Update conformance results after new pyre release (#1878) update conformance results after new pyre release --- conformance/results/mypy/version.toml | 2 +- .../results/pyre/aliases_explicit.toml | 4 + .../results/pyre/aliases_implicit.toml | 8 +- conformance/results/pyre/aliases_newtype.toml | 2 +- .../results/pyre/aliases_recursive.toml | 4 +- .../results/pyre/aliases_type_statement.toml | 56 +++++---- .../results/pyre/aliases_typealiastype.toml | 4 - .../results/pyre/aliases_variance.toml | 8 +- .../pyre/annotations_forward_refs.toml | 4 +- .../results/pyre/annotations_generators.toml | 4 +- .../results/pyre/annotations_methods.toml | 2 +- .../results/pyre/callables_annotation.toml | 2 + .../results/pyre/callables_kwargs.toml | 40 +++---- .../results/pyre/callables_protocol.toml | 6 +- .../results/pyre/callables_subtyping.toml | 10 +- .../results/pyre/classes_classvar.toml | 4 +- .../results/pyre/classes_override.toml | 9 +- .../results/pyre/constructors_call_init.toml | 14 ++- .../results/pyre/constructors_call_new.toml | 29 ++--- .../results/pyre/constructors_callable.toml | 29 ++--- .../results/pyre/dataclasses_descriptors.toml | 17 +-- .../pyre/dataclasses_transform_func.toml | 2 - .../results/pyre/dataclasses_usage.toml | 7 +- .../results/pyre/directives_assert_type.toml | 9 +- .../results/pyre/directives_reveal_type.toml | 8 +- .../pyre/directives_type_ignore_file1.toml | 7 +- .../pyre/directives_version_platform.toml | 10 +- conformance/results/pyre/enums_behaviors.toml | 7 +- .../results/pyre/enums_definition.toml | 10 +- conformance/results/pyre/enums_expansion.toml | 7 +- .../results/pyre/enums_member_names.toml | 8 +- .../results/pyre/enums_member_values.toml | 28 ++--- conformance/results/pyre/enums_members.toml | 26 ++-- .../pyre/exceptions_context_managers.toml | 12 +- conformance/results/pyre/generics_basic.toml | 6 +- .../results/pyre/generics_defaults.toml | 103 ++++++++-------- .../pyre/generics_defaults_referential.toml | 40 +++---- .../generics_defaults_specialization.toml | 20 ++-- .../pyre/generics_paramspec_components.toml | 2 +- .../pyre/generics_paramspec_semantics.toml | 6 +- .../results/pyre/generics_scoping.toml | 19 +-- .../results/pyre/generics_self_advanced.toml | 25 ++-- .../results/pyre/generics_self_basic.toml | 14 +-- .../pyre/generics_syntax_compatibility.toml | 9 +- .../pyre/generics_syntax_declarations.toml | 23 ++-- .../pyre/generics_syntax_infer_variance.toml | 44 +++---- .../results/pyre/generics_syntax_scoping.toml | 14 ++- .../results/pyre/generics_type_erasure.toml | 21 ++-- .../pyre/generics_typevartuple_args.toml | 41 +++---- .../pyre/generics_typevartuple_basic.toml | 76 +++--------- .../pyre/generics_typevartuple_callable.toml | 26 +--- .../pyre/generics_typevartuple_concat.toml | 39 ++---- .../pyre/generics_typevartuple_overloads.toml | 15 +-- .../generics_typevartuple_specialization.toml | 91 ++++---------- .../pyre/generics_typevartuple_unpack.toml | 24 +--- .../results/pyre/generics_upper_bound.toml | 2 +- .../results/pyre/generics_variance.toml | 4 +- .../pyre/generics_variance_inference.toml | 53 ++++++--- .../results/pyre/historical_positional.toml | 15 +-- .../results/pyre/literals_interactions.toml | 16 +-- .../results/pyre/literals_literalstring.toml | 4 +- .../pyre/literals_parameterizations.toml | 2 - .../pyre/namedtuples_define_class.toml | 30 +---- .../pyre/namedtuples_define_functional.toml | 26 +--- .../results/pyre/namedtuples_type_compat.toml | 11 +- .../results/pyre/namedtuples_usage.toml | 29 +---- .../results/pyre/narrowing_typeguard.toml | 11 +- .../results/pyre/narrowing_typeis.toml | 46 ++------ conformance/results/pyre/overloads_basic.toml | 7 +- .../results/pyre/protocols_generic.toml | 2 +- .../results/pyre/protocols_merging.toml | 7 +- .../results/pyre/qualifiers_annotated.toml | 10 +- .../results/pyre/specialtypes_any.toml | 11 +- .../results/pyre/specialtypes_never.toml | 4 +- .../results/pyre/specialtypes_type.toml | 16 +++ .../results/pyre/tuples_type_compat.toml | 111 ++++++------------ conformance/results/pyre/tuples_unpacked.toml | 25 +--- .../results/pyre/typeddicts_class_syntax.toml | 4 +- .../results/pyre/typeddicts_inheritance.toml | 7 +- .../results/pyre/typeddicts_operations.toml | 8 +- .../results/pyre/typeddicts_readonly.toml | 18 ++- .../pyre/typeddicts_readonly_consistency.toml | 12 +- .../pyre/typeddicts_readonly_inheritance.toml | 20 ++-- .../pyre/typeddicts_readonly_kwargs.toml | 10 +- .../pyre/typeddicts_readonly_update.toml | 10 +- .../results/pyre/typeddicts_required.toml | 4 - .../results/pyre/typeddicts_usage.toml | 8 +- conformance/results/pyre/version.toml | 5 +- conformance/results/pyright/version.toml | 3 +- conformance/results/results.html | 102 ++++++++-------- 90 files changed, 683 insertions(+), 1027 deletions(-) diff --git a/conformance/results/mypy/version.toml b/conformance/results/mypy/version.toml index 33181f435..bdefc8cfd 100644 --- a/conformance/results/mypy/version.toml +++ b/conformance/results/mypy/version.toml @@ -1,2 +1,2 @@ version = "mypy 1.13.0" -test_duration = 2.6 +test_duration = 2.7 diff --git a/conformance/results/pyre/aliases_explicit.toml b/conformance/results/pyre/aliases_explicit.toml index 473b04ee3..1ed27f715 100644 --- a/conformance/results/pyre/aliases_explicit.toml +++ b/conformance/results/pyre/aliases_explicit.toml @@ -15,6 +15,8 @@ aliases_explicit.py:26:0 Incompatible variable type [9]: GoodTypeAlias12 is decl aliases_explicit.py:26:31 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[typing.Any, Type[Variable[$synthetic_attribute_resolution_variable]]]` but got `Tuple[ParamSpec, None]`. aliases_explicit.py:41:8 Undefined or invalid type [11]: Annotation `GoodTypeAlias9` is not defined as a type. aliases_explicit.py:44:9 Undefined or invalid type [11]: Annotation `GoodTypeAlias12` is not defined as a type. +aliases_explicit.py:57:4 Assert type [70]: Expected `typing.Callable[[int, str, str], None]` but got `unknown`. +aliases_explicit.py:60:4 Assert type [70]: Expected `typing.Callable[..., None]` but got `unknown`. aliases_explicit.py:80:0 Incompatible variable type [9]: BadTypeAlias2 is declared to have type `TA` but is used as type `List[Type[Union[int, str]]]`. aliases_explicit.py:81:0 Incompatible variable type [9]: BadTypeAlias3 is declared to have type `TA` but is used as type `Tuple[Tuple[Type[int], Type[str]]]`. aliases_explicit.py:82:0 Incompatible variable type [9]: BadTypeAlias4 is declared to have type `TA` but is used as type `List[Type[int]]`. @@ -44,5 +46,7 @@ Line 23: Unexpected errors ['aliases_explicit.py:23:0 Incompatible variable type Line 26: Unexpected errors ['aliases_explicit.py:26:0 Incompatible variable type [9]: GoodTypeAlias12 is declared to have type `TA` but is used as type `Type[typing.Callable[..., Variable[$synthetic_attribute_resolution_variable]]]`.', 'aliases_explicit.py:26:31 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[typing.Any, Type[Variable[$synthetic_attribute_resolution_variable]]]` but got `Tuple[ParamSpec, None]`.'] Line 41: Unexpected errors ['aliases_explicit.py:41:8 Undefined or invalid type [11]: Annotation `GoodTypeAlias9` is not defined as a type.'] Line 44: Unexpected errors ['aliases_explicit.py:44:9 Undefined or invalid type [11]: Annotation `GoodTypeAlias12` is not defined as a type.'] +Line 57: Unexpected errors ['aliases_explicit.py:57:4 Assert type [70]: Expected `typing.Callable[[int, str, str], None]` but got `unknown`.'] +Line 60: Unexpected errors ['aliases_explicit.py:60:4 Assert type [70]: Expected `typing.Callable[..., None]` but got `unknown`.'] Line 97: Unexpected errors ['aliases_explicit.py:97:16 Call error [29]: `TA` is not a function.'] """ diff --git a/conformance/results/pyre/aliases_implicit.toml b/conformance/results/pyre/aliases_implicit.toml index 1d00603e1..322c29325 100644 --- a/conformance/results/pyre/aliases_implicit.toml +++ b/conformance/results/pyre/aliases_implicit.toml @@ -12,6 +12,8 @@ aliases_implicit.py:38:26 Incompatible parameter type [6]: In call `typing.Gener aliases_implicit.py:42:27 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[typing.Any, Type[Variable[$synthetic_attribute_resolution_variable]]]` but got `Tuple[ParamSpec, None]`. aliases_implicit.py:54:8 Undefined or invalid type [11]: Annotation `GoodTypeAlias9` is not defined as a type. aliases_implicit.py:58:9 Undefined or invalid type [11]: Annotation `GoodTypeAlias13` is not defined as a type. +aliases_implicit.py:68:4 Assert type [70]: Expected `typing.Callable[[int, str, str], None]` but got `unknown`. +aliases_implicit.py:72:4 Assert type [70]: Expected `typing.Callable[..., None]` but got `unknown`. aliases_implicit.py:106:8 Undefined or invalid type [11]: Annotation `BadTypeAlias1` is not defined as a type. aliases_implicit.py:107:8 Undefined or invalid type [11]: Annotation `BadTypeAlias2` is not defined as a type. aliases_implicit.py:108:8 Undefined or invalid type [11]: Annotation `BadTypeAlias3` is not defined as a type. @@ -26,7 +28,7 @@ aliases_implicit.py:116:9 Undefined or invalid type [11]: Annotation `BadTypeAli aliases_implicit.py:117:9 Undefined or invalid type [11]: Annotation `BadTypeAlias12` is not defined as a type. aliases_implicit.py:118:9 Undefined or invalid type [11]: Annotation `BadTypeAlias13` is not defined as a type. aliases_implicit.py:119:9 Undefined or invalid type [11]: Annotation `BadTypeAlias14` is not defined as a type. -aliases_implicit.py:131:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `List[int]` but got `typing.Any`. +aliases_implicit.py:131:0 Assert type [70]: Expected `List[int]` but got `typing.Any`. """ conformance_automated = "Fail" errors_diff = """ @@ -42,5 +44,7 @@ Line 38: Unexpected errors ['aliases_implicit.py:38:26 Incompatible parameter ty Line 42: Unexpected errors ['aliases_implicit.py:42:27 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[typing.Any, Type[Variable[$synthetic_attribute_resolution_variable]]]` but got `Tuple[ParamSpec, None]`.'] Line 54: Unexpected errors ['aliases_implicit.py:54:8 Undefined or invalid type [11]: Annotation `GoodTypeAlias9` is not defined as a type.'] Line 58: Unexpected errors ['aliases_implicit.py:58:9 Undefined or invalid type [11]: Annotation `GoodTypeAlias13` is not defined as a type.'] -Line 131: Unexpected errors ['aliases_implicit.py:131:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `List[int]` but got `typing.Any`.'] +Line 68: Unexpected errors ['aliases_implicit.py:68:4 Assert type [70]: Expected `typing.Callable[[int, str, str], None]` but got `unknown`.'] +Line 72: Unexpected errors ['aliases_implicit.py:72:4 Assert type [70]: Expected `typing.Callable[..., None]` but got `unknown`.'] +Line 131: Unexpected errors ['aliases_implicit.py:131:0 Assert type [70]: Expected `List[int]` but got `typing.Any`.'] """ diff --git a/conformance/results/pyre/aliases_newtype.toml b/conformance/results/pyre/aliases_newtype.toml index e9de50146..86ab3d228 100644 --- a/conformance/results/pyre/aliases_newtype.toml +++ b/conformance/results/pyre/aliases_newtype.toml @@ -15,7 +15,6 @@ aliases_newtype.py:38:5 Invalid type parameters [24]: Non-generic type `GoodNewT aliases_newtype.py:44:37 Invalid inheritance [39]: `typing.Union[int, str]` is not a valid parent class. aliases_newtype.py:51:37 Invalid inheritance [39]: `typing_extensions.Literal[7]` is not a valid parent class. aliases_newtype.py:60:14 Too many arguments [19]: Call `NewType.__init__` expects 2 positional arguments, 3 were provided. -aliases_newtype.py:62:37 Invalid inheritance [39]: `typing.Any` is not a valid parent class. """ conformance_automated = "Fail" errors_diff = """ @@ -25,4 +24,5 @@ Line 32: Expected 1 errors Line 47: Expected 1 errors Line 49: Expected 1 errors Line 58: Expected 1 errors +Line 62: Expected 1 errors """ diff --git a/conformance/results/pyre/aliases_recursive.toml b/conformance/results/pyre/aliases_recursive.toml index a87f4cf4d..69aeafb12 100644 --- a/conformance/results/pyre/aliases_recursive.toml +++ b/conformance/results/pyre/aliases_recursive.toml @@ -8,7 +8,7 @@ aliases_recursive.py:19:0 Incompatible variable type [9]: j4 is declared to have aliases_recursive.py:20:0 Incompatible variable type [9]: j5 is declared to have type `aliases_recursive.Json (resolves to Union[None, Dict[str, Json], List[Json], float, int, str])` but is used as type `List[complex]`. aliases_recursive.py:30:29 Undefined attribute [16]: `tuple` has no attribute `__getitem__`. aliases_recursive.py:33:4 Undefined or invalid type [11]: Annotation `RecursiveTuple` is not defined as a type. -aliases_recursive.py:42:39 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[Type[Variable[_KT]], Type[Variable[_VT_co](covariant)]]` but got `Tuple[Type[str], str]`. +aliases_recursive.py:42:39 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[Type[Variable[_KT]], Type[Variable[_VT_co]]]` but got `Tuple[Type[str], str]`. aliases_recursive.py:44:4 Undefined or invalid type [11]: Annotation `RecursiveMapping` is not defined as a type. aliases_recursive.py:58:20 Undefined attribute [16]: `list` has no attribute `__getitem__`. aliases_recursive.py:61:4 Undefined or invalid type [11]: Annotation `SpecializedTypeAlias1` is not defined as a type. @@ -29,7 +29,7 @@ Line 63: Expected 1 errors Line 69: Expected 1 errors Line 30: Unexpected errors ['aliases_recursive.py:30:29 Undefined attribute [16]: `tuple` has no attribute `__getitem__`.'] Line 33: Unexpected errors ['aliases_recursive.py:33:4 Undefined or invalid type [11]: Annotation `RecursiveTuple` is not defined as a type.'] -Line 42: Unexpected errors ['aliases_recursive.py:42:39 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[Type[Variable[_KT]], Type[Variable[_VT_co](covariant)]]` but got `Tuple[Type[str], str]`.'] +Line 42: Unexpected errors ['aliases_recursive.py:42:39 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[Type[Variable[_KT]], Type[Variable[_VT_co]]]` but got `Tuple[Type[str], str]`.'] Line 44: Unexpected errors ['aliases_recursive.py:44:4 Undefined or invalid type [11]: Annotation `RecursiveMapping` is not defined as a type.'] Line 58: Unexpected errors ['aliases_recursive.py:58:20 Undefined attribute [16]: `list` has no attribute `__getitem__`.'] Line 61: Unexpected errors ['aliases_recursive.py:61:4 Undefined or invalid type [11]: Annotation `SpecializedTypeAlias1` is not defined as a type.'] diff --git a/conformance/results/pyre/aliases_type_statement.toml b/conformance/results/pyre/aliases_type_statement.toml index 31559fcb5..e3ce7deb4 100644 --- a/conformance/results/pyre/aliases_type_statement.toml +++ b/conformance/results/pyre/aliases_type_statement.toml @@ -1,9 +1,36 @@ -conformant = "Unsupported" +conformant = "Partial" notes = """ -Does not support `type` statement. +Does not complain when a type alias cannot be used as a base class. +Does not complain when a type alias cannot be used as a function. +Does not complain when a type statement definition combines new and old TypeVars. +Does not complain when a type statement definition uses old TypeVars. +Does not properly support recursive aliases. """ output = """ -aliases_type_statement.py:8:6 Parsing failure [404]: invalid syntax +aliases_type_statement.py:37:0 Invalid type [31]: Expression `eval("".join(map(chr, [105, 110, 116])))` is not a valid type. +aliases_type_statement.py:38:0 Invalid type [31]: Expression `[int, str]` is not a valid type. +aliases_type_statement.py:39:0 Invalid type [31]: Expression `((int, str))` is not a valid type. +aliases_type_statement.py:40:0 Invalid type [31]: Expression `comprehension(int for generators(generator(i in range(1) if )))` is not a valid type. +aliases_type_statement.py:41:0 Invalid type [31]: Expression `{ "a":"b" }` is not a valid type. +aliases_type_statement.py:42:0 Invalid type [31]: Expression `lambda () (int)()` is not a valid type. +aliases_type_statement.py:43:0 Invalid type [31]: Expression `[int][0]` is not a valid type. +aliases_type_statement.py:44:0 Invalid type [31]: Expression `int if 1 < 3 else str` is not a valid type. +aliases_type_statement.py:45:0 Undefined or invalid type [11]: Annotation `var1` is not defined as a type. +aliases_type_statement.py:46:0 Invalid type [31]: Expression `True` is not a valid type. +aliases_type_statement.py:47:0 Invalid type [31]: Expression `1` is not a valid type. +aliases_type_statement.py:48:0 Invalid type [31]: Expression `list or set` is not a valid type. +aliases_type_statement.py:49:0 Invalid type [31]: Expression `f"{"int"}"` is not a valid type. +aliases_type_statement.py:72:0 Incompatible variable type [9]: r1_1 is declared to have type `aliases_type_statement.RecursiveTypeAlias1 (resolves to Union[List[aliases_type_statement.RecursiveTypeAlias1 (resolves to Union[List[RecursiveTypeAlias1], T])], T])` but is used as type `int`. +aliases_type_statement.py:73:0 Incompatible variable type [9]: r1_2 is declared to have type `aliases_type_statement.RecursiveTypeAlias1 (resolves to Union[List[aliases_type_statement.RecursiveTypeAlias1 (resolves to Union[List[RecursiveTypeAlias1], T])], T])` but is used as type `List[Union[List[int], int]]`. +aliases_type_statement.py:77:6 Invalid type [31]: Expression `RecursiveTypeAlias2[(str, str, ...)]` is not a valid type. +aliases_type_statement.py:78:6 Invalid type [31]: Expression `RecursiveTypeAlias2[(int, str, ...)]` is not a valid type. +aliases_type_statement.py:79:6 Invalid type [31]: Expression `RecursiveTypeAlias2[(int, int, ...)]` is not a valid type. +aliases_type_statement.py:80:6 Invalid type [31]: Expression `RecursiveTypeAlias2[(int, str, [int, str])]` is not a valid type. +aliases_type_statement.py:82:0 Undefined or invalid type [11]: Annotation `RecursiveTypeAlias3` is not defined as a type. +aliases_type_statement.py:84:0 Invalid type parameters [24]: Non-generic type `RecursiveTypeAlias4` cannot take parameters. +aliases_type_statement.py:84:0 Undefined or invalid type [11]: Annotation `RecursiveTypeAlias4` is not defined as a type. +aliases_type_statement.py:88:0 Undefined or invalid type [11]: Annotation `RecursiveTypeAlias7` is not defined as a type. +aliases_type_statement.py:89:0 Undefined or invalid type [11]: Annotation `RecursiveTypeAlias6` is not defined as a type. """ conformance_automated = "Fail" errors_diff = """ @@ -12,27 +39,12 @@ Line 19: Expected 1 errors Line 23: Expected 1 errors Line 26: Expected 1 errors Line 31: Expected 1 errors -Line 37: Expected 1 errors -Line 38: Expected 1 errors -Line 39: Expected 1 errors -Line 40: Expected 1 errors -Line 41: Expected 1 errors -Line 42: Expected 1 errors -Line 43: Expected 1 errors -Line 44: Expected 1 errors -Line 45: Expected 1 errors -Line 46: Expected 1 errors -Line 47: Expected 1 errors -Line 48: Expected 1 errors -Line 49: Expected 1 errors Line 56: Expected 1 errors Line 62: Expected 1 errors Line 67: Expected 1 errors -Line 77: Expected 1 errors -Line 79: Expected 1 errors -Line 82: Expected 1 errors -Line 84: Expected 1 errors Lines 51, 52: Expected error (tag 'TA14') -Lines 88, 89: Expected error (tag 'RTA6') -Line 8: Unexpected errors ['aliases_type_statement.py:8:6 Parsing failure [404]: invalid syntax'] +Line 72: Unexpected errors ['aliases_type_statement.py:72:0 Incompatible variable type [9]: r1_1 is declared to have type `aliases_type_statement.RecursiveTypeAlias1 (resolves to Union[List[aliases_type_statement.RecursiveTypeAlias1 (resolves to Union[List[RecursiveTypeAlias1], T])], T])` but is used as type `int`.'] +Line 73: Unexpected errors ['aliases_type_statement.py:73:0 Incompatible variable type [9]: r1_2 is declared to have type `aliases_type_statement.RecursiveTypeAlias1 (resolves to Union[List[aliases_type_statement.RecursiveTypeAlias1 (resolves to Union[List[RecursiveTypeAlias1], T])], T])` but is used as type `List[Union[List[int], int]]`.'] +Line 78: Unexpected errors ['aliases_type_statement.py:78:6 Invalid type [31]: Expression `RecursiveTypeAlias2[(int, str, ...)]` is not a valid type.'] +Line 80: Unexpected errors ['aliases_type_statement.py:80:6 Invalid type [31]: Expression `RecursiveTypeAlias2[(int, str, [int, str])]` is not a valid type.'] """ diff --git a/conformance/results/pyre/aliases_typealiastype.toml b/conformance/results/pyre/aliases_typealiastype.toml index 152a87de7..29cd273f5 100644 --- a/conformance/results/pyre/aliases_typealiastype.toml +++ b/conformance/results/pyre/aliases_typealiastype.toml @@ -6,11 +6,9 @@ output = """ aliases_typealiastype.py:17:41 Undefined attribute [16]: `list` has no attribute `__getitem__`. aliases_typealiastype.py:22:13 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[typing.Any, Type[Variable[$synthetic_attribute_resolution_variable]]]` but got `Tuple[ParamSpec, TypeVar]`. aliases_typealiastype.py:22:65 Undefined attribute [16]: `tuple` has no attribute `__getitem__`. -aliases_typealiastype.py:27:45 Undefined attribute [16]: `list` has no attribute `__getitem__`. aliases_typealiastype.py:32:6 Undefined attribute [16]: `TypeAliasType` has no attribute `other_attrib`. aliases_typealiastype.py:35:4 Undefined or invalid type [11]: Annotation `GoodAlias4` is not defined as a type. aliases_typealiastype.py:37:4 Undefined or invalid type [11]: Annotation `GoodAlias5` is not defined as a type. -aliases_typealiastype.py:39:4 Invalid type [31]: Expression `GoodAlias5[(int, str, [int, str], *tuple[(int, str, int)])]` is not a valid type. """ conformance_automated = "Fail" errors_diff = """ @@ -36,8 +34,6 @@ Line 63: Expected 1 errors Line 64: Expected 1 errors Line 17: Unexpected errors ['aliases_typealiastype.py:17:41 Undefined attribute [16]: `list` has no attribute `__getitem__`.'] Line 22: Unexpected errors ['aliases_typealiastype.py:22:13 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[typing.Any, Type[Variable[$synthetic_attribute_resolution_variable]]]` but got `Tuple[ParamSpec, TypeVar]`.', 'aliases_typealiastype.py:22:65 Undefined attribute [16]: `tuple` has no attribute `__getitem__`.'] -Line 27: Unexpected errors ['aliases_typealiastype.py:27:45 Undefined attribute [16]: `list` has no attribute `__getitem__`.'] Line 35: Unexpected errors ['aliases_typealiastype.py:35:4 Undefined or invalid type [11]: Annotation `GoodAlias4` is not defined as a type.'] Line 37: Unexpected errors ['aliases_typealiastype.py:37:4 Undefined or invalid type [11]: Annotation `GoodAlias5` is not defined as a type.'] -Line 39: Unexpected errors ['aliases_typealiastype.py:39:4 Invalid type [31]: Expression `GoodAlias5[(int, str, [int, str], *tuple[(int, str, int)])]` is not a valid type.'] """ diff --git a/conformance/results/pyre/aliases_variance.toml b/conformance/results/pyre/aliases_variance.toml index 76fec94ce..a5492b60e 100644 --- a/conformance/results/pyre/aliases_variance.toml +++ b/conformance/results/pyre/aliases_variance.toml @@ -1,9 +1,9 @@ conformant = "Pass" output = """ -aliases_variance.py:24:0 Invalid type variance [46]: The type variable `Variable[T_co](covariant)` is incompatible with parent class type variable `Variable[T]` because subclasses cannot use more permissive type variables than their superclasses. -aliases_variance.py:28:0 Invalid type variance [46]: The type variable `Variable[T_co](covariant)` is incompatible with parent class type variable `Variable[T]` because subclasses cannot use more permissive type variables than their superclasses. -aliases_variance.py:32:0 Invalid type variance [46]: The type variable `Variable[T_co](covariant)` is incompatible with parent class type variable `Variable[T]` because subclasses cannot use more permissive type variables than their superclasses. -aliases_variance.py:44:0 Invalid type variance [46]: The type variable `Variable[T_contra](contravariant)` is incompatible with parent class type variable `Variable[T]` because subclasses cannot use more permissive type variables than their superclasses. +aliases_variance.py:24:0 Invalid type variance [46]: The type variable `Variable[T_co](covariant)` is incompatible with parent class type variable `Variable[T](invariant)` because subclasses cannot use more permissive type variables than their superclasses. +aliases_variance.py:28:0 Invalid type variance [46]: The type variable `Variable[T_co](covariant)` is incompatible with parent class type variable `Variable[T](invariant)` because subclasses cannot use more permissive type variables than their superclasses. +aliases_variance.py:32:0 Invalid type variance [46]: The type variable `Variable[T_co](covariant)` is incompatible with parent class type variable `Variable[T](invariant)` because subclasses cannot use more permissive type variables than their superclasses. +aliases_variance.py:44:0 Invalid type variance [46]: The type variable `Variable[T_contra](contravariant)` is incompatible with parent class type variable `Variable[T](invariant)` because subclasses cannot use more permissive type variables than their superclasses. """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyre/annotations_forward_refs.toml b/conformance/results/pyre/annotations_forward_refs.toml index 6c52e88e7..6dd78f971 100644 --- a/conformance/results/pyre/annotations_forward_refs.toml +++ b/conformance/results/pyre/annotations_forward_refs.toml @@ -13,7 +13,7 @@ annotations_forward_refs.py:42:8 Invalid type [31]: Expression `"[int, str]"` is annotations_forward_refs.py:43:8 Invalid type [31]: Expression `"(int, str)"` is not a valid type. annotations_forward_refs.py:44:8 Undefined or invalid type [11]: Annotation `comprehension(int for generators(generator($target$i in range(1) if )))` is not defined as a type. annotations_forward_refs.py:45:8 Invalid type [31]: Expression `"{ }"` is not a valid type. -annotations_forward_refs.py:46:8 Undefined or invalid type [11]: Annotation `lambda () (int)()` is not defined as a type. +annotations_forward_refs.py:46:8 Invalid type [31]: Expression `lambda () (int)()` is not a valid type. annotations_forward_refs.py:47:8 Invalid type [31]: Expression `[int][0]` is not a valid type. annotations_forward_refs.py:48:8 Invalid type [31]: Expression `"int if 1 < 3 else str"` is not a valid type. annotations_forward_refs.py:49:8 Undefined or invalid type [11]: Annotation `var1` is not defined as a type. @@ -24,6 +24,7 @@ annotations_forward_refs.py:53:9 Invalid type [31]: Expression `"int or str"` is annotations_forward_refs.py:55:9 Undefined or invalid type [11]: Annotation `types` is not defined as a type. annotations_forward_refs.py:80:12 Undefined or invalid type [11]: Annotation `ClassF` is not defined as a type. annotations_forward_refs.py:87:7 Undefined or invalid type [11]: Annotation `ClassD.int` is not defined as a type. +annotations_forward_refs.py:96:0 Assert type [70]: Expected `int` but got `unknown`. annotations_forward_refs.py:103:7 Undefined or invalid type [11]: Annotation ` """ conformance_automated = "Fail" @@ -36,5 +37,6 @@ Line 54: Expected 1 errors Line 66: Expected 1 errors Line 89: Expected 1 errors Line 87: Unexpected errors ['annotations_forward_refs.py:87:7 Undefined or invalid type [11]: Annotation `ClassD.int` is not defined as a type.'] +Line 96: Unexpected errors ['annotations_forward_refs.py:96:0 Assert type [70]: Expected `int` but got `unknown`.'] Line 103: Unexpected errors ['annotations_forward_refs.py:103:7 Undefined or invalid type [11]: Annotation `'] """ diff --git a/conformance/results/pyre/annotations_generators.toml b/conformance/results/pyre/annotations_generators.toml index 4f05a0844..4ce5994d1 100644 --- a/conformance/results/pyre/annotations_generators.toml +++ b/conformance/results/pyre/annotations_generators.toml @@ -15,12 +15,12 @@ annotations_generators.py:92:4 Incompatible return type [7]: Expected `int` but annotations_generators.py:118:4 Incompatible return type [7]: Expected `Iterator[B]` but got `Generator[A, None, typing.Any]`. annotations_generators.py:119:4 Incompatible return type [7]: Expected `Iterator[B]` but got `Generator[int, None, typing.Any]`. annotations_generators.py:135:4 Incompatible return type [7]: Expected `Generator[None, str, None]` but got `Generator[None, int, typing.Any]`. -annotations_generators.py:182:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing.Callable[[], Coroutine[typing.Any, typing.Any, AsyncIterator[int]]]` but got `typing.Callable(generator29)[[], AsyncIterator[int]]`. +annotations_generators.py:182:0 Assert type [70]: Expected `typing.Callable[[], Coroutine[typing.Any, typing.Any, AsyncIterator[int]]]` but got `typing.Callable(generator29)[[], AsyncIterator[int]]`. """ conformance_automated = "Fail" errors_diff = """ Line 51: Expected 1 errors Line 86: Expected 1 errors Line 88: Unexpected errors ['annotations_generators.py:88:4 Incompatible return type [7]: Expected `int` but got `Generator[typing.Any, typing.Any, int]`.'] -Line 182: Unexpected errors ['annotations_generators.py:182:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing.Callable[[], Coroutine[typing.Any, typing.Any, AsyncIterator[int]]]` but got `typing.Callable(generator29)[[], AsyncIterator[int]]`.'] +Line 182: Unexpected errors ['annotations_generators.py:182:0 Assert type [70]: Expected `typing.Callable[[], Coroutine[typing.Any, typing.Any, AsyncIterator[int]]]` but got `typing.Callable(generator29)[[], AsyncIterator[int]]`.'] """ diff --git a/conformance/results/pyre/annotations_methods.toml b/conformance/results/pyre/annotations_methods.toml index c6be1388e..4c131204e 100644 --- a/conformance/results/pyre/annotations_methods.toml +++ b/conformance/results/pyre/annotations_methods.toml @@ -3,7 +3,7 @@ notes = """ Type evaluation differs from other type checkers because of ambiguity in the spec related to method bindings. """ output = """ -annotations_methods.py:42:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `A` but got `B`. +annotations_methods.py:42:0 Assert type [70]: Expected `A` but got `B`. """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyre/callables_annotation.toml b/conformance/results/pyre/callables_annotation.toml index 384310ba3..2d155ba04 100644 --- a/conformance/results/pyre/callables_annotation.toml +++ b/conformance/results/pyre/callables_annotation.toml @@ -18,6 +18,7 @@ callables_annotation.py:59:4 Invalid type [31]: Expression `typing.Callable[([.. callables_annotation.py:89:5 Invalid type [31]: Expression `typing.Callable[(typing.Concatenate[(int, ...)], str)]` is not a valid type. callables_annotation.py:145:8 Invalid type [31]: Expression `typing.Callable[(typing.Concatenate[(int, ...)], None)]` is not a valid type. callables_annotation.py:151:9 Invalid type [31]: Expression `typing.Callable[(typing.Concatenate[(int, ...)], None)]` is not a valid type. +callables_annotation.py:155:4 Incompatible variable type [9]: ok9 is declared to have type `Proto4[[...]]` but is used as type `Proto3`. callables_annotation.py:156:4 Incompatible variable type [9]: ok10 is declared to have type `Proto3` but is used as type `Proto4[[...]]`. callables_annotation.py:157:4 Incompatible variable type [9]: ok11 is declared to have type `Proto6` but is used as type `Proto7`. callables_annotation.py:159:4 Incompatible variable type [9]: err1 is declared to have type `Proto5[typing.Any]` but is used as type `Proto8`. @@ -39,6 +40,7 @@ Line 93: Expected 1 errors Line 89: Unexpected errors ['callables_annotation.py:89:5 Invalid type [31]: Expression `typing.Callable[(typing.Concatenate[(int, ...)], str)]` is not a valid type.'] Line 145: Unexpected errors ['callables_annotation.py:145:8 Invalid type [31]: Expression `typing.Callable[(typing.Concatenate[(int, ...)], None)]` is not a valid type.'] Line 151: Unexpected errors ['callables_annotation.py:151:9 Invalid type [31]: Expression `typing.Callable[(typing.Concatenate[(int, ...)], None)]` is not a valid type.'] +Line 155: Unexpected errors ['callables_annotation.py:155:4 Incompatible variable type [9]: ok9 is declared to have type `Proto4[[...]]` but is used as type `Proto3`.'] Line 156: Unexpected errors ['callables_annotation.py:156:4 Incompatible variable type [9]: ok10 is declared to have type `Proto3` but is used as type `Proto4[[...]]`.'] Line 157: Unexpected errors ['callables_annotation.py:157:4 Incompatible variable type [9]: ok11 is declared to have type `Proto6` but is used as type `Proto7`.'] Line 166: Unexpected errors ['callables_annotation.py:166:0 Incompatible variable type [9]: Callback1 is declared to have type `TypeAlias` but is used as type `Type[typing.Callable[..., str]]`.'] diff --git a/conformance/results/pyre/callables_kwargs.toml b/conformance/results/pyre/callables_kwargs.toml index 596abc4d4..6714bfea2 100644 --- a/conformance/results/pyre/callables_kwargs.toml +++ b/conformance/results/pyre/callables_kwargs.toml @@ -1,31 +1,21 @@ -conformant = "Unsupported" +conformant = "Pass" notes = """ -Does not understand Unpack in the context of **kwargs annotation. """ output = """ -callables_kwargs.py:22:20 Undefined or invalid type [11]: Annotation `Unpack` is not defined as a type. -callables_kwargs.py:24:4 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `typing.Any`. -callables_kwargs.py:32:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `typing.Any`. -callables_kwargs.py:35:4 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `typing.Any`. -callables_kwargs.py:52:4 Too many arguments [19]: Call `func1` expects 1 positional argument, 4 were provided. -callables_kwargs.py:62:12 Incompatible parameter type [6]: In call `func2`, for 1st positional argument, expected `str` but got `object`. -callables_kwargs.py:64:10 Incompatible parameter type [6]: In call `func2`, for 1st positional argument, expected `str` but got `int`. -callables_kwargs.py:65:18 Incompatible parameter type [6]: In call `func2`, for 2nd positional argument, expected `str` but got `object`. -callables_kwargs.py:122:20 Invalid type variable [34]: The type variable `Variable[T (bound to callables_kwargs.TD2)]` isn't present in the function's parameters. +callables_kwargs.py:46:4 Missing argument [20]: Call `func1` expects argument `v3`. +callables_kwargs.py:51:4 Unexpected keyword [28]: Unexpected keyword argument `v4` to call `func1`. +callables_kwargs.py:52:4 Too many arguments [19]: Call `func1` expects 0 positional arguments, 3 were provided. +callables_kwargs.py:58:12 Incompatible parameter type [6]: In call `func1`, for 1st positional argument, expected `TD2` but got `Dict[str, str]`. +callables_kwargs.py:61:12 Incompatible parameter type [6]: In call `func1`, for 1st positional argument, expected `TD2` but got `Dict[str, Union[int, str]]`. +callables_kwargs.py:63:4 Unexpected keyword [28]: Unexpected keyword argument `v1` to call `func1`. +callables_kwargs.py:64:4 Unexpected keyword [28]: Unexpected keyword argument `v3` to call `func2`. +callables_kwargs.py:65:4 Unexpected keyword [28]: Unexpected keyword argument `v1` to call `func2`. +callables_kwargs.py:101:0 Incompatible variable type [9]: v3 is declared to have type `TDProtocol3` but is used as type `typing.Callable(func1)[[Keywords(Unpack[TD2])], None]`. +callables_kwargs.py:102:0 Incompatible variable type [9]: v4 is declared to have type `TDProtocol4` but is used as type `typing.Callable(func1)[[Keywords(Unpack[TD2])], None]`. +callables_kwargs.py:103:0 Incompatible variable type [9]: v5 is declared to have type `TDProtocol5` but is used as type `typing.Callable(func1)[[Keywords(Unpack[TD2])], None]`. +callables_kwargs.py:111:21 Duplicate parameter [65]: Duplicate parameter name `v1`. +callables_kwargs.py:122:12 Invalid type [31]: `Unpack` in kwargs may only be used with typed dictionaries. `Variable[T (bound to TD2)]` is not a typed dictionary. """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 46: Expected 1 errors -Line 51: Expected 1 errors -Line 58: Expected 1 errors -Line 63: Expected 1 errors -Line 101: Expected 1 errors -Line 102: Expected 1 errors -Line 103: Expected 1 errors -Line 111: Expected 1 errors -Line 22: Unexpected errors ['callables_kwargs.py:22:20 Undefined or invalid type [11]: Annotation `Unpack` is not defined as a type.'] -Line 24: Unexpected errors ['callables_kwargs.py:24:4 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `typing.Any`.'] -Line 32: Unexpected errors ['callables_kwargs.py:32:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `typing.Any`.'] -Line 35: Unexpected errors ['callables_kwargs.py:35:4 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `typing.Any`.'] -Line 62: Unexpected errors ['callables_kwargs.py:62:12 Incompatible parameter type [6]: In call `func2`, for 1st positional argument, expected `str` but got `object`.'] """ diff --git a/conformance/results/pyre/callables_protocol.toml b/conformance/results/pyre/callables_protocol.toml index c4630b5ee..a20e7472f 100644 --- a/conformance/results/pyre/callables_protocol.toml +++ b/conformance/results/pyre/callables_protocol.toml @@ -21,14 +21,12 @@ callables_protocol.py:186:4 Incompatible attribute type [8]: Attribute `other_at callables_protocol.py:187:4 Undefined attribute [16]: `Proto9` has no attribute `xxx`. callables_protocol.py:197:6 Undefined attribute [16]: `Proto9` has no attribute `other_attribute2`. callables_protocol.py:216:0 Incompatible variable type [9]: cb10 is declared to have type `Proto10` but is used as type `typing.Callable(cb10_good)[[], None]`. -callables_protocol.py:259:0 Incompatible variable type [9]: cb12 is declared to have type `Proto12` but is used as type `typing.Callable(cb12_good2)[[Variable(typing.Any), Keywords(typing.Any)], None]`. callables_protocol.py:260:0 Incompatible variable type [9]: cb12 is declared to have type `Proto12` but is used as type `typing.Callable(cb12_bad1)[[Variable(typing.Any), KeywordOnly(kwarg0, typing.Any)], None]`. +callables_protocol.py:284:0 Incompatible variable type [9]: cb13_2 is declared to have type `Proto13_Default` but is used as type `typing.Callable(cb13_no_default)[[Named(path, str)], str]`. +callables_protocol.py:311:0 Incompatible variable type [9]: cb14_2 is declared to have type `Proto14_Default` but is used as type `typing.Callable(cb14_no_default)[[KeywordOnly(path, str)], str]`. """ conformance_automated = "Fail" errors_diff = """ Line 238: Expected 1 errors -Line 284: Expected 1 errors -Line 311: Expected 1 errors Line 216: Unexpected errors ['callables_protocol.py:216:0 Incompatible variable type [9]: cb10 is declared to have type `Proto10` but is used as type `typing.Callable(cb10_good)[[], None]`.'] -Line 259: Unexpected errors ['callables_protocol.py:259:0 Incompatible variable type [9]: cb12 is declared to have type `Proto12` but is used as type `typing.Callable(cb12_good2)[[Variable(typing.Any), Keywords(typing.Any)], None]`.'] """ diff --git a/conformance/results/pyre/callables_subtyping.toml b/conformance/results/pyre/callables_subtyping.toml index 4c686d89e..64b9b65f9 100644 --- a/conformance/results/pyre/callables_subtyping.toml +++ b/conformance/results/pyre/callables_subtyping.toml @@ -4,11 +4,8 @@ Rejects standard parameter as incompatible with keyword-only parameter. Rejects use of Callable with ParamSpec in TypeAlias definition. """ errors_diff = """ -Line 236: Expected 1 errors +Line 196: Expected 1 errors Line 57: Unexpected errors ['callables_subtyping.py:57:4 Incompatible variable type [9]: f5 is declared to have type `KwOnly2` but is used as type `Standard2`.'] -Line 188: Unexpected errors ['callables_subtyping.py:188:4 Incompatible variable type [9]: f2 is declared to have type `KwOnly6` but is used as type `IntStrKwargs6`.'] -Line 189: Unexpected errors ['callables_subtyping.py:189:4 Incompatible variable type [9]: f3 is declared to have type `KwOnly6` but is used as type `StrKwargs6`.'] -Line 192: Unexpected errors ['callables_subtyping.py:192:4 Incompatible variable type [9]: f6 is declared to have type `StrKwargs6` but is used as type `IntStrKwargs6`.'] Line 208: Unexpected errors ['callables_subtyping.py:208:0 Incompatible variable type [9]: TypeAliasWithP is declared to have type `TypeAlias` but is used as type `Type[typing.Callable[..., Variable[$synthetic_attribute_resolution_variable]]]`.', 'callables_subtyping.py:208:37 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[typing.Any, Type[Variable[$synthetic_attribute_resolution_variable]]]` but got `Tuple[ParamSpec, None]`.'] Line 211: Unexpected errors ['callables_subtyping.py:211:39 Undefined or invalid type [11]: Annotation `TypeAliasWithP` is not defined as a type.'] Line 253: Unexpected errors ['callables_subtyping.py:253:4 Missing overload implementation [42]: Overloaded function `Overloaded9.__call__` must have an implementation.'] @@ -36,18 +33,15 @@ callables_subtyping.py:151:4 Incompatible variable type [9]: f3 is declared to h callables_subtyping.py:154:4 Incompatible variable type [9]: f5 is declared to have type `FloatKwargs5` but is used as type `NoKwargs5`. callables_subtyping.py:155:4 Incompatible variable type [9]: f6 is declared to have type `FloatKwargs5` but is used as type `IntKwargs5`. callables_subtyping.py:187:4 Incompatible variable type [9]: f1 is declared to have type `KwOnly6` but is used as type `IntKwargs6`. -callables_subtyping.py:188:4 Incompatible variable type [9]: f2 is declared to have type `KwOnly6` but is used as type `IntStrKwargs6`. -callables_subtyping.py:189:4 Incompatible variable type [9]: f3 is declared to have type `KwOnly6` but is used as type `StrKwargs6`. callables_subtyping.py:190:4 Incompatible variable type [9]: f4 is declared to have type `IntStrKwargs6` but is used as type `StrKwargs6`. callables_subtyping.py:191:4 Incompatible variable type [9]: f5 is declared to have type `IntStrKwargs6` but is used as type `IntKwargs6`. -callables_subtyping.py:192:4 Incompatible variable type [9]: f6 is declared to have type `StrKwargs6` but is used as type `IntStrKwargs6`. callables_subtyping.py:193:4 Incompatible variable type [9]: f7 is declared to have type `StrKwargs6` but is used as type `IntKwargs6`. callables_subtyping.py:195:4 Incompatible variable type [9]: f9 is declared to have type `IntKwargs6` but is used as type `StrKwargs6`. -callables_subtyping.py:196:4 Incompatible variable type [9]: f10 is declared to have type `Standard6` but is used as type `IntStrKwargs6`. callables_subtyping.py:197:4 Incompatible variable type [9]: f11 is declared to have type `Standard6` but is used as type `StrKwargs6`. callables_subtyping.py:208:0 Incompatible variable type [9]: TypeAliasWithP is declared to have type `TypeAlias` but is used as type `Type[typing.Callable[..., Variable[$synthetic_attribute_resolution_variable]]]`. callables_subtyping.py:208:37 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[typing.Any, Type[Variable[$synthetic_attribute_resolution_variable]]]` but got `Tuple[ParamSpec, None]`. callables_subtyping.py:211:39 Undefined or invalid type [11]: Annotation `TypeAliasWithP` is not defined as a type. +callables_subtyping.py:236:4 Incompatible variable type [9]: f1 is declared to have type `DefaultArg8` but is used as type `NoDefaultArg8`. callables_subtyping.py:237:4 Incompatible variable type [9]: f2 is declared to have type `DefaultArg8` but is used as type `NoX8`. callables_subtyping.py:240:4 Incompatible variable type [9]: f4 is declared to have type `NoDefaultArg8` but is used as type `NoX8`. callables_subtyping.py:243:4 Incompatible variable type [9]: f6 is declared to have type `NoX8` but is used as type `NoDefaultArg8`. diff --git a/conformance/results/pyre/classes_classvar.toml b/conformance/results/pyre/classes_classvar.toml index 52902aedc..a44ae1aa9 100644 --- a/conformance/results/pyre/classes_classvar.toml +++ b/conformance/results/pyre/classes_classvar.toml @@ -17,7 +17,7 @@ classes_classvar.py:40:13 Unbound name [10]: Name `var` is used but not defined classes_classvar.py:52:4 Incompatible attribute type [8]: Attribute `bad8` declared in class `ClassA` has type `List[str]` but is used as type `Dict[Variable[_KT], Variable[_VT]]`. classes_classvar.py:65:8 Undefined attribute [16]: `ClassA` has no attribute `xx`. classes_classvar.py:68:8 Incompatible return type [7]: Expected `CV[int]` but got `int`. -classes_classvar.py:78:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `float` but got `typing.Any`. +classes_classvar.py:78:0 Assert type [70]: Expected `float` but got `typing.Any`. classes_classvar.py:105:0 Invalid assignment [41]: Assigning to class variable through instance, did you mean to assign to `Starship.stats` instead? classes_classvar.py:134:0 Incompatible variable type [9]: a is declared to have type `ProtoA` but is used as type `ProtoAImpl`. """ @@ -34,5 +34,5 @@ Line 67: Expected 1 errors Line 71: Expected 1 errors Line 72: Expected 1 errors Line 68: Unexpected errors ['classes_classvar.py:68:8 Incompatible return type [7]: Expected `CV[int]` but got `int`.'] -Line 78: Unexpected errors ['classes_classvar.py:78:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `float` but got `typing.Any`.'] +Line 78: Unexpected errors ['classes_classvar.py:78:0 Assert type [70]: Expected `float` but got `typing.Any`.'] """ diff --git a/conformance/results/pyre/classes_override.toml b/conformance/results/pyre/classes_override.toml index ac73d049b..bb4595083 100644 --- a/conformance/results/pyre/classes_override.toml +++ b/conformance/results/pyre/classes_override.toml @@ -1,6 +1,5 @@ -conformant = "Partial" +conformant = "Pass" notes = """ -Does not allow Any as a base class, leading to false positives. """ output = """ classes_override.py:53:4 Invalid override [40]: `classes_override.ChildA.method3` is decorated with @override, but no method of the same name exists in superclasses of `ChildA`. @@ -9,11 +8,7 @@ classes_override.py:65:4 Invalid override [40]: `classes_override.ChildA.method4 classes_override.py:79:4 Invalid override [40]: `classes_override.ChildA.static_method1` is decorated with @override, but no method of the same name exists in superclasses of `ChildA`. classes_override.py:84:4 Invalid override [40]: `classes_override.ChildA.class_method1` is decorated with @override, but no method of the same name exists in superclasses of `ChildA`. classes_override.py:89:4 Invalid override [40]: `classes_override.ChildA.property1` is decorated with @override, but no method of the same name exists in superclasses of `ChildA`. -classes_override.py:95:14 Invalid inheritance [39]: `typing.Any` is not a valid parent class. -classes_override.py:101:4 Invalid override [40]: `classes_override.ChildB.method1` is decorated with @override, but no method of the same name exists in superclasses of `ChildB`. """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 95: Unexpected errors ['classes_override.py:95:14 Invalid inheritance [39]: `typing.Any` is not a valid parent class.'] -Line 101: Unexpected errors ['classes_override.py:101:4 Invalid override [40]: `classes_override.ChildB.method1` is decorated with @override, but no method of the same name exists in superclasses of `ChildB`.'] """ diff --git a/conformance/results/pyre/constructors_call_init.toml b/conformance/results/pyre/constructors_call_init.toml index 9358ef095..0db6964ff 100644 --- a/conformance/results/pyre/constructors_call_init.toml +++ b/conformance/results/pyre/constructors_call_init.toml @@ -3,24 +3,26 @@ notes = """ Does not infer type of Self for self parameter of __init__ method. Does not report errors during binding to self parameter of __init__ method. Does not reject use of class-scoped type variables in annotation of self parameter in __init__ method. +Incorrectly raises Incompatible overload type errors. +Incorrectly raises compatibility type errors. """ conformance_automated = "Fail" errors_diff = """ Line 42: Expected 1 errors Line 56: Expected 1 errors Line 107: Expected 1 errors -Line 24: Unexpected errors ['constructors_call_init.py:24:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Class1[int]` but got `Class1[typing_extensions.Literal[1]]`.'] +Line 24: Unexpected errors ['constructors_call_init.py:24:0 Assert type [70]: Expected `Class1[int]` but got `Class1[typing_extensions.Literal[1]]`.'] Line 61: Unexpected errors ['constructors_call_init.py:61:4 Incompatible overload [43]: The implementation of `Class5.__init__` does not accept all possible arguments of overload defined on line `61`.'] Line 63: Unexpected errors ['constructors_call_init.py:63:4 Incompatible overload [43]: The implementation of `Class5.__init__` does not accept all possible arguments of overload defined on line `63`.'] -Line 91: Unexpected errors ["constructors_call_init.py:91:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Class6[int, str]` but got `Class6[typing_extensions.Literal[0], typing_extensions.Literal['']]`."] -Line 99: Unexpected errors ["constructors_call_init.py:99:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Class7[str, int]` but got `Class7[typing_extensions.Literal[''], typing_extensions.Literal[0]]`."] +Line 91: Unexpected errors ["constructors_call_init.py:91:0 Assert type [70]: Expected `Class6[int, str]` but got `Class6[typing_extensions.Literal[0], typing_extensions.Literal['']]`."] +Line 99: Unexpected errors ["constructors_call_init.py:99:0 Assert type [70]: Expected `Class7[str, int]` but got `Class7[typing_extensions.Literal[''], typing_extensions.Literal[0]]`."] """ output = """ constructors_call_init.py:21:12 Incompatible parameter type [6]: In call `Class1.__init__`, for 1st positional argument, expected `int` but got `float`. -constructors_call_init.py:24:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Class1[int]` but got `Class1[typing_extensions.Literal[1]]`. +constructors_call_init.py:24:0 Assert type [70]: Expected `Class1[int]` but got `Class1[typing_extensions.Literal[1]]`. constructors_call_init.py:61:4 Incompatible overload [43]: The implementation of `Class5.__init__` does not accept all possible arguments of overload defined on line `61`. constructors_call_init.py:63:4 Incompatible overload [43]: The implementation of `Class5.__init__` does not accept all possible arguments of overload defined on line `63`. -constructors_call_init.py:91:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Class6[int, str]` but got `Class6[typing_extensions.Literal[0], typing_extensions.Literal['']]`. -constructors_call_init.py:99:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Class7[str, int]` but got `Class7[typing_extensions.Literal[''], typing_extensions.Literal[0]]`. +constructors_call_init.py:91:0 Assert type [70]: Expected `Class6[int, str]` but got `Class6[typing_extensions.Literal[0], typing_extensions.Literal['']]`. +constructors_call_init.py:99:0 Assert type [70]: Expected `Class7[str, int]` but got `Class7[typing_extensions.Literal[''], typing_extensions.Literal[0]]`. constructors_call_init.py:130:0 Too many arguments [19]: Call `object.__init__` expects 0 positional arguments, 1 was provided. """ diff --git a/conformance/results/pyre/constructors_call_new.toml b/conformance/results/pyre/constructors_call_new.toml index 3974f524a..f0be57944 100644 --- a/conformance/results/pyre/constructors_call_new.toml +++ b/conformance/results/pyre/constructors_call_new.toml @@ -2,29 +2,30 @@ conformant = "Partial" notes = """ Does not support __new__ return type that is not a subclass of the class being constructed. Does not report errors during binding to cls parameter of __new__ method. +Incorrectly raises compatibility type errors. """ conformance_automated = "Fail" errors_diff = """ Line 145: Expected 1 errors -Line 23: Unexpected errors ['constructors_call_new.py:23:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Class1[int]` but got `Class1[typing_extensions.Literal[1]]`.'] -Line 35: Unexpected errors ['constructors_call_new.py:35:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Class2[int]` but got `Class2[typing_extensions.Literal[1]]`.'] -Line 36: Unexpected errors ["constructors_call_new.py:36:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Class2[str]` but got `Class2[typing_extensions.Literal['']]`."] -Line 49: Unexpected errors ['constructors_call_new.py:49:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `Class3`.', 'constructors_call_new.py:49:12 Missing argument [20]: Call `Class3.__init__` expects argument `x`.'] -Line 64: Unexpected errors ['constructors_call_new.py:64:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing.Any` but got `Class4`.', 'constructors_call_new.py:64:12 Missing argument [20]: Call `Class4.__init__` expects argument `x`.'] -Line 76: Unexpected errors ['constructors_call_new.py:76:4 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `NoReturn` but got `Class5`.', 'constructors_call_new.py:76:16 Missing argument [20]: Call `Class5.__init__` expects argument `x`.'] -Line 89: Unexpected errors ['constructors_call_new.py:89:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Union[Class6, int]` but got `Class6`.', 'constructors_call_new.py:89:12 Missing argument [20]: Call `Class6.__init__` expects argument `x`.'] +Line 23: Unexpected errors ['constructors_call_new.py:23:0 Assert type [70]: Expected `Class1[int]` but got `Class1[typing_extensions.Literal[1]]`.'] +Line 35: Unexpected errors ['constructors_call_new.py:35:0 Assert type [70]: Expected `Class2[int]` but got `Class2[typing_extensions.Literal[1]]`.'] +Line 36: Unexpected errors ["constructors_call_new.py:36:0 Assert type [70]: Expected `Class2[str]` but got `Class2[typing_extensions.Literal['']]`."] +Line 49: Unexpected errors ['constructors_call_new.py:49:0 Assert type [70]: Expected `int` but got `Class3`.', 'constructors_call_new.py:49:12 Missing argument [20]: Call `Class3.__init__` expects argument `x`.'] +Line 64: Unexpected errors ['constructors_call_new.py:64:0 Assert type [70]: Expected `typing.Any` but got `Class4`.', 'constructors_call_new.py:64:12 Missing argument [20]: Call `Class4.__init__` expects argument `x`.'] +Line 76: Unexpected errors ['constructors_call_new.py:76:4 Assert type [70]: Expected `NoReturn` but got `Class5`.', 'constructors_call_new.py:76:16 Missing argument [20]: Call `Class5.__init__` expects argument `x`.'] +Line 89: Unexpected errors ['constructors_call_new.py:89:0 Assert type [70]: Expected `Union[Class6, int]` but got `Class6`.', 'constructors_call_new.py:89:12 Missing argument [20]: Call `Class6.__init__` expects argument `x`.'] """ output = """ constructors_call_new.py:21:12 Incompatible parameter type [6]: In call `Class1.__new__`, for 1st positional argument, expected `int` but got `float`. -constructors_call_new.py:23:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Class1[int]` but got `Class1[typing_extensions.Literal[1]]`. -constructors_call_new.py:35:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Class2[int]` but got `Class2[typing_extensions.Literal[1]]`. -constructors_call_new.py:36:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Class2[str]` but got `Class2[typing_extensions.Literal['']]`. -constructors_call_new.py:49:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `Class3`. +constructors_call_new.py:23:0 Assert type [70]: Expected `Class1[int]` but got `Class1[typing_extensions.Literal[1]]`. +constructors_call_new.py:35:0 Assert type [70]: Expected `Class2[int]` but got `Class2[typing_extensions.Literal[1]]`. +constructors_call_new.py:36:0 Assert type [70]: Expected `Class2[str]` but got `Class2[typing_extensions.Literal['']]`. +constructors_call_new.py:49:0 Assert type [70]: Expected `int` but got `Class3`. constructors_call_new.py:49:12 Missing argument [20]: Call `Class3.__init__` expects argument `x`. -constructors_call_new.py:64:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing.Any` but got `Class4`. +constructors_call_new.py:64:0 Assert type [70]: Expected `typing.Any` but got `Class4`. constructors_call_new.py:64:12 Missing argument [20]: Call `Class4.__init__` expects argument `x`. -constructors_call_new.py:76:4 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `NoReturn` but got `Class5`. +constructors_call_new.py:76:4 Assert type [70]: Expected `NoReturn` but got `Class5`. constructors_call_new.py:76:16 Missing argument [20]: Call `Class5.__init__` expects argument `x`. -constructors_call_new.py:89:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Union[Class6, int]` but got `Class6`. +constructors_call_new.py:89:0 Assert type [70]: Expected `Union[Class6, int]` but got `Class6`. constructors_call_new.py:89:12 Missing argument [20]: Call `Class6.__init__` expects argument `x`. """ diff --git a/conformance/results/pyre/constructors_callable.toml b/conformance/results/pyre/constructors_callable.toml index 554365e17..0f3650ea0 100644 --- a/conformance/results/pyre/constructors_callable.toml +++ b/conformance/results/pyre/constructors_callable.toml @@ -4,6 +4,7 @@ Does not generate a union type for __new__ and __init__ when converting class to Does not ignore __init__ based on __new__ return type when converting class to callable. Does not support __new__ return type that is different from class being constructed. Does not use annotated type of self in __init__ method to generate return type of callable. +Incorrectly raises incompatibility type errors. """ conformance_automated = "Fail" errors_diff = """ @@ -11,17 +12,17 @@ Line 127: Expected 1 errors Line 144: Expected 1 errors Line 184: Expected 1 errors Line 195: Expected 1 errors -Line 78: Unexpected errors ['constructors_callable.py:78:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `Class4`.'] -Line 126: Unexpected errors ['constructors_callable.py:126:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Class6Proxy` but got `Class6`.', 'constructors_callable.py:126:12 Missing argument [20]: PositionalOnly call expects argument `x`.'] -Line 143: Unexpected errors ['constructors_callable.py:143:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing.Any` but got `Class6Any`.', 'constructors_callable.py:143:12 Missing argument [20]: PositionalOnly call expects argument `x`.'] +Line 78: Unexpected errors ['constructors_callable.py:78:0 Assert type [70]: Expected `int` but got `Class4`.'] +Line 126: Unexpected errors ['constructors_callable.py:126:0 Assert type [70]: Expected `Class6Proxy` but got `Class6`.', 'constructors_callable.py:126:12 Missing argument [20]: PositionalOnly call expects argument `x`.'] +Line 143: Unexpected errors ['constructors_callable.py:143:0 Assert type [70]: Expected `typing.Any` but got `Class6Any`.', 'constructors_callable.py:143:12 Missing argument [20]: PositionalOnly call expects argument `x`.'] Line 153: Unexpected errors ['constructors_callable.py:153:4 Incompatible overload [43]: The implementation of `Class7.__init__` does not accept all possible arguments of overload defined on line `153`.'] Line 155: Unexpected errors ['constructors_callable.py:155:4 Incompatible overload [43]: The implementation of `Class7.__init__` does not accept all possible arguments of overload defined on line `155`.'] -Line 164: Unexpected errors ['constructors_callable.py:164:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Class7[int]` but got `Class7[typing.Any]`.'] -Line 165: Unexpected errors ['constructors_callable.py:165:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Class7[str]` but got `Class7[typing.Any]`.', 'constructors_callable.py:165:15 Incompatible parameter type [6]: In anonymous call, for 1st positional argument, expected `int` but got `str`.'] +Line 164: Unexpected errors ['constructors_callable.py:164:0 Assert type [70]: Expected `Class7[int]` but got `Class7[typing.Any]`.'] +Line 165: Unexpected errors ['constructors_callable.py:165:0 Assert type [70]: Expected `Class7[str]` but got `Class7[typing.Any]`.', 'constructors_callable.py:165:15 Incompatible parameter type [6]: In anonymous call, for 1st positional argument, expected `int` but got `str`.'] Line 181: Unexpected errors ['constructors_callable.py:181:22 Incompatible parameter type [6]: In call `accepts_callable`, for 1st positional argument, expected `typing.Callable[constructors_callable.P, Variable[R]]` but got `Type[Class8]`.'] -Line 183: Unexpected errors ['constructors_callable.py:183:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Class8[str]` but got `typing.Any`.'] +Line 183: Unexpected errors ['constructors_callable.py:183:0 Assert type [70]: Expected `Class8[str]` but got `typing.Any`.'] Line 192: Unexpected errors ['constructors_callable.py:192:22 Incompatible parameter type [6]: In call `accepts_callable`, for 1st positional argument, expected `typing.Callable[constructors_callable.P, Variable[R]]` but got `Type[Class9]`.'] -Line 194: Unexpected errors ['constructors_callable.py:194:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Class9` but got `typing.Any`.'] +Line 194: Unexpected errors ['constructors_callable.py:194:0 Assert type [70]: Expected `Class9` but got `typing.Any`.'] """ output = """ constructors_callable.py:36:0 Revealed type [-1]: Revealed type for `r1` is `typing.Callable[[Named(x, int)], Class1]`. @@ -34,26 +35,26 @@ constructors_callable.py:65:0 Missing argument [20]: PositionalOnly call expects constructors_callable.py:66:0 Unexpected keyword [28]: Unexpected keyword argument `y` to anonymous call. constructors_callable.py:67:0 Too many arguments [19]: PositionalOnly call expects 1 positional argument, 2 were provided. constructors_callable.py:77:0 Revealed type [-1]: Revealed type for `r4` is `typing.Callable[[Named(x, int)], Class4]`. -constructors_callable.py:78:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `Class4`. +constructors_callable.py:78:0 Assert type [70]: Expected `int` but got `Class4`. constructors_callable.py:79:0 Missing argument [20]: PositionalOnly call expects argument `x`. constructors_callable.py:80:0 Unexpected keyword [28]: Unexpected keyword argument `y` to anonymous call. constructors_callable.py:97:0 Revealed type [-1]: Revealed type for `r5` is `typing.Callable[[Variable(typing.Any), Keywords(typing.Any)], NoReturn]`. constructors_callable.py:125:0 Revealed type [-1]: Revealed type for `r6` is `typing.Callable[[Named(x, int)], Class6]`. -constructors_callable.py:126:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Class6Proxy` but got `Class6`. +constructors_callable.py:126:0 Assert type [70]: Expected `Class6Proxy` but got `Class6`. constructors_callable.py:126:12 Missing argument [20]: PositionalOnly call expects argument `x`. constructors_callable.py:142:0 Revealed type [-1]: Revealed type for `r6_any` is `typing.Callable[[Named(x, int)], Class6Any]`. -constructors_callable.py:143:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing.Any` but got `Class6Any`. +constructors_callable.py:143:0 Assert type [70]: Expected `typing.Any` but got `Class6Any`. constructors_callable.py:143:12 Missing argument [20]: PositionalOnly call expects argument `x`. constructors_callable.py:153:4 Incompatible overload [43]: The implementation of `Class7.__init__` does not accept all possible arguments of overload defined on line `153`. constructors_callable.py:155:4 Incompatible overload [43]: The implementation of `Class7.__init__` does not accept all possible arguments of overload defined on line `155`. constructors_callable.py:161:0 Revealed type [-1]: Revealed type for `r7` is `typing.Callable[[Named(x, int)], Class7[typing.Any]]`. -constructors_callable.py:164:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Class7[int]` but got `Class7[typing.Any]`. -constructors_callable.py:165:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Class7[str]` but got `Class7[typing.Any]`. +constructors_callable.py:164:0 Assert type [70]: Expected `Class7[int]` but got `Class7[typing.Any]`. +constructors_callable.py:165:0 Assert type [70]: Expected `Class7[str]` but got `Class7[typing.Any]`. constructors_callable.py:165:15 Incompatible parameter type [6]: In anonymous call, for 1st positional argument, expected `int` but got `str`. constructors_callable.py:181:22 Incompatible parameter type [6]: In call `accepts_callable`, for 1st positional argument, expected `typing.Callable[constructors_callable.P, Variable[R]]` but got `Type[Class8]`. constructors_callable.py:182:0 Revealed type [-1]: Revealed type for `r8` is `typing.Callable[..., typing.Any]`. -constructors_callable.py:183:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Class8[str]` but got `typing.Any`. +constructors_callable.py:183:0 Assert type [70]: Expected `Class8[str]` but got `typing.Any`. constructors_callable.py:192:22 Incompatible parameter type [6]: In call `accepts_callable`, for 1st positional argument, expected `typing.Callable[constructors_callable.P, Variable[R]]` but got `Type[Class9]`. constructors_callable.py:193:0 Revealed type [-1]: Revealed type for `r9` is `typing.Callable[..., typing.Any]`. -constructors_callable.py:194:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Class9` but got `typing.Any`. +constructors_callable.py:194:0 Assert type [70]: Expected `Class9` but got `typing.Any`. """ diff --git a/conformance/results/pyre/dataclasses_descriptors.toml b/conformance/results/pyre/dataclasses_descriptors.toml index 0f99b5978..05c108e48 100644 --- a/conformance/results/pyre/dataclasses_descriptors.toml +++ b/conformance/results/pyre/dataclasses_descriptors.toml @@ -1,19 +1,20 @@ conformant = "Partial" notes = """ Incorrectly generates error when calling constructor of dataclass with descriptor. +Incorrectly raises incompatibility type errors. """ output = """ dataclasses_descriptors.py:35:10 Incompatible parameter type [6]: In call `DC1.__init__`, for 1st positional argument, expected `Desc1` but got `int`. -dataclasses_descriptors.py:61:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `List[int]` but got `Desc2[int]`. -dataclasses_descriptors.py:62:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `List[str]` but got `Desc2[str]`. -dataclasses_descriptors.py:66:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `Desc2[int]`. -dataclasses_descriptors.py:67:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `Desc2[str]`. +dataclasses_descriptors.py:61:0 Assert type [70]: Expected `List[int]` but got `Desc2[int]`. +dataclasses_descriptors.py:62:0 Assert type [70]: Expected `List[str]` but got `Desc2[str]`. +dataclasses_descriptors.py:66:0 Assert type [70]: Expected `int` but got `Desc2[int]`. +dataclasses_descriptors.py:67:0 Assert type [70]: Expected `str` but got `Desc2[str]`. """ conformance_automated = "Fail" errors_diff = """ Line 35: Unexpected errors ['dataclasses_descriptors.py:35:10 Incompatible parameter type [6]: In call `DC1.__init__`, for 1st positional argument, expected `Desc1` but got `int`.'] -Line 61: Unexpected errors ['dataclasses_descriptors.py:61:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `List[int]` but got `Desc2[int]`.'] -Line 62: Unexpected errors ['dataclasses_descriptors.py:62:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `List[str]` but got `Desc2[str]`.'] -Line 66: Unexpected errors ['dataclasses_descriptors.py:66:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `Desc2[int]`.'] -Line 67: Unexpected errors ['dataclasses_descriptors.py:67:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `Desc2[str]`.'] +Line 61: Unexpected errors ['dataclasses_descriptors.py:61:0 Assert type [70]: Expected `List[int]` but got `Desc2[int]`.'] +Line 62: Unexpected errors ['dataclasses_descriptors.py:62:0 Assert type [70]: Expected `List[str]` but got `Desc2[str]`.'] +Line 66: Unexpected errors ['dataclasses_descriptors.py:66:0 Assert type [70]: Expected `int` but got `Desc2[int]`.'] +Line 67: Unexpected errors ['dataclasses_descriptors.py:67:0 Assert type [70]: Expected `str` but got `Desc2[str]`.'] """ diff --git a/conformance/results/pyre/dataclasses_transform_func.toml b/conformance/results/pyre/dataclasses_transform_func.toml index 2f69091f4..1cefede1c 100644 --- a/conformance/results/pyre/dataclasses_transform_func.toml +++ b/conformance/results/pyre/dataclasses_transform_func.toml @@ -5,7 +5,6 @@ Does not detect non-frozen class inheriting from frozen class. Emits "attribute not initialized" error for dataclass field. """ output = """ -dataclasses_transform_func.py:20:0 Incompatible overload [43]: The implementation of `create_model` does not accept all possible arguments of overload defined on line `20`. dataclasses_transform_func.py:25:5 Invalid type variable [34]: The type variable `Variable[T]` isn't present in the function's parameters. dataclasses_transform_func.py:29:0 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s). dataclasses_transform_func.py:35:4 Uninitialized attribute [13]: Attribute `id` is declared in class `Customer1` to have type `int` but is never initialized. @@ -27,7 +26,6 @@ dataclasses_transform_func.py:97:0 Invalid assignment [41]: Cannot reassign fina conformance_automated = "Fail" errors_diff = """ Lines 89, 90: Expected error (tag 'Customer3Subclass') -Line 20: Unexpected errors ['dataclasses_transform_func.py:20:0 Incompatible overload [43]: The implementation of `create_model` does not accept all possible arguments of overload defined on line `20`.'] Line 25: Unexpected errors ["dataclasses_transform_func.py:25:5 Invalid type variable [34]: The type variable `Variable[T]` isn't present in the function's parameters."] Line 29: Unexpected errors ['dataclasses_transform_func.py:29:0 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).'] Line 35: Unexpected errors ['dataclasses_transform_func.py:35:4 Uninitialized attribute [13]: Attribute `id` is declared in class `Customer1` to have type `int` but is never initialized.'] diff --git a/conformance/results/pyre/dataclasses_usage.toml b/conformance/results/pyre/dataclasses_usage.toml index 4620f9ec1..f0a0ea0d5 100644 --- a/conformance/results/pyre/dataclasses_usage.toml +++ b/conformance/results/pyre/dataclasses_usage.toml @@ -3,6 +3,7 @@ notes = """ Does not report error when field with no default follows field with default. Complains on `assert_type` when used for bound methods vs `Callable`. Does not understand `__dataclass_fields__`. +Incorrectly raises incompatibility type errors. """ output = """ dataclasses_usage.py:50:5 Missing argument [20]: Call `InventoryItem.__init__` expects argument `unit_price`. @@ -11,14 +12,13 @@ dataclasses_usage.py:52:5 Too many arguments [19]: Call `InventoryItem.__init__` dataclasses_usage.py:72:4 Undefined attribute [16]: `typing.Type` has no attribute `a`. dataclasses_usage.py:83:5 Too many arguments [19]: Call `DC4.__init__` expects 1 positional argument, 2 were provided. dataclasses_usage.py:88:4 Incompatible attribute type [8]: Attribute `a` declared in class `DC5` has type `int` but is used as type `str`. -dataclasses_usage.py:106:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing.Callable[[str], int]` but got `BoundMethod[typing.Callable[[str], int], DC6]`. dataclasses_usage.py:127:0 Too many arguments [19]: Call `DC7.__init__` expects 1 positional argument, 2 were provided. dataclasses_usage.py:130:0 Missing argument [20]: Call `DC8.__init__` expects argument `y`. dataclasses_usage.py:173:4 Uninitialized attribute [13]: Attribute `x` is declared in class `DC13` to have type `int` but is never initialized. dataclasses_usage.py:174:4 Uninitialized attribute [13]: Attribute `x_squared` is declared in class `DC13` to have type `int` but is never initialized. dataclasses_usage.py:179:0 Too many arguments [19]: Call `object.__init__` expects 0 positional arguments, 1 was provided. dataclasses_usage.py:205:0 Incompatible variable type [9]: v7 is declared to have type `DataclassProto` but is used as type `DC15`. -dataclasses_usage.py:213:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `DC16[int]` but got `DC16[typing_extensions.Literal[1]]`. +dataclasses_usage.py:213:0 Assert type [70]: Expected `DC16[int]` but got `DC16[typing_extensions.Literal[1]]`. """ conformance_automated = "Fail" errors_diff = """ @@ -26,9 +26,8 @@ Lines 58, 61: Expected error (tag 'DC1') Lines 64, 67: Expected error (tag 'DC2') Lines 70, 73: Expected error (tag 'DC3') Line 72: Unexpected errors ['dataclasses_usage.py:72:4 Undefined attribute [16]: `typing.Type` has no attribute `a`.'] -Line 106: Unexpected errors ['dataclasses_usage.py:106:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing.Callable[[str], int]` but got `BoundMethod[typing.Callable[[str], int], DC6]`.'] Line 173: Unexpected errors ['dataclasses_usage.py:173:4 Uninitialized attribute [13]: Attribute `x` is declared in class `DC13` to have type `int` but is never initialized.'] Line 174: Unexpected errors ['dataclasses_usage.py:174:4 Uninitialized attribute [13]: Attribute `x_squared` is declared in class `DC13` to have type `int` but is never initialized.'] Line 205: Unexpected errors ['dataclasses_usage.py:205:0 Incompatible variable type [9]: v7 is declared to have type `DataclassProto` but is used as type `DC15`.'] -Line 213: Unexpected errors ['dataclasses_usage.py:213:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `DC16[int]` but got `DC16[typing_extensions.Literal[1]]`.'] +Line 213: Unexpected errors ['dataclasses_usage.py:213:0 Assert type [70]: Expected `DC16[int]` but got `DC16[typing_extensions.Literal[1]]`.'] """ diff --git a/conformance/results/pyre/directives_assert_type.toml b/conformance/results/pyre/directives_assert_type.toml index 2afa3ee8f..7c81101d7 100644 --- a/conformance/results/pyre/directives_assert_type.toml +++ b/conformance/results/pyre/directives_assert_type.toml @@ -1,13 +1,12 @@ conformant = "Pass" notes = """ -Does not weaken literal types in `assert_type`, which some (other) tests rely on. """ output = """ -directives_assert_type.py:27:4 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `Union[int, str]`. -directives_assert_type.py:28:4 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `typing.Any`. -directives_assert_type.py:29:4 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `typing_extensions.Literal[4]`. +directives_assert_type.py:27:4 Assert type [70]: Expected `int` but got `Union[int, str]`. +directives_assert_type.py:28:4 Assert type [70]: Expected `int` but got `typing.Any`. +directives_assert_type.py:29:4 Assert type [70]: Expected `int` but got `typing_extensions.Literal[4]`. directives_assert_type.py:31:4 Missing argument [20]: Call `assert_type` expects argument in position 0. -directives_assert_type.py:32:4 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `str`. +directives_assert_type.py:32:4 Assert type [70]: Expected `int` but got `typing_extensions.Literal['']`. directives_assert_type.py:33:4 Too many arguments [19]: Call `assert_type` expects 2 positional arguments, 3 were provided. """ conformance_automated = "Pass" diff --git a/conformance/results/pyre/directives_reveal_type.toml b/conformance/results/pyre/directives_reveal_type.toml index 492d32b28..64a213ec3 100644 --- a/conformance/results/pyre/directives_reveal_type.toml +++ b/conformance/results/pyre/directives_reveal_type.toml @@ -1,6 +1,5 @@ -conformant = "Partial" +conformant = "Pass" notes = """ -Produces errors rather than warnings on `reveal_type`. """ output = """ directives_reveal_type.py:14:4 Revealed type [-1]: Revealed type for `a` is `typing.Union[int, str]`. @@ -8,9 +7,8 @@ directives_reveal_type.py:15:4 Revealed type [-1]: Revealed type for `b` is `typ directives_reveal_type.py:16:4 Revealed type [-1]: Revealed type for `c` is `typing.Any`. directives_reveal_type.py:17:4 Revealed type [-1]: Revealed type for `d` is `ForwardReference`. directives_reveal_type.py:19:4 Missing argument [20]: Call `reveal_type` expects argument in position 0. -directives_reveal_type.py:20:4 Revealed type [-1]: Revealed type for `a` is `typing.Union[int, str]`. +directives_reveal_type.py:20:4 Too many arguments [19]: Call `reveal_type` expects 1 positional argument, 2 were provided. """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 20: Expected 1 errors """ diff --git a/conformance/results/pyre/directives_type_ignore_file1.toml b/conformance/results/pyre/directives_type_ignore_file1.toml index 3efc56a3e..07cd73b25 100644 --- a/conformance/results/pyre/directives_type_ignore_file1.toml +++ b/conformance/results/pyre/directives_type_ignore_file1.toml @@ -1,11 +1,8 @@ -conformant = "Unsupported" +conformant = "Pass" notes = """ -Does not support file-level `#type: ignore` comment. """ output = """ -directives_type_ignore_file1.py:16:0 Incompatible variable type [9]: x is declared to have type `int` but is used as type `str`. """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 16: Unexpected errors ['directives_type_ignore_file1.py:16:0 Incompatible variable type [9]: x is declared to have type `int` but is used as type `str`.'] """ diff --git a/conformance/results/pyre/directives_version_platform.toml b/conformance/results/pyre/directives_version_platform.toml index 24d9f1ea7..01d4e4b4f 100644 --- a/conformance/results/pyre/directives_version_platform.toml +++ b/conformance/results/pyre/directives_version_platform.toml @@ -1,16 +1,10 @@ -conformant = "Partial" +conformant = "Pass" notes = """ -Does not support sys.platform checks. -Does not support os.name checks. """ output = """ -directives_version_platform.py:31:4 Incompatible variable type [9]: val5 is declared to have type `int` but is used as type `str`. -directives_version_platform.py:36:4 Incompatible variable type [9]: val6 is declared to have type `int` but is used as type `str`. directives_version_platform.py:40:4 Incompatible variable type [9]: val7 is declared to have type `int` but is used as type `str`. directives_version_platform.py:45:4 Incompatible variable type [9]: val8 is declared to have type `int` but is used as type `str`. """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 31: Unexpected errors ['directives_version_platform.py:31:4 Incompatible variable type [9]: val5 is declared to have type `int` but is used as type `str`.'] -Line 36: Unexpected errors ['directives_version_platform.py:36:4 Incompatible variable type [9]: val6 is declared to have type `int` but is used as type `str`.'] """ diff --git a/conformance/results/pyre/enums_behaviors.toml b/conformance/results/pyre/enums_behaviors.toml index 42e562319..49c045e26 100644 --- a/conformance/results/pyre/enums_behaviors.toml +++ b/conformance/results/pyre/enums_behaviors.toml @@ -1,10 +1,9 @@ -conformant = "Partial" +conformant = "Pass" notes = """ -Does not enforce that Enum classes are implicitly final. """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 39: Expected 1 errors """ output = """ +enums_behaviors.py:39:0 Invalid inheritance [39]: Cannot inherit from final enum `Shape`. Enums with defined members cannot be extended. """ diff --git a/conformance/results/pyre/enums_definition.toml b/conformance/results/pyre/enums_definition.toml index 832a9d48d..7e80103fa 100644 --- a/conformance/results/pyre/enums_definition.toml +++ b/conformance/results/pyre/enums_definition.toml @@ -1,11 +1,8 @@ -conformant = "Partial" +conformant = "Pass" notes = """ -Does not support custom Enum classes based on EnumType metaclass. -Does not support some functional forms for Enum class definitions (optional). """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 75: Unexpected errors ['enums_definition.py:75:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[Color11.RED]` but got `int`.'] """ output = """ enums_definition.py:24:9 Too many arguments [19]: Call `Enum.__new__` expects 1 positional argument, 4 were provided. @@ -13,7 +10,8 @@ enums_definition.py:27:9 Too many arguments [19]: Call `Enum.__new__` expects 1 enums_definition.py:28:9 Too many arguments [19]: Call `Enum.__new__` expects 1 positional argument, 2 were provided. enums_definition.py:31:9 Too many arguments [19]: Call `Enum.__new__` expects 1 positional argument, 2 were provided. enums_definition.py:33:12 Undefined attribute [16]: `Enum` has no attribute `RED`. +enums_definition.py:38:0 Assert type [70]: Expected `typing_extensions.Literal[Color7.RED]` but got `unknown`. enums_definition.py:38:12 Undefined attribute [16]: `Color7` has no attribute `RED`. +enums_definition.py:39:0 Assert type [70]: Expected `typing_extensions.Literal[Color8.RED]` but got `unknown`. enums_definition.py:39:12 Undefined attribute [16]: `Color8` has no attribute `RED`. -enums_definition.py:75:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[Color11.RED]` but got `int`. """ diff --git a/conformance/results/pyre/enums_expansion.toml b/conformance/results/pyre/enums_expansion.toml index 8b75a929a..340065e03 100644 --- a/conformance/results/pyre/enums_expansion.toml +++ b/conformance/results/pyre/enums_expansion.toml @@ -1,12 +1,11 @@ conformant = "Pass" notes = """ -Does not perform type narrowing based on enum literal expansion (optional). """ conformance_automated = "Pass" errors_diff = """ """ output = """ -enums_expansion.py:25:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[Color.GREEN]` but got `Color`. -enums_expansion.py:35:12 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Never` but got `Color`. -enums_expansion.py:53:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[CustomFlags.FLAG3]` but got `CustomFlags`. +enums_expansion.py:25:8 Assert type [70]: Expected `typing_extensions.Literal[Color.GREEN]` but got `Color`. +enums_expansion.py:35:12 Assert type [70]: Expected `Never` but got `Color`. +enums_expansion.py:53:8 Assert type [70]: Expected `typing_extensions.Literal[CustomFlags.FLAG3]` but got `CustomFlags`. """ diff --git a/conformance/results/pyre/enums_member_names.toml b/conformance/results/pyre/enums_member_names.toml index 109185b53..263b2fab7 100644 --- a/conformance/results/pyre/enums_member_names.toml +++ b/conformance/results/pyre/enums_member_names.toml @@ -6,8 +6,8 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -enums_member_names.py:21:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal['RED']` but got `str`. -enums_member_names.py:22:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal['RED']` but got `typing.Any`. -enums_member_names.py:26:4 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Union[typing_extensions.Literal['BLUE'], typing_extensions.Literal['RED']]` but got `typing.Any`. -enums_member_names.py:30:4 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Union[typing_extensions.Literal['BLUE'], typing_extensions.Literal['GREEN'], typing_extensions.Literal['RED']]` but got `typing.Any`. +enums_member_names.py:21:0 Assert type [70]: Expected `typing_extensions.Literal['RED']` but got `str`. +enums_member_names.py:22:0 Assert type [70]: Expected `typing_extensions.Literal['RED']` but got `str`. +enums_member_names.py:26:4 Assert type [70]: Expected `Union[typing_extensions.Literal['BLUE'], typing_extensions.Literal['RED']]` but got `str`. +enums_member_names.py:30:4 Assert type [70]: Expected `Union[typing_extensions.Literal['BLUE'], typing_extensions.Literal['GREEN'], typing_extensions.Literal['RED']]` but got `str`. """ diff --git a/conformance/results/pyre/enums_member_values.toml b/conformance/results/pyre/enums_member_values.toml index 842417414..e14ce8a6e 100644 --- a/conformance/results/pyre/enums_member_values.toml +++ b/conformance/results/pyre/enums_member_values.toml @@ -1,23 +1,17 @@ -conformant = "Partial" +conformant = "Pass" notes = """ -Does not enforce declared type of `_value_`. -Does not enforce assigned tuple types for enum members (optional). -Does not evaluate literal types for enum member values (optional). -Does not evaluate literal types for auto values (optional). """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 78: Expected 1 errors -Line 85: Expected 1 errors -Line 76: Unexpected errors ['enums_member_values.py:76:4 Uninitialized attribute [13]: Attribute `_value_` is declared in class `Color3` to have type `Color3` but is never initialized.'] """ output = """ -enums_member_values.py:21:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[1]` but got `typing.Any`. -enums_member_values.py:22:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[1]` but got `typing.Any`. -enums_member_values.py:26:4 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Union[typing_extensions.Literal[1], typing_extensions.Literal[3]]` but got `typing.Any`. -enums_member_values.py:30:4 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Union[typing_extensions.Literal[1], typing_extensions.Literal[2], typing_extensions.Literal[3]]` but got `typing.Any`. -enums_member_values.py:54:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[1]` but got `typing.Any`. -enums_member_values.py:68:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[1]` but got `typing.Any`. -enums_member_values.py:76:4 Uninitialized attribute [13]: Attribute `_value_` is declared in class `Color3` to have type `Color3` but is never initialized. -enums_member_values.py:96:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `typing.Any`. +enums_member_values.py:21:0 Assert type [70]: Expected `typing_extensions.Literal[1]` but got `typing.Any`. +enums_member_values.py:22:0 Assert type [70]: Expected `typing_extensions.Literal[1]` but got `typing.Any`. +enums_member_values.py:26:4 Assert type [70]: Expected `Union[typing_extensions.Literal[1], typing_extensions.Literal[3]]` but got `typing.Any`. +enums_member_values.py:30:4 Assert type [70]: Expected `Union[typing_extensions.Literal[1], typing_extensions.Literal[2], typing_extensions.Literal[3]]` but got `typing.Any`. +enums_member_values.py:54:0 Assert type [70]: Expected `typing_extensions.Literal[1]` but got `typing.Any`. +enums_member_values.py:68:0 Assert type [70]: Expected `typing_extensions.Literal[1]` but got `typing.Any`. +enums_member_values.py:78:4 Incompatible attribute type [8]: Attribute `GREEN` declared in class `Color3` has type `int` but is used as type `str`. +enums_member_values.py:85:8 Incompatible attribute type [8]: Attribute `_value_` declared in class `Planet2` has type `str` but is used as type `int`. +enums_member_values.py:96:0 Assert type [70]: Expected `int` but got `typing.Any`. """ diff --git a/conformance/results/pyre/enums_members.toml b/conformance/results/pyre/enums_members.toml index 34529ba59..91220359c 100644 --- a/conformance/results/pyre/enums_members.toml +++ b/conformance/results/pyre/enums_members.toml @@ -11,30 +11,18 @@ Does not support `_ignore_` mechanism (optional). """ conformance_automated = "Fail" errors_diff = """ -Line 50: Expected 1 errors Line 82: Expected 1 errors Line 83: Expected 1 errors Line 116: Expected 1 errors Line 129: Expected 1 errors -Line 27: Unexpected errors ['enums_members.py:27:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `Pet`.'] -Line 28: Unexpected errors ['enums_members.py:28:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `Pet`.'] -Line 35: Unexpected errors ['enums_members.py:35:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `Pet2`.'] -Line 36: Unexpected errors ['enums_members.py:36:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `Pet2`.'] -Line 100: Unexpected errors ['enums_members.py:100:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[TrafficLight.YELLOW]` but got `typing_extensions.Literal[TrafficLight.AMBER]`.'] -Line 117: Unexpected errors ['enums_members.py:117:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[Example.c]` but got `member[typing.Callable(Example.c)[[Named(self, Example)], None]]`.'] -Line 139: Unexpected errors ['enums_members.py:139:4 Inconsistent override [15]: `_ignore_` overrides attribute defined in `Enum` inconsistently. Type `Pet5` is not a subtype of the overridden attribute `typing.Union[typing.List[str], str]`.'] +Line 100: Unexpected errors ['enums_members.py:100:0 Assert type [70]: Expected `typing_extensions.Literal[TrafficLight.YELLOW]` but got `typing_extensions.Literal[TrafficLight.AMBER]`.'] """ output = """ -enums_members.py:27:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `Pet`. -enums_members.py:28:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `Pet`. -enums_members.py:35:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `Pet2`. -enums_members.py:36:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `Pet2`. -enums_members.py:84:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[Pet4.species]` but got `str`. -enums_members.py:85:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[Pet4.speak]` but got `typing.Callable(Pet4.speak)[[Named(self, Pet4)], None]`. -enums_members.py:100:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[TrafficLight.YELLOW]` but got `typing_extensions.Literal[TrafficLight.AMBER]`. -enums_members.py:117:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[Example.c]` but got `member[typing.Callable(Example.c)[[Named(self, Example)], None]]`. +enums_members.py:50:4 Illegal annotation target [35]: Target `enums_members.Pet3.DOG` cannot be annotated as it is an enum member. Enum value types can be specified by annotating the `_value_` attribute. +enums_members.py:84:0 Assert type [70]: Expected `typing_extensions.Literal[Pet4.species]` but got `str`. +enums_members.py:85:0 Assert type [70]: Expected `typing_extensions.Literal[Pet4.speak]` but got `typing.Callable(Pet4.speak)[[Named(self, Pet4)], None]`. +enums_members.py:100:0 Assert type [70]: Expected `typing_extensions.Literal[TrafficLight.YELLOW]` but got `typing_extensions.Literal[TrafficLight.AMBER]`. enums_members.py:128:8 Revealed type [-1]: Revealed type for `enums_members.Example2._Example2__B` is `typing_extensions.Literal[Example2._Example2__B]` (final). -enums_members.py:139:4 Inconsistent override [15]: `_ignore_` overrides attribute defined in `Enum` inconsistently. Type `Pet5` is not a subtype of the overridden attribute `typing.Union[typing.List[str], str]`. -enums_members.py:146:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `Pet5`. -enums_members.py:147:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `Pet5`. +enums_members.py:146:0 Assert type [70]: Expected `int` but got `typing_extensions.Literal[Pet5.DOG]`. +enums_members.py:147:0 Assert type [70]: Expected `int` but got `typing_extensions.Literal[Pet5.FISH]`. """ diff --git a/conformance/results/pyre/exceptions_context_managers.toml b/conformance/results/pyre/exceptions_context_managers.toml index 9dff9945b..507ba6241 100644 --- a/conformance/results/pyre/exceptions_context_managers.toml +++ b/conformance/results/pyre/exceptions_context_managers.toml @@ -1,13 +1,13 @@ -conformant = "Unsupported" +conformant = "Partial" notes = """ -Does not understand context manager exception rules. +assert_type causes failures. """ conformance_automated = "Fail" errors_diff = """ -Line 50: Unexpected errors ['exceptions_context_managers.py:50:4 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Union[int, str]` but got `str`.'] -Line 57: Unexpected errors ['exceptions_context_managers.py:57:4 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Union[int, str]` but got `str`.'] +Line 50: Unexpected errors ['exceptions_context_managers.py:50:4 Assert type [70]: Expected `Union[int, str]` but got `str`.'] +Line 57: Unexpected errors ['exceptions_context_managers.py:57:4 Assert type [70]: Expected `Union[int, str]` but got `str`.'] """ output = """ -exceptions_context_managers.py:50:4 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Union[int, str]` but got `str`. -exceptions_context_managers.py:57:4 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Union[int, str]` but got `str`. +exceptions_context_managers.py:50:4 Assert type [70]: Expected `Union[int, str]` but got `str`. +exceptions_context_managers.py:57:4 Assert type [70]: Expected `Union[int, str]` but got `str`. """ diff --git a/conformance/results/pyre/generics_basic.toml b/conformance/results/pyre/generics_basic.toml index b7e8d00b0..0b3d5e6d6 100644 --- a/conformance/results/pyre/generics_basic.toml +++ b/conformance/results/pyre/generics_basic.toml @@ -12,14 +12,14 @@ generics_basic.py:34:15 Incompatible parameter type [6]: In call `str.__add__`, generics_basic.py:40:14 Incompatible parameter type [6]: In call `concat`, for 2nd positional argument, expected `Variable[AnyStr <: [str, bytes]]` but got `bytes`. generics_basic.py:41:14 Incompatible parameter type [6]: In call `concat`, for 2nd positional argument, expected `Variable[AnyStr <: [str, bytes]]` but got `str`. generics_basic.py:49:0 Invalid type [31]: TypeVar can't have a single explicit constraint. Did you mean `bound=str`? -generics_basic.py:55:52 Undefined attribute [16]: `list` has no attribute `__getitem__`. generics_basic.py:69:14 Incompatible parameter type [6]: In call `concat`, for 2nd positional argument, expected `Variable[AnyStr <: [str, bytes]]` but got `bytes`. generics_basic.py:121:0 Duplicate type variables [59]: Duplicate type variable `T` in Generic[...]. +generics_basic.py:157:7 Incompatible parameter type [6]: In call `typing.Mapping.__getitem__`, for 1st positional argument, expected `str` but got `int`. +generics_basic.py:158:7 Incompatible parameter type [6]: In call `typing.Mapping.__getitem__`, for 1st positional argument, expected `str` but got `int`. """ conformance_automated = "Fail" errors_diff = """ -Line 157: Expected 1 errors -Line 158: Expected 1 errors +Line 55: Expected 1 errors Line 191: Expected 1 errors Line 34: Unexpected errors ['generics_basic.py:34:4 Incompatible return type [7]: Expected `Variable[AnyStr <: [str, bytes]]` but got `str`.', 'generics_basic.py:34:15 Incompatible parameter type [6]: In call `str.__add__`, for 1st positional argument, expected `str` but got `Variable[AnyStr <: [str, bytes]]`.'] """ diff --git a/conformance/results/pyre/generics_defaults.toml b/conformance/results/pyre/generics_defaults.toml index 5e641c5b9..2db9965f2 100644 --- a/conformance/results/pyre/generics_defaults.toml +++ b/conformance/results/pyre/generics_defaults.toml @@ -6,64 +6,64 @@ output = """ generics_defaults.py:24:31 Undefined or invalid type [11]: Annotation `DefaultStrT` is not defined as a type. generics_defaults.py:24:31 Undefined or invalid type [11]: Annotation `T` is not defined as a type. generics_defaults.py:27:20 Undefined or invalid type [11]: Annotation `DefaultIntT` is not defined as a type. -generics_defaults.py:30:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Type[NoNonDefaults[]]` but got `Type[NoNonDefaults]`. +generics_defaults.py:30:0 Assert type [70]: Expected `Type[NoNonDefaults[]]` but got `Type[NoNonDefaults]`. generics_defaults.py:30:27 Invalid type parameters [24]: Non-generic type `NoNonDefaults` cannot take parameters. -generics_defaults.py:31:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Type[NoNonDefaults[]]` but got `typing.Any`. +generics_defaults.py:31:0 Assert type [70]: Expected `Type[NoNonDefaults[]]` but got `typing.Any`. generics_defaults.py:31:12 Undefined attribute [16]: `NoNonDefaults` has no attribute `__getitem__`. generics_defaults.py:31:32 Invalid type parameters [24]: Non-generic type `NoNonDefaults` cannot take parameters. -generics_defaults.py:32:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Type[NoNonDefaults[]]` but got `typing.Any`. +generics_defaults.py:32:0 Assert type [70]: Expected `Type[NoNonDefaults[]]` but got `typing.Any`. generics_defaults.py:32:37 Invalid type parameters [24]: Non-generic type `NoNonDefaults` cannot take parameters. generics_defaults.py:35:17 Undefined or invalid type [11]: Annotation `DefaultBoolT` is not defined as a type. -generics_defaults.py:38:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Type[OneDefault[]]` but got `typing.Any`. +generics_defaults.py:38:0 Assert type [70]: Expected `Type[OneDefault[]]` but got `typing.Any`. generics_defaults.py:38:12 Undefined attribute [16]: `OneDefault` has no attribute `__getitem__`. generics_defaults.py:38:31 Invalid type parameters [24]: Non-generic type `OneDefault` cannot take parameters. -generics_defaults.py:39:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `OneDefault[]` but got `typing.Any`. +generics_defaults.py:39:0 Assert type [70]: Expected `OneDefault[]` but got `typing.Any`. generics_defaults.py:39:33 Invalid type parameters [24]: Non-generic type `OneDefault` cannot take parameters. generics_defaults.py:42:21 Undefined or invalid type [11]: Annotation `T1` is not defined as a type. generics_defaults.py:42:21 Undefined or invalid type [11]: Annotation `T2` is not defined as a type. -generics_defaults.py:45:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Type[AllTheDefaults[]]` but got `Type[AllTheDefaults]`. +generics_defaults.py:45:0 Assert type [70]: Expected `Type[AllTheDefaults[]]` but got `Type[AllTheDefaults]`. generics_defaults.py:45:28 Invalid type parameters [24]: Non-generic type `AllTheDefaults` cannot take parameters. -generics_defaults.py:46:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Type[AllTheDefaults[]]` but got `typing.Any`. +generics_defaults.py:46:0 Assert type [70]: Expected `Type[AllTheDefaults[]]` but got `typing.Any`. generics_defaults.py:47:4 Undefined attribute [16]: `AllTheDefaults` has no attribute `__getitem__`. generics_defaults.py:47:34 Invalid type parameters [24]: Non-generic type `AllTheDefaults` cannot take parameters. -generics_defaults.py:52:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Type[AllTheDefaults[]]` but got `typing.Any`. +generics_defaults.py:52:0 Assert type [70]: Expected `Type[AllTheDefaults[]]` but got `typing.Any`. generics_defaults.py:53:34 Invalid type parameters [24]: Non-generic type `AllTheDefaults` cannot take parameters. -generics_defaults.py:55:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Type[AllTheDefaults[]]` but got `typing.Any`. +generics_defaults.py:55:0 Assert type [70]: Expected `Type[AllTheDefaults[]]` but got `typing.Any`. generics_defaults.py:57:4 Invalid type parameters [24]: Non-generic type `AllTheDefaults` cannot take parameters. -generics_defaults.py:59:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Type[AllTheDefaults[]]` but got `typing.Any`. +generics_defaults.py:59:0 Assert type [70]: Expected `Type[AllTheDefaults[]]` but got `typing.Any`. generics_defaults.py:61:4 Invalid type parameters [24]: Non-generic type `AllTheDefaults` cannot take parameters. -generics_defaults.py:63:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Type[AllTheDefaults[]]` but got `typing.Any`. +generics_defaults.py:63:0 Assert type [70]: Expected `Type[AllTheDefaults[]]` but got `typing.Any`. generics_defaults.py:65:4 Invalid type parameters [24]: Non-generic type `AllTheDefaults` cannot take parameters. -generics_defaults.py:73:33 Incompatible parameter type [6]: In call `ParamSpec.__init__`, for argument `default`, expected `Union[None, Type[typing.Any], str]` but got `List[Type[Union[int, str]]]`. generics_defaults.py:76:22 Undefined or invalid type [11]: Annotation `DefaultP` is not defined as a type. -generics_defaults.py:79:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Type[Class_ParamSpec[]]` but got `Type[Class_ParamSpec]`. +generics_defaults.py:79:0 Assert type [70]: Expected `Type[Class_ParamSpec[]]` but got `Type[Class_ParamSpec]`. generics_defaults.py:79:29 Invalid type parameters [24]: Non-generic type `Class_ParamSpec` cannot take parameters. -generics_defaults.py:80:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Class_ParamSpec[]` but got `Class_ParamSpec`. +generics_defaults.py:80:0 Assert type [70]: Expected `Class_ParamSpec[]` but got `Class_ParamSpec`. generics_defaults.py:80:31 Invalid type parameters [24]: Non-generic type `Class_ParamSpec` cannot take parameters. -generics_defaults.py:81:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Class_ParamSpec[]` but got `typing.Any`. +generics_defaults.py:81:0 Assert type [70]: Expected `Class_ParamSpec[]` but got `typing.Any`. generics_defaults.py:81:12 Undefined attribute [16]: `Class_ParamSpec` has no attribute `__getitem__`. generics_defaults.py:81:45 Invalid type parameters [24]: Non-generic type `Class_ParamSpec` cannot take parameters. -generics_defaults.py:88:53 Undefined attribute [16]: `tuple` has no attribute `__getitem__`. -generics_defaults.py:91:25 Invalid type [31]: Expression `typing.Generic[(*DefaultTs)]` is not a valid type. -generics_defaults.py:94:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Type[Class_TypeVarTuple[]]` but got `Type[Class_TypeVarTuple]`. -generics_defaults.py:94:32 Invalid type [31]: Expression `type[generics_defaults.Class_TypeVarTuple[(*tuple[(str, int)])]]` is not a valid type. +generics_defaults.py:91:25 Undefined or invalid type [11]: Annotation `DefaultTs` is not defined as a type. +generics_defaults.py:94:0 Assert type [70]: Expected `Type[Class_TypeVarTuple[]]` but got `Type[Class_TypeVarTuple]`. generics_defaults.py:94:32 Invalid type parameters [24]: Non-generic type `Class_TypeVarTuple` cannot take parameters. -generics_defaults.py:95:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Class_TypeVarTuple[]` but got `Class_TypeVarTuple`. +generics_defaults.py:95:0 Assert type [70]: Expected `Class_TypeVarTuple[]` but got `Class_TypeVarTuple`. generics_defaults.py:95:34 Invalid type parameters [24]: Non-generic type `Class_TypeVarTuple` cannot take parameters. -generics_defaults.py:96:31 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[]` but got `Tuple[Type[int], Type[bool]]`. Expected has length 0, but actual has length 2. +generics_defaults.py:96:0 Assert type [70]: Expected `Class_TypeVarTuple[]` but got `typing.Any`. +generics_defaults.py:96:12 Undefined attribute [16]: `Class_TypeVarTuple` has no attribute `__getitem__`. +generics_defaults.py:96:45 Invalid type parameters [24]: Non-generic type `Class_TypeVarTuple` cannot take parameters. generics_defaults.py:124:13 Undefined or invalid type [11]: Annotation `T4` is not defined as a type. -generics_defaults.py:138:11 Invalid type [31]: Expression `typing.Generic[(*Ts, T5)]` is not a valid type. +generics_defaults.py:127:0 Assert type [70]: Expected `int` but got `unknown`. +generics_defaults.py:138:11 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Ts`. generics_defaults.py:138:11 Undefined or invalid type [11]: Annotation `T5` is not defined as a type. -generics_defaults.py:145:19 Incompatible parameter type [6]: In call `ParamSpec.__init__`, for argument `default`, expected `Union[None, Type[typing.Any], str]` but got `List[Type[float]]`. -generics_defaults.py:148:11 Invalid type [31]: Expression `typing.Generic[(*Ts, P)]` is not a valid type. +generics_defaults.py:148:11 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Ts`. generics_defaults.py:148:11 Undefined or invalid type [11]: Annotation `P` is not defined as a type. -generics_defaults.py:151:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Type[Foo6[]]` but got `typing.Any`. +generics_defaults.py:151:0 Assert type [70]: Expected `Type[Foo6[]]` but got `typing.Any`. generics_defaults.py:151:12 Undefined attribute [16]: `Foo6` has no attribute `__getitem__`. generics_defaults.py:151:28 Invalid type parameters [24]: Non-generic type `Foo6` cannot take parameters. -generics_defaults.py:152:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Type[Foo6[]]` but got `typing.Any`. +generics_defaults.py:152:0 Assert type [70]: Expected `Type[Foo6[]]` but got `typing.Any`. generics_defaults.py:152:37 Invalid type parameters [24]: Non-generic type `Foo6` cannot take parameters. -generics_defaults.py:166:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing.Callable[[Foo7[]], Foo7[]]` but got `typing.Callable(Foo7.meth)[[Variable[_Self_generics_defaults_Foo7__ (bound to Foo7)]], Variable[_Self_generics_defaults_Foo7__ (bound to Foo7)]]`. +generics_defaults.py:166:0 Assert type [70]: Expected `typing.Callable[[Foo7[]], Foo7[]]` but got `typing.Callable(Foo7.meth)[[Variable[_Self_generics_defaults_Foo7__ (bound to Foo7)]], Variable[_Self_generics_defaults_Foo7__ (bound to Foo7)]]`. generics_defaults.py:166:23 Invalid type parameters [24]: Non-generic type `Foo7` cannot take parameters. +generics_defaults.py:167:0 Assert type [70]: Expected `int` but got `unknown`. """ conformance_automated = "Fail" errors_diff = """ @@ -71,38 +71,37 @@ Line 50: Expected 1 errors Line 104: Expected 1 errors Line 111: Expected 1 errors Line 27: Unexpected errors ['generics_defaults.py:27:20 Undefined or invalid type [11]: Annotation `DefaultIntT` is not defined as a type.'] -Line 30: Unexpected errors ['generics_defaults.py:30:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Type[NoNonDefaults[]]` but got `Type[NoNonDefaults]`.', 'generics_defaults.py:30:27 Invalid type parameters [24]: Non-generic type `NoNonDefaults` cannot take parameters.'] -Line 31: Unexpected errors ['generics_defaults.py:31:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Type[NoNonDefaults[]]` but got `typing.Any`.', 'generics_defaults.py:31:12 Undefined attribute [16]: `NoNonDefaults` has no attribute `__getitem__`.', 'generics_defaults.py:31:32 Invalid type parameters [24]: Non-generic type `NoNonDefaults` cannot take parameters.'] -Line 32: Unexpected errors ['generics_defaults.py:32:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Type[NoNonDefaults[]]` but got `typing.Any`.', 'generics_defaults.py:32:37 Invalid type parameters [24]: Non-generic type `NoNonDefaults` cannot take parameters.'] +Line 30: Unexpected errors ['generics_defaults.py:30:0 Assert type [70]: Expected `Type[NoNonDefaults[]]` but got `Type[NoNonDefaults]`.', 'generics_defaults.py:30:27 Invalid type parameters [24]: Non-generic type `NoNonDefaults` cannot take parameters.'] +Line 31: Unexpected errors ['generics_defaults.py:31:0 Assert type [70]: Expected `Type[NoNonDefaults[]]` but got `typing.Any`.', 'generics_defaults.py:31:12 Undefined attribute [16]: `NoNonDefaults` has no attribute `__getitem__`.', 'generics_defaults.py:31:32 Invalid type parameters [24]: Non-generic type `NoNonDefaults` cannot take parameters.'] +Line 32: Unexpected errors ['generics_defaults.py:32:0 Assert type [70]: Expected `Type[NoNonDefaults[]]` but got `typing.Any`.', 'generics_defaults.py:32:37 Invalid type parameters [24]: Non-generic type `NoNonDefaults` cannot take parameters.'] Line 35: Unexpected errors ['generics_defaults.py:35:17 Undefined or invalid type [11]: Annotation `DefaultBoolT` is not defined as a type.'] -Line 38: Unexpected errors ['generics_defaults.py:38:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Type[OneDefault[]]` but got `typing.Any`.', 'generics_defaults.py:38:12 Undefined attribute [16]: `OneDefault` has no attribute `__getitem__`.', 'generics_defaults.py:38:31 Invalid type parameters [24]: Non-generic type `OneDefault` cannot take parameters.'] -Line 39: Unexpected errors ['generics_defaults.py:39:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `OneDefault[]` but got `typing.Any`.', 'generics_defaults.py:39:33 Invalid type parameters [24]: Non-generic type `OneDefault` cannot take parameters.'] +Line 38: Unexpected errors ['generics_defaults.py:38:0 Assert type [70]: Expected `Type[OneDefault[]]` but got `typing.Any`.', 'generics_defaults.py:38:12 Undefined attribute [16]: `OneDefault` has no attribute `__getitem__`.', 'generics_defaults.py:38:31 Invalid type parameters [24]: Non-generic type `OneDefault` cannot take parameters.'] +Line 39: Unexpected errors ['generics_defaults.py:39:0 Assert type [70]: Expected `OneDefault[]` but got `typing.Any`.', 'generics_defaults.py:39:33 Invalid type parameters [24]: Non-generic type `OneDefault` cannot take parameters.'] Line 42: Unexpected errors ['generics_defaults.py:42:21 Undefined or invalid type [11]: Annotation `T1` is not defined as a type.', 'generics_defaults.py:42:21 Undefined or invalid type [11]: Annotation `T2` is not defined as a type.'] -Line 45: Unexpected errors ['generics_defaults.py:45:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Type[AllTheDefaults[]]` but got `Type[AllTheDefaults]`.', 'generics_defaults.py:45:28 Invalid type parameters [24]: Non-generic type `AllTheDefaults` cannot take parameters.'] -Line 46: Unexpected errors ['generics_defaults.py:46:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Type[AllTheDefaults[]]` but got `typing.Any`.'] +Line 45: Unexpected errors ['generics_defaults.py:45:0 Assert type [70]: Expected `Type[AllTheDefaults[]]` but got `Type[AllTheDefaults]`.', 'generics_defaults.py:45:28 Invalid type parameters [24]: Non-generic type `AllTheDefaults` cannot take parameters.'] +Line 46: Unexpected errors ['generics_defaults.py:46:0 Assert type [70]: Expected `Type[AllTheDefaults[]]` but got `typing.Any`.'] Line 47: Unexpected errors ['generics_defaults.py:47:4 Undefined attribute [16]: `AllTheDefaults` has no attribute `__getitem__`.', 'generics_defaults.py:47:34 Invalid type parameters [24]: Non-generic type `AllTheDefaults` cannot take parameters.'] -Line 52: Unexpected errors ['generics_defaults.py:52:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Type[AllTheDefaults[]]` but got `typing.Any`.'] +Line 52: Unexpected errors ['generics_defaults.py:52:0 Assert type [70]: Expected `Type[AllTheDefaults[]]` but got `typing.Any`.'] Line 53: Unexpected errors ['generics_defaults.py:53:34 Invalid type parameters [24]: Non-generic type `AllTheDefaults` cannot take parameters.'] -Line 55: Unexpected errors ['generics_defaults.py:55:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Type[AllTheDefaults[]]` but got `typing.Any`.'] +Line 55: Unexpected errors ['generics_defaults.py:55:0 Assert type [70]: Expected `Type[AllTheDefaults[]]` but got `typing.Any`.'] Line 57: Unexpected errors ['generics_defaults.py:57:4 Invalid type parameters [24]: Non-generic type `AllTheDefaults` cannot take parameters.'] -Line 59: Unexpected errors ['generics_defaults.py:59:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Type[AllTheDefaults[]]` but got `typing.Any`.'] +Line 59: Unexpected errors ['generics_defaults.py:59:0 Assert type [70]: Expected `Type[AllTheDefaults[]]` but got `typing.Any`.'] Line 61: Unexpected errors ['generics_defaults.py:61:4 Invalid type parameters [24]: Non-generic type `AllTheDefaults` cannot take parameters.'] -Line 63: Unexpected errors ['generics_defaults.py:63:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Type[AllTheDefaults[]]` but got `typing.Any`.'] +Line 63: Unexpected errors ['generics_defaults.py:63:0 Assert type [70]: Expected `Type[AllTheDefaults[]]` but got `typing.Any`.'] Line 65: Unexpected errors ['generics_defaults.py:65:4 Invalid type parameters [24]: Non-generic type `AllTheDefaults` cannot take parameters.'] -Line 73: Unexpected errors ['generics_defaults.py:73:33 Incompatible parameter type [6]: In call `ParamSpec.__init__`, for argument `default`, expected `Union[None, Type[typing.Any], str]` but got `List[Type[Union[int, str]]]`.'] Line 76: Unexpected errors ['generics_defaults.py:76:22 Undefined or invalid type [11]: Annotation `DefaultP` is not defined as a type.'] -Line 79: Unexpected errors ['generics_defaults.py:79:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Type[Class_ParamSpec[]]` but got `Type[Class_ParamSpec]`.', 'generics_defaults.py:79:29 Invalid type parameters [24]: Non-generic type `Class_ParamSpec` cannot take parameters.'] -Line 80: Unexpected errors ['generics_defaults.py:80:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Class_ParamSpec[]` but got `Class_ParamSpec`.', 'generics_defaults.py:80:31 Invalid type parameters [24]: Non-generic type `Class_ParamSpec` cannot take parameters.'] -Line 81: Unexpected errors ['generics_defaults.py:81:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Class_ParamSpec[]` but got `typing.Any`.', 'generics_defaults.py:81:12 Undefined attribute [16]: `Class_ParamSpec` has no attribute `__getitem__`.', 'generics_defaults.py:81:45 Invalid type parameters [24]: Non-generic type `Class_ParamSpec` cannot take parameters.'] -Line 88: Unexpected errors ['generics_defaults.py:88:53 Undefined attribute [16]: `tuple` has no attribute `__getitem__`.'] -Line 91: Unexpected errors ['generics_defaults.py:91:25 Invalid type [31]: Expression `typing.Generic[(*DefaultTs)]` is not a valid type.'] -Line 94: Unexpected errors ['generics_defaults.py:94:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Type[Class_TypeVarTuple[]]` but got `Type[Class_TypeVarTuple]`.', 'generics_defaults.py:94:32 Invalid type [31]: Expression `type[generics_defaults.Class_TypeVarTuple[(*tuple[(str, int)])]]` is not a valid type.', 'generics_defaults.py:94:32 Invalid type parameters [24]: Non-generic type `Class_TypeVarTuple` cannot take parameters.'] -Line 95: Unexpected errors ['generics_defaults.py:95:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Class_TypeVarTuple[]` but got `Class_TypeVarTuple`.', 'generics_defaults.py:95:34 Invalid type parameters [24]: Non-generic type `Class_TypeVarTuple` cannot take parameters.'] -Line 96: Unexpected errors ['generics_defaults.py:96:31 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[]` but got `Tuple[Type[int], Type[bool]]`. Expected has length 0, but actual has length 2.'] +Line 79: Unexpected errors ['generics_defaults.py:79:0 Assert type [70]: Expected `Type[Class_ParamSpec[]]` but got `Type[Class_ParamSpec]`.', 'generics_defaults.py:79:29 Invalid type parameters [24]: Non-generic type `Class_ParamSpec` cannot take parameters.'] +Line 80: Unexpected errors ['generics_defaults.py:80:0 Assert type [70]: Expected `Class_ParamSpec[]` but got `Class_ParamSpec`.', 'generics_defaults.py:80:31 Invalid type parameters [24]: Non-generic type `Class_ParamSpec` cannot take parameters.'] +Line 81: Unexpected errors ['generics_defaults.py:81:0 Assert type [70]: Expected `Class_ParamSpec[]` but got `typing.Any`.', 'generics_defaults.py:81:12 Undefined attribute [16]: `Class_ParamSpec` has no attribute `__getitem__`.', 'generics_defaults.py:81:45 Invalid type parameters [24]: Non-generic type `Class_ParamSpec` cannot take parameters.'] +Line 91: Unexpected errors ['generics_defaults.py:91:25 Undefined or invalid type [11]: Annotation `DefaultTs` is not defined as a type.'] +Line 94: Unexpected errors ['generics_defaults.py:94:0 Assert type [70]: Expected `Type[Class_TypeVarTuple[]]` but got `Type[Class_TypeVarTuple]`.', 'generics_defaults.py:94:32 Invalid type parameters [24]: Non-generic type `Class_TypeVarTuple` cannot take parameters.'] +Line 95: Unexpected errors ['generics_defaults.py:95:0 Assert type [70]: Expected `Class_TypeVarTuple[]` but got `Class_TypeVarTuple`.', 'generics_defaults.py:95:34 Invalid type parameters [24]: Non-generic type `Class_TypeVarTuple` cannot take parameters.'] +Line 96: Unexpected errors ['generics_defaults.py:96:0 Assert type [70]: Expected `Class_TypeVarTuple[]` but got `typing.Any`.', 'generics_defaults.py:96:12 Undefined attribute [16]: `Class_TypeVarTuple` has no attribute `__getitem__`.', 'generics_defaults.py:96:45 Invalid type parameters [24]: Non-generic type `Class_TypeVarTuple` cannot take parameters.'] Line 124: Unexpected errors ['generics_defaults.py:124:13 Undefined or invalid type [11]: Annotation `T4` is not defined as a type.'] -Line 145: Unexpected errors ['generics_defaults.py:145:19 Incompatible parameter type [6]: In call `ParamSpec.__init__`, for argument `default`, expected `Union[None, Type[typing.Any], str]` but got `List[Type[float]]`.'] -Line 148: Unexpected errors ['generics_defaults.py:148:11 Invalid type [31]: Expression `typing.Generic[(*Ts, P)]` is not a valid type.', 'generics_defaults.py:148:11 Undefined or invalid type [11]: Annotation `P` is not defined as a type.'] -Line 151: Unexpected errors ['generics_defaults.py:151:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Type[Foo6[]]` but got `typing.Any`.', 'generics_defaults.py:151:12 Undefined attribute [16]: `Foo6` has no attribute `__getitem__`.', 'generics_defaults.py:151:28 Invalid type parameters [24]: Non-generic type `Foo6` cannot take parameters.'] -Line 152: Unexpected errors ['generics_defaults.py:152:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Type[Foo6[]]` but got `typing.Any`.', 'generics_defaults.py:152:37 Invalid type parameters [24]: Non-generic type `Foo6` cannot take parameters.'] -Line 166: Unexpected errors ['generics_defaults.py:166:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing.Callable[[Foo7[]], Foo7[]]` but got `typing.Callable(Foo7.meth)[[Variable[_Self_generics_defaults_Foo7__ (bound to Foo7)]], Variable[_Self_generics_defaults_Foo7__ (bound to Foo7)]]`.', 'generics_defaults.py:166:23 Invalid type parameters [24]: Non-generic type `Foo7` cannot take parameters.'] +Line 127: Unexpected errors ['generics_defaults.py:127:0 Assert type [70]: Expected `int` but got `unknown`.'] +Line 148: Unexpected errors ["generics_defaults.py:148:11 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Ts`.", 'generics_defaults.py:148:11 Undefined or invalid type [11]: Annotation `P` is not defined as a type.'] +Line 151: Unexpected errors ['generics_defaults.py:151:0 Assert type [70]: Expected `Type[Foo6[]]` but got `typing.Any`.', 'generics_defaults.py:151:12 Undefined attribute [16]: `Foo6` has no attribute `__getitem__`.', 'generics_defaults.py:151:28 Invalid type parameters [24]: Non-generic type `Foo6` cannot take parameters.'] +Line 152: Unexpected errors ['generics_defaults.py:152:0 Assert type [70]: Expected `Type[Foo6[]]` but got `typing.Any`.', 'generics_defaults.py:152:37 Invalid type parameters [24]: Non-generic type `Foo6` cannot take parameters.'] +Line 166: Unexpected errors ['generics_defaults.py:166:0 Assert type [70]: Expected `typing.Callable[[Foo7[]], Foo7[]]` but got `typing.Callable(Foo7.meth)[[Variable[_Self_generics_defaults_Foo7__ (bound to Foo7)]], Variable[_Self_generics_defaults_Foo7__ (bound to Foo7)]]`.', 'generics_defaults.py:166:23 Invalid type parameters [24]: Non-generic type `Foo7` cannot take parameters.'] +Line 167: Unexpected errors ['generics_defaults.py:167:0 Assert type [70]: Expected `int` but got `unknown`.'] """ diff --git a/conformance/results/pyre/generics_defaults_referential.toml b/conformance/results/pyre/generics_defaults_referential.toml index 3da14a215..d7759bb41 100644 --- a/conformance/results/pyre/generics_defaults_referential.toml +++ b/conformance/results/pyre/generics_defaults_referential.toml @@ -3,18 +3,18 @@ output = """ generics_defaults_referential.py:20:12 Undefined or invalid type [11]: Annotation `StartT` is not defined as a type. generics_defaults_referential.py:20:12 Undefined or invalid type [11]: Annotation `StepT` is not defined as a type. generics_defaults_referential.py:20:12 Undefined or invalid type [11]: Annotation `StopT` is not defined as a type. -generics_defaults_referential.py:23:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Type[slice[]]` but got `Type[slice]`. +generics_defaults_referential.py:23:0 Assert type [70]: Expected `Type[slice[]]` but got `Type[slice]`. generics_defaults_referential.py:23:19 Invalid type parameters [24]: Non-generic type `slice` cannot take parameters. -generics_defaults_referential.py:24:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `slice[]` but got `slice`. +generics_defaults_referential.py:24:0 Assert type [70]: Expected `slice[]` but got `slice`. generics_defaults_referential.py:24:21 Invalid type parameters [24]: Non-generic type `slice` cannot take parameters. -generics_defaults_referential.py:25:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `slice[]` but got `typing.Any`. +generics_defaults_referential.py:25:0 Assert type [70]: Expected `slice[]` but got `typing.Any`. generics_defaults_referential.py:25:12 Undefined attribute [16]: `slice` has no attribute `__getitem__`. generics_defaults_referential.py:25:26 Invalid type parameters [24]: Non-generic type `slice` cannot take parameters. -generics_defaults_referential.py:26:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `slice[]` but got `typing.Any`. +generics_defaults_referential.py:26:0 Assert type [70]: Expected `slice[]` but got `typing.Any`. generics_defaults_referential.py:26:41 Invalid type parameters [24]: Non-generic type `slice` cannot take parameters. generics_defaults_referential.py:31:10 Undefined or invalid type [11]: Annotation `DefaultStrT` is not defined as a type. generics_defaults_referential.py:31:10 Undefined or invalid type [11]: Annotation `T2` is not defined as a type. -generics_defaults_referential.py:35:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Foo[]` but got `Foo`. +generics_defaults_referential.py:35:0 Assert type [70]: Expected `Foo[]` but got `Foo`. generics_defaults_referential.py:35:24 Invalid type parameters [24]: Non-generic type `Foo` cannot take parameters. generics_defaults_referential.py:36:0 Undefined attribute [16]: `Foo` has no attribute `__getitem__`. generics_defaults_referential.py:46:11 Undefined or invalid type [11]: Annotation `S1` is not defined as a type. @@ -24,16 +24,16 @@ generics_defaults_referential.py:53:13 Undefined or invalid type [11]: Annotatio generics_defaults_referential.py:87:47 Undefined attribute [16]: `list` has no attribute `__getitem__`. generics_defaults_referential.py:90:10 Undefined or invalid type [11]: Annotation `ListDefaultT` is not defined as a type. generics_defaults_referential.py:90:10 Undefined or invalid type [11]: Annotation `Z1` is not defined as a type. -generics_defaults_referential.py:94:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Type[Bar[]]` but got `Type[Bar]`. +generics_defaults_referential.py:94:0 Assert type [70]: Expected `Type[Bar[]]` but got `Type[Bar]`. generics_defaults_referential.py:94:17 Invalid type parameters [24]: Non-generic type `Bar` cannot take parameters. -generics_defaults_referential.py:95:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Type[Bar[]]` but got `typing.Any`. +generics_defaults_referential.py:95:0 Assert type [70]: Expected `Type[Bar[]]` but got `typing.Any`. generics_defaults_referential.py:95:12 Undefined attribute [16]: `Bar` has no attribute `__getitem__`. generics_defaults_referential.py:95:22 Invalid type parameters [24]: Non-generic type `Bar` cannot take parameters. -generics_defaults_referential.py:96:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Bar[]` but got `typing.Any`. +generics_defaults_referential.py:96:0 Assert type [70]: Expected `Bar[]` but got `typing.Any`. generics_defaults_referential.py:96:29 Invalid type parameters [24]: Non-generic type `Bar` cannot take parameters. -generics_defaults_referential.py:97:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Bar[]` but got `typing.Any`. +generics_defaults_referential.py:97:0 Assert type [70]: Expected `Bar[]` but got `typing.Any`. generics_defaults_referential.py:97:40 Invalid type parameters [24]: Non-generic type `Bar` cannot take parameters. -generics_defaults_referential.py:98:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Bar[]` but got `typing.Any`. +generics_defaults_referential.py:98:0 Assert type [70]: Expected `Bar[]` but got `typing.Any`. generics_defaults_referential.py:98:34 Invalid type parameters [24]: Non-generic type `Bar` cannot take parameters. """ conformance_automated = "Fail" @@ -44,18 +44,18 @@ Line 68: Expected 1 errors Line 74: Expected 1 errors Line 78: Expected 1 errors Line 20: Unexpected errors ['generics_defaults_referential.py:20:12 Undefined or invalid type [11]: Annotation `StartT` is not defined as a type.', 'generics_defaults_referential.py:20:12 Undefined or invalid type [11]: Annotation `StepT` is not defined as a type.', 'generics_defaults_referential.py:20:12 Undefined or invalid type [11]: Annotation `StopT` is not defined as a type.'] -Line 23: Unexpected errors ['generics_defaults_referential.py:23:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Type[slice[]]` but got `Type[slice]`.', 'generics_defaults_referential.py:23:19 Invalid type parameters [24]: Non-generic type `slice` cannot take parameters.'] -Line 24: Unexpected errors ['generics_defaults_referential.py:24:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `slice[]` but got `slice`.', 'generics_defaults_referential.py:24:21 Invalid type parameters [24]: Non-generic type `slice` cannot take parameters.'] -Line 25: Unexpected errors ['generics_defaults_referential.py:25:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `slice[]` but got `typing.Any`.', 'generics_defaults_referential.py:25:12 Undefined attribute [16]: `slice` has no attribute `__getitem__`.', 'generics_defaults_referential.py:25:26 Invalid type parameters [24]: Non-generic type `slice` cannot take parameters.'] -Line 26: Unexpected errors ['generics_defaults_referential.py:26:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `slice[]` but got `typing.Any`.', 'generics_defaults_referential.py:26:41 Invalid type parameters [24]: Non-generic type `slice` cannot take parameters.'] +Line 23: Unexpected errors ['generics_defaults_referential.py:23:0 Assert type [70]: Expected `Type[slice[]]` but got `Type[slice]`.', 'generics_defaults_referential.py:23:19 Invalid type parameters [24]: Non-generic type `slice` cannot take parameters.'] +Line 24: Unexpected errors ['generics_defaults_referential.py:24:0 Assert type [70]: Expected `slice[]` but got `slice`.', 'generics_defaults_referential.py:24:21 Invalid type parameters [24]: Non-generic type `slice` cannot take parameters.'] +Line 25: Unexpected errors ['generics_defaults_referential.py:25:0 Assert type [70]: Expected `slice[]` but got `typing.Any`.', 'generics_defaults_referential.py:25:12 Undefined attribute [16]: `slice` has no attribute `__getitem__`.', 'generics_defaults_referential.py:25:26 Invalid type parameters [24]: Non-generic type `slice` cannot take parameters.'] +Line 26: Unexpected errors ['generics_defaults_referential.py:26:0 Assert type [70]: Expected `slice[]` but got `typing.Any`.', 'generics_defaults_referential.py:26:41 Invalid type parameters [24]: Non-generic type `slice` cannot take parameters.'] Line 31: Unexpected errors ['generics_defaults_referential.py:31:10 Undefined or invalid type [11]: Annotation `DefaultStrT` is not defined as a type.', 'generics_defaults_referential.py:31:10 Undefined or invalid type [11]: Annotation `T2` is not defined as a type.'] -Line 35: Unexpected errors ['generics_defaults_referential.py:35:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Foo[]` but got `Foo`.', 'generics_defaults_referential.py:35:24 Invalid type parameters [24]: Non-generic type `Foo` cannot take parameters.'] +Line 35: Unexpected errors ['generics_defaults_referential.py:35:0 Assert type [70]: Expected `Foo[]` but got `Foo`.', 'generics_defaults_referential.py:35:24 Invalid type parameters [24]: Non-generic type `Foo` cannot take parameters.'] Line 46: Unexpected errors ['generics_defaults_referential.py:46:11 Undefined or invalid type [11]: Annotation `S1` is not defined as a type.', 'generics_defaults_referential.py:46:11 Undefined or invalid type [11]: Annotation `S2` is not defined as a type.'] Line 87: Unexpected errors ['generics_defaults_referential.py:87:47 Undefined attribute [16]: `list` has no attribute `__getitem__`.'] Line 90: Unexpected errors ['generics_defaults_referential.py:90:10 Undefined or invalid type [11]: Annotation `ListDefaultT` is not defined as a type.', 'generics_defaults_referential.py:90:10 Undefined or invalid type [11]: Annotation `Z1` is not defined as a type.'] -Line 94: Unexpected errors ['generics_defaults_referential.py:94:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Type[Bar[]]` but got `Type[Bar]`.', 'generics_defaults_referential.py:94:17 Invalid type parameters [24]: Non-generic type `Bar` cannot take parameters.'] -Line 95: Unexpected errors ['generics_defaults_referential.py:95:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Type[Bar[]]` but got `typing.Any`.', 'generics_defaults_referential.py:95:12 Undefined attribute [16]: `Bar` has no attribute `__getitem__`.', 'generics_defaults_referential.py:95:22 Invalid type parameters [24]: Non-generic type `Bar` cannot take parameters.'] -Line 96: Unexpected errors ['generics_defaults_referential.py:96:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Bar[]` but got `typing.Any`.', 'generics_defaults_referential.py:96:29 Invalid type parameters [24]: Non-generic type `Bar` cannot take parameters.'] -Line 97: Unexpected errors ['generics_defaults_referential.py:97:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Bar[]` but got `typing.Any`.', 'generics_defaults_referential.py:97:40 Invalid type parameters [24]: Non-generic type `Bar` cannot take parameters.'] -Line 98: Unexpected errors ['generics_defaults_referential.py:98:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Bar[]` but got `typing.Any`.', 'generics_defaults_referential.py:98:34 Invalid type parameters [24]: Non-generic type `Bar` cannot take parameters.'] +Line 94: Unexpected errors ['generics_defaults_referential.py:94:0 Assert type [70]: Expected `Type[Bar[]]` but got `Type[Bar]`.', 'generics_defaults_referential.py:94:17 Invalid type parameters [24]: Non-generic type `Bar` cannot take parameters.'] +Line 95: Unexpected errors ['generics_defaults_referential.py:95:0 Assert type [70]: Expected `Type[Bar[]]` but got `typing.Any`.', 'generics_defaults_referential.py:95:12 Undefined attribute [16]: `Bar` has no attribute `__getitem__`.', 'generics_defaults_referential.py:95:22 Invalid type parameters [24]: Non-generic type `Bar` cannot take parameters.'] +Line 96: Unexpected errors ['generics_defaults_referential.py:96:0 Assert type [70]: Expected `Bar[]` but got `typing.Any`.', 'generics_defaults_referential.py:96:29 Invalid type parameters [24]: Non-generic type `Bar` cannot take parameters.'] +Line 97: Unexpected errors ['generics_defaults_referential.py:97:0 Assert type [70]: Expected `Bar[]` but got `typing.Any`.', 'generics_defaults_referential.py:97:40 Invalid type parameters [24]: Non-generic type `Bar` cannot take parameters.'] +Line 98: Unexpected errors ['generics_defaults_referential.py:98:0 Assert type [70]: Expected `Bar[]` but got `typing.Any`.', 'generics_defaults_referential.py:98:34 Invalid type parameters [24]: Non-generic type `Bar` cannot take parameters.'] """ diff --git a/conformance/results/pyre/generics_defaults_specialization.toml b/conformance/results/pyre/generics_defaults_specialization.toml index 7de25df9c..91acb349f 100644 --- a/conformance/results/pyre/generics_defaults_specialization.toml +++ b/conformance/results/pyre/generics_defaults_specialization.toml @@ -7,18 +7,21 @@ generics_defaults_specialization.py:19:30 Undefined or invalid type [11]: Annota generics_defaults_specialization.py:19:30 Undefined or invalid type [11]: Annotation `T2` is not defined as a type. generics_defaults_specialization.py:22:21 Undefined attribute [16]: `SomethingWithNoDefaults` has no attribute `__getitem__`. generics_defaults_specialization.py:25:14 Undefined or invalid type [11]: Annotation `MyAlias` is not defined as a type. +generics_defaults_specialization.py:26:4 Assert type [70]: Expected `SomethingWithNoDefaults[]` but got `unknown`. generics_defaults_specialization.py:26:20 Invalid type parameters [24]: Non-generic type `SomethingWithNoDefaults` cannot take parameters. +generics_defaults_specialization.py:27:4 Assert type [70]: Expected `SomethingWithNoDefaults[]` but got `unknown`. generics_defaults_specialization.py:27:20 Invalid type parameters [24]: Non-generic type `SomethingWithNoDefaults` cannot take parameters. generics_defaults_specialization.py:30:0 Undefined attribute [16]: `TypeAlias` has no attribute `__getitem__`. generics_defaults_specialization.py:38:17 Undefined or invalid type [11]: Annotation `DefaultStrT` is not defined as a type. -generics_defaults_specialization.py:45:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Type[Bar[]]` but got `Type[Bar]`. +generics_defaults_specialization.py:45:0 Assert type [70]: Expected `Type[Bar[]]` but got `Type[Bar]`. generics_defaults_specialization.py:45:17 Invalid type parameters [24]: Non-generic type `Bar` cannot take parameters. -generics_defaults_specialization.py:46:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Bar[]` but got `Bar`. +generics_defaults_specialization.py:46:0 Assert type [70]: Expected `Bar[]` but got `Bar`. generics_defaults_specialization.py:46:19 Invalid type parameters [24]: Non-generic type `Bar` cannot take parameters. -generics_defaults_specialization.py:47:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Bar[]` but got `typing.Any`. +generics_defaults_specialization.py:47:0 Assert type [70]: Expected `Bar[]` but got `typing.Any`. generics_defaults_specialization.py:47:12 Undefined attribute [16]: `Bar` has no attribute `__getitem__`. generics_defaults_specialization.py:47:25 Invalid type parameters [24]: Non-generic type `Bar` cannot take parameters. generics_defaults_specialization.py:50:10 Invalid type parameters [24]: Non-generic type `SubclassMe` cannot take parameters. +generics_defaults_specialization.py:53:0 Assert type [70]: Expected `str` but got `unknown`. generics_defaults_specialization.py:55:0 Undefined attribute [16]: `Foo` has no attribute `__getitem__`. generics_defaults_specialization.py:58:10 Undefined or invalid type [11]: Annotation `DefaultIntT` is not defined as a type. generics_defaults_specialization.py:65:0 Incompatible variable type [9]: v1 is declared to have type `Baz[]` but is used as type `Spam`. @@ -29,13 +32,14 @@ errors_diff = """ Line 19: Unexpected errors ['generics_defaults_specialization.py:19:30 Undefined or invalid type [11]: Annotation `T1` is not defined as a type.', 'generics_defaults_specialization.py:19:30 Undefined or invalid type [11]: Annotation `T2` is not defined as a type.'] Line 22: Unexpected errors ['generics_defaults_specialization.py:22:21 Undefined attribute [16]: `SomethingWithNoDefaults` has no attribute `__getitem__`.'] Line 25: Unexpected errors ['generics_defaults_specialization.py:25:14 Undefined or invalid type [11]: Annotation `MyAlias` is not defined as a type.'] -Line 26: Unexpected errors ['generics_defaults_specialization.py:26:20 Invalid type parameters [24]: Non-generic type `SomethingWithNoDefaults` cannot take parameters.'] -Line 27: Unexpected errors ['generics_defaults_specialization.py:27:20 Invalid type parameters [24]: Non-generic type `SomethingWithNoDefaults` cannot take parameters.'] +Line 26: Unexpected errors ['generics_defaults_specialization.py:26:4 Assert type [70]: Expected `SomethingWithNoDefaults[]` but got `unknown`.', 'generics_defaults_specialization.py:26:20 Invalid type parameters [24]: Non-generic type `SomethingWithNoDefaults` cannot take parameters.'] +Line 27: Unexpected errors ['generics_defaults_specialization.py:27:4 Assert type [70]: Expected `SomethingWithNoDefaults[]` but got `unknown`.', 'generics_defaults_specialization.py:27:20 Invalid type parameters [24]: Non-generic type `SomethingWithNoDefaults` cannot take parameters.'] Line 38: Unexpected errors ['generics_defaults_specialization.py:38:17 Undefined or invalid type [11]: Annotation `DefaultStrT` is not defined as a type.'] -Line 45: Unexpected errors ['generics_defaults_specialization.py:45:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Type[Bar[]]` but got `Type[Bar]`.', 'generics_defaults_specialization.py:45:17 Invalid type parameters [24]: Non-generic type `Bar` cannot take parameters.'] -Line 46: Unexpected errors ['generics_defaults_specialization.py:46:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Bar[]` but got `Bar`.', 'generics_defaults_specialization.py:46:19 Invalid type parameters [24]: Non-generic type `Bar` cannot take parameters.'] -Line 47: Unexpected errors ['generics_defaults_specialization.py:47:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Bar[]` but got `typing.Any`.', 'generics_defaults_specialization.py:47:12 Undefined attribute [16]: `Bar` has no attribute `__getitem__`.', 'generics_defaults_specialization.py:47:25 Invalid type parameters [24]: Non-generic type `Bar` cannot take parameters.'] +Line 45: Unexpected errors ['generics_defaults_specialization.py:45:0 Assert type [70]: Expected `Type[Bar[]]` but got `Type[Bar]`.', 'generics_defaults_specialization.py:45:17 Invalid type parameters [24]: Non-generic type `Bar` cannot take parameters.'] +Line 46: Unexpected errors ['generics_defaults_specialization.py:46:0 Assert type [70]: Expected `Bar[]` but got `Bar`.', 'generics_defaults_specialization.py:46:19 Invalid type parameters [24]: Non-generic type `Bar` cannot take parameters.'] +Line 47: Unexpected errors ['generics_defaults_specialization.py:47:0 Assert type [70]: Expected `Bar[]` but got `typing.Any`.', 'generics_defaults_specialization.py:47:12 Undefined attribute [16]: `Bar` has no attribute `__getitem__`.', 'generics_defaults_specialization.py:47:25 Invalid type parameters [24]: Non-generic type `Bar` cannot take parameters.'] Line 50: Unexpected errors ['generics_defaults_specialization.py:50:10 Invalid type parameters [24]: Non-generic type `SubclassMe` cannot take parameters.'] +Line 53: Unexpected errors ['generics_defaults_specialization.py:53:0 Assert type [70]: Expected `str` but got `unknown`.'] Line 58: Unexpected errors ['generics_defaults_specialization.py:58:10 Undefined or invalid type [11]: Annotation `DefaultIntT` is not defined as a type.'] Line 65: Unexpected errors ['generics_defaults_specialization.py:65:0 Incompatible variable type [9]: v1 is declared to have type `Baz[]` but is used as type `Spam`.', 'generics_defaults_specialization.py:65:4 Invalid type parameters [24]: Non-generic type `Baz` cannot take parameters.'] """ diff --git a/conformance/results/pyre/generics_paramspec_components.toml b/conformance/results/pyre/generics_paramspec_components.toml index daf77e2f1..76e8a8c2d 100644 --- a/conformance/results/pyre/generics_paramspec_components.toml +++ b/conformance/results/pyre/generics_paramspec_components.toml @@ -13,7 +13,7 @@ generics_paramspec_components.py:17:44 Undefined or invalid type [11]: Annotatio generics_paramspec_components.py:49:8 Call error [29]: `typing.Callable[generics_paramspec_components.P, int]` cannot be safely called because the types and kinds of its parameters depend on a type variable. generics_paramspec_components.py:70:8 Call error [29]: `typing.Callable[typing.Concatenate[int, generics_paramspec_components.P], int]` cannot be safely called because the types and kinds of its parameters depend on a type variable. generics_paramspec_components.py:72:8 Missing argument [20]: PositionalOnly call expects argument in position 0. -generics_paramspec_components.py:83:8 Unexpected keyword [28]: Unexpected keyword argument `x` to call `foo`. +generics_paramspec_components.py:83:8 Unexpected keyword [28]: Unexpected keyword argument `x` to call `outer.foo`. generics_paramspec_components.py:98:19 Incompatible parameter type [6]: In call `twice`, for 2nd positional argument, expected `int` but got `str`. generics_paramspec_components.py:98:24 Incompatible parameter type [6]: In call `twice`, for 3rd positional argument, expected `str` but got `int`. """ diff --git a/conformance/results/pyre/generics_paramspec_semantics.toml b/conformance/results/pyre/generics_paramspec_semantics.toml index a3a645b67..851212188 100644 --- a/conformance/results/pyre/generics_paramspec_semantics.toml +++ b/conformance/results/pyre/generics_paramspec_semantics.toml @@ -7,9 +7,9 @@ generics_paramspec_semantics.py:61:22 Incompatible parameter type [6]: In call ` generics_paramspec_semantics.py:98:3 Incompatible parameter type [6]: In anonymous call, for 1st positional argument, expected `str` but got `int`. generics_paramspec_semantics.py:108:3 Incompatible parameter type [6]: In anonymous call, for 1st positional argument, expected `bool` but got `int`. generics_paramspec_semantics.py:120:3 Incompatible parameter type [6]: In anonymous call, for 1st positional argument, expected `str` but got `int`. -generics_paramspec_semantics.py:127:1 Invalid decoration [56]: Pyre doesn't yet support decorators with ParamSpec applied to generic functions Please add # pyre-ignore[56] to `generics_paramspec_semantics.expects_int_first`. -generics_paramspec_semantics.py:132:1 Invalid decoration [56]: Pyre doesn't yet support decorators with ParamSpec applied to generic functions Please add # pyre-ignore[56] to `generics_paramspec_semantics.expects_int_first`. -generics_paramspec_semantics.py:137:1 Invalid decoration [56]: Pyre doesn't yet support decorators with ParamSpec applied to generic functions Please add # pyre-ignore[56] to `generics_paramspec_semantics.expects_int_first`. +generics_paramspec_semantics.py:127:1 Invalid decoration [56]: Pyre doesn't yet support decorators with ParamSpec applied to generic functions. Consider using a context manager instead of a decorator, if possible. +generics_paramspec_semantics.py:132:1 Invalid decoration [56]: Pyre doesn't yet support decorators with ParamSpec applied to generic functions. Consider using a context manager instead of a decorator, if possible. +generics_paramspec_semantics.py:137:1 Invalid decoration [56]: Pyre doesn't yet support decorators with ParamSpec applied to generic functions. Consider using a context manager instead of a decorator, if possible. """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyre/generics_scoping.toml b/conformance/results/pyre/generics_scoping.toml index ae6cd48ca..e91ac08ba 100644 --- a/conformance/results/pyre/generics_scoping.toml +++ b/conformance/results/pyre/generics_scoping.toml @@ -2,17 +2,18 @@ conformant = "Partial" notes = """ False negative on generic class nested within generic function with same type variable. False negative on generic class nested within generic class with same type variable. +False negative on assert_type uses. """ output = """ -generics_scoping.py:14:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `typing_extensions.Literal[1]`. -generics_scoping.py:15:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `typing_extensions.Literal['a']`. +generics_scoping.py:14:0 Assert type [70]: Expected `int` but got `typing_extensions.Literal[1]`. +generics_scoping.py:15:0 Assert type [70]: Expected `str` but got `typing_extensions.Literal['a']`. generics_scoping.py:29:9 Incompatible parameter type [6]: In call `MyClass.meth_2`, for 1st positional argument, expected `int` but got `str`. -generics_scoping.py:42:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `typing_extensions.Literal['abc']`. -generics_scoping.py:43:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `bytes` but got `typing_extensions.Literal[b'abc']`. +generics_scoping.py:42:0 Assert type [70]: Expected `str` but got `typing_extensions.Literal['abc']`. +generics_scoping.py:43:0 Assert type [70]: Expected `bytes` but got `typing_extensions.Literal[b'abc']`. generics_scoping.py:50:7 Invalid type variable [34]: The type variable `Variable[S]` isn't present in the function's parameters. generics_scoping.py:54:13 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Variable[S]`. To reference the type variable, you can modify the class to inherit from `typing.Generic[S]`. generics_scoping.py:78:11 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Variable[T]`. To reference the type variable, you can modify the class to inherit from `typing.Generic[T]`. -generics_scoping.py:87:23 Undefined attribute [16]: `list` has no attribute `__getitem__`. +generics_scoping.py:87:4 Incompatible attribute type [8]: Attribute `alias` declared in class `Outer` has type `TypeAlias` but is used as type `Type[List[Variable[T]]]`. generics_scoping.py:94:13 Invalid type variable [34]: The type variable `Variable[T]` can only be used to annotate generic classes or functions. generics_scoping.py:95:13 Invalid type variable [34]: The type variable `Variable[T]` can only be used to annotate generic classes or functions. generics_scoping.py:96:0 Undefined attribute [16]: `list` has no attribute `__getitem__`. @@ -21,8 +22,8 @@ conformance_automated = "Fail" errors_diff = """ Line 65: Expected 1 errors Line 75: Expected 1 errors -Line 14: Unexpected errors ['generics_scoping.py:14:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `typing_extensions.Literal[1]`.'] -Line 15: Unexpected errors ["generics_scoping.py:15:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `typing_extensions.Literal['a']`."] -Line 42: Unexpected errors ["generics_scoping.py:42:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `typing_extensions.Literal['abc']`."] -Line 43: Unexpected errors ["generics_scoping.py:43:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `bytes` but got `typing_extensions.Literal[b'abc']`."] +Line 14: Unexpected errors ['generics_scoping.py:14:0 Assert type [70]: Expected `int` but got `typing_extensions.Literal[1]`.'] +Line 15: Unexpected errors ["generics_scoping.py:15:0 Assert type [70]: Expected `str` but got `typing_extensions.Literal['a']`."] +Line 42: Unexpected errors ["generics_scoping.py:42:0 Assert type [70]: Expected `str` but got `typing_extensions.Literal['abc']`."] +Line 43: Unexpected errors ["generics_scoping.py:43:0 Assert type [70]: Expected `bytes` but got `typing_extensions.Literal[b'abc']`."] """ diff --git a/conformance/results/pyre/generics_self_advanced.toml b/conformance/results/pyre/generics_self_advanced.toml index e7ef9d28d..f298efb4c 100644 --- a/conformance/results/pyre/generics_self_advanced.toml +++ b/conformance/results/pyre/generics_self_advanced.toml @@ -1,23 +1,24 @@ conformant = "Partial" notes = """ Does not handle use of `Self` within class body correctly. +False negatives on assert_type uses. """ output = """ generics_self_advanced.py:25:7 Undefined or invalid type [11]: Annotation `Self` is not defined as a type. -generics_self_advanced.py:35:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `unknown` but got `ChildB`. -generics_self_advanced.py:37:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `unknown` but got `typing.Any`. -generics_self_advanced.py:38:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `unknown` but got `ChildB`. -generics_self_advanced.py:42:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `unknown` but got `Type[ChildB]`. -generics_self_advanced.py:44:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `unknown` but got `typing.Any`. -generics_self_advanced.py:45:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `unknown` but got `ChildB`. +generics_self_advanced.py:35:8 Assert type [70]: Expected `unknown` but got `ChildB`. +generics_self_advanced.py:37:8 Assert type [70]: Expected `unknown` but got `typing.Any`. +generics_self_advanced.py:38:8 Assert type [70]: Expected `unknown` but got `ChildB`. +generics_self_advanced.py:42:8 Assert type [70]: Expected `unknown` but got `Type[ChildB]`. +generics_self_advanced.py:44:8 Assert type [70]: Expected `unknown` but got `typing.Any`. +generics_self_advanced.py:45:8 Assert type [70]: Expected `unknown` but got `ChildB`. """ conformance_automated = "Fail" errors_diff = """ Line 25: Unexpected errors ['generics_self_advanced.py:25:7 Undefined or invalid type [11]: Annotation `Self` is not defined as a type.'] -Line 35: Unexpected errors ['generics_self_advanced.py:35:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `unknown` but got `ChildB`.'] -Line 37: Unexpected errors ['generics_self_advanced.py:37:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `unknown` but got `typing.Any`.'] -Line 38: Unexpected errors ['generics_self_advanced.py:38:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `unknown` but got `ChildB`.'] -Line 42: Unexpected errors ['generics_self_advanced.py:42:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `unknown` but got `Type[ChildB]`.'] -Line 44: Unexpected errors ['generics_self_advanced.py:44:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `unknown` but got `typing.Any`.'] -Line 45: Unexpected errors ['generics_self_advanced.py:45:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `unknown` but got `ChildB`.'] +Line 35: Unexpected errors ['generics_self_advanced.py:35:8 Assert type [70]: Expected `unknown` but got `ChildB`.'] +Line 37: Unexpected errors ['generics_self_advanced.py:37:8 Assert type [70]: Expected `unknown` but got `typing.Any`.'] +Line 38: Unexpected errors ['generics_self_advanced.py:38:8 Assert type [70]: Expected `unknown` but got `ChildB`.'] +Line 42: Unexpected errors ['generics_self_advanced.py:42:8 Assert type [70]: Expected `unknown` but got `Type[ChildB]`.'] +Line 44: Unexpected errors ['generics_self_advanced.py:44:8 Assert type [70]: Expected `unknown` but got `typing.Any`.'] +Line 45: Unexpected errors ['generics_self_advanced.py:45:8 Assert type [70]: Expected `unknown` but got `ChildB`.'] """ diff --git a/conformance/results/pyre/generics_self_basic.toml b/conformance/results/pyre/generics_self_basic.toml index 8b64f8127..db088609e 100644 --- a/conformance/results/pyre/generics_self_basic.toml +++ b/conformance/results/pyre/generics_self_basic.toml @@ -3,17 +3,17 @@ notes = """ Does not handle use of `Self` as a generic type. """ output = """ -generics_self_basic.py:14:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `unknown` but got `Variable[_Self_generics_self_basic_Shape__ (bound to Shape)]`. +generics_self_basic.py:14:8 Assert type [70]: Expected `unknown` but got `Variable[_Self_generics_self_basic_Shape__ (bound to Shape)]`. generics_self_basic.py:14:26 Undefined or invalid type [11]: Annotation `Self` is not defined as a type. generics_self_basic.py:20:8 Incompatible return type [7]: Expected `Variable[_Self_generics_self_basic_Shape__ (bound to Shape)]` but got `Shape`. -generics_self_basic.py:27:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `unknown` but got `Type[Variable[_Self_generics_self_basic_Shape__ (bound to Shape)]]`. +generics_self_basic.py:27:8 Assert type [70]: Expected `unknown` but got `Type[Variable[_Self_generics_self_basic_Shape__ (bound to Shape)]]`. generics_self_basic.py:33:8 Incompatible return type [7]: Expected `Variable[_Self_generics_self_basic_Shape__ (bound to Shape)]` but got `Shape`. -generics_self_basic.py:40:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `unknown` but got `Variable[_Self_generics_self_basic_Shape__ (bound to Shape)]`. +generics_self_basic.py:40:8 Assert type [70]: Expected `unknown` but got `Variable[_Self_generics_self_basic_Shape__ (bound to Shape)]`. +generics_self_basic.py:67:25 Invalid type parameters [24]: Non-generic type `_Self_generics_self_basic_Container__` cannot take parameters. """ conformance_automated = "Fail" errors_diff = """ -Line 67: Expected 1 errors -Line 14: Unexpected errors ['generics_self_basic.py:14:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `unknown` but got `Variable[_Self_generics_self_basic_Shape__ (bound to Shape)]`.', 'generics_self_basic.py:14:26 Undefined or invalid type [11]: Annotation `Self` is not defined as a type.'] -Line 27: Unexpected errors ['generics_self_basic.py:27:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `unknown` but got `Type[Variable[_Self_generics_self_basic_Shape__ (bound to Shape)]]`.'] -Line 40: Unexpected errors ['generics_self_basic.py:40:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `unknown` but got `Variable[_Self_generics_self_basic_Shape__ (bound to Shape)]`.'] +Line 14: Unexpected errors ['generics_self_basic.py:14:8 Assert type [70]: Expected `unknown` but got `Variable[_Self_generics_self_basic_Shape__ (bound to Shape)]`.', 'generics_self_basic.py:14:26 Undefined or invalid type [11]: Annotation `Self` is not defined as a type.'] +Line 27: Unexpected errors ['generics_self_basic.py:27:8 Assert type [70]: Expected `unknown` but got `Type[Variable[_Self_generics_self_basic_Shape__ (bound to Shape)]]`.'] +Line 40: Unexpected errors ['generics_self_basic.py:40:8 Assert type [70]: Expected `unknown` but got `Variable[_Self_generics_self_basic_Shape__ (bound to Shape)]`.'] """ diff --git a/conformance/results/pyre/generics_syntax_compatibility.toml b/conformance/results/pyre/generics_syntax_compatibility.toml index 46268f566..71877e3ce 100644 --- a/conformance/results/pyre/generics_syntax_compatibility.toml +++ b/conformance/results/pyre/generics_syntax_compatibility.toml @@ -1,11 +1,14 @@ -conformant = "Unsupported" +conformant = "Partial" notes = """ -Type parameter syntax not yet support. +False negative on mixing legacy and PEP695 syntax. +Does not detect mixing legacy and PEP695 syntax in methods. """ output = """ -generics_syntax_compatibility.py:14:13 Parsing failure [404]: invalid syntax +generics_syntax_compatibility.py:14:16 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Variable[K]`. To reference the type variable, you can modify the class to inherit from `typing.Generic[K]`. +generics_syntax_compatibility.py:18:19 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Variable[K]`. To reference the type variable, you can modify the class to inherit from `typing.Generic[K]`. """ conformance_automated = "Fail" errors_diff = """ Line 26: Expected 1 errors +Line 18: Unexpected errors ["generics_syntax_compatibility.py:18:19 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Variable[K]`. To reference the type variable, you can modify the class to inherit from `typing.Generic[K]`."] """ diff --git a/conformance/results/pyre/generics_syntax_declarations.toml b/conformance/results/pyre/generics_syntax_declarations.toml index 410811065..a97c785e4 100644 --- a/conformance/results/pyre/generics_syntax_declarations.toml +++ b/conformance/results/pyre/generics_syntax_declarations.toml @@ -1,21 +1,20 @@ -conformant = "Unsupported" +conformant = "Partial" notes = """ -Type parameter syntax not yet support. +Does not detect incorrect use of legacy style syntax mixed with PEP695 syntax. +False negatives due to assert_type use. """ output = """ -generics_syntax_declarations.py:13:17 Parsing failure [404]: invalid syntax +generics_syntax_declarations.py:32:8 Undefined attribute [16]: `Variable[T (bound to str)]` has no attribute `is_integer`. +generics_syntax_declarations.py:44:20 Invalid bound [75]: `dict[(str, V)]` is not valid bound. +generics_syntax_declarations.py:48:16 Invalid bound [75]: `[str, int]` is not valid bound. +generics_syntax_declarations.py:60:16 Invalid bound [75]: `()` is not valid bound. +generics_syntax_declarations.py:64:16 Invalid bound [75]: `(str)` is not valid bound. +generics_syntax_declarations.py:71:16 Invalid bound [75]: `$local_generics_syntax_declarations$t1` is not valid bound. +generics_syntax_declarations.py:75:16 Invalid bound [75]: `(3, bytes)` is not valid bound. +generics_syntax_declarations.py:79:16 Invalid bound [75]: `(list[S], str)` is not valid bound. """ conformance_automated = "Fail" errors_diff = """ Line 17: Expected 1 errors Line 25: Expected 1 errors -Line 32: Expected 1 errors -Line 44: Expected 1 errors -Line 48: Expected 1 errors -Line 60: Expected 1 errors -Line 64: Expected 1 errors -Line 71: Expected 1 errors -Line 75: Expected 1 errors -Line 79: Expected 1 errors -Line 13: Unexpected errors ['generics_syntax_declarations.py:13:17 Parsing failure [404]: invalid syntax'] """ diff --git a/conformance/results/pyre/generics_syntax_infer_variance.toml b/conformance/results/pyre/generics_syntax_infer_variance.toml index 7a8486583..2894b29bd 100644 --- a/conformance/results/pyre/generics_syntax_infer_variance.toml +++ b/conformance/results/pyre/generics_syntax_infer_variance.toml @@ -1,29 +1,33 @@ -conformant = "Unsupported" +conformant = "Partial" notes = """ -Type parameter syntax not yet support. +Incorrectly determines that a class cannot be instantiated with __getitem__. +Incorrectly handles mixing legacy and PEP695 syntax. """ output = """ -generics_syntax_infer_variance.py:132:25 Parsing failure [404]: invalid syntax +generics_syntax_infer_variance.py:15:0 Invalid variance definition [77]: Cannot use infer_variance with predefined variance. +generics_syntax_infer_variance.py:17:0 Invalid variance definition [77]: Cannot use infer_variance with predefined variance. +generics_syntax_infer_variance.py:29:0 Incompatible variable type [9]: vco1_2 is declared to have type `ShouldBeCovariant1[int]` but is used as type `ShouldBeCovariant1[float]`. +generics_syntax_infer_variance.py:36:36 Invalid class instantiation [45]: Cannot instantiate abstract class `ShouldBeCovariant2` with abstract methods `__getitem__`, `__len__`. +generics_syntax_infer_variance.py:37:0 Incompatible variable type [9]: vco2_2 is declared to have type `ShouldBeCovariant2[int]` but is used as type `ShouldBeCovariant2[float]`. +generics_syntax_infer_variance.py:37:34 Invalid class instantiation [45]: Cannot instantiate abstract class `ShouldBeCovariant2` with abstract methods `__getitem__`, `__len__`. +generics_syntax_infer_variance.py:46:0 Incompatible variable type [9]: vco3_2 is declared to have type `ShouldBeCovariant3[int]` but is used as type `ShouldBeCovariant3[float]`. +generics_syntax_infer_variance.py:75:0 Incompatible variable type [9]: vo5_2 is declared to have type `ShouldBeCovariant5[int]` but is used as type `ShouldBeCovariant5[float]`. +generics_syntax_infer_variance.py:86:0 Incompatible variable type [9]: vo6_2 is declared to have type `ShouldBeCovariant6[int]` but is used as type `ShouldBeCovariant6[float]`. +generics_syntax_infer_variance.py:102:0 Incompatible variable type [9]: vinv1_1 is declared to have type `ShouldBeInvariant1[float]` but is used as type `ShouldBeInvariant1[int]`. +generics_syntax_infer_variance.py:103:0 Incompatible variable type [9]: vinv1_2 is declared to have type `ShouldBeInvariant1[int]` but is used as type `ShouldBeInvariant1[float]`. +generics_syntax_infer_variance.py:117:0 Incompatible variable type [9]: vinv2_1 is declared to have type `ShouldBeInvariant2[float]` but is used as type `ShouldBeInvariant2[int]`. +generics_syntax_infer_variance.py:118:0 Incompatible variable type [9]: vinv2_2 is declared to have type `ShouldBeInvariant2[int]` but is used as type `ShouldBeInvariant2[float]`. +generics_syntax_infer_variance.py:125:0 Incompatible variable type [9]: vinv3_1 is declared to have type `ShouldBeInvariant3[float, str]` but is used as type `ShouldBeInvariant3[int, str]`. +generics_syntax_infer_variance.py:126:0 Incompatible variable type [9]: vinv3_2 is declared to have type `ShouldBeInvariant3[int, str]` but is used as type `ShouldBeInvariant3[float, str]`. +generics_syntax_infer_variance.py:127:0 Incompatible variable type [9]: vinv3_3 is declared to have type `ShouldBeInvariant3[str, float]` but is used as type `ShouldBeInvariant3[str, int]`. +generics_syntax_infer_variance.py:128:0 Incompatible variable type [9]: vinv3_4 is declared to have type `ShouldBeInvariant3[str, int]` but is used as type `ShouldBeInvariant3[str, float]`. +generics_syntax_infer_variance.py:133:7 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Variable[T]`. To reference the type variable, you can modify the class to inherit from `typing.Generic[T]`. +generics_syntax_infer_variance.py:155:0 Incompatible variable type [9]: vcontra1_1 is declared to have type `ShouldBeContravariant1[float]` but is used as type `ShouldBeContravariant1[int]`. """ conformance_automated = "Fail" errors_diff = """ -Line 15: Expected 1 errors -Line 17: Expected 1 errors -Line 29: Expected 1 errors -Line 37: Expected 1 errors -Line 46: Expected 1 errors -Line 75: Expected 1 errors -Line 86: Expected 1 errors -Line 102: Expected 1 errors -Line 103: Expected 1 errors -Line 117: Expected 1 errors -Line 118: Expected 1 errors -Line 125: Expected 1 errors -Line 126: Expected 1 errors -Line 127: Expected 1 errors -Line 128: Expected 1 errors Line 136: Expected 1 errors Line 144: Expected 1 errors -Line 155: Expected 1 errors -Line 132: Unexpected errors ['generics_syntax_infer_variance.py:132:25 Parsing failure [404]: invalid syntax'] +Line 36: Unexpected errors ['generics_syntax_infer_variance.py:36:36 Invalid class instantiation [45]: Cannot instantiate abstract class `ShouldBeCovariant2` with abstract methods `__getitem__`, `__len__`.'] +Line 133: Unexpected errors ["generics_syntax_infer_variance.py:133:7 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Variable[T]`. To reference the type variable, you can modify the class to inherit from `typing.Generic[T]`."] """ diff --git a/conformance/results/pyre/generics_syntax_scoping.toml b/conformance/results/pyre/generics_syntax_scoping.toml index db9a56f1a..4ac894c8c 100644 --- a/conformance/results/pyre/generics_syntax_scoping.toml +++ b/conformance/results/pyre/generics_syntax_scoping.toml @@ -1,16 +1,20 @@ -conformant = "Unsupported" +conformant = "Partial" notes = """ -Type parameter syntax not yet support. +Does not properly handle mixing legacy syntax with PEP695 syntax. """ output = """ -generics_syntax_scoping.py:14:13 Parsing failure [404]: invalid syntax +generics_syntax_scoping.py:14:19 Invalid bound [75]: `typing.Sequence[$local_generics_syntax_scoping$S]` is not valid bound. +generics_syntax_scoping.py:18:16 Invalid bound [75]: `typing.Sequence[$local_generics_syntax_scoping$T]` is not valid bound. +generics_syntax_scoping.py:27:38 Undefined or invalid type [11]: Annotation `T` is not defined as a type. +generics_syntax_scoping.py:31:41 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[T]]` but got `int`. +generics_syntax_scoping.py:98:28 Undefined or invalid type [11]: Annotation `ClassE.T` is not defined as a type. """ conformance_automated = "Fail" errors_diff = """ -Line 18: Expected 1 errors Line 35: Expected 1 errors Line 44: Expected 1 errors Line 92: Expected 1 errors Line 95: Expected 1 errors -Line 98: Expected 1 errors +Line 27: Unexpected errors ['generics_syntax_scoping.py:27:38 Undefined or invalid type [11]: Annotation `T` is not defined as a type.'] +Line 31: Unexpected errors ['generics_syntax_scoping.py:31:41 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[T]]` but got `int`.'] """ diff --git a/conformance/results/pyre/generics_type_erasure.toml b/conformance/results/pyre/generics_type_erasure.toml index f2bc6919e..af4f56c41 100644 --- a/conformance/results/pyre/generics_type_erasure.toml +++ b/conformance/results/pyre/generics_type_erasure.toml @@ -3,15 +3,16 @@ notes = """ Does not erase unspecified type variables to `Any` prior to `assert_type` handling. False negatives on instance attribute access on the type. Does not infer type of `DefaultDict` with explicit type parameters on constructor. +False negatives on assert_type uses. """ output = """ -generics_type_erasure.py:17:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Node[str]` but got `Node[typing_extensions.Literal['']]`. -generics_type_erasure.py:18:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Node[int]` but got `Node[typing_extensions.Literal[0]]`. -generics_type_erasure.py:19:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Node[typing.Any]` but got `Node[Variable[T]]`. -generics_type_erasure.py:21:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `typing_extensions.Literal[0]`. +generics_type_erasure.py:17:0 Assert type [70]: Expected `Node[str]` but got `Node[typing_extensions.Literal['']]`. +generics_type_erasure.py:18:0 Assert type [70]: Expected `Node[int]` but got `Node[typing_extensions.Literal[0]]`. +generics_type_erasure.py:19:0 Assert type [70]: Expected `Node[typing.Any]` but got `Node[Variable[T]]`. +generics_type_erasure.py:21:0 Assert type [70]: Expected `int` but got `typing_extensions.Literal[0]`. generics_type_erasure.py:38:15 Incompatible parameter type [6]: In call `Node.__init__`, for 1st positional argument, expected `Optional[int]` but got `str`. generics_type_erasure.py:40:15 Incompatible parameter type [6]: In call `Node.__init__`, for 1st positional argument, expected `Optional[str]` but got `int`. -generics_type_erasure.py:56:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `bytes` but got `typing.Any`. +generics_type_erasure.py:56:0 Assert type [70]: Expected `bytes` but got `typing.Any`. """ conformance_automated = "Fail" errors_diff = """ @@ -20,9 +21,9 @@ Line 43: Expected 1 errors Line 44: Expected 1 errors Line 45: Expected 1 errors Line 46: Expected 1 errors -Line 17: Unexpected errors ["generics_type_erasure.py:17:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Node[str]` but got `Node[typing_extensions.Literal['']]`."] -Line 18: Unexpected errors ['generics_type_erasure.py:18:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Node[int]` but got `Node[typing_extensions.Literal[0]]`.'] -Line 19: Unexpected errors ['generics_type_erasure.py:19:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Node[typing.Any]` but got `Node[Variable[T]]`.'] -Line 21: Unexpected errors ['generics_type_erasure.py:21:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `typing_extensions.Literal[0]`.'] -Line 56: Unexpected errors ['generics_type_erasure.py:56:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `bytes` but got `typing.Any`.'] +Line 17: Unexpected errors ["generics_type_erasure.py:17:0 Assert type [70]: Expected `Node[str]` but got `Node[typing_extensions.Literal['']]`."] +Line 18: Unexpected errors ['generics_type_erasure.py:18:0 Assert type [70]: Expected `Node[int]` but got `Node[typing_extensions.Literal[0]]`.'] +Line 19: Unexpected errors ['generics_type_erasure.py:19:0 Assert type [70]: Expected `Node[typing.Any]` but got `Node[Variable[T]]`.'] +Line 21: Unexpected errors ['generics_type_erasure.py:21:0 Assert type [70]: Expected `int` but got `typing_extensions.Literal[0]`.'] +Line 56: Unexpected errors ['generics_type_erasure.py:56:0 Assert type [70]: Expected `bytes` but got `typing.Any`.'] """ diff --git a/conformance/results/pyre/generics_typevartuple_args.toml b/conformance/results/pyre/generics_typevartuple_args.toml index eaca737dd..7f48df0cd 100644 --- a/conformance/results/pyre/generics_typevartuple_args.toml +++ b/conformance/results/pyre/generics_typevartuple_args.toml @@ -1,32 +1,25 @@ -conformant = "Unsupported" +conformant = "Partial" notes = """ -Does not support star expressions for `Unpack`. +Does not property handle TypeVarTuple. """ output = """ -generics_typevartuple_args.py:16:25 Invalid type [31]: Expression `*Ts` is not a valid type. -generics_typevartuple_args.py:16:33 Invalid type [31]: Expression `tuple[(*Ts)]` is not a valid type. -generics_typevartuple_args.py:27:30 Invalid type [31]: Expression `*tuple[(*Ts, generics_typevartuple_args.Env)]` is not a valid type. -generics_typevartuple_args.py:27:76 Invalid type [31]: Expression `tuple[(*Ts)]` is not a valid type. -generics_typevartuple_args.py:42:17 Invalid type [31]: Expression `*tuple[(int, ...)]` is not a valid type. -generics_typevartuple_args.py:51:17 Invalid type [31]: Expression `*tuple[(int, *tuple[(str, ...)], str)]` is not a valid type. -generics_typevartuple_args.py:62:17 Invalid type [31]: Expression `*tuple[(int, str)]` is not a valid type. -generics_typevartuple_args.py:70:17 Invalid type [31]: Expression `tuple[(*Ts)]` is not a valid type. -generics_typevartuple_args.py:75:12 Incompatible parameter type [6]: In call `func4`, for 2nd positional argument, expected `Tuple[]` but got `Tuple[int, int]`. Expected has length 1, but actual has length 2. +generics_typevartuple_args.py:20:0 Assert type [70]: Expected `Tuple[int, str]` but got `Tuple[typing_extensions.Literal[1], typing_extensions.Literal['a']]`. +generics_typevartuple_args.py:32:0 Assert type [70]: Expected `Tuple[int, str]` but got `Tuple[typing_extensions.Literal[0], typing_extensions.Literal['']]`. +generics_typevartuple_args.py:33:0 Invalid argument [32]: Argument types `typing_extensions.Literal[0], typing_extensions.Literal['']` are not compatible with expected variadic elements `*generics_typevartuple_args.Ts, generics_typevartuple_args.Env`. +generics_typevartuple_args.py:34:0 Invalid argument [32]: Argument types `typing_extensions.Literal[0], typing_extensions.Literal['']` are not compatible with expected variadic elements `*generics_typevartuple_args.Ts, generics_typevartuple_args.Env`. +generics_typevartuple_args.py:48:9 Incompatible parameter type [6]: In call `func1`, for 2nd positional argument, expected `int` but got `str`. +generics_typevartuple_args.py:57:0 Invalid argument [32]: Argument types `typing_extensions.Literal[1], typing_extensions.Literal[1], typing_extensions.Literal['']` are not compatible with expected variadic elements `int, *Tuple[str, ...], str`. +generics_typevartuple_args.py:58:0 Invalid argument [32]: Argument types `typing_extensions.Literal[1]` are not compatible with expected variadic elements `int, *Tuple[str, ...], str`. +generics_typevartuple_args.py:59:0 Invalid argument [32]: Argument types `typing_extensions.Literal['']` are not compatible with expected variadic elements `int, *Tuple[str, ...], str`. +generics_typevartuple_args.py:66:6 Incompatible parameter type [6]: In call `func3`, for 1st positional argument, expected `Unpack[Tuple[int, str]]` but got `int`. +generics_typevartuple_args.py:66:9 Incompatible parameter type [6]: In call `func3`, for 2nd positional argument, expected `Unpack[Tuple[int, str]]` but got `str`. +generics_typevartuple_args.py:67:6 Incompatible parameter type [6]: In call `func3`, for 1st positional argument, expected `Unpack[Tuple[int, str]]` but got `int`. """ conformance_automated = "Fail" errors_diff = """ -Line 33: Expected 1 errors -Line 34: Expected 1 errors -Line 48: Expected 1 errors -Line 57: Expected 1 errors -Line 58: Expected 1 errors -Line 59: Expected 1 errors -Line 67: Expected 1 errors +Line 75: Expected 1 errors Line 76: Expected 1 errors -Line 16: Unexpected errors ['generics_typevartuple_args.py:16:25 Invalid type [31]: Expression `*Ts` is not a valid type.', 'generics_typevartuple_args.py:16:33 Invalid type [31]: Expression `tuple[(*Ts)]` is not a valid type.'] -Line 27: Unexpected errors ['generics_typevartuple_args.py:27:30 Invalid type [31]: Expression `*tuple[(*Ts, generics_typevartuple_args.Env)]` is not a valid type.', 'generics_typevartuple_args.py:27:76 Invalid type [31]: Expression `tuple[(*Ts)]` is not a valid type.'] -Line 42: Unexpected errors ['generics_typevartuple_args.py:42:17 Invalid type [31]: Expression `*tuple[(int, ...)]` is not a valid type.'] -Line 51: Unexpected errors ['generics_typevartuple_args.py:51:17 Invalid type [31]: Expression `*tuple[(int, *tuple[(str, ...)], str)]` is not a valid type.'] -Line 62: Unexpected errors ['generics_typevartuple_args.py:62:17 Invalid type [31]: Expression `*tuple[(int, str)]` is not a valid type.'] -Line 70: Unexpected errors ['generics_typevartuple_args.py:70:17 Invalid type [31]: Expression `tuple[(*Ts)]` is not a valid type.'] +Line 20: Unexpected errors ["generics_typevartuple_args.py:20:0 Assert type [70]: Expected `Tuple[int, str]` but got `Tuple[typing_extensions.Literal[1], typing_extensions.Literal['a']]`."] +Line 32: Unexpected errors ["generics_typevartuple_args.py:32:0 Assert type [70]: Expected `Tuple[int, str]` but got `Tuple[typing_extensions.Literal[0], typing_extensions.Literal['']]`."] +Line 66: Unexpected errors ['generics_typevartuple_args.py:66:6 Incompatible parameter type [6]: In call `func3`, for 1st positional argument, expected `Unpack[Tuple[int, str]]` but got `int`.', 'generics_typevartuple_args.py:66:9 Incompatible parameter type [6]: In call `func3`, for 2nd positional argument, expected `Unpack[Tuple[int, str]]` but got `str`.'] """ diff --git a/conformance/results/pyre/generics_typevartuple_basic.toml b/conformance/results/pyre/generics_typevartuple_basic.toml index 8964996ac..6b3fded1b 100644 --- a/conformance/results/pyre/generics_typevartuple_basic.toml +++ b/conformance/results/pyre/generics_typevartuple_basic.toml @@ -1,73 +1,33 @@ -conformant = "Unsupported" +conformant = "Partial" notes = """ Does not support TypeVarTuple. +False negatives due to assert_type. """ output = """ -generics_typevartuple_basic.py:12:13 Invalid type [31]: Expression `typing.Generic[(*Ts)]` is not a valid type. -generics_typevartuple_basic.py:16:17 Invalid type [31]: Expression `*Ts` is not a valid type. -generics_typevartuple_basic.py:16:25 Invalid type [31]: Expression `tuple[(*Ts)]` is not a valid type. -generics_typevartuple_basic.py:23:12 Invalid type [31]: Expression `typing.Generic[(*Shape)]` is not a valid type. -generics_typevartuple_basic.py:24:30 Invalid type [31]: Expression `tuple[(*Shape)]` is not a valid type. -generics_typevartuple_basic.py:25:21 Invalid type [31]: Expression `tuple[(*Shape)]` is not a valid type. -generics_typevartuple_basic.py:27:27 Invalid type [31]: Expression `tuple[(*Shape)]` is not a valid type. -generics_typevartuple_basic.py:36:0 Incompatible variable type [9]: v1 is declared to have type `Array[]` but is used as type `Array`. -generics_typevartuple_basic.py:36:4 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. -generics_typevartuple_basic.py:36:33 Incompatible parameter type [6]: In call `Array.__init__`, for 1st positional argument, expected `Tuple[]` but got `Tuple[Height, Width]`. Expected has length 1, but actual has length 2. -generics_typevartuple_basic.py:37:0 Incompatible variable type [9]: v2 is declared to have type `Array[]` but is used as type `Array`. -generics_typevartuple_basic.py:37:4 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. -generics_typevartuple_basic.py:37:40 Incompatible parameter type [6]: In call `Array.__init__`, for 1st positional argument, expected `Tuple[]` but got `Tuple[Batch, Height, Width]`. Expected has length 1, but actual has length 3. -generics_typevartuple_basic.py:38:0 Incompatible variable type [9]: v3 is declared to have type `Array[]` but is used as type `Array`. -generics_typevartuple_basic.py:38:4 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. -generics_typevartuple_basic.py:39:4 Incompatible parameter type [6]: In call `Array.__init__`, for 1st positional argument, expected `Tuple[]` but got `Tuple[Time, Batch, Height, Width]`. Expected has length 1, but actual has length 4. -generics_typevartuple_basic.py:42:0 Incompatible variable type [9]: v4 is declared to have type `Array[]` but is used as type `Array`. -generics_typevartuple_basic.py:42:4 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. -generics_typevartuple_basic.py:42:33 Incompatible parameter type [6]: In call `Array.__init__`, for 1st positional argument, expected `Tuple[]` but got `Height`. -generics_typevartuple_basic.py:43:0 Incompatible variable type [9]: v5 is declared to have type `Array[]` but is used as type `Array`. -generics_typevartuple_basic.py:43:4 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. -generics_typevartuple_basic.py:43:40 Incompatible parameter type [6]: In call `Array.__init__`, for 1st positional argument, expected `Tuple[]` but got `Tuple[Batch, Width]`. Expected has length 1, but actual has length 2. -generics_typevartuple_basic.py:44:0 Incompatible variable type [9]: v6 is declared to have type `Array[]` but is used as type `Array`. -generics_typevartuple_basic.py:44:4 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. -generics_typevartuple_basic.py:45:4 Incompatible parameter type [6]: In call `Array.__init__`, for 1st positional argument, expected `Tuple[]` but got `Tuple[Time, Batch, Width, Height]`. Expected has length 1, but actual has length 4. +generics_typevartuple_basic.py:42:33 Incompatible parameter type [6]: In call `Array.__init__`, for 1st positional argument, expected `typing.Tuple[*generics_typevartuple_basic.Shape]` but got `Height`. +generics_typevartuple_basic.py:43:0 Incompatible variable type [9]: v5 is declared to have type `Array[Batch, Height, Width]` but is used as type `Array[Batch, Width]`. +generics_typevartuple_basic.py:44:0 Incompatible variable type [9]: v6 is declared to have type `Array[Time, Batch, Height, Width]` but is used as type `Array[Time, Batch, Width, Height]`. generics_typevartuple_basic.py:52:13 Undefined or invalid type [11]: Annotation `Shape` is not defined as a type. -generics_typevartuple_basic.py:54:21 Invalid type [31]: Expression `tuple[(*Shape)]` is not a valid type. +generics_typevartuple_basic.py:54:21 Invalid type variable [34]: The type variable `Shape` isn't present in the function's parameters. generics_typevartuple_basic.py:65:6 Unexpected keyword [28]: Unexpected keyword argument `covariant` to call `TypeVarTuple.__init__`. generics_typevartuple_basic.py:66:6 Too many arguments [19]: Call `TypeVarTuple.__init__` expects 1 positional argument, 3 were provided. generics_typevartuple_basic.py:67:6 Unexpected keyword [28]: Unexpected keyword argument `bound` to call `TypeVarTuple.__init__`. -generics_typevartuple_basic.py:75:16 Invalid type [31]: Expression `tuple[(*Ts)]` is not a valid type. -generics_typevartuple_basic.py:75:34 Invalid type [31]: Expression `tuple[(*Ts)]` is not a valid type. -generics_typevartuple_basic.py:75:49 Invalid type [31]: Expression `tuple[(*Ts)]` is not a valid type. -generics_typevartuple_basic.py:90:6 Incompatible parameter type [6]: In call `func2`, for 1st positional argument, expected `Tuple[]` but got `Tuple[int, int]`. Expected has length 1, but actual has length 2. -generics_typevartuple_basic.py:93:16 Invalid type [31]: Expression `generics_typevartuple_basic.Array[(*Shape)]` is not a valid type. -generics_typevartuple_basic.py:93:16 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. -generics_typevartuple_basic.py:93:34 Invalid type [31]: Expression `generics_typevartuple_basic.Array[(*Shape)]` is not a valid type. -generics_typevartuple_basic.py:93:34 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. -generics_typevartuple_basic.py:93:52 Invalid type [31]: Expression `generics_typevartuple_basic.Array[(*Shape)]` is not a valid type. -generics_typevartuple_basic.py:93:52 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. -generics_typevartuple_basic.py:97:13 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. -generics_typevartuple_basic.py:97:31 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. -generics_typevartuple_basic.py:97:48 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. -generics_typevartuple_basic.py:106:13 Invalid type [31]: Expression `typing.Generic[(*Ts1, *Ts2)]` is not a valid type. +generics_typevartuple_basic.py:84:0 Assert type [70]: Expected `Tuple[int]` but got `Tuple[typing_extensions.Literal[0]]`. +generics_typevartuple_basic.py:84:24 Incompatible parameter type [6]: In call `func2`, for 2nd positional argument, expected `typing.Tuple[*generics_typevartuple_basic.Ts]` but got `Tuple[int]`. +generics_typevartuple_basic.py:87:12 Incompatible parameter type [6]: In call `func2`, for 2nd positional argument, expected `typing.Tuple[*generics_typevartuple_basic.Ts]` but got `Tuple[int]`. +generics_typevartuple_basic.py:89:12 Incompatible parameter type [6]: In call `func2`, for 2nd positional argument, expected `typing.Tuple[*generics_typevartuple_basic.Ts]` but got `Tuple[str]`. +generics_typevartuple_basic.py:90:14 Incompatible parameter type [6]: In call `func2`, for 2nd positional argument, expected `typing.Tuple[*generics_typevartuple_basic.Ts]` but got `Tuple[int]`. +generics_typevartuple_basic.py:99:16 Incompatible parameter type [6]: In call `multiply`, for 2nd positional argument, expected `Array[*generics_typevartuple_basic.Shape]` but got `Array[Width]`. +generics_typevartuple_basic.py:100:16 Incompatible parameter type [6]: In call `multiply`, for 2nd positional argument, expected `Array[*generics_typevartuple_basic.Shape]` but got `Array[Height, Width]`. +generics_typevartuple_basic.py:106:13 Undefined or invalid type [11]: Annotation `Ts1` is not defined as a type. +generics_typevartuple_basic.py:106:13 Undefined or invalid type [11]: Annotation `Ts2` is not defined as a type. """ conformance_automated = "Fail" errors_diff = """ Line 53: Expected 1 errors Line 56: Expected 1 errors Line 59: Expected 1 errors -Line 89: Expected 1 errors -Line 99: Expected 1 errors -Line 100: Expected 1 errors -Line 12: Unexpected errors ['generics_typevartuple_basic.py:12:13 Invalid type [31]: Expression `typing.Generic[(*Ts)]` is not a valid type.'] -Line 16: Unexpected errors ['generics_typevartuple_basic.py:16:17 Invalid type [31]: Expression `*Ts` is not a valid type.', 'generics_typevartuple_basic.py:16:25 Invalid type [31]: Expression `tuple[(*Ts)]` is not a valid type.'] -Line 23: Unexpected errors ['generics_typevartuple_basic.py:23:12 Invalid type [31]: Expression `typing.Generic[(*Shape)]` is not a valid type.'] -Line 24: Unexpected errors ['generics_typevartuple_basic.py:24:30 Invalid type [31]: Expression `tuple[(*Shape)]` is not a valid type.'] -Line 25: Unexpected errors ['generics_typevartuple_basic.py:25:21 Invalid type [31]: Expression `tuple[(*Shape)]` is not a valid type.'] -Line 27: Unexpected errors ['generics_typevartuple_basic.py:27:27 Invalid type [31]: Expression `tuple[(*Shape)]` is not a valid type.'] -Line 36: Unexpected errors ['generics_typevartuple_basic.py:36:0 Incompatible variable type [9]: v1 is declared to have type `Array[]` but is used as type `Array`.', 'generics_typevartuple_basic.py:36:4 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.', 'generics_typevartuple_basic.py:36:33 Incompatible parameter type [6]: In call `Array.__init__`, for 1st positional argument, expected `Tuple[]` but got `Tuple[Height, Width]`. Expected has length 1, but actual has length 2.'] -Line 37: Unexpected errors ['generics_typevartuple_basic.py:37:0 Incompatible variable type [9]: v2 is declared to have type `Array[]` but is used as type `Array`.', 'generics_typevartuple_basic.py:37:4 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.', 'generics_typevartuple_basic.py:37:40 Incompatible parameter type [6]: In call `Array.__init__`, for 1st positional argument, expected `Tuple[]` but got `Tuple[Batch, Height, Width]`. Expected has length 1, but actual has length 3.'] -Line 38: Unexpected errors ['generics_typevartuple_basic.py:38:0 Incompatible variable type [9]: v3 is declared to have type `Array[]` but is used as type `Array`.', 'generics_typevartuple_basic.py:38:4 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.'] -Line 39: Unexpected errors ['generics_typevartuple_basic.py:39:4 Incompatible parameter type [6]: In call `Array.__init__`, for 1st positional argument, expected `Tuple[]` but got `Tuple[Time, Batch, Height, Width]`. Expected has length 1, but actual has length 4.'] -Line 54: Unexpected errors ['generics_typevartuple_basic.py:54:21 Invalid type [31]: Expression `tuple[(*Shape)]` is not a valid type.'] -Line 75: Unexpected errors ['generics_typevartuple_basic.py:75:16 Invalid type [31]: Expression `tuple[(*Ts)]` is not a valid type.', 'generics_typevartuple_basic.py:75:34 Invalid type [31]: Expression `tuple[(*Ts)]` is not a valid type.', 'generics_typevartuple_basic.py:75:49 Invalid type [31]: Expression `tuple[(*Ts)]` is not a valid type.'] -Line 93: Unexpected errors ['generics_typevartuple_basic.py:93:16 Invalid type [31]: Expression `generics_typevartuple_basic.Array[(*Shape)]` is not a valid type.', 'generics_typevartuple_basic.py:93:16 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.', 'generics_typevartuple_basic.py:93:34 Invalid type [31]: Expression `generics_typevartuple_basic.Array[(*Shape)]` is not a valid type.', 'generics_typevartuple_basic.py:93:34 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.', 'generics_typevartuple_basic.py:93:52 Invalid type [31]: Expression `generics_typevartuple_basic.Array[(*Shape)]` is not a valid type.', 'generics_typevartuple_basic.py:93:52 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.'] -Line 97: Unexpected errors ['generics_typevartuple_basic.py:97:13 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.', 'generics_typevartuple_basic.py:97:31 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.', 'generics_typevartuple_basic.py:97:48 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.'] +Line 54: Unexpected errors ["generics_typevartuple_basic.py:54:21 Invalid type variable [34]: The type variable `Shape` isn't present in the function's parameters."] +Line 84: Unexpected errors ['generics_typevartuple_basic.py:84:0 Assert type [70]: Expected `Tuple[int]` but got `Tuple[typing_extensions.Literal[0]]`.', 'generics_typevartuple_basic.py:84:24 Incompatible parameter type [6]: In call `func2`, for 2nd positional argument, expected `typing.Tuple[*generics_typevartuple_basic.Ts]` but got `Tuple[int]`.'] +Line 87: Unexpected errors ['generics_typevartuple_basic.py:87:12 Incompatible parameter type [6]: In call `func2`, for 2nd positional argument, expected `typing.Tuple[*generics_typevartuple_basic.Ts]` but got `Tuple[int]`.'] """ diff --git a/conformance/results/pyre/generics_typevartuple_callable.toml b/conformance/results/pyre/generics_typevartuple_callable.toml index e3c989ea8..aa0453d99 100644 --- a/conformance/results/pyre/generics_typevartuple_callable.toml +++ b/conformance/results/pyre/generics_typevartuple_callable.toml @@ -1,28 +1,12 @@ -conformant = "Unsupported" +conformant = "Partial" notes = """ -Does not support TypeVarTuple. +False negatives due to assert_type. """ output = """ -generics_typevartuple_callable.py:17:31 Invalid type [31]: Expression `typing.Callable[([*Ts], None)]` is not a valid type. -generics_typevartuple_callable.py:17:60 Invalid type [31]: Expression `tuple[(*Ts)]` is not a valid type. -generics_typevartuple_callable.py:25:8 Incompatible parameter type [6]: In call `Process.__init__`, for argument `target`, expected `typing.Callable[[unknown], None]` but got `typing.Callable(func1)[[Named(arg1, int), Named(arg2, str)], None]`. -generics_typevartuple_callable.py:25:22 Incompatible parameter type [6]: In call `Process.__init__`, for argument `args`, expected `Tuple[]` but got `Tuple[int, str]`. Expected has length 1, but actual has length 2. -generics_typevartuple_callable.py:26:8 Incompatible parameter type [6]: In call `Process.__init__`, for argument `target`, expected `typing.Callable[[unknown], None]` but got `typing.Callable(func1)[[Named(arg1, int), Named(arg2, str)], None]`. -generics_typevartuple_callable.py:26:22 Incompatible parameter type [6]: In call `Process.__init__`, for argument `args`, expected `Tuple[]` but got `Tuple[str, int]`. Expected has length 1, but actual has length 2. -generics_typevartuple_callable.py:29:13 Invalid type [31]: Expression `typing.Callable[([int, *Ts, T], tuple[(T, *Ts)])]` is not a valid type. -generics_typevartuple_callable.py:29:56 Invalid type [31]: Expression `tuple[(*Ts, T)]` is not a valid type. -generics_typevartuple_callable.py:41:18 Incompatible parameter type [6]: In call `func2`, for 1st positional argument, expected `typing.Callable[[int, unknown, Variable[T]], Tuple[Variable[T], unknown]]` but got `typing.Callable(callback1)[[Named(a, int), Named(b, str), Named(c, int), Named(d, complex)], Tuple[complex, str, int]]`. -generics_typevartuple_callable.py:42:18 Incompatible parameter type [6]: In call `func2`, for 1st positional argument, expected `typing.Callable[[int, unknown, Variable[T]], Tuple[Variable[T], unknown]]` but got `typing.Callable(callback2)[[Named(a, int), Named(d, str)], Tuple[str]]`. -generics_typevartuple_callable.py:45:17 Invalid type [31]: Expression `*tuple[(int, *Ts, T)]` is not a valid type. -generics_typevartuple_callable.py:45:42 Invalid type [31]: Expression `tuple[(T, *Ts)]` is not a valid type. -generics_typevartuple_callable.py:45:42 Invalid type variable [34]: The type variable `Variable[T]` isn't present in the function's parameters. +generics_typevartuple_callable.py:26:8 Incompatible parameter type [6]: In call `Process.__init__`, for argument `target`, expected `typing.Callable[[Variable(*generics_typevartuple_callable.Ts)], None]` but got `typing.Callable(func1)[[Named(arg1, int), Named(arg2, str)], None]`. +generics_typevartuple_callable.py:49:0 Assert type [70]: Expected `Tuple[float, str, complex]` but got `Tuple[float, typing_extensions.Literal[''], complex]`. """ conformance_automated = "Fail" errors_diff = """ -Line 17: Unexpected errors ['generics_typevartuple_callable.py:17:31 Invalid type [31]: Expression `typing.Callable[([*Ts], None)]` is not a valid type.', 'generics_typevartuple_callable.py:17:60 Invalid type [31]: Expression `tuple[(*Ts)]` is not a valid type.'] -Line 25: Unexpected errors ['generics_typevartuple_callable.py:25:8 Incompatible parameter type [6]: In call `Process.__init__`, for argument `target`, expected `typing.Callable[[unknown], None]` but got `typing.Callable(func1)[[Named(arg1, int), Named(arg2, str)], None]`.', 'generics_typevartuple_callable.py:25:22 Incompatible parameter type [6]: In call `Process.__init__`, for argument `args`, expected `Tuple[]` but got `Tuple[int, str]`. Expected has length 1, but actual has length 2.'] -Line 29: Unexpected errors ['generics_typevartuple_callable.py:29:13 Invalid type [31]: Expression `typing.Callable[([int, *Ts, T], tuple[(T, *Ts)])]` is not a valid type.', 'generics_typevartuple_callable.py:29:56 Invalid type [31]: Expression `tuple[(*Ts, T)]` is not a valid type.'] -Line 41: Unexpected errors ['generics_typevartuple_callable.py:41:18 Incompatible parameter type [6]: In call `func2`, for 1st positional argument, expected `typing.Callable[[int, unknown, Variable[T]], Tuple[Variable[T], unknown]]` but got `typing.Callable(callback1)[[Named(a, int), Named(b, str), Named(c, int), Named(d, complex)], Tuple[complex, str, int]]`.'] -Line 42: Unexpected errors ['generics_typevartuple_callable.py:42:18 Incompatible parameter type [6]: In call `func2`, for 1st positional argument, expected `typing.Callable[[int, unknown, Variable[T]], Tuple[Variable[T], unknown]]` but got `typing.Callable(callback2)[[Named(a, int), Named(d, str)], Tuple[str]]`.'] -Line 45: Unexpected errors ['generics_typevartuple_callable.py:45:17 Invalid type [31]: Expression `*tuple[(int, *Ts, T)]` is not a valid type.', 'generics_typevartuple_callable.py:45:42 Invalid type [31]: Expression `tuple[(T, *Ts)]` is not a valid type.', "generics_typevartuple_callable.py:45:42 Invalid type variable [34]: The type variable `Variable[T]` isn't present in the function's parameters."] +Line 49: Unexpected errors ["generics_typevartuple_callable.py:49:0 Assert type [70]: Expected `Tuple[float, str, complex]` but got `Tuple[float, typing_extensions.Literal[''], complex]`."] """ diff --git a/conformance/results/pyre/generics_typevartuple_concat.toml b/conformance/results/pyre/generics_typevartuple_concat.toml index e3a1bf0fd..3754ffc8e 100644 --- a/conformance/results/pyre/generics_typevartuple_concat.toml +++ b/conformance/results/pyre/generics_typevartuple_concat.toml @@ -1,39 +1,14 @@ -conformant = "Unsupported" +conformant = "Partial" notes = """ -Does not support TypeVarTuple. +False negatives due to assert_type. +False compatability error message. """ output = """ -generics_typevartuple_concat.py:22:12 Invalid type [31]: Expression `typing.Generic[(*Ts)]` is not a valid type. -generics_typevartuple_concat.py:26:22 Invalid type [31]: Expression `generics_typevartuple_concat.Array[(*Shape)]` is not a valid type. -generics_typevartuple_concat.py:26:22 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. -generics_typevartuple_concat.py:26:40 Invalid type [31]: Expression `generics_typevartuple_concat.Array[(generics_typevartuple_concat.Batch, *Shape)]` is not a valid type. -generics_typevartuple_concat.py:26:40 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. -generics_typevartuple_concat.py:30:22 Invalid type [31]: Expression `generics_typevartuple_concat.Array[(generics_typevartuple_concat.Batch, *Shape)]` is not a valid type. -generics_typevartuple_concat.py:30:22 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. -generics_typevartuple_concat.py:30:47 Invalid type [31]: Expression `generics_typevartuple_concat.Array[(*Shape)]` is not a valid type. -generics_typevartuple_concat.py:30:47 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. -generics_typevartuple_concat.py:34:26 Invalid type [31]: Expression `generics_typevartuple_concat.Array[(*Shape)]` is not a valid type. -generics_typevartuple_concat.py:34:26 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. -generics_typevartuple_concat.py:34:44 Invalid type [31]: Expression `generics_typevartuple_concat.Array[(generics_typevartuple_concat.Batch, *Shape, generics_typevartuple_concat.Channels)]` is not a valid type. -generics_typevartuple_concat.py:34:44 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. -generics_typevartuple_concat.py:38:13 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. -generics_typevartuple_concat.py:47:26 Invalid type [31]: Expression `tuple[(*Ts)]` is not a valid type. -generics_typevartuple_concat.py:47:41 Invalid type [31]: Expression `tuple[(T, *Ts)]` is not a valid type. -generics_typevartuple_concat.py:51:22 Incompatible parameter type [6]: In call `prefix_tuple`, for argument `y`, expected `Tuple[]` but got `Tuple[bool, str]`. Expected has length 1, but actual has length 2. -generics_typevartuple_concat.py:55:36 Invalid type [31]: Expression `tuple[(T, *Ts)]` is not a valid type. -generics_typevartuple_concat.py:55:54 Invalid type [31]: Expression `tuple[(*Ts, T)]` is not a valid type. -generics_typevartuple_concat.py:56:11 Unable to concatenate tuple [60]: Expected to unpack an iterable, but got `Variable[generics_typevartuple_concat.T]`. -generics_typevartuple_concat.py:56:17 Incompatible parameter type [6]: In call `tuple.__getitem__`, for 1st positional argument, expected `typing_extensions.Literal[0]` but got `slice`. +generics_typevartuple_concat.py:52:0 Assert type [70]: Expected `Tuple[int, bool, str]` but got `Tuple[typing_extensions.Literal[0], typing_extensions.Literal[True], typing_extensions.Literal['a']]`. +generics_typevartuple_concat.py:56:4 Incompatible return type [7]: Expected `typing.Tuple[*generics_typevartuple_concat.Ts, Variable[T]]` but got `typing.Tuple[*Tuple[object, ...], object]`. """ conformance_automated = "Fail" errors_diff = """ -Line 22: Unexpected errors ['generics_typevartuple_concat.py:22:12 Invalid type [31]: Expression `typing.Generic[(*Ts)]` is not a valid type.'] -Line 26: Unexpected errors ['generics_typevartuple_concat.py:26:22 Invalid type [31]: Expression `generics_typevartuple_concat.Array[(*Shape)]` is not a valid type.', 'generics_typevartuple_concat.py:26:22 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.', 'generics_typevartuple_concat.py:26:40 Invalid type [31]: Expression `generics_typevartuple_concat.Array[(generics_typevartuple_concat.Batch, *Shape)]` is not a valid type.', 'generics_typevartuple_concat.py:26:40 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.'] -Line 30: Unexpected errors ['generics_typevartuple_concat.py:30:22 Invalid type [31]: Expression `generics_typevartuple_concat.Array[(generics_typevartuple_concat.Batch, *Shape)]` is not a valid type.', 'generics_typevartuple_concat.py:30:22 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.', 'generics_typevartuple_concat.py:30:47 Invalid type [31]: Expression `generics_typevartuple_concat.Array[(*Shape)]` is not a valid type.', 'generics_typevartuple_concat.py:30:47 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.'] -Line 34: Unexpected errors ['generics_typevartuple_concat.py:34:26 Invalid type [31]: Expression `generics_typevartuple_concat.Array[(*Shape)]` is not a valid type.', 'generics_typevartuple_concat.py:34:26 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.', 'generics_typevartuple_concat.py:34:44 Invalid type [31]: Expression `generics_typevartuple_concat.Array[(generics_typevartuple_concat.Batch, *Shape, generics_typevartuple_concat.Channels)]` is not a valid type.', 'generics_typevartuple_concat.py:34:44 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.'] -Line 38: Unexpected errors ['generics_typevartuple_concat.py:38:13 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.'] -Line 47: Unexpected errors ['generics_typevartuple_concat.py:47:26 Invalid type [31]: Expression `tuple[(*Ts)]` is not a valid type.', 'generics_typevartuple_concat.py:47:41 Invalid type [31]: Expression `tuple[(T, *Ts)]` is not a valid type.'] -Line 51: Unexpected errors ['generics_typevartuple_concat.py:51:22 Incompatible parameter type [6]: In call `prefix_tuple`, for argument `y`, expected `Tuple[]` but got `Tuple[bool, str]`. Expected has length 1, but actual has length 2.'] -Line 55: Unexpected errors ['generics_typevartuple_concat.py:55:36 Invalid type [31]: Expression `tuple[(T, *Ts)]` is not a valid type.', 'generics_typevartuple_concat.py:55:54 Invalid type [31]: Expression `tuple[(*Ts, T)]` is not a valid type.'] -Line 56: Unexpected errors ['generics_typevartuple_concat.py:56:11 Unable to concatenate tuple [60]: Expected to unpack an iterable, but got `Variable[generics_typevartuple_concat.T]`.', 'generics_typevartuple_concat.py:56:17 Incompatible parameter type [6]: In call `tuple.__getitem__`, for 1st positional argument, expected `typing_extensions.Literal[0]` but got `slice`.'] +Line 52: Unexpected errors ["generics_typevartuple_concat.py:52:0 Assert type [70]: Expected `Tuple[int, bool, str]` but got `Tuple[typing_extensions.Literal[0], typing_extensions.Literal[True], typing_extensions.Literal['a']]`."] +Line 56: Unexpected errors ['generics_typevartuple_concat.py:56:4 Incompatible return type [7]: Expected `typing.Tuple[*generics_typevartuple_concat.Ts, Variable[T]]` but got `typing.Tuple[*Tuple[object, ...], object]`.'] """ diff --git a/conformance/results/pyre/generics_typevartuple_overloads.toml b/conformance/results/pyre/generics_typevartuple_overloads.toml index 9696e56a0..08cb3a92d 100644 --- a/conformance/results/pyre/generics_typevartuple_overloads.toml +++ b/conformance/results/pyre/generics_typevartuple_overloads.toml @@ -3,18 +3,11 @@ notes = """ Does not support star expressions for `Unpack`. """ output = """ -generics_typevartuple_overloads.py:16:12 Invalid type [31]: Expression `typing.Generic[(*Shape)]` is not a valid type. -generics_typevartuple_overloads.py:18:24 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. -generics_typevartuple_overloads.py:18:50 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. -generics_typevartuple_overloads.py:22:24 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. -generics_typevartuple_overloads.py:22:57 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. -generics_typevartuple_overloads.py:29:13 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. -generics_typevartuple_overloads.py:29:37 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. +generics_typevartuple_overloads.py:18:4 Incompatible overload [43]: The implementation of `Array.transpose` does not accept all possible arguments of overload defined on line `18`. +generics_typevartuple_overloads.py:22:4 Incompatible overload [43]: The implementation of `Array.transpose` does not accept all possible arguments of overload defined on line `22`. """ conformance_automated = "Fail" errors_diff = """ -Line 16: Unexpected errors ['generics_typevartuple_overloads.py:16:12 Invalid type [31]: Expression `typing.Generic[(*Shape)]` is not a valid type.'] -Line 18: Unexpected errors ['generics_typevartuple_overloads.py:18:24 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.', 'generics_typevartuple_overloads.py:18:50 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.'] -Line 22: Unexpected errors ['generics_typevartuple_overloads.py:22:24 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.', 'generics_typevartuple_overloads.py:22:57 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.'] -Line 29: Unexpected errors ['generics_typevartuple_overloads.py:29:13 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.', 'generics_typevartuple_overloads.py:29:37 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.'] +Line 18: Unexpected errors ['generics_typevartuple_overloads.py:18:4 Incompatible overload [43]: The implementation of `Array.transpose` does not accept all possible arguments of overload defined on line `18`.'] +Line 22: Unexpected errors ['generics_typevartuple_overloads.py:22:4 Incompatible overload [43]: The implementation of `Array.transpose` does not accept all possible arguments of overload defined on line `22`.'] """ diff --git a/conformance/results/pyre/generics_typevartuple_specialization.toml b/conformance/results/pyre/generics_typevartuple_specialization.toml index d6cf07fe0..0f155d1be 100644 --- a/conformance/results/pyre/generics_typevartuple_specialization.toml +++ b/conformance/results/pyre/generics_typevartuple_specialization.toml @@ -3,78 +3,33 @@ notes = """ Does not support star expressions for `Unpack`. """ output = """ -generics_typevartuple_specialization.py:16:12 Invalid type [31]: Expression `typing.Generic[(*Ts)]` is not a valid type. -generics_typevartuple_specialization.py:24:26 Invalid type [31]: Expression `generics_typevartuple_specialization.Array[(*tuple[(typing.Any, ...)])]` is not a valid type. -generics_typevartuple_specialization.py:24:26 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. -generics_typevartuple_specialization.py:28:13 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. -generics_typevartuple_specialization.py:33:13 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. -generics_typevartuple_specialization.py:41:11 Undefined attribute [16]: `tuple` has no attribute `__getitem__`. -generics_typevartuple_specialization.py:45:13 Undefined or invalid type [11]: Annotation `IntTuple` is not defined as a type. -generics_typevartuple_specialization.py:45:39 Undefined or invalid type [11]: Annotation `NamedArray` is not defined as a type. -generics_typevartuple_specialization.py:47:19 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. -generics_typevartuple_specialization.py:59:13 Invalid type [31]: Expression `typing.Generic[(DType, *Shape)]` is not a valid type. -generics_typevartuple_specialization.py:59:13 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Variable[DType]`. To reference the type variable, you can modify the class to inherit from `typing.Generic[DType]`. -generics_typevartuple_specialization.py:63:20 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[]` but got `typing.Tuple[Type[float], *Tuple[typing.Any, ...]]`. -generics_typevartuple_specialization.py:64:0 Invalid type parameters [24]: Non-generic type `Array2` cannot take parameters. -generics_typevartuple_specialization.py:68:4 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Array2[]` but got `Array2`. -generics_typevartuple_specialization.py:68:19 Invalid type parameters [24]: Non-generic type `Array2` cannot take parameters. -generics_typevartuple_specialization.py:69:4 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Array2[]` but got `Array2`. -generics_typevartuple_specialization.py:69:19 Invalid type parameters [24]: Non-generic type `Array2` cannot take parameters. -generics_typevartuple_specialization.py:72:38 Undefined or invalid type [11]: Annotation `FloatArray` is not defined as a type. -generics_typevartuple_specialization.py:92:13 Undefined or invalid type [11]: Annotation `VariadicTuple` is not defined as a type. -generics_typevartuple_specialization.py:95:19 Invalid type [31]: Expression `tuple[(typing.Any, *tuple[(typing.Any, ...)])]` is not a valid type. -generics_typevartuple_specialization.py:108:0 Undefined attribute [16]: `typing.Tuple` has no attribute `__getitem__`. -generics_typevartuple_specialization.py:121:12 Unable to concatenate tuple [60]: Concatenation not yet support for multiple variadic tuples: `*Ts, *Ts`. -generics_typevartuple_specialization.py:122:12 Unable to concatenate tuple [60]: Concatenation not yet support for multiple variadic tuples: `*Ts, *tuple[(int, ...)]`. -generics_typevartuple_specialization.py:127:4 Undefined or invalid type [11]: Annotation `TA7` is not defined as a type. -generics_typevartuple_specialization.py:130:13 Invalid type [31]: Expression `TA7[(*Ts, T1, T2)]` is not a valid type. -generics_typevartuple_specialization.py:130:13 Invalid type variable [34]: The type variable `Variable[T1]` isn't present in the function's parameters. -generics_typevartuple_specialization.py:130:13 Invalid type variable [34]: The type variable `Variable[T2]` isn't present in the function's parameters. -generics_typevartuple_specialization.py:130:34 Invalid type [31]: Expression `tuple[(tuple[(*Ts)], T1, T2)]` is not a valid type. -generics_typevartuple_specialization.py:130:34 Invalid type variable [34]: The type variable `Variable[T1]` isn't present in the function's parameters. -generics_typevartuple_specialization.py:130:34 Invalid type variable [34]: The type variable `Variable[T2]` isn't present in the function's parameters. -generics_typevartuple_specialization.py:143:13 Invalid type [31]: Expression `TA8[(T1, *Ts, T2, T3)]` is not a valid type. -generics_typevartuple_specialization.py:143:13 Invalid type variable [34]: The type variable `Variable[T1]` isn't present in the function's parameters. -generics_typevartuple_specialization.py:143:13 Invalid type variable [34]: The type variable `Variable[T2]` isn't present in the function's parameters. -generics_typevartuple_specialization.py:143:13 Invalid type variable [34]: The type variable `Variable[T3]` isn't present in the function's parameters. -generics_typevartuple_specialization.py:143:13 Undefined or invalid type [11]: Annotation `TA8` is not defined as a type. -generics_typevartuple_specialization.py:143:38 Invalid type [31]: Expression `tuple[(tuple[(*Ts)], T1, T2, T3)]` is not a valid type. -generics_typevartuple_specialization.py:143:38 Invalid type variable [34]: The type variable `Variable[T1]` isn't present in the function's parameters. -generics_typevartuple_specialization.py:143:38 Invalid type variable [34]: The type variable `Variable[T2]` isn't present in the function's parameters. -generics_typevartuple_specialization.py:143:38 Invalid type variable [34]: The type variable `Variable[T3]` isn't present in the function's parameters. -generics_typevartuple_specialization.py:156:14 Undefined or invalid type [11]: Annotation `TA10` is not defined as a type. -generics_typevartuple_specialization.py:156:23 Invalid type [31]: Expression `TA9[(*tuple[(int, ...)], str)]` is not a valid type. -generics_typevartuple_specialization.py:156:23 Undefined or invalid type [11]: Annotation `TA9` is not defined as a type. -generics_typevartuple_specialization.py:156:54 Invalid type [31]: Expression `TA9[(*tuple[(int, ...)], str)]` is not a valid type. -generics_typevartuple_specialization.py:157:19 Invalid type [31]: Expression `tuple[(*tuple[(int, ...)], int)]` is not a valid type. -generics_typevartuple_specialization.py:158:19 Invalid type [31]: Expression `tuple[(*tuple[(int, ...)], str)]` is not a valid type. -generics_typevartuple_specialization.py:159:19 Invalid type [31]: Expression `tuple[(*tuple[(int, ...)], str)]` is not a valid type. +generics_typevartuple_specialization.py:29:21 Incompatible parameter type [6]: In call `takes_any_array1`, for 1st positional argument, expected `Array[]` but got `Array[Height, Width]`. +generics_typevartuple_specialization.py:34:21 Incompatible parameter type [6]: In call `takes_any_array1`, for 1st positional argument, expected `Array[]` but got `Array[Time, Height, Width]`. +generics_typevartuple_specialization.py:121:0 Invalid type [31]: Expression `tuple[(T1, *Ts, T2, *Ts)]` is not a valid type. +generics_typevartuple_specialization.py:122:0 Invalid type [31]: Expression `tuple[(T1, *Ts, T2, *tuple[(int, ...)])]` is not a valid type. +generics_typevartuple_specialization.py:127:4 Invalid type variable [34]: The type variable `Variable[T1]` can only be used to annotate generic classes or functions. +generics_typevartuple_specialization.py:127:4 Invalid type variable [34]: The type variable `Variable[T2]` can only be used to annotate generic classes or functions. +generics_typevartuple_specialization.py:127:4 Invalid type variable [34]: The type variable `Ts` can only be used to annotate generic classes or functions. +generics_typevartuple_specialization.py:136:4 Assert type [70]: Expected `Tuple[Tuple[str], bool, float]` but got `Tuple[Tuple[float], str, bool]`. +generics_typevartuple_specialization.py:137:4 Assert type [70]: Expected `Tuple[Tuple[str, bool], float, int]` but got `Tuple[Tuple[float, int], str, bool]`. +generics_typevartuple_specialization.py:148:4 Assert type [70]: Expected `Tuple[Tuple[], str, bool, float]` but got `Tuple[Tuple[], float, str, bool]`. +generics_typevartuple_specialization.py:149:4 Assert type [70]: Expected `Tuple[Tuple[bool], str, float, int]` but got `Tuple[Tuple[int], float, str, bool]`. +generics_typevartuple_specialization.py:157:4 Assert type [70]: Expected `typing.Tuple[*Tuple[int, ...], int]` but got `typing.Tuple[*Tuple[typing.Any, ...], typing.Any]`. +generics_typevartuple_specialization.py:158:4 Assert type [70]: Expected `typing.Tuple[*Tuple[int, ...], str]` but got `typing.Tuple[*generics_typevartuple_specialization.Ts, Variable[T1]]`. +generics_typevartuple_specialization.py:159:4 Assert type [70]: Expected `typing.Tuple[*Tuple[int, ...], str]` but got `typing.Tuple[*generics_typevartuple_specialization.Ts, Variable[T1]]`. """ conformance_automated = "Fail" errors_diff = """ Line 109: Expected 1 errors Line 110: Expected 1 errors Line 163: Expected 1 errors -Line 16: Unexpected errors ['generics_typevartuple_specialization.py:16:12 Invalid type [31]: Expression `typing.Generic[(*Ts)]` is not a valid type.'] -Line 24: Unexpected errors ['generics_typevartuple_specialization.py:24:26 Invalid type [31]: Expression `generics_typevartuple_specialization.Array[(*tuple[(typing.Any, ...)])]` is not a valid type.', 'generics_typevartuple_specialization.py:24:26 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.'] -Line 28: Unexpected errors ['generics_typevartuple_specialization.py:28:13 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.'] -Line 33: Unexpected errors ['generics_typevartuple_specialization.py:33:13 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.'] -Line 41: Unexpected errors ['generics_typevartuple_specialization.py:41:11 Undefined attribute [16]: `tuple` has no attribute `__getitem__`.'] -Line 45: Unexpected errors ['generics_typevartuple_specialization.py:45:13 Undefined or invalid type [11]: Annotation `IntTuple` is not defined as a type.', 'generics_typevartuple_specialization.py:45:39 Undefined or invalid type [11]: Annotation `NamedArray` is not defined as a type.'] -Line 47: Unexpected errors ['generics_typevartuple_specialization.py:47:19 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.'] -Line 59: Unexpected errors ['generics_typevartuple_specialization.py:59:13 Invalid type [31]: Expression `typing.Generic[(DType, *Shape)]` is not a valid type.', "generics_typevartuple_specialization.py:59:13 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Variable[DType]`. To reference the type variable, you can modify the class to inherit from `typing.Generic[DType]`."] -Line 63: Unexpected errors ['generics_typevartuple_specialization.py:63:20 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[]` but got `typing.Tuple[Type[float], *Tuple[typing.Any, ...]]`.'] -Line 64: Unexpected errors ['generics_typevartuple_specialization.py:64:0 Invalid type parameters [24]: Non-generic type `Array2` cannot take parameters.'] -Line 68: Unexpected errors ['generics_typevartuple_specialization.py:68:4 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Array2[]` but got `Array2`.', 'generics_typevartuple_specialization.py:68:19 Invalid type parameters [24]: Non-generic type `Array2` cannot take parameters.'] -Line 69: Unexpected errors ['generics_typevartuple_specialization.py:69:4 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Array2[]` but got `Array2`.', 'generics_typevartuple_specialization.py:69:19 Invalid type parameters [24]: Non-generic type `Array2` cannot take parameters.'] -Line 72: Unexpected errors ['generics_typevartuple_specialization.py:72:38 Undefined or invalid type [11]: Annotation `FloatArray` is not defined as a type.'] -Line 92: Unexpected errors ['generics_typevartuple_specialization.py:92:13 Undefined or invalid type [11]: Annotation `VariadicTuple` is not defined as a type.'] -Line 95: Unexpected errors ['generics_typevartuple_specialization.py:95:19 Invalid type [31]: Expression `tuple[(typing.Any, *tuple[(typing.Any, ...)])]` is not a valid type.'] -Line 108: Unexpected errors ['generics_typevartuple_specialization.py:108:0 Undefined attribute [16]: `typing.Tuple` has no attribute `__getitem__`.'] -Line 130: Unexpected errors ['generics_typevartuple_specialization.py:130:13 Invalid type [31]: Expression `TA7[(*Ts, T1, T2)]` is not a valid type.', "generics_typevartuple_specialization.py:130:13 Invalid type variable [34]: The type variable `Variable[T1]` isn't present in the function's parameters.", "generics_typevartuple_specialization.py:130:13 Invalid type variable [34]: The type variable `Variable[T2]` isn't present in the function's parameters.", 'generics_typevartuple_specialization.py:130:34 Invalid type [31]: Expression `tuple[(tuple[(*Ts)], T1, T2)]` is not a valid type.', "generics_typevartuple_specialization.py:130:34 Invalid type variable [34]: The type variable `Variable[T1]` isn't present in the function's parameters.", "generics_typevartuple_specialization.py:130:34 Invalid type variable [34]: The type variable `Variable[T2]` isn't present in the function's parameters."] -Line 143: Unexpected errors ['generics_typevartuple_specialization.py:143:13 Invalid type [31]: Expression `TA8[(T1, *Ts, T2, T3)]` is not a valid type.', "generics_typevartuple_specialization.py:143:13 Invalid type variable [34]: The type variable `Variable[T1]` isn't present in the function's parameters.", "generics_typevartuple_specialization.py:143:13 Invalid type variable [34]: The type variable `Variable[T2]` isn't present in the function's parameters.", "generics_typevartuple_specialization.py:143:13 Invalid type variable [34]: The type variable `Variable[T3]` isn't present in the function's parameters.", 'generics_typevartuple_specialization.py:143:13 Undefined or invalid type [11]: Annotation `TA8` is not defined as a type.', 'generics_typevartuple_specialization.py:143:38 Invalid type [31]: Expression `tuple[(tuple[(*Ts)], T1, T2, T3)]` is not a valid type.', "generics_typevartuple_specialization.py:143:38 Invalid type variable [34]: The type variable `Variable[T1]` isn't present in the function's parameters.", "generics_typevartuple_specialization.py:143:38 Invalid type variable [34]: The type variable `Variable[T2]` isn't present in the function's parameters.", "generics_typevartuple_specialization.py:143:38 Invalid type variable [34]: The type variable `Variable[T3]` isn't present in the function's parameters."] -Line 156: Unexpected errors ['generics_typevartuple_specialization.py:156:14 Undefined or invalid type [11]: Annotation `TA10` is not defined as a type.', 'generics_typevartuple_specialization.py:156:23 Invalid type [31]: Expression `TA9[(*tuple[(int, ...)], str)]` is not a valid type.', 'generics_typevartuple_specialization.py:156:23 Undefined or invalid type [11]: Annotation `TA9` is not defined as a type.', 'generics_typevartuple_specialization.py:156:54 Invalid type [31]: Expression `TA9[(*tuple[(int, ...)], str)]` is not a valid type.'] -Line 157: Unexpected errors ['generics_typevartuple_specialization.py:157:19 Invalid type [31]: Expression `tuple[(*tuple[(int, ...)], int)]` is not a valid type.'] -Line 158: Unexpected errors ['generics_typevartuple_specialization.py:158:19 Invalid type [31]: Expression `tuple[(*tuple[(int, ...)], str)]` is not a valid type.'] -Line 159: Unexpected errors ['generics_typevartuple_specialization.py:159:19 Invalid type [31]: Expression `tuple[(*tuple[(int, ...)], str)]` is not a valid type.'] +Line 29: Unexpected errors ['generics_typevartuple_specialization.py:29:21 Incompatible parameter type [6]: In call `takes_any_array1`, for 1st positional argument, expected `Array[]` but got `Array[Height, Width]`.'] +Line 34: Unexpected errors ['generics_typevartuple_specialization.py:34:21 Incompatible parameter type [6]: In call `takes_any_array1`, for 1st positional argument, expected `Array[]` but got `Array[Time, Height, Width]`.'] +Line 136: Unexpected errors ['generics_typevartuple_specialization.py:136:4 Assert type [70]: Expected `Tuple[Tuple[str], bool, float]` but got `Tuple[Tuple[float], str, bool]`.'] +Line 137: Unexpected errors ['generics_typevartuple_specialization.py:137:4 Assert type [70]: Expected `Tuple[Tuple[str, bool], float, int]` but got `Tuple[Tuple[float, int], str, bool]`.'] +Line 148: Unexpected errors ['generics_typevartuple_specialization.py:148:4 Assert type [70]: Expected `Tuple[Tuple[], str, bool, float]` but got `Tuple[Tuple[], float, str, bool]`.'] +Line 149: Unexpected errors ['generics_typevartuple_specialization.py:149:4 Assert type [70]: Expected `Tuple[Tuple[bool], str, float, int]` but got `Tuple[Tuple[int], float, str, bool]`.'] +Line 157: Unexpected errors ['generics_typevartuple_specialization.py:157:4 Assert type [70]: Expected `typing.Tuple[*Tuple[int, ...], int]` but got `typing.Tuple[*Tuple[typing.Any, ...], typing.Any]`.'] +Line 158: Unexpected errors ['generics_typevartuple_specialization.py:158:4 Assert type [70]: Expected `typing.Tuple[*Tuple[int, ...], str]` but got `typing.Tuple[*generics_typevartuple_specialization.Ts, Variable[T1]]`.'] +Line 159: Unexpected errors ['generics_typevartuple_specialization.py:159:4 Assert type [70]: Expected `typing.Tuple[*Tuple[int, ...], str]` but got `typing.Tuple[*generics_typevartuple_specialization.Ts, Variable[T1]]`.'] """ diff --git a/conformance/results/pyre/generics_typevartuple_unpack.toml b/conformance/results/pyre/generics_typevartuple_unpack.toml index 7e2f93c95..e71e46e5b 100644 --- a/conformance/results/pyre/generics_typevartuple_unpack.toml +++ b/conformance/results/pyre/generics_typevartuple_unpack.toml @@ -1,27 +1,9 @@ -conformant = "Unsupported" +conformant = "Pass" notes = """ -Does not support star expressions for `Unpack`. """ output = """ -generics_typevartuple_unpack.py:17:12 Invalid type [31]: Expression `typing.Generic[(*Ts)]` is not a valid type. -generics_typevartuple_unpack.py:21:30 Invalid type [31]: Expression `generics_typevartuple_unpack.Array[(generics_typevartuple_unpack.Batch, *tuple[(typing.Any, ...)], generics_typevartuple_unpack.Channels)]` is not a valid type. -generics_typevartuple_unpack.py:21:30 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. -generics_typevartuple_unpack.py:26:7 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. -generics_typevartuple_unpack.py:26:49 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. -generics_typevartuple_unpack.py:26:76 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. -generics_typevartuple_unpack.py:36:29 Invalid type [31]: Expression `generics_typevartuple_unpack.Array[(generics_typevartuple_unpack.Batch, *Shape)]` is not a valid type. -generics_typevartuple_unpack.py:36:29 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. -generics_typevartuple_unpack.py:40:28 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. -generics_typevartuple_unpack.py:44:13 Invalid type [31]: Expression `generics_typevartuple_unpack.Array[(*tuple[(typing.Any, ...)])]` is not a valid type. -generics_typevartuple_unpack.py:44:13 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. +generics_typevartuple_unpack.py:30:27 Incompatible parameter type [6]: In call `process_batch_channels`, for 1st positional argument, expected `Array[Batch, *Tuple[typing.Any, ...], Channels]` but got `Array[Batch]`. """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 30: Expected 1 errors -Line 17: Unexpected errors ['generics_typevartuple_unpack.py:17:12 Invalid type [31]: Expression `typing.Generic[(*Ts)]` is not a valid type.'] -Line 21: Unexpected errors ['generics_typevartuple_unpack.py:21:30 Invalid type [31]: Expression `generics_typevartuple_unpack.Array[(generics_typevartuple_unpack.Batch, *tuple[(typing.Any, ...)], generics_typevartuple_unpack.Channels)]` is not a valid type.', 'generics_typevartuple_unpack.py:21:30 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.'] -Line 26: Unexpected errors ['generics_typevartuple_unpack.py:26:7 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.', 'generics_typevartuple_unpack.py:26:49 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.', 'generics_typevartuple_unpack.py:26:76 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.'] -Line 36: Unexpected errors ['generics_typevartuple_unpack.py:36:29 Invalid type [31]: Expression `generics_typevartuple_unpack.Array[(generics_typevartuple_unpack.Batch, *Shape)]` is not a valid type.', 'generics_typevartuple_unpack.py:36:29 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.'] -Line 40: Unexpected errors ['generics_typevartuple_unpack.py:40:28 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.'] -Line 44: Unexpected errors ['generics_typevartuple_unpack.py:44:13 Invalid type [31]: Expression `generics_typevartuple_unpack.Array[(*tuple[(typing.Any, ...)])]` is not a valid type.', 'generics_typevartuple_unpack.py:44:13 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.'] """ diff --git a/conformance/results/pyre/generics_upper_bound.toml b/conformance/results/pyre/generics_upper_bound.toml index b54303c54..6c88c4065 100644 --- a/conformance/results/pyre/generics_upper_bound.toml +++ b/conformance/results/pyre/generics_upper_bound.toml @@ -4,11 +4,11 @@ False positives on valid type expression (`list[T]`) in `bound`. Does not complain when bound is used alongside type constraints. """ output = """ -generics_upper_bound.py:24:37 Undefined attribute [16]: `list` has no attribute `__getitem__`. generics_upper_bound.py:51:7 Incompatible parameter type [6]: In call `longer`, for 1st positional argument, expected `Variable[ST (bound to Sized)]` but got `int`. generics_upper_bound.py:51:10 Incompatible parameter type [6]: In call `longer`, for 2nd positional argument, expected `Variable[ST (bound to Sized)]` but got `int`. """ conformance_automated = "Fail" errors_diff = """ +Line 24: Expected 1 errors Line 56: Expected 1 errors """ diff --git a/conformance/results/pyre/generics_variance.toml b/conformance/results/pyre/generics_variance.toml index 3054f35e6..ee65464e9 100644 --- a/conformance/results/pyre/generics_variance.toml +++ b/conformance/results/pyre/generics_variance.toml @@ -4,8 +4,8 @@ Does not reject a TypeVar that is defined as both covariant and contravariant. Does not reject use of class-scoped TypeVar used in a base class when variance is incompatible. """ output = """ -generics_variance.py:77:0 Invalid type variance [46]: The type variable `Variable[T_co](covariant)` is incompatible with parent class type variable `Variable[T]` because subclasses cannot use more permissive type variables than their superclasses. -generics_variance.py:81:0 Invalid type variance [46]: The type variable `Variable[T_contra](contravariant)` is incompatible with parent class type variable `Variable[T]` because subclasses cannot use more permissive type variables than their superclasses. +generics_variance.py:77:0 Invalid type variance [46]: The type variable `Variable[T_co](covariant)` is incompatible with parent class type variable `Variable[T](invariant)` because subclasses cannot use more permissive type variables than their superclasses. +generics_variance.py:81:0 Invalid type variance [46]: The type variable `Variable[T_contra](contravariant)` is incompatible with parent class type variable `Variable[T](invariant)` because subclasses cannot use more permissive type variables than their superclasses. generics_variance.py:93:0 Invalid type variance [46]: The type variable `Variable[T_contra](contravariant)` is incompatible with parent class type variable `Variable[T_co](covariant)` because subclasses cannot use more permissive type variables than their superclasses. generics_variance.py:105:0 Invalid type variance [46]: The type variable `Variable[T_co](covariant)` is incompatible with parent class type variable `Variable[T_contra](contravariant)` because subclasses cannot use more permissive type variables than their superclasses. generics_variance.py:125:0 Invalid type variance [46]: The type variable `Variable[T_co](covariant)` is incompatible with parent class type variable `Variable[T_contra](contravariant)` because subclasses cannot use more permissive type variables than their superclasses. diff --git a/conformance/results/pyre/generics_variance_inference.toml b/conformance/results/pyre/generics_variance_inference.toml index a0efdd76e..39a5cb8c4 100644 --- a/conformance/results/pyre/generics_variance_inference.toml +++ b/conformance/results/pyre/generics_variance_inference.toml @@ -1,17 +1,36 @@ -conformant = "Unsupported" +conformant = "Partial" notes = """ -Type parameter syntax not yet support. +Does not properly handle mixing legacy and PEP695 syntax. +False negative about a type variable not being present in the function's parameters. """ output = """ -generics_variance_inference.py:15:13 Parsing failure [404]: invalid syntax +generics_variance_inference.py:24:4 Incompatible variable type [9]: v1 is declared to have type `ClassA[int, int, int]` but is used as type `ClassA[float, int, int]`. +generics_variance_inference.py:25:4 Incompatible variable type [9]: v2 is declared to have type `ClassA[float, float, int]` but is used as type `ClassA[float, int, int]`. +generics_variance_inference.py:28:4 Incompatible variable type [9]: v4 is declared to have type `ClassA[int, int, int]` but is used as type `ClassA[int, float, float]`. +generics_variance_inference.py:33:41 Invalid type variable [34]: The type variable `Variable[T]` isn't present in the function's parameters. +generics_variance_inference.py:36:26 Invalid type variable [34]: The type variable `Variable[T]` isn't present in the function's parameters. +generics_variance_inference.py:48:0 Incompatible variable type [9]: vco2_1 is declared to have type `ShouldBeCovariant2[float]` but is used as type `ShouldBeCovariant2[int]`. +generics_variance_inference.py:49:0 Incompatible variable type [9]: vco2_2 is declared to have type `ShouldBeCovariant2[int]` but is used as type `ShouldBeCovariant2[float]`. +generics_variance_inference.py:53:25 Invalid type variable [34]: The type variable `Variable[T]` isn't present in the function's parameters. +generics_variance_inference.py:63:7 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Variable[T]`. To reference the type variable, you can modify the class to inherit from `typing.Generic[T]`. +generics_variance_inference.py:75:19 Invalid type variable [34]: The type variable `Variable[T]` isn't present in the function's parameters. +generics_variance_inference.py:88:23 Invalid type variable [34]: The type variable `Variable[T]` isn't present in the function's parameters. +generics_variance_inference.py:104:27 Invalid type variable [34]: The type variable `Variable[T]` isn't present in the function's parameters. +generics_variance_inference.py:119:0 Incompatible variable type [9]: vinv3_1 is declared to have type `ShouldBeInvariant3[float, str]` but is used as type `ShouldBeInvariant3[int, str]`. +generics_variance_inference.py:120:0 Incompatible variable type [9]: vinv3_2 is declared to have type `ShouldBeInvariant3[int, str]` but is used as type `ShouldBeInvariant3[float, str]`. +generics_variance_inference.py:121:0 Incompatible variable type [9]: vinv3_3 is declared to have type `ShouldBeInvariant3[str, float]` but is used as type `ShouldBeInvariant3[str, int]`. +generics_variance_inference.py:122:0 Incompatible variable type [9]: vinv3_4 is declared to have type `ShouldBeInvariant3[str, int]` but is used as type `ShouldBeInvariant3[str, float]`. +generics_variance_inference.py:127:7 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Variable[T]`. To reference the type variable, you can modify the class to inherit from `typing.Generic[T]`. +generics_variance_inference.py:169:0 Incompatible variable type [9]: a1 is declared to have type `ShouldBeInvariant6[int]` but is used as type `ShouldBeInvariant6[float]`. +generics_variance_inference.py:170:0 Incompatible variable type [9]: a2 is declared to have type `ShouldBeInvariant6[float]` but is used as type `ShouldBeInvariant6[int]`. +generics_variance_inference.py:181:0 Incompatible variable type [9]: b1 is declared to have type `ShouldBeCovariant6[int]` but is used as type `ShouldBeCovariant6[float]`. +generics_variance_inference.py:182:0 Incompatible variable type [9]: b2 is declared to have type `ShouldBeCovariant6[float]` but is used as type `ShouldBeCovariant6[int]`. +generics_variance_inference.py:193:0 Incompatible variable type [9]: c1 is declared to have type `ShouldBeContravariant2[int]` but is used as type `ShouldBeContravariant2[float]`. +generics_variance_inference.py:194:0 Incompatible variable type [9]: c2 is declared to have type `ShouldBeContravariant2[float]` but is used as type `ShouldBeContravariant2[int]`. """ conformance_automated = "Fail" errors_diff = """ -Line 24: Expected 1 errors -Line 25: Expected 1 errors -Line 28: Expected 1 errors Line 41: Expected 1 errors -Line 49: Expected 1 errors Line 58: Expected 1 errors Line 67: Expected 1 errors Line 80: Expected 1 errors @@ -19,16 +38,18 @@ Line 96: Expected 1 errors Line 97: Expected 1 errors Line 111: Expected 1 errors Line 112: Expected 1 errors -Line 119: Expected 1 errors -Line 120: Expected 1 errors -Line 121: Expected 1 errors -Line 122: Expected 1 errors Line 130: Expected 1 errors Line 138: Expected 1 errors Line 149: Expected 1 errors -Line 169: Expected 1 errors -Line 170: Expected 1 errors -Line 181: Expected 1 errors -Line 194: Expected 1 errors -Line 15: Unexpected errors ['generics_variance_inference.py:15:13 Parsing failure [404]: invalid syntax'] +Line 33: Unexpected errors ["generics_variance_inference.py:33:41 Invalid type variable [34]: The type variable `Variable[T]` isn't present in the function's parameters."] +Line 36: Unexpected errors ["generics_variance_inference.py:36:26 Invalid type variable [34]: The type variable `Variable[T]` isn't present in the function's parameters."] +Line 48: Unexpected errors ['generics_variance_inference.py:48:0 Incompatible variable type [9]: vco2_1 is declared to have type `ShouldBeCovariant2[float]` but is used as type `ShouldBeCovariant2[int]`.'] +Line 53: Unexpected errors ["generics_variance_inference.py:53:25 Invalid type variable [34]: The type variable `Variable[T]` isn't present in the function's parameters."] +Line 63: Unexpected errors ["generics_variance_inference.py:63:7 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Variable[T]`. To reference the type variable, you can modify the class to inherit from `typing.Generic[T]`."] +Line 75: Unexpected errors ["generics_variance_inference.py:75:19 Invalid type variable [34]: The type variable `Variable[T]` isn't present in the function's parameters."] +Line 88: Unexpected errors ["generics_variance_inference.py:88:23 Invalid type variable [34]: The type variable `Variable[T]` isn't present in the function's parameters."] +Line 104: Unexpected errors ["generics_variance_inference.py:104:27 Invalid type variable [34]: The type variable `Variable[T]` isn't present in the function's parameters."] +Line 127: Unexpected errors ["generics_variance_inference.py:127:7 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Variable[T]`. To reference the type variable, you can modify the class to inherit from `typing.Generic[T]`."] +Line 182: Unexpected errors ['generics_variance_inference.py:182:0 Incompatible variable type [9]: b2 is declared to have type `ShouldBeCovariant6[float]` but is used as type `ShouldBeCovariant6[int]`.'] +Line 193: Unexpected errors ['generics_variance_inference.py:193:0 Incompatible variable type [9]: c1 is declared to have type `ShouldBeContravariant2[int]` but is used as type `ShouldBeContravariant2[float]`.'] """ diff --git a/conformance/results/pyre/historical_positional.toml b/conformance/results/pyre/historical_positional.toml index 9e1a52b20..96a409602 100644 --- a/conformance/results/pyre/historical_positional.toml +++ b/conformance/results/pyre/historical_positional.toml @@ -1,19 +1,12 @@ -conformant = "Partial" +conformant = "Pass" notes = """ -Does not reject positional-only parameter after non-positional-only parameter. -Incorrectly applies legacy positional-only rules when explicit *args are used. -Incorrectly applies legacy positional-only rules when PEP 570 syntax is used. """ output = """ historical_positional.py:18:0 Unexpected keyword [28]: Unexpected keyword argument `__x` to call `f1`. -historical_positional.py:32:0 Unexpected keyword [28]: Unexpected keyword argument `__y` to call `f3`. +historical_positional.py:26:15 Invalid positional-only parameter [69]: Positional-only parameters cannot appear after parameters that accept keyword arguments. +historical_positional.py:38:25 Invalid positional-only parameter [69]: Positional-only parameters cannot appear after parameters that accept keyword arguments. historical_positional.py:43:0 Unexpected keyword [28]: Unexpected keyword argument `__x` to call `A.m1`. -historical_positional.py:53:0 Unexpected keyword [28]: Unexpected keyword argument `__y` to call `f4`. """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 26: Expected 1 errors -Line 38: Expected 1 errors -Line 32: Unexpected errors ['historical_positional.py:32:0 Unexpected keyword [28]: Unexpected keyword argument `__y` to call `f3`.'] -Line 53: Unexpected errors ['historical_positional.py:53:0 Unexpected keyword [28]: Unexpected keyword argument `__y` to call `f4`.'] """ diff --git a/conformance/results/pyre/literals_interactions.toml b/conformance/results/pyre/literals_interactions.toml index fd34d1f4e..a7af3cc40 100644 --- a/conformance/results/pyre/literals_interactions.toml +++ b/conformance/results/pyre/literals_interactions.toml @@ -6,17 +6,13 @@ Does not narrow type of `x` with `x in Literal` type guard pattern. Does not narrow type of `x` with `x == Literal` type guard pattern. """ output = """ -literals_interactions.py:93:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `Union[Status, str]`. -literals_interactions.py:106:34 Incompatible parameter type [6]: In call `expects_bad_status`, for 1st positional argument, expected `Union[typing_extensions.Literal['ABORTED'], typing_extensions.Literal['MALFORMED']]` but got `str`. -literals_interactions.py:109:31 Non-literal string [62]: In call `expects_pending_status`, for 1st positional argument, expected `LiteralString` but got `str`. Ensure only a string literal or a `LiteralString` is used. +literals_interactions.py:15:4 Invalid tuple index [73]: Index 5 is out of bounds for concrete tuple with 3 members. +literals_interactions.py:16:4 Invalid tuple index [73]: Index -5 is out of bounds for concrete tuple with 3 members. +literals_interactions.py:17:4 Invalid tuple index [73]: Index 4 is out of bounds for concrete tuple with 3 members. +literals_interactions.py:18:4 Invalid tuple index [73]: Index -4 is out of bounds for concrete tuple with 3 members. +literals_interactions.py:93:8 Assert type [70]: Expected `str` but got `Union[Status, str]`. """ conformance_automated = "Fail" errors_diff = """ -Line 15: Expected 1 errors -Line 16: Expected 1 errors -Line 17: Expected 1 errors -Line 18: Expected 1 errors -Line 93: Unexpected errors ['literals_interactions.py:93:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `Union[Status, str]`.'] -Line 106: Unexpected errors ["literals_interactions.py:106:34 Incompatible parameter type [6]: In call `expects_bad_status`, for 1st positional argument, expected `Union[typing_extensions.Literal['ABORTED'], typing_extensions.Literal['MALFORMED']]` but got `str`."] -Line 109: Unexpected errors ['literals_interactions.py:109:31 Non-literal string [62]: In call `expects_pending_status`, for 1st positional argument, expected `LiteralString` but got `str`. Ensure only a string literal or a `LiteralString` is used.'] +Line 93: Unexpected errors ['literals_interactions.py:93:8 Assert type [70]: Expected `str` but got `Union[Status, str]`.'] """ diff --git a/conformance/results/pyre/literals_literalstring.toml b/conformance/results/pyre/literals_literalstring.toml index d92481187..2367ab62f 100644 --- a/conformance/results/pyre/literals_literalstring.toml +++ b/conformance/results/pyre/literals_literalstring.toml @@ -7,7 +7,7 @@ literals_literalstring.py:36:11 Invalid type [31]: Expression `LiteralString` is literals_literalstring.py:36:11 Undefined or invalid type [11]: Annotation `typing` is not defined as a type. literals_literalstring.py:37:13 Invalid type [31]: Expression `LiteralString` is not a literal value. literals_literalstring.py:43:4 Incompatible variable type [9]: x2 is declared to have type `typing_extensions.Literal['']` but is used as type `typing_extensions.Literal['two']`. -literals_literalstring.py:52:4 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.LiteralString` but got `str`. +literals_literalstring.py:52:4 Assert type [70]: Expected `typing_extensions.LiteralString` but got `str`. literals_literalstring.py:66:4 Incompatible variable type [9]: x1 is declared to have type `typing_extensions.LiteralString` but is used as type `str`. literals_literalstring.py:74:4 Incompatible variable type [9]: x3 is declared to have type `typing_extensions.LiteralString` but is used as type `typing_extensions.Literal[3]`. literals_literalstring.py:75:4 Incompatible variable type [9]: x4 is declared to have type `typing_extensions.LiteralString` but is used as type `typing_extensions.Literal[b'test']`. @@ -17,5 +17,5 @@ literals_literalstring.py:171:4 Incompatible variable type [9]: x1 is declared t """ conformance_automated = "Fail" errors_diff = """ -Line 52: Unexpected errors ['literals_literalstring.py:52:4 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.LiteralString` but got `str`.'] +Line 52: Unexpected errors ['literals_literalstring.py:52:4 Assert type [70]: Expected `typing_extensions.LiteralString` but got `str`.'] """ diff --git a/conformance/results/pyre/literals_parameterizations.toml b/conformance/results/pyre/literals_parameterizations.toml index 6dc0a5222..2dbdfbc53 100644 --- a/conformance/results/pyre/literals_parameterizations.toml +++ b/conformance/results/pyre/literals_parameterizations.toml @@ -11,7 +11,6 @@ literals_parameterizations.py:33:0 Invalid type [31]: Expression `ReadOnlyMode` literals_parameterizations.py:33:0 Invalid type [31]: Expression `WriteAndTruncateMode` is not a literal value. literals_parameterizations.py:33:0 Invalid type [31]: Expression `WriteNoTruncateMode` is not a literal value. literals_parameterizations.py:33:0 Undefined or invalid type [11]: Annotation `` is not defined as a type. -literals_parameterizations.py:35:8 Invalid type [31]: Expression `typing.Literal[(typing.Literal[(typing.Literal[(1, 2, 3)], "foo")], 5, None)]` is not a valid type. literals_parameterizations.py:41:6 Invalid type [31]: Expression `typing.Literal[3 + 4]` is not a valid type. literals_parameterizations.py:42:6 Invalid type [31]: Expression `typing.Literal["foo".replace("o", "b")]` is not a valid type. literals_parameterizations.py:43:6 Invalid type [31]: Expression `typing.Literal[4 + 3.000000j]` is not a valid type. @@ -33,5 +32,4 @@ errors_diff = """ Line 46: Expected 1 errors Line 60: Expected 1 errors Line 33: Unexpected errors ['literals_parameterizations.py:33:0 Invalid type [31]: Expression `AppendMode` is not a literal value.', 'literals_parameterizations.py:33:0 Invalid type [31]: Expression `ReadOnlyMode` is not a literal value.', 'literals_parameterizations.py:33:0 Invalid type [31]: Expression `WriteAndTruncateMode` is not a literal value.', 'literals_parameterizations.py:33:0 Invalid type [31]: Expression `WriteNoTruncateMode` is not a literal value.', 'literals_parameterizations.py:33:0 Undefined or invalid type [11]: Annotation `` is not defined as a type.'] -Line 35: Unexpected errors ['literals_parameterizations.py:35:8 Invalid type [31]: Expression `typing.Literal[(typing.Literal[(typing.Literal[(1, 2, 3)], "foo")], 5, None)]` is not a valid type.'] """ diff --git a/conformance/results/pyre/namedtuples_define_class.toml b/conformance/results/pyre/namedtuples_define_class.toml index 49225bc7d..3ce86df71 100644 --- a/conformance/results/pyre/namedtuples_define_class.toml +++ b/conformance/results/pyre/namedtuples_define_class.toml @@ -8,39 +8,19 @@ Incorrectly rejects assignment of named tuple to a tuple with compatible type. Does not reject attempt to use NamedTuple with multiple inheritance. """ output = """ -namedtuples_define_class.py:23:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `typing.Any`. -namedtuples_define_class.py:24:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `typing.Any`. -namedtuples_define_class.py:25:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `typing.Any`. -namedtuples_define_class.py:26:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `typing.Any`. -namedtuples_define_class.py:27:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `typing.Any`. -namedtuples_define_class.py:28:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `typing.Any`. -namedtuples_define_class.py:29:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Tuple[int, int]` but got `typing.Tuple[typing.Any, ...]`. -namedtuples_define_class.py:30:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Tuple[int, int, str]` but got `typing.Tuple[typing.Any, ...]`. +namedtuples_define_class.py:32:6 Invalid tuple index [73]: Index 3 is out of bounds for concrete tuple with 3 members. +namedtuples_define_class.py:33:6 Invalid tuple index [73]: Index -4 is out of bounds for concrete tuple with 3 members. namedtuples_define_class.py:44:5 Missing argument [20]: Call `Point.__init__` expects argument `y`. namedtuples_define_class.py:45:5 Missing argument [20]: Call `Point.__init__` expects argument `y`. namedtuples_define_class.py:46:14 Incompatible parameter type [6]: In call `Point.__init__`, for 2nd positional argument, expected `int` but got `str`. namedtuples_define_class.py:47:17 Incompatible parameter type [6]: In call `Point.__init__`, for argument `units`, expected `str` but got `int`. namedtuples_define_class.py:48:5 Too many arguments [19]: Call `Point.__init__` expects 3 positional arguments, 4 were provided. namedtuples_define_class.py:49:6 Unexpected keyword [28]: Unexpected keyword argument `other` to call `Point.__init__`. -namedtuples_define_class.py:73:0 Incompatible variable type [9]: Unable to unpack `PointWithName`, expected a tuple. +namedtuples_define_class.py:59:4 Missing named tuple default [74]: Named tuple field without default value may not be preceded by a field with default value. namedtuples_define_class.py:79:4 Invalid assignment [41]: Cannot reassign final attribute `x`. -namedtuples_define_class.py:95:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `float` but got `typing.Any`. namedtuples_define_class.py:98:18 Incompatible parameter type [6]: In call `Property.__init__`, for 2nd positional argument, expected `str` but got `float`. +namedtuples_define_class.py:105:23 Invalid inheritance [39]: If NamedTuple is included as a base class, the class may not extend anything else besides Generic. """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 32: Expected 1 errors -Line 33: Expected 1 errors -Line 59: Expected 1 errors -Line 105: Expected 1 errors -Line 23: Unexpected errors ['namedtuples_define_class.py:23:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `typing.Any`.'] -Line 24: Unexpected errors ['namedtuples_define_class.py:24:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `typing.Any`.'] -Line 25: Unexpected errors ['namedtuples_define_class.py:25:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `typing.Any`.'] -Line 26: Unexpected errors ['namedtuples_define_class.py:26:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `typing.Any`.'] -Line 27: Unexpected errors ['namedtuples_define_class.py:27:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `typing.Any`.'] -Line 28: Unexpected errors ['namedtuples_define_class.py:28:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `typing.Any`.'] -Line 29: Unexpected errors ['namedtuples_define_class.py:29:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Tuple[int, int]` but got `typing.Tuple[typing.Any, ...]`.'] -Line 30: Unexpected errors ['namedtuples_define_class.py:30:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Tuple[int, int, str]` but got `typing.Tuple[typing.Any, ...]`.'] -Line 73: Unexpected errors ['namedtuples_define_class.py:73:0 Incompatible variable type [9]: Unable to unpack `PointWithName`, expected a tuple.'] -Line 95: Unexpected errors ['namedtuples_define_class.py:95:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `float` but got `typing.Any`.'] """ diff --git a/conformance/results/pyre/namedtuples_define_functional.toml b/conformance/results/pyre/namedtuples_define_functional.toml index ac10f8e5f..dc1324433 100644 --- a/conformance/results/pyre/namedtuples_define_functional.toml +++ b/conformance/results/pyre/namedtuples_define_functional.toml @@ -1,8 +1,5 @@ -conformant = "Partial" +conformant = "Pass" notes = """ -Does not handle illegal named tuple names the same as runtime. -Does not handle defined fields correctly when extra flags like `rename` or `default` are used. -Does not support defaults in functional form. """ output = """ namedtuples_define_functional.py:16:7 Missing argument [20]: Call `Point1.__init__` expects argument `y`. @@ -14,24 +11,9 @@ namedtuples_define_functional.py:37:7 Too many arguments [19]: Call `Point5.__in namedtuples_define_functional.py:42:17 Incompatible parameter type [6]: In call `Point6.__init__`, for 2nd positional argument, expected `int` but got `str`. namedtuples_define_functional.py:43:14 Incompatible parameter type [6]: In call `Point6.__init__`, for argument `x`, expected `int` but got `float`. namedtuples_define_functional.py:52:0 Duplicate parameter [65]: Duplicate parameter name `a`. -namedtuples_define_functional.py:54:47 Invalid type [31]: Expression `False` is not a valid type. -namedtuples_define_functional.py:54:47 Invalid type [31]: Expression `False` is not a valid type. -namedtuples_define_functional.py:54:47 Invalid type [31]: Expression `typing.Final[False]` is not a valid type. -namedtuples_define_functional.py:56:47 Invalid type [31]: Expression `True` is not a valid type. -namedtuples_define_functional.py:56:47 Invalid type [31]: Expression `True` is not a valid type. -namedtuples_define_functional.py:56:47 Invalid type [31]: Expression `typing.Final[True]` is not a valid type. -namedtuples_define_functional.py:57:0 Unexpected keyword [28]: Unexpected keyword argument `abc` to call `NT4.__init__`. -namedtuples_define_functional.py:63:42 Invalid type [31]: Expression `typing.Final[(1, 2)]` is not a valid type. -namedtuples_define_functional.py:63:42 Invalid type [31]: Expression `(1, 2)` is not a valid type. -namedtuples_define_functional.py:63:42 Invalid type [31]: Expression `(1, 2)` is not a valid type. -namedtuples_define_functional.py:63:42 Invalid type parameters [24]: Generic type `typing.Final` expects 1 type parameter, received 2. -namedtuples_define_functional.py:65:0 Too many arguments [19]: Call `NT5.__init__` expects 1 positional argument, 3 were provided. -namedtuples_define_functional.py:66:0 Missing argument [20]: Call `NT5.__init__` expects argument `defaults`. +namedtuples_define_functional.py:52:0 Duplicate parameter [65]: Duplicate parameter name `a`. +namedtuples_define_functional.py:66:0 Missing argument [20]: Call `NT5.__init__` expects argument `a`. """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 56: Unexpected errors ['namedtuples_define_functional.py:56:47 Invalid type [31]: Expression `True` is not a valid type.', 'namedtuples_define_functional.py:56:47 Invalid type [31]: Expression `True` is not a valid type.', 'namedtuples_define_functional.py:56:47 Invalid type [31]: Expression `typing.Final[True]` is not a valid type.'] -Line 57: Unexpected errors ['namedtuples_define_functional.py:57:0 Unexpected keyword [28]: Unexpected keyword argument `abc` to call `NT4.__init__`.'] -Line 63: Unexpected errors ['namedtuples_define_functional.py:63:42 Invalid type [31]: Expression `typing.Final[(1, 2)]` is not a valid type.', 'namedtuples_define_functional.py:63:42 Invalid type [31]: Expression `(1, 2)` is not a valid type.', 'namedtuples_define_functional.py:63:42 Invalid type [31]: Expression `(1, 2)` is not a valid type.', 'namedtuples_define_functional.py:63:42 Invalid type parameters [24]: Generic type `typing.Final` expects 1 type parameter, received 2.'] -Line 65: Unexpected errors ['namedtuples_define_functional.py:65:0 Too many arguments [19]: Call `NT5.__init__` expects 1 positional argument, 3 were provided.'] """ diff --git a/conformance/results/pyre/namedtuples_type_compat.toml b/conformance/results/pyre/namedtuples_type_compat.toml index 76f3303cb..d9c3d790c 100644 --- a/conformance/results/pyre/namedtuples_type_compat.toml +++ b/conformance/results/pyre/namedtuples_type_compat.toml @@ -1,17 +1,10 @@ -conformant = "Unsupported" +conformant = "Pass" notes = """ -Rejects valid type compatibility between named tuple and tuple. """ output = """ -namedtuples_type_compat.py:20:0 Incompatible variable type [9]: Unable to unpack `Point`, expected a tuple. -namedtuples_type_compat.py:21:0 Incompatible variable type [9]: Unable to unpack `Point`, expected a tuple. namedtuples_type_compat.py:22:0 Incompatible variable type [9]: Unable to unpack `Point`, expected a tuple. namedtuples_type_compat.py:23:0 Incompatible variable type [9]: Unable to unpack `Point`, expected a tuple. -namedtuples_type_compat.py:27:0 Incompatible variable type [9]: Unable to unpack `Point`, expected a tuple. """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 20: Unexpected errors ['namedtuples_type_compat.py:20:0 Incompatible variable type [9]: Unable to unpack `Point`, expected a tuple.'] -Line 21: Unexpected errors ['namedtuples_type_compat.py:21:0 Incompatible variable type [9]: Unable to unpack `Point`, expected a tuple.'] -Line 27: Unexpected errors ['namedtuples_type_compat.py:27:0 Incompatible variable type [9]: Unable to unpack `Point`, expected a tuple.'] """ diff --git a/conformance/results/pyre/namedtuples_usage.toml b/conformance/results/pyre/namedtuples_usage.toml index a9956c367..785cef05a 100644 --- a/conformance/results/pyre/namedtuples_usage.toml +++ b/conformance/results/pyre/namedtuples_usage.toml @@ -1,35 +1,16 @@ conformant = "Partial" notes = """ -Does not report out-of-range index access with named tuple instance. -Does not reject attempt to delete named tuple field by name. -Does not reject attempt to delete named tuple field by index. -Incorrectly handles subclasses of named tuples that add more attributes. -Does not handle unpacking of named tuples. """ output = """ -namedtuples_usage.py:27:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `typing.Any`. -namedtuples_usage.py:28:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `typing.Any`. -namedtuples_usage.py:29:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `typing.Any`. -namedtuples_usage.py:30:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `typing.Any`. -namedtuples_usage.py:31:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `typing.Any`. -namedtuples_usage.py:32:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `typing.Any`. +namedtuples_usage.py:34:6 Invalid tuple index [73]: Index 3 is out of bounds for concrete tuple with 3 members. +namedtuples_usage.py:35:6 Invalid tuple index [73]: Index -4 is out of bounds for concrete tuple with 3 members. namedtuples_usage.py:40:0 Invalid assignment [41]: Cannot reassign final attribute `p.x`. namedtuples_usage.py:41:0 Undefined attribute [16]: `Point` has no attribute `__setitem__`. +namedtuples_usage.py:42:0 Unable to delete tuple member [72]: Tuples are immutable, so their members may not be deleted. +namedtuples_usage.py:43:0 Unable to delete tuple member [72]: Tuples are immutable, so their members may not be deleted. namedtuples_usage.py:52:0 Unable to unpack [23]: Unable to unpack 3 values, 2 were expected. namedtuples_usage.py:53:0 Unable to unpack [23]: Unable to unpack 3 values, 4 were expected. -namedtuples_usage.py:61:0 Unable to unpack [23]: Unable to unpack 0 values, 3 were expected. """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 34: Expected 1 errors -Line 35: Expected 1 errors -Line 42: Expected 1 errors -Line 43: Expected 1 errors -Line 27: Unexpected errors ['namedtuples_usage.py:27:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `typing.Any`.'] -Line 28: Unexpected errors ['namedtuples_usage.py:28:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `typing.Any`.'] -Line 29: Unexpected errors ['namedtuples_usage.py:29:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `typing.Any`.'] -Line 30: Unexpected errors ['namedtuples_usage.py:30:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `typing.Any`.'] -Line 31: Unexpected errors ['namedtuples_usage.py:31:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `typing.Any`.'] -Line 32: Unexpected errors ['namedtuples_usage.py:32:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `typing.Any`.'] -Line 61: Unexpected errors ['namedtuples_usage.py:61:0 Unable to unpack [23]: Unable to unpack 0 values, 3 were expected.'] """ diff --git a/conformance/results/pyre/narrowing_typeguard.toml b/conformance/results/pyre/narrowing_typeguard.toml index 7bf7ead7b..3f370ecfc 100644 --- a/conformance/results/pyre/narrowing_typeguard.toml +++ b/conformance/results/pyre/narrowing_typeguard.toml @@ -1,15 +1,12 @@ -conformant = "Partial" +conformant = "Pass" notes = """ -Does not reject TypeGuard method with too few parameters. """ output = """ +narrowing_typeguard.py:102:22 Invalid type guard [68]: User-defined type guard functions or methods must have at least one input parameter. +narrowing_typeguard.py:107:21 Invalid type guard [68]: User-defined type guard functions or methods must have at least one input parameter. narrowing_typeguard.py:128:19 Incompatible parameter type [6]: In call `takes_callable_str`, for 1st positional argument, expected `typing.Callable[[object], str]` but got `typing.Callable(simple_typeguard)[[Named(val, object)], TypeGuard[int]]`. narrowing_typeguard.py:148:25 Incompatible parameter type [6]: In call `takes_callable_str_proto`, for 1st positional argument, expected `CallableStrProto` but got `typing.Callable(simple_typeguard)[[Named(val, object)], TypeGuard[int]]`. -narrowing_typeguard.py:167:20 Incompatible parameter type [6]: In call `takes_int_typeguard`, for 1st positional argument, expected `typing.Callable[[object], TypeGuard[int]]` but got `typing.Callable(bool_typeguard)[[Named(val, object)], TypeGuard[bool]]`. """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 102: Expected 1 errors -Line 107: Expected 1 errors -Line 167: Unexpected errors ['narrowing_typeguard.py:167:20 Incompatible parameter type [6]: In call `takes_int_typeguard`, for 1st positional argument, expected `typing.Callable[[object], TypeGuard[int]]` but got `typing.Callable(bool_typeguard)[[Named(val, object)], TypeGuard[bool]]`.'] """ diff --git a/conformance/results/pyre/narrowing_typeis.toml b/conformance/results/pyre/narrowing_typeis.toml index 2746dc5f7..f3d989e37 100644 --- a/conformance/results/pyre/narrowing_typeis.toml +++ b/conformance/results/pyre/narrowing_typeis.toml @@ -1,39 +1,15 @@ -conformant = "Unsupported" +conformant = "Pass" output = """ -narrowing_typeis.py:9:0 Undefined import [21]: Could not find a name `TypeIs` defined in module `typing_extensions`. -narrowing_typeis.py:14:48 Undefined or invalid type [11]: Annotation `TypeIs` is not defined as a type. -narrowing_typeis.py:19:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Tuple[str, str]` but got `typing.Tuple[str, ...]`. -narrowing_typeis.py:35:17 Incompatible awaitable type [12]: Expected an awaitable but got `typing.Union[typing.Awaitable[int], int]`. -narrowing_typeis.py:38:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `Union[Awaitable[int], int]`. -narrowing_typeis.py:72:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `object`. -narrowing_typeis.py:76:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `object`. -narrowing_typeis.py:80:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `object`. -narrowing_typeis.py:84:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `object`. -narrowing_typeis.py:88:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `object`. -narrowing_typeis.py:92:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `B` but got `object`. -narrowing_typeis.py:96:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `B` but got `object`. +narrowing_typeis.py:105:22 Invalid type guard [68]: User-defined type guard functions or methods must have at least one input parameter. +narrowing_typeis.py:110:21 Invalid type guard [68]: User-defined type guard functions or methods must have at least one input parameter. +narrowing_typeis.py:132:19 Incompatible parameter type [6]: In call `takes_callable_str`, for 1st positional argument, expected `typing.Callable[[object], str]` but got `typing.Callable(simple_typeguard)[[Named(val, object)], TypeIs[int]]`. +narrowing_typeis.py:152:25 Incompatible parameter type [6]: In call `takes_callable_str_proto`, for 1st positional argument, expected `CallableStrProto` but got `typing.Callable(simple_typeguard)[[Named(val, object)], TypeIs[int]]`. +narrowing_typeis.py:169:16 Incompatible parameter type [6]: In call `takes_typeguard`, for 1st positional argument, expected `typing.Callable[[object], TypeGuard[int]]` but got `typing.Callable(is_int_typeis)[[Named(val, object)], TypeIs[int]]`. +narrowing_typeis.py:170:13 Incompatible parameter type [6]: In call `takes_typeis`, for 1st positional argument, expected `typing.Callable[[object], TypeIs[int]]` but got `typing.Callable(is_int_typeguard)[[Named(val, object)], TypeGuard[int]]`. +narrowing_typeis.py:191:17 Incompatible parameter type [6]: In call `takes_int_typeis`, for 1st positional argument, expected `typing.Callable[[object], TypeIs[int]]` but got `typing.Callable(bool_typeis)[[Named(val, object)], TypeIs[bool]]`. +narrowing_typeis.py:195:26 Invalid type guard [68]: The narrowed type str of this type guard is not a subtype of the first positional parameter type int. +narrowing_typeis.py:199:44 Invalid type guard [68]: The narrowed type typing.List[int] of this type guard is not a subtype of the first positional parameter type typing.List[object]. """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 105: Expected 1 errors -Line 110: Expected 1 errors -Line 132: Expected 1 errors -Line 152: Expected 1 errors -Line 169: Expected 1 errors -Line 170: Expected 1 errors -Line 191: Expected 1 errors -Line 195: Expected 1 errors -Line 199: Expected 1 errors -Line 9: Unexpected errors ['narrowing_typeis.py:9:0 Undefined import [21]: Could not find a name `TypeIs` defined in module `typing_extensions`.'] -Line 14: Unexpected errors ['narrowing_typeis.py:14:48 Undefined or invalid type [11]: Annotation `TypeIs` is not defined as a type.'] -Line 19: Unexpected errors ['narrowing_typeis.py:19:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Tuple[str, str]` but got `typing.Tuple[str, ...]`.'] -Line 35: Unexpected errors ['narrowing_typeis.py:35:17 Incompatible awaitable type [12]: Expected an awaitable but got `typing.Union[typing.Awaitable[int], int]`.'] -Line 38: Unexpected errors ['narrowing_typeis.py:38:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `Union[Awaitable[int], int]`.'] -Line 72: Unexpected errors ['narrowing_typeis.py:72:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `object`.'] -Line 76: Unexpected errors ['narrowing_typeis.py:76:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `object`.'] -Line 80: Unexpected errors ['narrowing_typeis.py:80:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `object`.'] -Line 84: Unexpected errors ['narrowing_typeis.py:84:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `object`.'] -Line 88: Unexpected errors ['narrowing_typeis.py:88:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `object`.'] -Line 92: Unexpected errors ['narrowing_typeis.py:92:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `B` but got `object`.'] -Line 96: Unexpected errors ['narrowing_typeis.py:96:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `B` but got `object`.'] """ diff --git a/conformance/results/pyre/overloads_basic.toml b/conformance/results/pyre/overloads_basic.toml index 7de070af9..7a5d5b54d 100644 --- a/conformance/results/pyre/overloads_basic.toml +++ b/conformance/results/pyre/overloads_basic.toml @@ -1,12 +1,11 @@ -conformant = "Partial" +conformant = "Pass" notes = """ -Does not reject a function with a single @overload signature. """ output = """ overloads_basic.py:37:2 Incompatible parameter type [6]: In call `Bytes.__getitem__`, for 1st positional argument, expected `int` but got `str`. +overloads_basic.py:63:0 Incompatible overload [43]: At least two overload signatures must be present. overloads_basic.py:75:0 Missing overload implementation [42]: Overloaded function `func2` must have an implementation. """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Lines 62, 63: Expected error (tag 'func1') """ diff --git a/conformance/results/pyre/protocols_generic.toml b/conformance/results/pyre/protocols_generic.toml index 0f071ec3d..dd13ab524 100644 --- a/conformance/results/pyre/protocols_generic.toml +++ b/conformance/results/pyre/protocols_generic.toml @@ -5,6 +5,7 @@ Does not detect protocol mismatch when method-scoped TypeVar is used in protocol """ output = """ protocols_generic.py:40:0 Incompatible variable type [9]: p2 is declared to have type `Proto1[int, str]` but is used as type `Concrete1`. +protocols_generic.py:44:29 Invalid inheritance [39]: Subscripted Protocol and Generic may not appear in the same base class list protocols_generic.py:56:4 Incompatible variable type [9]: v2 is declared to have type `Box[int]` but is used as type `Box[float]`. protocols_generic.py:66:4 Incompatible variable type [9]: v2 is declared to have type `Sender[float]` but is used as type `Sender[int]`. protocols_generic.py:74:4 Incompatible variable type [9]: v1 is declared to have type `AttrProto[float]` but is used as type `AttrProto[int]`. @@ -13,7 +14,6 @@ protocols_generic.py:146:0 Incompatible variable type [9]: hp3 is declared to ha """ conformance_automated = "Fail" errors_diff = """ -Line 44: Expected 1 errors Line 145: Expected 1 errors Line 147: Expected 1 errors """ diff --git a/conformance/results/pyre/protocols_merging.toml b/conformance/results/pyre/protocols_merging.toml index c471755f2..05c0cbd4b 100644 --- a/conformance/results/pyre/protocols_merging.toml +++ b/conformance/results/pyre/protocols_merging.toml @@ -1,15 +1,14 @@ -conformant = "Partial" +conformant = "Pass" notes = """ -Does not reject a protocol class that derives from a non-protocol class. """ output = """ protocols_merging.py:52:0 Incompatible variable type [9]: s6 is declared to have type `SizedAndClosable1` but is used as type `SCConcrete2`. protocols_merging.py:53:0 Incompatible variable type [9]: s7 is declared to have type `SizedAndClosable2` but is used as type `SCConcrete2`. protocols_merging.py:54:0 Incompatible variable type [9]: s8 is declared to have type `SizedAndClosable3` but is used as type `SCConcrete2`. +protocols_merging.py:67:15 Invalid inheritance [39]: If Protocol is included as a base class, all other base classes must be protocols or Generic. protocols_merging.py:82:4 Invalid class instantiation [45]: Cannot instantiate abstract class `SizedAndClosable4` with abstract method `close`. protocols_merging.py:83:0 Incompatible variable type [9]: y is declared to have type `SizedAndClosable4` but is used as type `SCConcrete1`. """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 67: Expected 1 errors """ diff --git a/conformance/results/pyre/qualifiers_annotated.toml b/conformance/results/pyre/qualifiers_annotated.toml index 2c9bc2893..c92e8f39c 100644 --- a/conformance/results/pyre/qualifiers_annotated.toml +++ b/conformance/results/pyre/qualifiers_annotated.toml @@ -16,19 +16,19 @@ qualifiers_annotated.py:51:6 Invalid type [31]: Expression `typing.Annotated[(Tr qualifiers_annotated.py:52:7 Invalid type [31]: Expression `typing.Annotated[(1, "")]` is not a valid type. qualifiers_annotated.py:53:7 Invalid type [31]: Expression `typing.Annotated[(list or set, "")]` is not a valid type. qualifiers_annotated.py:54:7 Invalid type [31]: Expression `typing.Annotated[(f"{"int"}", "")]` is not a valid type. -qualifiers_annotated.py:76:33 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[]` but got `Tuple[Type[int], str]`. Expected has length 0, but actual has length 2. +qualifiers_annotated.py:64:7 Invalid type parameters [24]: Generic type `Annotated` expects at least 2 type parameters, received 1. qualifiers_annotated.py:77:0 Incompatible variable type [9]: not_type2 is declared to have type `Type[typing.Any]` but is used as type `TypeAlias`. -qualifiers_annotated.py:84:16 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[]` but got `Tuple[Type[str], str]`. Expected has length 0, but actual has length 2. qualifiers_annotated.py:85:6 Incompatible parameter type [6]: In call `func4`, for 1st positional argument, expected `Type[Variable[T]]` but got `TypeAlias`. -qualifiers_annotated.py:92:10 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[]` but got `Tuple[Type[int], str]`. Expected has length 0, but actual has length 2. +qualifiers_annotated.py:91:0 Invalid class instantiation [45]: `Annotated` cannot be instantiated. qualifiers_annotated.py:93:0 Call error [29]: `TypeAlias` is not a function. qualifiers_annotated.py:105:4 Undefined attribute [16]: `typing.Type` has no attribute `a`. qualifiers_annotated.py:106:4 Undefined attribute [16]: `typing.Type` has no attribute `b`. """ conformance_automated = "Fail" errors_diff = """ -Line 64: Expected 1 errors -Line 91: Expected 1 errors +Line 76: Expected 1 errors +Line 84: Expected 1 errors +Line 92: Expected 1 errors Line 105: Unexpected errors ['qualifiers_annotated.py:105:4 Undefined attribute [16]: `typing.Type` has no attribute `a`.'] Line 106: Unexpected errors ['qualifiers_annotated.py:106:4 Undefined attribute [16]: `typing.Type` has no attribute `b`.'] """ diff --git a/conformance/results/pyre/specialtypes_any.toml b/conformance/results/pyre/specialtypes_any.toml index b3b83ddee..07cd73b25 100644 --- a/conformance/results/pyre/specialtypes_any.toml +++ b/conformance/results/pyre/specialtypes_any.toml @@ -1,15 +1,8 @@ -conformant = "Partial" +conformant = "Pass" notes = """ -Does not support Any as a base class. """ output = """ -specialtypes_any.py:81:13 Invalid inheritance [39]: `typing.Any` is not a valid parent class. -specialtypes_any.py:87:12 Undefined attribute [16]: `ClassA` has no attribute `method2`. -specialtypes_any.py:88:12 Undefined attribute [16]: `ClassA` has no attribute `method3`. """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 81: Unexpected errors ['specialtypes_any.py:81:13 Invalid inheritance [39]: `typing.Any` is not a valid parent class.'] -Line 87: Unexpected errors ['specialtypes_any.py:87:12 Undefined attribute [16]: `ClassA` has no attribute `method2`.'] -Line 88: Unexpected errors ['specialtypes_any.py:88:12 Undefined attribute [16]: `ClassA` has no attribute `method3`.'] """ diff --git a/conformance/results/pyre/specialtypes_never.toml b/conformance/results/pyre/specialtypes_never.toml index d65de23ed..1cdfcc0b6 100644 --- a/conformance/results/pyre/specialtypes_never.toml +++ b/conformance/results/pyre/specialtypes_never.toml @@ -3,7 +3,7 @@ notes = """ Does not treat Never as compatible with all other types. """ output = """ -specialtypes_never.py:21:8 Incompatible return type [7]: Function declared non-returnable, but got `None`. +specialtypes_never.py:19:21 Incompatible return type [7]: Function declared non-returnable, but got implicit return value of `None`. specialtypes_never.py:68:4 Incompatible variable type [9]: v1 is declared to have type `int` but is used as type `Never`. specialtypes_never.py:69:4 Incompatible variable type [9]: v2 is declared to have type `str` but is used as type `Never`. specialtypes_never.py:70:4 Incompatible variable type [9]: v3 is declared to have type `List[str]` but is used as type `Never`. @@ -14,8 +14,6 @@ specialtypes_never.py:105:4 Incompatible return type [7]: Expected `ClassC[Varia """ conformance_automated = "Fail" errors_diff = """ -Line 19: Expected 1 errors -Line 21: Unexpected errors ['specialtypes_never.py:21:8 Incompatible return type [7]: Function declared non-returnable, but got `None`.'] Line 68: Unexpected errors ['specialtypes_never.py:68:4 Incompatible variable type [9]: v1 is declared to have type `int` but is used as type `Never`.'] Line 69: Unexpected errors ['specialtypes_never.py:69:4 Incompatible variable type [9]: v2 is declared to have type `str` but is used as type `Never`.'] Line 70: Unexpected errors ['specialtypes_never.py:70:4 Incompatible variable type [9]: v3 is declared to have type `List[str]` but is used as type `Never`.'] diff --git a/conformance/results/pyre/specialtypes_type.toml b/conformance/results/pyre/specialtypes_type.toml index 78343fa29..a2a0c9c5a 100644 --- a/conformance/results/pyre/specialtypes_type.toml +++ b/conformance/results/pyre/specialtypes_type.toml @@ -9,6 +9,14 @@ Reports type incompatibility between `type` and `Callable[..., Any]`. output = """ specialtypes_type.py:56:6 Incompatible parameter type [6]: In call `func4`, for 1st positional argument, expected `Type[Union[BasicUser, ProUser]]` but got `Type[TeamUser]`. specialtypes_type.py:76:11 Invalid type parameters [24]: Generic type `type` expects 1 type parameter, received 2, use `typing.Type[]` to avoid runtime subscripting errors. +specialtypes_type.py:98:4 Assert type [70]: Expected `typing.Tuple[Type[typing.Any], ...]` but got `unknown`. +specialtypes_type.py:99:4 Assert type [70]: Expected `typing.Any` but got `unknown`. +specialtypes_type.py:102:4 Assert type [70]: Expected `typing.Tuple[Type[typing.Any], ...]` but got `unknown`. +specialtypes_type.py:103:4 Assert type [70]: Expected `typing.Any` but got `unknown`. +specialtypes_type.py:106:4 Assert type [70]: Expected `typing.Tuple[Type[typing.Any], ...]` but got `unknown`. +specialtypes_type.py:107:4 Assert type [70]: Expected `typing.Any` but got `unknown`. +specialtypes_type.py:110:4 Assert type [70]: Expected `typing.Tuple[Type[typing.Any], ...]` but got `unknown`. +specialtypes_type.py:111:4 Assert type [70]: Expected `typing.Any` but got `unknown`. specialtypes_type.py:117:4 Undefined attribute [16]: `object` has no attribute `unknown`. specialtypes_type.py:143:0 Undefined attribute [16]: `TypeAlias` has no attribute `unknown`. specialtypes_type.py:165:4 Incompatible variable type [9]: x1 is declared to have type `typing.Callable[..., typing.Any]` but is used as type `Type[typing.Any]`. @@ -21,6 +29,14 @@ Line 120: Expected 1 errors Line 144: Expected 1 errors Line 145: Expected 1 errors Line 146: Expected 1 errors +Line 98: Unexpected errors ['specialtypes_type.py:98:4 Assert type [70]: Expected `typing.Tuple[Type[typing.Any], ...]` but got `unknown`.'] +Line 99: Unexpected errors ['specialtypes_type.py:99:4 Assert type [70]: Expected `typing.Any` but got `unknown`.'] +Line 102: Unexpected errors ['specialtypes_type.py:102:4 Assert type [70]: Expected `typing.Tuple[Type[typing.Any], ...]` but got `unknown`.'] +Line 103: Unexpected errors ['specialtypes_type.py:103:4 Assert type [70]: Expected `typing.Any` but got `unknown`.'] +Line 106: Unexpected errors ['specialtypes_type.py:106:4 Assert type [70]: Expected `typing.Tuple[Type[typing.Any], ...]` but got `unknown`.'] +Line 107: Unexpected errors ['specialtypes_type.py:107:4 Assert type [70]: Expected `typing.Any` but got `unknown`.'] +Line 110: Unexpected errors ['specialtypes_type.py:110:4 Assert type [70]: Expected `typing.Tuple[Type[typing.Any], ...]` but got `unknown`.'] +Line 111: Unexpected errors ['specialtypes_type.py:111:4 Assert type [70]: Expected `typing.Any` but got `unknown`.'] Line 165: Unexpected errors ['specialtypes_type.py:165:4 Incompatible variable type [9]: x1 is declared to have type `typing.Callable[..., typing.Any]` but is used as type `Type[typing.Any]`.'] Line 166: Unexpected errors ['specialtypes_type.py:166:4 Incompatible variable type [9]: x2 is declared to have type `typing.Callable[[int, int], int]` but is used as type `Type[typing.Any]`.'] """ diff --git a/conformance/results/pyre/tuples_type_compat.toml b/conformance/results/pyre/tuples_type_compat.toml index 3d3a35787..72799fbd7 100644 --- a/conformance/results/pyre/tuples_type_compat.toml +++ b/conformance/results/pyre/tuples_type_compat.toml @@ -7,55 +7,29 @@ Does not correctly evaluate `Sequence[Never]` for `tuple[()]`. """ output = """ tuples_type_compat.py:15:4 Incompatible variable type [9]: v2 is declared to have type `Tuple[int, int]` but is used as type `Tuple[float, complex]`. -tuples_type_compat.py:22:30 Invalid type [31]: Expression `tuple[(int, *tuple[(int, ...)])]` is not a valid type. -tuples_type_compat.py:27:8 Invalid type [31]: Expression `tuple[(int, *tuple[(int, ...)])]` is not a valid type. -tuples_type_compat.py:47:8 Invalid type [31]: Expression `tuple[(int, *tuple[(str, ...)])]` is not a valid type. tuples_type_compat.py:55:21 Undefined or invalid type [11]: Annotation `SomeType` is not defined as a type. -tuples_type_compat.py:71:15 Invalid type [31]: Expression `typing.Union[(tuple[int], tuple[(str, str)], tuple[(int, *tuple[(str, ...)], int)])]` is not a valid type. -tuples_type_compat.py:91:15 Invalid type [31]: Expression `typing.Union[(tuple[int], tuple[(str, str)], tuple[(int, *tuple[(str, ...)], int)])]` is not a valid type. -tuples_type_compat.py:95:12 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Tuple[int]` but got `Union[Tuple[int], Tuple[str, str]]`. -tuples_type_compat.py:99:12 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Union[Tuple[int, int], Tuple[str, str]]` but got `Union[Tuple[int], Tuple[str, str]]`. -tuples_type_compat.py:103:12 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Tuple[int, str, int]` but got `Union[Tuple[int], Tuple[str, str]]`. -tuples_type_compat.py:115:12 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Tuple[Union[int, str], str]` but got `Tuple[Union[int, str], Union[int, str]]`. -tuples_type_compat.py:117:12 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Tuple[Union[int, str], int]` but got `Tuple[Union[int, str], Union[int, str]]`. -tuples_type_compat.py:134:39 Invalid type [31]: Expression `tuple[(int, *tuple[(str, ...)])]` is not a valid type. -tuples_type_compat.py:139:4 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Sequence[Union[int, str]]` but got `Sequence[Variable[T]]`. -tuples_type_compat.py:140:4 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Sequence[Never]` but got `Sequence[Variable[T]]`. -tuples_type_compat.py:143:4 Invalid type [31]: Expression `tuple[(int, *tuple[str])]` is not a valid type. -tuples_type_compat.py:144:0 Incompatible variable type [9]: t1 is declared to have type `Tuple[typing_extensions.Literal[1], typing_extensions.Literal['']]` but is used as type `Tuple[typing_extensions.Literal[1], typing_extensions.Literal[''], typing_extensions.Literal['']]`. -tuples_type_compat.py:146:0 Incompatible variable type [9]: t2 is declared to have type `Tuple[int, unknown]` but is used as type `Tuple[int]`. -tuples_type_compat.py:146:4 Invalid type [31]: Expression `tuple[(int, *tuple[(str, ...)])]` is not a valid type. -tuples_type_compat.py:147:0 Incompatible variable type [9]: t2 is declared to have type `Tuple[typing_extensions.Literal[1]]` but is used as type `Tuple[typing_extensions.Literal[1], typing_extensions.Literal['']]`. -tuples_type_compat.py:148:0 Incompatible variable type [9]: t2 is declared to have type `Tuple[typing_extensions.Literal[1]]` but is used as type `Tuple[typing_extensions.Literal[1], typing_extensions.Literal[''], typing_extensions.Literal['']]`. -tuples_type_compat.py:149:0 Incompatible variable type [9]: t2 is declared to have type `Tuple[typing_extensions.Literal[1]]` but is used as type `Tuple[typing_extensions.Literal[1], typing_extensions.Literal[1], typing_extensions.Literal['']]`. -tuples_type_compat.py:150:0 Incompatible variable type [9]: t2 is declared to have type `Tuple[typing_extensions.Literal[1]]` but is used as type `Tuple[typing_extensions.Literal[1], typing_extensions.Literal[''], typing_extensions.Literal[1]]`. -tuples_type_compat.py:153:0 Incompatible variable type [9]: t3 is declared to have type `Tuple[int, unknown, int]` but is used as type `Tuple[int, int]`. -tuples_type_compat.py:153:4 Invalid type [31]: Expression `tuple[(int, *tuple[(str, ...)], int)]` is not a valid type. -tuples_type_compat.py:154:0 Incompatible variable type [9]: t3 is declared to have type `Tuple[typing_extensions.Literal[1], typing_extensions.Literal[2]]` but is used as type `Tuple[typing_extensions.Literal[1], typing_extensions.Literal[''], typing_extensions.Literal[2]]`. -tuples_type_compat.py:155:0 Incompatible variable type [9]: t3 is declared to have type `Tuple[typing_extensions.Literal[1], typing_extensions.Literal[2]]` but is used as type `Tuple[typing_extensions.Literal[1], typing_extensions.Literal[''], typing_extensions.Literal[''], typing_extensions.Literal[2]]`. -tuples_type_compat.py:156:0 Incompatible variable type [9]: t3 is declared to have type `Tuple[typing_extensions.Literal[1], typing_extensions.Literal[2]]` but is used as type `Tuple[typing_extensions.Literal[1], typing_extensions.Literal[''], typing_extensions.Literal['']]`. -tuples_type_compat.py:157:0 Incompatible variable type [9]: t3 is declared to have type `Tuple[typing_extensions.Literal[1], typing_extensions.Literal[2]]` but is used as type `Tuple[typing_extensions.Literal[1], typing_extensions.Literal[''], typing_extensions.Literal[''], float]`. -tuples_type_compat.py:159:0 Incompatible variable type [9]: t4 is declared to have type `Tuple[unknown, int]` but is used as type `Tuple[int]`. -tuples_type_compat.py:159:4 Invalid type [31]: Expression `tuple[(*tuple[(str, ...)], int)]` is not a valid type. -tuples_type_compat.py:160:0 Incompatible variable type [9]: t4 is declared to have type `Tuple[typing_extensions.Literal[1]]` but is used as type `Tuple[typing_extensions.Literal[''], typing_extensions.Literal[1]]`. -tuples_type_compat.py:161:0 Incompatible variable type [9]: t4 is declared to have type `Tuple[typing_extensions.Literal[1]]` but is used as type `Tuple[typing_extensions.Literal[''], typing_extensions.Literal[''], typing_extensions.Literal[1]]`. -tuples_type_compat.py:162:0 Incompatible variable type [9]: t4 is declared to have type `Tuple[typing_extensions.Literal[1]]` but is used as type `Tuple[typing_extensions.Literal[1], typing_extensions.Literal[''], typing_extensions.Literal[1]]`. -tuples_type_compat.py:163:0 Incompatible variable type [9]: t4 is declared to have type `Tuple[typing_extensions.Literal[1]]` but is used as type `Tuple[typing_extensions.Literal[''], typing_extensions.Literal[''], float]`. -tuples_type_compat.py:167:4 Incompatible variable type [9]: t1 is declared to have type `Tuple[str, str, unknown]` but is used as type `Tuple[str, str]`. -tuples_type_compat.py:167:8 Invalid type [31]: Expression `tuple[(str, str, *tuple[(int, ...)])]` is not a valid type. -tuples_type_compat.py:168:4 Incompatible variable type [9]: t2 is declared to have type `Tuple[str, str, unknown]` but is used as type `Tuple[str, str]`. -tuples_type_compat.py:168:8 Invalid type [31]: Expression `tuple[(str, str, *tuple[int])]` is not a valid type. -tuples_type_compat.py:169:8 Invalid type [31]: Expression `tuple[(str, *tuple[(str, ...)])]` is not a valid type. -tuples_type_compat.py:170:4 Incompatible variable type [9]: t4 is declared to have type `Tuple[str, str, unknown]` but is used as type `Tuple[str, str]`. -tuples_type_compat.py:170:8 Invalid type [31]: Expression `tuple[(str, str, *tuple[(str, ...)])]` is not a valid type. -tuples_type_compat.py:171:4 Incompatible variable type [9]: t5 is declared to have type `Tuple[str, str, str, unknown]` but is used as type `Tuple[str, str]`. -tuples_type_compat.py:171:8 Invalid type [31]: Expression `tuple[(str, str, str, *tuple[(str, ...)])]` is not a valid type. -tuples_type_compat.py:172:4 Incompatible variable type [9]: t6 is declared to have type `Tuple[str, unknown, str]` but is used as type `Tuple[str, str]`. -tuples_type_compat.py:172:8 Invalid type [31]: Expression `tuple[(str, *tuple[(int, ...)], str)]` is not a valid type. -tuples_type_compat.py:173:8 Invalid type [31]: Expression `tuple[(*tuple[(str, ...)], str)]` is not a valid type. -tuples_type_compat.py:174:8 Invalid type [31]: Expression `tuple[(*tuple[(str, ...)], str)]` is not a valid type. -tuples_type_compat.py:175:4 Incompatible variable type [9]: t9 is declared to have type `Tuple[unknown, str, str, str]` but is used as type `Tuple[str, str]`. -tuples_type_compat.py:175:8 Invalid type [31]: Expression `tuple[(*tuple[(str, ...)], str, str, str)]` is not a valid type. +tuples_type_compat.py:72:11 Incompatible parameter type [6]: In call `len`, for 1st positional argument, expected `pyre_extensions.PyreReadOnly[Sized]` but got `Union[Tuple[int], Tuple[str, str], typing.Tuple[int, *Tuple[str, ...], int]]`. +tuples_type_compat.py:74:8 Assert type [70]: Expected `Tuple[int]` but got `Union[Tuple[int], Tuple[str, str], typing.Tuple[int, *Tuple[str, ...], int]]`. +tuples_type_compat.py:76:11 Incompatible parameter type [6]: In call `len`, for 1st positional argument, expected `pyre_extensions.PyreReadOnly[Sized]` but got `Union[Tuple[int], Tuple[str, str], typing.Tuple[int, *Tuple[str, ...], int]]`. +tuples_type_compat.py:78:8 Assert type [70]: Expected `Union[Tuple[int, int], Tuple[str, str]]` but got `Union[Tuple[int], Tuple[str, str], typing.Tuple[int, *Tuple[str, ...], int]]`. +tuples_type_compat.py:80:11 Incompatible parameter type [6]: In call `len`, for 1st positional argument, expected `pyre_extensions.PyreReadOnly[Sized]` but got `Union[Tuple[int], Tuple[str, str], typing.Tuple[int, *Tuple[str, ...], int]]`. +tuples_type_compat.py:82:8 Assert type [70]: Expected `Tuple[int, str, int]` but got `Union[Tuple[int], Tuple[str, str], typing.Tuple[int, *Tuple[str, ...], int]]`. +tuples_type_compat.py:95:12 Assert type [70]: Expected `Tuple[int]` but got `Union[Tuple[int], Tuple[str, str], typing.Tuple[int, *Tuple[str, ...], int]]`. +tuples_type_compat.py:99:12 Assert type [70]: Expected `Union[Tuple[int, int], Tuple[str, str]]` but got `Union[Tuple[int], Tuple[str, str], typing.Tuple[int, *Tuple[str, ...], int]]`. +tuples_type_compat.py:103:12 Assert type [70]: Expected `Tuple[int, str, int]` but got `Union[Tuple[int], Tuple[str, str], typing.Tuple[int, *Tuple[str, ...], int]]`. +tuples_type_compat.py:115:12 Assert type [70]: Expected `Tuple[Union[int, str], str]` but got `Tuple[Union[int, str], Union[int, str]]`. +tuples_type_compat.py:117:12 Assert type [70]: Expected `Tuple[Union[int, str], int]` but got `Tuple[Union[int, str], Union[int, str]]`. +tuples_type_compat.py:140:4 Assert type [70]: Expected `Sequence[Never]` but got `Sequence[Variable[T]]`. +tuples_type_compat.py:144:0 Incompatible variable type [9]: t1 is declared to have type `Tuple[int, str]` but is used as type `Tuple[int, str, str]`. +tuples_type_compat.py:149:0 Incompatible variable type [9]: t2 is declared to have type `typing.Tuple[int, *Tuple[str, ...]]` but is used as type `Tuple[int, int, str]`. +tuples_type_compat.py:150:0 Incompatible variable type [9]: t2 is declared to have type `typing.Tuple[int, *Tuple[str, ...]]` but is used as type `Tuple[int, str, int]`. +tuples_type_compat.py:156:0 Incompatible variable type [9]: t3 is declared to have type `typing.Tuple[int, *Tuple[str, ...], int]` but is used as type `Tuple[int, str, str]`. +tuples_type_compat.py:157:0 Incompatible variable type [9]: t3 is declared to have type `typing.Tuple[int, *Tuple[str, ...], int]` but is used as type `Tuple[int, str, str, float]`. +tuples_type_compat.py:162:0 Incompatible variable type [9]: t4 is declared to have type `typing.Tuple[*Tuple[str, ...], int]` but is used as type `Tuple[int, str, int]`. +tuples_type_compat.py:163:0 Incompatible variable type [9]: t4 is declared to have type `typing.Tuple[*Tuple[str, ...], int]` but is used as type `Tuple[str, str, float]`. +tuples_type_compat.py:168:4 Incompatible variable type [9]: t2 is declared to have type `Tuple[str, str, int]` but is used as type `Tuple[str, str]`. +tuples_type_compat.py:171:4 Incompatible variable type [9]: t5 is declared to have type `typing.Tuple[str, str, str, *Tuple[str, ...]]` but is used as type `Tuple[str, str]`. +tuples_type_compat.py:175:4 Incompatible variable type [9]: t9 is declared to have type `typing.Tuple[*Tuple[str, ...], str, str, str]` but is used as type `Tuple[str, str]`. """ conformance_automated = "Fail" errors_diff = """ @@ -64,34 +38,17 @@ Line 32: Expected 1 errors Line 33: Expected 1 errors Line 43: Expected 1 errors Line 62: Expected 1 errors -Line 22: Unexpected errors ['tuples_type_compat.py:22:30 Invalid type [31]: Expression `tuple[(int, *tuple[(int, ...)])]` is not a valid type.'] -Line 27: Unexpected errors ['tuples_type_compat.py:27:8 Invalid type [31]: Expression `tuple[(int, *tuple[(int, ...)])]` is not a valid type.'] -Line 47: Unexpected errors ['tuples_type_compat.py:47:8 Invalid type [31]: Expression `tuple[(int, *tuple[(str, ...)])]` is not a valid type.'] Line 55: Unexpected errors ['tuples_type_compat.py:55:21 Undefined or invalid type [11]: Annotation `SomeType` is not defined as a type.'] -Line 71: Unexpected errors ['tuples_type_compat.py:71:15 Invalid type [31]: Expression `typing.Union[(tuple[int], tuple[(str, str)], tuple[(int, *tuple[(str, ...)], int)])]` is not a valid type.'] -Line 91: Unexpected errors ['tuples_type_compat.py:91:15 Invalid type [31]: Expression `typing.Union[(tuple[int], tuple[(str, str)], tuple[(int, *tuple[(str, ...)], int)])]` is not a valid type.'] -Line 95: Unexpected errors ['tuples_type_compat.py:95:12 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Tuple[int]` but got `Union[Tuple[int], Tuple[str, str]]`.'] -Line 99: Unexpected errors ['tuples_type_compat.py:99:12 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Union[Tuple[int, int], Tuple[str, str]]` but got `Union[Tuple[int], Tuple[str, str]]`.'] -Line 103: Unexpected errors ['tuples_type_compat.py:103:12 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Tuple[int, str, int]` but got `Union[Tuple[int], Tuple[str, str]]`.'] -Line 115: Unexpected errors ['tuples_type_compat.py:115:12 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Tuple[Union[int, str], str]` but got `Tuple[Union[int, str], Union[int, str]]`.'] -Line 117: Unexpected errors ['tuples_type_compat.py:117:12 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Tuple[Union[int, str], int]` but got `Tuple[Union[int, str], Union[int, str]]`.'] -Line 134: Unexpected errors ['tuples_type_compat.py:134:39 Invalid type [31]: Expression `tuple[(int, *tuple[(str, ...)])]` is not a valid type.'] -Line 139: Unexpected errors ['tuples_type_compat.py:139:4 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Sequence[Union[int, str]]` but got `Sequence[Variable[T]]`.'] -Line 140: Unexpected errors ['tuples_type_compat.py:140:4 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Sequence[Never]` but got `Sequence[Variable[T]]`.'] -Line 143: Unexpected errors ['tuples_type_compat.py:143:4 Invalid type [31]: Expression `tuple[(int, *tuple[str])]` is not a valid type.'] -Line 146: Unexpected errors ['tuples_type_compat.py:146:0 Incompatible variable type [9]: t2 is declared to have type `Tuple[int, unknown]` but is used as type `Tuple[int]`.', 'tuples_type_compat.py:146:4 Invalid type [31]: Expression `tuple[(int, *tuple[(str, ...)])]` is not a valid type.'] -Line 147: Unexpected errors ["tuples_type_compat.py:147:0 Incompatible variable type [9]: t2 is declared to have type `Tuple[typing_extensions.Literal[1]]` but is used as type `Tuple[typing_extensions.Literal[1], typing_extensions.Literal['']]`."] -Line 148: Unexpected errors ["tuples_type_compat.py:148:0 Incompatible variable type [9]: t2 is declared to have type `Tuple[typing_extensions.Literal[1]]` but is used as type `Tuple[typing_extensions.Literal[1], typing_extensions.Literal[''], typing_extensions.Literal['']]`."] -Line 153: Unexpected errors ['tuples_type_compat.py:153:0 Incompatible variable type [9]: t3 is declared to have type `Tuple[int, unknown, int]` but is used as type `Tuple[int, int]`.', 'tuples_type_compat.py:153:4 Invalid type [31]: Expression `tuple[(int, *tuple[(str, ...)], int)]` is not a valid type.'] -Line 154: Unexpected errors ["tuples_type_compat.py:154:0 Incompatible variable type [9]: t3 is declared to have type `Tuple[typing_extensions.Literal[1], typing_extensions.Literal[2]]` but is used as type `Tuple[typing_extensions.Literal[1], typing_extensions.Literal[''], typing_extensions.Literal[2]]`."] -Line 155: Unexpected errors ["tuples_type_compat.py:155:0 Incompatible variable type [9]: t3 is declared to have type `Tuple[typing_extensions.Literal[1], typing_extensions.Literal[2]]` but is used as type `Tuple[typing_extensions.Literal[1], typing_extensions.Literal[''], typing_extensions.Literal[''], typing_extensions.Literal[2]]`."] -Line 159: Unexpected errors ['tuples_type_compat.py:159:0 Incompatible variable type [9]: t4 is declared to have type `Tuple[unknown, int]` but is used as type `Tuple[int]`.', 'tuples_type_compat.py:159:4 Invalid type [31]: Expression `tuple[(*tuple[(str, ...)], int)]` is not a valid type.'] -Line 160: Unexpected errors ["tuples_type_compat.py:160:0 Incompatible variable type [9]: t4 is declared to have type `Tuple[typing_extensions.Literal[1]]` but is used as type `Tuple[typing_extensions.Literal[''], typing_extensions.Literal[1]]`."] -Line 161: Unexpected errors ["tuples_type_compat.py:161:0 Incompatible variable type [9]: t4 is declared to have type `Tuple[typing_extensions.Literal[1]]` but is used as type `Tuple[typing_extensions.Literal[''], typing_extensions.Literal[''], typing_extensions.Literal[1]]`."] -Line 167: Unexpected errors ['tuples_type_compat.py:167:4 Incompatible variable type [9]: t1 is declared to have type `Tuple[str, str, unknown]` but is used as type `Tuple[str, str]`.', 'tuples_type_compat.py:167:8 Invalid type [31]: Expression `tuple[(str, str, *tuple[(int, ...)])]` is not a valid type.'] -Line 169: Unexpected errors ['tuples_type_compat.py:169:8 Invalid type [31]: Expression `tuple[(str, *tuple[(str, ...)])]` is not a valid type.'] -Line 170: Unexpected errors ['tuples_type_compat.py:170:4 Incompatible variable type [9]: t4 is declared to have type `Tuple[str, str, unknown]` but is used as type `Tuple[str, str]`.', 'tuples_type_compat.py:170:8 Invalid type [31]: Expression `tuple[(str, str, *tuple[(str, ...)])]` is not a valid type.'] -Line 172: Unexpected errors ['tuples_type_compat.py:172:4 Incompatible variable type [9]: t6 is declared to have type `Tuple[str, unknown, str]` but is used as type `Tuple[str, str]`.', 'tuples_type_compat.py:172:8 Invalid type [31]: Expression `tuple[(str, *tuple[(int, ...)], str)]` is not a valid type.'] -Line 173: Unexpected errors ['tuples_type_compat.py:173:8 Invalid type [31]: Expression `tuple[(*tuple[(str, ...)], str)]` is not a valid type.'] -Line 174: Unexpected errors ['tuples_type_compat.py:174:8 Invalid type [31]: Expression `tuple[(*tuple[(str, ...)], str)]` is not a valid type.'] +Line 72: Unexpected errors ['tuples_type_compat.py:72:11 Incompatible parameter type [6]: In call `len`, for 1st positional argument, expected `pyre_extensions.PyreReadOnly[Sized]` but got `Union[Tuple[int], Tuple[str, str], typing.Tuple[int, *Tuple[str, ...], int]]`.'] +Line 74: Unexpected errors ['tuples_type_compat.py:74:8 Assert type [70]: Expected `Tuple[int]` but got `Union[Tuple[int], Tuple[str, str], typing.Tuple[int, *Tuple[str, ...], int]]`.'] +Line 76: Unexpected errors ['tuples_type_compat.py:76:11 Incompatible parameter type [6]: In call `len`, for 1st positional argument, expected `pyre_extensions.PyreReadOnly[Sized]` but got `Union[Tuple[int], Tuple[str, str], typing.Tuple[int, *Tuple[str, ...], int]]`.'] +Line 78: Unexpected errors ['tuples_type_compat.py:78:8 Assert type [70]: Expected `Union[Tuple[int, int], Tuple[str, str]]` but got `Union[Tuple[int], Tuple[str, str], typing.Tuple[int, *Tuple[str, ...], int]]`.'] +Line 80: Unexpected errors ['tuples_type_compat.py:80:11 Incompatible parameter type [6]: In call `len`, for 1st positional argument, expected `pyre_extensions.PyreReadOnly[Sized]` but got `Union[Tuple[int], Tuple[str, str], typing.Tuple[int, *Tuple[str, ...], int]]`.'] +Line 82: Unexpected errors ['tuples_type_compat.py:82:8 Assert type [70]: Expected `Tuple[int, str, int]` but got `Union[Tuple[int], Tuple[str, str], typing.Tuple[int, *Tuple[str, ...], int]]`.'] +Line 95: Unexpected errors ['tuples_type_compat.py:95:12 Assert type [70]: Expected `Tuple[int]` but got `Union[Tuple[int], Tuple[str, str], typing.Tuple[int, *Tuple[str, ...], int]]`.'] +Line 99: Unexpected errors ['tuples_type_compat.py:99:12 Assert type [70]: Expected `Union[Tuple[int, int], Tuple[str, str]]` but got `Union[Tuple[int], Tuple[str, str], typing.Tuple[int, *Tuple[str, ...], int]]`.'] +Line 103: Unexpected errors ['tuples_type_compat.py:103:12 Assert type [70]: Expected `Tuple[int, str, int]` but got `Union[Tuple[int], Tuple[str, str], typing.Tuple[int, *Tuple[str, ...], int]]`.'] +Line 115: Unexpected errors ['tuples_type_compat.py:115:12 Assert type [70]: Expected `Tuple[Union[int, str], str]` but got `Tuple[Union[int, str], Union[int, str]]`.'] +Line 117: Unexpected errors ['tuples_type_compat.py:117:12 Assert type [70]: Expected `Tuple[Union[int, str], int]` but got `Tuple[Union[int, str], Union[int, str]]`.'] +Line 140: Unexpected errors ['tuples_type_compat.py:140:4 Assert type [70]: Expected `Sequence[Never]` but got `Sequence[Variable[T]]`.'] """ diff --git a/conformance/results/pyre/tuples_unpacked.toml b/conformance/results/pyre/tuples_unpacked.toml index 9e1dd53bd..b257b2595 100644 --- a/conformance/results/pyre/tuples_unpacked.toml +++ b/conformance/results/pyre/tuples_unpacked.toml @@ -1,34 +1,13 @@ -conformant = "Partial" +conformant = "Pass" notes = """ -Does not understand star syntax for `Unpack`. """ output = """ -tuples_unpacked.py:16:13 Invalid type [31]: Expression `tuple[(int, *tuple[(bool, bool)], str)]` is not a valid type. -tuples_unpacked.py:18:19 Invalid type [31]: Expression `tuple[(*tuple[(int, bool)], bool, str)]` is not a valid type. -tuples_unpacked.py:19:19 Invalid type [31]: Expression `tuple[(int, bool, *tuple[(bool, str)])]` is not a valid type. -tuples_unpacked.py:25:13 Invalid type [31]: Expression `tuple[(int, *tuple[(bool, ...)], str)]` is not a valid type. -tuples_unpacked.py:31:4 Invalid type [31]: Expression `tuple[(*tuple[int], *tuple[int])]` is not a valid type. -tuples_unpacked.py:33:4 Invalid type [31]: Expression `tuple[(*tuple[(int, ...)], *tuple[int])]` is not a valid type. -tuples_unpacked.py:38:4 Invalid type [31]: Expression `tuple[(*tuple[str], *tuple[str])]` is not a valid type. -tuples_unpacked.py:39:4 Invalid type [31]: Expression `tuple[(*tuple[(str, *tuple[(str, ...)])])]` is not a valid type. tuples_unpacked.py:40:4 Invalid type [31]: Expression `tuple[(*tuple[(str, ...)], *tuple[(int, ...)])]` is not a valid type. tuples_unpacked.py:41:4 Invalid type [31]: Expression `tuple[(*tuple[(str, *tuple[(str, ...)])], *tuple[(int, ...)])]` is not a valid type. -tuples_unpacked.py:49:13 Invalid type [31]: Expression `tuple[(*Ts)]` is not a valid type. -tuples_unpacked.py:50:8 Invalid type [31]: Expression `tuple[(*tuple[str], *Ts)]` is not a valid type. tuples_unpacked.py:51:8 Invalid type [31]: Expression `tuple[(*tuple[(str, ...)], *Ts)]` is not a valid type. tuples_unpacked.py:59:5 Invalid type [31]: Expression `tuple[(typing.Unpack[tuple[(str, ...)]], typing.Unpack[tuple[(int, ...)]])]` is not a valid type. tuples_unpacked.py:60:5 Invalid type [31]: Expression `tuple[(typing.Unpack[tuple[(str, typing.Unpack[tuple[(str, ...)]])]], typing.Unpack[tuple[(int, ...)]])]` is not a valid type. """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 16: Unexpected errors ['tuples_unpacked.py:16:13 Invalid type [31]: Expression `tuple[(int, *tuple[(bool, bool)], str)]` is not a valid type.'] -Line 18: Unexpected errors ['tuples_unpacked.py:18:19 Invalid type [31]: Expression `tuple[(*tuple[(int, bool)], bool, str)]` is not a valid type.'] -Line 19: Unexpected errors ['tuples_unpacked.py:19:19 Invalid type [31]: Expression `tuple[(int, bool, *tuple[(bool, str)])]` is not a valid type.'] -Line 25: Unexpected errors ['tuples_unpacked.py:25:13 Invalid type [31]: Expression `tuple[(int, *tuple[(bool, ...)], str)]` is not a valid type.'] -Line 31: Unexpected errors ['tuples_unpacked.py:31:4 Invalid type [31]: Expression `tuple[(*tuple[int], *tuple[int])]` is not a valid type.'] -Line 33: Unexpected errors ['tuples_unpacked.py:33:4 Invalid type [31]: Expression `tuple[(*tuple[(int, ...)], *tuple[int])]` is not a valid type.'] -Line 38: Unexpected errors ['tuples_unpacked.py:38:4 Invalid type [31]: Expression `tuple[(*tuple[str], *tuple[str])]` is not a valid type.'] -Line 39: Unexpected errors ['tuples_unpacked.py:39:4 Invalid type [31]: Expression `tuple[(*tuple[(str, *tuple[(str, ...)])])]` is not a valid type.'] -Line 49: Unexpected errors ['tuples_unpacked.py:49:13 Invalid type [31]: Expression `tuple[(*Ts)]` is not a valid type.'] -Line 50: Unexpected errors ['tuples_unpacked.py:50:8 Invalid type [31]: Expression `tuple[(*tuple[str], *Ts)]` is not a valid type.'] """ diff --git a/conformance/results/pyre/typeddicts_class_syntax.toml b/conformance/results/pyre/typeddicts_class_syntax.toml index 3bcd15206..ff3c7e5f8 100644 --- a/conformance/results/pyre/typeddicts_class_syntax.toml +++ b/conformance/results/pyre/typeddicts_class_syntax.toml @@ -6,7 +6,7 @@ Does not report when other keyword argument is provided. Does not support generic TypedDict class. """ output = """ -typeddicts_class_syntax.py:59:11 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Variable[T]`. To reference the type variable, you can modify the class to inherit from `typing.Generic[T]`. +typeddicts_class_syntax.py:49:0 Unexpected keyword [28]: Unexpected keyword argument `other` to call `object.__init_subclass__`. """ conformance_automated = "Fail" errors_diff = """ @@ -14,6 +14,4 @@ Line 29: Expected 1 errors Line 33: Expected 1 errors Line 38: Expected 1 errors Line 44: Expected 1 errors -Line 49: Expected 1 errors -Line 59: Unexpected errors ["typeddicts_class_syntax.py:59:11 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Variable[T]`. To reference the type variable, you can modify the class to inherit from `typing.Generic[T]`."] """ diff --git a/conformance/results/pyre/typeddicts_inheritance.toml b/conformance/results/pyre/typeddicts_inheritance.toml index 3e91f5b67..5ac846afe 100644 --- a/conformance/results/pyre/typeddicts_inheritance.toml +++ b/conformance/results/pyre/typeddicts_inheritance.toml @@ -1,12 +1,11 @@ -conformant = "Partial" +conformant = "Pass" notes = """ -Does not reject TypedDict class that inherits from non-TypedDict class. """ output = """ +typeddicts_inheritance.py:44:30 Invalid inheritance [39]: `NonTypedDict` is not a valid parent class for a typed dictionary. Expected a typed dictionary or typing.Generic. typeddicts_inheritance.py:54:0 Inconsistent override [15]: `x` overrides attribute defined in `X1` inconsistently. Type `int` is not a subtype of the overridden attribute `str`. typeddicts_inheritance.py:65:0 Invalid inheritance [39]: Field `x` has type `int` in base class `X2` and type `str` in base class `Y2`. """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 44: Expected 1 errors """ diff --git a/conformance/results/pyre/typeddicts_operations.toml b/conformance/results/pyre/typeddicts_operations.toml index 14ebfde95..e8b1cf658 100644 --- a/conformance/results/pyre/typeddicts_operations.toml +++ b/conformance/results/pyre/typeddicts_operations.toml @@ -1,6 +1,5 @@ -conformant = "Partial" +conformant = "Pass" notes = """ -Does not reject `del` of required key. """ output = """ typeddicts_operations.py:22:16 Invalid TypedDict operation [54]: Expected `str` to be assigned to `Movie` field `name` but got `int`. @@ -11,11 +10,10 @@ typeddicts_operations.py:28:8 TypedDict initialization error [55]: Missing requi typeddicts_operations.py:29:8 TypedDict initialization error [55]: Expected type `int` for `Movie` field `year` but got `float`. typeddicts_operations.py:32:8 TypedDict initialization error [55]: TypedDict `Movie` has no field `other`. typeddicts_operations.py:37:4 Incompatible variable type [9]: movie is declared to have type `Movie` but is used as type `Dict[str, Union[int, str]]`. -typeddicts_operations.py:44:10 TypedDict accessed with a missing key [27]: TypedDict `Movie` has no key `other`. typeddicts_operations.py:47:0 Undefined attribute [16]: `Movie` has no attribute `clear`. +typeddicts_operations.py:49:0 Invalid TypedDict operation [54]: Cannot delete required field `name` from TypedDict `Movie`. typeddicts_operations.py:62:0 Undefined attribute [16]: `MovieOptional` has no attribute `clear`. """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 49: Expected 1 errors """ diff --git a/conformance/results/pyre/typeddicts_readonly.toml b/conformance/results/pyre/typeddicts_readonly.toml index 70380b51f..2af32a98d 100644 --- a/conformance/results/pyre/typeddicts_readonly.toml +++ b/conformance/results/pyre/typeddicts_readonly.toml @@ -1,14 +1,12 @@ -conformant = "Unsupported" +conformant = "Pass" output = """ -typeddicts_readonly.py:18:13 Undefined or invalid type [11]: Annotation `ReadOnly` is not defined as a type. +typeddicts_readonly.py:24:16 Invalid TypedDict operation [54]: Cannot write to `Band` read-only field `members`. +typeddicts_readonly.py:36:16 Invalid TypedDict operation [54]: Cannot write to `Band2` read-only field `members`. +typeddicts_readonly.py:50:14 Invalid TypedDict operation [54]: Cannot write to `Movie1` read-only field `title`. +typeddicts_readonly.py:51:13 Invalid TypedDict operation [54]: Cannot write to `Movie1` read-only field `year`. +typeddicts_readonly.py:60:14 Invalid TypedDict operation [54]: Cannot write to `Movie2` read-only field `title`. +typeddicts_readonly.py:61:13 Invalid TypedDict operation [54]: Cannot write to `Movie2` read-only field `year`. """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 24: Expected 1 errors -Line 36: Expected 1 errors -Line 50: Expected 1 errors -Line 51: Expected 1 errors -Line 60: Expected 1 errors -Line 61: Expected 1 errors -Line 18: Unexpected errors ['typeddicts_readonly.py:18:13 Undefined or invalid type [11]: Annotation `ReadOnly` is not defined as a type.'] """ diff --git a/conformance/results/pyre/typeddicts_readonly_consistency.toml b/conformance/results/pyre/typeddicts_readonly_consistency.toml index a13a44a5c..21056412c 100644 --- a/conformance/results/pyre/typeddicts_readonly_consistency.toml +++ b/conformance/results/pyre/typeddicts_readonly_consistency.toml @@ -1,21 +1,13 @@ -conformant = "Unsupported" +conformant = "Pass" output = """ -typeddicts_readonly_consistency.py:30:7 Undefined or invalid type [11]: Annotation `ReadOnly` is not defined as a type. typeddicts_readonly_consistency.py:37:4 Incompatible variable type [9]: v3 is declared to have type `B1` but is used as type `A1`. typeddicts_readonly_consistency.py:38:4 Incompatible variable type [9]: v4 is declared to have type `B1` but is used as type `C1`. typeddicts_readonly_consistency.py:40:4 Incompatible variable type [9]: v5 is declared to have type `C1` but is used as type `A1`. -typeddicts_readonly_consistency.py:41:4 Incompatible variable type [9]: v6 is declared to have type `C1` but is used as type `B1`. -typeddicts_readonly_consistency.py:78:4 Incompatible variable type [9]: v1 is declared to have type `A2` but is used as type `B2`. -typeddicts_readonly_consistency.py:79:4 Incompatible variable type [9]: v2 is declared to have type `A2` but is used as type `C2`. typeddicts_readonly_consistency.py:81:4 Incompatible variable type [9]: v3 is declared to have type `B2` but is used as type `A2`. typeddicts_readonly_consistency.py:82:4 Incompatible variable type [9]: v4 is declared to have type `B2` but is used as type `C2`. typeddicts_readonly_consistency.py:84:4 Incompatible variable type [9]: v5 is declared to have type `C2` but is used as type `A2`. typeddicts_readonly_consistency.py:85:4 Incompatible variable type [9]: v6 is declared to have type `C2` but is used as type `B2`. """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 30: Unexpected errors ['typeddicts_readonly_consistency.py:30:7 Undefined or invalid type [11]: Annotation `ReadOnly` is not defined as a type.'] -Line 41: Unexpected errors ['typeddicts_readonly_consistency.py:41:4 Incompatible variable type [9]: v6 is declared to have type `C1` but is used as type `B1`.'] -Line 78: Unexpected errors ['typeddicts_readonly_consistency.py:78:4 Incompatible variable type [9]: v1 is declared to have type `A2` but is used as type `B2`.'] -Line 79: Unexpected errors ['typeddicts_readonly_consistency.py:79:4 Incompatible variable type [9]: v2 is declared to have type `A2` but is used as type `C2`.'] """ diff --git a/conformance/results/pyre/typeddicts_readonly_inheritance.toml b/conformance/results/pyre/typeddicts_readonly_inheritance.toml index 8bcacffd1..abf96bda2 100644 --- a/conformance/results/pyre/typeddicts_readonly_inheritance.toml +++ b/conformance/results/pyre/typeddicts_readonly_inheritance.toml @@ -1,27 +1,27 @@ conformant = "Unsupported" output = """ -typeddicts_readonly_inheritance.py:15:10 Undefined or invalid type [11]: Annotation `ReadOnly` is not defined as a type. -typeddicts_readonly_inheritance.py:18:0 Inconsistent override [15]: `name` overrides attribute defined in `NamedDict` inconsistently. Type `str` is not a subtype of the overridden attribute `unknown`. +typeddicts_readonly_inheritance.py:36:13 Invalid TypedDict operation [54]: Cannot write to `Album2` read-only field `name`. +typeddicts_readonly_inheritance.py:47:0 Inconsistent override [15]: `alt` overrides attribute defined in `AlbumCollection` inconsistently. Type `typing.List[str]` is not a subtype of the overridden attribute `typing.List[typing.Union[int, str]]`. typeddicts_readonly_inheritance.py:65:18 TypedDict initialization error [55]: Missing required field `name` for TypedDict `RequiredName`. -typeddicts_readonly_inheritance.py:75:0 Inconsistent override [15]: `ident` overrides attribute defined in `OptionalIdent` inconsistently. Type `str` is not a subtype of the overridden attribute `unknown`. typeddicts_readonly_inheritance.py:82:13 Invalid TypedDict operation [54]: Expected `str` to be assigned to `User` field `ident` but got `int`. typeddicts_readonly_inheritance.py:83:4 TypedDict initialization error [55]: Expected type `str` for `User` field `ident` but got `int`. typeddicts_readonly_inheritance.py:84:4 TypedDict initialization error [55]: Missing required field `ident` for TypedDict `User`. -typeddicts_readonly_inheritance.py:93:0 Inconsistent override [15]: `a` overrides attribute defined in `F1` inconsistently. Type `unknown` is not a subtype of the overridden attribute `int`. +typeddicts_readonly_inheritance.py:93:0 Inconsistent override [15]: `a` overrides attribute defined in `F1` inconsistently. Type `int` is not a subtype of the overridden attribute `int`. typeddicts_readonly_inheritance.py:97:0 Inconsistent override [15]: `a` overrides attribute defined in `F1` inconsistently. Type `int` is not a subtype of the overridden attribute `int`. +typeddicts_readonly_inheritance.py:105:0 Inconsistent override [15]: `c` overrides attribute defined in `F1` inconsistently. Type `int` is not a subtype of the overridden attribute `int`. typeddicts_readonly_inheritance.py:119:0 Invalid inheritance [39]: Field `x` has type `int` in base class `TD_A1` and type `float` in base class `TD_A2`. +typeddicts_readonly_inheritance.py:119:0 Invalid inheritance [39]: Field `y` has type `int` in base class `TD_A1` and type `float` in base class `TD_A2`. +typeddicts_readonly_inheritance.py:132:0 Invalid inheritance [39]: `y` is a required field in base class `TD_B1` and a non-required field in base class `TD_B2` (because of `total=False`). +typeddicts_readonly_inheritance.py:132:0 Invalid inheritance [39]: `x` is a required field in base class `TD_B2` and a non-required field in base class `TD_B1` (because of `total=False`). """ conformance_automated = "Fail" errors_diff = """ -Line 36: Expected 1 errors Line 50: Expected 1 errors Line 94: Expected 1 errors Line 98: Expected 1 errors Line 106: Expected 1 errors -Line 132: Expected 1 errors -Line 15: Unexpected errors ['typeddicts_readonly_inheritance.py:15:10 Undefined or invalid type [11]: Annotation `ReadOnly` is not defined as a type.'] -Line 18: Unexpected errors ['typeddicts_readonly_inheritance.py:18:0 Inconsistent override [15]: `name` overrides attribute defined in `NamedDict` inconsistently. Type `str` is not a subtype of the overridden attribute `unknown`.'] -Line 75: Unexpected errors ['typeddicts_readonly_inheritance.py:75:0 Inconsistent override [15]: `ident` overrides attribute defined in `OptionalIdent` inconsistently. Type `str` is not a subtype of the overridden attribute `unknown`.'] -Line 93: Unexpected errors ['typeddicts_readonly_inheritance.py:93:0 Inconsistent override [15]: `a` overrides attribute defined in `F1` inconsistently. Type `unknown` is not a subtype of the overridden attribute `int`.'] +Line 47: Unexpected errors ['typeddicts_readonly_inheritance.py:47:0 Inconsistent override [15]: `alt` overrides attribute defined in `AlbumCollection` inconsistently. Type `typing.List[str]` is not a subtype of the overridden attribute `typing.List[typing.Union[int, str]]`.'] +Line 93: Unexpected errors ['typeddicts_readonly_inheritance.py:93:0 Inconsistent override [15]: `a` overrides attribute defined in `F1` inconsistently. Type `int` is not a subtype of the overridden attribute `int`.'] Line 97: Unexpected errors ['typeddicts_readonly_inheritance.py:97:0 Inconsistent override [15]: `a` overrides attribute defined in `F1` inconsistently. Type `int` is not a subtype of the overridden attribute `int`.'] +Line 105: Unexpected errors ['typeddicts_readonly_inheritance.py:105:0 Inconsistent override [15]: `c` overrides attribute defined in `F1` inconsistently. Type `int` is not a subtype of the overridden attribute `int`.'] """ diff --git a/conformance/results/pyre/typeddicts_readonly_kwargs.toml b/conformance/results/pyre/typeddicts_readonly_kwargs.toml index 911a969a2..0f1dddfb2 100644 --- a/conformance/results/pyre/typeddicts_readonly_kwargs.toml +++ b/conformance/results/pyre/typeddicts_readonly_kwargs.toml @@ -1,11 +1,7 @@ -conformant = "Unsupported" +conformant = "Pass" output = """ -typeddicts_readonly_kwargs.py:24:10 Undefined or invalid type [11]: Annotation `ReadOnly` is not defined as a type. -typeddicts_readonly_kwargs.py:29:33 Undefined or invalid type [11]: Annotation `Unpack` is not defined as a type. +typeddicts_readonly_kwargs.py:33:21 Invalid TypedDict operation [54]: Cannot write to `ReadOnlyArgs` read-only field `key1`. """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 33: Expected 1 errors -Line 24: Unexpected errors ['typeddicts_readonly_kwargs.py:24:10 Undefined or invalid type [11]: Annotation `ReadOnly` is not defined as a type.'] -Line 29: Unexpected errors ['typeddicts_readonly_kwargs.py:29:33 Undefined or invalid type [11]: Annotation `Unpack` is not defined as a type.'] """ diff --git a/conformance/results/pyre/typeddicts_readonly_update.toml b/conformance/results/pyre/typeddicts_readonly_update.toml index 6f271f647..46846324a 100644 --- a/conformance/results/pyre/typeddicts_readonly_update.toml +++ b/conformance/results/pyre/typeddicts_readonly_update.toml @@ -1,11 +1,7 @@ -conformant = "Unsupported" +conformant = "Pass" output = """ -typeddicts_readonly_update.py:17:7 Undefined or invalid type [11]: Annotation `ReadOnly` is not defined as a type. -typeddicts_readonly_update.py:34:13 Incompatible parameter type [6]: In call `TypedDictionary.update`, for 1st positional argument, expected `A` but got `B`. +typeddicts_readonly_update.py:23:10 Incompatible parameter type [6]: In call `TypedDictionary.update`, for 1st positional argument, cannot update read-only fields of `A`. """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 23: Expected 1 errors -Line 17: Unexpected errors ['typeddicts_readonly_update.py:17:7 Undefined or invalid type [11]: Annotation `ReadOnly` is not defined as a type.'] -Line 34: Unexpected errors ['typeddicts_readonly_update.py:34:13 Incompatible parameter type [6]: In call `TypedDictionary.update`, for 1st positional argument, expected `A` but got `B`.'] """ diff --git a/conformance/results/pyre/typeddicts_required.toml b/conformance/results/pyre/typeddicts_required.toml index 2d84becd8..60e6c0ce5 100644 --- a/conformance/results/pyre/typeddicts_required.toml +++ b/conformance/results/pyre/typeddicts_required.toml @@ -8,8 +8,6 @@ Incorrectly generates "attribute not initialized" errors for TypedDict fields. """ output = """ typeddicts_required.py:15:8 Incompatible attribute type [8]: Attribute `x` declared in class `NotTypedDict` has type `Required[int]` but is used as type `int`. -typeddicts_required.py:74:62 Undefined or invalid type [11]: Annotation `RecursiveMovie` is not defined as a type. -typeddicts_required.py:77:24 TypedDict initialization error [55]: Expected type `unknown` for `RecursiveMovie` field `predecessor` but got `typing.Dict[str, str]`. """ conformance_automated = "Fail" errors_diff = """ @@ -18,6 +16,4 @@ Line 19: Expected 1 errors Line 62: Expected 1 errors Line 63: Expected 1 errors Line 15: Unexpected errors ['typeddicts_required.py:15:8 Incompatible attribute type [8]: Attribute `x` declared in class `NotTypedDict` has type `Required[int]` but is used as type `int`.'] -Line 74: Unexpected errors ['typeddicts_required.py:74:62 Undefined or invalid type [11]: Annotation `RecursiveMovie` is not defined as a type.'] -Line 77: Unexpected errors ['typeddicts_required.py:77:24 TypedDict initialization error [55]: Expected type `unknown` for `RecursiveMovie` field `predecessor` but got `typing.Dict[str, str]`.'] """ diff --git a/conformance/results/pyre/typeddicts_usage.toml b/conformance/results/pyre/typeddicts_usage.toml index 029675407..1699d6be3 100644 --- a/conformance/results/pyre/typeddicts_usage.toml +++ b/conformance/results/pyre/typeddicts_usage.toml @@ -1,4 +1,4 @@ -conformant = "Partial" +conformant = "Pass" notes = """ Does not report errant use of TypedDict in `isinstance` call. Does not reject use of TypedDict as TypeVar bound. @@ -7,9 +7,9 @@ output = """ typeddicts_usage.py:23:6 TypedDict accessed with a missing key [27]: TypedDict `Movie` has no key `director`. typeddicts_usage.py:24:16 Invalid TypedDict operation [54]: Expected `int` to be assigned to `Movie` field `year` but got `str`. typeddicts_usage.py:28:16 TypedDict initialization error [55]: Missing required field `name` for TypedDict `Movie`. +typeddicts_usage.py:35:21 TypedDict used in isinstance [71]: TypedDict classes may not be used for instance checks. +typeddicts_usage.py:40:0 Undefined or invalid type [11]: Annotation `TypedDict` is not defined as a type. """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 35: Expected 1 errors -Line 40: Expected 1 errors """ diff --git a/conformance/results/pyre/version.toml b/conformance/results/pyre/version.toml index 9b63b04fd..5c0e095c8 100644 --- a/conformance/results/pyre/version.toml +++ b/conformance/results/pyre/version.toml @@ -1,2 +1,3 @@ -version = "pyre 0.9.22" -test_duration = 6.5 +version = "pyre 0.9.23" +test_duration = 9.1 + diff --git a/conformance/results/pyright/version.toml b/conformance/results/pyright/version.toml index 9430b168b..6441c95a9 100644 --- a/conformance/results/pyright/version.toml +++ b/conformance/results/pyright/version.toml @@ -1,2 +1,3 @@ version = "pyright 1.1.386" -test_duration = 1.9 +test_duration = 2.0 + diff --git a/conformance/results/results.html b/conformance/results/results.html index 98e570341..724b351b9 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -159,13 +159,13 @@

    Python Type System Conformance Test Results

    - - + @@ -297,13 +297,13 @@

    Python Type System Conformance Test Results

    - + - + @@ -333,55 +333,55 @@

    Python Type System Conformance Test Results

    - + - + - + - + - + - + - + - + - + @@ -399,7 +399,7 @@

    Python Type System Conformance Test Results

    - + @@ -417,7 +417,7 @@

    Python Type System Conformance Test Results

    - + - + - + @@ -558,7 +558,7 @@

    Python Type System Conformance Test Results

    - + @@ -609,7 +609,7 @@

    Python Type System Conformance Test Results

    - + @@ -630,7 +630,7 @@

    Python Type System Conformance Test Results

    - + @@ -642,7 +642,7 @@

    Python Type System Conformance Test Results

    - + @@ -654,7 +654,7 @@

    Python Type System Conformance Test Results

    - + @@ -669,7 +669,7 @@

    Python Type System Conformance Test Results

    - + - + - + @@ -771,7 +771,7 @@

    Python Type System Conformance Test Results

    - + - + - + - + - + @@ -828,13 +828,13 @@

    Python Type System Conformance Test Results

    - + - + @@ -852,7 +852,7 @@

    Python Type System Conformance Test Results

    - + - + - + - + - + - + - + - + @@ -933,7 +933,7 @@

    Python Type System Conformance Test Results

    - + @@ -948,13 +948,13 @@

    Python Type System Conformance Test Results

    - + - + - + @@ -987,7 +987,7 @@

    Python Type System Conformance Test Results

    - + @@ -1005,7 +1005,7 @@

    Python Type System Conformance Test Results

    - + @@ -1017,7 +1017,7 @@

    Python Type System Conformance Test Results

    - + - +
     
    mypy 1.13.0
    -
    2.6sec
    +
    2.7sec
    pyright 1.1.386
    -
    1.9sec
    +
    2.0sec
    pyre 0.9.22
    -
    6.5sec
    +
    pyre 0.9.23
    +
    9.1sec
    pytype 2024.10.11
    50.2sec
    @@ -210,7 +210,7 @@

    Python Type System Conformance Test Results

         specialtypes_any Pass Pass
    Partial

    Does not support Any as a base class.

    Pass Pass
         specialtypes_never
         generics_scoping
    Partial

    False negative on generic class nested within generic class with same type variable.

    Pass
    Partial

    False negative on generic class nested within generic function with same type variable.

    False negative on generic class nested within generic class with same type variable.

    Partial

    False negative on generic class nested within generic function with same type variable.

    False negative on generic class nested within generic class with same type variable.

    False negative on assert_type uses.

    Partial

    Fails to reject type alias within generic class that uses class's type variable.

    Fails to reject unbound type variable in constructor call in global scope.

         generics_self_advanced
    Partial

    Does not infer the type of an unannotated `self` parameter to be type `Self`.

    Does not retain `Self` when calling method that returns `Self`.

    Does not infer the type of an unannotated `cls` parameter to be type `type[Self]`.

    Does not retain `Self` when accessing attribute through `type[Self]`.

    Pass
    Partial

    Does not handle use of `Self` within class body correctly.

    Partial

    Does not handle use of `Self` within class body correctly.

    False negatives on assert_type uses.

    Unsupported

    Does not understand `Self` type.

         generics_self_attributes
         generics_syntax_compatibility Pass Pass
    Unsupported

    Type parameter syntax not yet support.

    Partial

    False negative on mixing legacy and PEP695 syntax.

    Does not detect mixing legacy and PEP695 syntax in methods.

    Unsupported

    Type parameter syntax not yet support.

         generics_syntax_declarations Pass Pass
    Unsupported

    Type parameter syntax not yet support.

    Partial

    Does not detect incorrect use of legacy style syntax mixed with PEP695 syntax.

    False negatives due to assert_type use.

    Unsupported

    Type parameter syntax not yet support.

         generics_syntax_infer_variance
    Unsupported

    Type parameter syntax not yet support.

    Pass
    Unsupported

    Type parameter syntax not yet support.

    Partial

    Incorrectly determines that a class cannot be instantiated with __getitem__.

    Incorrectly handles mixing legacy and PEP695 syntax.

    Unsupported

    Type parameter syntax not yet support.

         generics_syntax_scoping
    Partial

    Does not following runtime scoping rules for type parameters in all cases.

    Pass
    Unsupported

    Type parameter syntax not yet support.

    Partial

    Does not properly handle mixing legacy syntax with PEP695 syntax.

    Unsupported

    Type parameter syntax not yet support.

         generics_type_erasure
    Partial

    Infers Node[Never] instead of Node[Any] when argument is not provided.

    False negative on instance attribute access on type(node).

    Pass
    Partial

    Does not erase unspecified type variables to `Any` prior to `assert_type` handling.

    False negatives on instance attribute access on the type.

    Does not infer type of `DefaultDict` with explicit type parameters on constructor.

    Partial

    Does not erase unspecified type variables to `Any` prior to `assert_type` handling.

    False negatives on instance attribute access on the type.

    Does not infer type of `DefaultDict` with explicit type parameters on constructor.

    False negatives on assert_type uses.

    Unsupported
         generics_typevartuple_args
    Partial

    Does not enforce that tuples captured by TypeVarTuple are same type.

    Pass
    Unsupported

    Does not support star expressions for `Unpack`.

    Partial

    Does not property handle TypeVarTuple.

    Unsupported

    Does not support TypeVarTuple.

         generics_typevartuple_basic
    Partial

    Does not enforce that tuples captured by TypeVarTuple are same length.

    Does not enforce that tuples captured by TypeVarTuple are same type.

    Pass
    Unsupported

    Does not support TypeVarTuple.

    Partial

    Does not support TypeVarTuple.

    False negatives due to assert_type.

    Unsupported

    Does not support TypeVarTuple.

         generics_typevartuple_callable Pass Pass
    Unsupported

    Does not support TypeVarTuple.

    Partial

    False negatives due to assert_type.

    Unsupported

    Does not support TypeVarTuple.

         generics_typevartuple_concat Pass Pass
    Unsupported

    Does not support TypeVarTuple.

    Partial

    False negatives due to assert_type.

    False compatability error message.

    Unsupported

    Does not support TypeVarTuple.

         generics_typevartuple_overloads
         generics_typevartuple_unpack Pass Pass
    Unsupported

    Does not support star expressions for `Unpack`.

    Pass
    Unsupported

    Does not support TypeVarTuple.

         generics_upper_bound
         generics_variance_inference Pass Pass
    Unsupported

    Type parameter syntax not yet support.

    Partial

    Does not properly handle mixing legacy and PEP695 syntax.

    False negative about a type variable not being present in the function's parameters.

    Unsupported

    Type parameter syntax not yet support.

    @@ -453,7 +453,7 @@

    Python Type System Conformance Test Results

         classes_override
    Partial

    Does not handle case where parent class derives from Any.

    Pass
    Partial

    Does not allow Any as a base class, leading to false positives.

    Pass
    Unsupported

    Does not yet support the @override decorator.

    @@ -486,7 +486,7 @@

    Python Type System Conformance Test Results

         aliases_type_statement
    Partial

    Does not reject type alias defined in function scope.

    Pass
    Unsupported

    Does not support `type` statement.

    Partial

    Does not complain when a type alias cannot be used as a base class.

    Does not complain when a type alias cannot be used as a function.

    Does not complain when a type statement definition combines new and old TypeVars.

    Does not complain when a type statement definition uses old TypeVars.

    Does not properly support recursive aliases.

    Unsupported

    Does not support `type` statement.

         aliases_typealiastype
         protocols_merging Pass Pass
    Partial

    Does not reject a protocol class that derives from a non-protocol class.

    Pass
    Partial

    Does not reject a protocol class that derives from a non-protocol class.

    Does not report attempt to instantiate abstract class downgraded from protocol class.

         protocols_modules
         callables_kwargs Pass Pass
    Unsupported

    Does not understand Unpack in the context of **kwargs annotation.

    Pass
    Unsupported

    Does not understand Unpack in the context of **kwargs annotation.

         callables_protocol
         constructors_call_init
    Partial

    Does not report errors during binding to self parameter of __init__ method.

    Does not reject use of class-scoped type variables in annotation of self parameter in __init__ method.

    Pass
    Partial

    Does not infer type of Self for self parameter of __init__ method.

    Does not report errors during binding to self parameter of __init__ method.

    Does not reject use of class-scoped type variables in annotation of self parameter in __init__ method.

    Partial

    Does not infer type of Self for self parameter of __init__ method.

    Does not report errors during binding to self parameter of __init__ method.

    Does not reject use of class-scoped type variables in annotation of self parameter in __init__ method.

    Incorrectly raises Incompatible overload type errors.

    Incorrectly raises compatibility type errors.

    Partial

    Does not report errors during binding to self parameter of __init__ method.

    Does not infer type of Self for self parameter of __init__ method.

    Rejects valid type annotation for self parameter in __init__ method.

    Does not support function-scoped TypeVars in self annotation in __init__ method.

    Does not reject use of class-scoped type variables in annotation of self parameter in __init__ method.

         constructors_call_metaclass
         constructors_call_new
    Partial

    Does not support __new__ return type that is not a subclass of the class being constructed.

    Does not skip evaluation of __init__ based on __new__ return type.

    Does not report errors during binding to cls parameter of __new__ method.

    Pass
    Partial

    Does not support __new__ return type that is not a subclass of the class being constructed.

    Does not report errors during binding to cls parameter of __new__ method.

    Partial

    Does not support __new__ return type that is not a subclass of the class being constructed.

    Does not report errors during binding to cls parameter of __new__ method.

    Incorrectly raises compatibility type errors.

    Partial

    Does not honor explicit specialization of generic class when used in constructor call.

    Does not support __new__ return type that is not a subclass of the class being constructed.

    Does not skip evaluation of __init__ based on __new__ return type.

         constructors_call_type
         constructors_callable
    Partial

    Does not generate a union type for __new__ and __init__ when converting class to callable.

    Does not ignore __init__ based on __new__ return type when converting class to callable.

    Does not support __new__ return type that is different from class being constructed.

    Pass
    Partial

    Does not generate a union type for __new__ and __init__ when converting class to callable.

    Does not ignore __init__ based on __new__ return type when converting class to callable.

    Does not support __new__ return type that is different from class being constructed.

    Does not use annotated type of self in __init__ method to generate return type of callable.

    Partial

    Does not generate a union type for __new__ and __init__ when converting class to callable.

    Does not ignore __init__ based on __new__ return type when converting class to callable.

    Does not support __new__ return type that is different from class being constructed.

    Does not use annotated type of self in __init__ method to generate return type of callable.

    Incorrectly raises incompatibility type errors.

    Partial

    Does not generate a union type for __new__ and __init__ when converting class to callable.

    Does not ignore __init__ based on __new__ return type when converting class to callable.

    Does not support __new__ return type that is different from class being constructed.

    Does not use annotated type of self in __init__ method to generate return type of callable.

         constructors_consistency
         overloads_basic Pass Pass
    Partial

    Does not reject a function with a single @overload signature.

    Pass
    Partial

    Does not reject a function with a single @overload signature.

    Does not reject a function with @overload signature but no implementation.

    @@ -678,7 +678,7 @@

    Python Type System Conformance Test Results

         exceptions_context_managers Pass Pass
    Unsupported

    Does not understand context manager exception rules.

    Partial

    assert_type causes failures.

    Unsupported

    Does not support code flow analysis.

    @@ -687,7 +687,7 @@

    Python Type System Conformance Test Results

         dataclasses_descriptors
    Partial

    Does not correctly evaluate type of descriptor access.

    Pass
    Partial

    Incorrectly generates error when calling constructor of dataclass with descriptor.

    Partial

    Incorrectly generates error when calling constructor of dataclass with descriptor.

    Incorrectly raises incompatibility type errors.

    Unsupported

    Does not understand descriptor objects in dataclass.

         dataclasses_final
         dataclasses_usage
    Pass*

    Does not detect unannotated usage of `dataclasses.field()`.

    Pass
    Partial

    Does not report error when field with no default follows field with default.

    Complains on `assert_type` when used for bound methods vs `Callable`.

    Does not understand `__dataclass_fields__`.

    Partial

    Does not report error when field with no default follows field with default.

    Complains on `assert_type` when used for bound methods vs `Callable`.

    Does not understand `__dataclass_fields__`.

    Incorrectly raises incompatibility type errors.

    Pass
    @@ -798,25 +798,25 @@

    Python Type System Conformance Test Results

         typeddicts_inheritance Pass Pass
    Partial

    Does not reject TypedDict class that inherits from non-TypedDict class.

    Pass Pass
         typeddicts_operations Pass Pass
    Partial

    Does not reject `del` of required key.

    Pass
    Partial

    Does not report type violation with TypedDict value assignment.

    Does not report reference to unknown key in TypedDict.

    Does not reject `clear` method on TypedDict with required keys.

    Does not reject delete operation for required key in TypedDict.

         typeddicts_readonly
    Partial

    Incorrectly rejects NotRequired directive when used in an Annotated annotation.

    PassUnsupportedPass Unsupported
         typeddicts_readonly_consistency
    Partial

    Incorrectly rejects assignment of required item to not-required read-only item.

    PassUnsupportedPass Unsupported
         typeddicts_readonly_inheritance
         typeddicts_readonly_kwargs Pass PassUnsupportedPass Unsupported
         typeddicts_readonly_update
    Partial

    Incorrectly allows update of ReadOnly item.

    Incorrectly rejects update involving an item with Never type.

    PassUnsupportedPass Unsupported
         typeddicts_required
         typeddicts_usage Pass Pass
    Partial

    Does not report errant use of TypedDict in `isinstance` call.

    Does not reject use of TypedDict as TypeVar bound.

    Pass*

    Does not report errant use of TypedDict in `isinstance` call.

    Does not reject use of TypedDict as TypeVar bound.

    Partial

    Does not report errant use of TypedDict in `isinstance` call.

    Does not reject use of TypedDict as TypeVar bound.

    @@ -873,7 +873,7 @@

    Python Type System Conformance Test Results

         tuples_unpacked
    Partial

    "More than one unpack" error is missing a line number.

    Pass
    Partial

    Does not understand star syntax for `Unpack`.

    Pass
    Unsupported

    Does not support `typing.Unpack`.

    Does not support unpacked tuples within a tuple type form.

    @@ -888,19 +888,19 @@

    Python Type System Conformance Test Results

         namedtuples_define_functional Pass Pass
    Partial

    Does not handle illegal named tuple names the same as runtime.

    Does not handle defined fields correctly when extra flags like `rename` or `default` are used.

    Does not support defaults in functional form.

    Pass
    Partial

    Does not handle illegal named tuple names the same as runtime.

    Does not support defaults in functional form.

         namedtuples_type_compat Pass Pass
    Unsupported

    Rejects valid type compatibility between named tuple and tuple.

    Pass Pass
         namedtuples_usage
    Partial

    Does not reject attempt to delete named tuple field by name.

    Pass
    Partial

    Does not report out-of-range index access with named tuple instance.

    Does not reject attempt to delete named tuple field by name.

    Does not reject attempt to delete named tuple field by index.

    Incorrectly handles subclasses of named tuples that add more attributes.

    Does not handle unpacking of named tuples.

    Partial
    Partial

    Incorrectly rejects valid index of named tuple instance when using a negative index.

    Does not report out-of-range index access with named tuple instance.

    Does not reject attempt to overwrite named tuple entry by name.

    Does not reject attempt to delete named tuple entry by name.

    @@ -909,19 +909,19 @@

    Python Type System Conformance Test Results

         enums_behaviors Pass Pass
    Partial

    Does not enforce that Enum classes are implicitly final.

    Pass
    Partial

    Does not enforce that Enum classes are implicitly final.

         enums_definition Pass Pass
    Partial

    Does not support custom Enum classes based on EnumType metaclass.

    Does not support some functional forms for Enum class definitions (optional).

    Pass
    Pass*

    Does not support some functional forms for Enum class definitions (optional).

         enums_expansion
    Partial

    Improperly applies narrowing to Flag subclass.

    Pass
    Pass*

    Does not perform type narrowing based on enum literal expansion (optional).

    Pass
    Partial

    Improperly applies narrowing to Flag subclass.

         enums_member_names
         enums_member_values
    Partial

    Does not enforce declared type of `_value_`.

    Does not enforce assigned tuple types for enum members (optional).

    Pass
    Partial

    Does not enforce declared type of `_value_`.

    Does not enforce assigned tuple types for enum members (optional).

    Does not evaluate literal types for enum member values (optional).

    Does not evaluate literal types for auto values (optional).

    Pass
    Partial

    Does not enforce declared type of `_value_`.

    Does not correctly enforce assigned tuple types for enum members (optional).

    Does not evaluate literal types for enum member values (optional).

    Does not evaluate literal types for auto values (optional).

         enums_members
         narrowing_typeguard Pass Pass
    Partial

    Does not reject TypeGuard method with too few parameters.

    Pass
    Partial

    Does not reject TypeGuard method with too few parameters.

         narrowing_typeis Pass PassUnsupportedPass
    Partial

    Does not narrow correctly on generic tuple type.

    Does not reject covariant use of TypeIs.

    Does not reject TypeIs where return type is not consistent with input type due to variance.

    @@ -963,7 +963,7 @@

    Python Type System Conformance Test Results

         directives_assert_type Pass Pass
    Pass*

    Does not weaken literal types in `assert_type`, which some (other) tests rely on.

    Pass
    Partial

    Incorrectly allows assert(x, int) where x is a Literal.

         directives_cast
         directives_reveal_type Pass Pass
    Partial

    Produces errors rather than warnings on `reveal_type`.

    Pass
    Partial

    Does not reject call to reveal_type with zero arguments.

    Does not reject call to reveal_type with too many arguments.

         directives_type_checking
         directives_type_ignore_file1 Pass Pass
    Unsupported

    Does not support file-level `#type: ignore` comment.

    Pass Pass
         directives_type_ignore_file2
         directives_version_platform
    Pass*

    Does not understand three-element form of sys.version checks.

    Does not understand os.name checks.

    Pass
    Partial

    Does not support sys.platform checks.

    Does not support os.name checks.

    Pass
    Pass*

    Does not understand three-element form of sys.version checks.

    Does not understand os.name checks.

    @@ -1026,7 +1026,7 @@

    Python Type System Conformance Test Results

         historical_positional
    Partial

    Does not reject positional-only parameter after non-positional-only parameter.

    Treats keyword-only parameter as positional-only.

    Applies legacy positional-only rules when PEP 570 syntax is used.

    Pass
    Partial

    Does not reject positional-only parameter after non-positional-only parameter.

    Incorrectly applies legacy positional-only rules when explicit *args are used.

    Incorrectly applies legacy positional-only rules when PEP 570 syntax is used.

    Pass
    Partial

    Does not apply rules for pre-3.8 positional-only parameters in some cases.

    Does not reject positional-only parameter after non-positional-only parameter.

    From a1d4d07f2ca6beb01a8db1b72f66120fc6ba33cb Mon Sep 17 00:00:00 2001 From: Shantanu <12621235+hauntsaninja@users.noreply.github.com> Date: Tue, 29 Oct 2024 17:20:15 -0700 Subject: [PATCH 060/308] Mention use of cast in enum type stub example (#1877) --- docs/spec/enums.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/spec/enums.rst b/docs/spec/enums.rst index a3fa1ccd8..fe38a358f 100644 --- a/docs/spec/enums.rst +++ b/docs/spec/enums.rst @@ -123,8 +123,9 @@ statically in cases where dynamic values are used. genus: str # Non-member attribute species: str # Non-member attribute - CAT = ... # Member attribute - DOG = ... # Member attribute + CAT = 1 # Member attribute with known value and type + DOG = cast(int, ...) # Member attribute with unknown value and known type + BIRD = ... # Member attribute with unknown value and type * Members defined within an enum class should not include explicit type annotations. Type checkers should infer a literal type for all members. From b2d1056de08823773a4dc0fa445c4bb2c087627c Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Mon, 11 Nov 2024 20:38:31 +0100 Subject: [PATCH 061/308] Tools can perform "some" refactorings (#1886) --- docs/guides/modernizing.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guides/modernizing.rst b/docs/guides/modernizing.rst index 279febd6a..2d17b6369 100644 --- a/docs/guides/modernizing.rst +++ b/docs/guides/modernizing.rst @@ -29,7 +29,7 @@ available using quoting. Tools such as `pyupgrade `__, `ruff `__ and/or `com2ann `__ can automatically perform - these refactorings for you. + some of these refactorings for you. .. note:: From 46b05a4c10ed3841c9bc5126ba9f31dd8ae061e7 Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Mon, 18 Nov 2024 13:10:13 +0100 Subject: [PATCH 062/308] Modernizing guide: Mention TypeGuard/TypeIs (#1887) --- docs/guides/modernizing.rst | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/guides/modernizing.rst b/docs/guides/modernizing.rst index 2d17b6369..a4eb3d5ac 100644 --- a/docs/guides/modernizing.rst +++ b/docs/guides/modernizing.rst @@ -341,3 +341,16 @@ Update your imports to use the new locations:: from collections.abc import Hashable, Sized def f(x: Hashable) -> Sized: ... + +``typing.TypeGuard`` +==================== + +*Available since:* Python 3.13, typing-extensions + +:data:`TypeIs ` is an alternative to +:data:`TypeGuard ` that usually has more intuitive +behavior, but has other restrictions. See the documentation for +:data:`TypeIs ` for more information. + +Review existing uses of :data:`TypeGuard ` to see if they +should be replaced with :data:`TypeIs `. From 438dc29b11d03ed446209a5f156684b6084fc1ec Mon Sep 17 00:00:00 2001 From: Rebecca Chen Date: Tue, 26 Nov 2024 17:36:17 -0800 Subject: [PATCH 063/308] Clarify some behavior around user-defined generic classes (#1879) * Update generics.rst * Update protocol.rst * Address reviewer comments. * Fix silly typo * English * Incorporate additional rules suggested by @erictraut. * Mandate error on inconsistent type variable order. * Mention inheriting from a generic in ways to define a class as generic. --- docs/spec/generics.rst | 103 ++++++++++++++++++++++++++++++++++------- docs/spec/protocol.rst | 11 ++++- 2 files changed, 95 insertions(+), 19 deletions(-) diff --git a/docs/spec/generics.rst b/docs/spec/generics.rst index 2cb3f6f65..c7a61594a 100644 --- a/docs/spec/generics.rst +++ b/docs/spec/generics.rst @@ -93,8 +93,16 @@ This is equivalent to omitting the generic notation and just saying User-defined generic types -------------------------- -You can include a ``Generic`` base class to define a user-defined class -as generic. Example:: +There are several ways to define a user-defined class as generic: + +* Include a ``Generic`` base class. +* Use the new generic class syntax in Python 3.12 and higher. +* Include a `` Protocol`` base class parameterized with type variables. This + approach also marks the class as a protocol - see + :ref:`generic protocols` for more information. +* Include a generic base class parameterized with type variables. + +Example using ``Generic``:: from typing import TypeVar, Generic from logging import Logger @@ -118,14 +126,14 @@ as generic. Example:: def log(self, message: str) -> None: self.logger.info('{}: {}'.format(self.name, message)) -Or, in Python 3.12 and higher, by using the new syntax for generic -classes:: +Or, using the new generic class syntax:: class LoggedVar[T]: # methods as in previous example -This implicitly adds ``Generic[T]`` as a base class and type checkers -should treat the two largely equivalently (except for variance, see below). +This implicitly adds ``Generic[T]`` as a base class, and type checkers +should treat the two definitions of ``LoggedVar`` largely equivalently (except +for variance, see below). ``Generic[T]`` as a base class defines that the class ``LoggedVar`` takes a single type parameter ``T``. This also makes ``T`` valid as @@ -144,7 +152,6 @@ A generic type can have any number of type variables, and type variables may be constrained. This is valid:: from typing import TypeVar, Generic - ... T = TypeVar('T') S = TypeVar('S') @@ -156,29 +163,52 @@ Each type variable argument to ``Generic`` must be distinct. This is thus invalid:: from typing import TypeVar, Generic - ... T = TypeVar('T') class Pair(Generic[T, T]): # INVALID ... -The ``Generic[T]`` base class is redundant in simple cases where you -subclass some other generic class and specify type variables for its -parameters:: +All arguments to ``Generic`` or ``Protocol`` must be type variables:: - from typing import TypeVar - from collections.abc import Iterator + from typing import Generic, Protocol + + class Bad1(Generic[int]): # INVALID + ... + class Bad2(Protocol[int]): # INVALID + ... + +When a ``Generic`` or parameterized ``Protocol`` base class is present, all type +parameters for the class must appear within the ``Generic`` or +``Protocol`` type argument list, respectively. A type checker should report an +error if a type variable that is not included in the type argument list appears +elsewhere in the base class list:: + + from typing import Generic, Protocol, TypeVar + from collections.abc import Iterable T = TypeVar('T') + S = TypeVar('S') - class MyIter(Iterator[T]): + class Bad1(Iterable[T], Generic[S]): # INVALID + ... + class Bad2(Iterable[T], Protocol[S]): # INVALID ... -That class definition is equivalent to:: +Note that the above rule does not apply to a bare ``Protocol`` base class. This +is valid (see below):: - class MyIter(Iterator[T], Generic[T]): - ... + from typing import Protocol, TypeVar + from collections.abc import Iterator + + T = TypeVar('T') + + class MyIterator(Iterator[T], Protocol): ... + +When no ``Generic`` or parameterized ``Protocol`` base class is present, a +defined class is generic if you subclass one or more other generic classes and +specify type variables for their parameters. See :ref:`generic-base-classes` +for details. You can use multiple inheritance with ``Generic``:: @@ -402,6 +432,7 @@ instead is preferred. (First, creating the subscripted class, e.g. ``Node[int]``, has a runtime cost. Second, using a type alias is more readable.) +.. _`generic-base-classes`: Arbitrary generic types as base classes --------------------------------------- @@ -458,8 +489,44 @@ Also consider the following example:: class MyDict(Mapping[str, T]): ... -In this case MyDict has a single parameter, T. +In this case ``MyDict`` has a single type parameter, ``T``. + +Type variables are applied to the defined class in the order in which +they first appear in any generic base classes:: + + from typing import Generic, TypeVar + + T1 = TypeVar('T1') + T2 = TypeVar('T2') + T3 = TypeVar('T3') + + class Parent1(Generic[T1, T2]): + ... + class Parent2(Generic[T1, T2]): + ... + class Child(Parent1[T1, T3], Parent2[T2, T3]): + ... + +That ``Child`` definition is equivalent to:: + class Child(Parent1[T1, T3], Parent2[T2, T3], Generic[T1, T3, T2]): + ... + +A type checker should report an error when the type variable order is +inconsistent:: + + from typing import Generic, TypeVar + + T1 = TypeVar('T1') + T2 = TypeVar('T2') + T3 = TypeVar('T3') + + class Grandparent(Generic[T1, T2]): + ... + class Parent(Grandparent[T1, T2]): + ... + class Child(Parent[T1, T2], Grandparent[T2, T1]): # INVALID + ... Abstract generic types ---------------------- diff --git a/docs/spec/protocol.rst b/docs/spec/protocol.rst index e280f0edb..50b64f372 100644 --- a/docs/spec/protocol.rst +++ b/docs/spec/protocol.rst @@ -257,6 +257,7 @@ from regular ABCs, where abstractness is simply defined by having at least one abstract method being unimplemented. Protocol classes must be marked *explicitly*. +.. _`generic-protocols`: Generic protocols ^^^^^^^^^^^^^^^^^ @@ -271,7 +272,15 @@ non-protocol generic types:: ... ``Protocol[T, S, ...]`` is allowed as a shorthand for -``Protocol, Generic[T, S, ...]``. +``Protocol, Generic[T, S, ...]``. It is an error to combine +``Protocol[T, S, ...]`` with ``Generic[T, S, ...]``, or with the new syntax for +generic classes in Python 3.12 and above:: + + class Iterable(Protocol[T], Generic[T]): # INVALID + ... + + class Iterable[T](Protocol[T]): # INVALID + ... User-defined generic protocols support explicitly declared variance. Type checkers will warn if the inferred variance is different from From cbedd6df4e89b92863e5534da6ea2aa9e6bb8f61 Mon Sep 17 00:00:00 2001 From: Rebecca Chen Date: Mon, 2 Dec 2024 20:36:57 -0800 Subject: [PATCH 064/308] Update conformance tests for recent generics spec change (#1892) * Baseline changes * New test cases for generics_base_class. * New test cases in generics_basic. --- .../results/mypy/generics_base_class.toml | 8 +++-- conformance/results/mypy/generics_basic.toml | 12 ++++--- conformance/results/mypy/version.toml | 2 +- .../results/pyre/generics_base_class.toml | 2 ++ conformance/results/pyre/generics_basic.toml | 7 +++- conformance/results/pyre/version.toml | 3 +- .../dataclasses_transform_converter.toml | 2 +- .../results/pyright/generics_base_class.toml | 2 ++ .../results/pyright/generics_basic.toml | 8 ++++- .../results/pyright/overloads_basic.toml | 4 +-- .../pyright/protocols_class_objects.toml | 4 +-- .../results/pyright/specialtypes_none.toml | 2 +- conformance/results/pyright/version.toml | 5 ++- .../results/pytype/generics_base_class.toml | 18 +++++++++++ .../results/pytype/generics_basic.toml | 32 +++++++++++++++++-- conformance/results/pytype/version.toml | 2 +- conformance/results/results.html | 20 ++++++------ conformance/tests/generics_base_class.py | 25 +++++++++++++++ conformance/tests/generics_basic.py | 19 ++++++++++- 19 files changed, 142 insertions(+), 35 deletions(-) diff --git a/conformance/results/mypy/generics_base_class.toml b/conformance/results/mypy/generics_base_class.toml index 7d1dbad82..a0c547eeb 100644 --- a/conformance/results/mypy/generics_base_class.toml +++ b/conformance/results/mypy/generics_base_class.toml @@ -1,4 +1,7 @@ -conformant = "Pass" +conformant = "Partial" +notes = """ +Does not detect inconsistent type variable ordering. +""" output = """ generics_base_class.py:26: error: Argument 1 to "takes_dict_incorrect" has incompatible type "SymbolTable"; expected "dict[str, list[object]]" [arg-type] generics_base_class.py:29: error: Variable "typing.Generic" is not valid as a type [valid-type] @@ -9,6 +12,7 @@ generics_base_class.py:49: error: "LinkedList" expects 1 type argument, but 2 gi generics_base_class.py:61: error: "MyDict" expects 1 type argument, but 2 given [type-arg] generics_base_class.py:68: error: Duplicate type variables in Generic[...] or Protocol[...] [misc] """ -conformance_automated = "Pass" +conformance_automated = "Fail" errors_diff = """ +Line 98: Expected 1 errors """ diff --git a/conformance/results/mypy/generics_basic.toml b/conformance/results/mypy/generics_basic.toml index 00c824401..78cbd2ee3 100644 --- a/conformance/results/mypy/generics_basic.toml +++ b/conformance/results/mypy/generics_basic.toml @@ -10,10 +10,14 @@ generics_basic.py:69: error: Value of type variable "AnyStr" of "concat" cannot generics_basic.py:121: error: Duplicate type variables in Generic[...] or Protocol[...] [misc] generics_basic.py:157: error: Invalid index type "int" for "MyMap1[str, int]"; expected type "str" [index] generics_basic.py:158: error: Invalid index type "int" for "MyMap2[int, str]"; expected type "str" [index] -generics_basic.py:191: error: Dynamic metaclass not supported for "GenericMetaInstance" [misc] -generics_basic.py:191: error: Type variable "generics_basic.T" is unbound [valid-type] -generics_basic.py:191: note: (Hint: Use "Generic[T]" or "Protocol[T]" base class to bind "T" inside a class) -generics_basic.py:191: note: (Hint: Use "T" in function signature to bind "T" inside a function) +generics_basic.py:162: error: Free type variable expected in Generic[...] [misc] +generics_basic.py:163: error: Free type variable expected in Protocol[...] [misc] +generics_basic.py:171: error: If Generic[...] or Protocol[...] is present it should list all type variables [misc] +generics_basic.py:172: error: If Generic[...] or Protocol[...] is present it should list all type variables [misc] +generics_basic.py:208: error: Dynamic metaclass not supported for "GenericMetaInstance" [misc] +generics_basic.py:208: error: Type variable "generics_basic.T" is unbound [valid-type] +generics_basic.py:208: note: (Hint: Use "Generic[T]" or "Protocol[T]" base class to bind "T" inside a class) +generics_basic.py:208: note: (Hint: Use "T" in function signature to bind "T" inside a function) """ conformance_automated = "Fail" errors_diff = """ diff --git a/conformance/results/mypy/version.toml b/conformance/results/mypy/version.toml index bdefc8cfd..c328270ab 100644 --- a/conformance/results/mypy/version.toml +++ b/conformance/results/mypy/version.toml @@ -1,2 +1,2 @@ version = "mypy 1.13.0" -test_duration = 2.7 +test_duration = 2.5 diff --git a/conformance/results/pyre/generics_base_class.toml b/conformance/results/pyre/generics_base_class.toml index 0e50c8f7e..3cac3f43f 100644 --- a/conformance/results/pyre/generics_base_class.toml +++ b/conformance/results/pyre/generics_base_class.toml @@ -2,6 +2,7 @@ conformant = "Partial" notes = """ Does not reject illegal use of Generic. Does not allow using generic in assert_type expression. +Does not detect inconsistent type variable ordering. """ output = """ generics_base_class.py:26:25 Incompatible parameter type [6]: In call `takes_dict_incorrect`, for 1st positional argument, expected `Dict[str, List[object]]` but got `SymbolTable`. @@ -13,4 +14,5 @@ conformance_automated = "Fail" errors_diff = """ Line 29: Expected 1 errors Line 30: Expected 1 errors +Line 98: Expected 1 errors """ diff --git a/conformance/results/pyre/generics_basic.toml b/conformance/results/pyre/generics_basic.toml index 0b3d5e6d6..2aab00599 100644 --- a/conformance/results/pyre/generics_basic.toml +++ b/conformance/results/pyre/generics_basic.toml @@ -4,6 +4,7 @@ False positives in examples using constrained type variables. False negative for constraint parameterized by a type variable. False negative in custom map example. False positive using `iter`. +False negative for bad type arguments to Generic/Protocol. False negative for generic metaclass. """ output = """ @@ -16,10 +17,14 @@ generics_basic.py:69:14 Incompatible parameter type [6]: In call `concat`, for 2 generics_basic.py:121:0 Duplicate type variables [59]: Duplicate type variable `T` in Generic[...]. generics_basic.py:157:7 Incompatible parameter type [6]: In call `typing.Mapping.__getitem__`, for 1st positional argument, expected `str` but got `int`. generics_basic.py:158:7 Incompatible parameter type [6]: In call `typing.Mapping.__getitem__`, for 1st positional argument, expected `str` but got `int`. +generics_basic.py:171:11 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Variable[T_co]`. To reference the type variable, you can modify the class to inherit from `typing.Generic[T_co]`. +generics_basic.py:172:11 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Variable[T_co]`. To reference the type variable, you can modify the class to inherit from `typing.Generic[T_co]`. """ conformance_automated = "Fail" errors_diff = """ Line 55: Expected 1 errors -Line 191: Expected 1 errors +Line 162: Expected 1 errors +Line 163: Expected 1 errors +Line 208: Expected 1 errors Line 34: Unexpected errors ['generics_basic.py:34:4 Incompatible return type [7]: Expected `Variable[AnyStr <: [str, bytes]]` but got `str`.', 'generics_basic.py:34:15 Incompatible parameter type [6]: In call `str.__add__`, for 1st positional argument, expected `str` but got `Variable[AnyStr <: [str, bytes]]`.'] """ diff --git a/conformance/results/pyre/version.toml b/conformance/results/pyre/version.toml index 5c0e095c8..3ed7e73c7 100644 --- a/conformance/results/pyre/version.toml +++ b/conformance/results/pyre/version.toml @@ -1,3 +1,2 @@ version = "pyre 0.9.23" -test_duration = 9.1 - +test_duration = 4.3 diff --git a/conformance/results/pyright/dataclasses_transform_converter.toml b/conformance/results/pyright/dataclasses_transform_converter.toml index 479f0d759..ec7db74cb 100644 --- a/conformance/results/pyright/dataclasses_transform_converter.toml +++ b/conformance/results/pyright/dataclasses_transform_converter.toml @@ -40,5 +40,5 @@ dataclasses_transform_converter.py:130:67 - error: Argument of type "Literal[1]" dataclasses_transform_converter.py:133:75 - error: Argument of type "type[int]" cannot be assigned to parameter "default_factory" of type "(() -> S@model_field) | None" in function "model_field"   Type "type[int]" is not assignable to type "(() -> str) | None"     No overloaded function matches type "() -> str" -    "type[type]" is not assignable to "type[None]" (reportArgumentType) +    Type is not assignable to "None" (reportArgumentType) """ diff --git a/conformance/results/pyright/generics_base_class.toml b/conformance/results/pyright/generics_base_class.toml index fa4abde3d..e39db1ee5 100644 --- a/conformance/results/pyright/generics_base_class.toml +++ b/conformance/results/pyright/generics_base_class.toml @@ -10,6 +10,8 @@ generics_base_class.py:30:8 - error: "Generic" is not valid in this context (rep generics_base_class.py:49:38 - error: Too many type arguments provided for "LinkedList"; expected 1 but received 2 (reportInvalidTypeArguments) generics_base_class.py:61:30 - error: Too many type arguments provided for "MyDict"; expected 1 but received 2 (reportInvalidTypeArguments) generics_base_class.py:68:28 - error: Type arguments for "Generic" must be unique (reportInvalidTypeForm) +generics_base_class.py:98:7 - error: Base classes of BadChild are mutually incompatible +  Base class "Grandparent[T2@BadChild, T1@BadChild]" derives from "Grandparent[T2@BadChild, T1@BadChild]" which is incompatible with type "Grandparent[T1@BadChild, T2@BadChild]" (reportGeneralTypeIssues) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/generics_basic.toml b/conformance/results/pyright/generics_basic.toml index 290ffe414..8b77d57f4 100644 --- a/conformance/results/pyright/generics_basic.toml +++ b/conformance/results/pyright/generics_basic.toml @@ -13,7 +13,13 @@ generics_basic.py:157:5 - error: Argument of type "Literal[0]" cannot be assigne   "Literal[0]" is not assignable to "str" (reportArgumentType) generics_basic.py:158:5 - error: Argument of type "Literal[0]" cannot be assigned to parameter "key" of type "str" in function "__getitem__"   "Literal[0]" is not assignable to "str" (reportArgumentType) -generics_basic.py:191:37 - error: Metaclass cannot be generic (reportGeneralTypeIssues) +generics_basic.py:162:20 - error: Type argument for "Generic" must be a type variable (reportInvalidTypeForm) +generics_basic.py:163:21 - error: Type argument for "Protocol" must be a type parameter (reportInvalidTypeForm) +generics_basic.py:171:7 - error: Generic[] or Protocol[] must include all type variables +  Missing type variables: "T_co" (reportGeneralTypeIssues) +generics_basic.py:172:7 - error: Generic[] or Protocol[] must include all type variables +  Missing type variables: "T_co" (reportGeneralTypeIssues) +generics_basic.py:208:37 - error: Metaclass cannot be generic (reportGeneralTypeIssues) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/overloads_basic.toml b/conformance/results/pyright/overloads_basic.toml index b4148bcc8..5171f52e2 100644 --- a/conformance/results/pyright/overloads_basic.toml +++ b/conformance/results/pyright/overloads_basic.toml @@ -1,8 +1,8 @@ conformant = "Pass" output = """ overloads_basic.py:37:1 - error: No overloads for "__getitem__" match the provided arguments (reportCallIssue) -overloads_basic.py:37:1 - error: Argument of type "Literal['']" cannot be assigned to parameter "__s" of type "slice" in function "__getitem__" -  "Literal['']" is not assignable to "slice" (reportArgumentType) +overloads_basic.py:37:1 - error: Argument of type "Literal['']" cannot be assigned to parameter "__s" of type "slice[Any, Any, Any]" in function "__getitem__" +  "Literal['']" is not assignable to "slice[Any, Any, Any]" (reportArgumentType) overloads_basic.py:63:5 - error: "func1" is marked as overload, but additional overloads are missing (reportInconsistentOverload) overloads_basic.py:75:5 - error: "func2" is marked as overload, but no implementation is provided (reportNoOverloadImplementation) """ diff --git a/conformance/results/pyright/protocols_class_objects.toml b/conformance/results/pyright/protocols_class_objects.toml index 2c3bfe0f6..f68c71e6d 100644 --- a/conformance/results/pyright/protocols_class_objects.toml +++ b/conformance/results/pyright/protocols_class_objects.toml @@ -5,8 +5,8 @@ protocols_class_objects.py:29:5 - error: Argument of type "type[Proto]" cannot b protocols_class_objects.py:34:7 - error: Type "type[Proto]" is not assignable to declared type "type[Proto]"   "Proto" is not a concrete class type and cannot be assigned to type "type[Proto]" (reportAssignmentType) protocols_class_objects.py:58:16 - error: Type "type[ConcreteA]" is not assignable to declared type "ProtoA1" -  "type[type]" is not assignable to "type[ConcreteA]" -  "type[type]" is not assignable to "type[ConcreteA]" +  Type "type[ConcreteA]" is not assignable to type "ConcreteA" +  Type "type[ConcreteA]" is not assignable to type "ConcreteA"   "method1" is an incompatible type     Type "(self: ConcreteA, x: int) -> int" is not assignable to type "(x: int) -> int"       Parameter name mismatch: "x" versus "self" diff --git a/conformance/results/pyright/specialtypes_none.toml b/conformance/results/pyright/specialtypes_none.toml index 94561c886..5bfb2d37d 100644 --- a/conformance/results/pyright/specialtypes_none.toml +++ b/conformance/results/pyright/specialtypes_none.toml @@ -1,7 +1,7 @@ conformant = "Pass" output = """ specialtypes_none.py:21:7 - error: Argument of type "type[None]" cannot be assigned to parameter "val1" of type "None" in function "func1" -  "type[type]" is not assignable to "type[None]" (reportArgumentType) +  Type is not assignable to "None" (reportArgumentType) specialtypes_none.py:27:19 - error: Type "None" is not assignable to declared type "Iterable[Unknown]"   "None" is incompatible with protocol "Iterable[Unknown]"     "__iter__" is not present (reportAssignmentType) diff --git a/conformance/results/pyright/version.toml b/conformance/results/pyright/version.toml index 6441c95a9..6269389b2 100644 --- a/conformance/results/pyright/version.toml +++ b/conformance/results/pyright/version.toml @@ -1,3 +1,2 @@ -version = "pyright 1.1.386" -test_duration = 2.0 - +version = "pyright 1.1.389" +test_duration = 2.5 diff --git a/conformance/results/pytype/generics_base_class.toml b/conformance/results/pytype/generics_base_class.toml index 096f7d009..a3aa1cea9 100644 --- a/conformance/results/pytype/generics_base_class.toml +++ b/conformance/results/pytype/generics_base_class.toml @@ -2,6 +2,7 @@ conformant = "Partial" notes = """ False negative on passing SymbolTable to dict[str, list[object]]. Does not reject illegal use of Generic. +Wrong type variable order when inheriting from multiple generic base classes. """ output = """ generics_base_class.py:29:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'T' [invalid-annotation] @@ -26,9 +27,26 @@ generics_base_class.py:68:17: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function takes_parent1 was called with the wrong arguments [wrong-arg-types] + +takes_parent1(child) # OK +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_base_class.py:91:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function takes_parent2 was called with the wrong arguments [wrong-arg-types] + +takes_parent2(child) # OK +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_base_class.py:98:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'BadChild' [invalid-annotation] + +class BadChild(Parent[T1, T2], Grandparent[T2, T1]): ... # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ Line 26: Expected 1 errors Line 30: Expected 1 errors +Line 90: Unexpected errors ['generics_base_class.py:90:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function takes_parent1 was called with the wrong arguments [wrong-arg-types]'] +Line 91: Unexpected errors ['generics_base_class.py:91:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function takes_parent2 was called with the wrong arguments [wrong-arg-types]'] """ diff --git a/conformance/results/pytype/generics_basic.toml b/conformance/results/pytype/generics_basic.toml index 5ab2769bc..db7695d22 100644 --- a/conformance/results/pytype/generics_basic.toml +++ b/conformance/results/pytype/generics_basic.toml @@ -1,6 +1,8 @@ conformant = "Partial" notes = """ False positives in examples using constrained type variables. +Argument 'covariant' to TypeVar not supported. +False negative for type variables missing from Generic/Protocol base class. False negative for generic metaclass. """ output = """ @@ -66,7 +68,27 @@ generics_basic.py:158:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in test_my m2[0] # E \u001b[1m\u001b[31m~~~~~\u001b[39m\u001b[0m -generics_basic.py:182:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in test_my_iterable_any: Iterator[nothing] [assert-type] +generics_basic.py:162:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class Bad1(Generic[int]): ... # E + \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_basic.py:163:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Protocol' [invalid-annotation] + +class Bad2(Protocol[int]): ... # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_basic.py:168:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet] + +T_co = TypeVar("T_co", covariant=True) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_basic.py:169:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet] + +S_co = TypeVar("S_co", covariant=True) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_basic.py:199:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in test_my_iterable_any: Iterator[nothing] [assert-type] assert_type(iter(m), Iterator[Any]) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -74,9 +96,13 @@ generics_basic.py:182:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in test_my """ conformance_automated = "Fail" errors_diff = """ -Line 191: Expected 1 errors +Line 171: Expected 1 errors +Line 172: Expected 1 errors +Line 208: Expected 1 errors Line 34: Unexpected errors ['generics_basic.py:34:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in concat: bad return type [bad-return-type]'] Line 67: Unexpected errors ['generics_basic.py:67:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in test_concat_subtype: MyStr [assert-type]'] Line 68: Unexpected errors ['generics_basic.py:68:17: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in test_concat_subtype: Function concat was called with the wrong arguments [wrong-arg-types]', 'generics_basic.py:68:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in test_concat_subtype: Any [assert-type]'] -Line 182: Unexpected errors ['generics_basic.py:182:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in test_my_iterable_any: Iterator[nothing] [assert-type]'] +Line 168: Unexpected errors ['generics_basic.py:168:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] +Line 169: Unexpected errors ['generics_basic.py:169:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] +Line 199: Unexpected errors ['generics_basic.py:199:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in test_my_iterable_any: Iterator[nothing] [assert-type]'] """ diff --git a/conformance/results/pytype/version.toml b/conformance/results/pytype/version.toml index 47fa98ffe..d7a8701eb 100644 --- a/conformance/results/pytype/version.toml +++ b/conformance/results/pytype/version.toml @@ -1,2 +1,2 @@ version = "pytype 2024.10.11" -test_duration = 50.2 +test_duration = 45.2 diff --git a/conformance/results/results.html b/conformance/results/results.html index 724b351b9..26eb1c70e 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -159,16 +159,16 @@

    Python Type System Conformance Test Results

    - + - - - + + - - + + diff --git a/conformance/tests/generics_base_class.py b/conformance/tests/generics_base_class.py index bfcb63476..61de59455 100644 --- a/conformance/tests/generics_base_class.py +++ b/conformance/tests/generics_base_class.py @@ -71,3 +71,28 @@ class BadClass1(Generic[T, T]): # E class GoodClass1(dict[T, T]): # OK pass + +# > Type variables are applied to the defined class in the order in which +# > they first appear in any generic base classes. + +T1 = TypeVar("T1") +T2 = TypeVar("T2") +T3 = TypeVar("T3") + +class Parent1(Generic[T1, T2]): ... +class Parent2(Generic[T1, T2]): ... +class Child(Parent1[T1, T3], Parent2[T2, T3]): ... + +def takes_parent1(x: Parent1[int, bytes]): ... +def takes_parent2(x: Parent2[str, bytes]): ... + +child: Child[int, bytes, str] = Child() +takes_parent1(child) # OK +takes_parent2(child) # OK + +# > A type checker should report an error when the type variable order is +# > inconsistent. + +class Grandparent(Generic[T1, T2]): ... +class Parent(Grandparent[T1, T2]): ... +class BadChild(Parent[T1, T2], Grandparent[T2, T1]): ... # E diff --git a/conformance/tests/generics_basic.py b/conformance/tests/generics_basic.py index 0a35336bd..179d84758 100644 --- a/conformance/tests/generics_basic.py +++ b/conformance/tests/generics_basic.py @@ -7,7 +7,7 @@ from __future__ import annotations from collections.abc import Sequence -from typing import Any, Generic, TypeVar, assert_type +from typing import Any, Generic, Protocol, TypeVar, assert_type T = TypeVar("T") @@ -157,6 +157,23 @@ def test_my_map(m1: MyMap1[str, int], m2: MyMap2[int, str]): m1[0] # E m2[0] # E +# > All arguments to ``Generic`` or ``Protocol`` must be type variables. + +class Bad1(Generic[int]): ... # E +class Bad2(Protocol[int]): ... # E + +# > All type parameters for the class must appear within the ``Generic`` or +# > ``Protocol`` type argument list. + +T_co = TypeVar("T_co", covariant=True) +S_co = TypeVar("S_co", covariant=True) + +class Bad3(Iterable[T_co], Generic[S_co]): ... # E +class Bad4(Iterable[T_co], Protocol[S_co]): ... # E + +# > The above rule does not apply to a bare ``Protocol`` base class. + +class MyIterator(Iterator[T_co], Protocol): ... # OK # > You can use multiple inheritance with ``Generic`` From 69ddc2389df3b8e94a7bc512e7b1f94e275810f8 Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Tue, 3 Dec 2024 14:04:38 +0100 Subject: [PATCH 065/308] Fix a typo (#1893) --- docs/guides/writing_stubs.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/guides/writing_stubs.rst b/docs/guides/writing_stubs.rst index 71d13a71b..7475cce00 100644 --- a/docs/guides/writing_stubs.rst +++ b/docs/guides/writing_stubs.rst @@ -113,8 +113,8 @@ Stub Content This section documents best practices on what elements to include or leave out of stub files. -Modules excluded fom stubs --------------------------- +Modules excluded from stubs +--------------------------- Not all modules should be included in stubs. From ad4cbc45f868f47031494694bdb7349119302f59 Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Tue, 3 Dec 2024 17:13:26 +0100 Subject: [PATCH 066/308] Writing Stubs: Add "Overloads and Flags" section (#1894) --- docs/guides/writing_stubs.rst | 58 +++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/docs/guides/writing_stubs.rst b/docs/guides/writing_stubs.rst index 7475cce00..bde286323 100644 --- a/docs/guides/writing_stubs.rst +++ b/docs/guides/writing_stubs.rst @@ -405,6 +405,64 @@ common mistakes like unintentionally passing in ``None``. If in doubt, consider asking the library maintainers about their intent. +Common Patterns +=============== + +.. _stub-patterns: + +This section documents common patterns that are useful in stub files. + +Overloads and Flags +------------------- + +.. _overloads-and-flags: + +Sometimes a function or method has a flag argument that changes the return type +or other accepted argument types. For example, take the following function:: + + def open(name: str, mode: Literal["r", "w"] = "r") -> Reader | Writer: + ... + +We can express this case easily with two overloads:: + + @overload + def open(name: str, mode: Literal["r"] = "r") -> Reader: ... + @overload + def open(name: str, mode: Literal["w"]) -> Writer: ... + +The first overload is picked when the mode is ``"r"`` or not given, and the +second overload is picked when the mode is ``"w"``. But what if the first +argument is optional? + +:: + + def open(name: str | None = None, mode: Literal["r", "w"] = "r") -> Reader | Writer: + ... + +Ideally we would be able to use the following overloads:: + + @overload + def open(name: str | None = None, mode: Literal["r"] = "r") -> Reader: ... + @overload + def open(name: str | None = None, mode: Literal["w"]) -> Writer: ... + +And while the first overload is fine, the second is a syntax error in Python, +because non-default arguments cannot follow default arguments. To work around +this, we need an extra overload:: + + @overload + def open(name: str | None = None, mode: Literal["r"] = "r") -> Reader: ... + @overload + def open(name: str | None, mode: Literal["w"]) -> Writer: ... + @overload + def open(*, mode: Literal["w"]) -> Writer: ... + +As before, the first overload is picked when the mode is ``"r"`` or not given. +Otherwise, the second overload is used when ``open`` is called with an explicit +``name``, e.g. ``open("file.txt", "w")`` or ``open(None, "w")``. The third +overload is used when ``open`` is called without a name , e.g. +``open(mode="w")``. + Style Guide =========== From d1e4add4f50493cc87124c741ba5c45a0bbe083b Mon Sep 17 00:00:00 2001 From: Victorien <65306057+Viicos@users.noreply.github.com> Date: Thu, 5 Dec 2024 20:17:57 +0100 Subject: [PATCH 067/308] Remove paragraph mentioning minor edits through the mailing list (#1891) --- docs/spec/dataclasses.rst | 5 ----- 1 file changed, 5 deletions(-) diff --git a/docs/spec/dataclasses.rst b/docs/spec/dataclasses.rst index ed914595c..92d53d227 100644 --- a/docs/spec/dataclasses.rst +++ b/docs/spec/dataclasses.rst @@ -192,11 +192,6 @@ customization of default behaviors: in ``typing.py``. Type checkers should report errors for any unrecognized parameters. -In the future, we may add additional parameters to -``dataclass_transform`` as needed to support common behaviors in user -code. These additions will be made after reaching consensus on -typing-sig rather than via additional PEPs. - The following sections provide additional examples showing how these parameters are used. From 6dd6fe403634ac5c89849e57141bcbc116ee2831 Mon Sep 17 00:00:00 2001 From: InSync Date: Sun, 8 Dec 2024 07:43:41 +0700 Subject: [PATCH 068/308] Specs clarification: Forbid `ClassVar` and `Final` within `TypedDict` body (#1890) --- docs/spec/class-compat.rst | 4 ++++ docs/spec/qualifiers.rst | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/docs/spec/class-compat.rst b/docs/spec/class-compat.rst index 9f88d5640..f3086e75c 100644 --- a/docs/spec/class-compat.rst +++ b/docs/spec/class-compat.rst @@ -89,6 +89,10 @@ annotated in ``__init__`` or other methods, rather than in the class:: def __init__(self, content): self.content: T = content +``ClassVar`` cannot be used as a qualifier for a :ref:`TypedDict ` +item or a :ref:`NamedTuple ` field. Such usage also generates +an error at runtime. + .. _`override`: ``@override`` diff --git a/docs/spec/qualifiers.rst b/docs/spec/qualifiers.rst index 4a3bcc9f1..7ba4d9f4a 100644 --- a/docs/spec/qualifiers.rst +++ b/docs/spec/qualifiers.rst @@ -203,6 +203,10 @@ following should be allowed:: Y: Final = "y" N = NamedTuple("N", [(X, int), (Y, int)]) +``Final`` cannot be used as a qualifier for a :ref:`TypedDict ` +item or a :ref:`NamedTuple ` field. Such usage also generates +an error at runtime. + .. _`annotated`: ``Annotated`` From 59081c2dce23cd12d6611657ba6fc62e5ebdfc37 Mon Sep 17 00:00:00 2001 From: Victorien <65306057+Viicos@users.noreply.github.com> Date: Mon, 16 Dec 2024 15:17:27 +0100 Subject: [PATCH 069/308] Fix markup in generics specification (#1900) --- docs/spec/generics.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/spec/generics.rst b/docs/spec/generics.rst index c7a61594a..d6055e20e 100644 --- a/docs/spec/generics.rst +++ b/docs/spec/generics.rst @@ -97,7 +97,7 @@ There are several ways to define a user-defined class as generic: * Include a ``Generic`` base class. * Use the new generic class syntax in Python 3.12 and higher. -* Include a `` Protocol`` base class parameterized with type variables. This +* Include a ``Protocol`` base class parameterized with type variables. This approach also marks the class as a protocol - see :ref:`generic protocols` for more information. * Include a generic base class parameterized with type variables. From a434c99b2207ded1aa687041220fe4868f1dc6fe Mon Sep 17 00:00:00 2001 From: Danny Yang Date: Tue, 17 Dec 2024 01:40:15 -0500 Subject: [PATCH 070/308] Add content from typeshed/CONTRIBUTING.md (#1882) * add content from typeshed/CONTRIBUTING.md * fix build errors * address review comments * Update docs/guides/writing_stubs.rst Co-authored-by: Rebecca Chen * Update docs/guides/writing_stubs.rst Co-authored-by: Rebecca Chen * add Incomplete vs Any, the Any trick sections; add reference to error suppression formats section * fix ref * format and fix link * fix backticks, add Docstrings section * fix one more backtick * fix typo * fix label * Minor style and formatting fixes Removed repeated example, fixed formatting, removed stray "the". --------- Co-authored-by: Rebecca Chen --- docs/guides/writing_stubs.rst | 215 +++++++++++++++++++++++++++++----- 1 file changed, 188 insertions(+), 27 deletions(-) diff --git a/docs/guides/writing_stubs.rst b/docs/guides/writing_stubs.rst index bde286323..47f48b40a 100644 --- a/docs/guides/writing_stubs.rst +++ b/docs/guides/writing_stubs.rst @@ -93,6 +93,9 @@ Liskov substitutability or detecting problematic overloads. It may be instructive to examine `typeshed `__'s `setup for testing stubs `__. +To suppress type errors in stubs, use ``# type: ignore`` comments. Refer to the :ref:`type-checker-error-suppression` section of the style guide for +error suppression formats specific to individual typecheckers. + .. TODO: consider adding examples and configurations for specific type checkers @@ -113,18 +116,6 @@ Stub Content This section documents best practices on what elements to include or leave out of stub files. -Modules excluded from stubs ---------------------------- - -Not all modules should be included in stubs. - -It is recommended to exclude: - -1. Implementation details, with `multiprocessing/popen_spawn_win32.py `_ as a notable example -2. Modules that are not supposed to be imported, such as ``__main__.py`` -3. Protected modules that start with a single ``_`` char. However, when needed protected modules can still be added (see :ref:`undocumented-objects` section below) -4. Tests - Public Interface ---------------- @@ -138,7 +129,17 @@ The following should always be included: * All objects included in ``__all__`` (if present). Other objects may be included if they are not prefixed with an underscore -or if they are being used in practice. (See the next section.) +or if they are being used in practice. + +Modules excluded from stubs +--------------------------- + +The following should not be included in stubs: + +1. Implementation details, with `multiprocessing/popen_spawn_win32.py `_ as a notable example +2. Modules that are not supposed to be imported, such as ``__main__.py`` +3. Protected modules that start with a single ``_`` char. However, when needed protected modules can still be added (see :ref:`undocumented-objects` section below) +4. Tests .. _undocumented-objects: @@ -212,6 +213,20 @@ to use them freely to describe simple structural types. Incomplete Stubs ---------------- +When writing new stubs, it is not necessary to fully annotate all arguments, +return types, and fields. Some items may be left unannotated or +annotated with ``_typeshed.Incomplete`` (`documentation `_):: + + from _typeshed import Incomplete + + field: Incomplete # unannotated + + def foo(x): ... # unannotated argument and return type + +``_typeshed.Incomplete`` can also be used for partially known types:: + + def foo(x: Incomplete | None = None) -> list[Incomplete]: ... + Partial stubs can be useful, especially for larger packages, but they should follow the following guidelines: @@ -219,16 +234,7 @@ follow the following guidelines: can be left unannotated. * Do not use ``Any`` to mark unannotated or partially annotated values. Leave function parameters and return values unannotated. In all other cases, use - ``_typeshed.Incomplete`` - (`documentation `_):: - - from _typeshed import Incomplete - - field1: Incomplete - field2: dict[str, Incomplete] - - def foo(x): ... - + ``_typeshed.Incomplete``. * Partial classes should include a ``__getattr__()`` method marked with ``_typeshed.Incomplete`` (see example below). * Partial modules (i.e. modules that are missing some or all classes, @@ -253,6 +259,17 @@ annotated function ``bar()``:: def bar(x: str, y, *, z=...): ... +``Any`` vs. ``Incomplete`` +-------------------------- + +While ``Incomplete`` is a type alias of ``Any``, they serve different purposes: +``Incomplete`` is a placeholder where a proper type might be substituted. +It's a "to do" item and should be replaced if possible. + +``Any`` is used when it's not possible to accurately type an item using the current +type system. It should be used sparingly, as described in the :ref:`using-any` +section of the style guide. + Attribute Access ---------------- @@ -475,6 +492,28 @@ and the :ref:`best-practices`. There are a few exceptions, outlined below, that different structure of stub files into account and aim to create more concise files. +Syntax Example +-------------- + +The below is an excerpt from the types for the ``datetime`` module. + + MAXYEAR: int + MINYEAR: int + + class date: + def __new__(cls, year: SupportsIndex, month: SupportsIndex, day: SupportsIndex) -> Self: ... + @classmethod + def fromtimestamp(cls, timestamp: float, /) -> Self: ... + @classmethod + def today(cls) -> Self: ... + @classmethod + def fromordinal(cls, n: int, /) -> Self: ... + @property + def year(self) -> int: ... + def replace(self, year: SupportsIndex = ..., month: SupportsIndex = ..., day: SupportsIndex = ...) -> Self: ... + def ctime(self) -> str: ... + def weekday(self) -> int: ... + Maximum Line Length ------------------- @@ -506,7 +545,7 @@ No:: def time_func() -> None: ... - def date_func() -> None: ... # do no leave unnecessary empty lines + def date_func() -> None: ... # do not leave unnecessary empty lines def ip_func() -> None: ... @@ -563,7 +602,7 @@ Yes:: class Color(Enum): # An assignment with no type annotation is a convention used to indicate - # an enum member. + # an enum member. RED = 1 No:: @@ -633,6 +672,13 @@ No:: ... def to_int3(x: str) -> int: pass +Avoid invariant collection types (``list``, ``dict``) for function parameters, +in favor of covariant types like ``Mapping`` or ``Sequence``. + +Avoid union return types. See https://github.com/python/mypy/issues/1693 + +Use ``float`` instead of ``int | float`` for parameter annotations. See :pep:`484` for more details. + Language Features ----------------- @@ -662,6 +708,14 @@ No:: class OtherClass: ... +Use variable annotations instead of type comments, even for stubs that target +older versions of Python. + +Platform-dependent APIs +----------------------- + +Use :ref:`platform checks` like ``if sys.platform == 'win32'`` to denote platform-dependent APIs. + NamedTuple and TypedDict ------------------------ @@ -689,7 +743,7 @@ No:: Built-in Generics ----------------- -:pep:`585` built-in generics are supported and should be used instead +:pep:`585` built-in generics (such as ``list``, ``dict``, ``tuple``, ``set``) are supported and should be used instead of the corresponding types from ``typing``:: from collections import defaultdict @@ -707,8 +761,115 @@ generally possible and recommended:: Unions ------ -Declaring unions with the shorthand `|` syntax is recommended and supported by +Declaring unions with the shorthand ``|`` syntax is recommended and supported by all type checkers:: def foo(x: int | str) -> int | None: ... # recommended def foo(x: Union[int, str]) -> Optional[int]: ... # ok + +.. _using-any: + +Using ``Any`` and ``object`` +---------------------------- + +When adding type hints, avoid using the ``Any`` type when possible. Reserve +the use of ``Any`` for when: + +* the correct type cannot be expressed in the current type system; and +* to avoid union returns (see above). + +Note that ``Any`` is not the correct type to use if you want to indicate +that some function can accept literally anything: in those cases use +``object`` instead. + +When using ``Any``, document the reason for using it in a comment. Ideally, +document what types could be used. + +The ``Any`` Trick +----------------- + +In cases where a function or method can return ``None``, but where forcing the +user to explicitly check for ``None`` can be detrimental, use +``_typeshed.MaybeNone`` (an alias to ``Any``), instead of ``None``. + +Consider the following (simplified) signature of ``re.Match[str].group``:: + + class Match: + def group(self, group: str | int, /) -> str | MaybeNone: ... + +This avoid forcing the user to check for ``None``:: + + match = re.fullmatch(r"\d+_(.*)", some_string) + assert match is not None + name_group = match.group(1) # The user knows that this will never be None + return name_group.uper() # This typo will be flagged by the type checker + +In this case, the user of ``match.group()`` must be prepared to handle a ``str``, +but type checkers are happy with ``if name_group is None`` checks, because we're +saying it can also be something else than an ``str``. + +This is sometimes called "the Any trick". + +Context Managers +---------------- + +When adding type annotations for context manager classes, annotate +the return type of ``__exit__`` as bool only if the context manager +sometimes suppresses exceptions -- if it sometimes returns ``True`` +at runtime. If the context manager never suppresses exceptions, +have the return type be either ``None`` or ``bool | None``. If you +are not sure whether exceptions are suppressed or not or if the +context manager is meant to be subclassed, pick ``bool | None``. +See https://github.com/python/mypy/issues/7214 for more details. + +``__enter__`` methods and other methods that return ``self`` or ``cls(...)`` +should be annotated with ``typing.Self`` +(`example `_). + +Naming +------ + +Type variables and aliases you introduce purely for legibility reasons +should be prefixed with an underscore to make it obvious to the reader +they are not part of the stubbed API. + +A few guidelines for protocol names below. In cases that don't fall +into any of those categories, use your best judgement. + +* Use plain names for protocols that represent a clear concept + (e.g. ``Iterator``, ``Container``). +* Use ``SupportsX`` for protocols that provide callable methods (e.g. + ``SupportsInt``, ``SupportsRead``, ``SupportsReadSeek``). +* Use ``HasX`` for protocols that have readable and/or writable attributes + or getter/setter methods (e.g. ``HasItems``, ``HasFileno``). + +.. _type-checker-error-suppression: + +Type Checker Error Suppression Formats +-------------------------------------- + +* Use mypy error codes for mypy-specific ``# type: ignore`` annotations, e.g. ``# type: ignore[override]`` for Liskov Substitution Principle violations. +* Use pyright error codes for pyright-specific suppressions, e.g. ``# pyright: ignore[reportGeneralTypeIssues]``. +* If you need both on the same line, mypy's annotation needs to go first, e.g. ``# type: ignore[override] # pyright: ignore[reportGeneralTypeIssues]``. + + +``@deprecated`` +--------------- + +The ``@typing_extensions.deprecated`` decorator (``@warnings.deprecated`` +since Python 3.13) can be used to mark deprecated functionality; see +:pep:`702`. + +Keep the deprecation message concise, but try to mention the projected +version when the functionality is to be removed, and a suggested +replacement. + +Docstrings +---------- + +There are several tradeoffs around including docstrings in type stubs. Consider the intended purpose +of your stubs when deciding whether to include docstrings in your project's stubs. + +* They do not affect type checking results and will be ignored by type checkers. +* Docstrings can improve certain IDE functionality, such as hover info. +* Duplicating docstrings between source code and stubs requires extra work to keep them in sync. From e52371772936ad45dca9677dd5232910a85efa2e Mon Sep 17 00:00:00 2001 From: Eric Traut Date: Fri, 20 Dec 2024 10:32:35 -0800 Subject: [PATCH 071/308] =?UTF-8?q?Updated=20conformance=20test=20results?= =?UTF-8?q?=20for=20the=20latest=20versions=20of=20type=20chec=E2=80=A6=20?= =?UTF-8?q?(#1904)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Updated conformance test results for the latest versions of type checkers. Mypy 1.14: * Added support for @deprecated * Added support for default TypeVar values * Fixed conformance issues with enums * Fixed conformance issues with generics (constrained TypeVars and ParamSpecs) * Fixed conformance issues with TypedDict ReadOnly Pyright 1.1.391: * No changes --- .../results/mypy/directives_deprecated.toml | 31 ++++++++---------- conformance/results/mypy/enums_members.toml | 4 +-- conformance/results/mypy/generics_basic.toml | 9 ++---- .../results/mypy/generics_defaults.toml | 2 +- .../mypy/generics_defaults_referential.toml | 2 +- .../generics_defaults_specialization.toml | 2 +- .../mypy/generics_paramspec_basic.toml | 10 +++--- .../results/mypy/narrowing_typeguard.toml | 1 + .../results/mypy/narrowing_typeis.toml | 1 + conformance/results/mypy/overloads_basic.toml | 2 +- .../results/mypy/qualifiers_annotated.toml | 4 --- .../results/mypy/typeddicts_readonly.toml | 11 ++----- .../mypy/typeddicts_readonly_consistency.toml | 9 ++---- .../results/mypy/typeddicts_required.toml | 11 ++----- conformance/results/mypy/version.toml | 4 +-- conformance/results/pyre/version.toml | 2 +- conformance/results/pyright/version.toml | 4 +-- .../results/pytype/specialtypes_never.toml | 7 ++-- conformance/results/pytype/version.toml | 2 +- conformance/results/results.html | 32 +++++++++---------- conformance/src/type_checker.py | 2 ++ 21 files changed, 64 insertions(+), 88 deletions(-) diff --git a/conformance/results/mypy/directives_deprecated.toml b/conformance/results/mypy/directives_deprecated.toml index 2442ee8f9..153d58c5b 100644 --- a/conformance/results/mypy/directives_deprecated.toml +++ b/conformance/results/mypy/directives_deprecated.toml @@ -1,21 +1,18 @@ -conformant = "Unsupported" -notes = """ -Does not support @deprecated. -""" -conformance_automated = "Fail" +conformant = "Pass" +conformance_automated = "Pass" errors_diff = """ -Line 18: Expected 1 errors -Line 24: Expected 1 errors -Line 25: Expected 1 errors -Line 30: Expected 1 errors -Line 41: Expected 1 errors -Line 42: Expected 1 errors -Line 44: Expected 1 errors -Line 47: Expected 1 errors -Line 48: Expected 1 errors -Line 58: Expected 1 errors -Line 69: Expected 1 errors -Line 98: Expected 1 errors """ output = """ +directives_deprecated.py:18: error: class _directives_deprecated_library.Ham is deprecated: Use Spam instead [deprecated] +directives_deprecated.py:24: error: function _directives_deprecated_library.norwegian_blue is deprecated: It is pining for the fjords [deprecated] +directives_deprecated.py:25: error: function _directives_deprecated_library.norwegian_blue is deprecated: It is pining for the fjords [deprecated] +directives_deprecated.py:30: error: overload def (x: builtins.int) -> builtins.str of function _directives_deprecated_library.foo is deprecated: Only str will be allowed [deprecated] +directives_deprecated.py:41: error: function _directives_deprecated_library.Spam.__add__ is deprecated: There is enough spam in the world [deprecated] +directives_deprecated.py:42: error: function _directives_deprecated_library.Spam.__add__ is deprecated: There is enough spam in the world [deprecated] +directives_deprecated.py:44: error: function _directives_deprecated_library.Spam.greasy is deprecated: All spam will be equally greasy [deprecated] +directives_deprecated.py:47: error: function _directives_deprecated_library.Spam.shape is deprecated: Shapes are becoming immutable [deprecated] +directives_deprecated.py:48: error: function _directives_deprecated_library.Spam.shape is deprecated: Shapes are becoming immutable [deprecated] +directives_deprecated.py:58: error: function directives_deprecated.Invocable.__call__ is deprecated: Deprecated [deprecated] +directives_deprecated.py:69: error: function directives_deprecated.lorem is deprecated: Deprecated [deprecated] +directives_deprecated.py:98: error: function directives_deprecated.SupportsFoo1.foo is deprecated: Deprecated [deprecated] """ diff --git a/conformance/results/mypy/enums_members.toml b/conformance/results/mypy/enums_members.toml index ebac634c3..3678b1239 100644 --- a/conformance/results/mypy/enums_members.toml +++ b/conformance/results/mypy/enums_members.toml @@ -1,7 +1,6 @@ conformant = "Partial" notes = """ Does not treat attribute with annotation and no assignment as non-member. -Does not reject use of annotation with enum member. Does not treat callables as non-members. Does not honor `enum.member` as method decorator. Does not properly handle aliased enum members. @@ -10,7 +9,6 @@ Does not treat attributes with private names as non-members. """ conformance_automated = "Fail" errors_diff = """ -Line 50: Expected 1 errors Line 82: Expected 1 errors Line 83: Expected 1 errors Line 129: Expected 1 errors @@ -26,6 +24,8 @@ enums_members.py:27: error: Expression is of type "Literal[Pet.genus]", not "str enums_members.py:28: error: Expression is of type "Literal[Pet.species]", not "str" [assert-type] enums_members.py:35: error: Expression is of type "Literal[Pet2.genus]", not "str" [assert-type] enums_members.py:36: error: Expression is of type "Literal[Pet2.species]", not "str" [assert-type] +enums_members.py:50: error: Enum members must be left unannotated [misc] +enums_members.py:50: note: See https://typing.readthedocs.io/en/latest/spec/enums.html#defining-members enums_members.py:84: error: Expression is of type "Callable[[Pet4], str]", not "Any" [assert-type] enums_members.py:84: error: Parameter 1 of Literal[...] is invalid [valid-type] enums_members.py:85: error: Expression is of type "Callable[[Pet4], None]", not "Any" [assert-type] diff --git a/conformance/results/mypy/generics_basic.toml b/conformance/results/mypy/generics_basic.toml index 78cbd2ee3..322d9ff72 100644 --- a/conformance/results/mypy/generics_basic.toml +++ b/conformance/results/mypy/generics_basic.toml @@ -1,11 +1,9 @@ -conformant = "Partial" -notes = """ -Does not reject the use of a constraint parameterized by another type variable. -""" +conformant = "Pass" output = """ generics_basic.py:40: error: Value of type variable "AnyStr" of "concat" cannot be "Sequence[object]" [type-var] generics_basic.py:41: error: Value of type variable "AnyStr" of "concat" cannot be "Sequence[object]" [type-var] generics_basic.py:49: error: Type variable must have at least two constrained types [misc] +generics_basic.py:55: error: TypeVar constraint type cannot be parametrized by type variables [misc] generics_basic.py:69: error: Value of type variable "AnyStr" of "concat" cannot be "Sequence[object]" [type-var] generics_basic.py:121: error: Duplicate type variables in Generic[...] or Protocol[...] [misc] generics_basic.py:157: error: Invalid index type "int" for "MyMap1[str, int]"; expected type "str" [index] @@ -19,7 +17,6 @@ generics_basic.py:208: error: Type variable "generics_basic.T" is unbound [vali generics_basic.py:208: note: (Hint: Use "Generic[T]" or "Protocol[T]" base class to bind "T" inside a class) generics_basic.py:208: note: (Hint: Use "T" in function signature to bind "T" inside a function) """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 55: Expected 1 errors """ diff --git a/conformance/results/mypy/generics_defaults.toml b/conformance/results/mypy/generics_defaults.toml index b8fb5b0f7..e7e5536b2 100644 --- a/conformance/results/mypy/generics_defaults.toml +++ b/conformance/results/mypy/generics_defaults.toml @@ -1,4 +1,4 @@ -conformant = "Unsupported" +conformant = "Partial" output = """ generics_defaults.py:24: error: "T" cannot appear after "DefaultStrT" in type parameter list because it has no default type [misc] generics_defaults.py:30: error: Expression is of type "type[NoNonDefaults[Any, Any]]", not "type[NoNonDefaults[str, int]]" [assert-type] diff --git a/conformance/results/mypy/generics_defaults_referential.toml b/conformance/results/mypy/generics_defaults_referential.toml index bcf11e059..3222f9e61 100644 --- a/conformance/results/mypy/generics_defaults_referential.toml +++ b/conformance/results/mypy/generics_defaults_referential.toml @@ -1,4 +1,4 @@ -conformant = "Unsupported" +conformant = "Partial" output = """ generics_defaults_referential.py:23: error: Expression is of type "type[slice[Any, Any, Any]]", not "type[slice[int, int, int | None]]" [assert-type] generics_defaults_referential.py:37: error: Argument 1 to "Foo" has incompatible type "str"; expected "int" [arg-type] diff --git a/conformance/results/mypy/generics_defaults_specialization.toml b/conformance/results/mypy/generics_defaults_specialization.toml index 95472edca..321faa383 100644 --- a/conformance/results/mypy/generics_defaults_specialization.toml +++ b/conformance/results/mypy/generics_defaults_specialization.toml @@ -1,4 +1,4 @@ -conformant = "Unsupported" +conformant = "Partial" output = """ generics_defaults_specialization.py:30: error: Bad number of arguments for type alias, expected between 0 and 1, given 2 [type-arg] generics_defaults_specialization.py:45: error: Expression is of type "type[Bar[Any]]", not "type[Bar[str]]" [assert-type] diff --git a/conformance/results/mypy/generics_paramspec_basic.toml b/conformance/results/mypy/generics_paramspec_basic.toml index 53fd4f5ee..538f6de4d 100644 --- a/conformance/results/mypy/generics_paramspec_basic.toml +++ b/conformance/results/mypy/generics_paramspec_basic.toml @@ -1,9 +1,8 @@ -conformant = "Partial" -notes = """ -Does not reject ParamSpec when used "bare" in type alias definition. -""" +conformant = "Pass" output = """ generics_paramspec_basic.py:10: error: String argument 1 "NotIt" to ParamSpec(...) does not match variable name "WrongName" [misc] +generics_paramspec_basic.py:15: error: Invalid location for ParamSpec "P" [valid-type] +generics_paramspec_basic.py:15: note: You can use ParamSpec as the first argument to Callable, e.g., "Callable[P, int]" generics_paramspec_basic.py:23: error: Invalid location for ParamSpec "P" [valid-type] generics_paramspec_basic.py:23: note: You can use ParamSpec as the first argument to Callable, e.g., "Callable[P, int]" generics_paramspec_basic.py:27: error: Invalid location for Concatenate [valid-type] @@ -15,7 +14,6 @@ generics_paramspec_basic.py:35: note: You can use ParamSpec as the first argumen generics_paramspec_basic.py:39: error: Invalid location for ParamSpec "P" [valid-type] generics_paramspec_basic.py:39: note: You can use ParamSpec as the first argument to Callable, e.g., "Callable[P, int]" """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 15: Expected 1 errors """ diff --git a/conformance/results/mypy/narrowing_typeguard.toml b/conformance/results/mypy/narrowing_typeguard.toml index f4a9a666d..12cc80af9 100644 --- a/conformance/results/mypy/narrowing_typeguard.toml +++ b/conformance/results/mypy/narrowing_typeguard.toml @@ -4,6 +4,7 @@ narrowing_typeguard.py:102: error: TypeGuard functions must have a positional ar narrowing_typeguard.py:107: error: TypeGuard functions must have a positional argument [valid-type] narrowing_typeguard.py:128: error: Argument 1 to "takes_callable_str" has incompatible type "Callable[[object], TypeGuard[int]]"; expected "Callable[[object], str]" [arg-type] narrowing_typeguard.py:148: error: Argument 1 to "takes_callable_str_proto" has incompatible type "Callable[[object], TypeGuard[int]]"; expected "CallableStrProto" [arg-type] +narrowing_typeguard.py:148: note: "CallableStrProto.__call__" has type "Callable[[Arg(object, 'val')], str]" """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/mypy/narrowing_typeis.toml b/conformance/results/mypy/narrowing_typeis.toml index f16730029..b913aa175 100644 --- a/conformance/results/mypy/narrowing_typeis.toml +++ b/conformance/results/mypy/narrowing_typeis.toml @@ -4,6 +4,7 @@ narrowing_typeis.py:105: error: "TypeIs" functions must have a positional argume narrowing_typeis.py:110: error: "TypeIs" functions must have a positional argument [valid-type] narrowing_typeis.py:132: error: Argument 1 to "takes_callable_str" has incompatible type "Callable[[object], TypeIs[int]]"; expected "Callable[[object], str]" [arg-type] narrowing_typeis.py:152: error: Argument 1 to "takes_callable_str_proto" has incompatible type "Callable[[object], TypeIs[int]]"; expected "CallableStrProto" [arg-type] +narrowing_typeis.py:152: note: "CallableStrProto.__call__" has type "Callable[[Arg(object, 'val')], str]" narrowing_typeis.py:169: error: Argument 1 to "takes_typeguard" has incompatible type "Callable[[object], TypeIs[int]]"; expected "Callable[[object], TypeGuard[int]]" [arg-type] narrowing_typeis.py:170: error: Argument 1 to "takes_typeis" has incompatible type "Callable[[object], TypeGuard[int]]"; expected "Callable[[object], TypeIs[int]]" [arg-type] narrowing_typeis.py:191: error: Argument 1 to "takes_int_typeis" has incompatible type "Callable[[object], TypeIs[bool]]"; expected "Callable[[object], TypeIs[int]]" [arg-type] diff --git a/conformance/results/mypy/overloads_basic.toml b/conformance/results/mypy/overloads_basic.toml index 6a7966962..c42562c94 100644 --- a/conformance/results/mypy/overloads_basic.toml +++ b/conformance/results/mypy/overloads_basic.toml @@ -3,7 +3,7 @@ output = """ overloads_basic.py:37: error: No overload variant of "__getitem__" of "Bytes" matches argument type "str" [call-overload] overloads_basic.py:37: note: Possible overload variants: overloads_basic.py:37: note: def __getitem__(self, int, /) -> int -overloads_basic.py:37: note: def __getitem__(self, slice, /) -> bytes +overloads_basic.py:37: note: def __getitem__(self, slice[Any, Any, Any], /) -> bytes overloads_basic.py:62: error: Single overload definition, multiple required [misc] overloads_basic.py:74: error: An overloaded function outside a stub file must have an implementation [no-overload-impl] """ diff --git a/conformance/results/mypy/qualifiers_annotated.toml b/conformance/results/mypy/qualifiers_annotated.toml index f2a37363a..b93e964ac 100644 --- a/conformance/results/mypy/qualifiers_annotated.toml +++ b/conformance/results/mypy/qualifiers_annotated.toml @@ -28,8 +28,6 @@ qualifiers_annotated.py:91: error: "" not callable [operat qualifiers_annotated.py:92: error: "" not callable [operator] qualifiers_annotated.py:98: error: Invalid type: ClassVar nested inside other type [valid-type] qualifiers_annotated.py:100: error: Final can be only used as an outermost qualifier in a variable annotation [valid-type] -qualifiers_annotated.py:110: error: Required[] can be only used in a TypedDict definition [valid-type] -qualifiers_annotated.py:112: error: NotRequired[] can be only used in a TypedDict definition [valid-type] qualifiers_annotated.py:119: error: Cannot redefine "T" as a type variable [misc] qualifiers_annotated.py:119: error: Invalid assignment target [misc] """ @@ -40,7 +38,5 @@ Line 85: Expected 1 errors Line 93: Expected 1 errors Line 98: Unexpected errors ['qualifiers_annotated.py:98: error: Invalid type: ClassVar nested inside other type [valid-type]'] Line 100: Unexpected errors ['qualifiers_annotated.py:100: error: Final can be only used as an outermost qualifier in a variable annotation [valid-type]'] -Line 110: Unexpected errors ['qualifiers_annotated.py:110: error: Required[] can be only used in a TypedDict definition [valid-type]'] -Line 112: Unexpected errors ['qualifiers_annotated.py:112: error: NotRequired[] can be only used in a TypedDict definition [valid-type]'] Line 119: Unexpected errors ['qualifiers_annotated.py:119: error: Cannot redefine "T" as a type variable [misc]', 'qualifiers_annotated.py:119: error: Invalid assignment target [misc]'] """ diff --git a/conformance/results/mypy/typeddicts_readonly.toml b/conformance/results/mypy/typeddicts_readonly.toml index 6dc58bb6e..882ee1b87 100644 --- a/conformance/results/mypy/typeddicts_readonly.toml +++ b/conformance/results/mypy/typeddicts_readonly.toml @@ -1,17 +1,12 @@ -conformant = "Partial" -notes = """ -Incorrectly rejects NotRequired directive when used in an Annotated annotation. -""" +conformant = "Pass" output = """ typeddicts_readonly.py:24: error: ReadOnly TypedDict key "members" TypedDict is mutated [typeddict-readonly-mutated] typeddicts_readonly.py:36: error: ReadOnly TypedDict key "members" TypedDict is mutated [typeddict-readonly-mutated] typeddicts_readonly.py:50: error: ReadOnly TypedDict key "title" TypedDict is mutated [typeddict-readonly-mutated] typeddicts_readonly.py:51: error: ReadOnly TypedDict key "year" TypedDict is mutated [typeddict-readonly-mutated] -typeddicts_readonly.py:56: error: NotRequired[] can be only used in a TypedDict definition [valid-type] typeddicts_readonly.py:60: error: ReadOnly TypedDict key "title" TypedDict is mutated [typeddict-readonly-mutated] +typeddicts_readonly.py:61: error: ReadOnly TypedDict key "year" TypedDict is mutated [typeddict-readonly-mutated] """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 61: Expected 1 errors -Line 56: Unexpected errors ['typeddicts_readonly.py:56: error: NotRequired[] can be only used in a TypedDict definition [valid-type]'] """ diff --git a/conformance/results/mypy/typeddicts_readonly_consistency.toml b/conformance/results/mypy/typeddicts_readonly_consistency.toml index ea01b2dc6..803f1bbd2 100644 --- a/conformance/results/mypy/typeddicts_readonly_consistency.toml +++ b/conformance/results/mypy/typeddicts_readonly_consistency.toml @@ -1,18 +1,13 @@ -conformant = "Partial" -notes = """ -Incorrectly rejects assignment of required item to not-required read-only item. -""" +conformant = "Pass" output = """ typeddicts_readonly_consistency.py:37: error: Incompatible types in assignment (expression has type "A1", variable has type "B1") [assignment] typeddicts_readonly_consistency.py:38: error: Incompatible types in assignment (expression has type "C1", variable has type "B1") [assignment] typeddicts_readonly_consistency.py:40: error: Incompatible types in assignment (expression has type "A1", variable has type "C1") [assignment] -typeddicts_readonly_consistency.py:79: error: Incompatible types in assignment (expression has type "C2", variable has type "A2") [assignment] typeddicts_readonly_consistency.py:81: error: Incompatible types in assignment (expression has type "A2", variable has type "B2") [assignment] typeddicts_readonly_consistency.py:82: error: Incompatible types in assignment (expression has type "C2", variable has type "B2") [assignment] typeddicts_readonly_consistency.py:84: error: Incompatible types in assignment (expression has type "A2", variable has type "C2") [assignment] typeddicts_readonly_consistency.py:85: error: Incompatible types in assignment (expression has type "B2", variable has type "C2") [assignment] """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 79: Unexpected errors ['typeddicts_readonly_consistency.py:79: error: Incompatible types in assignment (expression has type "C2", variable has type "A2") [assignment]'] """ diff --git a/conformance/results/mypy/typeddicts_required.toml b/conformance/results/mypy/typeddicts_required.toml index 7cf6994d7..96ef50072 100644 --- a/conformance/results/mypy/typeddicts_required.toml +++ b/conformance/results/mypy/typeddicts_required.toml @@ -1,17 +1,10 @@ -conformant = "Partial" -notes = """ -Does not support nesting of `Annotated` and `Required` or `NotRequired`. -""" +conformant = "Pass" output = """ typeddicts_required.py:12: error: Required[] can be only used in a TypedDict definition [valid-type] typeddicts_required.py:19: error: NotRequired[] can be only used in a TypedDict definition [valid-type] typeddicts_required.py:62: error: "Required[]" type cannot be nested [valid-type] typeddicts_required.py:63: error: "NotRequired[]" type cannot be nested [valid-type] -typeddicts_required.py:68: error: Required[] can be only used in a TypedDict definition [valid-type] -typeddicts_required.py:70: error: Required[] can be only used in a TypedDict definition [valid-type] """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 68: Unexpected errors ['typeddicts_required.py:68: error: Required[] can be only used in a TypedDict definition [valid-type]'] -Line 70: Unexpected errors ['typeddicts_required.py:70: error: Required[] can be only used in a TypedDict definition [valid-type]'] """ diff --git a/conformance/results/mypy/version.toml b/conformance/results/mypy/version.toml index c328270ab..3d498066d 100644 --- a/conformance/results/mypy/version.toml +++ b/conformance/results/mypy/version.toml @@ -1,2 +1,2 @@ -version = "mypy 1.13.0" -test_duration = 2.5 +version = "mypy 1.14.0" +test_duration = 1.6 diff --git a/conformance/results/pyre/version.toml b/conformance/results/pyre/version.toml index 3ed7e73c7..94de30557 100644 --- a/conformance/results/pyre/version.toml +++ b/conformance/results/pyre/version.toml @@ -1,2 +1,2 @@ version = "pyre 0.9.23" -test_duration = 4.3 +test_duration = 7.3 diff --git a/conformance/results/pyright/version.toml b/conformance/results/pyright/version.toml index 6269389b2..e8e963b77 100644 --- a/conformance/results/pyright/version.toml +++ b/conformance/results/pyright/version.toml @@ -1,2 +1,2 @@ -version = "pyright 1.1.389" -test_duration = 2.5 +version = "pyright 1.1.391" +test_duration = 1.2 diff --git a/conformance/results/pytype/specialtypes_never.toml b/conformance/results/pytype/specialtypes_never.toml index be27a72ae..7a2318585 100644 --- a/conformance/results/pytype/specialtypes_never.toml +++ b/conformance/results/pytype/specialtypes_never.toml @@ -8,10 +8,11 @@ specialtypes_never.py:11:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] -Line 21: Unexpected errors ['specialtypes_never.py:21:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: bad return type [bad-return-type]'] +Line 21: Unexpected errors ['specialtypes_never.py:21:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: bad return type [bad-return-type]'] Line 68: Unexpected errors ['specialtypes_never.py:68:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func6: Type annotation for v1 does not match type of assignment [annotation-type-mismatch]'] Line 69: Unexpected errors ['specialtypes_never.py:69:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func6: Type annotation for v2 does not match type of assignment [annotation-type-mismatch]'] Line 70: Unexpected errors ['specialtypes_never.py:70:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func6: Type annotation for v3 does not match type of assignment [annotation-type-mismatch]'] diff --git a/conformance/results/pytype/version.toml b/conformance/results/pytype/version.toml index d7a8701eb..94cd5eee5 100644 --- a/conformance/results/pytype/version.toml +++ b/conformance/results/pytype/version.toml @@ -1,2 +1,2 @@ version = "pytype 2024.10.11" -test_duration = 45.2 +test_duration = 37.2 diff --git a/conformance/results/results.html b/conformance/results/results.html index 26eb1c70e..e388ee383 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -158,17 +158,17 @@

    Python Type System Conformance Test Results

     
    mypy 1.13.0
    -
    2.7sec
    +
    2.5sec
    pyright 1.1.386
    -
    2.0sec
    +
    pyright 1.1.389
    +
    2.5sec
    pyre 0.9.23
    -
    9.1sec
    +
    4.3sec
    pytype 2024.10.11
    -
    50.2sec
    +
    45.2sec
    @@ -241,16 +241,16 @@

    Python Type System Conformance Test Results

    Generics
         generics_base_class
    Partial

    Does not detect inconsistent type variable ordering.

    PassPass
    Partial

    Does not reject illegal use of Generic.

    Does not allow using generic in assert_type expression.

    Partial

    False negative on passing SymbolTable to dict[str, list[object]].

    Does not reject illegal use of Generic.

    Partial

    Does not reject illegal use of Generic.

    Does not allow using generic in assert_type expression.

    Does not detect inconsistent type variable ordering.

    Partial

    False negative on passing SymbolTable to dict[str, list[object]].

    Does not reject illegal use of Generic.

    Wrong type variable order when inheriting from multiple generic base classes.

         generics_basic
    Partial

    Does not reject the use of a constraint parameterized by another type variable.

    Pass
    Partial

    False positives in examples using constrained type variables.

    False negative for constraint parameterized by a type variable.

    False negative in custom map example.

    False positive using `iter`.

    False negative for generic metaclass.

    Partial

    False positives in examples using constrained type variables.

    False negative for generic metaclass.

    Partial

    False positives in examples using constrained type variables.

    False negative for constraint parameterized by a type variable.

    False negative in custom map example.

    False positive using `iter`.

    False negative for bad type arguments to Generic/Protocol.

    False negative for generic metaclass.

    Partial

    False positives in examples using constrained type variables.

    Argument 'covariant' to TypeVar not supported.

    False negative for type variables missing from Generic/Protocol base class.

    False negative for generic metaclass.

         generics_defaults Unsupported
    - - - + - + - + - + - + @@ -808,13 +808,13 @@

    Python Type System Conformance Test Results

    - + - + @@ -838,7 +838,7 @@

    Python Type System Conformance Test Results

    - + @@ -937,7 +937,7 @@

    Python Type System Conformance Test Results

    - + @@ -973,7 +973,7 @@

    Python Type System Conformance Test Results

    - + diff --git a/conformance/src/type_checker.py b/conformance/src/type_checker.py index 185a3a0cb..b6b60fe76 100644 --- a/conformance/src/type_checker.py +++ b/conformance/src/type_checker.py @@ -111,6 +111,8 @@ def run_tests(self, test_files: Sequence[str]) -> dict[str, str]: ".", "--disable-error-code", "empty-body", + "--enable-error-code", + "deprecated", ] proc = run(command, stdout=PIPE, text=True) lines = proc.stdout.split("\n") From 0fed553b30cbbcc9d963aeb606a52fd44e8d9c35 Mon Sep 17 00:00:00 2001 From: Dhruv Manilawala Date: Fri, 17 Jan 2025 15:11:42 +0530 Subject: [PATCH 072/308] Fix typo in `__all__` examples (#1909) --- docs/spec/distributing.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/spec/distributing.rst b/docs/spec/distributing.rst index 57bcc66e2..13cfff81a 100644 --- a/docs/spec/distributing.rst +++ b/docs/spec/distributing.rst @@ -390,11 +390,11 @@ The following idioms are supported for defining the values contained within ``__all__``. These restrictions allow type checkers to statically determine the value of ``__all__``. -- ``__all__ = ('a', b')`` -- ``__all__ = ['a', b']`` -- ``__all__ += ['a', b']`` +- ``__all__ = ('a', 'b')`` +- ``__all__ = ['a', 'b']`` +- ``__all__ += ['a', 'b']`` - ``__all__ += submodule.__all__`` -- ``__all__.extend(['a', b'])`` +- ``__all__.extend(['a', 'b'])`` - ``__all__.extend(submodule.__all__)`` - ``__all__.append('a')`` - ``__all__.remove('a')`` From 4cfdb36c79fe8b4d406da9973e26fe9037c684b9 Mon Sep 17 00:00:00 2001 From: Neil Mitchell Date: Wed, 29 Jan 2025 15:17:31 +0000 Subject: [PATCH 073/308] Fix a type error in generics (#1913) The function says it returns an `int`, but used `pass` so returned `None`. Fix by returning the `a` argument which is of type `int`. --- docs/spec/generics.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/spec/generics.rst b/docs/spec/generics.rst index d6055e20e..aa7ca86df 100644 --- a/docs/spec/generics.rst +++ b/docs/spec/generics.rst @@ -1071,7 +1071,7 @@ outer ``Callable``. This has the following semantics: .. code-block:: def a_int_b_str(a: int, b: str) -> int: - pass + return a twice(a_int_b_str, 1, "A") # Accepted From b76a85311e512f057928a81524bf7b2d5522e14e Mon Sep 17 00:00:00 2001 From: Sergei Lebedev <185856+superbobry@users.noreply.github.com> Date: Thu, 30 Jan 2025 23:27:20 +0000 Subject: [PATCH 074/308] Allowed bare `typing.Final` in an annotation expression (#1915) The current grammar only allows `typing.Final[...]`, but not `typing.Final`. --- docs/spec/annotations.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/spec/annotations.rst b/docs/spec/annotations.rst index 3e56e5ce0..18f9f6a6b 100644 --- a/docs/spec/annotations.rst +++ b/docs/spec/annotations.rst @@ -110,7 +110,7 @@ The following grammar describes the allowed elements of type and annotation expr : | '[' `annotation_expression` ']' : | '[' `annotation_expression`']' : | '[' `annotation_expression`']' - : | '[' `annotation_expression`']' + : | ('[' `annotation_expression`']')? : | '[' `annotation_expression` ']' : | '[' `annotation_expression` ',' : expression (',' expression)* ']' From b97d71bc1f3ce42fed5baa307bfea9e3aafc9522 Mon Sep 17 00:00:00 2001 From: Eric Traut Date: Tue, 4 Feb 2025 20:56:49 -0800 Subject: [PATCH 075/308] Updated conformance test results for mypy 1.15 and pyright 1.1.393. (#1922) --- .../results/mypy/generics_defaults.toml | 40 +++++++++---------- .../mypy/generics_defaults_referential.toml | 12 +++--- .../generics_defaults_specialization.toml | 4 +- .../mypy/generics_paramspec_components.toml | 26 +++++------- conformance/results/mypy/version.toml | 4 +- conformance/results/pyre/version.toml | 2 +- .../results/pyright/aliases_explicit.toml | 10 ++--- .../pyright/aliases_type_statement.toml | 10 ++--- .../pyright/aliases_typealiastype.toml | 2 +- .../pyright/annotations_forward_refs.toml | 10 ++--- .../results/pyright/annotations_typeexpr.toml | 10 ++--- .../pyright/generics_syntax_declarations.toml | 2 +- .../pyright/generics_variance_inference.toml | 9 ++--- .../results/pyright/qualifiers_annotated.toml | 2 +- .../pyright/qualifiers_final_decorator.toml | 2 +- conformance/results/pyright/version.toml | 2 +- conformance/results/pytype/version.toml | 2 +- conformance/results/results.html | 12 +++--- 18 files changed, 76 insertions(+), 85 deletions(-) diff --git a/conformance/results/mypy/generics_defaults.toml b/conformance/results/mypy/generics_defaults.toml index e7e5536b2..0491d9470 100644 --- a/conformance/results/mypy/generics_defaults.toml +++ b/conformance/results/mypy/generics_defaults.toml @@ -1,17 +1,17 @@ conformant = "Partial" output = """ generics_defaults.py:24: error: "T" cannot appear after "DefaultStrT" in type parameter list because it has no default type [misc] -generics_defaults.py:30: error: Expression is of type "type[NoNonDefaults[Any, Any]]", not "type[NoNonDefaults[str, int]]" [assert-type] -generics_defaults.py:31: error: Expression is of type "type[NoNonDefaults[Any, Any]]", not "type[NoNonDefaults[str, int]]" [assert-type] -generics_defaults.py:38: error: Expression is of type "type[OneDefault[Any, Any]]", not "type[OneDefault[float, bool]]" [assert-type] -generics_defaults.py:45: error: Expression is of type "type[AllTheDefaults[Any, Any, Any, Any, Any]]", not "type[AllTheDefaults[Any, Any, str, int, bool]]" [assert-type] -generics_defaults.py:46: error: Expression is of type "type[AllTheDefaults[Any, Any, Any, Any, Any]]", not "type[AllTheDefaults[int, complex, str, int, bool]]" [assert-type] +generics_defaults.py:30: error: Expression is of type "type[NoNonDefaults[DefaultStrT, DefaultIntT]]", not "type[NoNonDefaults[str, int]]" [assert-type] +generics_defaults.py:31: error: Expression is of type "type[NoNonDefaults[str, DefaultIntT]]", not "type[NoNonDefaults[str, int]]" [assert-type] +generics_defaults.py:38: error: Expression is of type "type[OneDefault[float, DefaultBoolT]]", not "type[OneDefault[float, bool]]" [assert-type] +generics_defaults.py:45: error: Expression is of type "type[AllTheDefaults[T1, T2, DefaultStrT, DefaultIntT, DefaultBoolT]]", not "type[AllTheDefaults[Any, Any, str, int, bool]]" [assert-type] +generics_defaults.py:46: error: Expression is of type "type[AllTheDefaults[int, complex, DefaultStrT, DefaultIntT, DefaultBoolT]]", not "type[AllTheDefaults[int, complex, str, int, bool]]" [assert-type] generics_defaults.py:50: error: Type application has too few types (expected between 2 and 5) [misc] -generics_defaults.py:52: error: Expression is of type "type[AllTheDefaults[Any, Any, Any, Any, Any]]", not "type[AllTheDefaults[int, complex, str, int, bool]]" [assert-type] -generics_defaults.py:55: error: Expression is of type "type[AllTheDefaults[Any, Any, Any, Any, Any]]", not "type[AllTheDefaults[int, complex, str, int, bool]]" [assert-type] -generics_defaults.py:59: error: Expression is of type "type[AllTheDefaults[Any, Any, Any, Any, Any]]", not "type[AllTheDefaults[int, complex, str, int, bool]]" [assert-type] -generics_defaults.py:79: error: Expression is of type "type[Class_ParamSpec[Any]]", not "type[Class_ParamSpec[[str, int]]]" [assert-type] -generics_defaults.py:94: error: Expression is of type "type[Class_TypeVarTuple[*tuple[Any, ...]]]", not "type[Class_TypeVarTuple[str, int]]" [assert-type] +generics_defaults.py:52: error: Expression is of type "type[AllTheDefaults[int, complex, DefaultStrT, DefaultIntT, DefaultBoolT]]", not "type[AllTheDefaults[int, complex, str, int, bool]]" [assert-type] +generics_defaults.py:55: error: Expression is of type "type[AllTheDefaults[int, complex, str, DefaultIntT, DefaultBoolT]]", not "type[AllTheDefaults[int, complex, str, int, bool]]" [assert-type] +generics_defaults.py:59: error: Expression is of type "type[AllTheDefaults[int, complex, str, int, DefaultBoolT]]", not "type[AllTheDefaults[int, complex, str, int, bool]]" [assert-type] +generics_defaults.py:79: error: Expression is of type "type[Class_ParamSpec[DefaultP]]", not "type[Class_ParamSpec[[str, int]]]" [assert-type] +generics_defaults.py:94: error: Expression is of type "type[Class_TypeVarTuple[*DefaultTs]]", not "type[Class_TypeVarTuple[str, int]]" [assert-type] generics_defaults.py:151: error: Expression is of type "type[Foo6[*tuple[Any, ...], Any]]", not "type[Foo6[int, str, [float, bool]]]" [assert-type] generics_defaults.py:151: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [misc] generics_defaults.py:152: error: Expression is of type "type[Foo6[*tuple[Any, ...], Any]]", not "type[Foo6[int, str, [bytes]]]" [assert-type] @@ -25,16 +25,16 @@ errors_diff = """ Line 104: Expected 1 errors Line 111: Expected 1 errors Line 138: Expected 1 errors -Line 30: Unexpected errors ['generics_defaults.py:30: error: Expression is of type "type[NoNonDefaults[Any, Any]]", not "type[NoNonDefaults[str, int]]" [assert-type]'] -Line 31: Unexpected errors ['generics_defaults.py:31: error: Expression is of type "type[NoNonDefaults[Any, Any]]", not "type[NoNonDefaults[str, int]]" [assert-type]'] -Line 38: Unexpected errors ['generics_defaults.py:38: error: Expression is of type "type[OneDefault[Any, Any]]", not "type[OneDefault[float, bool]]" [assert-type]'] -Line 45: Unexpected errors ['generics_defaults.py:45: error: Expression is of type "type[AllTheDefaults[Any, Any, Any, Any, Any]]", not "type[AllTheDefaults[Any, Any, str, int, bool]]" [assert-type]'] -Line 46: Unexpected errors ['generics_defaults.py:46: error: Expression is of type "type[AllTheDefaults[Any, Any, Any, Any, Any]]", not "type[AllTheDefaults[int, complex, str, int, bool]]" [assert-type]'] -Line 52: Unexpected errors ['generics_defaults.py:52: error: Expression is of type "type[AllTheDefaults[Any, Any, Any, Any, Any]]", not "type[AllTheDefaults[int, complex, str, int, bool]]" [assert-type]'] -Line 55: Unexpected errors ['generics_defaults.py:55: error: Expression is of type "type[AllTheDefaults[Any, Any, Any, Any, Any]]", not "type[AllTheDefaults[int, complex, str, int, bool]]" [assert-type]'] -Line 59: Unexpected errors ['generics_defaults.py:59: error: Expression is of type "type[AllTheDefaults[Any, Any, Any, Any, Any]]", not "type[AllTheDefaults[int, complex, str, int, bool]]" [assert-type]'] -Line 79: Unexpected errors ['generics_defaults.py:79: error: Expression is of type "type[Class_ParamSpec[Any]]", not "type[Class_ParamSpec[[str, int]]]" [assert-type]'] -Line 94: Unexpected errors ['generics_defaults.py:94: error: Expression is of type "type[Class_TypeVarTuple[*tuple[Any, ...]]]", not "type[Class_TypeVarTuple[str, int]]" [assert-type]'] +Line 30: Unexpected errors ['generics_defaults.py:30: error: Expression is of type "type[NoNonDefaults[DefaultStrT, DefaultIntT]]", not "type[NoNonDefaults[str, int]]" [assert-type]'] +Line 31: Unexpected errors ['generics_defaults.py:31: error: Expression is of type "type[NoNonDefaults[str, DefaultIntT]]", not "type[NoNonDefaults[str, int]]" [assert-type]'] +Line 38: Unexpected errors ['generics_defaults.py:38: error: Expression is of type "type[OneDefault[float, DefaultBoolT]]", not "type[OneDefault[float, bool]]" [assert-type]'] +Line 45: Unexpected errors ['generics_defaults.py:45: error: Expression is of type "type[AllTheDefaults[T1, T2, DefaultStrT, DefaultIntT, DefaultBoolT]]", not "type[AllTheDefaults[Any, Any, str, int, bool]]" [assert-type]'] +Line 46: Unexpected errors ['generics_defaults.py:46: error: Expression is of type "type[AllTheDefaults[int, complex, DefaultStrT, DefaultIntT, DefaultBoolT]]", not "type[AllTheDefaults[int, complex, str, int, bool]]" [assert-type]'] +Line 52: Unexpected errors ['generics_defaults.py:52: error: Expression is of type "type[AllTheDefaults[int, complex, DefaultStrT, DefaultIntT, DefaultBoolT]]", not "type[AllTheDefaults[int, complex, str, int, bool]]" [assert-type]'] +Line 55: Unexpected errors ['generics_defaults.py:55: error: Expression is of type "type[AllTheDefaults[int, complex, str, DefaultIntT, DefaultBoolT]]", not "type[AllTheDefaults[int, complex, str, int, bool]]" [assert-type]'] +Line 59: Unexpected errors ['generics_defaults.py:59: error: Expression is of type "type[AllTheDefaults[int, complex, str, int, DefaultBoolT]]", not "type[AllTheDefaults[int, complex, str, int, bool]]" [assert-type]'] +Line 79: Unexpected errors ['generics_defaults.py:79: error: Expression is of type "type[Class_ParamSpec[DefaultP]]", not "type[Class_ParamSpec[[str, int]]]" [assert-type]'] +Line 94: Unexpected errors ['generics_defaults.py:94: error: Expression is of type "type[Class_TypeVarTuple[*DefaultTs]]", not "type[Class_TypeVarTuple[str, int]]" [assert-type]'] Line 151: Unexpected errors ['generics_defaults.py:151: error: Expression is of type "type[Foo6[*tuple[Any, ...], Any]]", not "type[Foo6[int, str, [float, bool]]]" [assert-type]', 'generics_defaults.py:151: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [misc]'] Line 152: Unexpected errors ['generics_defaults.py:152: error: Expression is of type "type[Foo6[*tuple[Any, ...], Any]]", not "type[Foo6[int, str, [bytes]]]" [assert-type]', 'generics_defaults.py:152: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [misc]'] Line 166: Unexpected errors ['generics_defaults.py:166: error: Expression is of type "Callable[[Self], Self]", not "Callable[[Foo7[int]], Foo7[int]]" [assert-type]'] diff --git a/conformance/results/mypy/generics_defaults_referential.toml b/conformance/results/mypy/generics_defaults_referential.toml index 3222f9e61..f2bcf685f 100644 --- a/conformance/results/mypy/generics_defaults_referential.toml +++ b/conformance/results/mypy/generics_defaults_referential.toml @@ -1,10 +1,10 @@ conformant = "Partial" output = """ -generics_defaults_referential.py:23: error: Expression is of type "type[slice[Any, Any, Any]]", not "type[slice[int, int, int | None]]" [assert-type] +generics_defaults_referential.py:23: error: Expression is of type "type[slice[StartT, StopT, StepT]]", not "type[slice[int, int, int | None]]" [assert-type] generics_defaults_referential.py:37: error: Argument 1 to "Foo" has incompatible type "str"; expected "int" [arg-type] generics_defaults_referential.py:53: error: Type parameter "Start2T" has a default type that refers to one or more type variables that are out of scope [misc] -generics_defaults_referential.py:94: error: Expression is of type "type[Bar[Any, Any]]", not "type[Bar[Any, list[Any]]]" [assert-type] -generics_defaults_referential.py:95: error: Expression is of type "type[Bar[Any, Any]]", not "type[Bar[int, list[int]]]" [assert-type] +generics_defaults_referential.py:94: error: Expression is of type "type[Bar[Z1, ListDefaultT]]", not "type[Bar[Any, list[Any]]]" [assert-type] +generics_defaults_referential.py:95: error: Expression is of type "type[Bar[int, ListDefaultT]]", not "type[Bar[int, list[int]]]" [assert-type] generics_defaults_referential.py:96: error: Expression is of type "Bar[int, list[Never]]", not "Bar[int, list[int]]" [assert-type] """ conformance_automated = "Fail" @@ -14,8 +14,8 @@ Line 60: Expected 1 errors Line 68: Expected 1 errors Line 74: Expected 1 errors Line 78: Expected 1 errors -Line 23: Unexpected errors ['generics_defaults_referential.py:23: error: Expression is of type "type[slice[Any, Any, Any]]", not "type[slice[int, int, int | None]]" [assert-type]'] -Line 94: Unexpected errors ['generics_defaults_referential.py:94: error: Expression is of type "type[Bar[Any, Any]]", not "type[Bar[Any, list[Any]]]" [assert-type]'] -Line 95: Unexpected errors ['generics_defaults_referential.py:95: error: Expression is of type "type[Bar[Any, Any]]", not "type[Bar[int, list[int]]]" [assert-type]'] +Line 23: Unexpected errors ['generics_defaults_referential.py:23: error: Expression is of type "type[slice[StartT, StopT, StepT]]", not "type[slice[int, int, int | None]]" [assert-type]'] +Line 94: Unexpected errors ['generics_defaults_referential.py:94: error: Expression is of type "type[Bar[Z1, ListDefaultT]]", not "type[Bar[Any, list[Any]]]" [assert-type]'] +Line 95: Unexpected errors ['generics_defaults_referential.py:95: error: Expression is of type "type[Bar[int, ListDefaultT]]", not "type[Bar[int, list[int]]]" [assert-type]'] Line 96: Unexpected errors ['generics_defaults_referential.py:96: error: Expression is of type "Bar[int, list[Never]]", not "Bar[int, list[int]]" [assert-type]'] """ diff --git a/conformance/results/mypy/generics_defaults_specialization.toml b/conformance/results/mypy/generics_defaults_specialization.toml index 321faa383..b29ba389c 100644 --- a/conformance/results/mypy/generics_defaults_specialization.toml +++ b/conformance/results/mypy/generics_defaults_specialization.toml @@ -1,10 +1,10 @@ conformant = "Partial" output = """ generics_defaults_specialization.py:30: error: Bad number of arguments for type alias, expected between 0 and 1, given 2 [type-arg] -generics_defaults_specialization.py:45: error: Expression is of type "type[Bar[Any]]", not "type[Bar[str]]" [assert-type] +generics_defaults_specialization.py:45: error: Expression is of type "type[Bar[DefaultStrT]]", not "type[Bar[str]]" [assert-type] generics_defaults_specialization.py:55: error: The type "type[Foo]" is not generic and not indexable [misc] """ conformance_automated = "Fail" errors_diff = """ -Line 45: Unexpected errors ['generics_defaults_specialization.py:45: error: Expression is of type "type[Bar[Any]]", not "type[Bar[str]]" [assert-type]'] +Line 45: Unexpected errors ['generics_defaults_specialization.py:45: error: Expression is of type "type[Bar[DefaultStrT]]", not "type[Bar[str]]" [assert-type]'] """ diff --git a/conformance/results/mypy/generics_paramspec_components.toml b/conformance/results/mypy/generics_paramspec_components.toml index 66a386ad0..bdc5f0b0f 100644 --- a/conformance/results/mypy/generics_paramspec_components.toml +++ b/conformance/results/mypy/generics_paramspec_components.toml @@ -1,17 +1,19 @@ -conformant = "Partial" -notes = """ -Does not report illegal use of "P.args" on normal parameter. -Does not report error when P.args is specified but P.kwargs is missing. -Does not report error when P is out of scope and P.args and P.kwargs is used. -Does not report error when keyword argument is specified between P.args and P.kwargs. -""" +conformant = "Pass" output = """ generics_paramspec_components.py:17: error: Use "P.args" for variadic "*" parameter [valid-type] generics_paramspec_components.py:17: error: Use "P.kwargs" for variadic "**" parameter [valid-type] +generics_paramspec_components.py:20: error: ParamSpec components are not allowed here [valid-type] generics_paramspec_components.py:23: error: Use "P.kwargs" for variadic "**" parameter [valid-type] +generics_paramspec_components.py:26: error: ParamSpec must have "*args" typed as "P.args" and "**kwargs" typed as "P.kwargs" [valid-type] +generics_paramspec_components.py:30: error: ParamSpec "P" is unbound [valid-type] +generics_paramspec_components.py:35: error: ParamSpec components are not allowed here [valid-type] +generics_paramspec_components.py:36: error: ParamSpec components are not allowed here [valid-type] +generics_paramspec_components.py:38: error: ParamSpec must have "*args" typed as "P.args" and "**kwargs" typed as "P.kwargs" [valid-type] +generics_paramspec_components.py:41: error: ParamSpec must have "*args" typed as "P.args" and "**kwargs" typed as "P.kwargs" [valid-type] generics_paramspec_components.py:49: error: Argument 1 has incompatible type "*P.kwargs"; expected "P.args" [arg-type] generics_paramspec_components.py:49: error: Argument 2 has incompatible type "**P.args"; expected "P.kwargs" [arg-type] generics_paramspec_components.py:51: error: Argument 1 has incompatible type "int"; expected "P.args" [arg-type] +generics_paramspec_components.py:60: error: Arguments not allowed after ParamSpec.args [valid-type] generics_paramspec_components.py:70: error: Argument 1 has incompatible type "*P.args"; expected "int" [arg-type] generics_paramspec_components.py:70: error: Argument 2 has incompatible type "int"; expected "P.args" [arg-type] generics_paramspec_components.py:72: error: Argument 1 has incompatible type "*P.args"; expected "int" [arg-type] @@ -21,14 +23,6 @@ generics_paramspec_components.py:83: error: Argument 3 to "foo" has incompatible generics_paramspec_components.py:98: error: Argument 2 to "twice" has incompatible type "str"; expected "int" [arg-type] generics_paramspec_components.py:98: error: Argument 3 to "twice" has incompatible type "int"; expected "str" [arg-type] """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 20: Expected 1 errors -Line 26: Expected 1 errors -Line 30: Expected 1 errors -Line 35: Expected 1 errors -Line 36: Expected 1 errors -Line 38: Expected 1 errors -Line 41: Expected 1 errors -Line 60: Expected 1 errors """ diff --git a/conformance/results/mypy/version.toml b/conformance/results/mypy/version.toml index 3d498066d..869e8bf2f 100644 --- a/conformance/results/mypy/version.toml +++ b/conformance/results/mypy/version.toml @@ -1,2 +1,2 @@ -version = "mypy 1.14.0" -test_duration = 1.6 +version = "mypy 1.15.0" +test_duration = 2.0 diff --git a/conformance/results/pyre/version.toml b/conformance/results/pyre/version.toml index 94de30557..028806c2e 100644 --- a/conformance/results/pyre/version.toml +++ b/conformance/results/pyre/version.toml @@ -1,2 +1,2 @@ version = "pyre 0.9.23" -test_duration = 7.3 +test_duration = 6.5 diff --git a/conformance/results/pyright/aliases_explicit.toml b/conformance/results/pyright/aliases_explicit.toml index a1e82c9eb..5948d8aba 100644 --- a/conformance/results/pyright/aliases_explicit.toml +++ b/conformance/results/pyright/aliases_explicit.toml @@ -10,25 +10,25 @@ aliases_explicit.py:79:21 - error: Invalid expression form for type alias defini aliases_explicit.py:79:21 - error: Call expression not allowed in type expression (reportInvalidTypeForm) aliases_explicit.py:80:21 - error: Invalid expression form for type alias definition (reportInvalidTypeForm) aliases_explicit.py:80:21 - error: List expression not allowed in type expression -  Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) +  Use list[T] to indicate a list type or T1 | T2 to indicate a union type (reportInvalidTypeForm) aliases_explicit.py:80:21 - error: Expected class but received "list[Unknown]" (reportGeneralTypeIssues) aliases_explicit.py:81:21 - error: Invalid expression form for type alias definition (reportInvalidTypeForm) aliases_explicit.py:81:21 - error: Tuple expression not allowed in type expression -  Use tuple[T1, ..., Tn] to indicate a tuple type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) +  Use tuple[T1, ..., Tn] to indicate a tuple type or T1 | T2 to indicate a union type (reportInvalidTypeForm) aliases_explicit.py:82:21 - error: Invalid expression form for type alias definition (reportInvalidTypeForm) aliases_explicit.py:82:21 - error: List expression not allowed in type expression -  Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) +  Use list[T] to indicate a list type or T1 | T2 to indicate a union type (reportInvalidTypeForm) aliases_explicit.py:82:21 - error: Expected class but received "list[type[int]]" (reportGeneralTypeIssues) aliases_explicit.py:83:21 - error: Invalid expression form for type alias definition (reportInvalidTypeForm) aliases_explicit.py:83:21 - error: Dictionary expression not allowed in type expression -  Use Dict[T1, T2] to indicate a dictionary type (reportInvalidTypeForm) +  Use dict[T1, T2] to indicate a dictionary type (reportInvalidTypeForm) aliases_explicit.py:83:21 - error: Expected class but received "dict[str, Unknown]" (reportGeneralTypeIssues) aliases_explicit.py:83:28 - error: "b" is not defined (reportUndefinedVariable) aliases_explicit.py:84:21 - error: Invalid expression form for type alias definition (reportInvalidTypeForm) aliases_explicit.py:84:21 - error: Call expression not allowed in type expression (reportInvalidTypeForm) aliases_explicit.py:85:21 - error: Invalid expression form for type alias definition (reportInvalidTypeForm) aliases_explicit.py:85:21 - error: List expression not allowed in type expression -  Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) +  Use list[T] to indicate a list type or T1 | T2 to indicate a union type (reportInvalidTypeForm) aliases_explicit.py:85:21 - error: Expected class but received "list[type[int]]" (reportGeneralTypeIssues) aliases_explicit.py:85:27 - error: Expected class but received "Literal[0]" (reportGeneralTypeIssues) aliases_explicit.py:86:21 - error: Invalid expression form for type alias definition (reportInvalidTypeForm) diff --git a/conformance/results/pyright/aliases_type_statement.toml b/conformance/results/pyright/aliases_type_statement.toml index 4556366e6..34269c479 100644 --- a/conformance/results/pyright/aliases_type_statement.toml +++ b/conformance/results/pyright/aliases_type_statement.toml @@ -14,20 +14,20 @@ aliases_type_statement.py:31:22 - error: Argument of type "TypeAliasType" cannot     "TypeAliasType" is not assignable to "tuple[_ClassInfo, ...]" (reportArgumentType) aliases_type_statement.py:37:22 - error: Call expression not allowed in type expression (reportInvalidTypeForm) aliases_type_statement.py:38:22 - error: List expression not allowed in type expression -  Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) +  Use list[T] to indicate a list type or T1 | T2 to indicate a union type (reportInvalidTypeForm) aliases_type_statement.py:38:22 - error: Expected class but received "list[Unknown]" (reportGeneralTypeIssues) aliases_type_statement.py:39:22 - error: Tuple expression not allowed in type expression -  Use tuple[T1, ..., Tn] to indicate a tuple type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) +  Use tuple[T1, ..., Tn] to indicate a tuple type or T1 | T2 to indicate a union type (reportInvalidTypeForm) aliases_type_statement.py:40:22 - error: List expression not allowed in type expression -  Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) +  Use list[T] to indicate a list type or T1 | T2 to indicate a union type (reportInvalidTypeForm) aliases_type_statement.py:40:22 - error: Expected class but received "list[type[int]]" (reportGeneralTypeIssues) aliases_type_statement.py:41:22 - error: Dictionary expression not allowed in type expression -  Use Dict[T1, T2] to indicate a dictionary type (reportInvalidTypeForm) +  Use dict[T1, T2] to indicate a dictionary type (reportInvalidTypeForm) aliases_type_statement.py:41:22 - error: Expected class but received "dict[str, Unknown]" (reportGeneralTypeIssues) aliases_type_statement.py:41:29 - error: "b" is not defined (reportUndefinedVariable) aliases_type_statement.py:42:22 - error: Call expression not allowed in type expression (reportInvalidTypeForm) aliases_type_statement.py:43:22 - error: List expression not allowed in type expression -  Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) +  Use list[T] to indicate a list type or T1 | T2 to indicate a union type (reportInvalidTypeForm) aliases_type_statement.py:43:22 - error: Expected class but received "list[type[int]]" (reportGeneralTypeIssues) aliases_type_statement.py:43:28 - error: Expected class but received "Literal[0]" (reportGeneralTypeIssues) aliases_type_statement.py:44:22 - error: Ternary expression not allowed in type expression (reportInvalidTypeForm) diff --git a/conformance/results/pyright/aliases_typealiastype.toml b/conformance/results/pyright/aliases_typealiastype.toml index 64ebf8cfe..610c1a96b 100644 --- a/conformance/results/pyright/aliases_typealiastype.toml +++ b/conformance/results/pyright/aliases_typealiastype.toml @@ -19,7 +19,7 @@ aliases_typealiastype.py:56:42 - error: Expected class but received "dict[str, U aliases_typealiastype.py:56:49 - error: "b" is not defined (reportUndefinedVariable) aliases_typealiastype.py:57:42 - error: Call expression not allowed in type expression (reportInvalidTypeForm) aliases_typealiastype.py:58:42 - error: List expression not allowed in type expression -  Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) +  Use list[T] to indicate a list type or T1 | T2 to indicate a union type (reportInvalidTypeForm) aliases_typealiastype.py:58:42 - error: Expected class but received "list[type[int]]" (reportGeneralTypeIssues) aliases_typealiastype.py:58:48 - error: Expected class but received "Literal[0]" (reportGeneralTypeIssues) aliases_typealiastype.py:59:42 - error: Ternary expression not allowed in type expression (reportInvalidTypeForm) diff --git a/conformance/results/pyright/annotations_forward_refs.toml b/conformance/results/pyright/annotations_forward_refs.toml index 297096740..ca35b5bb1 100644 --- a/conformance/results/pyright/annotations_forward_refs.toml +++ b/conformance/results/pyright/annotations_forward_refs.toml @@ -6,19 +6,19 @@ annotations_forward_refs.py:24:7 - error: Union syntax cannot be used with strin annotations_forward_refs.py:25:13 - error: Union syntax cannot be used with string operand; use quotes around entire expression (reportGeneralTypeIssues) annotations_forward_refs.py:41:10 - error: Call expression not allowed in type expression (reportInvalidTypeForm) annotations_forward_refs.py:42:10 - error: List expression not allowed in type expression -  Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) +  Use list[T] to indicate a list type or T1 | T2 to indicate a union type (reportInvalidTypeForm) annotations_forward_refs.py:42:10 - error: Expected class but received "list[Unknown]" (reportGeneralTypeIssues) annotations_forward_refs.py:43:10 - error: Tuple expression not allowed in type expression -  Use tuple[T1, ..., Tn] to indicate a tuple type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) +  Use tuple[T1, ..., Tn] to indicate a tuple type or T1 | T2 to indicate a union type (reportInvalidTypeForm) annotations_forward_refs.py:44:10 - error: List expression not allowed in type expression -  Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) +  Use list[T] to indicate a list type or T1 | T2 to indicate a union type (reportInvalidTypeForm) annotations_forward_refs.py:44:10 - error: Expected class but received "list[type[int]]" (reportGeneralTypeIssues) annotations_forward_refs.py:45:10 - error: Dictionary expression not allowed in type expression -  Use Dict[T1, T2] to indicate a dictionary type (reportInvalidTypeForm) +  Use dict[T1, T2] to indicate a dictionary type (reportInvalidTypeForm) annotations_forward_refs.py:45:10 - error: Expected class but received "dict[Unknown, Unknown]" (reportGeneralTypeIssues) annotations_forward_refs.py:46:10 - error: Call expression not allowed in type expression (reportInvalidTypeForm) annotations_forward_refs.py:47:10 - error: List expression not allowed in type expression -  Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) +  Use list[T] to indicate a list type or T1 | T2 to indicate a union type (reportInvalidTypeForm) annotations_forward_refs.py:47:10 - error: Expected class but received "list[type[int]]" (reportGeneralTypeIssues) annotations_forward_refs.py:47:16 - error: Expected class but received "Literal[0]" (reportGeneralTypeIssues) annotations_forward_refs.py:48:10 - error: Ternary expression not allowed in type expression (reportInvalidTypeForm) diff --git a/conformance/results/pyright/annotations_typeexpr.toml b/conformance/results/pyright/annotations_typeexpr.toml index 5504e9464..e9e3fdca6 100644 --- a/conformance/results/pyright/annotations_typeexpr.toml +++ b/conformance/results/pyright/annotations_typeexpr.toml @@ -2,19 +2,19 @@ conformant = "Pass" output = """ annotations_typeexpr.py:88:9 - error: Call expression not allowed in type expression (reportInvalidTypeForm) annotations_typeexpr.py:89:9 - error: List expression not allowed in type expression -  Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) +  Use list[T] to indicate a list type or T1 | T2 to indicate a union type (reportInvalidTypeForm) annotations_typeexpr.py:89:9 - error: Expected class but received "list[Unknown]" (reportGeneralTypeIssues) annotations_typeexpr.py:90:9 - error: Tuple expression not allowed in type expression -  Use tuple[T1, ..., Tn] to indicate a tuple type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) +  Use tuple[T1, ..., Tn] to indicate a tuple type or T1 | T2 to indicate a union type (reportInvalidTypeForm) annotations_typeexpr.py:91:9 - error: List expression not allowed in type expression -  Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) +  Use list[T] to indicate a list type or T1 | T2 to indicate a union type (reportInvalidTypeForm) annotations_typeexpr.py:91:9 - error: Expected class but received "list[type[int]]" (reportGeneralTypeIssues) annotations_typeexpr.py:92:9 - error: Dictionary expression not allowed in type expression -  Use Dict[T1, T2] to indicate a dictionary type (reportInvalidTypeForm) +  Use dict[T1, T2] to indicate a dictionary type (reportInvalidTypeForm) annotations_typeexpr.py:92:9 - error: Expected class but received "dict[Unknown, Unknown]" (reportGeneralTypeIssues) annotations_typeexpr.py:93:9 - error: Call expression not allowed in type expression (reportInvalidTypeForm) annotations_typeexpr.py:94:9 - error: List expression not allowed in type expression -  Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) +  Use list[T] to indicate a list type or T1 | T2 to indicate a union type (reportInvalidTypeForm) annotations_typeexpr.py:94:9 - error: Expected class but received "list[type[int]]" (reportGeneralTypeIssues) annotations_typeexpr.py:94:15 - error: Expected class but received "Literal[0]" (reportGeneralTypeIssues) annotations_typeexpr.py:95:9 - error: Ternary expression not allowed in type expression (reportInvalidTypeForm) diff --git a/conformance/results/pyright/generics_syntax_declarations.toml b/conformance/results/pyright/generics_syntax_declarations.toml index 25db91523..bc076dc93 100644 --- a/conformance/results/pyright/generics_syntax_declarations.toml +++ b/conformance/results/pyright/generics_syntax_declarations.toml @@ -6,7 +6,7 @@ generics_syntax_declarations.py:32:11 - error: Cannot access attribute "is_integ   Attribute "is_integer" is unknown (reportAttributeAccessIssue) generics_syntax_declarations.py:44:21 - error: TypeVar constraint type cannot be generic (reportGeneralTypeIssues) generics_syntax_declarations.py:48:17 - error: List expression not allowed in type expression -  Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) +  Use list[T] to indicate a list type or T1 | T2 to indicate a union type (reportInvalidTypeForm) generics_syntax_declarations.py:48:17 - error: Expected class but received "list[Unknown]" (reportGeneralTypeIssues) generics_syntax_declarations.py:60:17 - error: TypeVar must have at least two constrained types (reportGeneralTypeIssues) generics_syntax_declarations.py:64:17 - error: TypeVar must have at least two constrained types (reportGeneralTypeIssues) diff --git a/conformance/results/pyright/generics_variance_inference.toml b/conformance/results/pyright/generics_variance_inference.toml index 5c0f32e2a..9a378ad6f 100644 --- a/conformance/results/pyright/generics_variance_inference.toml +++ b/conformance/results/pyright/generics_variance_inference.toml @@ -23,12 +23,10 @@ generics_variance_inference.py:58:35 - error: Type "ShouldBeCovariant3[float]" i   "ShouldBeCovariant3[float]" is not assignable to "ShouldBeCovariant3[int]"     Type parameter "T@ShouldBeCovariant3" is covariant, but "float" is not a subtype of "int"       "float" is not assignable to "int" (reportAssignmentType) -generics_variance_inference.py:66:36 - error: Type "ShouldBeCovariant4[int]" is not assignable to declared type "ShouldBeCovariant4[float]" -  "ShouldBeCovariant4[int]" is not assignable to "ShouldBeCovariant4[float]" -    Type parameter "T@ShouldBeCovariant4" is invariant, but "int" is not the same as "float" (reportAssignmentType) generics_variance_inference.py:67:34 - error: Type "ShouldBeCovariant4[float]" is not assignable to declared type "ShouldBeCovariant4[int]"   "ShouldBeCovariant4[float]" is not assignable to "ShouldBeCovariant4[int]" -    Type parameter "T@ShouldBeCovariant4" is invariant, but "float" is not the same as "int" (reportAssignmentType) +    Type parameter "T@ShouldBeCovariant4" is covariant, but "float" is not a subtype of "int" +      "float" is not assignable to "int" (reportAssignmentType) generics_variance_inference.py:80:34 - error: Type "ShouldBeCovariant5[float]" is not assignable to declared type "ShouldBeCovariant5[int]"   "ShouldBeCovariant5[float]" is not assignable to "ShouldBeCovariant5[int]"     Type parameter "T@ShouldBeCovariant5" is covariant, but "float" is not a subtype of "int" @@ -82,7 +80,6 @@ generics_variance_inference.py:194:37 - error: Type "ShouldBeContravariant2[int]     Type parameter "T@ShouldBeContravariant2" is contravariant, but "int" is not a supertype of "float"       "float" is not assignable to "int" (reportAssignmentType) """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 66: Unexpected errors ['generics_variance_inference.py:66:36 - error: Type "ShouldBeCovariant4[int]" is not assignable to declared type "ShouldBeCovariant4[float]"'] """ diff --git a/conformance/results/pyright/qualifiers_annotated.toml b/conformance/results/pyright/qualifiers_annotated.toml index b8c271f0e..c7f60d828 100644 --- a/conformance/results/pyright/qualifiers_annotated.toml +++ b/conformance/results/pyright/qualifiers_annotated.toml @@ -9,7 +9,7 @@ qualifiers_annotated.py:46:17 - error: Dictionary expression not allowed in type qualifiers_annotated.py:46:24 - error: "b" is not defined (reportUndefinedVariable) qualifiers_annotated.py:47:17 - error: Call expression not allowed in type expression (reportInvalidTypeForm) qualifiers_annotated.py:48:17 - error: List expression not allowed in type expression -  Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) +  Use list[T] to indicate a list type or T1 | T2 to indicate a union type (reportInvalidTypeForm) qualifiers_annotated.py:48:17 - error: Expected class but received "list[type[int]]" (reportGeneralTypeIssues) qualifiers_annotated.py:48:23 - error: Expected class but received "Literal[0]" (reportGeneralTypeIssues) qualifiers_annotated.py:49:17 - error: Ternary expression not allowed in type expression (reportInvalidTypeForm) diff --git a/conformance/results/pyright/qualifiers_final_decorator.toml b/conformance/results/pyright/qualifiers_final_decorator.toml index 6a3156500..36b1e38bb 100644 --- a/conformance/results/pyright/qualifiers_final_decorator.toml +++ b/conformance/results/pyright/qualifiers_final_decorator.toml @@ -6,7 +6,7 @@ qualifiers_final_decorator.py:56:9 - error: Method "method1" cannot override fin qualifiers_final_decorator.py:60:9 - error: Method "method2" cannot override final method defined in class "Base2" (reportIncompatibleMethodOverride) qualifiers_final_decorator.py:64:9 - error: Method "method3" cannot override final method defined in class "Base2" (reportIncompatibleMethodOverride) qualifiers_final_decorator.py:75:9 - error: Method "method4" cannot override final method defined in class "Base2" (reportIncompatibleMethodOverride) -qualifiers_final_decorator.py:86:9 - error: Overload for "method" is marked @final but implementation is not (reportInconsistentOverload) +qualifiers_final_decorator.py:86:9 - error: @final decorator should be applied only to the implementation (reportInconsistentOverload) qualifiers_final_decorator.py:89:9 - error: Method "method" cannot override final method defined in class "Base3" (reportIncompatibleMethodOverride) qualifiers_final_decorator.py:102:9 - error: Method "method" cannot override final method defined in class "Base4" (reportIncompatibleMethodOverride) qualifiers_final_decorator.py:118:9 - error: Method "method" cannot override final method defined in class "Base5_2" (reportIncompatibleMethodOverride) diff --git a/conformance/results/pyright/version.toml b/conformance/results/pyright/version.toml index e8e963b77..48280a0cb 100644 --- a/conformance/results/pyright/version.toml +++ b/conformance/results/pyright/version.toml @@ -1,2 +1,2 @@ -version = "pyright 1.1.391" +version = "pyright 1.1.393" test_duration = 1.2 diff --git a/conformance/results/pytype/version.toml b/conformance/results/pytype/version.toml index 94cd5eee5..364d78136 100644 --- a/conformance/results/pytype/version.toml +++ b/conformance/results/pytype/version.toml @@ -1,2 +1,2 @@ version = "pytype 2024.10.11" -test_duration = 37.2 +test_duration = 36.6 diff --git a/conformance/results/results.html b/conformance/results/results.html index e388ee383..c2819a3ee 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -158,17 +158,17 @@

    Python Type System Conformance Test Results

     
    mypy 1.13.0
    -
    2.5sec
    +
    mypy 1.14.0
    +
    1.6sec
    pyright 1.1.389
    -
    2.5sec
    +
    pyright 1.1.391
    +
    1.2sec
    pyre 0.9.23
    -
    4.3sec
    +
    7.3sec
    pytype 2024.10.11
    -
    45.2sec
    +
    37.2sec
    @@ -247,31 +247,31 @@

    Python Type System Conformance Test Results

    Partial

    False negative on passing SymbolTable to dict[str, list[object]].

    Does not reject illegal use of Generic.

    Wrong type variable order when inheriting from multiple generic base classes.

         generics_basic
    Partial

    Does not reject the use of a constraint parameterized by another type variable.

    Pass Pass
    Partial

    False positives in examples using constrained type variables.

    False negative for constraint parameterized by a type variable.

    False negative in custom map example.

    False positive using `iter`.

    False negative for bad type arguments to Generic/Protocol.

    False negative for generic metaclass.

    Partial

    False positives in examples using constrained type variables.

    Argument 'covariant' to TypeVar not supported.

    False negative for type variables missing from Generic/Protocol base class.

    False negative for generic metaclass.

         generics_defaultsUnsupportedPartial Pass
    Unsupported

    Does not support generic defaults.

    Unsupported
         generics_defaults_referentialUnsupportedPartial Pass Unsupported Unsupported
         generics_defaults_specializationUnsupportedPartial Pass
    Unsupported

    Does not support generic defaults.

    Unsupported
         generics_paramspec_basic
    Partial

    Does not reject ParamSpec when used "bare" in type alias definition.

    Pass Pass
    Partial

    Does not enforce name consistency for ParamSpec assigned to identifier.

    Incorrectly reports error for legitimate use of ParamSpec in generic type alias.

    Does not reject ParamSpec when used in various invalid locations.

    Unsupported

    Does not support ParamSpec.

    Partial

    Does not report type violation with TypedDict value assignment.

    Does not report reference to unknown key in TypedDict.

    Does not reject `clear` method on TypedDict with required keys.

    Does not reject delete operation for required key in TypedDict.

         typeddicts_readonly
    Partial

    Incorrectly rejects NotRequired directive when used in an Annotated annotation.

    Pass Pass Pass Unsupported
         typeddicts_readonly_consistency
    Partial

    Incorrectly rejects assignment of required item to not-required read-only item.

    Pass Pass Pass Unsupported Unsupported
         typeddicts_required
    Partial

    Does not support nesting of `Annotated` and `Required` or `NotRequired`.

    Pass Pass
    Partial

    Does not reject use of `Required` in function parameter annotation.

    Does not reject nested use of `Required` in type annotation.

    Does not support recursive TypedDict definitions.

    Incorrectly complains about uninitialized attributes on TypedDict definitions.

    Incorrectly generates "attribute not initialized" errors for TypedDict fields.

    Partial

    Does not reject use of `Required` in non-TypedDict class.

    Does not reject use of `Required` in function parameter annotation.

    Does not reject nested use of `Required` in type annotation.

    Partial

    Does not enforce declared type of `_value_`.

    Does not correctly enforce assigned tuple types for enum members (optional).

    Does not evaluate literal types for enum member values (optional).

    Does not evaluate literal types for auto values (optional).

         enums_members
    Partial

    Does not treat attribute with annotation and no assignment as non-member.

    Does not reject use of annotation with enum member.

    Does not treat callables as non-members.

    Does not honor `enum.member` as method decorator.

    Does not properly handle aliased enum members.

    Does not support `_ignore_` mechanism (optional).

    Does not treat attributes with private names as non-members.

    Partial

    Does not treat attribute with annotation and no assignment as non-member.

    Does not treat callables as non-members.

    Does not honor `enum.member` as method decorator.

    Does not properly handle aliased enum members.

    Does not support `_ignore_` mechanism (optional).

    Does not treat attributes with private names as non-members.

    Pass*

    Does not support `_ignore_` mechanism (optional).

    Partial

    Does not reject use of annotation with enum member.

    Does not treat callables as non-members.

    Does not treat annotated attributes as non-members.

    Does not honor `enum.nonmember` to define non-member attribute.

    Does not honor `enum.member` as method decorator.

    Does not properly handle aliased enum members.

    Rejects use of `_ignore_`.

    Does not support `_ignore_` mechanism (optional).

    Partial

    Does not reject use of annotation with enum member.

    Does not support `enum.member` and `enum.nonmember`.

    Does not support `_ignore_` mechanism (optional).

    Partial

    Does not reject a call to "cast" with additional arguments.

         directives_deprecated
    Unsupported

    Does not support @deprecated.

    Pass Pass
    Unsupported

    Does not support @deprecated.

    Unsupported

    Does not support @deprecated.

    - - - + From 53daf3c86409a82ce3e70f2b3e3389330b65d79b Mon Sep 17 00:00:00 2001 From: Danny Yang Date: Wed, 5 Feb 2025 23:31:06 -0500 Subject: [PATCH 076/308] Add additional Unpack/kwargs conformance test cases (#1918) * add content from typeshed/CONTRIBUTING.md * fix build errors * address review comments * Update docs/guides/writing_stubs.rst Co-authored-by: Rebecca Chen * Update docs/guides/writing_stubs.rst Co-authored-by: Rebecca Chen * add Incomplete vs Any, the Any trick sections; add reference to error suppression formats section * fix ref * format and fix link * fix backticks, add Docstrings section * fix one more backtick * fix typo * fix label * Minor style and formatting fixes Removed repeated example, fixed formatting, removed stray "the". * Add additional callable kwargs conformance tests * add comments and notes * remove 2nd example --------- Co-authored-by: Rebecca Chen --- conformance/results/mypy/callables_kwargs.toml | 8 ++++++-- conformance/results/mypy/version.toml | 2 +- conformance/results/pyre/callables_kwargs.toml | 1 + conformance/results/pyre/version.toml | 2 +- conformance/results/pyright/callables_kwargs.toml | 8 ++++++-- conformance/results/pyright/version.toml | 2 +- conformance/results/pytype/callables_kwargs.toml | 1 + conformance/results/results.html | 10 +++++----- conformance/tests/callables_kwargs.py | 11 +++++++++++ 9 files changed, 33 insertions(+), 12 deletions(-) diff --git a/conformance/results/mypy/callables_kwargs.toml b/conformance/results/mypy/callables_kwargs.toml index 1b2578dd6..39eaad11f 100644 --- a/conformance/results/mypy/callables_kwargs.toml +++ b/conformance/results/mypy/callables_kwargs.toml @@ -1,4 +1,7 @@ -conformant = "Pass" +conformant = "Partial" +notes = """ +Allows callable without kwargs to be assigned to callable with unpacked kwargs +""" output = """ callables_kwargs.py:22: note: "func1" defined here callables_kwargs.py:46: error: Missing named argument "v1" for "func1" [call-arg] @@ -21,6 +24,7 @@ callables_kwargs.py:103: note: "TDProtocol5.__call__" has type "Callable[[Arg(in callables_kwargs.py:111: error: Overlap between argument names and ** TypedDict items: "v1" [misc] callables_kwargs.py:122: error: Unpack item in ** argument must be a TypedDict [misc] """ -conformance_automated = "Pass" +conformance_automated = "Fail" errors_diff = """ +Line 134: Expected 1 errors """ diff --git a/conformance/results/mypy/version.toml b/conformance/results/mypy/version.toml index 869e8bf2f..167122da3 100644 --- a/conformance/results/mypy/version.toml +++ b/conformance/results/mypy/version.toml @@ -1,2 +1,2 @@ version = "mypy 1.15.0" -test_duration = 2.0 +test_duration = 1.2 diff --git a/conformance/results/pyre/callables_kwargs.toml b/conformance/results/pyre/callables_kwargs.toml index 6714bfea2..a325fe97c 100644 --- a/conformance/results/pyre/callables_kwargs.toml +++ b/conformance/results/pyre/callables_kwargs.toml @@ -15,6 +15,7 @@ callables_kwargs.py:102:0 Incompatible variable type [9]: v4 is declared to have callables_kwargs.py:103:0 Incompatible variable type [9]: v5 is declared to have type `TDProtocol5` but is used as type `typing.Callable(func1)[[Keywords(Unpack[TD2])], None]`. callables_kwargs.py:111:21 Duplicate parameter [65]: Duplicate parameter name `v1`. callables_kwargs.py:122:12 Invalid type [31]: `Unpack` in kwargs may only be used with typed dictionaries. `Variable[T (bound to TD2)]` is not a typed dictionary. +callables_kwargs.py:134:0 Incompatible variable type [9]: v7 is declared to have type `TDProtocol6` but is used as type `typing.Callable(func7)[[KeywordOnly(v1, int), KeywordOnly(v3, str), KeywordOnly(v2, str, default)], None]`. """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyre/version.toml b/conformance/results/pyre/version.toml index 028806c2e..a23f5b07f 100644 --- a/conformance/results/pyre/version.toml +++ b/conformance/results/pyre/version.toml @@ -1,2 +1,2 @@ version = "pyre 0.9.23" -test_duration = 6.5 +test_duration = 7.8 diff --git a/conformance/results/pyright/callables_kwargs.toml b/conformance/results/pyright/callables_kwargs.toml index 9dea95b60..c0c093879 100644 --- a/conformance/results/pyright/callables_kwargs.toml +++ b/conformance/results/pyright/callables_kwargs.toml @@ -1,4 +1,7 @@ -conformant = "Pass" +conformant = "Partial" +notes = """ +Allows callable without kwargs to be assigned to callable with unpacked kwargs +""" output = """ callables_kwargs.py:28:5 - error: Could not access item in TypedDict   "v2" is not a required key in "TD2", so access may result in runtime exception (reportTypedDictNotRequiredAccess) @@ -28,6 +31,7 @@ callables_kwargs.py:103:19 - error: Type "(**kwargs: **TD2) -> None" is not assi callables_kwargs.py:111:30 - error: Typed dictionary overlaps with keyword parameter: v1 (reportGeneralTypeIssues) callables_kwargs.py:122:21 - error: Expected TypedDict type argument for Unpack (reportGeneralTypeIssues) """ -conformance_automated = "Pass" +conformance_automated = "Fail" errors_diff = """ +Line 134: Expected 1 errors """ diff --git a/conformance/results/pyright/version.toml b/conformance/results/pyright/version.toml index 48280a0cb..20ccca9bd 100644 --- a/conformance/results/pyright/version.toml +++ b/conformance/results/pyright/version.toml @@ -1,2 +1,2 @@ version = "pyright 1.1.393" -test_duration = 1.2 +test_duration = 1.4 diff --git a/conformance/results/pytype/callables_kwargs.toml b/conformance/results/pytype/callables_kwargs.toml index a44b3c5c5..9e727daec 100644 --- a/conformance/results/pytype/callables_kwargs.toml +++ b/conformance/results/pytype/callables_kwargs.toml @@ -82,6 +82,7 @@ Line 102: Expected 1 errors Line 103: Expected 1 errors Line 111: Expected 1 errors Line 122: Expected 1 errors +Line 134: Expected 1 errors Line 10: Unexpected errors ['callables_kwargs.py:10:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.Unpack not supported yet [not-supported-yet]'] Line 24: Unexpected errors ['callables_kwargs.py:24:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: Unpack[TD2] [assert-type]'] Line 32: Unexpected errors ['callables_kwargs.py:32:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: Unpack[TD2] [assert-type]'] diff --git a/conformance/results/results.html b/conformance/results/results.html index c2819a3ee..7be25aaad 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -159,13 +159,13 @@

    Python Type System Conformance Test Results

     
    mypy 1.14.0
    -
    1.6sec
    +
    mypy 1.15.0
    +
    2.0sec
    pyright 1.1.391
    +
    pyright 1.1.393
    1.2sec
    pyre 0.9.23
    -
    7.3sec
    +
    6.5sec
    pytype 2024.10.11
    -
    37.2sec
    +
    36.6sec
    @@ -277,7 +277,7 @@

    Python Type System Conformance Test Results

    Unsupported

    Does not support ParamSpec.

         generics_paramspec_components
    Partial

    Does not report illegal use of "P.args" on normal parameter.

    Does not report error when P.args is specified but P.kwargs is missing.

    Does not report error when P is out of scope and P.args and P.kwargs is used.

    Does not report error when keyword argument is specified between P.args and P.kwargs.

    Pass Pass
    Partial

    Does not report illegal use of "P.args" on normal parameter.

    Does not report error when P.args is specified but P.kwargs is missing.

    Does not report error when P is out of scope and P.args and P.kwargs is used.

    Does not report error when calling callback defined with ParamSpec with incorrect arguments.

    Does not report error when keyword argument is specified between P.args and P.kwargs.

    Does not report error when calling callable and argument is missing for concatenated parameters.

    Unsupported

    Does not support ParamSpec.

    - - + + diff --git a/conformance/tests/callables_kwargs.py b/conformance/tests/callables_kwargs.py index d8138efed..c52319fc1 100644 --- a/conformance/tests/callables_kwargs.py +++ b/conformance/tests/callables_kwargs.py @@ -121,3 +121,14 @@ def func5(v1: int, **kwargs: Unpack[TD2]) -> None: # E: parameter v1 overlaps w def func6(**kwargs: Unpack[T]) -> None: # E: unpacked value must be a TypedDict, not a TypeVar bound to TypedDict. ... + +# > The situation where the destination callable contains **kwargs: Unpack[TypedDict] and +# > the source callable doesn’t contain **kwargs should be disallowed. This is because, +# > we cannot be sure that additional keyword arguments are not being passed in when an instance of a subclass +# > had been assigned to a variable with a base class type and then unpacked in the destination callable invocation + +def func7(*, v1: int, v3: str, v2: str = "") -> None: + ... + + +v7: TDProtocol6 = func7 # E: source does not have kwargs From 7da7f02f33cf8f7a607a249392d5098274549756 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20S=C5=82awecki?= Date: Mon, 10 Feb 2025 22:18:22 +0100 Subject: [PATCH 077/308] Glossary: Clarify which types don't participate in subtyping (#1907) --- docs/spec/glossary.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/spec/glossary.rst b/docs/spec/glossary.rst index f17ffb617..1acbcc956 100644 --- a/docs/spec/glossary.rst +++ b/docs/spec/glossary.rst @@ -73,10 +73,10 @@ This section defines a few terms that may be used elsewhere in the specification contains ``Any`` or another :term:`gradual form`. A gradual type does not necessarily represent a single set of possible runtime values; instead it can represent a set of possible static types (a set of possible sets of - possible runtime values). Gradual types do not participate in the - :term:`subtype` relation, but they do participate in :term:`consistency - ` and :term:`assignability `. They can be - :term:`materialized ` to a more static, or fully static, + possible runtime values). Gradual types which are not fully static do not + participate in the :term:`subtype` relation, but they do participate in + :term:`consistency ` and :term:`assignability `. + They can be :term:`materialized ` to a more static, or fully static, type. See :ref:`type-system-concepts`. inline From 05b979d50aa9f92a7a2eebb0bcfac525099fe518 Mon Sep 17 00:00:00 2001 From: Eric Traut Date: Mon, 17 Feb 2025 12:45:48 -0700 Subject: [PATCH 078/308] Updated conformance tests for pyright 1.1.394. (#1926) This version of pyright fixes a conformance issue detected by the `callables_kwargs` test. Also updated the `annotations_generatosr` and `annotations_coroutines` test cases to accommodate a more precise (narrower) type inferred for `async def` functions. Pyright now infers `types.CoroutineType` rather than `typing.Coroutine`. Both are correct and should be accepted by the test. --- .../results/mypy/annotations_generators.toml | 6 +++--- conformance/results/mypy/version.toml | 2 +- .../results/pyre/annotations_generators.toml | 10 +++++----- conformance/results/pyre/version.toml | 2 +- .../results/pyright/annotations_generators.toml | 6 +++--- conformance/results/pyright/callables_kwargs.toml | 9 ++++----- conformance/results/pyright/version.toml | 4 ++-- .../results/pytype/annotations_generators.toml | 14 +++++++------- conformance/results/pytype/version.toml | 2 +- conformance/results/results.html | 12 ++++++------ conformance/tests/annotations_coroutines.py | 5 ++++- conformance/tests/annotations_generators.py | 5 ++++- 12 files changed, 41 insertions(+), 36 deletions(-) diff --git a/conformance/results/mypy/annotations_generators.toml b/conformance/results/mypy/annotations_generators.toml index 475411412..d906218f1 100644 --- a/conformance/results/mypy/annotations_generators.toml +++ b/conformance/results/mypy/annotations_generators.toml @@ -11,12 +11,12 @@ annotations_generators.py:71: error: No return value expected [return-value] annotations_generators.py:75: error: Incompatible types in "yield" (actual type "B", expected type "A") [misc] annotations_generators.py:86: error: The return type of a generator function should be "Generator" or one of its supertypes [misc] annotations_generators.py:91: error: The return type of an async generator function should be "AsyncGenerator" or one of its supertypes [misc] -annotations_generators.py:118: error: Incompatible types in "yield from" (actual type "A", expected type "B") [misc] -annotations_generators.py:119: error: Incompatible types in "yield from" (actual type "int", expected type "B") [misc] +annotations_generators.py:116: error: Incompatible types in "yield from" (actual type "A", expected type "B") [misc] +annotations_generators.py:117: error: Incompatible types in "yield from" (actual type "int", expected type "B") [misc] """ conformance_automated = "Fail" errors_diff = """ Line 87: Expected 1 errors Line 92: Expected 1 errors -Line 135: Expected 1 errors +Line 133: Expected 1 errors """ diff --git a/conformance/results/mypy/version.toml b/conformance/results/mypy/version.toml index 167122da3..b3982776b 100644 --- a/conformance/results/mypy/version.toml +++ b/conformance/results/mypy/version.toml @@ -1,2 +1,2 @@ version = "mypy 1.15.0" -test_duration = 1.2 +test_duration = 1.8 diff --git a/conformance/results/pyre/annotations_generators.toml b/conformance/results/pyre/annotations_generators.toml index 4ce5994d1..4fdff0424 100644 --- a/conformance/results/pyre/annotations_generators.toml +++ b/conformance/results/pyre/annotations_generators.toml @@ -12,15 +12,15 @@ annotations_generators.py:87:4 Incompatible return type [7]: Expected `int` but annotations_generators.py:88:4 Incompatible return type [7]: Expected `int` but got `Generator[typing.Any, typing.Any, int]`. annotations_generators.py:91:0 Incompatible async generator return type [57]: Expected return annotation to be AsyncGenerator or a superclass but got `int`. annotations_generators.py:92:4 Incompatible return type [7]: Expected `int` but got `AsyncGenerator[None, typing.Any]`. -annotations_generators.py:118:4 Incompatible return type [7]: Expected `Iterator[B]` but got `Generator[A, None, typing.Any]`. -annotations_generators.py:119:4 Incompatible return type [7]: Expected `Iterator[B]` but got `Generator[int, None, typing.Any]`. -annotations_generators.py:135:4 Incompatible return type [7]: Expected `Generator[None, str, None]` but got `Generator[None, int, typing.Any]`. -annotations_generators.py:182:0 Assert type [70]: Expected `typing.Callable[[], Coroutine[typing.Any, typing.Any, AsyncIterator[int]]]` but got `typing.Callable(generator29)[[], AsyncIterator[int]]`. +annotations_generators.py:116:4 Incompatible return type [7]: Expected `Iterator[B]` but got `Generator[A, None, typing.Any]`. +annotations_generators.py:117:4 Incompatible return type [7]: Expected `Iterator[B]` but got `Generator[int, None, typing.Any]`. +annotations_generators.py:133:4 Incompatible return type [7]: Expected `Generator[None, str, None]` but got `Generator[None, int, typing.Any]`. +annotations_generators.py:183:0 Incompatible variable type [9]: v1 is declared to have type `typing.Callable[[], Coroutine[typing.Any, typing.Any, AsyncIterator[int]]]` but is used as type `typing.Callable(generator29)[[], AsyncIterator[int]]`. """ conformance_automated = "Fail" errors_diff = """ Line 51: Expected 1 errors Line 86: Expected 1 errors Line 88: Unexpected errors ['annotations_generators.py:88:4 Incompatible return type [7]: Expected `int` but got `Generator[typing.Any, typing.Any, int]`.'] -Line 182: Unexpected errors ['annotations_generators.py:182:0 Assert type [70]: Expected `typing.Callable[[], Coroutine[typing.Any, typing.Any, AsyncIterator[int]]]` but got `typing.Callable(generator29)[[], AsyncIterator[int]]`.'] +Line 183: Unexpected errors ['annotations_generators.py:183:0 Incompatible variable type [9]: v1 is declared to have type `typing.Callable[[], Coroutine[typing.Any, typing.Any, AsyncIterator[int]]]` but is used as type `typing.Callable(generator29)[[], AsyncIterator[int]]`.'] """ diff --git a/conformance/results/pyre/version.toml b/conformance/results/pyre/version.toml index a23f5b07f..028806c2e 100644 --- a/conformance/results/pyre/version.toml +++ b/conformance/results/pyre/version.toml @@ -1,2 +1,2 @@ version = "pyre 0.9.23" -test_duration = 7.8 +test_duration = 6.5 diff --git a/conformance/results/pyright/annotations_generators.toml b/conformance/results/pyright/annotations_generators.toml index fd4b61db3..aca80497f 100644 --- a/conformance/results/pyright/annotations_generators.toml +++ b/conformance/results/pyright/annotations_generators.toml @@ -18,15 +18,15 @@ annotations_generators.py:91:27 - error: Return type of async generator function   "AsyncGenerator[Any, Any, Any]" is not assignable to "int" (reportInvalidTypeForm) annotations_generators.py:92:11 - error: Return type of async generator function must be compatible with "AsyncGenerator[None, Any]"   "AsyncGenerator[None, Unknown, Unknown]" is not assignable to "int" (reportReturnType) -annotations_generators.py:118:16 - error: Return type of generator function must be compatible with "Generator[A, Any, Any]" +annotations_generators.py:116:16 - error: Return type of generator function must be compatible with "Generator[A, Any, Any]"   "Generator[A, Unknown, Unknown]" is not assignable to "Iterator[B]"     Type parameter "_T_co@Iterator" is covariant, but "A" is not a subtype of "B"       "A" is not assignable to "B" (reportReturnType) -annotations_generators.py:119:16 - error: Return type of generator function must be compatible with "Generator[int, Any, Any]" +annotations_generators.py:117:16 - error: Return type of generator function must be compatible with "Generator[int, Any, Any]"   "Generator[int, Unknown, Unknown]" is not assignable to "Iterator[B]"     Type parameter "_T_co@Iterator" is covariant, but "int" is not a subtype of "B"       "int" is not assignable to "B" (reportReturnType) -annotations_generators.py:135:16 - error: Return type of generator function must be compatible with "Generator[None, Any, Any]" +annotations_generators.py:133:16 - error: Return type of generator function must be compatible with "Generator[None, Any, Any]"   "Generator[None, int, Unknown]" is not assignable to "Generator[None, str, None]"     Type parameter "_SendT_contra@Generator" is contravariant, but "int" is not a supertype of "str"       "str" is not assignable to "int" (reportReturnType) diff --git a/conformance/results/pyright/callables_kwargs.toml b/conformance/results/pyright/callables_kwargs.toml index c0c093879..0af9273e8 100644 --- a/conformance/results/pyright/callables_kwargs.toml +++ b/conformance/results/pyright/callables_kwargs.toml @@ -1,7 +1,4 @@ conformant = "Partial" -notes = """ -Allows callable without kwargs to be assigned to callable with unpacked kwargs -""" output = """ callables_kwargs.py:28:5 - error: Could not access item in TypedDict   "v2" is not a required key in "TD2", so access may result in runtime exception (reportTypedDictNotRequiredAccess) @@ -30,8 +27,10 @@ callables_kwargs.py:103:19 - error: Type "(**kwargs: **TD2) -> None" is not assi       Extra parameter "v3" (reportAssignmentType) callables_kwargs.py:111:30 - error: Typed dictionary overlaps with keyword parameter: v1 (reportGeneralTypeIssues) callables_kwargs.py:122:21 - error: Expected TypedDict type argument for Unpack (reportGeneralTypeIssues) +callables_kwargs.py:134:19 - error: Type "(*, v1: int, v3: str, v2: str = "") -> None" is not assignable to declared type "TDProtocol6" +  Type "(*, v1: int, v3: str, v2: str = "") -> None" is not assignable to type "(**kwargs: **TD2) -> None" +    Parameter "**kwargs" has no corresponding parameter (reportAssignmentType) """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 134: Expected 1 errors """ diff --git a/conformance/results/pyright/version.toml b/conformance/results/pyright/version.toml index 20ccca9bd..bf9b4ead6 100644 --- a/conformance/results/pyright/version.toml +++ b/conformance/results/pyright/version.toml @@ -1,2 +1,2 @@ -version = "pyright 1.1.393" -test_duration = 1.4 +version = "pyright 1.1.394" +test_duration = 1.3 diff --git a/conformance/results/pytype/annotations_generators.toml b/conformance/results/pytype/annotations_generators.toml index 50bb6423c..af2954999 100644 --- a/conformance/results/pytype/annotations_generators.toml +++ b/conformance/results/pytype/annotations_generators.toml @@ -46,26 +46,26 @@ async def generator9() -> int: # E: incompatible return type yield None # E \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m -annotations_generators.py:100:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Bad return type 'IntIterator' for generator function generator15 [bad-yield-annotation] +annotations_generators.py:99:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Bad return type 'IntIterator' for generator function generator15 [bad-yield-annotation] def generator15() -> IntIterator: # OK \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m yield 0 \u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m -annotations_generators.py:109:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Bad return type 'AsyncIntIterator' for async generator function generator16 [bad-yield-annotation] +annotations_generators.py:107:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Bad return type 'AsyncIntIterator' for async generator function generator16 [bad-yield-annotation] async def generator16() -> AsyncIntIterator: # OK \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m yield 0 \u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m -annotations_generators.py:118:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in generator18: bad return type [bad-return-type] +annotations_generators.py:116:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in generator18: bad return type [bad-return-type] yield from generator17() # E: incompatible generator type \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -annotations_generators.py:119:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in generator18: bad return type [bad-return-type] +annotations_generators.py:117:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in generator18: bad return type [bad-return-type] yield from [1] # E: incompatible generator type \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -76,7 +76,7 @@ errors_diff = """ Line 51: Expected 1 errors Line 87: Expected 1 errors Line 92: Expected 1 errors -Line 135: Expected 1 errors -Line 100: Unexpected errors ["annotations_generators.py:100:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Bad return type 'IntIterator' for generator function generator15 [bad-yield-annotation]"] -Line 109: Unexpected errors ["annotations_generators.py:109:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Bad return type 'AsyncIntIterator' for async generator function generator16 [bad-yield-annotation]"] +Line 133: Expected 1 errors +Line 99: Unexpected errors ["annotations_generators.py:99:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Bad return type 'IntIterator' for generator function generator15 [bad-yield-annotation]"] +Line 107: Unexpected errors ["annotations_generators.py:107:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Bad return type 'AsyncIntIterator' for async generator function generator16 [bad-yield-annotation]"] """ diff --git a/conformance/results/pytype/version.toml b/conformance/results/pytype/version.toml index 364d78136..10c237d65 100644 --- a/conformance/results/pytype/version.toml +++ b/conformance/results/pytype/version.toml @@ -1,2 +1,2 @@ version = "pytype 2024.10.11" -test_duration = 36.6 +test_duration = 34.9 diff --git a/conformance/results/results.html b/conformance/results/results.html index 7be25aaad..0777464b3 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -159,16 +159,16 @@

    Python Type System Conformance Test Results

     
    mypy 1.15.0
    -
    2.0sec
    +
    1.2sec
    pyright 1.1.393
    -
    1.2sec
    +
    1.4sec
    pyre 0.9.23
    -
    6.5sec
    +
    7.8sec
    pytype 2024.10.11
    36.6sec
    @@ -607,8 +607,8 @@

    Python Type System Conformance Test Results

    Partial

    Does not support Concatenate.

    Does not treat "*args: Any, **kwargs: Any" as "...".

         callables_kwargsPassPass
    Partial

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

    Partial

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

    Pass
    Unsupported

    Does not understand Unpack in the context of **kwargs annotation.

    - - + diff --git a/conformance/tests/annotations_coroutines.py b/conformance/tests/annotations_coroutines.py index b2200f6fe..d5b145f45 100644 --- a/conformance/tests/annotations_coroutines.py +++ b/conformance/tests/annotations_coroutines.py @@ -16,7 +16,10 @@ async def func1(ignored: int, /) -> str: return "spam" -assert_type(func1, Callable[[int], Coroutine[Any, Any, str]]) +# Don't use assert_type here because some type checkers infer +# the narrower type types.CoroutineType rather than typing.Coroutine +# in this case. +v1: Callable[[int], Coroutine[Any, Any, str]] = func1 async def func2() -> None: diff --git a/conformance/tests/annotations_generators.py b/conformance/tests/annotations_generators.py index 43d53c0e5..2def79eaa 100644 --- a/conformance/tests/annotations_generators.py +++ b/conformance/tests/annotations_generators.py @@ -179,7 +179,10 @@ async def generator29() -> AsyncIterator[int]: raise NotImplementedError -assert_type(generator29, Callable[[], Coroutine[Any, Any, AsyncIterator[int]]]) +# Don't use assert_type here because some type checkers infer +# the narrower type types.CoroutineType rather than typing.Coroutine +# in this case. +v1: Callable[[], Coroutine[Any, Any, AsyncIterator[int]]] = generator29 async def generator30() -> AsyncIterator[int]: From fafcdeb724ac22ace877bee4485ed3b4c3edbbd8 Mon Sep 17 00:00:00 2001 From: Eric Traut Date: Mon, 17 Feb 2025 12:51:18 -0700 Subject: [PATCH 079/308] Fixed manual scoring results for conformance report (#1927) Fixed manual scoring results for conformance report. I forgot to make this change in the previous commit. --- conformance/results/pyright/callables_kwargs.toml | 2 +- conformance/results/results.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/conformance/results/pyright/callables_kwargs.toml b/conformance/results/pyright/callables_kwargs.toml index 0af9273e8..191d97a58 100644 --- a/conformance/results/pyright/callables_kwargs.toml +++ b/conformance/results/pyright/callables_kwargs.toml @@ -1,4 +1,4 @@ -conformant = "Partial" +conformant = "Pass" output = """ callables_kwargs.py:28:5 - error: Could not access item in TypedDict   "v2" is not a required key in "TD2", so access may result in runtime exception (reportTypedDictNotRequiredAccess) diff --git a/conformance/results/results.html b/conformance/results/results.html index 0777464b3..ba1f3d8e2 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -608,7 +608,7 @@

    Python Type System Conformance Test Results

    - + From 8d3f04156b3bdb7371510597408d717901ce827a Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Wed, 5 Mar 2025 20:53:58 +0100 Subject: [PATCH 080/308] Update URLs to typing.python.org (#1940) --- .github/ISSUE_TEMPLATE/documentation-issue.md | 2 +- README.md | 8 ++-- conformance/README.md | 42 +++++++++---------- docs/README.rst | 2 +- 4 files changed, 27 insertions(+), 27 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/documentation-issue.md b/.github/ISSUE_TEMPLATE/documentation-issue.md index 6122c8f56..e8d7bc938 100644 --- a/.github/ISSUE_TEMPLATE/documentation-issue.md +++ b/.github/ISSUE_TEMPLATE/documentation-issue.md @@ -1,6 +1,6 @@ --- name: Documentation issue -about: Report a problem or suggest changes for the documentation at https://typing.readthedocs.io/ +about: Report a problem or suggest changes for the documentation at https://typing.python.org/ title: '' labels: 'topic: documentation' assignees: '' diff --git a/README.md b/README.md index 09fb4f1b0..3624c5041 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ ## Documentation and Support The documentation for Python's static typing can be found at -[typing.readthedocs.io](https://typing.readthedocs.io/). You can get +[typing.python.org](https://typing.python.org/). You can get help in our [support forum](https://github.com/python/typing/discussions). Improvements to the type system should be discussed on @@ -20,10 +20,10 @@ For conversations that are more suitable to a chat platform, you can use one of This GitHub repository is used for several things: -- The documentation at [typing.readthedocs.io](https://typing.readthedocs.io/) +- The documentation at [typing.python.org](https://typing.python.org/) is maintained in the [docs directory](./docs). This includes the - [specification](https://typing.readthedocs.io/en/latest/spec/index.html) for the - type system. See especially [the update procedure](https://typing.readthedocs.io/en/latest/spec/meta.html) + [specification](https://typing.python.org/en/latest/spec/index.html) for the + type system. See especially [the update procedure](https://typing.python.org/en/latest/spec/meta.html) for the spec. - A [discussion forum](https://github.com/python/typing/discussions) for typing-related user diff --git a/conformance/README.md b/conformance/README.md index 260b5ca03..c5f04b0d1 100644 --- a/conformance/README.md +++ b/conformance/README.md @@ -2,7 +2,7 @@ ## Motivation -[PEP 729](https://peps.python.org/pep-0729/) provides a structured and documented way to specify and evolve the Python type system. In support of this effort, an official [Python typing spec](https://github.com/python/typing/tree/main/docs/spec) has been drafted. This spec consolidates details from various historical typing-related PEPs. The spec will be modified over time to clarify unspecified and under-specified parts of the type system. It will also be extended to cover new features of the type system. +[PEP 729](https://peps.python.org/pep-0729/) provides a structured and documented way to specify and evolve the Python type system. In support of this effort, an official [Python typing spec](https://typing.python.org/en/latest/spec/) has been drafted. This spec consolidates details from various historical typing-related PEPs. The spec will be modified over time to clarify unspecified and under-specified parts of the type system. It will also be extended to cover new features of the type system. Accompanying the typing specification is this conformance test suite which validates the behavior of static type checkers against the specification. @@ -10,26 +10,26 @@ Accompanying the typing specification is this conformance test suite which valid This project contains test cases for behaviors defined in the Python typing spec. Tests are structured and grouped in accordance with the specification's chapter headings. -* [concepts](https://typing.readthedocs.io/en/latest/spec/concepts.html) -* [annotations](https://typing.readthedocs.io/en/latest/spec/annotations.html) -* [specialtypes](https://typing.readthedocs.io/en/latest/spec/special-types.html) -* [generics](https://typing.readthedocs.io/en/latest/spec/generics.html) -* [qualifiers](https://typing.readthedocs.io/en/latest/spec/qualifiers.html) -* [classes](https://typing.readthedocs.io/en/latest/spec/class-compat.html) -* [aliases](https://typing.readthedocs.io/en/latest/spec/aliases.html) -* [literals](https://typing.readthedocs.io/en/latest/spec/literal.html) -* [protocols](https://typing.readthedocs.io/en/latest/spec/protocol.html) -* [callables](https://typing.readthedocs.io/en/latest/spec/callables.html) -* [constructors](https://typing.readthedocs.io/en/latest/spec/constructors.html) -* [overloads](https://typing.readthedocs.io/en/latest/spec/overload.html) -* [dataclasses](https://typing.readthedocs.io/en/latest/spec/dataclasses.html) -* [typeddicts](https://typing.readthedocs.io/en/latest/spec/typeddict.html) -* [tuples](https://typing.readthedocs.io/en/latest/spec/tuples.html) -* [namedtuples](https://typing.readthedocs.io/en/latest/spec/namedtuples.html) -* [narrowing](https://typing.readthedocs.io/en/latest/spec/narrowing.html) -* [directives](https://typing.readthedocs.io/en/latest/spec/directives.html) -* [distribution](https://typing.readthedocs.io/en/latest/spec/distributing.html) -* [historical](https://typing.readthedocs.io/en/latest/spec/historical.html) +* [concepts](https://typing.python.org/en/latest/spec/concepts.html) +* [annotations](https://typing.python.org/en/latest/spec/annotations.html) +* [specialtypes](https://typing.python.org/en/latest/spec/special-types.html) +* [generics](https://typing.python.org/en/latest/spec/generics.html) +* [qualifiers](https://typing.python.org/en/latest/spec/qualifiers.html) +* [classes](https://typing.python.org/en/latest/spec/class-compat.html) +* [aliases](https://typing.python.org/en/latest/spec/aliases.html) +* [literals](https://typing.python.org/en/latest/spec/literal.html) +* [protocols](https://typing.python.org/en/latest/spec/protocol.html) +* [callables](https://typing.python.org/en/latest/spec/callables.html) +* [constructors](https://typing.python.org/en/latest/spec/constructors.html) +* [overloads](https://typing.python.org/en/latest/spec/overload.html) +* [dataclasses](https://typing.python.org/en/latest/spec/dataclasses.html) +* [typeddicts](https://typing.python.org/en/latest/spec/typeddict.html) +* [tuples](https://typing.python.org/en/latest/spec/tuples.html) +* [namedtuples](https://typing.python.org/en/latest/spec/namedtuples.html) +* [narrowing](https://typing.python.org/en/latest/spec/narrowing.html) +* [directives](https://typing.python.org/en/latest/spec/directives.html) +* [distribution](https://typing.python.org/en/latest/spec/distributing.html) +* [historical](https://typing.python.org/en/latest/spec/historical.html) A test file is a ".py" file. The file name should start with one of the above names followed by a description of the test (with words separated by underscores). For example, `generics_paramspec_basic_usage.py` would contain the basic usage tests for `ParamSpec`. Each test file can contain multiple individual unit tests, but these tests should be related to each other. If the number of unit tests in a single test file exceeds ten, it may be desirable to split it into separate test files. This will help maintain a consistent level of granularity across tests. diff --git a/docs/README.rst b/docs/README.rst index 6b431c811..c2f4cdf08 100644 --- a/docs/README.rst +++ b/docs/README.rst @@ -5,7 +5,7 @@ Reading the docs ================= The live documentation for Python's static typing can be found at -`typing.readthedocs.io `_. +`typing.python.org `_. Building the docs ================= From 811a8671427f7fefb56549830e3bd3db63001535 Mon Sep 17 00:00:00 2001 From: Eric Traut Date: Mon, 10 Mar 2025 13:08:27 -0600 Subject: [PATCH 081/308] Added "Importing Final Variables" section (#1937) * Added "Importing Final Variables" section * Clarified that this rule applies only to an import statement. --- docs/spec/qualifiers.rst | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/docs/spec/qualifiers.rst b/docs/spec/qualifiers.rst index 7ba4d9f4a..d6105c7b2 100644 --- a/docs/spec/qualifiers.rst +++ b/docs/spec/qualifiers.rst @@ -207,6 +207,34 @@ following should be allowed:: item or a :ref:`NamedTuple ` field. Such usage also generates an error at runtime. + +Importing ``Final`` Variables +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +If a module declares a ``Final`` variable and another module imports that +variable in an import statement by name or wildcard, the imported symbol +inherits the ``Final`` type qualifier. Any attempt to assign a different value +to this symbol should be flagged as an error by a type checker:: + + # lib/submodule.py + from typing import Final + PI: Final = 3.14 + + # lib/__init__.py + from .submodule import PI # PI is Final + + # test1.py + from lib import PI + PI = 0 # Error: Can't assign to Final value + + from lib import PI as PI2 + PI2 = 0 # Error: Can't assign to Final value + + # test2.py + from lib import * + PI = 0 # Error: Can't assign to Final value + + .. _`annotated`: ``Annotated`` From be7ba9750c129d7c33bc803b6648f4d199d8fe06 Mon Sep 17 00:00:00 2001 From: Eric Traut Date: Tue, 11 Mar 2025 01:09:44 -0600 Subject: [PATCH 082/308] Implemented conformance tests for imported Final variables (#1942) Implemented conformance tests for typing spec involving imported Final variables. --- .../results/mypy/annotations_generators.toml | 6 ++--- .../mypy/qualifiers_final_annotation.toml | 2 ++ conformance/results/mypy/version.toml | 2 +- .../results/pyre/annotations_generators.toml | 10 ++++---- .../pyre/qualifiers_final_annotation.toml | 3 +++ conformance/results/pyre/version.toml | 2 +- .../pyright/annotations_generators.toml | 18 ++++++++++----- .../results/pyright/callables_subtyping.toml | 4 +++- .../pyright/qualifiers_final_annotation.toml | 2 ++ conformance/results/pyright/version.toml | 2 +- .../pytype/annotations_generators.toml | 14 +++++------ .../pytype/qualifiers_final_annotation.toml | 17 +++++++++++++- conformance/results/pytype/version.toml | 2 +- conformance/results/results.html | 12 +++++----- .../tests/_qualifiers_final_annotation_1.py | 7 ++++++ .../tests/_qualifiers_final_annotation_2.py | 7 ++++++ .../tests/qualifiers_final_annotation.py | 23 +++++++++++++++---- 17 files changed, 96 insertions(+), 37 deletions(-) create mode 100644 conformance/tests/_qualifiers_final_annotation_1.py create mode 100644 conformance/tests/_qualifiers_final_annotation_2.py diff --git a/conformance/results/mypy/annotations_generators.toml b/conformance/results/mypy/annotations_generators.toml index d906218f1..475411412 100644 --- a/conformance/results/mypy/annotations_generators.toml +++ b/conformance/results/mypy/annotations_generators.toml @@ -11,12 +11,12 @@ annotations_generators.py:71: error: No return value expected [return-value] annotations_generators.py:75: error: Incompatible types in "yield" (actual type "B", expected type "A") [misc] annotations_generators.py:86: error: The return type of a generator function should be "Generator" or one of its supertypes [misc] annotations_generators.py:91: error: The return type of an async generator function should be "AsyncGenerator" or one of its supertypes [misc] -annotations_generators.py:116: error: Incompatible types in "yield from" (actual type "A", expected type "B") [misc] -annotations_generators.py:117: error: Incompatible types in "yield from" (actual type "int", expected type "B") [misc] +annotations_generators.py:118: error: Incompatible types in "yield from" (actual type "A", expected type "B") [misc] +annotations_generators.py:119: error: Incompatible types in "yield from" (actual type "int", expected type "B") [misc] """ conformance_automated = "Fail" errors_diff = """ Line 87: Expected 1 errors Line 92: Expected 1 errors -Line 133: Expected 1 errors +Line 135: Expected 1 errors """ diff --git a/conformance/results/mypy/qualifiers_final_annotation.toml b/conformance/results/mypy/qualifiers_final_annotation.toml index d0898be41..2d0cea337 100644 --- a/conformance/results/mypy/qualifiers_final_annotation.toml +++ b/conformance/results/mypy/qualifiers_final_annotation.toml @@ -35,6 +35,8 @@ qualifiers_final_annotation.py:145: error: Cannot assign to final name "x" [mis qualifiers_final_annotation.py:147: error: Cannot assign to final name "x" [misc] qualifiers_final_annotation.py:152: error: Incompatible types in assignment (expression has type "TextIOWrapper[_WrappedBuffer]", variable has type "int") [assignment] qualifiers_final_annotation.py:155: error: Cannot assign to final name "x" [misc] +qualifiers_final_annotation.py:166: error: Cannot assign to final name "TEN" [misc] +qualifiers_final_annotation.py:170: error: Cannot assign to final name "PI" [misc] """ conformance_automated = "Fail" errors_diff = """ diff --git a/conformance/results/mypy/version.toml b/conformance/results/mypy/version.toml index b3982776b..e5c363db9 100644 --- a/conformance/results/mypy/version.toml +++ b/conformance/results/mypy/version.toml @@ -1,2 +1,2 @@ version = "mypy 1.15.0" -test_duration = 1.8 +test_duration = 1.7 diff --git a/conformance/results/pyre/annotations_generators.toml b/conformance/results/pyre/annotations_generators.toml index 4fdff0424..865d139d2 100644 --- a/conformance/results/pyre/annotations_generators.toml +++ b/conformance/results/pyre/annotations_generators.toml @@ -12,15 +12,15 @@ annotations_generators.py:87:4 Incompatible return type [7]: Expected `int` but annotations_generators.py:88:4 Incompatible return type [7]: Expected `int` but got `Generator[typing.Any, typing.Any, int]`. annotations_generators.py:91:0 Incompatible async generator return type [57]: Expected return annotation to be AsyncGenerator or a superclass but got `int`. annotations_generators.py:92:4 Incompatible return type [7]: Expected `int` but got `AsyncGenerator[None, typing.Any]`. -annotations_generators.py:116:4 Incompatible return type [7]: Expected `Iterator[B]` but got `Generator[A, None, typing.Any]`. -annotations_generators.py:117:4 Incompatible return type [7]: Expected `Iterator[B]` but got `Generator[int, None, typing.Any]`. -annotations_generators.py:133:4 Incompatible return type [7]: Expected `Generator[None, str, None]` but got `Generator[None, int, typing.Any]`. -annotations_generators.py:183:0 Incompatible variable type [9]: v1 is declared to have type `typing.Callable[[], Coroutine[typing.Any, typing.Any, AsyncIterator[int]]]` but is used as type `typing.Callable(generator29)[[], AsyncIterator[int]]`. +annotations_generators.py:118:4 Incompatible return type [7]: Expected `Iterator[B]` but got `Generator[A, None, typing.Any]`. +annotations_generators.py:119:4 Incompatible return type [7]: Expected `Iterator[B]` but got `Generator[int, None, typing.Any]`. +annotations_generators.py:135:4 Incompatible return type [7]: Expected `Generator[None, str, None]` but got `Generator[None, int, typing.Any]`. +annotations_generators.py:185:0 Incompatible variable type [9]: v1 is declared to have type `typing.Callable[[], Coroutine[typing.Any, typing.Any, AsyncIterator[int]]]` but is used as type `typing.Callable(generator29)[[], AsyncIterator[int]]`. """ conformance_automated = "Fail" errors_diff = """ Line 51: Expected 1 errors Line 86: Expected 1 errors Line 88: Unexpected errors ['annotations_generators.py:88:4 Incompatible return type [7]: Expected `int` but got `Generator[typing.Any, typing.Any, int]`.'] -Line 183: Unexpected errors ['annotations_generators.py:183:0 Incompatible variable type [9]: v1 is declared to have type `typing.Callable[[], Coroutine[typing.Any, typing.Any, AsyncIterator[int]]]` but is used as type `typing.Callable(generator29)[[], AsyncIterator[int]]`.'] +Line 185: Unexpected errors ['annotations_generators.py:185:0 Incompatible variable type [9]: v1 is declared to have type `typing.Callable[[], Coroutine[typing.Any, typing.Any, AsyncIterator[int]]]` but is used as type `typing.Callable(generator29)[[], AsyncIterator[int]]`.'] """ diff --git a/conformance/results/pyre/qualifiers_final_annotation.toml b/conformance/results/pyre/qualifiers_final_annotation.toml index 1e7cb4c6d..f9b7dff8d 100644 --- a/conformance/results/pyre/qualifiers_final_annotation.toml +++ b/conformance/results/pyre/qualifiers_final_annotation.toml @@ -3,6 +3,7 @@ notes = """ Does not report Final variable with missing initialization in module scope. Does not report error for invalid nesting of Final and ClassVar. Does not treat use of Final name as if it was replaced by the literal in NamedTuple definition. +Does not reject modification of imported variable declared Final. """ output = """ qualifiers_final_annotation.py:18:6 Invalid type parameters [24]: Generic type `Final` expects 1 type parameter, received 2. @@ -33,5 +34,7 @@ errors_diff = """ Line 16: Expected 1 errors Line 107: Expected 1 errors Line 108: Expected 1 errors +Line 166: Expected 1 errors +Line 170: Expected 1 errors Line 133: Unexpected errors ['qualifiers_final_annotation.py:133:0 Unexpected keyword [28]: Unexpected keyword argument `x` to call `N.__init__`.'] """ diff --git a/conformance/results/pyre/version.toml b/conformance/results/pyre/version.toml index 028806c2e..5cd0b295f 100644 --- a/conformance/results/pyre/version.toml +++ b/conformance/results/pyre/version.toml @@ -1,2 +1,2 @@ version = "pyre 0.9.23" -test_duration = 6.5 +test_duration = 6.8 diff --git a/conformance/results/pyright/annotations_generators.toml b/conformance/results/pyright/annotations_generators.toml index aca80497f..84e2463d0 100644 --- a/conformance/results/pyright/annotations_generators.toml +++ b/conformance/results/pyright/annotations_generators.toml @@ -5,11 +5,17 @@ annotations_generators.py:51:21 - error: Function with declared return type "C" annotations_generators.py:54:16 - error: Type "Literal[False]" is not assignable to return type "C"   "Literal[False]" is not assignable to "C" (reportReturnType) annotations_generators.py:57:15 - error: Return type of generator function must be compatible with "Generator[Literal[3], Any, Any]" -  "Literal[3]" is not assignable to "A" (reportReturnType) +  "Generator[Literal[3], Unknown, Unknown]" is not assignable to "Generator[A, B, C]" +    Type parameter "_YieldT_co@Generator" is covariant, but "Literal[3]" is not a subtype of "A" +      "Literal[3]" is not assignable to "A" (reportReturnType) annotations_generators.py:66:15 - error: Return type of generator function must be compatible with "Generator[Literal[3], Any, Any]" -  "Literal[3]" is not assignable to "A" (reportReturnType) +  "Generator[Literal[3], Unknown, Unknown]" is not assignable to "Generator[A, int, Any]" +    Type parameter "_YieldT_co@Generator" is covariant, but "Literal[3]" is not a subtype of "A" +      "Literal[3]" is not assignable to "A" (reportReturnType) annotations_generators.py:75:11 - error: Return type of generator function must be compatible with "Generator[B, Any, Any]" -  "B" is not assignable to "A" (reportReturnType) +  "Generator[B, Unknown, Unknown]" is not assignable to "Iterator[A]" +    Type parameter "_T_co@Iterator" is covariant, but "B" is not a subtype of "A" +      "B" is not assignable to "A" (reportReturnType) annotations_generators.py:86:21 - error: Return type of generator function must be compatible with "Generator[Any, Any, Any]"   "Generator[Any, Any, Any]" is not assignable to "int" (reportInvalidTypeForm) annotations_generators.py:87:11 - error: Return type of generator function must be compatible with "Generator[None, Any, Any]" @@ -18,15 +24,15 @@ annotations_generators.py:91:27 - error: Return type of async generator function   "AsyncGenerator[Any, Any, Any]" is not assignable to "int" (reportInvalidTypeForm) annotations_generators.py:92:11 - error: Return type of async generator function must be compatible with "AsyncGenerator[None, Any]"   "AsyncGenerator[None, Unknown, Unknown]" is not assignable to "int" (reportReturnType) -annotations_generators.py:116:16 - error: Return type of generator function must be compatible with "Generator[A, Any, Any]" +annotations_generators.py:118:16 - error: Return type of generator function must be compatible with "Generator[A, Any, Any]"   "Generator[A, Unknown, Unknown]" is not assignable to "Iterator[B]"     Type parameter "_T_co@Iterator" is covariant, but "A" is not a subtype of "B"       "A" is not assignable to "B" (reportReturnType) -annotations_generators.py:117:16 - error: Return type of generator function must be compatible with "Generator[int, Any, Any]" +annotations_generators.py:119:16 - error: Return type of generator function must be compatible with "Generator[int, Any, Any]"   "Generator[int, Unknown, Unknown]" is not assignable to "Iterator[B]"     Type parameter "_T_co@Iterator" is covariant, but "int" is not a subtype of "B"       "int" is not assignable to "B" (reportReturnType) -annotations_generators.py:133:16 - error: Return type of generator function must be compatible with "Generator[None, Any, Any]" +annotations_generators.py:135:16 - error: Return type of generator function must be compatible with "Generator[None, Any, Any]"   "Generator[None, int, Unknown]" is not assignable to "Generator[None, str, None]"     Type parameter "_SendT_contra@Generator" is contravariant, but "int" is not a supertype of "str"       "str" is not assignable to "int" (reportReturnType) diff --git a/conformance/results/pyright/callables_subtyping.toml b/conformance/results/pyright/callables_subtyping.toml index 134de40c9..53f09982d 100644 --- a/conformance/results/pyright/callables_subtyping.toml +++ b/conformance/results/pyright/callables_subtyping.toml @@ -67,10 +67,12 @@ callables_subtyping.py:119:23 - error: Type "StrArgs4" is not assignable to decl   "StrArgs4" is incompatible with protocol "IntStrArgs4"     "__call__" is an incompatible type       Type "(a: int, /, *args: str) -> None" is not assignable to type "(*args: int | str) -> None" +        Parameter 1: type "int | str" is incompatible with type "int" +          Type "int | str" is not assignable to type "int"         Parameter 2: type "int | str" is incompatible with type "str"           Type "int | str" is not assignable to type "str"         Parameter 1: type "*tuple[int | str, ...]" is incompatible with type "*tuple[str, ...]" -          "*tuple[int | str, ...]" is not assignable to "*tuple[str, ...]" (reportAssignmentType) + ... (reportAssignmentType) callables_subtyping.py:120:23 - error: Type "IntArgs4" is not assignable to declared type "IntStrArgs4"   "IntArgs4" is incompatible with protocol "IntStrArgs4"     "__call__" is an incompatible type diff --git a/conformance/results/pyright/qualifiers_final_annotation.toml b/conformance/results/pyright/qualifiers_final_annotation.toml index 7918a7498..38f55274a 100644 --- a/conformance/results/pyright/qualifiers_final_annotation.toml +++ b/conformance/results/pyright/qualifiers_final_annotation.toml @@ -37,6 +37,8 @@ qualifiers_final_annotation.py:147:10 - error: "x" is declared as Final and cann qualifiers_final_annotation.py:149:9 - error: "x" is declared as Final and cannot be reassigned (reportGeneralTypeIssues) qualifiers_final_annotation.py:152:30 - error: "x" is declared as Final and cannot be reassigned (reportGeneralTypeIssues) qualifiers_final_annotation.py:155:9 - error: "x" is declared as Final and cannot be reassigned (reportGeneralTypeIssues) +qualifiers_final_annotation.py:166:1 - error: "TEN" is declared as Final and cannot be reassigned (reportGeneralTypeIssues) +qualifiers_final_annotation.py:170:1 - error: "PI" is declared as Final and cannot be reassigned (reportGeneralTypeIssues) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/version.toml b/conformance/results/pyright/version.toml index bf9b4ead6..2854cd0a9 100644 --- a/conformance/results/pyright/version.toml +++ b/conformance/results/pyright/version.toml @@ -1,2 +1,2 @@ -version = "pyright 1.1.394" +version = "pyright 1.1.396" test_duration = 1.3 diff --git a/conformance/results/pytype/annotations_generators.toml b/conformance/results/pytype/annotations_generators.toml index af2954999..50bb6423c 100644 --- a/conformance/results/pytype/annotations_generators.toml +++ b/conformance/results/pytype/annotations_generators.toml @@ -46,26 +46,26 @@ async def generator9() -> int: # E: incompatible return type yield None # E \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m -annotations_generators.py:99:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Bad return type 'IntIterator' for generator function generator15 [bad-yield-annotation] +annotations_generators.py:100:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Bad return type 'IntIterator' for generator function generator15 [bad-yield-annotation] def generator15() -> IntIterator: # OK \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m yield 0 \u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m -annotations_generators.py:107:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Bad return type 'AsyncIntIterator' for async generator function generator16 [bad-yield-annotation] +annotations_generators.py:109:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Bad return type 'AsyncIntIterator' for async generator function generator16 [bad-yield-annotation] async def generator16() -> AsyncIntIterator: # OK \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m yield 0 \u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m -annotations_generators.py:116:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in generator18: bad return type [bad-return-type] +annotations_generators.py:118:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in generator18: bad return type [bad-return-type] yield from generator17() # E: incompatible generator type \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -annotations_generators.py:117:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in generator18: bad return type [bad-return-type] +annotations_generators.py:119:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in generator18: bad return type [bad-return-type] yield from [1] # E: incompatible generator type \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -76,7 +76,7 @@ errors_diff = """ Line 51: Expected 1 errors Line 87: Expected 1 errors Line 92: Expected 1 errors -Line 133: Expected 1 errors -Line 99: Unexpected errors ["annotations_generators.py:99:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Bad return type 'IntIterator' for generator function generator15 [bad-yield-annotation]"] -Line 107: Unexpected errors ["annotations_generators.py:107:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Bad return type 'AsyncIntIterator' for async generator function generator16 [bad-yield-annotation]"] +Line 135: Expected 1 errors +Line 100: Unexpected errors ["annotations_generators.py:100:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Bad return type 'IntIterator' for generator function generator15 [bad-yield-annotation]"] +Line 109: Unexpected errors ["annotations_generators.py:109:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Bad return type 'AsyncIntIterator' for async generator function generator16 [bad-yield-annotation]"] """ diff --git a/conformance/results/pytype/qualifiers_final_annotation.toml b/conformance/results/pytype/qualifiers_final_annotation.toml index 59ff384d8..7a9dd829a 100644 --- a/conformance/results/pytype/qualifiers_final_annotation.toml +++ b/conformance/results/pytype/qualifiers_final_annotation.toml @@ -4,6 +4,7 @@ Does not report Final variable with missing initialization. Does not reject Final instance variable declared outside of __init__ method. Does not reject modification of global variable declared Final. Does not reject modification of local variable declared Final. +Does not reject modification of imported variable declared Final. """ output = """ qualifiers_final_annotation.py:18:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Final[str, int]' [invalid-annotation] @@ -106,9 +107,19 @@ N(x="", y="") # E qualifiers_final_annotation.py:145:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func2: Assigning to variable x, which was annotated with Final [final-error] - x += 1 # E: cannot modify Final value + x += 1 # E: cannot modify Final value \u001b[1m\u001b[31m~\u001b[39m\u001b[0m +qualifiers_final_annotation.py:164:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Can't find module '_qualifiers_final_annotation_1'. [import-error] + +from _qualifiers_final_annotation_1 import TEN +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +qualifiers_final_annotation.py:168:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Can't find module '_qualifiers_final_annotation_2'. [import-error] + +from _qualifiers_final_annotation_2 import * +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -123,5 +134,9 @@ Line 147: Expected 1 errors Line 149: Expected 1 errors Line 152: Expected 1 errors Line 155: Expected 1 errors +Line 166: Expected 1 errors +Line 170: Expected 1 errors Line 93: Unexpected errors ['qualifiers_final_annotation.py:93:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Class ClassCChild overrides final class attribute BORDER_WIDTH, defined in base class ClassC [final-error]'] +Line 164: Unexpected errors ["qualifiers_final_annotation.py:164:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Can't find module '_qualifiers_final_annotation_1'. [import-error]"] +Line 168: Unexpected errors ["qualifiers_final_annotation.py:168:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Can't find module '_qualifiers_final_annotation_2'. [import-error]"] """ diff --git a/conformance/results/pytype/version.toml b/conformance/results/pytype/version.toml index 10c237d65..3cd350580 100644 --- a/conformance/results/pytype/version.toml +++ b/conformance/results/pytype/version.toml @@ -1,2 +1,2 @@ version = "pytype 2024.10.11" -test_duration = 34.9 +test_duration = 34.7 diff --git a/conformance/results/results.html b/conformance/results/results.html index ba1f3d8e2..c47b5d4c0 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -159,16 +159,16 @@

    Python Type System Conformance Test Results

     
    mypy 1.15.0
    -
    1.2sec
    +
    1.8sec
    pyright 1.1.393
    -
    1.4sec
    +
    pyright 1.1.394
    +
    1.3sec
    pyre 0.9.23
    -
    7.8sec
    +
    6.5sec
    pytype 2024.10.11
    -
    36.6sec
    +
    34.9sec
    @@ -608,7 +608,7 @@

    Python Type System Conformance Test Results

         callables_kwargs
    Partial

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

    Partial

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

    Partial Pass
    Unsupported

    Does not understand Unpack in the context of **kwargs annotation.

         callables_kwargs
    Partial

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

    PartialPass Pass
    Unsupported

    Does not understand Unpack in the context of **kwargs annotation.

    - - - + + diff --git a/conformance/tests/_qualifiers_final_annotation_1.py b/conformance/tests/_qualifiers_final_annotation_1.py new file mode 100644 index 000000000..b2521b19c --- /dev/null +++ b/conformance/tests/_qualifiers_final_annotation_1.py @@ -0,0 +1,7 @@ +""" +Used as part of the test for the typing.Final special form. +""" + +from typing import Final + +TEN: Final[int] = 10 diff --git a/conformance/tests/_qualifiers_final_annotation_2.py b/conformance/tests/_qualifiers_final_annotation_2.py new file mode 100644 index 000000000..603d8bcb6 --- /dev/null +++ b/conformance/tests/_qualifiers_final_annotation_2.py @@ -0,0 +1,7 @@ +""" +Used as part of the test for the typing.Final special form. +""" + +from typing import Final + +PI: Final = 3.14 diff --git a/conformance/tests/qualifiers_final_annotation.py b/conformance/tests/qualifiers_final_annotation.py index c20a82528..822ea564a 100644 --- a/conformance/tests/qualifiers_final_annotation.py +++ b/conformance/tests/qualifiers_final_annotation.py @@ -138,18 +138,33 @@ def func1(x: Final[list[int]]) -> None: # E def func2() -> None: global ID1 - ID1 = 2 # E: cannot modify Final value + ID1 = 2 # E: cannot modify Final value x: Final = 3 - x += 1 # E: cannot modify Final value + x += 1 # E: cannot modify Final value a = (x := 4) # E: cannot modify Final value - for x in [1, 2, 3]: # E: cannot modify Final value + for x in [1, 2, 3]: # E: cannot modify Final value pass - with open("FileName") as x: # E: cannot modify Final value + with open("FileName") as x: # E: cannot modify Final value pass (a, x) = (1, 2) # E: cannot modify Final value + + +# > If a module declares a ``Final`` variable and another module imports that +# > variable in an import statement by name or wildcard, the imported symbol +# > inherits the ``Final`` type qualifier. Any attempt to assign a different value +# > to this symbol should be flagged as an error by a type checker. + + +from _qualifiers_final_annotation_1 import TEN + +TEN = 9 # E: Cannot redefine Final value + +from _qualifiers_final_annotation_2 import * + +PI = 3.14159 # E: Cannot redefine Final value From 736f9eca08851a98d8223d551aed8026d544743c Mon Sep 17 00:00:00 2001 From: Andrei Bodrov Date: Mon, 17 Mar 2025 13:13:19 +0300 Subject: [PATCH 083/308] Add Aliasing Decorators section to libraries.rst (#1243) --- docs/guides/libraries.rst | 62 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/docs/guides/libraries.rst b/docs/guides/libraries.rst index 4b90da498..d5edb1378 100644 --- a/docs/guides/libraries.rst +++ b/docs/guides/libraries.rst @@ -412,6 +412,8 @@ specified only by name, use the keyword-only separator (``*``). def create_user(age: int, *, dob: Optional[date] = None): ... +.. _annotating-decorators: + Annotating Decorators --------------------- @@ -448,6 +450,66 @@ original signature, thus blinding type checkers and other tools that provide signature assistance. As such, library authors are discouraged from creating decorators that mutate function signatures in this manner. +.. _aliasing-decorators: + +Aliasing Decorators +------------------- + +When writing a library with a couple of decorator factories +(i.e. functions returning decorators, like ``complex_decorator`` from the +:ref:`annotating-decorators` section) it may be tempting to create a shortcut +for a decorator. + +Different type checkers handle :data:`TypeAlias ` involving +:class:`Callable ` in a +different manner, so the most portable and easy way to create a shortcut +is to define a callable :class:`Protocol ` as described in the +:ref:`callback-protocols` section of the Typing Specification. + +There is already a :class:`Protocol ` called +``IdentityFunction`` defined in +`_typeshed `_: + +.. code:: python + + from typing import TYPE_CHECKING + + if TYPE_CHECKING: + from _typeshed import IdentityFunction + + def decorator_factory(*, mode: str) -> "IdentityFunction": + """ + Decorator factory is invoked with arguments like this: + @decorator_factory(mode="easy") + def my_function(): ... + """ + ... + +For non-trivial decorators with custom logic, it is still possible +to define a custom protocol using :class:`ParamSpec ` +and :data:`Concatenate ` mechanisms: + +.. code:: python + + class Client: ... + + P = ParamSpec("P") + R = TypeVar("R") + + class PClientInjector(Protocol): + def __call__(self, _: Callable[Concatenate[Client, P], R], /) -> Callable[P, R]: + ... + + def inject_client(service: str) -> PClientInjector: + """ + Decorator factory is invoked with arguments like this: + @inject_client("testing") + def my_function(client: Client, value: int): ... + + my_function then takes only value + """ + + Generic Classes and Functions ----------------------------- From a01c53661f250c5c0944abfa9f237537b193ccda Mon Sep 17 00:00:00 2001 From: Denis Borisov <1473445+denisborisov@users.noreply.github.com> Date: Mon, 17 Mar 2025 20:20:46 +0500 Subject: [PATCH 084/308] Change int to Any in unpacking unbounded tuple types (#1855) --- docs/spec/generics.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/spec/generics.rst b/docs/spec/generics.rst index aa7ca86df..65eeea941 100644 --- a/docs/spec/generics.rst +++ b/docs/spec/generics.rst @@ -1329,7 +1329,7 @@ unnecessary ``TypeVarTuple``: process_batch_channels(z) # Error: Expected Channels. -We can also pass a ``*tuple[int, ...]`` wherever a ``*Ts`` is +We can also pass a ``*tuple[Any, ...]`` wherever a ``*Ts`` is expected. This is useful when we have particularly dynamic code and cannot state the precise number of dimensions or the precise types for each of the dimensions. In those cases, we can smoothly fall back to From f558518e097a82d6bebf85e54d6f1ddfc629e765 Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Mon, 17 Mar 2025 16:21:07 +0100 Subject: [PATCH 085/308] Print URL after building docs (#1945) This makes it easier to open the generated HTML docs. In some terminal emulators, it allows the user to click the link instead of having to navigate to the build directory in the web browser. --- docs/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/Makefile b/docs/Makefile index 9c7bc939c..463d5f17d 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -29,6 +29,8 @@ build: html: BUILDER = html html: build @echo "Build finished. The HTML pages are in build/html." + @echo "file://$(shell pwd)/build/html" + @echo text: BUILDER = text text: build From 5f97c008e9bc45b9611c2401937ba247df4cf828 Mon Sep 17 00:00:00 2001 From: Eric Traut Date: Fri, 28 Mar 2025 15:47:25 -0700 Subject: [PATCH 086/308] Update to the Overloads chapter (#1839) * First draft of an update to the Overloads chapter. * Attempts to clearly define the algorithm for overload matching. * Describes checks for overload consistency, overlapping overloads, and implementation consistency. * [pre-commit.ci] auto fixes from pre-commit.com hooks * Updated draft based on initial round of feedback. * [pre-commit.ci] auto fixes from pre-commit.com hooks * Fixed reference. * Fixed reference. * Another reference fix. * Incorporated PR feedback. * Made changes to proposed overload chapter based on reviewer feedback. * Incorporated additional feedback from reviewers. * Incorporated more feedback. * Fixed typo in code sample. * Update docs/spec/overload.rst Co-authored-by: Eneg <42005170+Enegg@users.noreply.github.com> * (very) initial steps on conformance tests * fix abstractmethod without implementation check * split overloads_invalid.py from overloads_basic.py * add test for final with overload * add tests for correct usage of override with an overload * add test for wrong use of override with overload * rename overloads_invalid to overloads_definitions * add support for stub test files, add overloads_definitions_stub.pyi * add initial overloads_consistency tests * add tests for mixed async-def * add tests for signature-transforming decorators * add test for partially overlapping overloads * add test for fully overlapping overloads * add tests for step-1 of overload evaluation * add tests for steps 2 and 3 of overload evaluation * add tests for bool expansion (no checker does this) * add tests for enum and tuple expansion * add test for type[A | B] expansion * add test for step 4 in overload matching * add test for steps 5/6 in overload matching * no expectation of return type if there are call errors * improve variadic test to not use overlapping overloads * Apply suggestions from code review Co-authored-by: Alex Waygood * Update conformance/tests/overloads_consistency.py * Removed section on overlapping overloads. We're struggling to get agreement on the proper behavior, and this section is lower priority. We can revisit in the future if there's a desire to do so. * Updated Step 5 of overload algorithm based on PR feedback. * Fixed bug in conformance test. Updated conformance results for latest versions of type checkers. Removed outdated references to "overlapping overloads" in spec. --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Eneg <42005170+Enegg@users.noreply.github.com> Co-authored-by: Carl Meyer Co-authored-by: Jelle Zijlstra Co-authored-by: Alex Waygood --- conformance/results/mypy/overloads_basic.toml | 10 +- .../results/mypy/overloads_consistency.toml | 8 + .../results/mypy/overloads_definitions.toml | 24 ++ .../mypy/overloads_definitions_stub.toml | 18 + .../results/mypy/overloads_evaluation.toml | 43 +++ conformance/results/mypy/version.toml | 2 +- conformance/results/pyre/overloads_basic.toml | 6 +- .../results/pyre/overloads_consistency.toml | 18 + .../results/pyre/overloads_definitions.toml | 32 ++ .../pyre/overloads_definitions_stub.toml | 27 ++ .../results/pyre/overloads_evaluation.toml | 43 +++ conformance/results/pyre/version.toml | 2 +- .../results/pyright/overloads_basic.toml | 8 +- .../pyright/overloads_consistency.toml | 13 + .../pyright/overloads_definitions.toml | 38 ++ .../pyright/overloads_definitions_stub.toml | 24 ++ .../results/pyright/overloads_evaluation.toml | 25 ++ conformance/results/pyright/version.toml | 2 +- .../results/pytype/overloads_basic.toml | 14 +- .../results/pytype/overloads_consistency.toml | 56 +++ .../results/pytype/overloads_definitions.toml | 312 ++++++++++++++++ .../pytype/overloads_definitions_stub.toml | 17 + .../results/pytype/overloads_evaluation.toml | 136 +++++++ conformance/results/pytype/version.toml | 2 +- conformance/results/results.html | 34 +- conformance/src/test_groups.py | 3 +- conformance/src/type_checker.py | 4 +- conformance/tests/overloads_basic.py | 40 +-- conformance/tests/overloads_consistency.py | 118 ++++++ conformance/tests/overloads_definitions.py | 258 +++++++++++++ .../tests/overloads_definitions_stub.pyi | 175 +++++++++ conformance/tests/overloads_evaluation.py | 224 ++++++++++++ docs/spec/overload.rst | 338 +++++++++++++++++- 33 files changed, 1994 insertions(+), 80 deletions(-) create mode 100644 conformance/results/mypy/overloads_consistency.toml create mode 100644 conformance/results/mypy/overloads_definitions.toml create mode 100644 conformance/results/mypy/overloads_definitions_stub.toml create mode 100644 conformance/results/mypy/overloads_evaluation.toml create mode 100644 conformance/results/pyre/overloads_consistency.toml create mode 100644 conformance/results/pyre/overloads_definitions.toml create mode 100644 conformance/results/pyre/overloads_definitions_stub.toml create mode 100644 conformance/results/pyre/overloads_evaluation.toml create mode 100644 conformance/results/pyright/overloads_consistency.toml create mode 100644 conformance/results/pyright/overloads_definitions.toml create mode 100644 conformance/results/pyright/overloads_definitions_stub.toml create mode 100644 conformance/results/pyright/overloads_evaluation.toml create mode 100644 conformance/results/pytype/overloads_consistency.toml create mode 100644 conformance/results/pytype/overloads_definitions.toml create mode 100644 conformance/results/pytype/overloads_definitions_stub.toml create mode 100644 conformance/results/pytype/overloads_evaluation.toml create mode 100644 conformance/tests/overloads_consistency.py create mode 100644 conformance/tests/overloads_definitions.py create mode 100644 conformance/tests/overloads_definitions_stub.pyi create mode 100644 conformance/tests/overloads_evaluation.py diff --git a/conformance/results/mypy/overloads_basic.toml b/conformance/results/mypy/overloads_basic.toml index c42562c94..f592ea606 100644 --- a/conformance/results/mypy/overloads_basic.toml +++ b/conformance/results/mypy/overloads_basic.toml @@ -1,11 +1,9 @@ conformant = "Pass" output = """ -overloads_basic.py:37: error: No overload variant of "__getitem__" of "Bytes" matches argument type "str" [call-overload] -overloads_basic.py:37: note: Possible overload variants: -overloads_basic.py:37: note: def __getitem__(self, int, /) -> int -overloads_basic.py:37: note: def __getitem__(self, slice[Any, Any, Any], /) -> bytes -overloads_basic.py:62: error: Single overload definition, multiple required [misc] -overloads_basic.py:74: error: An overloaded function outside a stub file must have an implementation [no-overload-impl] +overloads_basic.py:39: error: No overload variant of "__getitem__" of "Bytes" matches argument type "str" [call-overload] +overloads_basic.py:39: note: Possible overload variants: +overloads_basic.py:39: note: def __getitem__(self, int, /) -> int +overloads_basic.py:39: note: def __getitem__(self, slice[Any, Any, Any], /) -> bytes """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/mypy/overloads_consistency.toml b/conformance/results/mypy/overloads_consistency.toml new file mode 100644 index 000000000..26cb4d916 --- /dev/null +++ b/conformance/results/mypy/overloads_consistency.toml @@ -0,0 +1,8 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +overloads_consistency.py:28: error: Overloaded function implementation cannot produce return type of signature 2 [misc] +overloads_consistency.py:44: error: Overloaded function implementation does not accept all possible arguments of signature 2 [misc] +""" diff --git a/conformance/results/mypy/overloads_definitions.toml b/conformance/results/mypy/overloads_definitions.toml new file mode 100644 index 000000000..d38c913f9 --- /dev/null +++ b/conformance/results/mypy/overloads_definitions.toml @@ -0,0 +1,24 @@ +conformant = "Partial" +conformance_automated = "Fail" +notes = """ +Does not allow an overload with no implementation in an abstract base class. +Allows @override to be on all overloads and implementation, instead of just implementation. +""" +errors_diff = """ +Line 245: Expected 1 errors +Line 49: Unexpected errors ['overloads_definitions.py:49: error: An overloaded function outside a stub file must have an implementation [no-overload-impl]'] +""" +output = """ +overloads_definitions.py:14: error: Single overload definition, multiple required [misc] +overloads_definitions.py:26: error: An overloaded function outside a stub file must have an implementation [no-overload-impl] +overloads_definitions.py:49: error: An overloaded function outside a stub file must have an implementation [no-overload-impl] +overloads_definitions.py:63: error: An overloaded function outside a stub file must have an implementation [no-overload-impl] +overloads_definitions.py:78: error: Overload does not consistently use the "@staticmethod" decorator on all function signatures. [misc] +overloads_definitions.py:88: error: Overloaded function implementation does not accept all possible arguments of signature 1 [misc] +overloads_definitions.py:88: error: Overloaded function implementation does not accept all possible arguments of signature 2 [misc] +overloads_definitions.py:91: error: Overload does not consistently use the "@classmethod" decorator on all function signatures. [misc] +overloads_definitions.py:133: error: @final should be applied only to overload implementation [misc] +overloads_definitions.py:148: error: @final should be applied only to overload implementation [misc] +overloads_definitions.py:196: error: Cannot override final attribute "final_method" (previously declared in base class "Base") [misc] +overloads_definitions.py:211: error: Method "bad_override" is marked as an override, but no base method was found with this name [misc] +""" diff --git a/conformance/results/mypy/overloads_definitions_stub.toml b/conformance/results/mypy/overloads_definitions_stub.toml new file mode 100644 index 000000000..d1623d20f --- /dev/null +++ b/conformance/results/mypy/overloads_definitions_stub.toml @@ -0,0 +1,18 @@ +conformant = "Partial" +notes = """ +Allows @override to appear in a stub file not on the first overload. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 168: Expected 1 errors +""" +output = """ +overloads_definitions_stub.pyi:13: error: Single overload definition, multiple required [misc] +overloads_definitions_stub.pyi:37: error: Overload does not consistently use the "@staticmethod" decorator on all function signatures. [misc] +overloads_definitions_stub.pyi:38: error: Self argument missing for a non-static method (or an invalid type for self) [misc] +overloads_definitions_stub.pyi:46: error: Overload does not consistently use the "@classmethod" decorator on all function signatures. [misc] +overloads_definitions_stub.pyi:85: error: In a stub file @final must be applied only to the first overload [misc] +overloads_definitions_stub.pyi:101: error: In a stub file @final must be applied only to the first overload [misc] +overloads_definitions_stub.pyi:128: error: Cannot override final attribute "final_method" (previously declared in base class "Base") [misc] +overloads_definitions_stub.pyi:140: error: Method "bad_override" is marked as an override, but no base method was found with this name [misc] +""" diff --git a/conformance/results/mypy/overloads_evaluation.toml b/conformance/results/mypy/overloads_evaluation.toml new file mode 100644 index 000000000..b1d7d783a --- /dev/null +++ b/conformance/results/mypy/overloads_evaluation.toml @@ -0,0 +1,43 @@ +conformant = "Partial" +notes = """ +Does not expand boolean arguments to Literal[True] and Literal[False]. +Does not expand enum arguments to literal variants. +Does not expand tuple arguments to possible combinations. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 106: Unexpected errors ['overloads_evaluation.py:106: error: No overload variant of "expand_bool" matches argument type "bool" [call-overload]'] +Line 107: Unexpected errors ['overloads_evaluation.py:107: error: Expression is of type "Any", not "Literal[0, 1]" [assert-type]'] +Line 129: Unexpected errors ['overloads_evaluation.py:129: error: No overload variant of "expand_enum" matches argument type "Color" [call-overload]'] +Line 130: Unexpected errors ['overloads_evaluation.py:130: error: Expression is of type "Any", not "Literal[0, 1]" [assert-type]'] +Line 169: Unexpected errors ['overloads_evaluation.py:169: error: Argument 1 to "expand_tuple" has incompatible type "tuple[int, int | str]"; expected "tuple[int, int]" [arg-type]'] +Line 170: Unexpected errors ['overloads_evaluation.py:170: error: Expression is of type "int", not "int | str" [assert-type]'] +""" +output = """ +overloads_evaluation.py:32: error: All overload variants of "example1" require at least one argument [call-overload] +overloads_evaluation.py:32: note: Possible overload variants: +overloads_evaluation.py:32: note: def example1(x: int, y: str) -> int +overloads_evaluation.py:32: note: def example1(x: str) -> str +overloads_evaluation.py:40: error: No overload variant of "example1" matches argument types "int", "int" [call-overload] +overloads_evaluation.py:40: note: Possible overload variants: +overloads_evaluation.py:40: note: def example1(x: int, y: str) -> int +overloads_evaluation.py:40: note: def example1(x: str) -> str +overloads_evaluation.py:45: error: No overload variant of "example1" matches argument type "int" [call-overload] +overloads_evaluation.py:45: note: Possible overload variants: +overloads_evaluation.py:45: note: def example1(x: int, y: str) -> int +overloads_evaluation.py:45: note: def example1(x: str) -> str +overloads_evaluation.py:89: error: Argument 1 to "example2" has incompatible type "int | str"; expected "int" [arg-type] +overloads_evaluation.py:89: error: Argument 2 to "example2" has incompatible type "int | str"; expected "str" [arg-type] +overloads_evaluation.py:106: error: No overload variant of "expand_bool" matches argument type "bool" [call-overload] +overloads_evaluation.py:106: note: Possible overload variants: +overloads_evaluation.py:106: note: def expand_bool(x: Literal[False]) -> Literal[0] +overloads_evaluation.py:106: note: def expand_bool(x: Literal[True]) -> Literal[1] +overloads_evaluation.py:107: error: Expression is of type "Any", not "Literal[0, 1]" [assert-type] +overloads_evaluation.py:129: error: No overload variant of "expand_enum" matches argument type "Color" [call-overload] +overloads_evaluation.py:129: note: Possible overload variants: +overloads_evaluation.py:129: note: def expand_enum(x: Literal[Color.RED]) -> Literal[0] +overloads_evaluation.py:129: note: def expand_enum(x: Literal[Color.BLUE]) -> Literal[1] +overloads_evaluation.py:130: error: Expression is of type "Any", not "Literal[0, 1]" [assert-type] +overloads_evaluation.py:169: error: Argument 1 to "expand_tuple" has incompatible type "tuple[int, int | str]"; expected "tuple[int, int]" [arg-type] +overloads_evaluation.py:170: error: Expression is of type "int", not "int | str" [assert-type] +""" diff --git a/conformance/results/mypy/version.toml b/conformance/results/mypy/version.toml index e5c363db9..04a88f8bf 100644 --- a/conformance/results/mypy/version.toml +++ b/conformance/results/mypy/version.toml @@ -1,2 +1,2 @@ version = "mypy 1.15.0" -test_duration = 1.7 +test_duration = 1.6 diff --git a/conformance/results/pyre/overloads_basic.toml b/conformance/results/pyre/overloads_basic.toml index 7a5d5b54d..aebf2dede 100644 --- a/conformance/results/pyre/overloads_basic.toml +++ b/conformance/results/pyre/overloads_basic.toml @@ -1,10 +1,6 @@ conformant = "Pass" -notes = """ -""" output = """ -overloads_basic.py:37:2 Incompatible parameter type [6]: In call `Bytes.__getitem__`, for 1st positional argument, expected `int` but got `str`. -overloads_basic.py:63:0 Incompatible overload [43]: At least two overload signatures must be present. -overloads_basic.py:75:0 Missing overload implementation [42]: Overloaded function `func2` must have an implementation. +overloads_basic.py:39:2 Incompatible parameter type [6]: In call `Bytes.__getitem__`, for 1st positional argument, expected `int` but got `str`. """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyre/overloads_consistency.toml b/conformance/results/pyre/overloads_consistency.toml new file mode 100644 index 000000000..5f38b134d --- /dev/null +++ b/conformance/results/pyre/overloads_consistency.toml @@ -0,0 +1,18 @@ +conformant = "Partial" +notes = """ +Does not apply decorator transforms before checking overload consistency. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 108: Unexpected errors ['overloads_consistency.py:108:0 Incompatible overload [43]: The return type of overloaded function `decorated` (`None`) is incompatible with the return type of the implementation (`bytes`).', 'overloads_consistency.py:108:0 Incompatible overload [43]: The implementation of `decorated` does not accept all possible arguments of overload defined on line `108`.'] +Line 112: Unexpected errors ['overloads_consistency.py:112:0 Incompatible overload [43]: The return type of overloaded function `decorated` (`str`) is incompatible with the return type of the implementation (`bytes`).', 'overloads_consistency.py:112:0 Incompatible overload [43]: The implementation of `decorated` does not accept all possible arguments of overload defined on line `112`.', 'overloads_consistency.py:112:0 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).'] +""" +output = """ +overloads_consistency.py:25:0 Incompatible overload [43]: The return type of overloaded function `return_type` (`str`) is incompatible with the return type of the implementation (`int`). +overloads_consistency.py:41:0 Incompatible overload [43]: The implementation of `parameter_type` does not accept all possible arguments of overload defined on line `41`. +overloads_consistency.py:108:0 Incompatible overload [43]: The return type of overloaded function `decorated` (`None`) is incompatible with the return type of the implementation (`bytes`). +overloads_consistency.py:108:0 Incompatible overload [43]: The implementation of `decorated` does not accept all possible arguments of overload defined on line `108`. +overloads_consistency.py:112:0 Incompatible overload [43]: The return type of overloaded function `decorated` (`str`) is incompatible with the return type of the implementation (`bytes`). +overloads_consistency.py:112:0 Incompatible overload [43]: The implementation of `decorated` does not accept all possible arguments of overload defined on line `112`. +overloads_consistency.py:112:0 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s). +""" diff --git a/conformance/results/pyre/overloads_definitions.toml b/conformance/results/pyre/overloads_definitions.toml new file mode 100644 index 000000000..fc29f7621 --- /dev/null +++ b/conformance/results/pyre/overloads_definitions.toml @@ -0,0 +1,32 @@ +conformant = "Partial" +conformance_automated = "Fail" +notes = """ +Does not allow an overload with no implementation in a Protocol or an abstract base class. +Expects @final/@override on all overloads and implementation, instead of implementation only. +""" +errors_diff = """ +Line 245: Expected 1 errors +Lines 148, 150: Expected error (tag 'invalid_final_2') +Line 40: Unexpected errors ['overloads_definitions.py:40:4 Missing overload implementation [42]: Overloaded function `MyProto.func3` must have an implementation.'] +Line 51: Unexpected errors ['overloads_definitions.py:51:4 Missing overload implementation [42]: Overloaded function `MyAbstractBase.func4` must have an implementation.'] +Line 128: Unexpected errors ['overloads_definitions.py:128:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).'] +Line 239: Unexpected errors ['overloads_definitions.py:239:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).'] +""" +output = """ +overloads_definitions.py:15:0 Incompatible overload [43]: At least two overload signatures must be present. +overloads_definitions.py:27:0 Missing overload implementation [42]: Overloaded function `func2` must have an implementation. +overloads_definitions.py:40:4 Missing overload implementation [42]: Overloaded function `MyProto.func3` must have an implementation. +overloads_definitions.py:51:4 Missing overload implementation [42]: Overloaded function `MyAbstractBase.func4` must have an implementation. +overloads_definitions.py:64:4 Missing overload implementation [42]: Overloaded function `MyAbstractBase.not_abstract` must have an implementation. +overloads_definitions.py:80:4 Incompatible overload [43]: The implementation of `C.func5` does not accept all possible arguments of overload defined on line `80`. +overloads_definitions.py:85:4 Incompatible overload [43]: The implementation of `C.func5` does not accept all possible arguments of overload defined on line `85`. +overloads_definitions.py:88:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s). +overloads_definitions.py:97:4 Incompatible overload [43]: The implementation of `C.func6` does not accept all possible arguments of overload defined on line `97`. +overloads_definitions.py:97:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s). +overloads_definitions.py:128:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s). +overloads_definitions.py:139:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s). +overloads_definitions.py:204:4 Invalid override [40]: `overloads_definitions.Child.final_method` cannot override final method defined in `Base`. +overloads_definitions.py:220:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s). +overloads_definitions.py:220:4 Invalid override [40]: `overloads_definitions.Child.bad_override` is decorated with @override, but no method of the same name exists in superclasses of `Child`. +overloads_definitions.py:239:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s). +""" diff --git a/conformance/results/pyre/overloads_definitions_stub.toml b/conformance/results/pyre/overloads_definitions_stub.toml new file mode 100644 index 000000000..93772e389 --- /dev/null +++ b/conformance/results/pyre/overloads_definitions_stub.toml @@ -0,0 +1,27 @@ +conformant = "Partial" +notes = """ +Expects @final and @override to be present on all overloads, not just first. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 168: Expected 1 errors +Lines 80, 82, 85, 87: Expected error (tag 'invalid_final') +Lines 96, 98, 101: Expected error (tag 'invalid_final_2') +Lines 122, 128, 129, 133: Expected error (tag 'override-final') +Line 75: Unexpected errors ['overloads_definitions_stub.pyi:75:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).'] +Line 91: Unexpected errors ['overloads_definitions_stub.pyi:91:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).'] +Line 146: Unexpected errors ['overloads_definitions_stub.pyi:146:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).'] +Line 162: Unexpected errors ['overloads_definitions_stub.pyi:162:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).'] +Line 174: Unexpected errors ['overloads_definitions_stub.pyi:174:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).'] +""" +output = """ +overloads_definitions_stub.pyi:14:0 Incompatible overload [43]: At least two overload signatures must be present. +overloads_definitions_stub.pyi:43:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s). +overloads_definitions_stub.pyi:52:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s). +overloads_definitions_stub.pyi:75:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s). +overloads_definitions_stub.pyi:91:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s). +overloads_definitions_stub.pyi:142:4 Invalid override [40]: `overloads_definitions_stub.Child.bad_override` is decorated with @override, but no method of the same name exists in superclasses of `Child`. +overloads_definitions_stub.pyi:146:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s). +overloads_definitions_stub.pyi:162:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s). +overloads_definitions_stub.pyi:174:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s). +""" diff --git a/conformance/results/pyre/overloads_evaluation.toml b/conformance/results/pyre/overloads_evaluation.toml new file mode 100644 index 000000000..9a8486864 --- /dev/null +++ b/conformance/results/pyre/overloads_evaluation.toml @@ -0,0 +1,43 @@ +conformant = "Partial" +notes = """ +Does not expand boolean arguments to Literal[True] and Literal[False]. +Does not expand enum arguments to literal variants. +Does not expand type[A | B] to type[A] and type[B]. +Does not expand tuple arguments to possible combinations. +Does not prefer variadic match to indeterminate-length unpacked argument. +Does not treat multiple matches due to gradual types as ambiguous. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 81: Unexpected errors ['overloads_evaluation.py:81:23 Incompatible parameter type [6]: In call `example2`, for 2nd positional argument, expected `str` but got `Union[int, str]`.'] +Line 82: Unexpected errors ['overloads_evaluation.py:82:4 Assert type [70]: Expected `Union[int, str]` but got `str`.'] +Line 106: Unexpected errors ['overloads_evaluation.py:106:23 Incompatible parameter type [6]: In call `expand_bool`, for 1st positional argument, expected `typing_extensions.Literal[False]` but got `bool`.'] +Line 107: Unexpected errors ['overloads_evaluation.py:107:4 Assert type [70]: Expected `Union[typing_extensions.Literal[0], typing_extensions.Literal[1]]` but got `typing_extensions.Literal[0]`.'] +Line 129: Unexpected errors ['overloads_evaluation.py:129:23 Incompatible parameter type [6]: In call `expand_enum`, for 1st positional argument, expected `typing_extensions.Literal[Color.RED]` but got `Color`.'] +Line 130: Unexpected errors ['overloads_evaluation.py:130:4 Assert type [70]: Expected `Union[typing_extensions.Literal[0], typing_extensions.Literal[1]]` but got `typing_extensions.Literal[0]`.'] +Line 147: Unexpected errors ['overloads_evaluation.py:147:29 Incompatible parameter type [6]: In call `expand_type_union`, for 1st positional argument, expected `Type[int]` but got `Type[Union[int, str]]`.'] +Line 148: Unexpected errors ['overloads_evaluation.py:148:4 Assert type [70]: Expected `Union[int, str]` but got `int`.'] +Line 169: Unexpected errors ['overloads_evaluation.py:169:24 Incompatible parameter type [6]: In call `expand_tuple`, for 1st positional argument, expected `Tuple[int, int]` but got `Tuple[int, Union[int, str]]`.'] +Line 170: Unexpected errors ['overloads_evaluation.py:170:4 Assert type [70]: Expected `Union[int, str]` but got `int`.'] +Line 196: Unexpected errors ['overloads_evaluation.py:196:4 Assert type [70]: Expected `int` but got `str`.'] +Line 224: Unexpected errors ['overloads_evaluation.py:224:4 Assert type [70]: Expected `typing.Any` but got `int`.'] +""" +output = """ +overloads_evaluation.py:32:0 Missing argument [20]: Call `example1` expects argument `x`. +overloads_evaluation.py:40:12 Incompatible parameter type [6]: In call `example1`, for 2nd positional argument, expected `str` but got `int`. +overloads_evaluation.py:45:9 Incompatible parameter type [6]: In call `example1`, for 1st positional argument, expected `str` but got `int`. +overloads_evaluation.py:81:23 Incompatible parameter type [6]: In call `example2`, for 2nd positional argument, expected `str` but got `Union[int, str]`. +overloads_evaluation.py:82:4 Assert type [70]: Expected `Union[int, str]` but got `str`. +overloads_evaluation.py:89:13 Incompatible parameter type [6]: In call `example2`, for 1st positional argument, expected `int` but got `Union[int, str]`. +overloads_evaluation.py:89:16 Incompatible parameter type [6]: In call `example2`, for 2nd positional argument, expected `str` but got `Union[int, str]`. +overloads_evaluation.py:106:23 Incompatible parameter type [6]: In call `expand_bool`, for 1st positional argument, expected `typing_extensions.Literal[False]` but got `bool`. +overloads_evaluation.py:107:4 Assert type [70]: Expected `Union[typing_extensions.Literal[0], typing_extensions.Literal[1]]` but got `typing_extensions.Literal[0]`. +overloads_evaluation.py:129:23 Incompatible parameter type [6]: In call `expand_enum`, for 1st positional argument, expected `typing_extensions.Literal[Color.RED]` but got `Color`. +overloads_evaluation.py:130:4 Assert type [70]: Expected `Union[typing_extensions.Literal[0], typing_extensions.Literal[1]]` but got `typing_extensions.Literal[0]`. +overloads_evaluation.py:147:29 Incompatible parameter type [6]: In call `expand_type_union`, for 1st positional argument, expected `Type[int]` but got `Type[Union[int, str]]`. +overloads_evaluation.py:148:4 Assert type [70]: Expected `Union[int, str]` but got `int`. +overloads_evaluation.py:169:24 Incompatible parameter type [6]: In call `expand_tuple`, for 1st positional argument, expected `Tuple[int, int]` but got `Tuple[int, Union[int, str]]`. +overloads_evaluation.py:170:4 Assert type [70]: Expected `Union[int, str]` but got `int`. +overloads_evaluation.py:196:4 Assert type [70]: Expected `int` but got `str`. +overloads_evaluation.py:224:4 Assert type [70]: Expected `typing.Any` but got `int`. +""" diff --git a/conformance/results/pyre/version.toml b/conformance/results/pyre/version.toml index 5cd0b295f..036bbbfbd 100644 --- a/conformance/results/pyre/version.toml +++ b/conformance/results/pyre/version.toml @@ -1,2 +1,2 @@ version = "pyre 0.9.23" -test_duration = 6.8 +test_duration = 7.4 diff --git a/conformance/results/pyright/overloads_basic.toml b/conformance/results/pyright/overloads_basic.toml index 5171f52e2..14bfb58bf 100644 --- a/conformance/results/pyright/overloads_basic.toml +++ b/conformance/results/pyright/overloads_basic.toml @@ -1,10 +1,10 @@ conformant = "Pass" +notes = """ +""" output = """ -overloads_basic.py:37:1 - error: No overloads for "__getitem__" match the provided arguments (reportCallIssue) -overloads_basic.py:37:1 - error: Argument of type "Literal['']" cannot be assigned to parameter "__s" of type "slice[Any, Any, Any]" in function "__getitem__" +overloads_basic.py:39:1 - error: No overloads for "__getitem__" match the provided arguments (reportCallIssue) +overloads_basic.py:39:1 - error: Argument of type "Literal['']" cannot be assigned to parameter "__s" of type "slice[Any, Any, Any]" in function "__getitem__"   "Literal['']" is not assignable to "slice[Any, Any, Any]" (reportArgumentType) -overloads_basic.py:63:5 - error: "func1" is marked as overload, but additional overloads are missing (reportInconsistentOverload) -overloads_basic.py:75:5 - error: "func2" is marked as overload, but no implementation is provided (reportNoOverloadImplementation) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/overloads_consistency.toml b/conformance/results/pyright/overloads_consistency.toml new file mode 100644 index 000000000..4568f8d82 --- /dev/null +++ b/conformance/results/pyright/overloads_consistency.toml @@ -0,0 +1,13 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +overloads_consistency.py:28:5 - error: Overloaded implementation is not consistent with signature of overload 2 +  Function return type "str" is incompatible with type "int" +    "str" is not assignable to "int" (reportInconsistentOverload) +overloads_consistency.py:44:5 - error: Overloaded implementation is not consistent with signature of overload 2 +  Type "(x: int) -> (int | str)" is not assignable to type "(x: str) -> str" +    Parameter 1: type "str" is incompatible with type "int" +      "str" is not assignable to "int" (reportInconsistentOverload) +""" diff --git a/conformance/results/pyright/overloads_definitions.toml b/conformance/results/pyright/overloads_definitions.toml new file mode 100644 index 000000000..78ec7ab8e --- /dev/null +++ b/conformance/results/pyright/overloads_definitions.toml @@ -0,0 +1,38 @@ +conformant = "Partial" +notes = """ +Allows @final/@override on all overloads and implementation; should be implementation-only. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 245: Expected 1 errors +Line 155: Unexpected errors ['overloads_definitions.py:155:9 - error: @final decorator should be applied only to the implementation (reportInconsistentOverload)'] +Line 247: Unexpected errors ['overloads_definitions.py:247:9 - error: @override decorator should be applied only to the implementation (reportInconsistentOverload)'] +Line 252: Unexpected errors ['overloads_definitions.py:252:9 - error: @override decorator should be applied only to the implementation (reportInconsistentOverload)'] +""" +output = """ +overloads_definitions.py:15:5 - error: "func1" is marked as overload, but additional overloads are missing (reportInconsistentOverload) +overloads_definitions.py:27:5 - error: "func2" is marked as overload, but no implementation is provided (reportNoOverloadImplementation) +overloads_definitions.py:64:9 - error: "not_abstract" is marked as overload, but no implementation is provided (reportNoOverloadImplementation) +overloads_definitions.py:80:9 - error: Overloads for "func5" use @staticmethod inconsistently (reportInconsistentOverload) +overloads_definitions.py:88:9 - error: Overloaded implementation is not consistent with signature of overload 1 +  Type "(self: Self@C, x: int | str) -> (int | str)" is not assignable to type "(x: int) -> int" +    Parameter name mismatch: "x" versus "self" +    Parameter 1: type "int" is incompatible with type "Self@C" +      Type "int" is not assignable to type "Self@C" +    Extra parameter "x" (reportInconsistentOverload) +overloads_definitions.py:88:9 - error: Overloaded implementation is not consistent with signature of overload 2 +  Type "(self: Self@C, x: int | str) -> (int | str)" is not assignable to type "(x: str) -> str" +    Parameter name mismatch: "x" versus "self" +    Parameter 1: type "str" is incompatible with type "Self@C" +      Type "str" is not assignable to type "Self@C" +    Extra parameter "x" (reportInconsistentOverload) +overloads_definitions.py:93:9 - error: Overloads for "func6" use @classmethod inconsistently (reportInconsistentOverload) +overloads_definitions.py:97:15 - warning: Instance methods should take a "self" parameter (reportSelfClsParameterName) +overloads_definitions.py:135:9 - error: @final decorator should be applied only to the implementation (reportInconsistentOverload) +overloads_definitions.py:150:9 - error: @final decorator should be applied only to the implementation (reportInconsistentOverload) +overloads_definitions.py:155:9 - error: @final decorator should be applied only to the implementation (reportInconsistentOverload) +overloads_definitions.py:204:9 - error: Method "final_method" cannot override final method defined in class "Base" (reportIncompatibleMethodOverride) +overloads_definitions.py:220:9 - error: Method "bad_override" is marked as override, but no base method of same name is present (reportGeneralTypeIssues) +overloads_definitions.py:247:9 - error: @override decorator should be applied only to the implementation (reportInconsistentOverload) +overloads_definitions.py:252:9 - error: @override decorator should be applied only to the implementation (reportInconsistentOverload) +""" diff --git a/conformance/results/pyright/overloads_definitions_stub.toml b/conformance/results/pyright/overloads_definitions_stub.toml new file mode 100644 index 000000000..3a71f07f5 --- /dev/null +++ b/conformance/results/pyright/overloads_definitions_stub.toml @@ -0,0 +1,24 @@ +conformant = "Partial" +notes = """ +Does not enforce that @final/@override in a stub should be only on first overload. +Does not enforce @override when correctly used with an overloaded method in a stub file. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 168: Expected 1 errors +Lines 96, 98, 101: Expected error (tag 'invalid_final_2') +Line 103: Unexpected errors ['overloads_definitions_stub.pyi:103:9 - error: Only the first overload should be marked @final (reportInconsistentOverload)'] +Line 174: Unexpected errors ['overloads_definitions_stub.pyi:174:9 - error: Only the first overload should be marked @override (reportInconsistentOverload)'] +""" +output = """ +overloads_definitions_stub.pyi:14:5 - error: "func1" is marked as overload, but additional overloads are missing (reportInconsistentOverload) +overloads_definitions_stub.pyi:38:9 - error: Overloads for "func5" use @staticmethod inconsistently (reportInconsistentOverload) +overloads_definitions_stub.pyi:38:15 - warning: Instance methods should take a "self" parameter (reportSelfClsParameterName) +overloads_definitions_stub.pyi:48:9 - error: Overloads for "func6" use @classmethod inconsistently (reportInconsistentOverload) +overloads_definitions_stub.pyi:52:15 - warning: Instance methods should take a "self" parameter (reportSelfClsParameterName) +overloads_definitions_stub.pyi:87:9 - error: Only the first overload should be marked @final (reportInconsistentOverload) +overloads_definitions_stub.pyi:103:9 - error: Only the first overload should be marked @final (reportInconsistentOverload) +overloads_definitions_stub.pyi:133:9 - error: Method "final_method" cannot override final method defined in class "Base" (reportIncompatibleMethodOverride) +overloads_definitions_stub.pyi:142:9 - error: Method "bad_override" is marked as override, but no base method of same name is present (reportGeneralTypeIssues) +overloads_definitions_stub.pyi:174:9 - error: Only the first overload should be marked @override (reportInconsistentOverload) +""" diff --git a/conformance/results/pyright/overloads_evaluation.toml b/conformance/results/pyright/overloads_evaluation.toml new file mode 100644 index 000000000..ee50a3a1a --- /dev/null +++ b/conformance/results/pyright/overloads_evaluation.toml @@ -0,0 +1,25 @@ +conformant = "Partial" +notes = """ +Does not expand boolean arguments to Literal[True] and Literal[False]. +Does not expand enum arguments to literal variants. +Does not expand tuple arguments to possible combinations. +Does not prefer variadic match to indeterminate-length unpacked argument. +""" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +overloads_evaluation.py:32:1 - error: No overloads for "example1" match the provided arguments +  Argument types: () (reportCallIssue) +overloads_evaluation.py:40:13 - error: Argument of type "Literal[1]" cannot be assigned to parameter "y" of type "str" in function "example1" +  "Literal[1]" is not assignable to "str" (reportArgumentType) +overloads_evaluation.py:45:10 - error: Argument of type "Literal[1]" cannot be assigned to parameter "x" of type "str" in function "example1" +  "Literal[1]" is not assignable to "str" (reportArgumentType) +overloads_evaluation.py:89:5 - error: No overloads for "example2" match the provided arguments (reportCallIssue) +overloads_evaluation.py:89:14 - error: Argument of type "int | str" cannot be assigned to parameter "x" of type "int" in function "example2" +  Type "int | str" is not assignable to type "int" +    "str" is not assignable to "int" (reportArgumentType) +overloads_evaluation.py:89:17 - error: Argument of type "int | str" cannot be assigned to parameter "y" of type "int" in function "example2" +  Type "int | str" is not assignable to type "int" +    "str" is not assignable to "int" (reportArgumentType) +""" diff --git a/conformance/results/pyright/version.toml b/conformance/results/pyright/version.toml index 2854cd0a9..7e7f60921 100644 --- a/conformance/results/pyright/version.toml +++ b/conformance/results/pyright/version.toml @@ -1,2 +1,2 @@ -version = "pyright 1.1.396" +version = "pyright 1.1.398" test_duration = 1.3 diff --git a/conformance/results/pytype/overloads_basic.toml b/conformance/results/pytype/overloads_basic.toml index 06e69b8cb..d1e57904c 100644 --- a/conformance/results/pytype/overloads_basic.toml +++ b/conformance/results/pytype/overloads_basic.toml @@ -1,20 +1,18 @@ conformant = "Partial" notes = """ -Does not reject a function with a single @overload signature. -Does not reject a function with @overload signature but no implementation. """ output = """ -overloads_basic.py:31:20: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __getitem__: bad return type [bad-return-type] +overloads_basic.py:33:20: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __getitem__: bad return type [bad-return-type] return b"" \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m -overloads_basic.py:37:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : unsupported operand type(s) for item retrieval: Bytes and str [unsupported-operands] +overloads_basic.py:39:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : unsupported operand type(s) for item retrieval: Bytes and str [unsupported-operands] b[""] # E: no matching overload \u001b[1m\u001b[31m~~~~~\u001b[39m\u001b[0m -overloads_basic.py:58:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in map: bad return type [bad-return-type] +overloads_basic.py:60:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in map: bad return type [bad-return-type] pass \u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m @@ -22,8 +20,6 @@ overloads_basic.py:58:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in map: ba """ conformance_automated = "Fail" errors_diff = """ -Lines 62, 63: Expected error (tag 'func1') -Lines 74, 75: Expected error (tag 'func2') -Line 31: Unexpected errors ['overloads_basic.py:31:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __getitem__: bad return type [bad-return-type]'] -Line 58: Unexpected errors ['overloads_basic.py:58:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in map: bad return type [bad-return-type]'] +Line 33: Unexpected errors ['overloads_basic.py:33:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __getitem__: bad return type [bad-return-type]'] +Line 60: Unexpected errors ['overloads_basic.py:60:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in map: bad return type [bad-return-type]'] """ diff --git a/conformance/results/pytype/overloads_consistency.toml b/conformance/results/pytype/overloads_consistency.toml new file mode 100644 index 000000000..58abf8d76 --- /dev/null +++ b/conformance/results/pytype/overloads_consistency.toml @@ -0,0 +1,56 @@ +conformant = "Fail" +notes = """ +Doesn't appear to validate overload consistency at all. +""" +conformance_automated = "Fail" +errors_diff = """ +Lines 25, 28: Expected error (tag 'return_type') +Lines 41, 44: Expected error (tag 'parameter_type') +Line 29: Unexpected errors ['overloads_consistency.py:29:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in return_type: bad return type [bad-return-type]'] +Line 45: Unexpected errors ['overloads_consistency.py:45:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in parameter_type: bad return type [bad-return-type]'] +Line 74: Unexpected errors ['overloads_consistency.py:74:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in returns_coroutine: bad return type [bad-return-type]'] +Line 89: Unexpected errors ['overloads_consistency.py:89:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in returns_coroutine_2: bad return type [bad-return-type]', 'overloads_consistency.py:89:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in returns_coroutine_2: bad return type [bad-return-type]'] +Line 108: Unexpected errors ['overloads_consistency.py:108:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function decorated expects 0 arg(s), got 1 [wrong-arg-count]'] +Line 116: Unexpected errors ["overloads_consistency.py:116:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Missing parameter 'z' in call to function decorated [missing-parameter]"] +""" +output = """ +overloads_consistency.py:29:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in return_type: bad return type [bad-return-type] + + return 1 + \u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +overloads_consistency.py:45:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in parameter_type: bad return type [bad-return-type] + + return 1 + \u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +overloads_consistency.py:74:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in returns_coroutine: bad return type [bad-return-type] + + return 1 + \u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +overloads_consistency.py:89:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in returns_coroutine_2: bad return type [bad-return-type] + + return _wrapped(x) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +overloads_consistency.py:89:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in returns_coroutine_2: bad return type [bad-return-type] + + return _wrapped(x) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +overloads_consistency.py:108:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function decorated expects 0 arg(s), got 1 [wrong-arg-count] + +def decorated() -> None: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +overloads_consistency.py:116:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'z' in call to function decorated [missing-parameter] + +def decorated(y: bytes, z: bytes) -> bytes: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + return b"" +\u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +""" diff --git a/conformance/results/pytype/overloads_definitions.toml b/conformance/results/pytype/overloads_definitions.toml new file mode 100644 index 000000000..e5307735a --- /dev/null +++ b/conformance/results/pytype/overloads_definitions.toml @@ -0,0 +1,312 @@ +conformant = "Fail" +notes = """ +Does not reject a function with a single @overload signature. +Does not reject a function with @overload signature but no implementation. +Does not allow an overload with no implementation in a Protocol or an abstract base class. +Does not error on overloads inconsistently decorated with `@staticmethod` or `@classmethod`. +Does not enforce any rules on location of @final or @override decorators. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 245: Expected 1 errors +Lines 14, 15: Expected error (tag 'func1') +Lines 26, 27: Expected error (tag 'func2') +Lines 63, 64: Expected error (tag 'not_abstract') +Lines 78, 80, 85, 88: Expected error (tag 'func5') +Lines 91, 93, 97, 101: Expected error (tag 'func6') +Lines 133, 135, 139: Expected error (tag 'invalid_final') +Lines 148, 150: Expected error (tag 'invalid_final_2') +Line 6: Unexpected errors ['overloads_definitions.py:6:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.override not supported yet [not-supported-yet]'] +Line 46: Unexpected errors ["overloads_definitions.py:46:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func3: @typing.overload-decorated 'MyProto.func3' object is not callable [not-callable]"] +Line 58: Unexpected errors ["overloads_definitions.py:58:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func4: @typing.overload-decorated 'MyAbstractBase.func4' object is not callable [not-callable]"] +Line 70: Unexpected errors ["overloads_definitions.py:70:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in not_abstract: @typing.overload-decorated 'MyAbstractBase.not_abstract' object is not callable [not-callable]"] +Line 81: Unexpected errors ['overloads_definitions.py:81:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func5: bad return type [bad-return-type]'] +Line 86: Unexpected errors ['overloads_definitions.py:86:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func5: bad return type [bad-return-type]'] +Line 129: Unexpected errors ['overloads_definitions.py:129:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in final_method: bad return type [bad-return-type]', 'overloads_definitions.py:129:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in final_method: bad return type [bad-return-type]'] +Line 143: Unexpected errors ['overloads_definitions.py:143:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in invalid_final: bad return type [bad-return-type]', 'overloads_definitions.py:143:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in invalid_final: bad return type [bad-return-type]'] +Line 160: Unexpected errors ['overloads_definitions.py:160:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in invalid_final_2: bad return type [bad-return-type]', 'overloads_definitions.py:160:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in invalid_final_2: bad return type [bad-return-type]'] +Line 176: Unexpected errors ['overloads_definitions.py:176:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in good_override: bad return type [bad-return-type]', 'overloads_definitions.py:176:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in good_override: bad return type [bad-return-type]'] +Line 187: Unexpected errors ['overloads_definitions.py:187:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in to_override: bad return type [bad-return-type]', 'overloads_definitions.py:187:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in to_override: bad return type [bad-return-type]'] +Line 205: Unexpected errors ['overloads_definitions.py:205:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in final_method: bad return type [bad-return-type]', 'overloads_definitions.py:205:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in final_method: bad return type [bad-return-type]'] +Line 221: Unexpected errors ['overloads_definitions.py:221:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in bad_override: bad return type [bad-return-type]', 'overloads_definitions.py:221:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in bad_override: bad return type [bad-return-type]'] +Line 240: Unexpected errors ['overloads_definitions.py:240:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in good_override: bad return type [bad-return-type]', 'overloads_definitions.py:240:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in good_override: bad return type [bad-return-type]'] +Line 257: Unexpected errors ['overloads_definitions.py:257:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in to_override: bad return type [bad-return-type]', 'overloads_definitions.py:257:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in to_override: bad return type [bad-return-type]'] +""" +output = """ +overloads_definitions.py:6:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing.override not supported yet [not-supported-yet] + +from typing import ( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + final, +\u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + Protocol, +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + overload, +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + override, +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m +) +\u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +overloads_definitions.py:46:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func3: @typing.overload-decorated 'MyProto.func3' object is not callable [not-callable] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +overloads_definitions.py:58:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func4: @typing.overload-decorated 'MyAbstractBase.func4' object is not callable [not-callable] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +overloads_definitions.py:70:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in not_abstract: @typing.overload-decorated 'MyAbstractBase.not_abstract' object is not callable [not-callable] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +overloads_definitions.py:81:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func5: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +overloads_definitions.py:86:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func5: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +overloads_definitions.py:129:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in final_method: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +overloads_definitions.py:129:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in final_method: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +overloads_definitions.py:143:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in invalid_final: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +overloads_definitions.py:143:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in invalid_final: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +overloads_definitions.py:160:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in invalid_final_2: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +overloads_definitions.py:160:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in invalid_final_2: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +overloads_definitions.py:176:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in good_override: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +overloads_definitions.py:176:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in good_override: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +overloads_definitions.py:187:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in to_override: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +overloads_definitions.py:187:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in to_override: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +overloads_definitions.py:190:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Class Child overrides final method final_method, defined in base class Base [final-error] + +class Child(Base): # E[override-final] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + # The correctly-decorated @final method `Base.final_method` should cause an +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + # error if overridden in a child class (we use an overload here to avoid +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + # questions of override LSP compatibility and focus only on the override): +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + @overload # E[override-final] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + def final_method(self, x: int) -> int: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + @overload +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + def final_method(self, x: str) -> str: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + def final_method(self, x: int | str) -> int | str: # E[override-final] can't override final method +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + # This is the right way to mark an overload as @override (decorate +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + # implementation only), so the use of @override should cause an error +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + # (because there's no `Base.bad_override` method): +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + @overload # E[bad_override] marked as override but doesn't exist in base +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + def bad_override(self, x: int) -> int: # E[bad_override] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + @overload +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + def bad_override(self, x: str) -> str: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + @override +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + def bad_override(self, x: int | str) -> int | str: # E[bad_override] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + # This is also a correctly-decorated overloaded @override, which is +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + # overriding a method that does exist in the base, so there should be no +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + # error. We need both this test and the previous one, because in the +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + # previous test, an incorrect error about the use of @override decorator +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + # could appear on the same line as the expected error about overriding a +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + # method that doesn't exist in base: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + @overload +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + def good_override(self, x: int) -> int: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + @overload +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + def good_override(self, x: str) -> str: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + @override +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + def good_override(self, x: int | str) -> int | str: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + # This is the wrong way to use @override with an overloaded method, and +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + # should emit an error: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + @overload # E: @override should appear only on implementation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + @override +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + def to_override(self, x: int) -> int: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + @overload +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + @override +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + def to_override(self, x: str) -> str: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + @override +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + def to_override(self, x: int | str) -> int | str: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +overloads_definitions.py:205:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in final_method: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +overloads_definitions.py:205:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in final_method: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +overloads_definitions.py:212:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Child: Attribute 'bad_override' not found on any parent class [override-error] + + def bad_override(self, x: int) -> int: # E[bad_override] + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +overloads_definitions.py:221:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in bad_override: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +overloads_definitions.py:221:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in bad_override: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +overloads_definitions.py:240:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in good_override: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +overloads_definitions.py:240:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in good_override: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +overloads_definitions.py:257:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in to_override: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +overloads_definitions.py:257:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in to_override: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +""" diff --git a/conformance/results/pytype/overloads_definitions_stub.toml b/conformance/results/pytype/overloads_definitions_stub.toml new file mode 100644 index 000000000..de2b6eda4 --- /dev/null +++ b/conformance/results/pytype/overloads_definitions_stub.toml @@ -0,0 +1,17 @@ +conformant = "Fail" +notes = """ +Does not enforce any of the specified rules regarding overload definitions. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 168: Expected 1 errors +Lines 13, 14: Expected error (tag 'func1') +Lines 37, 38, 43: Expected error (tag 'func5') +Lines 46, 48, 52: Expected error (tag 'func6') +Lines 80, 82, 85, 87: Expected error (tag 'invalid_final') +Lines 96, 98, 101: Expected error (tag 'invalid_final_2') +Lines 122, 128, 129, 133: Expected error (tag 'override-final') +Lines 140, 142: Expected error (tag 'bad_override') +""" +output = """ +""" diff --git a/conformance/results/pytype/overloads_evaluation.toml b/conformance/results/pytype/overloads_evaluation.toml new file mode 100644 index 000000000..004eea708 --- /dev/null +++ b/conformance/results/pytype/overloads_evaluation.toml @@ -0,0 +1,136 @@ +conformant = "Partial" +notes = """ +Does not perform argument expansion (on any types) when matching overloads. +Does not treat multiple matches due to gradual types as ambiguous. +Does not prefer variadic match to indeterminate-length unpacked argument. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 89: Expected 1 errors +Line 28: Unexpected errors ['overloads_evaluation.py:28:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in example1: bad return type [bad-return-type]'] +Line 63: Unexpected errors ['overloads_evaluation.py:63:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in example2: bad return type [bad-return-type]'] +Line 82: Unexpected errors ['overloads_evaluation.py:82:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in check_expand_union: str [assert-type]'] +Line 103: Unexpected errors ['overloads_evaluation.py:103:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in expand_bool: bad return type [bad-return-type]', 'overloads_evaluation.py:103:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in expand_bool: bad return type [bad-return-type]'] +Line 106: Unexpected errors ['overloads_evaluation.py:106:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in check_expand_bool: Function expand_bool was called with the wrong arguments [wrong-arg-types]'] +Line 107: Unexpected errors ['overloads_evaluation.py:107:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in check_expand_bool: Any [assert-type]'] +Line 126: Unexpected errors ['overloads_evaluation.py:126:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in expand_enum: bad return type [bad-return-type]'] +Line 129: Unexpected errors ['overloads_evaluation.py:129:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in check_expand_enum: Function expand_enum was called with the wrong arguments [wrong-arg-types]'] +Line 130: Unexpected errors ['overloads_evaluation.py:130:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in check_expand_enum: Any [assert-type]'] +Line 144: Unexpected errors ['overloads_evaluation.py:144:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in expand_type_union: bad return type [bad-return-type]'] +Line 148: Unexpected errors ['overloads_evaluation.py:148:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in check_expand_type_union: int [assert-type]'] +Line 166: Unexpected errors ['overloads_evaluation.py:166:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in expand_tuple: bad return type [bad-return-type]'] +Line 170: Unexpected errors ['overloads_evaluation.py:170:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in check_expand_tuple: int [assert-type]'] +Line 188: Unexpected errors ['overloads_evaluation.py:188:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in variadic: bad return type [bad-return-type]'] +Line 196: Unexpected errors ['overloads_evaluation.py:196:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in check_variadic: str [assert-type]'] +Line 217: Unexpected errors ['overloads_evaluation.py:217:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in example4: bad return type [bad-return-type]'] +Line 224: Unexpected errors ['overloads_evaluation.py:224:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in check_example4: int [assert-type]'] +""" +output = """ +overloads_evaluation.py:28:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in example1: bad return type [bad-return-type] + + return 1 + \u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +Called from (traceback): + line 42, in current file +overloads_evaluation.py:32:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'x' in call to function example1 [missing-parameter] + +example1() # E: no matching overload +\u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + +overloads_evaluation.py:40:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function example1 was called with the wrong arguments [wrong-arg-types] + +example1(1, 1) # E: Literal[1] not assignable to str +\u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +overloads_evaluation.py:45:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function example1 was called with the wrong arguments [wrong-arg-types] + +example1(1) # E: Literal[1] not assignable to str +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +overloads_evaluation.py:63:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in example2: bad return type [bad-return-type] + + return 1 + \u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +overloads_evaluation.py:82:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in check_expand_union: str [assert-type] + + assert_type(ret1, int | str) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +overloads_evaluation.py:103:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in expand_bool: bad return type [bad-return-type] + + return int(x) + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +overloads_evaluation.py:103:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in expand_bool: bad return type [bad-return-type] + + return int(x) + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +overloads_evaluation.py:106:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in check_expand_bool: Function expand_bool was called with the wrong arguments [wrong-arg-types] + + ret1 = expand_bool(v) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +overloads_evaluation.py:107:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in check_expand_bool: Any [assert-type] + + assert_type(ret1, Literal[0, 1]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +overloads_evaluation.py:126:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in expand_enum: bad return type [bad-return-type] + + return x.value + \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +overloads_evaluation.py:129:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in check_expand_enum: Function expand_enum was called with the wrong arguments [wrong-arg-types] + + ret1 = expand_enum(v) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +overloads_evaluation.py:130:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in check_expand_enum: Any [assert-type] + + assert_type(ret1, Literal[0, 1]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +overloads_evaluation.py:144:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in expand_type_union: bad return type [bad-return-type] + + return 1 + \u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +overloads_evaluation.py:148:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in check_expand_type_union: int [assert-type] + + assert_type(ret1, int | str) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +overloads_evaluation.py:166:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in expand_tuple: bad return type [bad-return-type] + + return 1 + \u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +overloads_evaluation.py:170:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in check_expand_tuple: int [assert-type] + + assert_type(ret1, int | str) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +overloads_evaluation.py:188:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in variadic: bad return type [bad-return-type] + + return 1 + \u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +overloads_evaluation.py:196:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in check_variadic: str [assert-type] + + assert_type(ret1, int) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +overloads_evaluation.py:217:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in example4: bad return type [bad-return-type] + + return 1 + \u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +overloads_evaluation.py:224:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in check_example4: int [assert-type] + + assert_type(ret2, Any) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +""" diff --git a/conformance/results/pytype/version.toml b/conformance/results/pytype/version.toml index 3cd350580..57c8a1ffa 100644 --- a/conformance/results/pytype/version.toml +++ b/conformance/results/pytype/version.toml @@ -1,2 +1,2 @@ version = "pytype 2024.10.11" -test_duration = 34.7 +test_duration = 35.2 diff --git a/conformance/results/results.html b/conformance/results/results.html index c47b5d4c0..86f2fd3c0 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -159,16 +159,16 @@

    Python Type System Conformance Test Results

     
    mypy 1.15.0
    -
    1.8sec
    +
    1.7sec
    pyright 1.1.394
    +
    pyright 1.1.396
    1.3sec
    pyre 0.9.23
    -
    6.5sec
    +
    6.8sec
    pytype 2024.10.11
    -
    34.9sec
    +
    34.7sec
    @@ -432,8 +432,8 @@

    Python Type System Conformance Test Results

         qualifiers_final_annotation
    Partial

    Does not treat use of Final name as if it was replaced by the literal in NamedTuple definition.

    Does not allow conditional assignment of Final instance variable in __init__ method.

    Does not allow redefinition of private class variable that is marked Final in parent class.

    Does not report modification of local Final variable via "for" statement.

    Pass
    Partial

    Does not report Final variable with missing initialization in module scope.

    Does not report error for invalid nesting of Final and ClassVar.

    Does not treat use of Final name as if it was replaced by the literal in NamedTuple definition.

    Partial

    Does not report Final variable with missing initialization.

    Does not reject Final instance variable declared outside of __init__ method.

    Does not reject modification of global variable declared Final.

    Does not reject modification of local variable declared Final.

    Partial

    Does not report Final variable with missing initialization in module scope.

    Does not report error for invalid nesting of Final and ClassVar.

    Does not treat use of Final name as if it was replaced by the literal in NamedTuple definition.

    Does not reject modification of imported variable declared Final.

    Partial

    Does not report Final variable with missing initialization.

    Does not reject Final instance variable declared outside of __init__ method.

    Does not reject modification of global variable declared Final.

    Does not reject modification of local variable declared Final.

    Does not reject modification of imported variable declared Final.

         qualifiers_final_decorator Pass
    - - + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + diff --git a/conformance/tests/overloads_definitions.py b/conformance/tests/overloads_definitions.py index a2323d7fe..d6c0267e6 100644 --- a/conformance/tests/overloads_definitions.py +++ b/conformance/tests/overloads_definitions.py @@ -10,6 +10,7 @@ override, ) + # > At least two @overload-decorated definitions must be present. @overload # E[func1] def func1() -> None: # E[func1]: At least two overloads must be present @@ -29,33 +30,27 @@ def func2(x: int) -> int: # E[func2]: no implementation @overload -def func2(x: str) -> str: - ... +def func2(x: str) -> str: ... # > Overload definitions within stub files, protocols, and on abstract methods # > within abstract base classes are exempt from this check. class MyProto(Protocol): @overload - def func3(self, x: int) -> int: - ... - + def func3(self, x: int) -> int: ... @overload - def func3(self, x: str) -> str: - ... + def func3(self, x: str) -> str: ... + class MyAbstractBase(ABC): @overload @abstractmethod - def func4(self, x: int) -> int: - ... - + def func4(self, x: int) -> int: ... @overload @abstractmethod - def func4(self, x: str) -> str: - ... + def func4(self, x: str) -> str: ... # A non-abstract method in an abstract base class still requires an # implementation: @@ -64,10 +59,8 @@ def func4(self, x: str) -> str: def not_abstract(self, x: int) -> int: # E[not_abstract] no implementation ... - @overload - def not_abstract(self, x: str) -> str: - ... + def not_abstract(self, x: str) -> str: ... # > If one overload signature is decorated with ``@staticmethod`` or @@ -102,7 +95,6 @@ def func6(cls, x: int | str) -> int | str: # E[func6] return 1 - # > If a ``@final`` or ``@override`` decorator is supplied for a function with # > overloads, the decorator should be applied only to the overload # > implementation if it is present. If an overload implementation isn't present @@ -112,21 +104,17 @@ def func6(cls, x: int | str) -> int | str: # E[func6] # > ``@override`` decorator follows these rules, a type checker should treat the # > decorator as if it is present on all overloads. class Base: - # This is a good definition of an overloaded final method (@final decorator # on implementation only): @overload - def final_method(self, x: int) -> int: - ... + def final_method(self, x: int) -> int: ... @overload - def final_method(self, x: str) -> str: - ... + def final_method(self, x: str) -> str: ... @final - def final_method(self, x: int | str) -> int | str: - ... + def final_method(self, x: int | str) -> int | str: ... # The @final decorator should not be on one of the overloads: @@ -139,8 +127,7 @@ def invalid_final(self, x: int) -> int: # E[invalid_final] def invalid_final(self, x: str) -> str: # E[invalid_final] ... - def invalid_final(self, x: int | str) -> int | str: - ... + def invalid_final(self, x: int | str) -> int | str: ... # The @final decorator should not be on multiple overloads and # implementation: @@ -152,12 +139,11 @@ def invalid_final_2(self, x: int) -> int: # E[invalid_final_2] @overload @final - def invalid_final_2(self, x: str) -> str: + def invalid_final_2(self, x: str) -> str: # E[invalid_final_2] ... @final - def invalid_final_2(self, x: int | str) -> int | str: - ... + def invalid_final_2(self, x: int | str) -> int | str: ... # These methods are just here for the @override test below. We use an # overload because mypy doesn't like overriding a non-overloaded method @@ -165,43 +151,36 @@ def invalid_final_2(self, x: int | str) -> int | str: # specification question, but it's not what we're trying to test here: @overload - def good_override(self, x: int) -> int: - ... + def good_override(self, x: int) -> int: ... @overload - def good_override(self, x: str) -> str: - ... + def good_override(self, x: str) -> str: ... - def good_override(self, x: int | str) -> int | str: - ... + def good_override(self, x: int | str) -> int | str: ... @overload - def to_override(self, x: int) -> int: - ... + def to_override(self, x: int) -> int: ... @overload - def to_override(self, x: str) -> str: - ... + def to_override(self, x: str) -> str: ... - def to_override(self, x: int | str) -> int | str: - ... + def to_override(self, x: int | str) -> int | str: ... class Child(Base): # E[override-final] - # The correctly-decorated @final method `Base.final_method` should cause an # error if overridden in a child class (we use an overload here to avoid # questions of override LSP compatibility and focus only on the override): - @overload # E[override-final] - def final_method(self, x: int) -> int: - ... + @overload # E[override-final] + def final_method(self, x: int) -> int: ... @overload - def final_method(self, x: str) -> str: - ... + def final_method(self, x: str) -> str: ... - def final_method(self, x: int | str) -> int | str: # E[override-final] can't override final method + def final_method( # E[override-final] can't override final method + self, x: int | str + ) -> int | str: # E[override-final] can't override final method ... # This is the right way to mark an overload as @override (decorate @@ -213,11 +192,10 @@ def bad_override(self, x: int) -> int: # E[bad_override] ... @overload - def bad_override(self, x: str) -> str: - ... + def bad_override(self, x: str) -> str: ... @override - def bad_override(self, x: int | str) -> int | str: # E[bad_override] + def bad_override(self, x: int | str) -> int | str: # E[bad_override] ... # This is also a correctly-decorated overloaded @override, which is @@ -228,31 +206,24 @@ def bad_override(self, x: int | str) -> int | str: # E[bad_override] # method that doesn't exist in base: @overload - def good_override(self, x: int) -> int: - ... + def good_override(self, x: int) -> int: ... @overload - def good_override(self, x: str) -> str: - ... + def good_override(self, x: str) -> str: ... @override - def good_override(self, x: int | str) -> int | str: - ... + def good_override(self, x: int | str) -> int | str: ... # This is the wrong way to use @override with an overloaded method, and # should emit an error: - @overload # E: @override should appear only on implementation + @overload # E[override_impl]: @override should appear only on implementation @override - def to_override(self, x: int) -> int: - ... + def to_override(self, x: int) -> int: ... # E[override_impl] @overload @override - def to_override(self, x: str) -> str: - ... + def to_override(self, x: str) -> str: ... # E[override_impl] @override - def to_override(self, x: int | str) -> int | str: - ... - + def to_override(self, x: int | str) -> int | str: ... diff --git a/conformance/tests/overloads_definitions_stub.pyi b/conformance/tests/overloads_definitions_stub.pyi index f86f2980f..3ab48adf5 100644 --- a/conformance/tests/overloads_definitions_stub.pyi +++ b/conformance/tests/overloads_definitions_stub.pyi @@ -14,20 +14,15 @@ from typing import ( def func1() -> None: # E[func1]: At least two overloads must be present ... - # > The ``@overload``-decorated definitions must be followed by an overload # > implementation, which does not include an ``@overload`` decorator. Type # > checkers should report an error or warning if an implementation is missing. # > Overload definitions within stub files, protocols, and on abstract methods # > within abstract base classes are exempt from this check. @overload -def func2(x: int) -> int: - ... - - +def func2(x: int) -> int: ... @overload -def func2(x: str) -> str: - ... +def func2(x: str) -> str: ... # > If one overload signature is decorated with ``@staticmethod`` or # > ``@classmethod``, all overload signatures must be similarly decorated. The @@ -37,22 +32,18 @@ class C: @overload # E[func5] def func5(x: int) -> int: # E[func5] ... - @overload @staticmethod def func5(x: str) -> str: # E[func5] ... - @overload # E[func6] @classmethod def func6(cls, x: int) -> int: # E[func6] ... - @overload def func6(cls, x: str) -> str: # E[func6] ... - # > If a ``@final`` or ``@override`` decorator is supplied for a function with # > overloads, the decorator should be applied only to the overload # > implementation if it is present. If an overload implementation isn't present @@ -62,18 +53,14 @@ class C: # > ``@override`` decorator follows these rules, a type checker should treat the # > decorator as if it is present on all overloads. class Base: - # This is a good definition of an overloaded final method in a stub (@final # decorator on first overload only): @overload @final - def final_method(self, x: int) -> int: - ... - + def final_method(self, x: int) -> int: ... @overload - def final_method(self, x: str) -> str: - ... + def final_method(self, x: str) -> str: ... # The @final decorator should not be on multiple overloads: @@ -81,15 +68,12 @@ class Base: @final def invalid_final(self, x: int) -> int: # E[invalid_final] ... - @overload # E[invalid_final] @final def invalid_final(self, x: str) -> str: # E[invalid_final] ... - @overload - def invalid_final(self, x: bytes) -> bytes: - ... + def invalid_final(self, x: bytes) -> bytes: ... # The @final decorator should not be on all overloads: @@ -97,11 +81,9 @@ class Base: @final def invalid_final_2(self, x: int) -> int: # E[invalid_final_2] ... - @overload # E[invalid_final_2] @final - def invalid_final_2(self, x: str) -> str: - ... + def invalid_final_2(self, x: str) -> str: ... # E[invalid_final_2] # These methods are just here for the @override test below. We use an # overload because mypy doesn't like overriding a non-overloaded method @@ -112,15 +94,12 @@ class Base: def good_override(self, x: int) -> int: ... @overload def good_override(self, x: str) -> str: ... - @overload def to_override(self, x: int) -> int: ... @overload def to_override(self, x: str) -> str: ... - class Child(Base): # E[override-final] - # The correctly-decorated @final method `Base.final_method` should cause an # error if overridden in a child class (we use an overload here to avoid # questions of override LSP compatibility and focus only on the override): @@ -128,9 +107,10 @@ class Child(Base): # E[override-final] @overload # E[override-final] def final_method(self, x: int) -> int: # E[override-final] ... - @overload - def final_method(self, x: str) -> str: # E[override-final] can't override final method + def final_method( # E[override-final] can't override final method + self, x: str + ) -> str: # E[override-final] can't override final method ... # This is the right way to mark an overload as @override (decorate first @@ -141,10 +121,8 @@ class Child(Base): # E[override-final] @override def bad_override(self, x: int) -> int: # E[bad_override] ... - @overload - def bad_override(self, x: str) -> str: - ... + def bad_override(self, x: str) -> str: ... # This is also a correctly-decorated overloaded @override, which is # overriding a method that does exist in the base, so there should be no @@ -155,21 +133,18 @@ class Child(Base): # E[override-final] @overload @override - def good_override(self, x: int) -> int: - ... - + def good_override(self, x: int) -> int: ... @overload - def good_override(self, x: str) -> str: - ... + def good_override(self, x: str) -> str: ... # This is the wrong way to use @override with an overloaded method, and # should emit an error: - @overload # E: @override should appear only on first overload - def to_override(self, x: int) -> int: - ... - + @overload # E[override_impl]: @override should appear only on first overload + def to_override(self, x: int) -> int: ... @overload @override - def to_override(self, x: str) -> str: + def to_override( # E[override_impl]: @override should appear only on first overload + self, x: str + ) -> str: # E[override_impl]: @override should appear only on first overload ... From b729bfc494c026a5f60fe5a9d7c346cca5e10f82 Mon Sep 17 00:00:00 2001 From: Eric Traut Date: Tue, 1 Apr 2025 17:11:56 -0700 Subject: [PATCH 088/308] Added a few more overload evaluation tests. (#1957) * Added a few more overload evaluation tests. These uncovered a few more cases where mypy and pyright do not conform to the standard. * Incorporated feedback from Carl's code review. --- .../results/mypy/overloads_evaluation.toml | 74 +++--- .../results/pyre/overloads_evaluation.toml | 62 ++--- conformance/results/pyre/version.toml | 2 +- .../results/pyright/overloads_evaluation.toml | 21 +- .../results/pytype/overloads_evaluation.toml | 135 +++++++---- conformance/results/pytype/version.toml | 2 +- conformance/results/results.html | 8 +- conformance/tests/overloads_evaluation.py | 213 ++++++++++++++---- 8 files changed, 347 insertions(+), 170 deletions(-) diff --git a/conformance/results/mypy/overloads_evaluation.toml b/conformance/results/mypy/overloads_evaluation.toml index b1d7d783a..91b04235c 100644 --- a/conformance/results/mypy/overloads_evaluation.toml +++ b/conformance/results/mypy/overloads_evaluation.toml @@ -3,41 +3,51 @@ notes = """ Does not expand boolean arguments to Literal[True] and Literal[False]. Does not expand enum arguments to literal variants. Does not expand tuple arguments to possible combinations. +Does not evaluate Any in some cases where overload is ambiguous. +Evaluates Any in some cases where overload is not ambiguous. """ conformance_automated = "Fail" errors_diff = """ -Line 106: Unexpected errors ['overloads_evaluation.py:106: error: No overload variant of "expand_bool" matches argument type "bool" [call-overload]'] -Line 107: Unexpected errors ['overloads_evaluation.py:107: error: Expression is of type "Any", not "Literal[0, 1]" [assert-type]'] -Line 129: Unexpected errors ['overloads_evaluation.py:129: error: No overload variant of "expand_enum" matches argument type "Color" [call-overload]'] -Line 130: Unexpected errors ['overloads_evaluation.py:130: error: Expression is of type "Any", not "Literal[0, 1]" [assert-type]'] -Line 169: Unexpected errors ['overloads_evaluation.py:169: error: Argument 1 to "expand_tuple" has incompatible type "tuple[int, int | str]"; expected "tuple[int, int]" [arg-type]'] -Line 170: Unexpected errors ['overloads_evaluation.py:170: error: Expression is of type "int", not "int | str" [assert-type]'] +Line 134: Unexpected errors ['overloads_evaluation.py:134: error: No overload variant of "expand_bool" matches argument type "bool" [call-overload]'] +Line 135: Unexpected errors ['overloads_evaluation.py:135: error: Expression is of type "Any", not "Literal[0, 1]" [assert-type]'] +Line 160: Unexpected errors ['overloads_evaluation.py:160: error: No overload variant of "expand_enum" matches argument type "Color" [call-overload]'] +Line 161: Unexpected errors ['overloads_evaluation.py:161: error: Expression is of type "Any", not "Literal[0, 1]" [assert-type]'] +Line 204: Unexpected errors ['overloads_evaluation.py:204: error: Argument 1 to "expand_tuple" has incompatible type "tuple[int, int | str]"; expected "tuple[int, int]" [arg-type]'] +Line 205: Unexpected errors ['overloads_evaluation.py:205: error: Expression is of type "int", not "int | str" [assert-type]'] +Line 264: Unexpected errors ['overloads_evaluation.py:264: error: Expression is of type "list[Any]", not "Any" [assert-type]'] +Line 280: Unexpected errors ['overloads_evaluation.py:280: error: Expression is of type "list[Any]", not "Any" [assert-type]'] +Line 301: Unexpected errors ['overloads_evaluation.py:301: error: Expression is of type "Any", not "float" [assert-type]'] +Line 345: Unexpected errors ['overloads_evaluation.py:345: error: Expression is of type "list[Any]", not "Any" [assert-type]'] """ output = """ -overloads_evaluation.py:32: error: All overload variants of "example1" require at least one argument [call-overload] -overloads_evaluation.py:32: note: Possible overload variants: -overloads_evaluation.py:32: note: def example1(x: int, y: str) -> int -overloads_evaluation.py:32: note: def example1(x: str) -> str -overloads_evaluation.py:40: error: No overload variant of "example1" matches argument types "int", "int" [call-overload] -overloads_evaluation.py:40: note: Possible overload variants: -overloads_evaluation.py:40: note: def example1(x: int, y: str) -> int -overloads_evaluation.py:40: note: def example1(x: str) -> str -overloads_evaluation.py:45: error: No overload variant of "example1" matches argument type "int" [call-overload] -overloads_evaluation.py:45: note: Possible overload variants: -overloads_evaluation.py:45: note: def example1(x: int, y: str) -> int -overloads_evaluation.py:45: note: def example1(x: str) -> str -overloads_evaluation.py:89: error: Argument 1 to "example2" has incompatible type "int | str"; expected "int" [arg-type] -overloads_evaluation.py:89: error: Argument 2 to "example2" has incompatible type "int | str"; expected "str" [arg-type] -overloads_evaluation.py:106: error: No overload variant of "expand_bool" matches argument type "bool" [call-overload] -overloads_evaluation.py:106: note: Possible overload variants: -overloads_evaluation.py:106: note: def expand_bool(x: Literal[False]) -> Literal[0] -overloads_evaluation.py:106: note: def expand_bool(x: Literal[True]) -> Literal[1] -overloads_evaluation.py:107: error: Expression is of type "Any", not "Literal[0, 1]" [assert-type] -overloads_evaluation.py:129: error: No overload variant of "expand_enum" matches argument type "Color" [call-overload] -overloads_evaluation.py:129: note: Possible overload variants: -overloads_evaluation.py:129: note: def expand_enum(x: Literal[Color.RED]) -> Literal[0] -overloads_evaluation.py:129: note: def expand_enum(x: Literal[Color.BLUE]) -> Literal[1] -overloads_evaluation.py:130: error: Expression is of type "Any", not "Literal[0, 1]" [assert-type] -overloads_evaluation.py:169: error: Argument 1 to "expand_tuple" has incompatible type "tuple[int, int | str]"; expected "tuple[int, int]" [arg-type] -overloads_evaluation.py:170: error: Expression is of type "int", not "int | str" [assert-type] +overloads_evaluation.py:38: error: All overload variants of "example1_1" require at least one argument [call-overload] +overloads_evaluation.py:38: note: Possible overload variants: +overloads_evaluation.py:38: note: def example1_1(x: int, y: str) -> int +overloads_evaluation.py:38: note: def example1_1(x: str) -> str +overloads_evaluation.py:46: error: No overload variant of "example1_1" matches argument types "int", "int" [call-overload] +overloads_evaluation.py:46: note: Possible overload variants: +overloads_evaluation.py:46: note: def example1_1(x: int, y: str) -> int +overloads_evaluation.py:46: note: def example1_1(x: str) -> str +overloads_evaluation.py:51: error: No overload variant of "example1_1" matches argument type "int" [call-overload] +overloads_evaluation.py:51: note: Possible overload variants: +overloads_evaluation.py:51: note: def example1_1(x: int, y: str) -> int +overloads_evaluation.py:51: note: def example1_1(x: str) -> str +overloads_evaluation.py:115: error: Argument 1 to "example2" has incompatible type "int | str"; expected "int" [arg-type] +overloads_evaluation.py:115: error: Argument 2 to "example2" has incompatible type "int | str"; expected "str" [arg-type] +overloads_evaluation.py:134: error: No overload variant of "expand_bool" matches argument type "bool" [call-overload] +overloads_evaluation.py:134: note: Possible overload variants: +overloads_evaluation.py:134: note: def expand_bool(x: Literal[False]) -> Literal[0] +overloads_evaluation.py:134: note: def expand_bool(x: Literal[True]) -> Literal[1] +overloads_evaluation.py:135: error: Expression is of type "Any", not "Literal[0, 1]" [assert-type] +overloads_evaluation.py:160: error: No overload variant of "expand_enum" matches argument type "Color" [call-overload] +overloads_evaluation.py:160: note: Possible overload variants: +overloads_evaluation.py:160: note: def expand_enum(x: Literal[Color.RED]) -> Literal[0] +overloads_evaluation.py:160: note: def expand_enum(x: Literal[Color.BLUE]) -> Literal[1] +overloads_evaluation.py:161: error: Expression is of type "Any", not "Literal[0, 1]" [assert-type] +overloads_evaluation.py:204: error: Argument 1 to "expand_tuple" has incompatible type "tuple[int, int | str]"; expected "tuple[int, int]" [arg-type] +overloads_evaluation.py:205: error: Expression is of type "int", not "int | str" [assert-type] +overloads_evaluation.py:264: error: Expression is of type "list[Any]", not "Any" [assert-type] +overloads_evaluation.py:280: error: Expression is of type "list[Any]", not "Any" [assert-type] +overloads_evaluation.py:301: error: Expression is of type "Any", not "float" [assert-type] +overloads_evaluation.py:345: error: Expression is of type "list[Any]", not "Any" [assert-type] """ diff --git a/conformance/results/pyre/overloads_evaluation.toml b/conformance/results/pyre/overloads_evaluation.toml index 9a8486864..c5ca33786 100644 --- a/conformance/results/pyre/overloads_evaluation.toml +++ b/conformance/results/pyre/overloads_evaluation.toml @@ -9,35 +9,39 @@ Does not treat multiple matches due to gradual types as ambiguous. """ conformance_automated = "Fail" errors_diff = """ -Line 81: Unexpected errors ['overloads_evaluation.py:81:23 Incompatible parameter type [6]: In call `example2`, for 2nd positional argument, expected `str` but got `Union[int, str]`.'] -Line 82: Unexpected errors ['overloads_evaluation.py:82:4 Assert type [70]: Expected `Union[int, str]` but got `str`.'] -Line 106: Unexpected errors ['overloads_evaluation.py:106:23 Incompatible parameter type [6]: In call `expand_bool`, for 1st positional argument, expected `typing_extensions.Literal[False]` but got `bool`.'] -Line 107: Unexpected errors ['overloads_evaluation.py:107:4 Assert type [70]: Expected `Union[typing_extensions.Literal[0], typing_extensions.Literal[1]]` but got `typing_extensions.Literal[0]`.'] -Line 129: Unexpected errors ['overloads_evaluation.py:129:23 Incompatible parameter type [6]: In call `expand_enum`, for 1st positional argument, expected `typing_extensions.Literal[Color.RED]` but got `Color`.'] -Line 130: Unexpected errors ['overloads_evaluation.py:130:4 Assert type [70]: Expected `Union[typing_extensions.Literal[0], typing_extensions.Literal[1]]` but got `typing_extensions.Literal[0]`.'] -Line 147: Unexpected errors ['overloads_evaluation.py:147:29 Incompatible parameter type [6]: In call `expand_type_union`, for 1st positional argument, expected `Type[int]` but got `Type[Union[int, str]]`.'] -Line 148: Unexpected errors ['overloads_evaluation.py:148:4 Assert type [70]: Expected `Union[int, str]` but got `int`.'] -Line 169: Unexpected errors ['overloads_evaluation.py:169:24 Incompatible parameter type [6]: In call `expand_tuple`, for 1st positional argument, expected `Tuple[int, int]` but got `Tuple[int, Union[int, str]]`.'] -Line 170: Unexpected errors ['overloads_evaluation.py:170:4 Assert type [70]: Expected `Union[int, str]` but got `int`.'] -Line 196: Unexpected errors ['overloads_evaluation.py:196:4 Assert type [70]: Expected `int` but got `str`.'] -Line 224: Unexpected errors ['overloads_evaluation.py:224:4 Assert type [70]: Expected `typing.Any` but got `int`.'] +Line 105: Unexpected errors ['overloads_evaluation.py:105:23 Incompatible parameter type [6]: In call `example2`, for 2nd positional argument, expected `str` but got `Union[int, str]`.'] +Line 106: Unexpected errors ['overloads_evaluation.py:106:4 Assert type [70]: Expected `Union[int, str]` but got `str`.'] +Line 134: Unexpected errors ['overloads_evaluation.py:134:23 Incompatible parameter type [6]: In call `expand_bool`, for 1st positional argument, expected `typing_extensions.Literal[False]` but got `bool`.'] +Line 135: Unexpected errors ['overloads_evaluation.py:135:4 Assert type [70]: Expected `Union[typing_extensions.Literal[0], typing_extensions.Literal[1]]` but got `typing_extensions.Literal[0]`.'] +Line 160: Unexpected errors ['overloads_evaluation.py:160:23 Incompatible parameter type [6]: In call `expand_enum`, for 1st positional argument, expected `typing_extensions.Literal[Color.RED]` but got `Color`.'] +Line 161: Unexpected errors ['overloads_evaluation.py:161:4 Assert type [70]: Expected `Union[typing_extensions.Literal[0], typing_extensions.Literal[1]]` but got `typing_extensions.Literal[0]`.'] +Line 180: Unexpected errors ['overloads_evaluation.py:180:29 Incompatible parameter type [6]: In call `expand_type_union`, for 1st positional argument, expected `Type[int]` but got `Type[Union[int, str]]`.'] +Line 181: Unexpected errors ['overloads_evaluation.py:181:4 Assert type [70]: Expected `Union[int, str]` but got `int`.'] +Line 204: Unexpected errors ['overloads_evaluation.py:204:24 Incompatible parameter type [6]: In call `expand_tuple`, for 1st positional argument, expected `Tuple[int, int]` but got `Tuple[int, Union[int, str]]`.'] +Line 205: Unexpected errors ['overloads_evaluation.py:205:4 Assert type [70]: Expected `Union[int, str]` but got `int`.'] +Line 234: Unexpected errors ['overloads_evaluation.py:234:4 Assert type [70]: Expected `int` but got `str`.'] +Line 264: Unexpected errors ['overloads_evaluation.py:264:4 Assert type [70]: Expected `typing.Any` but got `List[int]`.'] +Line 280: Unexpected errors ['overloads_evaluation.py:280:4 Assert type [70]: Expected `typing.Any` but got `List[int]`.'] +Line 345: Unexpected errors ['overloads_evaluation.py:345:4 Assert type [70]: Expected `typing.Any` but got `List[int]`.'] """ output = """ -overloads_evaluation.py:32:0 Missing argument [20]: Call `example1` expects argument `x`. -overloads_evaluation.py:40:12 Incompatible parameter type [6]: In call `example1`, for 2nd positional argument, expected `str` but got `int`. -overloads_evaluation.py:45:9 Incompatible parameter type [6]: In call `example1`, for 1st positional argument, expected `str` but got `int`. -overloads_evaluation.py:81:23 Incompatible parameter type [6]: In call `example2`, for 2nd positional argument, expected `str` but got `Union[int, str]`. -overloads_evaluation.py:82:4 Assert type [70]: Expected `Union[int, str]` but got `str`. -overloads_evaluation.py:89:13 Incompatible parameter type [6]: In call `example2`, for 1st positional argument, expected `int` but got `Union[int, str]`. -overloads_evaluation.py:89:16 Incompatible parameter type [6]: In call `example2`, for 2nd positional argument, expected `str` but got `Union[int, str]`. -overloads_evaluation.py:106:23 Incompatible parameter type [6]: In call `expand_bool`, for 1st positional argument, expected `typing_extensions.Literal[False]` but got `bool`. -overloads_evaluation.py:107:4 Assert type [70]: Expected `Union[typing_extensions.Literal[0], typing_extensions.Literal[1]]` but got `typing_extensions.Literal[0]`. -overloads_evaluation.py:129:23 Incompatible parameter type [6]: In call `expand_enum`, for 1st positional argument, expected `typing_extensions.Literal[Color.RED]` but got `Color`. -overloads_evaluation.py:130:4 Assert type [70]: Expected `Union[typing_extensions.Literal[0], typing_extensions.Literal[1]]` but got `typing_extensions.Literal[0]`. -overloads_evaluation.py:147:29 Incompatible parameter type [6]: In call `expand_type_union`, for 1st positional argument, expected `Type[int]` but got `Type[Union[int, str]]`. -overloads_evaluation.py:148:4 Assert type [70]: Expected `Union[int, str]` but got `int`. -overloads_evaluation.py:169:24 Incompatible parameter type [6]: In call `expand_tuple`, for 1st positional argument, expected `Tuple[int, int]` but got `Tuple[int, Union[int, str]]`. -overloads_evaluation.py:170:4 Assert type [70]: Expected `Union[int, str]` but got `int`. -overloads_evaluation.py:196:4 Assert type [70]: Expected `int` but got `str`. -overloads_evaluation.py:224:4 Assert type [70]: Expected `typing.Any` but got `int`. +overloads_evaluation.py:38:0 Missing argument [20]: Call `example1_1` expects argument `x`. +overloads_evaluation.py:46:14 Incompatible parameter type [6]: In call `example1_1`, for 2nd positional argument, expected `str` but got `int`. +overloads_evaluation.py:51:11 Incompatible parameter type [6]: In call `example1_1`, for 1st positional argument, expected `str` but got `int`. +overloads_evaluation.py:105:23 Incompatible parameter type [6]: In call `example2`, for 2nd positional argument, expected `str` but got `Union[int, str]`. +overloads_evaluation.py:106:4 Assert type [70]: Expected `Union[int, str]` but got `str`. +overloads_evaluation.py:115:13 Incompatible parameter type [6]: In call `example2`, for 1st positional argument, expected `int` but got `Union[int, str]`. +overloads_evaluation.py:115:16 Incompatible parameter type [6]: In call `example2`, for 2nd positional argument, expected `str` but got `Union[int, str]`. +overloads_evaluation.py:134:23 Incompatible parameter type [6]: In call `expand_bool`, for 1st positional argument, expected `typing_extensions.Literal[False]` but got `bool`. +overloads_evaluation.py:135:4 Assert type [70]: Expected `Union[typing_extensions.Literal[0], typing_extensions.Literal[1]]` but got `typing_extensions.Literal[0]`. +overloads_evaluation.py:160:23 Incompatible parameter type [6]: In call `expand_enum`, for 1st positional argument, expected `typing_extensions.Literal[Color.RED]` but got `Color`. +overloads_evaluation.py:161:4 Assert type [70]: Expected `Union[typing_extensions.Literal[0], typing_extensions.Literal[1]]` but got `typing_extensions.Literal[0]`. +overloads_evaluation.py:180:29 Incompatible parameter type [6]: In call `expand_type_union`, for 1st positional argument, expected `Type[int]` but got `Type[Union[int, str]]`. +overloads_evaluation.py:181:4 Assert type [70]: Expected `Union[int, str]` but got `int`. +overloads_evaluation.py:204:24 Incompatible parameter type [6]: In call `expand_tuple`, for 1st positional argument, expected `Tuple[int, int]` but got `Tuple[int, Union[int, str]]`. +overloads_evaluation.py:205:4 Assert type [70]: Expected `Union[int, str]` but got `int`. +overloads_evaluation.py:234:4 Assert type [70]: Expected `int` but got `str`. +overloads_evaluation.py:264:4 Assert type [70]: Expected `typing.Any` but got `List[int]`. +overloads_evaluation.py:280:4 Assert type [70]: Expected `typing.Any` but got `List[int]`. +overloads_evaluation.py:345:4 Assert type [70]: Expected `typing.Any` but got `List[int]`. """ diff --git a/conformance/results/pyre/version.toml b/conformance/results/pyre/version.toml index b7e0e78a4..4b79e199c 100644 --- a/conformance/results/pyre/version.toml +++ b/conformance/results/pyre/version.toml @@ -1,2 +1,2 @@ version = "pyre 0.9.23" -test_duration = 6.3 +test_duration = 6.4 diff --git a/conformance/results/pyright/overloads_evaluation.toml b/conformance/results/pyright/overloads_evaluation.toml index 2c4901905..7f7e0dce0 100644 --- a/conformance/results/pyright/overloads_evaluation.toml +++ b/conformance/results/pyright/overloads_evaluation.toml @@ -1,19 +1,24 @@ -conformant = "Pass" -conformance_automated = "Pass" +conformant = "Partial" +notes = """ +Does not evaluate Any in some cases where overload is ambiguous. +""" +conformance_automated = "Fail" errors_diff = """ +Line 280: Unexpected errors ['overloads_evaluation.py:280:17 - error: "assert_type" mismatch: expected "Any" but received "list[int]" (reportAssertTypeFailure)'] """ output = """ -overloads_evaluation.py:32:1 - error: No overloads for "example1" match the provided arguments +overloads_evaluation.py:38:1 - error: No overloads for "example1_1" match the provided arguments   Argument types: () (reportCallIssue) -overloads_evaluation.py:40:13 - error: Argument of type "Literal[1]" cannot be assigned to parameter "y" of type "str" in function "example1" +overloads_evaluation.py:46:15 - error: Argument of type "Literal[1]" cannot be assigned to parameter "y" of type "str" in function "example1_1"   "Literal[1]" is not assignable to "str" (reportArgumentType) -overloads_evaluation.py:45:10 - error: Argument of type "Literal[1]" cannot be assigned to parameter "x" of type "str" in function "example1" +overloads_evaluation.py:51:12 - error: Argument of type "Literal[1]" cannot be assigned to parameter "x" of type "str" in function "example1_1"   "Literal[1]" is not assignable to "str" (reportArgumentType) -overloads_evaluation.py:89:5 - error: No overloads for "example2" match the provided arguments (reportCallIssue) -overloads_evaluation.py:89:14 - error: Argument of type "int | str" cannot be assigned to parameter "x" of type "int" in function "example2" +overloads_evaluation.py:115:5 - error: No overloads for "example2" match the provided arguments (reportCallIssue) +overloads_evaluation.py:115:14 - error: Argument of type "int | str" cannot be assigned to parameter "x" of type "int" in function "example2"   Type "int | str" is not assignable to type "int"     "str" is not assignable to "int" (reportArgumentType) -overloads_evaluation.py:89:17 - error: Argument of type "int | str" cannot be assigned to parameter "y" of type "int" in function "example2" +overloads_evaluation.py:115:17 - error: Argument of type "int | str" cannot be assigned to parameter "y" of type "int" in function "example2"   Type "int | str" is not assignable to type "int"     "str" is not assignable to "int" (reportArgumentType) +overloads_evaluation.py:280:17 - error: "assert_type" mismatch: expected "Any" but received "list[int]" (reportAssertTypeFailure) """ diff --git a/conformance/results/pytype/overloads_evaluation.toml b/conformance/results/pytype/overloads_evaluation.toml index 004eea708..6efdfacc7 100644 --- a/conformance/results/pytype/overloads_evaluation.toml +++ b/conformance/results/pytype/overloads_evaluation.toml @@ -6,131 +6,168 @@ Does not prefer variadic match to indeterminate-length unpacked argument. """ conformance_automated = "Fail" errors_diff = """ -Line 89: Expected 1 errors -Line 28: Unexpected errors ['overloads_evaluation.py:28:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in example1: bad return type [bad-return-type]'] -Line 63: Unexpected errors ['overloads_evaluation.py:63:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in example2: bad return type [bad-return-type]'] -Line 82: Unexpected errors ['overloads_evaluation.py:82:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in check_expand_union: str [assert-type]'] -Line 103: Unexpected errors ['overloads_evaluation.py:103:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in expand_bool: bad return type [bad-return-type]', 'overloads_evaluation.py:103:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in expand_bool: bad return type [bad-return-type]'] -Line 106: Unexpected errors ['overloads_evaluation.py:106:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in check_expand_bool: Function expand_bool was called with the wrong arguments [wrong-arg-types]'] -Line 107: Unexpected errors ['overloads_evaluation.py:107:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in check_expand_bool: Any [assert-type]'] -Line 126: Unexpected errors ['overloads_evaluation.py:126:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in expand_enum: bad return type [bad-return-type]'] -Line 129: Unexpected errors ['overloads_evaluation.py:129:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in check_expand_enum: Function expand_enum was called with the wrong arguments [wrong-arg-types]'] -Line 130: Unexpected errors ['overloads_evaluation.py:130:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in check_expand_enum: Any [assert-type]'] -Line 144: Unexpected errors ['overloads_evaluation.py:144:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in expand_type_union: bad return type [bad-return-type]'] -Line 148: Unexpected errors ['overloads_evaluation.py:148:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in check_expand_type_union: int [assert-type]'] -Line 166: Unexpected errors ['overloads_evaluation.py:166:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in expand_tuple: bad return type [bad-return-type]'] -Line 170: Unexpected errors ['overloads_evaluation.py:170:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in check_expand_tuple: int [assert-type]'] -Line 188: Unexpected errors ['overloads_evaluation.py:188:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in variadic: bad return type [bad-return-type]'] -Line 196: Unexpected errors ['overloads_evaluation.py:196:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in check_variadic: str [assert-type]'] -Line 217: Unexpected errors ['overloads_evaluation.py:217:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in example4: bad return type [bad-return-type]'] -Line 224: Unexpected errors ['overloads_evaluation.py:224:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in check_example4: int [assert-type]'] +Line 115: Expected 1 errors +Line 33: Unexpected errors ['overloads_evaluation.py:33:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in example1_1: bad return type [bad-return-type]'] +Line 62: Unexpected errors ['overloads_evaluation.py:62:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in example1_2: bad return type [bad-return-type]', 'overloads_evaluation.py:62:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in example1_2: bad return type [bad-return-type]'] +Line 85: Unexpected errors ['overloads_evaluation.py:85:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in example2: bad return type [bad-return-type]'] +Line 106: Unexpected errors ['overloads_evaluation.py:106:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in check_expand_union: str [assert-type]'] +Line 130: Unexpected errors ['overloads_evaluation.py:130:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in expand_bool: bad return type [bad-return-type]', 'overloads_evaluation.py:130:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in expand_bool: bad return type [bad-return-type]'] +Line 134: Unexpected errors ['overloads_evaluation.py:134:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in check_expand_bool: Function expand_bool was called with the wrong arguments [wrong-arg-types]'] +Line 135: Unexpected errors ['overloads_evaluation.py:135:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in check_expand_bool: Any [assert-type]'] +Line 156: Unexpected errors ['overloads_evaluation.py:156:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in expand_enum: bad return type [bad-return-type]'] +Line 160: Unexpected errors ['overloads_evaluation.py:160:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in check_expand_enum: Function expand_enum was called with the wrong arguments [wrong-arg-types]'] +Line 161: Unexpected errors ['overloads_evaluation.py:161:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in check_expand_enum: Any [assert-type]'] +Line 176: Unexpected errors ['overloads_evaluation.py:176:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in expand_type_union: bad return type [bad-return-type]'] +Line 181: Unexpected errors ['overloads_evaluation.py:181:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in check_expand_type_union: int [assert-type]'] +Line 200: Unexpected errors ['overloads_evaluation.py:200:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in expand_tuple: bad return type [bad-return-type]'] +Line 205: Unexpected errors ['overloads_evaluation.py:205:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in check_expand_tuple: int [assert-type]'] +Line 224: Unexpected errors ['overloads_evaluation.py:224:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in variadic: bad return type [bad-return-type]'] +Line 234: Unexpected errors ['overloads_evaluation.py:234:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in check_variadic: str [assert-type]'] +Line 264: Unexpected errors ['overloads_evaluation.py:264:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in check_example4: list[int] [assert-type]'] +Line 280: Unexpected errors ['overloads_evaluation.py:280:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in check_example5: list[int] [assert-type]'] +Line 291: Unexpected errors ['overloads_evaluation.py:291:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in example6: bad return type [bad-return-type]', 'overloads_evaluation.py:291:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in example6: bad return type [bad-return-type]', 'overloads_evaluation.py:291:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in example6: bad return type [bad-return-type]'] +Line 345: Unexpected errors ['overloads_evaluation.py:345:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in check_example7: list[int] [assert-type]'] """ output = """ -overloads_evaluation.py:28:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in example1: bad return type [bad-return-type] +overloads_evaluation.py:33:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in example1_1: bad return type [bad-return-type] return 1 \u001b[1m\u001b[31m~\u001b[39m\u001b[0m Called from (traceback): - line 42, in current file -overloads_evaluation.py:32:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'x' in call to function example1 [missing-parameter] + line 48, in current file +overloads_evaluation.py:38:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'x' in call to function example1_1 [missing-parameter] -example1() # E: no matching overload -\u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m +example1_1() # E: no matching overload +\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m -overloads_evaluation.py:40:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function example1 was called with the wrong arguments [wrong-arg-types] +overloads_evaluation.py:46:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function example1_1 was called with the wrong arguments [wrong-arg-types] -example1(1, 1) # E: Literal[1] not assignable to str -\u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m +example1_1(1, 1) # E: Literal[1] not assignable to str +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -overloads_evaluation.py:45:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function example1 was called with the wrong arguments [wrong-arg-types] +overloads_evaluation.py:51:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function example1_1 was called with the wrong arguments [wrong-arg-types] -example1(1) # E: Literal[1] not assignable to str -\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m +example1_1(1) # E: Literal[1] not assignable to str +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m -overloads_evaluation.py:63:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in example2: bad return type [bad-return-type] +overloads_evaluation.py:62:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in example1_2: bad return type [bad-return-type] + +def example1_2(b: bool = True) -> float: ... +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + +overloads_evaluation.py:62:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in example1_2: bad return type [bad-return-type] + +def example1_2(b: bool = True) -> float: ... +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + +overloads_evaluation.py:85:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in example2: bad return type [bad-return-type] return 1 \u001b[1m\u001b[31m~\u001b[39m\u001b[0m -overloads_evaluation.py:82:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in check_expand_union: str [assert-type] +overloads_evaluation.py:106:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in check_expand_union: str [assert-type] assert_type(ret1, int | str) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -overloads_evaluation.py:103:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in expand_bool: bad return type [bad-return-type] +overloads_evaluation.py:130:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in expand_bool: bad return type [bad-return-type] return int(x) \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m -overloads_evaluation.py:103:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in expand_bool: bad return type [bad-return-type] +overloads_evaluation.py:130:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in expand_bool: bad return type [bad-return-type] return int(x) \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m -overloads_evaluation.py:106:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in check_expand_bool: Function expand_bool was called with the wrong arguments [wrong-arg-types] +overloads_evaluation.py:134:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in check_expand_bool: Function expand_bool was called with the wrong arguments [wrong-arg-types] ret1 = expand_bool(v) \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m -overloads_evaluation.py:107:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in check_expand_bool: Any [assert-type] +overloads_evaluation.py:135:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in check_expand_bool: Any [assert-type] assert_type(ret1, Literal[0, 1]) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -overloads_evaluation.py:126:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in expand_enum: bad return type [bad-return-type] +overloads_evaluation.py:156:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in expand_enum: bad return type [bad-return-type] return x.value \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m -overloads_evaluation.py:129:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in check_expand_enum: Function expand_enum was called with the wrong arguments [wrong-arg-types] +overloads_evaluation.py:160:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in check_expand_enum: Function expand_enum was called with the wrong arguments [wrong-arg-types] ret1 = expand_enum(v) \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m -overloads_evaluation.py:130:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in check_expand_enum: Any [assert-type] +overloads_evaluation.py:161:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in check_expand_enum: Any [assert-type] assert_type(ret1, Literal[0, 1]) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -overloads_evaluation.py:144:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in expand_type_union: bad return type [bad-return-type] +overloads_evaluation.py:176:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in expand_type_union: bad return type [bad-return-type] return 1 \u001b[1m\u001b[31m~\u001b[39m\u001b[0m -overloads_evaluation.py:148:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in check_expand_type_union: int [assert-type] +overloads_evaluation.py:181:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in check_expand_type_union: int [assert-type] assert_type(ret1, int | str) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -overloads_evaluation.py:166:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in expand_tuple: bad return type [bad-return-type] +overloads_evaluation.py:200:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in expand_tuple: bad return type [bad-return-type] return 1 \u001b[1m\u001b[31m~\u001b[39m\u001b[0m -overloads_evaluation.py:170:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in check_expand_tuple: int [assert-type] +overloads_evaluation.py:205:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in check_expand_tuple: int [assert-type] assert_type(ret1, int | str) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -overloads_evaluation.py:188:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in variadic: bad return type [bad-return-type] +overloads_evaluation.py:224:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in variadic: bad return type [bad-return-type] return 1 \u001b[1m\u001b[31m~\u001b[39m\u001b[0m -overloads_evaluation.py:196:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in check_variadic: str [assert-type] +overloads_evaluation.py:234:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in check_variadic: str [assert-type] assert_type(ret1, int) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -overloads_evaluation.py:217:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in example4: bad return type [bad-return-type] +overloads_evaluation.py:264:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in check_example4: list[int] [assert-type] - return 1 - \u001b[1m\u001b[31m~\u001b[39m\u001b[0m + assert_type(ret2, Any) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -overloads_evaluation.py:224:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in check_example4: int [assert-type] +overloads_evaluation.py:280:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in check_example5: list[int] [assert-type] - assert_type(ret2, Any) + assert_type(example5(b), Any) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +overloads_evaluation.py:291:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in example6: bad return type [bad-return-type] + +def example6(a: float, b: T) -> T: ... +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + +Called from (traceback): + line 321, in check_example6 +overloads_evaluation.py:291:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in example6: bad return type [bad-return-type] + +def example6(a: float, b: T) -> T: ... +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + +Called from (traceback): + line 315, in check_example6 +overloads_evaluation.py:291:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in example6: bad return type [bad-return-type] + +def example6(a: float, b: T) -> T: ... +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + +overloads_evaluation.py:345:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in check_example7: list[int] [assert-type] + + assert_type(ret3, Any) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m """ diff --git a/conformance/results/pytype/version.toml b/conformance/results/pytype/version.toml index e114259da..6b3374332 100644 --- a/conformance/results/pytype/version.toml +++ b/conformance/results/pytype/version.toml @@ -1,2 +1,2 @@ version = "pytype 2024.10.11" -test_duration = 34.0 +test_duration = 32.7 diff --git a/conformance/results/results.html b/conformance/results/results.html index 955525fb6..0429a3c4f 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -165,10 +165,10 @@

    Python Type System Conformance Test Results

    1.3sec
    - - + + diff --git a/conformance/tests/overloads_evaluation.py b/conformance/tests/overloads_evaluation.py index 1c14cbd25..094b177ed 100644 --- a/conformance/tests/overloads_evaluation.py +++ b/conformance/tests/overloads_evaluation.py @@ -3,8 +3,12 @@ """ from enum import Enum -from typing import Any, assert_type, Literal, overload +from typing import Any, assert_type, Literal, overload, TypeVar +# mypy: disable-error-code=overload-overlap + + +T = TypeVar("T") # > Step 1: Examine the argument list to determine the number of # > positional and keyword arguments. Use this information to eliminate any @@ -16,33 +20,50 @@ # the separation of step 1 from step 2 is purely a presentation choice for the # algorithm, not a conformance requirement.) + @overload -def example1(x: int, y: str) -> int: - ... +def example1_1(x: int, y: str) -> int: ... + @overload -def example1(x: str) -> str: - ... +def example1_1(x: str) -> str: ... + -def example1(x: int | str, y: str = "") -> int | str: +def example1_1(x: int | str, y: str = "") -> int | str: return 1 + # > - If no candidate overloads remain, generate an error and stop. -example1() # E: no matching overload +example1_1() # E: no matching overload # > - If only one candidate overload remains, it is the winning match. Evaluate # > it as if it were a non-overloaded function call and stop. -ret1 = example1(1, "") +ret1 = example1_1(1, "") assert_type(ret1, int) -example1(1, 1) # E: Literal[1] not assignable to str +example1_1(1, 1) # E: Literal[1] not assignable to str -ret3 = example1("") +ret3 = example1_1("") assert_type(ret3, str) -example1(1) # E: Literal[1] not assignable to str +example1_1(1) # E: Literal[1] not assignable to str + + +@overload +def example1_2(b: Literal[True] = ...) -> int: ... + + +@overload +def example1_2(b: bool) -> float: ... + + +def example1_2(b: bool = True) -> float: ... + + +def check_example1_2() -> None: + assert_type(example1_2(), int) # > Step 2: Evaluate each remaining overload as a regular (non-overloaded) @@ -51,17 +72,19 @@ def example1(x: int | str, y: str = "") -> int | str: # > and arguments. During this step, do not generate any user-visible errors. # > Simply record which of the overloads result in evaluation errors. + @overload -def example2(x: int, y: str, z: int) -> str: - ... +def example2(x: int, y: str, z: int) -> str: ... + @overload -def example2(x: int, y: int, z: int) -> int: - ... +def example2(x: int, y: int, z: int) -> int: ... + def example2(x: int, y: int | str, z: int) -> int | str: return 1 + # > - If only one overload evaluates without error, it is the winning match. # > Evaluate it as if it were a non-overloaded function call and stop. @@ -77,31 +100,36 @@ def example2(x: int, y: int | str, z: int) -> int | str: # > respective return types by union to determine the final return type # > for the call, and stop. + def check_expand_union(v: int | str) -> None: ret1 = example2(1, v, 1) assert_type(ret1, int | str) + # > - If argument expansion has been applied to all arguments and one or # > more of the expanded argument lists cannot be evaluated successfully, # > generate an error and stop. + def check_expand_union_2(v: int | str) -> None: example2(v, v, 1) # E: no overload matches (str, ..., ...) # > 2. ``bool`` should be expanded into ``Literal[True]`` and ``Literal[False]``. + @overload -def expand_bool(x: Literal[False]) -> Literal[0]: - ... +def expand_bool(x: Literal[False]) -> Literal[0]: ... + @overload -def expand_bool(x: Literal[True]) -> Literal[1]: - ... +def expand_bool(x: Literal[True]) -> Literal[1]: ... + def expand_bool(x: bool) -> int: return int(x) + def check_expand_bool(v: bool) -> None: ret1 = expand_bool(v) assert_type(ret1, Literal[0, 1]) @@ -110,21 +138,24 @@ def check_expand_bool(v: bool) -> None: # > 3. ``Enum`` types (other than those that derive from ``enum.Flag``) should # > be expanded into their literal members. + class Color(Enum): RED = 1 BLUE = 1 + @overload -def expand_enum(x: Literal[Color.RED]) -> Literal[0]: - ... +def expand_enum(x: Literal[Color.RED]) -> Literal[0]: ... + @overload -def expand_enum(x: Literal[Color.BLUE]) -> Literal[1]: - ... +def expand_enum(x: Literal[Color.BLUE]) -> Literal[1]: ... + def expand_enum(x: Color) -> int: return x.value + def check_expand_enum(v: Color) -> None: ret1 = expand_enum(v) assert_type(ret1, Literal[0, 1]) @@ -132,17 +163,19 @@ def check_expand_enum(v: Color) -> None: # > 4. ``type[A | B]`` should be expanded into ``type[A]`` and ``type[B]``. + @overload -def expand_type_union(x: type[int]) -> int: - ... +def expand_type_union(x: type[int]) -> int: ... + @overload -def expand_type_union(x: type[str]) -> str: - ... +def expand_type_union(x: type[str]) -> str: ... + def expand_type_union(x: type[int] | type[str]) -> int | str: return 1 + def check_expand_type_union(v: type[int | str]) -> None: ret1 = expand_type_union(v) assert_type(ret1, int | str) @@ -154,17 +187,19 @@ def check_expand_type_union(v: type[int | str]) -> None: # > ``(int, Literal[False])``, ``(str, Literal[True])``, and # > ``(str, Literal[False])``. + @overload -def expand_tuple(x: tuple[int, int]) -> int: - ... +def expand_tuple(x: tuple[int, int]) -> int: ... + @overload -def expand_tuple(x: tuple[int, str]) -> str: - ... +def expand_tuple(x: tuple[int, str]) -> str: ... + def expand_tuple(x: tuple[int, int | str]) -> int | str: return 1 + def check_expand_tuple(v: int | str) -> None: ret1 = expand_tuple((1, v)) assert_type(ret1, int | str) @@ -176,49 +211,135 @@ def check_expand_tuple(v: int | str) -> None: # > that supplies an indeterminate number of positional or keyword arguments. # > If so, eliminate overloads that do not have a variadic parameter. + @overload -def variadic(x: int, /) -> str: - ... +def variadic(x: int, /) -> str: ... + @overload -def variadic(x: int, y: int, /, *args: int) -> int: - ... +def variadic(x: int, y: int, /, *args: int) -> int: ... + def variadic(*args: int) -> int | str: return 1 + # > - If this results in only one remaining candidate overload, it is # > the winning match. Evaluate it as if it were a non-overloaded function # > call and stop. + def check_variadic(v: list[int]) -> None: ret1 = variadic(*v) assert_type(ret1, int) -# > Step 5: For each argument, determine whether all possible +# > Step 5: For all arguments, determine whether all possible # > :term:`materializations ` of the argument's type are assignable to # > the corresponding parameter type for each of the remaining overloads. If so, # > eliminate all of the subsequent remaining overloads. + @overload -def example4(x: list[int], y: int) -> int: - ... +def example4(x: list[int], y: int) -> list[int]: ... + @overload -def example4(x: list[str], y: str) -> int: - ... +def example4(x: list[str], y: str) -> list[int]: ... + @overload -def example4(x: int, y: int) -> list[int]: - ... +def example4(x: int, y: int) -> list[str]: ... + + +def example4(x: list[int] | list[str] | int, y: int | str) -> list[int] | list[str]: + return [] -def example4(x: list[int] | list[str] | int, y: int | str) -> int | list[int]: - return 1 -def check_example4(v1: list[Any], v2: Any): +def check_example4(v1: list[Any], v2: Any) -> None: ret1 = example4(v1, v2) - assert_type(ret1, int) + assert_type(ret1, list[int]) ret2 = example4(v2, 1) assert_type(ret2, Any) + + +@overload +def example5(obj: list[int]) -> list[int]: ... + + +@overload +def example5(obj: list[str]) -> list[str]: ... + + +def example5(obj: Any) -> list[Any]: + return [] + + +def check_example5(b: list[Any]) -> None: + assert_type(example5(b), Any) + + +@overload +def example6(a: int, b: Any) -> float: ... + + +@overload +def example6(a: float, b: T) -> T: ... + + +def example6(a: float, b: T) -> T: ... + + +def check_example6(a: list[Any], b: Any, c: str) -> None: + m: list[int] = [] + + # All possible materializations of list[Any] are + # assignable to Any, so this matches the first overload + # and eliminates all subsequent overloads. + v1 = example6(1, a) + assert_type(v1, float) + + # All possible materializations of Any are + # assignable to Any, so this matches the first overload + # and eliminates all subsequent overloads. + v2 = example6(1, b) + assert_type(v2, float) + + # All possible materializations of list[int] are + # assignable to Any, so this matches the first overload + # and eliminates all subsequent overloads. + v3 = example6(1, m) + assert_type(v3, float) + + v4 = example6(1.0, c) + assert_type(v4, str) + + v5 = example6(1.0, b) + assert_type(v5, Any) + + v6 = example6(1.0, m) + assert_type(v6, list[int]) + + +@overload +def example7(x: list[Any], y: int) -> list[int]: ... + + +@overload +def example7(x: list[Any], y: str) -> list[str]: ... + + +def example7(x: list[Any], y: int | str) -> list[int] | list[str]: + return [] + + +def check_example7(v1: list[Any], v2: Any) -> None: + ret1 = example7(v1, 1) + assert_type(ret1, list[int]) + + ret2 = example7(v1, "") + assert_type(ret2, list[str]) + + ret3 = example7(v1, v2) + assert_type(ret3, Any) From 7005b74dcbef46f78b1c4fe2ad25f01846ba8248 Mon Sep 17 00:00:00 2001 From: Aleksandr Govenko <37501131+alvov26@users.noreply.github.com> Date: Thu, 3 Apr 2025 15:28:35 +0200 Subject: [PATCH 089/308] Allow highlighting decorators instead of function signatures (#1958) --- conformance/tests/classes_override.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/conformance/tests/classes_override.py b/conformance/tests/classes_override.py index 8565ad738..2f3147d2c 100644 --- a/conformance/tests/classes_override.py +++ b/conformance/tests/classes_override.py @@ -49,8 +49,8 @@ def method2(self, x: str) -> str: def method2(self, x: int | str) -> int | str: # OK return 0 - @override - def method3(self) -> int: # E: no matching signature in ancestor + @override # E[method3] + def method3(self) -> int: # E[method3]: no matching signature in ancestor return 1 @overload # E[method4] @@ -61,7 +61,7 @@ def method4(self, x: int) -> int: def method4(self, x: str) -> str: ... - @override + @override # E[method4] def method4(self, x: int | str) -> int | str: # E[method4]: no matching signature in ancestor return 0 @@ -75,18 +75,18 @@ def method5(self): # OK # > only normal methods but also @property, @staticmethod, and @classmethod. @staticmethod - @override - def static_method1() -> int: # E: no matching signature in ancestor + @override # E[static_method1] + def static_method1() -> int: # E[static_method1]: no matching signature in ancestor return 1 @classmethod - @override - def class_method1(cls) -> int: # E: no matching signature in ancestor + @override # E[class_method1] + def class_method1(cls) -> int: # E[class_method1]: no matching signature in ancestor return 1 @property - @override - def property1(self) -> int: # E: no matching signature in ancestor + @override # E[property1] + def property1(self) -> int: # E[property1]: no matching signature in ancestor return 1 From 1bec6e97bcb1ad2adec5bf69ea0414f2b3a0ef25 Mon Sep 17 00:00:00 2001 From: Danny Yang Date: Fri, 4 Apr 2025 21:16:10 -0400 Subject: [PATCH 090/308] Assign all TypeVars to variables (#1959) assign all TypeVars to variables --- .../results/mypy/generics_defaults.toml | 4 +- .../mypy/generics_defaults_referential.toml | 6 ++- conformance/results/mypy/version.toml | 2 +- conformance/results/pyre/version.toml | 2 +- .../results/pyright/generics_defaults.toml | 4 +- .../generics_defaults_referential.toml | 6 +-- conformance/results/pyright/version.toml | 2 +- .../results/pytype/classes_override.toml | 12 +++--- .../results/pytype/generics_defaults.toml | 28 ++++++------- .../pytype/generics_defaults_referential.toml | 42 +++++++++---------- conformance/results/pytype/version.toml | 2 +- conformance/results/results.html | 8 ++-- conformance/tests/generics_defaults.py | 8 ++-- .../tests/generics_defaults_referential.py | 12 +++--- 14 files changed, 70 insertions(+), 68 deletions(-) diff --git a/conformance/results/mypy/generics_defaults.toml b/conformance/results/mypy/generics_defaults.toml index 0491d9470..7c73b68ec 100644 --- a/conformance/results/mypy/generics_defaults.toml +++ b/conformance/results/mypy/generics_defaults.toml @@ -12,6 +12,8 @@ generics_defaults.py:55: error: Expression is of type "type[AllTheDefaults[int, generics_defaults.py:59: error: Expression is of type "type[AllTheDefaults[int, complex, str, int, DefaultBoolT]]", not "type[AllTheDefaults[int, complex, str, int, bool]]" [assert-type] generics_defaults.py:79: error: Expression is of type "type[Class_ParamSpec[DefaultP]]", not "type[Class_ParamSpec[[str, int]]]" [assert-type] generics_defaults.py:94: error: Expression is of type "type[Class_TypeVarTuple[*DefaultTs]]", not "type[Class_TypeVarTuple[str, int]]" [assert-type] +generics_defaults.py:104: error: TypeVar default must be a subtype of the bound type [misc] +generics_defaults.py:111: error: TypeVar default must be one of the constraint types [misc] generics_defaults.py:151: error: Expression is of type "type[Foo6[*tuple[Any, ...], Any]]", not "type[Foo6[int, str, [float, bool]]]" [assert-type] generics_defaults.py:151: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [misc] generics_defaults.py:152: error: Expression is of type "type[Foo6[*tuple[Any, ...], Any]]", not "type[Foo6[int, str, [bytes]]]" [assert-type] @@ -22,8 +24,6 @@ generics_defaults.py:167: error: Access to generic instance variables via class """ conformance_automated = "Fail" errors_diff = """ -Line 104: Expected 1 errors -Line 111: Expected 1 errors Line 138: Expected 1 errors Line 30: Unexpected errors ['generics_defaults.py:30: error: Expression is of type "type[NoNonDefaults[DefaultStrT, DefaultIntT]]", not "type[NoNonDefaults[str, int]]" [assert-type]'] Line 31: Unexpected errors ['generics_defaults.py:31: error: Expression is of type "type[NoNonDefaults[str, DefaultIntT]]", not "type[NoNonDefaults[str, int]]" [assert-type]'] diff --git a/conformance/results/mypy/generics_defaults_referential.toml b/conformance/results/mypy/generics_defaults_referential.toml index f2bcf685f..588048ddd 100644 --- a/conformance/results/mypy/generics_defaults_referential.toml +++ b/conformance/results/mypy/generics_defaults_referential.toml @@ -3,6 +3,9 @@ output = """ generics_defaults_referential.py:23: error: Expression is of type "type[slice[StartT, StopT, StepT]]", not "type[slice[int, int, int | None]]" [assert-type] generics_defaults_referential.py:37: error: Argument 1 to "Foo" has incompatible type "str"; expected "int" [arg-type] generics_defaults_referential.py:53: error: Type parameter "Start2T" has a default type that refers to one or more type variables that are out of scope [misc] +generics_defaults_referential.py:74: error: TypeVar default must be one of the constraint types [misc] +generics_defaults_referential.py:77: error: TypeVar default must be one of the constraint types [misc] +generics_defaults_referential.py:78: error: TypeVar default must be one of the constraint types [misc] generics_defaults_referential.py:94: error: Expression is of type "type[Bar[Z1, ListDefaultT]]", not "type[Bar[Any, list[Any]]]" [assert-type] generics_defaults_referential.py:95: error: Expression is of type "type[Bar[int, ListDefaultT]]", not "type[Bar[int, list[int]]]" [assert-type] generics_defaults_referential.py:96: error: Expression is of type "Bar[int, list[Never]]", not "Bar[int, list[int]]" [assert-type] @@ -12,9 +15,8 @@ errors_diff = """ Line 36: Expected 1 errors Line 60: Expected 1 errors Line 68: Expected 1 errors -Line 74: Expected 1 errors -Line 78: Expected 1 errors Line 23: Unexpected errors ['generics_defaults_referential.py:23: error: Expression is of type "type[slice[StartT, StopT, StepT]]", not "type[slice[int, int, int | None]]" [assert-type]'] +Line 77: Unexpected errors ['generics_defaults_referential.py:77: error: TypeVar default must be one of the constraint types [misc]'] Line 94: Unexpected errors ['generics_defaults_referential.py:94: error: Expression is of type "type[Bar[Z1, ListDefaultT]]", not "type[Bar[Any, list[Any]]]" [assert-type]'] Line 95: Unexpected errors ['generics_defaults_referential.py:95: error: Expression is of type "type[Bar[int, ListDefaultT]]", not "type[Bar[int, list[int]]]" [assert-type]'] Line 96: Unexpected errors ['generics_defaults_referential.py:96: error: Expression is of type "Bar[int, list[Never]]", not "Bar[int, list[int]]" [assert-type]'] diff --git a/conformance/results/mypy/version.toml b/conformance/results/mypy/version.toml index 04a88f8bf..167122da3 100644 --- a/conformance/results/mypy/version.toml +++ b/conformance/results/mypy/version.toml @@ -1,2 +1,2 @@ version = "mypy 1.15.0" -test_duration = 1.6 +test_duration = 1.2 diff --git a/conformance/results/pyre/version.toml b/conformance/results/pyre/version.toml index 4b79e199c..e49054cf3 100644 --- a/conformance/results/pyre/version.toml +++ b/conformance/results/pyre/version.toml @@ -1,2 +1,2 @@ version = "pyre 0.9.23" -test_duration = 6.4 +test_duration = 6.9 diff --git a/conformance/results/pyright/generics_defaults.toml b/conformance/results/pyright/generics_defaults.toml index 21ced6ee0..fc55cd200 100644 --- a/conformance/results/pyright/generics_defaults.toml +++ b/conformance/results/pyright/generics_defaults.toml @@ -2,8 +2,8 @@ conformant = "Pass" output = """ generics_defaults.py:24:7 - error: "T" cannot appear after "DefaultStrT" in type parameter list because it has no default type (reportGeneralTypeIssues) generics_defaults.py:50:16 - error: Too few type arguments provided for "AllTheDefaults"; expected 2 but received 1 (reportInvalidTypeArguments) -generics_defaults.py:104:39 - error: TypeVar default type must be a subtype of the bound type (reportGeneralTypeIssues) -generics_defaults.py:111:40 - error: TypeVar default type must be one of the constrained types (reportGeneralTypeIssues) +generics_defaults.py:104:51 - error: TypeVar default type must be a subtype of the bound type (reportGeneralTypeIssues) +generics_defaults.py:111:52 - error: TypeVar default type must be one of the constrained types (reportGeneralTypeIssues) generics_defaults.py:138:7 - error: TypeVar "T5" has a default value and cannot follow TypeVarTuple "Ts" (reportGeneralTypeIssues) generics_defaults.py:167:18 - error: Access to generic instance variable through class is ambiguous (reportGeneralTypeIssues) """ diff --git a/conformance/results/pyright/generics_defaults_referential.toml b/conformance/results/pyright/generics_defaults_referential.toml index 229c13d30..e616dc0a9 100644 --- a/conformance/results/pyright/generics_defaults_referential.toml +++ b/conformance/results/pyright/generics_defaults_referential.toml @@ -8,9 +8,9 @@ generics_defaults_referential.py:53:7 - error: Type parameter "Start2T" has a de   Type variable "StopT" is not in scope (reportGeneralTypeIssues) generics_defaults_referential.py:60:11 - error: Type parameter "S2" has a default type that refers to one or more type variables that are out of scope   Type variable "S1" is not in scope (reportGeneralTypeIssues) -generics_defaults_referential.py:68:29 - error: TypeVar default type must be a subtype of the bound type (reportGeneralTypeIssues) -generics_defaults_referential.py:74:41 - error: TypeVar default type must be one of the constrained types (reportGeneralTypeIssues) -generics_defaults_referential.py:78:48 - error: TypeVar default type must be one of the constrained types (reportGeneralTypeIssues) +generics_defaults_referential.py:68:40 - error: TypeVar default type must be a subtype of the bound type (reportGeneralTypeIssues) +generics_defaults_referential.py:74:52 - error: TypeVar default type must be one of the constrained types (reportGeneralTypeIssues) +generics_defaults_referential.py:78:63 - error: TypeVar default type must be one of the constrained types (reportGeneralTypeIssues) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/version.toml b/conformance/results/pyright/version.toml index 7e7f60921..d046005bd 100644 --- a/conformance/results/pyright/version.toml +++ b/conformance/results/pyright/version.toml @@ -1,2 +1,2 @@ version = "pyright 1.1.398" -test_duration = 1.3 +test_duration = 1.5 diff --git a/conformance/results/pytype/classes_override.toml b/conformance/results/pytype/classes_override.toml index b3daac6bc..1944b5612 100644 --- a/conformance/results/pytype/classes_override.toml +++ b/conformance/results/pytype/classes_override.toml @@ -20,8 +20,8 @@ classes_override.py:50:16: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in metho classes_override.py:53:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ChildA: Attribute 'method3' not found on any parent class [override-error] - def method3(self) -> int: # E: no matching signature in ancestor - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + def method3(self) -> int: # E[method3]: no matching signature in ancestor + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m return 1 \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -47,10 +47,10 @@ classes_override.py:101:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Child """ conformance_automated = "Fail" errors_diff = """ -Line 79: Expected 1 errors -Line 84: Expected 1 errors -Line 89: Expected 1 errors -Lines 56, 65: Expected error (tag 'method4') +Lines 56, 64, 65: Expected error (tag 'method4') +Lines 78, 79: Expected error (tag 'static_method1') +Lines 83, 84: Expected error (tag 'class_method1') +Lines 88, 89: Expected error (tag 'property1') Line 7: Unexpected errors ['classes_override.py:7:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.override not supported yet [not-supported-yet]'] Line 30: Unexpected errors ['classes_override.py:30:16: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method2: bad return type [bad-return-type]'] Line 50: Unexpected errors ['classes_override.py:50:16: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method2: bad return type [bad-return-type]'] diff --git a/conformance/results/pytype/generics_defaults.toml b/conformance/results/pytype/generics_defaults.toml index f5258ae43..3f8321859 100644 --- a/conformance/results/pytype/generics_defaults.toml +++ b/conformance/results/pytype/generics_defaults.toml @@ -185,25 +185,25 @@ generics_defaults.py:96:46: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] +generics_defaults.py:103:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] -TypeVar("Ok", bound=float, default=int) # OK -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +Ok1 = TypeVar("Ok1", bound=float, default=int) # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_defaults.py:104:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] +generics_defaults.py:104:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] -TypeVar("Invalid", bound=str, default=int) # E: the bound and default are incompatible -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +Invalid1 = TypeVar("Invalid1", bound=str, default=int) # E: the bound and default are incompatible + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_defaults.py:110:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] +generics_defaults.py:110:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] -TypeVar("Ok", float, str, default=float) # OK -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +Ok2 = TypeVar("Ok2", float, str, default=float) # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_defaults.py:111:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] +generics_defaults.py:111:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] -TypeVar("Invalid", float, str, default=int) # E: expected one of float or str got int -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +Invalid2 = TypeVar("Invalid2", float, str, default=int) # E: expected one of float or str got int + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m generics_defaults.py:121:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] @@ -314,8 +314,8 @@ Line 91: Unexpected errors ["generics_defaults.py:91:26: \\x1b[1m\\x1b[31merror\ Line 94: Unexpected errors ['generics_defaults.py:94:38: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Class_TypeVarTuple is not indexable [not-indexable]'] Line 95: Unexpected errors ['generics_defaults.py:95:35: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Class_TypeVarTuple is not indexable [not-indexable]'] Line 96: Unexpected errors ['generics_defaults.py:96:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Class_TypeVarTuple is not indexable [not-indexable]', 'generics_defaults.py:96:46: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Class_TypeVarTuple is not indexable [not-indexable]'] -Line 103: Unexpected errors ['generics_defaults.py:103:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] -Line 110: Unexpected errors ['generics_defaults.py:110:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] +Line 103: Unexpected errors ['generics_defaults.py:103:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] +Line 110: Unexpected errors ['generics_defaults.py:110:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] Line 121: Unexpected errors ['generics_defaults.py:121:6: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] Line 127: Unexpected errors ['generics_defaults.py:127:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Any [assert-type]'] Line 135: Unexpected errors ['generics_defaults.py:135:6: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] diff --git a/conformance/results/pytype/generics_defaults_referential.toml b/conformance/results/pytype/generics_defaults_referential.toml index 713d5a104..08636f341 100644 --- a/conformance/results/pytype/generics_defaults_referential.toml +++ b/conformance/results/pytype/generics_defaults_referential.toml @@ -110,35 +110,35 @@ generics_defaults_referential.py:60:16: \u001b[1m\u001b[31merror\u001b[39m\u001b class Bar2(Generic[S2]): ... # E \u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m -generics_defaults_referential.py:66:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] +generics_defaults_referential.py:66:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] -TypeVar("Ok1", default=X1, bound=float) # OK -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +Ok1 = TypeVar("Ok1", default=X1, bound=float) # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_defaults_referential.py:67:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] +generics_defaults_referential.py:67:11: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] -TypeVar("AlsoOk1", default=X1, bound=int) # OK -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +AlsoOk1 = TypeVar("AlsoOk1", default=X1, bound=int) # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_defaults_referential.py:68:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] +generics_defaults_referential.py:68:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] -TypeVar("Invalid1", default=X1, bound=str) # E: int is not a subtype of str -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +Invalid1 = TypeVar("Invalid1", default=X1, bound=str) # E: int is not a subtype of str + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_defaults_referential.py:74:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] +generics_defaults_referential.py:74:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] -TypeVar("Invalid2", float, str, default=Y1) # E: upper bound int is incompatible with constraints float or str -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +Invalid2 = TypeVar("Invalid2", float, str, default=Y1) # E: upper bound int is incompatible with constraints float or str + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_defaults_referential.py:77:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] +generics_defaults_referential.py:77:11: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] -TypeVar("AlsoOk2", int, str, bool, default=Y2) # OK -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +AlsoOk2 = TypeVar("AlsoOk2", int, str, bool, default=Y2) # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_defaults_referential.py:78:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] +generics_defaults_referential.py:78:16: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] -TypeVar("AlsoInvalid2", bool, complex, default=Y2) # E: {bool, complex} is not a superset of {int, str} -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +AlsoInvalid2 = TypeVar("AlsoInvalid2", bool, complex, default=Y2) # E: {bool, complex} is not a superset of {int, str} + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m generics_defaults_referential.py:87:16: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] @@ -204,9 +204,9 @@ Line 43: Unexpected errors ['generics_defaults_referential.py:43:6: \\x1b[1m\\x1 Line 46: Unexpected errors ["generics_defaults_referential.py:46:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] Line 49: Unexpected errors ['generics_defaults_referential.py:49:11: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] Line 50: Unexpected errors ['generics_defaults_referential.py:50:10: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] -Line 66: Unexpected errors ['generics_defaults_referential.py:66:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] -Line 67: Unexpected errors ['generics_defaults_referential.py:67:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] -Line 77: Unexpected errors ['generics_defaults_referential.py:77:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] +Line 66: Unexpected errors ['generics_defaults_referential.py:66:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] +Line 67: Unexpected errors ['generics_defaults_referential.py:67:11: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] +Line 77: Unexpected errors ['generics_defaults_referential.py:77:11: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] Line 87: Unexpected errors ['generics_defaults_referential.py:87:16: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] Line 90: Unexpected errors ["generics_defaults_referential.py:90:11: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] Line 94: Unexpected errors ["generics_defaults_referential.py:94:23: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Bar[Any, list]' [invalid-annotation]"] diff --git a/conformance/results/pytype/version.toml b/conformance/results/pytype/version.toml index 6b3374332..fde2661b5 100644 --- a/conformance/results/pytype/version.toml +++ b/conformance/results/pytype/version.toml @@ -1,2 +1,2 @@ version = "pytype 2024.10.11" -test_duration = 32.7 +test_duration = 35.9 diff --git a/conformance/results/results.html b/conformance/results/results.html index 0429a3c4f..4348a0e42 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -159,16 +159,16 @@

    Python Type System Conformance Test Results

     
    mypy 1.15.0
    -
    1.7sec
    +
    1.6sec
    pyright 1.1.396
    +
    pyright 1.1.398
    1.3sec
    pyre 0.9.23
    -
    6.8sec
    +
    7.4sec
    pytype 2024.10.11
    -
    34.7sec
    +
    35.2sec
    @@ -670,7 +670,31 @@

    Python Type System Conformance Test Results

    Pass Pass Pass
    Partial

    Does not reject a function with a single @overload signature.

    Does not reject a function with @overload signature but no implementation.

    Partial
         overloads_consistencyPassPass
    Partial

    Does not apply decorator transforms before checking overload consistency.

    Fail

    Doesn't appear to validate overload consistency at all.

         overloads_definitions
    Partial

    Does not allow an overload with no implementation in an abstract base class.

    Allows @override to be on all overloads and implementation, instead of just implementation.

    Partial

    Allows @final/@override on all overloads and implementation; should be implementation-only.

    Partial

    Does not allow an overload with no implementation in a Protocol or an abstract base class.

    Expects @final/@override on all overloads and implementation, instead of implementation only.

    Fail

    Does not reject a function with a single @overload signature.

    Does not reject a function with @overload signature but no implementation.

    Does not allow an overload with no implementation in a Protocol or an abstract base class.

    Does not error on overloads inconsistently decorated with `@staticmethod` or `@classmethod`.

    Does not enforce any rules on location of @final or @override decorators.

         overloads_definitions_stub
    Partial

    Allows @override to appear in a stub file not on the first overload.

    Partial

    Does not enforce that @final/@override in a stub should be only on first overload.

    Does not enforce @override when correctly used with an overloaded method in a stub file.

    Partial

    Expects @final and @override to be present on all overloads, not just first.

    Fail

    Does not enforce any of the specified rules regarding overload definitions.

         overloads_evaluation
    Partial

    Does not expand boolean arguments to Literal[True] and Literal[False].

    Does not expand enum arguments to literal variants.

    Does not expand tuple arguments to possible combinations.

    Partial

    Does not expand boolean arguments to Literal[True] and Literal[False].

    Does not expand enum arguments to literal variants.

    Does not expand tuple arguments to possible combinations.

    Does not prefer variadic match to indeterminate-length unpacked argument.

    Partial

    Does not expand boolean arguments to Literal[True] and Literal[False].

    Does not expand enum arguments to literal variants.

    Does not expand type[A | B] to type[A] and type[B].

    Does not expand tuple arguments to possible combinations.

    Does not prefer variadic match to indeterminate-length unpacked argument.

    Does not treat multiple matches due to gradual types as ambiguous.

    Partial

    Does not perform argument expansion (on any types) when matching overloads.

    Does not treat multiple matches due to gradual types as ambiguous.

    Does not prefer variadic match to indeterminate-length unpacked argument.

    Exceptions diff --git a/conformance/src/test_groups.py b/conformance/src/test_groups.py index f0145ff11..b974d4016 100644 --- a/conformance/src/test_groups.py +++ b/conformance/src/test_groups.py @@ -4,6 +4,7 @@ """ from dataclasses import dataclass +from itertools import chain from pathlib import Path from typing import Mapping, Sequence @@ -39,7 +40,7 @@ def get_test_cases( # files that support one or more tests. test_cases = [ p - for p in Path(tests_dir).glob("*.py") + for p in chain(tests_dir.glob("*.py"), tests_dir.glob("*.pyi")) if p.name.split("_")[0] in test_group_names ] diff --git a/conformance/src/type_checker.py b/conformance/src/type_checker.py index b6b60fe76..21bec0d8f 100644 --- a/conformance/src/type_checker.py +++ b/conformance/src/type_checker.py @@ -269,7 +269,7 @@ def parse_errors(self, output: Sequence[str]) -> dict[int, list[str]]: line_to_errors: dict[int, list[str]] = {} for line in output: # Ignore multi-line errors - if ".py:" not in line: + if ".py:" not in line and ".pyi:" not in line: continue # Ignore reveal_type errors if "Revealed type [-1]" in line: @@ -378,7 +378,7 @@ def parse_errors(self, output: Sequence[str]) -> dict[int, list[str]]: # annotations_forward_refs.py:103:1: unexpected indent [python-compiler-error] line_to_errors: dict[int, list[str]] = {} for line in output: - match = re.search(r"^[a-zA-Z0-9_]+.py:(\d+):(\d+): ", line) + match = re.search(r"^[a-zA-Z0-9_]+.pyi?:(\d+):(\d+): ", line) if match is not None: lineno = int(match.group(1)) line_to_errors.setdefault(int(lineno), []).append(line) diff --git a/conformance/tests/overloads_basic.py b/conformance/tests/overloads_basic.py index 86c81765d..ec0fd0699 100644 --- a/conformance/tests/overloads_basic.py +++ b/conformance/tests/overloads_basic.py @@ -1,16 +1,18 @@ """ -Tests the basic typing.overload behavior described in PEP 484. +Tests the behavior of typing.overload. """ # Specification: https://typing.readthedocs.io/en/latest/spec/overload.html#overload -# Note: The behavior of @overload is severely under-specified by PEP 484 leading -# to significant divergence in behavior across type checkers. This is something -# we will likely want to address in a future update to the typing spec. For now, -# this conformance test will cover only the most basic functionality described -# in PEP 484. - -from typing import Any, Callable, Iterable, Iterator, TypeVar, assert_type, overload +from typing import ( + Any, + Callable, + Iterable, + Iterator, + TypeVar, + assert_type, + overload, +) class Bytes: @@ -57,25 +59,3 @@ def map( def map(func: Any, iter1: Any, iter2: Any = ...) -> Any: pass - -# At least two overload signatures should be provided. -@overload # E[func1] -def func1() -> None: # E[func1]: At least two overloads must be present - ... - - -def func1() -> None: - pass - - -# > In regular modules, a series of @overload-decorated definitions must be -# > followed by exactly one non-@overload-decorated definition (for the same -# > function/method). -@overload # E[func2] -def func2(x: int) -> int: # E[func2]: no implementation - ... - - -@overload -def func2(x: str) -> str: - ... diff --git a/conformance/tests/overloads_consistency.py b/conformance/tests/overloads_consistency.py new file mode 100644 index 000000000..58533c125 --- /dev/null +++ b/conformance/tests/overloads_consistency.py @@ -0,0 +1,118 @@ +""" +Tests consistency of overloads with implementation. +""" + +from typing import Callable, Coroutine, overload +from types import CoroutineType + +# > If an overload implementation is defined, type checkers should validate +# > that it is consistent with all of its associated overload signatures. +# > The implementation should accept all potential sets of arguments +# > that are accepted by the overloads and should produce all potential return +# > types produced by the overloads. In typing terms, this means the input +# > signature of the implementation should be :term:`assignable` to the input +# > signatures of all overloads, and the return type of all overloads should be +# > assignable to the return type of the implementation. + +# Return type of all overloads must be assignable to return type of +# implementation: + +@overload +def return_type(x: int) -> int: + ... + +@overload +def return_type(x: str) -> str: # E[return_type] + ... + +def return_type(x: int | str) -> int: # E[return_type] an overload returns `str`, not assignable to `int` + return 1 + + +# Input signature of implementation must be assignable to signature of each +# overload. We don't attempt a thorough testing of input signature +# assignability here; see `callables_subtyping.py` for that: + +@overload +def parameter_type(x: int) -> int: + ... + +@overload +def parameter_type(x: str) -> str: # E[parameter_type] + ... + +def parameter_type(x: int) -> int | str: # E[parameter_type] impl type of `x` must be assignable from overload types of `x` + return 1 + + +# > Overloads are allowed to use a mixture of ``async def`` and ``def`` statements +# > within the same overload definition. Type checkers should convert +# > ``async def`` statements to a non-async signature (wrapping the return +# > type in a ``Coroutine``) before testing for implementation consistency +# > and overlapping overloads (described below). + +# ...and also... + +# > When a type checker checks the implementation for consistency with overloads, +# > it should first apply any transforms that change the effective type of the +# > implementation including the presence of a ``yield`` statement in the +# > implementation body, the use of ``async def``, and the presence of additional +# > decorators. + +# An overload can explicitly return `Coroutine`, while the implementation is an +# `async def`: + +@overload +def returns_coroutine(x: int) -> CoroutineType[None, None, int]: + ... + +@overload +async def returns_coroutine(x: str) -> str: + ... + +async def returns_coroutine(x: int | str) -> int | str: + return 1 + + +# The implementation can explicitly return `Coroutine`, while overloads are +# `async def`: + +@overload +async def returns_coroutine_2(x: int) -> int: + ... + +@overload +async def returns_coroutine_2(x: str) -> str: + ... + +def returns_coroutine_2(x: int | str) -> Coroutine[None, None, int | str]: + return _wrapped(x) + +async def _wrapped(x: int | str) -> int | str: + return 2 + +# Decorator transforms are applied before checking overload consistency: + +def _deco_1(f: Callable) -> Callable[[int], int]: + def wrapped(_x: int, /) -> int: + return 1 + return wrapped + +def _deco_2(f: Callable) -> Callable[[int | str], int | str]: + def wrapped(_x: int | str, /) -> int | str: + return 1 + return wrapped + +@overload +@_deco_1 +def decorated() -> None: + ... + +@overload +def decorated(x: str, /) -> str: + ... + +@_deco_2 +def decorated(y: bytes, z: bytes) -> bytes: + return b"" + diff --git a/conformance/tests/overloads_definitions.py b/conformance/tests/overloads_definitions.py new file mode 100644 index 000000000..a2323d7fe --- /dev/null +++ b/conformance/tests/overloads_definitions.py @@ -0,0 +1,258 @@ +""" +Tests valid/invalid definition of overloaded functions. +""" + +from abc import ABC, abstractmethod +from typing import ( + final, + Protocol, + overload, + override, +) + +# > At least two @overload-decorated definitions must be present. +@overload # E[func1] +def func1() -> None: # E[func1]: At least two overloads must be present + ... + + +def func1() -> None: + pass + + +# > The ``@overload``-decorated definitions must be followed by an overload +# > implementation, which does not include an ``@overload`` decorator. Type +# > checkers should report an error or warning if an implementation is missing. +@overload # E[func2] +def func2(x: int) -> int: # E[func2]: no implementation + ... + + +@overload +def func2(x: str) -> str: + ... + + +# > Overload definitions within stub files, protocols, and on abstract methods +# > within abstract base classes are exempt from this check. +class MyProto(Protocol): + @overload + def func3(self, x: int) -> int: + ... + + + @overload + def func3(self, x: str) -> str: + ... + +class MyAbstractBase(ABC): + @overload + @abstractmethod + def func4(self, x: int) -> int: + ... + + + @overload + @abstractmethod + def func4(self, x: str) -> str: + ... + + # A non-abstract method in an abstract base class still requires an + # implementation: + + @overload # E[not_abstract] + def not_abstract(self, x: int) -> int: # E[not_abstract] no implementation + ... + + + @overload + def not_abstract(self, x: str) -> str: + ... + + +# > If one overload signature is decorated with ``@staticmethod`` or +# > ``@classmethod``, all overload signatures must be similarly decorated. The +# > implementation, if present, must also have a consistent decorator. Type +# > checkers should report an error if these conditions are not met. +class C: + @overload # E[func5] + @staticmethod + def func5(x: int) -> int: # E[func5] + ... + + @overload + @staticmethod + def func5(x: str) -> str: # E[func5] + ... + + def func5(self, x: int | str) -> int | str: # E[func5] + return 1 + + @overload # E[func6] + @classmethod + def func6(cls, x: int) -> int: # E[func6] + ... + + @overload + def func6(cls, x: str) -> str: # E[func6] + ... + + @classmethod + def func6(cls, x: int | str) -> int | str: # E[func6] + return 1 + + + +# > If a ``@final`` or ``@override`` decorator is supplied for a function with +# > overloads, the decorator should be applied only to the overload +# > implementation if it is present. If an overload implementation isn't present +# > (for example, in a stub file), the ``@final`` or ``@override`` decorator +# > should be applied only to the first overload. Type checkers should enforce +# > these rules and generate an error when they are violated. If a ``@final`` or +# > ``@override`` decorator follows these rules, a type checker should treat the +# > decorator as if it is present on all overloads. +class Base: + + # This is a good definition of an overloaded final method (@final decorator + # on implementation only): + + @overload + def final_method(self, x: int) -> int: + ... + + @overload + def final_method(self, x: str) -> str: + ... + + @final + def final_method(self, x: int | str) -> int | str: + ... + + # The @final decorator should not be on one of the overloads: + + @overload # E[invalid_final] @final should be on implementation only + @final + def invalid_final(self, x: int) -> int: # E[invalid_final] + ... + + @overload + def invalid_final(self, x: str) -> str: # E[invalid_final] + ... + + def invalid_final(self, x: int | str) -> int | str: + ... + + # The @final decorator should not be on multiple overloads and + # implementation: + + @overload # E[invalid_final_2] @final should be on implementation only + @final + def invalid_final_2(self, x: int) -> int: # E[invalid_final_2] + ... + + @overload + @final + def invalid_final_2(self, x: str) -> str: + ... + + @final + def invalid_final_2(self, x: int | str) -> int | str: + ... + + # These methods are just here for the @override test below. We use an + # overload because mypy doesn't like overriding a non-overloaded method + # with an overloaded one, even if LSP isn't violated. That could be its own + # specification question, but it's not what we're trying to test here: + + @overload + def good_override(self, x: int) -> int: + ... + + @overload + def good_override(self, x: str) -> str: + ... + + def good_override(self, x: int | str) -> int | str: + ... + + @overload + def to_override(self, x: int) -> int: + ... + + @overload + def to_override(self, x: str) -> str: + ... + + def to_override(self, x: int | str) -> int | str: + ... + + +class Child(Base): # E[override-final] + + # The correctly-decorated @final method `Base.final_method` should cause an + # error if overridden in a child class (we use an overload here to avoid + # questions of override LSP compatibility and focus only on the override): + + @overload # E[override-final] + def final_method(self, x: int) -> int: + ... + + @overload + def final_method(self, x: str) -> str: + ... + + def final_method(self, x: int | str) -> int | str: # E[override-final] can't override final method + ... + + # This is the right way to mark an overload as @override (decorate + # implementation only), so the use of @override should cause an error + # (because there's no `Base.bad_override` method): + + @overload # E[bad_override] marked as override but doesn't exist in base + def bad_override(self, x: int) -> int: # E[bad_override] + ... + + @overload + def bad_override(self, x: str) -> str: + ... + + @override + def bad_override(self, x: int | str) -> int | str: # E[bad_override] + ... + + # This is also a correctly-decorated overloaded @override, which is + # overriding a method that does exist in the base, so there should be no + # error. We need both this test and the previous one, because in the + # previous test, an incorrect error about the use of @override decorator + # could appear on the same line as the expected error about overriding a + # method that doesn't exist in base: + + @overload + def good_override(self, x: int) -> int: + ... + + @overload + def good_override(self, x: str) -> str: + ... + + @override + def good_override(self, x: int | str) -> int | str: + ... + + # This is the wrong way to use @override with an overloaded method, and + # should emit an error: + + @overload # E: @override should appear only on implementation + @override + def to_override(self, x: int) -> int: + ... + + @overload + @override + def to_override(self, x: str) -> str: + ... + + @override + def to_override(self, x: int | str) -> int | str: + ... + diff --git a/conformance/tests/overloads_definitions_stub.pyi b/conformance/tests/overloads_definitions_stub.pyi new file mode 100644 index 000000000..f86f2980f --- /dev/null +++ b/conformance/tests/overloads_definitions_stub.pyi @@ -0,0 +1,175 @@ +""" +Tests valid/invalid definition of overloaded functions in stub files, where the +rules differ from non-stubs, since an implementation is not required. +""" + +from typing import ( + final, + overload, + override, +) + +# > At least two @overload-decorated definitions must be present. +@overload # E[func1] +def func1() -> None: # E[func1]: At least two overloads must be present + ... + + +# > The ``@overload``-decorated definitions must be followed by an overload +# > implementation, which does not include an ``@overload`` decorator. Type +# > checkers should report an error or warning if an implementation is missing. +# > Overload definitions within stub files, protocols, and on abstract methods +# > within abstract base classes are exempt from this check. +@overload +def func2(x: int) -> int: + ... + + +@overload +def func2(x: str) -> str: + ... + +# > If one overload signature is decorated with ``@staticmethod`` or +# > ``@classmethod``, all overload signatures must be similarly decorated. The +# > implementation, if present, must also have a consistent decorator. Type +# > checkers should report an error if these conditions are not met. +class C: + @overload # E[func5] + def func5(x: int) -> int: # E[func5] + ... + + @overload + @staticmethod + def func5(x: str) -> str: # E[func5] + ... + + @overload # E[func6] + @classmethod + def func6(cls, x: int) -> int: # E[func6] + ... + + @overload + def func6(cls, x: str) -> str: # E[func6] + ... + + +# > If a ``@final`` or ``@override`` decorator is supplied for a function with +# > overloads, the decorator should be applied only to the overload +# > implementation if it is present. If an overload implementation isn't present +# > (for example, in a stub file), the ``@final`` or ``@override`` decorator +# > should be applied only to the first overload. Type checkers should enforce +# > these rules and generate an error when they are violated. If a ``@final`` or +# > ``@override`` decorator follows these rules, a type checker should treat the +# > decorator as if it is present on all overloads. +class Base: + + # This is a good definition of an overloaded final method in a stub (@final + # decorator on first overload only): + + @overload + @final + def final_method(self, x: int) -> int: + ... + + @overload + def final_method(self, x: str) -> str: + ... + + # The @final decorator should not be on multiple overloads: + + @overload # E[invalid_final] @final should be on first overload + @final + def invalid_final(self, x: int) -> int: # E[invalid_final] + ... + + @overload # E[invalid_final] + @final + def invalid_final(self, x: str) -> str: # E[invalid_final] + ... + + @overload + def invalid_final(self, x: bytes) -> bytes: + ... + + # The @final decorator should not be on all overloads: + + @overload # E[invalid_final_2] @final should be on first overload + @final + def invalid_final_2(self, x: int) -> int: # E[invalid_final_2] + ... + + @overload # E[invalid_final_2] + @final + def invalid_final_2(self, x: str) -> str: + ... + + # These methods are just here for the @override test below. We use an + # overload because mypy doesn't like overriding a non-overloaded method + # with an overloaded one, even if LSP isn't violated. That could be its own + # specification question, but it's not what we're trying to test here: + + @overload + def good_override(self, x: int) -> int: ... + @overload + def good_override(self, x: str) -> str: ... + + @overload + def to_override(self, x: int) -> int: ... + @overload + def to_override(self, x: str) -> str: ... + + +class Child(Base): # E[override-final] + + # The correctly-decorated @final method `Base.final_method` should cause an + # error if overridden in a child class (we use an overload here to avoid + # questions of override LSP compatibility and focus only on the override): + + @overload # E[override-final] + def final_method(self, x: int) -> int: # E[override-final] + ... + + @overload + def final_method(self, x: str) -> str: # E[override-final] can't override final method + ... + + # This is the right way to mark an overload as @override (decorate first + # overload only), so the use of @override should cause an error (because + # there's no `Base.bad_override` method): + + @overload # E[bad_override] marked as override but doesn't exist in base + @override + def bad_override(self, x: int) -> int: # E[bad_override] + ... + + @overload + def bad_override(self, x: str) -> str: + ... + + # This is also a correctly-decorated overloaded @override, which is + # overriding a method that does exist in the base, so there should be no + # error. We need both this test and the previous one, because in the + # previous test, an incorrect error about the use of @override decorator + # could appear on the same line as the expected error about overriding a + # method that doesn't exist in base: + + @overload + @override + def good_override(self, x: int) -> int: + ... + + @overload + def good_override(self, x: str) -> str: + ... + + # This is the wrong way to use @override with an overloaded method, and + # should emit an error: + + @overload # E: @override should appear only on first overload + def to_override(self, x: int) -> int: + ... + + @overload + @override + def to_override(self, x: str) -> str: + ... diff --git a/conformance/tests/overloads_evaluation.py b/conformance/tests/overloads_evaluation.py new file mode 100644 index 000000000..1c14cbd25 --- /dev/null +++ b/conformance/tests/overloads_evaluation.py @@ -0,0 +1,224 @@ +""" +Tests for evaluation of calls to overloaded functions. +""" + +from enum import Enum +from typing import Any, assert_type, Literal, overload + + +# > Step 1: Examine the argument list to determine the number of +# > positional and keyword arguments. Use this information to eliminate any +# > overload candidates that are not plausible based on their +# > input signatures. + +# (There is no way to observe via conformance tests whether an implementation +# performs this step separately from the argument-type-testing step 2 below, so +# the separation of step 1 from step 2 is purely a presentation choice for the +# algorithm, not a conformance requirement.) + +@overload +def example1(x: int, y: str) -> int: + ... + +@overload +def example1(x: str) -> str: + ... + +def example1(x: int | str, y: str = "") -> int | str: + return 1 + +# > - If no candidate overloads remain, generate an error and stop. + +example1() # E: no matching overload + +# > - If only one candidate overload remains, it is the winning match. Evaluate +# > it as if it were a non-overloaded function call and stop. + +ret1 = example1(1, "") +assert_type(ret1, int) + +example1(1, 1) # E: Literal[1] not assignable to str + +ret3 = example1("") +assert_type(ret3, str) + +example1(1) # E: Literal[1] not assignable to str + + +# > Step 2: Evaluate each remaining overload as a regular (non-overloaded) +# > call to determine whether it is compatible with the supplied +# > argument list. Unlike step 1, this step considers the types of the parameters +# > and arguments. During this step, do not generate any user-visible errors. +# > Simply record which of the overloads result in evaluation errors. + +@overload +def example2(x: int, y: str, z: int) -> str: + ... + +@overload +def example2(x: int, y: int, z: int) -> int: + ... + +def example2(x: int, y: int | str, z: int) -> int | str: + return 1 + +# > - If only one overload evaluates without error, it is the winning match. +# > Evaluate it as if it were a non-overloaded function call and stop. + +ret5 = example2(1, 2, 3) +assert_type(ret5, int) + +# > Step 3: If step 2 produces errors for all overloads, perform +# > "argument type expansion". Union types can be expanded +# > into their constituent subtypes. For example, the type ``int | str`` can +# > be expanded into ``int`` and ``str``. + +# > - If all argument lists evaluate successfully, combine their +# > respective return types by union to determine the final return type +# > for the call, and stop. + +def check_expand_union(v: int | str) -> None: + ret1 = example2(1, v, 1) + assert_type(ret1, int | str) + +# > - If argument expansion has been applied to all arguments and one or +# > more of the expanded argument lists cannot be evaluated successfully, +# > generate an error and stop. + +def check_expand_union_2(v: int | str) -> None: + example2(v, v, 1) # E: no overload matches (str, ..., ...) + + +# > 2. ``bool`` should be expanded into ``Literal[True]`` and ``Literal[False]``. + +@overload +def expand_bool(x: Literal[False]) -> Literal[0]: + ... + +@overload +def expand_bool(x: Literal[True]) -> Literal[1]: + ... + +def expand_bool(x: bool) -> int: + return int(x) + +def check_expand_bool(v: bool) -> None: + ret1 = expand_bool(v) + assert_type(ret1, Literal[0, 1]) + + +# > 3. ``Enum`` types (other than those that derive from ``enum.Flag``) should +# > be expanded into their literal members. + +class Color(Enum): + RED = 1 + BLUE = 1 + +@overload +def expand_enum(x: Literal[Color.RED]) -> Literal[0]: + ... + +@overload +def expand_enum(x: Literal[Color.BLUE]) -> Literal[1]: + ... + +def expand_enum(x: Color) -> int: + return x.value + +def check_expand_enum(v: Color) -> None: + ret1 = expand_enum(v) + assert_type(ret1, Literal[0, 1]) + + +# > 4. ``type[A | B]`` should be expanded into ``type[A]`` and ``type[B]``. + +@overload +def expand_type_union(x: type[int]) -> int: + ... + +@overload +def expand_type_union(x: type[str]) -> str: + ... + +def expand_type_union(x: type[int] | type[str]) -> int | str: + return 1 + +def check_expand_type_union(v: type[int | str]) -> None: + ret1 = expand_type_union(v) + assert_type(ret1, int | str) + + +# > 5. Tuples of known length that contain expandable types should be expanded +# > into all possible combinations of their element types. For example, the type +# > ``tuple[int | str, bool]`` should be expanded into ``(int, Literal[True])``, +# > ``(int, Literal[False])``, ``(str, Literal[True])``, and +# > ``(str, Literal[False])``. + +@overload +def expand_tuple(x: tuple[int, int]) -> int: + ... + +@overload +def expand_tuple(x: tuple[int, str]) -> str: + ... + +def expand_tuple(x: tuple[int, int | str]) -> int | str: + return 1 + +def check_expand_tuple(v: int | str) -> None: + ret1 = expand_tuple((1, v)) + assert_type(ret1, int | str) + + +# > Step 4: If the argument list is compatible with two or more overloads, +# > determine whether one or more of the overloads has a variadic parameter +# > (either ``*args`` or ``**kwargs``) that maps to a corresponding argument +# > that supplies an indeterminate number of positional or keyword arguments. +# > If so, eliminate overloads that do not have a variadic parameter. + +@overload +def variadic(x: int, /) -> str: + ... + +@overload +def variadic(x: int, y: int, /, *args: int) -> int: + ... + +def variadic(*args: int) -> int | str: + return 1 + +# > - If this results in only one remaining candidate overload, it is +# > the winning match. Evaluate it as if it were a non-overloaded function +# > call and stop. + +def check_variadic(v: list[int]) -> None: + ret1 = variadic(*v) + assert_type(ret1, int) + + +# > Step 5: For each argument, determine whether all possible +# > :term:`materializations ` of the argument's type are assignable to +# > the corresponding parameter type for each of the remaining overloads. If so, +# > eliminate all of the subsequent remaining overloads. + +@overload +def example4(x: list[int], y: int) -> int: + ... + +@overload +def example4(x: list[str], y: str) -> int: + ... + +@overload +def example4(x: int, y: int) -> list[int]: + ... + +def example4(x: list[int] | list[str] | int, y: int | str) -> int | list[int]: + return 1 + +def check_example4(v1: list[Any], v2: Any): + ret1 = example4(v1, v2) + assert_type(ret1, int) + + ret2 = example4(v2, 1) + assert_type(ret2, Any) diff --git a/docs/spec/overload.rst b/docs/spec/overload.rst index 3b534046d..9ddfe601d 100644 --- a/docs/spec/overload.rst +++ b/docs/spec/overload.rst @@ -1,11 +1,21 @@ .. _`overload`: -``@overload`` +``Overloads`` ============= +In Python, it is common for callable objects to be polymorphic, meaning +they accept different types of arguments. It is also common for such +callables to return different types depending on the arguments passed to +them. Overloads provide a way to describe the accepted input signatures +and corresponding return types. + + +Overload definitions +^^^^^^^^^^^^^^^^^^^^ + The ``@overload`` decorator allows describing functions and methods -that support multiple different combinations of argument types. This -pattern is used frequently in builtin modules and types. For example, +that support multiple different combinations of argument types. This +pattern is used frequently in builtin modules and types. For example, the ``__getitem__()`` method of the ``bytes`` type can be described as follows:: @@ -18,9 +28,9 @@ follows:: @overload def __getitem__(self, s: slice) -> bytes: ... -This description is more precise than would be possible using unions -(which cannot express the relationship between the argument and return -types):: +This description is more precise than would be possible using unions, +which cannot express the relationship between the argument and return +types:: class bytes: ... @@ -54,15 +64,15 @@ Note that we could also easily add items to support ``map(None, ...)``:: iter2: Iterable[T2]) -> Iterable[tuple[T1, T2]]: ... Uses of the ``@overload`` decorator as shown above are suitable for -stub files. In regular modules, a series of ``@overload``-decorated +stub files. In regular modules, a series of ``@overload``-decorated definitions must be followed by exactly one non-``@overload``-decorated definition (for the same function/method). The ``@overload``-decorated definitions are for the benefit of the type checker only, since they will be overwritten by the non-``@overload``-decorated definition, while the latter is used at -runtime but should be ignored by a type checker. At runtime, calling -a ``@overload``-decorated function directly will raise -``NotImplementedError``. Here's an example of a non-stub overload +runtime but should be ignored by a type checker. At runtime, calling +an ``@overload``-decorated function directly will raise +``NotImplementedError``. Here's an example of a non-stub overload that can't easily be expressed using a union or a type variable:: @overload @@ -77,9 +87,9 @@ that can't easily be expressed using a union or a type variable:: def utf8(value): -A constrained ``TypeVar`` type can often be used instead of using the -``@overload`` decorator. For example, the definitions of ``concat1`` -and ``concat2`` in this stub file are equivalent:: +A constrained ``TypeVar`` type can sometimes be used instead of +using the ``@overload`` decorator. For example, the definitions +of ``concat1`` and ``concat2`` in this stub file are equivalent:: from typing import TypeVar @@ -99,8 +109,308 @@ variable is not sufficient. Another important difference between type variables such as ``AnyStr`` and using ``@overload`` is that the prior can also be used to define -constraints for generic class type parameters. For example, the type +constraints for generic class type parameters. For example, the type parameter of the generic class ``typing.IO`` is constrained (only ``IO[str]``, ``IO[bytes]`` and ``IO[Any]`` are valid):: class IO(Generic[AnyStr]): ... + + +Invalid overload definitions +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Type checkers should enforce the following rules for overload definitions. + +At least two ``@overload``-decorated definitions must be present. If only +one is present, an error should be reported. + +The ``@overload``-decorated definitions must be followed by an overload +implementation, which does not include an ``@overload`` decorator. Type +checkers should report an error or warning if an implementation is missing. +Overload definitions within stub files, protocols, and on abstract methods +within abstract base classes are exempt from this check. + +If one overload signature is decorated with ``@staticmethod`` or +``@classmethod``, all overload signatures must be similarly decorated. The +implementation, if present, must also have a consistent decorator. Type +checkers should report an error if these conditions are not met. + +If a ``@final`` or ``@override`` decorator is supplied for a function with +overloads, the decorator should be applied only to the overload implementation +if it is present. If an overload implementation isn't present (for example, in +a stub file), the ``@final`` or ``@override`` decorator should be applied only +to the first overload. Type checkers should enforce these rules and generate +an error when they are violated. If a ``@final`` or ``@override`` decorator +follows these rules, a type checker should treat the decorator as if it is +present on all overloads. + +Overloads are allowed to use a mixture of ``async def`` and ``def`` statements +within the same overload definition. Type checkers should convert +``async def`` statements to a non-async signature (wrapping the return +type in a ``Coroutine``) before testing for implementation consistency. + + +Implementation consistency +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +If an overload implementation is defined, type checkers should validate +that it is consistent with all of its associated overload signatures. +The implementation should accept all potential sets of arguments +that are accepted by the overloads and should produce all potential return +types produced by the overloads. In typing terms, this means the input +signature of the implementation should be :term:`assignable` to the input +signatures of all overloads, and the return type of all overloads should be +assignable to the return type of the implementation. + +If the implementation is inconsistent with its overloads, a type checker +should report an error:: + + @overload + def func(x: str, /) -> str: ... + @overload + def func(x: int) -> int: ... + + # This implementation is inconsistent with the second overload + # because it does not accept a keyword argument ``x`` and the + # the overload's return type ``int`` is not assignable to the + # implementation's return type ``str``. + def func(x: int | str, /) -> str: + return str(x) + +When a type checker checks the implementation for consistency with overloads, +it should first apply any transforms that change the effective type of the +implementation including the presence of a ``yield`` statement in the +implementation body, the use of ``async def``, and the presence of additional +decorators. + + +Overload call evaluation +^^^^^^^^^^^^^^^^^^^^^^^^ + +When a type checker evaluates the call of an overloaded function, it +attempts to "match" the supplied arguments with one or more overloads. +This section describes the algorithm that type checkers should use +for overload matching. + +Only the overloads (the ``@overload``-decorated signatures) should be +considered for matching purposes. The implementation, if provided, +should be ignored for purposes of overload matching. + + +Step 1: Examine the argument list to determine the number of +positional and keyword arguments. Use this information to eliminate any +overload candidates that are not plausible based on their +input signatures. + +- If no candidate overloads remain, generate an error and stop. +- If only one candidate overload remains, it is the winning match. Evaluate + it as if it were a non-overloaded function call and stop. +- If two or more candidate overloads remain, proceed to step 2. + + +Step 2: Evaluate each remaining overload as a regular (non-overloaded) +call to determine whether it is compatible with the supplied +argument list. Unlike step 1, this step considers the types of the parameters +and arguments. During this step, do not generate any user-visible errors. +Simply record which of the overloads result in evaluation errors. + +- If all overloads result in errors, proceed to step 3. +- If only one overload evaluates without error, it is the winning match. + Evaluate it as if it were a non-overloaded function call and stop. +- If two or more candidate overloads remain, proceed to step 4. + + +Step 3: If step 2 produces errors for all overloads, perform +"argument type expansion". Union types can be expanded +into their constituent subtypes. For example, the type ``int | str`` can +be expanded into ``int`` and ``str``. + +Type expansion should be performed one argument at a time from left to +right. Each expansion results in sets of effective argument types. +For example, if there are two arguments whose types evaluate to +``int | str`` and ``int | bytes``, expanding the first argument type +results in two sets of argument types: ``(int, int | bytes)`` and +``(str, int | bytes)``. If type expansion for the second argument is required, +four sets of argument types are produced: ``(int, int)``, ``(int, bytes)``, +``(str, int)``, and ``(str, bytes)``. + +After each argument's expansion, return to step 2 and evaluate all +expanded argument lists. + +- If all argument lists evaluate successfully, combine their + respective return types by union to determine the final return type + for the call, and stop. +- If argument expansion has been applied to all arguments and one or + more of the expanded argument lists cannot be evaluated successfully, + generate an error and stop. + + +For additional details about argument type expansion, see +`argument-type-expansion`_ below. + + +Step 4: If the argument list is compatible with two or more overloads, +determine whether one or more of the overloads has a variadic parameter +(either ``*args`` or ``**kwargs``) that maps to a corresponding argument +that supplies an indeterminate number of positional or keyword arguments. +If so, eliminate overloads that do not have a variadic parameter. + +- If this results in only one remaining candidate overload, it is + the winning match. Evaluate it as if it were a non-overloaded function + call and stop. +- If two or more candidate overloads remain, proceed to step 5. + + +Step 5: For all arguments, determine whether all possible +:term:`materializations ` of the argument's type are assignable to +the corresponding parameter type for each of the remaining overloads. If so, +eliminate all of the subsequent remaining overloads. + +Consider the following example:: + + @overload + def example(x: list[int]) -> int: ... + @overload + def example(x: list[Any]) -> str: ... + @overload + def example(x: Any) -> Any: ... + + def test(a: list[Any]): + # All materializations of list[Any] will match either the first or + # second overload, so the third overload can be eliminated. + example(a) + +This rule eliminates overloads that will never be chosen even if the +caller eliminates types that include ``Any``. + +If the call involves more than one argument, all possible materializations of +every argument type must be assignable to its corresponding parameter type. +If this condition exists, all subsequent remaining overloads should be eliminated. + +Once this filtering process is applied for all arguments, examine the return +types of the remaining overloads. If these return types include type variables, +they should be replaced with their solved types. If the resulting return types +for all remaining overloads are :term:`equivalent`, proceed to step 6. + +If the return types are not equivalent, overload matching is ambiguous. In +this case, assume a return type of ``Any`` and stop. + + +Step 6: Choose the first remaining candidate overload as the winning +match. Evaluate it as if it were a non-overloaded function call and stop. + +Example 1:: + + @overload + def example1(x: int, y: str) -> int: ... + @overload + def example1(x: str) -> str: ... + + example1() # Error in step 1: no plausible overloads + example1(1, "") # Step 1 eliminates second overload + example1("") # Step 1 eliminates first overload + + example1("", "") # Error in step 2: no compatible overloads + example1(1) # Error in step 2: no compatible overloads + + +Example 2:: + + @overload + def example2(x: int, y: str, z: int) -> str: ... + @overload + def example2(x: int, y: int, z: int) -> int: ... + + def test(values: list[str | int]): + # In this example, argument type expansion is + # performed on the first two arguments. Expansion + # of the third is unnecessary. + r1 = example2(1, values[0], 1) + reveal_type(r1) # Should reveal str | int + + # Here, the types of all three arguments are expanded + # without success. + example2(values[0], values[1], values[2]) # Error in step 3 + + +Example 3:: + + @overload + def example3(x: int, /) -> tuple[int]: ... + @overload + def example3(x: int, y: int, /) -> tuple[int, int]: ... + @overload + def example3(*args: int) -> tuple[int, ...]: ... + + def test(val: list[int]): + # Step 1 eliminates second overload. Step 4 and + # step 5 do not apply. Step 6 picks the first + # overload. + r1 = example3(1) + reveal_type(r1) # Should reveal tuple[int] + + # Step 1 eliminates first overload. Step 4 and + # step 5 do not apply. Step 6 picks the second + # overload. + r2 = example3(1, 2) + reveal_type(r2) # Should reveal tuple[int, int] + + # Step 1 doesn't eliminate any overloads. Step 4 + # picks the third overload. + r3 = example3(*val) + reveal_type(r3) # Should reveal tuple[int, ...] + + +Example 4:: + + @overload + def example4(x: list[int], y: int) -> int: ... + @overload + def example4(x: list[str], y: str) -> int: ... + @overload + def example4(x: int, y: int) -> list[int]: ... + + def test(v1: list[Any], v2: Any): + # Step 2 eliminates the third overload. Step 5 + # determines that first and second overloads + # both apply and are ambiguous due to Any, but + # return types are consistent. + r1 = example4(v1, v2) + reveal_type(r1) # Reveals int + + # Step 2 eliminates the second overload. Step 5 + # determines that first and third overloads + # both apply and are ambiguous due to Any, and + # the return types are inconsistent. + r2 = example4(v2, 1) + reveal_type(r2) # Should reveal Any + + +.. _argument-type-expansion: + +Argument type expansion +^^^^^^^^^^^^^^^^^^^^^^^ + +When performing argument type expansion, a type that is equivalent to +a union of a finite set of subtypes should be expanded into its constituent +subtypes. This includes the following cases. + +1. Explicit unions: Each subtype of the union should be considered as a + separate argument type. For example, the type ``int | str`` should be expanded + into ``int`` and ``str``. + +2. ``bool`` should be expanded into ``Literal[True]`` and ``Literal[False]``. + +3. ``Enum`` types (other than those that derive from ``enum.Flag``) should + be expanded into their literal members. + +4. ``type[A | B]`` should be expanded into ``type[A]`` and ``type[B]``. + +5. Tuples of known length that contain expandable types should be expanded + into all possible combinations of their element types. For example, the type + ``tuple[int | str, bool]`` should be expanded into ``(int, Literal[True])``, + ``(int, Literal[False])``, ``(str, Literal[True])``, and + ``(str, Literal[False])``. + +The above list may not be exhaustive, and additional cases may be added in +the future as the type system evolves. From 2dea83d64ea11d7972d1c8268092938fb989ad50 Mon Sep 17 00:00:00 2001 From: Eric Traut Date: Mon, 31 Mar 2025 09:37:12 -0700 Subject: [PATCH 087/308] Tweaked overload conformance tests to permit errors to appear in a few additional places (#1956) Tweaked overload conformance tests to permit errors to appear in a few additional places. Updated conformance results for pyright, which passes the overload conformance tests in the latest version. --- .../results/mypy/overloads_definitions.toml | 28 +-- .../mypy/overloads_definitions_stub.toml | 16 +- .../results/pyre/overloads_definitions.toml | 40 +-- .../pyre/overloads_definitions_stub.toml | 32 ++- conformance/results/pyre/version.toml | 2 +- .../pyright/overloads_definitions.toml | 41 ++- .../pyright/overloads_definitions_stub.toml | 30 +-- .../results/pyright/overloads_evaluation.toml | 8 +- .../results/pytype/overloads_definitions.toml | 238 ++++++++---------- .../pytype/overloads_definitions_stub.toml | 14 +- conformance/results/pytype/version.toml | 2 +- conformance/results/results.html | 10 +- conformance/tests/overloads_definitions.py | 99 +++----- .../tests/overloads_definitions_stub.pyi | 59 ++--- 14 files changed, 263 insertions(+), 356 deletions(-) diff --git a/conformance/results/mypy/overloads_definitions.toml b/conformance/results/mypy/overloads_definitions.toml index d38c913f9..e642fa29b 100644 --- a/conformance/results/mypy/overloads_definitions.toml +++ b/conformance/results/mypy/overloads_definitions.toml @@ -5,20 +5,20 @@ Does not allow an overload with no implementation in an abstract base class. Allows @override to be on all overloads and implementation, instead of just implementation. """ errors_diff = """ -Line 245: Expected 1 errors -Line 49: Unexpected errors ['overloads_definitions.py:49: error: An overloaded function outside a stub file must have an implementation [no-overload-impl]'] +Lines 220, 222, 226: Expected error (tag 'override_impl') +Line 47: Unexpected errors ['overloads_definitions.py:47: error: An overloaded function outside a stub file must have an implementation [no-overload-impl]'] """ output = """ -overloads_definitions.py:14: error: Single overload definition, multiple required [misc] -overloads_definitions.py:26: error: An overloaded function outside a stub file must have an implementation [no-overload-impl] -overloads_definitions.py:49: error: An overloaded function outside a stub file must have an implementation [no-overload-impl] -overloads_definitions.py:63: error: An overloaded function outside a stub file must have an implementation [no-overload-impl] -overloads_definitions.py:78: error: Overload does not consistently use the "@staticmethod" decorator on all function signatures. [misc] -overloads_definitions.py:88: error: Overloaded function implementation does not accept all possible arguments of signature 1 [misc] -overloads_definitions.py:88: error: Overloaded function implementation does not accept all possible arguments of signature 2 [misc] -overloads_definitions.py:91: error: Overload does not consistently use the "@classmethod" decorator on all function signatures. [misc] -overloads_definitions.py:133: error: @final should be applied only to overload implementation [misc] -overloads_definitions.py:148: error: @final should be applied only to overload implementation [misc] -overloads_definitions.py:196: error: Cannot override final attribute "final_method" (previously declared in base class "Base") [misc] -overloads_definitions.py:211: error: Method "bad_override" is marked as an override, but no base method was found with this name [misc] +overloads_definitions.py:15: error: Single overload definition, multiple required [misc] +overloads_definitions.py:27: error: An overloaded function outside a stub file must have an implementation [no-overload-impl] +overloads_definitions.py:47: error: An overloaded function outside a stub file must have an implementation [no-overload-impl] +overloads_definitions.py:58: error: An overloaded function outside a stub file must have an implementation [no-overload-impl] +overloads_definitions.py:71: error: Overload does not consistently use the "@staticmethod" decorator on all function signatures. [misc] +overloads_definitions.py:81: error: Overloaded function implementation does not accept all possible arguments of signature 1 [misc] +overloads_definitions.py:81: error: Overloaded function implementation does not accept all possible arguments of signature 2 [misc] +overloads_definitions.py:84: error: Overload does not consistently use the "@classmethod" decorator on all function signatures. [misc] +overloads_definitions.py:121: error: @final should be applied only to overload implementation [misc] +overloads_definitions.py:135: error: @final should be applied only to overload implementation [misc] +overloads_definitions.py:175: error: Cannot override final attribute "final_method" (previously declared in base class "Base") [misc] +overloads_definitions.py:190: error: Method "bad_override" is marked as an override, but no base method was found with this name [misc] """ diff --git a/conformance/results/mypy/overloads_definitions_stub.toml b/conformance/results/mypy/overloads_definitions_stub.toml index d1623d20f..f2fd2a7b4 100644 --- a/conformance/results/mypy/overloads_definitions_stub.toml +++ b/conformance/results/mypy/overloads_definitions_stub.toml @@ -4,15 +4,15 @@ Allows @override to appear in a stub file not on the first overload. """ conformance_automated = "Fail" errors_diff = """ -Line 168: Expected 1 errors +Lines 143, 147, 149: Expected error (tag 'override_impl') """ output = """ overloads_definitions_stub.pyi:13: error: Single overload definition, multiple required [misc] -overloads_definitions_stub.pyi:37: error: Overload does not consistently use the "@staticmethod" decorator on all function signatures. [misc] -overloads_definitions_stub.pyi:38: error: Self argument missing for a non-static method (or an invalid type for self) [misc] -overloads_definitions_stub.pyi:46: error: Overload does not consistently use the "@classmethod" decorator on all function signatures. [misc] -overloads_definitions_stub.pyi:85: error: In a stub file @final must be applied only to the first overload [misc] -overloads_definitions_stub.pyi:101: error: In a stub file @final must be applied only to the first overload [misc] -overloads_definitions_stub.pyi:128: error: Cannot override final attribute "final_method" (previously declared in base class "Base") [misc] -overloads_definitions_stub.pyi:140: error: Method "bad_override" is marked as an override, but no base method was found with this name [misc] +overloads_definitions_stub.pyi:32: error: Overload does not consistently use the "@staticmethod" decorator on all function signatures. [misc] +overloads_definitions_stub.pyi:33: error: Self argument missing for a non-static method (or an invalid type for self) [misc] +overloads_definitions_stub.pyi:39: error: Overload does not consistently use the "@classmethod" decorator on all function signatures. [misc] +overloads_definitions_stub.pyi:71: error: In a stub file @final must be applied only to the first overload [misc] +overloads_definitions_stub.pyi:84: error: In a stub file @final must be applied only to the first overload [misc] +overloads_definitions_stub.pyi:107: error: Cannot override final attribute "final_method" (previously declared in base class "Base") [misc] +overloads_definitions_stub.pyi:120: error: Method "bad_override" is marked as an override, but no base method was found with this name [misc] """ diff --git a/conformance/results/pyre/overloads_definitions.toml b/conformance/results/pyre/overloads_definitions.toml index fc29f7621..0a99160d0 100644 --- a/conformance/results/pyre/overloads_definitions.toml +++ b/conformance/results/pyre/overloads_definitions.toml @@ -5,28 +5,28 @@ Does not allow an overload with no implementation in a Protocol or an abstract b Expects @final/@override on all overloads and implementation, instead of implementation only. """ errors_diff = """ -Line 245: Expected 1 errors -Lines 148, 150: Expected error (tag 'invalid_final_2') +Lines 135, 137, 142: Expected error (tag 'invalid_final_2') +Lines 220, 222, 226: Expected error (tag 'override_impl') Line 40: Unexpected errors ['overloads_definitions.py:40:4 Missing overload implementation [42]: Overloaded function `MyProto.func3` must have an implementation.'] -Line 51: Unexpected errors ['overloads_definitions.py:51:4 Missing overload implementation [42]: Overloaded function `MyAbstractBase.func4` must have an implementation.'] -Line 128: Unexpected errors ['overloads_definitions.py:128:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).'] -Line 239: Unexpected errors ['overloads_definitions.py:239:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).'] +Line 49: Unexpected errors ['overloads_definitions.py:49:4 Missing overload implementation [42]: Overloaded function `MyAbstractBase.func4` must have an implementation.'] +Line 117: Unexpected errors ['overloads_definitions.py:117:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).'] +Line 215: Unexpected errors ['overloads_definitions.py:215:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).'] """ output = """ -overloads_definitions.py:15:0 Incompatible overload [43]: At least two overload signatures must be present. -overloads_definitions.py:27:0 Missing overload implementation [42]: Overloaded function `func2` must have an implementation. +overloads_definitions.py:16:0 Incompatible overload [43]: At least two overload signatures must be present. +overloads_definitions.py:28:0 Missing overload implementation [42]: Overloaded function `func2` must have an implementation. overloads_definitions.py:40:4 Missing overload implementation [42]: Overloaded function `MyProto.func3` must have an implementation. -overloads_definitions.py:51:4 Missing overload implementation [42]: Overloaded function `MyAbstractBase.func4` must have an implementation. -overloads_definitions.py:64:4 Missing overload implementation [42]: Overloaded function `MyAbstractBase.not_abstract` must have an implementation. -overloads_definitions.py:80:4 Incompatible overload [43]: The implementation of `C.func5` does not accept all possible arguments of overload defined on line `80`. -overloads_definitions.py:85:4 Incompatible overload [43]: The implementation of `C.func5` does not accept all possible arguments of overload defined on line `85`. -overloads_definitions.py:88:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s). -overloads_definitions.py:97:4 Incompatible overload [43]: The implementation of `C.func6` does not accept all possible arguments of overload defined on line `97`. -overloads_definitions.py:97:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s). -overloads_definitions.py:128:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s). -overloads_definitions.py:139:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s). -overloads_definitions.py:204:4 Invalid override [40]: `overloads_definitions.Child.final_method` cannot override final method defined in `Base`. -overloads_definitions.py:220:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s). -overloads_definitions.py:220:4 Invalid override [40]: `overloads_definitions.Child.bad_override` is decorated with @override, but no method of the same name exists in superclasses of `Child`. -overloads_definitions.py:239:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s). +overloads_definitions.py:49:4 Missing overload implementation [42]: Overloaded function `MyAbstractBase.func4` must have an implementation. +overloads_definitions.py:59:4 Missing overload implementation [42]: Overloaded function `MyAbstractBase.not_abstract` must have an implementation. +overloads_definitions.py:73:4 Incompatible overload [43]: The implementation of `C.func5` does not accept all possible arguments of overload defined on line `73`. +overloads_definitions.py:78:4 Incompatible overload [43]: The implementation of `C.func5` does not accept all possible arguments of overload defined on line `78`. +overloads_definitions.py:81:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s). +overloads_definitions.py:90:4 Incompatible overload [43]: The implementation of `C.func6` does not accept all possible arguments of overload defined on line `90`. +overloads_definitions.py:90:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s). +overloads_definitions.py:117:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s). +overloads_definitions.py:127:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s). +overloads_definitions.py:181:4 Invalid override [40]: `overloads_definitions.Child.final_method` cannot override final method defined in `Base`. +overloads_definitions.py:198:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s). +overloads_definitions.py:198:4 Invalid override [40]: `overloads_definitions.Child.bad_override` is decorated with @override, but no method of the same name exists in superclasses of `Child`. +overloads_definitions.py:215:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s). """ diff --git a/conformance/results/pyre/overloads_definitions_stub.toml b/conformance/results/pyre/overloads_definitions_stub.toml index 93772e389..4a9239556 100644 --- a/conformance/results/pyre/overloads_definitions_stub.toml +++ b/conformance/results/pyre/overloads_definitions_stub.toml @@ -4,24 +4,22 @@ Expects @final and @override to be present on all overloads, not just first. """ conformance_automated = "Fail" errors_diff = """ -Line 168: Expected 1 errors -Lines 80, 82, 85, 87: Expected error (tag 'invalid_final') -Lines 96, 98, 101: Expected error (tag 'invalid_final_2') -Lines 122, 128, 129, 133: Expected error (tag 'override-final') -Line 75: Unexpected errors ['overloads_definitions_stub.pyi:75:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).'] -Line 91: Unexpected errors ['overloads_definitions_stub.pyi:91:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).'] -Line 146: Unexpected errors ['overloads_definitions_stub.pyi:146:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).'] -Line 162: Unexpected errors ['overloads_definitions_stub.pyi:162:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).'] -Line 174: Unexpected errors ['overloads_definitions_stub.pyi:174:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).'] +Lines 67, 69, 71, 73: Expected error (tag 'invalid_final') +Lines 80, 82, 84, 86: Expected error (tag 'invalid_final_2') +Lines 102, 107, 108, 111, 113: Expected error (tag 'override-final') +Line 63: Unexpected errors ['overloads_definitions_stub.pyi:63:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).'] +Line 76: Unexpected errors ['overloads_definitions_stub.pyi:76:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).'] +Line 125: Unexpected errors ['overloads_definitions_stub.pyi:125:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).'] +Line 138: Unexpected errors ['overloads_definitions_stub.pyi:138:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).'] """ output = """ overloads_definitions_stub.pyi:14:0 Incompatible overload [43]: At least two overload signatures must be present. -overloads_definitions_stub.pyi:43:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s). -overloads_definitions_stub.pyi:52:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s). -overloads_definitions_stub.pyi:75:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s). -overloads_definitions_stub.pyi:91:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s). -overloads_definitions_stub.pyi:142:4 Invalid override [40]: `overloads_definitions_stub.Child.bad_override` is decorated with @override, but no method of the same name exists in superclasses of `Child`. -overloads_definitions_stub.pyi:146:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s). -overloads_definitions_stub.pyi:162:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s). -overloads_definitions_stub.pyi:174:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s). +overloads_definitions_stub.pyi:37:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s). +overloads_definitions_stub.pyi:44:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s). +overloads_definitions_stub.pyi:63:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s). +overloads_definitions_stub.pyi:76:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s). +overloads_definitions_stub.pyi:122:4 Invalid override [40]: `overloads_definitions_stub.Child.bad_override` is decorated with @override, but no method of the same name exists in superclasses of `Child`. +overloads_definitions_stub.pyi:125:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s). +overloads_definitions_stub.pyi:138:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s). +overloads_definitions_stub.pyi:147:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s). """ diff --git a/conformance/results/pyre/version.toml b/conformance/results/pyre/version.toml index 036bbbfbd..b7e0e78a4 100644 --- a/conformance/results/pyre/version.toml +++ b/conformance/results/pyre/version.toml @@ -1,2 +1,2 @@ version = "pyre 0.9.23" -test_duration = 7.4 +test_duration = 6.3 diff --git a/conformance/results/pyright/overloads_definitions.toml b/conformance/results/pyright/overloads_definitions.toml index 78ec7ab8e..e0c86ab26 100644 --- a/conformance/results/pyright/overloads_definitions.toml +++ b/conformance/results/pyright/overloads_definitions.toml @@ -1,38 +1,31 @@ -conformant = "Partial" -notes = """ -Allows @final/@override on all overloads and implementation; should be implementation-only. -""" -conformance_automated = "Fail" +conformant = "Pass" +conformance_automated = "Pass" errors_diff = """ -Line 245: Expected 1 errors -Line 155: Unexpected errors ['overloads_definitions.py:155:9 - error: @final decorator should be applied only to the implementation (reportInconsistentOverload)'] -Line 247: Unexpected errors ['overloads_definitions.py:247:9 - error: @override decorator should be applied only to the implementation (reportInconsistentOverload)'] -Line 252: Unexpected errors ['overloads_definitions.py:252:9 - error: @override decorator should be applied only to the implementation (reportInconsistentOverload)'] """ output = """ -overloads_definitions.py:15:5 - error: "func1" is marked as overload, but additional overloads are missing (reportInconsistentOverload) -overloads_definitions.py:27:5 - error: "func2" is marked as overload, but no implementation is provided (reportNoOverloadImplementation) -overloads_definitions.py:64:9 - error: "not_abstract" is marked as overload, but no implementation is provided (reportNoOverloadImplementation) -overloads_definitions.py:80:9 - error: Overloads for "func5" use @staticmethod inconsistently (reportInconsistentOverload) -overloads_definitions.py:88:9 - error: Overloaded implementation is not consistent with signature of overload 1 +overloads_definitions.py:16:5 - error: "func1" is marked as overload, but additional overloads are missing (reportInconsistentOverload) +overloads_definitions.py:28:5 - error: "func2" is marked as overload, but no implementation is provided (reportNoOverloadImplementation) +overloads_definitions.py:59:9 - error: "not_abstract" is marked as overload, but no implementation is provided (reportNoOverloadImplementation) +overloads_definitions.py:73:9 - error: Overloads for "func5" use @staticmethod inconsistently (reportInconsistentOverload) +overloads_definitions.py:81:9 - error: Overloaded implementation is not consistent with signature of overload 1   Type "(self: Self@C, x: int | str) -> (int | str)" is not assignable to type "(x: int) -> int"     Parameter name mismatch: "x" versus "self"     Parameter 1: type "int" is incompatible with type "Self@C"       Type "int" is not assignable to type "Self@C"     Extra parameter "x" (reportInconsistentOverload) -overloads_definitions.py:88:9 - error: Overloaded implementation is not consistent with signature of overload 2 +overloads_definitions.py:81:9 - error: Overloaded implementation is not consistent with signature of overload 2   Type "(self: Self@C, x: int | str) -> (int | str)" is not assignable to type "(x: str) -> str"     Parameter name mismatch: "x" versus "self"     Parameter 1: type "str" is incompatible with type "Self@C"       Type "str" is not assignable to type "Self@C"     Extra parameter "x" (reportInconsistentOverload) -overloads_definitions.py:93:9 - error: Overloads for "func6" use @classmethod inconsistently (reportInconsistentOverload) -overloads_definitions.py:97:15 - warning: Instance methods should take a "self" parameter (reportSelfClsParameterName) -overloads_definitions.py:135:9 - error: @final decorator should be applied only to the implementation (reportInconsistentOverload) -overloads_definitions.py:150:9 - error: @final decorator should be applied only to the implementation (reportInconsistentOverload) -overloads_definitions.py:155:9 - error: @final decorator should be applied only to the implementation (reportInconsistentOverload) -overloads_definitions.py:204:9 - error: Method "final_method" cannot override final method defined in class "Base" (reportIncompatibleMethodOverride) -overloads_definitions.py:220:9 - error: Method "bad_override" is marked as override, but no base method of same name is present (reportGeneralTypeIssues) -overloads_definitions.py:247:9 - error: @override decorator should be applied only to the implementation (reportInconsistentOverload) -overloads_definitions.py:252:9 - error: @override decorator should be applied only to the implementation (reportInconsistentOverload) +overloads_definitions.py:86:9 - error: Overloads for "func6" use @classmethod inconsistently (reportInconsistentOverload) +overloads_definitions.py:90:15 - warning: Instance methods should take a "self" parameter (reportSelfClsParameterName) +overloads_definitions.py:123:9 - error: @final decorator should be applied only to the implementation (reportInconsistentOverload) +overloads_definitions.py:137:9 - error: @final decorator should be applied only to the implementation (reportInconsistentOverload) +overloads_definitions.py:142:9 - error: @final decorator should be applied only to the implementation (reportInconsistentOverload) +overloads_definitions.py:181:9 - error: Method "final_method" cannot override final method defined in class "Base" (reportIncompatibleMethodOverride) +overloads_definitions.py:198:9 - error: Method "bad_override" is marked as override, but no base method of same name is present (reportGeneralTypeIssues) +overloads_definitions.py:222:9 - error: @override decorator should be applied only to the implementation (reportInconsistentOverload) +overloads_definitions.py:226:9 - error: @override decorator should be applied only to the implementation (reportInconsistentOverload) """ diff --git a/conformance/results/pyright/overloads_definitions_stub.toml b/conformance/results/pyright/overloads_definitions_stub.toml index 3a71f07f5..1e9c89498 100644 --- a/conformance/results/pyright/overloads_definitions_stub.toml +++ b/conformance/results/pyright/overloads_definitions_stub.toml @@ -1,24 +1,16 @@ -conformant = "Partial" -notes = """ -Does not enforce that @final/@override in a stub should be only on first overload. -Does not enforce @override when correctly used with an overloaded method in a stub file. -""" -conformance_automated = "Fail" +conformant = "Pass" +conformance_automated = "Pass" errors_diff = """ -Line 168: Expected 1 errors -Lines 96, 98, 101: Expected error (tag 'invalid_final_2') -Line 103: Unexpected errors ['overloads_definitions_stub.pyi:103:9 - error: Only the first overload should be marked @final (reportInconsistentOverload)'] -Line 174: Unexpected errors ['overloads_definitions_stub.pyi:174:9 - error: Only the first overload should be marked @override (reportInconsistentOverload)'] """ output = """ overloads_definitions_stub.pyi:14:5 - error: "func1" is marked as overload, but additional overloads are missing (reportInconsistentOverload) -overloads_definitions_stub.pyi:38:9 - error: Overloads for "func5" use @staticmethod inconsistently (reportInconsistentOverload) -overloads_definitions_stub.pyi:38:15 - warning: Instance methods should take a "self" parameter (reportSelfClsParameterName) -overloads_definitions_stub.pyi:48:9 - error: Overloads for "func6" use @classmethod inconsistently (reportInconsistentOverload) -overloads_definitions_stub.pyi:52:15 - warning: Instance methods should take a "self" parameter (reportSelfClsParameterName) -overloads_definitions_stub.pyi:87:9 - error: Only the first overload should be marked @final (reportInconsistentOverload) -overloads_definitions_stub.pyi:103:9 - error: Only the first overload should be marked @final (reportInconsistentOverload) -overloads_definitions_stub.pyi:133:9 - error: Method "final_method" cannot override final method defined in class "Base" (reportIncompatibleMethodOverride) -overloads_definitions_stub.pyi:142:9 - error: Method "bad_override" is marked as override, but no base method of same name is present (reportGeneralTypeIssues) -overloads_definitions_stub.pyi:174:9 - error: Only the first overload should be marked @override (reportInconsistentOverload) +overloads_definitions_stub.pyi:33:9 - error: Overloads for "func5" use @staticmethod inconsistently (reportInconsistentOverload) +overloads_definitions_stub.pyi:33:15 - warning: Instance methods should take a "self" parameter (reportSelfClsParameterName) +overloads_definitions_stub.pyi:41:9 - error: Overloads for "func6" use @classmethod inconsistently (reportInconsistentOverload) +overloads_definitions_stub.pyi:44:15 - warning: Instance methods should take a "self" parameter (reportSelfClsParameterName) +overloads_definitions_stub.pyi:73:9 - error: Only the first overload should be marked @final (reportInconsistentOverload) +overloads_definitions_stub.pyi:86:9 - error: Only the first overload should be marked @final (reportInconsistentOverload) +overloads_definitions_stub.pyi:111:9 - error: Method "final_method" cannot override final method defined in class "Base" (reportIncompatibleMethodOverride) +overloads_definitions_stub.pyi:122:9 - error: Method "bad_override" is marked as override, but no base method of same name is present (reportGeneralTypeIssues) +overloads_definitions_stub.pyi:147:9 - error: Only the first overload should be marked @override (reportInconsistentOverload) """ diff --git a/conformance/results/pyright/overloads_evaluation.toml b/conformance/results/pyright/overloads_evaluation.toml index ee50a3a1a..2c4901905 100644 --- a/conformance/results/pyright/overloads_evaluation.toml +++ b/conformance/results/pyright/overloads_evaluation.toml @@ -1,10 +1,4 @@ -conformant = "Partial" -notes = """ -Does not expand boolean arguments to Literal[True] and Literal[False]. -Does not expand enum arguments to literal variants. -Does not expand tuple arguments to possible combinations. -Does not prefer variadic match to indeterminate-length unpacked argument. -""" +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ diff --git a/conformance/results/pytype/overloads_definitions.toml b/conformance/results/pytype/overloads_definitions.toml index e5307735a..dc4444dc3 100644 --- a/conformance/results/pytype/overloads_definitions.toml +++ b/conformance/results/pytype/overloads_definitions.toml @@ -8,29 +8,29 @@ Does not enforce any rules on location of @final or @override decorators. """ conformance_automated = "Fail" errors_diff = """ -Line 245: Expected 1 errors -Lines 14, 15: Expected error (tag 'func1') -Lines 26, 27: Expected error (tag 'func2') -Lines 63, 64: Expected error (tag 'not_abstract') -Lines 78, 80, 85, 88: Expected error (tag 'func5') -Lines 91, 93, 97, 101: Expected error (tag 'func6') -Lines 133, 135, 139: Expected error (tag 'invalid_final') -Lines 148, 150: Expected error (tag 'invalid_final_2') +Lines 15, 16: Expected error (tag 'func1') +Lines 27, 28: Expected error (tag 'func2') +Lines 58, 59: Expected error (tag 'not_abstract') +Lines 71, 73, 78, 81: Expected error (tag 'func5') +Lines 84, 86, 90, 94: Expected error (tag 'func6') +Lines 121, 123, 127: Expected error (tag 'invalid_final') +Lines 135, 137, 142: Expected error (tag 'invalid_final_2') +Lines 220, 222, 226: Expected error (tag 'override_impl') Line 6: Unexpected errors ['overloads_definitions.py:6:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.override not supported yet [not-supported-yet]'] -Line 46: Unexpected errors ["overloads_definitions.py:46:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func3: @typing.overload-decorated 'MyProto.func3' object is not callable [not-callable]"] -Line 58: Unexpected errors ["overloads_definitions.py:58:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func4: @typing.overload-decorated 'MyAbstractBase.func4' object is not callable [not-callable]"] -Line 70: Unexpected errors ["overloads_definitions.py:70:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in not_abstract: @typing.overload-decorated 'MyAbstractBase.not_abstract' object is not callable [not-callable]"] -Line 81: Unexpected errors ['overloads_definitions.py:81:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func5: bad return type [bad-return-type]'] -Line 86: Unexpected errors ['overloads_definitions.py:86:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func5: bad return type [bad-return-type]'] -Line 129: Unexpected errors ['overloads_definitions.py:129:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in final_method: bad return type [bad-return-type]', 'overloads_definitions.py:129:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in final_method: bad return type [bad-return-type]'] -Line 143: Unexpected errors ['overloads_definitions.py:143:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in invalid_final: bad return type [bad-return-type]', 'overloads_definitions.py:143:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in invalid_final: bad return type [bad-return-type]'] -Line 160: Unexpected errors ['overloads_definitions.py:160:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in invalid_final_2: bad return type [bad-return-type]', 'overloads_definitions.py:160:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in invalid_final_2: bad return type [bad-return-type]'] -Line 176: Unexpected errors ['overloads_definitions.py:176:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in good_override: bad return type [bad-return-type]', 'overloads_definitions.py:176:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in good_override: bad return type [bad-return-type]'] -Line 187: Unexpected errors ['overloads_definitions.py:187:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in to_override: bad return type [bad-return-type]', 'overloads_definitions.py:187:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in to_override: bad return type [bad-return-type]'] -Line 205: Unexpected errors ['overloads_definitions.py:205:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in final_method: bad return type [bad-return-type]', 'overloads_definitions.py:205:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in final_method: bad return type [bad-return-type]'] -Line 221: Unexpected errors ['overloads_definitions.py:221:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in bad_override: bad return type [bad-return-type]', 'overloads_definitions.py:221:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in bad_override: bad return type [bad-return-type]'] -Line 240: Unexpected errors ['overloads_definitions.py:240:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in good_override: bad return type [bad-return-type]', 'overloads_definitions.py:240:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in good_override: bad return type [bad-return-type]'] -Line 257: Unexpected errors ['overloads_definitions.py:257:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in to_override: bad return type [bad-return-type]', 'overloads_definitions.py:257:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in to_override: bad return type [bad-return-type]'] +Line 43: Unexpected errors ["overloads_definitions.py:43:37: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func3: @typing.overload-decorated 'MyProto.func3' object is not callable [not-callable]"] +Line 53: Unexpected errors ["overloads_definitions.py:53:37: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func4: @typing.overload-decorated 'MyAbstractBase.func4' object is not callable [not-callable]"] +Line 63: Unexpected errors ["overloads_definitions.py:63:44: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in not_abstract: @typing.overload-decorated 'MyAbstractBase.not_abstract' object is not callable [not-callable]"] +Line 74: Unexpected errors ['overloads_definitions.py:74:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func5: bad return type [bad-return-type]'] +Line 79: Unexpected errors ['overloads_definitions.py:79:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func5: bad return type [bad-return-type]'] +Line 117: Unexpected errors ['overloads_definitions.py:117:56: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in final_method: bad return type [bad-return-type]', 'overloads_definitions.py:117:56: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in final_method: bad return type [bad-return-type]'] +Line 130: Unexpected errors ['overloads_definitions.py:130:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in invalid_final: bad return type [bad-return-type]', 'overloads_definitions.py:130:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in invalid_final: bad return type [bad-return-type]'] +Line 146: Unexpected errors ['overloads_definitions.py:146:59: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in invalid_final_2: bad return type [bad-return-type]', 'overloads_definitions.py:146:59: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in invalid_final_2: bad return type [bad-return-type]'] +Line 159: Unexpected errors ['overloads_definitions.py:159:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in good_override: bad return type [bad-return-type]', 'overloads_definitions.py:159:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in good_override: bad return type [bad-return-type]'] +Line 167: Unexpected errors ['overloads_definitions.py:167:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in to_override: bad return type [bad-return-type]', 'overloads_definitions.py:167:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in to_override: bad return type [bad-return-type]'] +Line 184: Unexpected errors ['overloads_definitions.py:184:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in final_method: bad return type [bad-return-type]', 'overloads_definitions.py:184:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in final_method: bad return type [bad-return-type]'] +Line 199: Unexpected errors ['overloads_definitions.py:199:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in bad_override: bad return type [bad-return-type]', 'overloads_definitions.py:199:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in bad_override: bad return type [bad-return-type]'] +Line 215: Unexpected errors ['overloads_definitions.py:215:57: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in good_override: bad return type [bad-return-type]', 'overloads_definitions.py:215:57: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in good_override: bad return type [bad-return-type]'] +Line 229: Unexpected errors ['overloads_definitions.py:229:55: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in to_override: bad return type [bad-return-type]', 'overloads_definitions.py:229:55: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in to_override: bad return type [bad-return-type]'] """ output = """ overloads_definitions.py:6:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing.override not supported yet [not-supported-yet] @@ -48,87 +48,85 @@ from typing import ( ) \u001b[1m\u001b[31m~\u001b[39m\u001b[0m -overloads_definitions.py:46:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func3: @typing.overload-decorated 'MyProto.func3' object is not callable [not-callable] +overloads_definitions.py:43:37: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func3: @typing.overload-decorated 'MyProto.func3' object is not callable [not-callable] - ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + def func3(self, x: str) -> str: ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m -overloads_definitions.py:58:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func4: @typing.overload-decorated 'MyAbstractBase.func4' object is not callable [not-callable] +overloads_definitions.py:53:37: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func4: @typing.overload-decorated 'MyAbstractBase.func4' object is not callable [not-callable] - ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + def func4(self, x: str) -> str: ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m -overloads_definitions.py:70:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in not_abstract: @typing.overload-decorated 'MyAbstractBase.not_abstract' object is not callable [not-callable] +overloads_definitions.py:63:44: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in not_abstract: @typing.overload-decorated 'MyAbstractBase.not_abstract' object is not callable [not-callable] - ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + def not_abstract(self, x: str) -> str: ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m -overloads_definitions.py:81:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func5: bad return type [bad-return-type] +overloads_definitions.py:74:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func5: bad return type [bad-return-type] ... \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m -overloads_definitions.py:86:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func5: bad return type [bad-return-type] +overloads_definitions.py:79:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func5: bad return type [bad-return-type] ... \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m -overloads_definitions.py:129:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in final_method: bad return type [bad-return-type] +overloads_definitions.py:117:56: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in final_method: bad return type [bad-return-type] - ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + def final_method(self, x: int | str) -> int | str: ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m -overloads_definitions.py:129:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in final_method: bad return type [bad-return-type] +overloads_definitions.py:117:56: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in final_method: bad return type [bad-return-type] - ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + def final_method(self, x: int | str) -> int | str: ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m -overloads_definitions.py:143:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in invalid_final: bad return type [bad-return-type] +overloads_definitions.py:130:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in invalid_final: bad return type [bad-return-type] - ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + def invalid_final(self, x: int | str) -> int | str: ... +\u001b[1m\u001b[31m\u001b[39m\u001b[0m -overloads_definitions.py:143:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in invalid_final: bad return type [bad-return-type] +overloads_definitions.py:130:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in invalid_final: bad return type [bad-return-type] - ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + def invalid_final(self, x: int | str) -> int | str: ... +\u001b[1m\u001b[31m\u001b[39m\u001b[0m -overloads_definitions.py:160:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in invalid_final_2: bad return type [bad-return-type] +overloads_definitions.py:146:59: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in invalid_final_2: bad return type [bad-return-type] - ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + def invalid_final_2(self, x: int | str) -> int | str: ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m -overloads_definitions.py:160:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in invalid_final_2: bad return type [bad-return-type] +overloads_definitions.py:146:59: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in invalid_final_2: bad return type [bad-return-type] - ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + def invalid_final_2(self, x: int | str) -> int | str: ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m -overloads_definitions.py:176:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in good_override: bad return type [bad-return-type] +overloads_definitions.py:159:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in good_override: bad return type [bad-return-type] - ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + def good_override(self, x: int | str) -> int | str: ... +\u001b[1m\u001b[31m\u001b[39m\u001b[0m -overloads_definitions.py:176:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in good_override: bad return type [bad-return-type] +overloads_definitions.py:159:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in good_override: bad return type [bad-return-type] - ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + def good_override(self, x: int | str) -> int | str: ... +\u001b[1m\u001b[31m\u001b[39m\u001b[0m -overloads_definitions.py:187:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in to_override: bad return type [bad-return-type] +overloads_definitions.py:167:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in to_override: bad return type [bad-return-type] - ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + def to_override(self, x: int | str) -> int | str: ... +\u001b[1m\u001b[31m\u001b[39m\u001b[0m -overloads_definitions.py:187:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in to_override: bad return type [bad-return-type] +overloads_definitions.py:167:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in to_override: bad return type [bad-return-type] - ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + def to_override(self, x: int | str) -> int | str: ... +\u001b[1m\u001b[31m\u001b[39m\u001b[0m -overloads_definitions.py:190:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Class Child overrides final method final_method, defined in base class Base [final-error] +overloads_definitions.py:170:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Class Child overrides final method final_method, defined in base class Base [final-error] class Child(Base): # E[override-final] \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -\u001b[1m\u001b[31m\u001b[39m\u001b[0m # The correctly-decorated @final method `Base.final_method` should cause an \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m # error if overridden in a child class (we use an overload here to avoid @@ -137,24 +135,24 @@ class Child(Base): # E[override-final] \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m \u001b[1m\u001b[31m\u001b[39m\u001b[0m - @overload # E[override-final] -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - def final_method(self, x: int) -> int: -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - ... -\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + @overload # E[override-final] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + def final_method(self, x: int) -> int: ... +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m \u001b[1m\u001b[31m\u001b[39m\u001b[0m @overload \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - def final_method(self, x: str) -> str: -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - ... -\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + def final_method(self, x: str) -> str: ... +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m \u001b[1m\u001b[31m\u001b[39m\u001b[0m - def final_method(self, x: int | str) -> int | str: # E[override-final] can't override final method -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + def final_method( # E[override-final] can't override final method +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + self, x: int | str +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ) -> int | str: # E[override-final] can't override final method +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m ... \u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m @@ -177,16 +175,14 @@ class Child(Base): # E[override-final] \u001b[1m\u001b[31m\u001b[39m\u001b[0m @overload \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - def bad_override(self, x: str) -> str: -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - ... -\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + def bad_override(self, x: str) -> str: ... +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m \u001b[1m\u001b[31m\u001b[39m\u001b[0m @override \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - def bad_override(self, x: int | str) -> int | str: # E[bad_override] -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + def bad_override(self, x: int | str) -> int | str: # E[bad_override] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m ... \u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m @@ -207,26 +203,20 @@ class Child(Base): # E[override-final] \u001b[1m\u001b[31m\u001b[39m\u001b[0m @overload \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - def good_override(self, x: int) -> int: -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - ... -\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + def good_override(self, x: int) -> int: ... +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m \u001b[1m\u001b[31m\u001b[39m\u001b[0m @overload \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - def good_override(self, x: str) -> str: -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - ... -\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + def good_override(self, x: str) -> str: ... +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m \u001b[1m\u001b[31m\u001b[39m\u001b[0m @override \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - def good_override(self, x: int | str) -> int | str: -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - ... -\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + def good_override(self, x: int | str) -> int | str: ... +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m \u001b[1m\u001b[31m\u001b[39m\u001b[0m # This is the wrong way to use @override with an overloaded method, and @@ -235,78 +225,72 @@ class Child(Base): # E[override-final] \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m \u001b[1m\u001b[31m\u001b[39m\u001b[0m - @overload # E: @override should appear only on implementation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + @overload # E[override_impl]: @override should appear only on implementation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m @override \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - def to_override(self, x: int) -> int: -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - ... -\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + def to_override(self, x: int) -> int: ... # E[override_impl] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m \u001b[1m\u001b[31m\u001b[39m\u001b[0m @overload \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m @override \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - def to_override(self, x: str) -> str: -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - ... -\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + def to_override(self, x: str) -> str: ... # E[override_impl] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m \u001b[1m\u001b[31m\u001b[39m\u001b[0m @override \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - def to_override(self, x: int | str) -> int | str: -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - ... -\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + def to_override(self, x: int | str) -> int | str: ... +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -overloads_definitions.py:205:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in final_method: bad return type [bad-return-type] +overloads_definitions.py:184:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in final_method: bad return type [bad-return-type] ... \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m -overloads_definitions.py:205:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in final_method: bad return type [bad-return-type] +overloads_definitions.py:184:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in final_method: bad return type [bad-return-type] ... \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m -overloads_definitions.py:212:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Child: Attribute 'bad_override' not found on any parent class [override-error] +overloads_definitions.py:191:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Child: Attribute 'bad_override' not found on any parent class [override-error] def bad_override(self, x: int) -> int: # E[bad_override] \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m ... \u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m -overloads_definitions.py:221:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in bad_override: bad return type [bad-return-type] +overloads_definitions.py:199:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in bad_override: bad return type [bad-return-type] ... \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m -overloads_definitions.py:221:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in bad_override: bad return type [bad-return-type] +overloads_definitions.py:199:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in bad_override: bad return type [bad-return-type] ... \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m -overloads_definitions.py:240:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in good_override: bad return type [bad-return-type] +overloads_definitions.py:215:57: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in good_override: bad return type [bad-return-type] - ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + def good_override(self, x: int | str) -> int | str: ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m -overloads_definitions.py:240:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in good_override: bad return type [bad-return-type] +overloads_definitions.py:215:57: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in good_override: bad return type [bad-return-type] - ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + def good_override(self, x: int | str) -> int | str: ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m -overloads_definitions.py:257:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in to_override: bad return type [bad-return-type] +overloads_definitions.py:229:55: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in to_override: bad return type [bad-return-type] - ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + def to_override(self, x: int | str) -> int | str: ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m -overloads_definitions.py:257:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in to_override: bad return type [bad-return-type] +overloads_definitions.py:229:55: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in to_override: bad return type [bad-return-type] - ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + def to_override(self, x: int | str) -> int | str: ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m """ diff --git a/conformance/results/pytype/overloads_definitions_stub.toml b/conformance/results/pytype/overloads_definitions_stub.toml index de2b6eda4..bf1399325 100644 --- a/conformance/results/pytype/overloads_definitions_stub.toml +++ b/conformance/results/pytype/overloads_definitions_stub.toml @@ -4,14 +4,14 @@ Does not enforce any of the specified rules regarding overload definitions. """ conformance_automated = "Fail" errors_diff = """ -Line 168: Expected 1 errors Lines 13, 14: Expected error (tag 'func1') -Lines 37, 38, 43: Expected error (tag 'func5') -Lines 46, 48, 52: Expected error (tag 'func6') -Lines 80, 82, 85, 87: Expected error (tag 'invalid_final') -Lines 96, 98, 101: Expected error (tag 'invalid_final_2') -Lines 122, 128, 129, 133: Expected error (tag 'override-final') -Lines 140, 142: Expected error (tag 'bad_override') +Lines 32, 33, 37: Expected error (tag 'func5') +Lines 39, 41, 44: Expected error (tag 'func6') +Lines 67, 69, 71, 73: Expected error (tag 'invalid_final') +Lines 80, 82, 84, 86: Expected error (tag 'invalid_final_2') +Lines 102, 107, 108, 111, 113: Expected error (tag 'override-final') +Lines 120, 122: Expected error (tag 'bad_override') +Lines 143, 147, 149: Expected error (tag 'override_impl') """ output = """ """ diff --git a/conformance/results/pytype/version.toml b/conformance/results/pytype/version.toml index 57c8a1ffa..e114259da 100644 --- a/conformance/results/pytype/version.toml +++ b/conformance/results/pytype/version.toml @@ -1,2 +1,2 @@ version = "pytype 2024.10.11" -test_duration = 35.2 +test_duration = 34.0 diff --git a/conformance/results/results.html b/conformance/results/results.html index 86f2fd3c0..955525fb6 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -165,10 +165,10 @@

    Python Type System Conformance Test Results

    1.3sec
    pyre 0.9.23
    -
    7.4sec
    +
    6.3sec
    pytype 2024.10.11
    -
    35.2sec
    +
    34.0sec
    @@ -680,19 +680,19 @@

    Python Type System Conformance Test Results

         overloads_definitions
    Partial

    Does not allow an overload with no implementation in an abstract base class.

    Allows @override to be on all overloads and implementation, instead of just implementation.

    Partial

    Allows @final/@override on all overloads and implementation; should be implementation-only.

    Pass
    Partial

    Does not allow an overload with no implementation in a Protocol or an abstract base class.

    Expects @final/@override on all overloads and implementation, instead of implementation only.

    Fail

    Does not reject a function with a single @overload signature.

    Does not reject a function with @overload signature but no implementation.

    Does not allow an overload with no implementation in a Protocol or an abstract base class.

    Does not error on overloads inconsistently decorated with `@staticmethod` or `@classmethod`.

    Does not enforce any rules on location of @final or @override decorators.

         overloads_definitions_stub
    Partial

    Allows @override to appear in a stub file not on the first overload.

    Partial

    Does not enforce that @final/@override in a stub should be only on first overload.

    Does not enforce @override when correctly used with an overloaded method in a stub file.

    Pass
    Partial

    Expects @final and @override to be present on all overloads, not just first.

    Fail

    Does not enforce any of the specified rules regarding overload definitions.

         overloads_evaluation
    Partial

    Does not expand boolean arguments to Literal[True] and Literal[False].

    Does not expand enum arguments to literal variants.

    Does not expand tuple arguments to possible combinations.

    Partial

    Does not expand boolean arguments to Literal[True] and Literal[False].

    Does not expand enum arguments to literal variants.

    Does not expand tuple arguments to possible combinations.

    Does not prefer variadic match to indeterminate-length unpacked argument.

    Pass
    Partial

    Does not expand boolean arguments to Literal[True] and Literal[False].

    Does not expand enum arguments to literal variants.

    Does not expand type[A | B] to type[A] and type[B].

    Does not expand tuple arguments to possible combinations.

    Does not prefer variadic match to indeterminate-length unpacked argument.

    Does not treat multiple matches due to gradual types as ambiguous.

    Partial

    Does not perform argument expansion (on any types) when matching overloads.

    Does not treat multiple matches due to gradual types as ambiguous.

    Does not prefer variadic match to indeterminate-length unpacked argument.

    pyre 0.9.23
    -
    6.3sec
    +
    6.4sec
    pytype 2024.10.11
    -
    34.0sec
    +
    32.7sec
    @@ -691,8 +691,8 @@

    Python Type System Conformance Test Results

    Fail

    Does not enforce any of the specified rules regarding overload definitions.

         overloads_evaluation
    Partial

    Does not expand boolean arguments to Literal[True] and Literal[False].

    Does not expand enum arguments to literal variants.

    Does not expand tuple arguments to possible combinations.

    Pass
    Partial

    Does not expand boolean arguments to Literal[True] and Literal[False].

    Does not expand enum arguments to literal variants.

    Does not expand tuple arguments to possible combinations.

    Does not evaluate Any in some cases where overload is ambiguous.

    Evaluates Any in some cases where overload is not ambiguous.

    Partial

    Does not evaluate Any in some cases where overload is ambiguous.

    Partial

    Does not expand boolean arguments to Literal[True] and Literal[False].

    Does not expand enum arguments to literal variants.

    Does not expand type[A | B] to type[A] and type[B].

    Does not expand tuple arguments to possible combinations.

    Does not prefer variadic match to indeterminate-length unpacked argument.

    Does not treat multiple matches due to gradual types as ambiguous.

    Partial

    Does not perform argument expansion (on any types) when matching overloads.

    Does not treat multiple matches due to gradual types as ambiguous.

    Does not prefer variadic match to indeterminate-length unpacked argument.

    + @@ -1536,7 +1541,7 @@

    Python Type System Conformance Test Results

    - + @@ -2728,7 +2733,7 @@

    Python Type System Conformance Test Results

    - + diff --git a/conformance/results/ty/protocols_definition.toml b/conformance/results/ty/protocols_definition.toml index 29e82bd3b..09ccdd19e 100644 --- a/conformance/results/ty/protocols_definition.toml +++ b/conformance/results/ty/protocols_definition.toml @@ -23,4 +23,6 @@ protocols_definition.py:289:22: error[invalid-assignment] Object of type `Concre protocols_definition.py:339:22: error[invalid-assignment] Object of type `Concrete6_Bad1` is not assignable to `Template6` protocols_definition.py:340:22: error[invalid-assignment] Object of type `Concrete6_Bad2` is not assignable to `Template6` protocols_definition.py:341:22: error[invalid-assignment] Object of type `Concrete6_Bad3` is not assignable to `Template6` +protocols_definition.py:369:22: error[invalid-assignment] Object of type `Concrete7_Bad1` is not assignable to `Template7` +protocols_definition.py:370:22: error[invalid-assignment] Object of type `Concrete7_Bad2` is not assignable to `Template7` """ diff --git a/conformance/results/zuban/protocols_definition.toml b/conformance/results/zuban/protocols_definition.toml index a0316e0ea..26d390b47 100644 --- a/conformance/results/zuban/protocols_definition.toml +++ b/conformance/results/zuban/protocols_definition.toml @@ -67,4 +67,7 @@ protocols_definition.py:340: error: Incompatible types in assignment (expression protocols_definition.py:340: note: Protocol member Template6.val1 expected settable variable, got read-only attribute protocols_definition.py:341: error: Incompatible types in assignment (expression has type "Concrete6_Bad3", variable has type "Template6") [assignment] protocols_definition.py:341: note: Protocol member Template6.val1 expected settable variable, got read-only attribute +protocols_definition.py:369: error: Incompatible types in assignment (expression has type "Concrete7_Bad1", variable has type "Template7") [assignment] +protocols_definition.py:369: note: Protocol member Template7.val1 expected class variable, got instance variable +protocols_definition.py:370: error: Incompatible types in assignment (expression has type "Concrete7_Bad2", variable has type "Template7") [assignment] """ diff --git a/conformance/tests/protocols_class_objects.py b/conformance/tests/protocols_class_objects.py index 79de51204..2a498438b 100644 --- a/conformance/tests/protocols_class_objects.py +++ b/conformance/tests/protocols_class_objects.py @@ -105,5 +105,5 @@ class ConcreteC3(metaclass=CMeta): pc2: ProtoC2 = ConcreteC1 # OK pc3: ProtoC1 = ConcreteC2 # E pc4: ProtoC2 = ConcreteC2 # E -pc5: ProtoC1 = ConcreteC3 # E +pc5: ProtoC1 = ConcreteC3 # E?: Explicit ClassVar matching is unspecified pc6: ProtoC2 = ConcreteC3 # OK diff --git a/conformance/tests/protocols_definition.py b/conformance/tests/protocols_definition.py index bf046ee8c..7252dfc16 100644 --- a/conformance/tests/protocols_definition.py +++ b/conformance/tests/protocols_definition.py @@ -114,7 +114,7 @@ class Concrete2_Bad4: v2_bad1: Template2 = Concrete2_Bad1() # E v2_bad2: Template2 = Concrete2_Bad2() # E v2_bad3: Template2 = Concrete2_Bad3() # E -v2_bad4: Template2 = Concrete2_Bad4() # E +v2_bad4: Template2 = Concrete2_Bad4() # E?: Explicit ClassVar matching is unspecified class Template3(Protocol): @@ -339,3 +339,32 @@ class Concrete6_Bad3: v6_bad1: Template6 = Concrete6_Bad1() # E v6_bad2: Template6 = Concrete6_Bad2() # E: named tuple is immutable v6_bad3: Template6 = Concrete6_Bad3() # E: dataclass is frozen + + +# The specification leaves two possible interpretations of a ClassVar protocol +# member. One interpretation requires the implementing attribute to be explicitly +# declared with ClassVar. The other interpretation imposes only structural +# requirements: the attribute must be readable and writable on the class object +# and readable on instances of the class. Both interpretations therefore require +# the following assignments to be rejected. + + +class Template7(Protocol): + val1: ClassVar[int] + + +class Concrete7_Bad1: + def __init__(self) -> None: + self.val1: int = 42 + + +class Concrete7Meta(type): + val1: int = 42 + + +class Concrete7_Bad2(metaclass=Concrete7Meta): + pass + + +v7_bad1: Template7 = Concrete7_Bad1() # E: val1 is not readable on the class object +v7_bad2: Template7 = Concrete7_Bad2() # E: val1 is not readable on instances From dcffbae91ed8b7e26fdf35803133eaf85d836160 Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Fri, 14 Aug 2026 06:49:03 -0700 Subject: [PATCH 282/308] Remove class-object assertion from defaults test (#2343) --- .../mypy/generics_defaults_referential.toml | 22 ++++++++--------- .../generics_defaults_referential.toml | 24 +++++++++---------- .../generics_defaults_referential.toml | 14 +++++------ .../generics_defaults_referential.toml | 14 +++++------ .../ty/generics_defaults_referential.toml | 14 +++++------ .../zuban/generics_defaults_referential.toml | 14 +++++------ .../tests/generics_defaults_referential.py | 1 - 7 files changed, 49 insertions(+), 54 deletions(-) diff --git a/conformance/results/mypy/generics_defaults_referential.toml b/conformance/results/mypy/generics_defaults_referential.toml index 6bedb442a..111df437e 100644 --- a/conformance/results/mypy/generics_defaults_referential.toml +++ b/conformance/results/mypy/generics_defaults_referential.toml @@ -3,20 +3,18 @@ notes = """ Does not correctly handle defaults referencing other `TypeVar`s. """ output = """ -generics_defaults_referential.py:23: error: Expression is of type "type[slice[StartT, StopT, StepT]]", not "type[slice[int, int, int | None]]" [assert-type] -generics_defaults_referential.py:38: error: Argument 1 to "Foo" has incompatible type "str"; expected "int" [arg-type] -generics_defaults_referential.py:54: error: Type parameter "Start2T" has a default type that refers to one or more type variables that are out of scope [misc] -generics_defaults_referential.py:61: error: Type variable S1 referenced in the default of S2 is unbound [misc] -generics_defaults_referential.py:75: error: TypeVar default must be one of the constraint types [misc] +generics_defaults_referential.py:37: error: Argument 1 to "Foo" has incompatible type "str"; expected "int" [arg-type] +generics_defaults_referential.py:53: error: Type parameter "Start2T" has a default type that refers to one or more type variables that are out of scope [misc] +generics_defaults_referential.py:60: error: Type variable S1 referenced in the default of S2 is unbound [misc] +generics_defaults_referential.py:74: error: TypeVar default must be one of the constraint types [misc] +generics_defaults_referential.py:77: error: TypeVar default must be one of the constraint types [misc] generics_defaults_referential.py:78: error: TypeVar default must be one of the constraint types [misc] -generics_defaults_referential.py:79: error: TypeVar default must be one of the constraint types [misc] -generics_defaults_referential.py:104: error: Expression is of type "Bar[int, list[Never]]", not "Bar[int, list[int]]" [assert-type] +generics_defaults_referential.py:103: error: Expression is of type "Bar[int, list[Never]]", not "Bar[int, list[int]]" [assert-type] """ conformance_automated = "Fail" errors_diff = """ -Line 37: Expected 1 errors -Line 69: Expected 1 errors -Line 23: Unexpected errors ['generics_defaults_referential.py:23: error: Expression is of type "type[slice[StartT, StopT, StepT]]", not "type[slice[int, int, int | None]]" [assert-type]'] -Line 78: Unexpected errors ['generics_defaults_referential.py:78: error: TypeVar default must be one of the constraint types [misc]'] -Line 104: Unexpected errors ['generics_defaults_referential.py:104: error: Expression is of type "Bar[int, list[Never]]", not "Bar[int, list[int]]" [assert-type]'] +Line 36: Expected 1 errors +Line 68: Expected 1 errors +Line 77: Unexpected errors ['generics_defaults_referential.py:77: error: TypeVar default must be one of the constraint types [misc]'] +Line 103: Unexpected errors ['generics_defaults_referential.py:103: error: Expression is of type "Bar[int, list[Never]]", not "Bar[int, list[int]]" [assert-type]'] """ diff --git a/conformance/results/pycroscope/generics_defaults_referential.toml b/conformance/results/pycroscope/generics_defaults_referential.toml index bd7f61cec..9bde8f604 100644 --- a/conformance/results/pycroscope/generics_defaults_referential.toml +++ b/conformance/results/pycroscope/generics_defaults_referential.toml @@ -4,19 +4,17 @@ Fails to apply default specializations in some cases. """ conformance_automated = "Fail" errors_diff = """ -Line 23: Unexpected errors ["./generics_defaults_referential.py:23:12: type 'generics_defaults_referential.slice' is not equivalent to type[generics_defaults_referential.slice[int, int, int | None]]"] -Line 98: Unexpected errors ['./generics_defaults_referential.py:98:16: ~Z1@generics_defaults_referential.Bar is not equivalent to Any[explicit]'] -Line 99: Unexpected errors ['./generics_defaults_referential.py:99:16: ~ListDefaultT@generics_defaults_referential.Bar is not equivalent to list[Any[explicit]]'] +Line 97: Unexpected errors ['./generics_defaults_referential.py:97:16: ~Z1@generics_defaults_referential.Bar is not equivalent to Any[explicit]'] +Line 98: Unexpected errors ['./generics_defaults_referential.py:98:16: ~ListDefaultT@generics_defaults_referential.Bar is not equivalent to list[Any[explicit]]'] """ output = """ -./generics_defaults_referential.py:23:12: type 'generics_defaults_referential.slice' is not equivalent to type[generics_defaults_referential.slice[int, int, int | None]] -./generics_defaults_referential.py:37:16: Incompatible argument type for b: expected int but got str [incompatible_argument] -./generics_defaults_referential.py:38:13: Incompatible argument type for a: expected int but got str [incompatible_argument] -./generics_defaults_referential.py:54:0: Type parameter defaults can reference only earlier type parameters from the same class [invalid_type_parameter] -./generics_defaults_referential.py:61:4: Type parameter defaults can reference only earlier type parameters from the same class [invalid_type_parameter] -./generics_defaults_referential.py:69:39: TypeVar default must be assignable to its bound [incompatible_call] -./generics_defaults_referential.py:75:51: TypeVar default must be one of its constraints [incompatible_call] -./generics_defaults_referential.py:79:62: TypeVar default must be one of its constraints [incompatible_call] -./generics_defaults_referential.py:98:16: ~Z1@generics_defaults_referential.Bar is not equivalent to Any[explicit] -./generics_defaults_referential.py:99:16: ~ListDefaultT@generics_defaults_referential.Bar is not equivalent to list[Any[explicit]] +./generics_defaults_referential.py:36:16: Incompatible argument type for b: expected int but got str [incompatible_argument] +./generics_defaults_referential.py:37:13: Incompatible argument type for a: expected int but got str [incompatible_argument] +./generics_defaults_referential.py:53:0: Type parameter defaults can reference only earlier type parameters from the same class [invalid_type_parameter] +./generics_defaults_referential.py:60:4: Type parameter defaults can reference only earlier type parameters from the same class [invalid_type_parameter] +./generics_defaults_referential.py:68:39: TypeVar default must be assignable to its bound [incompatible_call] +./generics_defaults_referential.py:74:51: TypeVar default must be one of its constraints [incompatible_call] +./generics_defaults_referential.py:78:62: TypeVar default must be one of its constraints [incompatible_call] +./generics_defaults_referential.py:97:16: ~Z1@generics_defaults_referential.Bar is not equivalent to Any[explicit] +./generics_defaults_referential.py:98:16: ~ListDefaultT@generics_defaults_referential.Bar is not equivalent to list[Any[explicit]] """ diff --git a/conformance/results/pyrefly/generics_defaults_referential.toml b/conformance/results/pyrefly/generics_defaults_referential.toml index 138472455..d4c867f4f 100644 --- a/conformance/results/pyrefly/generics_defaults_referential.toml +++ b/conformance/results/pyrefly/generics_defaults_referential.toml @@ -3,11 +3,11 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR generics_defaults_referential.py:37:17-18: Argument `str` is not assignable to parameter `b` with type `int` in function `Foo.__init__` [bad-argument-type] -ERROR generics_defaults_referential.py:38:14-15: Argument `str` is not assignable to parameter `a` with type `int` in function `Foo.__init__` [bad-argument-type] -ERROR generics_defaults_referential.py:54:7-13: Default of type parameter `Start2T` refers to out-of-scope type parameter `StopT` [invalid-type-var] -ERROR generics_defaults_referential.py:61:11-15: Default of type parameter `S2` refers to out-of-scope type parameter `S1` [invalid-type-var] -ERROR generics_defaults_referential.py:69:40-42: Expected default `TypeVar[X1]` of `Invalid1` to be assignable to the upper bound of `str` [invalid-type-var] -ERROR generics_defaults_referential.py:75:52-54: Expected default `TypeVar[Y1]` of `Invalid2` to be one of the following constraints: `float`, `str` [invalid-type-var] -ERROR generics_defaults_referential.py:79:63-65: Expected default `TypeVar[Y2]` of `AlsoInvalid2` to be one of the following constraints: `bool`, `complex` [invalid-type-var] +ERROR generics_defaults_referential.py:36:17-18: Argument `str` is not assignable to parameter `b` with type `int` in function `Foo.__init__` [bad-argument-type] +ERROR generics_defaults_referential.py:37:14-15: Argument `str` is not assignable to parameter `a` with type `int` in function `Foo.__init__` [bad-argument-type] +ERROR generics_defaults_referential.py:53:7-13: Default of type parameter `Start2T` refers to out-of-scope type parameter `StopT` [invalid-type-var] +ERROR generics_defaults_referential.py:60:11-15: Default of type parameter `S2` refers to out-of-scope type parameter `S1` [invalid-type-var] +ERROR generics_defaults_referential.py:68:40-42: Expected default `TypeVar[X1]` of `Invalid1` to be assignable to the upper bound of `str` [invalid-type-var] +ERROR generics_defaults_referential.py:74:52-54: Expected default `TypeVar[Y1]` of `Invalid2` to be one of the following constraints: `float`, `str` [invalid-type-var] +ERROR generics_defaults_referential.py:78:63-65: Expected default `TypeVar[Y2]` of `AlsoInvalid2` to be one of the following constraints: `bool`, `complex` [invalid-type-var] """ diff --git a/conformance/results/pyright/generics_defaults_referential.toml b/conformance/results/pyright/generics_defaults_referential.toml index f05169557..d8e21ca89 100644 --- a/conformance/results/pyright/generics_defaults_referential.toml +++ b/conformance/results/pyright/generics_defaults_referential.toml @@ -1,16 +1,16 @@ conformant = "Pass" output = """ -generics_defaults_referential.py:37:17 - error: Argument of type "str" cannot be assigned to parameter "b" of type "int" in function "__init__" +generics_defaults_referential.py:36:17 - error: Argument of type "str" cannot be assigned to parameter "b" of type "int" in function "__init__"   "str" is not assignable to "int" (reportArgumentType) -generics_defaults_referential.py:38:14 - error: Argument of type "str" cannot be assigned to parameter "a" of type "int" in function "__init__" +generics_defaults_referential.py:37:14 - error: Argument of type "str" cannot be assigned to parameter "a" of type "int" in function "__init__"   "str" is not assignable to "int" (reportArgumentType) -generics_defaults_referential.py:54:7 - error: Type parameter "Start2T" has a default type that refers to one or more type variables that are out of scope +generics_defaults_referential.py:53:7 - error: Type parameter "Start2T" has a default type that refers to one or more type variables that are out of scope   Type variable "StopT" is not in scope (reportGeneralTypeIssues) -generics_defaults_referential.py:61:11 - error: Type parameter "S2" has a default type that refers to one or more type variables that are out of scope +generics_defaults_referential.py:60:11 - error: Type parameter "S2" has a default type that refers to one or more type variables that are out of scope   Type variable "S1" is not in scope (reportGeneralTypeIssues) -generics_defaults_referential.py:69:40 - error: TypeVar default type must be a subtype of the bound type (reportGeneralTypeIssues) -generics_defaults_referential.py:75:52 - error: TypeVar default type must be one of the constrained types (reportGeneralTypeIssues) -generics_defaults_referential.py:79:63 - error: TypeVar default type must be one of the constrained types (reportGeneralTypeIssues) +generics_defaults_referential.py:68:40 - error: TypeVar default type must be a subtype of the bound type (reportGeneralTypeIssues) +generics_defaults_referential.py:74:52 - error: TypeVar default type must be one of the constrained types (reportGeneralTypeIssues) +generics_defaults_referential.py:78:63 - error: TypeVar default type must be one of the constrained types (reportGeneralTypeIssues) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/ty/generics_defaults_referential.toml b/conformance/results/ty/generics_defaults_referential.toml index 7df90ae84..69e9ba4cd 100644 --- a/conformance/results/ty/generics_defaults_referential.toml +++ b/conformance/results/ty/generics_defaults_referential.toml @@ -2,11 +2,11 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -generics_defaults_referential.py:37:17: error[invalid-argument-type] Argument to `Foo.__init__` is incorrect: Expected `int`, found `str` -generics_defaults_referential.py:38:14: error[invalid-argument-type] Argument to `Foo.__init__` is incorrect: Expected `int`, found `str` -generics_defaults_referential.py:54:7: error[invalid-generic-class] Default of `Start2T` cannot reference out-of-scope type variable `StopT` -generics_defaults_referential.py:61:11: error[invalid-generic-class] Default of `S2` cannot reference out-of-scope type variable `S1` -generics_defaults_referential.py:69:40: error[invalid-type-variable-default] Default `X1` of TypeVar `Invalid1` is not assignable to upper bound `str` of `Invalid1` because its upper bound `int` is not assignable to `str` -generics_defaults_referential.py:75:52: error[invalid-type-variable-default] TypeVar default is inconsistent with the TypeVar's constraints: Bounded TypeVar cannot be used as the default for a constrained TypeVar -generics_defaults_referential.py:79:63: error[invalid-type-variable-default] Default `Y2` of TypeVar `AlsoInvalid2` is inconsistent with its constraints `AlsoInvalid2` because constraint `int` of `Y2` is not one of the constraints of `AlsoInvalid2` +generics_defaults_referential.py:36:17: error[invalid-argument-type] Argument to `Foo.__init__` is incorrect: Expected `int`, found `str` +generics_defaults_referential.py:37:14: error[invalid-argument-type] Argument to `Foo.__init__` is incorrect: Expected `int`, found `str` +generics_defaults_referential.py:53:7: error[invalid-generic-class] Default of `Start2T` cannot reference out-of-scope type variable `StopT` +generics_defaults_referential.py:60:11: error[invalid-generic-class] Default of `S2` cannot reference out-of-scope type variable `S1` +generics_defaults_referential.py:68:40: error[invalid-type-variable-default] Default `X1` of TypeVar `Invalid1` is not assignable to upper bound `str` of `Invalid1` because its upper bound `int` is not assignable to `str` +generics_defaults_referential.py:74:52: error[invalid-type-variable-default] TypeVar default is inconsistent with the TypeVar's constraints: Bounded TypeVar cannot be used as the default for a constrained TypeVar +generics_defaults_referential.py:78:63: error[invalid-type-variable-default] Default `Y2` of TypeVar `AlsoInvalid2` is inconsistent with its constraints `AlsoInvalid2` because constraint `int` of `Y2` is not one of the constraints of `AlsoInvalid2` """ diff --git a/conformance/results/zuban/generics_defaults_referential.toml b/conformance/results/zuban/generics_defaults_referential.toml index 097f66531..874e32116 100644 --- a/conformance/results/zuban/generics_defaults_referential.toml +++ b/conformance/results/zuban/generics_defaults_referential.toml @@ -2,11 +2,11 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -generics_defaults_referential.py:37: error: Argument 2 to "Foo" has incompatible type "str"; expected "int" [arg-type] -generics_defaults_referential.py:38: error: Argument 1 to "Foo" has incompatible type "str"; expected "int" [arg-type] -generics_defaults_referential.py:54: error: Type parameter "Start2T" has a default type that refers to one or more type variables that are out of scope [misc] -generics_defaults_referential.py:61: error: Type parameter "S2" has a default type that refers to one or more type variables that are out of scope [misc] -generics_defaults_referential.py:69: error: TypeVar default must be a subtype of the bound type [misc] -generics_defaults_referential.py:75: error: TypeVar default must be one of the constraint types [misc] -generics_defaults_referential.py:79: error: TypeVar default must be one of the constraint types [misc] +generics_defaults_referential.py:36: error: Argument 2 to "Foo" has incompatible type "str"; expected "int" [arg-type] +generics_defaults_referential.py:37: error: Argument 1 to "Foo" has incompatible type "str"; expected "int" [arg-type] +generics_defaults_referential.py:53: error: Type parameter "Start2T" has a default type that refers to one or more type variables that are out of scope [misc] +generics_defaults_referential.py:60: error: Type parameter "S2" has a default type that refers to one or more type variables that are out of scope [misc] +generics_defaults_referential.py:68: error: TypeVar default must be a subtype of the bound type [misc] +generics_defaults_referential.py:74: error: TypeVar default must be one of the constraint types [misc] +generics_defaults_referential.py:78: error: TypeVar default must be one of the constraint types [misc] """ diff --git a/conformance/tests/generics_defaults_referential.py b/conformance/tests/generics_defaults_referential.py index 30c0281f6..ee2d9594f 100644 --- a/conformance/tests/generics_defaults_referential.py +++ b/conformance/tests/generics_defaults_referential.py @@ -20,7 +20,6 @@ class slice(Generic[StartT, StopT, StepT]): ... -assert_type(slice, type[slice[int, int, int | None]]) assert_type(slice(), slice[int, int, int | None]) assert_type(slice[str](), slice[str, str, int | None]) assert_type(slice[str, bool, complex](), slice[str, bool, complex]) From b41e5096bc9b1333355911614648616f7cfbf943 Mon Sep 17 00:00:00 2001 From: Eric Traut Date: Wed, 19 Aug 2026 02:09:40 -0700 Subject: [PATCH 283/308] Do not require an error for a generic class attribute (#2008) Modified `generics_type_erasure.py` test to not require an error when accessing a generic attribute on a class when a subtype could provide specialization for that generic attribute. --------- Co-authored-by: Jelle Zijlstra --- conformance/results/mypy/generics_type_erasure.toml | 2 -- conformance/results/results.html | 1 - conformance/results/ty/generics_type_erasure.toml | 1 - conformance/tests/generics_type_erasure.py | 2 +- docs/spec/generics.rst | 1 - 5 files changed, 1 insertion(+), 6 deletions(-) diff --git a/conformance/results/mypy/generics_type_erasure.toml b/conformance/results/mypy/generics_type_erasure.toml index dd13b4464..a37b9c98a 100644 --- a/conformance/results/mypy/generics_type_erasure.toml +++ b/conformance/results/mypy/generics_type_erasure.toml @@ -1,7 +1,6 @@ conformant = "Partial" notes = """ Infers `Node[Never]` instead of `Node[Any]` when argument is not provided. -False negative on instance attribute access on `type(node)`. """ output = """ generics_type_erasure.py:19: error: Expression is of type "Node[Never]", not "Node[Any]" [assert-type] @@ -15,7 +14,6 @@ generics_type_erasure.py:45: error: Access to generic instance variables via cla """ conformance_automated = "Fail" errors_diff = """ -Line 46: Expected 1 errors Line 19: Unexpected errors ['generics_type_erasure.py:19: error: Expression is of type "Node[Never]", not "Node[Any]" [assert-type]'] Line 22: Unexpected errors ['generics_type_erasure.py:22: error: Expression is of type "Never", not "Any" [assert-type]'] """ diff --git a/conformance/results/results.html b/conformance/results/results.html index 7c89516d1..f0438d584 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -809,7 +809,6 @@

    Python Type System Conformance Test Results

    Partial
    • Infers Node[Never] instead of Node[Any] when argument is not provided.
    • -
    • False negative on instance attribute access on type(node).
    diff --git a/conformance/results/ty/generics_type_erasure.toml b/conformance/results/ty/generics_type_erasure.toml index 0d180a391..0348dcfd2 100644 --- a/conformance/results/ty/generics_type_erasure.toml +++ b/conformance/results/ty/generics_type_erasure.toml @@ -8,7 +8,6 @@ Line 42: Expected 1 errors Line 43: Expected 1 errors Line 44: Expected 1 errors Line 45: Expected 1 errors -Line 46: Expected 1 errors """ output = """ generics_type_erasure.py:38:16: error[invalid-argument-type] Argument to `Node.__init__` is incorrect: Expected `int | None`, found `Literal[""]` diff --git a/conformance/tests/generics_type_erasure.py b/conformance/tests/generics_type_erasure.py index c7462259a..b78f29249 100644 --- a/conformance/tests/generics_type_erasure.py +++ b/conformance/tests/generics_type_erasure.py @@ -43,7 +43,7 @@ def __init__(self, label: T | None = None) -> None: Node[int].label # E Node.label = 1 # E Node.label # E -type(n1).label # E +type(n1).label # E? assert_type(n1.label, int) assert_type(Node[int]().label, int) n1.label = 1 # OK diff --git a/docs/spec/generics.rst b/docs/spec/generics.rst index 3735a5806..1bb6df6e5 100644 --- a/docs/spec/generics.rst +++ b/docs/spec/generics.rst @@ -400,7 +400,6 @@ class instance that does not have an instance attribute with the same name:: Node[int].x # Error Node.x = 1 # Error Node.x # Error - type(p).x # Error p.x # Ok (evaluates to int) Node[int]().x # Ok (evaluates to int) p.x = 1 # Ok, but assigning to instance attribute From 44f42629df028aebb783917a393172e4234ad2e7 Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Mon, 24 Aug 2026 03:23:12 -0400 Subject: [PATCH 284/308] Update ty results for v0.0.74 (#2346) --- conformance/results/results.html | 33 +++++----------- .../results/ty/callables_protocol.toml | 8 ++-- conformance/results/ty/dataclasses_slots.toml | 12 ++---- .../ty/exceptions_context_managers.toml | 7 +--- .../ty/generics_typevartuple_args.toml | 26 ++++--------- .../ty/generics_typevartuple_callable.toml | 8 +--- conformance/results/ty/version.toml | 2 +- conformance/uv.lock | 38 +++++++++---------- 8 files changed, 47 insertions(+), 87 deletions(-) diff --git a/conformance/results/results.html b/conformance/results/results.html index f0438d584..1afd3d46e 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -268,7 +268,7 @@

    Python Type System Conformance Test Results

    - + @@ -838,12 +838,7 @@

    Python Type System Conformance Test Results

  • Does not correctly solve TypeVarTuple with heterogeneous bounds.
  • - + @@ -876,12 +871,7 @@

    Python Type System Conformance Test Results

    - + @@ -997,7 +987,7 @@

    Python Type System Conformance Test Results

    - + @@ -1851,7 +1841,7 @@

    Python Type System Conformance Test Results

    - + @@ -1860,7 +1850,7 @@

    Python Type System Conformance Test Results

    - + @@ -1997,12 +1987,7 @@

    Python Type System Conformance Test Results

    - + @@ -2086,7 +2071,7 @@

    Python Type System Conformance Test Results

    - + @@ -2735,7 +2720,7 @@

    Python Type System Conformance Test Results

    - + diff --git a/conformance/results/ty/callables_protocol.toml b/conformance/results/ty/callables_protocol.toml index 23b8e9cf3..cab2ecce2 100644 --- a/conformance/results/ty/callables_protocol.toml +++ b/conformance/results/ty/callables_protocol.toml @@ -2,21 +2,21 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -callables_protocol.py:35:7: error[invalid-assignment] Object of type `def cb1_bad1(*vals: bytes, *, max_items: int | None) -> list[bytes]` is not assignable to `Proto1` +callables_protocol.py:35:7: error[invalid-assignment] Object of type `def cb1_bad1(*vals: bytes, max_items: int | None) -> list[bytes]` is not assignable to `Proto1` callables_protocol.py:36:7: error[invalid-assignment] Object of type `def cb1_bad2(*vals: bytes) -> list[bytes]` is not assignable to `Proto1` -callables_protocol.py:37:7: error[invalid-assignment] Object of type `def cb1_bad3(*vals: bytes, *, max_len: str | None) -> list[bytes]` is not assignable to `Proto1` +callables_protocol.py:37:7: error[invalid-assignment] Object of type `def cb1_bad3(*vals: bytes, max_len: str | None) -> list[bytes]` is not assignable to `Proto1` callables_protocol.py:67:7: error[invalid-assignment] Object of type `def cb2_bad1(*a: bytes) -> Unknown` is not assignable to `Proto2` callables_protocol.py:68:7: error[invalid-assignment] Object of type `def cb2_bad2(*a: str, **b: str) -> Unknown` is not assignable to `Proto2` callables_protocol.py:69:7: error[invalid-assignment] Object of type `def cb2_bad3(*a: bytes, **b: bytes) -> Unknown` is not assignable to `Proto2` callables_protocol.py:70:7: error[invalid-assignment] Object of type `def cb2_bad4(**b: str) -> Unknown` is not assignable to `Proto2` callables_protocol.py:97:16: error[invalid-assignment] Object of type `def cb4_bad1(x: int) -> None` is not assignable to `Proto4` -callables_protocol.py:121:18: error[invalid-assignment] Object of type `def cb6_bad1(*vals: bytes, *, max_len: int | None = None) -> list[bytes]` is not assignable to `NotProto6` +callables_protocol.py:121:18: error[invalid-assignment] Object of type `def cb6_bad1(*vals: bytes, max_len: int | None = None) -> list[bytes]` is not assignable to `NotProto6` callables_protocol.py:169:7: error[invalid-assignment] Object of type `def cb8_bad1(x: int) -> Any` is not assignable to `Proto8` callables_protocol.py:186:5: error[invalid-assignment] Object of type `Literal["str"]` is not assignable to attribute `other_attribute` of type `int` callables_protocol.py:187:5: error[unresolved-attribute] Unresolved attribute `xxx` on type `Proto9[P@decorator1, R@decorator1]` callables_protocol.py:197:7: error[unresolved-attribute] Object of type `Proto9[(x: int), str]` has no attribute `other_attribute2` callables_protocol.py:238:8: error[invalid-assignment] Object of type `def cb11_bad1(x: int, y: str, /) -> Any` is not assignable to `Proto11` -callables_protocol.py:260:8: error[invalid-assignment] Object of type `def cb12_bad1(*args: Any, *, kwarg0: Any) -> None` is not assignable to `Proto12` +callables_protocol.py:260:8: error[invalid-assignment] Object of type `def cb12_bad1(*args: Any, kwarg0: Any) -> None` is not assignable to `Proto12` callables_protocol.py:284:27: error[invalid-assignment] Object of type `def cb13_no_default(path: str) -> str` is not assignable to `Proto13_Default` callables_protocol.py:311:27: error[invalid-assignment] Object of type `def cb14_no_default(*, path: str) -> str` is not assignable to `Proto14_Default` """ diff --git a/conformance/results/ty/dataclasses_slots.toml b/conformance/results/ty/dataclasses_slots.toml index 818e9cd48..916d88e0e 100644 --- a/conformance/results/ty/dataclasses_slots.toml +++ b/conformance/results/ty/dataclasses_slots.toml @@ -1,14 +1,10 @@ -conformance_automated = "Fail" -conformant = "Partial" -notes = """ -Synthesizes a `__slots__` attribute but does not validate attribute assignments against `__slots__`. -""" +conformance_automated = "Pass" errors_diff = """ -Line 25: Expected 1 errors -Line 38: Expected 1 errors -Lines 10, 11: Expected error (tag 'DC1') """ output = """ +dataclasses_slots.py:11:7: error[invalid-dataclass] Dataclass `DC1` cannot combine `slots=True` with manually assigned `__slots__` +dataclasses_slots.py:25:9: error[unresolved-attribute] Unresolved attribute `y` on type `Self@__init__` +dataclasses_slots.py:38:9: error[unresolved-attribute] Unresolved attribute `y` on type `Self@__init__` dataclasses_slots.py:66:1: error[unresolved-attribute] Class `DC6` has no attribute `__slots__` dataclasses_slots.py:69:1: error[unresolved-attribute] Object of type `DC6` has no attribute `__slots__` """ diff --git a/conformance/results/ty/exceptions_context_managers.toml b/conformance/results/ty/exceptions_context_managers.toml index 8ba800645..cdd4d0cd9 100644 --- a/conformance/results/ty/exceptions_context_managers.toml +++ b/conformance/results/ty/exceptions_context_managers.toml @@ -1,10 +1,5 @@ -conformance_automated = "Fail" -conformant = "Unsupported" +conformance_automated = "Pass" errors_diff = """ -Line 50: Unexpected errors ['exceptions_context_managers.py:50:5: error[type-assertion-failure] Type `str` does not match asserted type `int | str`'] -Line 57: Unexpected errors ['exceptions_context_managers.py:57:5: error[type-assertion-failure] Type `str` does not match asserted type `int | str`'] """ output = """ -exceptions_context_managers.py:50:5: error[type-assertion-failure] Type `str` does not match asserted type `int | str` -exceptions_context_managers.py:57:5: error[type-assertion-failure] Type `str` does not match asserted type `int | str` """ diff --git a/conformance/results/ty/generics_typevartuple_args.toml b/conformance/results/ty/generics_typevartuple_args.toml index 79dbf1299..1ed98ead3 100644 --- a/conformance/results/ty/generics_typevartuple_args.toml +++ b/conformance/results/ty/generics_typevartuple_args.toml @@ -1,23 +1,13 @@ -conformance_automated = "Fail" -conformant = "Partial" -notes = """ -Only partially supports `TypeVarTuple` in `*args` annotations. -""" +conformance_automated = "Pass" errors_diff = """ -Line 33: Expected 1 errors -Line 34: Expected 1 errors -Line 48: Expected 1 errors -Line 57: Expected 1 errors -Line 58: Expected 1 errors -Line 59: Expected 1 errors -Line 67: Expected 1 errors -Line 29: Unexpected errors ['generics_typevartuple_args.py:29:5: error[type-assertion-failure] Type `tuple[Unknown, ...]` does not match asserted type `tuple[int, str]`'] -Line 31: Unexpected errors ['generics_typevartuple_args.py:31:5: error[type-assertion-failure] Type `tuple[Unknown, ...]` does not match asserted type `tuple[()]`'] -Line 32: Unexpected errors ['generics_typevartuple_args.py:32:5: error[type-assertion-failure] Type `tuple[Unknown, ...]` does not match asserted type `tuple[int, str]`'] """ output = """ -generics_typevartuple_args.py:29:5: error[type-assertion-failure] Type `tuple[Unknown, ...]` does not match asserted type `tuple[int, str]` -generics_typevartuple_args.py:31:5: error[type-assertion-failure] Type `tuple[Unknown, ...]` does not match asserted type `tuple[()]` -generics_typevartuple_args.py:32:5: error[type-assertion-failure] Type `tuple[Unknown, ...]` does not match asserted type `tuple[int, str]` +generics_typevartuple_args.py:33:20: error[invalid-argument-type] Argument to function `exec_le` is incorrect: Expected `Env`, found `Literal[""]` +generics_typevartuple_args.py:34:20: error[invalid-argument-type] Argument to function `exec_le` is incorrect: Expected `Env`, found `Literal[""]` +generics_typevartuple_args.py:48:10: error[invalid-argument-type] Argument to function `func1` is incorrect: Expected `int`, found `Literal["2"]` +generics_typevartuple_args.py:57:10: error[invalid-argument-type] Argument to function `func2` is incorrect: Expected `str`, found `Literal[1]` +generics_typevartuple_args.py:58:1: error[missing-argument] No argument provided for required parameter `*args` of function `func2` +generics_typevartuple_args.py:59:1: error[missing-argument] No argument provided for required parameter `*args` of function `func2` +generics_typevartuple_args.py:67:1: error[missing-argument] No argument provided for required parameter `*args` of function `func3` generics_typevartuple_args.py:75:13: error[invalid-argument-type] Argument to function `func4` is incorrect: Expected `tuple[Literal[0]]`, found `tuple[Literal[1], Literal[2]]` """ diff --git a/conformance/results/ty/generics_typevartuple_callable.toml b/conformance/results/ty/generics_typevartuple_callable.toml index c1b0b28e7..f133063e7 100644 --- a/conformance/results/ty/generics_typevartuple_callable.toml +++ b/conformance/results/ty/generics_typevartuple_callable.toml @@ -1,12 +1,6 @@ -conformance_automated = "Fail" -conformant = "Partial" -notes = """ -Does not correctly infer a `TypeVarTuple` that appears between fixed leading and trailing parameters in `*args`. -""" +conformance_automated = "Pass" errors_diff = """ -Line 50: Unexpected errors ['generics_typevartuple_callable.py:50:5: error[type-assertion-failure] Type `tuple[Unknown, *tuple[Unknown, ...]]` does not match asserted type `tuple[complex, str, float]`'] """ output = """ generics_typevartuple_callable.py:26:9: error[invalid-argument-type] Argument to `Process.__init__` is incorrect: Expected `(int | Literal[""], str | Literal[0], /) -> None`, found `def func1(arg1: int, arg2: str) -> None` -generics_typevartuple_callable.py:50:5: error[type-assertion-failure] Type `tuple[Unknown, *tuple[Unknown, ...]]` does not match asserted type `tuple[complex, str, float]` """ diff --git a/conformance/results/ty/version.toml b/conformance/results/ty/version.toml index 6932c70c5..56a7045d9 100644 --- a/conformance/results/ty/version.toml +++ b/conformance/results/ty/version.toml @@ -1 +1 @@ -version = "ty 0.0.70" +version = "ty 0.0.74" diff --git a/conformance/uv.lock b/conformance/uv.lock index 2ff42f9be..5da6097af 100644 --- a/conformance/uv.lock +++ b/conformance/uv.lock @@ -202,27 +202,27 @@ wheels = [ [[package]] name = "ty" -version = "0.0.70" +version = "0.0.74" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/58/ed/38a8ab52f1d7c3ed701442a31b23ba774cbc5d6909f2c00da9e1f3c590f9/ty-0.0.70.tar.gz", hash = "sha256:a01bebc128b4081c16002965d906fccb21323d69bb709b9108c1f2406bcffced", size = 6601156, upload-time = "2026-08-10T23:20:26.268Z" } +sdist = { url = "https://files.pythonhosted.org/packages/88/0f/c767853e88567a2ec7e996dd95e3105b1bc62c95d103689311ef0f4a603c/ty-0.0.74.tar.gz", hash = "sha256:da14344fc8625fc9ff359bafb856ad575636ea86d9bb6a629b146bff27b380e6", size = 6786318, upload-time = "2026-08-22T15:05:54.054Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/3d/c5/ddd6cc5657fd3da85591b264f4dabb1ce5e5b535e73fd5174991c294978b/ty-0.0.70-py3-none-linux_armv6l.whl", hash = "sha256:4fb2d2e55e2160c07152361be2e1a26fdd4f6261055731317d5972daf1749935", size = 12537215, upload-time = "2026-08-10T23:19:43.512Z" }, - { url = "https://files.pythonhosted.org/packages/8b/8a/acc9b34331cde81e0d63cda92d4db9e4042def5b1efa7d47431ff1d30d17/ty-0.0.70-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:9b04d4c21cb029501c05598ca21e9c0829c0b2e35a7ceba1e5b78014c1e8104d", size = 12149070, upload-time = "2026-08-10T23:19:46.369Z" }, - { url = "https://files.pythonhosted.org/packages/fd/cd/51ac2708f4d077058a0bfeefa40d630883c5ec7a82fd2c15c86519140235/ty-0.0.70-py3-none-macosx_11_0_arm64.whl", hash = "sha256:c605ebf2643f5e64ec4bcb269640a1aa85966d29fa888fb746039c28570369b2", size = 11625729, upload-time = "2026-08-10T23:19:48.535Z" }, - { url = "https://files.pythonhosted.org/packages/b7/99/afc4fe7e630100dc782ff0cdc8c59c01acfb05299551ff0ef49c93814320/ty-0.0.70-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0c38ea76e12909c29e18fcd295ff223b63f3701c1d1c34db2cdc9736340b9de2", size = 12204810, upload-time = "2026-08-10T23:19:51.845Z" }, - { url = "https://files.pythonhosted.org/packages/ca/38/8cabc3c8ad4c3a02e585ecff12a71ff8e5881f8a00ee71745fd765201da5/ty-0.0.70-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:c1ee6bf4edaabf7bd0307f0c0f9ddc2204df0390820fe89f6a9de65f07722aba", size = 12308114, upload-time = "2026-08-10T23:19:54.229Z" }, - { url = "https://files.pythonhosted.org/packages/44/7e/bb4e552ecd68bb490bae9368ef323e3d0c79ef85a811857139a2d0f59ddb/ty-0.0.70-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:5eef3e11d7d6b800ef66da0cce8ea24f8be804d1ebf359683426cfe848729bf8", size = 13072240, upload-time = "2026-08-10T23:19:56.872Z" }, - { url = "https://files.pythonhosted.org/packages/f6/c4/1861e1d554e5b6e0d11b3a9f36d40c372253f44a3c4e56ad4bf840f2801e/ty-0.0.70-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a95e4ae7c2599197c9d89652e49ca344ab224f7d12376e6ad8beb0587e8ff83f", size = 13497678, upload-time = "2026-08-10T23:19:59.191Z" }, - { url = "https://files.pythonhosted.org/packages/77/22/3b22442133e8f641485e59e463a070a31184db0d6456851f871db8f59763/ty-0.0.70-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:06aca758d1e0016c0a1f57fe9d8de7a21ff83f692306f747a0d97f32de24e27f", size = 13232510, upload-time = "2026-08-10T23:20:01.456Z" }, - { url = "https://files.pythonhosted.org/packages/84/b8/911f1e6885b5485b6e1d29aaab19ce5e6deeb3e931b6ad82296da4f22051/ty-0.0.70-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d81825524f1b57ecbcb5fce7d61fb159cb4837a6167a4569309c9fa7fc15a77d", size = 12817128, upload-time = "2026-08-10T23:20:04.275Z" }, - { url = "https://files.pythonhosted.org/packages/e6/a6/9affc3ca11c32d75b348a66144ab83335fa7fa7100b1581356725e15a668/ty-0.0.70-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:3287dfb09f7320ef28f114f5f9aae5f697b7b1a6ee37fb2a4a3be94481c1b4f8", size = 13089208, upload-time = "2026-08-10T23:20:06.574Z" }, - { url = "https://files.pythonhosted.org/packages/f0/cb/4776108ea08ec4013b71375b101be9c8a632967cd10f24abbdd4664d66f4/ty-0.0.70-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:9fb1877f6401cdaac4db46c5bf762f327482ba5f891420ea462ebd15d0de4185", size = 12148890, upload-time = "2026-08-10T23:20:08.827Z" }, - { url = "https://files.pythonhosted.org/packages/c9/d9/814e71f698d9231ef6412bd2c1499d81c6f86f66c2764e952c991e2d6da5/ty-0.0.70-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:e78f4997dbb0db2d2270210eb3694466206e5b3a11985e24148770e702158a25", size = 12327084, upload-time = "2026-08-10T23:20:11.023Z" }, - { url = "https://files.pythonhosted.org/packages/3b/69/9f34bba534c5d1ace391d300ead4f1971f4348c5459e66dc466cfd60661c/ty-0.0.70-py3-none-musllinux_1_2_i686.whl", hash = "sha256:cf758d3b2dad910c9b1d22d2d62fea894b5bc9acd3c00365e8a73ace6090a452", size = 12604372, upload-time = "2026-08-10T23:20:13.366Z" }, - { url = "https://files.pythonhosted.org/packages/fe/ff/abb34674517b29a8e2489a39c4e01930fcf6aab993a7d6b33aa97f119117/ty-0.0.70-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:0d338761617279a4fb6a83e7fad7e21126394637b8c45e13e196b2bb675f39b2", size = 12917800, upload-time = "2026-08-10T23:20:15.841Z" }, - { url = "https://files.pythonhosted.org/packages/a4/1a/f8289572f4fad5cb16c883b94638548166bc78cf3eb569f0cd9199eb10a0/ty-0.0.70-py3-none-win32.whl", hash = "sha256:a45642cf09dde91f0a3ce9b9e6fffda9779ff69d73f7347c18acf4fb45007c07", size = 11921482, upload-time = "2026-08-10T23:20:18.244Z" }, - { url = "https://files.pythonhosted.org/packages/17/ae/8739d7618b4670c3ee4f52d641d53be87928bd121d8bda9c0e3450500b75/ty-0.0.70-py3-none-win_amd64.whl", hash = "sha256:33e7941a926cf39b82553911a59a6ed68ec98c3d3d5a415df633f4d1cd051e6c", size = 12986994, upload-time = "2026-08-10T23:20:20.53Z" }, - { url = "https://files.pythonhosted.org/packages/f1/44/2bc3301ba4356ad8866daac9f8cfb3687953e52d076ea204f113b9304c42/ty-0.0.70-py3-none-win_arm64.whl", hash = "sha256:0d380f735d52b1d4b773193f8f5c58c065725eab1ebb0008d38a7b830de14f47", size = 12301082, upload-time = "2026-08-10T23:20:23.816Z" }, + { url = "https://files.pythonhosted.org/packages/2c/95/6ded58bc97885c6d88fa1f9cd815031489200738f961cbf0466663213f80/ty-0.0.74-py3-none-linux_armv6l.whl", hash = "sha256:8969ef4e508debf00cf58f9ea85a539f799b1732c59cdfcecd037630b9755b30", size = 12790043, upload-time = "2026-08-22T15:05:05.015Z" }, + { url = "https://files.pythonhosted.org/packages/d9/8a/5e323603b6ab8731144421877ee8a0f8ac5a5511e67857127caa09f6730e/ty-0.0.74-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:51fb6cf5b98e1e1140825b2430943f78d744876a735231656eafbb4c3f7eca3c", size = 12371748, upload-time = "2026-08-22T15:05:08.609Z" }, + { url = "https://files.pythonhosted.org/packages/d0/44/ee72e08cb705281e8d8c42917dd577aa598a8a098008495fda5176ee3f6e/ty-0.0.74-py3-none-macosx_11_0_arm64.whl", hash = "sha256:8ebe60b1f0a948c793d6c77fc9e9ddda599e4f023c04ab16e8e03bcb428c3fa0", size = 12282403, upload-time = "2026-08-22T15:05:11.448Z" }, + { url = "https://files.pythonhosted.org/packages/da/b3/fd935b694ff68bc278af50f7ad04770b36ce6306399baef7e1847b553a9d/ty-0.0.74-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:aa97f407a695c890a53615966a663c7d2167e2cabe88db7ca1a24d62635cdfc8", size = 12345164, upload-time = "2026-08-22T15:05:14.19Z" }, + { url = "https://files.pythonhosted.org/packages/54/5c/5b5825268e029ebb164c909780103dbbae367f069801410068bf1cef29b3/ty-0.0.74-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:673ddb733d4a0db31385ba1ed9ff1f6bd9dc5565413ce57b1ca5ac4c7803da5d", size = 12556646, upload-time = "2026-08-22T15:05:16.994Z" }, + { url = "https://files.pythonhosted.org/packages/56/e7/515914e571d62ce0101744fed3f881936eeb1b30dc37beb72b4f7ca1e289/ty-0.0.74-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1028e7c6b4f6145e9704552f43a5fffdcd51b42263ffdcd9c9677762bc395a4a", size = 13311653, upload-time = "2026-08-22T15:05:20.254Z" }, + { url = "https://files.pythonhosted.org/packages/b0/07/d1452babb6f9266c2122cabc095180b70ed306fb770b2996753814d2237d/ty-0.0.74-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:79841a8890493021fb308772474983316eb91f7b56cb227a6a05a06b262a36f0", size = 13768284, upload-time = "2026-08-22T15:05:23.197Z" }, + { url = "https://files.pythonhosted.org/packages/b1/60/8d4a2fc7842a47210a1cb0a16a187d9de39ad5d509a00fb74c1c073afcde/ty-0.0.74-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:94859d321f3c6a6c8f7bfc3f40e8319cda7e6e012e613440f3dfd145d5010e2e", size = 13422306, upload-time = "2026-08-22T15:05:26.248Z" }, + { url = "https://files.pythonhosted.org/packages/de/76/ebbc269a8c4efcc4d44624993bd188145f20d60ebda9680b15aaec42cc50/ty-0.0.74-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:970a8b2c09ff3be04c8a1c6767332d861be4fce85efe7bb205e4ade7c8655274", size = 12970637, upload-time = "2026-08-22T15:05:29.15Z" }, + { url = "https://files.pythonhosted.org/packages/9e/dd/b99f7236acbf856780ca1779a48143d2d9f2c24d7f531a0ce15a022b8a87/ty-0.0.74-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:795f763b3ded85574c2c2846a6fb8acf2aa76e9e83d761143e92b1f0c7ffa2cd", size = 13344891, upload-time = "2026-08-22T15:05:32.033Z" }, + { url = "https://files.pythonhosted.org/packages/0b/d7/9ff7449a4c7e6428f2c6f298e74cf24b70668f29d45c249507a723ff3782/ty-0.0.74-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:dc086db5367d912c31c0cc872deb7387290e779a4b9b54fcb944673a7cd52c7b", size = 12395272, upload-time = "2026-08-22T15:05:34.702Z" }, + { url = "https://files.pythonhosted.org/packages/b1/dd/b23a5b6b35d37df89dc8dc5daa09efd9245a668b50c4c81c25de21567dc1/ty-0.0.74-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:0314d7b391cf684e47c2fa093d2ce4c597cfc9b01d9a315fe204aed6359b271b", size = 12573079, upload-time = "2026-08-22T15:05:37.683Z" }, + { url = "https://files.pythonhosted.org/packages/23/c5/ccba16239d6129533c8b3603458d0f4dd2ba69478e47059073968e74261d/ty-0.0.74-py3-none-musllinux_1_2_i686.whl", hash = "sha256:c4a45dd2e991e8bdae82ba78c8cd051b253f60bc71a6536598fa3ef580b4fc9b", size = 12832506, upload-time = "2026-08-22T15:05:40.505Z" }, + { url = "https://files.pythonhosted.org/packages/6d/1c/2390912634dff4f341f97b397f2aee341ff062be0a66cda37d59375454f2/ty-0.0.74-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:210e2eac6b018fb934e2b8dac3956a0ba076a3fb1fa6f135058c825e5b759b81", size = 13154752, upload-time = "2026-08-22T15:05:43.355Z" }, + { url = "https://files.pythonhosted.org/packages/c4/33/a8c12188227e6f74f91853a7374e01ed81d6ad21c16c8b70e92dbebfe46a/ty-0.0.74-py3-none-win32.whl", hash = "sha256:db0bb6a8f098ef9bd1be861f73b4f7c0320d40d4c05c7ae0a8677d4e7aa4f6e5", size = 12130002, upload-time = "2026-08-22T15:05:46.058Z" }, + { url = "https://files.pythonhosted.org/packages/21/5c/064f28ccb9c234cfce5a2f7aa69a256663d5ae5bb0290b3a9706cc4d1e4c/ty-0.0.74-py3-none-win_amd64.whl", hash = "sha256:bebff181515255b3c78bd2e7693ae66fab6064ad4feea2065c68bc01022aa678", size = 12771435, upload-time = "2026-08-22T15:05:48.811Z" }, + { url = "https://files.pythonhosted.org/packages/fe/06/d6becdaca0315346c26b6df97cb0eafa81de4f870945d6989e88704374ed/ty-0.0.74-py3-none-win_arm64.whl", hash = "sha256:1a3469eaaf8c85b1c0a15bede25d36daea4b09fce1d913e965b24e24b3f1d6c6", size = 12558299, upload-time = "2026-08-22T15:05:51.543Z" }, ] [[package]] From 30921de7f3ed02b9bd5ceed2b64b62dddca18ca3 Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Wed, 26 Aug 2026 00:42:33 +0000 Subject: [PATCH 285/308] Upgrade Zuban to 0.9.2 (#2347) --- conformance/results/results.html | 54 +++++-------------- .../results/zuban/callables_subtyping.toml | 14 +++-- .../results/zuban/classes_override.toml | 15 +++--- .../results/zuban/constructors_call_init.toml | 2 +- .../results/zuban/enums_expansion.toml | 10 +--- .../generics_mixed_variance_inference.toml | 8 +-- .../zuban/generics_paramspec_variance.toml | 44 +++++---------- .../zuban/generics_typevartuple_variance.toml | 44 +++------------ .../zuban/generics_variance_inference.toml | 11 +--- .../results/zuban/protocols_variance.toml | 8 +-- .../results/zuban/typeddicts_extra_items.toml | 2 +- conformance/results/zuban/version.toml | 2 +- conformance/uv.lock | 26 ++++----- 13 files changed, 68 insertions(+), 172 deletions(-) diff --git a/conformance/results/results.html b/conformance/results/results.html index 1afd3d46e..1aa44316d 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -269,7 +269,7 @@

    Python Type System Conformance Test Results

    - + @@ -617,12 +617,7 @@

    Python Type System Conformance Test Results

    - + @@ -677,7 +672,7 @@

    Python Type System Conformance Test Results

  • Does not error when a ParamSpec is used in a position that violates its explicit variance.
  • - + @@ -928,7 +923,7 @@

    Python Type System Conformance Test Results

  • Does not error when a TypeVarTuple is used in a position that violates its explicit variance.
  • - + @@ -972,14 +967,7 @@

    Python Type System Conformance Test Results

    - + @@ -988,7 +976,7 @@

    Python Type System Conformance Test Results

    - + @@ -1116,13 +1104,7 @@

    Python Type System Conformance Test Results

  • the incompatible constructor overrides in ChildC2 are not flagged.
  • - + @@ -1131,7 +1113,7 @@

    Python Type System Conformance Test Results

    - + @@ -1520,12 +1502,7 @@

    Python Type System Conformance Test Results

    - + @@ -1534,7 +1511,7 @@

    Python Type System Conformance Test Results

    - + @@ -2418,12 +2395,7 @@

    Python Type System Conformance Test Results

    - + @@ -2485,7 +2457,7 @@

    Python Type System Conformance Test Results

    - + @@ -2721,7 +2693,7 @@

    Python Type System Conformance Test Results

    - +
     
    mypy 1.15.0
    -
    1.6sec
    +
    1.2sec
    pyright 1.1.398
    -
    1.3sec
    +
    1.5sec
    pyre 0.9.23
    -
    6.4sec
    +
    6.9sec
    pytype 2024.10.11
    -
    32.7sec
    +
    35.9sec
    diff --git a/conformance/tests/generics_defaults.py b/conformance/tests/generics_defaults.py index 0857b9291..af347b102 100644 --- a/conformance/tests/generics_defaults.py +++ b/conformance/tests/generics_defaults.py @@ -100,15 +100,15 @@ class Class_TypeVarTuple(Generic[*DefaultTs]): ... # > subtype of ``bound``. If not, the type checker should generate an # > error. -TypeVar("Ok", bound=float, default=int) # OK -TypeVar("Invalid", bound=str, default=int) # E: the bound and default are incompatible +Ok1 = TypeVar("Ok1", bound=float, default=int) # OK +Invalid1 = TypeVar("Invalid1", bound=str, default=int) # E: the bound and default are incompatible # > For constrained ``TypeVar``\ s, the default needs to be one of the # > constraints. A type checker should generate an error even if it is a # > subtype of one of the constraints. -TypeVar("Ok", float, str, default=float) # OK -TypeVar("Invalid", float, str, default=int) # E: expected one of float or str got int +Ok2 = TypeVar("Ok2", float, str, default=float) # OK +Invalid2 = TypeVar("Invalid2", float, str, default=int) # E: expected one of float or str got int # > In generic functions, type checkers may use a type parameter's default when the diff --git a/conformance/tests/generics_defaults_referential.py b/conformance/tests/generics_defaults_referential.py index 34b236007..a033d9c5c 100644 --- a/conformance/tests/generics_defaults_referential.py +++ b/conformance/tests/generics_defaults_referential.py @@ -63,19 +63,19 @@ class Bar2(Generic[S2]): ... # E # > ``T1``'s bound must be a subtype of ``T2``'s bound. X1 = TypeVar("X1", bound=int) -TypeVar("Ok1", default=X1, bound=float) # OK -TypeVar("AlsoOk1", default=X1, bound=int) # OK -TypeVar("Invalid1", default=X1, bound=str) # E: int is not a subtype of str +Ok1 = TypeVar("Ok1", default=X1, bound=float) # OK +AlsoOk1 = TypeVar("AlsoOk1", default=X1, bound=int) # OK +Invalid1 = TypeVar("Invalid1", default=X1, bound=str) # E: int is not a subtype of str # > The constraints of ``T2`` must be a superset of the constraints of ``T1``. Y1 = TypeVar("Y1", bound=int) -TypeVar("Invalid2", float, str, default=Y1) # E: upper bound int is incompatible with constraints float or str +Invalid2 = TypeVar("Invalid2", float, str, default=Y1) # E: upper bound int is incompatible with constraints float or str Y2 = TypeVar("Y2", int, str) -TypeVar("AlsoOk2", int, str, bool, default=Y2) # OK -TypeVar("AlsoInvalid2", bool, complex, default=Y2) # E: {bool, complex} is not a superset of {int, str} +AlsoOk2 = TypeVar("AlsoOk2", int, str, bool, default=Y2) # OK +AlsoInvalid2 = TypeVar("AlsoInvalid2", bool, complex, default=Y2) # E: {bool, complex} is not a superset of {int, str} # > Type parameters are valid as parameters to generics inside of a From 75a5e9dd7cdde589da6e0c214ca5621e70e4c14e Mon Sep 17 00:00:00 2001 From: Victorien <65306057+Viicos@users.noreply.github.com> Date: Wed, 9 Apr 2025 20:00:22 +0200 Subject: [PATCH 091/308] Allow bare `typing.ClassVar` qualifiers (#1931) * Allow bare `typing.ClassVar` qualifiers * Feedback, add conformance test * Feedback --- .../results/mypy/classes_classvar.toml | 29 +++++++-------- conformance/results/mypy/version.toml | 2 +- .../results/pyre/classes_classvar.toml | 24 ++++++------- conformance/results/pyre/version.toml | 2 +- .../results/pyright/classes_classvar.toml | 16 ++++----- conformance/results/pyright/version.toml | 2 +- .../results/pytype/classes_classvar.toml | 35 ++++++++++--------- conformance/results/pytype/version.toml | 2 +- conformance/results/results.html | 8 ++--- conformance/tests/classes_classvar.py | 10 ++++-- docs/spec/annotations.rst | 2 +- docs/spec/class-compat.rst | 29 ++++++++++++--- 12 files changed, 92 insertions(+), 69 deletions(-) diff --git a/conformance/results/mypy/classes_classvar.toml b/conformance/results/mypy/classes_classvar.toml index 82c4756ba..0d9662ecf 100644 --- a/conformance/results/mypy/classes_classvar.toml +++ b/conformance/results/mypy/classes_classvar.toml @@ -4,7 +4,6 @@ Internal error if TypeVarTuple is used in ClassVar. Does not reject use of ParamSpec in ClassVar. Rejects ClassVar nested in Annotated. Does not reject use of ClassVar in TypeAlias definition. -Does not infer type of ClassVar from assignment if no type is provided. """ output = """ classes_classvar.py:38: error: ClassVar[...] must have at most one type argument [valid-type] @@ -15,24 +14,22 @@ classes_classvar.py:46: error: ClassVar cannot contain type variables [misc] classes_classvar.py:52: error: Incompatible types in assignment (expression has type "dict[Never, Never]", variable has type "list[str]") [assignment] classes_classvar.py:54: error: Variable should not be annotated with both ClassVar and Final [misc] classes_classvar.py:55: error: Invalid type: ClassVar nested inside other type [valid-type] -classes_classvar.py:61: error: Invalid type: ClassVar nested inside other type [valid-type] -classes_classvar.py:63: error: ClassVar can only be used for assignments in class body [misc] -classes_classvar.py:64: error: ClassVar can only be used for assignments in class body [misc] -classes_classvar.py:65: error: ClassVar can only be used for assignments in class body [misc] -classes_classvar.py:67: error: ClassVar can only be used for assignments in class body [misc] +classes_classvar.py:67: error: Invalid type: ClassVar nested inside other type [valid-type] +classes_classvar.py:69: error: ClassVar can only be used for assignments in class body [misc] +classes_classvar.py:70: error: ClassVar can only be used for assignments in class body [misc] classes_classvar.py:71: error: ClassVar can only be used for assignments in class body [misc] -classes_classvar.py:78: error: Expression is of type "Any", not "float" [assert-type] -classes_classvar.py:105: error: Cannot assign to class variable "stats" via instance [misc] -classes_classvar.py:134: error: Incompatible types in assignment (expression has type "ProtoAImpl", variable has type "ProtoA") [assignment] -classes_classvar.py:134: note: "ProtoAImpl" is missing following "ProtoA" protocol member: -classes_classvar.py:134: note: z -classes_classvar.py:134: note: Protocol member ProtoA.x expected class variable, got instance variable -classes_classvar.py:134: note: Protocol member ProtoA.y expected class variable, got instance variable +classes_classvar.py:73: error: ClassVar can only be used for assignments in class body [misc] +classes_classvar.py:77: error: ClassVar can only be used for assignments in class body [misc] +classes_classvar.py:111: error: Cannot assign to class variable "stats" via instance [misc] +classes_classvar.py:140: error: Incompatible types in assignment (expression has type "ProtoAImpl", variable has type "ProtoA") [assignment] +classes_classvar.py:140: note: "ProtoAImpl" is missing following "ProtoA" protocol member: +classes_classvar.py:140: note: z +classes_classvar.py:140: note: Protocol member ProtoA.x expected class variable, got instance variable +classes_classvar.py:140: note: Protocol member ProtoA.y expected class variable, got instance variable """ conformance_automated = "Fail" errors_diff = """ Line 47: Expected 1 errors -Line 72: Expected 1 errors -Line 61: Unexpected errors ['classes_classvar.py:61: error: Invalid type: ClassVar nested inside other type [valid-type]'] -Line 78: Unexpected errors ['classes_classvar.py:78: error: Expression is of type "Any", not "float" [assert-type]'] +Line 78: Expected 1 errors +Line 67: Unexpected errors ['classes_classvar.py:67: error: Invalid type: ClassVar nested inside other type [valid-type]'] """ diff --git a/conformance/results/mypy/version.toml b/conformance/results/mypy/version.toml index 167122da3..6bd36c63e 100644 --- a/conformance/results/mypy/version.toml +++ b/conformance/results/mypy/version.toml @@ -1,2 +1,2 @@ version = "mypy 1.15.0" -test_duration = 1.2 +test_duration = 2.1 diff --git a/conformance/results/pyre/classes_classvar.toml b/conformance/results/pyre/classes_classvar.toml index a44ae1aa9..77c9e7265 100644 --- a/conformance/results/pyre/classes_classvar.toml +++ b/conformance/results/pyre/classes_classvar.toml @@ -15,11 +15,11 @@ classes_classvar.py:38:10 Invalid type parameters [24]: Generic type `CV` expect classes_classvar.py:39:10 Invalid type [31]: Expression `typing.ClassVar[3]` is not a valid type. classes_classvar.py:40:13 Unbound name [10]: Name `var` is used but not defined in the current scope. classes_classvar.py:52:4 Incompatible attribute type [8]: Attribute `bad8` declared in class `ClassA` has type `List[str]` but is used as type `Dict[Variable[_KT], Variable[_VT]]`. -classes_classvar.py:65:8 Undefined attribute [16]: `ClassA` has no attribute `xx`. -classes_classvar.py:68:8 Incompatible return type [7]: Expected `CV[int]` but got `int`. -classes_classvar.py:78:0 Assert type [70]: Expected `float` but got `typing.Any`. -classes_classvar.py:105:0 Invalid assignment [41]: Assigning to class variable through instance, did you mean to assign to `Starship.stats` instead? -classes_classvar.py:134:0 Incompatible variable type [9]: a is declared to have type `ProtoA` but is used as type `ProtoAImpl`. +classes_classvar.py:66:4 Uninitialized attribute [13]: Attribute `good5` is declared in class `ClassA` to have type `typing.Any` but is never initialized. +classes_classvar.py:71:8 Undefined attribute [16]: `ClassA` has no attribute `xx`. +classes_classvar.py:74:8 Incompatible return type [7]: Expected `CV[int]` but got `int`. +classes_classvar.py:111:0 Invalid assignment [41]: Assigning to class variable through instance, did you mean to assign to `Starship.stats` instead? +classes_classvar.py:140:0 Incompatible variable type [9]: a is declared to have type `ProtoA` but is used as type `ProtoAImpl`. """ conformance_automated = "Fail" errors_diff = """ @@ -28,11 +28,11 @@ Line 46: Expected 1 errors Line 47: Expected 1 errors Line 54: Expected 1 errors Line 55: Expected 1 errors -Line 63: Expected 1 errors -Line 64: Expected 1 errors -Line 67: Expected 1 errors -Line 71: Expected 1 errors -Line 72: Expected 1 errors -Line 68: Unexpected errors ['classes_classvar.py:68:8 Incompatible return type [7]: Expected `CV[int]` but got `int`.'] -Line 78: Unexpected errors ['classes_classvar.py:78:0 Assert type [70]: Expected `float` but got `typing.Any`.'] +Line 69: Expected 1 errors +Line 70: Expected 1 errors +Line 73: Expected 1 errors +Line 77: Expected 1 errors +Line 78: Expected 1 errors +Line 66: Unexpected errors ['classes_classvar.py:66:4 Uninitialized attribute [13]: Attribute `good5` is declared in class `ClassA` to have type `typing.Any` but is never initialized.'] +Line 74: Unexpected errors ['classes_classvar.py:74:8 Incompatible return type [7]: Expected `CV[int]` but got `int`.'] """ diff --git a/conformance/results/pyre/version.toml b/conformance/results/pyre/version.toml index e49054cf3..c60d20445 100644 --- a/conformance/results/pyre/version.toml +++ b/conformance/results/pyre/version.toml @@ -1,2 +1,2 @@ version = "pyre 0.9.23" -test_duration = 6.9 +test_duration = 3.9 diff --git a/conformance/results/pyright/classes_classvar.toml b/conformance/results/pyright/classes_classvar.toml index 42c7a249c..1b03b11a3 100644 --- a/conformance/results/pyright/classes_classvar.toml +++ b/conformance/results/pyright/classes_classvar.toml @@ -9,15 +9,15 @@ classes_classvar.py:47:20 - error: "ClassVar" type cannot include type variables classes_classvar.py:52:33 - error: Type "dict[Any, Any]" is not assignable to declared type "list[str]" (reportAssignmentType) classes_classvar.py:54:17 - error: "ClassVar" is not allowed in this context (reportInvalidTypeForm) classes_classvar.py:55:17 - error: "ClassVar" is not allowed in this context (reportInvalidTypeForm) -classes_classvar.py:63:26 - error: "ClassVar" is not allowed in this context (reportInvalidTypeForm) -classes_classvar.py:64:12 - error: "ClassVar" is not allowed in this context (reportInvalidTypeForm) -classes_classvar.py:65:18 - error: "ClassVar" is not allowed in this context (reportInvalidTypeForm) -classes_classvar.py:67:26 - error: "ClassVar" is not allowed in this context (reportInvalidTypeForm) -classes_classvar.py:71:8 - error: "ClassVar" is not allowed in this context (reportInvalidTypeForm) -classes_classvar.py:72:20 - error: "ClassVar" is not allowed in this context (reportInvalidTypeForm) -classes_classvar.py:105:14 - error: Cannot assign to attribute "stats" for class "Starship" +classes_classvar.py:69:26 - error: "ClassVar" is not allowed in this context (reportInvalidTypeForm) +classes_classvar.py:70:12 - error: "ClassVar" is not allowed in this context (reportInvalidTypeForm) +classes_classvar.py:71:18 - error: "ClassVar" is not allowed in this context (reportInvalidTypeForm) +classes_classvar.py:73:26 - error: "ClassVar" is not allowed in this context (reportInvalidTypeForm) +classes_classvar.py:77:8 - error: "ClassVar" is not allowed in this context (reportInvalidTypeForm) +classes_classvar.py:78:20 - error: "ClassVar" is not allowed in this context (reportInvalidTypeForm) +classes_classvar.py:111:14 - error: Cannot assign to attribute "stats" for class "Starship"   Attribute "stats" cannot be assigned through a class instance because it is a ClassVar (reportAttributeAccessIssue) -classes_classvar.py:134:13 - error: Type "ProtoAImpl" is not assignable to declared type "ProtoA" +classes_classvar.py:140:13 - error: Type "ProtoAImpl" is not assignable to declared type "ProtoA"   "ProtoAImpl" is incompatible with protocol "ProtoA"     "x" is defined as a ClassVar in protocol     "y" is defined as a ClassVar in protocol (reportAssignmentType) diff --git a/conformance/results/pyright/version.toml b/conformance/results/pyright/version.toml index d046005bd..8fb908adb 100644 --- a/conformance/results/pyright/version.toml +++ b/conformance/results/pyright/version.toml @@ -1,2 +1,2 @@ version = "pyright 1.1.398" -test_duration = 1.5 +test_duration = 2.3 diff --git a/conformance/results/pytype/classes_classvar.toml b/conformance/results/pytype/classes_classvar.toml index d042ebf8d..3c88e5ef8 100644 --- a/conformance/results/pytype/classes_classvar.toml +++ b/conformance/results/pytype/classes_classvar.toml @@ -4,6 +4,7 @@ Does not reject use of TypeVar in ClassVar. Does not reject use of ParamSpec in ClassVar. Does not reject use of ClassVar as a generic type argument. Rejects initialization of ClassVar if no type argument is provided. +Does not infer ClassVar with no type argument and no assigned value as Any. Does not reject use of ClassVar in parameter type annotation. Does not reject use of ClassVar in local variable annotation. Does not reject use of ClassVar in instance variable annotation. @@ -85,27 +86,27 @@ classes_classvar.py:52:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassA bad8: ClassVar[list[str]] = {} # E: type violation in initialization \u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m -classes_classvar.py:60:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassA: Type annotation for good4 does not match type of assignment [annotation-type-mismatch] +classes_classvar.py:63:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassA: Type annotation for good4 does not match type of assignment [annotation-type-mismatch] good4: ClassVar = 3.1 \u001b[1m\u001b[31m~~~~~\u001b[39m\u001b[0m -classes_classvar.py:68:16: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method2: bad return type [bad-return-type] +classes_classvar.py:74:16: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method2: bad return type [bad-return-type] return 3 \u001b[1m\u001b[31m~\u001b[39m\u001b[0m -classes_classvar.py:78:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : ClassVar [assert-type] +classes_classvar.py:84:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : ClassVar [assert-type] -assert_type(ClassA.good4, float) -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +assert_type(ClassA.good5, Any) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -classes_classvar.py:124:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ProtoA: Type annotation for z does not match type of assignment [annotation-type-mismatch] +classes_classvar.py:130:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ProtoA: Type annotation for z does not match type of assignment [annotation-type-mismatch] z: CV = [""] \u001b[1m\u001b[31m~\u001b[39m\u001b[0m -classes_classvar.py:134:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for a does not match type of assignment [annotation-type-mismatch] +classes_classvar.py:140:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for a does not match type of assignment [annotation-type-mismatch] a: ProtoA = ProtoAImpl() # E: y is not a ClassVar \u001b[1m\u001b[31m~\u001b[39m\u001b[0m @@ -118,17 +119,17 @@ Line 46: Expected 1 errors Line 47: Expected 1 errors Line 54: Expected 1 errors Line 55: Expected 1 errors -Line 63: Expected 1 errors -Line 64: Expected 1 errors -Line 65: Expected 1 errors -Line 67: Expected 1 errors +Line 69: Expected 1 errors +Line 70: Expected 1 errors Line 71: Expected 1 errors -Line 72: Expected 1 errors -Line 105: Expected 1 errors +Line 73: Expected 1 errors +Line 77: Expected 1 errors +Line 78: Expected 1 errors +Line 111: Expected 1 errors Line 7: Unexpected errors ['classes_classvar.py:7:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet]'] Line 29: Unexpected errors ['classes_classvar.py:29:6: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] -Line 60: Unexpected errors ['classes_classvar.py:60:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in ClassA: Type annotation for good4 does not match type of assignment [annotation-type-mismatch]'] -Line 68: Unexpected errors ['classes_classvar.py:68:16: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method2: bad return type [bad-return-type]'] -Line 78: Unexpected errors ['classes_classvar.py:78:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : ClassVar [assert-type]'] -Line 124: Unexpected errors ['classes_classvar.py:124:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in ProtoA: Type annotation for z does not match type of assignment [annotation-type-mismatch]'] +Line 63: Unexpected errors ['classes_classvar.py:63:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in ClassA: Type annotation for good4 does not match type of assignment [annotation-type-mismatch]'] +Line 74: Unexpected errors ['classes_classvar.py:74:16: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method2: bad return type [bad-return-type]'] +Line 84: Unexpected errors ['classes_classvar.py:84:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : ClassVar [assert-type]'] +Line 130: Unexpected errors ['classes_classvar.py:130:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in ProtoA: Type annotation for z does not match type of assignment [annotation-type-mismatch]'] """ diff --git a/conformance/results/pytype/version.toml b/conformance/results/pytype/version.toml index fde2661b5..cdc0a953f 100644 --- a/conformance/results/pytype/version.toml +++ b/conformance/results/pytype/version.toml @@ -1,2 +1,2 @@ version = "pytype 2024.10.11" -test_duration = 35.9 +test_duration = 43.3 diff --git a/conformance/results/results.html b/conformance/results/results.html index 4348a0e42..d78bd9122 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -159,16 +159,16 @@

    Python Type System Conformance Test Results

    + @@ -1086,7 +1091,7 @@

    Python Type System Conformance Test Results

    - + @@ -2647,7 +2652,7 @@

    Python Type System Conformance Test Results

    - + diff --git a/conformance/results/ty/classes_classvar.toml b/conformance/results/ty/classes_classvar.toml index 1cadf9978..ff909e64b 100644 --- a/conformance/results/ty/classes_classvar.toml +++ b/conformance/results/ty/classes_classvar.toml @@ -2,21 +2,23 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -classes_classvar.py:38:11: error[invalid-type-form] Type qualifier `typing.ClassVar` expected exactly 1 argument, got 2 -classes_classvar.py:39:14: error[invalid-type-form] Int literals are not allowed in this context in a type expression: Did you mean `typing.Literal[3]`? -classes_classvar.py:40:14: error[unresolved-reference] Name `var` used when not defined -classes_classvar.py:45:11: error[invalid-type-form] `ClassVar` cannot contain type variables -classes_classvar.py:46:11: error[invalid-type-form] `ClassVar` cannot contain type variables +classes_classvar.py:40:11: error[invalid-type-form] Type qualifier `typing.ClassVar` expected exactly 1 argument, got 2 +classes_classvar.py:41:14: error[invalid-type-form] Int literals are not allowed in this context in a type expression: Did you mean `typing.Literal[3]`? +classes_classvar.py:42:14: error[unresolved-reference] Name `var` used when not defined classes_classvar.py:47:11: error[invalid-type-form] `ClassVar` cannot contain type variables -classes_classvar.py:52:33: error[invalid-assignment] Object of type `dict[Unknown, Unknown]` is not assignable to `list[str]` -classes_classvar.py:54:11: error[redundant-final-classvar] `Combining `ClassVar` and `Final` is redundant -classes_classvar.py:55:17: error[invalid-type-form] Type qualifier `typing.ClassVar` is not allowed in type expressions (only in annotation expressions) -classes_classvar.py:69:26: error[invalid-type-form] Type qualifier `typing.ClassVar` is not allowed in parameter annotations -classes_classvar.py:70:12: error[invalid-type-form] `ClassVar` is only allowed in class bodies -classes_classvar.py:71:18: error[invalid-type-form] `ClassVar` annotations are not allowed for non-name targets -classes_classvar.py:73:26: error[invalid-type-form] Type qualifier `typing.ClassVar` is not allowed in return type annotations -classes_classvar.py:77:8: error[invalid-type-form] `ClassVar` is only allowed in class bodies -classes_classvar.py:78:20: error[invalid-type-form] Type qualifier `typing.ClassVar` is not allowed in type alias values -classes_classvar.py:111:1: error[invalid-attribute-access] Cannot assign to ClassVar `stats` from an instance of type `Starship` -classes_classvar.py:140:13: error[invalid-assignment] Object of type `ProtoAImpl` is not assignable to `ProtoA` +classes_classvar.py:48:11: error[invalid-type-form] `ClassVar` cannot contain type variables +classes_classvar.py:49:11: error[invalid-type-form] `ClassVar` cannot contain type variables +classes_classvar.py:54:33: error[invalid-assignment] Object of type `dict[Unknown, Unknown]` is not assignable to `list[str]` +classes_classvar.py:56:11: error[redundant-final-classvar] `Combining `ClassVar` and `Final` is redundant +classes_classvar.py:57:17: error[invalid-type-form] Type qualifier `typing.ClassVar` is not allowed in type expressions (only in annotation expressions) +classes_classvar.py:71:26: error[invalid-type-form] Type qualifier `typing.ClassVar` is not allowed in parameter annotations +classes_classvar.py:72:12: error[invalid-type-form] `ClassVar` is only allowed in class bodies +classes_classvar.py:73:18: error[invalid-type-form] `ClassVar` annotations are not allowed for non-name targets +classes_classvar.py:75:26: error[invalid-type-form] Type qualifier `typing.ClassVar` is not allowed in return type annotations +classes_classvar.py:79:8: error[invalid-type-form] `ClassVar` is only allowed in class bodies +classes_classvar.py:80:20: error[invalid-type-form] Type qualifier `typing.ClassVar` is not allowed in type alias values +classes_classvar.py:89:8: error[invalid-type-form] `ClassVar` is not allowed in TypedDict fields +classes_classvar.py:94:5: error[invalid-named-tuple] Type qualifier `ClassVar` is not allowed on NamedTuple field `b` +classes_classvar.py:127:1: error[invalid-attribute-access] Cannot assign to ClassVar `stats` from an instance of type `Starship` +classes_classvar.py:156:13: error[invalid-assignment] Object of type `ProtoAImpl` is not assignable to `ProtoA` """ diff --git a/conformance/results/ty/qualifiers_final_annotation.toml b/conformance/results/ty/qualifiers_final_annotation.toml index 10678afda..ba871f898 100644 --- a/conformance/results/ty/qualifiers_final_annotation.toml +++ b/conformance/results/ty/qualifiers_final_annotation.toml @@ -18,16 +18,18 @@ qualifiers_final_annotation.py:107:13: error[redundant-final-classvar] `Combinin qualifiers_final_annotation.py:108:13: error[redundant-final-classvar] `Combining `ClassVar` and `Final` is redundant qualifiers_final_annotation.py:118:9: error[invalid-type-form] Type qualifier `typing.Final` is not allowed in type expressions (only in annotation expressions) qualifiers_final_annotation.py:121:14: error[invalid-type-form] Type qualifier `typing.Final` is not allowed in parameter annotations -qualifiers_final_annotation.py:134:1: error[missing-argument] No arguments provided for required parameters `x`, `y` -qualifiers_final_annotation.py:134:3: error[unknown-argument] Argument `a` does not match any known parameter -qualifiers_final_annotation.py:135:3: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal[""]` -qualifiers_final_annotation.py:135:9: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal[""]` -qualifiers_final_annotation.py:141:5: error[invalid-assignment] Reassignment of `Final` symbol `ID1` is not allowed: Reassignment of `Final` symbol -qualifiers_final_annotation.py:145:5: error[invalid-assignment] Reassignment of `Final` symbol `x` is not allowed: Symbol later reassigned here -qualifiers_final_annotation.py:147:10: error[invalid-assignment] Reassignment of `Final` symbol `x` is not allowed: Symbol later reassigned here -qualifiers_final_annotation.py:149:9: error[invalid-assignment] Reassignment of `Final` symbol `x` is not allowed: Symbol later reassigned here -qualifiers_final_annotation.py:152:30: error[invalid-assignment] Reassignment of `Final` symbol `x` is not allowed: Symbol later reassigned here -qualifiers_final_annotation.py:155:9: error[invalid-assignment] Reassignment of `Final` symbol `x` is not allowed: Symbol later reassigned here -qualifiers_final_annotation.py:166:1: error[invalid-assignment] Reassignment of `Final` symbol `TEN` is not allowed: Reassignment of `Final` symbol -qualifiers_final_annotation.py:170:1: error[invalid-assignment] Reassignment of `Final` symbol `PI` is not allowed: Reassignment of `Final` symbol +qualifiers_final_annotation.py:131:8: error[invalid-type-form] `Final` is not allowed in TypedDict fields +qualifiers_final_annotation.py:136:5: error[invalid-named-tuple] Type qualifier `Final` is not allowed on NamedTuple field `b` +qualifiers_final_annotation.py:148:1: error[missing-argument] No arguments provided for required parameters `x`, `y` +qualifiers_final_annotation.py:148:3: error[unknown-argument] Argument `a` does not match any known parameter +qualifiers_final_annotation.py:149:3: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal[""]` +qualifiers_final_annotation.py:149:9: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal[""]` +qualifiers_final_annotation.py:155:5: error[invalid-assignment] Reassignment of `Final` symbol `ID1` is not allowed: Reassignment of `Final` symbol +qualifiers_final_annotation.py:159:5: error[invalid-assignment] Reassignment of `Final` symbol `x` is not allowed: Symbol later reassigned here +qualifiers_final_annotation.py:161:10: error[invalid-assignment] Reassignment of `Final` symbol `x` is not allowed: Symbol later reassigned here +qualifiers_final_annotation.py:163:9: error[invalid-assignment] Reassignment of `Final` symbol `x` is not allowed: Symbol later reassigned here +qualifiers_final_annotation.py:166:30: error[invalid-assignment] Reassignment of `Final` symbol `x` is not allowed: Symbol later reassigned here +qualifiers_final_annotation.py:169:9: error[invalid-assignment] Reassignment of `Final` symbol `x` is not allowed: Symbol later reassigned here +qualifiers_final_annotation.py:180:1: error[invalid-assignment] Reassignment of `Final` symbol `TEN` is not allowed: Reassignment of `Final` symbol +qualifiers_final_annotation.py:184:1: error[invalid-assignment] Reassignment of `Final` symbol `PI` is not allowed: Reassignment of `Final` symbol """ diff --git a/conformance/results/zuban/classes_classvar.toml b/conformance/results/zuban/classes_classvar.toml index a451ac506..afb724d07 100644 --- a/conformance/results/zuban/classes_classvar.toml +++ b/conformance/results/zuban/classes_classvar.toml @@ -2,26 +2,28 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -classes_classvar.py:38: error: ClassVar[...] must have at most one type argument [misc] -classes_classvar.py:39: error: Invalid type: try using Literal[3] instead? [valid-type] -classes_classvar.py:40: error: Name "var" is not defined [name-defined] -classes_classvar.py:45: error: ClassVar cannot contain type variables [misc] -classes_classvar.py:46: error: ClassVar cannot contain type variables [misc] +classes_classvar.py:40: error: ClassVar[...] must have at most one type argument [misc] +classes_classvar.py:41: error: Invalid type: try using Literal[3] instead? [valid-type] +classes_classvar.py:42: error: Name "var" is not defined [name-defined] classes_classvar.py:47: error: ClassVar cannot contain type variables [misc] -classes_classvar.py:52: error: Incompatible types in assignment (expression has type "dict[Any, Any]", variable has type "list[str]") [assignment] -classes_classvar.py:54: error: Variable should not be annotated with both ClassVar and Final [misc] -classes_classvar.py:55: error: Invalid Type: ClassVar nested inside other type [misc] -classes_classvar.py:66: error: Type in ClassVar[...] can only be omitted if there is an initializer [misc] -classes_classvar.py:69: error: ClassVar can only be used for assignments in class body [misc] -classes_classvar.py:70: error: ClassVar can only be used for assignments in class body [misc] +classes_classvar.py:48: error: ClassVar cannot contain type variables [misc] +classes_classvar.py:49: error: ClassVar cannot contain type variables [misc] +classes_classvar.py:54: error: Incompatible types in assignment (expression has type "dict[Any, Any]", variable has type "list[str]") [assignment] +classes_classvar.py:56: error: Variable should not be annotated with both ClassVar and Final [misc] +classes_classvar.py:57: error: Invalid Type: ClassVar nested inside other type [misc] +classes_classvar.py:68: error: Type in ClassVar[...] can only be omitted if there is an initializer [misc] classes_classvar.py:71: error: ClassVar can only be used for assignments in class body [misc] +classes_classvar.py:72: error: ClassVar can only be used for assignments in class body [misc] classes_classvar.py:73: error: ClassVar can only be used for assignments in class body [misc] -classes_classvar.py:77: error: ClassVar can only be used for assignments in class body [misc] -classes_classvar.py:78: error: ClassVar can only be used for assignments in class body [misc] -classes_classvar.py:111: error: Cannot assign to class variable "stats" via instance [misc] -classes_classvar.py:140: error: Incompatible types in assignment (expression has type "ProtoAImpl", variable has type "ProtoA") [assignment] -classes_classvar.py:140: note: Protocol member ProtoA.x expected class variable, got instance variable -classes_classvar.py:140: note: Protocol member ProtoA.y expected class variable, got instance variable -classes_classvar.py:140: note: "ProtoAImpl" is missing following "ProtoA" protocol member: -classes_classvar.py:140: note: z +classes_classvar.py:75: error: ClassVar can only be used for assignments in class body [misc] +classes_classvar.py:79: error: ClassVar can only be used for assignments in class body [misc] +classes_classvar.py:80: error: ClassVar can only be used for assignments in class body [misc] +classes_classvar.py:89: error: Invalid Type: ClassVar nested inside other type [misc] +classes_classvar.py:94: error: ClassVar can only be used for assignments in class body [misc] +classes_classvar.py:127: error: Cannot assign to class variable "stats" via instance [misc] +classes_classvar.py:156: error: Incompatible types in assignment (expression has type "ProtoAImpl", variable has type "ProtoA") [assignment] +classes_classvar.py:156: note: Protocol member ProtoA.x expected class variable, got instance variable +classes_classvar.py:156: note: Protocol member ProtoA.y expected class variable, got instance variable +classes_classvar.py:156: note: "ProtoAImpl" is missing following "ProtoA" protocol member: +classes_classvar.py:156: note: z """ diff --git a/conformance/results/zuban/qualifiers_final_annotation.toml b/conformance/results/zuban/qualifiers_final_annotation.toml index 32a15ea44..1101ba386 100644 --- a/conformance/results/zuban/qualifiers_final_annotation.toml +++ b/conformance/results/zuban/qualifiers_final_annotation.toml @@ -18,16 +18,18 @@ qualifiers_final_annotation.py:107: error: Final can be only used as an outermos qualifiers_final_annotation.py:108: error: Invalid Type: ClassVar nested inside other type [misc] qualifiers_final_annotation.py:118: error: Final can be only used as an outermost qualifier in a variable annotation [misc] qualifiers_final_annotation.py:121: error: Final can be only used as an outermost qualifier in a variable annotation [misc] -qualifiers_final_annotation.py:134: error: Unexpected keyword argument "a" for "N" [call-arg] -qualifiers_final_annotation.py:135: error: Argument "x" to "N" has incompatible type "str"; expected "int" [arg-type] -qualifiers_final_annotation.py:135: error: Argument "y" to "N" has incompatible type "str"; expected "int" [arg-type] -qualifiers_final_annotation.py:141: error: Cannot assign to final name "ID1" [misc] -qualifiers_final_annotation.py:145: error: Cannot assign to final name "x" [misc] -qualifiers_final_annotation.py:147: error: Cannot assign to final name "x" [misc] -qualifiers_final_annotation.py:149: error: Cannot assign to final name "x" [misc] -qualifiers_final_annotation.py:152: error: Cannot assign to final name "x" [misc] -qualifiers_final_annotation.py:152: error: Incompatible types in assignment (expression has type "TextIOWrapper[_WrappedBuffer]", variable has type "int") [assignment] -qualifiers_final_annotation.py:155: error: Cannot assign to final name "x" [misc] -qualifiers_final_annotation.py:166: error: Cannot assign to final name "TEN" [misc] -qualifiers_final_annotation.py:170: error: Cannot assign to final name "PI" [misc] +qualifiers_final_annotation.py:131: error: Final can be only used as an outermost qualifier in a variable annotation [misc] +qualifiers_final_annotation.py:136: error: Final can be only used as an outermost qualifier in a variable annotation [misc] +qualifiers_final_annotation.py:148: error: Unexpected keyword argument "a" for "N" [call-arg] +qualifiers_final_annotation.py:149: error: Argument "x" to "N" has incompatible type "str"; expected "int" [arg-type] +qualifiers_final_annotation.py:149: error: Argument "y" to "N" has incompatible type "str"; expected "int" [arg-type] +qualifiers_final_annotation.py:155: error: Cannot assign to final name "ID1" [misc] +qualifiers_final_annotation.py:159: error: Cannot assign to final name "x" [misc] +qualifiers_final_annotation.py:161: error: Cannot assign to final name "x" [misc] +qualifiers_final_annotation.py:163: error: Cannot assign to final name "x" [misc] +qualifiers_final_annotation.py:166: error: Cannot assign to final name "x" [misc] +qualifiers_final_annotation.py:166: error: Incompatible types in assignment (expression has type "TextIOWrapper[_WrappedBuffer]", variable has type "int") [assignment] +qualifiers_final_annotation.py:169: error: Cannot assign to final name "x" [misc] +qualifiers_final_annotation.py:180: error: Cannot assign to final name "TEN" [misc] +qualifiers_final_annotation.py:184: error: Cannot assign to final name "PI" [misc] """ diff --git a/conformance/tests/classes_classvar.py b/conformance/tests/classes_classvar.py index 3f94fe5a6..5f0ca9241 100644 --- a/conformance/tests/classes_classvar.py +++ b/conformance/tests/classes_classvar.py @@ -11,11 +11,13 @@ ClassVar, Final, Generic, + NamedTuple, ParamSpec, Protocol, TypeAlias, TypeVar, TypeVarTuple, + TypedDict, assert_type, cast, ) @@ -78,6 +80,20 @@ def method2(self) -> ClassVar[int]: # E: ClassVar not allowed here bad12: TypeAlias = ClassVar[str] # E: ClassVar not allowed here +# > ``ClassVar`` cannot be used as a qualifier for a TypedDict item or a +# > NamedTuple field. Such usage also generates an error at runtime. + + +class TDWithClassVar(TypedDict): + a: int + b: ClassVar[int] # E: ClassVar not allowed in a TypedDict + + +class NTWithClassVar(NamedTuple): + a: int + b: ClassVar[int] # E: ClassVar not allowed in a NamedTuple + + assert_type(ClassA.good1, int) assert_type(ClassA.good2, list[str]) assert_type(ClassA.good3, Any) diff --git a/conformance/tests/qualifiers_final_annotation.py b/conformance/tests/qualifiers_final_annotation.py index 822ea564a..0dc611211 100644 --- a/conformance/tests/qualifiers_final_annotation.py +++ b/conformance/tests/qualifiers_final_annotation.py @@ -2,7 +2,7 @@ Tests the typing.Final special form. """ -from typing import ClassVar, Final, Literal, NamedTuple, assert_type +from typing import ClassVar, Final, Literal, NamedTuple, TypedDict, assert_type # Specification: https://typing.readthedocs.io/en/latest/spec/qualifiers.html#id1 @@ -122,6 +122,20 @@ def func1(x: Final[list[int]]) -> None: # E ... +# > ``Final`` cannot be used as a qualifier for a TypedDict item or a +# > NamedTuple field. Such usage also generates an error at runtime. + + +class TDWithFinal(TypedDict): + a: int + b: Final[int] # E: Final not allowed in a TypedDict + + +class NTWithFinal(NamedTuple): + a: int + b: Final[int] # E: Final not allowed in a NamedTuple + + # > Type checkers should treat uses of a final name that was initialized with # > a literal as if it was replaced by the literal. For example, the following # > should be allowed: From 2b960aab282484d5934f307a50ec3511a3b63d0e Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Wed, 12 Aug 2026 15:27:37 +0100 Subject: [PATCH 279/308] Update ty conformance results for v0.0.70 (#2339) * Update conformance for latest ty * Adjust configuration so ty reports `ambiguous-protocol-member` as an error * Remove obsolete notes from passing ty protocol result --- conformance/results/results.html | 14 +- conformance/results/ty/aliases_implicit.toml | 2 +- .../results/ty/callables_subtyping.toml | 4 +- .../results/ty/constructors_call_init.toml | 2 +- .../results/ty/constructors_call_new.toml | 2 +- .../ty/dataclasses_transform_converter.toml | 2 +- conformance/results/ty/dataclasses_usage.toml | 2 +- conformance/results/ty/generics_defaults.toml | 4 +- .../ty/generics_syntax_infer_variance.toml | 32 +-- .../ty/generics_typevartuple_callable.toml | 4 +- .../ty/generics_variance_inference.toml | 46 ++-- .../results/ty/namedtuples_define_class.toml | 2 +- .../ty/namedtuples_define_functional.toml | 2 +- .../results/ty/protocols_class_objects.toml | 2 +- .../results/ty/protocols_definition.toml | 12 +- conformance/results/ty/protocols_generic.toml | 8 +- .../results/ty/protocols_subtyping.toml | 8 +- .../results/ty/specialtypes_promotions.toml | 2 +- .../results/ty/tuples_type_compat.toml | 6 +- .../results/ty/typeddicts_operations.toml | 2 +- .../ty/typeddicts_readonly_inheritance.toml | 4 +- conformance/results/ty/version.toml | 2 +- conformance/tests/ty.toml | 1 + conformance/uv.lock | 240 +++++++++--------- 24 files changed, 198 insertions(+), 207 deletions(-) diff --git a/conformance/results/results.html b/conformance/results/results.html index 4de25dec5..6f89d20e3 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -268,7 +268,7 @@

    Python Type System Conformance Test Results

    - + @@ -1340,13 +1340,7 @@

    Python Type System Conformance Test Results

    - + @@ -1478,7 +1472,7 @@

    Python Type System Conformance Test Results

    - + @@ -2655,7 +2649,7 @@

    Python Type System Conformance Test Results

    - + diff --git a/conformance/results/ty/aliases_implicit.toml b/conformance/results/ty/aliases_implicit.toml index 53571d439..5cd4682e0 100644 --- a/conformance/results/ty/aliases_implicit.toml +++ b/conformance/results/ty/aliases_implicit.toml @@ -17,7 +17,7 @@ aliases_implicit.py:77:9: error[not-subscriptable] Cannot subscript non-generic aliases_implicit.py:78:29: error[invalid-type-arguments] Too many type arguments: expected 1, got 2 aliases_implicit.py:79:29: error[invalid-type-arguments] Too many type arguments: expected 1, got 2 aliases_implicit.py:80:24: error[invalid-type-arguments] Type argument for `ParamSpec` must be either a list of types, `ParamSpec`, `Concatenate`, or `...` -aliases_implicit.py:81:25: error[invalid-type-arguments] Type `str` is not assignable to upper bound `int | float` of type variable `TFloat@GoodTypeAlias12` +aliases_implicit.py:81:25: error[invalid-type-arguments] Type `str` is not assignable to upper bound `float` of type variable `TFloat@GoodTypeAlias12` aliases_implicit.py:107:9: error[invalid-type-form] Variable of type `list[ | ]` is not allowed in a parameter annotation aliases_implicit.py:108:9: error[invalid-type-form] Variable of type `tuple[tuple[, ]]` is not allowed in a parameter annotation aliases_implicit.py:109:9: error[invalid-type-form] Variable of type `list[]` is not allowed in a parameter annotation diff --git a/conformance/results/ty/callables_subtyping.toml b/conformance/results/ty/callables_subtyping.toml index d6d67269d..b5cf55fac 100644 --- a/conformance/results/ty/callables_subtyping.toml +++ b/conformance/results/ty/callables_subtyping.toml @@ -2,8 +2,8 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -callables_subtyping.py:26:36: error[invalid-assignment] Object of type `(int, /) -> int` is not assignable to `(int | float, /) -> int | float` -callables_subtyping.py:29:32: error[invalid-assignment] Object of type `(int | float, /) -> int | float` is not assignable to `(int, /) -> int` +callables_subtyping.py:26:36: error[invalid-assignment] Object of type `(int, /) -> int` is not assignable to `(float, /) -> float` +callables_subtyping.py:29:32: error[invalid-assignment] Object of type `(float, /) -> float` is not assignable to `(int, /) -> int` callables_subtyping.py:51:21: error[invalid-assignment] Object of type `PosOnly2` is not assignable to `Standard2` callables_subtyping.py:52:21: error[invalid-assignment] Object of type `KwOnly2` is not assignable to `Standard2` callables_subtyping.py:55:20: error[invalid-assignment] Object of type `KwOnly2` is not assignable to `PosOnly2` diff --git a/conformance/results/ty/constructors_call_init.toml b/conformance/results/ty/constructors_call_init.toml index aee79b414..a0284093b 100644 --- a/conformance/results/ty/constructors_call_init.toml +++ b/conformance/results/ty/constructors_call_init.toml @@ -9,7 +9,7 @@ Line 42: Expected 1 errors Line 107: Expected 1 errors """ output = """ -constructors_call_init.py:21:13: error[invalid-argument-type] Argument to `Class1.__init__` is incorrect: Expected `int`, found `float` +constructors_call_init.py:21:13: error[invalid-argument-type] Argument to `Class1.__init__` is incorrect: Expected `int`, found `float*` constructors_call_init.py:56:1: error[invalid-argument-type] Argument to `Class4.__init__` is incorrect: Expected `Class4[int]`, found `Class4[str]` constructors_call_init.py:130:9: error[too-many-positional-arguments] Too many positional arguments to `object.__init__`: expected 1, got 2 """ diff --git a/conformance/results/ty/constructors_call_new.toml b/conformance/results/ty/constructors_call_new.toml index 51da8faed..c3424c736 100644 --- a/conformance/results/ty/constructors_call_new.toml +++ b/conformance/results/ty/constructors_call_new.toml @@ -2,6 +2,6 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -constructors_call_new.py:21:13: error[invalid-argument-type] Argument to constructor `Class1.__new__` is incorrect: Expected `int`, found `float` +constructors_call_new.py:21:13: error[invalid-argument-type] Argument to constructor `Class1.__new__` is incorrect: Expected `int`, found `float*` constructors_call_new.py:148:1: error[invalid-argument-type] Argument to constructor `Class11.__new__` is incorrect: Expected `type[Class11[int]]`, found `` """ diff --git a/conformance/results/ty/dataclasses_transform_converter.toml b/conformance/results/ty/dataclasses_transform_converter.toml index e04d01805..a327291ff 100644 --- a/conformance/results/ty/dataclasses_transform_converter.toml +++ b/conformance/results/ty/dataclasses_transform_converter.toml @@ -6,7 +6,7 @@ dataclasses_transform_converter.py:48:31: error[invalid-argument-type] Argument 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: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: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: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` diff --git a/conformance/results/ty/dataclasses_usage.toml b/conformance/results/ty/dataclasses_usage.toml index 989dd39fa..253fe101d 100644 --- a/conformance/results/ty/dataclasses_usage.toml +++ b/conformance/results/ty/dataclasses_usage.toml @@ -3,7 +3,7 @@ errors_diff = """ """ output = """ dataclasses_usage.py:51:6: error[missing-argument] No argument provided for required parameter `unit_price` -dataclasses_usage.py:52:28: error[invalid-argument-type] Argument is incorrect: Expected `int | float`, found `Literal["price"]` +dataclasses_usage.py:52:28: error[invalid-argument-type] Argument is incorrect: Expected `float`, found `Literal["price"]` dataclasses_usage.py:53:36: error[too-many-positional-arguments] Too many positional arguments: expected 3, got 4 dataclasses_usage.py:62:5: error[dataclass-field-order] Required field `b` cannot be defined after fields with default values dataclasses_usage.py:68:5: error[dataclass-field-order] Required field `b` cannot be defined after fields with default values diff --git a/conformance/results/ty/generics_defaults.toml b/conformance/results/ty/generics_defaults.toml index edcfc62c8..8a265a5d2 100644 --- a/conformance/results/ty/generics_defaults.toml +++ b/conformance/results/ty/generics_defaults.toml @@ -10,7 +10,7 @@ Line 188: Expected 1 errors Line 144: Unexpected errors ['generics_defaults.py:144:61: error[invalid-type-form] `Unpack` can only unpack a tuple type or `TypeVarTuple`'] Line 203: Unexpected errors ['generics_defaults.py:203:28: error[invalid-type-arguments] Type argument for `ParamSpec` must be either a list of types, `ParamSpec`, `Concatenate`, or `...`'] Line 204: Unexpected errors ['generics_defaults.py:204:5: error[type-assertion-failure] Type `tuple[int]` does not match asserted type `tuple[int, str]`'] -Line 205: Unexpected errors ['generics_defaults.py:205:5: error[type-assertion-failure] Type `(...) -> None` does not match asserted type `(int | float, bool, /) -> None`'] +Line 205: Unexpected errors ['generics_defaults.py:205:5: error[type-assertion-failure] Type `(...) -> None` does not match asserted type `(float, bool, /) -> None`'] """ output = """ generics_defaults.py:24:40: error[invalid-generic-class] Type parameter `T` without a default cannot follow earlier parameter `DefaultStrT` with a default @@ -21,5 +21,5 @@ generics_defaults.py:159:52: error[invalid-type-variable-default] TypeVar defaul generics_defaults.py:177:1: error[type-assertion-failure] Type `int` does not match asserted type `Any` generics_defaults.py:203:28: error[invalid-type-arguments] Type argument for `ParamSpec` must be either a list of types, `ParamSpec`, `Concatenate`, or `...` generics_defaults.py:204:5: error[type-assertion-failure] Type `tuple[int]` does not match asserted type `tuple[int, str]` -generics_defaults.py:205:5: error[type-assertion-failure] Type `(...) -> None` does not match asserted type `(int | float, bool, /) -> None` +generics_defaults.py:205:5: error[type-assertion-failure] Type `(...) -> None` does not match asserted type `(float, bool, /) -> None` """ diff --git a/conformance/results/ty/generics_syntax_infer_variance.toml b/conformance/results/ty/generics_syntax_infer_variance.toml index d1af4ea25..6bfde6a3c 100644 --- a/conformance/results/ty/generics_syntax_infer_variance.toml +++ b/conformance/results/ty/generics_syntax_infer_variance.toml @@ -4,20 +4,20 @@ errors_diff = """ output = """ generics_syntax_infer_variance.py:15:6: error[invalid-legacy-type-variable] A `TypeVar` cannot specify variance when `infer_variance=True` generics_syntax_infer_variance.py:17:6: error[invalid-legacy-type-variable] A `TypeVar` cannot specify variance when `infer_variance=True` -generics_syntax_infer_variance.py:29:35: error[invalid-assignment] Object of type `ShouldBeCovariant1[int | float]` is not assignable to `ShouldBeCovariant1[int]` -generics_syntax_infer_variance.py:47:35: error[invalid-assignment] Object of type `ShouldBeCovariant2[int | float]` is not assignable to `ShouldBeCovariant2[int]` -generics_syntax_infer_variance.py:56:35: error[invalid-assignment] Object of type `ShouldBeCovariant3[int | float]` is not assignable to `ShouldBeCovariant3[int]` -generics_syntax_infer_variance.py:85:34: error[invalid-assignment] Object of type `ShouldBeCovariant5[int | float]` is not assignable to `ShouldBeCovariant5[int]` -generics_syntax_infer_variance.py:96:34: error[invalid-assignment] Object of type `ShouldBeCovariant6[int | float]` is not assignable to `ShouldBeCovariant6[int]` -generics_syntax_infer_variance.py:112:38: error[invalid-assignment] Object of type `ShouldBeInvariant1[int]` is not assignable to `ShouldBeInvariant1[int | float]` -generics_syntax_infer_variance.py:113:36: error[invalid-assignment] Object of type `ShouldBeInvariant1[int | float]` is not assignable to `ShouldBeInvariant1[int]` -generics_syntax_infer_variance.py:127:38: error[invalid-assignment] Object of type `ShouldBeInvariant2[int]` is not assignable to `ShouldBeInvariant2[int | float]` -generics_syntax_infer_variance.py:128:36: error[invalid-assignment] Object of type `ShouldBeInvariant2[int | float]` is not assignable to `ShouldBeInvariant2[int]` -generics_syntax_infer_variance.py:135:43: error[invalid-assignment] Object of type `ShouldBeInvariant3[int, str]` is not assignable to `ShouldBeInvariant3[int | float, str]` -generics_syntax_infer_variance.py:136:41: error[invalid-assignment] Object of type `ShouldBeInvariant3[int | float, str]` is not assignable to `ShouldBeInvariant3[int, str]` -generics_syntax_infer_variance.py:137:43: error[invalid-assignment] Object of type `ShouldBeInvariant3[str, int]` is not assignable to `ShouldBeInvariant3[str, int | float]` -generics_syntax_infer_variance.py:138:41: error[invalid-assignment] Object of type `ShouldBeInvariant3[str, int | float]` is not assignable to `ShouldBeInvariant3[str, int]` -generics_syntax_infer_variance.py:146:38: error[invalid-assignment] Object of type `ShouldBeInvariant4[int]` is not assignable to `ShouldBeInvariant4[int | float]` -generics_syntax_infer_variance.py:154:38: error[invalid-assignment] Object of type `ShouldBeInvariant5[int]` is not assignable to `ShouldBeInvariant5[int | float]` -generics_syntax_infer_variance.py:165:45: error[invalid-assignment] Object of type `ShouldBeContravariant1[int]` is not assignable to `ShouldBeContravariant1[int | float]` +generics_syntax_infer_variance.py:29:35: error[invalid-assignment] Object of type `ShouldBeCovariant1[float]` is not assignable to `ShouldBeCovariant1[int]` +generics_syntax_infer_variance.py:47:35: error[invalid-assignment] Object of type `ShouldBeCovariant2[float]` is not assignable to `ShouldBeCovariant2[int]` +generics_syntax_infer_variance.py:56:35: error[invalid-assignment] Object of type `ShouldBeCovariant3[float]` is not assignable to `ShouldBeCovariant3[int]` +generics_syntax_infer_variance.py:85:34: error[invalid-assignment] Object of type `ShouldBeCovariant5[float]` is not assignable to `ShouldBeCovariant5[int]` +generics_syntax_infer_variance.py:96:34: error[invalid-assignment] Object of type `ShouldBeCovariant6[float]` is not assignable to `ShouldBeCovariant6[int]` +generics_syntax_infer_variance.py:112:38: error[invalid-assignment] Object of type `ShouldBeInvariant1[int]` is not assignable to `ShouldBeInvariant1[float]` +generics_syntax_infer_variance.py:113:36: error[invalid-assignment] Object of type `ShouldBeInvariant1[float]` is not assignable to `ShouldBeInvariant1[int]` +generics_syntax_infer_variance.py:127:38: error[invalid-assignment] Object of type `ShouldBeInvariant2[int]` is not assignable to `ShouldBeInvariant2[float]` +generics_syntax_infer_variance.py:128:36: error[invalid-assignment] Object of type `ShouldBeInvariant2[float]` is not assignable to `ShouldBeInvariant2[int]` +generics_syntax_infer_variance.py:135:43: error[invalid-assignment] Object of type `ShouldBeInvariant3[int, str]` is not assignable to `ShouldBeInvariant3[float, str]` +generics_syntax_infer_variance.py:136:41: error[invalid-assignment] Object of type `ShouldBeInvariant3[float, str]` is not assignable to `ShouldBeInvariant3[int, str]` +generics_syntax_infer_variance.py:137:43: error[invalid-assignment] Object of type `ShouldBeInvariant3[str, int]` is not assignable to `ShouldBeInvariant3[str, float]` +generics_syntax_infer_variance.py:138:41: error[invalid-assignment] Object of type `ShouldBeInvariant3[str, float]` is not assignable to `ShouldBeInvariant3[str, int]` +generics_syntax_infer_variance.py:146:38: error[invalid-assignment] Object of type `ShouldBeInvariant4[int]` is not assignable to `ShouldBeInvariant4[float]` +generics_syntax_infer_variance.py:154:38: error[invalid-assignment] Object of type `ShouldBeInvariant5[int]` is not assignable to `ShouldBeInvariant5[float]` +generics_syntax_infer_variance.py:165:45: error[invalid-assignment] Object of type `ShouldBeContravariant1[int]` is not assignable to `ShouldBeContravariant1[float]` """ diff --git a/conformance/results/ty/generics_typevartuple_callable.toml b/conformance/results/ty/generics_typevartuple_callable.toml index 8e5efea3b..c1b0b28e7 100644 --- a/conformance/results/ty/generics_typevartuple_callable.toml +++ b/conformance/results/ty/generics_typevartuple_callable.toml @@ -4,9 +4,9 @@ notes = """ Does not correctly infer a `TypeVarTuple` that appears between fixed leading and trailing parameters in `*args`. """ errors_diff = """ -Line 50: Unexpected errors ['generics_typevartuple_callable.py:50:5: error[type-assertion-failure] Type `tuple[Unknown, *tuple[Unknown, ...]]` does not match asserted type `tuple[int | float | complex, str, int | float]`'] +Line 50: Unexpected errors ['generics_typevartuple_callable.py:50:5: error[type-assertion-failure] Type `tuple[Unknown, *tuple[Unknown, ...]]` does not match asserted type `tuple[complex, str, float]`'] """ output = """ generics_typevartuple_callable.py:26:9: error[invalid-argument-type] Argument to `Process.__init__` is incorrect: Expected `(int | Literal[""], str | Literal[0], /) -> None`, found `def func1(arg1: int, arg2: str) -> None` -generics_typevartuple_callable.py:50:5: error[type-assertion-failure] Type `tuple[Unknown, *tuple[Unknown, ...]]` does not match asserted type `tuple[int | float | complex, str, int | float]` +generics_typevartuple_callable.py:50:5: error[type-assertion-failure] Type `tuple[Unknown, *tuple[Unknown, ...]]` does not match asserted type `tuple[complex, str, float]` """ diff --git a/conformance/results/ty/generics_variance_inference.toml b/conformance/results/ty/generics_variance_inference.toml index 110ceaa3a..80f2098cd 100644 --- a/conformance/results/ty/generics_variance_inference.toml +++ b/conformance/results/ty/generics_variance_inference.toml @@ -2,28 +2,28 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -generics_variance_inference.py:24:33: error[invalid-assignment] Object of type `ClassA[int | float, int, int]` is not assignable to `ClassA[int, int, int]` -generics_variance_inference.py:25:37: error[invalid-assignment] Object of type `ClassA[int | float, int, int]` is not assignable to `ClassA[int | float, int | float, int]` -generics_variance_inference.py:28:33: error[invalid-assignment] Object of type `ClassA[int, int | float, int | float]` is not assignable to `ClassA[int, int, int]` -generics_variance_inference.py:41:35: error[invalid-assignment] Object of type `ShouldBeCovariant1[int | float]` is not assignable to `ShouldBeCovariant1[int]` -generics_variance_inference.py:49:35: error[invalid-assignment] Object of type `ShouldBeCovariant2[int | float]` is not assignable to `ShouldBeCovariant2[int]` -generics_variance_inference.py:58:35: error[invalid-assignment] Object of type `ShouldBeCovariant3[int | float]` is not assignable to `ShouldBeCovariant3[int]` -generics_variance_inference.py:67:34: error[invalid-assignment] Object of type `ShouldBeCovariant4[int | float]` is not assignable to `ShouldBeCovariant4[int]` -generics_variance_inference.py:80:34: error[invalid-assignment] Object of type `ShouldBeCovariant5[int | float]` is not assignable to `ShouldBeCovariant5[int]` -generics_variance_inference.py:96:38: error[invalid-assignment] Object of type `ShouldBeInvariant1[int]` is not assignable to `ShouldBeInvariant1[int | float]` -generics_variance_inference.py:97:36: error[invalid-assignment] Object of type `ShouldBeInvariant1[int | float]` is not assignable to `ShouldBeInvariant1[int]` -generics_variance_inference.py:111:38: error[invalid-assignment] Object of type `ShouldBeInvariant2[int]` is not assignable to `ShouldBeInvariant2[int | float]` -generics_variance_inference.py:112:36: error[invalid-assignment] Object of type `ShouldBeInvariant2[int | float]` is not assignable to `ShouldBeInvariant2[int]` -generics_variance_inference.py:119:43: error[invalid-assignment] Object of type `ShouldBeInvariant3[int, str]` is not assignable to `ShouldBeInvariant3[int | float, str]` -generics_variance_inference.py:120:41: error[invalid-assignment] Object of type `ShouldBeInvariant3[int | float, str]` is not assignable to `ShouldBeInvariant3[int, str]` -generics_variance_inference.py:121:43: error[invalid-assignment] Object of type `ShouldBeInvariant3[str, int]` is not assignable to `ShouldBeInvariant3[str, int | float]` -generics_variance_inference.py:122:41: error[invalid-assignment] Object of type `ShouldBeInvariant3[str, int | float]` is not assignable to `ShouldBeInvariant3[str, int]` -generics_variance_inference.py:130:38: error[invalid-assignment] Object of type `ShouldBeInvariant4[int]` is not assignable to `ShouldBeInvariant4[int | float]` -generics_variance_inference.py:138:38: error[invalid-assignment] Object of type `ShouldBeInvariant5[int]` is not assignable to `ShouldBeInvariant5[int | float]` -generics_variance_inference.py:149:45: error[invalid-assignment] Object of type `ShouldBeContravariant1[int]` is not assignable to `ShouldBeContravariant1[int | float]` -generics_variance_inference.py:169:31: error[invalid-assignment] Object of type `ShouldBeInvariant6[int | float]` is not assignable to `ShouldBeInvariant6[int]` -generics_variance_inference.py:170:33: error[invalid-assignment] Object of type `ShouldBeInvariant6[int]` is not assignable to `ShouldBeInvariant6[int | float]` -generics_variance_inference.py:181:31: error[invalid-assignment] Object of type `ShouldBeCovariant6[int | float]` is not assignable to `ShouldBeCovariant6[int]` -generics_variance_inference.py:194:37: error[invalid-assignment] Object of type `ShouldBeContravariant2[int]` is not assignable to `ShouldBeContravariant2[int | float]` +generics_variance_inference.py:24:33: error[invalid-assignment] Object of type `ClassA[float, int, int]` is not assignable to `ClassA[int, int, int]` +generics_variance_inference.py:25:37: error[invalid-assignment] Object of type `ClassA[float, int, int]` is not assignable to `ClassA[float, float, int]` +generics_variance_inference.py:28:33: error[invalid-assignment] Object of type `ClassA[int, float, float]` is not assignable to `ClassA[int, int, int]` +generics_variance_inference.py:41:35: error[invalid-assignment] Object of type `ShouldBeCovariant1[float]` is not assignable to `ShouldBeCovariant1[int]` +generics_variance_inference.py:49:35: error[invalid-assignment] Object of type `ShouldBeCovariant2[float]` is not assignable to `ShouldBeCovariant2[int]` +generics_variance_inference.py:58:35: error[invalid-assignment] Object of type `ShouldBeCovariant3[float]` is not assignable to `ShouldBeCovariant3[int]` +generics_variance_inference.py:67:34: error[invalid-assignment] Object of type `ShouldBeCovariant4[float]` is not assignable to `ShouldBeCovariant4[int]` +generics_variance_inference.py:80:34: error[invalid-assignment] Object of type `ShouldBeCovariant5[float]` is not assignable to `ShouldBeCovariant5[int]` +generics_variance_inference.py:96:38: error[invalid-assignment] Object of type `ShouldBeInvariant1[int]` is not assignable to `ShouldBeInvariant1[float]` +generics_variance_inference.py:97:36: error[invalid-assignment] Object of type `ShouldBeInvariant1[float]` is not assignable to `ShouldBeInvariant1[int]` +generics_variance_inference.py:111:38: error[invalid-assignment] Object of type `ShouldBeInvariant2[int]` is not assignable to `ShouldBeInvariant2[float]` +generics_variance_inference.py:112:36: error[invalid-assignment] Object of type `ShouldBeInvariant2[float]` is not assignable to `ShouldBeInvariant2[int]` +generics_variance_inference.py:119:43: error[invalid-assignment] Object of type `ShouldBeInvariant3[int, str]` is not assignable to `ShouldBeInvariant3[float, str]` +generics_variance_inference.py:120:41: error[invalid-assignment] Object of type `ShouldBeInvariant3[float, str]` is not assignable to `ShouldBeInvariant3[int, str]` +generics_variance_inference.py:121:43: error[invalid-assignment] Object of type `ShouldBeInvariant3[str, int]` is not assignable to `ShouldBeInvariant3[str, float]` +generics_variance_inference.py:122:41: error[invalid-assignment] Object of type `ShouldBeInvariant3[str, float]` is not assignable to `ShouldBeInvariant3[str, int]` +generics_variance_inference.py:130:38: error[invalid-assignment] Object of type `ShouldBeInvariant4[int]` is not assignable to `ShouldBeInvariant4[float]` +generics_variance_inference.py:138:38: error[invalid-assignment] Object of type `ShouldBeInvariant5[int]` is not assignable to `ShouldBeInvariant5[float]` +generics_variance_inference.py:149:45: error[invalid-assignment] Object of type `ShouldBeContravariant1[int]` is not assignable to `ShouldBeContravariant1[float]` +generics_variance_inference.py:169:31: error[invalid-assignment] Object of type `ShouldBeInvariant6[float]` is not assignable to `ShouldBeInvariant6[int]` +generics_variance_inference.py:170:33: error[invalid-assignment] Object of type `ShouldBeInvariant6[int]` is not assignable to `ShouldBeInvariant6[float]` +generics_variance_inference.py:181:31: error[invalid-assignment] Object of type `ShouldBeCovariant6[float]` is not assignable to `ShouldBeCovariant6[int]` +generics_variance_inference.py:194:37: error[invalid-assignment] Object of type `ShouldBeContravariant2[int]` is not assignable to `ShouldBeContravariant2[float]` generics_variance_inference.py:205:31: error[invalid-assignment] Object of type `ShouldBeCovariant7[object]` is not assignable to `ShouldBeCovariant7[int]` """ diff --git a/conformance/results/ty/namedtuples_define_class.toml b/conformance/results/ty/namedtuples_define_class.toml index e5e7bc787..ea5576d1d 100644 --- a/conformance/results/ty/namedtuples_define_class.toml +++ b/conformance/results/ty/namedtuples_define_class.toml @@ -15,6 +15,6 @@ namedtuples_define_class.py:77:5: error[invalid-named-tuple] NamedTuple field `_ namedtuples_define_class.py:87:5: error[invalid-named-tuple] NamedTuple field without default value cannot follow field(s) with default value(s): Field `latitude` defined here without a default value namedtuples_define_class.py:107:5: error[invalid-named-tuple-override] Cannot override NamedTuple field `x` inherited from `Point` namedtuples_define_class.py:121:24: error[too-many-positional-arguments] Too many positional arguments: expected 3, got 4 -namedtuples_define_class.py:140:19: error[invalid-argument-type] Argument is incorrect: Expected `str`, found `float` +namedtuples_define_class.py:140:19: error[invalid-argument-type] Argument is incorrect: Expected `str`, found `float*` namedtuples_define_class.py:147:24: error[invalid-named-tuple] NamedTuple class `Unit` cannot use multiple inheritance except with `Generic[]` """ diff --git a/conformance/results/ty/namedtuples_define_functional.toml b/conformance/results/ty/namedtuples_define_functional.toml index dc85a1e4b..037fdf685 100644 --- a/conformance/results/ty/namedtuples_define_functional.toml +++ b/conformance/results/ty/namedtuples_define_functional.toml @@ -10,7 +10,7 @@ namedtuples_define_functional.py:31:18: error[unknown-argument] Argument `z` doe namedtuples_define_functional.py:36:18: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal["1"]` namedtuples_define_functional.py:37:21: error[too-many-positional-arguments] Too many positional arguments: expected 3, got 4 namedtuples_define_functional.py:42:18: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal["1"]` -namedtuples_define_functional.py:43:15: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `float` +namedtuples_define_functional.py:43:15: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `float*` namedtuples_define_functional.py:52:25: error[invalid-named-tuple] Duplicate field name `a` in `namedtuple()`: Field `a` already defined; will raise `ValueError` at runtime namedtuples_define_functional.py:53:25: error[invalid-named-tuple] Field name `def` in `namedtuple()` cannot be a Python keyword: Will raise `ValueError` at runtime namedtuples_define_functional.py:54:25: error[invalid-named-tuple] Field name `def` in `namedtuple()` cannot be a Python keyword: Will raise `ValueError` at runtime diff --git a/conformance/results/ty/protocols_class_objects.toml b/conformance/results/ty/protocols_class_objects.toml index 5b04906fe..de396b6e0 100644 --- a/conformance/results/ty/protocols_class_objects.toml +++ b/conformance/results/ty/protocols_class_objects.toml @@ -8,11 +8,11 @@ errors_diff = """ Line 29: Expected 1 errors Line 34: Expected 1 errors Line 107: Expected 1 errors -Line 108: Expected 1 errors """ output = """ protocols_class_objects.py:58:16: error[invalid-assignment] Object of type `` is not assignable to `ProtoA1` protocols_class_objects.py:74:16: error[invalid-assignment] Object of type `` is not assignable to `ProtoB1` protocols_class_objects.py:104:16: error[invalid-assignment] Object of type `` is not assignable to `ProtoC1` protocols_class_objects.py:106:16: error[invalid-assignment] Object of type `` is not assignable to `ProtoC1` +protocols_class_objects.py:108:16: error[invalid-assignment] Object of type `` is not assignable to `ProtoC1` """ diff --git a/conformance/results/ty/protocols_definition.toml b/conformance/results/ty/protocols_definition.toml index e49455622..29e82bd3b 100644 --- a/conformance/results/ty/protocols_definition.toml +++ b/conformance/results/ty/protocols_definition.toml @@ -1,19 +1,13 @@ -conformance_automated = "Fail" -conformant = "Partial" -notes = """ -Reports an implicit instance attribute in a `Protocol` method only as a warning. -Incorrectly considers an instance attribute on a concrete class as satisfying a `ClassVar` protocol member. -""" +conformance_automated = "Pass" errors_diff = """ -Line 67: Expected 1 errors -Line 117: Expected 1 errors """ output = """ protocols_definition.py:30:11: error[invalid-argument-type] Argument to function `close_all` is incorrect: Expected `Iterable[SupportsClose]`, found `list[int]` -protocols_definition.py:67:9: warning[ambiguous-protocol-member] Cannot assign to an undeclared attribute in a protocol method: `temp` is not declared as a protocol member +protocols_definition.py:67:9: error[ambiguous-protocol-member] Cannot assign to an undeclared attribute in a protocol method: `temp` is not declared as a protocol member protocols_definition.py:114:22: error[invalid-assignment] Object of type `Concrete2_Bad1` is not assignable to `Template2` protocols_definition.py:115:22: error[invalid-assignment] Object of type `Concrete2_Bad2` is not assignable to `Template2` protocols_definition.py:116:22: error[invalid-assignment] Object of type `Concrete2_Bad3` is not assignable to `Template2` +protocols_definition.py:117:22: error[invalid-assignment] Object of type `Concrete2_Bad4` is not assignable to `Template2` protocols_definition.py:156:22: error[invalid-assignment] Object of type `Concrete3_Bad1` is not assignable to `Template3` protocols_definition.py:157:22: error[invalid-assignment] Object of type `Concrete3_Bad2` is not assignable to `Template3` protocols_definition.py:158:22: error[invalid-assignment] Object of type `Concrete3_Bad3` is not assignable to `Template3` diff --git a/conformance/results/ty/protocols_generic.toml b/conformance/results/ty/protocols_generic.toml index f532306ea..0d955245e 100644 --- a/conformance/results/ty/protocols_generic.toml +++ b/conformance/results/ty/protocols_generic.toml @@ -9,10 +9,10 @@ Line 144: Unexpected errors ['protocols_generic.py:144:25: error[invalid-assignm output = """ protocols_generic.py:40:24: error[invalid-assignment] Object of type `Concrete1` is not assignable to `Proto1[int, str]` protocols_generic.py:44:14: error[invalid-generic-class] Cannot both inherit from subscripted `Protocol` and subscripted `Generic` -protocols_generic.py:56:20: error[invalid-assignment] Object of type `Box[int | float]` is not assignable to `Box[int]` -protocols_generic.py:66:25: error[invalid-assignment] Object of type `Sender[int]` is not assignable to `Sender[int | float]` -protocols_generic.py:74:28: error[invalid-assignment] Object of type `AttrProto[int]` is not assignable to `AttrProto[int | float]` -protocols_generic.py:75:26: error[invalid-assignment] Object of type `AttrProto[int | float]` is not assignable to `AttrProto[int]` +protocols_generic.py:56:20: error[invalid-assignment] Object of type `Box[float]` is not assignable to `Box[int]` +protocols_generic.py:66:25: error[invalid-assignment] Object of type `Sender[int]` is not assignable to `Sender[float]` +protocols_generic.py:74:28: error[invalid-assignment] Object of type `AttrProto[int]` is not assignable to `AttrProto[float]` +protocols_generic.py:75:26: error[invalid-assignment] Object of type `AttrProto[float]` is not assignable to `AttrProto[int]` protocols_generic.py:144:25: error[invalid-assignment] Object of type `ConcreteHasProperty1` is not assignable to `HasPropertyProto` protocols_generic.py:145:25: error[invalid-assignment] Object of type `ConcreteHasProperty2` is not assignable to `HasPropertyProto` protocols_generic.py:146:25: error[invalid-assignment] Object of type `ConcreteHasProperty3` is not assignable to `HasPropertyProto` diff --git a/conformance/results/ty/protocols_subtyping.toml b/conformance/results/ty/protocols_subtyping.toml index b75d7d453..3e5b0c8dd 100644 --- a/conformance/results/ty/protocols_subtyping.toml +++ b/conformance/results/ty/protocols_subtyping.toml @@ -5,8 +5,8 @@ output = """ protocols_subtyping.py:16:6: error[call-non-callable] Cannot instantiate class `Proto1`: This call will raise `TypeError` at runtime protocols_subtyping.py:38:21: error[invalid-assignment] Object of type `Proto2` is not assignable to `Concrete2` protocols_subtyping.py:55:18: error[invalid-assignment] Object of type `Proto2` is not assignable to `Proto3` -protocols_subtyping.py:79:30: error[invalid-assignment] Object of type `Proto5[int]` is not assignable to `Proto4[int, int | float]` -protocols_subtyping.py:80:25: error[invalid-assignment] Object of type `Proto4[int, int]` is not assignable to `Proto5[int | float]` -protocols_subtyping.py:102:30: error[invalid-assignment] Object of type `Proto6[int | float, int | float]` is not assignable to `Proto7[int, int | float]` -protocols_subtyping.py:103:33: error[invalid-assignment] Object of type `Proto6[int | float, int | float]` is not assignable to `Proto7[int | float, object]` +protocols_subtyping.py:79:30: error[invalid-assignment] Object of type `Proto5[int]` is not assignable to `Proto4[int, float]` +protocols_subtyping.py:80:25: error[invalid-assignment] Object of type `Proto4[int, int]` is not assignable to `Proto5[float]` +protocols_subtyping.py:102:30: error[invalid-assignment] Object of type `Proto6[float, float]` is not assignable to `Proto7[int, float]` +protocols_subtyping.py:103:33: error[invalid-assignment] Object of type `Proto6[float, float]` is not assignable to `Proto7[float, object]` """ diff --git a/conformance/results/ty/specialtypes_promotions.toml b/conformance/results/ty/specialtypes_promotions.toml index 5dea49f83..1e2be6c14 100644 --- a/conformance/results/ty/specialtypes_promotions.toml +++ b/conformance/results/ty/specialtypes_promotions.toml @@ -2,5 +2,5 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -specialtypes_promotions.py:13:5: error[unresolved-attribute] Attribute `numerator` is not defined on `float` in union `int | float` +specialtypes_promotions.py:13:5: error[unresolved-attribute] Attribute `numerator` is not defined on `float*` in union `float` """ diff --git a/conformance/results/ty/tuples_type_compat.toml b/conformance/results/ty/tuples_type_compat.toml index 2d6b0793e..6b7200081 100644 --- a/conformance/results/ty/tuples_type_compat.toml +++ b/conformance/results/ty/tuples_type_compat.toml @@ -2,7 +2,7 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -tuples_type_compat.py:15:27: error[invalid-assignment] Object of type `tuple[int | float, int | float | complex]` is not assignable to `tuple[int, int]` +tuples_type_compat.py:15:27: error[invalid-assignment] Object of type `tuple[float, complex]` is not assignable to `tuple[int, int]` tuples_type_compat.py:29:10: error[invalid-assignment] Object of type `tuple[int, ...]` is not assignable to `tuple[int, *tuple[int, ...]]` tuples_type_compat.py:32:10: error[invalid-assignment] Object of type `tuple[int, *tuple[int, ...]]` is not assignable to `tuple[int]` tuples_type_compat.py:33:10: error[invalid-assignment] Object of type `tuple[int, ...]` is not assignable to `tuple[int]` @@ -20,9 +20,9 @@ tuples_type_compat.py:157:6: error[invalid-assignment] Object of type `tuple[Lit tuples_type_compat.py:162:6: error[invalid-assignment] Object of type `tuple[Literal[1], Literal[1], Literal[""]]` is not assignable to `tuple[int, *tuple[str, ...]]` tuples_type_compat.py:163:6: error[invalid-assignment] Object of type `tuple[Literal[1], Literal[""], Literal[1]]` is not assignable to `tuple[int, *tuple[str, ...]]` tuples_type_compat.py:169:6: error[invalid-assignment] Object of type `tuple[Literal[1], Literal[""], Literal[""]]` is not assignable to `tuple[int, *tuple[str, ...], int]` -tuples_type_compat.py:170:6: error[invalid-assignment] Object of type `tuple[Literal[1], Literal[""], Literal[""], float]` is not assignable to `tuple[int, *tuple[str, ...], int]` +tuples_type_compat.py:170:6: error[invalid-assignment] Object of type `tuple[Literal[1], Literal[""], Literal[""], float*]` is not assignable to `tuple[int, *tuple[str, ...], int]` tuples_type_compat.py:175:6: error[invalid-assignment] Object of type `tuple[Literal[1], Literal[""], Literal[1]]` is not assignable to `tuple[*tuple[str, ...], int]` -tuples_type_compat.py:176:6: error[invalid-assignment] Object of type `tuple[Literal[""], Literal[""], float]` is not assignable to `tuple[*tuple[str, ...], int]` +tuples_type_compat.py:176:6: error[invalid-assignment] Object of type `tuple[Literal[""], Literal[""], float*]` is not assignable to `tuple[*tuple[str, ...], int]` tuples_type_compat.py:181:40: error[invalid-assignment] Object of type `tuple[str, str]` is not assignable to `tuple[str, str, int]` tuples_type_compat.py:184:50: error[invalid-assignment] Object of type `tuple[str, str]` is not assignable to `tuple[str, str, str, *tuple[str, ...]]` tuples_type_compat.py:188:50: error[invalid-assignment] Object of type `tuple[str, str]` is not assignable to `tuple[*tuple[str, ...], str, str, str]` diff --git a/conformance/results/ty/typeddicts_operations.toml b/conformance/results/ty/typeddicts_operations.toml index 8526b4218..7a6929fb0 100644 --- a/conformance/results/ty/typeddicts_operations.toml +++ b/conformance/results/ty/typeddicts_operations.toml @@ -7,7 +7,7 @@ typeddicts_operations.py:23:17: error[invalid-assignment] Invalid assignment to 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: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` 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` diff --git a/conformance/results/ty/typeddicts_readonly_inheritance.toml b/conformance/results/ty/typeddicts_readonly_inheritance.toml index bc9847757..a19eb7560 100644 --- a/conformance/results/ty/typeddicts_readonly_inheritance.toml +++ b/conformance/results/ty/typeddicts_readonly_inheritance.toml @@ -9,6 +9,8 @@ typeddicts_readonly_inheritance.py:84:5: error[missing-typed-dict-key] Missing r typeddicts_readonly_inheritance.py:94:5: error[invalid-typed-dict-field] Cannot overwrite TypedDict field `a`: Mutable inherited fields cannot be redeclared as read-only typeddicts_readonly_inheritance.py:98:5: error[invalid-typed-dict-field] Cannot overwrite TypedDict field `a`: Required inherited fields cannot be redeclared as `NotRequired` typeddicts_readonly_inheritance.py:106:5: error[invalid-typed-dict-field] Cannot overwrite TypedDict field `c`: Required inherited fields cannot be redeclared as `NotRequired` -typeddicts_readonly_inheritance.py:119:7: error[invalid-typed-dict-field] Cannot overwrite TypedDict field `x` while merging base classes: Inherited mutable field type `int | float` is incompatible with `int` +typeddicts_readonly_inheritance.py:119:7: error[invalid-typed-dict-field] Cannot overwrite TypedDict field `x` while merging base classes: Inherited mutable field type `float` is incompatible with `int` typeddicts_readonly_inheritance.py:132:7: error[invalid-typed-dict-field] Cannot overwrite TypedDict field `x` while merging base classes: Required inherited fields cannot be redeclared as `NotRequired` """ +errors_diff = """ +""" diff --git a/conformance/results/ty/version.toml b/conformance/results/ty/version.toml index 1d686bb73..6932c70c5 100644 --- a/conformance/results/ty/version.toml +++ b/conformance/results/ty/version.toml @@ -1 +1 @@ -version = "ty 0.0.67" +version = "ty 0.0.70" diff --git a/conformance/tests/ty.toml b/conformance/tests/ty.toml index 986f5e429..dcd178048 100644 --- a/conformance/tests/ty.toml +++ b/conformance/tests/ty.toml @@ -9,3 +9,4 @@ assert-type-unspellable-subtype = "ignore" invalid-enum-member-annotation = "error" mismatched-type-name = "error" invalid-named-tuple-override = "error" +ambiguous-protocol-member = "error" diff --git a/conformance/uv.lock b/conformance/uv.lock index 533989b4c..b6f401d1b 100644 --- a/conformance/uv.lock +++ b/conformance/uv.lock @@ -1,38 +1,38 @@ version = 1 -revision = 2 +revision = 3 requires-python = "==3.12.*" [[package]] name = "ast-serialize" version = "0.5.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/81/9d/09e27731bd5864a9ce04e3244074e674bb8936bf62b45e0357248717adac/ast_serialize-0.5.0.tar.gz", hash = "sha256:5880091bfe6f4f986f22866375c2e884843e7a0b6343ae41aeea659613d879b6", size = 61157, upload_time = "2026-05-17T17:48:29.429Z" } +sdist = { url = "https://files.pythonhosted.org/packages/81/9d/09e27731bd5864a9ce04e3244074e674bb8936bf62b45e0357248717adac/ast_serialize-0.5.0.tar.gz", hash = "sha256:5880091bfe6f4f986f22866375c2e884843e7a0b6343ae41aeea659613d879b6", size = 61157, upload-time = "2026-05-17T17:48:29.429Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/e0/9e/dc2530acb3a60dc6e46d65abf27d1d9f86721694757906a148d90a6860de/ast_serialize-0.5.0-cp39-abi3-macosx_10_12_x86_64.whl", hash = "sha256:0668aa9459cfa8c9c49ddd2163ebcf43088ba045ef7492af6fe22e0098303101", size = 1191380, upload_time = "2026-05-17T17:48:03.738Z" }, - { url = "https://files.pythonhosted.org/packages/26/0a/bd3d18a582f273d6c843d16bb9e22e9e16365ff7991e92f18f798e9f1224/ast_serialize-0.5.0-cp39-abi3-macosx_11_0_arm64.whl", hash = "sha256:bf683d6363edf2b39eed6b6d4fe22d34b6203867a67e27134d9e2a2680c4bc4a", size = 1183879, upload_time = "2026-05-17T17:48:05.463Z" }, - { url = "https://files.pythonhosted.org/packages/40/ae/1f919100f8620887af58fcc381c61a1f218cdf89c6e155f87b213e61010a/ast_serialize-0.5.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9cc22cf0c9be65e71cf88fda130af60d61eb4a79370ad4cfe7900d48a4aa2211", size = 1244529, upload_time = "2026-05-17T17:48:07.008Z" }, - { url = "https://files.pythonhosted.org/packages/c6/ca/6376559dcce707cdbc1d0d9a13c8d3baaaa501e949ce0ebdc4230cd881aa/ast_serialize-0.5.0-cp39-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:f66173891548c9f2726bf27957b41cabce12fa679dc6da505ddbde4d4b3b31cf", size = 1240560, upload_time = "2026-05-17T17:48:08.46Z" }, - { url = "https://files.pythonhosted.org/packages/35/b2/a620e206b5aeb7efbf2710336df57d457cffbb3991076bbcc1147ef9abd4/ast_serialize-0.5.0-cp39-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e42d729ef2be96a14efbad355093284739e3670ece3e534f82cc8832790911d9", size = 1451172, upload_time = "2026-05-17T17:48:09.922Z" }, - { url = "https://files.pythonhosted.org/packages/fa/e0/4ad5c04c24a40481b2935ce9a0ccdb6023dc8b667167d06ae530cc3512f2/ast_serialize-0.5.0-cp39-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b725026bafa801dbd7310eb13a75f0a2e370e7e51b2cb225f9d21fcfadf919ee", size = 1265072, upload_time = "2026-05-17T17:48:11.469Z" }, - { url = "https://files.pythonhosted.org/packages/b2/71/4d1d479aa56d0101c40e17720c3d6ac2af7269ea0487a80b18e7bfd1a5b7/ast_serialize-0.5.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b54f60c1d78767a53b67eaa663f0dfac3afe606aa07f1301572f588b73d64809", size = 1270488, upload_time = "2026-05-17T17:48:13.575Z" }, - { url = "https://files.pythonhosted.org/packages/6d/4f/0de1bbe06f6edef9fde4ed12ca8e7b3ec7e6e2bd4e672c5af487f7957665/ast_serialize-0.5.0-cp39-abi3-manylinux_2_31_riscv64.whl", hash = "sha256:27d51654fc240a1e87e742d353d98eb45b75f62f129086b3596ab53df2ac2a43", size = 1260702, upload_time = "2026-05-17T17:48:15.141Z" }, - { url = "https://files.pythonhosted.org/packages/75/61/e00872439cfdddcc3c1b6cdaa6e5d904ba8e26a18807c67c4e14409d0ca8/ast_serialize-0.5.0-cp39-abi3-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:2782c36237c46dd1674542f2109740ea5ea485a169bf1431939ada0434e17934", size = 1311182, upload_time = "2026-05-17T17:48:16.779Z" }, - { url = "https://files.pythonhosted.org/packages/76/8e/699a5b955f7926956c95e9e1d74132acad73c2fe7a426f94da89123c20aa/ast_serialize-0.5.0-cp39-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:1943db345233cc7194a470f13afa9c59772c0b123dea0c9414c4d4ca54369759", size = 1421410, upload_time = "2026-05-17T17:48:18.527Z" }, - { url = "https://files.pythonhosted.org/packages/a9/ae/d5b7626874478997adc7a29ab28accf21e596fb590c944290401dfd0b29e/ast_serialize-0.5.0-cp39-abi3-musllinux_1_2_armv7l.whl", hash = "sha256:df1c00022cbbcb064bfaa505aa9c9295362443ce5dacb459d1331d3da353f887", size = 1516587, upload_time = "2026-05-17T17:48:20.133Z" }, - { url = "https://files.pythonhosted.org/packages/0c/ce/b59e02a82d9c4244d64cde502e0b00e83e38816abe19155ceb5437402c7f/ast_serialize-0.5.0-cp39-abi3-musllinux_1_2_i686.whl", hash = "sha256:cae65289fc456fde04af979a2be09302ef5d8ab92ef23e596d6746dc267ada27", size = 1515171, upload_time = "2026-05-17T17:48:21.921Z" }, - { url = "https://files.pythonhosted.org/packages/8b/38/d8d90042747d05aa08d4efcf1c99035a5f670a6bf4c214d31644392afbca/ast_serialize-0.5.0-cp39-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:239a4c354e8d676e9d94631d1d4a64edc6b266f86ff3a5a80aedd344f342c01d", size = 1464668, upload_time = "2026-05-17T17:48:23.544Z" }, - { url = "https://files.pythonhosted.org/packages/dd/51/5b840c4df7334104cecffa28f23904fe81ca89ca223d2450e288de39fd3c/ast_serialize-0.5.0-cp39-abi3-win32.whl", hash = "sha256:143a4ef63285a075871908fda3672dc21864b83a8ec3ee12304aa3e4c5387b9a", size = 1068311, upload_time = "2026-05-17T17:48:25.027Z" }, - { url = "https://files.pythonhosted.org/packages/41/11/ca5672c7d491825bc4cd6702dea106a6b60d928707712ec257c7833ae476/ast_serialize-0.5.0-cp39-abi3-win_amd64.whl", hash = "sha256:cf25572c526add400f26a4750dc6ce0c3bb93fc1f75e7ae0cad4ce4f2cd5c590", size = 1108931, upload_time = "2026-05-17T17:48:26.591Z" }, - { url = "https://files.pythonhosted.org/packages/45/19/cc8bd127d28a43da249aa955cfd164cf8fd534e79e42cea96c4854d72fd0/ast_serialize-0.5.0-cp39-abi3-win_arm64.whl", hash = "sha256:92a31c9c20d25a076edaeec76b128a3535d74a24f340b9a8a7e96c9b86dc9642", size = 1081181, upload_time = "2026-05-17T17:48:28.122Z" }, + { url = "https://files.pythonhosted.org/packages/e0/9e/dc2530acb3a60dc6e46d65abf27d1d9f86721694757906a148d90a6860de/ast_serialize-0.5.0-cp39-abi3-macosx_10_12_x86_64.whl", hash = "sha256:0668aa9459cfa8c9c49ddd2163ebcf43088ba045ef7492af6fe22e0098303101", size = 1191380, upload-time = "2026-05-17T17:48:03.738Z" }, + { url = "https://files.pythonhosted.org/packages/26/0a/bd3d18a582f273d6c843d16bb9e22e9e16365ff7991e92f18f798e9f1224/ast_serialize-0.5.0-cp39-abi3-macosx_11_0_arm64.whl", hash = "sha256:bf683d6363edf2b39eed6b6d4fe22d34b6203867a67e27134d9e2a2680c4bc4a", size = 1183879, upload-time = "2026-05-17T17:48:05.463Z" }, + { url = "https://files.pythonhosted.org/packages/40/ae/1f919100f8620887af58fcc381c61a1f218cdf89c6e155f87b213e61010a/ast_serialize-0.5.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9cc22cf0c9be65e71cf88fda130af60d61eb4a79370ad4cfe7900d48a4aa2211", size = 1244529, upload-time = "2026-05-17T17:48:07.008Z" }, + { url = "https://files.pythonhosted.org/packages/c6/ca/6376559dcce707cdbc1d0d9a13c8d3baaaa501e949ce0ebdc4230cd881aa/ast_serialize-0.5.0-cp39-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:f66173891548c9f2726bf27957b41cabce12fa679dc6da505ddbde4d4b3b31cf", size = 1240560, upload-time = "2026-05-17T17:48:08.46Z" }, + { url = "https://files.pythonhosted.org/packages/35/b2/a620e206b5aeb7efbf2710336df57d457cffbb3991076bbcc1147ef9abd4/ast_serialize-0.5.0-cp39-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e42d729ef2be96a14efbad355093284739e3670ece3e534f82cc8832790911d9", size = 1451172, upload-time = "2026-05-17T17:48:09.922Z" }, + { url = "https://files.pythonhosted.org/packages/fa/e0/4ad5c04c24a40481b2935ce9a0ccdb6023dc8b667167d06ae530cc3512f2/ast_serialize-0.5.0-cp39-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b725026bafa801dbd7310eb13a75f0a2e370e7e51b2cb225f9d21fcfadf919ee", size = 1265072, upload-time = "2026-05-17T17:48:11.469Z" }, + { url = "https://files.pythonhosted.org/packages/b2/71/4d1d479aa56d0101c40e17720c3d6ac2af7269ea0487a80b18e7bfd1a5b7/ast_serialize-0.5.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b54f60c1d78767a53b67eaa663f0dfac3afe606aa07f1301572f588b73d64809", size = 1270488, upload-time = "2026-05-17T17:48:13.575Z" }, + { url = "https://files.pythonhosted.org/packages/6d/4f/0de1bbe06f6edef9fde4ed12ca8e7b3ec7e6e2bd4e672c5af487f7957665/ast_serialize-0.5.0-cp39-abi3-manylinux_2_31_riscv64.whl", hash = "sha256:27d51654fc240a1e87e742d353d98eb45b75f62f129086b3596ab53df2ac2a43", size = 1260702, upload-time = "2026-05-17T17:48:15.141Z" }, + { url = "https://files.pythonhosted.org/packages/75/61/e00872439cfdddcc3c1b6cdaa6e5d904ba8e26a18807c67c4e14409d0ca8/ast_serialize-0.5.0-cp39-abi3-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:2782c36237c46dd1674542f2109740ea5ea485a169bf1431939ada0434e17934", size = 1311182, upload-time = "2026-05-17T17:48:16.779Z" }, + { url = "https://files.pythonhosted.org/packages/76/8e/699a5b955f7926956c95e9e1d74132acad73c2fe7a426f94da89123c20aa/ast_serialize-0.5.0-cp39-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:1943db345233cc7194a470f13afa9c59772c0b123dea0c9414c4d4ca54369759", size = 1421410, upload-time = "2026-05-17T17:48:18.527Z" }, + { url = "https://files.pythonhosted.org/packages/a9/ae/d5b7626874478997adc7a29ab28accf21e596fb590c944290401dfd0b29e/ast_serialize-0.5.0-cp39-abi3-musllinux_1_2_armv7l.whl", hash = "sha256:df1c00022cbbcb064bfaa505aa9c9295362443ce5dacb459d1331d3da353f887", size = 1516587, upload-time = "2026-05-17T17:48:20.133Z" }, + { url = "https://files.pythonhosted.org/packages/0c/ce/b59e02a82d9c4244d64cde502e0b00e83e38816abe19155ceb5437402c7f/ast_serialize-0.5.0-cp39-abi3-musllinux_1_2_i686.whl", hash = "sha256:cae65289fc456fde04af979a2be09302ef5d8ab92ef23e596d6746dc267ada27", size = 1515171, upload-time = "2026-05-17T17:48:21.921Z" }, + { url = "https://files.pythonhosted.org/packages/8b/38/d8d90042747d05aa08d4efcf1c99035a5f670a6bf4c214d31644392afbca/ast_serialize-0.5.0-cp39-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:239a4c354e8d676e9d94631d1d4a64edc6b266f86ff3a5a80aedd344f342c01d", size = 1464668, upload-time = "2026-05-17T17:48:23.544Z" }, + { url = "https://files.pythonhosted.org/packages/dd/51/5b840c4df7334104cecffa28f23904fe81ca89ca223d2450e288de39fd3c/ast_serialize-0.5.0-cp39-abi3-win32.whl", hash = "sha256:143a4ef63285a075871908fda3672dc21864b83a8ec3ee12304aa3e4c5387b9a", size = 1068311, upload-time = "2026-05-17T17:48:25.027Z" }, + { url = "https://files.pythonhosted.org/packages/41/11/ca5672c7d491825bc4cd6702dea106a6b60d928707712ec257c7833ae476/ast_serialize-0.5.0-cp39-abi3-win_amd64.whl", hash = "sha256:cf25572c526add400f26a4750dc6ce0c3bb93fc1f75e7ae0cad4ce4f2cd5c590", size = 1108931, upload-time = "2026-05-17T17:48:26.591Z" }, + { url = "https://files.pythonhosted.org/packages/45/19/cc8bd127d28a43da249aa955cfd164cf8fd534e79e42cea96c4854d72fd0/ast_serialize-0.5.0-cp39-abi3-win_arm64.whl", hash = "sha256:92a31c9c20d25a076edaeec76b128a3535d74a24f340b9a8a7e96c9b86dc9642", size = 1081181, upload-time = "2026-05-17T17:48:28.122Z" }, ] [[package]] name = "importlib-resources" version = "7.1.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/e4/06/b56dfa750b44e86157093bc8fca0ab81dccbf5260510de4eaf1cb69b5b99/importlib_resources-7.1.0.tar.gz", hash = "sha256:0722d4c6212489c530f2a145a34c0a7a3b4721bc96a15fada5930e2a0b760708", size = 44985, upload_time = "2026-04-12T16:36:09.232Z" } +sdist = { url = "https://files.pythonhosted.org/packages/e4/06/b56dfa750b44e86157093bc8fca0ab81dccbf5260510de4eaf1cb69b5b99/importlib_resources-7.1.0.tar.gz", hash = "sha256:0722d4c6212489c530f2a145a34c0a7a3b4721bc96a15fada5930e2a0b760708", size = 44985, upload-time = "2026-04-12T16:36:09.232Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/8a/db/55a262f3606bebcae07cc14095338471ad7c0bbcaa37707e6f0ee49725b7/importlib_resources-7.1.0-py3-none-any.whl", hash = "sha256:1bd7b48b4088eddb2cd16382150bb515af0bd2c70128194392725f82ad2c96a1", size = 37232, upload_time = "2026-04-12T16:36:08.219Z" }, + { url = "https://files.pythonhosted.org/packages/8a/db/55a262f3606bebcae07cc14095338471ad7c0bbcaa37707e6f0ee49725b7/importlib_resources-7.1.0-py3-none-any.whl", hash = "sha256:1bd7b48b4088eddb2cd16382150bb515af0bd2c70128194392725f82ad2c96a1", size = 37232, upload-time = "2026-04-12T16:36:08.219Z" }, ] [[package]] @@ -42,58 +42,58 @@ source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "markupsafe" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/df/bf/f7da0350254c0ed7c72f3e33cef02e048281fec7ecec5f032d4aac52226b/jinja2-3.1.6.tar.gz", hash = "sha256:0137fb05990d35f1275a587e9aee6d56da821fc83491a0fb838183be43f66d6d", size = 245115, upload_time = "2025-03-05T20:05:02.478Z" } +sdist = { url = "https://files.pythonhosted.org/packages/df/bf/f7da0350254c0ed7c72f3e33cef02e048281fec7ecec5f032d4aac52226b/jinja2-3.1.6.tar.gz", hash = "sha256:0137fb05990d35f1275a587e9aee6d56da821fc83491a0fb838183be43f66d6d", size = 245115, upload-time = "2025-03-05T20:05:02.478Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/62/a1/3d680cbfd5f4b8f15abc1d571870c5fc3e594bb582bc3b64ea099db13e56/jinja2-3.1.6-py3-none-any.whl", hash = "sha256:85ece4451f492d0c13c5dd7c13a64681a86afae63a5f347908daf103ce6d2f67", size = 134899, upload_time = "2025-03-05T20:05:00.369Z" }, + { url = "https://files.pythonhosted.org/packages/62/a1/3d680cbfd5f4b8f15abc1d571870c5fc3e594bb582bc3b64ea099db13e56/jinja2-3.1.6-py3-none-any.whl", hash = "sha256:85ece4451f492d0c13c5dd7c13a64681a86afae63a5f347908daf103ce6d2f67", size = 134899, upload-time = "2025-03-05T20:05:00.369Z" }, ] [[package]] name = "librt" version = "0.11.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/40/08/9e7f6b5d2b5bed6ad055cdd5925f192bb403a51280f86b56554d9d0699a2/librt-0.11.0.tar.gz", hash = "sha256:075dc3ef4458a278e0195cbf6ac9d38808d9b906c5a6c7f7f79c3888276a3fb1", size = 200139, upload_time = "2026-05-10T18:17:25.138Z" } +sdist = { url = "https://files.pythonhosted.org/packages/40/08/9e7f6b5d2b5bed6ad055cdd5925f192bb403a51280f86b56554d9d0699a2/librt-0.11.0.tar.gz", hash = "sha256:075dc3ef4458a278e0195cbf6ac9d38808d9b906c5a6c7f7f79c3888276a3fb1", size = 200139, upload-time = "2026-05-10T18:17:25.138Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/8b/d0/07c77e067f0838949b43bd89232c29d72efebb9d2801a9750184eb706b71/librt-0.11.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:b87504f1690a23b9a2cca841191a04f83895d4fc2dd04df91d82b1a04ca2ad46", size = 144147, upload_time = "2026-05-10T18:15:53.227Z" }, - { url = "https://files.pythonhosted.org/packages/7a/24/8493538fa4f62f982686398a5b8f68008138a75086abdea19ade64bf4255/librt-0.11.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:40071fc5fe0ce8daa6de616702314a01e1250711682b0523d6ab8d4525910cb3", size = 143614, upload_time = "2026-05-10T18:15:54.657Z" }, - { url = "https://files.pythonhosted.org/packages/ff/1e/f8bad050810d9171f34a1648ed910e56814c2ba61639f2bd53c6377ae24b/librt-0.11.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:137e79445c896a0ea7b265f52d23954e05b64222ee1af69e2cb34219067cbb67", size = 485538, upload_time = "2026-05-10T18:15:56.117Z" }, - { url = "https://files.pythonhosted.org/packages/c0/fe/3594ebfbaf03084ba4b120c9ba5c3183fd938a48725e9bbe6ff0a5159ad8/librt-0.11.0-cp312-cp312-manylinux2014_i686.manylinux_2_17_i686.manylinux_2_28_i686.whl", hash = "sha256:cca6644054e78746d8d4ef238681f9c34ff8b584fe6b988ecebb8db3b15e622a", size = 479623, upload_time = "2026-05-10T18:15:57.544Z" }, - { url = "https://files.pythonhosted.org/packages/b0/da/5d1876984b3746c85dbd219dbfcb73c85f54ee263fd32e5b2a632ec14571/librt-0.11.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d5b0eea49f5562861ee8d757a32ef7d559c1d35be2aaaa1ec28941d74c9ffc8a", size = 513082, upload_time = "2026-05-10T18:15:58.805Z" }, - { url = "https://files.pythonhosted.org/packages/19/6e/55bdf5d5ca00c3e18430690bf2c953d8d3ffd3c337418173d33dec985dc9/librt-0.11.0-cp312-cp312-manylinux_2_34_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:0d1029d7e1ae1a7e647ed6fb5df8c4ce2dffefb7a9f5fd1376a4554d96dac09f", size = 508105, upload_time = "2026-05-10T18:16:00.2Z" }, - { url = "https://files.pythonhosted.org/packages/07/10/f1f23a7c595ee90ece4d35c851e5d104b1311a887ed1b4ac4c35bbd13da8/librt-0.11.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:bc3ce6b33c5828d9e80592011a5c584cb2ce86edbc4088405f70da47dc1d1b3b", size = 522268, upload_time = "2026-05-10T18:16:01.708Z" }, - { url = "https://files.pythonhosted.org/packages/b6/02/5720f5697a7f54b78b3aefbe20df3a48cedcff1276618c4aa481177942ed/librt-0.11.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:936c5995f3514a42111f20099397d8177c79b4d7e70961e396c6f5a0a3566766", size = 527348, upload_time = "2026-05-10T18:16:03.496Z" }, - { url = "https://files.pythonhosted.org/packages/50/db/b4a47c6f91db4ff76348a0b3dd0cc65e090a078b765a810a62ff9434c3d3/librt-0.11.0-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:9bc0ca6ad9381cbe8e4aa6e5726e4c80c78115a6e9723c599ed1d73e092bc49d", size = 516294, upload_time = "2026-05-10T18:16:05.173Z" }, - { url = "https://files.pythonhosted.org/packages/9e/58/9384b2f4eb1ed1d273d40948a7c5c4b2360213b402ef3be4641c06299f9c/librt-0.11.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:070aa8c26c0a74774317a72df8851facc7f0f012a5b406557ac56992d92e1ec8", size = 553608, upload_time = "2026-05-10T18:16:06.839Z" }, - { url = "https://files.pythonhosted.org/packages/21/7b/5aa8848a7c6a9278c79375146da1812e695754ceec5f005e6043461a7315/librt-0.11.0-cp312-cp312-win32.whl", hash = "sha256:6bf14feb84b05ae945277395451998c89c54d0def4070eb5c08de544930b245a", size = 101879, upload_time = "2026-05-10T18:16:08.103Z" }, - { url = "https://files.pythonhosted.org/packages/37/33/8a745436944947575b584231750a41417de1a38cf6a2e9251d1065651c09/librt-0.11.0-cp312-cp312-win_amd64.whl", hash = "sha256:75672f0bc524ede266287d532d7923dbce94c7514ad07627bac3d0c6d92cc4d9", size = 119831, upload_time = "2026-05-10T18:16:09.174Z" }, - { url = "https://files.pythonhosted.org/packages/59/67/a6739ac96e28b7855808bdb0370e250606104a859750d209e5a0716fe7ab/librt-0.11.0-cp312-cp312-win_arm64.whl", hash = "sha256:2f10cf143e4a9bb0f4f5af568a00df94a2d69ef41c2579584454bb0fe5cc642c", size = 103470, upload_time = "2026-05-10T18:16:10.369Z" }, + { url = "https://files.pythonhosted.org/packages/8b/d0/07c77e067f0838949b43bd89232c29d72efebb9d2801a9750184eb706b71/librt-0.11.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:b87504f1690a23b9a2cca841191a04f83895d4fc2dd04df91d82b1a04ca2ad46", size = 144147, upload-time = "2026-05-10T18:15:53.227Z" }, + { url = "https://files.pythonhosted.org/packages/7a/24/8493538fa4f62f982686398a5b8f68008138a75086abdea19ade64bf4255/librt-0.11.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:40071fc5fe0ce8daa6de616702314a01e1250711682b0523d6ab8d4525910cb3", size = 143614, upload-time = "2026-05-10T18:15:54.657Z" }, + { url = "https://files.pythonhosted.org/packages/ff/1e/f8bad050810d9171f34a1648ed910e56814c2ba61639f2bd53c6377ae24b/librt-0.11.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:137e79445c896a0ea7b265f52d23954e05b64222ee1af69e2cb34219067cbb67", size = 485538, upload-time = "2026-05-10T18:15:56.117Z" }, + { url = "https://files.pythonhosted.org/packages/c0/fe/3594ebfbaf03084ba4b120c9ba5c3183fd938a48725e9bbe6ff0a5159ad8/librt-0.11.0-cp312-cp312-manylinux2014_i686.manylinux_2_17_i686.manylinux_2_28_i686.whl", hash = "sha256:cca6644054e78746d8d4ef238681f9c34ff8b584fe6b988ecebb8db3b15e622a", size = 479623, upload-time = "2026-05-10T18:15:57.544Z" }, + { url = "https://files.pythonhosted.org/packages/b0/da/5d1876984b3746c85dbd219dbfcb73c85f54ee263fd32e5b2a632ec14571/librt-0.11.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d5b0eea49f5562861ee8d757a32ef7d559c1d35be2aaaa1ec28941d74c9ffc8a", size = 513082, upload-time = "2026-05-10T18:15:58.805Z" }, + { url = "https://files.pythonhosted.org/packages/19/6e/55bdf5d5ca00c3e18430690bf2c953d8d3ffd3c337418173d33dec985dc9/librt-0.11.0-cp312-cp312-manylinux_2_34_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:0d1029d7e1ae1a7e647ed6fb5df8c4ce2dffefb7a9f5fd1376a4554d96dac09f", size = 508105, upload-time = "2026-05-10T18:16:00.2Z" }, + { url = "https://files.pythonhosted.org/packages/07/10/f1f23a7c595ee90ece4d35c851e5d104b1311a887ed1b4ac4c35bbd13da8/librt-0.11.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:bc3ce6b33c5828d9e80592011a5c584cb2ce86edbc4088405f70da47dc1d1b3b", size = 522268, upload-time = "2026-05-10T18:16:01.708Z" }, + { url = "https://files.pythonhosted.org/packages/b6/02/5720f5697a7f54b78b3aefbe20df3a48cedcff1276618c4aa481177942ed/librt-0.11.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:936c5995f3514a42111f20099397d8177c79b4d7e70961e396c6f5a0a3566766", size = 527348, upload-time = "2026-05-10T18:16:03.496Z" }, + { url = "https://files.pythonhosted.org/packages/50/db/b4a47c6f91db4ff76348a0b3dd0cc65e090a078b765a810a62ff9434c3d3/librt-0.11.0-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:9bc0ca6ad9381cbe8e4aa6e5726e4c80c78115a6e9723c599ed1d73e092bc49d", size = 516294, upload-time = "2026-05-10T18:16:05.173Z" }, + { url = "https://files.pythonhosted.org/packages/9e/58/9384b2f4eb1ed1d273d40948a7c5c4b2360213b402ef3be4641c06299f9c/librt-0.11.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:070aa8c26c0a74774317a72df8851facc7f0f012a5b406557ac56992d92e1ec8", size = 553608, upload-time = "2026-05-10T18:16:06.839Z" }, + { url = "https://files.pythonhosted.org/packages/21/7b/5aa8848a7c6a9278c79375146da1812e695754ceec5f005e6043461a7315/librt-0.11.0-cp312-cp312-win32.whl", hash = "sha256:6bf14feb84b05ae945277395451998c89c54d0def4070eb5c08de544930b245a", size = 101879, upload-time = "2026-05-10T18:16:08.103Z" }, + { url = "https://files.pythonhosted.org/packages/37/33/8a745436944947575b584231750a41417de1a38cf6a2e9251d1065651c09/librt-0.11.0-cp312-cp312-win_amd64.whl", hash = "sha256:75672f0bc524ede266287d532d7923dbce94c7514ad07627bac3d0c6d92cc4d9", size = 119831, upload-time = "2026-05-10T18:16:09.174Z" }, + { url = "https://files.pythonhosted.org/packages/59/67/a6739ac96e28b7855808bdb0370e250606104a859750d209e5a0716fe7ab/librt-0.11.0-cp312-cp312-win_arm64.whl", hash = "sha256:2f10cf143e4a9bb0f4f5af568a00df94a2d69ef41c2579584454bb0fe5cc642c", size = 103470, upload-time = "2026-05-10T18:16:10.369Z" }, ] [[package]] name = "markdown" version = "3.10.2" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/2b/f4/69fa6ed85ae003c2378ffa8f6d2e3234662abd02c10d216c0ba96081a238/markdown-3.10.2.tar.gz", hash = "sha256:994d51325d25ad8aa7ce4ebaec003febcce822c3f8c911e3b17c52f7f589f950", size = 368805, upload_time = "2026-02-09T14:57:26.942Z" } +sdist = { url = "https://files.pythonhosted.org/packages/2b/f4/69fa6ed85ae003c2378ffa8f6d2e3234662abd02c10d216c0ba96081a238/markdown-3.10.2.tar.gz", hash = "sha256:994d51325d25ad8aa7ce4ebaec003febcce822c3f8c911e3b17c52f7f589f950", size = 368805, upload-time = "2026-02-09T14:57:26.942Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/de/1f/77fa3081e4f66ca3576c896ae5d31c3002ac6607f9747d2e3aa49227e464/markdown-3.10.2-py3-none-any.whl", hash = "sha256:e91464b71ae3ee7afd3017d9f358ef0baf158fd9a298db92f1d4761133824c36", size = 108180, upload_time = "2026-02-09T14:57:25.787Z" }, + { url = "https://files.pythonhosted.org/packages/de/1f/77fa3081e4f66ca3576c896ae5d31c3002ac6607f9747d2e3aa49227e464/markdown-3.10.2-py3-none-any.whl", hash = "sha256:e91464b71ae3ee7afd3017d9f358ef0baf158fd9a298db92f1d4761133824c36", size = 108180, upload-time = "2026-02-09T14:57:25.787Z" }, ] [[package]] name = "markupsafe" version = "3.0.3" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/7e/99/7690b6d4034fffd95959cbe0c02de8deb3098cc577c67bb6a24fe5d7caa7/markupsafe-3.0.3.tar.gz", hash = "sha256:722695808f4b6457b320fdc131280796bdceb04ab50fe1795cd540799ebe1698", size = 80313, upload_time = "2025-09-27T18:37:40.426Z" } +sdist = { url = "https://files.pythonhosted.org/packages/7e/99/7690b6d4034fffd95959cbe0c02de8deb3098cc577c67bb6a24fe5d7caa7/markupsafe-3.0.3.tar.gz", hash = "sha256:722695808f4b6457b320fdc131280796bdceb04ab50fe1795cd540799ebe1698", size = 80313, upload-time = "2025-09-27T18:37:40.426Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/5a/72/147da192e38635ada20e0a2e1a51cf8823d2119ce8883f7053879c2199b5/markupsafe-3.0.3-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:d53197da72cc091b024dd97249dfc7794d6a56530370992a5e1a08983ad9230e", size = 11615, upload_time = "2025-09-27T18:36:30.854Z" }, - { url = "https://files.pythonhosted.org/packages/9a/81/7e4e08678a1f98521201c3079f77db69fb552acd56067661f8c2f534a718/markupsafe-3.0.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:1872df69a4de6aead3491198eaf13810b565bdbeec3ae2dc8780f14458ec73ce", size = 12020, upload_time = "2025-09-27T18:36:31.971Z" }, - { url = "https://files.pythonhosted.org/packages/1e/2c/799f4742efc39633a1b54a92eec4082e4f815314869865d876824c257c1e/markupsafe-3.0.3-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:3a7e8ae81ae39e62a41ec302f972ba6ae23a5c5396c8e60113e9066ef893da0d", size = 24332, upload_time = "2025-09-27T18:36:32.813Z" }, - { url = "https://files.pythonhosted.org/packages/3c/2e/8d0c2ab90a8c1d9a24f0399058ab8519a3279d1bd4289511d74e909f060e/markupsafe-3.0.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d6dd0be5b5b189d31db7cda48b91d7e0a9795f31430b7f271219ab30f1d3ac9d", size = 22947, upload_time = "2025-09-27T18:36:33.86Z" }, - { url = "https://files.pythonhosted.org/packages/2c/54/887f3092a85238093a0b2154bd629c89444f395618842e8b0c41783898ea/markupsafe-3.0.3-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:94c6f0bb423f739146aec64595853541634bde58b2135f27f61c1ffd1cd4d16a", size = 21962, upload_time = "2025-09-27T18:36:35.099Z" }, - { url = "https://files.pythonhosted.org/packages/c9/2f/336b8c7b6f4a4d95e91119dc8521402461b74a485558d8f238a68312f11c/markupsafe-3.0.3-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:be8813b57049a7dc738189df53d69395eba14fb99345e0a5994914a3864c8a4b", size = 23760, upload_time = "2025-09-27T18:36:36.001Z" }, - { url = "https://files.pythonhosted.org/packages/32/43/67935f2b7e4982ffb50a4d169b724d74b62a3964bc1a9a527f5ac4f1ee2b/markupsafe-3.0.3-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:83891d0e9fb81a825d9a6d61e3f07550ca70a076484292a70fde82c4b807286f", size = 21529, upload_time = "2025-09-27T18:36:36.906Z" }, - { url = "https://files.pythonhosted.org/packages/89/e0/4486f11e51bbba8b0c041098859e869e304d1c261e59244baa3d295d47b7/markupsafe-3.0.3-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:77f0643abe7495da77fb436f50f8dab76dbc6e5fd25d39589a0f1fe6548bfa2b", size = 23015, upload_time = "2025-09-27T18:36:37.868Z" }, - { url = "https://files.pythonhosted.org/packages/2f/e1/78ee7a023dac597a5825441ebd17170785a9dab23de95d2c7508ade94e0e/markupsafe-3.0.3-cp312-cp312-win32.whl", hash = "sha256:d88b440e37a16e651bda4c7c2b930eb586fd15ca7406cb39e211fcff3bf3017d", size = 14540, upload_time = "2025-09-27T18:36:38.761Z" }, - { url = "https://files.pythonhosted.org/packages/aa/5b/bec5aa9bbbb2c946ca2733ef9c4ca91c91b6a24580193e891b5f7dbe8e1e/markupsafe-3.0.3-cp312-cp312-win_amd64.whl", hash = "sha256:26a5784ded40c9e318cfc2bdb30fe164bdb8665ded9cd64d500a34fb42067b1c", size = 15105, upload_time = "2025-09-27T18:36:39.701Z" }, - { url = "https://files.pythonhosted.org/packages/e5/f1/216fc1bbfd74011693a4fd837e7026152e89c4bcf3e77b6692fba9923123/markupsafe-3.0.3-cp312-cp312-win_arm64.whl", hash = "sha256:35add3b638a5d900e807944a078b51922212fb3dedb01633a8defc4b01a3c85f", size = 13906, upload_time = "2025-09-27T18:36:40.689Z" }, + { url = "https://files.pythonhosted.org/packages/5a/72/147da192e38635ada20e0a2e1a51cf8823d2119ce8883f7053879c2199b5/markupsafe-3.0.3-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:d53197da72cc091b024dd97249dfc7794d6a56530370992a5e1a08983ad9230e", size = 11615, upload-time = "2025-09-27T18:36:30.854Z" }, + { url = "https://files.pythonhosted.org/packages/9a/81/7e4e08678a1f98521201c3079f77db69fb552acd56067661f8c2f534a718/markupsafe-3.0.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:1872df69a4de6aead3491198eaf13810b565bdbeec3ae2dc8780f14458ec73ce", size = 12020, upload-time = "2025-09-27T18:36:31.971Z" }, + { url = "https://files.pythonhosted.org/packages/1e/2c/799f4742efc39633a1b54a92eec4082e4f815314869865d876824c257c1e/markupsafe-3.0.3-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:3a7e8ae81ae39e62a41ec302f972ba6ae23a5c5396c8e60113e9066ef893da0d", size = 24332, upload-time = "2025-09-27T18:36:32.813Z" }, + { url = "https://files.pythonhosted.org/packages/3c/2e/8d0c2ab90a8c1d9a24f0399058ab8519a3279d1bd4289511d74e909f060e/markupsafe-3.0.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d6dd0be5b5b189d31db7cda48b91d7e0a9795f31430b7f271219ab30f1d3ac9d", size = 22947, upload-time = "2025-09-27T18:36:33.86Z" }, + { url = "https://files.pythonhosted.org/packages/2c/54/887f3092a85238093a0b2154bd629c89444f395618842e8b0c41783898ea/markupsafe-3.0.3-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:94c6f0bb423f739146aec64595853541634bde58b2135f27f61c1ffd1cd4d16a", size = 21962, upload-time = "2025-09-27T18:36:35.099Z" }, + { url = "https://files.pythonhosted.org/packages/c9/2f/336b8c7b6f4a4d95e91119dc8521402461b74a485558d8f238a68312f11c/markupsafe-3.0.3-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:be8813b57049a7dc738189df53d69395eba14fb99345e0a5994914a3864c8a4b", size = 23760, upload-time = "2025-09-27T18:36:36.001Z" }, + { url = "https://files.pythonhosted.org/packages/32/43/67935f2b7e4982ffb50a4d169b724d74b62a3964bc1a9a527f5ac4f1ee2b/markupsafe-3.0.3-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:83891d0e9fb81a825d9a6d61e3f07550ca70a076484292a70fde82c4b807286f", size = 21529, upload-time = "2025-09-27T18:36:36.906Z" }, + { url = "https://files.pythonhosted.org/packages/89/e0/4486f11e51bbba8b0c041098859e869e304d1c261e59244baa3d295d47b7/markupsafe-3.0.3-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:77f0643abe7495da77fb436f50f8dab76dbc6e5fd25d39589a0f1fe6548bfa2b", size = 23015, upload-time = "2025-09-27T18:36:37.868Z" }, + { url = "https://files.pythonhosted.org/packages/2f/e1/78ee7a023dac597a5825441ebd17170785a9dab23de95d2c7508ade94e0e/markupsafe-3.0.3-cp312-cp312-win32.whl", hash = "sha256:d88b440e37a16e651bda4c7c2b930eb586fd15ca7406cb39e211fcff3bf3017d", size = 14540, upload-time = "2025-09-27T18:36:38.761Z" }, + { url = "https://files.pythonhosted.org/packages/aa/5b/bec5aa9bbbb2c946ca2733ef9c4ca91c91b6a24580193e891b5f7dbe8e1e/markupsafe-3.0.3-cp312-cp312-win_amd64.whl", hash = "sha256:26a5784ded40c9e318cfc2bdb30fe164bdb8665ded9cd64d500a34fb42067b1c", size = 15105, upload-time = "2025-09-27T18:36:39.701Z" }, + { url = "https://files.pythonhosted.org/packages/e5/f1/216fc1bbfd74011693a4fd837e7026152e89c4bcf3e77b6692fba9923123/markupsafe-3.0.3-cp312-cp312-win_arm64.whl", hash = "sha256:35add3b638a5d900e807944a078b51922212fb3dedb01633a8defc4b01a3c85f", size = 13906, upload-time = "2025-09-27T18:36:40.689Z" }, ] [[package]] @@ -107,43 +107,43 @@ dependencies = [ { name = "pathspec" }, { name = "typing-extensions" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/82/15/cca9d88503549ed6fedeaa1d448cdddd542ee8a490232d732e278036fbf2/mypy-2.1.0.tar.gz", hash = "sha256:81e76ad12c2d804512e9b13240d1588316531bfba07558286078bfbce9613633", size = 3898359, upload_time = "2026-05-11T18:37:36.237Z" } +sdist = { url = "https://files.pythonhosted.org/packages/82/15/cca9d88503549ed6fedeaa1d448cdddd542ee8a490232d732e278036fbf2/mypy-2.1.0.tar.gz", hash = "sha256:81e76ad12c2d804512e9b13240d1588316531bfba07558286078bfbce9613633", size = 3898359, upload-time = "2026-05-11T18:37:36.237Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/95/b1/55861beb5c339b44f9a2ba92df9e2cb1eeb4ae1eee674cdf7772c797778b/mypy-2.1.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:244358bf1c0da7722230bce60683d52e8e9fd030554926f15b747a84efb5b3af", size = 14874381, upload_time = "2026-05-11T18:37:31.784Z" }, - { url = "https://files.pythonhosted.org/packages/0b/b3/b7f770114b7d0ac92d0f76e8d93c2780844a70488a90e91821927850da86/mypy-2.1.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:4ec7c57657493c7a75534df2751c8ae2cda383c16ecc55d2106c54476b1b16f6", size = 13665501, upload_time = "2026-05-11T18:34:23.063Z" }, - { url = "https://files.pythonhosted.org/packages/b6/f3/8ae2037967e2126689a0c11d99e2b707134a565191e92c60ca2572aec60a/mypy-2.1.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:d8161b6ff4392410023224f0969d17db93e1e154bc3e4ba62598e720723ae211", size = 14045750, upload_time = "2026-05-11T18:31:48.151Z" }, - { url = "https://files.pythonhosted.org/packages/a0/32/615eb5911859e43d054941b0d0a7d06cfa2870eba86529cf385b052b111c/mypy-2.1.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:bf03e12003084a67395184d3eb8cbd6a489dc3655b5664b28c210a9e2403ab0b", size = 15061630, upload_time = "2026-05-11T18:37:06.898Z" }, - { url = "https://files.pythonhosted.org/packages/d4/03/4eafbfff8bfab1b87082741eae6e6a624028c984e6708b73bce2a8570c9d/mypy-2.1.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:20509760fd791c51579d573153407d226385ec1f8bcce55d730b354f3336bc22", size = 15288831, upload_time = "2026-05-11T18:31:18.07Z" }, - { url = "https://files.pythonhosted.org/packages/99/ee/919661478e5891a3c96e549c036e467e64563ab85995b10c53c8358e16a3/mypy-2.1.0-cp312-cp312-win_amd64.whl", hash = "sha256:6753d0c1fdd6b1a23b9e4f283ce80b2153b724adcb2653b20b85a8a28ac6436b", size = 11135228, upload_time = "2026-05-11T18:34:31.23Z" }, - { url = "https://files.pythonhosted.org/packages/24/0a/6a12b9782ca0831a553192f351679f4548abc9d19a7cc93bb7feb02084c7/mypy-2.1.0-cp312-cp312-win_arm64.whl", hash = "sha256:98ebb6589bb3b6d0c6f0c459d53ca55b8091fbc13d277c4041c885392e8195e8", size = 10040684, upload_time = "2026-05-11T18:36:48.199Z" }, - { url = "https://files.pythonhosted.org/packages/0d/2a/13ca1f292f6db1b98ff495ef3467736b331621c5917cad984b7043e7348d/mypy-2.1.0-py3-none-any.whl", hash = "sha256:a663814603a5c563fb87a4f96fb473eeb30d1f5a4885afcf44f9db000a366289", size = 2693302, upload_time = "2026-05-11T18:31:29.246Z" }, + { url = "https://files.pythonhosted.org/packages/95/b1/55861beb5c339b44f9a2ba92df9e2cb1eeb4ae1eee674cdf7772c797778b/mypy-2.1.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:244358bf1c0da7722230bce60683d52e8e9fd030554926f15b747a84efb5b3af", size = 14874381, upload-time = "2026-05-11T18:37:31.784Z" }, + { url = "https://files.pythonhosted.org/packages/0b/b3/b7f770114b7d0ac92d0f76e8d93c2780844a70488a90e91821927850da86/mypy-2.1.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:4ec7c57657493c7a75534df2751c8ae2cda383c16ecc55d2106c54476b1b16f6", size = 13665501, upload-time = "2026-05-11T18:34:23.063Z" }, + { url = "https://files.pythonhosted.org/packages/b6/f3/8ae2037967e2126689a0c11d99e2b707134a565191e92c60ca2572aec60a/mypy-2.1.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:d8161b6ff4392410023224f0969d17db93e1e154bc3e4ba62598e720723ae211", size = 14045750, upload-time = "2026-05-11T18:31:48.151Z" }, + { url = "https://files.pythonhosted.org/packages/a0/32/615eb5911859e43d054941b0d0a7d06cfa2870eba86529cf385b052b111c/mypy-2.1.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:bf03e12003084a67395184d3eb8cbd6a489dc3655b5664b28c210a9e2403ab0b", size = 15061630, upload-time = "2026-05-11T18:37:06.898Z" }, + { url = "https://files.pythonhosted.org/packages/d4/03/4eafbfff8bfab1b87082741eae6e6a624028c984e6708b73bce2a8570c9d/mypy-2.1.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:20509760fd791c51579d573153407d226385ec1f8bcce55d730b354f3336bc22", size = 15288831, upload-time = "2026-05-11T18:31:18.07Z" }, + { url = "https://files.pythonhosted.org/packages/99/ee/919661478e5891a3c96e549c036e467e64563ab85995b10c53c8358e16a3/mypy-2.1.0-cp312-cp312-win_amd64.whl", hash = "sha256:6753d0c1fdd6b1a23b9e4f283ce80b2153b724adcb2653b20b85a8a28ac6436b", size = 11135228, upload-time = "2026-05-11T18:34:31.23Z" }, + { url = "https://files.pythonhosted.org/packages/24/0a/6a12b9782ca0831a553192f351679f4548abc9d19a7cc93bb7feb02084c7/mypy-2.1.0-cp312-cp312-win_arm64.whl", hash = "sha256:98ebb6589bb3b6d0c6f0c459d53ca55b8091fbc13d277c4041c885392e8195e8", size = 10040684, upload-time = "2026-05-11T18:36:48.199Z" }, + { url = "https://files.pythonhosted.org/packages/0d/2a/13ca1f292f6db1b98ff495ef3467736b331621c5917cad984b7043e7348d/mypy-2.1.0-py3-none-any.whl", hash = "sha256:a663814603a5c563fb87a4f96fb473eeb30d1f5a4885afcf44f9db000a366289", size = 2693302, upload-time = "2026-05-11T18:31:29.246Z" }, ] [[package]] name = "mypy-extensions" version = "1.1.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/a2/6e/371856a3fb9d31ca8dac321cda606860fa4548858c0cc45d9d1d4ca2628b/mypy_extensions-1.1.0.tar.gz", hash = "sha256:52e68efc3284861e772bbcd66823fde5ae21fd2fdb51c62a211403730b916558", size = 6343, upload_time = "2025-04-22T14:54:24.164Z" } +sdist = { url = "https://files.pythonhosted.org/packages/a2/6e/371856a3fb9d31ca8dac321cda606860fa4548858c0cc45d9d1d4ca2628b/mypy_extensions-1.1.0.tar.gz", hash = "sha256:52e68efc3284861e772bbcd66823fde5ae21fd2fdb51c62a211403730b916558", size = 6343, upload-time = "2025-04-22T14:54:24.164Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/79/7b/2c79738432f5c924bef5071f933bcc9efd0473bac3b4aa584a6f7c1c8df8/mypy_extensions-1.1.0-py3-none-any.whl", hash = "sha256:1be4cccdb0f2482337c4743e60421de3a356cd97508abadd57d47403e94f5505", size = 4963, upload_time = "2025-04-22T14:54:22.983Z" }, + { url = "https://files.pythonhosted.org/packages/79/7b/2c79738432f5c924bef5071f933bcc9efd0473bac3b4aa584a6f7c1c8df8/mypy_extensions-1.1.0-py3-none-any.whl", hash = "sha256:1be4cccdb0f2482337c4743e60421de3a356cd97508abadd57d47403e94f5505", size = 4963, upload-time = "2025-04-22T14:54:22.983Z" }, ] [[package]] name = "nodeenv" version = "1.10.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/24/bf/d1bda4f6168e0b2e9e5958945e01910052158313224ada5ce1fb2e1113b8/nodeenv-1.10.0.tar.gz", hash = "sha256:996c191ad80897d076bdfba80a41994c2b47c68e224c542b48feba42ba00f8bb", size = 55611, upload_time = "2025-12-20T14:08:54.006Z" } +sdist = { url = "https://files.pythonhosted.org/packages/24/bf/d1bda4f6168e0b2e9e5958945e01910052158313224ada5ce1fb2e1113b8/nodeenv-1.10.0.tar.gz", hash = "sha256:996c191ad80897d076bdfba80a41994c2b47c68e224c542b48feba42ba00f8bb", size = 55611, upload-time = "2025-12-20T14:08:54.006Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/88/b2/d0896bdcdc8d28a7fc5717c305f1a861c26e18c05047949fb371034d98bd/nodeenv-1.10.0-py2.py3-none-any.whl", hash = "sha256:5bb13e3eed2923615535339b3c620e76779af4cb4c6a90deccc9e36b274d3827", size = 23438, upload_time = "2025-12-20T14:08:52.782Z" }, + { url = "https://files.pythonhosted.org/packages/88/b2/d0896bdcdc8d28a7fc5717c305f1a861c26e18c05047949fb371034d98bd/nodeenv-1.10.0-py2.py3-none-any.whl", hash = "sha256:5bb13e3eed2923615535339b3c620e76779af4cb4c6a90deccc9e36b274d3827", size = 23438, upload-time = "2025-12-20T14:08:52.782Z" }, ] [[package]] name = "pathspec" version = "1.0.4" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/fa/36/e27608899f9b8d4dff0617b2d9ab17ca5608956ca44461ac14ac48b44015/pathspec-1.0.4.tar.gz", hash = "sha256:0210e2ae8a21a9137c0d470578cb0e595af87edaa6ebf12ff176f14a02e0e645", size = 131200, upload_time = "2026-01-27T03:59:46.938Z" } +sdist = { url = "https://files.pythonhosted.org/packages/fa/36/e27608899f9b8d4dff0617b2d9ab17ca5608956ca44461ac14ac48b44015/pathspec-1.0.4.tar.gz", hash = "sha256:0210e2ae8a21a9137c0d470578cb0e595af87edaa6ebf12ff176f14a02e0e645", size = 131200, upload-time = "2026-01-27T03:59:46.938Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/ef/3c/2c197d226f9ea224a9ab8d197933f9da0ae0aac5b6e0f884e2b8d9c8e9f7/pathspec-1.0.4-py3-none-any.whl", hash = "sha256:fb6ae2fd4e7c921a165808a552060e722767cfa526f99ca5156ed2ce45a5c723", size = 55206, upload_time = "2026-01-27T03:59:45.137Z" }, + { url = "https://files.pythonhosted.org/packages/ef/3c/2c197d226f9ea224a9ab8d197933f9da0ae0aac5b6e0f884e2b8d9c8e9f7/pathspec-1.0.4-py3-none-any.whl", hash = "sha256:fb6ae2fd4e7c921a165808a552060e722767cfa526f99ca5156ed2ce45a5c723", size = 55206, upload-time = "2026-01-27T03:59:45.137Z" }, ] [[package]] @@ -154,28 +154,28 @@ dependencies = [ { name = "typeshed-client" }, { name = "typing-extensions" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/7c/8e/284fdc4027bf9a7c92f8256ff07006a50456ccd2ce5506d040e6ed2f2f1b/pycroscope-0.4.0.tar.gz", hash = "sha256:14b40e36f6186dd2eff712c8da91d02eb89a263a257472b49f4c59153ff380fb", size = 662901, upload_time = "2026-05-02T14:00:43.775Z" } +sdist = { url = "https://files.pythonhosted.org/packages/7c/8e/284fdc4027bf9a7c92f8256ff07006a50456ccd2ce5506d040e6ed2f2f1b/pycroscope-0.4.0.tar.gz", hash = "sha256:14b40e36f6186dd2eff712c8da91d02eb89a263a257472b49f4c59153ff380fb", size = 662901, upload-time = "2026-05-02T14:00:43.775Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/50/5f/c172c08b69e29d4094e1466b63260d8daf61a3ed3c689de7936f952f1663/pycroscope-0.4.0-py3-none-any.whl", hash = "sha256:cb7440b44ed16ed927995c33867cab22503f4bff7efe504964b81fb967183223", size = 714256, upload_time = "2026-05-02T14:00:41.891Z" }, + { url = "https://files.pythonhosted.org/packages/50/5f/c172c08b69e29d4094e1466b63260d8daf61a3ed3c689de7936f952f1663/pycroscope-0.4.0-py3-none-any.whl", hash = "sha256:cb7440b44ed16ed927995c33867cab22503f4bff7efe504964b81fb967183223", size = 714256, upload-time = "2026-05-02T14:00:41.891Z" }, ] [[package]] name = "pyrefly" version = "1.3.0.dev1" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/a5/de/fe8d8567d1d092f5d67bb8bbe0863a44919482a37febc79db8aa88088532/pyrefly-1.3.0.dev1.tar.gz", hash = "sha256:189e0e1d3212ab4ecff1d058f9e095fa9711e5e4c19436f7370ceef05d1788fd", size = 6306791, upload_time = "2026-08-07T01:56:51.009Z" } +sdist = { url = "https://files.pythonhosted.org/packages/a5/de/fe8d8567d1d092f5d67bb8bbe0863a44919482a37febc79db8aa88088532/pyrefly-1.3.0.dev1.tar.gz", hash = "sha256:189e0e1d3212ab4ecff1d058f9e095fa9711e5e4c19436f7370ceef05d1788fd", size = 6306791, upload-time = "2026-08-07T01:56:51.009Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/ba/6a/ca1ea8084f000ecbf7d6a2a8cde3f2d6f437d0d527f5f0bda0a383fb011f/pyrefly-1.3.0.dev1-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:327e245a54357794954a7788d22dd446b90dcc403d0d82414b0b20b6fa37648c", size = 14210092, upload_time = "2026-08-07T01:56:17.895Z" }, - { url = "https://files.pythonhosted.org/packages/a2/df/0f405798d99900a6809483db0262c820ccccdf13b379789d9280d848b9a0/pyrefly-1.3.0.dev1-py3-none-macosx_11_0_arm64.whl", hash = "sha256:00e5d88265c5e3088ac566dd4cf542a13f93e76f7672b738c1306d5d5cae6123", size = 13639017, upload_time = "2026-08-07T01:56:21.181Z" }, - { url = "https://files.pythonhosted.org/packages/4b/28/a41e1daab805124cdefc46566251555bbe0caf24668a851393971eb5cbd7/pyrefly-1.3.0.dev1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c2dcce81731dcc0dcd199b6b0117ebd3df2ee1fc4910f508cb84aa7615182f28", size = 14084976, upload_time = "2026-08-07T01:56:24.551Z" }, - { url = "https://files.pythonhosted.org/packages/df/9c/985e6ab05ab7927d5f6eb8420958957b707f8fbdcb012001b967286a46cc/pyrefly-1.3.0.dev1-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:56a855f5784978e990effe760e0eaab60b98a0add9bebb79af901d9a8269696d", size = 15230694, upload_time = "2026-08-07T01:56:27.722Z" }, - { url = "https://files.pythonhosted.org/packages/55/73/1368adde6c6f29bd88d5929211291a17c4cf9bddaafd0a3ab330d463ed10/pyrefly-1.3.0.dev1-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a0e36aede58dffab44a67ac0f322e416d0fa4955c80d491fc7e0fe80c1a73a5d", size = 15170348, upload_time = "2026-08-07T01:56:30.86Z" }, - { url = "https://files.pythonhosted.org/packages/2c/28/172a588415c48b2eb2eccabbfb3e21c5c95ddeb1022ca96b5fde75c5f71a/pyrefly-1.3.0.dev1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fdb58f30ec64ae44268baa58fcf01f0fdfba44c3153591c8b76a16a57df44ee4", size = 14582792, upload_time = "2026-08-07T01:56:34.052Z" }, - { url = "https://files.pythonhosted.org/packages/fa/8f/c7211d118a5dfb08e24655ff5c4414fda0b281de64cf83834da9fd1bbcd2/pyrefly-1.3.0.dev1-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:c4e6e3c80416636666d2a9cbca0fd32dbba51e54da4e7a5a6ba3388bfbacf612", size = 14106287, upload_time = "2026-08-07T01:56:37.073Z" }, - { url = "https://files.pythonhosted.org/packages/d5/f4/642addd2e33daf1cc2357150db5c6ab6a81bd378281203552d5e509c6f02/pyrefly-1.3.0.dev1-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:1672be7086ae54d8dfce02eb612894c3ad51c42e03b4769d0e45a9d9e622d4ed", size = 14617068, upload_time = "2026-08-07T01:56:39.913Z" }, - { url = "https://files.pythonhosted.org/packages/3b/17/e4a7c0f6ded01370f3267058f5bb2a10487d200dc5a29058fbff34aa9820/pyrefly-1.3.0.dev1-py3-none-win32.whl", hash = "sha256:7dd496f3642bba6764f3c4c9f189ef021a30fc05261087316e4d6bb9beace65e", size = 13403475, upload_time = "2026-08-07T01:56:42.782Z" }, - { url = "https://files.pythonhosted.org/packages/61/79/2a366f1b65c177e42f67b8540e7372e258d0880eed957859bbf5b1ff7d0e/pyrefly-1.3.0.dev1-py3-none-win_amd64.whl", hash = "sha256:70baea8d7577be7f50a5dbbf5819f5cb335208e97793846e14d80ebd8f90f6c4", size = 14264341, upload_time = "2026-08-07T01:56:45.772Z" }, - { url = "https://files.pythonhosted.org/packages/c8/f9/abe77e5154b1c56d60831aade2d4b6e9e9d2c458860e5fd9fc30a2fc720e/pyrefly-1.3.0.dev1-py3-none-win_arm64.whl", hash = "sha256:d5070fecbe7b22eaf46b1da510fe5ea3c69b17f805dfbc04753d9501ce24f54e", size = 13607012, upload_time = "2026-08-07T01:56:48.638Z" }, + { url = "https://files.pythonhosted.org/packages/ba/6a/ca1ea8084f000ecbf7d6a2a8cde3f2d6f437d0d527f5f0bda0a383fb011f/pyrefly-1.3.0.dev1-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:327e245a54357794954a7788d22dd446b90dcc403d0d82414b0b20b6fa37648c", size = 14210092, upload-time = "2026-08-07T01:56:17.895Z" }, + { url = "https://files.pythonhosted.org/packages/a2/df/0f405798d99900a6809483db0262c820ccccdf13b379789d9280d848b9a0/pyrefly-1.3.0.dev1-py3-none-macosx_11_0_arm64.whl", hash = "sha256:00e5d88265c5e3088ac566dd4cf542a13f93e76f7672b738c1306d5d5cae6123", size = 13639017, upload-time = "2026-08-07T01:56:21.181Z" }, + { url = "https://files.pythonhosted.org/packages/4b/28/a41e1daab805124cdefc46566251555bbe0caf24668a851393971eb5cbd7/pyrefly-1.3.0.dev1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c2dcce81731dcc0dcd199b6b0117ebd3df2ee1fc4910f508cb84aa7615182f28", size = 14084976, upload-time = "2026-08-07T01:56:24.551Z" }, + { url = "https://files.pythonhosted.org/packages/df/9c/985e6ab05ab7927d5f6eb8420958957b707f8fbdcb012001b967286a46cc/pyrefly-1.3.0.dev1-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:56a855f5784978e990effe760e0eaab60b98a0add9bebb79af901d9a8269696d", size = 15230694, upload-time = "2026-08-07T01:56:27.722Z" }, + { url = "https://files.pythonhosted.org/packages/55/73/1368adde6c6f29bd88d5929211291a17c4cf9bddaafd0a3ab330d463ed10/pyrefly-1.3.0.dev1-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a0e36aede58dffab44a67ac0f322e416d0fa4955c80d491fc7e0fe80c1a73a5d", size = 15170348, upload-time = "2026-08-07T01:56:30.86Z" }, + { url = "https://files.pythonhosted.org/packages/2c/28/172a588415c48b2eb2eccabbfb3e21c5c95ddeb1022ca96b5fde75c5f71a/pyrefly-1.3.0.dev1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fdb58f30ec64ae44268baa58fcf01f0fdfba44c3153591c8b76a16a57df44ee4", size = 14582792, upload-time = "2026-08-07T01:56:34.052Z" }, + { url = "https://files.pythonhosted.org/packages/fa/8f/c7211d118a5dfb08e24655ff5c4414fda0b281de64cf83834da9fd1bbcd2/pyrefly-1.3.0.dev1-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:c4e6e3c80416636666d2a9cbca0fd32dbba51e54da4e7a5a6ba3388bfbacf612", size = 14106287, upload-time = "2026-08-07T01:56:37.073Z" }, + { url = "https://files.pythonhosted.org/packages/d5/f4/642addd2e33daf1cc2357150db5c6ab6a81bd378281203552d5e509c6f02/pyrefly-1.3.0.dev1-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:1672be7086ae54d8dfce02eb612894c3ad51c42e03b4769d0e45a9d9e622d4ed", size = 14617068, upload-time = "2026-08-07T01:56:39.913Z" }, + { url = "https://files.pythonhosted.org/packages/3b/17/e4a7c0f6ded01370f3267058f5bb2a10487d200dc5a29058fbff34aa9820/pyrefly-1.3.0.dev1-py3-none-win32.whl", hash = "sha256:7dd496f3642bba6764f3c4c9f189ef021a30fc05261087316e4d6bb9beace65e", size = 13403475, upload-time = "2026-08-07T01:56:42.782Z" }, + { url = "https://files.pythonhosted.org/packages/61/79/2a366f1b65c177e42f67b8540e7372e258d0880eed957859bbf5b1ff7d0e/pyrefly-1.3.0.dev1-py3-none-win_amd64.whl", hash = "sha256:70baea8d7577be7f50a5dbbf5819f5cb335208e97793846e14d80ebd8f90f6c4", size = 14264341, upload-time = "2026-08-07T01:56:45.772Z" }, + { url = "https://files.pythonhosted.org/packages/c8/f9/abe77e5154b1c56d60831aade2d4b6e9e9d2c458860e5fd9fc30a2fc720e/pyrefly-1.3.0.dev1-py3-none-win_arm64.whl", hash = "sha256:d5070fecbe7b22eaf46b1da510fe5ea3c69b17f805dfbc04753d9501ce24f54e", size = 13607012, upload-time = "2026-08-07T01:56:48.638Z" }, ] [[package]] @@ -186,52 +186,52 @@ dependencies = [ { name = "nodeenv" }, { name = "typing-extensions" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/10/53/e4d8ea1391bd4355231be6f91bf239479aa0014260ed3fb5526eeb12a1f2/pyright-1.1.410.tar.gz", hash = "sha256:07a073b8ba6749826773c1269773efa11b93440d9a6aa60419d9a3172d6dc488", size = 4062013, upload_time = "2026-06-01T17:35:48.894Z" } +sdist = { url = "https://files.pythonhosted.org/packages/10/53/e4d8ea1391bd4355231be6f91bf239479aa0014260ed3fb5526eeb12a1f2/pyright-1.1.410.tar.gz", hash = "sha256:07a073b8ba6749826773c1269773efa11b93440d9a6aa60419d9a3172d6dc488", size = 4062013, upload-time = "2026-06-01T17:35:48.894Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/d7/33/288b5868fa00846dacf249633719d747893e54aebd196b9968ac1878a5d3/pyright-1.1.410-py3-none-any.whl", hash = "sha256:5e961bed37cacf96b3f7cd7b1da39b350a9239aa2e69138d0e88f728cfaf296c", size = 6082448, upload_time = "2026-06-01T17:35:46.387Z" }, + { url = "https://files.pythonhosted.org/packages/d7/33/288b5868fa00846dacf249633719d747893e54aebd196b9968ac1878a5d3/pyright-1.1.410-py3-none-any.whl", hash = "sha256:5e961bed37cacf96b3f7cd7b1da39b350a9239aa2e69138d0e88f728cfaf296c", size = 6082448, upload-time = "2026-06-01T17:35:46.387Z" }, ] [[package]] name = "tomlkit" version = "0.14.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/c3/af/14b24e41977adb296d6bd1fb59402cf7d60ce364f90c890bd2ec65c43b5a/tomlkit-0.14.0.tar.gz", hash = "sha256:cf00efca415dbd57575befb1f6634c4f42d2d87dbba376128adb42c121b87064", size = 187167, upload_time = "2026-01-13T01:14:53.304Z" } +sdist = { url = "https://files.pythonhosted.org/packages/c3/af/14b24e41977adb296d6bd1fb59402cf7d60ce364f90c890bd2ec65c43b5a/tomlkit-0.14.0.tar.gz", hash = "sha256:cf00efca415dbd57575befb1f6634c4f42d2d87dbba376128adb42c121b87064", size = 187167, upload-time = "2026-01-13T01:14:53.304Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/b5/11/87d6d29fb5d237229d67973a6c9e06e048f01cf4994dee194ab0ea841814/tomlkit-0.14.0-py3-none-any.whl", hash = "sha256:592064ed85b40fa213469f81ac584f67a4f2992509a7c3ea2d632208623a3680", size = 39310, upload_time = "2026-01-13T01:14:51.965Z" }, + { url = "https://files.pythonhosted.org/packages/b5/11/87d6d29fb5d237229d67973a6c9e06e048f01cf4994dee194ab0ea841814/tomlkit-0.14.0-py3-none-any.whl", hash = "sha256:592064ed85b40fa213469f81ac584f67a4f2992509a7c3ea2d632208623a3680", size = 39310, upload-time = "2026-01-13T01:14:51.965Z" }, ] [[package]] name = "ty" -version = "0.0.67" +version = "0.0.70" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/d3/aa/e153d47aef36891729ff2a7dd7350d04df73f81ef8117257b518c771956e/ty-0.0.67.tar.gz", hash = "sha256:8926130a1d5a11b228f72bc6a7680cf4f75be99064dfe3ad161fd3b860999603", size = 6550079, upload_time = "2026-08-05T18:43:21.18Z" } +sdist = { url = "https://files.pythonhosted.org/packages/58/ed/38a8ab52f1d7c3ed701442a31b23ba774cbc5d6909f2c00da9e1f3c590f9/ty-0.0.70.tar.gz", hash = "sha256:a01bebc128b4081c16002965d906fccb21323d69bb709b9108c1f2406bcffced", size = 6601156, upload-time = "2026-08-10T23:20:26.268Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/fd/0a/992067ee1bdd30994c0dbdb3674e88a9ea7892dd6008a819c73f9985a1b6/ty-0.0.67-py3-none-linux_armv6l.whl", hash = "sha256:5ad41198feb7d3963f954902d3b33c58b5dc27bd21f4d9cde45dd1ae1ba34677", size = 12353546, upload_time = "2026-08-05T18:42:42.137Z" }, - { url = "https://files.pythonhosted.org/packages/a2/8c/def24d99c4a4e1bfc30ce6d69a913a9bf6bfa8a56fe2b1b3d6bce7e75bdd/ty-0.0.67-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:90f8271d66d0a42bd5f3aab01c51acf70dc7111fe8ffe62c9125a2db1a4f8a55", size = 12023201, upload_time = "2026-08-05T18:42:44.944Z" }, - { url = "https://files.pythonhosted.org/packages/99/11/03c2278fb76f764439045760c11ac7bd407bc534c13138ccc21d60e5d883/ty-0.0.67-py3-none-macosx_11_0_arm64.whl", hash = "sha256:df5d5b4496036fffe3f767691867b57bc67fc2155e9608cb4fcb517dfe4f5761", size = 11522878, upload_time = "2026-08-05T18:42:47.192Z" }, - { url = "https://files.pythonhosted.org/packages/03/47/d4d4e334649db69d7467084aedf02f237b852a8ffba4579d0d193a50dda5/ty-0.0.67-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:de4f90d9152051a697d59f354f30eb76c3e9ec608e2a3c33595bbc88f851ad4e", size = 12093398, upload_time = "2026-08-05T18:42:49.331Z" }, - { url = "https://files.pythonhosted.org/packages/db/24/a551f16dfcd89ff4173757f09f3bb6cb9aa10e6f079c604b949a9c19ba41/ty-0.0.67-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:bccc2361d1f628182ca19b1736c947ca082e7db5f07277a43b316241e07b1350", size = 12141027, upload_time = "2026-08-05T18:42:51.528Z" }, - { url = "https://files.pythonhosted.org/packages/c5/87/9e2baa098b94ea0bce4e3e8b106711a500af50be50519b96e90484e4f4b8/ty-0.0.67-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e0d7eee4a9d7694d64085a8ae12b4d9fc7c162b24e3000befe91737a9a61d1dd", size = 12908208, upload_time = "2026-08-05T18:42:53.844Z" }, - { url = "https://files.pythonhosted.org/packages/42/32/e8c0bfc19cc0a6dbf254933c13b857c2c0c800b86158296d3e4ccdb5702c/ty-0.0.67-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f4309acef52659fb5e030962b60fccd44b4f6b9c19c365738bc5d46a3c138b1e", size = 13404183, upload_time = "2026-08-05T18:42:55.988Z" }, - { url = "https://files.pythonhosted.org/packages/a3/ab/c9faa04a075136741b173058dd81a4070dc0bdf7fe162f8278d61e1b0b3d/ty-0.0.67-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:4daffa097226bcdee4852b61bd05311a49a7286b10042c148450cf6761b287c7", size = 13127241, upload_time = "2026-08-05T18:42:58.826Z" }, - { url = "https://files.pythonhosted.org/packages/a7/e5/47a368bdee8fd8376b6055496b5d2d03650d976b94e924b39332c0861396/ty-0.0.67-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:94b579b8ee3836238b96fb186a99904eea0a56685d6e50f7b54fe530050df07d", size = 12685060, upload_time = "2026-08-05T18:43:01.487Z" }, - { url = "https://files.pythonhosted.org/packages/ce/2d/b78102ca16dd05be36defe18f312deba43606c8870638749908de58b6408/ty-0.0.67-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:3b357d66119c4dc11d7508c40df0338857e470b0041515781effc45ca9211294", size = 12959319, upload_time = "2026-08-05T18:43:03.712Z" }, - { url = "https://files.pythonhosted.org/packages/88/e6/35e5a6d887144463d93c1320558fe6027e02c2cd27658999af04abf56120/ty-0.0.67-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:24043b96d25b9b787b715c08ed7c8bc236cb7800a6fd189967092b9712f523c9", size = 12040267, upload_time = "2026-08-05T18:43:05.91Z" }, - { url = "https://files.pythonhosted.org/packages/69/26/2d81626e029e5fa6a9b03e98141dbf52a6e6b814130e5d7227cbb9b74611/ty-0.0.67-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:4384d7427e1abf5165e010b66d2133d38b2707ef8880eb755de25f2e5b69a3f1", size = 12153207, upload_time = "2026-08-05T18:43:08.039Z" }, - { url = "https://files.pythonhosted.org/packages/df/62/cc61afedad6e8f02303cf2867364d5b30f2f223787c58932870c53e99d65/ty-0.0.67-py3-none-musllinux_1_2_i686.whl", hash = "sha256:761a141c6f6833b62bc5d92558b243adfd11b8084e070aa112c9b7ab9ec90e8b", size = 12446021, upload_time = "2026-08-05T18:43:10.207Z" }, - { url = "https://files.pythonhosted.org/packages/25/c4/8bbc1c641018b4003bb9fdc1a93843055dfa8d771b4d08fb6413b7a94a5a/ty-0.0.67-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:fc80a63d0b9eecc667e16e809d20a1c014668e6be8523db1f7714bc1a84e79c4", size = 12797108, upload_time = "2026-08-05T18:43:12.244Z" }, - { url = "https://files.pythonhosted.org/packages/c9/a4/8b181be30a49f6813822d50e7489eb8fe6287db7f2b635d1de97f82bbf94/ty-0.0.67-py3-none-win32.whl", hash = "sha256:9dc697547cc7972079e77d716b6874fbe7c6e7265d360ba372afdf44f0a103ec", size = 11771788, upload_time = "2026-08-05T18:43:14.375Z" }, - { url = "https://files.pythonhosted.org/packages/a6/bc/948eb72740c23c0ab3bb0a3bb07035e25d7950e862fd987651a8a6f21430/ty-0.0.67-py3-none-win_amd64.whl", hash = "sha256:2c4cdc1dffbfab5476bd708adb90018dd3f8bc796b3608fd60162b6e9c85981a", size = 12818447, upload_time = "2026-08-05T18:43:16.607Z" }, - { url = "https://files.pythonhosted.org/packages/5e/0a/8a2002aed7e4cf7278141984b393b5156e7f42c8aefc9ced9d037a3a3cd9/ty-0.0.67-py3-none-win_arm64.whl", hash = "sha256:6251e59bf4c36486204a0ec3aa758f7b65ef6727f1db7b24b8e90db072ac6eff", size = 12146254, upload_time = "2026-08-05T18:43:18.915Z" }, + { url = "https://files.pythonhosted.org/packages/3d/c5/ddd6cc5657fd3da85591b264f4dabb1ce5e5b535e73fd5174991c294978b/ty-0.0.70-py3-none-linux_armv6l.whl", hash = "sha256:4fb2d2e55e2160c07152361be2e1a26fdd4f6261055731317d5972daf1749935", size = 12537215, upload-time = "2026-08-10T23:19:43.512Z" }, + { url = "https://files.pythonhosted.org/packages/8b/8a/acc9b34331cde81e0d63cda92d4db9e4042def5b1efa7d47431ff1d30d17/ty-0.0.70-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:9b04d4c21cb029501c05598ca21e9c0829c0b2e35a7ceba1e5b78014c1e8104d", size = 12149070, upload-time = "2026-08-10T23:19:46.369Z" }, + { url = "https://files.pythonhosted.org/packages/fd/cd/51ac2708f4d077058a0bfeefa40d630883c5ec7a82fd2c15c86519140235/ty-0.0.70-py3-none-macosx_11_0_arm64.whl", hash = "sha256:c605ebf2643f5e64ec4bcb269640a1aa85966d29fa888fb746039c28570369b2", size = 11625729, upload-time = "2026-08-10T23:19:48.535Z" }, + { url = "https://files.pythonhosted.org/packages/b7/99/afc4fe7e630100dc782ff0cdc8c59c01acfb05299551ff0ef49c93814320/ty-0.0.70-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0c38ea76e12909c29e18fcd295ff223b63f3701c1d1c34db2cdc9736340b9de2", size = 12204810, upload-time = "2026-08-10T23:19:51.845Z" }, + { url = "https://files.pythonhosted.org/packages/ca/38/8cabc3c8ad4c3a02e585ecff12a71ff8e5881f8a00ee71745fd765201da5/ty-0.0.70-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:c1ee6bf4edaabf7bd0307f0c0f9ddc2204df0390820fe89f6a9de65f07722aba", size = 12308114, upload-time = "2026-08-10T23:19:54.229Z" }, + { url = "https://files.pythonhosted.org/packages/44/7e/bb4e552ecd68bb490bae9368ef323e3d0c79ef85a811857139a2d0f59ddb/ty-0.0.70-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:5eef3e11d7d6b800ef66da0cce8ea24f8be804d1ebf359683426cfe848729bf8", size = 13072240, upload-time = "2026-08-10T23:19:56.872Z" }, + { url = "https://files.pythonhosted.org/packages/f6/c4/1861e1d554e5b6e0d11b3a9f36d40c372253f44a3c4e56ad4bf840f2801e/ty-0.0.70-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a95e4ae7c2599197c9d89652e49ca344ab224f7d12376e6ad8beb0587e8ff83f", size = 13497678, upload-time = "2026-08-10T23:19:59.191Z" }, + { url = "https://files.pythonhosted.org/packages/77/22/3b22442133e8f641485e59e463a070a31184db0d6456851f871db8f59763/ty-0.0.70-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:06aca758d1e0016c0a1f57fe9d8de7a21ff83f692306f747a0d97f32de24e27f", size = 13232510, upload-time = "2026-08-10T23:20:01.456Z" }, + { url = "https://files.pythonhosted.org/packages/84/b8/911f1e6885b5485b6e1d29aaab19ce5e6deeb3e931b6ad82296da4f22051/ty-0.0.70-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d81825524f1b57ecbcb5fce7d61fb159cb4837a6167a4569309c9fa7fc15a77d", size = 12817128, upload-time = "2026-08-10T23:20:04.275Z" }, + { url = "https://files.pythonhosted.org/packages/e6/a6/9affc3ca11c32d75b348a66144ab83335fa7fa7100b1581356725e15a668/ty-0.0.70-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:3287dfb09f7320ef28f114f5f9aae5f697b7b1a6ee37fb2a4a3be94481c1b4f8", size = 13089208, upload-time = "2026-08-10T23:20:06.574Z" }, + { url = "https://files.pythonhosted.org/packages/f0/cb/4776108ea08ec4013b71375b101be9c8a632967cd10f24abbdd4664d66f4/ty-0.0.70-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:9fb1877f6401cdaac4db46c5bf762f327482ba5f891420ea462ebd15d0de4185", size = 12148890, upload-time = "2026-08-10T23:20:08.827Z" }, + { url = "https://files.pythonhosted.org/packages/c9/d9/814e71f698d9231ef6412bd2c1499d81c6f86f66c2764e952c991e2d6da5/ty-0.0.70-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:e78f4997dbb0db2d2270210eb3694466206e5b3a11985e24148770e702158a25", size = 12327084, upload-time = "2026-08-10T23:20:11.023Z" }, + { url = "https://files.pythonhosted.org/packages/3b/69/9f34bba534c5d1ace391d300ead4f1971f4348c5459e66dc466cfd60661c/ty-0.0.70-py3-none-musllinux_1_2_i686.whl", hash = "sha256:cf758d3b2dad910c9b1d22d2d62fea894b5bc9acd3c00365e8a73ace6090a452", size = 12604372, upload-time = "2026-08-10T23:20:13.366Z" }, + { url = "https://files.pythonhosted.org/packages/fe/ff/abb34674517b29a8e2489a39c4e01930fcf6aab993a7d6b33aa97f119117/ty-0.0.70-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:0d338761617279a4fb6a83e7fad7e21126394637b8c45e13e196b2bb675f39b2", size = 12917800, upload-time = "2026-08-10T23:20:15.841Z" }, + { url = "https://files.pythonhosted.org/packages/a4/1a/f8289572f4fad5cb16c883b94638548166bc78cf3eb569f0cd9199eb10a0/ty-0.0.70-py3-none-win32.whl", hash = "sha256:a45642cf09dde91f0a3ce9b9e6fffda9779ff69d73f7347c18acf4fb45007c07", size = 11921482, upload-time = "2026-08-10T23:20:18.244Z" }, + { url = "https://files.pythonhosted.org/packages/17/ae/8739d7618b4670c3ee4f52d641d53be87928bd121d8bda9c0e3450500b75/ty-0.0.70-py3-none-win_amd64.whl", hash = "sha256:33e7941a926cf39b82553911a59a6ed68ec98c3d3d5a415df633f4d1cd051e6c", size = 12986994, upload-time = "2026-08-10T23:20:20.53Z" }, + { url = "https://files.pythonhosted.org/packages/f1/44/2bc3301ba4356ad8866daac9f8cfb3687953e52d076ea204f113b9304c42/ty-0.0.70-py3-none-win_arm64.whl", hash = "sha256:0d380f735d52b1d4b773193f8f5c58c065725eab1ebb0008d38a7b830de14f47", size = 12301082, upload-time = "2026-08-10T23:20:23.816Z" }, ] [[package]] name = "types-markdown" version = "3.10.2.20260508" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/24/62/4ca11db82799590117d9b6ef8fcd6515039cff80838304face5440f7d95c/types_markdown-3.10.2.20260508.tar.gz", hash = "sha256:64c405a30decd46cf78443bbcde8331f561f83752cc6d962ff3f5ccaabe26a8e", size = 19818, upload_time = "2026-05-08T04:49:45.095Z" } +sdist = { url = "https://files.pythonhosted.org/packages/24/62/4ca11db82799590117d9b6ef8fcd6515039cff80838304face5440f7d95c/types_markdown-3.10.2.20260508.tar.gz", hash = "sha256:64c405a30decd46cf78443bbcde8331f561f83752cc6d962ff3f5ccaabe26a8e", size = 19818, upload-time = "2026-05-08T04:49:45.095Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/cf/9d/eae7125bcf063ff5f79aadad58f3d37675263941f84e025bf53de1735fe1/types_markdown-3.10.2.20260508-py3-none-any.whl", hash = "sha256:2ee5e462c7b821c27c3d8f75f4da873d3e3c87d24d7f2d741f8f4261e4024a99", size = 25811, upload_time = "2026-05-08T04:49:43.962Z" }, + { url = "https://files.pythonhosted.org/packages/cf/9d/eae7125bcf063ff5f79aadad58f3d37675263941f84e025bf53de1735fe1/types_markdown-3.10.2.20260508-py3-none-any.whl", hash = "sha256:2ee5e462c7b821c27c3d8f75f4da873d3e3c87d24d7f2d741f8f4261e4024a99", size = 25811, upload-time = "2026-05-08T04:49:43.962Z" }, ] [[package]] @@ -242,9 +242,9 @@ dependencies = [ { name = "importlib-resources" }, { name = "typing-extensions" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/85/7d/62fbae352d5fb7ce5ef4d9ca73bf7a9b02b790d2524ab6ef1e0e799a5d1b/typeshed_client-2.11.0.tar.gz", hash = "sha256:0b8f2ab88f611f5e97b70d2a8123942d3d7d5c74cee8ae694db83422f32f9481", size = 522774, upload_time = "2026-05-01T14:51:52.38Z" } +sdist = { url = "https://files.pythonhosted.org/packages/85/7d/62fbae352d5fb7ce5ef4d9ca73bf7a9b02b790d2524ab6ef1e0e799a5d1b/typeshed_client-2.11.0.tar.gz", hash = "sha256:0b8f2ab88f611f5e97b70d2a8123942d3d7d5c74cee8ae694db83422f32f9481", size = 522774, upload-time = "2026-05-01T14:51:52.38Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/4f/22/fa16b462157bd869dfad528f5637506b9430ca63d48fb536ecf4cc78481a/typeshed_client-2.11.0-py3-none-any.whl", hash = "sha256:5745e0990b80b29a286b22d68f81779c5c7adf1cac8969eeafba44b73b486c36", size = 787609, upload_time = "2026-05-01T14:51:51.005Z" }, + { url = "https://files.pythonhosted.org/packages/4f/22/fa16b462157bd869dfad528f5637506b9430ca63d48fb536ecf4cc78481a/typeshed_client-2.11.0-py3-none-any.whl", hash = "sha256:5745e0990b80b29a286b22d68f81779c5c7adf1cac8969eeafba44b73b486c36", size = 787609, upload-time = "2026-05-01T14:51:51.005Z" }, ] [[package]] @@ -282,9 +282,9 @@ requires-dist = [ name = "typing-extensions" version = "4.15.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/72/94/1a15dd82efb362ac84269196e94cf00f187f7ed21c242792a923cdb1c61f/typing_extensions-4.15.0.tar.gz", hash = "sha256:0cea48d173cc12fa28ecabc3b837ea3cf6f38c6d1136f85cbaaf598984861466", size = 109391, upload_time = "2025-08-25T13:49:26.313Z" } +sdist = { url = "https://files.pythonhosted.org/packages/72/94/1a15dd82efb362ac84269196e94cf00f187f7ed21c242792a923cdb1c61f/typing_extensions-4.15.0.tar.gz", hash = "sha256:0cea48d173cc12fa28ecabc3b837ea3cf6f38c6d1136f85cbaaf598984861466", size = 109391, upload-time = "2025-08-25T13:49:26.313Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/18/67/36e9267722cc04a6b9f15c7f3441c2363321a3ea07da7ae0c0707beb2a9c/typing_extensions-4.15.0-py3-none-any.whl", hash = "sha256:f0fa19c6845758ab08074a0cfa8b7aecb71c999ca73d62883bc25cc018c4e548", size = 44614, upload_time = "2025-08-25T13:49:24.86Z" }, + { url = "https://files.pythonhosted.org/packages/18/67/36e9267722cc04a6b9f15c7f3441c2363321a3ea07da7ae0c0707beb2a9c/typing_extensions-4.15.0-py3-none-any.whl", hash = "sha256:f0fa19c6845758ab08074a0cfa8b7aecb71c999ca73d62883bc25cc018c4e548", size = 44614, upload-time = "2025-08-25T13:49:24.86Z" }, ] [[package]] @@ -292,16 +292,16 @@ name = "zuban" version = "0.8.2" source = { registry = "https://pypi.org/simple" } wheels = [ - { url = "https://files.pythonhosted.org/packages/95/d8/9a24dc2c22250fc416bff06c4ac4664c73ef7ec558b8d23049f493af73b5/zuban-0.8.2-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:07d3a498c514cb51ec881987b0e841043ea466674a9b3bed8411890bacb4d0e3", size = 11486917, upload_time = "2026-06-08T23:29:02.829Z" }, - { url = "https://files.pythonhosted.org/packages/23/62/3636a5474a9f9361ca83030cb82fefb4b1ff7771c75ab957c9025a3a7a97/zuban-0.8.2-py3-none-macosx_11_0_arm64.whl", hash = "sha256:64ed57aea375c74671d81e4d4655328a47b2157c7827e2c50cc90f80b29e8417", size = 11205360, upload_time = "2026-06-08T23:29:05.612Z" }, - { url = "https://files.pythonhosted.org/packages/49/41/0650f89e1f2ea0e865dd5e23614e6f3a205153032f0a9e970c5f4da885d1/zuban-0.8.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8bc47f343a939407ff881b0e9f0da36c7a3a509b3e6ca237512aadf30d02053b", size = 28385720, upload_time = "2026-06-08T23:29:08.177Z" }, - { url = "https://files.pythonhosted.org/packages/d7/52/58ecbdbf9668fd81c85f69b94609a5a813a94a18d9ce73ee1548cf85d98d/zuban-0.8.2-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:26ede2418f48affde0e9092108ec0be344b1323d7e87d11ecac8e5e89d383d7e", size = 28603725, upload_time = "2026-06-08T23:29:11.778Z" }, - { url = "https://files.pythonhosted.org/packages/96/ad/efc2e98a4492d010459161e03f98952227744c8f5ae8ebcc13ca88d50ad6/zuban-0.8.2-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b83e0cc35cccb2f60b50d8c6658ca3ac332914ad58d8e3d3d5886a13f761771b", size = 29769216, upload_time = "2026-06-08T23:29:14.865Z" }, - { url = "https://files.pythonhosted.org/packages/f7/60/a40add4cf31694f64727a34fc4a2093c599f1c911fdb6fbf61bf40d437f5/zuban-0.8.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8c4b26c1a383234c340d4956c04d8528e5e1654a08571d9d3eaced4973d21f87", size = 30851896, upload_time = "2026-06-08T23:29:18.04Z" }, - { url = "https://files.pythonhosted.org/packages/17/6f/7e32ec7c1677dfd7ac5821ac1d6cc6d4552f65fe06b098bd3515f5c5699d/zuban-0.8.2-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:32699e64acdb7d8984eddc3095b8f6fcf37fa00c52d54e74fed920440fe36ebe", size = 28551589, upload_time = "2026-06-08T23:29:20.922Z" }, - { url = "https://files.pythonhosted.org/packages/68/26/f5e8434aa8ea478a949b4dab8bd94abb47ff46f4777943a3309c33bfda94/zuban-0.8.2-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:f2ada854ceddeae6f7a8ecf709577235f5845770ebd6d51b26dde4358e78b645", size = 29007499, upload_time = "2026-06-08T23:29:23.954Z" }, - { url = "https://files.pythonhosted.org/packages/5c/37/70e6696e0e9d202fa84be8437b9dbf32e6d5854d9a201b9ca24965496391/zuban-0.8.2-py3-none-musllinux_1_2_i686.whl", hash = "sha256:dd6c2be104e6e9e1693e15d0a7775c5841a9793534351738c24b7377c58b487c", size = 29670474, upload_time = "2026-06-08T23:29:26.769Z" }, - { url = "https://files.pythonhosted.org/packages/74/0c/1c6f0a239fc2c93c46e733fa5d6f9ac376f9e0aec909467d50f6071234bf/zuban-0.8.2-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:299debc250b729abb0ebecd0bd53cac3c6b26cdb32dc4e79e601f9a1f584d3cd", size = 29029010, upload_time = "2026-06-08T23:29:29.959Z" }, - { url = "https://files.pythonhosted.org/packages/a6/7b/d5cdb140e9979d3f7784d9565f21692cafb851cceb21cba13348bcfcfa30/zuban-0.8.2-py3-none-win32.whl", hash = "sha256:3521196b132c2650e01a085d211dfcd849de9e9409e193e8f8ad85629c60fa42", size = 10026570, upload_time = "2026-06-08T23:29:32.596Z" }, - { url = "https://files.pythonhosted.org/packages/ee/cb/25a952a3594aa7ee32dee648513a1ea758c2def98742966d24484bb3d8ab/zuban-0.8.2-py3-none-win_amd64.whl", hash = "sha256:07463d337d293efb918990900c52b976646810b8f741999e8f288fb3da6e6594", size = 10798493, upload_time = "2026-06-08T23:29:34.805Z" }, + { url = "https://files.pythonhosted.org/packages/95/d8/9a24dc2c22250fc416bff06c4ac4664c73ef7ec558b8d23049f493af73b5/zuban-0.8.2-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:07d3a498c514cb51ec881987b0e841043ea466674a9b3bed8411890bacb4d0e3", size = 11486917, upload-time = "2026-06-08T23:29:02.829Z" }, + { url = "https://files.pythonhosted.org/packages/23/62/3636a5474a9f9361ca83030cb82fefb4b1ff7771c75ab957c9025a3a7a97/zuban-0.8.2-py3-none-macosx_11_0_arm64.whl", hash = "sha256:64ed57aea375c74671d81e4d4655328a47b2157c7827e2c50cc90f80b29e8417", size = 11205360, upload-time = "2026-06-08T23:29:05.612Z" }, + { url = "https://files.pythonhosted.org/packages/49/41/0650f89e1f2ea0e865dd5e23614e6f3a205153032f0a9e970c5f4da885d1/zuban-0.8.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8bc47f343a939407ff881b0e9f0da36c7a3a509b3e6ca237512aadf30d02053b", size = 28385720, upload-time = "2026-06-08T23:29:08.177Z" }, + { url = "https://files.pythonhosted.org/packages/d7/52/58ecbdbf9668fd81c85f69b94609a5a813a94a18d9ce73ee1548cf85d98d/zuban-0.8.2-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:26ede2418f48affde0e9092108ec0be344b1323d7e87d11ecac8e5e89d383d7e", size = 28603725, upload-time = "2026-06-08T23:29:11.778Z" }, + { url = "https://files.pythonhosted.org/packages/96/ad/efc2e98a4492d010459161e03f98952227744c8f5ae8ebcc13ca88d50ad6/zuban-0.8.2-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b83e0cc35cccb2f60b50d8c6658ca3ac332914ad58d8e3d3d5886a13f761771b", size = 29769216, upload-time = "2026-06-08T23:29:14.865Z" }, + { url = "https://files.pythonhosted.org/packages/f7/60/a40add4cf31694f64727a34fc4a2093c599f1c911fdb6fbf61bf40d437f5/zuban-0.8.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8c4b26c1a383234c340d4956c04d8528e5e1654a08571d9d3eaced4973d21f87", size = 30851896, upload-time = "2026-06-08T23:29:18.04Z" }, + { url = "https://files.pythonhosted.org/packages/17/6f/7e32ec7c1677dfd7ac5821ac1d6cc6d4552f65fe06b098bd3515f5c5699d/zuban-0.8.2-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:32699e64acdb7d8984eddc3095b8f6fcf37fa00c52d54e74fed920440fe36ebe", size = 28551589, upload-time = "2026-06-08T23:29:20.922Z" }, + { url = "https://files.pythonhosted.org/packages/68/26/f5e8434aa8ea478a949b4dab8bd94abb47ff46f4777943a3309c33bfda94/zuban-0.8.2-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:f2ada854ceddeae6f7a8ecf709577235f5845770ebd6d51b26dde4358e78b645", size = 29007499, upload-time = "2026-06-08T23:29:23.954Z" }, + { url = "https://files.pythonhosted.org/packages/5c/37/70e6696e0e9d202fa84be8437b9dbf32e6d5854d9a201b9ca24965496391/zuban-0.8.2-py3-none-musllinux_1_2_i686.whl", hash = "sha256:dd6c2be104e6e9e1693e15d0a7775c5841a9793534351738c24b7377c58b487c", size = 29670474, upload-time = "2026-06-08T23:29:26.769Z" }, + { url = "https://files.pythonhosted.org/packages/74/0c/1c6f0a239fc2c93c46e733fa5d6f9ac376f9e0aec909467d50f6071234bf/zuban-0.8.2-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:299debc250b729abb0ebecd0bd53cac3c6b26cdb32dc4e79e601f9a1f584d3cd", size = 29029010, upload-time = "2026-06-08T23:29:29.959Z" }, + { url = "https://files.pythonhosted.org/packages/a6/7b/d5cdb140e9979d3f7784d9565f21692cafb851cceb21cba13348bcfcfa30/zuban-0.8.2-py3-none-win32.whl", hash = "sha256:3521196b132c2650e01a085d211dfcd849de9e9409e193e8f8ad85629c60fa42", size = 10026570, upload-time = "2026-06-08T23:29:32.596Z" }, + { url = "https://files.pythonhosted.org/packages/ee/cb/25a952a3594aa7ee32dee648513a1ea758c2def98742966d24484bb3d8ab/zuban-0.8.2-py3-none-win_amd64.whl", hash = "sha256:07463d337d293efb918990900c52b976646810b8f741999e8f288fb3da6e6594", size = 10798493, upload-time = "2026-06-08T23:29:34.805Z" }, ] From 97b98ba933fb1bb7c5c1df7a8c24265b16b41aa5 Mon Sep 17 00:00:00 2001 From: KotlinIsland <65446343+KotlinIsland@users.noreply.github.com> Date: Thu, 13 Aug 2026 13:10:47 +1000 Subject: [PATCH 280/308] parameter specification/type variable tuple variance (#2215) Co-authored-by: Carl Meyer --- conformance/pyproject.toml | 1 + .../generics_mixed_variance_inference.toml | 9 ++ .../mypy/generics_paramspec_variance.toml | 44 +++++ .../mypy/generics_typevartuple_basic.toml | 16 +- .../mypy/generics_typevartuple_variance.toml | 51 ++++++ .../results/mypy/protocols_variance.toml | 27 ++-- .../pycroscope/callables_annotation.toml | 9 +- .../pycroscope/callables_protocol.toml | 9 +- .../pycroscope/callables_subtyping.toml | 11 +- .../generics_mixed_variance_inference.toml | 20 +++ .../generics_paramspec_variance.toml | 49 ++++++ .../generics_typevartuple_basic.toml | 22 +-- .../generics_typevartuple_variance.toml | 54 +++++++ .../literals_parameterizations.toml | 2 +- .../pycroscope/protocols_variance.toml | 14 +- .../pycroscope/specialtypes_sentinels.toml | 4 +- .../generics_mixed_variance_inference.toml | 13 ++ .../pyrefly/generics_paramspec_variance.toml | 55 +++++++ .../pyrefly/generics_typevartuple_basic.toml | 16 +- .../generics_typevartuple_variance.toml | 63 ++++++++ .../results/pyrefly/protocols_variance.toml | 23 +-- .../generics_mixed_variance_inference.toml | 24 +++ .../pyright/generics_paramspec_variance.toml | 101 ++++++++++++ .../pyright/generics_typevartuple_basic.toml | 20 +-- .../generics_typevartuple_variance.toml | 119 ++++++++++++++ .../results/pyright/protocols_variance.toml | 27 ++-- conformance/results/results.html | 132 ++++++++++++--- .../ty/generics_mixed_variance_inference.toml | 9 ++ .../ty/generics_paramspec_variance.toml | 31 ++++ .../ty/generics_typevartuple_basic.toml | 17 +- .../ty/generics_typevartuple_variance.toml | 35 ++++ .../results/ty/protocols_variance.toml | 14 +- .../generics_mixed_variance_inference.toml | 14 ++ .../zuban/generics_paramspec_variance.toml | 47 ++++++ .../zuban/generics_typevartuple_basic.toml | 16 +- .../zuban/generics_typevartuple_variance.toml | 63 ++++++++ .../results/zuban/protocols_variance.toml | 26 +-- conformance/tests/callables_annotation.py | 2 +- conformance/tests/callables_protocol.py | 2 +- conformance/tests/callables_subtyping.py | 2 +- .../generics_mixed_variance_inference.py | 21 +++ .../tests/generics_paramspec_variance.py | 152 ++++++++++++++++++ .../tests/generics_typevartuple_basic.py | 12 +- .../tests/generics_typevartuple_variance.py | 117 ++++++++++++++ conformance/tests/protocols_variance.py | 5 +- conformance/uv.lock | 8 +- docs/spec/generics.rst | 90 ++++++----- 47 files changed, 1433 insertions(+), 185 deletions(-) create mode 100644 conformance/results/mypy/generics_mixed_variance_inference.toml create mode 100644 conformance/results/mypy/generics_paramspec_variance.toml create mode 100644 conformance/results/mypy/generics_typevartuple_variance.toml create mode 100644 conformance/results/pycroscope/generics_mixed_variance_inference.toml create mode 100644 conformance/results/pycroscope/generics_paramspec_variance.toml create mode 100644 conformance/results/pycroscope/generics_typevartuple_variance.toml create mode 100644 conformance/results/pyrefly/generics_mixed_variance_inference.toml create mode 100644 conformance/results/pyrefly/generics_paramspec_variance.toml create mode 100644 conformance/results/pyrefly/generics_typevartuple_variance.toml create mode 100644 conformance/results/pyright/generics_mixed_variance_inference.toml create mode 100644 conformance/results/pyright/generics_paramspec_variance.toml create mode 100644 conformance/results/pyright/generics_typevartuple_variance.toml create mode 100644 conformance/results/ty/generics_mixed_variance_inference.toml create mode 100644 conformance/results/ty/generics_paramspec_variance.toml create mode 100644 conformance/results/ty/generics_typevartuple_variance.toml create mode 100644 conformance/results/zuban/generics_mixed_variance_inference.toml create mode 100644 conformance/results/zuban/generics_paramspec_variance.toml create mode 100644 conformance/results/zuban/generics_typevartuple_variance.toml create mode 100644 conformance/tests/generics_mixed_variance_inference.py create mode 100644 conformance/tests/generics_paramspec_variance.py create mode 100644 conformance/tests/generics_typevartuple_variance.py diff --git a/conformance/pyproject.toml b/conformance/pyproject.toml index cc393c951..c2b42fa73 100644 --- a/conformance/pyproject.toml +++ b/conformance/pyproject.toml @@ -12,6 +12,7 @@ dependencies = [ "tomlkit", "ty", "types-markdown", + "typing-extensions>=4.16.0", "zuban", ] diff --git a/conformance/results/mypy/generics_mixed_variance_inference.toml b/conformance/results/mypy/generics_mixed_variance_inference.toml new file mode 100644 index 000000000..84f10eed9 --- /dev/null +++ b/conformance/results/mypy/generics_mixed_variance_inference.toml @@ -0,0 +1,9 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +generics_mixed_variance_inference.py:13: error: Incompatible types in assignment (expression has type "Mixed[bool, []]", variable has type "Mixed[int, []]") [assignment] +generics_mixed_variance_inference.py:16: error: Incompatible types in assignment (expression has type "Mixed[int, object, []]", variable has type "Mixed[int, int, []]") [assignment] +generics_mixed_variance_inference.py:21: error: Incompatible types in assignment (expression has type "Mixed[int, [bool]]", variable has type "Mixed[int, [int]]") [assignment] +""" diff --git a/conformance/results/mypy/generics_paramspec_variance.toml b/conformance/results/mypy/generics_paramspec_variance.toml new file mode 100644 index 000000000..3aa86da8f --- /dev/null +++ b/conformance/results/mypy/generics_paramspec_variance.toml @@ -0,0 +1,44 @@ +conformant = "Unsupported" +conformance_automated = "Fail" +errors_diff = """ +Line 15: Expected 1 errors +Line 30: Expected 1 errors +Line 90: Expected 1 errors +Line 111: Expected 1 errors +Line 117: Expected 1 errors +Line 126: Expected 1 errors +Line 132: Expected 1 errors +Line 151: Expected 1 errors +Line 31: Unexpected errors ['generics_paramspec_variance.py:31: error: Incompatible types in assignment (expression has type "CovariantParamSpec[[int]]", variable has type "CovariantParamSpec[[object]]") [assignment]'] +Line 84: Unexpected errors ['generics_paramspec_variance.py:84: error: Incompatible types in assignment (expression has type "OutitP[[NamedArg(int, \\'a\\')]]", variable has type "OutitP[[int]]") [assignment]'] +Line 86: Unexpected errors ['generics_paramspec_variance.py:86: error: Incompatible types in assignment (expression has type "OutitP[[int]]", variable has type "OutitP[[Arg(int, \\'a\\')]]") [assignment]'] +Line 97: Unexpected errors ['generics_paramspec_variance.py:97: error: The variance and bound arguments to ParamSpec do not have defined semantics yet [misc]'] +Line 98: Unexpected errors ['generics_paramspec_variance.py:98: error: The variance and bound arguments to ParamSpec do not have defined semantics yet [misc]'] +Line 99: Unexpected errors ['generics_paramspec_variance.py:99: error: The variance and bound arguments to ParamSpec do not have defined semantics yet [misc]'] +Line 133: Unexpected errors ['generics_paramspec_variance.py:133: error: Incompatible types in assignment (expression has type "CovariantParamSpecOld[[int]]", variable has type "CovariantParamSpecOld[[object]]") [assignment]'] +Line 152: Unexpected errors ['generics_paramspec_variance.py:152: error: Incompatible types in assignment (expression has type "InferredCovariantParamSpecOld[[int]]", variable has type "InferredCovariantParamSpecOld[[object]]") [assignment]'] +""" +output = """ +generics_paramspec_variance.py:14: error: Incompatible types in assignment (expression has type "InvariantParamSpec[[int]]", variable has type "InvariantParamSpec[[object]]") [assignment] +generics_paramspec_variance.py:21: error: Incompatible types in assignment (expression has type "ContravariantParamSpec[[int]]", variable has type "ContravariantParamSpec[[object]]") [assignment] +generics_paramspec_variance.py:31: error: Incompatible types in assignment (expression has type "CovariantParamSpec[[int]]", variable has type "CovariantParamSpec[[object]]") [assignment] +generics_paramspec_variance.py:61: error: Incompatible types in assignment (expression has type "InitP[[NamedArg(int, 'a')]]", variable has type "InitP[[int]]") [assignment] +generics_paramspec_variance.py:63: error: Incompatible types in assignment (expression has type "InitP[[int]]", variable has type "InitP[[Arg(int, 'a')]]") [assignment] +generics_paramspec_variance.py:65: error: Incompatible types in assignment (expression has type "InitP[[Arg(int, 'b')]]", variable has type "InitP[[Arg(int, 'a')]]") [assignment] +generics_paramspec_variance.py:69: error: Incompatible types in assignment (expression has type "InitP[[int, str]]", variable has type "InitP[[int]]") [assignment] +generics_paramspec_variance.py:84: error: Incompatible types in assignment (expression has type "OutitP[[NamedArg(int, 'a')]]", variable has type "OutitP[[int]]") [assignment] +generics_paramspec_variance.py:86: error: Incompatible types in assignment (expression has type "OutitP[[int]]", variable has type "OutitP[[Arg(int, 'a')]]") [assignment] +generics_paramspec_variance.py:88: error: Incompatible types in assignment (expression has type "OutitP[[Arg(int, 'b')]]", variable has type "OutitP[[Arg(int, 'a')]]") [assignment] +generics_paramspec_variance.py:92: error: Incompatible types in assignment (expression has type "OutitP[[int, str]]", variable has type "OutitP[[int]]") [assignment] +generics_paramspec_variance.py:97: error: The variance and bound arguments to ParamSpec do not have defined semantics yet [misc] +generics_paramspec_variance.py:98: error: The variance and bound arguments to ParamSpec do not have defined semantics yet [misc] +generics_paramspec_variance.py:99: error: The variance and bound arguments to ParamSpec do not have defined semantics yet [misc] +generics_paramspec_variance.py:100: error: The variance and bound arguments to ParamSpec do not have defined semantics yet [misc] +generics_paramspec_variance.py:101: error: The variance and bound arguments to ParamSpec do not have defined semantics yet [misc] +generics_paramspec_variance.py:102: error: The variance and bound arguments to ParamSpec do not have defined semantics yet [misc] +generics_paramspec_variance.py:110: error: Incompatible types in assignment (expression has type "InvariantParamSpecOld[[bool]]", variable has type "InvariantParamSpecOld[[int]]") [assignment] +generics_paramspec_variance.py:121: error: Incompatible types in assignment (expression has type "ContravariantParamSpecOld[[int]]", variable has type "ContravariantParamSpecOld[[object]]") [assignment] +generics_paramspec_variance.py:133: error: Incompatible types in assignment (expression has type "CovariantParamSpecOld[[int]]", variable has type "CovariantParamSpecOld[[object]]") [assignment] +generics_paramspec_variance.py:142: error: Incompatible types in assignment (expression has type "InferredContravariantParamSpecOld[[int]]", variable has type "InferredContravariantParamSpecOld[[object]]") [assignment] +generics_paramspec_variance.py:152: error: Incompatible types in assignment (expression has type "InferredCovariantParamSpecOld[[int]]", variable has type "InferredCovariantParamSpecOld[[object]]") [assignment] +""" diff --git a/conformance/results/mypy/generics_typevartuple_basic.toml b/conformance/results/mypy/generics_typevartuple_basic.toml index c9a734127..5bf562c64 100644 --- a/conformance/results/mypy/generics_typevartuple_basic.toml +++ b/conformance/results/mypy/generics_typevartuple_basic.toml @@ -3,19 +3,19 @@ notes = """ Does not enforce that tuples captured by `TypeVarTuple` are same length. """ output = """ -generics_typevartuple_basic.py:42: error: Argument 1 to "Array" has incompatible type "Height"; expected "tuple[Height, Width]" [arg-type] -generics_typevartuple_basic.py:43: error: Argument 1 to "Array" has incompatible type "tuple[Batch, Width]"; expected "tuple[Batch, Height, Width]" [arg-type] -generics_typevartuple_basic.py:45: error: Argument 1 to "Array" has incompatible type "tuple[Time, Batch, Width, Height]"; expected "tuple[Time, Batch, Height, Width]" [arg-type] -generics_typevartuple_basic.py:52: error: Free type variable expected in Generic[...] [misc] -generics_typevartuple_basic.py:53: error: TypeVarTuple "Shape" is only valid with an unpack [valid-type] -generics_typevartuple_basic.py:56: error: TypeVarTuple "Shape" is only valid with an unpack [valid-type] -generics_typevartuple_basic.py:59: error: TypeVarTuple "Shape" is only valid with an unpack [valid-type] -generics_typevartuple_basic.py:65: error: Unexpected keyword argument "covariant" for "TypeVarTuple" [misc] +generics_typevartuple_basic.py:43: error: Argument 1 to "Array" has incompatible type "Height"; expected "tuple[Height, Width]" [arg-type] +generics_typevartuple_basic.py:44: error: Argument 1 to "Array" has incompatible type "tuple[Batch, Width]"; expected "tuple[Batch, Height, Width]" [arg-type] +generics_typevartuple_basic.py:46: error: Argument 1 to "Array" has incompatible type "tuple[Time, Batch, Width, Height]"; expected "tuple[Time, Batch, Height, Width]" [arg-type] +generics_typevartuple_basic.py:53: error: Free type variable expected in Generic[...] [misc] +generics_typevartuple_basic.py:54: error: TypeVarTuple "Shape" is only valid with an unpack [valid-type] +generics_typevartuple_basic.py:57: error: TypeVarTuple "Shape" is only valid with an unpack [valid-type] +generics_typevartuple_basic.py:60: error: TypeVarTuple "Shape" is only valid with an unpack [valid-type] generics_typevartuple_basic.py:66: error: Too many positional arguments for "TypeVarTuple" [misc] generics_typevartuple_basic.py:67: error: Unexpected keyword argument "bound" for "TypeVarTuple" [misc] generics_typevartuple_basic.py:100: error: Cannot infer value of type parameter "Shape" of "multiply" [misc] generics_typevartuple_basic.py:101: error: Cannot infer value of type parameter "Shape" of "multiply" [misc] generics_typevartuple_basic.py:107: error: Can only use one type var tuple in a class def [misc] +generics_typevartuple_basic.py:111: error: Can only use one type var tuple in a class def [misc] """ conformance_automated = "Fail" errors_diff = """ diff --git a/conformance/results/mypy/generics_typevartuple_variance.toml b/conformance/results/mypy/generics_typevartuple_variance.toml new file mode 100644 index 000000000..35d157ef1 --- /dev/null +++ b/conformance/results/mypy/generics_typevartuple_variance.toml @@ -0,0 +1,51 @@ +conformant = "Unsupported" +conformance_automated = "Fail" +errors_diff = """ +Line 14: Expected 1 errors +Line 18: Expected 1 errors +Line 21: Expected 1 errors +Line 28: Expected 1 errors +Line 31: Expected 1 errors +Line 34: Expected 1 errors +Line 68: Expected 1 errors +Line 79: Expected 1 errors +Line 83: Expected 1 errors +Line 90: Expected 1 errors +Line 107: Expected 1 errors +Line 29: Unexpected errors ['generics_typevartuple_variance.py:29: error: Incompatible types in assignment (expression has type "ContravariantTypeVarTuple[object]", variable has type "ContravariantTypeVarTuple[int]") [assignment]'] +Line 30: Unexpected errors ['generics_typevartuple_variance.py:30: error: Incompatible types in assignment (expression has type "ContravariantTypeVarTuple[*tuple[object, ...]]", variable has type "ContravariantTypeVarTuple[*tuple[int, ...]]") [assignment]'] +Line 33: Unexpected errors ['generics_typevartuple_variance.py:33: error: Incompatible types in assignment (expression has type "ContravariantTypeVarTuple[*tuple[int, ...]]", variable has type "ContravariantTypeVarTuple[int]") [assignment]'] +Line 55: Unexpected errors ['generics_typevartuple_variance.py:55: error: Unexpected keyword argument "infer_variance" for "TypeVarTuple" [misc]'] +Line 73: Unexpected errors ['generics_typevartuple_variance.py:73: error: Unexpected keyword argument "contravariant" for "TypeVarTuple" [misc]'] +Line 84: Unexpected errors ['generics_typevartuple_variance.py:84: error: Incompatible types in assignment (expression has type "ContravariantTypeVarTupleOld[object]", variable has type "ContravariantTypeVarTupleOld[int]") [assignment]'] +Line 87: Unexpected errors ['generics_typevartuple_variance.py:87: error: Unexpected keyword argument "covariant" for "TypeVarTuple" [misc]'] +Line 108: Unexpected errors ['generics_typevartuple_variance.py:108: error: Incompatible types in assignment (expression has type "InferredContravariantTypeVarTupleOld[object]", variable has type "InferredContravariantTypeVarTupleOld[int]") [assignment]'] +""" +output = """ +generics_typevartuple_variance.py:15: error: Incompatible types in assignment (expression has type "InvariantTypeVarTuple[object]", variable has type "InvariantTypeVarTuple[int]") [assignment] +generics_typevartuple_variance.py:17: error: Incompatible types in assignment (expression has type "InvariantTypeVarTuple[*tuple[object, ...]]", variable has type "InvariantTypeVarTuple[*tuple[int, ...]]") [assignment] +generics_typevartuple_variance.py:20: error: Incompatible types in assignment (expression has type "InvariantTypeVarTuple[*tuple[int, ...]]", variable has type "InvariantTypeVarTuple[int]") [assignment] +generics_typevartuple_variance.py:29: error: Incompatible types in assignment (expression has type "ContravariantTypeVarTuple[object]", variable has type "ContravariantTypeVarTuple[int]") [assignment] +generics_typevartuple_variance.py:30: error: Incompatible types in assignment (expression has type "ContravariantTypeVarTuple[*tuple[object, ...]]", variable has type "ContravariantTypeVarTuple[*tuple[int, ...]]") [assignment] +generics_typevartuple_variance.py:33: error: Incompatible types in assignment (expression has type "ContravariantTypeVarTuple[*tuple[int, ...]]", variable has type "ContravariantTypeVarTuple[int]") [assignment] +generics_typevartuple_variance.py:42: error: Incompatible types in assignment (expression has type "CovariantTypeVarTuple[object]", variable has type "CovariantTypeVarTuple[int]") [assignment] +generics_typevartuple_variance.py:45: error: Incompatible types in assignment (expression has type "CovariantTypeVarTuple[bool, object]", variable has type "CovariantTypeVarTuple[int, int]") [assignment] +generics_typevartuple_variance.py:46: error: Incompatible types in assignment (expression has type "CovariantTypeVarTuple[object, bool]", variable has type "CovariantTypeVarTuple[int, int]") [assignment] +generics_typevartuple_variance.py:47: error: Incompatible types in assignment (expression has type "CovariantTypeVarTuple[object, object]", variable has type "CovariantTypeVarTuple[int, int]") [assignment] +generics_typevartuple_variance.py:48: error: Incompatible types in assignment (expression has type "CovariantTypeVarTuple[*tuple[object, ...]]", variable has type "CovariantTypeVarTuple[*tuple[int, ...]]") [assignment] +generics_typevartuple_variance.py:51: error: Incompatible types in assignment (expression has type "CovariantTypeVarTuple[*tuple[int, ...]]", variable has type "CovariantTypeVarTuple[int]") [assignment] +generics_typevartuple_variance.py:55: error: Unexpected keyword argument "infer_variance" for "TypeVarTuple" [misc] +generics_typevartuple_variance.py:56: error: Unexpected keyword argument "covariant" for "TypeVarTuple" [misc] +generics_typevartuple_variance.py:56: error: Unexpected keyword argument "contravariant" for "TypeVarTuple" [misc] +generics_typevartuple_variance.py:57: error: Unexpected keyword argument "covariant" for "TypeVarTuple" [misc] +generics_typevartuple_variance.py:57: error: Unexpected keyword argument "infer_variance" for "TypeVarTuple" [misc] +generics_typevartuple_variance.py:58: error: Unexpected keyword argument "contravariant" for "TypeVarTuple" [misc] +generics_typevartuple_variance.py:58: error: Unexpected keyword argument "infer_variance" for "TypeVarTuple" [misc] +generics_typevartuple_variance.py:69: error: Incompatible types in assignment (expression has type "InvariantTypeVarTupleOld[object]", variable has type "InvariantTypeVarTupleOld[int]") [assignment] +generics_typevartuple_variance.py:73: error: Unexpected keyword argument "contravariant" for "TypeVarTuple" [misc] +generics_typevartuple_variance.py:84: error: Incompatible types in assignment (expression has type "ContravariantTypeVarTupleOld[object]", variable has type "ContravariantTypeVarTupleOld[int]") [assignment] +generics_typevartuple_variance.py:87: error: Unexpected keyword argument "covariant" for "TypeVarTuple" [misc] +generics_typevartuple_variance.py:97: error: Incompatible types in assignment (expression has type "CovariantTypeVarTupleOld[object]", variable has type "CovariantTypeVarTupleOld[int]") [assignment] +generics_typevartuple_variance.py:108: error: Incompatible types in assignment (expression has type "InferredContravariantTypeVarTupleOld[object]", variable has type "InferredContravariantTypeVarTupleOld[int]") [assignment] +generics_typevartuple_variance.py:116: error: Incompatible types in assignment (expression has type "InferredCovariantTypeVarTupleOld[object]", variable has type "InferredCovariantTypeVarTupleOld[int]") [assignment] +""" diff --git a/conformance/results/mypy/protocols_variance.toml b/conformance/results/mypy/protocols_variance.toml index e434501cf..58d213901 100644 --- a/conformance/results/mypy/protocols_variance.toml +++ b/conformance/results/mypy/protocols_variance.toml @@ -1,15 +1,20 @@ -conformant = "Pass" +conformant = "Partial" +notes = """ +False report of ParamSpec variance keywords. +""" output = """ -protocols_variance.py:21: error: Invariant type variable "T1" used in protocol where covariant one is expected [misc] -protocols_variance.py:40: error: Invariant type variable "T3" used in protocol where contravariant one is expected [misc] -protocols_variance.py:56: error: Invariant type variable "T1" used in protocol where contravariant one is expected [misc] -protocols_variance.py:61: error: Covariant type variable "T1_co" used in protocol where contravariant one is expected [misc] -protocols_variance.py:62: error: Cannot use a covariant type variable as a parameter [misc] -protocols_variance.py:66: error: Invariant type variable "T1" used in protocol where covariant one is expected [misc] -protocols_variance.py:71: error: Contravariant type variable "T1_contra" used in protocol where covariant one is expected [misc] -protocols_variance.py:72: error: Cannot use a contravariant type variable as return type [misc] -protocols_variance.py:104: error: Invariant type variable "T1" used in protocol where covariant one is expected [misc] +protocols_variance.py:15: error: The variance and bound arguments to ParamSpec do not have defined semantics yet [misc] +protocols_variance.py:22: error: Invariant type variable "T1" used in protocol where covariant one is expected [misc] +protocols_variance.py:41: error: Invariant type variable "T3" used in protocol where contravariant one is expected [misc] +protocols_variance.py:57: error: Invariant type variable "T1" used in protocol where contravariant one is expected [misc] +protocols_variance.py:62: error: Covariant type variable "T1_co" used in protocol where contravariant one is expected [misc] +protocols_variance.py:63: error: Cannot use a covariant type variable as a parameter [misc] +protocols_variance.py:67: error: Invariant type variable "T1" used in protocol where covariant one is expected [misc] +protocols_variance.py:72: error: Contravariant type variable "T1_contra" used in protocol where covariant one is expected [misc] +protocols_variance.py:73: error: Cannot use a contravariant type variable as return type [misc] +protocols_variance.py:105: error: Invariant type variable "T1" used in protocol where covariant one is expected [misc] """ -conformance_automated = "Pass" +conformance_automated = "Fail" errors_diff = """ +Line 15: Unexpected errors ['protocols_variance.py:15: error: The variance and bound arguments to ParamSpec do not have defined semantics yet [misc]'] """ diff --git a/conformance/results/pycroscope/callables_annotation.toml b/conformance/results/pycroscope/callables_annotation.toml index 2de3e2782..4eac45be1 100644 --- a/conformance/results/pycroscope/callables_annotation.toml +++ b/conformance/results/pycroscope/callables_annotation.toml @@ -1,5 +1,10 @@ -conformance_automated = "Pass" +conformant = "Partial" +notes = """ +Does not support callback protocols with PEP 695 ParamSpec type parameters. +""" +conformance_automated = "Fail" errors_diff = """ +Line 115: Unexpected errors ['./callables_annotation.py:115:38: Traceback (most recent call last):', './callables_annotation.py:115:4: Traceback (most recent call last):'] """ output = """ ./callables_annotation.py:25:4: Missing required positional argument at position 1 [incompatible_call] @@ -14,6 +19,8 @@ output = """ ./callables_annotation.py:59:4: Ellipsis must be used directly in Callable[..., T], not in Callable[[...], T] [invalid_annotation] ./callables_annotation.py:91:0: Incompatible assignment: expected (int, /, **Any[explicit]) -> str, got () -> str [incompatible_assignment] ./callables_annotation.py:93:0: Incompatible assignment: expected (int, /, **Any[explicit]) -> str, got (*, a: int) -> str [incompatible_assignment] +./callables_annotation.py:115:38: Traceback (most recent call last): +./callables_annotation.py:115:4: Traceback (most recent call last): ./callables_annotation.py:159:4: Incompatible assignment: expected ./callables_annotation.py.Proto5[Any[explicit]], got ./callables_annotation.py.Proto8 [incompatible_assignment] ./callables_annotation.py:172:4: Incompatible assignment: expected .Callback2[Any[ellipsis_callable]] = (int, /, ****P) -> str, got () -> str [incompatible_assignment] ./callables_annotation.py:187:4: Incompatible assignment: expected (str, /, **Any[explicit]) -> str, got (int, str, /) -> str [incompatible_assignment] diff --git a/conformance/results/pycroscope/callables_protocol.toml b/conformance/results/pycroscope/callables_protocol.toml index 658e045ad..8bc4c7dff 100644 --- a/conformance/results/pycroscope/callables_protocol.toml +++ b/conformance/results/pycroscope/callables_protocol.toml @@ -1,5 +1,10 @@ -conformance_automated = "Pass" +conformant = "Partial" +notes = """ +Does not support callback protocols with PEP 695 ParamSpec type parameters. +""" +conformance_automated = "Fail" errors_diff = """ +Line 179: Unexpected errors ['./callables_protocol.py:179:30: Traceback (most recent call last):', './callables_protocol.py:179:4: Traceback (most recent call last):'] """ output = """ ./callables_protocol.py:35:0: Incompatible assignment: expected ./callables_protocol.py.Proto1, got (*vals: tuple[bytes, ...], max_items: int | None) -> list[bytes] [incompatible_assignment] @@ -12,6 +17,8 @@ output = """ ./callables_protocol.py:97:0: Incompatible assignment: expected ./callables_protocol.py.Proto4, got (x: int) -> None [incompatible_assignment] ./callables_protocol.py:121:0: Incompatible assignment: expected ./callables_protocol.py.NotProto6, got (*vals: tuple[bytes, ...], max_len: int | None = None) -> list[bytes] [incompatible_assignment] ./callables_protocol.py:169:0: Incompatible assignment: expected ./callables_protocol.py.Proto8, got (x: int) -> Any[explicit] [incompatible_assignment] +./callables_protocol.py:179:30: Traceback (most recent call last): +./callables_protocol.py:179:4: Traceback (most recent call last): ./callables_protocol.py:186:4: Incompatible types in assignment to attribute 'other_attribute': expected int, got Literal['str'] [incompatible_assignment] ./callables_protocol.py:187:4: ./callables_protocol.py.Proto9[**P@./callables_protocol.py.decorator1..decorator1, +R@./callables_protocol.py.decorator1..decorator1] has no attribute 'xxx' [undefined_attribute] ./callables_protocol.py:197:6: ./callables_protocol.py.Proto9[(x: int) -> Any[unannotated], str] has no attribute 'other_attribute2' [undefined_attribute] diff --git a/conformance/results/pycroscope/callables_subtyping.toml b/conformance/results/pycroscope/callables_subtyping.toml index 548cae50e..ad3adb9b2 100644 --- a/conformance/results/pycroscope/callables_subtyping.toml +++ b/conformance/results/pycroscope/callables_subtyping.toml @@ -1,5 +1,11 @@ -conformance_automated = "Pass" +conformant = "Partial" +notes = """ +Does not support callback protocols with PEP 695 ParamSpec type parameters. +""" +conformance_automated = "Fail" errors_diff = """ +Line 205: Unexpected errors ['./callables_subtyping.py:205:30: Traceback (most recent call last):', './callables_subtyping.py:205:4: Traceback (most recent call last):'] +Line 214: Unexpected errors ['./callables_subtyping.py:214:4: Incompatible assignment: expected callables_subtyping.ProtocolWithP[**P@callables_subtyping.func7..func7], got callables_subtyping.TypeAliasWithP[**P@callables_subtyping.func7..func7] = (**__P: **P) -> None [incompatible_assignment]'] """ output = """ ./callables_subtyping.py:26:4: Incompatible assignment: expected (float | int, /) -> float | int, got (int, /) -> int [incompatible_assignment] @@ -28,6 +34,9 @@ output = """ ./callables_subtyping.py:195:4: Incompatible assignment: expected callables_subtyping.IntKwargs6, got callables_subtyping.StrKwargs6 [incompatible_assignment] ./callables_subtyping.py:196:4: Incompatible assignment: expected callables_subtyping.Standard6, got callables_subtyping.IntStrKwargs6 [incompatible_assignment] ./callables_subtyping.py:197:4: Incompatible assignment: expected callables_subtyping.Standard6, got callables_subtyping.StrKwargs6 [incompatible_assignment] +./callables_subtyping.py:205:30: Traceback (most recent call last): +./callables_subtyping.py:205:4: Traceback (most recent call last): +./callables_subtyping.py:214:4: Incompatible assignment: expected callables_subtyping.ProtocolWithP[**P@callables_subtyping.func7..func7], got callables_subtyping.TypeAliasWithP[**P@callables_subtyping.func7..func7] = (**__P: **P) -> None [incompatible_assignment] ./callables_subtyping.py:236:4: Incompatible assignment: expected callables_subtyping.DefaultArg8, got callables_subtyping.NoDefaultArg8 [incompatible_assignment] ./callables_subtyping.py:237:4: Incompatible assignment: expected callables_subtyping.DefaultArg8, got callables_subtyping.NoX8 [incompatible_assignment] ./callables_subtyping.py:240:4: Incompatible assignment: expected callables_subtyping.NoDefaultArg8, got callables_subtyping.NoX8 [incompatible_assignment] diff --git a/conformance/results/pycroscope/generics_mixed_variance_inference.toml b/conformance/results/pycroscope/generics_mixed_variance_inference.toml new file mode 100644 index 000000000..6aa55eb89 --- /dev/null +++ b/conformance/results/pycroscope/generics_mixed_variance_inference.toml @@ -0,0 +1,20 @@ +conformant = "Unsupported" +conformance_automated = "Fail" +errors_diff = """ +Line 8: Unexpected errors ['./generics_mixed_variance_inference.py:8:32: Traceback (most recent call last):', './generics_mixed_variance_inference.py:8:4: Traceback (most recent call last):'] +Line 12: Unexpected errors ['./generics_mixed_variance_inference.py:12:0: Incompatible assignment: expected generics_mixed_variance_inference.Mixed[int, Any[error]], got generics_mixed_variance_inference.Mixed[object, AnySig()] [incompatible_assignment]', './generics_mixed_variance_inference.py:12:4: Invalid type annotation [] [invalid_annotation]'] +Line 17: Unexpected errors ['./generics_mixed_variance_inference.py:17:0: Incompatible assignment: expected generics_mixed_variance_inference.Mixed[int, int, ], got generics_mixed_variance_inference.Mixed[int, bool, AnySig()] [incompatible_assignment]'] +Line 20: Unexpected errors ["./generics_mixed_variance_inference.py:20:4: Invalid type annotation [] [invalid_annotation]"] +""" +output = """ +./generics_mixed_variance_inference.py:8:32: Traceback (most recent call last): +./generics_mixed_variance_inference.py:8:4: Traceback (most recent call last): +./generics_mixed_variance_inference.py:12:0: Incompatible assignment: expected generics_mixed_variance_inference.Mixed[int, Any[error]], got generics_mixed_variance_inference.Mixed[object, AnySig()] [incompatible_assignment] +./generics_mixed_variance_inference.py:12:4: Invalid type annotation [] [invalid_annotation] +./generics_mixed_variance_inference.py:13:0: Incompatible assignment: expected generics_mixed_variance_inference.Mixed[int, Any[error]], got generics_mixed_variance_inference.Mixed[bool, AnySig()] [incompatible_assignment] +./generics_mixed_variance_inference.py:13:4: Invalid type annotation [] [invalid_annotation] +./generics_mixed_variance_inference.py:16:0: Incompatible assignment: expected generics_mixed_variance_inference.Mixed[int, int, ], got generics_mixed_variance_inference.Mixed[int, object, AnySig()] [incompatible_assignment] +./generics_mixed_variance_inference.py:17:0: Incompatible assignment: expected generics_mixed_variance_inference.Mixed[int, int, ], got generics_mixed_variance_inference.Mixed[int, bool, AnySig()] [incompatible_assignment] +./generics_mixed_variance_inference.py:20:4: Invalid type annotation [] [invalid_annotation] +./generics_mixed_variance_inference.py:21:4: Invalid type annotation [] [invalid_annotation] +""" diff --git a/conformance/results/pycroscope/generics_paramspec_variance.toml b/conformance/results/pycroscope/generics_paramspec_variance.toml new file mode 100644 index 000000000..9a83d5184 --- /dev/null +++ b/conformance/results/pycroscope/generics_paramspec_variance.toml @@ -0,0 +1,49 @@ +conformant = "Unsupported" +conformance_automated = "Fail" +errors_diff = """ +Line 90: Expected 1 errors +Line 117: Expected 1 errors +Line 126: Expected 1 errors +Line 19: Unexpected errors ['./generics_paramspec_variance.py:19:23: Traceback (most recent call last):', './generics_paramspec_variance.py:19:4: Traceback (most recent call last):'] +Line 22: Unexpected errors ['./generics_paramspec_variance.py:22:38: Traceback (most recent call last):'] +Line 31: Unexpected errors ['./generics_paramspec_variance.py:31:38: Traceback (most recent call last):'] +Line 84: Unexpected errors ["./generics_paramspec_variance.py:84:0: Incompatible types in assignment to attribute 't': expected ./generics_paramspec_variance.py.OutitP~[(a: int) -> Any[unannotated]], got ./generics_paramspec_variance.py.OutitP~[(*, a: int) -> Any[unannotated]] [incompatible_assignment]"] +Line 86: Unexpected errors ["./generics_paramspec_variance.py:86:0: Incompatible types in assignment to attribute 't': expected ./generics_paramspec_variance.py.OutitP~[(a: int) -> Any[unannotated]], got ./generics_paramspec_variance.py.OutitP~[(a: int, /) -> Any[unannotated]] [incompatible_assignment]"] +Line 109: Unexpected errors ['./generics_paramspec_variance.py:109:13: Traceback (most recent call last):'] +Line 122: Unexpected errors ['./generics_paramspec_variance.py:122:45: Traceback (most recent call last):'] +Line 133: Unexpected errors ['./generics_paramspec_variance.py:133:45: Traceback (most recent call last):'] +Line 143: Unexpected errors ['./generics_paramspec_variance.py:143:59: Traceback (most recent call last):'] +Line 152: Unexpected errors ['./generics_paramspec_variance.py:152:59: Traceback (most recent call last):'] +""" +output = """ +./generics_paramspec_variance.py:14:41: Traceback (most recent call last): +./generics_paramspec_variance.py:15:38: Traceback (most recent call last): +./generics_paramspec_variance.py:19:23: Traceback (most recent call last): +./generics_paramspec_variance.py:19:4: Traceback (most recent call last): +./generics_paramspec_variance.py:21:41: Traceback (most recent call last): +./generics_paramspec_variance.py:22:38: Traceback (most recent call last): +./generics_paramspec_variance.py:30:35: Traceback (most recent call last): +./generics_paramspec_variance.py:31:38: Traceback (most recent call last): +./generics_paramspec_variance.py:61:0: Incompatible types in assignment to attribute 't': expected ./generics_paramspec_variance.py.InitP~[(a: int) -> Any[unannotated]], got ./generics_paramspec_variance.py.InitP~[(*, a: int) -> Any[unannotated]] [incompatible_assignment] +./generics_paramspec_variance.py:63:0: Incompatible types in assignment to attribute 't': expected ./generics_paramspec_variance.py.InitP~[(a: int) -> Any[unannotated]], got ./generics_paramspec_variance.py.InitP~[(a: int, /) -> Any[unannotated]] [incompatible_assignment] +./generics_paramspec_variance.py:65:0: Incompatible types in assignment to attribute 't': expected ./generics_paramspec_variance.py.InitP~[(a: int) -> Any[unannotated]], got ./generics_paramspec_variance.py.InitP~[(b: int) -> Any[unannotated]] [incompatible_assignment] +./generics_paramspec_variance.py:69:0: Incompatible types in assignment to attribute 't': expected ./generics_paramspec_variance.py.InitP~[(a: int) -> Any[unannotated]], got ./generics_paramspec_variance.py.InitP~[(a: int, b: str) -> Any[unannotated]] [incompatible_assignment] +./generics_paramspec_variance.py:84:0: Incompatible types in assignment to attribute 't': expected ./generics_paramspec_variance.py.OutitP~[(a: int) -> Any[unannotated]], got ./generics_paramspec_variance.py.OutitP~[(*, a: int) -> Any[unannotated]] [incompatible_assignment] +./generics_paramspec_variance.py:86:0: Incompatible types in assignment to attribute 't': expected ./generics_paramspec_variance.py.OutitP~[(a: int) -> Any[unannotated]], got ./generics_paramspec_variance.py.OutitP~[(a: int, /) -> Any[unannotated]] [incompatible_assignment] +./generics_paramspec_variance.py:88:0: Incompatible types in assignment to attribute 't': expected ./generics_paramspec_variance.py.OutitP~[(a: int) -> Any[unannotated]], got ./generics_paramspec_variance.py.OutitP~[(b: int) -> Any[unannotated]] [incompatible_assignment] +./generics_paramspec_variance.py:92:0: Incompatible types in assignment to attribute 't': expected ./generics_paramspec_variance.py.OutitP~[(a: int) -> Any[unannotated]], got ./generics_paramspec_variance.py.OutitP~[(a: int, b: str) -> Any[unannotated]] [incompatible_assignment] +./generics_paramspec_variance.py:100:8: Error calling (name: str, /, *, bound: object = no argument given, covariant: bool = Literal[False], contravariant: bool = Literal[False], infer_variance: bool = Literal[False], default: object = no argument given) -> typing.ParamSpec (with impl): Bivariant types are not supported. [incompatible_call] +./generics_paramspec_variance.py:101:8: Error calling (name: str, /, *, bound: object = no argument given, covariant: bool = Literal[False], contravariant: bool = Literal[False], infer_variance: bool = Literal[False], default: object = no argument given) -> typing.ParamSpec (with impl): Variance cannot be specified with infer_variance. [incompatible_call] +./generics_paramspec_variance.py:102:8: Error calling (name: str, /, *, bound: object = no argument given, covariant: bool = Literal[False], contravariant: bool = Literal[False], infer_variance: bool = Literal[False], default: object = no argument given) -> typing.ParamSpec (with impl): Variance cannot be specified with infer_variance. [incompatible_call] +./generics_paramspec_variance.py:109:13: Traceback (most recent call last): +./generics_paramspec_variance.py:110:13: Traceback (most recent call last): +./generics_paramspec_variance.py:111:13: Traceback (most recent call last): +./generics_paramspec_variance.py:121:48: Traceback (most recent call last): +./generics_paramspec_variance.py:122:45: Traceback (most recent call last): +./generics_paramspec_variance.py:132:42: Traceback (most recent call last): +./generics_paramspec_variance.py:133:45: Traceback (most recent call last): +./generics_paramspec_variance.py:142:62: Traceback (most recent call last): +./generics_paramspec_variance.py:143:59: Traceback (most recent call last): +./generics_paramspec_variance.py:151:56: Traceback (most recent call last): +./generics_paramspec_variance.py:152:59: Traceback (most recent call last): +""" diff --git a/conformance/results/pycroscope/generics_typevartuple_basic.toml b/conformance/results/pycroscope/generics_typevartuple_basic.toml index 842c7ca46..6685db31f 100644 --- a/conformance/results/pycroscope/generics_typevartuple_basic.toml +++ b/conformance/results/pycroscope/generics_typevartuple_basic.toml @@ -1,15 +1,19 @@ -conformance_automated = "Pass" +conformant = "Partial" +conformance_automated = "Fail" +notes = """ +Doesn't error when multiple type variable tuples appear in a PEP 695 type parameter list; only detects the `Generic[...]` form. +""" errors_diff = """ +Line 111: Expected 1 errors """ output = """ -./generics_typevartuple_basic.py:42:33: Incompatible argument type for shape: expected tuple[*tuple[Shape, ...]] but got NewType('Height', int) [incompatible_argument] -./generics_typevartuple_basic.py:43:0: Incompatible assignment: expected ./generics_typevartuple_basic.py.Array[NewType('Batch', int), NewType('Height', int), NewType('Width', int)], got ./generics_typevartuple_basic.py.Array~[NewType('Batch', int), NewType('Width', int)] [incompatible_assignment] -./generics_typevartuple_basic.py:44:0: Incompatible assignment: expected ./generics_typevartuple_basic.py.Array[NewType('Time', int), NewType('Batch', int), NewType('Height', int), NewType('Width', int)], got ./generics_typevartuple_basic.py.Array~[NewType('Time', int), NewType('Batch', int), NewType('Width', int), NewType('Height', int)] [incompatible_assignment] -./generics_typevartuple_basic.py:52:21: TypeVarTuple must be unpacked [invalid_base] -./generics_typevartuple_basic.py:53:30: TypeVarTuple must be unpacked [invalid_annotation] -./generics_typevartuple_basic.py:56:27: TypeVarTuple must be unpacked [invalid_annotation] -./generics_typevartuple_basic.py:59:17: TypeVarTuple must be unpacked [invalid_annotation] -./generics_typevartuple_basic.py:65:6: In call to typing.TypeVarTuple: Got an unexpected keyword argument 'covariant' [incompatible_call] +./generics_typevartuple_basic.py:43:33: Incompatible argument type for shape: expected tuple[*tuple[Shape, ...]] but got NewType('Height', int) [incompatible_argument] +./generics_typevartuple_basic.py:44:0: Incompatible assignment: expected ./generics_typevartuple_basic.py.Array[NewType('Batch', int), NewType('Height', int), NewType('Width', int)], got ./generics_typevartuple_basic.py.Array~[NewType('Batch', int), NewType('Width', int)] [incompatible_assignment] +./generics_typevartuple_basic.py:45:0: Incompatible assignment: expected ./generics_typevartuple_basic.py.Array[NewType('Time', int), NewType('Batch', int), NewType('Height', int), NewType('Width', int)], got ./generics_typevartuple_basic.py.Array~[NewType('Time', int), NewType('Batch', int), NewType('Width', int), NewType('Height', int)] [incompatible_assignment] +./generics_typevartuple_basic.py:53:21: TypeVarTuple must be unpacked [invalid_base] +./generics_typevartuple_basic.py:54:30: TypeVarTuple must be unpacked [invalid_annotation] +./generics_typevartuple_basic.py:57:27: TypeVarTuple must be unpacked [invalid_annotation] +./generics_typevartuple_basic.py:60:17: TypeVarTuple must be unpacked [invalid_annotation] ./generics_typevartuple_basic.py:66:6: In call to typing.TypeVarTuple: Takes 1 positional arguments but 3 were given [incompatible_call] ./generics_typevartuple_basic.py:67:6: In call to typing.TypeVarTuple: Got an unexpected keyword argument 'bound' [incompatible_call] ./generics_typevartuple_basic.py:91:0: Cannot resolve type variables [incompatible_call] diff --git a/conformance/results/pycroscope/generics_typevartuple_variance.toml b/conformance/results/pycroscope/generics_typevartuple_variance.toml new file mode 100644 index 000000000..f53bb15ad --- /dev/null +++ b/conformance/results/pycroscope/generics_typevartuple_variance.toml @@ -0,0 +1,54 @@ +conformant = "Unsupported" +conformance_automated = "Fail" +errors_diff = """ +Line 56: Expected 1 errors +Line 57: Expected 1 errors +Line 58: Expected 1 errors +Line 79: Expected 1 errors +Line 90: Expected 1 errors +Line 29: Unexpected errors ['./generics_typevartuple_variance.py:29:0: Incompatible assignment: expected generics_typevartuple_variance.ContravariantTypeVarTuple[int], got generics_typevartuple_variance.ContravariantTypeVarTuple[object] [incompatible_assignment]'] +Line 30: Unexpected errors ['./generics_typevartuple_variance.py:30:0: Incompatible assignment: expected generics_typevartuple_variance.ContravariantTypeVarTuple[*tuple[int, ...]], got generics_typevartuple_variance.ContravariantTypeVarTuple[tuple[object, ...]] [incompatible_assignment]'] +Line 33: Unexpected errors ['./generics_typevartuple_variance.py:33:0: Incompatible assignment: expected generics_typevartuple_variance.ContravariantTypeVarTuple[int], got generics_typevartuple_variance.ContravariantTypeVarTuple[tuple[int, ...]] [incompatible_assignment]'] +Line 43: Unexpected errors ['./generics_typevartuple_variance.py:43:0: Incompatible assignment: expected generics_typevartuple_variance.CovariantTypeVarTuple[object], got generics_typevartuple_variance.CovariantTypeVarTuple[int] [incompatible_assignment]'] +Line 44: Unexpected errors ['./generics_typevartuple_variance.py:44:0: Incompatible assignment: expected generics_typevartuple_variance.CovariantTypeVarTuple[int, int], got generics_typevartuple_variance.CovariantTypeVarTuple[bool, bool] [incompatible_assignment]'] +Line 49: Unexpected errors ['./generics_typevartuple_variance.py:49:0: Incompatible assignment: expected generics_typevartuple_variance.CovariantTypeVarTuple[*tuple[object, ...]], got generics_typevartuple_variance.CovariantTypeVarTuple[tuple[int, ...]] [incompatible_assignment]'] +Line 52: Unexpected errors ['./generics_typevartuple_variance.py:52:0: Incompatible assignment: expected generics_typevartuple_variance.CovariantTypeVarTuple[*tuple[int, ...]], got generics_typevartuple_variance.CovariantTypeVarTuple[int] [incompatible_assignment]'] +Line 84: Unexpected errors ['./generics_typevartuple_variance.py:84:0: Incompatible assignment: expected generics_typevartuple_variance.ContravariantTypeVarTupleOld[int], got generics_typevartuple_variance.ContravariantTypeVarTupleOld[object] [incompatible_assignment]'] +Line 98: Unexpected errors ['./generics_typevartuple_variance.py:98:0: Incompatible assignment: expected generics_typevartuple_variance.CovariantTypeVarTupleOld[object], got generics_typevartuple_variance.CovariantTypeVarTupleOld[int] [incompatible_assignment]'] +Line 108: Unexpected errors ['./generics_typevartuple_variance.py:108:0: Incompatible assignment: expected generics_typevartuple_variance.InferredContravariantTypeVarTupleOld[int], got generics_typevartuple_variance.InferredContravariantTypeVarTupleOld[object] [incompatible_assignment]'] +Line 117: Unexpected errors ['./generics_typevartuple_variance.py:117:0: Incompatible assignment: expected generics_typevartuple_variance.InferredCovariantTypeVarTupleOld[object], got generics_typevartuple_variance.InferredCovariantTypeVarTupleOld[int] [incompatible_assignment]'] +""" +output = """ +./generics_typevartuple_variance.py:14:0: Incompatible assignment: expected generics_typevartuple_variance.InvariantTypeVarTuple[object], got generics_typevartuple_variance.InvariantTypeVarTuple[int] [incompatible_assignment] +./generics_typevartuple_variance.py:15:0: Incompatible assignment: expected generics_typevartuple_variance.InvariantTypeVarTuple[int], got generics_typevartuple_variance.InvariantTypeVarTuple[object] [incompatible_assignment] +./generics_typevartuple_variance.py:17:0: Incompatible assignment: expected generics_typevartuple_variance.InvariantTypeVarTuple[*tuple[int, ...]], got generics_typevartuple_variance.InvariantTypeVarTuple[tuple[object, ...]] [incompatible_assignment] +./generics_typevartuple_variance.py:18:0: Incompatible assignment: expected generics_typevartuple_variance.InvariantTypeVarTuple[*tuple[object, ...]], got generics_typevartuple_variance.InvariantTypeVarTuple[tuple[int, ...]] [incompatible_assignment] +./generics_typevartuple_variance.py:20:0: Incompatible assignment: expected generics_typevartuple_variance.InvariantTypeVarTuple[int], got generics_typevartuple_variance.InvariantTypeVarTuple[tuple[int, ...]] [incompatible_assignment] +./generics_typevartuple_variance.py:21:0: Incompatible assignment: expected generics_typevartuple_variance.InvariantTypeVarTuple[*tuple[int, ...]], got generics_typevartuple_variance.InvariantTypeVarTuple[int] [incompatible_assignment] +./generics_typevartuple_variance.py:28:0: Incompatible assignment: expected generics_typevartuple_variance.ContravariantTypeVarTuple[object, object], got generics_typevartuple_variance.ContravariantTypeVarTuple[object, int] [incompatible_assignment] +./generics_typevartuple_variance.py:29:0: Incompatible assignment: expected generics_typevartuple_variance.ContravariantTypeVarTuple[int], got generics_typevartuple_variance.ContravariantTypeVarTuple[object] [incompatible_assignment] +./generics_typevartuple_variance.py:30:0: Incompatible assignment: expected generics_typevartuple_variance.ContravariantTypeVarTuple[*tuple[int, ...]], got generics_typevartuple_variance.ContravariantTypeVarTuple[tuple[object, ...]] [incompatible_assignment] +./generics_typevartuple_variance.py:31:0: Incompatible assignment: expected generics_typevartuple_variance.ContravariantTypeVarTuple[*tuple[object, ...]], got generics_typevartuple_variance.ContravariantTypeVarTuple[tuple[int, ...]] [incompatible_assignment] +./generics_typevartuple_variance.py:33:0: Incompatible assignment: expected generics_typevartuple_variance.ContravariantTypeVarTuple[int], got generics_typevartuple_variance.ContravariantTypeVarTuple[tuple[int, ...]] [incompatible_assignment] +./generics_typevartuple_variance.py:34:0: Incompatible assignment: expected generics_typevartuple_variance.ContravariantTypeVarTuple[*tuple[int, ...]], got generics_typevartuple_variance.ContravariantTypeVarTuple[int] [incompatible_assignment] +./generics_typevartuple_variance.py:42:0: Incompatible assignment: expected generics_typevartuple_variance.CovariantTypeVarTuple[int], got generics_typevartuple_variance.CovariantTypeVarTuple[object] [incompatible_assignment] +./generics_typevartuple_variance.py:43:0: Incompatible assignment: expected generics_typevartuple_variance.CovariantTypeVarTuple[object], got generics_typevartuple_variance.CovariantTypeVarTuple[int] [incompatible_assignment] +./generics_typevartuple_variance.py:44:0: Incompatible assignment: expected generics_typevartuple_variance.CovariantTypeVarTuple[int, int], got generics_typevartuple_variance.CovariantTypeVarTuple[bool, bool] [incompatible_assignment] +./generics_typevartuple_variance.py:45:0: Incompatible assignment: expected generics_typevartuple_variance.CovariantTypeVarTuple[int, int], got generics_typevartuple_variance.CovariantTypeVarTuple[bool, object] [incompatible_assignment] +./generics_typevartuple_variance.py:46:0: Incompatible assignment: expected generics_typevartuple_variance.CovariantTypeVarTuple[int, int], got generics_typevartuple_variance.CovariantTypeVarTuple[object, bool] [incompatible_assignment] +./generics_typevartuple_variance.py:47:0: Incompatible assignment: expected generics_typevartuple_variance.CovariantTypeVarTuple[int, int], got generics_typevartuple_variance.CovariantTypeVarTuple[object, object] [incompatible_assignment] +./generics_typevartuple_variance.py:48:0: Incompatible assignment: expected generics_typevartuple_variance.CovariantTypeVarTuple[*tuple[int, ...]], got generics_typevartuple_variance.CovariantTypeVarTuple[tuple[object, ...]] [incompatible_assignment] +./generics_typevartuple_variance.py:49:0: Incompatible assignment: expected generics_typevartuple_variance.CovariantTypeVarTuple[*tuple[object, ...]], got generics_typevartuple_variance.CovariantTypeVarTuple[tuple[int, ...]] [incompatible_assignment] +./generics_typevartuple_variance.py:51:0: Incompatible assignment: expected generics_typevartuple_variance.CovariantTypeVarTuple[int], got generics_typevartuple_variance.CovariantTypeVarTuple[tuple[int, ...]] [incompatible_assignment] +./generics_typevartuple_variance.py:52:0: Incompatible assignment: expected generics_typevartuple_variance.CovariantTypeVarTuple[*tuple[int, ...]], got generics_typevartuple_variance.CovariantTypeVarTuple[int] [incompatible_assignment] +./generics_typevartuple_variance.py:68:0: Incompatible assignment: expected generics_typevartuple_variance.InvariantTypeVarTupleOld[object], got generics_typevartuple_variance.InvariantTypeVarTupleOld[int] [incompatible_assignment] +./generics_typevartuple_variance.py:69:0: Incompatible assignment: expected generics_typevartuple_variance.InvariantTypeVarTupleOld[int], got generics_typevartuple_variance.InvariantTypeVarTupleOld[object] [incompatible_assignment] +./generics_typevartuple_variance.py:83:0: Incompatible assignment: expected generics_typevartuple_variance.ContravariantTypeVarTupleOld[object], got generics_typevartuple_variance.ContravariantTypeVarTupleOld[int] [incompatible_assignment] +./generics_typevartuple_variance.py:84:0: Incompatible assignment: expected generics_typevartuple_variance.ContravariantTypeVarTupleOld[int], got generics_typevartuple_variance.ContravariantTypeVarTupleOld[object] [incompatible_assignment] +./generics_typevartuple_variance.py:97:0: Incompatible assignment: expected generics_typevartuple_variance.CovariantTypeVarTupleOld[int], got generics_typevartuple_variance.CovariantTypeVarTupleOld[object] [incompatible_assignment] +./generics_typevartuple_variance.py:98:0: Incompatible assignment: expected generics_typevartuple_variance.CovariantTypeVarTupleOld[object], got generics_typevartuple_variance.CovariantTypeVarTupleOld[int] [incompatible_assignment] +./generics_typevartuple_variance.py:107:0: Incompatible assignment: expected generics_typevartuple_variance.InferredContravariantTypeVarTupleOld[object], got generics_typevartuple_variance.InferredContravariantTypeVarTupleOld[int] [incompatible_assignment] +./generics_typevartuple_variance.py:108:0: Incompatible assignment: expected generics_typevartuple_variance.InferredContravariantTypeVarTupleOld[int], got generics_typevartuple_variance.InferredContravariantTypeVarTupleOld[object] [incompatible_assignment] +./generics_typevartuple_variance.py:116:0: Incompatible assignment: expected generics_typevartuple_variance.InferredCovariantTypeVarTupleOld[int], got generics_typevartuple_variance.InferredCovariantTypeVarTupleOld[object] [incompatible_assignment] +./generics_typevartuple_variance.py:117:0: Incompatible assignment: expected generics_typevartuple_variance.InferredCovariantTypeVarTupleOld[object], got generics_typevartuple_variance.InferredCovariantTypeVarTupleOld[int] [incompatible_assignment] +""" diff --git a/conformance/results/pycroscope/literals_parameterizations.toml b/conformance/results/pycroscope/literals_parameterizations.toml index 80a88342d..d6be8e851 100644 --- a/conformance/results/pycroscope/literals_parameterizations.toml +++ b/conformance/results/pycroscope/literals_parameterizations.toml @@ -16,7 +16,7 @@ output = """ ./literals_parameterizations.py:43:6: Arguments to Literal[] must be None, bool, int, str, bytes, or enum members; got (4+3j) [invalid_literal] ./literals_parameterizations.py:47:6: Arguments to Literal[] must be None, bool, int, str, bytes, or enum members; got {'a': 'b', 'c': 'd'} [invalid_literal] ./literals_parameterizations.py:48:6: Arguments to Literal[] must be None, bool, int, str, bytes, or enum members; got [invalid_literal] -./literals_parameterizations.py:50:7: Arguments to Literal[] must be literals, not (PartialCallValue(callee=KnownValue(val=), arguments={'name': KnownValue(val='T'), 'constraints': SequenceValue(typ=, literal_only=False, args=(MultiValuedValue(vals=()),), weak=True, members=()), 'bound': KnownValue(val=), 'covariant': KnownValue(val=False), 'contravariant': KnownValue(val=False), 'infer_variance': KnownValue(val=False), 'default': KnownValue(val=)}, runtime_value=TypedValue(typ=, literal_only=False), node=),) [invalid_literal] +./literals_parameterizations.py:50:7: Arguments to Literal[] must be literals, not (PartialCallValue(callee=KnownValue(val=), arguments={'name': KnownValue(val='T'), 'constraints': SequenceValue(typ=, literal_only=False, args=(MultiValuedValue(vals=()),), weak=True, members=()), 'bound': KnownValue(val=no argument given), 'covariant': KnownValue(val=False), 'contravariant': KnownValue(val=False), 'infer_variance': KnownValue(val=False), 'default': KnownValue(val=no argument given)}, runtime_value=TypedValue(typ=, literal_only=False), node=),) [invalid_literal] ./literals_parameterizations.py:50:15: Type parameter is not valid in this annotation context [invalid_annotation] ./literals_parameterizations.py:51:7: Arguments to Literal[] must be None, bool, int, str, bytes, or enum members; got 3.14 [invalid_literal] ./literals_parameterizations.py:52:7: Arguments to Literal[] must be None, bool, int, str, bytes, or enum members; got typing.Any [invalid_literal] diff --git a/conformance/results/pycroscope/protocols_variance.toml b/conformance/results/pycroscope/protocols_variance.toml index 70d6e1c4b..43efcf3a7 100644 --- a/conformance/results/pycroscope/protocols_variance.toml +++ b/conformance/results/pycroscope/protocols_variance.toml @@ -2,11 +2,11 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -./protocols_variance.py:21:0: T1 should be covariant [invalid_protocol] -./protocols_variance.py:40:0: T3 should be contravariant [invalid_protocol] -./protocols_variance.py:56:0: T1 should be contravariant [invalid_protocol] -./protocols_variance.py:61:0: T1_co should be contravariant [invalid_protocol] -./protocols_variance.py:66:0: T1 should be covariant [invalid_protocol] -./protocols_variance.py:71:0: T1_contra should be covariant [invalid_protocol] -./protocols_variance.py:104:0: T1 should be covariant [invalid_protocol] +./protocols_variance.py:22:0: T1 should be covariant [invalid_protocol] +./protocols_variance.py:41:0: T3 should be contravariant [invalid_protocol] +./protocols_variance.py:57:0: T1 should be contravariant [invalid_protocol] +./protocols_variance.py:62:0: T1_co should be contravariant [invalid_protocol] +./protocols_variance.py:67:0: T1 should be covariant [invalid_protocol] +./protocols_variance.py:72:0: T1_contra should be covariant [invalid_protocol] +./protocols_variance.py:105:0: T1 should be covariant [invalid_protocol] """ diff --git a/conformance/results/pycroscope/specialtypes_sentinels.toml b/conformance/results/pycroscope/specialtypes_sentinels.toml index 4c2425384..77f5d331c 100644 --- a/conformance/results/pycroscope/specialtypes_sentinels.toml +++ b/conformance/results/pycroscope/specialtypes_sentinels.toml @@ -3,6 +3,6 @@ errors_diff = """ """ output = """ ./specialtypes_sentinels.py:14:10: Default value for argument x incompatible with declared type int [incompatible_default] -./specialtypes_sentinels.py:36:6: Incompatible argument type for x: expected int | Literal[<>, ] but got [incompatible_argument] -./specialtypes_sentinels.py:39:6: Incompatible argument type for x: expected int | Literal[] but got <> [incompatible_argument] +./specialtypes_sentinels.py:36:6: Incompatible argument type for x: expected int | Literal[, SPECIAL] but got Cls.IN_CLASS [incompatible_argument] +./specialtypes_sentinels.py:39:6: Incompatible argument type for x: expected int | Literal[Cls.IN_CLASS] but got [incompatible_argument] """ diff --git a/conformance/results/pyrefly/generics_mixed_variance_inference.toml b/conformance/results/pyrefly/generics_mixed_variance_inference.toml new file mode 100644 index 000000000..862cfd90f --- /dev/null +++ b/conformance/results/pyrefly/generics_mixed_variance_inference.toml @@ -0,0 +1,13 @@ +conformant = "Unsupported" +conformance_automated = "Fail" +errors_diff = """ +Line 21: Expected 1 errors +Line 17: Unexpected errors ['`Mixed[int, bool, []]` is not assignable to `Mixed[int, int, []]` [bad-assignment]'] +Line 20: Unexpected errors ['`Mixed[int, *tuple[()], [object]]` is not assignable to `Mixed[int, *tuple[()], [int]]` [bad-assignment]'] +""" +output = """ +ERROR generics_mixed_variance_inference.py:13:22-39: `Mixed[bool, *tuple[()], []]` is not assignable to `Mixed[int, *tuple[()], []]` [bad-assignment] +ERROR generics_mixed_variance_inference.py:16:27-51: `Mixed[int, object, []]` is not assignable to `Mixed[int, int, []]` [bad-assignment] +ERROR generics_mixed_variance_inference.py:17:27-49: `Mixed[int, bool, []]` is not assignable to `Mixed[int, int, []]` [bad-assignment] +ERROR generics_mixed_variance_inference.py:20:25-47: `Mixed[int, *tuple[()], [object]]` is not assignable to `Mixed[int, *tuple[()], [int]]` [bad-assignment] +""" diff --git a/conformance/results/pyrefly/generics_paramspec_variance.toml b/conformance/results/pyrefly/generics_paramspec_variance.toml new file mode 100644 index 000000000..f68f02249 --- /dev/null +++ b/conformance/results/pyrefly/generics_paramspec_variance.toml @@ -0,0 +1,55 @@ +conformant = "Unsupported" +conformance_automated = "Fail" +errors_diff = """ +Line 14: Expected 1 errors +Line 21: Expected 1 errors +Line 30: Expected 1 errors +Line 61: Expected 1 errors +Line 63: Expected 1 errors +Line 90: Expected 1 errors +Line 117: Expected 1 errors +Line 126: Expected 1 errors +Line 22: Unexpected errors ['`ContravariantParamSpec[[object]]` is not assignable to `ContravariantParamSpec[[int]]` [bad-assignment]'] +Line 31: Unexpected errors ['`CovariantParamSpec[[int]]` is not assignable to `CovariantParamSpec[[object]]` [bad-assignment]'] +Line 67: Unexpected errors ['`InitP[[a: int = 1]]` is not assignable to attribute `t` with type `InitP[[a: int]]` [bad-assignment]'] +Line 84: Unexpected errors ['`OutitP[[*, a: int]]` is not assignable to attribute `t` with type `OutitP[[a: int]]` [bad-assignment]'] +Line 86: Unexpected errors ['`OutitP[[a: int, /]]` is not assignable to attribute `t` with type `OutitP[[a: int]]` [bad-assignment]'] +Line 97: Unexpected errors ['Unexpected keyword argument `contravariant` to ParamSpec [invalid-param-spec]'] +Line 98: Unexpected errors ['Unexpected keyword argument `covariant` to ParamSpec [invalid-param-spec]'] +Line 99: Unexpected errors ['Unexpected keyword argument `infer_variance` to ParamSpec [invalid-param-spec]'] +Line 122: Unexpected errors ['`ContravariantParamSpecOld[[object]]` is not assignable to `ContravariantParamSpecOld[[int]]` [bad-assignment]'] +Line 133: Unexpected errors ['`CovariantParamSpecOld[[int]]` is not assignable to `CovariantParamSpecOld[[object]]` [bad-assignment]'] +Line 143: Unexpected errors ['`InferredContravariantParamSpecOld[[object]]` is not assignable to `InferredContravariantParamSpecOld[[int]]` [bad-assignment]'] +Line 152: Unexpected errors ['`InferredCovariantParamSpecOld[[int]]` is not assignable to `InferredCovariantParamSpecOld[[object]]` [bad-assignment]'] +""" +output = """ +ERROR generics_paramspec_variance.py:15:39-67: `InvariantParamSpec[[object]]` is not assignable to `InvariantParamSpec[[int]]` [bad-assignment] +ERROR generics_paramspec_variance.py:22:39-71: `ContravariantParamSpec[[object]]` is not assignable to `ContravariantParamSpec[[int]]` [bad-assignment] +ERROR generics_paramspec_variance.py:31:39-64: `CovariantParamSpec[[int]]` is not assignable to `CovariantParamSpec[[object]]` [bad-assignment] +ERROR generics_paramspec_variance.py:65:12-22: `InitP[[b: int]]` is not assignable to attribute `t` with type `InitP[[a: int]]` [bad-assignment] +ERROR generics_paramspec_variance.py:67:12-24: `InitP[[a: int = 1]]` is not assignable to attribute `t` with type `InitP[[a: int]]` [bad-assignment] +ERROR generics_paramspec_variance.py:69:12-22: `InitP[[a: int, b: str]]` is not assignable to attribute `t` with type `InitP[[a: int]]` [bad-assignment] +ERROR generics_paramspec_variance.py:84:13-21: `OutitP[[*, a: int]]` is not assignable to attribute `t` with type `OutitP[[a: int]]` [bad-assignment] +ERROR generics_paramspec_variance.py:86:13-22: `OutitP[[a: int, /]]` is not assignable to attribute `t` with type `OutitP[[a: int]]` [bad-assignment] +ERROR generics_paramspec_variance.py:88:13-24: `OutitP[[b: int]]` is not assignable to attribute `t` with type `OutitP[[a: int]]` [bad-assignment] +ERROR generics_paramspec_variance.py:92:13-24: `OutitP[[a: int, b: str]]` is not assignable to attribute `t` with type `OutitP[[a: int]]` [bad-assignment] +ERROR generics_paramspec_variance.py:97:24-42: Unexpected keyword argument `contravariant` to ParamSpec [invalid-param-spec] +ERROR generics_paramspec_variance.py:98:26-40: Unexpected keyword argument `covariant` to ParamSpec [invalid-param-spec] +ERROR generics_paramspec_variance.py:99:30-49: Unexpected keyword argument `infer_variance` to ParamSpec [invalid-param-spec] +ERROR generics_paramspec_variance.py:100:28-42: Unexpected keyword argument `covariant` to ParamSpec [invalid-param-spec] +ERROR generics_paramspec_variance.py:100:44-62: Unexpected keyword argument `contravariant` to ParamSpec [invalid-param-spec] +ERROR generics_paramspec_variance.py:101:28-42: Unexpected keyword argument `covariant` to ParamSpec [invalid-param-spec] +ERROR generics_paramspec_variance.py:101:44-63: Unexpected keyword argument `infer_variance` to ParamSpec [invalid-param-spec] +ERROR generics_paramspec_variance.py:102:28-46: Unexpected keyword argument `contravariant` to ParamSpec [invalid-param-spec] +ERROR generics_paramspec_variance.py:102:48-67: Unexpected keyword argument `infer_variance` to ParamSpec [invalid-param-spec] +ERROR generics_paramspec_variance.py:110:14-43: `InvariantParamSpecOld[[bool]]` is not assignable to variable `in_out_old` with type `InvariantParamSpecOld[[int]]` [bad-assignment] +ERROR generics_paramspec_variance.py:111:14-45: `InvariantParamSpecOld[[object]]` is not assignable to variable `in_out_old` with type `InvariantParamSpecOld[[int]]` [bad-assignment] +ERROR generics_paramspec_variance.py:121:49-81: `ContravariantParamSpecOld[[int]]` is not assignable to `ContravariantParamSpecOld[[object]]` [bad-assignment] +ERROR generics_paramspec_variance.py:122:46-81: `ContravariantParamSpecOld[[object]]` is not assignable to `ContravariantParamSpecOld[[int]]` [bad-assignment] +ERROR generics_paramspec_variance.py:132:43-74: `CovariantParamSpecOld[[object]]` is not assignable to `CovariantParamSpecOld[[int]]` [bad-assignment] +ERROR generics_paramspec_variance.py:133:46-74: `CovariantParamSpecOld[[int]]` is not assignable to `CovariantParamSpecOld[[object]]` [bad-assignment] +ERROR generics_paramspec_variance.py:142:63-103: `InferredContravariantParamSpecOld[[int]]` is not assignable to `InferredContravariantParamSpecOld[[object]]` [bad-assignment] +ERROR generics_paramspec_variance.py:143:60-103: `InferredContravariantParamSpecOld[[object]]` is not assignable to `InferredContravariantParamSpecOld[[int]]` [bad-assignment] +ERROR generics_paramspec_variance.py:151:57-96: `InferredCovariantParamSpecOld[[object]]` is not assignable to `InferredCovariantParamSpecOld[[int]]` [bad-assignment] +ERROR generics_paramspec_variance.py:152:60-96: `InferredCovariantParamSpecOld[[int]]` is not assignable to `InferredCovariantParamSpecOld[[object]]` [bad-assignment] +""" diff --git a/conformance/results/pyrefly/generics_typevartuple_basic.toml b/conformance/results/pyrefly/generics_typevartuple_basic.toml index e4437865d..df28e1648 100644 --- a/conformance/results/pyrefly/generics_typevartuple_basic.toml +++ b/conformance/results/pyrefly/generics_typevartuple_basic.toml @@ -3,18 +3,18 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR generics_typevartuple_basic.py:42:34-43: Argument `Height` is not assignable to parameter `shape` with type `tuple[*@_]` in function `Array.__init__` [bad-argument-type] -ERROR generics_typevartuple_basic.py:43:35-62: `Array[Batch, Width]` is not assignable to `Array[Batch, Height, Width]` [bad-assignment] -ERROR generics_typevartuple_basic.py:44:41-46:2: `Array[Time, Batch, Width, Height]` is not assignable to `Array[Time, Batch, Height, Width]` [bad-assignment] -ERROR generics_typevartuple_basic.py:52:22-27: `TypeVarTuple` must be unpacked [invalid-annotation] -ERROR generics_typevartuple_basic.py:53:37-42: `TypeVarTuple` must be unpacked [invalid-type-var-tuple] -ERROR generics_typevartuple_basic.py:56:34-39: `TypeVarTuple` must be unpacked [invalid-type-var-tuple] -ERROR generics_typevartuple_basic.py:59:24-29: `TypeVarTuple` must be unpacked [invalid-annotation] -ERROR generics_typevartuple_basic.py:65:27-41: Unexpected keyword argument `covariant` to TypeVarTuple [invalid-type-var-tuple] +ERROR generics_typevartuple_basic.py:43:34-43: Argument `Height` is not assignable to parameter `shape` with type `tuple[*@_]` in function `Array.__init__` [bad-argument-type] +ERROR generics_typevartuple_basic.py:44:35-62: `Array[Batch, Width]` is not assignable to `Array[Batch, Height, Width]` [bad-assignment] +ERROR generics_typevartuple_basic.py:45:41-47:2: `Array[Time, Batch, Width, Height]` is not assignable to `Array[Time, Batch, Height, Width]` [bad-assignment] +ERROR generics_typevartuple_basic.py:53:22-27: `TypeVarTuple` must be unpacked [invalid-annotation] +ERROR generics_typevartuple_basic.py:54:37-42: `TypeVarTuple` must be unpacked [invalid-type-var-tuple] +ERROR generics_typevartuple_basic.py:57:34-39: `TypeVarTuple` must be unpacked [invalid-type-var-tuple] +ERROR generics_typevartuple_basic.py:60:24-29: `TypeVarTuple` must be unpacked [invalid-annotation] ERROR generics_typevartuple_basic.py:66:27-30: Unexpected positional argument to TypeVarTuple [invalid-type-var-tuple] ERROR generics_typevartuple_basic.py:67:27-36: Unexpected keyword argument `bound` to TypeVarTuple [invalid-type-var-tuple] ERROR generics_typevartuple_basic.py:91:15-19: Argument `tuple[Literal[0]]` is not assignable to parameter `arg2` with type `tuple[int, int]` in function `func2` [bad-argument-type] ERROR generics_typevartuple_basic.py:100:17-18: Argument `Array[Width]` is not assignable to parameter `y` with type `Array[Height]` in function `multiply` [bad-argument-type] ERROR generics_typevartuple_basic.py:101:17-18: Argument `Array[Height, Width]` is not assignable to parameter `y` with type `Array[Height]` in function `multiply` [bad-argument-type] ERROR generics_typevartuple_basic.py:107:7-13: Type parameters for class may not have more than one TypeVarTuple [invalid-type-var-tuple] +ERROR generics_typevartuple_basic.py:111:7-13: Type parameters for class may not have more than one TypeVarTuple [invalid-type-var-tuple] """ diff --git a/conformance/results/pyrefly/generics_typevartuple_variance.toml b/conformance/results/pyrefly/generics_typevartuple_variance.toml new file mode 100644 index 000000000..ef2eff062 --- /dev/null +++ b/conformance/results/pyrefly/generics_typevartuple_variance.toml @@ -0,0 +1,63 @@ +conformant = "Unsupported" +conformance_automated = "Fail" +errors_diff = """ +Line 79: Expected 1 errors +Line 90: Expected 1 errors +Line 29: Unexpected errors ['`ContravariantTypeVarTuple[object]` is not assignable to `ContravariantTypeVarTuple[int]` [bad-assignment]'] +Line 30: Unexpected errors ['`ContravariantTypeVarTuple[*tuple[object, ...]]` is not assignable to `ContravariantTypeVarTuple[*tuple[int, ...]]` [bad-assignment]'] +Line 33: Unexpected errors ['`ContravariantTypeVarTuple[*tuple[int, ...]]` is not assignable to `ContravariantTypeVarTuple[int]` [bad-assignment]'] +Line 43: Unexpected errors ['`CovariantTypeVarTuple[int]` is not assignable to `CovariantTypeVarTuple[object]` [bad-assignment]'] +Line 44: Unexpected errors ['`CovariantTypeVarTuple[bool, bool]` is not assignable to `CovariantTypeVarTuple[int, int]` [bad-assignment]'] +Line 49: Unexpected errors ['`CovariantTypeVarTuple[*tuple[int, ...]]` is not assignable to `CovariantTypeVarTuple[*tuple[object, ...]]` [bad-assignment]'] +Line 52: Unexpected errors ['`CovariantTypeVarTuple[int]` is not assignable to `CovariantTypeVarTuple[*tuple[int, ...]]` [bad-assignment]'] +Line 55: Unexpected errors ['Unexpected keyword argument `infer_variance` to TypeVarTuple [invalid-type-var-tuple]'] +Line 73: Unexpected errors ['Unexpected keyword argument `contravariant` to TypeVarTuple [invalid-type-var-tuple]'] +Line 84: Unexpected errors ['`ContravariantTypeVarTupleOld[object]` is not assignable to `ContravariantTypeVarTupleOld[int]` [bad-assignment]'] +Line 87: Unexpected errors ['Unexpected keyword argument `covariant` to TypeVarTuple [invalid-type-var-tuple]'] +Line 98: Unexpected errors ['`CovariantTypeVarTupleOld[int]` is not assignable to `CovariantTypeVarTupleOld[object]` [bad-assignment]'] +Line 108: Unexpected errors ['`InferredContravariantTypeVarTupleOld[object]` is not assignable to `InferredContravariantTypeVarTupleOld[int]` [bad-assignment]'] +Line 117: Unexpected errors ['`InferredCovariantTypeVarTupleOld[int]` is not assignable to `InferredCovariantTypeVarTupleOld[object]` [bad-assignment]'] +""" +output = """ +ERROR generics_typevartuple_variance.py:14:45-73: `InvariantTypeVarTuple[int]` is not assignable to `InvariantTypeVarTuple[object]` [bad-assignment] +ERROR generics_typevartuple_variance.py:15:42-73: `InvariantTypeVarTuple[object]` is not assignable to `InvariantTypeVarTuple[int]` [bad-assignment] +ERROR generics_typevartuple_variance.py:17:64-108: `InvariantTypeVarTuple[*tuple[object, ...]]` is not assignable to `InvariantTypeVarTuple[*tuple[int, ...]]` [bad-assignment] +ERROR generics_typevartuple_variance.py:18:70-111: `InvariantTypeVarTuple[*tuple[int, ...]]` is not assignable to `InvariantTypeVarTuple[*tuple[object, ...]]` [bad-assignment] +ERROR generics_typevartuple_variance.py:20:58-99: `InvariantTypeVarTuple[*tuple[int, ...]]` is not assignable to `InvariantTypeVarTuple[int]` [bad-assignment] +ERROR generics_typevartuple_variance.py:21:71-99: `InvariantTypeVarTuple[int]` is not assignable to `InvariantTypeVarTuple[*tuple[int, ...]]` [bad-assignment] +ERROR generics_typevartuple_variance.py:28:53-93: `ContravariantTypeVarTuple[object, int]` is not assignable to `ContravariantTypeVarTuple[object, object]` [bad-assignment] +ERROR generics_typevartuple_variance.py:29:42-77: `ContravariantTypeVarTuple[object]` is not assignable to `ContravariantTypeVarTuple[int]` [bad-assignment] +ERROR generics_typevartuple_variance.py:30:64-112: `ContravariantTypeVarTuple[*tuple[object, ...]]` is not assignable to `ContravariantTypeVarTuple[*tuple[int, ...]]` [bad-assignment] +ERROR generics_typevartuple_variance.py:31:70-115: `ContravariantTypeVarTuple[*tuple[int, ...]]` is not assignable to `ContravariantTypeVarTuple[*tuple[object, ...]]` [bad-assignment] +ERROR generics_typevartuple_variance.py:33:58-103: `ContravariantTypeVarTuple[*tuple[int, ...]]` is not assignable to `ContravariantTypeVarTuple[int]` [bad-assignment] +ERROR generics_typevartuple_variance.py:34:71-103: `ContravariantTypeVarTuple[int]` is not assignable to `ContravariantTypeVarTuple[*tuple[int, ...]]` [bad-assignment] +ERROR generics_typevartuple_variance.py:42:39-70: `CovariantTypeVarTuple[object]` is not assignable to `CovariantTypeVarTuple[int]` [bad-assignment] +ERROR generics_typevartuple_variance.py:43:42-70: `CovariantTypeVarTuple[int]` is not assignable to `CovariantTypeVarTuple[object]` [bad-assignment] +ERROR generics_typevartuple_variance.py:44:50-86: `CovariantTypeVarTuple[bool, bool]` is not assignable to `CovariantTypeVarTuple[int, int]` [bad-assignment] +ERROR generics_typevartuple_variance.py:45:50-88: `CovariantTypeVarTuple[bool, object]` is not assignable to `CovariantTypeVarTuple[int, int]` [bad-assignment] +ERROR generics_typevartuple_variance.py:46:50-88: `CovariantTypeVarTuple[object, bool]` is not assignable to `CovariantTypeVarTuple[int, int]` [bad-assignment] +ERROR generics_typevartuple_variance.py:47:50-90: `CovariantTypeVarTuple[object, object]` is not assignable to `CovariantTypeVarTuple[int, int]` [bad-assignment] +ERROR generics_typevartuple_variance.py:48:61-105: `CovariantTypeVarTuple[*tuple[object, ...]]` is not assignable to `CovariantTypeVarTuple[*tuple[int, ...]]` [bad-assignment] +ERROR generics_typevartuple_variance.py:49:67-108: `CovariantTypeVarTuple[*tuple[int, ...]]` is not assignable to `CovariantTypeVarTuple[*tuple[object, ...]]` [bad-assignment] +ERROR generics_typevartuple_variance.py:51:55-96: `CovariantTypeVarTuple[*tuple[int, ...]]` is not assignable to `CovariantTypeVarTuple[int]` [bad-assignment] +ERROR generics_typevartuple_variance.py:52:68-96: `CovariantTypeVarTuple[int]` is not assignable to `CovariantTypeVarTuple[*tuple[int, ...]]` [bad-assignment] +ERROR generics_typevartuple_variance.py:55:35-54: Unexpected keyword argument `infer_variance` to TypeVarTuple [invalid-type-var-tuple] +ERROR generics_typevartuple_variance.py:56:33-47: Unexpected keyword argument `covariant` to TypeVarTuple [invalid-type-var-tuple] +ERROR generics_typevartuple_variance.py:56:49-67: Unexpected keyword argument `contravariant` to TypeVarTuple [invalid-type-var-tuple] +ERROR generics_typevartuple_variance.py:57:33-47: Unexpected keyword argument `covariant` to TypeVarTuple [invalid-type-var-tuple] +ERROR generics_typevartuple_variance.py:57:49-68: Unexpected keyword argument `infer_variance` to TypeVarTuple [invalid-type-var-tuple] +ERROR generics_typevartuple_variance.py:58:33-51: Unexpected keyword argument `contravariant` to TypeVarTuple [invalid-type-var-tuple] +ERROR generics_typevartuple_variance.py:58:53-72: Unexpected keyword argument `infer_variance` to TypeVarTuple [invalid-type-var-tuple] +ERROR generics_typevartuple_variance.py:68:45-76: `InvariantTypeVarTupleOld[int]` is not assignable to `InvariantTypeVarTupleOld[object]` [bad-assignment] +ERROR generics_typevartuple_variance.py:69:42-76: `InvariantTypeVarTupleOld[object]` is not assignable to `InvariantTypeVarTupleOld[int]` [bad-assignment] +ERROR generics_typevartuple_variance.py:73:29-47: Unexpected keyword argument `contravariant` to TypeVarTuple [invalid-type-var-tuple] +ERROR generics_typevartuple_variance.py:83:52-87: `ContravariantTypeVarTupleOld[int]` is not assignable to `ContravariantTypeVarTupleOld[object]` [bad-assignment] +ERROR generics_typevartuple_variance.py:84:49-87: `ContravariantTypeVarTupleOld[object]` is not assignable to `ContravariantTypeVarTupleOld[int]` [bad-assignment] +ERROR generics_typevartuple_variance.py:87:31-45: Unexpected keyword argument `covariant` to TypeVarTuple [invalid-type-var-tuple] +ERROR generics_typevartuple_variance.py:97:46-80: `CovariantTypeVarTupleOld[object]` is not assignable to `CovariantTypeVarTupleOld[int]` [bad-assignment] +ERROR generics_typevartuple_variance.py:98:49-80: `CovariantTypeVarTupleOld[int]` is not assignable to `CovariantTypeVarTupleOld[object]` [bad-assignment] +ERROR generics_typevartuple_variance.py:107:66-109: `InferredContravariantTypeVarTupleOld[int]` is not assignable to `InferredContravariantTypeVarTupleOld[object]` [bad-assignment] +ERROR generics_typevartuple_variance.py:108:63-109: `InferredContravariantTypeVarTupleOld[object]` is not assignable to `InferredContravariantTypeVarTupleOld[int]` [bad-assignment] +ERROR generics_typevartuple_variance.py:116:60-102: `InferredCovariantTypeVarTupleOld[object]` is not assignable to `InferredCovariantTypeVarTupleOld[int]` [bad-assignment] +ERROR generics_typevartuple_variance.py:117:63-102: `InferredCovariantTypeVarTupleOld[int]` is not assignable to `InferredCovariantTypeVarTupleOld[object]` [bad-assignment] +""" diff --git a/conformance/results/pyrefly/protocols_variance.toml b/conformance/results/pyrefly/protocols_variance.toml index f0c9d08dc..f6836baf9 100644 --- a/conformance/results/pyrefly/protocols_variance.toml +++ b/conformance/results/pyrefly/protocols_variance.toml @@ -1,13 +1,18 @@ -conformant = "Pass" -conformance_automated = "Pass" +conformant = "Partial" +conformance_automated = "Fail" +notes = """ +Doesn't support variance keywords to ParamSpec +""" errors_diff = """ +Line 15: Unexpected errors ['Unexpected keyword argument `contravariant` to ParamSpec [invalid-param-spec]'] """ output = """ - WARN protocols_variance.py:21:7-17: Type variable `T1` in class `AnotherBox` is declared as invariant, but could be covariant based on its usage [variance-mismatch] - WARN protocols_variance.py:40:7-16: Type variable `T3` in class `Protocol2` is declared as invariant, but could be contravariant based on its usage [variance-mismatch] - WARN protocols_variance.py:56:7-16: Type variable `T1` in class `Protocol4` is declared as invariant, but could be contravariant based on its usage [variance-mismatch] -ERROR protocols_variance.py:62:9-11: Type variable `T1_co` is covariant but is used in contravariant position [invalid-variance] - WARN protocols_variance.py:66:7-16: Type variable `T1` in class `Protocol6` is declared as invariant, but could be covariant based on its usage [variance-mismatch] -ERROR protocols_variance.py:72:9-11: Type variable `T1_contra` is contravariant but is used in covariant position [invalid-variance] - WARN protocols_variance.py:104:7-17: Type variable `T1` in class `Protocol12` is declared as invariant, but could be covariant based on its usage [variance-mismatch] +ERROR protocols_variance.py:15:20-38: Unexpected keyword argument `contravariant` to ParamSpec [invalid-param-spec] + WARN protocols_variance.py:22:7-17: Type variable `T1` in class `AnotherBox` is declared as invariant, but could be covariant based on its usage [variance-mismatch] + WARN protocols_variance.py:41:7-16: Type variable `T3` in class `Protocol2` is declared as invariant, but could be contravariant based on its usage [variance-mismatch] + WARN protocols_variance.py:57:7-16: Type variable `T1` in class `Protocol4` is declared as invariant, but could be contravariant based on its usage [variance-mismatch] +ERROR protocols_variance.py:63:9-11: Type variable `T1_co` is covariant but is used in contravariant position [invalid-variance] + WARN protocols_variance.py:67:7-16: Type variable `T1` in class `Protocol6` is declared as invariant, but could be covariant based on its usage [variance-mismatch] +ERROR protocols_variance.py:73:9-11: Type variable `T1_contra` is contravariant but is used in covariant position [invalid-variance] + WARN protocols_variance.py:105:7-17: Type variable `T1` in class `Protocol12` is declared as invariant, but could be covariant based on its usage [variance-mismatch] """ diff --git a/conformance/results/pyright/generics_mixed_variance_inference.toml b/conformance/results/pyright/generics_mixed_variance_inference.toml new file mode 100644 index 000000000..36e0b0436 --- /dev/null +++ b/conformance/results/pyright/generics_mixed_variance_inference.toml @@ -0,0 +1,24 @@ +conformant = "Unsupported" +conformance_automated = "Fail" +errors_diff = """ +Line 17: Unexpected errors ['generics_mixed_variance_inference.py:17:27 - error: Type "Mixed[int, bool, ()]" is not assignable to declared type "Mixed[int, int, ()]"'] +Line 20: Unexpected errors ['generics_mixed_variance_inference.py:20:25 - error: Type "Mixed[int, (object)]" is not assignable to declared type "Mixed[int, (int)]"'] +""" +output = """ +generics_mixed_variance_inference.py:13:22 - error: Type "Mixed[bool, ()]" is not assignable to declared type "Mixed[int, ()]" +  "Mixed[bool, ()]" is not assignable to "Mixed[int, ()]" +    Type parameter "T@Mixed" is contravariant, but "bool" is not a supertype of "int" +      "int" is not assignable to "bool" (reportAssignmentType) +generics_mixed_variance_inference.py:16:27 - error: Type "Mixed[int, object, ()]" is not assignable to declared type "Mixed[int, int, ()]" +  "Mixed[int, object, ()]" is not assignable to "Mixed[int, int, ()]" +    Type parameter "Ts@Mixed" is invariant, but "*tuple[object]" is not the same as "*tuple[int]" (reportAssignmentType) +generics_mixed_variance_inference.py:17:27 - error: Type "Mixed[int, bool, ()]" is not assignable to declared type "Mixed[int, int, ()]" +  "Mixed[int, bool, ()]" is not assignable to "Mixed[int, int, ()]" +    Type parameter "Ts@Mixed" is invariant, but "*tuple[bool]" is not the same as "*tuple[int]" (reportAssignmentType) +generics_mixed_variance_inference.py:20:25 - error: Type "Mixed[int, (object)]" is not assignable to declared type "Mixed[int, (int)]" +  "Mixed[int, (object)]" is not assignable to "Mixed[int, (int)]" +    Type parameter "P@Mixed" is invariant, but "(object)" is not the same as "(int)" (reportAssignmentType) +generics_mixed_variance_inference.py:21:25 - error: Type "Mixed[int, (bool)]" is not assignable to declared type "Mixed[int, (int)]" +  "Mixed[int, (bool)]" is not assignable to "Mixed[int, (int)]" +    Type parameter "P@Mixed" is invariant, but "(bool)" is not the same as "(int)" (reportAssignmentType) +""" diff --git a/conformance/results/pyright/generics_paramspec_variance.toml b/conformance/results/pyright/generics_paramspec_variance.toml new file mode 100644 index 000000000..f39f7d2aa --- /dev/null +++ b/conformance/results/pyright/generics_paramspec_variance.toml @@ -0,0 +1,101 @@ +conformant = "Unsupported" +conformance_automated = "Fail" +errors_diff = """ +Line 90: Expected 1 errors +Line 117: Expected 1 errors +Line 126: Expected 1 errors +Line 22: Unexpected errors ['generics_paramspec_variance.py:22:39 - error: Type "ContravariantParamSpec[(object)]" is not assignable to declared type "ContravariantParamSpec[(int)]"'] +Line 31: Unexpected errors ['generics_paramspec_variance.py:31:39 - error: Type "CovariantParamSpec[(int)]" is not assignable to declared type "CovariantParamSpec[(object)]"'] +Line 84: Unexpected errors ['generics_paramspec_variance.py:84:13 - error: Cannot assign to attribute "t" for class "Box[OutitP[(a: int)]]"'] +Line 86: Unexpected errors ['generics_paramspec_variance.py:86:13 - error: Cannot assign to attribute "t" for class "Box[OutitP[(a: int)]]"'] +Line 97: Unexpected errors ['generics_paramspec_variance.py:97:24 - error: "contravariant" is unknown parameter to ParamSpec (reportGeneralTypeIssues)'] +Line 98: Unexpected errors ['generics_paramspec_variance.py:98:26 - error: "covariant" is unknown parameter to ParamSpec (reportGeneralTypeIssues)'] +Line 99: Unexpected errors ['generics_paramspec_variance.py:99:30 - error: "infer_variance" is unknown parameter to ParamSpec (reportGeneralTypeIssues)'] +Line 122: Unexpected errors ['generics_paramspec_variance.py:122:46 - error: Type "ContravariantParamSpecOld[(object)]" is not assignable to declared type "ContravariantParamSpecOld[(int)]"'] +Line 133: Unexpected errors ['generics_paramspec_variance.py:133:46 - error: Type "CovariantParamSpecOld[(int)]" is not assignable to declared type "CovariantParamSpecOld[(object)]"'] +Line 143: Unexpected errors ['generics_paramspec_variance.py:143:60 - error: Type "InferredContravariantParamSpecOld[(object)]" is not assignable to declared type "InferredContravariantParamSpecOld[(int)]"'] +Line 152: Unexpected errors ['generics_paramspec_variance.py:152:60 - error: Type "InferredCovariantParamSpecOld[(int)]" is not assignable to declared type "InferredCovariantParamSpecOld[(object)]"'] +""" +output = """ +generics_paramspec_variance.py:14:42 - error: Type "InvariantParamSpec[(int)]" is not assignable to declared type "InvariantParamSpec[(object)]" +  "InvariantParamSpec[(int)]" is not assignable to "InvariantParamSpec[(object)]" +    Type parameter "InOutP@InvariantParamSpec" is invariant, but "(int)" is not the same as "(object)" (reportAssignmentType) +generics_paramspec_variance.py:15:39 - error: Type "InvariantParamSpec[(object)]" is not assignable to declared type "InvariantParamSpec[(int)]" +  "InvariantParamSpec[(object)]" is not assignable to "InvariantParamSpec[(int)]" +    Type parameter "InOutP@InvariantParamSpec" is invariant, but "(object)" is not the same as "(int)" (reportAssignmentType) +generics_paramspec_variance.py:21:42 - error: Type "ContravariantParamSpec[(int)]" is not assignable to declared type "ContravariantParamSpec[(object)]" +  "ContravariantParamSpec[(int)]" is not assignable to "ContravariantParamSpec[(object)]" +    Type parameter "InP@ContravariantParamSpec" is invariant, but "(int)" is not the same as "(object)" (reportAssignmentType) +generics_paramspec_variance.py:22:39 - error: Type "ContravariantParamSpec[(object)]" is not assignable to declared type "ContravariantParamSpec[(int)]" +  "ContravariantParamSpec[(object)]" is not assignable to "ContravariantParamSpec[(int)]" +    Type parameter "InP@ContravariantParamSpec" is invariant, but "(object)" is not the same as "(int)" (reportAssignmentType) +generics_paramspec_variance.py:30:36 - error: Type "CovariantParamSpec[(object)]" is not assignable to declared type "CovariantParamSpec[(int)]" +  "CovariantParamSpec[(object)]" is not assignable to "CovariantParamSpec[(int)]" +    Type parameter "OutP@CovariantParamSpec" is invariant, but "(object)" is not the same as "(int)" (reportAssignmentType) +generics_paramspec_variance.py:31:39 - error: Type "CovariantParamSpec[(int)]" is not assignable to declared type "CovariantParamSpec[(object)]" +  "CovariantParamSpec[(int)]" is not assignable to "CovariantParamSpec[(object)]" +    Type parameter "OutP@CovariantParamSpec" is invariant, but "(int)" is not the same as "(object)" (reportAssignmentType) +generics_paramspec_variance.py:61:12 - error: Cannot assign to attribute "t" for class "Box[InitP[(a: int)]]" +  "InitP[(*, a: int)]" is not assignable to "InitP[(a: int)]" +    Type parameter "P@InitP" is invariant, but "(*, a: int)" is not the same as "(a: int)" (reportAttributeAccessIssue) +generics_paramspec_variance.py:63:12 - error: Cannot assign to attribute "t" for class "Box[InitP[(a: int)]]" +  "InitP[(a: int, /)]" is not assignable to "InitP[(a: int)]" +    Type parameter "P@InitP" is invariant, but "(a: int, /)" is not the same as "(a: int)" (reportAttributeAccessIssue) +generics_paramspec_variance.py:65:12 - error: Cannot assign to attribute "t" for class "Box[InitP[(a: int)]]" +  "InitP[(b: int)]" is not assignable to "InitP[(a: int)]" +    Type parameter "P@InitP" is invariant, but "(b: int)" is not the same as "(a: int)" (reportAttributeAccessIssue) +generics_paramspec_variance.py:69:12 - error: Cannot assign to attribute "t" for class "Box[InitP[(a: int)]]" +  "InitP[(a: int, b: str)]" is not assignable to "InitP[(a: int)]" +    Type parameter "P@InitP" is invariant, but "(a: int, b: str)" is not the same as "(a: int)" (reportAttributeAccessIssue) +generics_paramspec_variance.py:84:13 - error: Cannot assign to attribute "t" for class "Box[OutitP[(a: int)]]" +  "OutitP[(*, a: int)]" is not assignable to "OutitP[(a: int)]" +    Type parameter "P@OutitP" is invariant, but "(*, a: int)" is not the same as "(a: int)" (reportAttributeAccessIssue) +generics_paramspec_variance.py:86:13 - error: Cannot assign to attribute "t" for class "Box[OutitP[(a: int)]]" +  "OutitP[(a: int, /)]" is not assignable to "OutitP[(a: int)]" +    Type parameter "P@OutitP" is invariant, but "(a: int, /)" is not the same as "(a: int)" (reportAttributeAccessIssue) +generics_paramspec_variance.py:88:13 - error: Cannot assign to attribute "t" for class "Box[OutitP[(a: int)]]" +  "OutitP[(b: int)]" is not assignable to "OutitP[(a: int)]" +    Type parameter "P@OutitP" is invariant, but "(b: int)" is not the same as "(a: int)" (reportAttributeAccessIssue) +generics_paramspec_variance.py:92:13 - error: Cannot assign to attribute "t" for class "Box[OutitP[(a: int)]]" +  "OutitP[(a: int, b: str)]" is not assignable to "OutitP[(a: int)]" +    Type parameter "P@OutitP" is invariant, but "(a: int, b: str)" is not the same as "(a: int)" (reportAttributeAccessIssue) +generics_paramspec_variance.py:97:24 - error: "contravariant" is unknown parameter to ParamSpec (reportGeneralTypeIssues) +generics_paramspec_variance.py:98:26 - error: "covariant" is unknown parameter to ParamSpec (reportGeneralTypeIssues) +generics_paramspec_variance.py:99:30 - error: "infer_variance" is unknown parameter to ParamSpec (reportGeneralTypeIssues) +generics_paramspec_variance.py:100:28 - error: "covariant" is unknown parameter to ParamSpec (reportGeneralTypeIssues) +generics_paramspec_variance.py:100:44 - error: "contravariant" is unknown parameter to ParamSpec (reportGeneralTypeIssues) +generics_paramspec_variance.py:101:28 - error: "covariant" is unknown parameter to ParamSpec (reportGeneralTypeIssues) +generics_paramspec_variance.py:101:44 - error: "infer_variance" is unknown parameter to ParamSpec (reportGeneralTypeIssues) +generics_paramspec_variance.py:102:28 - error: "contravariant" is unknown parameter to ParamSpec (reportGeneralTypeIssues) +generics_paramspec_variance.py:102:48 - error: "infer_variance" is unknown parameter to ParamSpec (reportGeneralTypeIssues) +generics_paramspec_variance.py:110:14 - error: Type "InvariantParamSpecOld[(bool)]" is not assignable to declared type "InvariantParamSpecOld[(int)]" +  "InvariantParamSpecOld[(bool)]" is not assignable to "InvariantParamSpecOld[(int)]" +    Type parameter "P@InvariantParamSpecOld" is invariant, but "(bool)" is not the same as "(int)" (reportAssignmentType) +generics_paramspec_variance.py:111:14 - error: Type "InvariantParamSpecOld[(object)]" is not assignable to declared type "InvariantParamSpecOld[(int)]" +  "InvariantParamSpecOld[(object)]" is not assignable to "InvariantParamSpecOld[(int)]" +    Type parameter "P@InvariantParamSpecOld" is invariant, but "(object)" is not the same as "(int)" (reportAssignmentType) +generics_paramspec_variance.py:121:49 - error: Type "ContravariantParamSpecOld[(int)]" is not assignable to declared type "ContravariantParamSpecOld[(object)]" +  "ContravariantParamSpecOld[(int)]" is not assignable to "ContravariantParamSpecOld[(object)]" +    Type parameter "InP@ContravariantParamSpecOld" is invariant, but "(int)" is not the same as "(object)" (reportAssignmentType) +generics_paramspec_variance.py:122:46 - error: Type "ContravariantParamSpecOld[(object)]" is not assignable to declared type "ContravariantParamSpecOld[(int)]" +  "ContravariantParamSpecOld[(object)]" is not assignable to "ContravariantParamSpecOld[(int)]" +    Type parameter "InP@ContravariantParamSpecOld" is invariant, but "(object)" is not the same as "(int)" (reportAssignmentType) +generics_paramspec_variance.py:132:43 - error: Type "CovariantParamSpecOld[(object)]" is not assignable to declared type "CovariantParamSpecOld[(int)]" +  "CovariantParamSpecOld[(object)]" is not assignable to "CovariantParamSpecOld[(int)]" +    Type parameter "OutP@CovariantParamSpecOld" is invariant, but "(object)" is not the same as "(int)" (reportAssignmentType) +generics_paramspec_variance.py:133:46 - error: Type "CovariantParamSpecOld[(int)]" is not assignable to declared type "CovariantParamSpecOld[(object)]" +  "CovariantParamSpecOld[(int)]" is not assignable to "CovariantParamSpecOld[(object)]" +    Type parameter "OutP@CovariantParamSpecOld" is invariant, but "(int)" is not the same as "(object)" (reportAssignmentType) +generics_paramspec_variance.py:142:63 - error: Type "InferredContravariantParamSpecOld[(int)]" is not assignable to declared type "InferredContravariantParamSpecOld[(object)]" +  "InferredContravariantParamSpecOld[(int)]" is not assignable to "InferredContravariantParamSpecOld[(object)]" +    Type parameter "InferP@InferredContravariantParamSpecOld" is invariant, but "(int)" is not the same as "(object)" (reportAssignmentType) +generics_paramspec_variance.py:143:60 - error: Type "InferredContravariantParamSpecOld[(object)]" is not assignable to declared type "InferredContravariantParamSpecOld[(int)]" +  "InferredContravariantParamSpecOld[(object)]" is not assignable to "InferredContravariantParamSpecOld[(int)]" +    Type parameter "InferP@InferredContravariantParamSpecOld" is invariant, but "(object)" is not the same as "(int)" (reportAssignmentType) +generics_paramspec_variance.py:151:57 - error: Type "InferredCovariantParamSpecOld[(object)]" is not assignable to declared type "InferredCovariantParamSpecOld[(int)]" +  "InferredCovariantParamSpecOld[(object)]" is not assignable to "InferredCovariantParamSpecOld[(int)]" +    Type parameter "InferP@InferredCovariantParamSpecOld" is invariant, but "(object)" is not the same as "(int)" (reportAssignmentType) +generics_paramspec_variance.py:152:60 - error: Type "InferredCovariantParamSpecOld[(int)]" is not assignable to declared type "InferredCovariantParamSpecOld[(object)]" +  "InferredCovariantParamSpecOld[(int)]" is not assignable to "InferredCovariantParamSpecOld[(object)]" +    Type parameter "InferP@InferredCovariantParamSpecOld" is invariant, but "(int)" is not the same as "(object)" (reportAssignmentType) +""" diff --git a/conformance/results/pyright/generics_typevartuple_basic.toml b/conformance/results/pyright/generics_typevartuple_basic.toml index 4021237e7..ea0d0a1a8 100644 --- a/conformance/results/pyright/generics_typevartuple_basic.toml +++ b/conformance/results/pyright/generics_typevartuple_basic.toml @@ -7,19 +7,18 @@ errors_diff = """ Line 90: Unexpected errors ['generics_typevartuple_basic.py:90:14 - error: Argument of type "tuple[Literal[\\'0\\']]" cannot be assigned to parameter "arg2" of type "tuple[*Ts@func2]" in function "func2"'] """ output = """ -generics_typevartuple_basic.py:42:34 - error: Argument of type "Height" cannot be assigned to parameter "shape" of type "tuple[*Shape@Array]" in function "__init__" +generics_typevartuple_basic.py:43:34 - error: Argument of type "Height" cannot be assigned to parameter "shape" of type "tuple[*Shape@Array]" in function "__init__"   "Height" is not assignable to "tuple[*Shape@Array]" (reportArgumentType) -generics_typevartuple_basic.py:43:35 - error: Type "Array[Batch, Width]" is not assignable to declared type "Array[Batch, Height, Width]" +generics_typevartuple_basic.py:44:35 - error: Type "Array[Batch, Width]" is not assignable to declared type "Array[Batch, Height, Width]"   "Array[Batch, Width]" is not assignable to "Array[Batch, Height, Width]"     Type parameter "Shape@Array" is invariant, but "*tuple[Batch, Width]" is not the same as "*tuple[Batch, Height, Width]" (reportAssignmentType) -generics_typevartuple_basic.py:44:41 - error: Type "Array[Time, Batch, Width, Height]" is not assignable to declared type "Array[Time, Batch, Height, Width]" +generics_typevartuple_basic.py:45:41 - error: Type "Array[Time, Batch, Width, Height]" is not assignable to declared type "Array[Time, Batch, Height, Width]"   "Array[Time, Batch, Width, Height]" is not assignable to "Array[Time, Batch, Height, Width]"     Type parameter "Shape@Array" is invariant, but "*tuple[Time, Batch, Width, Height]" is not the same as "*tuple[Time, Batch, Height, Width]" (reportAssignmentType) -generics_typevartuple_basic.py:52:22 - error: Expected unpacked TypeVarTuple; use Unpack[Shape] or *Shape (reportInvalidTypeForm) -generics_typevartuple_basic.py:53:37 - error: Expected unpacked TypeVarTuple; use Unpack[Shape] or *Shape (reportInvalidTypeForm) -generics_typevartuple_basic.py:56:34 - error: Expected unpacked TypeVarTuple; use Unpack[Shape] or *Shape (reportInvalidTypeForm) -generics_typevartuple_basic.py:59:24 - error: Expected unpacked TypeVarTuple; use Unpack[Shape] or *Shape (reportInvalidTypeForm) -generics_typevartuple_basic.py:65:27 - error: "covariant" is unknown parameter to TypeVarTuple (reportGeneralTypeIssues) +generics_typevartuple_basic.py:53:22 - error: Expected unpacked TypeVarTuple; use Unpack[Shape] or *Shape (reportInvalidTypeForm) +generics_typevartuple_basic.py:54:37 - error: Expected unpacked TypeVarTuple; use Unpack[Shape] or *Shape (reportInvalidTypeForm) +generics_typevartuple_basic.py:57:34 - error: Expected unpacked TypeVarTuple; use Unpack[Shape] or *Shape (reportInvalidTypeForm) +generics_typevartuple_basic.py:60:24 - error: Expected unpacked TypeVarTuple; use Unpack[Shape] or *Shape (reportInvalidTypeForm) generics_typevartuple_basic.py:66:27 - error: TypeVarTuple cannot have value constraints (reportGeneralTypeIssues) generics_typevartuple_basic.py:66:32 - error: TypeVarTuple cannot have value constraints (reportGeneralTypeIssues) generics_typevartuple_basic.py:67:27 - error: "bound" is unknown parameter to TypeVarTuple (reportGeneralTypeIssues) @@ -34,6 +33,7 @@ generics_typevartuple_basic.py:100:17 - error: Argument of type "Array[Width]" c generics_typevartuple_basic.py:101:17 - error: Argument of type "Array[Height, Width]" cannot be assigned to parameter "y" of type "Array[*Shape@multiply]" in function "multiply"   "Array[Height, Width]" is not assignable to "Array[Height]"     Type parameter "Shape@Array" is invariant, but "*tuple[Height, Width]" is not the same as "*tuple[Height]" (reportArgumentType) -generics_typevartuple_basic.py:107:14 - error: Generic class can have at most one TypeVarTuple type parameter but received multiple ("Ts1", "Ts2") (reportGeneralTypeIssues) -generics_typevartuple_basic.py:107:29 - error: Type argument list can have at most one unpacked TypeVarTuple or tuple (reportInvalidTypeForm) +generics_typevartuple_basic.py:107:14 - error: Generic class can have at most one TypeVarTuple type parameter but received multiple ("Ts", "Ts1") (reportGeneralTypeIssues) +generics_typevartuple_basic.py:107:28 - error: Type argument list can have at most one unpacked TypeVarTuple or tuple (reportInvalidTypeForm) +generics_typevartuple_basic.py:111:7 - error: Generic class can have at most one TypeVarTuple type parameter but received multiple ("Ts1", "Ts2") (reportGeneralTypeIssues) """ diff --git a/conformance/results/pyright/generics_typevartuple_variance.toml b/conformance/results/pyright/generics_typevartuple_variance.toml new file mode 100644 index 000000000..3bfb0f7c7 --- /dev/null +++ b/conformance/results/pyright/generics_typevartuple_variance.toml @@ -0,0 +1,119 @@ +conformant = "Unsupported" +conformance_automated = "Fail" +errors_diff = """ +Line 21: Expected 1 errors +Line 34: Expected 1 errors +Line 79: Expected 1 errors +Line 90: Expected 1 errors +Line 29: Unexpected errors ['generics_typevartuple_variance.py:29:42 - error: Type "ContravariantTypeVarTuple[object]" is not assignable to declared type "ContravariantTypeVarTuple[int]"'] +Line 30: Unexpected errors ['generics_typevartuple_variance.py:30:64 - error: Type "ContravariantTypeVarTuple[*tuple[object, ...]]" is not assignable to declared type "ContravariantTypeVarTuple[*tuple[int, ...]]"'] +Line 33: Unexpected errors ['generics_typevartuple_variance.py:33:58 - error: Type "ContravariantTypeVarTuple[*tuple[int, ...]]" is not assignable to declared type "ContravariantTypeVarTuple[int]"'] +Line 43: Unexpected errors ['generics_typevartuple_variance.py:43:42 - error: Type "CovariantTypeVarTuple[int]" is not assignable to declared type "CovariantTypeVarTuple[object]"'] +Line 44: Unexpected errors ['generics_typevartuple_variance.py:44:50 - error: Type "CovariantTypeVarTuple[bool, bool]" is not assignable to declared type "CovariantTypeVarTuple[int, int]"'] +Line 49: Unexpected errors ['generics_typevartuple_variance.py:49:67 - error: Type "CovariantTypeVarTuple[*tuple[int, ...]]" is not assignable to declared type "CovariantTypeVarTuple[*tuple[object, ...]]"'] +Line 55: Unexpected errors ['generics_typevartuple_variance.py:55:35 - error: "infer_variance" is unknown parameter to TypeVarTuple (reportGeneralTypeIssues)'] +Line 73: Unexpected errors ['generics_typevartuple_variance.py:73:29 - error: "contravariant" is unknown parameter to TypeVarTuple (reportGeneralTypeIssues)'] +Line 84: Unexpected errors ['generics_typevartuple_variance.py:84:49 - error: Type "ContravariantTypeVarTupleOld[object]" is not assignable to declared type "ContravariantTypeVarTupleOld[int]"'] +Line 87: Unexpected errors ['generics_typevartuple_variance.py:87:31 - error: "covariant" is unknown parameter to TypeVarTuple (reportGeneralTypeIssues)'] +Line 98: Unexpected errors ['generics_typevartuple_variance.py:98:49 - error: Type "CovariantTypeVarTupleOld[int]" is not assignable to declared type "CovariantTypeVarTupleOld[object]"'] +Line 108: Unexpected errors ['generics_typevartuple_variance.py:108:63 - error: Type "InferredContravariantTypeVarTupleOld[object]" is not assignable to declared type "InferredContravariantTypeVarTupleOld[int]"'] +Line 117: Unexpected errors ['generics_typevartuple_variance.py:117:63 - error: Type "InferredCovariantTypeVarTupleOld[int]" is not assignable to declared type "InferredCovariantTypeVarTupleOld[object]"'] +""" +output = """ +generics_typevartuple_variance.py:14:45 - error: Type "InvariantTypeVarTuple[int]" is not assignable to declared type "InvariantTypeVarTuple[object]" +  "InvariantTypeVarTuple[int]" is not assignable to "InvariantTypeVarTuple[object]" +    Type parameter "InOutTs@InvariantTypeVarTuple" is invariant, but "*tuple[int]" is not the same as "*tuple[object]" (reportAssignmentType) +generics_typevartuple_variance.py:15:42 - error: Type "InvariantTypeVarTuple[object]" is not assignable to declared type "InvariantTypeVarTuple[int]" +  "InvariantTypeVarTuple[object]" is not assignable to "InvariantTypeVarTuple[int]" +    Type parameter "InOutTs@InvariantTypeVarTuple" is invariant, but "*tuple[object]" is not the same as "*tuple[int]" (reportAssignmentType) +generics_typevartuple_variance.py:17:64 - error: Type "InvariantTypeVarTuple[*tuple[object, ...]]" is not assignable to declared type "InvariantTypeVarTuple[*tuple[int, ...]]" +  "InvariantTypeVarTuple[*tuple[object, ...]]" is not assignable to "InvariantTypeVarTuple[*tuple[int, ...]]" +    Type parameter "InOutTs@InvariantTypeVarTuple" is invariant, but "*tuple[object, ...]" is not the same as "*tuple[int, ...]" (reportAssignmentType) +generics_typevartuple_variance.py:18:70 - error: Type "InvariantTypeVarTuple[*tuple[int, ...]]" is not assignable to declared type "InvariantTypeVarTuple[*tuple[object, ...]]" +  "InvariantTypeVarTuple[*tuple[int, ...]]" is not assignable to "InvariantTypeVarTuple[*tuple[object, ...]]" +    Type parameter "InOutTs@InvariantTypeVarTuple" is invariant, but "*tuple[int, ...]" is not the same as "*tuple[object, ...]" (reportAssignmentType) +generics_typevartuple_variance.py:20:58 - error: Type "InvariantTypeVarTuple[*tuple[int, ...]]" is not assignable to declared type "InvariantTypeVarTuple[int]" +  "InvariantTypeVarTuple[*tuple[int, ...]]" is not assignable to "InvariantTypeVarTuple[int]" +    Type parameter "InOutTs@InvariantTypeVarTuple" is invariant, but "*tuple[int, ...]" is not the same as "*tuple[int]" (reportAssignmentType) +generics_typevartuple_variance.py:28:53 - error: Type "ContravariantTypeVarTuple[object, int]" is not assignable to declared type "ContravariantTypeVarTuple[object, object]" +  "ContravariantTypeVarTuple[object, int]" is not assignable to "ContravariantTypeVarTuple[object, object]" +    Type parameter "InTs@ContravariantTypeVarTuple" is invariant, but "*tuple[object, int]" is not the same as "*tuple[object, object]" (reportAssignmentType) +generics_typevartuple_variance.py:29:42 - error: Type "ContravariantTypeVarTuple[object]" is not assignable to declared type "ContravariantTypeVarTuple[int]" +  "ContravariantTypeVarTuple[object]" is not assignable to "ContravariantTypeVarTuple[int]" +    Type parameter "InTs@ContravariantTypeVarTuple" is invariant, but "*tuple[object]" is not the same as "*tuple[int]" (reportAssignmentType) +generics_typevartuple_variance.py:30:64 - error: Type "ContravariantTypeVarTuple[*tuple[object, ...]]" is not assignable to declared type "ContravariantTypeVarTuple[*tuple[int, ...]]" +  "ContravariantTypeVarTuple[*tuple[object, ...]]" is not assignable to "ContravariantTypeVarTuple[*tuple[int, ...]]" +    Type parameter "InTs@ContravariantTypeVarTuple" is invariant, but "*tuple[object, ...]" is not the same as "*tuple[int, ...]" (reportAssignmentType) +generics_typevartuple_variance.py:31:70 - error: Type "ContravariantTypeVarTuple[*tuple[int, ...]]" is not assignable to declared type "ContravariantTypeVarTuple[*tuple[object, ...]]" +  "ContravariantTypeVarTuple[*tuple[int, ...]]" is not assignable to "ContravariantTypeVarTuple[*tuple[object, ...]]" +    Type parameter "InTs@ContravariantTypeVarTuple" is invariant, but "*tuple[int, ...]" is not the same as "*tuple[object, ...]" (reportAssignmentType) +generics_typevartuple_variance.py:33:58 - error: Type "ContravariantTypeVarTuple[*tuple[int, ...]]" is not assignable to declared type "ContravariantTypeVarTuple[int]" +  "ContravariantTypeVarTuple[*tuple[int, ...]]" is not assignable to "ContravariantTypeVarTuple[int]" +    Type parameter "InTs@ContravariantTypeVarTuple" is invariant, but "*tuple[int, ...]" is not the same as "*tuple[int]" (reportAssignmentType) +generics_typevartuple_variance.py:42:39 - error: Type "CovariantTypeVarTuple[object]" is not assignable to declared type "CovariantTypeVarTuple[int]" +  "CovariantTypeVarTuple[object]" is not assignable to "CovariantTypeVarTuple[int]" +    Type parameter "OutTs@CovariantTypeVarTuple" is invariant, but "*tuple[object]" is not the same as "*tuple[int]" (reportAssignmentType) +generics_typevartuple_variance.py:43:42 - error: Type "CovariantTypeVarTuple[int]" is not assignable to declared type "CovariantTypeVarTuple[object]" +  "CovariantTypeVarTuple[int]" is not assignable to "CovariantTypeVarTuple[object]" +    Type parameter "OutTs@CovariantTypeVarTuple" is invariant, but "*tuple[int]" is not the same as "*tuple[object]" (reportAssignmentType) +generics_typevartuple_variance.py:44:50 - error: Type "CovariantTypeVarTuple[bool, bool]" is not assignable to declared type "CovariantTypeVarTuple[int, int]" +  "CovariantTypeVarTuple[bool, bool]" is not assignable to "CovariantTypeVarTuple[int, int]" +    Type parameter "OutTs@CovariantTypeVarTuple" is invariant, but "*tuple[bool, bool]" is not the same as "*tuple[int, int]" (reportAssignmentType) +generics_typevartuple_variance.py:45:50 - error: Type "CovariantTypeVarTuple[bool, object]" is not assignable to declared type "CovariantTypeVarTuple[int, int]" +  "CovariantTypeVarTuple[bool, object]" is not assignable to "CovariantTypeVarTuple[int, int]" +    Type parameter "OutTs@CovariantTypeVarTuple" is invariant, but "*tuple[bool, object]" is not the same as "*tuple[int, int]" (reportAssignmentType) +generics_typevartuple_variance.py:46:50 - error: Type "CovariantTypeVarTuple[object, bool]" is not assignable to declared type "CovariantTypeVarTuple[int, int]" +  "CovariantTypeVarTuple[object, bool]" is not assignable to "CovariantTypeVarTuple[int, int]" +    Type parameter "OutTs@CovariantTypeVarTuple" is invariant, but "*tuple[object, bool]" is not the same as "*tuple[int, int]" (reportAssignmentType) +generics_typevartuple_variance.py:47:50 - error: Type "CovariantTypeVarTuple[object, object]" is not assignable to declared type "CovariantTypeVarTuple[int, int]" +  "CovariantTypeVarTuple[object, object]" is not assignable to "CovariantTypeVarTuple[int, int]" +    Type parameter "OutTs@CovariantTypeVarTuple" is invariant, but "*tuple[object, object]" is not the same as "*tuple[int, int]" (reportAssignmentType) +generics_typevartuple_variance.py:48:61 - error: Type "CovariantTypeVarTuple[*tuple[object, ...]]" is not assignable to declared type "CovariantTypeVarTuple[*tuple[int, ...]]" +  "CovariantTypeVarTuple[*tuple[object, ...]]" is not assignable to "CovariantTypeVarTuple[*tuple[int, ...]]" +    Type parameter "OutTs@CovariantTypeVarTuple" is invariant, but "*tuple[object, ...]" is not the same as "*tuple[int, ...]" (reportAssignmentType) +generics_typevartuple_variance.py:49:67 - error: Type "CovariantTypeVarTuple[*tuple[int, ...]]" is not assignable to declared type "CovariantTypeVarTuple[*tuple[object, ...]]" +  "CovariantTypeVarTuple[*tuple[int, ...]]" is not assignable to "CovariantTypeVarTuple[*tuple[object, ...]]" +    Type parameter "OutTs@CovariantTypeVarTuple" is invariant, but "*tuple[int, ...]" is not the same as "*tuple[object, ...]" (reportAssignmentType) +generics_typevartuple_variance.py:51:55 - error: Type "CovariantTypeVarTuple[*tuple[int, ...]]" is not assignable to declared type "CovariantTypeVarTuple[int]" +  "CovariantTypeVarTuple[*tuple[int, ...]]" is not assignable to "CovariantTypeVarTuple[int]" +    Type parameter "OutTs@CovariantTypeVarTuple" is invariant, but "*tuple[int, ...]" is not the same as "*tuple[int]" (reportAssignmentType) +generics_typevartuple_variance.py:55:35 - error: "infer_variance" is unknown parameter to TypeVarTuple (reportGeneralTypeIssues) +generics_typevartuple_variance.py:56:33 - error: "covariant" is unknown parameter to TypeVarTuple (reportGeneralTypeIssues) +generics_typevartuple_variance.py:56:49 - error: "contravariant" is unknown parameter to TypeVarTuple (reportGeneralTypeIssues) +generics_typevartuple_variance.py:57:33 - error: "covariant" is unknown parameter to TypeVarTuple (reportGeneralTypeIssues) +generics_typevartuple_variance.py:57:49 - error: "infer_variance" is unknown parameter to TypeVarTuple (reportGeneralTypeIssues) +generics_typevartuple_variance.py:58:33 - error: "contravariant" is unknown parameter to TypeVarTuple (reportGeneralTypeIssues) +generics_typevartuple_variance.py:58:53 - error: "infer_variance" is unknown parameter to TypeVarTuple (reportGeneralTypeIssues) +generics_typevartuple_variance.py:68:45 - error: Type "InvariantTypeVarTupleOld[int]" is not assignable to declared type "InvariantTypeVarTupleOld[object]" +  "InvariantTypeVarTupleOld[int]" is not assignable to "InvariantTypeVarTupleOld[object]" +    Type parameter "Ts@InvariantTypeVarTupleOld" is invariant, but "*tuple[int]" is not the same as "*tuple[object]" (reportAssignmentType) +generics_typevartuple_variance.py:69:42 - error: Type "InvariantTypeVarTupleOld[object]" is not assignable to declared type "InvariantTypeVarTupleOld[int]" +  "InvariantTypeVarTupleOld[object]" is not assignable to "InvariantTypeVarTupleOld[int]" +    Type parameter "Ts@InvariantTypeVarTupleOld" is invariant, but "*tuple[object]" is not the same as "*tuple[int]" (reportAssignmentType) +generics_typevartuple_variance.py:73:29 - error: "contravariant" is unknown parameter to TypeVarTuple (reportGeneralTypeIssues) +generics_typevartuple_variance.py:83:52 - error: Type "ContravariantTypeVarTupleOld[int]" is not assignable to declared type "ContravariantTypeVarTupleOld[object]" +  "ContravariantTypeVarTupleOld[int]" is not assignable to "ContravariantTypeVarTupleOld[object]" +    Type parameter "InTs@ContravariantTypeVarTupleOld" is invariant, but "*tuple[int]" is not the same as "*tuple[object]" (reportAssignmentType) +generics_typevartuple_variance.py:84:49 - error: Type "ContravariantTypeVarTupleOld[object]" is not assignable to declared type "ContravariantTypeVarTupleOld[int]" +  "ContravariantTypeVarTupleOld[object]" is not assignable to "ContravariantTypeVarTupleOld[int]" +    Type parameter "InTs@ContravariantTypeVarTupleOld" is invariant, but "*tuple[object]" is not the same as "*tuple[int]" (reportAssignmentType) +generics_typevartuple_variance.py:87:31 - error: "covariant" is unknown parameter to TypeVarTuple (reportGeneralTypeIssues) +generics_typevartuple_variance.py:97:46 - error: Type "CovariantTypeVarTupleOld[object]" is not assignable to declared type "CovariantTypeVarTupleOld[int]" +  "CovariantTypeVarTupleOld[object]" is not assignable to "CovariantTypeVarTupleOld[int]" +    Type parameter "OutTs@CovariantTypeVarTupleOld" is invariant, but "*tuple[object]" is not the same as "*tuple[int]" (reportAssignmentType) +generics_typevartuple_variance.py:98:49 - error: Type "CovariantTypeVarTupleOld[int]" is not assignable to declared type "CovariantTypeVarTupleOld[object]" +  "CovariantTypeVarTupleOld[int]" is not assignable to "CovariantTypeVarTupleOld[object]" +    Type parameter "OutTs@CovariantTypeVarTupleOld" is invariant, but "*tuple[int]" is not the same as "*tuple[object]" (reportAssignmentType) +generics_typevartuple_variance.py:107:66 - error: Type "InferredContravariantTypeVarTupleOld[int]" is not assignable to declared type "InferredContravariantTypeVarTupleOld[object]" +  "InferredContravariantTypeVarTupleOld[int]" is not assignable to "InferredContravariantTypeVarTupleOld[object]" +    Type parameter "InferTs@InferredContravariantTypeVarTupleOld" is invariant, but "*tuple[int]" is not the same as "*tuple[object]" (reportAssignmentType) +generics_typevartuple_variance.py:108:63 - error: Type "InferredContravariantTypeVarTupleOld[object]" is not assignable to declared type "InferredContravariantTypeVarTupleOld[int]" +  "InferredContravariantTypeVarTupleOld[object]" is not assignable to "InferredContravariantTypeVarTupleOld[int]" +    Type parameter "InferTs@InferredContravariantTypeVarTupleOld" is invariant, but "*tuple[object]" is not the same as "*tuple[int]" (reportAssignmentType) +generics_typevartuple_variance.py:116:60 - error: Type "InferredCovariantTypeVarTupleOld[object]" is not assignable to declared type "InferredCovariantTypeVarTupleOld[int]" +  "InferredCovariantTypeVarTupleOld[object]" is not assignable to "InferredCovariantTypeVarTupleOld[int]" +    Type parameter "InferTs@InferredCovariantTypeVarTupleOld" is invariant, but "*tuple[object]" is not the same as "*tuple[int]" (reportAssignmentType) +generics_typevartuple_variance.py:117:63 - error: Type "InferredCovariantTypeVarTupleOld[int]" is not assignable to declared type "InferredCovariantTypeVarTupleOld[object]" +  "InferredCovariantTypeVarTupleOld[int]" is not assignable to "InferredCovariantTypeVarTupleOld[object]" +    Type parameter "InferTs@InferredCovariantTypeVarTupleOld" is invariant, but "*tuple[int]" is not the same as "*tuple[object]" (reportAssignmentType) +""" diff --git a/conformance/results/pyright/protocols_variance.toml b/conformance/results/pyright/protocols_variance.toml index 108fd9d99..761d7d473 100644 --- a/conformance/results/pyright/protocols_variance.toml +++ b/conformance/results/pyright/protocols_variance.toml @@ -1,15 +1,20 @@ -conformant = "Pass" +conformant = "Partial" +notes = """ +Doesn't support variance keyword arguments to ParamSpec. +""" output = """ -protocols_variance.py:21:7 - warning: Type variable "T1" used in generic Protocol "AnotherBox" should be covariant (reportInvalidTypeVarUse) -protocols_variance.py:40:7 - warning: Type variable "T3" used in generic Protocol "Protocol2" should be contravariant (reportInvalidTypeVarUse) -protocols_variance.py:56:7 - warning: Type variable "T1" used in generic Protocol "Protocol4" should be contravariant (reportInvalidTypeVarUse) -protocols_variance.py:61:7 - warning: Type variable "T1_co" used in generic Protocol "Protocol5" should be contravariant (reportInvalidTypeVarUse) -protocols_variance.py:62:22 - error: Covariant type variable cannot be used in parameter type (reportGeneralTypeIssues) -protocols_variance.py:66:7 - warning: Type variable "T1" used in generic Protocol "Protocol6" should be covariant (reportInvalidTypeVarUse) -protocols_variance.py:71:7 - warning: Type variable "T1_contra" used in generic Protocol "Protocol7" should be covariant (reportInvalidTypeVarUse) -protocols_variance.py:72:21 - error: Contravariant type variable cannot be used in return type (reportGeneralTypeIssues) -protocols_variance.py:104:7 - warning: Type variable "T1" used in generic Protocol "Protocol12" should be covariant (reportInvalidTypeVarUse) +protocols_variance.py:15:20 - error: "contravariant" is unknown parameter to ParamSpec (reportGeneralTypeIssues) +protocols_variance.py:22:7 - warning: Type variable "T1" used in generic Protocol "AnotherBox" should be covariant (reportInvalidTypeVarUse) +protocols_variance.py:41:7 - warning: Type variable "T3" used in generic Protocol "Protocol2" should be contravariant (reportInvalidTypeVarUse) +protocols_variance.py:57:7 - warning: Type variable "T1" used in generic Protocol "Protocol4" should be contravariant (reportInvalidTypeVarUse) +protocols_variance.py:62:7 - warning: Type variable "T1_co" used in generic Protocol "Protocol5" should be contravariant (reportInvalidTypeVarUse) +protocols_variance.py:63:22 - error: Covariant type variable cannot be used in parameter type (reportGeneralTypeIssues) +protocols_variance.py:67:7 - warning: Type variable "T1" used in generic Protocol "Protocol6" should be covariant (reportInvalidTypeVarUse) +protocols_variance.py:72:7 - warning: Type variable "T1_contra" used in generic Protocol "Protocol7" should be covariant (reportInvalidTypeVarUse) +protocols_variance.py:73:21 - error: Contravariant type variable cannot be used in return type (reportGeneralTypeIssues) +protocols_variance.py:105:7 - warning: Type variable "T1" used in generic Protocol "Protocol12" should be covariant (reportInvalidTypeVarUse) """ -conformance_automated = "Pass" +conformance_automated = "Fail" errors_diff = """ +Line 15: Unexpected errors ['protocols_variance.py:15:20 - error: "contravariant" is unknown parameter to ParamSpec (reportGeneralTypeIssues)'] """ diff --git a/conformance/results/results.html b/conformance/results/results.html index 6f89d20e3..2a8c27f44 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -610,6 +610,20 @@

    Python Type System Conformance Test Results

    + + + + + + + + + @@ -651,6 +665,20 @@

    Python Type System Conformance Test Results

    + + + + + + + + + @@ -827,7 +855,12 @@

    Python Type System Conformance Test Results

  • Does not enforce that tuples captured by TypeVarTuple are same length.
  • - + + + + + + + + + + - - - - - - + + + + + + @@ -1459,21 +1506,41 @@

    Python Type System Conformance Test Results

    + - - - + + - + + - - - + + - + @@ -1491,7 +1558,12 @@

    Python Type System Conformance Test Results

  • Does not treat *args: Any, **kargs: Any as ... when separated by keyword parameter.
  • - + @@ -1514,7 +1586,12 @@

    Python Type System Conformance Test Results

    - + @@ -1523,7 +1600,12 @@

    Python Type System Conformance Test Results

    - + @@ -1532,7 +1614,7 @@

    Python Type System Conformance Test Results

    - + @@ -2645,12 +2727,12 @@

    Python Type System Conformance Test Results

    - - - - - - + + + + + +
     
    mypy 1.15.0
    -
    1.2sec
    +
    2.1sec
    pyright 1.1.398
    -
    1.5sec
    +
    2.3sec
    pyre 0.9.23
    -
    6.9sec
    +
    3.9sec
    pytype 2024.10.11
    -
    35.9sec
    +
    43.3sec
    diff --git a/conformance/tests/classes_classvar.py b/conformance/tests/classes_classvar.py index 5e0c963b3..2f6ed04fb 100644 --- a/conformance/tests/classes_classvar.py +++ b/conformance/tests/classes_classvar.py @@ -57,8 +57,14 @@ class ClassA(Generic[T, P]): good1: CV[int] = 1 good2: ClassVar[list[str]] = [] good3: ClassVar[Any] = 1 + # > If an assigned value is available, the type should be inferred as some type + # > to which this value is assignable. + # Here, type checkers could infer good4 as `float` or `Any`, for example. good4: ClassVar = 3.1 - good5: Annotated[ClassVar[list[int]], ""] = [] + # > If the `ClassVar` qualifier is used without any assigned value, the type + # > should be inferred as `Any`: + good5: ClassVar #E? Type checkers may error on uninitialized ClassVar + good6: Annotated[ClassVar[list[int]], ""] = [] def method1(self, a: ClassVar[int]): # E: ClassVar not allowed here x: ClassVar[str] = "" # E: ClassVar not allowed here @@ -75,7 +81,7 @@ def method2(self) -> ClassVar[int]: # E: ClassVar not allowed here assert_type(ClassA.good1, int) assert_type(ClassA.good2, list[str]) assert_type(ClassA.good3, Any) -assert_type(ClassA.good4, float) +assert_type(ClassA.good5, Any) class BasicStarship: diff --git a/docs/spec/annotations.rst b/docs/spec/annotations.rst index 18f9f6a6b..e4bea9116 100644 --- a/docs/spec/annotations.rst +++ b/docs/spec/annotations.rst @@ -109,7 +109,7 @@ The following grammar describes the allowed elements of type and annotation expr annotation_expression: '[' `annotation_expression` ']' : | '[' `annotation_expression` ']' : | '[' `annotation_expression`']' - : | '[' `annotation_expression`']' + : | ('[' `annotation_expression`']')? : | ('[' `annotation_expression`']')? : | '[' `annotation_expression` ']' : | '[' `annotation_expression` ',' diff --git a/docs/spec/class-compat.rst b/docs/spec/class-compat.rst index f3086e75c..2984c5a3c 100644 --- a/docs/spec/class-compat.rst +++ b/docs/spec/class-compat.rst @@ -10,11 +10,30 @@ Class type assignability (Originally specified in :pep:`526`.) -A :term:`type qualifier` ``ClassVar[T]`` exists in the :py:mod:`typing` -module. It accepts only a single argument that should be a valid type, -and is used to annotate class variables that should not be set on class -instances. This restriction is enforced by static checkers, -but not at runtime. +The :py:data:`typing.ClassVar` :term:`type qualifier` is used to annotate +class variables that should not be set on class instances. This restriction +is enforced by static checkers, but not at runtime. + +:py:data:`~typing.ClassVar` may be used in one of several forms: + +* With an explicit type, using the syntax ``ClassVar[]``. Example:: + + class C: + x: ClassVar[float] = 1 + +* With no type annotation. Example:: + + class C: + y: ClassVar = 2 + z: ClassVar + + If an assigned value is available (e.g. with ``y``), the type should be + inferred as some type to which this value is :term:`assignable` (for example, + ``int``, ``Literal[2]``, or ``Any``). + + If the bare ``ClassVar`` qualifier is used without any assigned value, the type + should be inferred as :ref:`Any `. Type checkers may error if no assigned + value is present. Type annotations can be used to annotate class and instance variables in class bodies and methods. In particular, the value-less notation ``a: int`` From 525da68e7dad714c82df8fe9be65e66132ab5f58 Mon Sep 17 00:00:00 2001 From: Andrej Date: Thu, 10 Apr 2025 08:33:57 +0500 Subject: [PATCH 092/308] Fix indentation issue in TypedDict docs (#1963) --- docs/spec/typeddict.rst | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/spec/typeddict.rst b/docs/spec/typeddict.rst index 15d9aeaad..559771f77 100644 --- a/docs/spec/typeddict.rst +++ b/docs/spec/typeddict.rst @@ -353,15 +353,15 @@ Discussion: x: int y: str - def f(a: A) -> None: - a['y'] = 1 + def f(a: A) -> None: + a['y'] = 1 - def g(b: B) -> None: - f(b) # Type check error: 'B' not assignable to 'A' + def g(b: B) -> None: + f(b) # Type check error: 'B' not assignable to 'A' - c: C = {'x': 0, 'y': 'foo'} - g(c) - c['y'] + 'bar' # Runtime error: int + str + c: C = {'x': 0, 'y': 'foo'} + g(c) + c['y'] + 'bar' # Runtime error: int + str * A TypedDict isn't :term:`assignable` to any ``Dict[...]`` type, since dictionary types allow destructive operations, including ``clear()``. They From 6c3f9904759a312deea43c30b68cdeab6ed490a4 Mon Sep 17 00:00:00 2001 From: Pavel Karateev Date: Fri, 11 Apr 2025 16:53:43 +0200 Subject: [PATCH 093/308] Fix error message - `__len__` implementation is in fact missing (#1967) --- conformance/tests/protocols_merging.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conformance/tests/protocols_merging.py b/conformance/tests/protocols_merging.py index 6540de7ed..e989e4ef8 100644 --- a/conformance/tests/protocols_merging.py +++ b/conformance/tests/protocols_merging.py @@ -49,8 +49,8 @@ def close(self) -> None: s4: SizedAndClosable2 = SizedAndClosable3() # OK s5: Sized = SCConcrete1() # OK -s6: SizedAndClosable1 = SCConcrete2() # E: doesn't implement close -s7: SizedAndClosable2 = SCConcrete2() # E: doesn't implement close +s6: SizedAndClosable1 = SCConcrete2() # E: doesn't implement `__len__` +s7: SizedAndClosable2 = SCConcrete2() # E: doesn't implement `__len__` s8: SizedAndClosable3 = SCConcrete2() # E: SizedAndClosable3 is not a protocol From dde9ec41d8ef032fce3927bb514a29b02c5ad38c Mon Sep 17 00:00:00 2001 From: Matthew Mckee Date: Fri, 11 Apr 2025 16:22:57 +0100 Subject: [PATCH 094/308] Update docs on equivalence between gradual types (#1965) Update docs about equivalence between gradual types to include that it is an equivalence relation --- docs/spec/concepts.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/spec/concepts.rst b/docs/spec/concepts.rst index 058a5794f..ee230f231 100644 --- a/docs/spec/concepts.rst +++ b/docs/spec/concepts.rst @@ -298,11 +298,11 @@ visualize this analogy in the following table: * - ``B`` is :term:`equivalent` to ``A`` - ``B`` is :term:`consistent` with ``A`` -We can also define equivalence on gradual types. Two gradual types ``A`` and -``B`` are equivalent (that is, the same gradual type, not merely consistent -with one another) if and only if all materializations of ``A`` are also -materializations of ``B``, and all materializations of ``B`` are also -materializations of ``A``. +We can also define an **equivalence** relation on gradual types: the gradual +types ``A`` and ``B`` are equivalent (that is, the same gradual type, not +merely consistent with one another) if and only if all materializations of +``A`` are also materializations of ``B``, and all materializations of ``B`` +are also materializations of ``A``. Attributes and methods ---------------------- From 54b6ce2821d19f6d9bc91ec1ea92f58d5eaaf33a Mon Sep 17 00:00:00 2001 From: Andrej Date: Sun, 13 Apr 2025 07:16:57 +0500 Subject: [PATCH 095/308] Conformance: fix issues running on Windows (#1969) --- conformance/README.md | 2 +- conformance/requirements.txt | 2 +- conformance/src/main.py | 2 +- conformance/src/type_checker.py | 9 ++++----- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/conformance/README.md b/conformance/README.md index c5f04b0d1..a0a821359 100644 --- a/conformance/README.md +++ b/conformance/README.md @@ -60,7 +60,7 @@ To run the conformance test suite: * Switch to the `conformance` subdirectory and install all dependencies (`pip install -r requirements.txt`). * Switch to the `src` subdirectory and run `python main.py`. -Note that some type checkers may not run on some platforms. For example, pytype cannot be installed on Windows. If a type checker fails to install, tests will be skipped for that type checker. +Note that some type checkers may not run on some platforms. If a type checker fails to install, tests will be skipped for that type checker. ## Reporting Conformance Results diff --git a/conformance/requirements.txt b/conformance/requirements.txt index 396b5100d..d4c4d5a86 100644 --- a/conformance/requirements.txt +++ b/conformance/requirements.txt @@ -5,4 +5,4 @@ pyright mypy pip pyre-check -pytype; platform_system != "Windows" +pytype diff --git a/conformance/src/main.py b/conformance/src/main.py index 02453f9f8..3f4b12973 100644 --- a/conformance/src/main.py +++ b/conformance/src/main.py @@ -67,7 +67,7 @@ def f(): pass # E[final] {"final": [3, 4]} ) """ - with open(test_case, "r") as f: + with open(test_case, "r", encoding="utf-8") as f: lines = f.readlines() output: dict[int, tuple[int, int]] = {} groups: dict[str, list[int]] = {} diff --git a/conformance/src/type_checker.py b/conformance/src/type_checker.py index 21bec0d8f..d5ee0dfa7 100644 --- a/conformance/src/type_checker.py +++ b/conformance/src/type_checker.py @@ -3,7 +3,6 @@ """ from abc import ABC, abstractmethod -from curses.ascii import isspace import json from pathlib import Path import os @@ -114,7 +113,7 @@ def run_tests(self, test_files: Sequence[str]) -> dict[str, str]: "--enable-error-code", "deprecated", ] - proc = run(command, stdout=PIPE, text=True) + proc = run(command, stdout=PIPE, text=True, encoding="utf-8") lines = proc.stdout.split("\n") # Add results to a dictionary keyed by the file name. @@ -174,7 +173,7 @@ def get_version(self) -> str: def run_tests(self, test_files: Sequence[str]) -> dict[str, str]: command = [sys.executable, "-m", "pyright", ".", "--outputjson"] - proc = run(command, stdout=PIPE, text=True) + proc = run(command, stdout=PIPE, text=True, encoding="utf-8") output_json = json.loads(proc.stdout) diagnostics = output_json["generalDiagnostics"] @@ -253,7 +252,7 @@ def get_version(self) -> str: return version def run_tests(self, test_files: Sequence[str]) -> dict[str, str]: - proc = run(["pyre", "check"], stdout=PIPE, text=True) + proc = run(["pyre", "check"], stdout=PIPE, text=True, encoding="utf-8") lines = proc.stdout.split("\n") # Add results to a dictionary keyed by the file name. @@ -325,7 +324,7 @@ def run_tests(self, test_files: Sequence[str]) -> dict[str, str]: if not fi.endswith(".py"): continue options.tweak(input=fi) - with open(fi, "r") as test_file: + with open(fi, "r", encoding="utf-8") as test_file: src = test_file.read() try: analysis: pytype_analyze.Analysis = pytype_io.check_py( From 0b9fed83ee2ac10aeac187d4182ae949f9fc25f0 Mon Sep 17 00:00:00 2001 From: Victorien <65306057+Viicos@users.noreply.github.com> Date: Thu, 17 Apr 2025 19:35:19 +0200 Subject: [PATCH 096/308] Fix assignability rule for typed dictionaries (#1974) --- docs/spec/typeddict.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/spec/typeddict.rst b/docs/spec/typeddict.rst index 559771f77..4cbeedba3 100644 --- a/docs/spec/typeddict.rst +++ b/docs/spec/typeddict.rst @@ -296,9 +296,9 @@ and only if both of these conditions are satisfied: * For each key in ``A``, ``B`` has the corresponding key and the corresponding value type in ``B`` is :term:`consistent` with the value type in ``A``. -* For each required key in ``B``, the corresponding key is required - in ``A``. For each non-required key in ``B``, the corresponding key - is not required in ``A``. +* For each required key in ``A``, the corresponding key is required + in ``B``. For each non-required key in ``A``, the corresponding key + is not required in ``B``. Discussion: From 9df7bdf0c064bc978b13035272bdca34aca7d782 Mon Sep 17 00:00:00 2001 From: Danny Yang Date: Sat, 19 Apr 2025 19:03:17 +0800 Subject: [PATCH 097/308] Adjust error locations for typeddicts_class_syntax conformance test (#1980) * allow alternative locations for some typeddict method errors * update results --- conformance/results/mypy/version.toml | 2 +- .../results/pyre/typeddicts_class_syntax.toml | 4 ++-- conformance/results/pyre/version.toml | 2 +- conformance/results/pyright/version.toml | 4 ++-- conformance/results/pytype/protocols_merging.toml | 4 ++-- .../results/pytype/typeddicts_class_syntax.toml | 4 ++-- conformance/results/pytype/version.toml | 2 +- conformance/results/results.html | 14 +++++++------- conformance/tests/typeddicts_class_syntax.py | 8 ++++---- 9 files changed, 22 insertions(+), 22 deletions(-) diff --git a/conformance/results/mypy/version.toml b/conformance/results/mypy/version.toml index 6bd36c63e..ec26466c2 100644 --- a/conformance/results/mypy/version.toml +++ b/conformance/results/mypy/version.toml @@ -1,2 +1,2 @@ version = "mypy 1.15.0" -test_duration = 2.1 +test_duration = 2.3 diff --git a/conformance/results/pyre/typeddicts_class_syntax.toml b/conformance/results/pyre/typeddicts_class_syntax.toml index ff3c7e5f8..2dc3e9595 100644 --- a/conformance/results/pyre/typeddicts_class_syntax.toml +++ b/conformance/results/pyre/typeddicts_class_syntax.toml @@ -11,7 +11,7 @@ typeddicts_class_syntax.py:49:0 Unexpected keyword [28]: Unexpected keyword argu conformance_automated = "Fail" errors_diff = """ Line 29: Expected 1 errors -Line 33: Expected 1 errors -Line 38: Expected 1 errors Line 44: Expected 1 errors +Lines 33, 34: Expected error (tag 'method2') +Lines 38, 39: Expected error (tag 'method3') """ diff --git a/conformance/results/pyre/version.toml b/conformance/results/pyre/version.toml index c60d20445..1fe379853 100644 --- a/conformance/results/pyre/version.toml +++ b/conformance/results/pyre/version.toml @@ -1,2 +1,2 @@ version = "pyre 0.9.23" -test_duration = 3.9 +test_duration = 8.2 diff --git a/conformance/results/pyright/version.toml b/conformance/results/pyright/version.toml index 8fb908adb..57dacbb67 100644 --- a/conformance/results/pyright/version.toml +++ b/conformance/results/pyright/version.toml @@ -1,2 +1,2 @@ -version = "pyright 1.1.398" -test_duration = 2.3 +version = "pyright 1.1.399" +test_duration = 1.4 diff --git a/conformance/results/pytype/protocols_merging.toml b/conformance/results/pytype/protocols_merging.toml index a3102a965..28275fdd8 100644 --- a/conformance/results/pytype/protocols_merging.toml +++ b/conformance/results/pytype/protocols_merging.toml @@ -6,12 +6,12 @@ Does not report attempt to instantiate abstract class downgraded from protocol c output = """ protocols_merging.py:52:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for s6 does not match type of assignment [annotation-type-mismatch] -s6: SizedAndClosable1 = SCConcrete2() # E: doesn't implement close +s6: SizedAndClosable1 = SCConcrete2() # E: doesn't implement `__len__` \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m protocols_merging.py:53:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for s7 does not match type of assignment [annotation-type-mismatch] -s7: SizedAndClosable2 = SCConcrete2() # E: doesn't implement close +s7: SizedAndClosable2 = SCConcrete2() # E: doesn't implement `__len__` \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m protocols_merging.py:54:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for s8 does not match type of assignment [annotation-type-mismatch] diff --git a/conformance/results/pytype/typeddicts_class_syntax.toml b/conformance/results/pytype/typeddicts_class_syntax.toml index c60ade248..d3a7ae736 100644 --- a/conformance/results/pytype/typeddicts_class_syntax.toml +++ b/conformance/results/pytype/typeddicts_class_syntax.toml @@ -18,9 +18,9 @@ class GenericTypedDict(TypedDict, Generic[T]): conformance_automated = "Fail" errors_diff = """ Line 29: Expected 1 errors -Line 33: Expected 1 errors -Line 38: Expected 1 errors Line 44: Expected 1 errors Line 49: Expected 1 errors +Lines 33, 34: Expected error (tag 'method2') +Lines 38, 39: Expected error (tag 'method3') Line 57: Unexpected errors ['typeddicts_class_syntax.py:57:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid base class: Generic[T] [base-class-error]'] """ diff --git a/conformance/results/pytype/version.toml b/conformance/results/pytype/version.toml index cdc0a953f..57c8a1ffa 100644 --- a/conformance/results/pytype/version.toml +++ b/conformance/results/pytype/version.toml @@ -1,2 +1,2 @@ version = "pytype 2024.10.11" -test_duration = 43.3 +test_duration = 35.2 diff --git a/conformance/results/results.html b/conformance/results/results.html index d78bd9122..855005632 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -159,16 +159,16 @@

    Python Type System Conformance Test Results

    - + - + - + diff --git a/conformance/tests/typeddicts_class_syntax.py b/conformance/tests/typeddicts_class_syntax.py index 6c8409b58..b83f50bf7 100644 --- a/conformance/tests/typeddicts_class_syntax.py +++ b/conformance/tests/typeddicts_class_syntax.py @@ -30,13 +30,13 @@ def method1(self): # E pass # Methods are not allowed, so this should generate an error. - @classmethod # E - def method2(cls): + @classmethod # E[method2] + def method2(cls): # E[method2] pass # Methods are not allowed, so this should generate an error. - @staticmethod # E - def method3(): + @staticmethod # E[method3] + def method3(): # E[method3] pass From 2d9ea90efd18d3eb91a2b9f332a36deba1d78156 Mon Sep 17 00:00:00 2001 From: Andrej Date: Sat, 19 Apr 2025 16:05:05 +0500 Subject: [PATCH 098/308] Conformance - fix issues on Windows (unicode, Pyre) (#1976) * Conformance - fix saving toml results file in non-unicode Noticed that pyright is giving unicode output that on Windows is leading to issues generating reports later. Saving this output explicitly as unicode resolves the issue. ```python Generating summary report Traceback (most recent call last): File "\typing\conformance\src\main.py", line 260, in main() File "\typing\conformance\src\main.py", line 256, in main generate_summary(root_dir) File "\typing\conformance\src\reporting.py", line 19, in generate_summary summary = template.replace("{{summary}}", generate_summary_html(root_dir)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "\typing\conformance\src\reporting.py", line 87, in generate_summary_html results = tomli.load(f) ^^^^^^^^^^^^^ File "src\tomli\_parser.py", line 134, in load UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa0 in position 110: invalid start byte ``` * Conformance - skip Pyre on Windows as it's not supported --- conformance/README.md | 3 ++- conformance/requirements.txt | 2 +- conformance/src/main.py | 2 +- conformance/src/type_checker.py | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/conformance/README.md b/conformance/README.md index a0a821359..7abe0c43d 100644 --- a/conformance/README.md +++ b/conformance/README.md @@ -60,7 +60,8 @@ To run the conformance test suite: * Switch to the `conformance` subdirectory and install all dependencies (`pip install -r requirements.txt`). * Switch to the `src` subdirectory and run `python main.py`. -Note that some type checkers may not run on some platforms. If a type checker fails to install, tests will be skipped for that type checker. +Note that some type checkers may not run on some platforms. If a type checker fails to install, tests will be skipped for that type checker. +Currently, the only unsupported type checker is Pyre on Windows. ## Reporting Conformance Results diff --git a/conformance/requirements.txt b/conformance/requirements.txt index d4c4d5a86..f4dafc207 100644 --- a/conformance/requirements.txt +++ b/conformance/requirements.txt @@ -4,5 +4,5 @@ tqdm pyright mypy pip -pyre-check +pyre-check; platform_system != "Windows" pytype diff --git a/conformance/src/main.py b/conformance/src/main.py index 3f4b12973..0c8a3b5ad 100644 --- a/conformance/src/main.py +++ b/conformance/src/main.py @@ -197,7 +197,7 @@ def update_output_for_test( notes = "\n" + notes existing_results["notes"] = tomlkit.string(notes, multiline=True) results_file.parent.mkdir(parents=True, exist_ok=True) - with open(results_file, "w") as f: + with open(results_file, "w", encoding="utf-8") as f: tomlkit.dump(existing_results, f) diff --git a/conformance/src/type_checker.py b/conformance/src/type_checker.py index d5ee0dfa7..05f4485a9 100644 --- a/conformance/src/type_checker.py +++ b/conformance/src/type_checker.py @@ -387,6 +387,6 @@ def parse_errors(self, output: Sequence[str]) -> dict[int, list[str]]: TYPE_CHECKERS: Sequence[TypeChecker] = ( MypyTypeChecker(), PyrightTypeChecker(), - PyreTypeChecker(), + *([] if os.name == "nt" else [PyreTypeChecker()]), PytypeTypeChecker(), ) From c55a4d047465cc5081df2bdc7924d29de81304a4 Mon Sep 17 00:00:00 2001 From: Evgeny Bovykin Date: Tue, 22 Apr 2025 16:07:13 +0200 Subject: [PATCH 099/308] Make optional type narrowing actually optional in tuples_type_compat.py (#1981) --- conformance/tests/tuples_type_compat.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/conformance/tests/tuples_type_compat.py b/conformance/tests/tuples_type_compat.py index 73f3b3ad5..12a84cb16 100644 --- a/conformance/tests/tuples_type_compat.py +++ b/conformance/tests/tuples_type_compat.py @@ -71,15 +71,15 @@ def func4( def func5(val: tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]): if len(val) == 1: # Type can be narrowed to tuple[int]. - assert_type(val, tuple[int]) # tuple[int] + assert_type(val, tuple[int]) # E?: tuple[int] if len(val) == 2: # Type can be narrowed to tuple[str, str] | tuple[int, int]. - assert_type(val, tuple[str, str] | tuple[int, int]) + assert_type(val, tuple[str, str] | tuple[int, int]) # E? if len(val) == 3: # Type can be narrowed to tuple[int, str, int]. - assert_type(val, tuple[int, str, int]) + assert_type(val, tuple[int, str, int]) # E? # > This property may also be used to safely narrow tuple types within a match @@ -92,15 +92,15 @@ def func6(val: tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]) match val: case (x,): # Type can be narrowed to tuple[int]. - assert_type(val, tuple[int]) # tuple[int] + assert_type(val, tuple[int]) # E?: tuple[int] case (x, y): # Type can be narrowed to tuple[str, str] | tuple[int, int]. - assert_type(val, tuple[str, str] | tuple[int, int]) + assert_type(val, tuple[str, str] | tuple[int, int]) # E? case (x, y, z): # Type can be narrowed to tuple[int, str, int]. - assert_type(val, tuple[int, str, int]) + assert_type(val, tuple[int, str, int]) # E? # > Type checkers may safely use this equivalency rule (tuple expansion) @@ -112,9 +112,9 @@ def func6(val: tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]) def func7(subj: tuple[int | str, int | str]): match subj: case x, str(): - assert_type(subj, tuple[int | str, str]) + assert_type(subj, tuple[int | str, str]) # E? case y: - assert_type(subj, tuple[int | str, int]) + assert_type(subj, tuple[int | str, int]) # E? # > The tuple class derives from Sequence[T_co] where ``T_co`` is a covariant From ac67f79a58ae33a461a973cc363671d6f264d0e6 Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Tue, 22 Apr 2025 11:12:22 -0700 Subject: [PATCH 100/308] Conformance: Make "# E[tag]" exactly once, add support for at least once (#1982) --- conformance/README.md | 18 +- .../results/mypy/overloads_definitions.toml | 4 +- .../mypy/overloads_definitions_stub.toml | 1 - .../results/mypy/tuples_type_compat.toml | 42 ++--- conformance/results/mypy/version.toml | 2 +- .../results/pyre/overloads_definitions.toml | 8 +- .../results/pyre/tuples_type_compat.toml | 60 +++---- conformance/results/pyre/version.toml | 2 +- .../pyright/overloads_definitions.toml | 13 -- .../pyright/overloads_definitions_stub.toml | 2 - .../results/pyright/tuples_type_compat.toml | 28 +-- conformance/results/pyright/version.toml | 2 +- .../results/pytype/overloads_definitions.toml | 30 ++-- .../results/pytype/tuples_type_compat.toml | 170 +++++++++--------- conformance/results/pytype/version.toml | 2 +- conformance/results/results.html | 8 +- conformance/src/main.py | 32 +++- conformance/tests/aliases_type_statement.py | 4 +- conformance/tests/overloads_definitions.py | 32 ++-- .../tests/overloads_definitions_stub.pyi | 8 +- conformance/tests/tuples_type_compat.py | 43 +++-- 21 files changed, 273 insertions(+), 238 deletions(-) diff --git a/conformance/README.md b/conformance/README.md index 7abe0c43d..aa65c815d 100644 --- a/conformance/README.md +++ b/conformance/README.md @@ -46,12 +46,26 @@ Test cases use the following conventions: * Lines that are expected to produce a type checker error should have a comment starting with # E", either by itself or followed by an explanation after a colon (e.g., "# E: int is not a subtype of str"). Such explanatory comments are purely for human understanding, but type checkers are not - expected to use their exact wording. + expected to use their exact wording. There are several syntactic variations; see "Test Case Syntax" + below. * Lines that may produce an error (e.g., because the spec allows multiple behaviors) should be marked with "# E?" instead of "# E". * If a test case tests conformance with a specific passage in the spec, that passage should be quoted in a comment prefixed with "# > ". +## Test Case Syntax + +Test cases support the following special comments for declaring where errors should be raised: + +* `# E`: an error must be raised on this line +* `# E?`: an error may be raised on this line +* `# E[tag]`, where `tag` is an arbitrary string: must appear multiple times in a file with the same tag. + Exactly one line with this tag must raise an error. +* `# E[tag+]`: like `# E[tag]`, but errors may be raised on multiple lines. + +Each comment may be followed by a colon plus an explanation of the error; the explanation is ignored +by the scoring system. + ## Running the Conformance Test Tool To run the conformance test suite: @@ -60,7 +74,7 @@ To run the conformance test suite: * Switch to the `conformance` subdirectory and install all dependencies (`pip install -r requirements.txt`). * Switch to the `src` subdirectory and run `python main.py`. -Note that some type checkers may not run on some platforms. If a type checker fails to install, tests will be skipped for that type checker. +Note that some type checkers may not run on some platforms. If a type checker fails to install, tests will be skipped for that type checker. Currently, the only unsupported type checker is Pyre on Windows. ## Reporting Conformance Results diff --git a/conformance/results/mypy/overloads_definitions.toml b/conformance/results/mypy/overloads_definitions.toml index e642fa29b..d9485b866 100644 --- a/conformance/results/mypy/overloads_definitions.toml +++ b/conformance/results/mypy/overloads_definitions.toml @@ -5,7 +5,7 @@ Does not allow an overload with no implementation in an abstract base class. Allows @override to be on all overloads and implementation, instead of just implementation. """ errors_diff = """ -Lines 220, 222, 226: Expected error (tag 'override_impl') +Lines 220, 221, 222, 225, 226: Expected error (tag 'override_impl') Line 47: Unexpected errors ['overloads_definitions.py:47: error: An overloaded function outside a stub file must have an implementation [no-overload-impl]'] """ output = """ @@ -14,8 +14,6 @@ overloads_definitions.py:27: error: An overloaded function outside a stub file m overloads_definitions.py:47: error: An overloaded function outside a stub file must have an implementation [no-overload-impl] overloads_definitions.py:58: error: An overloaded function outside a stub file must have an implementation [no-overload-impl] overloads_definitions.py:71: error: Overload does not consistently use the "@staticmethod" decorator on all function signatures. [misc] -overloads_definitions.py:81: error: Overloaded function implementation does not accept all possible arguments of signature 1 [misc] -overloads_definitions.py:81: error: Overloaded function implementation does not accept all possible arguments of signature 2 [misc] overloads_definitions.py:84: error: Overload does not consistently use the "@classmethod" decorator on all function signatures. [misc] overloads_definitions.py:121: error: @final should be applied only to overload implementation [misc] overloads_definitions.py:135: error: @final should be applied only to overload implementation [misc] diff --git a/conformance/results/mypy/overloads_definitions_stub.toml b/conformance/results/mypy/overloads_definitions_stub.toml index f2fd2a7b4..2fccd76a3 100644 --- a/conformance/results/mypy/overloads_definitions_stub.toml +++ b/conformance/results/mypy/overloads_definitions_stub.toml @@ -9,7 +9,6 @@ Lines 143, 147, 149: Expected error (tag 'override_impl') output = """ overloads_definitions_stub.pyi:13: error: Single overload definition, multiple required [misc] overloads_definitions_stub.pyi:32: error: Overload does not consistently use the "@staticmethod" decorator on all function signatures. [misc] -overloads_definitions_stub.pyi:33: error: Self argument missing for a non-static method (or an invalid type for self) [misc] overloads_definitions_stub.pyi:39: error: Overload does not consistently use the "@classmethod" decorator on all function signatures. [misc] overloads_definitions_stub.pyi:71: error: In a stub file @final must be applied only to the first overload [misc] overloads_definitions_stub.pyi:84: error: In a stub file @final must be applied only to the first overload [misc] diff --git a/conformance/results/mypy/tuples_type_compat.toml b/conformance/results/mypy/tuples_type_compat.toml index 3882ed3f3..da7c5e84f 100644 --- a/conformance/results/mypy/tuples_type_compat.toml +++ b/conformance/results/mypy/tuples_type_compat.toml @@ -9,27 +9,29 @@ tuples_type_compat.py:32: error: Incompatible types in assignment (expression ha tuples_type_compat.py:33: error: Incompatible types in assignment (expression has type "tuple[int, ...]", variable has type "tuple[int]") [assignment] tuples_type_compat.py:43: error: Incompatible types in assignment (expression has type "tuple[int, ...]", variable has type "tuple[int]") [assignment] tuples_type_compat.py:62: error: Incompatible types in assignment (expression has type "tuple[int, ...]", variable has type "tuple[int, int]") [assignment] -tuples_type_compat.py:95: error: Expression is of type "tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]", not "tuple[int]" [assert-type] -tuples_type_compat.py:99: error: Expression is of type "tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]", not "tuple[str, str] | tuple[int, int]" [assert-type] -tuples_type_compat.py:103: error: Expression is of type "tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]", not "tuple[int, str, int]" [assert-type] -tuples_type_compat.py:136: error: Expression is of type "Sequence[object]", not "Sequence[complex | list[int]]" [assert-type] -tuples_type_compat.py:139: error: Expression is of type "Sequence[object]", not "Sequence[int | str]" [assert-type] -tuples_type_compat.py:144: error: Incompatible types in assignment (expression has type "tuple[int, str, str]", variable has type "tuple[int, str]") [assignment] -tuples_type_compat.py:149: error: Incompatible types in assignment (expression has type "tuple[int, int, str]", variable has type "tuple[int, *tuple[str, ...]]") [assignment] -tuples_type_compat.py:150: error: Incompatible types in assignment (expression has type "tuple[int, str, int]", variable has type "tuple[int, *tuple[str, ...]]") [assignment] -tuples_type_compat.py:156: error: Incompatible types in assignment (expression has type "tuple[int, str, str]", variable has type "tuple[int, *tuple[str, ...], int]") [assignment] -tuples_type_compat.py:157: error: Incompatible types in assignment (expression has type "tuple[int, str, str, float]", variable has type "tuple[int, *tuple[str, ...], int]") [assignment] -tuples_type_compat.py:162: error: Incompatible types in assignment (expression has type "tuple[int, str, int]", variable has type "tuple[*tuple[str, ...], int]") [assignment] -tuples_type_compat.py:163: error: Incompatible types in assignment (expression has type "tuple[str, str, float]", variable has type "tuple[*tuple[str, ...], int]") [assignment] -tuples_type_compat.py:168: error: Incompatible types in assignment (expression has type "tuple[str, str]", variable has type "tuple[str, str, int]") [assignment] -tuples_type_compat.py:171: error: Incompatible types in assignment (expression has type "tuple[str, str]", variable has type "tuple[str, str, str, *tuple[str, ...]]") [assignment] -tuples_type_compat.py:175: error: Incompatible types in assignment (expression has type "tuple[str, str]", variable has type "tuple[*tuple[str, ...], str, str, str]") [assignment] +tuples_type_compat.py:76: error: Expression is of type "tuple[int]", not "tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]" [assert-type] +tuples_type_compat.py:81: error: Expression is of type "tuple[str, str] | tuple[int, int]", not "tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]" [assert-type] +tuples_type_compat.py:86: error: Expression is of type "tuple[int, str, int]", not "tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]" [assert-type] +tuples_type_compat.py:101: error: Expression is of type "tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]", not "tuple[int]" [assert-type] +tuples_type_compat.py:106: error: Expression is of type "tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]", not "tuple[str, str] | tuple[int, int]" [assert-type] +tuples_type_compat.py:111: error: Expression is of type "tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]", not "tuple[int, str, int]" [assert-type] +tuples_type_compat.py:127: error: Expression is of type "tuple[int | str, str]", not "tuple[int | str, int | str]" [assert-type] +tuples_type_compat.py:130: error: Expression is of type "tuple[int | str, int]", not "tuple[int | str, int | str]" [assert-type] +tuples_type_compat.py:149: error: Expression is of type "Sequence[object]", not "Sequence[complex | list[int]]" [assert-type] +tuples_type_compat.py:152: error: Expression is of type "Sequence[object]", not "Sequence[int | str]" [assert-type] +tuples_type_compat.py:157: error: Incompatible types in assignment (expression has type "tuple[int, str, str]", variable has type "tuple[int, str]") [assignment] +tuples_type_compat.py:162: error: Incompatible types in assignment (expression has type "tuple[int, int, str]", variable has type "tuple[int, *tuple[str, ...]]") [assignment] +tuples_type_compat.py:163: error: Incompatible types in assignment (expression has type "tuple[int, str, int]", variable has type "tuple[int, *tuple[str, ...]]") [assignment] +tuples_type_compat.py:169: error: Incompatible types in assignment (expression has type "tuple[int, str, str]", variable has type "tuple[int, *tuple[str, ...], int]") [assignment] +tuples_type_compat.py:170: error: Incompatible types in assignment (expression has type "tuple[int, str, str, float]", variable has type "tuple[int, *tuple[str, ...], int]") [assignment] +tuples_type_compat.py:175: error: Incompatible types in assignment (expression has type "tuple[int, str, int]", variable has type "tuple[*tuple[str, ...], int]") [assignment] +tuples_type_compat.py:176: error: Incompatible types in assignment (expression has type "tuple[str, str, float]", variable has type "tuple[*tuple[str, ...], int]") [assignment] +tuples_type_compat.py:181: error: Incompatible types in assignment (expression has type "tuple[str, str]", variable has type "tuple[str, str, int]") [assignment] +tuples_type_compat.py:184: error: Incompatible types in assignment (expression has type "tuple[str, str]", variable has type "tuple[str, str, str, *tuple[str, ...]]") [assignment] +tuples_type_compat.py:188: error: Incompatible types in assignment (expression has type "tuple[str, str]", variable has type "tuple[*tuple[str, ...], str, str, str]") [assignment] """ conformance_automated = "Fail" errors_diff = """ -Line 95: Unexpected errors ['tuples_type_compat.py:95: error: Expression is of type "tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]", not "tuple[int]" [assert-type]'] -Line 99: Unexpected errors ['tuples_type_compat.py:99: error: Expression is of type "tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]", not "tuple[str, str] | tuple[int, int]" [assert-type]'] -Line 103: Unexpected errors ['tuples_type_compat.py:103: error: Expression is of type "tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]", not "tuple[int, str, int]" [assert-type]'] -Line 136: Unexpected errors ['tuples_type_compat.py:136: error: Expression is of type "Sequence[object]", not "Sequence[complex | list[int]]" [assert-type]'] -Line 139: Unexpected errors ['tuples_type_compat.py:139: error: Expression is of type "Sequence[object]", not "Sequence[int | str]" [assert-type]'] +Line 149: Unexpected errors ['tuples_type_compat.py:149: error: Expression is of type "Sequence[object]", not "Sequence[complex | list[int]]" [assert-type]'] +Line 152: Unexpected errors ['tuples_type_compat.py:152: error: Expression is of type "Sequence[object]", not "Sequence[int | str]" [assert-type]'] """ diff --git a/conformance/results/mypy/version.toml b/conformance/results/mypy/version.toml index ec26466c2..b3982776b 100644 --- a/conformance/results/mypy/version.toml +++ b/conformance/results/mypy/version.toml @@ -1,2 +1,2 @@ version = "mypy 1.15.0" -test_duration = 2.3 +test_duration = 1.8 diff --git a/conformance/results/pyre/overloads_definitions.toml b/conformance/results/pyre/overloads_definitions.toml index 0a99160d0..9462c19ce 100644 --- a/conformance/results/pyre/overloads_definitions.toml +++ b/conformance/results/pyre/overloads_definitions.toml @@ -5,10 +5,14 @@ Does not allow an overload with no implementation in a Protocol or an abstract b Expects @final/@override on all overloads and implementation, instead of implementation only. """ errors_diff = """ -Lines 135, 137, 142: Expected error (tag 'invalid_final_2') -Lines 220, 222, 226: Expected error (tag 'override_impl') +Lines 71, 73, 78, 81: Expected exactly one error (tag 'func5') +Lines 135, 136, 137, 141, 142: Expected error (tag 'invalid_final_2') +Lines 220, 221, 222, 225, 226: Expected error (tag 'override_impl') Line 40: Unexpected errors ['overloads_definitions.py:40:4 Missing overload implementation [42]: Overloaded function `MyProto.func3` must have an implementation.'] Line 49: Unexpected errors ['overloads_definitions.py:49:4 Missing overload implementation [42]: Overloaded function `MyAbstractBase.func4` must have an implementation.'] +Line 73: Unexpected errors ['overloads_definitions.py:73:4 Incompatible overload [43]: The implementation of `C.func5` does not accept all possible arguments of overload defined on line `73`.'] +Line 78: Unexpected errors ['overloads_definitions.py:78:4 Incompatible overload [43]: The implementation of `C.func5` does not accept all possible arguments of overload defined on line `78`.'] +Line 81: Unexpected errors ['overloads_definitions.py:81:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).'] Line 117: Unexpected errors ['overloads_definitions.py:117:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).'] Line 215: Unexpected errors ['overloads_definitions.py:215:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).'] """ diff --git a/conformance/results/pyre/tuples_type_compat.toml b/conformance/results/pyre/tuples_type_compat.toml index 72799fbd7..7eb2392d0 100644 --- a/conformance/results/pyre/tuples_type_compat.toml +++ b/conformance/results/pyre/tuples_type_compat.toml @@ -8,28 +8,28 @@ Does not correctly evaluate `Sequence[Never]` for `tuple[()]`. output = """ tuples_type_compat.py:15:4 Incompatible variable type [9]: v2 is declared to have type `Tuple[int, int]` but is used as type `Tuple[float, complex]`. tuples_type_compat.py:55:21 Undefined or invalid type [11]: Annotation `SomeType` is not defined as a type. -tuples_type_compat.py:72:11 Incompatible parameter type [6]: In call `len`, for 1st positional argument, expected `pyre_extensions.PyreReadOnly[Sized]` but got `Union[Tuple[int], Tuple[str, str], typing.Tuple[int, *Tuple[str, ...], int]]`. -tuples_type_compat.py:74:8 Assert type [70]: Expected `Tuple[int]` but got `Union[Tuple[int], Tuple[str, str], typing.Tuple[int, *Tuple[str, ...], int]]`. -tuples_type_compat.py:76:11 Incompatible parameter type [6]: In call `len`, for 1st positional argument, expected `pyre_extensions.PyreReadOnly[Sized]` but got `Union[Tuple[int], Tuple[str, str], typing.Tuple[int, *Tuple[str, ...], int]]`. -tuples_type_compat.py:78:8 Assert type [70]: Expected `Union[Tuple[int, int], Tuple[str, str]]` but got `Union[Tuple[int], Tuple[str, str], typing.Tuple[int, *Tuple[str, ...], int]]`. -tuples_type_compat.py:80:11 Incompatible parameter type [6]: In call `len`, for 1st positional argument, expected `pyre_extensions.PyreReadOnly[Sized]` but got `Union[Tuple[int], Tuple[str, str], typing.Tuple[int, *Tuple[str, ...], int]]`. -tuples_type_compat.py:82:8 Assert type [70]: Expected `Tuple[int, str, int]` but got `Union[Tuple[int], Tuple[str, str], typing.Tuple[int, *Tuple[str, ...], int]]`. -tuples_type_compat.py:95:12 Assert type [70]: Expected `Tuple[int]` but got `Union[Tuple[int], Tuple[str, str], typing.Tuple[int, *Tuple[str, ...], int]]`. -tuples_type_compat.py:99:12 Assert type [70]: Expected `Union[Tuple[int, int], Tuple[str, str]]` but got `Union[Tuple[int], Tuple[str, str], typing.Tuple[int, *Tuple[str, ...], int]]`. -tuples_type_compat.py:103:12 Assert type [70]: Expected `Tuple[int, str, int]` but got `Union[Tuple[int], Tuple[str, str], typing.Tuple[int, *Tuple[str, ...], int]]`. -tuples_type_compat.py:115:12 Assert type [70]: Expected `Tuple[Union[int, str], str]` but got `Tuple[Union[int, str], Union[int, str]]`. -tuples_type_compat.py:117:12 Assert type [70]: Expected `Tuple[Union[int, str], int]` but got `Tuple[Union[int, str], Union[int, str]]`. -tuples_type_compat.py:140:4 Assert type [70]: Expected `Sequence[Never]` but got `Sequence[Variable[T]]`. -tuples_type_compat.py:144:0 Incompatible variable type [9]: t1 is declared to have type `Tuple[int, str]` but is used as type `Tuple[int, str, str]`. -tuples_type_compat.py:149:0 Incompatible variable type [9]: t2 is declared to have type `typing.Tuple[int, *Tuple[str, ...]]` but is used as type `Tuple[int, int, str]`. -tuples_type_compat.py:150:0 Incompatible variable type [9]: t2 is declared to have type `typing.Tuple[int, *Tuple[str, ...]]` but is used as type `Tuple[int, str, int]`. -tuples_type_compat.py:156:0 Incompatible variable type [9]: t3 is declared to have type `typing.Tuple[int, *Tuple[str, ...], int]` but is used as type `Tuple[int, str, str]`. -tuples_type_compat.py:157:0 Incompatible variable type [9]: t3 is declared to have type `typing.Tuple[int, *Tuple[str, ...], int]` but is used as type `Tuple[int, str, str, float]`. -tuples_type_compat.py:162:0 Incompatible variable type [9]: t4 is declared to have type `typing.Tuple[*Tuple[str, ...], int]` but is used as type `Tuple[int, str, int]`. -tuples_type_compat.py:163:0 Incompatible variable type [9]: t4 is declared to have type `typing.Tuple[*Tuple[str, ...], int]` but is used as type `Tuple[str, str, float]`. -tuples_type_compat.py:168:4 Incompatible variable type [9]: t2 is declared to have type `Tuple[str, str, int]` but is used as type `Tuple[str, str]`. -tuples_type_compat.py:171:4 Incompatible variable type [9]: t5 is declared to have type `typing.Tuple[str, str, str, *Tuple[str, ...]]` but is used as type `Tuple[str, str]`. -tuples_type_compat.py:175:4 Incompatible variable type [9]: t9 is declared to have type `typing.Tuple[*Tuple[str, ...], str, str, str]` but is used as type `Tuple[str, str]`. +tuples_type_compat.py:73:11 Incompatible parameter type [6]: In call `len`, for 1st positional argument, expected `pyre_extensions.PyreReadOnly[Sized]` but got `Union[Tuple[int], Tuple[str, str], typing.Tuple[int, *Tuple[str, ...], int]]`. +tuples_type_compat.py:75:8 Assert type [70]: Expected `Tuple[int]` but got `Union[Tuple[int], Tuple[str, str], typing.Tuple[int, *Tuple[str, ...], int]]`. +tuples_type_compat.py:78:11 Incompatible parameter type [6]: In call `len`, for 1st positional argument, expected `pyre_extensions.PyreReadOnly[Sized]` but got `Union[Tuple[int], Tuple[str, str], typing.Tuple[int, *Tuple[str, ...], int]]`. +tuples_type_compat.py:80:8 Assert type [70]: Expected `Union[Tuple[int, int], Tuple[str, str]]` but got `Union[Tuple[int], Tuple[str, str], typing.Tuple[int, *Tuple[str, ...], int]]`. +tuples_type_compat.py:83:11 Incompatible parameter type [6]: In call `len`, for 1st positional argument, expected `pyre_extensions.PyreReadOnly[Sized]` but got `Union[Tuple[int], Tuple[str, str], typing.Tuple[int, *Tuple[str, ...], int]]`. +tuples_type_compat.py:85:8 Assert type [70]: Expected `Tuple[int, str, int]` but got `Union[Tuple[int], Tuple[str, str], typing.Tuple[int, *Tuple[str, ...], int]]`. +tuples_type_compat.py:101:12 Assert type [70]: Expected `Tuple[int]` but got `Union[Tuple[int], Tuple[str, str], typing.Tuple[int, *Tuple[str, ...], int]]`. +tuples_type_compat.py:106:12 Assert type [70]: Expected `Union[Tuple[int, int], Tuple[str, str]]` but got `Union[Tuple[int], Tuple[str, str], typing.Tuple[int, *Tuple[str, ...], int]]`. +tuples_type_compat.py:111:12 Assert type [70]: Expected `Tuple[int, str, int]` but got `Union[Tuple[int], Tuple[str, str], typing.Tuple[int, *Tuple[str, ...], int]]`. +tuples_type_compat.py:126:12 Assert type [70]: Expected `Tuple[Union[int, str], str]` but got `Tuple[Union[int, str], Union[int, str]]`. +tuples_type_compat.py:129:12 Assert type [70]: Expected `Tuple[Union[int, str], int]` but got `Tuple[Union[int, str], Union[int, str]]`. +tuples_type_compat.py:153:4 Assert type [70]: Expected `Sequence[Never]` but got `Sequence[Variable[T]]`. +tuples_type_compat.py:157:0 Incompatible variable type [9]: t1 is declared to have type `Tuple[int, str]` but is used as type `Tuple[int, str, str]`. +tuples_type_compat.py:162:0 Incompatible variable type [9]: t2 is declared to have type `typing.Tuple[int, *Tuple[str, ...]]` but is used as type `Tuple[int, int, str]`. +tuples_type_compat.py:163:0 Incompatible variable type [9]: t2 is declared to have type `typing.Tuple[int, *Tuple[str, ...]]` but is used as type `Tuple[int, str, int]`. +tuples_type_compat.py:169:0 Incompatible variable type [9]: t3 is declared to have type `typing.Tuple[int, *Tuple[str, ...], int]` but is used as type `Tuple[int, str, str]`. +tuples_type_compat.py:170:0 Incompatible variable type [9]: t3 is declared to have type `typing.Tuple[int, *Tuple[str, ...], int]` but is used as type `Tuple[int, str, str, float]`. +tuples_type_compat.py:175:0 Incompatible variable type [9]: t4 is declared to have type `typing.Tuple[*Tuple[str, ...], int]` but is used as type `Tuple[int, str, int]`. +tuples_type_compat.py:176:0 Incompatible variable type [9]: t4 is declared to have type `typing.Tuple[*Tuple[str, ...], int]` but is used as type `Tuple[str, str, float]`. +tuples_type_compat.py:181:4 Incompatible variable type [9]: t2 is declared to have type `Tuple[str, str, int]` but is used as type `Tuple[str, str]`. +tuples_type_compat.py:184:4 Incompatible variable type [9]: t5 is declared to have type `typing.Tuple[str, str, str, *Tuple[str, ...]]` but is used as type `Tuple[str, str]`. +tuples_type_compat.py:188:4 Incompatible variable type [9]: t9 is declared to have type `typing.Tuple[*Tuple[str, ...], str, str, str]` but is used as type `Tuple[str, str]`. """ conformance_automated = "Fail" errors_diff = """ @@ -39,16 +39,8 @@ Line 33: Expected 1 errors Line 43: Expected 1 errors Line 62: Expected 1 errors Line 55: Unexpected errors ['tuples_type_compat.py:55:21 Undefined or invalid type [11]: Annotation `SomeType` is not defined as a type.'] -Line 72: Unexpected errors ['tuples_type_compat.py:72:11 Incompatible parameter type [6]: In call `len`, for 1st positional argument, expected `pyre_extensions.PyreReadOnly[Sized]` but got `Union[Tuple[int], Tuple[str, str], typing.Tuple[int, *Tuple[str, ...], int]]`.'] -Line 74: Unexpected errors ['tuples_type_compat.py:74:8 Assert type [70]: Expected `Tuple[int]` but got `Union[Tuple[int], Tuple[str, str], typing.Tuple[int, *Tuple[str, ...], int]]`.'] -Line 76: Unexpected errors ['tuples_type_compat.py:76:11 Incompatible parameter type [6]: In call `len`, for 1st positional argument, expected `pyre_extensions.PyreReadOnly[Sized]` but got `Union[Tuple[int], Tuple[str, str], typing.Tuple[int, *Tuple[str, ...], int]]`.'] -Line 78: Unexpected errors ['tuples_type_compat.py:78:8 Assert type [70]: Expected `Union[Tuple[int, int], Tuple[str, str]]` but got `Union[Tuple[int], Tuple[str, str], typing.Tuple[int, *Tuple[str, ...], int]]`.'] -Line 80: Unexpected errors ['tuples_type_compat.py:80:11 Incompatible parameter type [6]: In call `len`, for 1st positional argument, expected `pyre_extensions.PyreReadOnly[Sized]` but got `Union[Tuple[int], Tuple[str, str], typing.Tuple[int, *Tuple[str, ...], int]]`.'] -Line 82: Unexpected errors ['tuples_type_compat.py:82:8 Assert type [70]: Expected `Tuple[int, str, int]` but got `Union[Tuple[int], Tuple[str, str], typing.Tuple[int, *Tuple[str, ...], int]]`.'] -Line 95: Unexpected errors ['tuples_type_compat.py:95:12 Assert type [70]: Expected `Tuple[int]` but got `Union[Tuple[int], Tuple[str, str], typing.Tuple[int, *Tuple[str, ...], int]]`.'] -Line 99: Unexpected errors ['tuples_type_compat.py:99:12 Assert type [70]: Expected `Union[Tuple[int, int], Tuple[str, str]]` but got `Union[Tuple[int], Tuple[str, str], typing.Tuple[int, *Tuple[str, ...], int]]`.'] -Line 103: Unexpected errors ['tuples_type_compat.py:103:12 Assert type [70]: Expected `Tuple[int, str, int]` but got `Union[Tuple[int], Tuple[str, str], typing.Tuple[int, *Tuple[str, ...], int]]`.'] -Line 115: Unexpected errors ['tuples_type_compat.py:115:12 Assert type [70]: Expected `Tuple[Union[int, str], str]` but got `Tuple[Union[int, str], Union[int, str]]`.'] -Line 117: Unexpected errors ['tuples_type_compat.py:117:12 Assert type [70]: Expected `Tuple[Union[int, str], int]` but got `Tuple[Union[int, str], Union[int, str]]`.'] -Line 140: Unexpected errors ['tuples_type_compat.py:140:4 Assert type [70]: Expected `Sequence[Never]` but got `Sequence[Variable[T]]`.'] +Line 73: Unexpected errors ['tuples_type_compat.py:73:11 Incompatible parameter type [6]: In call `len`, for 1st positional argument, expected `pyre_extensions.PyreReadOnly[Sized]` but got `Union[Tuple[int], Tuple[str, str], typing.Tuple[int, *Tuple[str, ...], int]]`.'] +Line 78: Unexpected errors ['tuples_type_compat.py:78:11 Incompatible parameter type [6]: In call `len`, for 1st positional argument, expected `pyre_extensions.PyreReadOnly[Sized]` but got `Union[Tuple[int], Tuple[str, str], typing.Tuple[int, *Tuple[str, ...], int]]`.'] +Line 83: Unexpected errors ['tuples_type_compat.py:83:11 Incompatible parameter type [6]: In call `len`, for 1st positional argument, expected `pyre_extensions.PyreReadOnly[Sized]` but got `Union[Tuple[int], Tuple[str, str], typing.Tuple[int, *Tuple[str, ...], int]]`.'] +Line 153: Unexpected errors ['tuples_type_compat.py:153:4 Assert type [70]: Expected `Sequence[Never]` but got `Sequence[Variable[T]]`.'] """ diff --git a/conformance/results/pyre/version.toml b/conformance/results/pyre/version.toml index 1fe379853..e9c0c954d 100644 --- a/conformance/results/pyre/version.toml +++ b/conformance/results/pyre/version.toml @@ -1,2 +1,2 @@ version = "pyre 0.9.23" -test_duration = 8.2 +test_duration = 9.0 diff --git a/conformance/results/pyright/overloads_definitions.toml b/conformance/results/pyright/overloads_definitions.toml index e0c86ab26..f7b17e782 100644 --- a/conformance/results/pyright/overloads_definitions.toml +++ b/conformance/results/pyright/overloads_definitions.toml @@ -7,20 +7,7 @@ overloads_definitions.py:16:5 - error: "func1" is marked as overload, but additi overloads_definitions.py:28:5 - error: "func2" is marked as overload, but no implementation is provided (reportNoOverloadImplementation) overloads_definitions.py:59:9 - error: "not_abstract" is marked as overload, but no implementation is provided (reportNoOverloadImplementation) overloads_definitions.py:73:9 - error: Overloads for "func5" use @staticmethod inconsistently (reportInconsistentOverload) -overloads_definitions.py:81:9 - error: Overloaded implementation is not consistent with signature of overload 1 -  Type "(self: Self@C, x: int | str) -> (int | str)" is not assignable to type "(x: int) -> int" -    Parameter name mismatch: "x" versus "self" -    Parameter 1: type "int" is incompatible with type "Self@C" -      Type "int" is not assignable to type "Self@C" -    Extra parameter "x" (reportInconsistentOverload) -overloads_definitions.py:81:9 - error: Overloaded implementation is not consistent with signature of overload 2 -  Type "(self: Self@C, x: int | str) -> (int | str)" is not assignable to type "(x: str) -> str" -    Parameter name mismatch: "x" versus "self" -    Parameter 1: type "str" is incompatible with type "Self@C" -      Type "str" is not assignable to type "Self@C" -    Extra parameter "x" (reportInconsistentOverload) overloads_definitions.py:86:9 - error: Overloads for "func6" use @classmethod inconsistently (reportInconsistentOverload) -overloads_definitions.py:90:15 - warning: Instance methods should take a "self" parameter (reportSelfClsParameterName) overloads_definitions.py:123:9 - error: @final decorator should be applied only to the implementation (reportInconsistentOverload) overloads_definitions.py:137:9 - error: @final decorator should be applied only to the implementation (reportInconsistentOverload) overloads_definitions.py:142:9 - error: @final decorator should be applied only to the implementation (reportInconsistentOverload) diff --git a/conformance/results/pyright/overloads_definitions_stub.toml b/conformance/results/pyright/overloads_definitions_stub.toml index 1e9c89498..a043c6cf1 100644 --- a/conformance/results/pyright/overloads_definitions_stub.toml +++ b/conformance/results/pyright/overloads_definitions_stub.toml @@ -5,9 +5,7 @@ errors_diff = """ output = """ overloads_definitions_stub.pyi:14:5 - error: "func1" is marked as overload, but additional overloads are missing (reportInconsistentOverload) overloads_definitions_stub.pyi:33:9 - error: Overloads for "func5" use @staticmethod inconsistently (reportInconsistentOverload) -overloads_definitions_stub.pyi:33:15 - warning: Instance methods should take a "self" parameter (reportSelfClsParameterName) overloads_definitions_stub.pyi:41:9 - error: Overloads for "func6" use @classmethod inconsistently (reportInconsistentOverload) -overloads_definitions_stub.pyi:44:15 - warning: Instance methods should take a "self" parameter (reportSelfClsParameterName) overloads_definitions_stub.pyi:73:9 - error: Only the first overload should be marked @final (reportInconsistentOverload) overloads_definitions_stub.pyi:86:9 - error: Only the first overload should be marked @final (reportInconsistentOverload) overloads_definitions_stub.pyi:111:9 - error: Method "final_method" cannot override final method defined in class "Base" (reportIncompatibleMethodOverride) diff --git a/conformance/results/pyright/tuples_type_compat.toml b/conformance/results/pyright/tuples_type_compat.toml index 02eac2977..72058759b 100644 --- a/conformance/results/pyright/tuples_type_compat.toml +++ b/conformance/results/pyright/tuples_type_compat.toml @@ -19,28 +19,36 @@ tuples_type_compat.py:43:22 - error: Type "tuple[int, ...]" is not assignable to tuples_type_compat.py:62:26 - error: Type "tuple[int, ...]" is not assignable to declared type "tuple[int, int]"   "tuple[int, ...]" is not assignable to "tuple[int, int]"     Tuple size mismatch; expected 2 but received indeterminate (reportAssignmentType) -tuples_type_compat.py:144:6 - error: Type "tuple[Literal[1], Literal[''], Literal['']]" is not assignable to declared type "tuple[int, str]" +tuples_type_compat.py:76:21 - error: "assert_type" mismatch: expected "tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]" but received "tuple[int]" (reportAssertTypeFailure) +tuples_type_compat.py:81:21 - error: "assert_type" mismatch: expected "tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]" but received "tuple[str, str] | tuple[int, int]" (reportAssertTypeFailure) +tuples_type_compat.py:86:21 - error: "assert_type" mismatch: expected "tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]" but received "tuple[int, str, int]" (reportAssertTypeFailure) +tuples_type_compat.py:102:25 - error: "assert_type" mismatch: expected "tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]" but received "tuple[int]" (reportAssertTypeFailure) +tuples_type_compat.py:107:25 - error: "assert_type" mismatch: expected "tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]" but received "tuple[str, str] | tuple[int, int]" (reportAssertTypeFailure) +tuples_type_compat.py:112:25 - error: "assert_type" mismatch: expected "tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]" but received "tuple[int, str, int]" (reportAssertTypeFailure) +tuples_type_compat.py:127:25 - error: "assert_type" mismatch: expected "tuple[int | str, int | str]" but received "tuple[int | str, str]" (reportAssertTypeFailure) +tuples_type_compat.py:130:25 - error: "assert_type" mismatch: expected "tuple[int | str, int | str]" but received "tuple[int | str, int]" (reportAssertTypeFailure) +tuples_type_compat.py:157:6 - error: Type "tuple[Literal[1], Literal[''], Literal['']]" is not assignable to declared type "tuple[int, str]"   "tuple[Literal[1], Literal[''], Literal['']]" is not assignable to "tuple[int, str]"     Tuple size mismatch; expected 2 but received 3 (reportAssignmentType) -tuples_type_compat.py:149:10 - error: Type "tuple[Literal[1], Literal[1], Literal['']]" is not assignable to declared type "tuple[int, *tuple[str, ...]]" +tuples_type_compat.py:162:10 - error: Type "tuple[Literal[1], Literal[1], Literal['']]" is not assignable to declared type "tuple[int, *tuple[str, ...]]"   "Literal[1]" is not assignable to "str" (reportAssignmentType) -tuples_type_compat.py:150:14 - error: Type "tuple[Literal[1], Literal[''], Literal[1]]" is not assignable to declared type "tuple[int, *tuple[str, ...]]" +tuples_type_compat.py:163:14 - error: Type "tuple[Literal[1], Literal[''], Literal[1]]" is not assignable to declared type "tuple[int, *tuple[str, ...]]"   "Literal[1]" is not assignable to "str" (reportAssignmentType) -tuples_type_compat.py:156:14 - error: Type "tuple[Literal[1], Literal[''], Literal['']]" is not assignable to declared type "tuple[int, *tuple[str, ...], int]" +tuples_type_compat.py:169:14 - error: Type "tuple[Literal[1], Literal[''], Literal['']]" is not assignable to declared type "tuple[int, *tuple[str, ...], int]"   "Literal['']" is not assignable to "int" (reportAssignmentType) -tuples_type_compat.py:157:18 - error: Type "tuple[Literal[1], Literal[''], Literal[''], float]" is not assignable to declared type "tuple[int, *tuple[str, ...], int]" +tuples_type_compat.py:170:18 - error: Type "tuple[Literal[1], Literal[''], Literal[''], float]" is not assignable to declared type "tuple[int, *tuple[str, ...], int]"   "float" is not assignable to "int" (reportAssignmentType) -tuples_type_compat.py:162:7 - error: Type "tuple[Literal[1], Literal[''], Literal[1]]" is not assignable to declared type "tuple[*tuple[str, ...], int]" +tuples_type_compat.py:175:7 - error: Type "tuple[Literal[1], Literal[''], Literal[1]]" is not assignable to declared type "tuple[*tuple[str, ...], int]"   "Literal[1]" is not assignable to "str" (reportAssignmentType) -tuples_type_compat.py:163:15 - error: Type "tuple[Literal[''], Literal[''], float]" is not assignable to declared type "tuple[*tuple[str, ...], int]" +tuples_type_compat.py:176:15 - error: Type "tuple[Literal[''], Literal[''], float]" is not assignable to declared type "tuple[*tuple[str, ...], int]"   "float" is not assignable to "int" (reportAssignmentType) -tuples_type_compat.py:168:40 - error: Type "tuple[str, str]" is not assignable to declared type "tuple[str, str, int]" +tuples_type_compat.py:181:40 - error: Type "tuple[str, str]" is not assignable to declared type "tuple[str, str, int]"   "tuple[str, str]" is not assignable to "tuple[str, str, int]"     Tuple size mismatch; expected 3 but received 2 (reportAssignmentType) -tuples_type_compat.py:171:50 - error: Type "tuple[str, str]" is not assignable to declared type "tuple[str, str, str, *tuple[str, ...]]" +tuples_type_compat.py:184:50 - error: Type "tuple[str, str]" is not assignable to declared type "tuple[str, str, str, *tuple[str, ...]]"   "tuple[str, str]" is not assignable to "tuple[str, str, str, *tuple[str, ...]]"     Tuple size mismatch; expected 3 or more but received 2 (reportAssignmentType) -tuples_type_compat.py:175:50 - error: Type "tuple[str, str]" is not assignable to declared type "tuple[*tuple[str, ...], str, str, str]" +tuples_type_compat.py:188:50 - error: Type "tuple[str, str]" is not assignable to declared type "tuple[*tuple[str, ...], str, str, str]"   "tuple[str, str]" is not assignable to "tuple[*tuple[str, ...], str, str, str]"     Tuple size mismatch; expected 3 or more but received 2 (reportAssignmentType) """ diff --git a/conformance/results/pyright/version.toml b/conformance/results/pyright/version.toml index 57dacbb67..03b8b5c64 100644 --- a/conformance/results/pyright/version.toml +++ b/conformance/results/pyright/version.toml @@ -1,2 +1,2 @@ version = "pyright 1.1.399" -test_duration = 1.4 +test_duration = 1.1 diff --git a/conformance/results/pytype/overloads_definitions.toml b/conformance/results/pytype/overloads_definitions.toml index dc4444dc3..5716f0e5b 100644 --- a/conformance/results/pytype/overloads_definitions.toml +++ b/conformance/results/pytype/overloads_definitions.toml @@ -14,14 +14,15 @@ Lines 58, 59: Expected error (tag 'not_abstract') Lines 71, 73, 78, 81: Expected error (tag 'func5') Lines 84, 86, 90, 94: Expected error (tag 'func6') Lines 121, 123, 127: Expected error (tag 'invalid_final') -Lines 135, 137, 142: Expected error (tag 'invalid_final_2') -Lines 220, 222, 226: Expected error (tag 'override_impl') +Lines 135, 136, 137, 141, 142: Expected error (tag 'invalid_final_2') +Lines 220, 221, 222, 225, 226: Expected error (tag 'override_impl') Line 6: Unexpected errors ['overloads_definitions.py:6:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.override not supported yet [not-supported-yet]'] Line 43: Unexpected errors ["overloads_definitions.py:43:37: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func3: @typing.overload-decorated 'MyProto.func3' object is not callable [not-callable]"] Line 53: Unexpected errors ["overloads_definitions.py:53:37: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func4: @typing.overload-decorated 'MyAbstractBase.func4' object is not callable [not-callable]"] Line 63: Unexpected errors ["overloads_definitions.py:63:44: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in not_abstract: @typing.overload-decorated 'MyAbstractBase.not_abstract' object is not callable [not-callable]"] Line 74: Unexpected errors ['overloads_definitions.py:74:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func5: bad return type [bad-return-type]'] Line 79: Unexpected errors ['overloads_definitions.py:79:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func5: bad return type [bad-return-type]'] +Line 95: Unexpected errors ['overloads_definitions.py:95:16: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func6: bad return type [bad-return-type]'] Line 117: Unexpected errors ['overloads_definitions.py:117:56: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in final_method: bad return type [bad-return-type]', 'overloads_definitions.py:117:56: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in final_method: bad return type [bad-return-type]'] Line 130: Unexpected errors ['overloads_definitions.py:130:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in invalid_final: bad return type [bad-return-type]', 'overloads_definitions.py:130:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in invalid_final: bad return type [bad-return-type]'] Line 146: Unexpected errors ['overloads_definitions.py:146:59: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in invalid_final_2: bad return type [bad-return-type]', 'overloads_definitions.py:146:59: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in invalid_final_2: bad return type [bad-return-type]'] @@ -73,6 +74,11 @@ overloads_definitions.py:79:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in f ... \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m +overloads_definitions.py:95:16: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func6: bad return type [bad-return-type] + + return 1 + \u001b[1m\u001b[31m~\u001b[39m\u001b[0m + overloads_definitions.py:117:56: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in final_method: bad return type [bad-return-type] def final_method(self, x: int | str) -> int | str: ... @@ -225,20 +231,20 @@ class Child(Base): # E[override-final] \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m \u001b[1m\u001b[31m\u001b[39m\u001b[0m - @overload # E[override_impl]: @override should appear only on implementation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - @override -\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - def to_override(self, x: int) -> int: ... # E[override_impl] -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + @overload # E[override_impl+]: @override should appear only on implementation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + @override # E[override_impl+] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + def to_override(self, x: int) -> int: ... # E[override_impl+] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m \u001b[1m\u001b[31m\u001b[39m\u001b[0m @overload \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - @override -\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - def to_override(self, x: str) -> str: ... # E[override_impl] -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + @override # E[override_impl+] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + def to_override(self, x: str) -> str: ... # E[override_impl+] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m \u001b[1m\u001b[31m\u001b[39m\u001b[0m @override diff --git a/conformance/results/pytype/tuples_type_compat.toml b/conformance/results/pytype/tuples_type_compat.toml index 029eb7134..d7c191764 100644 --- a/conformance/results/pytype/tuples_type_compat.toml +++ b/conformance/results/pytype/tuples_type_compat.toml @@ -25,257 +25,257 @@ tuples_type_compat.py:47:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func v6: tuple[int, *tuple[str, ...]] = t3 # OK \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m -tuples_type_compat.py:71:47: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] +tuples_type_compat.py:70:56: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] -def func5(val: tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]): - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +Func5Input: TypeAlias = tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int] + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -tuples_type_compat.py:74:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func5: tuple [assert-type] +tuples_type_compat.py:75:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func5: tuple [assert-type] - assert_type(val, tuple[int]) # tuple[int] + assert_type(val, tuple[int]) # E[func5_1] \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -tuples_type_compat.py:78:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func5: tuple [assert-type] +tuples_type_compat.py:80:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func5: tuple [assert-type] - assert_type(val, tuple[str, str] | tuple[int, int]) + assert_type(val, tuple[str, str] | tuple[int, int]) # E[func5_2] \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -tuples_type_compat.py:82:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func5: tuple [assert-type] +tuples_type_compat.py:85:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func5: tuple [assert-type] - assert_type(val, tuple[int, str, int]) + assert_type(val, tuple[int, str, int]) # E[func5_3] \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -tuples_type_compat.py:91:47: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] +tuples_type_compat.py:94:56: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] -def func6(val: tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]): - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +Func6Input: TypeAlias = tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int] + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -tuples_type_compat.py:115:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func7: tuple[Union[int, str], Union[int, str]] [assert-type] +tuples_type_compat.py:126:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func7: tuple[Union[int, str], Union[int, str]] [assert-type] - assert_type(subj, tuple[int | str, str]) + assert_type(subj, tuple[int | str, str]) # E[func7_1] \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -tuples_type_compat.py:117:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func7: tuple[Union[int, str], Union[int, str]] [assert-type] +tuples_type_compat.py:129:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func7: tuple[Union[int, str], Union[int, str]] [assert-type] - assert_type(subj, tuple[int | str, int]) + assert_type(subj, tuple[int | str, int]) # E[func7_2] \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -tuples_type_compat.py:134:40: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] +tuples_type_compat.py:147:40: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] t1: tuple[complex, list[int]], t2: tuple[int, *tuple[str, ...]], t3: tuple[()] \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -tuples_type_compat.py:139:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func8: Sequence [assert-type] +tuples_type_compat.py:152:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func8: Sequence [assert-type] assert_type(test_seq(t2), Sequence[int | str]) # Could be Sequence[object] \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -tuples_type_compat.py:140:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func8: Sequence [assert-type] +tuples_type_compat.py:153:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func8: Sequence [assert-type] assert_type(test_seq(t3), Sequence[Never]) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -tuples_type_compat.py:143:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t1 does not match type of assignment [annotation-type-mismatch] +tuples_type_compat.py:156:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t1 does not match type of assignment [annotation-type-mismatch] t1: tuple[int, *tuple[str]] = (1, "") # OK \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m -tuples_type_compat.py:143:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[int, *tuple[str]]' [invalid-annotation] +tuples_type_compat.py:156:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[int, *tuple[str]]' [invalid-annotation] t1: tuple[int, *tuple[str]] = (1, "") # OK \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m -tuples_type_compat.py:143:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] +tuples_type_compat.py:156:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] t1: tuple[int, *tuple[str]] = (1, "") # OK \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -tuples_type_compat.py:144:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t1 does not match type of assignment [annotation-type-mismatch] +tuples_type_compat.py:157:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t1 does not match type of assignment [annotation-type-mismatch] t1 = (1, "", "") # E \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m -tuples_type_compat.py:146:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[int, *tuple[str, ...]]' [invalid-annotation] +tuples_type_compat.py:159:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[int, *tuple[str, ...]]' [invalid-annotation] t2: tuple[int, *tuple[str, ...]] = (1,) # OK \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m -tuples_type_compat.py:146:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] +tuples_type_compat.py:159:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] t2: tuple[int, *tuple[str, ...]] = (1,) # OK \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -tuples_type_compat.py:147:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t2 does not match type of assignment [annotation-type-mismatch] +tuples_type_compat.py:160:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t2 does not match type of assignment [annotation-type-mismatch] t2 = (1, "") # OK \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m -tuples_type_compat.py:148:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t2 does not match type of assignment [annotation-type-mismatch] +tuples_type_compat.py:161:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t2 does not match type of assignment [annotation-type-mismatch] t2 = (1, "", "") # OK \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m -tuples_type_compat.py:149:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t2 does not match type of assignment [annotation-type-mismatch] +tuples_type_compat.py:162:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t2 does not match type of assignment [annotation-type-mismatch] t2 = (1, 1, "") # E \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m -tuples_type_compat.py:150:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t2 does not match type of assignment [annotation-type-mismatch] +tuples_type_compat.py:163:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t2 does not match type of assignment [annotation-type-mismatch] t2 = (1, "", 1) # E \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m -tuples_type_compat.py:153:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t3 does not match type of assignment [annotation-type-mismatch] +tuples_type_compat.py:166:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t3 does not match type of assignment [annotation-type-mismatch] t3: tuple[int, *tuple[str, ...], int] = (1, 2) # OK \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m -tuples_type_compat.py:153:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[int, *tuple[str, ...], int]' [invalid-annotation] +tuples_type_compat.py:166:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[int, *tuple[str, ...], int]' [invalid-annotation] t3: tuple[int, *tuple[str, ...], int] = (1, 2) # OK \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m -tuples_type_compat.py:153:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] +tuples_type_compat.py:166:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] t3: tuple[int, *tuple[str, ...], int] = (1, 2) # OK \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -tuples_type_compat.py:154:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t3 does not match type of assignment [annotation-type-mismatch] +tuples_type_compat.py:167:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t3 does not match type of assignment [annotation-type-mismatch] t3 = (1, "", 2) # OK \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m -tuples_type_compat.py:155:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t3 does not match type of assignment [annotation-type-mismatch] +tuples_type_compat.py:168:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t3 does not match type of assignment [annotation-type-mismatch] t3 = (1, "", "", 2) # OK \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m -tuples_type_compat.py:156:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t3 does not match type of assignment [annotation-type-mismatch] +tuples_type_compat.py:169:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t3 does not match type of assignment [annotation-type-mismatch] t3 = (1, "", "") # E \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m -tuples_type_compat.py:157:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t3 does not match type of assignment [annotation-type-mismatch] +tuples_type_compat.py:170:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t3 does not match type of assignment [annotation-type-mismatch] t3 = (1, "", "", 1.2) # E \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m -tuples_type_compat.py:159:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[*tuple[str, ...], int]' [invalid-annotation] +tuples_type_compat.py:172:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[*tuple[str, ...], int]' [invalid-annotation] t4: tuple[*tuple[str, ...], int] = (1,) # OK \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m -tuples_type_compat.py:159:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] +tuples_type_compat.py:172:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] t4: tuple[*tuple[str, ...], int] = (1,) # OK \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -tuples_type_compat.py:160:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t4 does not match type of assignment [annotation-type-mismatch] +tuples_type_compat.py:173:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t4 does not match type of assignment [annotation-type-mismatch] t4 = ("", 1) # OK \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m -tuples_type_compat.py:161:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t4 does not match type of assignment [annotation-type-mismatch] +tuples_type_compat.py:174:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t4 does not match type of assignment [annotation-type-mismatch] t4 = ("", "", 1) # OK \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m -tuples_type_compat.py:162:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t4 does not match type of assignment [annotation-type-mismatch] +tuples_type_compat.py:175:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t4 does not match type of assignment [annotation-type-mismatch] t4 = (1, "", 1) # E \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m -tuples_type_compat.py:163:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t4 does not match type of assignment [annotation-type-mismatch] +tuples_type_compat.py:176:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t4 does not match type of assignment [annotation-type-mismatch] t4 = ("", "", 1.2) # E \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m -tuples_type_compat.py:167:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Type annotation for t1 does not match type of assignment [annotation-type-mismatch] +tuples_type_compat.py:180:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Type annotation for t1 does not match type of assignment [annotation-type-mismatch] t1: tuple[str, str, *tuple[int, ...]] = a # OK \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m -tuples_type_compat.py:167:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Invalid type annotation 'tuple[str, str, *tuple[int, ...]]' [invalid-annotation] +tuples_type_compat.py:180:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Invalid type annotation 'tuple[str, str, *tuple[int, ...]]' [invalid-annotation] t1: tuple[str, str, *tuple[int, ...]] = a # OK \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m -tuples_type_compat.py:168:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Type annotation for t2 does not match type of assignment [annotation-type-mismatch] +tuples_type_compat.py:181:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Type annotation for t2 does not match type of assignment [annotation-type-mismatch] t2: tuple[str, str, *tuple[int]] = a # E \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m -tuples_type_compat.py:168:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Invalid type annotation 'tuple[str, str, *tuple[int]]' [invalid-annotation] +tuples_type_compat.py:181:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Invalid type annotation 'tuple[str, str, *tuple[int]]' [invalid-annotation] t2: tuple[str, str, *tuple[int]] = a # E \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m -tuples_type_compat.py:169:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Type annotation for t3 does not match type of assignment [annotation-type-mismatch] +tuples_type_compat.py:182:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Type annotation for t3 does not match type of assignment [annotation-type-mismatch] t3: tuple[str, *tuple[str, ...]] = a # OK \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m -tuples_type_compat.py:169:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Invalid type annotation 'tuple[str, *tuple[str, ...]]' [invalid-annotation] +tuples_type_compat.py:182:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Invalid type annotation 'tuple[str, *tuple[str, ...]]' [invalid-annotation] t3: tuple[str, *tuple[str, ...]] = a # OK \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m -tuples_type_compat.py:170:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Type annotation for t4 does not match type of assignment [annotation-type-mismatch] +tuples_type_compat.py:183:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Type annotation for t4 does not match type of assignment [annotation-type-mismatch] t4: tuple[str, str, *tuple[str, ...]] = a # OK \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m -tuples_type_compat.py:170:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Invalid type annotation 'tuple[str, str, *tuple[str, ...]]' [invalid-annotation] +tuples_type_compat.py:183:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Invalid type annotation 'tuple[str, str, *tuple[str, ...]]' [invalid-annotation] t4: tuple[str, str, *tuple[str, ...]] = a # OK \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m -tuples_type_compat.py:171:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Type annotation for t5 does not match type of assignment [annotation-type-mismatch] +tuples_type_compat.py:184:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Type annotation for t5 does not match type of assignment [annotation-type-mismatch] t5: tuple[str, str, str, *tuple[str, ...]] = a # E \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m -tuples_type_compat.py:171:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Invalid type annotation 'tuple[str, str, str, *tuple[str, ...]]' [invalid-annotation] +tuples_type_compat.py:184:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Invalid type annotation 'tuple[str, str, str, *tuple[str, ...]]' [invalid-annotation] t5: tuple[str, str, str, *tuple[str, ...]] = a # E \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m -tuples_type_compat.py:172:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Type annotation for t6 does not match type of assignment [annotation-type-mismatch] +tuples_type_compat.py:185:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Type annotation for t6 does not match type of assignment [annotation-type-mismatch] t6: tuple[str, *tuple[int, ...], str] = a # OK \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m -tuples_type_compat.py:172:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Invalid type annotation 'tuple[str, *tuple[int, ...], str]' [invalid-annotation] +tuples_type_compat.py:185:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Invalid type annotation 'tuple[str, *tuple[int, ...], str]' [invalid-annotation] t6: tuple[str, *tuple[int, ...], str] = a # OK \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m -tuples_type_compat.py:173:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Type annotation for t7 does not match type of assignment [annotation-type-mismatch] +tuples_type_compat.py:186:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Type annotation for t7 does not match type of assignment [annotation-type-mismatch] t7: tuple[*tuple[str, ...], str] = a # OK \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m -tuples_type_compat.py:173:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Invalid type annotation 'tuple[*tuple[str, ...], str]' [invalid-annotation] +tuples_type_compat.py:186:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Invalid type annotation 'tuple[*tuple[str, ...], str]' [invalid-annotation] t7: tuple[*tuple[str, ...], str] = a # OK \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m -tuples_type_compat.py:174:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Type annotation for t8 does not match type of assignment [annotation-type-mismatch] +tuples_type_compat.py:187:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Type annotation for t8 does not match type of assignment [annotation-type-mismatch] t8: tuple[*tuple[str, ...], str] = a # OK \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m -tuples_type_compat.py:174:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Invalid type annotation 'tuple[*tuple[str, ...], str]' [invalid-annotation] +tuples_type_compat.py:187:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Invalid type annotation 'tuple[*tuple[str, ...], str]' [invalid-annotation] t8: tuple[*tuple[str, ...], str] = a # OK \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m -tuples_type_compat.py:175:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Type annotation for t9 does not match type of assignment [annotation-type-mismatch] +tuples_type_compat.py:188:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Type annotation for t9 does not match type of assignment [annotation-type-mismatch] t9: tuple[*tuple[str, ...], str, str, str] = a # E \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m -tuples_type_compat.py:175:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Invalid type annotation 'tuple[*tuple[str, ...], str, str, str]' [invalid-annotation] +tuples_type_compat.py:188:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Invalid type annotation 'tuple[*tuple[str, ...], str, str, str]' [invalid-annotation] t9: tuple[*tuple[str, ...], str, str, str] = a # E \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m @@ -288,33 +288,31 @@ Line 32: Expected 1 errors Line 33: Expected 1 errors Line 43: Expected 1 errors Line 62: Expected 1 errors +Lines 101, 102: Expected error (tag 'func6_1') +Lines 106, 107: Expected error (tag 'func6_2') +Lines 111, 112: Expected error (tag 'func6_3') Line 22: Unexpected errors ["tuples_type_compat.py:22:31: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] Line 27: Unexpected errors ["tuples_type_compat.py:27:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func2: Invalid type annotation 'tuple[int, *tuple[int, ...]]' [invalid-annotation]"] Line 47: Unexpected errors ["tuples_type_compat.py:47:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func3: Invalid type annotation 'tuple[int, *tuple[str, ...]]' [invalid-annotation]"] -Line 71: Unexpected errors ["tuples_type_compat.py:71:47: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] -Line 74: Unexpected errors ['tuples_type_compat.py:74:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func5: tuple [assert-type]'] -Line 78: Unexpected errors ['tuples_type_compat.py:78:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func5: tuple [assert-type]'] -Line 82: Unexpected errors ['tuples_type_compat.py:82:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func5: tuple [assert-type]'] -Line 91: Unexpected errors ["tuples_type_compat.py:91:47: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] -Line 115: Unexpected errors ['tuples_type_compat.py:115:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func7: tuple[Union[int, str], Union[int, str]] [assert-type]'] -Line 117: Unexpected errors ['tuples_type_compat.py:117:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func7: tuple[Union[int, str], Union[int, str]] [assert-type]'] -Line 134: Unexpected errors ["tuples_type_compat.py:134:40: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] -Line 139: Unexpected errors ['tuples_type_compat.py:139:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func8: Sequence [assert-type]'] -Line 140: Unexpected errors ['tuples_type_compat.py:140:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func8: Sequence [assert-type]'] -Line 143: Unexpected errors ['tuples_type_compat.py:143:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for t1 does not match type of assignment [annotation-type-mismatch]', "tuples_type_compat.py:143:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'tuple[int, *tuple[str]]' [invalid-annotation]", "tuples_type_compat.py:143:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] -Line 146: Unexpected errors ["tuples_type_compat.py:146:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'tuple[int, *tuple[str, ...]]' [invalid-annotation]", "tuples_type_compat.py:146:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] -Line 147: Unexpected errors ['tuples_type_compat.py:147:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for t2 does not match type of assignment [annotation-type-mismatch]'] -Line 148: Unexpected errors ['tuples_type_compat.py:148:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for t2 does not match type of assignment [annotation-type-mismatch]'] -Line 153: Unexpected errors ['tuples_type_compat.py:153:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for t3 does not match type of assignment [annotation-type-mismatch]', "tuples_type_compat.py:153:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'tuple[int, *tuple[str, ...], int]' [invalid-annotation]", "tuples_type_compat.py:153:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] -Line 154: Unexpected errors ['tuples_type_compat.py:154:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for t3 does not match type of assignment [annotation-type-mismatch]'] -Line 155: Unexpected errors ['tuples_type_compat.py:155:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for t3 does not match type of assignment [annotation-type-mismatch]'] -Line 159: Unexpected errors ["tuples_type_compat.py:159:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'tuple[*tuple[str, ...], int]' [invalid-annotation]", "tuples_type_compat.py:159:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] -Line 160: Unexpected errors ['tuples_type_compat.py:160:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for t4 does not match type of assignment [annotation-type-mismatch]'] -Line 161: Unexpected errors ['tuples_type_compat.py:161:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for t4 does not match type of assignment [annotation-type-mismatch]'] -Line 167: Unexpected errors ['tuples_type_compat.py:167:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func9: Type annotation for t1 does not match type of assignment [annotation-type-mismatch]', "tuples_type_compat.py:167:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func9: Invalid type annotation 'tuple[str, str, *tuple[int, ...]]' [invalid-annotation]"] -Line 169: Unexpected errors ['tuples_type_compat.py:169:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func9: Type annotation for t3 does not match type of assignment [annotation-type-mismatch]', "tuples_type_compat.py:169:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func9: Invalid type annotation 'tuple[str, *tuple[str, ...]]' [invalid-annotation]"] -Line 170: Unexpected errors ['tuples_type_compat.py:170:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func9: Type annotation for t4 does not match type of assignment [annotation-type-mismatch]', "tuples_type_compat.py:170:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func9: Invalid type annotation 'tuple[str, str, *tuple[str, ...]]' [invalid-annotation]"] -Line 172: Unexpected errors ['tuples_type_compat.py:172:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func9: Type annotation for t6 does not match type of assignment [annotation-type-mismatch]', "tuples_type_compat.py:172:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func9: Invalid type annotation 'tuple[str, *tuple[int, ...], str]' [invalid-annotation]"] -Line 173: Unexpected errors ['tuples_type_compat.py:173:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func9: Type annotation for t7 does not match type of assignment [annotation-type-mismatch]', "tuples_type_compat.py:173:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func9: Invalid type annotation 'tuple[*tuple[str, ...], str]' [invalid-annotation]"] -Line 174: Unexpected errors ['tuples_type_compat.py:174:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func9: Type annotation for t8 does not match type of assignment [annotation-type-mismatch]', "tuples_type_compat.py:174:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func9: Invalid type annotation 'tuple[*tuple[str, ...], str]' [invalid-annotation]"] +Line 70: Unexpected errors ["tuples_type_compat.py:70:56: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 94: Unexpected errors ["tuples_type_compat.py:94:56: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 147: Unexpected errors ["tuples_type_compat.py:147:40: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 152: Unexpected errors ['tuples_type_compat.py:152:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func8: Sequence [assert-type]'] +Line 153: Unexpected errors ['tuples_type_compat.py:153:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func8: Sequence [assert-type]'] +Line 156: Unexpected errors ['tuples_type_compat.py:156:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for t1 does not match type of assignment [annotation-type-mismatch]', "tuples_type_compat.py:156:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'tuple[int, *tuple[str]]' [invalid-annotation]", "tuples_type_compat.py:156:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 159: Unexpected errors ["tuples_type_compat.py:159:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'tuple[int, *tuple[str, ...]]' [invalid-annotation]", "tuples_type_compat.py:159:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 160: Unexpected errors ['tuples_type_compat.py:160:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for t2 does not match type of assignment [annotation-type-mismatch]'] +Line 161: Unexpected errors ['tuples_type_compat.py:161:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for t2 does not match type of assignment [annotation-type-mismatch]'] +Line 166: Unexpected errors ['tuples_type_compat.py:166:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for t3 does not match type of assignment [annotation-type-mismatch]', "tuples_type_compat.py:166:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'tuple[int, *tuple[str, ...], int]' [invalid-annotation]", "tuples_type_compat.py:166:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 167: Unexpected errors ['tuples_type_compat.py:167:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for t3 does not match type of assignment [annotation-type-mismatch]'] +Line 168: Unexpected errors ['tuples_type_compat.py:168:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for t3 does not match type of assignment [annotation-type-mismatch]'] +Line 172: Unexpected errors ["tuples_type_compat.py:172:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'tuple[*tuple[str, ...], int]' [invalid-annotation]", "tuples_type_compat.py:172:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 173: Unexpected errors ['tuples_type_compat.py:173:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for t4 does not match type of assignment [annotation-type-mismatch]'] +Line 174: Unexpected errors ['tuples_type_compat.py:174:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for t4 does not match type of assignment [annotation-type-mismatch]'] +Line 180: Unexpected errors ['tuples_type_compat.py:180:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func9: Type annotation for t1 does not match type of assignment [annotation-type-mismatch]', "tuples_type_compat.py:180:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func9: Invalid type annotation 'tuple[str, str, *tuple[int, ...]]' [invalid-annotation]"] +Line 182: Unexpected errors ['tuples_type_compat.py:182:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func9: Type annotation for t3 does not match type of assignment [annotation-type-mismatch]', "tuples_type_compat.py:182:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func9: Invalid type annotation 'tuple[str, *tuple[str, ...]]' [invalid-annotation]"] +Line 183: Unexpected errors ['tuples_type_compat.py:183:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func9: Type annotation for t4 does not match type of assignment [annotation-type-mismatch]', "tuples_type_compat.py:183:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func9: Invalid type annotation 'tuple[str, str, *tuple[str, ...]]' [invalid-annotation]"] +Line 185: Unexpected errors ['tuples_type_compat.py:185:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func9: Type annotation for t6 does not match type of assignment [annotation-type-mismatch]', "tuples_type_compat.py:185:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func9: Invalid type annotation 'tuple[str, *tuple[int, ...], str]' [invalid-annotation]"] +Line 186: Unexpected errors ['tuples_type_compat.py:186:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func9: Type annotation for t7 does not match type of assignment [annotation-type-mismatch]', "tuples_type_compat.py:186:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func9: Invalid type annotation 'tuple[*tuple[str, ...], str]' [invalid-annotation]"] +Line 187: Unexpected errors ['tuples_type_compat.py:187:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func9: Type annotation for t8 does not match type of assignment [annotation-type-mismatch]', "tuples_type_compat.py:187:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func9: Invalid type annotation 'tuple[*tuple[str, ...], str]' [invalid-annotation]"] """ diff --git a/conformance/results/pytype/version.toml b/conformance/results/pytype/version.toml index 57c8a1ffa..3a84f443c 100644 --- a/conformance/results/pytype/version.toml +++ b/conformance/results/pytype/version.toml @@ -1,2 +1,2 @@ version = "pytype 2024.10.11" -test_duration = 35.2 +test_duration = 31.3 diff --git a/conformance/results/results.html b/conformance/results/results.html index 855005632..dc93d81fd 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -159,16 +159,16 @@

    Python Type System Conformance Test Results

     
    mypy 1.15.0
    -
    2.1sec
    -
    pyright 1.1.398
    2.3sec
    pyright 1.1.399
    +
    1.4sec
    +
    pyre 0.9.23
    -
    3.9sec
    +
    8.2sec
    pytype 2024.10.11
    -
    43.3sec
    +
    35.2sec
    @@ -445,10 +445,10 @@

    Python Type System Conformance Test Results

    Class type compatibility
         classes_classvar
    Partial

    Internal error if TypeVarTuple is used in ClassVar.

    Does not reject use of ParamSpec in ClassVar.

    Rejects ClassVar nested in Annotated.

    Does not reject use of ClassVar in TypeAlias definition.

    Does not infer type of ClassVar from assignment if no type is provided.

    Partial

    Internal error if TypeVarTuple is used in ClassVar.

    Does not reject use of ParamSpec in ClassVar.

    Rejects ClassVar nested in Annotated.

    Does not reject use of ClassVar in TypeAlias definition.

    Pass
    Partial

    Does not reject use of TypeVar in ClassVar.

    Does not reject use of ParamSpec in ClassVar.

    Does not reject use of ClassVar as a generic type argument.

    Does not reject use of ClassVar in parameter type annotation.

    Does not reject use of ClassVar in local variable annotation.

    Does not reject use of ClassVar in instance variable annotation.

    Does not reject use of ClassVar in return type annotation.

    Does not reject use of ClassVar in type alias definition.

    Does not infer type from initialization for bare ClassVar.

    Partial

    Does not reject use of TypeVar in ClassVar.

    Does not reject use of ParamSpec in ClassVar.

    Does not reject use of ClassVar as a generic type argument.

    Rejects initialization of ClassVar if no type argument is provided.

    Does not reject use of ClassVar in parameter type annotation.

    Does not reject use of ClassVar in local variable annotation.

    Does not reject use of ClassVar in instance variable annotation.

    Does not reject use of ClassVar in return type annotation.

    Does not reject use of ClassVar in type alias definition.

    Does not reject assignment of ClassVar through instance of class.

    Partial

    Does not reject use of TypeVar in ClassVar.

    Does not reject use of ParamSpec in ClassVar.

    Does not reject use of ClassVar as a generic type argument.

    Rejects initialization of ClassVar if no type argument is provided.

    Does not infer ClassVar with no type argument and no assigned value as Any.

    Does not reject use of ClassVar in parameter type annotation.

    Does not reject use of ClassVar in local variable annotation.

    Does not reject use of ClassVar in instance variable annotation.

    Does not reject use of ClassVar in return type annotation.

    Does not reject use of ClassVar in type alias definition.

    Does not reject assignment of ClassVar through instance of class.

         classes_override
    Partial

    Does not handle case where parent class derives from Any.

    - - + @@ -491,7 +491,7 @@

    Python Type System Conformance Test Results

    - + diff --git a/conformance/tests/aliases_typealiastype.py b/conformance/tests/aliases_typealiastype.py index 644809d1f..d696bfdec 100644 --- a/conformance/tests/aliases_typealiastype.py +++ b/conformance/tests/aliases_typealiastype.py @@ -16,10 +16,10 @@ GoodAlias1 = TypeAliasType("GoodAlias1", int) GoodAlias2 = TypeAliasType("GoodAlias2", list[T], type_params=(T,)) GoodAlias3 = TypeAliasType("GoodAlias3", list[T] | list[S], type_params=(S, T)) -GoodAlias4 = TypeAliasType("GoodAlias4", T | list[GoodAlias4[T]], type_params=(T,)) +GoodAlias4 = TypeAliasType("GoodAlias4", T | "list[GoodAlias4[T]]", type_params=(T,)) GoodAlias5 = TypeAliasType( "GoodAlias5", - Callable[P, TStr] | list[S] | list[GoodAlias5[S, TStr, P]] | tuple[*Ts], + Callable[P, TStr] | list[S] | list["GoodAlias5[S, TStr, P]"] | tuple[*Ts], type_params=(S, TStr, P, Ts), ) @@ -43,9 +43,9 @@ class ClassA(Generic[T]): BadAlias1 = TypeAliasType("BadAlias1", list[S], type_params=(T,)) # E: S not in scope BadAlias2 = TypeAliasType("BadAlias2", list[S]) # E: S not in scope BadAlias3 = TypeAliasType("BadAlias3", int, type_params=my_tuple) # E: not literal tuple -BadAlias4 = TypeAliasType("BadAlias4", BadAlias4) # E: circular dependency -BadAlias5 = TypeAliasType("BadAlias5", T | BadAlias5[str], type_params=(T,)) # E: circular dependency -BadAlias6 = TypeAliasType("BadAlias6", BadAlias7) # E: circular dependency +BadAlias4 = TypeAliasType("BadAlias4", "BadAlias4") # E: circular dependency +BadAlias5 = TypeAliasType("BadAlias5", T | "BadAlias5[str]", type_params=(T,)) # E: circular dependency +BadAlias6 = TypeAliasType("BadAlias6", "BadAlias7") # E: circular dependency BadAlias7 = TypeAliasType("BadAlias7", BadAlias6) # E?: circular dependency # The following are invalid type expressions for a type alias. @@ -62,3 +62,5 @@ class ClassA(Generic[T]): BadAlias18 = TypeAliasType("BadAlias18", 1) # E BadAlias19 = TypeAliasType("BadAlias19", list or set) # E BadAlias20 = TypeAliasType("BadAlias20", f"{'int'}") # E + +BadAlias21 = TypeAliasType("BadAlias21", list[BadAlias21]) # E From ed97c5bea48e217bfa3a19abf46ddb7e8bb0b021 Mon Sep 17 00:00:00 2001 From: Eric Traut Date: Tue, 20 May 2025 09:26:37 -0700 Subject: [PATCH 106/308] Removed support for the pytype type checker (#2010) Removed support for the pytype type checker. It is becoming increasingly difficult to maintain support for pytype in the conformance tests. The maintainers of pytype have indicated that they do not have plans to make their type checker compliant with the typing spec, and they've agreed that it makes sense to eliminate it from the conformance test results. --- conformance/README.md | 2 +- conformance/requirements.txt | 1 - conformance/results/mypy/version.toml | 2 +- conformance/results/pyre/version.toml | 2 +- .../results/pytype/aliases_explicit.toml | 113 ----- .../results/pytype/aliases_implicit.toml | 342 ------------- .../results/pytype/aliases_newtype.toml | 44 -- .../results/pytype/aliases_recursive.toml | 115 ----- .../pytype/aliases_type_statement.toml | 37 -- .../results/pytype/aliases_typealiastype.toml | 78 --- .../results/pytype/aliases_variance.toml | 25 - .../pytype/annotations_coroutines.toml | 7 - .../pytype/annotations_forward_refs.toml | 446 ----------------- .../pytype/annotations_generators.toml | 82 ---- .../results/pytype/annotations_methods.toml | 14 - .../results/pytype/annotations_typeexpr.toml | 381 --------------- .../results/pytype/callables_annotation.toml | 27 -- .../results/pytype/callables_kwargs.toml | 93 ---- .../results/pytype/callables_protocol.toml | 66 --- .../results/pytype/callables_subtyping.toml | 74 --- .../results/pytype/classes_classvar.toml | 135 ------ .../results/pytype/classes_override.toml | 60 --- .../pytype/constructors_call_init.toml | 90 ---- .../pytype/constructors_call_metaclass.toml | 41 -- .../results/pytype/constructors_call_new.toml | 49 -- .../pytype/constructors_call_type.toml | 54 --- .../results/pytype/constructors_callable.toml | 230 --------- .../pytype/constructors_consistency.toml | 10 - .../pytype/dataclasses_descriptors.toml | 78 --- .../results/pytype/dataclasses_final.toml | 33 -- .../results/pytype/dataclasses_frozen.toml | 16 - .../results/pytype/dataclasses_hash.toml | 12 - .../pytype/dataclasses_inheritance.toml | 13 - .../results/pytype/dataclasses_kwonly.toml | 49 -- .../results/pytype/dataclasses_order.toml | 11 - .../results/pytype/dataclasses_postinit.toml | 30 -- .../results/pytype/dataclasses_slots.toml | 36 -- .../pytype/dataclasses_transform_class.toml | 57 --- .../dataclasses_transform_converter.toml | 123 ----- .../pytype/dataclasses_transform_field.toml | 23 - .../pytype/dataclasses_transform_func.toml | 76 --- .../pytype/dataclasses_transform_meta.toml | 39 -- .../results/pytype/dataclasses_usage.toml | 61 --- .../pytype/directives_assert_type.toml | 35 -- .../results/pytype/directives_cast.toml | 20 - .../results/pytype/directives_deprecated.toml | 43 -- .../pytype/directives_no_type_check.toml | 34 -- .../pytype/directives_reveal_type.toml | 40 -- .../pytype/directives_type_checking.toml | 7 - .../pytype/directives_type_ignore.toml | 21 - .../pytype/directives_type_ignore_file1.toml | 7 - .../pytype/directives_type_ignore_file2.toml | 11 - .../pytype/directives_version_platform.toml | 25 - .../results/pytype/enums_behaviors.toml | 11 - .../results/pytype/enums_definition.toml | 14 - .../results/pytype/enums_expansion.toml | 11 - .../results/pytype/enums_member_names.toml | 7 - .../results/pytype/enums_member_values.toml | 74 --- conformance/results/pytype/enums_members.toml | 134 ------ .../pytype/exceptions_context_managers.toml | 21 - .../results/pytype/generics_base_class.toml | 52 -- .../results/pytype/generics_basic.toml | 108 ----- .../results/pytype/generics_defaults.toml | 335 ------------- .../pytype/generics_defaults_referential.toml | 217 --------- .../generics_defaults_specialization.toml | 104 ---- .../pytype/generics_paramspec_basic.toml | 17 - .../pytype/generics_paramspec_components.toml | 26 - .../pytype/generics_paramspec_semantics.toml | 19 - .../generics_paramspec_specialization.toml | 79 --- .../results/pytype/generics_scoping.toml | 96 ---- .../pytype/generics_self_advanced.toml | 91 ---- .../pytype/generics_self_attributes.toml | 15 - .../results/pytype/generics_self_basic.toml | 70 --- .../pytype/generics_self_protocols.toml | 12 - .../results/pytype/generics_self_usage.toml | 78 --- .../pytype/generics_syntax_compatibility.toml | 12 - .../pytype/generics_syntax_declarations.toml | 20 - .../generics_syntax_infer_variance.toml | 28 -- .../pytype/generics_syntax_scoping.toml | 17 - .../results/pytype/generics_type_erasure.toml | 14 - .../pytype/generics_typevartuple_args.toml | 134 ------ .../pytype/generics_typevartuple_basic.toml | 306 ------------ .../generics_typevartuple_callable.toml | 128 ----- .../pytype/generics_typevartuple_concat.toml | 155 ------ .../generics_typevartuple_overloads.toml | 72 --- .../generics_typevartuple_specialization.toml | 454 ------------------ .../pytype/generics_typevartuple_unpack.toml | 74 --- .../results/pytype/generics_upper_bound.toml | 41 -- .../results/pytype/generics_variance.toml | 55 --- .../pytype/generics_variance_inference.toml | 33 -- .../results/pytype/historical_positional.toml | 18 - .../results/pytype/literals_interactions.toml | 87 ---- .../pytype/literals_literalstring.toml | 89 ---- .../pytype/literals_parameterizations.toml | 106 ---- .../results/pytype/literals_semantics.toml | 62 --- .../pytype/namedtuples_define_class.toml | 81 ---- .../pytype/namedtuples_define_functional.toml | 72 --- .../pytype/namedtuples_type_compat.toml | 16 - .../results/pytype/namedtuples_usage.toml | 48 -- .../results/pytype/narrowing_typeguard.toml | 21 - .../results/pytype/narrowing_typeis.toml | 48 -- .../results/pytype/overloads_basic.toml | 25 - .../results/pytype/overloads_consistency.toml | 56 --- .../results/pytype/overloads_definitions.toml | 302 ------------ .../pytype/overloads_definitions_stub.toml | 17 - .../results/pytype/overloads_evaluation.toml | 173 ------- .../pytype/protocols_class_objects.toml | 33 -- .../results/pytype/protocols_definition.toml | 77 --- .../results/pytype/protocols_explicit.toml | 36 -- .../results/pytype/protocols_generic.toml | 60 --- .../results/pytype/protocols_merging.toml | 36 -- .../results/pytype/protocols_modules.toml | 24 - .../results/pytype/protocols_recursive.toml | 27 -- .../pytype/protocols_runtime_checkable.toml | 18 - .../results/pytype/protocols_self.toml | 33 -- .../results/pytype/protocols_subtyping.toml | 37 -- .../results/pytype/protocols_variance.toml | 34 -- .../results/pytype/qualifiers_annotated.toml | 78 --- .../pytype/qualifiers_final_annotation.toml | 142 ------ .../pytype/qualifiers_final_decorator.toml | 265 ---------- .../results/pytype/specialtypes_any.toml | 7 - .../results/pytype/specialtypes_never.toml | 47 -- .../results/pytype/specialtypes_none.toml | 21 - .../pytype/specialtypes_promotions.toml | 11 - .../results/pytype/specialtypes_type.toml | 83 ---- .../results/pytype/tuples_type_compat.toml | 318 ------------ .../results/pytype/tuples_type_form.toml | 71 --- .../results/pytype/tuples_unpacked.toml | 167 ------- .../results/pytype/typeddicts_alt_syntax.toml | 25 - .../pytype/typeddicts_class_syntax.toml | 26 - .../results/pytype/typeddicts_final.toml | 7 - .../pytype/typeddicts_inheritance.toml | 27 -- .../results/pytype/typeddicts_operations.toml | 45 -- .../results/pytype/typeddicts_readonly.toml | 18 - .../typeddicts_readonly_consistency.toml | 35 -- .../typeddicts_readonly_inheritance.toml | 134 ------ .../pytype/typeddicts_readonly_kwargs.toml | 23 - .../pytype/typeddicts_readonly_update.toml | 13 - .../results/pytype/typeddicts_required.toml | 16 - .../pytype/typeddicts_type_consistency.toml | 38 -- .../results/pytype/typeddicts_usage.toml | 27 -- conformance/results/pytype/version.toml | 2 - conformance/results/results.html | 188 +------- conformance/src/type_checker.py | 111 ----- 144 files changed, 27 insertions(+), 10208 deletions(-) delete mode 100644 conformance/results/pytype/aliases_explicit.toml delete mode 100644 conformance/results/pytype/aliases_implicit.toml delete mode 100644 conformance/results/pytype/aliases_newtype.toml delete mode 100644 conformance/results/pytype/aliases_recursive.toml delete mode 100644 conformance/results/pytype/aliases_type_statement.toml delete mode 100644 conformance/results/pytype/aliases_typealiastype.toml delete mode 100644 conformance/results/pytype/aliases_variance.toml delete mode 100644 conformance/results/pytype/annotations_coroutines.toml delete mode 100644 conformance/results/pytype/annotations_forward_refs.toml delete mode 100644 conformance/results/pytype/annotations_generators.toml delete mode 100644 conformance/results/pytype/annotations_methods.toml delete mode 100644 conformance/results/pytype/annotations_typeexpr.toml delete mode 100644 conformance/results/pytype/callables_annotation.toml delete mode 100644 conformance/results/pytype/callables_kwargs.toml delete mode 100644 conformance/results/pytype/callables_protocol.toml delete mode 100644 conformance/results/pytype/callables_subtyping.toml delete mode 100644 conformance/results/pytype/classes_classvar.toml delete mode 100644 conformance/results/pytype/classes_override.toml delete mode 100644 conformance/results/pytype/constructors_call_init.toml delete mode 100644 conformance/results/pytype/constructors_call_metaclass.toml delete mode 100644 conformance/results/pytype/constructors_call_new.toml delete mode 100644 conformance/results/pytype/constructors_call_type.toml delete mode 100644 conformance/results/pytype/constructors_callable.toml delete mode 100644 conformance/results/pytype/constructors_consistency.toml delete mode 100644 conformance/results/pytype/dataclasses_descriptors.toml delete mode 100644 conformance/results/pytype/dataclasses_final.toml delete mode 100644 conformance/results/pytype/dataclasses_frozen.toml delete mode 100644 conformance/results/pytype/dataclasses_hash.toml delete mode 100644 conformance/results/pytype/dataclasses_inheritance.toml delete mode 100644 conformance/results/pytype/dataclasses_kwonly.toml delete mode 100644 conformance/results/pytype/dataclasses_order.toml delete mode 100644 conformance/results/pytype/dataclasses_postinit.toml delete mode 100644 conformance/results/pytype/dataclasses_slots.toml delete mode 100644 conformance/results/pytype/dataclasses_transform_class.toml delete mode 100644 conformance/results/pytype/dataclasses_transform_converter.toml delete mode 100644 conformance/results/pytype/dataclasses_transform_field.toml delete mode 100644 conformance/results/pytype/dataclasses_transform_func.toml delete mode 100644 conformance/results/pytype/dataclasses_transform_meta.toml delete mode 100644 conformance/results/pytype/dataclasses_usage.toml delete mode 100644 conformance/results/pytype/directives_assert_type.toml delete mode 100644 conformance/results/pytype/directives_cast.toml delete mode 100644 conformance/results/pytype/directives_deprecated.toml delete mode 100644 conformance/results/pytype/directives_no_type_check.toml delete mode 100644 conformance/results/pytype/directives_reveal_type.toml delete mode 100644 conformance/results/pytype/directives_type_checking.toml delete mode 100644 conformance/results/pytype/directives_type_ignore.toml delete mode 100644 conformance/results/pytype/directives_type_ignore_file1.toml delete mode 100644 conformance/results/pytype/directives_type_ignore_file2.toml delete mode 100644 conformance/results/pytype/directives_version_platform.toml delete mode 100644 conformance/results/pytype/enums_behaviors.toml delete mode 100644 conformance/results/pytype/enums_definition.toml delete mode 100644 conformance/results/pytype/enums_expansion.toml delete mode 100644 conformance/results/pytype/enums_member_names.toml delete mode 100644 conformance/results/pytype/enums_member_values.toml delete mode 100644 conformance/results/pytype/enums_members.toml delete mode 100644 conformance/results/pytype/exceptions_context_managers.toml delete mode 100644 conformance/results/pytype/generics_base_class.toml delete mode 100644 conformance/results/pytype/generics_basic.toml delete mode 100644 conformance/results/pytype/generics_defaults.toml delete mode 100644 conformance/results/pytype/generics_defaults_referential.toml delete mode 100644 conformance/results/pytype/generics_defaults_specialization.toml delete mode 100644 conformance/results/pytype/generics_paramspec_basic.toml delete mode 100644 conformance/results/pytype/generics_paramspec_components.toml delete mode 100644 conformance/results/pytype/generics_paramspec_semantics.toml delete mode 100644 conformance/results/pytype/generics_paramspec_specialization.toml delete mode 100644 conformance/results/pytype/generics_scoping.toml delete mode 100644 conformance/results/pytype/generics_self_advanced.toml delete mode 100644 conformance/results/pytype/generics_self_attributes.toml delete mode 100644 conformance/results/pytype/generics_self_basic.toml delete mode 100644 conformance/results/pytype/generics_self_protocols.toml delete mode 100644 conformance/results/pytype/generics_self_usage.toml delete mode 100644 conformance/results/pytype/generics_syntax_compatibility.toml delete mode 100644 conformance/results/pytype/generics_syntax_declarations.toml delete mode 100644 conformance/results/pytype/generics_syntax_infer_variance.toml delete mode 100644 conformance/results/pytype/generics_syntax_scoping.toml delete mode 100644 conformance/results/pytype/generics_type_erasure.toml delete mode 100644 conformance/results/pytype/generics_typevartuple_args.toml delete mode 100644 conformance/results/pytype/generics_typevartuple_basic.toml delete mode 100644 conformance/results/pytype/generics_typevartuple_callable.toml delete mode 100644 conformance/results/pytype/generics_typevartuple_concat.toml delete mode 100644 conformance/results/pytype/generics_typevartuple_overloads.toml delete mode 100644 conformance/results/pytype/generics_typevartuple_specialization.toml delete mode 100644 conformance/results/pytype/generics_typevartuple_unpack.toml delete mode 100644 conformance/results/pytype/generics_upper_bound.toml delete mode 100644 conformance/results/pytype/generics_variance.toml delete mode 100644 conformance/results/pytype/generics_variance_inference.toml delete mode 100644 conformance/results/pytype/historical_positional.toml delete mode 100644 conformance/results/pytype/literals_interactions.toml delete mode 100644 conformance/results/pytype/literals_literalstring.toml delete mode 100644 conformance/results/pytype/literals_parameterizations.toml delete mode 100644 conformance/results/pytype/literals_semantics.toml delete mode 100644 conformance/results/pytype/namedtuples_define_class.toml delete mode 100644 conformance/results/pytype/namedtuples_define_functional.toml delete mode 100644 conformance/results/pytype/namedtuples_type_compat.toml delete mode 100644 conformance/results/pytype/namedtuples_usage.toml delete mode 100644 conformance/results/pytype/narrowing_typeguard.toml delete mode 100644 conformance/results/pytype/narrowing_typeis.toml delete mode 100644 conformance/results/pytype/overloads_basic.toml delete mode 100644 conformance/results/pytype/overloads_consistency.toml delete mode 100644 conformance/results/pytype/overloads_definitions.toml delete mode 100644 conformance/results/pytype/overloads_definitions_stub.toml delete mode 100644 conformance/results/pytype/overloads_evaluation.toml delete mode 100644 conformance/results/pytype/protocols_class_objects.toml delete mode 100644 conformance/results/pytype/protocols_definition.toml delete mode 100644 conformance/results/pytype/protocols_explicit.toml delete mode 100644 conformance/results/pytype/protocols_generic.toml delete mode 100644 conformance/results/pytype/protocols_merging.toml delete mode 100644 conformance/results/pytype/protocols_modules.toml delete mode 100644 conformance/results/pytype/protocols_recursive.toml delete mode 100644 conformance/results/pytype/protocols_runtime_checkable.toml delete mode 100644 conformance/results/pytype/protocols_self.toml delete mode 100644 conformance/results/pytype/protocols_subtyping.toml delete mode 100644 conformance/results/pytype/protocols_variance.toml delete mode 100644 conformance/results/pytype/qualifiers_annotated.toml delete mode 100644 conformance/results/pytype/qualifiers_final_annotation.toml delete mode 100644 conformance/results/pytype/qualifiers_final_decorator.toml delete mode 100644 conformance/results/pytype/specialtypes_any.toml delete mode 100644 conformance/results/pytype/specialtypes_never.toml delete mode 100644 conformance/results/pytype/specialtypes_none.toml delete mode 100644 conformance/results/pytype/specialtypes_promotions.toml delete mode 100644 conformance/results/pytype/specialtypes_type.toml delete mode 100644 conformance/results/pytype/tuples_type_compat.toml delete mode 100644 conformance/results/pytype/tuples_type_form.toml delete mode 100644 conformance/results/pytype/tuples_unpacked.toml delete mode 100644 conformance/results/pytype/typeddicts_alt_syntax.toml delete mode 100644 conformance/results/pytype/typeddicts_class_syntax.toml delete mode 100644 conformance/results/pytype/typeddicts_final.toml delete mode 100644 conformance/results/pytype/typeddicts_inheritance.toml delete mode 100644 conformance/results/pytype/typeddicts_operations.toml delete mode 100644 conformance/results/pytype/typeddicts_readonly.toml delete mode 100644 conformance/results/pytype/typeddicts_readonly_consistency.toml delete mode 100644 conformance/results/pytype/typeddicts_readonly_inheritance.toml delete mode 100644 conformance/results/pytype/typeddicts_readonly_kwargs.toml delete mode 100644 conformance/results/pytype/typeddicts_readonly_update.toml delete mode 100644 conformance/results/pytype/typeddicts_required.toml delete mode 100644 conformance/results/pytype/typeddicts_type_consistency.toml delete mode 100644 conformance/results/pytype/typeddicts_usage.toml delete mode 100644 conformance/results/pytype/version.toml diff --git a/conformance/README.md b/conformance/README.md index aa65c815d..a5a45b7e6 100644 --- a/conformance/README.md +++ b/conformance/README.md @@ -81,7 +81,7 @@ Currently, the only unsupported type checker is Pyre on Windows. Different type checkers report errors in different ways (with different wording in error messages and different line numbers or character ranges for errors). This variation makes it difficult to fully automate test validation given that tests will want to check for both false positive and false negative type errors. Some level of manual inspection will therefore be needed to determine whether a type checker is fully conformant with all tests in any given test file. This "scoring" process is required only when the output of a test changes — e.g. when a new version of that type checker is released and the tests are rerun. We assume that the output of a type checker will be the same from one run to the next unless/until a new version is released that fixes or introduces a bug. In this case, the output will need to be manually inspected and the conformance results re-scored for those tests whose output has changed. -Conformance results are reported and summarized for each supported type checker. Currently, results are reported for mypy, pyre, pyright, and pytype. It is the goal and desire to add additional type checkers over time. +Conformance results are reported and summarized for each supported type checker. Currently, results are reported for mypy, pyre, and pyright. It is the goal and desire to add additional type checkers over time. ## Adding a New Test Case diff --git a/conformance/requirements.txt b/conformance/requirements.txt index f4dafc207..973d0bf51 100644 --- a/conformance/requirements.txt +++ b/conformance/requirements.txt @@ -5,4 +5,3 @@ pyright mypy pip pyre-check; platform_system != "Windows" -pytype diff --git a/conformance/results/mypy/version.toml b/conformance/results/mypy/version.toml index b3982776b..41659210a 100644 --- a/conformance/results/mypy/version.toml +++ b/conformance/results/mypy/version.toml @@ -1,2 +1,2 @@ version = "mypy 1.15.0" -test_duration = 1.8 +test_duration = 1.5 diff --git a/conformance/results/pyre/version.toml b/conformance/results/pyre/version.toml index cd0a5eb7e..c759e78d0 100644 --- a/conformance/results/pyre/version.toml +++ b/conformance/results/pyre/version.toml @@ -1,2 +1,2 @@ version = "pyre 0.9.23" -test_duration = 9.8 +test_duration = 10.7 diff --git a/conformance/results/pytype/aliases_explicit.toml b/conformance/results/pytype/aliases_explicit.toml deleted file mode 100644 index c46571aff..000000000 --- a/conformance/results/pytype/aliases_explicit.toml +++ /dev/null @@ -1,113 +0,0 @@ -conformant = "Partial" -notes = """ -Incorrectly reports error for type alias defined with ParamSpec. -Does not report invalid specialization of generic type alias with bound TypeVar. -Incorrectly evaluates generic type alias with ParamSpec with missing type argument. -Does not report some illegal annotation forms as invalid type aliases. -Does not report invalid specialization of already-specialized generic type alias. -""" -output = """ -aliases_explicit.py:41:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '[str, str]' [invalid-annotation] - - p9: GoodTypeAlias9[[str, str], None], - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -aliases_explicit.py:41:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Callable[Concatenate[int, P], R][[str, str], None]' [invalid-annotation] - - p9: GoodTypeAlias9[[str, str], None], - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -aliases_explicit.py:57:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in good_type_aliases: Callable[Concatenate, Any] [assert-type] - - assert_type(p9, Callable[[int, str, str], None]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -aliases_explicit.py:60:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in good_type_aliases: Callable[[Any], None] [assert-type] - - assert_type(p12, Callable[..., None]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -aliases_explicit.py:67:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Optional[int][int]' [invalid-annotation] - - p1: GoodTypeAlias2[int], # E: type alias is not generic - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -aliases_explicit.py:68:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'list[Optional[int]][int]' [invalid-annotation] - - p2: GoodTypeAlias3[int], # E: type alias is already specialized - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -aliases_explicit.py:69:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'list[T][int, int]' [invalid-annotation] - - p3: GoodTypeAlias4[int, int], # E: too many type arguments - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -aliases_explicit.py:70:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Callable[[int, T], T][int, int]' [invalid-annotation] - - p4: GoodTypeAlias8[int, int], # E: too many type arguments - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -aliases_explicit.py:71:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Callable[Concatenate[int, P], R][int, int]' [invalid-annotation] - - p5: GoodTypeAlias9[int, int], # E: bad type argument for ParamSpec - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -aliases_explicit.py:80:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '[int, str]' for BadTypeAlias2 [invalid-annotation] - -BadTypeAlias2: TA = [int, str] # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - -aliases_explicit.py:81:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '((int, str),)' for BadTypeAlias3 [invalid-annotation] - -BadTypeAlias3: TA = ((int, str),) # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - -aliases_explicit.py:82:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' for BadTypeAlias4 [invalid-annotation] - -BadTypeAlias4: TA = [int for i in range(1)] # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - -aliases_explicit.py:83:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation "{'a': 'b'}" for BadTypeAlias5 [invalid-annotation] - -BadTypeAlias5: TA = {"a": "b"} # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - -aliases_explicit.py:87:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '3' for BadTypeAlias9 [invalid-annotation] - -BadTypeAlias9: TA = var1 # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - -aliases_explicit.py:88:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'True' for BadTypeAlias10 [invalid-annotation] - -BadTypeAlias10: TA = True # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -aliases_explicit.py:89:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '1' for BadTypeAlias11 [invalid-annotation] - -BadTypeAlias11: TA = 1 # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -aliases_explicit.py:91:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' for BadTypeAlias13 [invalid-annotation] - -BadTypeAlias13: TA = f"{'int'}" # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -aliases_explicit.py:102:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Union[list, set][int]' [invalid-annotation] - -x4: ListOrSetAlias[int] # E: already specialized - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 79: Expected 1 errors -Line 84: Expected 1 errors -Line 85: Expected 1 errors -Line 86: Expected 1 errors -Line 90: Expected 1 errors -Line 100: Expected 1 errors -Line 101: Expected 1 errors -Line 41: Unexpected errors ["aliases_explicit.py:41:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '[str, str]' [invalid-annotation]", "aliases_explicit.py:41:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Callable[Concatenate[int, P], R][[str, str], None]' [invalid-annotation]"] -Line 57: Unexpected errors ['aliases_explicit.py:57:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in good_type_aliases: Callable[Concatenate, Any] [assert-type]'] -Line 60: Unexpected errors ['aliases_explicit.py:60:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in good_type_aliases: Callable[[Any], None] [assert-type]'] -""" diff --git a/conformance/results/pytype/aliases_implicit.toml b/conformance/results/pytype/aliases_implicit.toml deleted file mode 100644 index 2be1cfd68..000000000 --- a/conformance/results/pytype/aliases_implicit.toml +++ /dev/null @@ -1,342 +0,0 @@ -conformant = "Partial" -notes = """ -Incorrectly reports error for type alias defined with ParamSpec. -Does not report invalid specialization of generic type alias with bound TypeVar. -Incorrectly evaluates generic type alias with ParamSpec with missing type argument. -Allows some illegal annotation forms to be interpreted as valid type aliases. -Does not report invalid specialization of already-specialized generic type alias. -""" -output = """ -aliases_implicit.py:54:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '[str, str]' [invalid-annotation] - - p9: GoodTypeAlias9[[str, str], None], - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -aliases_implicit.py:54:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Callable[Concatenate[int, P], R][[str, str], None]' [invalid-annotation] - - p9: GoodTypeAlias9[[str, str], None], - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -aliases_implicit.py:68:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in good_type_aliases: Callable[Concatenate, Any] [assert-type] - - assert_type(p9, Callable[[int, str, str], None]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -aliases_implicit.py:72:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in good_type_aliases: Callable[[Any], None] [assert-type] - - assert_type(p13, Callable[..., None]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -aliases_implicit.py:76:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Optional[int][int]' [invalid-annotation] - - p1: GoodTypeAlias2[int], # E: type alias is not generic - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -aliases_implicit.py:77:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'list[Optional[int]][int]' [invalid-annotation] - - p2: GoodTypeAlias3[int], # E: type alias is already specialized - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -aliases_implicit.py:78:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'list[T][int, int]' [invalid-annotation] - - p3: GoodTypeAlias4[int, int], # E: too many type arguments - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -aliases_implicit.py:79:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Callable[[int, T], T][int, int]' [invalid-annotation] - - p4: GoodTypeAlias8[int, int], # E: too many type arguments - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -aliases_implicit.py:80:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Callable[Concatenate[int, P], R][int, int]' [invalid-annotation] - - p5: GoodTypeAlias9[int, int], # E: bad type argument for ParamSpec - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -aliases_implicit.py:105:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '[int, str]' for p2 [invalid-annotation] - -def bad_type_aliases( -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p1: BadTypeAlias1, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p2: BadTypeAlias2, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p3: BadTypeAlias3, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p4: BadTypeAlias4, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p5: BadTypeAlias5, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p6: BadTypeAlias6, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p7: BadTypeAlias7, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p8: BadTypeAlias8, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p9: BadTypeAlias9, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p10: BadTypeAlias10, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p11: BadTypeAlias11, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p12: BadTypeAlias12, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p13: BadTypeAlias13, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p14: BadTypeAlias14, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -): -\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - pass -\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m - -aliases_implicit.py:105:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'True' for p10 [invalid-annotation] - -def bad_type_aliases( -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p1: BadTypeAlias1, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p2: BadTypeAlias2, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p3: BadTypeAlias3, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p4: BadTypeAlias4, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p5: BadTypeAlias5, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p6: BadTypeAlias6, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p7: BadTypeAlias7, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p8: BadTypeAlias8, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p9: BadTypeAlias9, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p10: BadTypeAlias10, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p11: BadTypeAlias11, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p12: BadTypeAlias12, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p13: BadTypeAlias13, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p14: BadTypeAlias14, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -): -\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - pass -\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m - -aliases_implicit.py:105:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' for p4 [invalid-annotation] - -def bad_type_aliases( -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p1: BadTypeAlias1, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p2: BadTypeAlias2, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p3: BadTypeAlias3, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p4: BadTypeAlias4, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p5: BadTypeAlias5, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p6: BadTypeAlias6, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p7: BadTypeAlias7, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p8: BadTypeAlias8, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p9: BadTypeAlias9, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p10: BadTypeAlias10, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p11: BadTypeAlias11, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p12: BadTypeAlias12, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p13: BadTypeAlias13, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p14: BadTypeAlias14, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -): -\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - pass -\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m - -aliases_implicit.py:105:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '3' for p9 [invalid-annotation] - -def bad_type_aliases( -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p1: BadTypeAlias1, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p2: BadTypeAlias2, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p3: BadTypeAlias3, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p4: BadTypeAlias4, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p5: BadTypeAlias5, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p6: BadTypeAlias6, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p7: BadTypeAlias7, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p8: BadTypeAlias8, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p9: BadTypeAlias9, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p10: BadTypeAlias10, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p11: BadTypeAlias11, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p12: BadTypeAlias12, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p13: BadTypeAlias13, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p14: BadTypeAlias14, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -): -\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - pass -\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m - -aliases_implicit.py:105:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '1' for p11 [invalid-annotation] - -def bad_type_aliases( -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p1: BadTypeAlias1, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p2: BadTypeAlias2, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p3: BadTypeAlias3, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p4: BadTypeAlias4, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p5: BadTypeAlias5, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p6: BadTypeAlias6, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p7: BadTypeAlias7, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p8: BadTypeAlias8, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p9: BadTypeAlias9, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p10: BadTypeAlias10, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p11: BadTypeAlias11, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p12: BadTypeAlias12, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p13: BadTypeAlias13, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p14: BadTypeAlias14, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -): -\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - pass -\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m - -aliases_implicit.py:105:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '((int, str),)' for p3 [invalid-annotation] - -def bad_type_aliases( -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p1: BadTypeAlias1, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p2: BadTypeAlias2, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p3: BadTypeAlias3, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p4: BadTypeAlias4, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p5: BadTypeAlias5, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p6: BadTypeAlias6, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p7: BadTypeAlias7, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p8: BadTypeAlias8, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p9: BadTypeAlias9, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p10: BadTypeAlias10, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p11: BadTypeAlias11, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p12: BadTypeAlias12, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p13: BadTypeAlias13, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p14: BadTypeAlias14, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -): -\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - pass -\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m - -aliases_implicit.py:105:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation "{'a': 'b'}" for p5 [invalid-annotation] - -def bad_type_aliases( -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p1: BadTypeAlias1, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p2: BadTypeAlias2, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p3: BadTypeAlias3, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p4: BadTypeAlias4, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p5: BadTypeAlias5, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p6: BadTypeAlias6, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p7: BadTypeAlias7, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p8: BadTypeAlias8, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p9: BadTypeAlias9, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p10: BadTypeAlias10, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p11: BadTypeAlias11, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p12: BadTypeAlias12, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p13: BadTypeAlias13, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p14: BadTypeAlias14, # E: Invalid type annotation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -): -\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - pass -\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m - -aliases_implicit.py:135:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Union[list, set][int]' [invalid-annotation] - -x4: ListOrSetAlias[int] # E: already specialized - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 81: Expected 1 errors -Line 106: Expected 1 errors -Line 107: Expected 1 errors -Line 108: Expected 1 errors -Line 109: Expected 1 errors -Line 110: Expected 1 errors -Line 111: Expected 1 errors -Line 112: Expected 1 errors -Line 113: Expected 1 errors -Line 114: Expected 1 errors -Line 115: Expected 1 errors -Line 116: Expected 1 errors -Line 117: Expected 1 errors -Line 118: Expected 1 errors -Line 119: Expected 1 errors -Line 133: Expected 1 errors -Line 54: Unexpected errors ["aliases_implicit.py:54:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '[str, str]' [invalid-annotation]", "aliases_implicit.py:54:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Callable[Concatenate[int, P], R][[str, str], None]' [invalid-annotation]"] -Line 68: Unexpected errors ['aliases_implicit.py:68:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in good_type_aliases: Callable[Concatenate, Any] [assert-type]'] -Line 72: Unexpected errors ['aliases_implicit.py:72:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in good_type_aliases: Callable[[Any], None] [assert-type]'] -Line 105: Unexpected errors ["aliases_implicit.py:105:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '[int, str]' for p2 [invalid-annotation]", "aliases_implicit.py:105:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'True' for p10 [invalid-annotation]", "aliases_implicit.py:105:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' for p4 [invalid-annotation]", "aliases_implicit.py:105:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '3' for p9 [invalid-annotation]", "aliases_implicit.py:105:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '1' for p11 [invalid-annotation]", "aliases_implicit.py:105:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '((int, str),)' for p3 [invalid-annotation]", 'aliases_implicit.py:105:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation "{\\'a\\': \\'b\\'}" for p5 [invalid-annotation]'] -""" diff --git a/conformance/results/pytype/aliases_newtype.toml b/conformance/results/pytype/aliases_newtype.toml deleted file mode 100644 index 996e17771..000000000 --- a/conformance/results/pytype/aliases_newtype.toml +++ /dev/null @@ -1,44 +0,0 @@ -conformant = "Partial" -notes = """ -Does not reject use of NewType in `isinstance` call. -Does not reject use of NewType in class definition statement. -Does not report inconsistency between name of NewType and assigned identifier name. -Does not reject use of NewType with generic class with TypeVar. -Does not reject use of NewType with protocol class. -Does not reject use of NewType with TypedDict class. -Does not reject use of NewType with Any. -""" -output = """ -aliases_newtype.py:11:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function UserId.__init__ was called with the wrong arguments [wrong-arg-types] - -UserId("user") # E: incorrect type -\u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -aliases_newtype.py:12:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for u1 does not match type of assignment [annotation-type-mismatch] - -u1: UserId = 42 # E: incorrect type -\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -aliases_newtype.py:38:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class GoodNewType1 is not indexable [not-indexable] - -nt1: GoodNewType1[int] # E: NewType cannot be generic - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -aliases_newtype.py:60:15: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function typing.NewType expects 2 arg(s), got 3 [wrong-arg-count] - -BadNewType6 = NewType("BadNewType6", int, int) # E: too many arguments - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 20: Expected 1 errors -Line 23: Expected 1 errors -Line 32: Expected 1 errors -Line 44: Expected 1 errors -Line 47: Expected 1 errors -Line 49: Expected 1 errors -Line 51: Expected 1 errors -Line 58: Expected 1 errors -Line 62: Expected 1 errors -""" diff --git a/conformance/results/pytype/aliases_recursive.toml b/conformance/results/pytype/aliases_recursive.toml deleted file mode 100644 index 10e318a6b..000000000 --- a/conformance/results/pytype/aliases_recursive.toml +++ /dev/null @@ -1,115 +0,0 @@ -conformant = "Partial" -notes = """ -Does not detect type violation for some deeply-nested types. -Does not properly handle `|` for unions in some recursive type alias definitions. -Does not detect cyclical references in recursive type alias definition. -""" -output = """ -aliases_recursive.py:19:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for j4 does not match type of assignment [annotation-type-mismatch] - -j4: Json = {"a": 1, "b": 3j} # E: incompatible type -\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -aliases_recursive.py:20:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for j5 does not match type of assignment [annotation-type-mismatch] - -j5: Json = [2, 3j] # E: incompatible type -\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -aliases_recursive.py:38:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t6 does not match type of assignment [annotation-type-mismatch] - -t6: RecursiveTuple = (1, ("1", 1), (1, (1, [2]))) # E -\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -aliases_recursive.py:39:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t6 does not match type of assignment [annotation-type-mismatch] - -t6: RecursiveTuple = (1, [1]) # E -\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -aliases_recursive.py:50:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for m7 does not match type of assignment [annotation-type-mismatch] - -m7: RecursiveMapping = {"1": [1]} # E -\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -aliases_recursive.py:51:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for m8 does not match type of assignment [annotation-type-mismatch] - -m8: RecursiveMapping = {"1": "1", "2": 1, "3": [1, 2]} # E -\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -aliases_recursive.py:58:26: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : unsupported operand type(s) for |: ''GenericTypeAlias1[T1]': str' and 'T1: TypeVar' [unsupported-operands] - -GenericTypeAlias1 = list["GenericTypeAlias1[T1]" | T1] - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -aliases_recursive.py:59:25: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'list[str]' [invalid-annotation] - -SpecializedTypeAlias1 = GenericTypeAlias1[str] - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -aliases_recursive.py:62:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'list[str]' [invalid-annotation] - -g2: GenericTypeAlias1[str] = ["hi", "bye", [""], [["hi"]]] # OK - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -aliases_recursive.py:62:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'GenericTypeAlias1[str]' [invalid-annotation] - -g2: GenericTypeAlias1[str] = ["hi", "bye", [""], [["hi"]]] # OK -\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -aliases_recursive.py:63:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'list[str]' [invalid-annotation] - -g3: GenericTypeAlias1[str] = ["hi", [2.4]] # E - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -aliases_recursive.py:63:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'GenericTypeAlias1[str]' [invalid-annotation] - -g3: GenericTypeAlias1[str] = ["hi", [2.4]] # E -\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -aliases_recursive.py:65:26: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : unsupported operand type(s) for |: ''GenericTypeAlias2[T1, T2]': str' and 'T1: TypeVar' [unsupported-operands] - -GenericTypeAlias2 = list["GenericTypeAlias2[T1, T2]" | T1 | T2] - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -aliases_recursive.py:67:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'list[str, int]' [invalid-annotation] - -g4: GenericTypeAlias2[str, int] = [[3, ["hi"]], "hi"] # OK - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -aliases_recursive.py:67:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'GenericTypeAlias2[str, int]' [invalid-annotation] - -g4: GenericTypeAlias2[str, int] = [[3, ["hi"]], "hi"] # OK -\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -aliases_recursive.py:68:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'list[str, float]' [invalid-annotation] - -g5: GenericTypeAlias2[str, float] = [[3, ["hi", 3.4, [3.4]]], "hi"] # OK - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -aliases_recursive.py:68:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'GenericTypeAlias2[str, float]' [invalid-annotation] - -g5: GenericTypeAlias2[str, float] = [[3, ["hi", 3.4, [3.4]]], "hi"] # OK -\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -aliases_recursive.py:69:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'list[str, int]' [invalid-annotation] - -g6: GenericTypeAlias2[str, int] = [[3, ["hi", 3, [3.4]]], "hi"] # E - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -aliases_recursive.py:69:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'GenericTypeAlias2[str, int]' [invalid-annotation] - -g6: GenericTypeAlias2[str, int] = [[3, ["hi", 3, [3.4]]], "hi"] # E -\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 52: Expected 1 errors -Line 72: Expected 1 errors -Line 75: Expected 1 errors -Line 58: Unexpected errors ["aliases_recursive.py:58:26: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : unsupported operand type(s) for |: ''GenericTypeAlias1[T1]': str' and 'T1: TypeVar' [unsupported-operands]"] -Line 59: Unexpected errors ["aliases_recursive.py:59:25: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'list[str]' [invalid-annotation]"] -Line 62: Unexpected errors ["aliases_recursive.py:62:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'list[str]' [invalid-annotation]", "aliases_recursive.py:62:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'GenericTypeAlias1[str]' [invalid-annotation]"] -Line 65: Unexpected errors ["aliases_recursive.py:65:26: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : unsupported operand type(s) for |: ''GenericTypeAlias2[T1, T2]': str' and 'T1: TypeVar' [unsupported-operands]"] -Line 67: Unexpected errors ["aliases_recursive.py:67:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'list[str, int]' [invalid-annotation]", "aliases_recursive.py:67:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'GenericTypeAlias2[str, int]' [invalid-annotation]"] -Line 68: Unexpected errors ["aliases_recursive.py:68:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'list[str, float]' [invalid-annotation]", "aliases_recursive.py:68:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'GenericTypeAlias2[str, float]' [invalid-annotation]"] -""" diff --git a/conformance/results/pytype/aliases_type_statement.toml b/conformance/results/pytype/aliases_type_statement.toml deleted file mode 100644 index 84f4bc313..000000000 --- a/conformance/results/pytype/aliases_type_statement.toml +++ /dev/null @@ -1,37 +0,0 @@ -conformant = "Unsupported" -notes = """ -Does not support `type` statement. -""" -output = """ -SyntaxError: Type statement is only supported in Python 3.12 and greater (, line 8) -""" -conformance_automated = "Fail" -errors_diff = """ -Line 17: Expected 1 errors -Line 19: Expected 1 errors -Line 23: Expected 1 errors -Line 26: Expected 1 errors -Line 31: Expected 1 errors -Line 37: Expected 1 errors -Line 38: Expected 1 errors -Line 39: Expected 1 errors -Line 40: Expected 1 errors -Line 41: Expected 1 errors -Line 42: Expected 1 errors -Line 43: Expected 1 errors -Line 44: Expected 1 errors -Line 45: Expected 1 errors -Line 46: Expected 1 errors -Line 47: Expected 1 errors -Line 48: Expected 1 errors -Line 49: Expected 1 errors -Line 56: Expected 1 errors -Line 62: Expected 1 errors -Line 67: Expected 1 errors -Line 77: Expected 1 errors -Line 79: Expected 1 errors -Line 82: Expected 1 errors -Line 84: Expected 1 errors -Lines 51, 52: Expected error (tag 'TA14') -Lines 88, 89: Expected error (tag 'RTA6') -""" diff --git a/conformance/results/pytype/aliases_typealiastype.toml b/conformance/results/pytype/aliases_typealiastype.toml deleted file mode 100644 index da0105cf4..000000000 --- a/conformance/results/pytype/aliases_typealiastype.toml +++ /dev/null @@ -1,78 +0,0 @@ -conformant = "Unsupported" -notes = """ -Support for TypeAliasType is not implemented. -""" -output = """ -aliases_typealiastype.py:5:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet] - -from typing import Callable, Generic, ParamSpec, TypeAliasType, TypeVar, TypeVarTuple -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -aliases_typealiastype.py:11:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] - -Ts = TypeVarTuple("Ts") - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -aliases_typealiastype.py:16:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] - -GoodAlias1 = TypeAliasType("GoodAlias1", int) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -aliases_typealiastype.py:19:42: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : unsupported operand type(s) for |: 'T: TypeVar' and ''list[GoodAlias4[T]]': str' [unsupported-operands] - -GoodAlias4 = TypeAliasType("GoodAlias4", T | "list[GoodAlias4[T]]", type_params=(T,)) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -aliases_typealiastype.py:22:68: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] - - Callable[P, TStr] | list[S] | list["GoodAlias5[S, TStr, P]"] | tuple[*Ts], - \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m - -aliases_typealiastype.py:22:35: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] - - Callable[P, TStr] | list[S] | list["GoodAlias5[S, TStr, P]"] | tuple[*Ts], - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -aliases_typealiastype.py:32:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : No attribute 'other_attrib' on TypeAliasType [attribute-error] - -print(GoodAlias1.other_attrib) # E: unknown attribute - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -aliases_typealiastype.py:47:40: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : unsupported operand type(s) for |: 'T: TypeVar' and ''BadAlias5[str]': str' [unsupported-operands] - -BadAlias5 = TypeAliasType("BadAlias5", T | "BadAlias5[str]", type_params=(T,)) # E: circular dependency - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -aliases_typealiastype.py:66:47: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Name 'BadAlias21' is not defined [name-error] - -BadAlias21 = TypeAliasType("BadAlias21", list[BadAlias21]) # E - \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 40: Expected 1 errors -Line 43: Expected 1 errors -Line 44: Expected 1 errors -Line 45: Expected 1 errors -Line 46: Expected 1 errors -Line 48: Expected 1 errors -Line 52: Expected 1 errors -Line 53: Expected 1 errors -Line 54: Expected 1 errors -Line 55: Expected 1 errors -Line 56: Expected 1 errors -Line 57: Expected 1 errors -Line 58: Expected 1 errors -Line 59: Expected 1 errors -Line 60: Expected 1 errors -Line 61: Expected 1 errors -Line 62: Expected 1 errors -Line 63: Expected 1 errors -Line 64: Expected 1 errors -Line 5: Unexpected errors ['aliases_typealiastype.py:5:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet]'] -Line 11: Unexpected errors ['aliases_typealiastype.py:11:6: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] -Line 16: Unexpected errors ["aliases_typealiastype.py:16:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] -Line 19: Unexpected errors ["aliases_typealiastype.py:19:42: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : unsupported operand type(s) for |: 'T: TypeVar' and ''list[GoodAlias4[T]]': str' [unsupported-operands]"] -Line 22: Unexpected errors ["aliases_typealiastype.py:22:68: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", "aliases_typealiastype.py:22:35: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] -""" diff --git a/conformance/results/pytype/aliases_variance.toml b/conformance/results/pytype/aliases_variance.toml deleted file mode 100644 index 89093dfe8..000000000 --- a/conformance/results/pytype/aliases_variance.toml +++ /dev/null @@ -1,25 +0,0 @@ -conformant = "Unsupported" -notes = """ -Does not detect variance incompatibility. -""" -output = """ -aliases_variance.py:9:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet] - -T_co = TypeVar("T_co", covariant=True) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -aliases_variance.py:10:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "contravariant" to TypeVar not supported yet [not-supported-yet] - -T_contra = TypeVar("T_contra", contravariant=True) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 24: Expected 1 errors -Line 28: Expected 1 errors -Line 32: Expected 1 errors -Line 44: Expected 1 errors -Line 9: Unexpected errors ['aliases_variance.py:9:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] -Line 10: Unexpected errors ['aliases_variance.py:10:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "contravariant" to TypeVar not supported yet [not-supported-yet]'] -""" diff --git a/conformance/results/pytype/annotations_coroutines.toml b/conformance/results/pytype/annotations_coroutines.toml deleted file mode 100644 index a339ad0a1..000000000 --- a/conformance/results/pytype/annotations_coroutines.toml +++ /dev/null @@ -1,7 +0,0 @@ -conformant = "Pass" -output = """ - -""" -conformance_automated = "Pass" -errors_diff = """ -""" diff --git a/conformance/results/pytype/annotations_forward_refs.toml b/conformance/results/pytype/annotations_forward_refs.toml deleted file mode 100644 index c8757a0c1..000000000 --- a/conformance/results/pytype/annotations_forward_refs.toml +++ /dev/null @@ -1,446 +0,0 @@ -conformant = "Partial" -notes = """ -Does not reject some illegal type expression forms when quoted. -Incorrectly generates error for quoted type defined in class scope. -Evaluates incorrect type for class variable annotated with quoted type expression. -Does not treat triple-quoted forward reference annotation as implicitly parenthesized. -""" -output = """ -annotations_forward_refs.py:22:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Name 'ClassA' is not defined [name-error] - -bad1: ClassA # E: Runtime error: requires quotes - \u001b[1m\u001b[31m~~~~~~\u001b[39m\u001b[0m - -annotations_forward_refs.py:23:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Name 'ClassA' is not defined [name-error] - -bad2: list[ClassA] # E: Runtime error: requires quotes - \u001b[1m\u001b[31m~~~~~~\u001b[39m\u001b[0m - -annotations_forward_refs.py:24:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : unsupported operand type(s) for |: ''ClassA': str' and 'int: type[int]' [unsupported-operands] - -bad3: "ClassA" | int # E: Runtime error - \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -annotations_forward_refs.py:25:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'y' in call to function int.__or__ [missing-parameter] - -bad4: int | "ClassA" # E: Runtime error - \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -annotations_forward_refs.py:40:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '{}' for p5 [invalid-annotation] - -def invalid_annotations( -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p1: "eval(''.join(map(chr, [105, 110, 116])))", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p2: "[int, str]", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p3: "(int, str)", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p4: "[int for i in range(1)]", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p5: "{}", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p6: "(lambda : int)()", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p7: "[int][0]", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p8: "int if 1 < 3 else str", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p9: "var1", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p10: "True", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p11: "1", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p12: "-1", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p13: "int or str", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p14: 'f"int"', # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p15: "types", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -): -\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - pass -\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m - -annotations_forward_refs.py:40:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '[int, str]' for p2 [invalid-annotation] - -def invalid_annotations( -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p1: "eval(''.join(map(chr, [105, 110, 116])))", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p2: "[int, str]", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p3: "(int, str)", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p4: "[int for i in range(1)]", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p5: "{}", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p6: "(lambda : int)()", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p7: "[int][0]", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p8: "int if 1 < 3 else str", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p9: "var1", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p10: "True", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p11: "1", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p12: "-1", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p13: "int or str", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p14: 'f"int"', # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p15: "types", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -): -\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - pass -\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m - -annotations_forward_refs.py:40:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'True' for p10 [invalid-annotation] - -def invalid_annotations( -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p1: "eval(''.join(map(chr, [105, 110, 116])))", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p2: "[int, str]", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p3: "(int, str)", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p4: "[int for i in range(1)]", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p5: "{}", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p6: "(lambda : int)()", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p7: "[int][0]", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p8: "int if 1 < 3 else str", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p9: "var1", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p10: "True", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p11: "1", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p12: "-1", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p13: "int or str", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p14: 'f"int"', # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p15: "types", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -): -\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - pass -\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m - -annotations_forward_refs.py:40:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' for p15 [invalid-annotation] - -def invalid_annotations( -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p1: "eval(''.join(map(chr, [105, 110, 116])))", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p2: "[int, str]", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p3: "(int, str)", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p4: "[int for i in range(1)]", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p5: "{}", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p6: "(lambda : int)()", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p7: "[int][0]", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p8: "int if 1 < 3 else str", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p9: "var1", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p10: "True", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p11: "1", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p12: "-1", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p13: "int or str", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p14: 'f"int"', # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p15: "types", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -): -\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - pass -\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m - -annotations_forward_refs.py:40:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' for p4 [invalid-annotation] - -def invalid_annotations( -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p1: "eval(''.join(map(chr, [105, 110, 116])))", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p2: "[int, str]", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p3: "(int, str)", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p4: "[int for i in range(1)]", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p5: "{}", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p6: "(lambda : int)()", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p7: "[int][0]", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p8: "int if 1 < 3 else str", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p9: "var1", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p10: "True", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p11: "1", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p12: "-1", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p13: "int or str", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p14: 'f"int"', # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p15: "types", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -): -\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - pass -\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m - -annotations_forward_refs.py:40:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '1' for p9 [invalid-annotation] - -def invalid_annotations( -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p1: "eval(''.join(map(chr, [105, 110, 116])))", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p2: "[int, str]", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p3: "(int, str)", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p4: "[int for i in range(1)]", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p5: "{}", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p6: "(lambda : int)()", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p7: "[int][0]", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p8: "int if 1 < 3 else str", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p9: "var1", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p10: "True", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p11: "1", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p12: "-1", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p13: "int or str", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p14: 'f"int"', # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p15: "types", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -): -\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - pass -\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m - -annotations_forward_refs.py:40:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '1' for p11 [invalid-annotation] - -def invalid_annotations( -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p1: "eval(''.join(map(chr, [105, 110, 116])))", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p2: "[int, str]", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p3: "(int, str)", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p4: "[int for i in range(1)]", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p5: "{}", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p6: "(lambda : int)()", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p7: "[int][0]", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p8: "int if 1 < 3 else str", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p9: "var1", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p10: "True", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p11: "1", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p12: "-1", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p13: "int or str", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p14: 'f"int"', # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p15: "types", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -): -\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - pass -\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m - -annotations_forward_refs.py:40:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '-1' for p12 [invalid-annotation] - -def invalid_annotations( -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p1: "eval(''.join(map(chr, [105, 110, 116])))", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p2: "[int, str]", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p3: "(int, str)", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p4: "[int for i in range(1)]", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p5: "{}", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p6: "(lambda : int)()", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p7: "[int][0]", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p8: "int if 1 < 3 else str", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p9: "var1", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p10: "True", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p11: "1", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p12: "-1", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p13: "int or str", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p14: 'f"int"', # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p15: "types", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -): -\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - pass -\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m - -annotations_forward_refs.py:40:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '(int, str)' for p3 [invalid-annotation] - -def invalid_annotations( -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p1: "eval(''.join(map(chr, [105, 110, 116])))", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p2: "[int, str]", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p3: "(int, str)", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p4: "[int for i in range(1)]", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p5: "{}", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p6: "(lambda : int)()", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p7: "[int][0]", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p8: "int if 1 < 3 else str", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p9: "var1", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p10: "True", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p11: "1", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p12: "-1", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p13: "int or str", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p14: 'f"int"', # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p15: "types", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -): -\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - pass -\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m - -annotations_forward_refs.py:66:26: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassB: Name 'ClassB' is not defined [name-error] - - def method1(self) -> ClassB: # E: Runtime error - \u001b[1m\u001b[31m~~~~~~\u001b[39m\u001b[0m - -annotations_forward_refs.py:80:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassD: Name 'ClassF' is not defined [name-error] - - ClassF: "ClassF" # E: circular reference - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -annotations_forward_refs.py:82:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassD: Invalid type annotation '' for str [invalid-annotation] - - str: "str" = "" # OK - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -annotations_forward_refs.py:87:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassD: Invalid type annotation '' for x [invalid-annotation] - - x: "int" = 0 # OK - \u001b[1m\u001b[31m~\u001b[39m\u001b[0m - -annotations_forward_refs.py:89:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassD: Invalid type annotation '' for y [invalid-annotation] - - y: int = 0 # E: Refers to local int, which isn't a legal type expression - \u001b[1m\u001b[31m~\u001b[39m\u001b[0m - -annotations_forward_refs.py:96:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Any [assert-type] - -assert_type(ClassD.x, int) -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -annotations_forward_refs.py:103:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : unexpected indent [python-compiler-error] - -value: ""\" -\u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m - int | -\u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m - str | -\u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m - list[int] -\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m -""\" -\u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 41: Expected 1 errors -Line 42: Expected 1 errors -Line 43: Expected 1 errors -Line 44: Expected 1 errors -Line 45: Expected 1 errors -Line 46: Expected 1 errors -Line 47: Expected 1 errors -Line 48: Expected 1 errors -Line 49: Expected 1 errors -Line 50: Expected 1 errors -Line 51: Expected 1 errors -Line 52: Expected 1 errors -Line 53: Expected 1 errors -Line 54: Expected 1 errors -Line 55: Expected 1 errors -Line 40: Unexpected errors ["annotations_forward_refs.py:40:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '{}' for p5 [invalid-annotation]", "annotations_forward_refs.py:40:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '[int, str]' for p2 [invalid-annotation]", "annotations_forward_refs.py:40:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'True' for p10 [invalid-annotation]", "annotations_forward_refs.py:40:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' for p15 [invalid-annotation]", "annotations_forward_refs.py:40:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' for p4 [invalid-annotation]", "annotations_forward_refs.py:40:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '1' for p9 [invalid-annotation]", "annotations_forward_refs.py:40:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '1' for p11 [invalid-annotation]", "annotations_forward_refs.py:40:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '-1' for p12 [invalid-annotation]", "annotations_forward_refs.py:40:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '(int, str)' for p3 [invalid-annotation]"] -Line 82: Unexpected errors ["annotations_forward_refs.py:82:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in ClassD: Invalid type annotation '' for str [invalid-annotation]"] -Line 87: Unexpected errors ["annotations_forward_refs.py:87:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in ClassD: Invalid type annotation '' for x [invalid-annotation]"] -Line 96: Unexpected errors ['annotations_forward_refs.py:96:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Any [assert-type]'] -Line 103: Unexpected errors ['annotations_forward_refs.py:103:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : unexpected indent [python-compiler-error]'] -""" diff --git a/conformance/results/pytype/annotations_generators.toml b/conformance/results/pytype/annotations_generators.toml deleted file mode 100644 index 50bb6423c..000000000 --- a/conformance/results/pytype/annotations_generators.toml +++ /dev/null @@ -1,82 +0,0 @@ -conformant = "Partial" -notes = """ -Does not report invalid return type for generator when function implicitly returns None. -Reports invalid error when return type of generator is annotated as a compatible protocol. -Does not report type violation in `yield from` statement. -""" -output = """ -annotations_generators.py:54:16: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in generator2: bad return type [bad-return-type] - - return False # E: incompatible return type - \u001b[1m\u001b[31m~~~~~\u001b[39m\u001b[0m - -annotations_generators.py:57:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in generator2: bad return type [bad-return-type] - - yield 3 # E: incompatible yield type - \u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m - -annotations_generators.py:57:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in generator2: bad return type [bad-return-type] - - yield 3 # E: incompatible yield type - \u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m - -annotations_generators.py:66:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in generator3: bad return type [bad-return-type] - - yield 3 # E: Incompatible yield type - \u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m - -annotations_generators.py:75:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in generator5: bad return type [bad-return-type] - - yield B() # E: incompatible yield type - \u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m - -annotations_generators.py:86:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Bad return type 'int' for generator function generator8 [bad-yield-annotation] - -def generator8() -> int: # E: incompatible return type -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - yield None # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - return 0 -\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m - -annotations_generators.py:91:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Bad return type 'int' for async generator function generator9 [bad-yield-annotation] - -async def generator9() -> int: # E: incompatible return type -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - yield None # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -annotations_generators.py:100:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Bad return type 'IntIterator' for generator function generator15 [bad-yield-annotation] - -def generator15() -> IntIterator: # OK -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - yield 0 -\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m - -annotations_generators.py:109:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Bad return type 'AsyncIntIterator' for async generator function generator16 [bad-yield-annotation] - -async def generator16() -> AsyncIntIterator: # OK -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - yield 0 -\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m - -annotations_generators.py:118:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in generator18: bad return type [bad-return-type] - - yield from generator17() # E: incompatible generator type - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -annotations_generators.py:119:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in generator18: bad return type [bad-return-type] - - yield from [1] # E: incompatible generator type - \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 51: Expected 1 errors -Line 87: Expected 1 errors -Line 92: Expected 1 errors -Line 135: Expected 1 errors -Line 100: Unexpected errors ["annotations_generators.py:100:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Bad return type 'IntIterator' for generator function generator15 [bad-yield-annotation]"] -Line 109: Unexpected errors ["annotations_generators.py:109:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Bad return type 'AsyncIntIterator' for async generator function generator16 [bad-yield-annotation]"] -""" diff --git a/conformance/results/pytype/annotations_methods.toml b/conformance/results/pytype/annotations_methods.toml deleted file mode 100644 index 4a773d055..000000000 --- a/conformance/results/pytype/annotations_methods.toml +++ /dev/null @@ -1,14 +0,0 @@ -conformant = "Pass" -notes = """ -Type evaluation differs from other type checkers because of ambiguity in the spec related to method bindings. -""" -output = """ -annotations_methods.py:42:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : B [assert-type] - -assert_type(A.copy(B()), A) # E? -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Pass" -errors_diff = """ -""" diff --git a/conformance/results/pytype/annotations_typeexpr.toml b/conformance/results/pytype/annotations_typeexpr.toml deleted file mode 100644 index 322d352c5..000000000 --- a/conformance/results/pytype/annotations_typeexpr.toml +++ /dev/null @@ -1,381 +0,0 @@ -conformant = "Partial" -notes = """ -Does not reject call expressions in type annotation. -Does not reject call lambda expression in type annotation. -Does not reject list expression in type annotation. -Does not reject ternary expression in type annotation. -Does not reject f-string in type annotation. -Does not reject module in type annotation. -""" -output = """ -annotations_typeexpr.py:87:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '{}' for p5 [invalid-annotation] - -def invalid_annotations( -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p1: eval("".join(map(chr, [105, 110, 116]))), # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p2: [int, str], # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p3: (int, str), # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p4: [int for i in range(1)], # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p5: {}, # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p6: (lambda: int)(), # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p7: [int][0], # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p8: int if 1 < 3 else str, # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p9: var1, # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p10: True, # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p11: 1, # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p12: -1, # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p13: int or str, # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p14: f"int", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p15: types, # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -): -\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - pass -\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m - -annotations_typeexpr.py:87:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '[int, str]' for p2 [invalid-annotation] - -def invalid_annotations( -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p1: eval("".join(map(chr, [105, 110, 116]))), # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p2: [int, str], # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p3: (int, str), # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p4: [int for i in range(1)], # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p5: {}, # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p6: (lambda: int)(), # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p7: [int][0], # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p8: int if 1 < 3 else str, # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p9: var1, # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p10: True, # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p11: 1, # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p12: -1, # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p13: int or str, # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p14: f"int", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p15: types, # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -): -\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - pass -\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m - -annotations_typeexpr.py:87:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'True' for p10 [invalid-annotation] - -def invalid_annotations( -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p1: eval("".join(map(chr, [105, 110, 116]))), # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p2: [int, str], # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p3: (int, str), # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p4: [int for i in range(1)], # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p5: {}, # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p6: (lambda: int)(), # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p7: [int][0], # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p8: int if 1 < 3 else str, # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p9: var1, # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p10: True, # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p11: 1, # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p12: -1, # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p13: int or str, # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p14: f"int", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p15: types, # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -): -\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - pass -\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m - -annotations_typeexpr.py:87:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' for p15 [invalid-annotation] - -def invalid_annotations( -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p1: eval("".join(map(chr, [105, 110, 116]))), # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p2: [int, str], # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p3: (int, str), # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p4: [int for i in range(1)], # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p5: {}, # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p6: (lambda: int)(), # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p7: [int][0], # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p8: int if 1 < 3 else str, # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p9: var1, # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p10: True, # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p11: 1, # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p12: -1, # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p13: int or str, # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p14: f"int", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p15: types, # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -): -\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - pass -\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m - -annotations_typeexpr.py:87:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' for p4 [invalid-annotation] - -def invalid_annotations( -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p1: eval("".join(map(chr, [105, 110, 116]))), # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p2: [int, str], # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p3: (int, str), # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p4: [int for i in range(1)], # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p5: {}, # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p6: (lambda: int)(), # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p7: [int][0], # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p8: int if 1 < 3 else str, # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p9: var1, # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p10: True, # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p11: 1, # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p12: -1, # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p13: int or str, # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p14: f"int", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p15: types, # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -): -\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - pass -\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m - -annotations_typeexpr.py:87:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '3' for p9 [invalid-annotation] - -def invalid_annotations( -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p1: eval("".join(map(chr, [105, 110, 116]))), # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p2: [int, str], # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p3: (int, str), # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p4: [int for i in range(1)], # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p5: {}, # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p6: (lambda: int)(), # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p7: [int][0], # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p8: int if 1 < 3 else str, # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p9: var1, # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p10: True, # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p11: 1, # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p12: -1, # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p13: int or str, # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p14: f"int", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p15: types, # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -): -\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - pass -\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m - -annotations_typeexpr.py:87:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '1' for p11 [invalid-annotation] - -def invalid_annotations( -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p1: eval("".join(map(chr, [105, 110, 116]))), # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p2: [int, str], # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p3: (int, str), # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p4: [int for i in range(1)], # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p5: {}, # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p6: (lambda: int)(), # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p7: [int][0], # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p8: int if 1 < 3 else str, # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p9: var1, # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p10: True, # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p11: 1, # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p12: -1, # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p13: int or str, # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p14: f"int", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p15: types, # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -): -\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - pass -\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m - -annotations_typeexpr.py:87:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '-1' for p12 [invalid-annotation] - -def invalid_annotations( -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p1: eval("".join(map(chr, [105, 110, 116]))), # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p2: [int, str], # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p3: (int, str), # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p4: [int for i in range(1)], # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p5: {}, # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p6: (lambda: int)(), # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p7: [int][0], # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p8: int if 1 < 3 else str, # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p9: var1, # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p10: True, # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p11: 1, # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p12: -1, # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p13: int or str, # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p14: f"int", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p15: types, # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -): -\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - pass -\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m - -annotations_typeexpr.py:87:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '(int, str)' for p3 [invalid-annotation] - -def invalid_annotations( -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p1: eval("".join(map(chr, [105, 110, 116]))), # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p2: [int, str], # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p3: (int, str), # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p4: [int for i in range(1)], # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p5: {}, # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p6: (lambda: int)(), # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p7: [int][0], # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p8: int if 1 < 3 else str, # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p9: var1, # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p10: True, # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p11: 1, # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p12: -1, # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p13: int or str, # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p14: f"int", # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - p15: types, # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -): -\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - pass -\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 88: Expected 1 errors -Line 89: Expected 1 errors -Line 90: Expected 1 errors -Line 91: Expected 1 errors -Line 92: Expected 1 errors -Line 93: Expected 1 errors -Line 94: Expected 1 errors -Line 95: Expected 1 errors -Line 96: Expected 1 errors -Line 97: Expected 1 errors -Line 98: Expected 1 errors -Line 99: Expected 1 errors -Line 100: Expected 1 errors -Line 101: Expected 1 errors -Line 102: Expected 1 errors -Line 87: Unexpected errors ["annotations_typeexpr.py:87:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '{}' for p5 [invalid-annotation]", "annotations_typeexpr.py:87:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '[int, str]' for p2 [invalid-annotation]", "annotations_typeexpr.py:87:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'True' for p10 [invalid-annotation]", "annotations_typeexpr.py:87:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' for p15 [invalid-annotation]", "annotations_typeexpr.py:87:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' for p4 [invalid-annotation]", "annotations_typeexpr.py:87:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '3' for p9 [invalid-annotation]", "annotations_typeexpr.py:87:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '1' for p11 [invalid-annotation]", "annotations_typeexpr.py:87:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '-1' for p12 [invalid-annotation]", "annotations_typeexpr.py:87:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '(int, str)' for p3 [invalid-annotation]"] -""" diff --git a/conformance/results/pytype/callables_annotation.toml b/conformance/results/pytype/callables_annotation.toml deleted file mode 100644 index 2373cd1cc..000000000 --- a/conformance/results/pytype/callables_annotation.toml +++ /dev/null @@ -1,27 +0,0 @@ -conformant = "Partial" -notes = """ -Does not support Concatenate. -Does not treat "*args: Any, **kwargs: Any" as "...". -""" -output = """ -AttributeError: 'Concatenate' object has no attribute 'formal_type_parameters' -""" -conformance_automated = "Fail" -errors_diff = """ -Line 25: Expected 1 errors -Line 26: Expected 1 errors -Line 27: Expected 1 errors -Line 29: Expected 1 errors -Line 35: Expected 1 errors -Line 55: Expected 1 errors -Line 56: Expected 1 errors -Line 57: Expected 1 errors -Line 58: Expected 1 errors -Line 59: Expected 1 errors -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 -""" diff --git a/conformance/results/pytype/callables_kwargs.toml b/conformance/results/pytype/callables_kwargs.toml deleted file mode 100644 index 9e727daec..000000000 --- a/conformance/results/pytype/callables_kwargs.toml +++ /dev/null @@ -1,93 +0,0 @@ -conformant = "Unsupported" -notes = """ -Does not understand Unpack in the context of **kwargs annotation. -""" -output = """ -callables_kwargs.py:10:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing.Unpack not supported yet [not-supported-yet] - -from typing import Protocol, TypeVar, TypedDict, NotRequired, Required, Unpack, assert_type -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -callables_kwargs.py:24:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Unpack[TD2] [assert-type] - - assert_type(v1, int) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -callables_kwargs.py:32:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Unpack[TD2] [assert-type] - - assert_type(v2, str) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -callables_kwargs.py:35:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Unpack[TD2] [assert-type] - - assert_type(v3, str) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -callables_kwargs.py:41:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func2: dict[str, Unpack[TD1]] [assert-type] - - assert_type(kwargs, TD1) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -callables_kwargs.py:47:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func3: Function func1 was called with the wrong arguments [wrong-arg-types] - - func1(v1=1, v2="", v3="5") # OK - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -callables_kwargs.py:49:11: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func3: Missing parameter 'v2' in call to function TD2.__init__ [missing-parameter] - - td2 = TD2(v1=2, v3="4") - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -callables_kwargs.py:51:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func3: Function func1 was called with the wrong arguments [wrong-arg-types] - - func1(v1=1, v2="", v3="5", v4=5) # E: v4 is not in TD2 - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -callables_kwargs.py:52:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func3: Function func1 expects 0 arg(s), got 3 [wrong-arg-count] - - func1(1, "", "5") # E: args not passed by position - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -callables_kwargs.py:58:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func3: Function func1 was called with the wrong arguments [wrong-arg-types] - - func1(**my_dict) # E: untyped dict - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -callables_kwargs.py:61:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func3: Function func1 was called with the wrong arguments [wrong-arg-types] - - func1(**d1) # E?: OK or Type error (spec allows either) - \u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m - -callables_kwargs.py:63:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func3: Function func1 was called with the wrong arguments [wrong-arg-types] - - func1(v1=2, **td2) # E: v1 is already specified - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -callables_kwargs.py:64:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func3: Function func2 was called with the wrong arguments [wrong-arg-types] - - func2(1, **td2) # E: v1 is already specified - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -callables_kwargs.py:65:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func3: Function func2 was called with the wrong arguments [wrong-arg-types] - - func2(v1=1, **td2) # E: v1 is already specified - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 46: Expected 1 errors -Line 101: Expected 1 errors -Line 102: Expected 1 errors -Line 103: Expected 1 errors -Line 111: Expected 1 errors -Line 122: Expected 1 errors -Line 134: Expected 1 errors -Line 10: Unexpected errors ['callables_kwargs.py:10:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.Unpack not supported yet [not-supported-yet]'] -Line 24: Unexpected errors ['callables_kwargs.py:24:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: Unpack[TD2] [assert-type]'] -Line 32: Unexpected errors ['callables_kwargs.py:32:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: Unpack[TD2] [assert-type]'] -Line 35: Unexpected errors ['callables_kwargs.py:35:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: Unpack[TD2] [assert-type]'] -Line 41: Unexpected errors ['callables_kwargs.py:41:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func2: dict[str, Unpack[TD1]] [assert-type]'] -Line 47: Unexpected errors ['callables_kwargs.py:47:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func3: Function func1 was called with the wrong arguments [wrong-arg-types]'] -Line 49: Unexpected errors ["callables_kwargs.py:49:11: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func3: Missing parameter 'v2' in call to function TD2.__init__ [missing-parameter]"] -""" diff --git a/conformance/results/pytype/callables_protocol.toml b/conformance/results/pytype/callables_protocol.toml deleted file mode 100644 index 1f20354ff..000000000 --- a/conformance/results/pytype/callables_protocol.toml +++ /dev/null @@ -1,66 +0,0 @@ -conformant = "Unsupported" -notes = """ -Does not properly handle type compatibility checks with callback protocols. -""" -output = """ -callables_protocol.py:9:10: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "contravariant" to TypeVar not supported yet [not-supported-yet] - -InputT = TypeVar("InputT", contravariant=True) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -callables_protocol.py:10:11: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet] - -OutputT = TypeVar("OutputT", covariant=True) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -callables_protocol.py:121:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for cb6 does not match type of assignment [annotation-type-mismatch] - -cb6: NotProto6 = cb6_bad1 # E: NotProto6 isn't a protocol class -\u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m - -callables_protocol.py:173:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet] - -R = TypeVar("R", covariant=True) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -callables_protocol.py:188:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in decorator1: bad return type [bad-return-type] - - return converted - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -Called from (traceback): - line 191, in current file -callables_protocol.py:197:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : No attribute 'other_attribute2' on Proto9[Any, str] [attribute-error] - -print(cb9_good.other_attribute2) # E: unknown attribute - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -callables_protocol.py:199:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Proto9.__call__ was called with the wrong arguments [wrong-arg-types] - -cb9_good(x=3) -\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 35: Expected 1 errors -Line 36: Expected 1 errors -Line 37: Expected 1 errors -Line 67: Expected 1 errors -Line 68: Expected 1 errors -Line 69: Expected 1 errors -Line 70: Expected 1 errors -Line 97: Expected 1 errors -Line 169: Expected 1 errors -Line 186: Expected 1 errors -Line 187: Expected 1 errors -Line 238: Expected 1 errors -Line 260: Expected 1 errors -Line 284: Expected 1 errors -Line 311: Expected 1 errors -Line 9: Unexpected errors ['callables_protocol.py:9:10: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "contravariant" to TypeVar not supported yet [not-supported-yet]'] -Line 10: Unexpected errors ['callables_protocol.py:10:11: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] -Line 173: Unexpected errors ['callables_protocol.py:173:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] -Line 188: Unexpected errors ['callables_protocol.py:188:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in decorator1: bad return type [bad-return-type]'] -Line 199: Unexpected errors ['callables_protocol.py:199:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function Proto9.__call__ was called with the wrong arguments [wrong-arg-types]'] -""" diff --git a/conformance/results/pytype/callables_subtyping.toml b/conformance/results/pytype/callables_subtyping.toml deleted file mode 100644 index 9d940c4ab..000000000 --- a/conformance/results/pytype/callables_subtyping.toml +++ /dev/null @@ -1,74 +0,0 @@ -conformant = "Partial" -notes = """ -Does not detect many subtyping rule violations for callables. -Does not correctly handle type alias parameterized by ParamSpec. -""" -errors_diff = """ -Line 51: Expected 1 errors -Line 52: Expected 1 errors -Line 55: Expected 1 errors -Line 58: Expected 1 errors -Line 82: Expected 1 errors -Line 85: Expected 1 errors -Line 86: Expected 1 errors -Line 116: Expected 1 errors -Line 119: Expected 1 errors -Line 120: Expected 1 errors -Line 122: Expected 1 errors -Line 124: Expected 1 errors -Line 125: Expected 1 errors -Line 126: Expected 1 errors -Line 151: Expected 1 errors -Line 154: Expected 1 errors -Line 155: Expected 1 errors -Line 187: Expected 1 errors -Line 190: Expected 1 errors -Line 191: Expected 1 errors -Line 193: Expected 1 errors -Line 195: Expected 1 errors -Line 196: Expected 1 errors -Line 197: Expected 1 errors -Line 236: Expected 1 errors -Line 237: Expected 1 errors -Line 240: Expected 1 errors -Line 243: Expected 1 errors -Line 273: Expected 1 errors -Line 297: Expected 1 errors -Line 211: Unexpected errors ["callables_subtyping.py:211:40: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Callable[[P], None][P]' [invalid-annotation]"] -Line 213: Unexpected errors ["callables_subtyping.py:213:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func7: Invalid type annotation 'TypeAliasWithP[P]' [invalid-annotation]"] -Line 255: Unexpected errors ["callables_subtyping.py:255:40: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __call__: @typing.overload-decorated 'Overloaded9.__call__' object is not callable [not-callable]"] -Line 284: Unexpected errors ["callables_subtyping.py:284:44: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __call__: @typing.overload-decorated 'Overloaded10.__call__' object is not callable [not-callable]"] -""" -output = """ -callables_subtyping.py:26:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Type annotation for f6 does not match type of assignment [annotation-type-mismatch] - - f6: Callable[[float], float] = cb3 # E - \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -callables_subtyping.py:29:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Type annotation for f8 does not match type of assignment [annotation-type-mismatch] - - f8: Callable[[int], int] = cb2 # E - \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -callables_subtyping.py:211:40: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Callable[[P], None][P]' [invalid-annotation] - -def func7(proto: ProtocolWithP[P], ta: TypeAliasWithP[P]): - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -callables_subtyping.py:213:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func7: Invalid type annotation 'TypeAliasWithP[P]' [invalid-annotation] - - f1: TypeAliasWithP[P] = proto # OK - \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -callables_subtyping.py:255:40: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __call__: @typing.overload-decorated 'Overloaded9.__call__' object is not callable [not-callable] - - def __call__(self, x: str) -> str: ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m - -callables_subtyping.py:284:44: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __call__: @typing.overload-decorated 'Overloaded10.__call__' object is not callable [not-callable] - - def __call__(self, x: str) -> complex: ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" diff --git a/conformance/results/pytype/classes_classvar.toml b/conformance/results/pytype/classes_classvar.toml deleted file mode 100644 index 3c88e5ef8..000000000 --- a/conformance/results/pytype/classes_classvar.toml +++ /dev/null @@ -1,135 +0,0 @@ -conformant = "Partial" -notes = """ -Does not reject use of TypeVar in ClassVar. -Does not reject use of ParamSpec in ClassVar. -Does not reject use of ClassVar as a generic type argument. -Rejects initialization of ClassVar if no type argument is provided. -Does not infer ClassVar with no type argument and no assigned value as Any. -Does not reject use of ClassVar in parameter type annotation. -Does not reject use of ClassVar in local variable annotation. -Does not reject use of ClassVar in instance variable annotation. -Does not reject use of ClassVar in return type annotation. -Does not reject use of ClassVar in type alias definition. -Does not reject assignment of ClassVar through instance of class. -""" -output = """ -classes_classvar.py:7:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet] - -from typing import ( -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - Annotated, -\u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m - Any, -\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m - Callable, -\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - ClassVar, -\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - Final, -\u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m - Generic, -\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m - ParamSpec, -\u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m - Protocol, -\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - TypeAlias, -\u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m - TypeVar, -\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m - TypeVarTuple, -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - assert_type, -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - cast, -\u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m -) -\u001b[1m\u001b[31m~\u001b[39m\u001b[0m - -classes_classvar.py:29:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] - -Ts = TypeVarTuple("Ts") - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -classes_classvar.py:38:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassA: Invalid type annotation 'ClassVar[int, str]' [invalid-annotation] - - bad1: ClassVar[int, str] = cast(Any, 0) # E: too many arguments - \u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m - -classes_classvar.py:38:11: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassA: Invalid type annotation 'ClassVar[int, str]' [invalid-annotation] - - bad1: ClassVar[int, str] = cast(Any, 0) # E: too many arguments - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -classes_classvar.py:39:11: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassA: class ClassVar is not indexable [not-indexable] - - bad2: CV[3] = cast(Any, 0) # E: invalid type - \u001b[1m\u001b[31m~~~~~\u001b[39m\u001b[0m - -classes_classvar.py:39:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassA: Invalid type annotation 'CV[3]' [invalid-annotation] - - bad2: CV[3] = cast(Any, 0) # E: invalid type - \u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m - -classes_classvar.py:40:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassA: Name 'var' is not defined [name-error] - - bad3: CV[var] = cast(Any, 0) # E: invalid type - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m - -classes_classvar.py:40:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassA: Name 'var' is not defined [name-error] - - bad3: CV[var] = cast(Any, 0) # E: invalid type - \u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m - -classes_classvar.py:52:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassA: Type annotation for bad8 does not match type of assignment [annotation-type-mismatch] - - bad8: ClassVar[list[str]] = {} # E: type violation in initialization - \u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m - -classes_classvar.py:63:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassA: Type annotation for good4 does not match type of assignment [annotation-type-mismatch] - - good4: ClassVar = 3.1 - \u001b[1m\u001b[31m~~~~~\u001b[39m\u001b[0m - -classes_classvar.py:74:16: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method2: bad return type [bad-return-type] - - return 3 - \u001b[1m\u001b[31m~\u001b[39m\u001b[0m - -classes_classvar.py:84:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : ClassVar [assert-type] - -assert_type(ClassA.good5, Any) -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -classes_classvar.py:130:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ProtoA: Type annotation for z does not match type of assignment [annotation-type-mismatch] - - z: CV = [""] - \u001b[1m\u001b[31m~\u001b[39m\u001b[0m - -classes_classvar.py:140:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for a does not match type of assignment [annotation-type-mismatch] - -a: ProtoA = ProtoAImpl() # E: y is not a ClassVar -\u001b[1m\u001b[31m~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 45: Expected 1 errors -Line 46: Expected 1 errors -Line 47: Expected 1 errors -Line 54: Expected 1 errors -Line 55: Expected 1 errors -Line 69: Expected 1 errors -Line 70: Expected 1 errors -Line 71: Expected 1 errors -Line 73: Expected 1 errors -Line 77: Expected 1 errors -Line 78: Expected 1 errors -Line 111: Expected 1 errors -Line 7: Unexpected errors ['classes_classvar.py:7:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet]'] -Line 29: Unexpected errors ['classes_classvar.py:29:6: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] -Line 63: Unexpected errors ['classes_classvar.py:63:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in ClassA: Type annotation for good4 does not match type of assignment [annotation-type-mismatch]'] -Line 74: Unexpected errors ['classes_classvar.py:74:16: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method2: bad return type [bad-return-type]'] -Line 84: Unexpected errors ['classes_classvar.py:84:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : ClassVar [assert-type]'] -Line 130: Unexpected errors ['classes_classvar.py:130:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in ProtoA: Type annotation for z does not match type of assignment [annotation-type-mismatch]'] -""" diff --git a/conformance/results/pytype/classes_override.toml b/conformance/results/pytype/classes_override.toml deleted file mode 100644 index 1944b5612..000000000 --- a/conformance/results/pytype/classes_override.toml +++ /dev/null @@ -1,60 +0,0 @@ -conformant = "Unsupported" -notes = """ -Does not yet support the @override decorator. -""" -output = """ -classes_override.py:7:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing.override not supported yet [not-supported-yet] - -from typing import Any, Callable, overload, override -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -classes_override.py:30:16: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method2: bad return type [bad-return-type] - - return 0 - \u001b[1m\u001b[31m~\u001b[39m\u001b[0m - -classes_override.py:50:16: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method2: bad return type [bad-return-type] - - return 0 - \u001b[1m\u001b[31m~\u001b[39m\u001b[0m - -classes_override.py:53:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ChildA: Attribute 'method3' not found on any parent class [override-error] - - def method3(self) -> int: # E[method3]: no matching signature in ancestor - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - return 1 -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -classes_override.py:57:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ChildA: Attribute 'method4' not found on any parent class [override-error] - - def method4(self, x: int) -> int: - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - ... -\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m - -classes_override.py:66:16: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method4: bad return type [bad-return-type] - - return 0 - \u001b[1m\u001b[31m~\u001b[39m\u001b[0m - -classes_override.py:101:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ChildB: Attribute 'method1' not found on any parent class [override-error] - - def method1(self) -> None: # OK - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - pass -\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Lines 56, 64, 65: Expected error (tag 'method4') -Lines 78, 79: Expected error (tag 'static_method1') -Lines 83, 84: Expected error (tag 'class_method1') -Lines 88, 89: Expected error (tag 'property1') -Line 7: Unexpected errors ['classes_override.py:7:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.override not supported yet [not-supported-yet]'] -Line 30: Unexpected errors ['classes_override.py:30:16: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method2: bad return type [bad-return-type]'] -Line 50: Unexpected errors ['classes_override.py:50:16: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method2: bad return type [bad-return-type]'] -Line 57: Unexpected errors ["classes_override.py:57:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in ChildA: Attribute 'method4' not found on any parent class [override-error]"] -Line 66: Unexpected errors ['classes_override.py:66:16: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method4: bad return type [bad-return-type]'] -Line 101: Unexpected errors ["classes_override.py:101:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in ChildB: Attribute 'method1' not found on any parent class [override-error]"] -""" diff --git a/conformance/results/pytype/constructors_call_init.toml b/conformance/results/pytype/constructors_call_init.toml deleted file mode 100644 index b52f3b5b2..000000000 --- a/conformance/results/pytype/constructors_call_init.toml +++ /dev/null @@ -1,90 +0,0 @@ -conformant = "Partial" -notes = """ -Does not report errors during binding to self parameter of __init__ method. -Does not infer type of Self for self parameter of __init__ method. -Rejects valid type annotation for self parameter in __init__ method. -Does not support function-scoped TypeVars in self annotation in __init__ method. -Does not reject use of class-scoped type variables in annotation of self parameter in __init__ method. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 21: Expected 1 errors -Line 42: Expected 1 errors -Line 56: Expected 1 errors -Line 107: Expected 1 errors -Line 51: Unexpected errors ["constructors_call_init.py:51:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __init__: Invalid type annotation 'Class4[int]' for self [invalid-annotation]"] -Line 72: Unexpected errors ['constructors_call_init.py:72:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Class5 [assert-type]'] -Line 74: Unexpected errors ['constructors_call_init.py:74:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Class5 [assert-type]'] -Line 88: Unexpected errors ["constructors_call_init.py:88:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in Class6: Invalid type annotation 'V2' [invalid-annotation]", "constructors_call_init.py:88:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in Class6: Invalid type annotation 'V1' [invalid-annotation]", "constructors_call_init.py:88:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __init__: Invalid type annotation 'Class6[V1, V2]' for self [invalid-annotation]"] -Line 91: Unexpected errors ['constructors_call_init.py:91:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Class6 [assert-type]'] -Line 96: Unexpected errors ["constructors_call_init.py:96:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in Class7: Invalid type annotation 'V2' [invalid-annotation]", "constructors_call_init.py:96:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in Class7: Invalid type annotation 'V1' [invalid-annotation]", "constructors_call_init.py:96:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __init__: Invalid type annotation 'Class7[V2, V1]' for self [invalid-annotation]"] -Line 99: Unexpected errors ['constructors_call_init.py:99:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Class7 [assert-type]'] -Line 108: Unexpected errors ["constructors_call_init.py:108:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __init__: Invalid type annotation 'Class8[T2, T1]' for self [invalid-annotation]"] -""" -output = """ -constructors_call_init.py:51:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __init__: Invalid type annotation 'Class4[int]' for self [invalid-annotation] - - def __init__(self: "Class4[int]") -> None: ... -\u001b[1m\u001b[31m\u001b[39m\u001b[0m - -constructors_call_init.py:72:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Class5 [assert-type] - -assert_type(Class5(0), Class5[list[int]]) -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -constructors_call_init.py:74:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Class5 [assert-type] - -assert_type(Class5(""), Class5[set[str]]) -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -constructors_call_init.py:88:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Class6: Invalid type annotation 'V2' [invalid-annotation] - - def __init__(self: "Class6[V1, V2]", value1: V1, value2: V2) -> None: ... - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -constructors_call_init.py:88:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Class6: Invalid type annotation 'V1' [invalid-annotation] - - def __init__(self: "Class6[V1, V2]", value1: V1, value2: V2) -> None: ... - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -constructors_call_init.py:88:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __init__: Invalid type annotation 'Class6[V1, V2]' for self [invalid-annotation] - - def __init__(self: "Class6[V1, V2]", value1: V1, value2: V2) -> None: ... -\u001b[1m\u001b[31m\u001b[39m\u001b[0m - -constructors_call_init.py:91:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Class6 [assert-type] - -assert_type(Class6(0, ""), Class6[int, str]) -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -constructors_call_init.py:96:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Class7: Invalid type annotation 'V2' [invalid-annotation] - - def __init__(self: "Class7[V2, V1]", value1: V1, value2: V2) -> None: ... - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -constructors_call_init.py:96:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Class7: Invalid type annotation 'V1' [invalid-annotation] - - def __init__(self: "Class7[V2, V1]", value1: V1, value2: V2) -> None: ... - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -constructors_call_init.py:96:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __init__: Invalid type annotation 'Class7[V2, V1]' for self [invalid-annotation] - - def __init__(self: "Class7[V2, V1]", value1: V1, value2: V2) -> None: ... -\u001b[1m\u001b[31m\u001b[39m\u001b[0m - -constructors_call_init.py:99:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Class7 [assert-type] - -assert_type(Class7(0, ""), Class7[str, int]) -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -constructors_call_init.py:108:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __init__: Invalid type annotation 'Class8[T2, T1]' for self [invalid-annotation] - - pass - \u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m - -constructors_call_init.py:130:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Class11.__init__ expects 1 arg(s), got 2 [wrong-arg-count] - -Class11(1) # E -\u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m - -""" diff --git a/conformance/results/pytype/constructors_call_metaclass.toml b/conformance/results/pytype/constructors_call_metaclass.toml deleted file mode 100644 index 3fe225c40..000000000 --- a/conformance/results/pytype/constructors_call_metaclass.toml +++ /dev/null @@ -1,41 +0,0 @@ -conformant = "Unupported" -notes = """ -Does not honor metaclass __call__ method when evaluating constructor call. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 23: Unexpected errors ["constructors_call_metaclass.py:23:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Missing parameter 'x' in call to function Class1.__new__ [missing-parameter]", 'constructors_call_metaclass.py:23:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Any [assert-type]'] -Line 36: Unexpected errors ["constructors_call_metaclass.py:36:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Missing parameter 'x' in call to function Class2.__new__ [missing-parameter]", 'constructors_call_metaclass.py:36:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Any [assert-type]'] -""" -output = """ -constructors_call_metaclass.py:23:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'x' in call to function Class1.__new__ [missing-parameter] - -assert_type(Class1(), NoReturn) - \u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m - -constructors_call_metaclass.py:23:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Any [assert-type] - -assert_type(Class1(), NoReturn) -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -constructors_call_metaclass.py:36:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'x' in call to function Class2.__new__ [missing-parameter] - -assert_type(Class2(), int | Meta2) - \u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m - -constructors_call_metaclass.py:36:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Any [assert-type] - -assert_type(Class2(), int | Meta2) -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -constructors_call_metaclass.py:51:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'x' in call to function Class3.__new__ [missing-parameter] - -Class3() # E: Missing argument for 'x' parameter in __new__ -\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m - -constructors_call_metaclass.py:65:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'x' in call to function Class4.__new__ [missing-parameter] - -Class4() # E: Missing argument for 'x' parameter in __new__ -\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m - -""" diff --git a/conformance/results/pytype/constructors_call_new.toml b/conformance/results/pytype/constructors_call_new.toml deleted file mode 100644 index 970a8bbe3..000000000 --- a/conformance/results/pytype/constructors_call_new.toml +++ /dev/null @@ -1,49 +0,0 @@ -conformant = "Partial" -notes = """ -Does not honor explicit specialization of generic class when used in constructor call. -Does not support __new__ return type that is not a subclass of the class being constructed. -Does not skip evaluation of __init__ based on __new__ return type. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 21: Expected 1 errors -Line 76: Unexpected errors ['constructors_call_new.py:76:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Any [assert-type]'] -Line 89: Unexpected errors ["constructors_call_new.py:89:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Missing parameter 'x' in call to function Class6.__init__ [missing-parameter]"] -Line 113: Unexpected errors ['constructors_call_new.py:113:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __new__: bad return type [bad-return-type]'] -Line 125: Unexpected errors ['constructors_call_new.py:125:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __new__: bad return type [bad-return-type]'] -Line 140: Unexpected errors ['constructors_call_new.py:140:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __new__: bad return type [bad-return-type]'] -""" -output = """ -constructors_call_new.py:76:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Any [assert-type] - - assert_type(Class5(), NoReturn) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -constructors_call_new.py:89:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'x' in call to function Class6.__init__ [missing-parameter] - -assert_type(Class6(), int | Class6) - \u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m - -constructors_call_new.py:113:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __new__: bad return type [bad-return-type] - - def __new__(cls, *args, **kwargs) -> "Class8[list[T]]": ... -\u001b[1m\u001b[31m\u001b[39m\u001b[0m - -constructors_call_new.py:125:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __new__: bad return type [bad-return-type] - - def __new__(cls, *args, **kwargs) -> Self: ... -\u001b[1m\u001b[31m\u001b[39m\u001b[0m - -constructors_call_new.py:140:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __new__: bad return type [bad-return-type] - - def __new__(cls: "type[Class11[int]]") -> "Class11[int]": ... -\u001b[1m\u001b[31m\u001b[39m\u001b[0m - -Called from (traceback): - line 143, in current file -constructors_call_new.py:145:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Class11.__new__ was called with the wrong arguments [wrong-arg-types] - -Class11[str]() # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -""" diff --git a/conformance/results/pytype/constructors_call_type.toml b/conformance/results/pytype/constructors_call_type.toml deleted file mode 100644 index 9af05589a..000000000 --- a/conformance/results/pytype/constructors_call_type.toml +++ /dev/null @@ -1,54 +0,0 @@ -conformant = "Partial" -notes = """ -Does not validate call to custom metaclass __call__ method through type[T]. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 30: Expected 1 errors -Line 64: Expected 1 errors -Line 72: Expected 1 errors -Line 81: Expected 1 errors -Line 82: Expected 1 errors -Line 25: Unexpected errors ["constructors_call_type.py:25:16: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __new__: Missing parameter 'cls' in call to function object.__new__ [missing-parameter]", 'constructors_call_type.py:25:16: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __new__: Invalid keyword arguments (x, y) to function object.__new__ [wrong-keyword-args]'] -Line 62: Unexpected errors ["constructors_call_type.py:62:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'T' [invalid-annotation]"] -""" -output = """ -constructors_call_type.py:25:16: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __new__: Missing parameter 'cls' in call to function object.__new__ [missing-parameter] - - return super().__new__(*args, **kwargs) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -Called from (traceback): - line 30, in func1 -constructors_call_type.py:25:16: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __new__: Invalid keyword arguments (x, y) to function object.__new__ [wrong-keyword-args] - - return super().__new__(*args, **kwargs) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -Called from (traceback): - line 29, in func1 -constructors_call_type.py:40:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func2: Missing parameter 'x' in call to function Class2.__new__ [missing-parameter] - - cls() # E - \u001b[1m\u001b[31m~~~~~\u001b[39m\u001b[0m - -constructors_call_type.py:50:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func3: Missing parameter 'x' in call to function Class3.__init__ [missing-parameter] - - cls() # E - \u001b[1m\u001b[31m~~~~~\u001b[39m\u001b[0m - -constructors_call_type.py:59:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func4: Function Class4.__init__ expects 1 arg(s), got 2 [wrong-arg-count] - - cls(1) # E - \u001b[1m\u001b[31m~~~~~~\u001b[39m\u001b[0m - -constructors_call_type.py:62:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'T' [invalid-annotation] - -def func5(cls: type[T]): -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - cls() # OK -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - cls(1) # E -\u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m - -""" diff --git a/conformance/results/pytype/constructors_callable.toml b/conformance/results/pytype/constructors_callable.toml deleted file mode 100644 index 0074fa180..000000000 --- a/conformance/results/pytype/constructors_callable.toml +++ /dev/null @@ -1,230 +0,0 @@ -conformant = "Partial" -notes = """ -Does not generate a union type for __new__ and __init__ when converting class to callable. -Does not ignore __init__ based on __new__ return type when converting class to callable. -Does not support __new__ return type that is different from class being constructed. -Does not use annotated type of self in __init__ method to generate return type of callable. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 51: Expected 1 errors -Line 127: Expected 1 errors -Line 144: Expected 1 errors -Line 36: Unexpected errors ['constructors_callable.py:36:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Callable[[Any], Class1] [reveal-type]'] -Line 49: Unexpected errors ['constructors_callable.py:49:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Callable[[Any], Class2] [reveal-type]'] -Line 50: Unexpected errors ['constructors_callable.py:50:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function expects 1 arg(s), got 0 [wrong-arg-count]', 'constructors_callable.py:50:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Any [assert-type]'] -Line 57: Unexpected errors ['constructors_callable.py:57:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __new__: bad return type [bad-return-type]'] -Line 63: Unexpected errors ['constructors_callable.py:63:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Callable[[Any], Class3] [reveal-type]'] -Line 73: Unexpected errors ['constructors_callable.py:73:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __new__: bad return type [bad-return-type]'] -Line 77: Unexpected errors ['constructors_callable.py:77:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Callable[[Any], Class4] [reveal-type]'] -Line 78: Unexpected errors ['constructors_callable.py:78:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : nothing [assert-type]'] -Line 97: Unexpected errors ['constructors_callable.py:97:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Callable[[Any], Class5] [reveal-type]'] -Line 100: Unexpected errors ['constructors_callable.py:100:17: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function expects 1 arg(s), got 0 [wrong-arg-count]', 'constructors_callable.py:100:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Any [assert-type]'] -Line 105: Unexpected errors ['constructors_callable.py:105:17: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid keyword argument x to function [wrong-keyword-args]', 'constructors_callable.py:105:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Any [assert-type]'] -Line 125: Unexpected errors ['constructors_callable.py:125:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Callable[[Any], Class6] [reveal-type]'] -Line 126: Unexpected errors ['constructors_callable.py:126:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function expects 1 arg(s), got 0 [wrong-arg-count]', 'constructors_callable.py:126:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Any [assert-type]'] -Line 142: Unexpected errors ['constructors_callable.py:142:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Callable[[Any], Class6Any] [reveal-type]'] -Line 143: Unexpected errors ['constructors_callable.py:143:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function expects 1 arg(s), got 0 [wrong-arg-count]'] -Line 161: Unexpected errors ['constructors_callable.py:161:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Callable[[Any], Class7] [reveal-type]'] -Line 164: Unexpected errors ['constructors_callable.py:164:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Class7 [assert-type]'] -Line 165: Unexpected errors ['constructors_callable.py:165:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Class7 [assert-type]'] -Line 182: Unexpected errors ['constructors_callable.py:182:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Callable[[Any], Class8[nothing]] [reveal-type]'] -Line 183: Unexpected errors ['constructors_callable.py:183:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function expects 1 arg(s), got 2 [wrong-arg-count]', 'constructors_callable.py:183:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Any [assert-type]'] -Line 193: Unexpected errors ['constructors_callable.py:193:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Callable[[Any], Class9] [reveal-type]'] -Line 194: Unexpected errors ['constructors_callable.py:194:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function expects 1 arg(s), got 2 [wrong-arg-count]', 'constructors_callable.py:194:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Any [assert-type]'] -""" -output = """ -constructors_callable.py:36:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Callable[[Any], Class1] [reveal-type] - -reveal_type(r1) # `def (x: int) -> Class1` -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -constructors_callable.py:38:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function expects 1 arg(s), got 0 [wrong-arg-count] - -r1() # E -\u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m - -constructors_callable.py:39:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid keyword argument y to function [wrong-keyword-args] - -r1(y=1) # E -\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m - -constructors_callable.py:49:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Callable[[Any], Class2] [reveal-type] - -reveal_type(r2) # `def () -> Class2` -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -constructors_callable.py:50:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function expects 1 arg(s), got 0 [wrong-arg-count] - -assert_type(r2(), Class2) - \u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m - -constructors_callable.py:50:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Any [assert-type] - -assert_type(r2(), Class2) -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -constructors_callable.py:57:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __new__: bad return type [bad-return-type] - - def __new__(cls, *args, **kwargs) -> Self: ... -\u001b[1m\u001b[31m\u001b[39m\u001b[0m - -Called from (traceback): - line 64, in current file -constructors_callable.py:63:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Callable[[Any], Class3] [reveal-type] - -reveal_type(r3) # `def (x: int) -> Class3` -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -constructors_callable.py:65:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function expects 1 arg(s), got 0 [wrong-arg-count] - -r3() # E -\u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m - -constructors_callable.py:66:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid keyword argument y to function [wrong-keyword-args] - -r3(y=1) # E -\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m - -constructors_callable.py:67:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function expects 1 arg(s), got 2 [wrong-arg-count] - -r3(1, 2) # E -\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m - -constructors_callable.py:73:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __new__: bad return type [bad-return-type] - - def __new__(cls, x: int) -> int: ... -\u001b[1m\u001b[31m\u001b[39m\u001b[0m - -Called from (traceback): - line 78, in current file -constructors_callable.py:77:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Callable[[Any], Class4] [reveal-type] - -reveal_type(r4) # `def (x: int) -> int` -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -constructors_callable.py:78:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : nothing [assert-type] - -assert_type(r4(1), int) -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -constructors_callable.py:79:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function expects 1 arg(s), got 0 [wrong-arg-count] - -r4() # E -\u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m - -constructors_callable.py:80:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid keyword argument y to function [wrong-keyword-args] - -r4(y=1) # E -\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m - -constructors_callable.py:97:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Callable[[Any], Class5] [reveal-type] - -reveal_type(r5) # `def (*args: Any, **kwargs: Any) -> NoReturn` -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -constructors_callable.py:100:17: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function expects 1 arg(s), got 0 [wrong-arg-count] - - assert_type(r5(), NoReturn) - \u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m - -constructors_callable.py:100:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Any [assert-type] - - assert_type(r5(), NoReturn) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -constructors_callable.py:105:17: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid keyword argument x to function [wrong-keyword-args] - - assert_type(r5(1, x=1), NoReturn) - \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m - -constructors_callable.py:105:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Any [assert-type] - - assert_type(r5(1, x=1), NoReturn) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -constructors_callable.py:125:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Callable[[Any], Class6] [reveal-type] - -reveal_type(r6) # `def () -> Class6Proxy` -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -constructors_callable.py:126:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function expects 1 arg(s), got 0 [wrong-arg-count] - -assert_type(r6(), Class6Proxy) - \u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m - -constructors_callable.py:126:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Any [assert-type] - -assert_type(r6(), Class6Proxy) -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -constructors_callable.py:142:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Callable[[Any], Class6Any] [reveal-type] - -reveal_type(r6_any) # `def () -> Any` -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -constructors_callable.py:143:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function expects 1 arg(s), got 0 [wrong-arg-count] - -assert_type(r6_any(), Any) - \u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m - -constructors_callable.py:161:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Callable[[Any], Class7] [reveal-type] - -reveal_type( -\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m - r7 -\u001b[1m\u001b[31m~~~~~~\u001b[39m\u001b[0m -) # overload of `def (x: int) -> Class7[int]` and `def (x: str) -> Class7[str]` -\u001b[1m\u001b[31m~\u001b[39m\u001b[0m - -constructors_callable.py:164:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Class7 [assert-type] - -assert_type(r7(0), Class7[int]) -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -constructors_callable.py:165:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Class7 [assert-type] - -assert_type(r7(""), Class7[str]) -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -constructors_callable.py:182:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Callable[[Any], Class8[nothing]] [reveal-type] - -reveal_type(r8) # `def [T] (x: T, y: list[T]) -> Class8[T]` -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -constructors_callable.py:183:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function expects 1 arg(s), got 2 [wrong-arg-count] - -assert_type(r8([""], [""]), Class8[str]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -constructors_callable.py:183:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Any [assert-type] - -assert_type(r8([""], [""]), Class8[str]) -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -constructors_callable.py:184:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function expects 1 arg(s), got 2 [wrong-arg-count] - -r8([1], [""]) # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - -constructors_callable.py:193:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Callable[[Any], Class9] [reveal-type] - -reveal_type(r9) # `def [T] (x: list[T], y: list[T]) -> Class9` -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -constructors_callable.py:194:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function expects 1 arg(s), got 2 [wrong-arg-count] - -assert_type(r9([""], [""]), Class9) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -constructors_callable.py:194:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Any [assert-type] - -assert_type(r9([""], [""]), Class9) -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -constructors_callable.py:195:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function expects 1 arg(s), got 2 [wrong-arg-count] - -r9([1], [""]) # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - -""" diff --git a/conformance/results/pytype/constructors_consistency.toml b/conformance/results/pytype/constructors_consistency.toml deleted file mode 100644 index a5d4de873..000000000 --- a/conformance/results/pytype/constructors_consistency.toml +++ /dev/null @@ -1,10 +0,0 @@ -conformant = "Pass" -notes = """ -Does not report inconsistency between __new__ and __init__ (optional). -""" -errors_diff = """ -""" -output = """ - -""" -conformance_automated = "Pass" diff --git a/conformance/results/pytype/dataclasses_descriptors.toml b/conformance/results/pytype/dataclasses_descriptors.toml deleted file mode 100644 index 04f115500..000000000 --- a/conformance/results/pytype/dataclasses_descriptors.toml +++ /dev/null @@ -1,78 +0,0 @@ -conformant = "Unsupported" -notes = """ -Does not understand descriptor objects in dataclass. -""" -output = """ -dataclasses_descriptors.py:24:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __get__: bad return type [bad-return-type] - - ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m - -Called from (traceback): - line 38, in current file -dataclasses_descriptors.py:24:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __get__: bad return type [bad-return-type] - - ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m - -Called from (traceback): - line 37, in current file -dataclasses_descriptors.py:35:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function DC1.__init__ was called with the wrong arguments [wrong-arg-types] - -dc1 = DC1(3) - \u001b[1m\u001b[31m~~~~~~\u001b[39m\u001b[0m - -dataclasses_descriptors.py:51:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __get__: bad return type [bad-return-type] - - ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m - -Called from (traceback): - line 68, in current file -dataclasses_descriptors.py:51:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __get__: bad return type [bad-return-type] - - ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m - -Called from (traceback): - line 67, in current file -dataclasses_descriptors.py:51:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __get__: bad return type [bad-return-type] - - ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m - -Called from (traceback): - line 66, in current file -dataclasses_descriptors.py:51:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __get__: bad return type [bad-return-type] - - ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m - -Called from (traceback): - line 63, in current file -dataclasses_descriptors.py:51:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __get__: bad return type [bad-return-type] - - ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m - -Called from (traceback): - line 62, in current file -dataclasses_descriptors.py:51:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __get__: bad return type [bad-return-type] - - ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m - -Called from (traceback): - line 61, in current file -dataclasses_descriptors.py:51:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __get__: bad return type [bad-return-type] - - ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 24: Unexpected errors ['dataclasses_descriptors.py:24:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __get__: bad return type [bad-return-type]', 'dataclasses_descriptors.py:24:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __get__: bad return type [bad-return-type]'] -Line 35: Unexpected errors ['dataclasses_descriptors.py:35:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function DC1.__init__ was called with the wrong arguments [wrong-arg-types]'] -Line 51: Unexpected errors ['dataclasses_descriptors.py:51:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __get__: bad return type [bad-return-type]', 'dataclasses_descriptors.py:51:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __get__: bad return type [bad-return-type]', 'dataclasses_descriptors.py:51:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __get__: bad return type [bad-return-type]', 'dataclasses_descriptors.py:51:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __get__: bad return type [bad-return-type]', 'dataclasses_descriptors.py:51:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __get__: bad return type [bad-return-type]', 'dataclasses_descriptors.py:51:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __get__: bad return type [bad-return-type]', 'dataclasses_descriptors.py:51:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __get__: bad return type [bad-return-type]'] -""" diff --git a/conformance/results/pytype/dataclasses_final.toml b/conformance/results/pytype/dataclasses_final.toml deleted file mode 100644 index 7d9d915f0..000000000 --- a/conformance/results/pytype/dataclasses_final.toml +++ /dev/null @@ -1,33 +0,0 @@ -conformant = "Partial" -notes = """ -Doesn't handle Final nested inside ClassVar. -""" -errors_diff = """ -Line 27: Expected 1 errors -Line 35: Expected 1 errors -Line 37: Expected 1 errors -Line 18: Unexpected errors ['dataclasses_final.py:18:21: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in D: Invalid use of typing.Final [final-error]', "dataclasses_final.py:18:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in D: Invalid type annotation 'ClassVar[Final[int]]' [invalid-annotation]"] -""" -output = """ -dataclasses_final.py:18:21: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in D: Invalid use of typing.Final [final-error] - - final_classvar: ClassVar[Final[int]] = 4 - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -dataclasses_final.py:18:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in D: Invalid type annotation 'ClassVar[Final[int]]' [invalid-annotation] - - final_classvar: ClassVar[Final[int]] = 4 - \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -dataclasses_final.py:36:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Assigning to attribute final_with_default, which was annotated with Final [final-error] - -d.final_with_default = "baz" # E: can't assign to final attribute -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -dataclasses_final.py:38:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Assigning to attribute final_with_default, which was annotated with Final [final-error] - -D.final_with_default = "baz" # E: can't assign to final attribute -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" diff --git a/conformance/results/pytype/dataclasses_frozen.toml b/conformance/results/pytype/dataclasses_frozen.toml deleted file mode 100644 index ede4373af..000000000 --- a/conformance/results/pytype/dataclasses_frozen.toml +++ /dev/null @@ -1,16 +0,0 @@ -conformant = "Unsupported" -notes = """ -Does not report assignment to field within frozen dataclass instance. -Does not reject frozen dataclass inherited from non-frozen dataclass. -Does not reject non-frozen dataclass inherited from frozen dataclass. -""" -output = """ - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 16: Expected 1 errors -Line 17: Expected 1 errors -Lines 22, 23: Expected error (tag 'DC2') -Lines 32, 33: Expected error (tag 'DC4') -""" diff --git a/conformance/results/pytype/dataclasses_hash.toml b/conformance/results/pytype/dataclasses_hash.toml deleted file mode 100644 index 379b0e691..000000000 --- a/conformance/results/pytype/dataclasses_hash.toml +++ /dev/null @@ -1,12 +0,0 @@ -conformant = "Partial" -notes = """ -Does not report when dataclass is not compatible with Hashable protocol. -""" -output = """ - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 15: Expected 1 errors -Line 32: Expected 1 errors -""" diff --git a/conformance/results/pytype/dataclasses_inheritance.toml b/conformance/results/pytype/dataclasses_inheritance.toml deleted file mode 100644 index 88ec64ce2..000000000 --- a/conformance/results/pytype/dataclasses_inheritance.toml +++ /dev/null @@ -1,13 +0,0 @@ -conformant = "Partial" -notes = """ -Does not reject ClassVar that is overridden by instance variable. -Does not reject instance variable that is overridden by ClassVar. -""" -output = """ - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 60: Expected 1 errors -Line 64: Expected 1 errors -""" diff --git a/conformance/results/pytype/dataclasses_kwonly.toml b/conformance/results/pytype/dataclasses_kwonly.toml deleted file mode 100644 index 4166e7030..000000000 --- a/conformance/results/pytype/dataclasses_kwonly.toml +++ /dev/null @@ -1,49 +0,0 @@ -conformant = "Partial" -notes = """ -Incorrectly reports error when kw_only field has default value. -Incorrectly rejects kw_only field with default before positional field. -""" -output = """ -dataclasses_kwonly.py:23:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function DC1.__init__ expects 2 arg(s), got 3 [wrong-arg-count] - -DC1("hi", 1) # E -\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m - -dataclasses_kwonly.py:38:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function DC2.__init__ expects 2 arg(s), got 3 [wrong-arg-count] - -DC2("hi", 1) # E -\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m - -dataclasses_kwonly.py:47:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'a' in call to function DC3.__init__ [missing-parameter] - -DC3("hi") -\u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m - -dataclasses_kwonly.py:50:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'a' in call to function DC3.__init__ [missing-parameter] - -DC3("hi", b=1) -\u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -dataclasses_kwonly.py:53:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'a' in call to function DC3.__init__ [missing-parameter] - -DC3("hi", 1) # E -\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m - -dataclasses_kwonly.py:56:2: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : In method __init__, non-default argument c follows default argument [invalid-function-definition] - -@dataclass - \u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m - -dataclasses_kwonly.py:61:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : function DC4.__init__ got multiple values for keyword argument 'b' [duplicate-keyword-argument] - -DC4("", 0.2, b=3) -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 47: Unexpected errors ["dataclasses_kwonly.py:47:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Missing parameter 'a' in call to function DC3.__init__ [missing-parameter]"] -Line 50: Unexpected errors ["dataclasses_kwonly.py:50:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Missing parameter 'a' in call to function DC3.__init__ [missing-parameter]"] -Line 56: Unexpected errors ['dataclasses_kwonly.py:56:2: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : In method __init__, non-default argument c follows default argument [invalid-function-definition]'] -Line 61: Unexpected errors ["dataclasses_kwonly.py:61:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : function DC4.__init__ got multiple values for keyword argument 'b' [duplicate-keyword-argument]"] -""" diff --git a/conformance/results/pytype/dataclasses_order.toml b/conformance/results/pytype/dataclasses_order.toml deleted file mode 100644 index 154b02be2..000000000 --- a/conformance/results/pytype/dataclasses_order.toml +++ /dev/null @@ -1,11 +0,0 @@ -conformant = "Partial" -notes = """ -Does not report type incompatibility with comparison operator. -""" -output = """ - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 50: Expected 1 errors -""" diff --git a/conformance/results/pytype/dataclasses_postinit.toml b/conformance/results/pytype/dataclasses_postinit.toml deleted file mode 100644 index 286e7a3d9..000000000 --- a/conformance/results/pytype/dataclasses_postinit.toml +++ /dev/null @@ -1,30 +0,0 @@ -conformant = "Partial" -notes = """ -Does not validate `__post_init__` method. -Reports incorrect error for incompatible `__post_init__` method override. -""" -output = """ -dataclasses_postinit.py:28:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : No attribute 'x' on DC1 [attribute-error] - -print(dc1.x) # E: cannot access InitVar - \u001b[1m\u001b[31m~~~~~\u001b[39m\u001b[0m - -dataclasses_postinit.py:29:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : No attribute 'y' on DC1 [attribute-error] - -print(dc1.y) # E: cannot access InitVar - \u001b[1m\u001b[31m~~~~~\u001b[39m\u001b[0m - -dataclasses_postinit.py:54:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in DC4: Overriding method signature mismatch [signature-mismatch] - - def __post_init__(self, _name: str, _age: int): - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - ... -\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 19: Expected 1 errors -Line 36: Expected 1 errors -Line 54: Unexpected errors ['dataclasses_postinit.py:54:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in DC4: Overriding method signature mismatch [signature-mismatch]'] -""" diff --git a/conformance/results/pytype/dataclasses_slots.toml b/conformance/results/pytype/dataclasses_slots.toml deleted file mode 100644 index c3318af84..000000000 --- a/conformance/results/pytype/dataclasses_slots.toml +++ /dev/null @@ -1,36 +0,0 @@ -conformant = "Partial" -notes = """ -Does not report error when `slots=True` is used with `__slots__` definition. -Does not reject write to instance variable that is not defined in __slots__. -Incorrectly reports error when accessing `__slots__` when `slots=True`. -""" -output = """ -dataclasses_slots.py:56:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : No attribute '__slots__' on type[DC5] [attribute-error] - -DC5.__slots__ -\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - -dataclasses_slots.py:57:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : No attribute '__slots__' on DC5 [attribute-error] - -DC5(1).__slots__ -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -dataclasses_slots.py:66:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : No attribute '__slots__' on type[DC6] [attribute-error] - -DC6.__slots__ # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - -dataclasses_slots.py:69:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : No attribute '__slots__' on DC6 [attribute-error] - -DC6(1).__slots__ # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 25: Expected 1 errors -Line 38: Expected 1 errors -Lines 10, 11: Expected error (tag 'DC1') -Line 56: Unexpected errors ["dataclasses_slots.py:56:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : No attribute '__slots__' on type[DC5] [attribute-error]"] -Line 57: Unexpected errors ["dataclasses_slots.py:57:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : No attribute '__slots__' on DC5 [attribute-error]"] -""" diff --git a/conformance/results/pytype/dataclasses_transform_class.toml b/conformance/results/pytype/dataclasses_transform_class.toml deleted file mode 100644 index 5bbaceedc..000000000 --- a/conformance/results/pytype/dataclasses_transform_class.toml +++ /dev/null @@ -1,57 +0,0 @@ -conformant = "Unsupported" -notes = """ -Does not understand @dataclass_transform. -""" -output = """ -dataclasses_transform_class.py:23:2: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Arguments to dataclass_transform not supported yet [not-supported-yet] - -@dataclass_transform( - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - kw_only_default=True, -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - field_specifiers=(ModelField, model_field), -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -) -\u001b[1m\u001b[31m~\u001b[39m\u001b[0m - -dataclasses_transform_class.py:60:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid keyword argument other_name to function Customer1.__init__ [wrong-keyword-args] - -c1_1 = Customer1(id=3, name="Sue", other_name="Susan") - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -dataclasses_transform_class.py:85:2: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Arguments to dataclass_transform not supported yet [not-supported-yet] - -@dataclass_transform( - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - kw_only_default=True, -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - field_specifiers=(ModelField, model_field), -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -) -\u001b[1m\u001b[31m~\u001b[39m\u001b[0m - -dataclasses_transform_class.py:106:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid keyword argument id to function GenericCustomer.__init__ [wrong-keyword-args] - -gc_1 = GenericCustomer(id=3) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -dataclasses_transform_class.py:109:2: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Arguments to dataclass_transform not supported yet [not-supported-yet] - -@dataclass_transform(frozen_default=True) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 51: Expected 1 errors -Line 63: Expected 1 errors -Line 66: Expected 1 errors -Line 72: Expected 1 errors -Line 82: Expected 1 errors -Line 122: Expected 1 errors -Line 23: Unexpected errors ['dataclasses_transform_class.py:23:2: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] -Line 60: Unexpected errors ['dataclasses_transform_class.py:60:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid keyword argument other_name to function Customer1.__init__ [wrong-keyword-args]'] -Line 85: Unexpected errors ['dataclasses_transform_class.py:85:2: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] -Line 106: Unexpected errors ['dataclasses_transform_class.py:106:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid keyword argument id to function GenericCustomer.__init__ [wrong-keyword-args]'] -Line 109: Unexpected errors ['dataclasses_transform_class.py:109:2: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] -""" diff --git a/conformance/results/pytype/dataclasses_transform_converter.toml b/conformance/results/pytype/dataclasses_transform_converter.toml deleted file mode 100644 index 14fa83e82..000000000 --- a/conformance/results/pytype/dataclasses_transform_converter.toml +++ /dev/null @@ -1,123 +0,0 @@ -conformant = "Unsupported" -notes = """ -Converter parameter not yet supported. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 49: Expected 1 errors -Line 118: Expected 1 errors -Line 26: Unexpected errors ['dataclasses_transform_converter.py:26:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in model_field: bad return type [bad-return-type]', 'dataclasses_transform_converter.py:26:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in model_field: bad return type [bad-return-type]', 'dataclasses_transform_converter.py:26:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in model_field: bad return type [bad-return-type]', 'dataclasses_transform_converter.py:26:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in model_field: bad return type [bad-return-type]', 'dataclasses_transform_converter.py:26:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in model_field: bad return type [bad-return-type]'] -Line 29: Unexpected errors ['dataclasses_transform_converter.py:29:2: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] -Line 112: Unexpected errors ['dataclasses_transform_converter.py:112:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function DC2.__init__ was called with the wrong arguments [wrong-arg-types]'] -Line 114: Unexpected errors ['dataclasses_transform_converter.py:114:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for field0 does not match type of assignment [annotation-type-mismatch]'] -Line 115: Unexpected errors ['dataclasses_transform_converter.py:115:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for field3 does not match type of assignment [annotation-type-mismatch]'] -Line 116: Unexpected errors ['dataclasses_transform_converter.py:116:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for field3 does not match type of assignment [annotation-type-mismatch]'] -Line 121: Unexpected errors ['dataclasses_transform_converter.py:121:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function DC2.__init__ was called with the wrong arguments [wrong-arg-types]'] -""" -output = """ -dataclasses_transform_converter.py:26:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in model_field: bad return type [bad-return-type] - - ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m - -Called from (traceback): - line 98, in current file - line 99, in DC2 -dataclasses_transform_converter.py:26:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in model_field: bad return type [bad-return-type] - - ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m - -Called from (traceback): - line 98, in current file - line 104, in DC2 -dataclasses_transform_converter.py:26:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in model_field: bad return type [bad-return-type] - - ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m - -Called from (traceback): - line 98, in current file - line 102, in DC2 -dataclasses_transform_converter.py:26:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in model_field: bad return type [bad-return-type] - - ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m - -Called from (traceback): - line 98, in current file - line 100, in DC2 -dataclasses_transform_converter.py:26:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in model_field: bad return type [bad-return-type] - - ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m - -Called from (traceback): - line 47, in current file - line 49, in DC1 -dataclasses_transform_converter.py:29:2: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Arguments to dataclass_transform not supported yet [not-supported-yet] - -@dataclass_transform(field_specifiers=(model_field,)) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -dataclasses_transform_converter.py:48:19: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in DC1: Function model_field was called with the wrong arguments [wrong-arg-types] - - field1: int = model_field(converter=bad_converter1) # E - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -dataclasses_transform_converter.py:107:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function DC2.__init__ was called with the wrong arguments [wrong-arg-types] - -DC2(1, "f1", "f2", b"f3", []) # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -dataclasses_transform_converter.py:108:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function DC2.__init__ was called with the wrong arguments [wrong-arg-types] - -DC2("f0", "f1", "f2", 1, []) # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -dataclasses_transform_converter.py:109:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function DC2.__init__ was called with the wrong arguments [wrong-arg-types] - -DC2("f0", "f1", "f2", "f3", 3j) # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -dataclasses_transform_converter.py:112:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function DC2.__init__ was called with the wrong arguments [wrong-arg-types] - -dc1 = DC2("f0", "f1", "f2", b"f6", []) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -dataclasses_transform_converter.py:114:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for field0 does not match type of assignment [annotation-type-mismatch] - -dc1.field0 = "f1" -\u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m - -dataclasses_transform_converter.py:115:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for field3 does not match type of assignment [annotation-type-mismatch] - -dc1.field3 = "f6" -\u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m - -dataclasses_transform_converter.py:116:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for field3 does not match type of assignment [annotation-type-mismatch] - -dc1.field3 = b"f6" -\u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m - -dataclasses_transform_converter.py:119:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for field3 does not match type of assignment [annotation-type-mismatch] - -dc1.field3 = 1 # E -\u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m - -dataclasses_transform_converter.py:121:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function DC2.__init__ was called with the wrong arguments [wrong-arg-types] - -dc2 = DC2("f0", "f1", "f2", "f6", "1", (("a", "1"), ("b", "2"))) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -dataclasses_transform_converter.py:130:19: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in DC3: Function model_field was called with the wrong arguments [wrong-arg-types] - - field1: int = model_field(converter=converter_simple, default=1) # E - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -dataclasses_transform_converter.py:133:19: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in DC3: Function model_field was called with the wrong arguments [wrong-arg-types] - - field3: int = model_field(converter=converter_simple, default_factory=int) # E - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -""" diff --git a/conformance/results/pytype/dataclasses_transform_field.toml b/conformance/results/pytype/dataclasses_transform_field.toml deleted file mode 100644 index 62c34fded..000000000 --- a/conformance/results/pytype/dataclasses_transform_field.toml +++ /dev/null @@ -1,23 +0,0 @@ -conformant = "Unsupported" -notes = """ -Does not understand @dataclass_transform. -""" -output = """ -dataclasses_transform_field.py:48:2: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Arguments to dataclass_transform not supported yet [not-supported-yet] - -@dataclass_transform(kw_only_default=True, field_specifiers=(field1, field2)) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -dataclasses_transform_field.py:50:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in create_model: bad return type [bad-return-type] - - ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 64: Expected 1 errors -Line 75: Expected 1 errors -Line 48: Unexpected errors ['dataclasses_transform_field.py:48:2: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] -Line 50: Unexpected errors ['dataclasses_transform_field.py:50:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in create_model: bad return type [bad-return-type]'] -""" diff --git a/conformance/results/pytype/dataclasses_transform_func.toml b/conformance/results/pytype/dataclasses_transform_func.toml deleted file mode 100644 index 1479e2bcb..000000000 --- a/conformance/results/pytype/dataclasses_transform_func.toml +++ /dev/null @@ -1,76 +0,0 @@ -conformant = "Unsupported" -notes = """ -Does not understand @dataclass_transform. -""" -output = """ -dataclasses_transform_func.py:13:2: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Arguments to dataclass_transform not supported yet [not-supported-yet] - -@dataclass_transform(kw_only_default=True, order_default=True) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -dataclasses_transform_func.py:19:2: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Arguments to dataclass_transform not supported yet [not-supported-yet] - -@dataclass_transform(kw_only_default=True, order_default=True) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -dataclasses_transform_func.py:30:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in create_model: bad return type [bad-return-type] - - ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m - -Called from (traceback): - line 89, in current file -dataclasses_transform_func.py:30:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in create_model: bad return type [bad-return-type] - - ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m - -dataclasses_transform_func.py:50:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid keyword arguments (id, name) to function Customer1.__init__ [wrong-keyword-args] - -c1_1 = Customer1(id=3, name="Sue") - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -dataclasses_transform_func.py:53:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Customer1.__init__ expects 1 arg(s), got 3 [wrong-arg-count] - -c1_2 = Customer1(3, "Sue") - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -dataclasses_transform_func.py:57:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for name does not match type of assignment [annotation-type-mismatch] - -c1_2.name = 3 # E -\u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m - -dataclasses_transform_func.py:65:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid keyword arguments (id, name, salary) to function Customer1.__init__ [wrong-keyword-args] - -c1_3 = Customer1(id=3, name="Sue", salary=40000) # E - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -dataclasses_transform_func.py:67:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid keyword arguments (id, name) to function Customer2.__init__ [wrong-keyword-args] - -c2_1 = Customer2(id=0, name="John") - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -dataclasses_transform_func.py:71:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Customer2.__init__ expects 1 arg(s), got 3 [wrong-arg-count] - -c2_2 = Customer2(0, "John") # E - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -dataclasses_transform_func.py:76:2: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Arguments to dataclass_transform not supported yet [not-supported-yet] - -@dataclass_transform(kw_only_default=True, order_default=True, frozen_default=True) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 61: Expected 1 errors -Line 97: Expected 1 errors -Lines 89, 90: Expected error (tag 'Customer3Subclass') -Line 13: Unexpected errors ['dataclasses_transform_func.py:13:2: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] -Line 19: Unexpected errors ['dataclasses_transform_func.py:19:2: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] -Line 30: Unexpected errors ['dataclasses_transform_func.py:30:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in create_model: bad return type [bad-return-type]', 'dataclasses_transform_func.py:30:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in create_model: bad return type [bad-return-type]'] -Line 50: Unexpected errors ['dataclasses_transform_func.py:50:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid keyword arguments (id, name) to function Customer1.__init__ [wrong-keyword-args]'] -Line 53: Unexpected errors ['dataclasses_transform_func.py:53:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function Customer1.__init__ expects 1 arg(s), got 3 [wrong-arg-count]'] -Line 67: Unexpected errors ['dataclasses_transform_func.py:67:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid keyword arguments (id, name) to function Customer2.__init__ [wrong-keyword-args]'] -Line 76: Unexpected errors ['dataclasses_transform_func.py:76:2: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] -""" diff --git a/conformance/results/pytype/dataclasses_transform_meta.toml b/conformance/results/pytype/dataclasses_transform_meta.toml deleted file mode 100644 index 93cf0058c..000000000 --- a/conformance/results/pytype/dataclasses_transform_meta.toml +++ /dev/null @@ -1,39 +0,0 @@ -conformant = "Unsupported" -notes = """ -Does not understand @dataclass_transform. -""" -output = """ -dataclasses_transform_meta.py:21:2: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Arguments to dataclass_transform not supported yet [not-supported-yet] - -@dataclass_transform( - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - kw_only_default=True, -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - field_specifiers=(ModelField, model_field), -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -) -\u001b[1m\u001b[31m~\u001b[39m\u001b[0m - -dataclasses_transform_meta.py:60:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid keyword argument other_name to function Customer1.__init__ [wrong-keyword-args] - -c1_1 = Customer1(id=3, name="Sue", other_name="Susan") - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -dataclasses_transform_meta.py:86:2: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Arguments to dataclass_transform not supported yet [not-supported-yet] - -@dataclass_transform(frozen_default=True) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 51: Expected 1 errors -Line 63: Expected 1 errors -Line 66: Expected 1 errors -Line 73: Expected 1 errors -Line 83: Expected 1 errors -Line 103: Expected 1 errors -Line 21: Unexpected errors ['dataclasses_transform_meta.py:21:2: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] -Line 60: Unexpected errors ['dataclasses_transform_meta.py:60:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid keyword argument other_name to function Customer1.__init__ [wrong-keyword-args]'] -Line 86: Unexpected errors ['dataclasses_transform_meta.py:86:2: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] -""" diff --git a/conformance/results/pytype/dataclasses_usage.toml b/conformance/results/pytype/dataclasses_usage.toml deleted file mode 100644 index cc9e6e713..000000000 --- a/conformance/results/pytype/dataclasses_usage.toml +++ /dev/null @@ -1,61 +0,0 @@ -conformant = "Pass" -output = """ -dataclasses_usage.py:50:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'unit_price' in call to function InventoryItem.__init__ [missing-parameter] - -v2 = InventoryItem("name") # E: missing unit_price - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -dataclasses_usage.py:51:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function InventoryItem.__init__ was called with the wrong arguments [wrong-arg-types] - -v3 = InventoryItem("name", "price") # E: incorrect type for unit_price - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -dataclasses_usage.py:52:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function InventoryItem.__init__ expects 3 arg(s), got 5 [wrong-arg-count] - -v4 = InventoryItem("name", 3.1, 3, 4) # E: too many arguments - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -dataclasses_usage.py:58:2: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : In method __init__, non-default argument b follows default argument [invalid-function-definition] - -@dataclass # E[DC1] - \u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m - -dataclasses_usage.py:64:2: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : In method __init__, non-default argument b follows default argument [invalid-function-definition] - -@dataclass # E[DC2] - \u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m - -dataclasses_usage.py:70:2: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : In method __init__, non-default argument b follows default argument [invalid-function-definition] - -@dataclass # E[DC3] - \u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m - -dataclasses_usage.py:83:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function DC4.__init__ expects 2 arg(s), got 3 [wrong-arg-count] - -v6 = DC4(0, 1) # E: too many parameters - \u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m - -dataclasses_usage.py:88:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in DC5: Type annotation for a does not match type of assignment [annotation-type-mismatch] - - a: int = field(default_factory=str) # E: type mismatch - \u001b[1m\u001b[31m~\u001b[39m\u001b[0m - -dataclasses_usage.py:127:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function DC7.__init__ expects 2 arg(s), got 3 [wrong-arg-count] - -DC7(3, 4) # E -\u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m - -dataclasses_usage.py:130:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'y' in call to function DC8.__init__ [missing-parameter] - -DC8(a) # E -\u001b[1m\u001b[31m~~~~~~\u001b[39m\u001b[0m - -dataclasses_usage.py:179:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function DC13.__init__ expects 1 arg(s), got 2 [wrong-arg-count] - -DC13(3) # E -\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Pass" -errors_diff = """ -""" diff --git a/conformance/results/pytype/directives_assert_type.toml b/conformance/results/pytype/directives_assert_type.toml deleted file mode 100644 index 288cc6558..000000000 --- a/conformance/results/pytype/directives_assert_type.toml +++ /dev/null @@ -1,35 +0,0 @@ -conformant = "Partial" -notes = """ -Incorrectly allows assert(x, int) where x is a Literal. -""" -output = """ -directives_assert_type.py:27:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Union[int, str] [assert-type] - - assert_type(a, int) # E: Type mismatch - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -directives_assert_type.py:28:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Any [assert-type] - - assert_type(c, int) # E: Type mismatch - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -directives_assert_type.py:31:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Function assert_type expects 2 arg(s), got 0 [wrong-arg-count] - - assert_type() # E: not enough arguments - \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - -directives_assert_type.py:32:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: str [assert-type] - - assert_type("", int) # E: wrong argument type - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -directives_assert_type.py:33:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Function assert_type expects 2 arg(s), got 3 [wrong-arg-count] - - assert_type(a, int | str, a) # E: too many arguments - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 29: Expected 1 errors -""" diff --git a/conformance/results/pytype/directives_cast.toml b/conformance/results/pytype/directives_cast.toml deleted file mode 100644 index edb229b98..000000000 --- a/conformance/results/pytype/directives_cast.toml +++ /dev/null @@ -1,20 +0,0 @@ -conformant = "Partial" -notes = """ -Does not reject a call to "cast" with additional arguments. -""" -output = """ -directives_cast.py:15:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'typ' in call to function typing.cast [missing-parameter] - -bad1 = cast() # E: Too few arguments - \u001b[1m\u001b[31m~~~~~~\u001b[39m\u001b[0m - -directives_cast.py:16:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '1' for typing.cast [invalid-annotation] - -bad2 = cast(1, "") # E: Bad first argument type - \u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 17: Expected 1 errors -""" diff --git a/conformance/results/pytype/directives_deprecated.toml b/conformance/results/pytype/directives_deprecated.toml deleted file mode 100644 index 26c189937..000000000 --- a/conformance/results/pytype/directives_deprecated.toml +++ /dev/null @@ -1,43 +0,0 @@ -conformant = "Unsupported" -notes = """ -Does not support @deprecated. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 24: Expected 1 errors -Line 25: Expected 1 errors -Line 30: Expected 1 errors -Line 41: Expected 1 errors -Line 42: Expected 1 errors -Line 44: Expected 1 errors -Line 47: Expected 1 errors -Line 48: Expected 1 errors -Line 58: Expected 1 errors -Line 69: Expected 1 errors -Line 98: Expected 1 errors -Line 10: Unexpected errors ['directives_deprecated.py:10:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.override not supported yet [not-supported-yet]'] -Line 11: Unexpected errors ['directives_deprecated.py:11:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing_extensions.deprecated not supported yet [not-supported-yet]'] -Line 19: Unexpected errors ["directives_deprecated.py:19:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Can't find module '_directives_deprecated_library'. [import-error]"] -""" -output = """ -directives_deprecated.py:10:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing.override not supported yet [not-supported-yet] - -from typing import Protocol, override -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -directives_deprecated.py:11:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing_extensions.deprecated not supported yet [not-supported-yet] - -from typing_extensions import deprecated -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -directives_deprecated.py:18:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Can't find module '_directives_deprecated_library'. [import-error] - -from _directives_deprecated_library import Ham # E: Use of deprecated class Ham -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -directives_deprecated.py:19:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Can't find module '_directives_deprecated_library'. [import-error] - -import _directives_deprecated_library as library -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -""" diff --git a/conformance/results/pytype/directives_no_type_check.toml b/conformance/results/pytype/directives_no_type_check.toml deleted file mode 100644 index 22229130f..000000000 --- a/conformance/results/pytype/directives_no_type_check.toml +++ /dev/null @@ -1,34 +0,0 @@ -conformant = "Pass" -notes = """ -Does not honor @no_type_check decorator. -""" -output = """ -directives_no_type_check.py:15:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassA: Type annotation for x does not match type of assignment [annotation-type-mismatch] - - x: int = "" # E?: No error should be reported - \u001b[1m\u001b[31m~\u001b[39m\u001b[0m - -directives_no_type_check.py:25:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: unsupported operand type(s) for +: int and str [unsupported-operands] - - c = a + b # E?: No error should be reported - \u001b[1m\u001b[31m~~~~~\u001b[39m\u001b[0m - -directives_no_type_check.py:26:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: bad return type [bad-return-type] - - return 1 # E?: No error should be reported - \u001b[1m\u001b[31m~\u001b[39m\u001b[0m - -directives_no_type_check.py:29:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function func1 was called with the wrong arguments [wrong-arg-types] - -func1(b"invalid", b"arguments") # E?: No error should be reported -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -directives_no_type_check.py:32:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'a' in call to function func1 [missing-parameter] - -func1() # E: incorrect arguments for parameters -\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Pass" -errors_diff = """ -""" diff --git a/conformance/results/pytype/directives_reveal_type.toml b/conformance/results/pytype/directives_reveal_type.toml deleted file mode 100644 index 05358bc89..000000000 --- a/conformance/results/pytype/directives_reveal_type.toml +++ /dev/null @@ -1,40 +0,0 @@ -conformant = "Partial" -notes = """ -Does not reject call to reveal_type with zero arguments. -Does not reject call to reveal_type with too many arguments. -""" -output = """ -directives_reveal_type.py:14:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Union[int, str] [reveal-type] - - reveal_type(a) # Revealed type is "int | str" - \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -directives_reveal_type.py:15:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: list[int] [reveal-type] - - reveal_type(b) # Revealed type is "list[int]" - \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -directives_reveal_type.py:16:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Any [reveal-type] - - reveal_type(c) # Revealed type is "Any" - \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -directives_reveal_type.py:17:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: ForwardReference [reveal-type] - - reveal_type(d) # Revealed type is "ForwardReference" - \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -directives_reveal_type.py:20:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Union[int, str] [reveal-type] - - reveal_type(a, a) # E: Too many arguments - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 19: Expected 1 errors -Line 14: Unexpected errors ['directives_reveal_type.py:14:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: Union[int, str] [reveal-type]'] -Line 15: Unexpected errors ['directives_reveal_type.py:15:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: list[int] [reveal-type]'] -Line 16: Unexpected errors ['directives_reveal_type.py:16:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: Any [reveal-type]'] -Line 17: Unexpected errors ['directives_reveal_type.py:17:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: ForwardReference [reveal-type]'] -""" diff --git a/conformance/results/pytype/directives_type_checking.toml b/conformance/results/pytype/directives_type_checking.toml deleted file mode 100644 index a339ad0a1..000000000 --- a/conformance/results/pytype/directives_type_checking.toml +++ /dev/null @@ -1,7 +0,0 @@ -conformant = "Pass" -output = """ - -""" -conformance_automated = "Pass" -errors_diff = """ -""" diff --git a/conformance/results/pytype/directives_type_ignore.toml b/conformance/results/pytype/directives_type_ignore.toml deleted file mode 100644 index 0fd583385..000000000 --- a/conformance/results/pytype/directives_type_ignore.toml +++ /dev/null @@ -1,21 +0,0 @@ -conformant = "Partial" -notes = """ -Does not honor "# type: ignore" comment if comment includes additional text. -""" -output = """ -directives_type_ignore.py:11:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for y does not match type of assignment [annotation-type-mismatch] - -y: int = "" # type: ignore - additional stuff -\u001b[1m\u001b[31m~\u001b[39m\u001b[0m - -directives_type_ignore.py:11:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: : Stray type comment: ignore - additional stuff [ignored-type-comment] - -y: int = "" # type: ignore - additional stuff\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -y: int = "" # type: ignore - additional stuff -\u001b[1m\u001b[31m\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 11: Unexpected errors ['directives_type_ignore.py:11:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for y does not match type of assignment [annotation-type-mismatch]', 'directives_type_ignore.py:11:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: : Stray type comment: ignore - additional stuff [ignored-type-comment]'] -""" diff --git a/conformance/results/pytype/directives_type_ignore_file1.toml b/conformance/results/pytype/directives_type_ignore_file1.toml deleted file mode 100644 index a339ad0a1..000000000 --- a/conformance/results/pytype/directives_type_ignore_file1.toml +++ /dev/null @@ -1,7 +0,0 @@ -conformant = "Pass" -output = """ - -""" -conformance_automated = "Pass" -errors_diff = """ -""" diff --git a/conformance/results/pytype/directives_type_ignore_file2.toml b/conformance/results/pytype/directives_type_ignore_file2.toml deleted file mode 100644 index 0b11099d3..000000000 --- a/conformance/results/pytype/directives_type_ignore_file2.toml +++ /dev/null @@ -1,11 +0,0 @@ -conformant = "Partial" -notes = """ -Does not ignore `# type: ignore` if it occurs after docstrings in the file. -""" -output = """ - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 14: Expected 1 errors -""" diff --git a/conformance/results/pytype/directives_version_platform.toml b/conformance/results/pytype/directives_version_platform.toml deleted file mode 100644 index dd6558f4b..000000000 --- a/conformance/results/pytype/directives_version_platform.toml +++ /dev/null @@ -1,25 +0,0 @@ -conformant = "Pass" -notes = """ -Does not understand three-element form of sys.version checks. -Does not understand os.name checks. -""" -output = """ -directives_version_platform.py:27:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for val3 does not match type of assignment [annotation-type-mismatch] - - val3: int = "" # E?: May not generate an error (support for three-element sys.version is optional) - \u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m - -directives_version_platform.py:40:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for val7 does not match type of assignment [annotation-type-mismatch] - - val7: int = "" # E?: May not generate an error (support for os.name is optional) - \u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m - -directives_version_platform.py:45:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for val8 does not match type of assignment [annotation-type-mismatch] - - val8: int = "" # E?: May not generate an error (support for os.name is optional) - \u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Pass" -errors_diff = """ -""" diff --git a/conformance/results/pytype/enums_behaviors.toml b/conformance/results/pytype/enums_behaviors.toml deleted file mode 100644 index ab9118cfb..000000000 --- a/conformance/results/pytype/enums_behaviors.toml +++ /dev/null @@ -1,11 +0,0 @@ -conformant = "Partial" -notes = """ -Does not enforce that Enum classes are implicitly final. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 39: Expected 1 errors -""" -output = """ - -""" diff --git a/conformance/results/pytype/enums_definition.toml b/conformance/results/pytype/enums_definition.toml deleted file mode 100644 index bc2a8230e..000000000 --- a/conformance/results/pytype/enums_definition.toml +++ /dev/null @@ -1,14 +0,0 @@ -conformant = "Pass" -notes = """ -Does not support some functional forms for Enum class definitions (optional). -""" -errors_diff = """ -""" -output = """ -enums_definition.py:24:10: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function unsolveable.__new__ was called with the wrong arguments [wrong-arg-types] - -Color2 = Enum("Color2", "RED", "GREEN", "BLUE") # E? - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Pass" diff --git a/conformance/results/pytype/enums_expansion.toml b/conformance/results/pytype/enums_expansion.toml deleted file mode 100644 index 9f168ca05..000000000 --- a/conformance/results/pytype/enums_expansion.toml +++ /dev/null @@ -1,11 +0,0 @@ -conformant = "Partial" -notes = """ -Improperly applies narrowing to Flag subclass. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 53: Expected 1 errors -""" -output = """ - -""" diff --git a/conformance/results/pytype/enums_member_names.toml b/conformance/results/pytype/enums_member_names.toml deleted file mode 100644 index fb0bc9609..000000000 --- a/conformance/results/pytype/enums_member_names.toml +++ /dev/null @@ -1,7 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ - -""" diff --git a/conformance/results/pytype/enums_member_values.toml b/conformance/results/pytype/enums_member_values.toml deleted file mode 100644 index bf9325764..000000000 --- a/conformance/results/pytype/enums_member_values.toml +++ /dev/null @@ -1,74 +0,0 @@ -conformant = "Partial" -notes = """ -Does not enforce declared type of `_value_`. -Does not correctly enforce assigned tuple types for enum members (optional). -Does not evaluate literal types for enum member values (optional). -Does not evaluate literal types for auto values (optional). -""" -conformance_automated = "Fail" -errors_diff = """ -Line 78: Expected 1 errors -Line 41: Unexpected errors ["enums_member_values.py:41:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Missing parameter 'mass' in call to function Planet.__init__ [missing-parameter]", 'enums_member_values.py:41:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function Planet.__init__ was called with the wrong arguments [wrong-arg-types]'] -""" -output = """ -enums_member_values.py:41:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'mass' in call to function Planet.__init__ [missing-parameter] - -class Planet(Enum): -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - def __init__(self, value: int, mass: float, radius: float): -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - self._value_ = value -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - self.mass = mass -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - self.radius = radius -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -\u001b[1m\u001b[31m\u001b[39m\u001b[0m - MERCURY = (1, 3.303e23, 2.4397e6) -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - VENUS = (2, 4.869e24, 6.0518e6) -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - EARTH = (3, 5.976e24, 6.37814e6) -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - MARS = (6.421e23, 3.3972e6) # E?: Type checker error (optional) -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - JUPITER = 5 # E?: Type checker error (optional) -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -enums_member_values.py:41:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Planet.__init__ was called with the wrong arguments [wrong-arg-types] - -class Planet(Enum): -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - def __init__(self, value: int, mass: float, radius: float): -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - self._value_ = value -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - self.mass = mass -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - self.radius = radius -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -\u001b[1m\u001b[31m\u001b[39m\u001b[0m - MERCURY = (1, 3.303e23, 2.4397e6) -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - VENUS = (2, 4.869e24, 6.0518e6) -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - EARTH = (3, 5.976e24, 6.37814e6) -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - MARS = (6.421e23, 3.3972e6) # E?: Type checker error (optional) -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - JUPITER = 5 # E?: Type checker error (optional) -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -enums_member_values.py:85:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __init__: Type annotation for _value_ does not match type of assignment [annotation-type-mismatch] - - self._value_ = value # E - \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m - -enums_member_values.py:96:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Any [assert-type] - -assert_type(ColumnType.DORIC.value, int) # E? -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -""" diff --git a/conformance/results/pytype/enums_members.toml b/conformance/results/pytype/enums_members.toml deleted file mode 100644 index 2f5eb964d..000000000 --- a/conformance/results/pytype/enums_members.toml +++ /dev/null @@ -1,134 +0,0 @@ -conformant = "Partial" -notes = """ -Does not reject use of annotation with enum member. -Does not support `enum.member` and `enum.nonmember`. -Does not support `_ignore_` mechanism (optional). -""" -conformance_automated = "Fail" -errors_diff = """ -Line 50: Expected 1 errors -Line 116: Expected 1 errors -Line 129: Expected 1 errors -Line 7: Unexpected errors ['enums_members.py:7:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : enum.nonmember not supported yet [not-supported-yet]', 'enums_members.py:7:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : enum.member not supported yet [not-supported-yet]'] -Line 35: Unexpected errors ['enums_members.py:35:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : _enums_members.Pet2 [assert-type]'] -Line 36: Unexpected errors ['enums_members.py:36:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : _enums_members.Pet2 [assert-type]'] -Line 107: Unexpected errors ['enums_members.py:107:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in Example: Function enum.member expects 0 arg(s), got 1 [wrong-arg-count]'] -Line 108: Unexpected errors ['enums_members.py:108:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in Example: Function enum.nonmember expects 0 arg(s), got 1 [wrong-arg-count]'] -Line 110: Unexpected errors ['enums_members.py:110:6: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in Example: Function enum.member expects 0 arg(s), got 1 [wrong-arg-count]'] -Line 128: Unexpected errors ['enums_members.py:128:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method: Example2 [reveal-type]'] -""" -output = """ -enums_members.py:7:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : enum.nonmember not supported yet [not-supported-yet] - -from enum import Enum, member, nonmember -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -enums_members.py:7:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : enum.member not supported yet [not-supported-yet] - -from enum import Enum, member, nonmember -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -enums_members.py:15:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Pet.__init__ was called with the wrong arguments [wrong-arg-types] - -class Pet(Enum): # E?: Uninitialized attributes (pyre) -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - genus: str # Non-member attribute -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - species: str # Non-member attribute -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -\u001b[1m\u001b[31m\u001b[39m\u001b[0m - CAT = 1 # Member attribute -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - DOG = 2 # Member attribute -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -\u001b[1m\u001b[31m\u001b[39m\u001b[0m - def __init__(self, genus: str, species: str) -> None: -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - self.genus = genus -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - self.species = species -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -enums_members.py:35:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : _enums_members.Pet2 [assert-type] - -assert_type(Pet2.genus, str) -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -enums_members.py:36:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : _enums_members.Pet2 [assert-type] - -assert_type(Pet2.species, str) -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -enums_members.py:82:29: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] - -assert_type(Pet4.converter, Literal[Pet4.converter]) # E - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -enums_members.py:82:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Callable[[Any], Any] [assert-type] - -assert_type(Pet4.converter, Literal[Pet4.converter]) # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -enums_members.py:83:29: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] - -assert_type(Pet4.transform, Literal[Pet4.transform]) # E - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -enums_members.py:83:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Callable[[int], int] [assert-type] - -assert_type(Pet4.transform, Literal[Pet4.transform]) # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -enums_members.py:84:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : property [assert-type] - -assert_type(Pet4.species, Literal[Pet4.species]) # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -enums_members.py:84:27: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] - -assert_type(Pet4.species, Literal[Pet4.species]) # E - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -enums_members.py:85:25: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] - -assert_type(Pet4.speak, Literal[Pet4.speak]) # E - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -enums_members.py:85:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Callable[[Any], None] [assert-type] - -assert_type(Pet4.speak, Literal[Pet4.speak]) # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -enums_members.py:107:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Example: Function enum.member expects 0 arg(s), got 1 [wrong-arg-count] - - a = member(1) # Member attribute - \u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m - -enums_members.py:108:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Example: Function enum.nonmember expects 0 arg(s), got 1 [wrong-arg-count] - - b = nonmember(2) # Non-member attribute - \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m - -enums_members.py:110:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Example: Function enum.member expects 0 arg(s), got 1 [wrong-arg-count] - - @member - \u001b[1m\u001b[31m~~~~~~\u001b[39m\u001b[0m - -enums_members.py:128:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method: Example2 [reveal-type] - - reveal_type(Example2.__B) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -enums_members.py:146:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Pet5 [assert-type] - -assert_type(Pet5.DOG, int) # E?: Literal[2] is also acceptable -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -enums_members.py:147:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Pet5 [assert-type] - -assert_type(Pet5.FISH, int) # E?: Literal[3] is also acceptable -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -""" diff --git a/conformance/results/pytype/exceptions_context_managers.toml b/conformance/results/pytype/exceptions_context_managers.toml deleted file mode 100644 index 4d195209d..000000000 --- a/conformance/results/pytype/exceptions_context_managers.toml +++ /dev/null @@ -1,21 +0,0 @@ -conformant = "Unsupported" -notes = """ -Does not support code flow analysis. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 50: Unexpected errors ['exceptions_context_managers.py:50:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in suppress1: str [assert-type]'] -Line 57: Unexpected errors ['exceptions_context_managers.py:57:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in suppress2: str [assert-type]'] -""" -output = """ -exceptions_context_managers.py:50:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in suppress1: str [assert-type] - - assert_type(x, int | str) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -exceptions_context_managers.py:57:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in suppress2: str [assert-type] - - assert_type(x, int | str) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -""" diff --git a/conformance/results/pytype/generics_base_class.toml b/conformance/results/pytype/generics_base_class.toml deleted file mode 100644 index a3aa1cea9..000000000 --- a/conformance/results/pytype/generics_base_class.toml +++ /dev/null @@ -1,52 +0,0 @@ -conformant = "Partial" -notes = """ -False negative on passing SymbolTable to dict[str, list[object]]. -Does not reject illegal use of Generic. -Wrong type variable order when inheriting from multiple generic base classes. -""" -output = """ -generics_base_class.py:29:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'T' [invalid-annotation] - -def func1(y: Generic[T]): # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - x: Generic # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_base_class.py:49:22: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'LinkedList[int, int]' [invalid-annotation] - -linked_list_invalid: LinkedList[int, int] # E - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_base_class.py:61:18: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'MyDict[int, int]' [invalid-annotation] - -my_dict_invalid: MyDict[int, int] # E - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_base_class.py:68:17: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] - -class BadClass1(Generic[T, T]): # E - \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_base_class.py:90:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function takes_parent1 was called with the wrong arguments [wrong-arg-types] - -takes_parent1(child) # OK -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_base_class.py:91:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function takes_parent2 was called with the wrong arguments [wrong-arg-types] - -takes_parent2(child) # OK -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_base_class.py:98:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'BadChild' [invalid-annotation] - -class BadChild(Parent[T1, T2], Grandparent[T2, T1]): ... # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 26: Expected 1 errors -Line 30: Expected 1 errors -Line 90: Unexpected errors ['generics_base_class.py:90:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function takes_parent1 was called with the wrong arguments [wrong-arg-types]'] -Line 91: Unexpected errors ['generics_base_class.py:91:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function takes_parent2 was called with the wrong arguments [wrong-arg-types]'] -""" diff --git a/conformance/results/pytype/generics_basic.toml b/conformance/results/pytype/generics_basic.toml deleted file mode 100644 index db7695d22..000000000 --- a/conformance/results/pytype/generics_basic.toml +++ /dev/null @@ -1,108 +0,0 @@ -conformant = "Partial" -notes = """ -False positives in examples using constrained type variables. -Argument 'covariant' to TypeVar not supported. -False negative for type variables missing from Generic/Protocol base class. -False negative for generic metaclass. -""" -output = """ -generics_basic.py:34:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in concat: bad return type [bad-return-type] - - return x + y - \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m - -Called from (traceback): - line 67, in test_concat_subtype -generics_basic.py:40:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in test_concat: Function concat was called with the wrong arguments [wrong-arg-types] - - concat(s, b) # E - \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_basic.py:41:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in test_concat: Function concat was called with the wrong arguments [wrong-arg-types] - - concat(b, s) # E - \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_basic.py:49:18: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid TypeVar: the number of constraints must be 0 or more than 1 [invalid-typevar] - -BadConstraint1 = TypeVar("BadConstraint1", str) # E - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_basic.py:55:22: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Test: Invalid TypeVar: constraint cannot contain TypeVars [invalid-typevar] - - BadConstraint2 = TypeVar("BadConstraint2", str, list[T]) # E - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_basic.py:67:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in test_concat_subtype: MyStr [assert-type] - - assert_type(concat(m, m), str) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_basic.py:68:17: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in test_concat_subtype: Function concat was called with the wrong arguments [wrong-arg-types] - - assert_type(concat(m, s), str) - \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_basic.py:68:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in test_concat_subtype: Any [assert-type] - - assert_type(concat(m, s), str) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_basic.py:69:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in test_concat_subtype: Function concat was called with the wrong arguments [wrong-arg-types] - - concat(m, b) # E - \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_basic.py:121:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] - -class Pair2(Generic[T, T]): # E - \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_basic.py:157:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in test_my_map: unsupported operand type(s) for item retrieval: MyMap1[str, int] and int [unsupported-operands] - - m1[0] # E - \u001b[1m\u001b[31m~~~~~\u001b[39m\u001b[0m - -generics_basic.py:158:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in test_my_map: unsupported operand type(s) for item retrieval: MyMap2[int, str] and int [unsupported-operands] - - m2[0] # E - \u001b[1m\u001b[31m~~~~~\u001b[39m\u001b[0m - -generics_basic.py:162:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] - -class Bad1(Generic[int]): ... # E - \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_basic.py:163:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Protocol' [invalid-annotation] - -class Bad2(Protocol[int]): ... # E - \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_basic.py:168:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet] - -T_co = TypeVar("T_co", covariant=True) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_basic.py:169:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet] - -S_co = TypeVar("S_co", covariant=True) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_basic.py:199:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in test_my_iterable_any: Iterator[nothing] [assert-type] - - assert_type(iter(m), Iterator[Any]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 171: Expected 1 errors -Line 172: Expected 1 errors -Line 208: Expected 1 errors -Line 34: Unexpected errors ['generics_basic.py:34:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in concat: bad return type [bad-return-type]'] -Line 67: Unexpected errors ['generics_basic.py:67:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in test_concat_subtype: MyStr [assert-type]'] -Line 68: Unexpected errors ['generics_basic.py:68:17: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in test_concat_subtype: Function concat was called with the wrong arguments [wrong-arg-types]', 'generics_basic.py:68:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in test_concat_subtype: Any [assert-type]'] -Line 168: Unexpected errors ['generics_basic.py:168:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] -Line 169: Unexpected errors ['generics_basic.py:169:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] -Line 199: Unexpected errors ['generics_basic.py:199:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in test_my_iterable_any: Iterator[nothing] [assert-type]'] -""" diff --git a/conformance/results/pytype/generics_defaults.toml b/conformance/results/pytype/generics_defaults.toml deleted file mode 100644 index 68c0f8448..000000000 --- a/conformance/results/pytype/generics_defaults.toml +++ /dev/null @@ -1,335 +0,0 @@ -conformant = "Unsupported" -output = """ -generics_defaults.py:7:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing.Unpack not supported yet [not-supported-yet] - -from typing import Any, Callable, Generic, Self, Unpack, assert_type -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults.py:8:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing_extensions.TypeVarTuple not supported yet [not-supported-yet] - -from typing_extensions import TypeVar, ParamSpec, TypeVarTuple -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults.py:11:15: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] - -DefaultStrT = TypeVar("DefaultStrT", default=str) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults.py:12:15: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] - -DefaultIntT = TypeVar("DefaultIntT", default=int) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults.py:13:16: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] - -DefaultBoolT = TypeVar("DefaultBoolT", default=bool) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults.py:24:32: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] - -class NonDefaultFollowsDefault(Generic[DefaultStrT, T]): ... # E: non-default TypeVars cannot follow ones with defaults - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults.py:27:21: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] - -class NoNonDefaults(Generic[DefaultStrT, DefaultIntT]): ... - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults.py:30:33: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class NoNonDefaults is not indexable [not-indexable] - -assert_type(NoNonDefaults, type[NoNonDefaults[str, int]]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults.py:31:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class NoNonDefaults is not indexable [not-indexable] - -assert_type(NoNonDefaults[str], type[NoNonDefaults[str, int]]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults.py:31:38: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class NoNonDefaults is not indexable [not-indexable] - -assert_type(NoNonDefaults[str], type[NoNonDefaults[str, int]]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults.py:32:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class NoNonDefaults is not indexable [not-indexable] - -assert_type(NoNonDefaults[str, int], type[NoNonDefaults[str, int]]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults.py:32:43: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class NoNonDefaults is not indexable [not-indexable] - -assert_type(NoNonDefaults[str, int], type[NoNonDefaults[str, int]]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults.py:35:18: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] - -class OneDefault(Generic[T, DefaultBoolT]): ... - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults.py:38:37: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'OneDefault[float, bool]' [invalid-annotation] - -assert_type(OneDefault[float], type[OneDefault[float, bool]]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults.py:39:34: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'OneDefault[float, bool]' [invalid-annotation] - -assert_type(OneDefault[float](), OneDefault[float, bool]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults.py:42:22: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] - -class AllTheDefaults(Generic[T1, T2, DefaultStrT, DefaultIntT, DefaultBoolT]): ... - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults.py:45:34: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'AllTheDefaults[Any, Any, str, int, bool]' [invalid-annotation] - -assert_type(AllTheDefaults, type[AllTheDefaults[Any, Any, str, int, bool]]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults.py:47:40: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'AllTheDefaults[int, complex, str, int, bool]' [invalid-annotation] - - AllTheDefaults[int, complex], type[AllTheDefaults[int, complex, str, int, bool]] - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults.py:50:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'AllTheDefaults[int]' [invalid-annotation] - -AllTheDefaults[int] # E: expected 2 arguments to AllTheDefaults -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults.py:53:40: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'AllTheDefaults[int, complex, str, int, bool]' [invalid-annotation] - - AllTheDefaults[int, complex], type[AllTheDefaults[int, complex, str, int, bool]] - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults.py:56:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'AllTheDefaults[int, complex, str]' [invalid-annotation] - - AllTheDefaults[int, complex, str], - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults.py:57:10: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'AllTheDefaults[int, complex, str, int, bool]' [invalid-annotation] - - type[AllTheDefaults[int, complex, str, int, bool]], - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults.py:60:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'AllTheDefaults[int, complex, str, int]' [invalid-annotation] - - AllTheDefaults[int, complex, str, int], - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults.py:61:10: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'AllTheDefaults[int, complex, str, int, bool]' [invalid-annotation] - - type[AllTheDefaults[int, complex, str, int, bool]], - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults.py:64:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'AllTheDefaults[int, complex, str, int, bool]' [invalid-annotation] - - AllTheDefaults[int, complex, str, int, bool], - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults.py:65:10: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'AllTheDefaults[int, complex, str, int, bool]' [invalid-annotation] - - type[AllTheDefaults[int, complex, str, int, bool]], - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults.py:73:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] - -DefaultP = ParamSpec("DefaultP", default=[str, int]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults.py:76:23: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] - -class Class_ParamSpec(Generic[DefaultP]): ... - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults.py:79:35: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Class_ParamSpec is not indexable [not-indexable] - -assert_type(Class_ParamSpec, type[Class_ParamSpec[str, int]]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults.py:80:32: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Class_ParamSpec is not indexable [not-indexable] - -assert_type(Class_ParamSpec(), Class_ParamSpec[str, int]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults.py:81:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Class_ParamSpec is not indexable [not-indexable] - -assert_type(Class_ParamSpec[[bool, bool]](), Class_ParamSpec[bool, bool]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults.py:81:46: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Class_ParamSpec is not indexable [not-indexable] - -assert_type(Class_ParamSpec[[bool, bool]](), Class_ParamSpec[bool, bool]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults.py:91:26: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] - -class Class_TypeVarTuple(Generic[*DefaultTs]): ... - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults.py:94:38: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Class_TypeVarTuple is not indexable [not-indexable] - -assert_type(Class_TypeVarTuple, type[Class_TypeVarTuple[*tuple[str, int]]]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults.py:95:35: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Class_TypeVarTuple is not indexable [not-indexable] - -assert_type(Class_TypeVarTuple(), Class_TypeVarTuple[str, int]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults.py:96:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Class_TypeVarTuple is not indexable [not-indexable] - -assert_type(Class_TypeVarTuple[int, bool](), Class_TypeVarTuple[int, bool]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults.py:96:46: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Class_TypeVarTuple is not indexable [not-indexable] - -assert_type(Class_TypeVarTuple[int, bool](), Class_TypeVarTuple[int, bool]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults.py:99:61: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] - -AnotherDefaultTs = TypeVarTuple("AnotherDefaultTs", default=Unpack[DefaultTs]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults.py:106:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] - -Ok1 = TypeVar("Ok1", bound=float, default=int) # OK - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults.py:107:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] - -Invalid1 = TypeVar("Invalid1", bound=str, default=int) # E: the bound and default are incompatible - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults.py:113:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] - -Ok2 = TypeVar("Ok2", float, str, default=float) # OK - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults.py:114:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] - -Invalid2 = TypeVar("Invalid2", float, str, default=int) # E: expected one of float or str got int - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults.py:124:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] - -T4 = TypeVar("T4", default=int) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults.py:130:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Any [assert-type] - -assert_type(func1(0), int) -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults.py:138:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] - -T5 = TypeVar("T5", default=bool) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults.py:141:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] - -class Foo5(Generic[*Ts, T5]): ... # E - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults.py:148:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] - -P = ParamSpec("P", default=[float, bool]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults.py:151:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] - -class Foo6(Generic[*Ts, P]): ... # OK - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults.py:154:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Foo6 is not indexable [not-indexable] - -assert_type(Foo6[int, str], type[Foo6[int, str, [float, bool]]]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults.py:154:34: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Foo6 is not indexable [not-indexable] - -assert_type(Foo6[int, str], type[Foo6[int, str, [float, bool]]]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults.py:155:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Foo6 is not indexable [not-indexable] - -assert_type(Foo6[int, str, [bytes]], type[Foo6[int, str, [bytes]]]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults.py:155:43: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Foo6 is not indexable [not-indexable] - -assert_type(Foo6[int, str, [bytes]], type[Foo6[int, str, [bytes]]]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults.py:162:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] - -class Foo7(Generic[DefaultIntT]): - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults.py:169:34: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Foo7 is not indexable [not-indexable] - -assert_type(Foo7.meth, Callable[[Foo7[int]], Foo7[int]]) - \u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults.py:169:46: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Foo7 is not indexable [not-indexable] - -assert_type(Foo7.meth, Callable[[Foo7[int]], Foo7[int]]) - \u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults.py:169:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Callable[[Any], Self] [assert-type] - -assert_type(Foo7.meth, Callable[[Foo7[int]], Foo7[int]]) -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults.py:170:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Any [assert-type] - -assert_type(Foo7.attr, int) -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 7: Unexpected errors ['generics_defaults.py:7:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.Unpack not supported yet [not-supported-yet]'] -Line 8: Unexpected errors ['generics_defaults.py:8:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing_extensions.TypeVarTuple not supported yet [not-supported-yet]'] -Line 11: Unexpected errors ['generics_defaults.py:11:15: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] -Line 12: Unexpected errors ['generics_defaults.py:12:15: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] -Line 13: Unexpected errors ['generics_defaults.py:13:16: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] -Line 27: Unexpected errors ["generics_defaults.py:27:21: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] -Line 30: Unexpected errors ['generics_defaults.py:30:33: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class NoNonDefaults is not indexable [not-indexable]'] -Line 31: Unexpected errors ['generics_defaults.py:31:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class NoNonDefaults is not indexable [not-indexable]', 'generics_defaults.py:31:38: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class NoNonDefaults is not indexable [not-indexable]'] -Line 32: Unexpected errors ['generics_defaults.py:32:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class NoNonDefaults is not indexable [not-indexable]', 'generics_defaults.py:32:43: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class NoNonDefaults is not indexable [not-indexable]'] -Line 35: Unexpected errors ["generics_defaults.py:35:18: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] -Line 38: Unexpected errors ["generics_defaults.py:38:37: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'OneDefault[float, bool]' [invalid-annotation]"] -Line 39: Unexpected errors ["generics_defaults.py:39:34: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'OneDefault[float, bool]' [invalid-annotation]"] -Line 42: Unexpected errors ["generics_defaults.py:42:22: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] -Line 45: Unexpected errors ["generics_defaults.py:45:34: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'AllTheDefaults[Any, Any, str, int, bool]' [invalid-annotation]"] -Line 47: Unexpected errors ["generics_defaults.py:47:40: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'AllTheDefaults[int, complex, str, int, bool]' [invalid-annotation]"] -Line 53: Unexpected errors ["generics_defaults.py:53:40: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'AllTheDefaults[int, complex, str, int, bool]' [invalid-annotation]"] -Line 56: Unexpected errors ["generics_defaults.py:56:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'AllTheDefaults[int, complex, str]' [invalid-annotation]"] -Line 57: Unexpected errors ["generics_defaults.py:57:10: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'AllTheDefaults[int, complex, str, int, bool]' [invalid-annotation]"] -Line 60: Unexpected errors ["generics_defaults.py:60:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'AllTheDefaults[int, complex, str, int]' [invalid-annotation]"] -Line 61: Unexpected errors ["generics_defaults.py:61:10: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'AllTheDefaults[int, complex, str, int, bool]' [invalid-annotation]"] -Line 64: Unexpected errors ["generics_defaults.py:64:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'AllTheDefaults[int, complex, str, int, bool]' [invalid-annotation]"] -Line 65: Unexpected errors ["generics_defaults.py:65:10: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'AllTheDefaults[int, complex, str, int, bool]' [invalid-annotation]"] -Line 73: Unexpected errors ['generics_defaults.py:73:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] -Line 76: Unexpected errors ["generics_defaults.py:76:23: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] -Line 79: Unexpected errors ['generics_defaults.py:79:35: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Class_ParamSpec is not indexable [not-indexable]'] -Line 80: Unexpected errors ['generics_defaults.py:80:32: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Class_ParamSpec is not indexable [not-indexable]'] -Line 81: Unexpected errors ['generics_defaults.py:81:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Class_ParamSpec is not indexable [not-indexable]', 'generics_defaults.py:81:46: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Class_ParamSpec is not indexable [not-indexable]'] -Line 91: Unexpected errors ["generics_defaults.py:91:26: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] -Line 94: Unexpected errors ['generics_defaults.py:94:38: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Class_TypeVarTuple is not indexable [not-indexable]'] -Line 95: Unexpected errors ['generics_defaults.py:95:35: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Class_TypeVarTuple is not indexable [not-indexable]'] -Line 96: Unexpected errors ['generics_defaults.py:96:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Class_TypeVarTuple is not indexable [not-indexable]', 'generics_defaults.py:96:46: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Class_TypeVarTuple is not indexable [not-indexable]'] -Line 99: Unexpected errors ["generics_defaults.py:99:61: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] -Line 106: Unexpected errors ['generics_defaults.py:106:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] -Line 113: Unexpected errors ['generics_defaults.py:113:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] -Line 124: Unexpected errors ['generics_defaults.py:124:6: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] -Line 130: Unexpected errors ['generics_defaults.py:130:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Any [assert-type]'] -Line 138: Unexpected errors ['generics_defaults.py:138:6: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] -Line 148: Unexpected errors ['generics_defaults.py:148:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] -Line 151: Unexpected errors ["generics_defaults.py:151:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] -Line 154: Unexpected errors ['generics_defaults.py:154:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Foo6 is not indexable [not-indexable]', 'generics_defaults.py:154:34: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Foo6 is not indexable [not-indexable]'] -Line 155: Unexpected errors ['generics_defaults.py:155:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Foo6 is not indexable [not-indexable]', 'generics_defaults.py:155:43: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Foo6 is not indexable [not-indexable]'] -Line 162: Unexpected errors ["generics_defaults.py:162:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] -Line 169: Unexpected errors ['generics_defaults.py:169:34: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Foo7 is not indexable [not-indexable]', 'generics_defaults.py:169:46: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Foo7 is not indexable [not-indexable]', 'generics_defaults.py:169:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Callable[[Any], Self] [assert-type]'] -Line 170: Unexpected errors ['generics_defaults.py:170:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Any [assert-type]'] -""" diff --git a/conformance/results/pytype/generics_defaults_referential.toml b/conformance/results/pytype/generics_defaults_referential.toml deleted file mode 100644 index 08636f341..000000000 --- a/conformance/results/pytype/generics_defaults_referential.toml +++ /dev/null @@ -1,217 +0,0 @@ -conformant = "Unsupported" -output = """ -generics_defaults_referential.py:14:15: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] - -DefaultStrT = TypeVar("DefaultStrT", default=str) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults_referential.py:15:10: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] - -StartT = TypeVar("StartT", default=int) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults_referential.py:16:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] - -StopT = TypeVar("StopT", default=StartT) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults_referential.py:17:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] - -StepT = TypeVar("StepT", default=int | None) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults_referential.py:20:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] - -class slice(Generic[StartT, StopT, StepT]): ... - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults_referential.py:23:25: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class slice is not indexable [not-indexable] - -assert_type(slice, type[slice[int, int, int | None]]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults_referential.py:24:22: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class slice is not indexable [not-indexable] - -assert_type(slice(), slice[int, int, int | None]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults_referential.py:25:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class slice is not indexable [not-indexable] - -assert_type(slice[str](), slice[str, str, int | None]) - \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults_referential.py:25:27: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class slice is not indexable [not-indexable] - -assert_type(slice[str](), slice[str, str, int | None]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults_referential.py:26:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class slice is not indexable [not-indexable] - -assert_type(slice[str, bool, complex](), slice[str, bool, complex]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults_referential.py:26:42: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class slice is not indexable [not-indexable] - -assert_type(slice[str, bool, complex](), slice[str, bool, complex]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults_referential.py:28:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] - -T2 = TypeVar("T2", default=DefaultStrT) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults_referential.py:31:11: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] - -class Foo(Generic[DefaultStrT, T2]): - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults_referential.py:35:25: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Foo is not indexable [not-indexable] - -assert_type(Foo(1, ""), Foo[int, str]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults_referential.py:36:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Foo is not indexable [not-indexable] - -Foo[int](1, "") # E: Foo[int, str] cannot be assigned to self: Foo[int, int] in Foo.__init__ -\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults_referential.py:37:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Foo is not indexable [not-indexable] - -Foo[int]("", 1) # E: Foo[str, int] cannot be assigned to self: Foo[int, int] in Foo.__init__ -\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults_referential.py:43:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] - -S2 = TypeVar("S2", default=S1) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults_referential.py:46:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] - -class Foo2(Generic[S1, S2]): ... # OK - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults_referential.py:49:11: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] - -Start2T = TypeVar("Start2T", default="StopT") - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults_referential.py:50:10: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] - -Stop2T = TypeVar("Stop2T", default=int) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults_referential.py:53:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] - -class slice2(Generic[Start2T, Stop2T, StepT]): ... # E: bad ordering - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults_referential.py:60:16: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Foo3: Invalid type annotation 'Generic' [invalid-annotation] - - class Bar2(Generic[S2]): ... # E - \u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults_referential.py:66:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] - -Ok1 = TypeVar("Ok1", default=X1, bound=float) # OK - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults_referential.py:67:11: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] - -AlsoOk1 = TypeVar("AlsoOk1", default=X1, bound=int) # OK - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults_referential.py:68:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] - -Invalid1 = TypeVar("Invalid1", default=X1, bound=str) # E: int is not a subtype of str - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults_referential.py:74:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] - -Invalid2 = TypeVar("Invalid2", float, str, default=Y1) # E: upper bound int is incompatible with constraints float or str - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults_referential.py:77:11: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] - -AlsoOk2 = TypeVar("AlsoOk2", int, str, bool, default=Y2) # OK - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults_referential.py:78:16: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] - -AlsoInvalid2 = TypeVar("AlsoInvalid2", bool, complex, default=Y2) # E: {bool, complex} is not a superset of {int, str} - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults_referential.py:87:16: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] - -ListDefaultT = TypeVar("ListDefaultT", default=list[Z1]) # OK - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults_referential.py:90:11: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] - -class Bar(Generic[Z1, ListDefaultT]): # OK - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults_referential.py:94:23: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Bar[Any, list]' [invalid-annotation] - -assert_type(Bar, type[Bar[Any, list[Any]]]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults_referential.py:95:28: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Bar[int, list[int]]' [invalid-annotation] - -assert_type(Bar[int], type[Bar[int, list[int]]]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults_referential.py:96:30: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Bar[int, list[int]]' [invalid-annotation] - -assert_type(Bar[int](0, []), Bar[int, list[int]]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults_referential.py:97:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Bar[int, list[str]]' [invalid-annotation] - -assert_type(Bar[int, list[str]](0, []), Bar[int, list[str]]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults_referential.py:97:41: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Bar[int, list[str]]' [invalid-annotation] - -assert_type(Bar[int, list[str]](0, []), Bar[int, list[str]]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults_referential.py:98:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Bar[int, str]' [invalid-annotation] - -assert_type(Bar[int, str](0, ""), Bar[int, str]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults_referential.py:98:35: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Bar[int, str]' [invalid-annotation] - -assert_type(Bar[int, str](0, ""), Bar[int, str]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 14: Unexpected errors ['generics_defaults_referential.py:14:15: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] -Line 15: Unexpected errors ['generics_defaults_referential.py:15:10: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] -Line 16: Unexpected errors ['generics_defaults_referential.py:16:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] -Line 17: Unexpected errors ['generics_defaults_referential.py:17:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] -Line 20: Unexpected errors ["generics_defaults_referential.py:20:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] -Line 23: Unexpected errors ['generics_defaults_referential.py:23:25: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class slice is not indexable [not-indexable]'] -Line 24: Unexpected errors ['generics_defaults_referential.py:24:22: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class slice is not indexable [not-indexable]'] -Line 25: Unexpected errors ['generics_defaults_referential.py:25:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class slice is not indexable [not-indexable]', 'generics_defaults_referential.py:25:27: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class slice is not indexable [not-indexable]'] -Line 26: Unexpected errors ['generics_defaults_referential.py:26:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class slice is not indexable [not-indexable]', 'generics_defaults_referential.py:26:42: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class slice is not indexable [not-indexable]'] -Line 28: Unexpected errors ['generics_defaults_referential.py:28:6: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] -Line 31: Unexpected errors ["generics_defaults_referential.py:31:11: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] -Line 35: Unexpected errors ['generics_defaults_referential.py:35:25: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Foo is not indexable [not-indexable]'] -Line 43: Unexpected errors ['generics_defaults_referential.py:43:6: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] -Line 46: Unexpected errors ["generics_defaults_referential.py:46:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] -Line 49: Unexpected errors ['generics_defaults_referential.py:49:11: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] -Line 50: Unexpected errors ['generics_defaults_referential.py:50:10: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] -Line 66: Unexpected errors ['generics_defaults_referential.py:66:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] -Line 67: Unexpected errors ['generics_defaults_referential.py:67:11: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] -Line 77: Unexpected errors ['generics_defaults_referential.py:77:11: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] -Line 87: Unexpected errors ['generics_defaults_referential.py:87:16: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] -Line 90: Unexpected errors ["generics_defaults_referential.py:90:11: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] -Line 94: Unexpected errors ["generics_defaults_referential.py:94:23: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Bar[Any, list]' [invalid-annotation]"] -Line 95: Unexpected errors ["generics_defaults_referential.py:95:28: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Bar[int, list[int]]' [invalid-annotation]"] -Line 96: Unexpected errors ["generics_defaults_referential.py:96:30: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Bar[int, list[int]]' [invalid-annotation]"] -Line 97: Unexpected errors ["generics_defaults_referential.py:97:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Bar[int, list[str]]' [invalid-annotation]", "generics_defaults_referential.py:97:41: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Bar[int, list[str]]' [invalid-annotation]"] -Line 98: Unexpected errors ["generics_defaults_referential.py:98:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Bar[int, str]' [invalid-annotation]", "generics_defaults_referential.py:98:35: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Bar[int, str]' [invalid-annotation]"] -""" diff --git a/conformance/results/pytype/generics_defaults_specialization.toml b/conformance/results/pytype/generics_defaults_specialization.toml deleted file mode 100644 index 2b77a0a3e..000000000 --- a/conformance/results/pytype/generics_defaults_specialization.toml +++ /dev/null @@ -1,104 +0,0 @@ -conformant = "Unsupported" -output = """ -generics_defaults_specialization.py:15:15: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] - -DefaultIntT = TypeVar("DefaultIntT", default=int) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults_specialization.py:16:15: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] - -DefaultStrT = TypeVar("DefaultStrT", default=str) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults_specialization.py:25:28: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'SomethingWithNoDefaults[int, Any][bool]' [invalid-annotation] - -def func1(p1: MyAlias, p2: MyAlias[bool]): - \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults_specialization.py:26:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: SomethingWithNoDefaults[int, Any] [assert-type] - - assert_type(p1, SomethingWithNoDefaults[int, str]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults_specialization.py:27:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: SomethingWithNoDefaults[int, Any] [assert-type] - - assert_type(p2, SomethingWithNoDefaults[int, bool]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults_specialization.py:30:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'SomethingWithNoDefaults[int, Any][bool, int]' [invalid-annotation] - -MyAlias[bool, int] # E: too many arguments passed to MyAlias -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults_specialization.py:38:18: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] - -class SubclassMe(Generic[T1, DefaultStrT]): - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults_specialization.py:42:11: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'SubclassMe[int, Any]' [invalid-annotation] - -class Bar(SubclassMe[int, DefaultStrT]): ... - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults_specialization.py:45:23: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Bar is not indexable [not-indexable] - -assert_type(Bar, type[Bar[str]]) - \u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults_specialization.py:46:20: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Bar is not indexable [not-indexable] - -assert_type(Bar(), Bar[str]) - \u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults_specialization.py:47:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Bar is not indexable [not-indexable] - -assert_type(Bar[bool](), Bar[bool]) - \u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults_specialization.py:47:26: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Bar is not indexable [not-indexable] - -assert_type(Bar[bool](), Bar[bool]) - \u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults_specialization.py:53:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Any [assert-type] - -assert_type(Foo().x, str) -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults_specialization.py:55:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Foo is not indexable [not-indexable] - -Foo[str] # E: Foo cannot be further subscripted -\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults_specialization.py:58:11: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] - -class Baz(Generic[DefaultIntT, DefaultStrT]): ... - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults_specialization.py:65:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Baz is not indexable [not-indexable] - -v1: Baz[int, str] = Spam() - \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_defaults_specialization.py:65:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Baz[int, str]' [invalid-annotation] - -v1: Baz[int, str] = Spam() -\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 15: Unexpected errors ['generics_defaults_specialization.py:15:15: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] -Line 16: Unexpected errors ['generics_defaults_specialization.py:16:15: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] -Line 25: Unexpected errors ["generics_defaults_specialization.py:25:28: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'SomethingWithNoDefaults[int, Any][bool]' [invalid-annotation]"] -Line 26: Unexpected errors ['generics_defaults_specialization.py:26:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: SomethingWithNoDefaults[int, Any] [assert-type]'] -Line 27: Unexpected errors ['generics_defaults_specialization.py:27:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: SomethingWithNoDefaults[int, Any] [assert-type]'] -Line 38: Unexpected errors ["generics_defaults_specialization.py:38:18: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] -Line 42: Unexpected errors ["generics_defaults_specialization.py:42:11: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'SubclassMe[int, Any]' [invalid-annotation]"] -Line 45: Unexpected errors ['generics_defaults_specialization.py:45:23: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Bar is not indexable [not-indexable]'] -Line 46: Unexpected errors ['generics_defaults_specialization.py:46:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Bar is not indexable [not-indexable]'] -Line 47: Unexpected errors ['generics_defaults_specialization.py:47:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Bar is not indexable [not-indexable]', 'generics_defaults_specialization.py:47:26: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Bar is not indexable [not-indexable]'] -Line 53: Unexpected errors ['generics_defaults_specialization.py:53:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Any [assert-type]'] -Line 58: Unexpected errors ["generics_defaults_specialization.py:58:11: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] -Line 65: Unexpected errors ['generics_defaults_specialization.py:65:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Baz is not indexable [not-indexable]', "generics_defaults_specialization.py:65:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Baz[int, str]' [invalid-annotation]"] -""" diff --git a/conformance/results/pytype/generics_paramspec_basic.toml b/conformance/results/pytype/generics_paramspec_basic.toml deleted file mode 100644 index e57c04905..000000000 --- a/conformance/results/pytype/generics_paramspec_basic.toml +++ /dev/null @@ -1,17 +0,0 @@ -conformant = "Unsupported" -notes = """ -Does not support ParamSpec. -""" -output = """ -AssertionError: -""" -conformance_automated = "Fail" -errors_diff = """ -Line 10: Expected 1 errors -Line 15: Expected 1 errors -Line 23: Expected 1 errors -Line 27: Expected 1 errors -Line 31: Expected 1 errors -Line 35: Expected 1 errors -Line 39: Expected 1 errors -""" diff --git a/conformance/results/pytype/generics_paramspec_components.toml b/conformance/results/pytype/generics_paramspec_components.toml deleted file mode 100644 index 247d208ed..000000000 --- a/conformance/results/pytype/generics_paramspec_components.toml +++ /dev/null @@ -1,26 +0,0 @@ -conformant = "Unsupported" -notes = """ -Does not support ParamSpec. -""" -output = """ -NotImplementedError: ParamSpecArgs -""" -conformance_automated = "Fail" -errors_diff = """ -Line 17: Expected 1 errors -Line 20: Expected 1 errors -Line 23: Expected 1 errors -Line 26: Expected 1 errors -Line 30: Expected 1 errors -Line 35: Expected 1 errors -Line 36: Expected 1 errors -Line 38: Expected 1 errors -Line 41: Expected 1 errors -Line 49: Expected 1 errors -Line 51: Expected 1 errors -Line 60: Expected 1 errors -Line 70: Expected 1 errors -Line 72: Expected 1 errors -Line 83: Expected 1 errors -Line 98: Expected 1 errors -""" diff --git a/conformance/results/pytype/generics_paramspec_semantics.toml b/conformance/results/pytype/generics_paramspec_semantics.toml deleted file mode 100644 index d9d0175b6..000000000 --- a/conformance/results/pytype/generics_paramspec_semantics.toml +++ /dev/null @@ -1,19 +0,0 @@ -conformant = "Unsupported" -notes = """ -Does not support ParamSpec. -""" -output = """ -AssertionError: -""" -conformance_automated = "Fail" -errors_diff = """ -Line 26: Expected 1 errors -Line 27: Expected 1 errors -Line 61: Expected 1 errors -Line 98: Expected 1 errors -Line 108: Expected 1 errors -Line 120: Expected 1 errors -Line 127: Expected 1 errors -Line 132: Expected 1 errors -Line 137: Expected 1 errors -""" diff --git a/conformance/results/pytype/generics_paramspec_specialization.toml b/conformance/results/pytype/generics_paramspec_specialization.toml deleted file mode 100644 index cbe272e96..000000000 --- a/conformance/results/pytype/generics_paramspec_specialization.toml +++ /dev/null @@ -1,79 +0,0 @@ -conformant = "Partial" -notes = """ -Rejects valid specialization of ParamSpec using list expression. -Does not reject invalid specialization of class with both TypeVar and ParamSpec. -Reports error for valid method call involving ParamSpec. -""" -output = """ -generics_paramspec_specialization.py:32:15: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '[int, bool]' [invalid-annotation] - -def func22(x: ClassB[int, [int, bool], ...]) -> str: # OK - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_paramspec_specialization.py:32:15: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Ellipsis' [invalid-annotation] - -def func22(x: ClassB[int, [int, bool], ...]) -> str: # OK - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_paramspec_specialization.py:36:15: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Ellipsis' [invalid-annotation] - -def func23(x: ClassA[int, ...]) -> str: # OK - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_paramspec_specialization.py:40:15: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '[]' [invalid-annotation] - -def func24(x: ClassB[int, [], []]) -> str: # OK - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_paramspec_specialization.py:52:15: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '[int, str, bool]' [invalid-annotation] - -def func30(x: ClassC[[int, str, bool]]) -> None: # OK - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_paramspec_specialization.py:53:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func30: Function expects 1 arg(s), got 3 [wrong-arg-count] - - x.f(0, "", True) # OK - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_paramspec_specialization.py:54:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func30: Function expects 1 arg(s), got 3 [wrong-arg-count] - - x.f("", "", True) # E - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_paramspec_specialization.py:55:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func30: Function expects 1 arg(s), got 3 [wrong-arg-count] - - x.f(0, "", "") # E - \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_paramspec_specialization.py:58:15: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'ClassC[int, str, bool]' [invalid-annotation] - -def func31(x: ClassC[int, str, bool]) -> None: # OK - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_paramspec_specialization.py:59:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func31: Function expects 1 arg(s), got 3 [wrong-arg-count] - - x.f(0, "", True) # OK - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_paramspec_specialization.py:60:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func31: Function expects 1 arg(s), got 3 [wrong-arg-count] - - x.f("", "", True) # E - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_paramspec_specialization.py:61:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func31: Function expects 1 arg(s), got 3 [wrong-arg-count] - - x.f(0, "", "") # E - \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 44: Expected 1 errors -Line 32: Unexpected errors ["generics_paramspec_specialization.py:32:15: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '[int, bool]' [invalid-annotation]", "generics_paramspec_specialization.py:32:15: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Ellipsis' [invalid-annotation]"] -Line 36: Unexpected errors ["generics_paramspec_specialization.py:36:15: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Ellipsis' [invalid-annotation]"] -Line 40: Unexpected errors ["generics_paramspec_specialization.py:40:15: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '[]' [invalid-annotation]"] -Line 52: Unexpected errors ["generics_paramspec_specialization.py:52:15: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '[int, str, bool]' [invalid-annotation]"] -Line 53: Unexpected errors ['generics_paramspec_specialization.py:53:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func30: Function expects 1 arg(s), got 3 [wrong-arg-count]'] -Line 58: Unexpected errors ["generics_paramspec_specialization.py:58:15: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'ClassC[int, str, bool]' [invalid-annotation]"] -Line 59: Unexpected errors ['generics_paramspec_specialization.py:59:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func31: Function expects 1 arg(s), got 3 [wrong-arg-count]'] -""" diff --git a/conformance/results/pytype/generics_scoping.toml b/conformance/results/pytype/generics_scoping.toml deleted file mode 100644 index 32c0fd18d..000000000 --- a/conformance/results/pytype/generics_scoping.toml +++ /dev/null @@ -1,96 +0,0 @@ -conformant = "Partial" -notes = """ -Fails to reject type alias within generic class that uses class's type variable. -Fails to reject unbound type variable in constructor call in global scope. -""" -output = """ -generics_scoping.py:29:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function MyClass.meth_2 was called with the wrong arguments [wrong-arg-types] - -a.meth_2('a') # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_scoping.py:50:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in fun_3: Invalid type annotation 'list[S]' for z [invalid-annotation] - - z: list[S] = [] # E - \u001b[1m\u001b[31m~\u001b[39m\u001b[0m - -generics_scoping.py:54:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Bar: Invalid type annotation 'list[S]' for an_attr [invalid-annotation] - - an_attr: list[S] = [] # E - \u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m - -generics_scoping.py:63:23: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in fun_4: Invalid type annotation 'T' [invalid-annotation] - - a_list: list[T] = [] # OK - \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -generics_scoping.py:74:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Outer' [invalid-annotation] - -class Outer(Generic[T]): -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - class Bad(Iterable[T]): # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - ... -\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m - class AlsoBad: -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - x: list[T] # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -\u001b[1m\u001b[31m\u001b[39m\u001b[0m - def __init__(self, x: list[T]) -> None: -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - self.x = x -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -\u001b[1m\u001b[31m\u001b[39m\u001b[0m - class Inner(Iterable[S]): # OK -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - ... -\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m - attr: Inner[T] # OK -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -\u001b[1m\u001b[31m\u001b[39m\u001b[0m - alias: TypeAlias = list[T] # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -\u001b[1m\u001b[31m\u001b[39m\u001b[0m - def __init__(self, attr: Inner[T]) -> None: -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - self.attr = attr -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_scoping.py:78:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in AlsoBad: Invalid type annotation 'list[T]' for x [invalid-annotation] - - x: list[T] # E - \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m - -generics_scoping.py:80:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in AlsoBad: Invalid type annotation 'T' [invalid-annotation] - - def __init__(self, x: list[T]) -> None: - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - self.x = x -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_scoping.py:94:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'T' for global_var1 [invalid-annotation] - -global_var1: T # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_scoping.py:95:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'list[T]' for global_var2 [invalid-annotation] - -global_var2: list[T] = [] # E -\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 65: Expected 1 errors -Line 75: Expected 1 errors -Line 87: Expected 1 errors -Line 96: Expected 1 errors -Line 63: Unexpected errors ["generics_scoping.py:63:23: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in fun_4: Invalid type annotation 'T' [invalid-annotation]"] -Line 74: Unexpected errors ["generics_scoping.py:74:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Outer' [invalid-annotation]"] -Line 80: Unexpected errors ["generics_scoping.py:80:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in AlsoBad: Invalid type annotation 'T' [invalid-annotation]"] -""" diff --git a/conformance/results/pytype/generics_self_advanced.toml b/conformance/results/pytype/generics_self_advanced.toml deleted file mode 100644 index c2cc90e86..000000000 --- a/conformance/results/pytype/generics_self_advanced.toml +++ /dev/null @@ -1,91 +0,0 @@ -conformant = "Unsupported" -notes = """ -Does not understand `Self` type. -""" -output = """ -generics_self_advanced.py:12:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in prop1: bad return type [bad-return-type] - - ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m - -Called from (traceback): - line 19, in current file -generics_self_advanced.py:12:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in prop1: bad return type [bad-return-type] - - ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m - -Called from (traceback): - line 18, in current file -generics_self_advanced.py:19:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : ParentA [assert-type] - -assert_type(ChildA().prop1, ChildA) -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_self_advanced.py:29:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method1: bad return type [bad-return-type] - - ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m - -Called from (traceback): - line 38, in method2 -generics_self_advanced.py:29:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method1: bad return type [bad-return-type] - - ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m - -generics_self_advanced.py:35:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method2: ChildB [assert-type] - - assert_type(self, Self) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_self_advanced.py:36:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method2: list[ChildB] [assert-type] - - assert_type(self.a, list[Self]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_self_advanced.py:37:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method2: ChildB [assert-type] - - assert_type(self.a[0], Self) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_self_advanced.py:38:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method2: ChildB [assert-type] - - assert_type(self.method1(), Self) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_self_advanced.py:42:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method3: type[ChildB] [assert-type] - - assert_type(cls, type[Self]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_self_advanced.py:43:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method3: list[ChildB] [assert-type] - - assert_type(cls.a, list[Self]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_self_advanced.py:44:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method3: ChildB [assert-type] - - assert_type(cls.a[0], Self) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_self_advanced.py:45:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method3: ChildB [assert-type] - - assert_type(cls.method1(), Self) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 12: Unexpected errors ['generics_self_advanced.py:12:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in prop1: bad return type [bad-return-type]', 'generics_self_advanced.py:12:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in prop1: bad return type [bad-return-type]'] -Line 19: Unexpected errors ['generics_self_advanced.py:19:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : ParentA [assert-type]'] -Line 29: Unexpected errors ['generics_self_advanced.py:29:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method1: bad return type [bad-return-type]', 'generics_self_advanced.py:29:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method1: bad return type [bad-return-type]'] -Line 35: Unexpected errors ['generics_self_advanced.py:35:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method2: ChildB [assert-type]'] -Line 36: Unexpected errors ['generics_self_advanced.py:36:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method2: list[ChildB] [assert-type]'] -Line 37: Unexpected errors ['generics_self_advanced.py:37:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method2: ChildB [assert-type]'] -Line 38: Unexpected errors ['generics_self_advanced.py:38:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method2: ChildB [assert-type]'] -Line 42: Unexpected errors ['generics_self_advanced.py:42:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method3: type[ChildB] [assert-type]'] -Line 43: Unexpected errors ['generics_self_advanced.py:43:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method3: list[ChildB] [assert-type]'] -Line 44: Unexpected errors ['generics_self_advanced.py:44:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method3: ChildB [assert-type]'] -Line 45: Unexpected errors ['generics_self_advanced.py:45:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method3: ChildB [assert-type]'] -""" diff --git a/conformance/results/pytype/generics_self_attributes.toml b/conformance/results/pytype/generics_self_attributes.toml deleted file mode 100644 index 8079a601d..000000000 --- a/conformance/results/pytype/generics_self_attributes.toml +++ /dev/null @@ -1,15 +0,0 @@ -conformant = "Unsupported" -notes = """ -Does not understand `Self` type. -""" -output = """ -generics_self_attributes.py:26:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function OrdinalLinkedList.__init__ was called with the wrong arguments [wrong-arg-types] - -xs = OrdinalLinkedList(value=1, next=LinkedList[int](value=2)) # E - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 32: Expected 1 errors -""" diff --git a/conformance/results/pytype/generics_self_basic.toml b/conformance/results/pytype/generics_self_basic.toml deleted file mode 100644 index 28ff372ae..000000000 --- a/conformance/results/pytype/generics_self_basic.toml +++ /dev/null @@ -1,70 +0,0 @@ -conformant = "Unsupported" -notes = """ -Does not understand `Self` type. -""" -output = """ -generics_self_basic.py:14:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in set_scale: Shape [assert-type] - - assert_type(self, Self) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_self_basic.py:14:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in set_scale: Circle [assert-type] - - assert_type(self, Self) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -Called from (traceback): - line 52, in current file -generics_self_basic.py:27:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in from_config: type[Shape] [assert-type] - - assert_type(cls, type[Self]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -Called from (traceback): - line 54, in current file -generics_self_basic.py:27:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in from_config: type[Circle] [assert-type] - - assert_type(cls, type[Self]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -Called from (traceback): - line 55, in current file -generics_self_basic.py:40:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in difference: Shape [assert-type] - - assert_type(other, Self) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_self_basic.py:64:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in set_value: bad return type [bad-return-type] - - def set_value(self, value: T) -> Self: ... -\u001b[1m\u001b[31m\u001b[39m\u001b[0m - -Called from (traceback): - line 75, in object_with_concrete_type -generics_self_basic.py:64:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in set_value: bad return type [bad-return-type] - - def set_value(self, value: T) -> Self: ... -\u001b[1m\u001b[31m\u001b[39m\u001b[0m - -Called from (traceback): - line 74, in object_with_concrete_type -generics_self_basic.py:64:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in set_value: bad return type [bad-return-type] - - def set_value(self, value: T) -> Self: ... -\u001b[1m\u001b[31m\u001b[39m\u001b[0m - -generics_self_basic.py:67:26: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Container: unsupported operand type(s) for item retrieval: 'Self: TypeVar' and 'int: type[int]' [unsupported-operands] - - def foo(self, other: Self[int]) -> None: # E - \u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 20: Expected 1 errors -Line 33: Expected 1 errors -Line 14: Unexpected errors ['generics_self_basic.py:14:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in set_scale: Shape [assert-type]', 'generics_self_basic.py:14:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in set_scale: Circle [assert-type]'] -Line 27: Unexpected errors ['generics_self_basic.py:27:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in from_config: type[Shape] [assert-type]', 'generics_self_basic.py:27:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in from_config: type[Circle] [assert-type]'] -Line 40: Unexpected errors ['generics_self_basic.py:40:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in difference: Shape [assert-type]'] -Line 64: Unexpected errors ['generics_self_basic.py:64:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in set_value: bad return type [bad-return-type]', 'generics_self_basic.py:64:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in set_value: bad return type [bad-return-type]', 'generics_self_basic.py:64:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in set_value: bad return type [bad-return-type]'] -""" diff --git a/conformance/results/pytype/generics_self_protocols.toml b/conformance/results/pytype/generics_self_protocols.toml deleted file mode 100644 index 2f76c782b..000000000 --- a/conformance/results/pytype/generics_self_protocols.toml +++ /dev/null @@ -1,12 +0,0 @@ -conformant = "Partial" -notes = """ -Does not reject protocol compatibility due to method `Self` return type. -""" -output = """ - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 61: Expected 1 errors -Line 64: Expected 1 errors -""" diff --git a/conformance/results/pytype/generics_self_usage.toml b/conformance/results/pytype/generics_self_usage.toml deleted file mode 100644 index 84de50aed..000000000 --- a/conformance/results/pytype/generics_self_usage.toml +++ /dev/null @@ -1,78 +0,0 @@ -conformant = "Unsupported" -notes = """ -Does not understand `Self` type. -""" -output = """ -generics_self_usage.py:58:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in foo: Invalid type annotation 'Self' [invalid-annotation] - - def nested(z: int, inner_self: Self) -> Self: - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - print(z) -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - print(inner_self.x) -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - return inner_self -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_self_usage.py:73:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Self' [invalid-annotation] - -def foo(bar: Self) -> Self: ... # E: not within a class -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_self_usage.py:76:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Self' for bar [invalid-annotation] - -bar: Self # E: not within a class -\u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m - -generics_self_usage.py:82:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in has_existing_self_annotation: bad return type [bad-return-type] - - def has_existing_self_annotation(self: TFoo2) -> Self: ... # E -\u001b[1m\u001b[31m\u001b[39m\u001b[0m - -generics_self_usage.py:86:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in return_concrete_type: bad return type [bad-return-type] - - return Foo3() # E (see FooChild below for rationale) - \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - -Called from (traceback): - line 92, in child_method -generics_self_usage.py:103:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid base class: Self [base-class-error] - -class Baz2(Self): ... # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_self_usage.py:111:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Base: Invalid type annotation 'Self' [invalid-annotation] - - def make() -> Self: # E - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - ... -\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_self_usage.py:116:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Base: Invalid type annotation 'Self' [invalid-annotation] - - def return_parameter(foo: Self) -> Self: # E - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - ... -\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_self_usage.py:122:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __new__: bad return type [bad-return-type] - - ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m - -generics_self_usage.py:126:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __mul__: bad return type [bad-return-type] - - ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 101: Expected 1 errors -Line 106: Expected 1 errors -Line 121: Expected 1 errors -Line 125: Expected 1 errors -Line 58: Unexpected errors ["generics_self_usage.py:58:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in foo: Invalid type annotation 'Self' [invalid-annotation]"] -Line 122: Unexpected errors ['generics_self_usage.py:122:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __new__: bad return type [bad-return-type]'] -Line 126: Unexpected errors ['generics_self_usage.py:126:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __mul__: bad return type [bad-return-type]'] -""" diff --git a/conformance/results/pytype/generics_syntax_compatibility.toml b/conformance/results/pytype/generics_syntax_compatibility.toml deleted file mode 100644 index 55006657c..000000000 --- a/conformance/results/pytype/generics_syntax_compatibility.toml +++ /dev/null @@ -1,12 +0,0 @@ -conformant = "Unsupported" -notes = """ -Type parameter syntax not yet support. -""" -output = """ -SyntaxError: Type parameter lists are only supported in Python 3.12 and greater (, line 14) -""" -conformance_automated = "Fail" -errors_diff = """ -Line 14: Expected 1 errors -Line 26: Expected 1 errors -""" diff --git a/conformance/results/pytype/generics_syntax_declarations.toml b/conformance/results/pytype/generics_syntax_declarations.toml deleted file mode 100644 index 3960f34b1..000000000 --- a/conformance/results/pytype/generics_syntax_declarations.toml +++ /dev/null @@ -1,20 +0,0 @@ -conformant = "Unsupported" -notes = """ -Type parameter syntax not yet support. -""" -output = """ -SyntaxError: Type parameter lists are only supported in Python 3.12 and greater (, line 13) -""" -conformance_automated = "Fail" -errors_diff = """ -Line 17: Expected 1 errors -Line 25: Expected 1 errors -Line 32: Expected 1 errors -Line 44: Expected 1 errors -Line 48: Expected 1 errors -Line 60: Expected 1 errors -Line 64: Expected 1 errors -Line 71: Expected 1 errors -Line 75: Expected 1 errors -Line 79: Expected 1 errors -""" diff --git a/conformance/results/pytype/generics_syntax_infer_variance.toml b/conformance/results/pytype/generics_syntax_infer_variance.toml deleted file mode 100644 index 05c5d9bee..000000000 --- a/conformance/results/pytype/generics_syntax_infer_variance.toml +++ /dev/null @@ -1,28 +0,0 @@ -conformant = "Unsupported" -notes = """ -Type parameter syntax not yet support. -""" -output = """ -SyntaxError: Type parameter lists are only supported in Python 3.12 and greater (, line 132) -""" -conformance_automated = "Fail" -errors_diff = """ -Line 15: Expected 1 errors -Line 17: Expected 1 errors -Line 29: Expected 1 errors -Line 37: Expected 1 errors -Line 46: Expected 1 errors -Line 75: Expected 1 errors -Line 86: Expected 1 errors -Line 102: Expected 1 errors -Line 103: Expected 1 errors -Line 117: Expected 1 errors -Line 118: Expected 1 errors -Line 125: Expected 1 errors -Line 126: Expected 1 errors -Line 127: Expected 1 errors -Line 128: Expected 1 errors -Line 136: Expected 1 errors -Line 144: Expected 1 errors -Line 155: Expected 1 errors -""" diff --git a/conformance/results/pytype/generics_syntax_scoping.toml b/conformance/results/pytype/generics_syntax_scoping.toml deleted file mode 100644 index 0e811a233..000000000 --- a/conformance/results/pytype/generics_syntax_scoping.toml +++ /dev/null @@ -1,17 +0,0 @@ -conformant = "Unsupported" -notes = """ -Type parameter syntax not yet support. -""" -output = """ -SyntaxError: Type parameter lists are only supported in Python 3.12 and greater (, line 14) -""" -conformance_automated = "Fail" -errors_diff = """ -Line 14: Expected 1 errors -Line 18: Expected 1 errors -Line 35: Expected 1 errors -Line 44: Expected 1 errors -Line 92: Expected 1 errors -Line 95: Expected 1 errors -Line 98: Expected 1 errors -""" diff --git a/conformance/results/pytype/generics_type_erasure.toml b/conformance/results/pytype/generics_type_erasure.toml deleted file mode 100644 index ac5e34ce1..000000000 --- a/conformance/results/pytype/generics_type_erasure.toml +++ /dev/null @@ -1,14 +0,0 @@ -conformant = "Unsupported" -output = """ -NotImplementedError: ParameterizedClass -""" -conformance_automated = "Fail" -errors_diff = """ -Line 38: Expected 1 errors -Line 40: Expected 1 errors -Line 42: Expected 1 errors -Line 43: Expected 1 errors -Line 44: Expected 1 errors -Line 45: Expected 1 errors -Line 46: Expected 1 errors -""" diff --git a/conformance/results/pytype/generics_typevartuple_args.toml b/conformance/results/pytype/generics_typevartuple_args.toml deleted file mode 100644 index f49671e37..000000000 --- a/conformance/results/pytype/generics_typevartuple_args.toml +++ /dev/null @@ -1,134 +0,0 @@ -conformant = "Unsupported" -notes = """ -Does not support TypeVarTuple. -""" -output = """ -generics_typevartuple_args.py:10:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet] - -from typing import TypeVarTuple, assert_type -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_args.py:13:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] - -Ts = TypeVarTuple("Ts") - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_args.py:16:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : No attribute '__iter__' on TypeVarTuple [attribute-error] - -def args_to_tuple(*args: *Ts) -> tuple[*Ts]: -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - ... -\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_args.py:16:34: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] - -def args_to_tuple(*args: *Ts) -> tuple[*Ts]: - \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_args.py:17:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in args_to_tuple: bad return type [bad-return-type] - - ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m - -Called from (traceback): - line 20, in current file -generics_typevartuple_args.py:20:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : tuple[Any] [assert-type] - -assert_type(args_to_tuple(1, "a"), tuple[int, str]) -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_args.py:27:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'self' in call to function tuple.__iter__ [missing-parameter] - -def exec_le(path: str, *args: * tuple[*Ts, Env], env: Env | None = None) -> tuple[*Ts]: -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - ... -\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_args.py:27:33: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] - -def exec_le(path: str, *args: * tuple[*Ts, Env], env: Env | None = None) -> tuple[*Ts]: - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_args.py:27:77: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] - -def exec_le(path: str, *args: * tuple[*Ts, Env], env: Env | None = None) -> tuple[*Ts]: - \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_args.py:28:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in exec_le: bad return type [bad-return-type] - - ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m - -Called from (traceback): - line 31, in current file -generics_typevartuple_args.py:31:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : tuple[Any] [assert-type] - -assert_type(exec_le("", Env()), tuple[()]) # OK -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_args.py:32:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : tuple[Any] [assert-type] - -assert_type(exec_le("", 0, "", Env()), tuple[int, str]) # OK -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_args.py:42:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'self' in call to function tuple.__iter__ [missing-parameter] - -def func1(*args: * tuple[int, ...]) -> None: -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - ... -\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_args.py:51:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'self' in call to function tuple.__iter__ [missing-parameter] - -def func2(*args: * tuple[int, *tuple[str, ...], str]) -> None: -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - ... -\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_args.py:51:20: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] - -def func2(*args: * tuple[int, *tuple[str, ...], str]) -> None: - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_args.py:62:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'self' in call to function tuple.__iter__ [missing-parameter] - -def func3(*args: * tuple[int, str]) -> None: -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - ... -\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_args.py:70:18: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] - -def func4(*args: tuple[*Ts]): - \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_args.py:75:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function func4 was called with the wrong arguments [wrong-arg-types] - -func4((0,), (1, 2)) # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 33: Expected 1 errors -Line 34: Expected 1 errors -Line 48: Expected 1 errors -Line 57: Expected 1 errors -Line 58: Expected 1 errors -Line 59: Expected 1 errors -Line 67: Expected 1 errors -Line 76: Expected 1 errors -Line 10: Unexpected errors ['generics_typevartuple_args.py:10:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet]'] -Line 13: Unexpected errors ['generics_typevartuple_args.py:13:6: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] -Line 16: Unexpected errors ["generics_typevartuple_args.py:16:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : No attribute '__iter__' on TypeVarTuple [attribute-error]", "generics_typevartuple_args.py:16:34: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] -Line 17: Unexpected errors ['generics_typevartuple_args.py:17:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in args_to_tuple: bad return type [bad-return-type]'] -Line 20: Unexpected errors ['generics_typevartuple_args.py:20:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : tuple[Any] [assert-type]'] -Line 27: Unexpected errors ["generics_typevartuple_args.py:27:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Missing parameter 'self' in call to function tuple.__iter__ [missing-parameter]", "generics_typevartuple_args.py:27:33: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", "generics_typevartuple_args.py:27:77: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] -Line 28: Unexpected errors ['generics_typevartuple_args.py:28:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in exec_le: bad return type [bad-return-type]'] -Line 31: Unexpected errors ['generics_typevartuple_args.py:31:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : tuple[Any] [assert-type]'] -Line 32: Unexpected errors ['generics_typevartuple_args.py:32:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : tuple[Any] [assert-type]'] -Line 42: Unexpected errors ["generics_typevartuple_args.py:42:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Missing parameter 'self' in call to function tuple.__iter__ [missing-parameter]"] -Line 51: Unexpected errors ["generics_typevartuple_args.py:51:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Missing parameter 'self' in call to function tuple.__iter__ [missing-parameter]", "generics_typevartuple_args.py:51:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] -Line 62: Unexpected errors ["generics_typevartuple_args.py:62:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Missing parameter 'self' in call to function tuple.__iter__ [missing-parameter]"] -Line 70: Unexpected errors ["generics_typevartuple_args.py:70:18: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] -""" diff --git a/conformance/results/pytype/generics_typevartuple_basic.toml b/conformance/results/pytype/generics_typevartuple_basic.toml deleted file mode 100644 index 0b78be1c5..000000000 --- a/conformance/results/pytype/generics_typevartuple_basic.toml +++ /dev/null @@ -1,306 +0,0 @@ -conformant = "Unsupported" -notes = """ -Does not support TypeVarTuple. -""" -output = """ -generics_typevartuple_basic.py:7:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet] - -from typing import Generic, NewType, TypeVarTuple, assert_type -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_basic.py:9:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] - -Ts = TypeVarTuple("Ts") - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_basic.py:12:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] - -class Array1(Generic[*Ts]): - \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_basic.py:16:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : No attribute '__iter__' on TypeVarTuple [attribute-error] - -def func1(*args: *Ts) -> tuple[*Ts]: -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - ... -\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_basic.py:16:26: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] - -def func1(*args: *Ts) -> tuple[*Ts]: - \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_basic.py:17:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: bad return type [bad-return-type] - - ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m - -generics_typevartuple_basic.py:20:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] - -Shape = TypeVarTuple("Shape") - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_basic.py:23:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] - -class Array(Generic[*Shape]): - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_basic.py:24:31: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Array: Invalid type annotation '' [invalid-annotation] - - def __init__(self, shape: tuple[*Shape]): - \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_basic.py:25:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __init__: Invalid type annotation 'tuple[*Shape,]' [invalid-annotation] - - self._shape: tuple[*Shape] = shape - \u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_basic.py:27:28: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Array: Invalid type annotation '' [invalid-annotation] - - def get_shape(self) -> tuple[*Shape]: - \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_basic.py:36:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] - -v1: Array[Height, Width] = Array((Height(1), Width(2))) # OK - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_basic.py:36:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Array[Height, Width]' [invalid-annotation] - -v1: Array[Height, Width] = Array((Height(1), Width(2))) # OK -\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -generics_typevartuple_basic.py:36:28: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Array.__init__ was called with the wrong arguments [wrong-arg-types] - -v1: Array[Height, Width] = Array((Height(1), Width(2))) # OK - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_basic.py:37:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] - -v2: Array[Batch, Height, Width] = Array((Batch(1), Height(1), Width(1))) # OK - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_basic.py:37:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Array[Batch, Height, Width]' [invalid-annotation] - -v2: Array[Batch, Height, Width] = Array((Batch(1), Height(1), Width(1))) # OK -\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -generics_typevartuple_basic.py:37:35: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Array.__init__ was called with the wrong arguments [wrong-arg-types] - -v2: Array[Batch, Height, Width] = Array((Batch(1), Height(1), Width(1))) # OK - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_basic.py:38:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] - -v3: Array[Time, Batch, Height, Width] = Array( - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_basic.py:38:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Array[Time, Batch, Height, Width]' [invalid-annotation] - -v3: Array[Time, Batch, Height, Width] = Array( -\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -generics_typevartuple_basic.py:38:41: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Array.__init__ was called with the wrong arguments [wrong-arg-types] - -v3: Array[Time, Batch, Height, Width] = Array( - \u001b[1m\u001b[31m~~~~~~\u001b[39m\u001b[0m - (Time(1), Batch(1), Height(1), Width(1)) -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -) # OK -\u001b[1m\u001b[31m~\u001b[39m\u001b[0m - -generics_typevartuple_basic.py:42:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] - -v4: Array[Height, Width] = Array(Height(1)) # E - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_basic.py:42:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Array[Height, Width]' [invalid-annotation] - -v4: Array[Height, Width] = Array(Height(1)) # E -\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -generics_typevartuple_basic.py:42:28: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Array.__init__ was called with the wrong arguments [wrong-arg-types] - -v4: Array[Height, Width] = Array(Height(1)) # E - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_basic.py:43:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] - -v5: Array[Batch, Height, Width] = Array((Batch(1), Width(1))) # E - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_basic.py:43:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Array[Batch, Height, Width]' [invalid-annotation] - -v5: Array[Batch, Height, Width] = Array((Batch(1), Width(1))) # E -\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -generics_typevartuple_basic.py:43:35: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Array.__init__ was called with the wrong arguments [wrong-arg-types] - -v5: Array[Batch, Height, Width] = Array((Batch(1), Width(1))) # E - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_basic.py:44:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] - -v6: Array[Time, Batch, Height, Width] = Array( # E[v6] - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_basic.py:44:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Array[Time, Batch, Height, Width]' [invalid-annotation] - -v6: Array[Time, Batch, Height, Width] = Array( # E[v6] -\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -generics_typevartuple_basic.py:44:41: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Array.__init__ was called with the wrong arguments [wrong-arg-types] - -v6: Array[Time, Batch, Height, Width] = Array( # E[v6] - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - (Time(1), Batch(1), Width(1), Height(1)) # E[v6] -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -) -\u001b[1m\u001b[31m~\u001b[39m\u001b[0m - -generics_typevartuple_basic.py:52:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] - -class ClassA(Generic[Shape]): # E: not unpacked - \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_basic.py:53:31: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassA: Invalid type annotation '' [invalid-annotation] - - def __init__(self, shape: tuple[Shape]): # E: not unpacked - \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_basic.py:54:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __init__: Invalid type annotation 'tuple[*Shape,]' [invalid-annotation] - - self._shape: tuple[*Shape] = shape - \u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_basic.py:56:28: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassA: Invalid type annotation '' [invalid-annotation] - - def get_shape(self) -> tuple[Shape]: # E: not unpacked - \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_basic.py:59:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassA: Invalid type annotation '' for args [invalid-annotation] - - def method1(*args: Shape) -> None: # E: not unpacked - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - ... -\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_basic.py:65:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 3 [wrong-arg-count] - -Ts1 = TypeVarTuple("Ts1", covariant=True) # E - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_basic.py:66:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 4 [wrong-arg-count] - -Ts2 = TypeVarTuple("Ts2", int, float) # E - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_basic.py:67:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 3 [wrong-arg-count] - -Ts3 = TypeVarTuple("Ts3", bound=int) # E - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_basic.py:75:17: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] - -def func2(arg1: tuple[*Ts], arg2: tuple[*Ts]) -> tuple[*Ts]: - \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_basic.py:75:35: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] - -def func2(arg1: tuple[*Ts], arg2: tuple[*Ts]) -> tuple[*Ts]: - \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_basic.py:75:50: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] - -def func2(arg1: tuple[*Ts], arg2: tuple[*Ts]) -> tuple[*Ts]: - \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_basic.py:76:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func2: bad return type [bad-return-type] - - ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m - -Called from (traceback): - line 84, in current file -generics_typevartuple_basic.py:84:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : tuple[Any] [assert-type] - -assert_type(func2((0,), (1,)), tuple[int]) # OK -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_basic.py:90:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function func2 was called with the wrong arguments [wrong-arg-types] - -func2((0, 0), (0,)) # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_basic.py:93:17: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] - -def multiply(x: Array[*Shape], y: Array[*Shape]) -> Array[*Shape]: - \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_basic.py:93:35: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] - -def multiply(x: Array[*Shape], y: Array[*Shape]) -> Array[*Shape]: - \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_basic.py:93:53: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] - -def multiply(x: Array[*Shape], y: Array[*Shape]) -> Array[*Shape]: - \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_basic.py:94:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in multiply: bad return type [bad-return-type] - - ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m - -generics_typevartuple_basic.py:97:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] - -def func3(x: Array[Height], y: Array[Width], z: Array[Height, Width]): - \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_basic.py:97:32: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] - -def func3(x: Array[Height], y: Array[Width], z: Array[Height, Width]): - \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_basic.py:97:49: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] - -def func3(x: Array[Height], y: Array[Width], z: Array[Height, Width]): - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_basic.py:106:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] - -class Array3(Generic[*Ts1, *Ts2]): # E - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_basic.py:106:22: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function list.extend was called with the wrong arguments [wrong-arg-types] - -class Array3(Generic[*Ts1, *Ts2]): # E - \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 89: Expected 1 errors -Line 99: Expected 1 errors -Line 100: Expected 1 errors -Line 7: Unexpected errors ['generics_typevartuple_basic.py:7:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet]'] -Line 9: Unexpected errors ['generics_typevartuple_basic.py:9:6: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] -Line 12: Unexpected errors ["generics_typevartuple_basic.py:12:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] -Line 16: Unexpected errors ["generics_typevartuple_basic.py:16:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : No attribute '__iter__' on TypeVarTuple [attribute-error]", "generics_typevartuple_basic.py:16:26: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] -Line 17: Unexpected errors ['generics_typevartuple_basic.py:17:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: bad return type [bad-return-type]'] -Line 20: Unexpected errors ['generics_typevartuple_basic.py:20:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] -Line 23: Unexpected errors ["generics_typevartuple_basic.py:23:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] -Line 24: Unexpected errors ["generics_typevartuple_basic.py:24:31: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in Array: Invalid type annotation '' [invalid-annotation]"] -Line 25: Unexpected errors ["generics_typevartuple_basic.py:25:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __init__: Invalid type annotation 'tuple[*Shape,]' [invalid-annotation]"] -Line 27: Unexpected errors ["generics_typevartuple_basic.py:27:28: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in Array: Invalid type annotation '' [invalid-annotation]"] -Line 36: Unexpected errors ['generics_typevartuple_basic.py:36:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]', "generics_typevartuple_basic.py:36:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Array[Height, Width]' [invalid-annotation]", 'generics_typevartuple_basic.py:36:28: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function Array.__init__ was called with the wrong arguments [wrong-arg-types]'] -Line 37: Unexpected errors ['generics_typevartuple_basic.py:37:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]', "generics_typevartuple_basic.py:37:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Array[Batch, Height, Width]' [invalid-annotation]", 'generics_typevartuple_basic.py:37:35: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function Array.__init__ was called with the wrong arguments [wrong-arg-types]'] -Line 38: Unexpected errors ['generics_typevartuple_basic.py:38:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]', "generics_typevartuple_basic.py:38:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Array[Time, Batch, Height, Width]' [invalid-annotation]", 'generics_typevartuple_basic.py:38:41: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function Array.__init__ was called with the wrong arguments [wrong-arg-types]'] -Line 54: Unexpected errors ["generics_typevartuple_basic.py:54:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __init__: Invalid type annotation 'tuple[*Shape,]' [invalid-annotation]"] -Line 75: Unexpected errors ["generics_typevartuple_basic.py:75:17: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", "generics_typevartuple_basic.py:75:35: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", "generics_typevartuple_basic.py:75:50: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] -Line 76: Unexpected errors ['generics_typevartuple_basic.py:76:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func2: bad return type [bad-return-type]'] -Line 84: Unexpected errors ['generics_typevartuple_basic.py:84:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : tuple[Any] [assert-type]'] -Line 93: Unexpected errors ['generics_typevartuple_basic.py:93:17: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]', 'generics_typevartuple_basic.py:93:35: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]', 'generics_typevartuple_basic.py:93:53: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]'] -Line 94: Unexpected errors ['generics_typevartuple_basic.py:94:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in multiply: bad return type [bad-return-type]'] -Line 97: Unexpected errors ['generics_typevartuple_basic.py:97:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]', 'generics_typevartuple_basic.py:97:32: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]', 'generics_typevartuple_basic.py:97:49: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]'] -""" diff --git a/conformance/results/pytype/generics_typevartuple_callable.toml b/conformance/results/pytype/generics_typevartuple_callable.toml deleted file mode 100644 index c2cf17829..000000000 --- a/conformance/results/pytype/generics_typevartuple_callable.toml +++ /dev/null @@ -1,128 +0,0 @@ -conformant = "Unsupported" -notes = """ -Does not support TypeVarTuple. -""" -output = """ -generics_typevartuple_callable.py:10:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet] - -from typing import Callable, TypeVar, TypeVarTuple, assert_type -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_callable.py:12:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] - -Ts = TypeVarTuple("Ts") - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_callable.py:17:61: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Process: Invalid type annotation '' [invalid-annotation] - - def __init__(self, target: Callable[[*Ts], None], args: tuple[*Ts]) -> None: - \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_callable.py:17:32: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Process: Invalid type annotation '' [invalid-annotation] - - def __init__(self, target: Callable[[*Ts], None], args: tuple[*Ts]) -> None: - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_callable.py:25:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Process.__init__ was called with the wrong arguments [wrong-arg-types] - -Process(target=func1, args=(0, "")) # OK -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_callable.py:26:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Process.__init__ was called with the wrong arguments [wrong-arg-types] - -Process(target=func1, args=("", 0)) # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_callable.py:29:57: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] - -def func2(f: Callable[[int, *Ts, T], tuple[T, *Ts]]) -> tuple[*Ts, T]: - \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_callable.py:29:38: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] - -def func2(f: Callable[[int, *Ts, T], tuple[T, *Ts]]) -> tuple[*Ts, T]: - \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_callable.py:29:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] - -def func2(f: Callable[[int, *Ts, T], tuple[T, *Ts]]) -> tuple[*Ts, T]: - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_callable.py:30:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func2: bad return type [bad-return-type] - - ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m - -Called from (traceback): - line 42, in current file -generics_typevartuple_callable.py:34:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in callback1: bad return type [bad-return-type] - - ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m - -generics_typevartuple_callable.py:38:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in callback2: bad return type [bad-return-type] - - ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m - -generics_typevartuple_callable.py:41:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function func2 was called with the wrong arguments [wrong-arg-types] - -assert_type(func2(callback1), tuple[str, int, complex]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_callable.py:41:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Any [assert-type] - -assert_type(func2(callback1), tuple[str, int, complex]) -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_callable.py:42:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : tuple[Any] [assert-type] - -assert_type(func2(callback2), tuple[str]) -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_callable.py:45:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'self' in call to function tuple.__iter__ [missing-parameter] - -def func3(*args: * tuple[int, *Ts, T]) -> tuple[T, *Ts]: -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - ... -\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_callable.py:45:20: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] - -def func3(*args: * tuple[int, *Ts, T]) -> tuple[T, *Ts]: - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_callable.py:45:43: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] - -def func3(*args: * tuple[int, *Ts, T]) -> tuple[T, *Ts]: - \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_callable.py:46:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func3: bad return type [bad-return-type] - - ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m - -Called from (traceback): - line 49, in current file -generics_typevartuple_callable.py:49:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : tuple[Any] [assert-type] - -assert_type(func3(1, "", 3j, 3.4), tuple[float, str, complex]) -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 10: Unexpected errors ['generics_typevartuple_callable.py:10:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet]'] -Line 12: Unexpected errors ['generics_typevartuple_callable.py:12:6: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] -Line 17: Unexpected errors ["generics_typevartuple_callable.py:17:61: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in Process: Invalid type annotation '' [invalid-annotation]", "generics_typevartuple_callable.py:17:32: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in Process: Invalid type annotation '' [invalid-annotation]"] -Line 25: Unexpected errors ['generics_typevartuple_callable.py:25:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function Process.__init__ was called with the wrong arguments [wrong-arg-types]'] -Line 29: Unexpected errors ["generics_typevartuple_callable.py:29:57: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", "generics_typevartuple_callable.py:29:38: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", "generics_typevartuple_callable.py:29:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] -Line 30: Unexpected errors ['generics_typevartuple_callable.py:30:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func2: bad return type [bad-return-type]'] -Line 34: Unexpected errors ['generics_typevartuple_callable.py:34:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in callback1: bad return type [bad-return-type]'] -Line 38: Unexpected errors ['generics_typevartuple_callable.py:38:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in callback2: bad return type [bad-return-type]'] -Line 41: Unexpected errors ['generics_typevartuple_callable.py:41:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function func2 was called with the wrong arguments [wrong-arg-types]', 'generics_typevartuple_callable.py:41:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Any [assert-type]'] -Line 42: Unexpected errors ['generics_typevartuple_callable.py:42:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : tuple[Any] [assert-type]'] -Line 45: Unexpected errors ["generics_typevartuple_callable.py:45:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Missing parameter 'self' in call to function tuple.__iter__ [missing-parameter]", "generics_typevartuple_callable.py:45:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", "generics_typevartuple_callable.py:45:43: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] -Line 46: Unexpected errors ['generics_typevartuple_callable.py:46:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func3: bad return type [bad-return-type]'] -Line 49: Unexpected errors ['generics_typevartuple_callable.py:49:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : tuple[Any] [assert-type]'] -""" diff --git a/conformance/results/pytype/generics_typevartuple_concat.toml b/conformance/results/pytype/generics_typevartuple_concat.toml deleted file mode 100644 index aa1708948..000000000 --- a/conformance/results/pytype/generics_typevartuple_concat.toml +++ /dev/null @@ -1,155 +0,0 @@ -conformant = "Unsupported" -notes = """ -Does not support TypeVarTuple. -""" -output = """ -generics_typevartuple_concat.py:9:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet] - -from typing import Generic, NewType, TypeVar, TypeVarTuple, assert_type -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_concat.py:17:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] - -Shape = TypeVarTuple("Shape") - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_concat.py:18:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] - -Ts = TypeVarTuple("Ts") - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_concat.py:22:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] - -class Array(Generic[*Ts]): - \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_concat.py:26:23: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] - -def add_batch_axis(x: Array[*Shape]) -> Array[Batch, *Shape]: - \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_concat.py:26:41: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] - -def add_batch_axis(x: Array[*Shape]) -> Array[Batch, *Shape]: - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_concat.py:27:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in add_batch_axis: bad return type [bad-return-type] - - ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m - -generics_typevartuple_concat.py:30:23: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] - -def del_batch_axis(x: Array[Batch, *Shape]) -> Array[*Shape]: - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_concat.py:30:48: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] - -def del_batch_axis(x: Array[Batch, *Shape]) -> Array[*Shape]: - \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_concat.py:31:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in del_batch_axis: bad return type [bad-return-type] - - ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m - -generics_typevartuple_concat.py:34:27: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] - -def add_batch_channels(x: Array[*Shape]) -> Array[Batch, *Shape, Channels]: - \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_concat.py:34:45: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] - -def add_batch_channels(x: Array[*Shape]) -> Array[Batch, *Shape, Channels]: - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_concat.py:35:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in add_batch_channels: bad return type [bad-return-type] - - ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m - -generics_typevartuple_concat.py:38:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] - -def func1(a: Array[Height, Width]): - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_concat.py:40:20: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: class Array is not indexable [not-indexable] - - assert_type(b, Array[Batch, Height, Width]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_concat.py:42:20: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: class Array is not indexable [not-indexable] - - assert_type(c, Array[Height, Width]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_concat.py:44:20: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: class Array is not indexable [not-indexable] - - assert_type(d, Array[Batch, Height, Width, Channels]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_concat.py:47:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'T' [invalid-annotation] - -def prefix_tuple(x: T, y: tuple[*Ts]) -> tuple[T, *Ts]: -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - ... -\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_concat.py:47:27: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] - -def prefix_tuple(x: T, y: tuple[*Ts]) -> tuple[T, *Ts]: - \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_concat.py:47:42: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] - -def prefix_tuple(x: T, y: tuple[*Ts]) -> tuple[T, *Ts]: - \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_concat.py:48:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in prefix_tuple: bad return type [bad-return-type] - - ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m - -generics_typevartuple_concat.py:51:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function prefix_tuple was called with the wrong arguments [wrong-arg-types] - -z = prefix_tuple(x=0, y=(True, "a")) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_concat.py:52:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Any [assert-type] - -assert_type(z, tuple[int, bool, str]) -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_concat.py:55:55: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] - -def move_first_element_to_last(tup: tuple[T, *Ts]) -> tuple[*Ts, T]: - \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_concat.py:55:37: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] - -def move_first_element_to_last(tup: tuple[T, *Ts]) -> tuple[*Ts, T]: - \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 9: Unexpected errors ['generics_typevartuple_concat.py:9:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet]'] -Line 17: Unexpected errors ['generics_typevartuple_concat.py:17:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] -Line 18: Unexpected errors ['generics_typevartuple_concat.py:18:6: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] -Line 22: Unexpected errors ["generics_typevartuple_concat.py:22:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] -Line 26: Unexpected errors ['generics_typevartuple_concat.py:26:23: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]', 'generics_typevartuple_concat.py:26:41: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]'] -Line 27: Unexpected errors ['generics_typevartuple_concat.py:27:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in add_batch_axis: bad return type [bad-return-type]'] -Line 30: Unexpected errors ['generics_typevartuple_concat.py:30:23: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]', 'generics_typevartuple_concat.py:30:48: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]'] -Line 31: Unexpected errors ['generics_typevartuple_concat.py:31:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in del_batch_axis: bad return type [bad-return-type]'] -Line 34: Unexpected errors ['generics_typevartuple_concat.py:34:27: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]', 'generics_typevartuple_concat.py:34:45: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]'] -Line 35: Unexpected errors ['generics_typevartuple_concat.py:35:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in add_batch_channels: bad return type [bad-return-type]'] -Line 38: Unexpected errors ['generics_typevartuple_concat.py:38:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]'] -Line 40: Unexpected errors ['generics_typevartuple_concat.py:40:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: class Array is not indexable [not-indexable]'] -Line 42: Unexpected errors ['generics_typevartuple_concat.py:42:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: class Array is not indexable [not-indexable]'] -Line 44: Unexpected errors ['generics_typevartuple_concat.py:44:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: class Array is not indexable [not-indexable]'] -Line 47: Unexpected errors ["generics_typevartuple_concat.py:47:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'T' [invalid-annotation]", "generics_typevartuple_concat.py:47:27: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", "generics_typevartuple_concat.py:47:42: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] -Line 48: Unexpected errors ['generics_typevartuple_concat.py:48:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in prefix_tuple: bad return type [bad-return-type]'] -Line 51: Unexpected errors ['generics_typevartuple_concat.py:51:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function prefix_tuple was called with the wrong arguments [wrong-arg-types]'] -Line 52: Unexpected errors ['generics_typevartuple_concat.py:52:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Any [assert-type]'] -Line 55: Unexpected errors ["generics_typevartuple_concat.py:55:55: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", "generics_typevartuple_concat.py:55:37: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] -""" diff --git a/conformance/results/pytype/generics_typevartuple_overloads.toml b/conformance/results/pytype/generics_typevartuple_overloads.toml deleted file mode 100644 index 6a56bcbe6..000000000 --- a/conformance/results/pytype/generics_typevartuple_overloads.toml +++ /dev/null @@ -1,72 +0,0 @@ -conformant = "Unsupported" -notes = """ -Does not support TypeVarTuple. -""" -output = """ -generics_typevartuple_overloads.py:7:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet] - -from typing import Any, Generic, TypeVar, TypeVarTuple, assert_type, overload -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_overloads.py:10:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] - -Shape = TypeVarTuple("Shape") - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_overloads.py:16:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] - -class Array(Generic[*Shape]): - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_overloads.py:18:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Array: class Array is not indexable [not-indexable] - - def transpose(self: "Array[Axis1, Axis2]") -> "Array[Axis2, Axis1]": - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - ... -\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_overloads.py:22:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Array: class Array is not indexable [not-indexable] - - def transpose(self: "Array[Axis1, Axis2, Axis3]") -> "Array[Axis3, Axis2, Axis1]": - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - ... -\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_overloads.py:26:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in transpose: bad return type [bad-return-type] - - pass - \u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m - -generics_typevartuple_overloads.py:29:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] - -def func1(a: Array[Axis1, Axis2], b: Array[Axis1, Axis2, Axis3]): - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_overloads.py:29:38: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] - -def func1(a: Array[Axis1, Axis2], b: Array[Axis1, Axis2, Axis3]): - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_overloads.py:30:32: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: class Array is not indexable [not-indexable] - - assert_type(a.transpose(), Array[Axis2, Axis1]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_overloads.py:31:32: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: class Array is not indexable [not-indexable] - - assert_type(b.transpose(), Array[Axis3, Axis2, Axis1]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 7: Unexpected errors ['generics_typevartuple_overloads.py:7:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet]'] -Line 10: Unexpected errors ['generics_typevartuple_overloads.py:10:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] -Line 16: Unexpected errors ["generics_typevartuple_overloads.py:16:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] -Line 18: Unexpected errors ['generics_typevartuple_overloads.py:18:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in Array: class Array is not indexable [not-indexable]'] -Line 22: Unexpected errors ['generics_typevartuple_overloads.py:22:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in Array: class Array is not indexable [not-indexable]'] -Line 26: Unexpected errors ['generics_typevartuple_overloads.py:26:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in transpose: bad return type [bad-return-type]'] -Line 29: Unexpected errors ['generics_typevartuple_overloads.py:29:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]', 'generics_typevartuple_overloads.py:29:38: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]'] -Line 30: Unexpected errors ['generics_typevartuple_overloads.py:30:32: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: class Array is not indexable [not-indexable]'] -Line 31: Unexpected errors ['generics_typevartuple_overloads.py:31:32: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: class Array is not indexable [not-indexable]'] -""" diff --git a/conformance/results/pytype/generics_typevartuple_specialization.toml b/conformance/results/pytype/generics_typevartuple_specialization.toml deleted file mode 100644 index ea620c39e..000000000 --- a/conformance/results/pytype/generics_typevartuple_specialization.toml +++ /dev/null @@ -1,454 +0,0 @@ -conformant = "Unsupported" -notes = """ -Does not support TypeVarTuple. -""" -output = """ -generics_typevartuple_specialization.py:7:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet] - -from typing import Any, Generic, NewType, TypeVar, TypeVarTuple, assert_type -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_specialization.py:10:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] - -Ts = TypeVarTuple("Ts") - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_specialization.py:16:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] - -class Array(Generic[*Ts]): - \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_specialization.py:24:27: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] - -def takes_any_array2(arr: Array[*tuple[Any, ...]]): - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_specialization.py:28:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] - -def func1(x: Array[Height, Width]): - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_specialization.py:33:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] - -def func2(y: Array[Time, Height, Width]): - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_specialization.py:41:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] - -IntTuple = tuple[int, *Ts] - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_specialization.py:42:25: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] - -NamedArray = tuple[str, Array[*Ts]] - \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_specialization.py:45:40: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[str, Array][Height]' [invalid-annotation] - -def func3(a: IntTuple[float, bool], b: NamedArray[Height]): - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_specialization.py:45:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[Any][float, bool]' [invalid-annotation] - -def func3(a: IntTuple[float, bool], b: NamedArray[Height]): - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_specialization.py:46:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func3: tuple[Any] [assert-type] - - assert_type(a, tuple[int, float, bool]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_specialization.py:47:31: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func3: class Array is not indexable [not-indexable] - - assert_type(b, tuple[str, Array[Height]]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_specialization.py:51:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func4: tuple[Any] [assert-type] - - assert_type(a, tuple[int]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_specialization.py:55:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] - -Shape = TypeVarTuple("Shape") - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_specialization.py:59:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] - -class Array2(Generic[DType, *Shape]): - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_specialization.py:63:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array2 is not indexable [not-indexable] - -FloatArray = Array2[float, *Shape] - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_specialization.py:64:11: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array2 is not indexable [not-indexable] - -Array1D = Array2[DType, Any] - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_specialization.py:67:28: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array2 is not indexable [not-indexable] - -def func5_0(a: Array1D, b: Array1D[int]): - \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_specialization.py:68:20: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func5_0: class Array2 is not indexable [not-indexable] - - assert_type(a, Array2[Any, Any]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_specialization.py:69:20: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func5_0: class Array2 is not indexable [not-indexable] - - assert_type(b, Array2[int, Any]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_specialization.py:76:16: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array2 is not indexable [not-indexable] - -def func5_1(x: FloatArray[Height, Width]): - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_specialization.py:80:46: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array2 is not indexable [not-indexable] - -def takes_float_array_with_specific_shape(y: FloatArray[Height, Width]): - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_specialization.py:89:17: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] - -VariadicTuple = tuple[T, *Ts] - \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_specialization.py:92:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[Any][str, int]' [invalid-annotation] - -def func6(a: VariadicTuple[str, int], b: VariadicTuple[float], c: VariadicTuple): - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_specialization.py:92:42: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[Any][float]' [invalid-annotation] - -def func6(a: VariadicTuple[str, int], b: VariadicTuple[float], c: VariadicTuple): - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_specialization.py:93:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func6: tuple[Any] [assert-type] - - assert_type(a, tuple[str, int]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_specialization.py:94:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func6: tuple[Any] [assert-type] - - assert_type(b, tuple[float]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_specialization.py:95:20: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func6: Invalid type annotation '' [invalid-annotation] - - assert_type(c, tuple[Any, *tuple[Any, ...]]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_specialization.py:98:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] - -Ts1 = TypeVarTuple("Ts1") - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_specialization.py:99:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] - -Ts2 = TypeVarTuple("Ts2") - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_specialization.py:101:15: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] - -IntTupleVar = tuple[int, *Ts1] # OK - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_specialization.py:102:20: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[Any][]' [invalid-annotation] - -IntFloatTupleVar = IntTupleVar[float, *Ts2] # OK - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_specialization.py:103:21: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[Any][]' [invalid-annotation] - -IntFloatsTupleVar = IntTupleVar[*tuple[float, ...]] # OK - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_specialization.py:109:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] - -IntTupleGeneric[*Ts] # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_specialization.py:110:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] - -IntTupleGeneric[*tuple[float, ...]] # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_specialization.py:117:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] - -TA1 = tuple[*Ts, T1, T2] # OK - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_specialization.py:118:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] - -TA2 = tuple[T1, T2, *Ts] # OK - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_specialization.py:119:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] - -TA3 = tuple[T1, *Ts, T2, T3] # OK - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_specialization.py:120:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] - -TA4 = tuple[T1, T2, *tuple[int, ...]] # OK - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_specialization.py:121:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] - -TA5 = tuple[T1, *Ts, T2, *Ts] # E - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_specialization.py:121:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function list.extend was called with the wrong arguments [wrong-arg-types] - -TA5 = tuple[T1, *Ts, T2, *Ts] # E - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_specialization.py:122:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] - -TA6 = tuple[T1, *Ts, T2, *tuple[int, ...]] # E - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_specialization.py:122:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function list.extend was called with the wrong arguments [wrong-arg-types] - -TA6 = tuple[T1, *Ts, T2, *tuple[int, ...]] # E - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_specialization.py:125:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] - -TA7 = tuple[*Ts, T1, T2] - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_specialization.py:127:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[Any][int]' [invalid-annotation] - -v1: TA7[int] # E: requires at least two type arguments - \u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_specialization.py:130:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[Any][]' [invalid-annotation] - -def func7(a: TA7[*Ts, T1, T2]) -> tuple[tuple[*Ts], T1, T2]: - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_specialization.py:130:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'T2' [invalid-annotation] - -def func7(a: TA7[*Ts, T1, T2]) -> tuple[tuple[*Ts], T1, T2]: -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - ... -\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_specialization.py:130:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'T1' [invalid-annotation] - -def func7(a: TA7[*Ts, T1, T2]) -> tuple[tuple[*Ts], T1, T2]: -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - ... -\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_specialization.py:130:41: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] - -def func7(a: TA7[*Ts, T1, T2]) -> tuple[tuple[*Ts], T1, T2]: - \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_specialization.py:131:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func7: bad return type [bad-return-type] - - ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m - -generics_typevartuple_specialization.py:134:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[Any][str, bool]' [invalid-annotation] - -def func8(a: TA7[str, bool], b: TA7[str, bool, float], c: TA7[str, bool, float, int]): - \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_specialization.py:134:33: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[Any][str, bool, float]' [invalid-annotation] - -def func8(a: TA7[str, bool], b: TA7[str, bool, float], c: TA7[str, bool, float, int]): - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_specialization.py:134:59: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[Any][str, bool, float, int]' [invalid-annotation] - -def func8(a: TA7[str, bool], b: TA7[str, bool, float], c: TA7[str, bool, float, int]): - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_specialization.py:135:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func8: tuple[tuple[Any], Any, Any] [assert-type] - - assert_type(func7(a), tuple[tuple[()], str, bool]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_specialization.py:136:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func8: tuple[tuple[Any], Any, Any] [assert-type] - - assert_type(func7(b), tuple[tuple[str], bool, float]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_specialization.py:137:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func8: tuple[tuple[Any], Any, Any] [assert-type] - - assert_type(func7(c), tuple[tuple[str, bool], float, int]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_specialization.py:140:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] - -TA8 = tuple[T1, *Ts, T2, T3] - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_specialization.py:143:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[Any][]' [invalid-annotation] - -def func9(a: TA8[T1, *Ts, T2, T3]) -> tuple[tuple[*Ts], T1, T2, T3]: - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_specialization.py:143:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'T3' [invalid-annotation] - -def func9(a: TA8[T1, *Ts, T2, T3]) -> tuple[tuple[*Ts], T1, T2, T3]: -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - ... -\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_specialization.py:143:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'T2' [invalid-annotation] - -def func9(a: TA8[T1, *Ts, T2, T3]) -> tuple[tuple[*Ts], T1, T2, T3]: -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - ... -\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_specialization.py:143:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'T1' [invalid-annotation] - -def func9(a: TA8[T1, *Ts, T2, T3]) -> tuple[tuple[*Ts], T1, T2, T3]: -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - ... -\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_specialization.py:143:45: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] - -def func9(a: TA8[T1, *Ts, T2, T3]) -> tuple[tuple[*Ts], T1, T2, T3]: - \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_specialization.py:144:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: bad return type [bad-return-type] - - ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m - -generics_typevartuple_specialization.py:147:15: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[Any][str, bool, float]' [invalid-annotation] - -def func10(a: TA8[str, bool, float], b: TA8[str, bool, float, int]): - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_specialization.py:147:41: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[Any][str, bool, float, int]' [invalid-annotation] - -def func10(a: TA8[str, bool, float], b: TA8[str, bool, float, int]): - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_specialization.py:148:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func10: tuple[tuple[Any], Any, Any, Any] [assert-type] - - assert_type(func9(a), tuple[tuple[()], str, bool, float]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_specialization.py:149:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func10: tuple[tuple[Any], Any, Any, Any] [assert-type] - - assert_type(func9(b), tuple[tuple[bool], str, float, int]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_specialization.py:152:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] - -TA9 = tuple[*Ts, T1] - \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_specialization.py:153:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[Any][]' [invalid-annotation] - -TA10 = TA9[*tuple[int, ...]] # OK - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_specialization.py:156:24: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[Any][]' [invalid-annotation] - -def func11(a: TA10, b: TA9[*tuple[int, ...], str], c: TA9[*tuple[int, ...], str]): - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_specialization.py:156:55: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[Any][]' [invalid-annotation] - -def func11(a: TA10, b: TA9[*tuple[int, ...], str], c: TA9[*tuple[int, ...], str]): - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_specialization.py:157:20: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func11: Invalid type annotation '' [invalid-annotation] - - assert_type(a, tuple[*tuple[int, ...], int]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_specialization.py:158:20: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func11: Invalid type annotation '' [invalid-annotation] - - assert_type(b, tuple[*tuple[int, ...], str]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_specialization.py:159:20: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func11: Invalid type annotation '' [invalid-annotation] - - assert_type(c, tuple[*tuple[int, ...], str]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_specialization.py:162:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] - -TA11 = tuple[T, *Ts1] - \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_specialization.py:163:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[Any][]' [invalid-annotation] - -TA12 = TA11[*Ts2] # E - \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 7: Unexpected errors ['generics_typevartuple_specialization.py:7:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet]'] -Line 10: Unexpected errors ['generics_typevartuple_specialization.py:10:6: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] -Line 16: Unexpected errors ["generics_typevartuple_specialization.py:16:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] -Line 24: Unexpected errors ['generics_typevartuple_specialization.py:24:27: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]'] -Line 28: Unexpected errors ['generics_typevartuple_specialization.py:28:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]'] -Line 33: Unexpected errors ['generics_typevartuple_specialization.py:33:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]'] -Line 41: Unexpected errors ["generics_typevartuple_specialization.py:41:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] -Line 42: Unexpected errors ['generics_typevartuple_specialization.py:42:25: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]'] -Line 45: Unexpected errors ["generics_typevartuple_specialization.py:45:40: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'tuple[str, Array][Height]' [invalid-annotation]", "generics_typevartuple_specialization.py:45:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'tuple[Any][float, bool]' [invalid-annotation]"] -Line 46: Unexpected errors ['generics_typevartuple_specialization.py:46:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func3: tuple[Any] [assert-type]'] -Line 47: Unexpected errors ['generics_typevartuple_specialization.py:47:31: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func3: class Array is not indexable [not-indexable]'] -Line 51: Unexpected errors ['generics_typevartuple_specialization.py:51:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func4: tuple[Any] [assert-type]'] -Line 55: Unexpected errors ['generics_typevartuple_specialization.py:55:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] -Line 59: Unexpected errors ["generics_typevartuple_specialization.py:59:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] -Line 63: Unexpected errors ['generics_typevartuple_specialization.py:63:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array2 is not indexable [not-indexable]'] -Line 64: Unexpected errors ['generics_typevartuple_specialization.py:64:11: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array2 is not indexable [not-indexable]'] -Line 67: Unexpected errors ['generics_typevartuple_specialization.py:67:28: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array2 is not indexable [not-indexable]'] -Line 68: Unexpected errors ['generics_typevartuple_specialization.py:68:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func5_0: class Array2 is not indexable [not-indexable]'] -Line 69: Unexpected errors ['generics_typevartuple_specialization.py:69:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func5_0: class Array2 is not indexable [not-indexable]'] -Line 76: Unexpected errors ['generics_typevartuple_specialization.py:76:16: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array2 is not indexable [not-indexable]'] -Line 80: Unexpected errors ['generics_typevartuple_specialization.py:80:46: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array2 is not indexable [not-indexable]'] -Line 89: Unexpected errors ["generics_typevartuple_specialization.py:89:17: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] -Line 92: Unexpected errors ["generics_typevartuple_specialization.py:92:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'tuple[Any][str, int]' [invalid-annotation]", "generics_typevartuple_specialization.py:92:42: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'tuple[Any][float]' [invalid-annotation]"] -Line 93: Unexpected errors ['generics_typevartuple_specialization.py:93:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func6: tuple[Any] [assert-type]'] -Line 94: Unexpected errors ['generics_typevartuple_specialization.py:94:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func6: tuple[Any] [assert-type]'] -Line 95: Unexpected errors ["generics_typevartuple_specialization.py:95:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func6: Invalid type annotation '' [invalid-annotation]"] -Line 98: Unexpected errors ['generics_typevartuple_specialization.py:98:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] -Line 99: Unexpected errors ['generics_typevartuple_specialization.py:99:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] -Line 101: Unexpected errors ["generics_typevartuple_specialization.py:101:15: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] -Line 102: Unexpected errors ["generics_typevartuple_specialization.py:102:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'tuple[Any][]' [invalid-annotation]"] -Line 103: Unexpected errors ["generics_typevartuple_specialization.py:103:21: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'tuple[Any][]' [invalid-annotation]"] -Line 117: Unexpected errors ["generics_typevartuple_specialization.py:117:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] -Line 118: Unexpected errors ["generics_typevartuple_specialization.py:118:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] -Line 119: Unexpected errors ["generics_typevartuple_specialization.py:119:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] -Line 120: Unexpected errors ["generics_typevartuple_specialization.py:120:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] -Line 125: Unexpected errors ["generics_typevartuple_specialization.py:125:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] -Line 130: Unexpected errors ["generics_typevartuple_specialization.py:130:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'tuple[Any][]' [invalid-annotation]", "generics_typevartuple_specialization.py:130:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'T2' [invalid-annotation]", "generics_typevartuple_specialization.py:130:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'T1' [invalid-annotation]", "generics_typevartuple_specialization.py:130:41: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] -Line 131: Unexpected errors ['generics_typevartuple_specialization.py:131:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func7: bad return type [bad-return-type]'] -Line 134: Unexpected errors ["generics_typevartuple_specialization.py:134:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'tuple[Any][str, bool]' [invalid-annotation]", "generics_typevartuple_specialization.py:134:33: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'tuple[Any][str, bool, float]' [invalid-annotation]", "generics_typevartuple_specialization.py:134:59: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'tuple[Any][str, bool, float, int]' [invalid-annotation]"] -Line 135: Unexpected errors ['generics_typevartuple_specialization.py:135:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func8: tuple[tuple[Any], Any, Any] [assert-type]'] -Line 136: Unexpected errors ['generics_typevartuple_specialization.py:136:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func8: tuple[tuple[Any], Any, Any] [assert-type]'] -Line 137: Unexpected errors ['generics_typevartuple_specialization.py:137:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func8: tuple[tuple[Any], Any, Any] [assert-type]'] -Line 140: Unexpected errors ["generics_typevartuple_specialization.py:140:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] -Line 143: Unexpected errors ["generics_typevartuple_specialization.py:143:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'tuple[Any][]' [invalid-annotation]", "generics_typevartuple_specialization.py:143:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'T3' [invalid-annotation]", "generics_typevartuple_specialization.py:143:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'T2' [invalid-annotation]", "generics_typevartuple_specialization.py:143:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'T1' [invalid-annotation]", "generics_typevartuple_specialization.py:143:45: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] -Line 144: Unexpected errors ['generics_typevartuple_specialization.py:144:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func9: bad return type [bad-return-type]'] -Line 147: Unexpected errors ["generics_typevartuple_specialization.py:147:15: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'tuple[Any][str, bool, float]' [invalid-annotation]", "generics_typevartuple_specialization.py:147:41: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'tuple[Any][str, bool, float, int]' [invalid-annotation]"] -Line 148: Unexpected errors ['generics_typevartuple_specialization.py:148:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func10: tuple[tuple[Any], Any, Any, Any] [assert-type]'] -Line 149: Unexpected errors ['generics_typevartuple_specialization.py:149:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func10: tuple[tuple[Any], Any, Any, Any] [assert-type]'] -Line 152: Unexpected errors ["generics_typevartuple_specialization.py:152:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] -Line 153: Unexpected errors ["generics_typevartuple_specialization.py:153:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'tuple[Any][]' [invalid-annotation]"] -Line 156: Unexpected errors ["generics_typevartuple_specialization.py:156:24: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'tuple[Any][]' [invalid-annotation]", "generics_typevartuple_specialization.py:156:55: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'tuple[Any][]' [invalid-annotation]"] -Line 157: Unexpected errors ["generics_typevartuple_specialization.py:157:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func11: Invalid type annotation '' [invalid-annotation]"] -Line 158: Unexpected errors ["generics_typevartuple_specialization.py:158:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func11: Invalid type annotation '' [invalid-annotation]"] -Line 159: Unexpected errors ["generics_typevartuple_specialization.py:159:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func11: Invalid type annotation '' [invalid-annotation]"] -Line 162: Unexpected errors ["generics_typevartuple_specialization.py:162:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] -""" diff --git a/conformance/results/pytype/generics_typevartuple_unpack.toml b/conformance/results/pytype/generics_typevartuple_unpack.toml deleted file mode 100644 index b19a75825..000000000 --- a/conformance/results/pytype/generics_typevartuple_unpack.toml +++ /dev/null @@ -1,74 +0,0 @@ -conformant = "Unsupported" -notes = """ -Does not support TypeVarTuple. -""" -output = """ -generics_typevartuple_unpack.py:7:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet] - -from typing import Any, Generic, NewType, TypeVarTuple -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_unpack.py:14:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] - -Ts = TypeVarTuple("Ts") - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_unpack.py:17:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] - -class Array(Generic[*Ts]): - \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_unpack.py:21:31: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] - -def process_batch_channels(x: Array[Batch, *tuple[Any, ...], Channels]) -> None: - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_unpack.py:26:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] - - x: Array[Batch, Height, Width, Channels], y: Array[Batch, Channels], z: Array[Batch] - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_unpack.py:26:50: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] - - x: Array[Batch, Height, Width, Channels], y: Array[Batch, Channels], z: Array[Batch] - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_unpack.py:26:77: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] - - x: Array[Batch, Height, Width, Channels], y: Array[Batch, Channels], z: Array[Batch] - \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_unpack.py:33:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] - -Shape = TypeVarTuple("Shape") - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_unpack.py:36:30: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] - -def expect_variadic_array(x: Array[Batch, *Shape]) -> None: - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_unpack.py:40:29: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] - -def expect_precise_array(x: Array[Batch, Height, Width, Channels]) -> None: - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_typevartuple_unpack.py:44:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] - -def func4(y: Array[*tuple[Any, ...]]): - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 30: Expected 1 errors -Line 7: Unexpected errors ['generics_typevartuple_unpack.py:7:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet]'] -Line 14: Unexpected errors ['generics_typevartuple_unpack.py:14:6: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] -Line 17: Unexpected errors ["generics_typevartuple_unpack.py:17:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] -Line 21: Unexpected errors ['generics_typevartuple_unpack.py:21:31: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]'] -Line 26: Unexpected errors ['generics_typevartuple_unpack.py:26:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]', 'generics_typevartuple_unpack.py:26:50: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]', 'generics_typevartuple_unpack.py:26:77: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]'] -Line 33: Unexpected errors ['generics_typevartuple_unpack.py:33:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] -Line 36: Unexpected errors ['generics_typevartuple_unpack.py:36:30: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]'] -Line 40: Unexpected errors ['generics_typevartuple_unpack.py:40:29: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]'] -Line 44: Unexpected errors ['generics_typevartuple_unpack.py:44:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]'] -""" diff --git a/conformance/results/pytype/generics_upper_bound.toml b/conformance/results/pytype/generics_upper_bound.toml deleted file mode 100644 index 756776a8e..000000000 --- a/conformance/results/pytype/generics_upper_bound.toml +++ /dev/null @@ -1,41 +0,0 @@ -conformant = "Partial" -notes = """ -Does not properly support assert_type. -""" -output = """ -generics_upper_bound.py:24:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Test: Invalid TypeVar: bound cannot contain TypeVars [invalid-typevar] - - T_Bad1 = TypeVar("T_Bad1", bound=list[T]) # E - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_upper_bound.py:37:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : list [assert-type] - -assert_type(longer([1], [1, 2]), list[int]) -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_upper_bound.py:38:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : set [assert-type] - -assert_type(longer({1}, {1, 2}), set[int]) -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_upper_bound.py:43:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Union[list, set] [assert-type] - -assert_type(longer([1], {1, 2}), list[int] | set[int]) # E? -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_upper_bound.py:51:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function longer was called with the wrong arguments [wrong-arg-types] - -longer(3, 3) # E -\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_upper_bound.py:56:10: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid TypeVar: constraints and a bound are mutually exclusive [invalid-typevar] - -T_Bad2 = TypeVar("T_Bad2", str, int, bound="int") # E - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 37: Unexpected errors ['generics_upper_bound.py:37:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : list [assert-type]'] -Line 38: Unexpected errors ['generics_upper_bound.py:38:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : set [assert-type]'] -""" diff --git a/conformance/results/pytype/generics_variance.toml b/conformance/results/pytype/generics_variance.toml deleted file mode 100644 index 46ec8ed46..000000000 --- a/conformance/results/pytype/generics_variance.toml +++ /dev/null @@ -1,55 +0,0 @@ -conformant = "Unsupported" -notes = """ -Does not support covariant or contravariant TypeVars. -""" -output = """ -generics_variance.py:14:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet] - -X1 = TypeVar("X1", covariant=True, contravariant=True) # E - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_variance.py:14:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "contravariant" to TypeVar not supported yet [not-supported-yet] - -X1 = TypeVar("X1", covariant=True, contravariant=True) # E - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_variance.py:18:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet] - -T_co = TypeVar("T_co", covariant=True) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_variance.py:19:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "contravariant" to TypeVar not supported yet [not-supported-yet] - -T_contra = TypeVar("T_contra", contravariant=True) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -generics_variance.py:27:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __iter__: bad return type [bad-return-type] - - ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m - -generics_variance.py:52:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet] - -B_co = TypeVar("B_co", covariant=True) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 77: Expected 1 errors -Line 81: Expected 1 errors -Line 93: Expected 1 errors -Line 105: Expected 1 errors -Line 113: Expected 1 errors -Line 163: Expected 1 errors -Line 167: Expected 1 errors -Line 191: Expected 1 errors -Lines 125, 126: Expected error (tag 'CoContra_Child2') -Lines 131, 132: Expected error (tag 'CoContra_Child3') -Lines 141, 142: Expected error (tag 'CoContra_Child5') -Lines 195, 196: Expected error (tag 'ContraToContraToContra_WithTA') -Line 18: Unexpected errors ['generics_variance.py:18:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] -Line 19: Unexpected errors ['generics_variance.py:19:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "contravariant" to TypeVar not supported yet [not-supported-yet]'] -Line 27: Unexpected errors ['generics_variance.py:27:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __iter__: bad return type [bad-return-type]'] -Line 52: Unexpected errors ['generics_variance.py:52:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] -""" diff --git a/conformance/results/pytype/generics_variance_inference.toml b/conformance/results/pytype/generics_variance_inference.toml deleted file mode 100644 index 67937210c..000000000 --- a/conformance/results/pytype/generics_variance_inference.toml +++ /dev/null @@ -1,33 +0,0 @@ -conformant = "Unsupported" -notes = """ -Type parameter syntax not yet support. -""" -output = """ -SyntaxError: Type parameter lists are only supported in Python 3.12 and greater (, line 15) -""" -conformance_automated = "Fail" -errors_diff = """ -Line 24: Expected 1 errors -Line 25: Expected 1 errors -Line 28: Expected 1 errors -Line 41: Expected 1 errors -Line 49: Expected 1 errors -Line 58: Expected 1 errors -Line 67: Expected 1 errors -Line 80: Expected 1 errors -Line 96: Expected 1 errors -Line 97: Expected 1 errors -Line 111: Expected 1 errors -Line 112: Expected 1 errors -Line 119: Expected 1 errors -Line 120: Expected 1 errors -Line 121: Expected 1 errors -Line 122: Expected 1 errors -Line 130: Expected 1 errors -Line 138: Expected 1 errors -Line 149: Expected 1 errors -Line 169: Expected 1 errors -Line 170: Expected 1 errors -Line 181: Expected 1 errors -Line 194: Expected 1 errors -""" diff --git a/conformance/results/pytype/historical_positional.toml b/conformance/results/pytype/historical_positional.toml deleted file mode 100644 index 563658c06..000000000 --- a/conformance/results/pytype/historical_positional.toml +++ /dev/null @@ -1,18 +0,0 @@ -conformant = "Partial" -notes = """ -Does not apply rules for pre-3.8 positional-only parameters in some cases. -Does not reject positional-only parameter after non-positional-only parameter. -""" -output = """ -historical_positional.py:43:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid keyword argument __x to function A.m1 [wrong-keyword-args] - -a.m1(__x=3) # E -\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 18: Expected 1 errors -Line 26: Expected 1 errors -Line 38: Expected 1 errors -""" diff --git a/conformance/results/pytype/literals_interactions.toml b/conformance/results/pytype/literals_interactions.toml deleted file mode 100644 index a9a4375b2..000000000 --- a/conformance/results/pytype/literals_interactions.toml +++ /dev/null @@ -1,87 +0,0 @@ -conformant = "Partial" -notes = """ -Incorrectly rejects some legal Literal annotations. -Does not reject some illegal Literal annotations. -Does not use Literal to distinguish overloads. -Does not narrow based on `x is Literal` type guard pattern. -Does not narrow based on `x == Literal` type guard pattern. -""" -output = """ -literals_interactions.py:11:76: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] - -def func1(v: tuple[int, str, list[bool]], a: Literal[0], b: Literal[5], c: Literal[-5]): - \u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m - -literals_interactions.py:46:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in open: bad return type [bad-return-type] - - pass - \u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m - -Called from (traceback): - line 51, in current file -literals_interactions.py:46:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in open: bad return type [bad-return-type] - - pass - \u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m - -Called from (traceback): - line 50, in current file -literals_interactions.py:46:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in open: bad return type [bad-return-type] - - pass - \u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m - -Called from (traceback): - line 49, in current file -literals_interactions.py:61:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __add__: bad return type [bad-return-type] - - ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m - -literals_interactions.py:64:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __matmul__: bad return type [bad-return-type] - - ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m - -literals_interactions.py:67:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in transpose: bad return type [bad-return-type] - - ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m - -literals_interactions.py:72:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func2: Matrix[Any, int] [assert-type] - - assert_type(c, Matrix[Literal[2], Literal[7]]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -literals_interactions.py:93:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in parse_status1: Union[Status, str] [assert-type] - - assert_type(s, str) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -literals_interactions.py:106:16: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in parse_status2: Function expects_bad_status was called with the wrong arguments [wrong-arg-types] - - return expects_bad_status(status) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -literals_interactions.py:109:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in parse_status2: Function expects_pending_status was called with the wrong arguments [wrong-arg-types] - - expects_pending_status(status) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 15: Expected 1 errors -Line 16: Expected 1 errors -Line 17: Expected 1 errors -Line 18: Expected 1 errors -Line 11: Unexpected errors ["literals_interactions.py:11:76: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Literal' [invalid-annotation]"] -Line 46: Unexpected errors ['literals_interactions.py:46:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in open: bad return type [bad-return-type]', 'literals_interactions.py:46:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in open: bad return type [bad-return-type]', 'literals_interactions.py:46:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in open: bad return type [bad-return-type]'] -Line 61: Unexpected errors ['literals_interactions.py:61:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __add__: bad return type [bad-return-type]'] -Line 64: Unexpected errors ['literals_interactions.py:64:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __matmul__: bad return type [bad-return-type]'] -Line 67: Unexpected errors ['literals_interactions.py:67:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in transpose: bad return type [bad-return-type]'] -Line 72: Unexpected errors ['literals_interactions.py:72:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func2: Matrix[Any, int] [assert-type]'] -Line 93: Unexpected errors ['literals_interactions.py:93:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in parse_status1: Union[Status, str] [assert-type]'] -Line 106: Unexpected errors ['literals_interactions.py:106:16: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in parse_status2: Function expects_bad_status was called with the wrong arguments [wrong-arg-types]'] -Line 109: Unexpected errors ['literals_interactions.py:109:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in parse_status2: Function expects_pending_status was called with the wrong arguments [wrong-arg-types]'] -""" diff --git a/conformance/results/pytype/literals_literalstring.toml b/conformance/results/pytype/literals_literalstring.toml deleted file mode 100644 index 1a86e0b8c..000000000 --- a/conformance/results/pytype/literals_literalstring.toml +++ /dev/null @@ -1,89 +0,0 @@ -conformant = "Unsupported" -notes = """ -Does not understand `LiteralString` special form. -""" -output = """ -literals_literalstring.py:8:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing.LiteralString not supported yet [not-supported-yet] - -from typing import ( -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - Any, -\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m - Generic, -\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m - Literal, -\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m - LiteralString, -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - Sequence, -\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - TypeVar, -\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m - assert_type, -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - overload, -\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m -) -\u001b[1m\u001b[31m~\u001b[39m\u001b[0m - -literals_literalstring.py:24:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in my_function: bad return type [bad-return-type] - - ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m - -literals_literalstring.py:36:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] - -bad_union: Literal["hello", LiteralString] # E - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -literals_literalstring.py:37:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] - -bad_nesting: Literal[LiteralString] # E - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -literals_literalstring.py:43:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Type annotation for x2 does not match type of assignment [annotation-type-mismatch] - - x2: Literal[""] = b # E - \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -literals_literalstring.py:74:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func2: Type annotation for x3 does not match type of assignment [annotation-type-mismatch] - - x3: LiteralString = 3 # E - \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -literals_literalstring.py:75:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func2: Type annotation for x4 does not match type of assignment [annotation-type-mismatch] - - x4: LiteralString = b"test" # E - \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -literals_literalstring.py:162:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func8: bad return type [bad-return-type] - - ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m - -Called from (traceback): - line 166, in current file -literals_literalstring.py:162:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func8: bad return type [bad-return-type] - - ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m - -Called from (traceback): - line 165, in current file -literals_literalstring.py:167:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : B [assert-type] - -assert_type(func8(str(1)), A) # Third overload -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 66: Expected 1 errors -Line 120: Expected 1 errors -Line 134: Expected 1 errors -Line 171: Expected 1 errors -Line 8: Unexpected errors ['literals_literalstring.py:8:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.LiteralString not supported yet [not-supported-yet]'] -Line 24: Unexpected errors ['literals_literalstring.py:24:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in my_function: bad return type [bad-return-type]'] -Line 162: Unexpected errors ['literals_literalstring.py:162:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func8: bad return type [bad-return-type]', 'literals_literalstring.py:162:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func8: bad return type [bad-return-type]'] -Line 167: Unexpected errors ['literals_literalstring.py:167:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : B [assert-type]'] -""" diff --git a/conformance/results/pytype/literals_parameterizations.toml b/conformance/results/pytype/literals_parameterizations.toml deleted file mode 100644 index a1751be55..000000000 --- a/conformance/results/pytype/literals_parameterizations.toml +++ /dev/null @@ -1,106 +0,0 @@ -conformant = "Unsupported" -notes = """ -Does not understand `Literal` type annotation. -""" -output = """ -literals_parameterizations.py:17:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] - -good1: Literal[26] - \u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m - -literals_parameterizations.py:18:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] - -good2: Literal[0x1A] - \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - -literals_parameterizations.py:19:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] - -good3: Literal[-4] - \u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m - -literals_parameterizations.py:33:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] - -AllModes = Literal[ReadOnlyMode, WriteAndTruncateMode, WriteNoTruncateMode, AppendMode] - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -literals_parameterizations.py:35:17: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] - -good11: Literal[Literal[Literal[1, 2, 3], "foo"], 5, None] - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -literals_parameterizations.py:35:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] - -good11: Literal[Literal[Literal[1, 2, 3], "foo"], 5, None] - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -literals_parameterizations.py:42:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] - -bad2: Literal["foo".replace("o", "b")] # E - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -literals_parameterizations.py:43:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] - -bad3: Literal[4 + 3j] # E - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -literals_parameterizations.py:44:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] - -bad4: Literal[~5] # E - \u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m - -literals_parameterizations.py:47:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] - -bad7: Literal[{"a": "b", "c": "d"}] # E - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -literals_parameterizations.py:48:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] - -bad8: Literal[int] # E - \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m - -literals_parameterizations.py:50:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] - -bad10: Literal[T] # E - \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m - -literals_parameterizations.py:51:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] - -bad11: Literal[3.14] # E - \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - -literals_parameterizations.py:53:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] - -bad13: Literal[...] # E - \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m - -literals_parameterizations.py:61:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal[my_function]' [invalid-annotation] - -y: Literal[my_function] = my_function # E -\u001b[1m\u001b[31m~\u001b[39m\u001b[0m - -literals_parameterizations.py:61:4: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] - -y: Literal[my_function] = my_function # E - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -literals_parameterizations.py:65:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func2: Type annotation for x1 does not match type of assignment [annotation-type-mismatch] - - x1: Literal["Color.RED"] = a # E - \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 41: Expected 1 errors -Line 45: Expected 1 errors -Line 46: Expected 1 errors -Line 49: Expected 1 errors -Line 52: Expected 1 errors -Line 56: Expected 1 errors -Line 60: Expected 1 errors -Line 17: Unexpected errors ["literals_parameterizations.py:17:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Literal' [invalid-annotation]"] -Line 18: Unexpected errors ["literals_parameterizations.py:18:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Literal' [invalid-annotation]"] -Line 19: Unexpected errors ["literals_parameterizations.py:19:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Literal' [invalid-annotation]"] -Line 33: Unexpected errors ["literals_parameterizations.py:33:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Literal' [invalid-annotation]"] -Line 35: Unexpected errors ["literals_parameterizations.py:35:17: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Literal' [invalid-annotation]", "literals_parameterizations.py:35:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Literal' [invalid-annotation]"] -""" diff --git a/conformance/results/pytype/literals_semantics.toml b/conformance/results/pytype/literals_semantics.toml deleted file mode 100644 index e443c9509..000000000 --- a/conformance/results/pytype/literals_semantics.toml +++ /dev/null @@ -1,62 +0,0 @@ -conformant = "Unsupported" -notes = """ -Does not understand `Literal` type annotation. -""" -output = """ -literals_semantics.py:10:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for v2 does not match type of assignment [annotation-type-mismatch] - -v2: Literal[3] = 4 # E -\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -literals_semantics.py:12:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] - -v3: L[-3] = -3 - \u001b[1m\u001b[31m~~~~~\u001b[39m\u001b[0m - -literals_semantics.py:12:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'L[-3]' [invalid-annotation] - -v3: L[-3] = -3 -\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -literals_semantics.py:16:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] - -def func1(a: Literal[20], b: Literal[0x14], c: Literal[0b10100]): - \u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m - -literals_semantics.py:16:30: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] - -def func1(a: Literal[20], b: Literal[0x14], c: Literal[0b10100]): - \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - -literals_semantics.py:16:48: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] - -def func1(a: Literal[20], b: Literal[0x14], c: Literal[0b10100]): - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -literals_semantics.py:17:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Invalid type annotation 'Literal[20]' [invalid-annotation] - - x1: Literal[0x14] = a - \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -literals_semantics.py:18:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Invalid type annotation 'Literal[20]' [invalid-annotation] - - x2: Literal[0x14] = b - \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -literals_semantics.py:19:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Invalid type annotation 'Literal[20]' [invalid-annotation] - - x3: Literal[0x14] = c - \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 24: Expected 1 errors -Line 25: Expected 1 errors -Line 33: Expected 1 errors -Line 12: Unexpected errors ["literals_semantics.py:12:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Literal' [invalid-annotation]", "literals_semantics.py:12:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'L[-3]' [invalid-annotation]"] -Line 16: Unexpected errors ["literals_semantics.py:16:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Literal' [invalid-annotation]", "literals_semantics.py:16:30: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Literal' [invalid-annotation]", "literals_semantics.py:16:48: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Literal' [invalid-annotation]"] -Line 17: Unexpected errors ["literals_semantics.py:17:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: Invalid type annotation 'Literal[20]' [invalid-annotation]"] -Line 18: Unexpected errors ["literals_semantics.py:18:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: Invalid type annotation 'Literal[20]' [invalid-annotation]"] -Line 19: Unexpected errors ["literals_semantics.py:19:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: Invalid type annotation 'Literal[20]' [invalid-annotation]"] -""" diff --git a/conformance/results/pytype/namedtuples_define_class.toml b/conformance/results/pytype/namedtuples_define_class.toml deleted file mode 100644 index 189add7c1..000000000 --- a/conformance/results/pytype/namedtuples_define_class.toml +++ /dev/null @@ -1,81 +0,0 @@ -conformant = "Partial" -notes = """ -Incorrectly rejects valid index of named tuple instance when using a negative index. -Does not evaluate correct type for indexed named tuple instance with slice. -Does not reject named tuple element with no default value after one with a default. -Does not reject override of named tuple attribute in child class. -Evaluates incorrect type for named tuple entry with a generic type. -Does not reject incorrect argument type passed to specialized generic named tuple constructor. -Does not reject attempt to use NamedTuple with multiple inheritance. -""" -output = """ -namedtuples_define_class.py:27:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Union[int, str] [assert-type] - -assert_type(p1[-2], int) -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -namedtuples_define_class.py:28:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Union[int, str] [assert-type] - -assert_type(p1[-3], int) -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -namedtuples_define_class.py:29:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : tuple[Union[int, str], ...] [assert-type] - -assert_type(p1[0:2], tuple[int, int]) -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -namedtuples_define_class.py:30:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : tuple[Union[int, str], ...] [assert-type] - -assert_type(p1[0:], tuple[int, int, str]) -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -namedtuples_define_class.py:44:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'y' in call to function Point.__new__ [missing-parameter] - -p5 = Point(1) # E - \u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m - -namedtuples_define_class.py:45:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'y' in call to function Point.__new__ [missing-parameter] - -p6 = Point(x=1) # E - \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m - -namedtuples_define_class.py:46:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Point.__new__ was called with the wrong arguments [wrong-arg-types] - -p7 = Point(1, "") # E - \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m - -namedtuples_define_class.py:47:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Point.__new__ was called with the wrong arguments [wrong-arg-types] - -p8 = Point(1, 2, units=3) # E - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -namedtuples_define_class.py:48:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Point.__new__ expects 3 arg(s), got 5 [wrong-arg-count] - -p9 = Point(1, 2, "", "") # E - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -namedtuples_define_class.py:49:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid keyword argument other to function Point.__new__ [wrong-keyword-args] - -p10 = Point(1, 2, "", other="") # E - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -namedtuples_define_class.py:95:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Any [assert-type] - -assert_type(pr1[1], float) -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 32: Expected 1 errors -Line 33: Expected 1 errors -Line 59: Expected 1 errors -Line 79: Expected 1 errors -Line 98: Expected 1 errors -Line 105: Expected 1 errors -Line 27: Unexpected errors ['namedtuples_define_class.py:27:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Union[int, str] [assert-type]'] -Line 28: Unexpected errors ['namedtuples_define_class.py:28:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Union[int, str] [assert-type]'] -Line 29: Unexpected errors ['namedtuples_define_class.py:29:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : tuple[Union[int, str], ...] [assert-type]'] -Line 30: Unexpected errors ['namedtuples_define_class.py:30:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : tuple[Union[int, str], ...] [assert-type]'] -Line 95: Unexpected errors ['namedtuples_define_class.py:95:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Any [assert-type]'] -""" diff --git a/conformance/results/pytype/namedtuples_define_functional.toml b/conformance/results/pytype/namedtuples_define_functional.toml deleted file mode 100644 index f18a771b4..000000000 --- a/conformance/results/pytype/namedtuples_define_functional.toml +++ /dev/null @@ -1,72 +0,0 @@ -conformant = "Partial" -notes = """ -Does not handle illegal named tuple names the same as runtime. -Does not support defaults in functional form. -""" -output = """ -namedtuples_define_functional.py:16:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'y' in call to function Point1.__new__ [missing-parameter] - -p1_3 = Point1(2.3) # E - \u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m - -namedtuples_define_functional.py:21:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'x' in call to function Point2.__new__ [missing-parameter] - -p2_3 = Point2() # E - \u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m - -namedtuples_define_functional.py:26:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Point3.__new__ expects 3 arg(s), got 4 [wrong-arg-count] - -p3_3 = Point3(1, 2, 3) # E - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -namedtuples_define_functional.py:31:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid keyword argument z to function Point4.__new__ [wrong-keyword-args] - -p4_3 = Point4(1, z=3) # E - \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -namedtuples_define_functional.py:36:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Point5.__new__ was called with the wrong arguments [wrong-arg-types] - -p5_3 = Point5(2, "1") # E - \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -namedtuples_define_functional.py:37:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Point5.__new__ expects 3 arg(s), got 4 [wrong-arg-count] - -p5_4 = Point5(1, 2, 3) # E - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -namedtuples_define_functional.py:42:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Point6.__new__ was called with the wrong arguments [wrong-arg-types] - -p6_3 = Point6(2, "1") # E - \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -namedtuples_define_functional.py:43:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Point6.__new__ was called with the wrong arguments [wrong-arg-types] - -p6_4 = Point6(x=1.1, y=2) # E - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -namedtuples_define_functional.py:52:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : collections.namedtuple argument 'a' is not a valid typename or field name. [invalid-namedtuple-arg] - -NT1 = namedtuple("NT1", ["a", "a"]) # E?: duplicate field name - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -namedtuples_define_functional.py:53:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : collections.namedtuple argument 'def' is not a valid typename or field name. [invalid-namedtuple-arg] - -NT2 = namedtuple("NT2", ["abc", "def"]) # E?: illegal field name - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -namedtuples_define_functional.py:54:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : collections.namedtuple argument 'def' is not a valid typename or field name. [invalid-namedtuple-arg] - -NT3 = namedtuple("NT3", ["abc", "def"], rename=False) # E?: illegal field name - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -namedtuples_define_functional.py:63:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function collections.namedtuple was called with the wrong arguments [wrong-arg-types] - -NT5 = namedtuple("NT5", "a b c", defaults=(1, 2)) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 66: Expected 1 errors -Line 63: Unexpected errors ['namedtuples_define_functional.py:63:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function collections.namedtuple was called with the wrong arguments [wrong-arg-types]'] -""" diff --git a/conformance/results/pytype/namedtuples_type_compat.toml b/conformance/results/pytype/namedtuples_type_compat.toml deleted file mode 100644 index a649efd7f..000000000 --- a/conformance/results/pytype/namedtuples_type_compat.toml +++ /dev/null @@ -1,16 +0,0 @@ -conformant = "Pass" -output = """ -namedtuples_type_compat.py:22:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for v3 does not match type of assignment [annotation-type-mismatch] - -v3: tuple[int, int] = p # E: too few elements -\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -namedtuples_type_compat.py:23:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for v4 does not match type of assignment [annotation-type-mismatch] - -v4: tuple[int, str, str] = p # E: incompatible element type -\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Pass" -errors_diff = """ -""" diff --git a/conformance/results/pytype/namedtuples_usage.toml b/conformance/results/pytype/namedtuples_usage.toml deleted file mode 100644 index 91aabf28c..000000000 --- a/conformance/results/pytype/namedtuples_usage.toml +++ /dev/null @@ -1,48 +0,0 @@ -conformant = "Partial" -notes = """ -Incorrectly rejects valid index of named tuple instance when using a negative index. -Does not report out-of-range index access with named tuple instance. -Does not reject attempt to overwrite named tuple entry by name. -Does not reject attempt to delete named tuple entry by name. -""" -output = """ -namedtuples_usage.py:31:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Union[int, str] [assert-type] - -assert_type(p[-2], int) -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -namedtuples_usage.py:32:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Union[int, str] [assert-type] - -assert_type(p[-3], int) -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -namedtuples_usage.py:41:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : unsupported operand type(s) for item assignment: Point [unsupported-operands] - -p[0] = 3 # E -\u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m - -namedtuples_usage.py:43:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : unsupported operand type(s) for item deletion: Point [unsupported-operands] - -del p[0] # E - \u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m - -namedtuples_usage.py:52:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Cannot unpack 3 values into 2 variables [bad-unpacking] - -x2, y2 = p # E: too few values to unpack -\u001b[1m\u001b[31m~~~~~~\u001b[39m\u001b[0m - -namedtuples_usage.py:53:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Cannot unpack 3 values into 4 variables [bad-unpacking] - -x3, y3, unit3, other = p # E: too many values to unpack -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 34: Expected 1 errors -Line 35: Expected 1 errors -Line 40: Expected 1 errors -Line 42: Expected 1 errors -Line 31: Unexpected errors ['namedtuples_usage.py:31:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Union[int, str] [assert-type]'] -Line 32: Unexpected errors ['namedtuples_usage.py:32:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Union[int, str] [assert-type]'] -""" diff --git a/conformance/results/pytype/narrowing_typeguard.toml b/conformance/results/pytype/narrowing_typeguard.toml deleted file mode 100644 index da2f78df4..000000000 --- a/conformance/results/pytype/narrowing_typeguard.toml +++ /dev/null @@ -1,21 +0,0 @@ -conformant = "Partial" -notes = """ -Does not reject TypeGuard method with too few parameters. -""" -output = """ -narrowing_typeguard.py:128:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function takes_callable_str was called with the wrong arguments [wrong-arg-types] - -takes_callable_str(simple_typeguard) # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -narrowing_typeguard.py:148:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function takes_callable_str_proto was called with the wrong arguments [wrong-arg-types] - -takes_callable_str_proto(simple_typeguard) # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 102: Expected 1 errors -Line 107: Expected 1 errors -""" diff --git a/conformance/results/pytype/narrowing_typeis.toml b/conformance/results/pytype/narrowing_typeis.toml deleted file mode 100644 index 7101206c1..000000000 --- a/conformance/results/pytype/narrowing_typeis.toml +++ /dev/null @@ -1,48 +0,0 @@ -conformant = "Partial" -notes = """ -Does not narrow correctly on generic tuple type. -Does not reject covariant use of TypeIs. -Does not reject TypeIs where return type is not consistent with input type due to variance. -""" -output = """ -narrowing_typeis.py:19:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: tuple[str, ...] [assert-type] - - assert_type(names, tuple[str, str]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -narrowing_typeis.py:132:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function takes_callable_str was called with the wrong arguments [wrong-arg-types] - -takes_callable_str(simple_typeguard) # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -narrowing_typeis.py:152:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function takes_callable_str_proto was called with the wrong arguments [wrong-arg-types] - -takes_callable_str_proto(simple_typeguard) # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -narrowing_typeis.py:169:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function takes_typeguard was called with the wrong arguments [wrong-arg-types] - -takes_typeguard(is_int_typeis) # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -narrowing_typeis.py:170:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function takes_typeis was called with the wrong arguments [wrong-arg-types] - -takes_typeis(is_int_typeguard) # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -narrowing_typeis.py:195:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : TypeIs[str] is not consistent with input type int [invalid-function-definition] - -def bad_typeis(x: int) -> TypeIs[str]: # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - return isinstance(x, str) -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 105: Expected 1 errors -Line 110: Expected 1 errors -Line 191: Expected 1 errors -Line 199: Expected 1 errors -Line 19: Unexpected errors ['narrowing_typeis.py:19:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: tuple[str, ...] [assert-type]'] -""" diff --git a/conformance/results/pytype/overloads_basic.toml b/conformance/results/pytype/overloads_basic.toml deleted file mode 100644 index d1e57904c..000000000 --- a/conformance/results/pytype/overloads_basic.toml +++ /dev/null @@ -1,25 +0,0 @@ -conformant = "Partial" -notes = """ -""" -output = """ -overloads_basic.py:33:20: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __getitem__: bad return type [bad-return-type] - - return b"" - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m - -overloads_basic.py:39:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : unsupported operand type(s) for item retrieval: Bytes and str [unsupported-operands] - -b[""] # E: no matching overload -\u001b[1m\u001b[31m~~~~~\u001b[39m\u001b[0m - -overloads_basic.py:60:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in map: bad return type [bad-return-type] - - pass - \u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 33: Unexpected errors ['overloads_basic.py:33:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __getitem__: bad return type [bad-return-type]'] -Line 60: Unexpected errors ['overloads_basic.py:60:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in map: bad return type [bad-return-type]'] -""" diff --git a/conformance/results/pytype/overloads_consistency.toml b/conformance/results/pytype/overloads_consistency.toml deleted file mode 100644 index 58abf8d76..000000000 --- a/conformance/results/pytype/overloads_consistency.toml +++ /dev/null @@ -1,56 +0,0 @@ -conformant = "Fail" -notes = """ -Doesn't appear to validate overload consistency at all. -""" -conformance_automated = "Fail" -errors_diff = """ -Lines 25, 28: Expected error (tag 'return_type') -Lines 41, 44: Expected error (tag 'parameter_type') -Line 29: Unexpected errors ['overloads_consistency.py:29:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in return_type: bad return type [bad-return-type]'] -Line 45: Unexpected errors ['overloads_consistency.py:45:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in parameter_type: bad return type [bad-return-type]'] -Line 74: Unexpected errors ['overloads_consistency.py:74:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in returns_coroutine: bad return type [bad-return-type]'] -Line 89: Unexpected errors ['overloads_consistency.py:89:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in returns_coroutine_2: bad return type [bad-return-type]', 'overloads_consistency.py:89:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in returns_coroutine_2: bad return type [bad-return-type]'] -Line 108: Unexpected errors ['overloads_consistency.py:108:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function decorated expects 0 arg(s), got 1 [wrong-arg-count]'] -Line 116: Unexpected errors ["overloads_consistency.py:116:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Missing parameter 'z' in call to function decorated [missing-parameter]"] -""" -output = """ -overloads_consistency.py:29:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in return_type: bad return type [bad-return-type] - - return 1 - \u001b[1m\u001b[31m~\u001b[39m\u001b[0m - -overloads_consistency.py:45:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in parameter_type: bad return type [bad-return-type] - - return 1 - \u001b[1m\u001b[31m~\u001b[39m\u001b[0m - -overloads_consistency.py:74:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in returns_coroutine: bad return type [bad-return-type] - - return 1 - \u001b[1m\u001b[31m~\u001b[39m\u001b[0m - -overloads_consistency.py:89:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in returns_coroutine_2: bad return type [bad-return-type] - - return _wrapped(x) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -overloads_consistency.py:89:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in returns_coroutine_2: bad return type [bad-return-type] - - return _wrapped(x) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -overloads_consistency.py:108:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function decorated expects 0 arg(s), got 1 [wrong-arg-count] - -def decorated() -> None: -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - ... -\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m - -overloads_consistency.py:116:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'z' in call to function decorated [missing-parameter] - -def decorated(y: bytes, z: bytes) -> bytes: -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - return b"" -\u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -""" diff --git a/conformance/results/pytype/overloads_definitions.toml b/conformance/results/pytype/overloads_definitions.toml deleted file mode 100644 index 01f5bab94..000000000 --- a/conformance/results/pytype/overloads_definitions.toml +++ /dev/null @@ -1,302 +0,0 @@ -conformant = "Fail" -notes = """ -Does not reject a function with a single @overload signature. -Does not reject a function with @overload signature but no implementation. -Does not allow an overload with no implementation in a Protocol or an abstract base class. -Does not error on overloads inconsistently decorated with `@staticmethod` or `@classmethod`. -Does not enforce any rules on location of @final or @override decorators. -""" -conformance_automated = "Fail" -errors_diff = """ -Lines 15, 16: Expected error (tag 'func1') -Lines 27, 28: Expected error (tag 'func2') -Lines 58, 59: Expected error (tag 'not_abstract') -Lines 71, 73, 78, 81: Expected error (tag 'func5') -Lines 84, 86, 90, 94: Expected error (tag 'func6') -Lines 121, 123, 127: Expected error (tag 'invalid_final') -Lines 135, 136, 137, 141, 142: Expected error (tag 'invalid_final_2') -Lines 220, 221, 222, 225, 226: Expected error (tag 'override_impl') -Line 6: Unexpected errors ['overloads_definitions.py:6:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.override not supported yet [not-supported-yet]'] -Line 43: Unexpected errors ["overloads_definitions.py:43:37: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func3: @typing.overload-decorated 'MyProto.func3' object is not callable [not-callable]"] -Line 53: Unexpected errors ["overloads_definitions.py:53:37: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func4: @typing.overload-decorated 'MyAbstractBase.func4' object is not callable [not-callable]"] -Line 63: Unexpected errors ["overloads_definitions.py:63:44: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in not_abstract: @typing.overload-decorated 'MyAbstractBase.not_abstract' object is not callable [not-callable]"] -Line 74: Unexpected errors ['overloads_definitions.py:74:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func5: bad return type [bad-return-type]'] -Line 79: Unexpected errors ['overloads_definitions.py:79:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func5: bad return type [bad-return-type]'] -Line 95: Unexpected errors ['overloads_definitions.py:95:16: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func6: bad return type [bad-return-type]'] -Line 117: Unexpected errors ['overloads_definitions.py:117:56: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in final_method: bad return type [bad-return-type]', 'overloads_definitions.py:117:56: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in final_method: bad return type [bad-return-type]'] -Line 130: Unexpected errors ['overloads_definitions.py:130:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in invalid_final: bad return type [bad-return-type]', 'overloads_definitions.py:130:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in invalid_final: bad return type [bad-return-type]'] -Line 146: Unexpected errors ['overloads_definitions.py:146:59: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in invalid_final_2: bad return type [bad-return-type]', 'overloads_definitions.py:146:59: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in invalid_final_2: bad return type [bad-return-type]'] -Line 159: Unexpected errors ['overloads_definitions.py:159:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in good_override: bad return type [bad-return-type]', 'overloads_definitions.py:159:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in good_override: bad return type [bad-return-type]'] -Line 167: Unexpected errors ['overloads_definitions.py:167:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in to_override: bad return type [bad-return-type]', 'overloads_definitions.py:167:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in to_override: bad return type [bad-return-type]'] -Line 184: Unexpected errors ['overloads_definitions.py:184:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in final_method: bad return type [bad-return-type]', 'overloads_definitions.py:184:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in final_method: bad return type [bad-return-type]'] -Line 199: Unexpected errors ['overloads_definitions.py:199:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in bad_override: bad return type [bad-return-type]', 'overloads_definitions.py:199:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in bad_override: bad return type [bad-return-type]'] -Line 215: Unexpected errors ['overloads_definitions.py:215:57: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in good_override: bad return type [bad-return-type]', 'overloads_definitions.py:215:57: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in good_override: bad return type [bad-return-type]'] -Line 229: Unexpected errors ['overloads_definitions.py:229:55: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in to_override: bad return type [bad-return-type]', 'overloads_definitions.py:229:55: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in to_override: bad return type [bad-return-type]'] -""" -output = """ -overloads_definitions.py:6:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing.override not supported yet [not-supported-yet] - -from typing import ( -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - final, -\u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m - Protocol, -\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - overload, -\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - override, -\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m -) -\u001b[1m\u001b[31m~\u001b[39m\u001b[0m - -overloads_definitions.py:43:37: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func3: @typing.overload-decorated 'MyProto.func3' object is not callable [not-callable] - - def func3(self, x: str) -> str: ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m - -overloads_definitions.py:53:37: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func4: @typing.overload-decorated 'MyAbstractBase.func4' object is not callable [not-callable] - - def func4(self, x: str) -> str: ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m - -overloads_definitions.py:63:44: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in not_abstract: @typing.overload-decorated 'MyAbstractBase.not_abstract' object is not callable [not-callable] - - def not_abstract(self, x: str) -> str: ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m - -overloads_definitions.py:74:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func5: bad return type [bad-return-type] - - ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m - -overloads_definitions.py:79:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func5: bad return type [bad-return-type] - - ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m - -overloads_definitions.py:95:16: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func6: bad return type [bad-return-type] - - return 1 - \u001b[1m\u001b[31m~\u001b[39m\u001b[0m - -overloads_definitions.py:117:56: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in final_method: bad return type [bad-return-type] - - def final_method(self, x: int | str) -> int | str: ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m - -overloads_definitions.py:117:56: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in final_method: bad return type [bad-return-type] - - def final_method(self, x: int | str) -> int | str: ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m - -overloads_definitions.py:130:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in invalid_final: bad return type [bad-return-type] - - def invalid_final(self, x: int | str) -> int | str: ... -\u001b[1m\u001b[31m\u001b[39m\u001b[0m - -overloads_definitions.py:130:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in invalid_final: bad return type [bad-return-type] - - def invalid_final(self, x: int | str) -> int | str: ... -\u001b[1m\u001b[31m\u001b[39m\u001b[0m - -overloads_definitions.py:146:59: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in invalid_final_2: bad return type [bad-return-type] - - def invalid_final_2(self, x: int | str) -> int | str: ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m - -overloads_definitions.py:146:59: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in invalid_final_2: bad return type [bad-return-type] - - def invalid_final_2(self, x: int | str) -> int | str: ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m - -overloads_definitions.py:159:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in good_override: bad return type [bad-return-type] - - def good_override(self, x: int | str) -> int | str: ... -\u001b[1m\u001b[31m\u001b[39m\u001b[0m - -overloads_definitions.py:159:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in good_override: bad return type [bad-return-type] - - def good_override(self, x: int | str) -> int | str: ... -\u001b[1m\u001b[31m\u001b[39m\u001b[0m - -overloads_definitions.py:167:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in to_override: bad return type [bad-return-type] - - def to_override(self, x: int | str) -> int | str: ... -\u001b[1m\u001b[31m\u001b[39m\u001b[0m - -overloads_definitions.py:167:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in to_override: bad return type [bad-return-type] - - def to_override(self, x: int | str) -> int | str: ... -\u001b[1m\u001b[31m\u001b[39m\u001b[0m - -overloads_definitions.py:170:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Class Child overrides final method final_method, defined in base class Base [final-error] - -class Child(Base): # E[override-final] -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - # The correctly-decorated @final method `Base.final_method` should cause an -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - # error if overridden in a child class (we use an overload here to avoid -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - # questions of override LSP compatibility and focus only on the override): -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -\u001b[1m\u001b[31m\u001b[39m\u001b[0m - @overload # E[override-final] -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - def final_method(self, x: int) -> int: ... -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -\u001b[1m\u001b[31m\u001b[39m\u001b[0m - @overload -\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - def final_method(self, x: str) -> str: ... -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -\u001b[1m\u001b[31m\u001b[39m\u001b[0m - def final_method( # E[override-final] can't override final method -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - self, x: int | str -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - ) -> int | str: # E[override-final] can't override final method -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - ... -\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m - -\u001b[1m\u001b[31m\u001b[39m\u001b[0m - # This is the right way to mark an overload as @override (decorate -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - # implementation only), so the use of @override should cause an error -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - # (because there's no `Base.bad_override` method): -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -\u001b[1m\u001b[31m\u001b[39m\u001b[0m - @overload # E[bad_override] marked as override but doesn't exist in base -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - def bad_override(self, x: int) -> int: # E[bad_override] -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - ... -\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m - -\u001b[1m\u001b[31m\u001b[39m\u001b[0m - @overload -\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - def bad_override(self, x: str) -> str: ... -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -\u001b[1m\u001b[31m\u001b[39m\u001b[0m - @override # E[bad_override] -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - def bad_override(self, x: int | str) -> int | str: # E[bad_override] -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - ... -\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m - -\u001b[1m\u001b[31m\u001b[39m\u001b[0m - # This is also a correctly-decorated overloaded @override, which is -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - # overriding a method that does exist in the base, so there should be no -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - # error. We need both this test and the previous one, because in the -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - # previous test, an incorrect error about the use of @override decorator -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - # could appear on the same line as the expected error about overriding a -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - # method that doesn't exist in base: -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -\u001b[1m\u001b[31m\u001b[39m\u001b[0m - @overload -\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - def good_override(self, x: int) -> int: ... -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -\u001b[1m\u001b[31m\u001b[39m\u001b[0m - @overload -\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - def good_override(self, x: str) -> str: ... -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -\u001b[1m\u001b[31m\u001b[39m\u001b[0m - @override -\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - def good_override(self, x: int | str) -> int | str: ... -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -\u001b[1m\u001b[31m\u001b[39m\u001b[0m - # This is the wrong way to use @override with an overloaded method, and -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - # should emit an error: -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -\u001b[1m\u001b[31m\u001b[39m\u001b[0m - @overload # E[override_impl+]: @override should appear only on implementation -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - @override # E[override_impl+] -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - def to_override(self, x: int) -> int: ... # E[override_impl+] -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -\u001b[1m\u001b[31m\u001b[39m\u001b[0m - @overload -\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - @override # E[override_impl+] -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - def to_override(self, x: str) -> str: ... # E[override_impl+] -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -\u001b[1m\u001b[31m\u001b[39m\u001b[0m - @override -\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - def to_override(self, x: int | str) -> int | str: ... -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -overloads_definitions.py:184:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in final_method: bad return type [bad-return-type] - - ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m - -overloads_definitions.py:184:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in final_method: bad return type [bad-return-type] - - ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m - -overloads_definitions.py:191:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Child: Attribute 'bad_override' not found on any parent class [override-error] - - def bad_override(self, x: int) -> int: # E[bad_override] - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - ... -\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m - -overloads_definitions.py:199:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in bad_override: bad return type [bad-return-type] - - ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m - -overloads_definitions.py:199:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in bad_override: bad return type [bad-return-type] - - ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m - -overloads_definitions.py:215:57: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in good_override: bad return type [bad-return-type] - - def good_override(self, x: int | str) -> int | str: ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m - -overloads_definitions.py:215:57: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in good_override: bad return type [bad-return-type] - - def good_override(self, x: int | str) -> int | str: ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m - -overloads_definitions.py:229:55: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in to_override: bad return type [bad-return-type] - - def to_override(self, x: int | str) -> int | str: ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m - -overloads_definitions.py:229:55: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in to_override: bad return type [bad-return-type] - - def to_override(self, x: int | str) -> int | str: ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m - -""" diff --git a/conformance/results/pytype/overloads_definitions_stub.toml b/conformance/results/pytype/overloads_definitions_stub.toml deleted file mode 100644 index 24d83050a..000000000 --- a/conformance/results/pytype/overloads_definitions_stub.toml +++ /dev/null @@ -1,17 +0,0 @@ -conformant = "Fail" -notes = """ -Does not enforce any of the specified rules regarding overload definitions. -""" -conformance_automated = "Fail" -errors_diff = """ -Lines 13, 14: Expected error (tag 'func1') -Lines 32, 33, 37: Expected error (tag 'func5') -Lines 39, 41, 44: Expected error (tag 'func6') -Lines 67, 69, 71, 73: Expected error (tag 'invalid_final') -Lines 80, 82, 84, 86: Expected error (tag 'invalid_final_2') -Lines 102, 107, 108, 111, 113: Expected error (tag 'override-final') -Lines 120, 121, 122: Expected error (tag 'bad_override') -Lines 143, 147, 149: Expected error (tag 'override_impl') -""" -output = """ -""" diff --git a/conformance/results/pytype/overloads_evaluation.toml b/conformance/results/pytype/overloads_evaluation.toml deleted file mode 100644 index 6efdfacc7..000000000 --- a/conformance/results/pytype/overloads_evaluation.toml +++ /dev/null @@ -1,173 +0,0 @@ -conformant = "Partial" -notes = """ -Does not perform argument expansion (on any types) when matching overloads. -Does not treat multiple matches due to gradual types as ambiguous. -Does not prefer variadic match to indeterminate-length unpacked argument. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 115: Expected 1 errors -Line 33: Unexpected errors ['overloads_evaluation.py:33:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in example1_1: bad return type [bad-return-type]'] -Line 62: Unexpected errors ['overloads_evaluation.py:62:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in example1_2: bad return type [bad-return-type]', 'overloads_evaluation.py:62:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in example1_2: bad return type [bad-return-type]'] -Line 85: Unexpected errors ['overloads_evaluation.py:85:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in example2: bad return type [bad-return-type]'] -Line 106: Unexpected errors ['overloads_evaluation.py:106:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in check_expand_union: str [assert-type]'] -Line 130: Unexpected errors ['overloads_evaluation.py:130:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in expand_bool: bad return type [bad-return-type]', 'overloads_evaluation.py:130:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in expand_bool: bad return type [bad-return-type]'] -Line 134: Unexpected errors ['overloads_evaluation.py:134:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in check_expand_bool: Function expand_bool was called with the wrong arguments [wrong-arg-types]'] -Line 135: Unexpected errors ['overloads_evaluation.py:135:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in check_expand_bool: Any [assert-type]'] -Line 156: Unexpected errors ['overloads_evaluation.py:156:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in expand_enum: bad return type [bad-return-type]'] -Line 160: Unexpected errors ['overloads_evaluation.py:160:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in check_expand_enum: Function expand_enum was called with the wrong arguments [wrong-arg-types]'] -Line 161: Unexpected errors ['overloads_evaluation.py:161:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in check_expand_enum: Any [assert-type]'] -Line 176: Unexpected errors ['overloads_evaluation.py:176:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in expand_type_union: bad return type [bad-return-type]'] -Line 181: Unexpected errors ['overloads_evaluation.py:181:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in check_expand_type_union: int [assert-type]'] -Line 200: Unexpected errors ['overloads_evaluation.py:200:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in expand_tuple: bad return type [bad-return-type]'] -Line 205: Unexpected errors ['overloads_evaluation.py:205:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in check_expand_tuple: int [assert-type]'] -Line 224: Unexpected errors ['overloads_evaluation.py:224:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in variadic: bad return type [bad-return-type]'] -Line 234: Unexpected errors ['overloads_evaluation.py:234:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in check_variadic: str [assert-type]'] -Line 264: Unexpected errors ['overloads_evaluation.py:264:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in check_example4: list[int] [assert-type]'] -Line 280: Unexpected errors ['overloads_evaluation.py:280:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in check_example5: list[int] [assert-type]'] -Line 291: Unexpected errors ['overloads_evaluation.py:291:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in example6: bad return type [bad-return-type]', 'overloads_evaluation.py:291:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in example6: bad return type [bad-return-type]', 'overloads_evaluation.py:291:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in example6: bad return type [bad-return-type]'] -Line 345: Unexpected errors ['overloads_evaluation.py:345:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in check_example7: list[int] [assert-type]'] -""" -output = """ -overloads_evaluation.py:33:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in example1_1: bad return type [bad-return-type] - - return 1 - \u001b[1m\u001b[31m~\u001b[39m\u001b[0m - -Called from (traceback): - line 48, in current file -overloads_evaluation.py:38:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'x' in call to function example1_1 [missing-parameter] - -example1_1() # E: no matching overload -\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m - -overloads_evaluation.py:46:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function example1_1 was called with the wrong arguments [wrong-arg-types] - -example1_1(1, 1) # E: Literal[1] not assignable to str -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -overloads_evaluation.py:51:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function example1_1 was called with the wrong arguments [wrong-arg-types] - -example1_1(1) # E: Literal[1] not assignable to str -\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - -overloads_evaluation.py:62:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in example1_2: bad return type [bad-return-type] - -def example1_2(b: bool = True) -> float: ... -\u001b[1m\u001b[31m\u001b[39m\u001b[0m - -overloads_evaluation.py:62:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in example1_2: bad return type [bad-return-type] - -def example1_2(b: bool = True) -> float: ... -\u001b[1m\u001b[31m\u001b[39m\u001b[0m - -overloads_evaluation.py:85:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in example2: bad return type [bad-return-type] - - return 1 - \u001b[1m\u001b[31m~\u001b[39m\u001b[0m - -overloads_evaluation.py:106:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in check_expand_union: str [assert-type] - - assert_type(ret1, int | str) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -overloads_evaluation.py:130:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in expand_bool: bad return type [bad-return-type] - - return int(x) - \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - -overloads_evaluation.py:130:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in expand_bool: bad return type [bad-return-type] - - return int(x) - \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - -overloads_evaluation.py:134:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in check_expand_bool: Function expand_bool was called with the wrong arguments [wrong-arg-types] - - ret1 = expand_bool(v) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -overloads_evaluation.py:135:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in check_expand_bool: Any [assert-type] - - assert_type(ret1, Literal[0, 1]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -overloads_evaluation.py:156:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in expand_enum: bad return type [bad-return-type] - - return x.value - \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -overloads_evaluation.py:160:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in check_expand_enum: Function expand_enum was called with the wrong arguments [wrong-arg-types] - - ret1 = expand_enum(v) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -overloads_evaluation.py:161:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in check_expand_enum: Any [assert-type] - - assert_type(ret1, Literal[0, 1]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -overloads_evaluation.py:176:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in expand_type_union: bad return type [bad-return-type] - - return 1 - \u001b[1m\u001b[31m~\u001b[39m\u001b[0m - -overloads_evaluation.py:181:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in check_expand_type_union: int [assert-type] - - assert_type(ret1, int | str) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -overloads_evaluation.py:200:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in expand_tuple: bad return type [bad-return-type] - - return 1 - \u001b[1m\u001b[31m~\u001b[39m\u001b[0m - -overloads_evaluation.py:205:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in check_expand_tuple: int [assert-type] - - assert_type(ret1, int | str) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -overloads_evaluation.py:224:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in variadic: bad return type [bad-return-type] - - return 1 - \u001b[1m\u001b[31m~\u001b[39m\u001b[0m - -overloads_evaluation.py:234:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in check_variadic: str [assert-type] - - assert_type(ret1, int) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -overloads_evaluation.py:264:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in check_example4: list[int] [assert-type] - - assert_type(ret2, Any) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -overloads_evaluation.py:280:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in check_example5: list[int] [assert-type] - - assert_type(example5(b), Any) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -overloads_evaluation.py:291:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in example6: bad return type [bad-return-type] - -def example6(a: float, b: T) -> T: ... -\u001b[1m\u001b[31m\u001b[39m\u001b[0m - -Called from (traceback): - line 321, in check_example6 -overloads_evaluation.py:291:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in example6: bad return type [bad-return-type] - -def example6(a: float, b: T) -> T: ... -\u001b[1m\u001b[31m\u001b[39m\u001b[0m - -Called from (traceback): - line 315, in check_example6 -overloads_evaluation.py:291:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in example6: bad return type [bad-return-type] - -def example6(a: float, b: T) -> T: ... -\u001b[1m\u001b[31m\u001b[39m\u001b[0m - -overloads_evaluation.py:345:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in check_example7: list[int] [assert-type] - - assert_type(ret3, Any) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -""" diff --git a/conformance/results/pytype/protocols_class_objects.toml b/conformance/results/pytype/protocols_class_objects.toml deleted file mode 100644 index f294b7008..000000000 --- a/conformance/results/pytype/protocols_class_objects.toml +++ /dev/null @@ -1,33 +0,0 @@ -conformant = "Partial" -notes = """ -Does not reject protocol class assigned to type[Proto]. -Incorrectly reports some class objects as incompatible with a protocol. -Fails to report some class objects as incompatible with a protocol. -""" -output = """ -protocols_class_objects.py:50:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method1: bad return type [bad-return-type] - - ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m - -protocols_class_objects.py:100:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function CMeta.__init__ was called with the wrong arguments [wrong-arg-types] - -class ConcreteC3(metaclass=CMeta): -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - pass -\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 29: Expected 1 errors -Line 34: Expected 1 errors -Line 58: Expected 1 errors -Line 74: Expected 1 errors -Line 104: Expected 1 errors -Line 106: Expected 1 errors -Line 107: Expected 1 errors -Line 108: Expected 1 errors -Line 50: Unexpected errors ['protocols_class_objects.py:50:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method1: bad return type [bad-return-type]'] -Line 100: Unexpected errors ['protocols_class_objects.py:100:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function CMeta.__init__ was called with the wrong arguments [wrong-arg-types]'] -""" diff --git a/conformance/results/pytype/protocols_definition.toml b/conformance/results/pytype/protocols_definition.toml deleted file mode 100644 index 0c6fb35eb..000000000 --- a/conformance/results/pytype/protocols_definition.toml +++ /dev/null @@ -1,77 +0,0 @@ -conformant = "Partial" -notes = """ -Reports errors for protocol static method with "..." implementation. -Does not report error when instance variable is set through "self" access in protocol class. -Does not report protocol mismatch when concrete class has attribute with covariant type and protocol attribute is mutable. -Does not reject ClassVar in concrete class when attribute in protocol is not ClassVar. -Does not reject read-only property in concrete class when attribute in protocol is mutable. -Does not reject covariant attribute type when protocol attribute is mutable. -Does not detect protocol mismatch if concrete method is missing annotations. -Does not detect protocol mismatch if concrete method's parameters are keyword-only. -Does not detect protocol mismatch if concrete method's parameters are position-only. -Does not detect protocol mismatch if concrete method is a classmethod. -Does not detect protocol mismatch if concrete method is a staticmethod. -Does not reject read-only property in concrete class when protocol has settable property. -Does not reject immutable named tuple attribute in concrete class when protocol attribute is mutable. -Does not reject immutable frozen dataclass attribute in concrete class when protocol attribute is mutable. -""" -output = """ -protocols_definition.py:30:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function close_all was called with the wrong arguments [wrong-arg-types] - -close_all([1]) # E: 'int' has no 'close' method -\u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -protocols_definition.py:45:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in third: bad return type [bad-return-type] - - ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m - -protocols_definition.py:114:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for v2_bad1 does not match type of assignment [annotation-type-mismatch] - -v2_bad1: Template2 = Concrete2_Bad1() # E -\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m - -protocols_definition.py:115:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for v2_bad2 does not match type of assignment [annotation-type-mismatch] - -v2_bad2: Template2 = Concrete2_Bad2() # E -\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m - -protocols_definition.py:156:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for v3_bad1 does not match type of assignment [annotation-type-mismatch] - -v3_bad1: Template3 = Concrete3_Bad1() # E -\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m - -protocols_definition.py:159:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for v3_bad4 does not match type of assignment [annotation-type-mismatch] - -v3_bad4: Template3 = Concrete3_Bad4() # E -\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m - -protocols_definition.py:218:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for v4_bad1 does not match type of assignment [annotation-type-mismatch] - -v4_bad1: Template4 = Concrete4_Bad1() # E -\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m - -protocols_definition.py:219:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for v4_bad2 does not match type of assignment [annotation-type-mismatch] - -v4_bad2: Template4 = Concrete4_Bad2() # E -\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 67: Expected 1 errors -Line 116: Expected 1 errors -Line 117: Expected 1 errors -Line 157: Expected 1 errors -Line 158: Expected 1 errors -Line 160: Expected 1 errors -Line 285: Expected 1 errors -Line 286: Expected 1 errors -Line 287: Expected 1 errors -Line 288: Expected 1 errors -Line 289: Expected 1 errors -Line 339: Expected 1 errors -Line 340: Expected 1 errors -Line 341: Expected 1 errors -Line 45: Unexpected errors ['protocols_definition.py:45:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in third: bad return type [bad-return-type]'] -""" diff --git a/conformance/results/pytype/protocols_explicit.toml b/conformance/results/pytype/protocols_explicit.toml deleted file mode 100644 index 5dbd6b44e..000000000 --- a/conformance/results/pytype/protocols_explicit.toml +++ /dev/null @@ -1,36 +0,0 @@ -conformant = "Partial" -notes = """ -Reports errors for protocol static method with "..." implementation. -Does not report error when calling unimplemented protocol method from derived class. -Does not report type incompatibility when assigning to attribute defined in protocol. -Does not reject instantiation of class that derives from protocol but doesn't implement attribute. -Does not report instantiation of class that derives from protocol but doesn't implement method. -""" -output = """ -protocols_explicit.py:14:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in draw: bad return type [bad-return-type] - - ... - \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m - -Called from (traceback): - line 27, in draw -protocols_explicit.py:60:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Can't instantiate Point with abstract methods intensity [not-instantiable] - -p = Point(0, 0, "") # E: Cannot instantiate abstract class - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -protocols_explicit.py:165:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Can't instantiate Concrete7A with abstract methods method1 [not-instantiable] - -c7a = Concrete7A() # E: cannot instantiate abstract class - \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 27: Expected 1 errors -Line 56: Expected 1 errors -Line 90: Expected 1 errors -Line 110: Expected 1 errors -Line 135: Expected 1 errors -Line 14: Unexpected errors ['protocols_explicit.py:14:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in draw: bad return type [bad-return-type]'] -""" diff --git a/conformance/results/pytype/protocols_generic.toml b/conformance/results/pytype/protocols_generic.toml deleted file mode 100644 index 3de697592..000000000 --- a/conformance/results/pytype/protocols_generic.toml +++ /dev/null @@ -1,60 +0,0 @@ -conformant = "Partial" -notes = """ -Does not correctly enforce contravariance in protocol type compatibility tests. -Does not correctly enforce invariance in protocol type compatibility tests. -Does not detect protocol mismatch when method-scoped TypeVar is used in protocol. -""" -output = """ -protocols_generic.py:12:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet] - -T_co = TypeVar("T_co", covariant=True) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -protocols_generic.py:13:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "contravariant" to TypeVar not supported yet [not-supported-yet] - -T_contra = TypeVar("T_contra", contravariant=True) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -protocols_generic.py:40:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for p2 does not match type of assignment [annotation-type-mismatch] - -p2: Proto1[int, str] = Concrete1() # E: incompatible type -\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -protocols_generic.py:44:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Proto2' [invalid-annotation] - -class Proto2(Protocol[T_co], Generic[T_co]): # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - ... -\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m - -protocols_generic.py:56:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Type annotation for v2 does not match type of assignment [annotation-type-mismatch] - - v2: Box[int] = box_float # E - \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -protocols_generic.py:65:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func2: Type annotation for v1 does not match type of assignment [annotation-type-mismatch] - - v1: Sender[int] = sender_float # OK - \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -protocols_generic.py:75:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func3: Type annotation for v2 does not match type of assignment [annotation-type-mismatch] - - v2: AttrProto[int] = attr_float # E - \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -protocols_generic.py:146:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for hp3 does not match type of assignment [annotation-type-mismatch] - -hp3: HasPropertyProto = ConcreteHasProperty3() # E -\u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 66: Expected 1 errors -Line 74: Expected 1 errors -Line 145: Expected 1 errors -Line 147: Expected 1 errors -Line 12: Unexpected errors ['protocols_generic.py:12:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] -Line 13: Unexpected errors ['protocols_generic.py:13:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "contravariant" to TypeVar not supported yet [not-supported-yet]'] -Line 65: Unexpected errors ['protocols_generic.py:65:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func2: Type annotation for v1 does not match type of assignment [annotation-type-mismatch]'] -""" diff --git a/conformance/results/pytype/protocols_merging.toml b/conformance/results/pytype/protocols_merging.toml deleted file mode 100644 index 28275fdd8..000000000 --- a/conformance/results/pytype/protocols_merging.toml +++ /dev/null @@ -1,36 +0,0 @@ -conformant = "Partial" -notes = """ -Does not reject a protocol class that derives from a non-protocol class. -Does not report attempt to instantiate abstract class downgraded from protocol class. -""" -output = """ -protocols_merging.py:52:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for s6 does not match type of assignment [annotation-type-mismatch] - -s6: SizedAndClosable1 = SCConcrete2() # E: doesn't implement `__len__` -\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -protocols_merging.py:53:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for s7 does not match type of assignment [annotation-type-mismatch] - -s7: SizedAndClosable2 = SCConcrete2() # E: doesn't implement `__len__` -\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -protocols_merging.py:54:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for s8 does not match type of assignment [annotation-type-mismatch] - -s8: SizedAndClosable3 = SCConcrete2() # E: SizedAndClosable3 is not a protocol -\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -protocols_merging.py:82:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Can't instantiate SizedAndClosable4 with abstract methods close [not-instantiable] - -x = SizedAndClosable4() # E: cannot instantiate abstract class - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -protocols_merging.py:83:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for y does not match type of assignment [annotation-type-mismatch] - -y: SizedAndClosable4 = SCConcrete1() # E -\u001b[1m\u001b[31m~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 67: Expected 1 errors -""" diff --git a/conformance/results/pytype/protocols_modules.toml b/conformance/results/pytype/protocols_modules.toml deleted file mode 100644 index 77c9ae318..000000000 --- a/conformance/results/pytype/protocols_modules.toml +++ /dev/null @@ -1,24 +0,0 @@ -conformant = "Partial" -notes = """ -Does not report incompatibilities for protocol methods. -""" -output = """ -protocols_modules.py:10:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Can't find module '_protocols_modules1'. [import-error] - -import _protocols_modules1 -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -protocols_modules.py:11:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Can't find module '_protocols_modules2'. [import-error] - -import _protocols_modules2 -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 26: Expected 1 errors -Line 48: Expected 1 errors -Line 49: Expected 1 errors -Line 10: Unexpected errors ["protocols_modules.py:10:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Can't find module '_protocols_modules1'. [import-error]"] -Line 11: Unexpected errors ["protocols_modules.py:11:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Can't find module '_protocols_modules2'. [import-error]"] -""" diff --git a/conformance/results/pytype/protocols_recursive.toml b/conformance/results/pytype/protocols_recursive.toml deleted file mode 100644 index 419fa160b..000000000 --- a/conformance/results/pytype/protocols_recursive.toml +++ /dev/null @@ -1,27 +0,0 @@ -conformant = "Partial" -notes = """ -Incorrectly reports type error for some recursive protocols. -""" -output = """ -protocols_recursive.py:11:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet] - -T_co = TypeVar("T_co", covariant=True) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -protocols_recursive.py:12:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "contravariant" to TypeVar not supported yet [not-supported-yet] - -T_contra = TypeVar("T_contra", contravariant=True) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -protocols_recursive.py:81:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Any [assert-type] - -assert_type(v1, list[int]) -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 11: Unexpected errors ['protocols_recursive.py:11:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] -Line 12: Unexpected errors ['protocols_recursive.py:12:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "contravariant" to TypeVar not supported yet [not-supported-yet]'] -Line 81: Unexpected errors ['protocols_recursive.py:81:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Any [assert-type]'] -""" diff --git a/conformance/results/pytype/protocols_runtime_checkable.toml b/conformance/results/pytype/protocols_runtime_checkable.toml deleted file mode 100644 index 259caef2e..000000000 --- a/conformance/results/pytype/protocols_runtime_checkable.toml +++ /dev/null @@ -1,18 +0,0 @@ -conformant = "Unsupported" -notes = """ -Does not reject isinstance or issubclass call for protocol that is not runtime_checkable. -Does not reject issubclass call for data protocol. -Does not report unsafe overlap for runtime_checkable protocol. -""" -output = """ - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 23: Expected 1 errors -Line 55: Expected 1 errors -Line 61: Expected 1 errors -Line 88: Expected 1 errors -Line 92: Expected 1 errors -Line 96: Expected 1 errors -""" diff --git a/conformance/results/pytype/protocols_self.toml b/conformance/results/pytype/protocols_self.toml deleted file mode 100644 index a6a63cb46..000000000 --- a/conformance/results/pytype/protocols_self.toml +++ /dev/null @@ -1,33 +0,0 @@ -conformant = "Partial" -notes = """ -Does not properly handle Self type within a protocol. -""" -output = """ -protocols_self.py:36:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet] - -T1_co = TypeVar("T1_co", covariant=True) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -protocols_self.py:37:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet] - -T2_co = TypeVar("T2_co", covariant=True) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -protocols_self.py:72:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for a2 does not match type of assignment [annotation-type-mismatch] - -a2: P2Parent[str] = C2[str]() # OK -\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -protocols_self.py:73:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for b2 does not match type of assignment [annotation-type-mismatch] - -b2: P2Child[str] = C2[str]() # OK -\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 36: Unexpected errors ['protocols_self.py:36:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] -Line 37: Unexpected errors ['protocols_self.py:37:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] -Line 72: Unexpected errors ['protocols_self.py:72:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for a2 does not match type of assignment [annotation-type-mismatch]'] -Line 73: Unexpected errors ['protocols_self.py:73:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for b2 does not match type of assignment [annotation-type-mismatch]'] -""" diff --git a/conformance/results/pytype/protocols_subtyping.toml b/conformance/results/pytype/protocols_subtyping.toml deleted file mode 100644 index 2908ac1b0..000000000 --- a/conformance/results/pytype/protocols_subtyping.toml +++ /dev/null @@ -1,37 +0,0 @@ -conformant = "Partial" -notes = """ -Does not reject attempt to instantiate protocol class. -Does not report some protocol type compatibility violations involving contravariance. -""" -output = """ -protocols_subtyping.py:38:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Type annotation for v2 does not match type of assignment [annotation-type-mismatch] - - v2: Concrete2 = p2 # E - \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -protocols_subtyping.py:55:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func2: Type annotation for v2 does not match type of assignment [annotation-type-mismatch] - - v2: Proto3 = p2 # E - \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -protocols_subtyping.py:83:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet] - -S_co = TypeVar("S_co", covariant=True) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -protocols_subtyping.py:84:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "contravariant" to TypeVar not supported yet [not-supported-yet] - -T_contra = TypeVar("T_contra", contravariant=True) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 16: Expected 1 errors -Line 79: Expected 1 errors -Line 80: Expected 1 errors -Line 102: Expected 1 errors -Line 103: Expected 1 errors -Line 83: Unexpected errors ['protocols_subtyping.py:83:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] -Line 84: Unexpected errors ['protocols_subtyping.py:84:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "contravariant" to TypeVar not supported yet [not-supported-yet]'] -""" diff --git a/conformance/results/pytype/protocols_variance.toml b/conformance/results/pytype/protocols_variance.toml deleted file mode 100644 index a3089e61a..000000000 --- a/conformance/results/pytype/protocols_variance.toml +++ /dev/null @@ -1,34 +0,0 @@ -conformant = "Unsupported" -notes = """ -Does not detect incorrect TypeVar variance within generic protocols. -""" -output = """ -protocols_variance.py:12:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet] - -T1_co = TypeVar("T1_co", covariant=True) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -protocols_variance.py:13:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "contravariant" to TypeVar not supported yet [not-supported-yet] - -T1_contra = TypeVar("T1_contra", contravariant=True) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -protocols_variance.py:15:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet] - -R = TypeVar("R", covariant=True) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 21: Expected 1 errors -Line 40: Expected 1 errors -Line 56: Expected 1 errors -Line 61: Expected 1 errors -Line 66: Expected 1 errors -Line 71: Expected 1 errors -Line 104: Expected 1 errors -Line 12: Unexpected errors ['protocols_variance.py:12:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] -Line 13: Unexpected errors ['protocols_variance.py:13:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "contravariant" to TypeVar not supported yet [not-supported-yet]'] -Line 15: Unexpected errors ['protocols_variance.py:15:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] -""" diff --git a/conformance/results/pytype/qualifiers_annotated.toml b/conformance/results/pytype/qualifiers_annotated.toml deleted file mode 100644 index 86e4ce6b4..000000000 --- a/conformance/results/pytype/qualifiers_annotated.toml +++ /dev/null @@ -1,78 +0,0 @@ -conformant = "Partial" -notes = """ -Does not reject some illegal type expression forms used in Annotated. -Does not report type incompatibility between Annotated and type[T]. -Does not reject call of Annotated. -Does not allow TypeVar to be used in type alias when wrapped with Annotated. -""" -output = """ -qualifiers_annotated.py:43:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '[int, str]' for Bad1 [invalid-annotation] - -Bad1: Annotated[[int, str], ""] # E: invalid type expression -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -qualifiers_annotated.py:44:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '((int, str),)' for Bad2 [invalid-annotation] - -Bad2: Annotated[((int, str),), ""] # E: invalid type expression -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -qualifiers_annotated.py:45:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' for Bad3 [invalid-annotation] - -Bad3: Annotated[[int for i in range(1)], ""] # E: invalid type expression -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -qualifiers_annotated.py:46:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation "{'a': 'b'}" for Bad4 [invalid-annotation] - -Bad4: Annotated[{"a": "b"}, ""] # E: invalid type expression -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -qualifiers_annotated.py:50:17: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Name 'var1' is not defined [name-error] - -Bad8: Annotated[var1, ""] # E: invalid type expression - \u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m - -qualifiers_annotated.py:51:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'True' for Bad9 [invalid-annotation] - -Bad9: Annotated[True, ""] # E: invalid type expression -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -qualifiers_annotated.py:52:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '1' for Bad10 [invalid-annotation] - -Bad10: Annotated[1, ""] # E: invalid type expression -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -qualifiers_annotated.py:54:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' for Bad12 [invalid-annotation] - -Bad12: Annotated[f"{'int'}", ""] # E: invalid type expression -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -qualifiers_annotated.py:64:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Annotated' [invalid-annotation] - -Bad13: Annotated[int] # E: requires at least two arguments - \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -qualifiers_annotated.py:91:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : 'Annotated' object is not callable [not-callable] - -Annotated() # E -\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m - -qualifiers_annotated.py:121:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid TypeVar: TypeVar('T') must be stored as 'T', not 'TA3' [invalid-typevar] - -TA3 = Annotated[T, ""] -\u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 47: Expected 1 errors -Line 48: Expected 1 errors -Line 49: Expected 1 errors -Line 53: Expected 1 errors -Line 76: Expected 1 errors -Line 77: Expected 1 errors -Line 84: Expected 1 errors -Line 85: Expected 1 errors -Line 92: Expected 1 errors -Line 93: Expected 1 errors -Line 121: Unexpected errors ["qualifiers_annotated.py:121:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid TypeVar: TypeVar('T') must be stored as 'T', not 'TA3' [invalid-typevar]"] -""" diff --git a/conformance/results/pytype/qualifiers_final_annotation.toml b/conformance/results/pytype/qualifiers_final_annotation.toml deleted file mode 100644 index 7a9dd829a..000000000 --- a/conformance/results/pytype/qualifiers_final_annotation.toml +++ /dev/null @@ -1,142 +0,0 @@ -conformant = "Partial" -notes = """ -Does not report Final variable with missing initialization. -Does not reject Final instance variable declared outside of __init__ method. -Does not reject modification of global variable declared Final. -Does not reject modification of local variable declared Final. -Does not reject modification of imported variable declared Final. -""" -output = """ -qualifiers_final_annotation.py:18:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Final[str, int]' [invalid-annotation] - -BAD2: Final[str, int] = "" # E: only one type argument allowed -\u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m - -qualifiers_final_annotation.py:18:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Final' [invalid-annotation] - -BAD2: Final[str, int] = "" # E: only one type argument allowed - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -qualifiers_final_annotation.py:54:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __init__: Assigning to attribute ID5, which was annotated with Final [final-error] - - self.ID5 = 0 # E: Already initialized - \u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m - -qualifiers_final_annotation.py:65:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method1: Assigning to attribute ID7, which was annotated with Final [final-error] - - self.ID7 = 0 # E: cannot modify Final value - \u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m - -qualifiers_final_annotation.py:67:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method1: Assigning to attribute ID7, which was annotated with Final [final-error] - - self.ID7 += 1 # E: cannot modify Final value - \u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m - -qualifiers_final_annotation.py:71:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Assigning to variable RATE, which was annotated with Final [final-error] - -RATE = 300 # E: Cannot redefine Final value -\u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m - -qualifiers_final_annotation.py:81:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Assigning to attribute DEFAULT_ID, which was annotated with Final [final-error] - -ClassB.DEFAULT_ID = 0 # E: Cannot redefined value -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -qualifiers_final_annotation.py:93:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Class ClassCChild overrides final class attribute BORDER_WIDTH, defined in base class ClassC [final-error] - -class ClassCChild(ClassC): -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - BORDER_WIDTH = 2.5 # E: Cannot override Final value -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -\u001b[1m\u001b[31m\u001b[39m\u001b[0m - __private = 0 # OK -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -qualifiers_final_annotation.py:107:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassD: Type annotation for VALUE2 does not match type of assignment [annotation-type-mismatch] - - VALUE2: ClassVar[Final] = 1 # E: Final cannot be used with ClassVar - \u001b[1m\u001b[31m~~~~~~\u001b[39m\u001b[0m - -qualifiers_final_annotation.py:107:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassD: Invalid use of typing.Final [final-error] - - VALUE2: ClassVar[Final] = 1 # E: Final cannot be used with ClassVar - \u001b[1m\u001b[31m~~~~~~\u001b[39m\u001b[0m - -qualifiers_final_annotation.py:107:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassD: Invalid use of typing.Final [final-error] - - VALUE2: ClassVar[Final] = 1 # E: Final cannot be used with ClassVar - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -qualifiers_final_annotation.py:107:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassD: Invalid type annotation 'ClassVar[Final]' [invalid-annotation] - - VALUE2: ClassVar[Final] = 1 # E: Final cannot be used with ClassVar - \u001b[1m\u001b[31m~~~~~~\u001b[39m\u001b[0m - -qualifiers_final_annotation.py:108:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassD: Type annotation for VALUE3 does not match type of assignment [annotation-type-mismatch] - - VALUE3: Final[ClassVar] = 1 # E: Final cannot be used with ClassVar - \u001b[1m\u001b[31m~~~~~~\u001b[39m\u001b[0m - -qualifiers_final_annotation.py:118:4: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid use of typing.Final [final-error] - -x: list[Final[int]] = [] # E - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -qualifiers_final_annotation.py:118:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'list[Final[int]]' [invalid-annotation] - -x: list[Final[int]] = [] # E -\u001b[1m\u001b[31m~\u001b[39m\u001b[0m - -qualifiers_final_annotation.py:121:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid use of typing.Final [final-error] - -def func1(x: Final[list[int]]) -> None: # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - ... -\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m - -qualifiers_final_annotation.py:134:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid keyword argument a to function N.__new__ [wrong-keyword-args] - -N(a=1) # E -\u001b[1m\u001b[31m~~~~~~\u001b[39m\u001b[0m - -qualifiers_final_annotation.py:135:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function N.__new__ was called with the wrong arguments [wrong-arg-types] - -N(x="", y="") # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - -qualifiers_final_annotation.py:145:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func2: Assigning to variable x, which was annotated with Final [final-error] - - x += 1 # E: cannot modify Final value - \u001b[1m\u001b[31m~\u001b[39m\u001b[0m - -qualifiers_final_annotation.py:164:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Can't find module '_qualifiers_final_annotation_1'. [import-error] - -from _qualifiers_final_annotation_1 import TEN -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -qualifiers_final_annotation.py:168:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Can't find module '_qualifiers_final_annotation_2'. [import-error] - -from _qualifiers_final_annotation_2 import * -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 16: Expected 1 errors -Line 34: Expected 1 errors -Line 38: Expected 1 errors -Line 62: Expected 1 errors -Line 63: Expected 1 errors -Line 94: Expected 1 errors -Line 141: Expected 1 errors -Line 147: Expected 1 errors -Line 149: Expected 1 errors -Line 152: Expected 1 errors -Line 155: Expected 1 errors -Line 166: Expected 1 errors -Line 170: Expected 1 errors -Line 93: Unexpected errors ['qualifiers_final_annotation.py:93:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Class ClassCChild overrides final class attribute BORDER_WIDTH, defined in base class ClassC [final-error]'] -Line 164: Unexpected errors ["qualifiers_final_annotation.py:164:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Can't find module '_qualifiers_final_annotation_1'. [import-error]"] -Line 168: Unexpected errors ["qualifiers_final_annotation.py:168:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Can't find module '_qualifiers_final_annotation_2'. [import-error]"] -""" diff --git a/conformance/results/pytype/qualifiers_final_decorator.toml b/conformance/results/pytype/qualifiers_final_decorator.toml deleted file mode 100644 index 3910ac781..000000000 --- a/conformance/results/pytype/qualifiers_final_decorator.toml +++ /dev/null @@ -1,265 +0,0 @@ -conformant = "Partial" -notes = """ -Does not report error for overloaded @final method defined in stub file. -Does not report error for overload that is marked @final when implementation is not. -""" -output = """ -qualifiers_final_decorator.py:8:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Couldn't import pyi for '_qualifiers_final_decorator' [pyi-error] - -from _qualifiers_final_decorator import Base3, Base4 -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -qualifiers_final_decorator.py:21:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Cannot subclass final class: Base1 [final-error] - -class Derived1(Base1): # E: Cannot inherit from final class "Base" -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - ... -\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m - -qualifiers_final_decorator.py:52:16: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method4: bad return type [bad-return-type] - - return 0 - \u001b[1m\u001b[31m~\u001b[39m\u001b[0m - -qualifiers_final_decorator.py:55:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Class Derived2 overrides final method method4, defined in base class Base2 [final-error] - -class Derived2(Base2): -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - def method1(self) -> None: # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - pass -\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m - -\u001b[1m\u001b[31m\u001b[39m\u001b[0m - @classmethod # E[method2] -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - def method2(cls) -> None: # E[method2] -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - pass -\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m - -\u001b[1m\u001b[31m\u001b[39m\u001b[0m - @staticmethod # E[method3] -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - def method3() -> None: # E[method3] -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - pass -\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m - -\u001b[1m\u001b[31m\u001b[39m\u001b[0m - @overload # E[method4] -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - def method4(self, x: int) -> int: -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - ... -\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m - -\u001b[1m\u001b[31m\u001b[39m\u001b[0m - @overload -\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - def method4(self, x: str) -> str: -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - ... -\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m - -\u001b[1m\u001b[31m\u001b[39m\u001b[0m - def method4(self, x: int | str) -> int | str: # E[method4] -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - return 0 -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -qualifiers_final_decorator.py:55:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Class Derived2 overrides final method method3, defined in base class Base2 [final-error] - -class Derived2(Base2): -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - def method1(self) -> None: # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - pass -\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m - -\u001b[1m\u001b[31m\u001b[39m\u001b[0m - @classmethod # E[method2] -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - def method2(cls) -> None: # E[method2] -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - pass -\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m - -\u001b[1m\u001b[31m\u001b[39m\u001b[0m - @staticmethod # E[method3] -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - def method3() -> None: # E[method3] -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - pass -\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m - -\u001b[1m\u001b[31m\u001b[39m\u001b[0m - @overload # E[method4] -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - def method4(self, x: int) -> int: -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - ... -\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m - -\u001b[1m\u001b[31m\u001b[39m\u001b[0m - @overload -\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - def method4(self, x: str) -> str: -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - ... -\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m - -\u001b[1m\u001b[31m\u001b[39m\u001b[0m - def method4(self, x: int | str) -> int | str: # E[method4] -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - return 0 -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -qualifiers_final_decorator.py:55:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Class Derived2 overrides final method method2, defined in base class Base2 [final-error] - -class Derived2(Base2): -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - def method1(self) -> None: # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - pass -\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m - -\u001b[1m\u001b[31m\u001b[39m\u001b[0m - @classmethod # E[method2] -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - def method2(cls) -> None: # E[method2] -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - pass -\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m - -\u001b[1m\u001b[31m\u001b[39m\u001b[0m - @staticmethod # E[method3] -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - def method3() -> None: # E[method3] -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - pass -\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m - -\u001b[1m\u001b[31m\u001b[39m\u001b[0m - @overload # E[method4] -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - def method4(self, x: int) -> int: -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - ... -\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m - -\u001b[1m\u001b[31m\u001b[39m\u001b[0m - @overload -\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - def method4(self, x: str) -> str: -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - ... -\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m - -\u001b[1m\u001b[31m\u001b[39m\u001b[0m - def method4(self, x: int | str) -> int | str: # E[method4] -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - return 0 -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -qualifiers_final_decorator.py:55:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Class Derived2 overrides final method method1, defined in base class Base2 [final-error] - -class Derived2(Base2): -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - def method1(self) -> None: # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - pass -\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m - -\u001b[1m\u001b[31m\u001b[39m\u001b[0m - @classmethod # E[method2] -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - def method2(cls) -> None: # E[method2] -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - pass -\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m - -\u001b[1m\u001b[31m\u001b[39m\u001b[0m - @staticmethod # E[method3] -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - def method3() -> None: # E[method3] -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - pass -\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m - -\u001b[1m\u001b[31m\u001b[39m\u001b[0m - @overload # E[method4] -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - def method4(self, x: int) -> int: -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - ... -\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m - -\u001b[1m\u001b[31m\u001b[39m\u001b[0m - @overload -\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - def method4(self, x: str) -> str: -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - ... -\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m - -\u001b[1m\u001b[31m\u001b[39m\u001b[0m - def method4(self, x: int | str) -> int | str: # E[method4] -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - return 0 -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -qualifiers_final_decorator.py:76:16: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method4: bad return type [bad-return-type] - - return 0 - \u001b[1m\u001b[31m~\u001b[39m\u001b[0m - -qualifiers_final_decorator.py:90:16: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method: bad return type [bad-return-type] - - return 0 - \u001b[1m\u001b[31m~\u001b[39m\u001b[0m - -qualifiers_final_decorator.py:103:16: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method: bad return type [bad-return-type] - - return 0 - \u001b[1m\u001b[31m~\u001b[39m\u001b[0m - -qualifiers_final_decorator.py:117:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Class Derived5 overrides final method method, defined in base class Base5_2 [final-error] - -class Derived5(Base5_1, Base5_2): -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - def method(self) -> None: # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - ... -\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m - -qualifiers_final_decorator.py:118:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Derived5: Overriding method signature mismatch [signature-mismatch] - - def method(self) -> None: # E - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - ... -\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m - -qualifiers_final_decorator.py:125:2: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Cannot apply @final decorator to func1 [final-error] - -@final # E[func]: not allowed on non-method function. - \u001b[1m\u001b[31m~~~~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 56: Expected 1 errors -Lines 59, 60: Expected error (tag 'method2') -Lines 63, 64: Expected error (tag 'method3') -Lines 67, 75: Expected error (tag 'method4') -Lines 80, 89: Expected error (tag 'Derived3') -Lines 84, 85, 86: Expected error (tag 'Derived3-2') -Lines 94, 102: Expected error (tag 'Derived4') -Line 8: Unexpected errors ["qualifiers_final_decorator.py:8:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Couldn't import pyi for '_qualifiers_final_decorator' [pyi-error]"] -Line 52: Unexpected errors ['qualifiers_final_decorator.py:52:16: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method4: bad return type [bad-return-type]'] -Line 55: Unexpected errors ['qualifiers_final_decorator.py:55:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Class Derived2 overrides final method method4, defined in base class Base2 [final-error]', 'qualifiers_final_decorator.py:55:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Class Derived2 overrides final method method3, defined in base class Base2 [final-error]', 'qualifiers_final_decorator.py:55:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Class Derived2 overrides final method method2, defined in base class Base2 [final-error]', 'qualifiers_final_decorator.py:55:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Class Derived2 overrides final method method1, defined in base class Base2 [final-error]'] -Line 76: Unexpected errors ['qualifiers_final_decorator.py:76:16: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method4: bad return type [bad-return-type]'] -Line 90: Unexpected errors ['qualifiers_final_decorator.py:90:16: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method: bad return type [bad-return-type]'] -Line 103: Unexpected errors ['qualifiers_final_decorator.py:103:16: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method: bad return type [bad-return-type]'] -Line 117: Unexpected errors ['qualifiers_final_decorator.py:117:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Class Derived5 overrides final method method, defined in base class Base5_2 [final-error]'] -""" diff --git a/conformance/results/pytype/specialtypes_any.toml b/conformance/results/pytype/specialtypes_any.toml deleted file mode 100644 index a339ad0a1..000000000 --- a/conformance/results/pytype/specialtypes_any.toml +++ /dev/null @@ -1,7 +0,0 @@ -conformant = "Pass" -output = """ - -""" -conformance_automated = "Pass" -errors_diff = """ -""" diff --git a/conformance/results/pytype/specialtypes_never.toml b/conformance/results/pytype/specialtypes_never.toml deleted file mode 100644 index 7a2318585..000000000 --- a/conformance/results/pytype/specialtypes_never.toml +++ /dev/null @@ -1,47 +0,0 @@ -conformant = "Unsupported" -notes = """ -Does not understand NoReturn or Never. -""" -output = """ -specialtypes_never.py:11:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet] - -T_co = TypeVar("T_co", covariant=True) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -specialtypes_never.py:21:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: bad return type [bad-return-type] - - sys.exit(1) \u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m - sys.exit(1) -\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - -specialtypes_never.py:68:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func6: Type annotation for v1 does not match type of assignment [annotation-type-mismatch] - - v1: int = a # OK - \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -specialtypes_never.py:69:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func6: Type annotation for v2 does not match type of assignment [annotation-type-mismatch] - - v2: str = a # OK - \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -specialtypes_never.py:70:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func6: Type annotation for v3 does not match type of assignment [annotation-type-mismatch] - - v3: list[str] = a # OK - \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -specialtypes_never.py:86:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func8: Type annotation for v3 does not match type of assignment [annotation-type-mismatch] - - v3: list[int] = c # E - \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 19: Expected 1 errors -Line 105: Expected 1 errors -Line 11: Unexpected errors ['specialtypes_never.py:11:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] -Line 21: Unexpected errors ['specialtypes_never.py:21:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: bad return type [bad-return-type]'] -Line 68: Unexpected errors ['specialtypes_never.py:68:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func6: Type annotation for v1 does not match type of assignment [annotation-type-mismatch]'] -Line 69: Unexpected errors ['specialtypes_never.py:69:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func6: Type annotation for v2 does not match type of assignment [annotation-type-mismatch]'] -Line 70: Unexpected errors ['specialtypes_never.py:70:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func6: Type annotation for v3 does not match type of assignment [annotation-type-mismatch]'] -""" diff --git a/conformance/results/pytype/specialtypes_none.toml b/conformance/results/pytype/specialtypes_none.toml deleted file mode 100644 index 03a38e99d..000000000 --- a/conformance/results/pytype/specialtypes_none.toml +++ /dev/null @@ -1,21 +0,0 @@ -conformant = "Partial" -notes = """ -Does not detect type incompatibility between None and type[None]. -Does not detect type incompatibility between None and incompatible protocol. -""" -output = """ -specialtypes_none.py:21:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function func1 was called with the wrong arguments [wrong-arg-types] - -func1(type(None)) # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -specialtypes_none.py:41:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function func2 was called with the wrong arguments [wrong-arg-types] - -func2(None) # E: not compatible -\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 27: Expected 1 errors -""" diff --git a/conformance/results/pytype/specialtypes_promotions.toml b/conformance/results/pytype/specialtypes_promotions.toml deleted file mode 100644 index 8380712e2..000000000 --- a/conformance/results/pytype/specialtypes_promotions.toml +++ /dev/null @@ -1,11 +0,0 @@ -conformant = "Pass" -output = """ -specialtypes_promotions.py:13:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: No attribute 'numerator' on float [attribute-error] - - f.numerator # E - \u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Pass" -errors_diff = """ -""" diff --git a/conformance/results/pytype/specialtypes_type.toml b/conformance/results/pytype/specialtypes_type.toml deleted file mode 100644 index 98f8ffbb2..000000000 --- a/conformance/results/pytype/specialtypes_type.toml +++ /dev/null @@ -1,83 +0,0 @@ -conformant = "Partial" -notes = """ -Does not reject Callable when passed to type[T]. -Does not allow access to known attributes from object of type `type[Any]`. -""" -output = """ -specialtypes_type.py:56:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function func4 was called with the wrong arguments [wrong-arg-types] - -func4(TeamUser) # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -specialtypes_type.py:64:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'T' [invalid-annotation] - -def func5(x: type[T]) -> None: -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - pass -\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m - -specialtypes_type.py:76:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'type[int, str]' [invalid-annotation] - -bad_type1: type[int, str] # E - \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -specialtypes_type.py:98:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func7: Any [assert-type] - - assert_type(a.__mro__, tuple[type, ...]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -specialtypes_type.py:102:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func7: Any [assert-type] - - assert_type(b.__mro__, tuple[type, ...]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -specialtypes_type.py:106:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func7: Any [assert-type] - - assert_type(c.__mro__, tuple[type, ...]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -specialtypes_type.py:110:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func7: Any [assert-type] - - assert_type(d.__mro__, tuple[type, ...]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -specialtypes_type.py:117:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func8: No attribute 'unknown' on type[object] [attribute-error] - - a.unknown # E - \u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m - -specialtypes_type.py:120:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func8: No attribute 'unknown' on type[object] [attribute-error] - - b.unknown # E - \u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m - -specialtypes_type.py:143:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : No attribute 'unknown' on type[type] [attribute-error] - -TA1.unknown # E -\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m - -specialtypes_type.py:144:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : No attribute 'unknown' on type[type] [attribute-error] - -TA2.unknown # E -\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m - -specialtypes_type.py:145:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : No attribute 'unknown' on type[type] [attribute-error] - -TA3.unknown # E -\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m - -specialtypes_type.py:146:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : No attribute 'unknown' on type[type] [attribute-error] - -TA4.unknown # E -\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 70: Expected 1 errors -Line 64: Unexpected errors ["specialtypes_type.py:64:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'T' [invalid-annotation]"] -Line 98: Unexpected errors ['specialtypes_type.py:98:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func7: Any [assert-type]'] -Line 102: Unexpected errors ['specialtypes_type.py:102:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func7: Any [assert-type]'] -Line 106: Unexpected errors ['specialtypes_type.py:106:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func7: Any [assert-type]'] -Line 110: Unexpected errors ['specialtypes_type.py:110:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func7: Any [assert-type]'] -""" diff --git a/conformance/results/pytype/tuples_type_compat.toml b/conformance/results/pytype/tuples_type_compat.toml deleted file mode 100644 index d7c191764..000000000 --- a/conformance/results/pytype/tuples_type_compat.toml +++ /dev/null @@ -1,318 +0,0 @@ -conformant = "Partial" -notes = """ -Does not support unpacked tuple forms. -Does not report type violation when assigning `tuple[int, ...]` to `tuple[int]`. -Does not support tuple narrowing based on `len()` type guard (optional). -""" -output = """ -tuples_type_compat.py:15:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Type annotation for v2 does not match type of assignment [annotation-type-mismatch] - - v2: tuple[int, int] = t1 # E - \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -tuples_type_compat.py:22:31: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] - -def func2(t1: tuple[int], t2: tuple[int, *tuple[int, ...]], t3: tuple[int, ...]): - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -tuples_type_compat.py:27:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func2: Invalid type annotation 'tuple[int, *tuple[int, ...]]' [invalid-annotation] - - v2: tuple[int, *tuple[int, ...]] - \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -tuples_type_compat.py:47:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func3: Invalid type annotation 'tuple[int, *tuple[str, ...]]' [invalid-annotation] - - v6: tuple[int, *tuple[str, ...]] = t3 # OK - \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -tuples_type_compat.py:70:56: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] - -Func5Input: TypeAlias = tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int] - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -tuples_type_compat.py:75:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func5: tuple [assert-type] - - assert_type(val, tuple[int]) # E[func5_1] - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -tuples_type_compat.py:80:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func5: tuple [assert-type] - - assert_type(val, tuple[str, str] | tuple[int, int]) # E[func5_2] - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -tuples_type_compat.py:85:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func5: tuple [assert-type] - - assert_type(val, tuple[int, str, int]) # E[func5_3] - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -tuples_type_compat.py:94:56: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] - -Func6Input: TypeAlias = tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int] - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -tuples_type_compat.py:126:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func7: tuple[Union[int, str], Union[int, str]] [assert-type] - - assert_type(subj, tuple[int | str, str]) # E[func7_1] - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -tuples_type_compat.py:129:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func7: tuple[Union[int, str], Union[int, str]] [assert-type] - - assert_type(subj, tuple[int | str, int]) # E[func7_2] - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -tuples_type_compat.py:147:40: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] - - t1: tuple[complex, list[int]], t2: tuple[int, *tuple[str, ...]], t3: tuple[()] - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -tuples_type_compat.py:152:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func8: Sequence [assert-type] - - assert_type(test_seq(t2), Sequence[int | str]) # Could be Sequence[object] - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -tuples_type_compat.py:153:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func8: Sequence [assert-type] - - assert_type(test_seq(t3), Sequence[Never]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -tuples_type_compat.py:156:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t1 does not match type of assignment [annotation-type-mismatch] - -t1: tuple[int, *tuple[str]] = (1, "") # OK -\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -tuples_type_compat.py:156:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[int, *tuple[str]]' [invalid-annotation] - -t1: tuple[int, *tuple[str]] = (1, "") # OK -\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -tuples_type_compat.py:156:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] - -t1: tuple[int, *tuple[str]] = (1, "") # OK - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -tuples_type_compat.py:157:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t1 does not match type of assignment [annotation-type-mismatch] - -t1 = (1, "", "") # E -\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -tuples_type_compat.py:159:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[int, *tuple[str, ...]]' [invalid-annotation] - -t2: tuple[int, *tuple[str, ...]] = (1,) # OK -\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -tuples_type_compat.py:159:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] - -t2: tuple[int, *tuple[str, ...]] = (1,) # OK - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -tuples_type_compat.py:160:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t2 does not match type of assignment [annotation-type-mismatch] - -t2 = (1, "") # OK -\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -tuples_type_compat.py:161:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t2 does not match type of assignment [annotation-type-mismatch] - -t2 = (1, "", "") # OK -\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -tuples_type_compat.py:162:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t2 does not match type of assignment [annotation-type-mismatch] - -t2 = (1, 1, "") # E -\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -tuples_type_compat.py:163:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t2 does not match type of assignment [annotation-type-mismatch] - -t2 = (1, "", 1) # E -\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -tuples_type_compat.py:166:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t3 does not match type of assignment [annotation-type-mismatch] - -t3: tuple[int, *tuple[str, ...], int] = (1, 2) # OK -\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -tuples_type_compat.py:166:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[int, *tuple[str, ...], int]' [invalid-annotation] - -t3: tuple[int, *tuple[str, ...], int] = (1, 2) # OK -\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -tuples_type_compat.py:166:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] - -t3: tuple[int, *tuple[str, ...], int] = (1, 2) # OK - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -tuples_type_compat.py:167:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t3 does not match type of assignment [annotation-type-mismatch] - -t3 = (1, "", 2) # OK -\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -tuples_type_compat.py:168:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t3 does not match type of assignment [annotation-type-mismatch] - -t3 = (1, "", "", 2) # OK -\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -tuples_type_compat.py:169:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t3 does not match type of assignment [annotation-type-mismatch] - -t3 = (1, "", "") # E -\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -tuples_type_compat.py:170:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t3 does not match type of assignment [annotation-type-mismatch] - -t3 = (1, "", "", 1.2) # E -\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -tuples_type_compat.py:172:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[*tuple[str, ...], int]' [invalid-annotation] - -t4: tuple[*tuple[str, ...], int] = (1,) # OK -\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -tuples_type_compat.py:172:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] - -t4: tuple[*tuple[str, ...], int] = (1,) # OK - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -tuples_type_compat.py:173:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t4 does not match type of assignment [annotation-type-mismatch] - -t4 = ("", 1) # OK -\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -tuples_type_compat.py:174:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t4 does not match type of assignment [annotation-type-mismatch] - -t4 = ("", "", 1) # OK -\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -tuples_type_compat.py:175:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t4 does not match type of assignment [annotation-type-mismatch] - -t4 = (1, "", 1) # E -\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -tuples_type_compat.py:176:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t4 does not match type of assignment [annotation-type-mismatch] - -t4 = ("", "", 1.2) # E -\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -tuples_type_compat.py:180:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Type annotation for t1 does not match type of assignment [annotation-type-mismatch] - - t1: tuple[str, str, *tuple[int, ...]] = a # OK - \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -tuples_type_compat.py:180:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Invalid type annotation 'tuple[str, str, *tuple[int, ...]]' [invalid-annotation] - - t1: tuple[str, str, *tuple[int, ...]] = a # OK - \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -tuples_type_compat.py:181:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Type annotation for t2 does not match type of assignment [annotation-type-mismatch] - - t2: tuple[str, str, *tuple[int]] = a # E - \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -tuples_type_compat.py:181:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Invalid type annotation 'tuple[str, str, *tuple[int]]' [invalid-annotation] - - t2: tuple[str, str, *tuple[int]] = a # E - \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -tuples_type_compat.py:182:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Type annotation for t3 does not match type of assignment [annotation-type-mismatch] - - t3: tuple[str, *tuple[str, ...]] = a # OK - \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -tuples_type_compat.py:182:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Invalid type annotation 'tuple[str, *tuple[str, ...]]' [invalid-annotation] - - t3: tuple[str, *tuple[str, ...]] = a # OK - \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -tuples_type_compat.py:183:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Type annotation for t4 does not match type of assignment [annotation-type-mismatch] - - t4: tuple[str, str, *tuple[str, ...]] = a # OK - \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -tuples_type_compat.py:183:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Invalid type annotation 'tuple[str, str, *tuple[str, ...]]' [invalid-annotation] - - t4: tuple[str, str, *tuple[str, ...]] = a # OK - \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -tuples_type_compat.py:184:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Type annotation for t5 does not match type of assignment [annotation-type-mismatch] - - t5: tuple[str, str, str, *tuple[str, ...]] = a # E - \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -tuples_type_compat.py:184:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Invalid type annotation 'tuple[str, str, str, *tuple[str, ...]]' [invalid-annotation] - - t5: tuple[str, str, str, *tuple[str, ...]] = a # E - \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -tuples_type_compat.py:185:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Type annotation for t6 does not match type of assignment [annotation-type-mismatch] - - t6: tuple[str, *tuple[int, ...], str] = a # OK - \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -tuples_type_compat.py:185:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Invalid type annotation 'tuple[str, *tuple[int, ...], str]' [invalid-annotation] - - t6: tuple[str, *tuple[int, ...], str] = a # OK - \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -tuples_type_compat.py:186:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Type annotation for t7 does not match type of assignment [annotation-type-mismatch] - - t7: tuple[*tuple[str, ...], str] = a # OK - \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -tuples_type_compat.py:186:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Invalid type annotation 'tuple[*tuple[str, ...], str]' [invalid-annotation] - - t7: tuple[*tuple[str, ...], str] = a # OK - \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -tuples_type_compat.py:187:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Type annotation for t8 does not match type of assignment [annotation-type-mismatch] - - t8: tuple[*tuple[str, ...], str] = a # OK - \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -tuples_type_compat.py:187:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Invalid type annotation 'tuple[*tuple[str, ...], str]' [invalid-annotation] - - t8: tuple[*tuple[str, ...], str] = a # OK - \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -tuples_type_compat.py:188:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Type annotation for t9 does not match type of assignment [annotation-type-mismatch] - - t9: tuple[*tuple[str, ...], str, str, str] = a # E - \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -tuples_type_compat.py:188:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Invalid type annotation 'tuple[*tuple[str, ...], str, str, str]' [invalid-annotation] - - t9: tuple[*tuple[str, ...], str, str, str] = a # E - \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 29: Expected 1 errors -Line 32: Expected 1 errors -Line 33: Expected 1 errors -Line 43: Expected 1 errors -Line 62: Expected 1 errors -Lines 101, 102: Expected error (tag 'func6_1') -Lines 106, 107: Expected error (tag 'func6_2') -Lines 111, 112: Expected error (tag 'func6_3') -Line 22: Unexpected errors ["tuples_type_compat.py:22:31: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] -Line 27: Unexpected errors ["tuples_type_compat.py:27:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func2: Invalid type annotation 'tuple[int, *tuple[int, ...]]' [invalid-annotation]"] -Line 47: Unexpected errors ["tuples_type_compat.py:47:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func3: Invalid type annotation 'tuple[int, *tuple[str, ...]]' [invalid-annotation]"] -Line 70: Unexpected errors ["tuples_type_compat.py:70:56: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] -Line 94: Unexpected errors ["tuples_type_compat.py:94:56: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] -Line 147: Unexpected errors ["tuples_type_compat.py:147:40: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] -Line 152: Unexpected errors ['tuples_type_compat.py:152:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func8: Sequence [assert-type]'] -Line 153: Unexpected errors ['tuples_type_compat.py:153:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func8: Sequence [assert-type]'] -Line 156: Unexpected errors ['tuples_type_compat.py:156:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for t1 does not match type of assignment [annotation-type-mismatch]', "tuples_type_compat.py:156:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'tuple[int, *tuple[str]]' [invalid-annotation]", "tuples_type_compat.py:156:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] -Line 159: Unexpected errors ["tuples_type_compat.py:159:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'tuple[int, *tuple[str, ...]]' [invalid-annotation]", "tuples_type_compat.py:159:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] -Line 160: Unexpected errors ['tuples_type_compat.py:160:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for t2 does not match type of assignment [annotation-type-mismatch]'] -Line 161: Unexpected errors ['tuples_type_compat.py:161:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for t2 does not match type of assignment [annotation-type-mismatch]'] -Line 166: Unexpected errors ['tuples_type_compat.py:166:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for t3 does not match type of assignment [annotation-type-mismatch]', "tuples_type_compat.py:166:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'tuple[int, *tuple[str, ...], int]' [invalid-annotation]", "tuples_type_compat.py:166:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] -Line 167: Unexpected errors ['tuples_type_compat.py:167:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for t3 does not match type of assignment [annotation-type-mismatch]'] -Line 168: Unexpected errors ['tuples_type_compat.py:168:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for t3 does not match type of assignment [annotation-type-mismatch]'] -Line 172: Unexpected errors ["tuples_type_compat.py:172:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'tuple[*tuple[str, ...], int]' [invalid-annotation]", "tuples_type_compat.py:172:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] -Line 173: Unexpected errors ['tuples_type_compat.py:173:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for t4 does not match type of assignment [annotation-type-mismatch]'] -Line 174: Unexpected errors ['tuples_type_compat.py:174:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for t4 does not match type of assignment [annotation-type-mismatch]'] -Line 180: Unexpected errors ['tuples_type_compat.py:180:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func9: Type annotation for t1 does not match type of assignment [annotation-type-mismatch]', "tuples_type_compat.py:180:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func9: Invalid type annotation 'tuple[str, str, *tuple[int, ...]]' [invalid-annotation]"] -Line 182: Unexpected errors ['tuples_type_compat.py:182:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func9: Type annotation for t3 does not match type of assignment [annotation-type-mismatch]', "tuples_type_compat.py:182:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func9: Invalid type annotation 'tuple[str, *tuple[str, ...]]' [invalid-annotation]"] -Line 183: Unexpected errors ['tuples_type_compat.py:183:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func9: Type annotation for t4 does not match type of assignment [annotation-type-mismatch]', "tuples_type_compat.py:183:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func9: Invalid type annotation 'tuple[str, str, *tuple[str, ...]]' [invalid-annotation]"] -Line 185: Unexpected errors ['tuples_type_compat.py:185:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func9: Type annotation for t6 does not match type of assignment [annotation-type-mismatch]', "tuples_type_compat.py:185:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func9: Invalid type annotation 'tuple[str, *tuple[int, ...], str]' [invalid-annotation]"] -Line 186: Unexpected errors ['tuples_type_compat.py:186:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func9: Type annotation for t7 does not match type of assignment [annotation-type-mismatch]', "tuples_type_compat.py:186:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func9: Invalid type annotation 'tuple[*tuple[str, ...], str]' [invalid-annotation]"] -Line 187: Unexpected errors ['tuples_type_compat.py:187:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func9: Type annotation for t8 does not match type of assignment [annotation-type-mismatch]', "tuples_type_compat.py:187:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func9: Invalid type annotation 'tuple[*tuple[str, ...], str]' [invalid-annotation]"] -""" diff --git a/conformance/results/pytype/tuples_type_form.toml b/conformance/results/pytype/tuples_type_form.toml deleted file mode 100644 index 8ecf9d221..000000000 --- a/conformance/results/pytype/tuples_type_form.toml +++ /dev/null @@ -1,71 +0,0 @@ -conformant = "Pass" -output = """ -tuples_type_form.py:12:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t1 does not match type of assignment [annotation-type-mismatch] - -t1 = (1, 2) # E -\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -tuples_type_form.py:14:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t2 does not match type of assignment [annotation-type-mismatch] - -t2 = (1,) # E -\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -tuples_type_form.py:15:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t2 does not match type of assignment [annotation-type-mismatch] - -t2 = (1, "") # E -\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -tuples_type_form.py:25:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t10 does not match type of assignment [annotation-type-mismatch] - -t10 = (1,) # E -\u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m - -tuples_type_form.py:36:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t20 does not match type of assignment [annotation-type-mismatch] - -t20 = (1, 2, 3, "") # E -\u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m - -tuples_type_form.py:40:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[int, int, Any]' [invalid-annotation] - -t31: tuple[int, int, ...] # E - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -tuples_type_form.py:41:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Ellipsis' [invalid-annotation] - -t32: tuple[...] # E - \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m - -tuples_type_form.py:42:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[Any, int]' [invalid-annotation] - -t33: tuple[..., int] # E - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -tuples_type_form.py:42:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Ellipsis' [invalid-annotation] - -t33: tuple[..., int] # E - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -tuples_type_form.py:43:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[int, Any, int]' [invalid-annotation] - -t34: tuple[int, ..., int] # E - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -tuples_type_form.py:43:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Ellipsis' [invalid-annotation] - -t34: tuple[int, ..., int] # E - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -tuples_type_form.py:44:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] - -t35: tuple[*tuple[str], ...] # E - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -tuples_type_form.py:45:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] - -t36: tuple[*tuple[str, ...], ...] # E - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Pass" -errors_diff = """ -""" diff --git a/conformance/results/pytype/tuples_unpacked.toml b/conformance/results/pytype/tuples_unpacked.toml deleted file mode 100644 index 1b2f6febd..000000000 --- a/conformance/results/pytype/tuples_unpacked.toml +++ /dev/null @@ -1,167 +0,0 @@ -conformant = "Unsupported" -notes = """ -Does not support `typing.Unpack`. -Does not support unpacked tuples within a tuple type form. -""" -output = """ -tuples_unpacked.py:13:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing.Unpack not supported yet [not-supported-yet] - -from typing import TypeVarTuple, Unpack, assert_type -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -tuples_unpacked.py:13:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet] - -from typing import TypeVarTuple, Unpack, assert_type -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -tuples_unpacked.py:16:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] - -def func1(x: tuple[int, *tuple[bool, bool], str]): - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -tuples_unpacked.py:17:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: tuple[Any] [assert-type] - - assert_type(x, tuple[int, bool, bool, str]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -tuples_unpacked.py:18:20: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Invalid type annotation '' [invalid-annotation] - - assert_type(x, tuple[*tuple[int, bool], bool, str]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -tuples_unpacked.py:19:20: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Invalid type annotation '' [invalid-annotation] - - assert_type(x, tuple[int, bool, *tuple[bool, str]]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -tuples_unpacked.py:25:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] - -def func2(x: tuple[int, *tuple[bool, ...], str]): - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -tuples_unpacked.py:26:20: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func2: Invalid type annotation '' [invalid-annotation] - - assert_type(x, tuple[int, *tuple[bool, ...], str]) - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -tuples_unpacked.py:31:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for u1 does not match type of assignment [annotation-type-mismatch] - -u1: tuple[*tuple[int], *tuple[int]] = (int(1), int(1)) # OK -\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -tuples_unpacked.py:31:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[*tuple[int], *tuple[int]]' [invalid-annotation] - -u1: tuple[*tuple[int], *tuple[int]] = (int(1), int(1)) # OK -\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -tuples_unpacked.py:31:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] - -u1: tuple[*tuple[int], *tuple[int]] = (int(1), int(1)) # OK - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -tuples_unpacked.py:31:11: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function list.extend was called with the wrong arguments [wrong-arg-types] - -u1: tuple[*tuple[int], *tuple[int]] = (int(1), int(1)) # OK - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -tuples_unpacked.py:32:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : tuple[Any] [assert-type] - -assert_type(u1, tuple[int, int]) -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -tuples_unpacked.py:33:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] - -u2: tuple[*tuple[int, ...], *tuple[int]] # OK - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -tuples_unpacked.py:33:11: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function list.extend was called with the wrong arguments [wrong-arg-types] - -u2: tuple[*tuple[int, ...], *tuple[int]] # OK - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -tuples_unpacked.py:38:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] - -t1: tuple[*tuple[str], *tuple[str]] # OK - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -tuples_unpacked.py:38:11: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function list.extend was called with the wrong arguments [wrong-arg-types] - -t1: tuple[*tuple[str], *tuple[str]] # OK - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -tuples_unpacked.py:39:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] - -t2: tuple[*tuple[str, *tuple[str, ...]]] # OK - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -tuples_unpacked.py:39:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] - -t2: tuple[*tuple[str, *tuple[str, ...]]] # OK - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -tuples_unpacked.py:40:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] - -t3: tuple[*tuple[str, ...], *tuple[int, ...]] # E - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -tuples_unpacked.py:40:11: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function list.extend was called with the wrong arguments [wrong-arg-types] - -t3: tuple[*tuple[str, ...], *tuple[int, ...]] # E - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -tuples_unpacked.py:41:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] - -t4: tuple[*tuple[str, *tuple[str, ...]], *tuple[int, ...]] # E - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -tuples_unpacked.py:41:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] - -t4: tuple[*tuple[str, *tuple[str, ...]], *tuple[int, ...]] # E - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -tuples_unpacked.py:41:11: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function list.extend was called with the wrong arguments [wrong-arg-types] - -t4: tuple[*tuple[str, *tuple[str, ...]], *tuple[int, ...]] # E - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -tuples_unpacked.py:46:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] - -Ts = TypeVarTuple("Ts") - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -tuples_unpacked.py:49:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] - -def func3(t: tuple[*Ts]): - \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m - -tuples_unpacked.py:50:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func3: Invalid type annotation 'tuple[*tuple[str], *Ts]' [invalid-annotation] - - t5: tuple[*tuple[str], *Ts] # OK - \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -tuples_unpacked.py:51:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func3: Invalid type annotation 'tuple[*tuple[str, ...], *Ts]' [invalid-annotation] - - t6: tuple[*tuple[str, ...], *Ts] # E - \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 59: Expected 1 errors -Lines 60, 61: Expected error (tag 't14') -Line 13: Unexpected errors ['tuples_unpacked.py:13:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.Unpack not supported yet [not-supported-yet]', 'tuples_unpacked.py:13:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet]'] -Line 16: Unexpected errors ["tuples_unpacked.py:16:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] -Line 17: Unexpected errors ['tuples_unpacked.py:17:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: tuple[Any] [assert-type]'] -Line 18: Unexpected errors ["tuples_unpacked.py:18:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: Invalid type annotation '' [invalid-annotation]"] -Line 19: Unexpected errors ["tuples_unpacked.py:19:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: Invalid type annotation '' [invalid-annotation]"] -Line 25: Unexpected errors ["tuples_unpacked.py:25:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] -Line 26: Unexpected errors ["tuples_unpacked.py:26:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func2: Invalid type annotation '' [invalid-annotation]"] -Line 31: Unexpected errors ['tuples_unpacked.py:31:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for u1 does not match type of assignment [annotation-type-mismatch]', "tuples_unpacked.py:31:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'tuple[*tuple[int], *tuple[int]]' [invalid-annotation]", "tuples_unpacked.py:31:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", 'tuples_unpacked.py:31:11: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function list.extend was called with the wrong arguments [wrong-arg-types]'] -Line 32: Unexpected errors ['tuples_unpacked.py:32:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : tuple[Any] [assert-type]'] -Line 33: Unexpected errors ["tuples_unpacked.py:33:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", 'tuples_unpacked.py:33:11: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function list.extend was called with the wrong arguments [wrong-arg-types]'] -Line 38: Unexpected errors ["tuples_unpacked.py:38:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", 'tuples_unpacked.py:38:11: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function list.extend was called with the wrong arguments [wrong-arg-types]'] -Line 39: Unexpected errors ["tuples_unpacked.py:39:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", "tuples_unpacked.py:39:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] -Line 46: Unexpected errors ['tuples_unpacked.py:46:6: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] -Line 49: Unexpected errors ["tuples_unpacked.py:49:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] -Line 50: Unexpected errors ["tuples_unpacked.py:50:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func3: Invalid type annotation 'tuple[*tuple[str], *Ts]' [invalid-annotation]"] -""" diff --git a/conformance/results/pytype/typeddicts_alt_syntax.toml b/conformance/results/pytype/typeddicts_alt_syntax.toml deleted file mode 100644 index 62574fb06..000000000 --- a/conformance/results/pytype/typeddicts_alt_syntax.toml +++ /dev/null @@ -1,25 +0,0 @@ -conformant = "Partial" -notes = """ -Does not reject use of variable as second argument to `TypedDict` call. -Does not report when name of TypedDict doesn't match assigned identifier name. -Does not support keyword-argument form of alternative syntax (deprecated in 3.11). -""" -output = """ -typeddicts_alt_syntax.py:27:17: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function typing.TypedDict was called with the wrong arguments [wrong-arg-types] - -BadTypedDict2 = TypedDict("BadTypedDict2", {1: str}) # E - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -typeddicts_alt_syntax.py:41:10: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function typing.TypedDict expects 2 arg(s), got 3 [wrong-arg-count] - -Movie2 = TypedDict("Movie2", name=str, year=int) # E? - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 23: Expected 1 errors -Line 31: Expected 1 errors -Line 35: Expected 1 errors -Line 45: Expected 1 errors -""" diff --git a/conformance/results/pytype/typeddicts_class_syntax.toml b/conformance/results/pytype/typeddicts_class_syntax.toml deleted file mode 100644 index d3a7ae736..000000000 --- a/conformance/results/pytype/typeddicts_class_syntax.toml +++ /dev/null @@ -1,26 +0,0 @@ -conformant = "Partial" -notes = """ -Does not reject methods within TypedDict class. -Does not report when metaclass is provided. -Does not report when other keyword argument is provided. -""" -output = """ -typeddicts_class_syntax.py:57:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid base class: Generic[T] [base-class-error] - -class GenericTypedDict(TypedDict, Generic[T]): -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - name: str -\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - value: T -\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 29: Expected 1 errors -Line 44: Expected 1 errors -Line 49: Expected 1 errors -Lines 33, 34: Expected error (tag 'method2') -Lines 38, 39: Expected error (tag 'method3') -Line 57: Unexpected errors ['typeddicts_class_syntax.py:57:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid base class: Generic[T] [base-class-error]'] -""" diff --git a/conformance/results/pytype/typeddicts_final.toml b/conformance/results/pytype/typeddicts_final.toml deleted file mode 100644 index a339ad0a1..000000000 --- a/conformance/results/pytype/typeddicts_final.toml +++ /dev/null @@ -1,7 +0,0 @@ -conformant = "Pass" -output = """ - -""" -conformance_automated = "Pass" -errors_diff = """ -""" diff --git a/conformance/results/pytype/typeddicts_inheritance.toml b/conformance/results/pytype/typeddicts_inheritance.toml deleted file mode 100644 index ca9002699..000000000 --- a/conformance/results/pytype/typeddicts_inheritance.toml +++ /dev/null @@ -1,27 +0,0 @@ -conformant = "Pass" -output = """ -typeddicts_inheritance.py:44:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid base class: NonTypedDict [base-class-error] - -class BadTypedDict(TypedDict, NonTypedDict): # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - pass -\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m - -typeddicts_inheritance.py:54:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid base class: X1 [base-class-error] - -class Y1(X1): # E[Y1] -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - x: int # E[Y1]: cannot overwrite TypedDict field "x" -\u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m - -typeddicts_inheritance.py:65:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid base class: Y2 [base-class-error] - -class XYZ2(X2, Y2): # E: cannot overwrite TypedDict field "x" while merging -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - xyz: bool -\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Pass" -errors_diff = """ -""" diff --git a/conformance/results/pytype/typeddicts_operations.toml b/conformance/results/pytype/typeddicts_operations.toml deleted file mode 100644 index a01d0edeb..000000000 --- a/conformance/results/pytype/typeddicts_operations.toml +++ /dev/null @@ -1,45 +0,0 @@ -conformant = "Partial" -notes = """ -Does not report type violation with TypedDict value assignment. -Does not report reference to unknown key in TypedDict. -Does not reject `clear` method on TypedDict with required keys. -Does not reject delete operation for required key in TypedDict. -""" -output = """ -typeddicts_operations.py:28:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for movie does not match type of assignment [annotation-type-mismatch] - -movie = {"name": "Blade Runner"} # E: year is missing -\u001b[1m\u001b[31m~~~~~\u001b[39m\u001b[0m - -typeddicts_operations.py:29:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for movie does not match type of assignment [annotation-type-mismatch] - -movie = {"name": "Blade Runner", "year": 1982.1} # E: year is wrong type -\u001b[1m\u001b[31m~~~~~\u001b[39m\u001b[0m - -typeddicts_operations.py:32:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for movie does not match type of assignment [annotation-type-mismatch] - -movie = {"name": "", "year": 1900, "other": 2} # E: extra key -\u001b[1m\u001b[31m~~~~~\u001b[39m\u001b[0m - -typeddicts_operations.py:37:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Type annotation for movie does not match type of assignment [annotation-type-mismatch] - - movie: Movie = {variable_key: "", "year": 1900} # E: variable key - \u001b[1m\u001b[31m~~~~~\u001b[39m\u001b[0m - -typeddicts_operations.py:60:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : str [assert-type] - -assert_type(movie_optional.get("name"), str | None) -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 22: Expected 1 errors -Line 23: Expected 1 errors -Line 24: Expected 1 errors -Line 26: Expected 1 errors -Line 47: Expected 1 errors -Line 49: Expected 1 errors -Line 62: Expected 1 errors -Line 60: Unexpected errors ['typeddicts_operations.py:60:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : str [assert-type]'] -""" diff --git a/conformance/results/pytype/typeddicts_readonly.toml b/conformance/results/pytype/typeddicts_readonly.toml deleted file mode 100644 index fdf00b964..000000000 --- a/conformance/results/pytype/typeddicts_readonly.toml +++ /dev/null @@ -1,18 +0,0 @@ -conformant = "Unsupported" -output = """ -typeddicts_readonly.py:8:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing_extensions.ReadOnly not supported yet [not-supported-yet] - -from typing_extensions import ReadOnly -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 24: Expected 1 errors -Line 36: Expected 1 errors -Line 50: Expected 1 errors -Line 51: Expected 1 errors -Line 60: Expected 1 errors -Line 61: Expected 1 errors -Line 8: Unexpected errors ['typeddicts_readonly.py:8:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing_extensions.ReadOnly not supported yet [not-supported-yet]'] -""" diff --git a/conformance/results/pytype/typeddicts_readonly_consistency.toml b/conformance/results/pytype/typeddicts_readonly_consistency.toml deleted file mode 100644 index 466a0505e..000000000 --- a/conformance/results/pytype/typeddicts_readonly_consistency.toml +++ /dev/null @@ -1,35 +0,0 @@ -conformant = "Unsupported" -output = """ -typeddicts_readonly_consistency.py:8:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing_extensions.ReadOnly not supported yet [not-supported-yet] - -from typing_extensions import ReadOnly -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -typeddicts_readonly_consistency.py:34:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Type annotation for v1 does not match type of assignment [annotation-type-mismatch] - - v1: A1 = b # OK - \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -typeddicts_readonly_consistency.py:35:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Type annotation for v2 does not match type of assignment [annotation-type-mismatch] - - v2: A1 = c # OK - \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -typeddicts_readonly_consistency.py:40:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Type annotation for v5 does not match type of assignment [annotation-type-mismatch] - - v5: C1 = a # E - \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 37: Expected 1 errors -Line 38: Expected 1 errors -Line 81: Expected 1 errors -Line 82: Expected 1 errors -Line 84: Expected 1 errors -Line 85: Expected 1 errors -Line 8: Unexpected errors ['typeddicts_readonly_consistency.py:8:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing_extensions.ReadOnly not supported yet [not-supported-yet]'] -Line 34: Unexpected errors ['typeddicts_readonly_consistency.py:34:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: Type annotation for v1 does not match type of assignment [annotation-type-mismatch]'] -Line 35: Unexpected errors ['typeddicts_readonly_consistency.py:35:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: Type annotation for v2 does not match type of assignment [annotation-type-mismatch]'] -""" diff --git a/conformance/results/pytype/typeddicts_readonly_inheritance.toml b/conformance/results/pytype/typeddicts_readonly_inheritance.toml deleted file mode 100644 index c8e735abb..000000000 --- a/conformance/results/pytype/typeddicts_readonly_inheritance.toml +++ /dev/null @@ -1,134 +0,0 @@ -conformant = "Unsupported" -output = """ -typeddicts_readonly_inheritance.py:8:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing_extensions.ReadOnly not supported yet [not-supported-yet] - -from typing_extensions import ReadOnly -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -typeddicts_readonly_inheritance.py:18:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid base class: NamedDict [base-class-error] - -class Album1(NamedDict): -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - name: str -\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - year: int -\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - -typeddicts_readonly_inheritance.py:47:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid base class: AlbumCollection [base-class-error] - -class RecordShop(AlbumCollection): -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - name: str -\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - albums: ReadOnly[list[Album1]] # OK -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - alt: ReadOnly[list[str]] # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -typeddicts_readonly_inheritance.py:47:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid base class: AlbumCollection [base-class-error] - -class RecordShop(AlbumCollection): -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - name: str -\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - albums: ReadOnly[list[Album1]] # OK -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - alt: ReadOnly[list[str]] # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -typeddicts_readonly_inheritance.py:61:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid base class: OptionalName [base-class-error] - -class RequiredName(OptionalName): -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - name: ReadOnly[Required[str]] # OK -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -typeddicts_readonly_inheritance.py:65:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for d does not match type of assignment [annotation-type-mismatch] - -d: RequiredName = {} # E -\u001b[1m\u001b[31m~\u001b[39m\u001b[0m - -typeddicts_readonly_inheritance.py:75:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid base class: OptionalIdent [base-class-error] - -class User(OptionalIdent): -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - ident: str # Required, mutable, and not an int -\u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -typeddicts_readonly_inheritance.py:83:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for u does not match type of assignment [annotation-type-mismatch] - -u = {"ident": 3} # E -\u001b[1m\u001b[31m~\u001b[39m\u001b[0m - -typeddicts_readonly_inheritance.py:84:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for u does not match type of assignment [annotation-type-mismatch] - -u = {} # E -\u001b[1m\u001b[31m~\u001b[39m\u001b[0m - -typeddicts_readonly_inheritance.py:93:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid base class: F1 [base-class-error] - -class F3(F1): -\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - a: ReadOnly[int] # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -typeddicts_readonly_inheritance.py:97:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid base class: F1 [base-class-error] - -class F4(F1): -\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - a: NotRequired[int] # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -typeddicts_readonly_inheritance.py:101:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid base class: F1 [base-class-error] - -class F5(F1): -\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - b: ReadOnly[Required[int]] # OK -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -typeddicts_readonly_inheritance.py:105:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid base class: F1 [base-class-error] - -class F6(F1): -\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - c: ReadOnly[NotRequired[int]] # E -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -typeddicts_readonly_inheritance.py:119:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid base class: TD_A2 [base-class-error] - -class TD_A(TD_A1, TD_A2): ... # E: x is incompatible -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -typeddicts_readonly_inheritance.py:119:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid base class: TD_A2 [base-class-error] - -class TD_A(TD_A1, TD_A2): ... # E: x is incompatible -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -typeddicts_readonly_inheritance.py:132:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid base class: TD_B2 [base-class-error] - -class TD_B(TD_B1, TD_B2): ... # E: x is incompatible -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -typeddicts_readonly_inheritance.py:132:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid base class: TD_B2 [base-class-error] - -class TD_B(TD_B1, TD_B2): ... # E: x is incompatible -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 36: Expected 1 errors -Line 50: Expected 1 errors -Line 82: Expected 1 errors -Line 94: Expected 1 errors -Line 98: Expected 1 errors -Line 106: Expected 1 errors -Line 8: Unexpected errors ['typeddicts_readonly_inheritance.py:8:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing_extensions.ReadOnly not supported yet [not-supported-yet]'] -Line 18: Unexpected errors ['typeddicts_readonly_inheritance.py:18:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid base class: NamedDict [base-class-error]'] -Line 47: Unexpected errors ['typeddicts_readonly_inheritance.py:47:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid base class: AlbumCollection [base-class-error]', 'typeddicts_readonly_inheritance.py:47:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid base class: AlbumCollection [base-class-error]'] -Line 61: Unexpected errors ['typeddicts_readonly_inheritance.py:61:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid base class: OptionalName [base-class-error]'] -Line 75: Unexpected errors ['typeddicts_readonly_inheritance.py:75:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid base class: OptionalIdent [base-class-error]'] -Line 93: Unexpected errors ['typeddicts_readonly_inheritance.py:93:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid base class: F1 [base-class-error]'] -Line 97: Unexpected errors ['typeddicts_readonly_inheritance.py:97:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid base class: F1 [base-class-error]'] -Line 101: Unexpected errors ['typeddicts_readonly_inheritance.py:101:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid base class: F1 [base-class-error]'] -Line 105: Unexpected errors ['typeddicts_readonly_inheritance.py:105:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid base class: F1 [base-class-error]'] -""" diff --git a/conformance/results/pytype/typeddicts_readonly_kwargs.toml b/conformance/results/pytype/typeddicts_readonly_kwargs.toml deleted file mode 100644 index d9462a9c7..000000000 --- a/conformance/results/pytype/typeddicts_readonly_kwargs.toml +++ /dev/null @@ -1,23 +0,0 @@ -conformant = "Unsupported" -output = """ -typeddicts_readonly_kwargs.py:8:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing.Unpack not supported yet [not-supported-yet] - -from typing import Protocol, TypedDict, Unpack -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -typeddicts_readonly_kwargs.py:9:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing_extensions.ReadOnly not supported yet [not-supported-yet] - -from typing_extensions import ReadOnly -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -typeddicts_readonly_kwargs.py:33:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in impl: New container type for kwargs does not match type annotation [container-type-mismatch] - - kwargs["key1"] = 3 # E - \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 8: Unexpected errors ['typeddicts_readonly_kwargs.py:8:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.Unpack not supported yet [not-supported-yet]'] -Line 9: Unexpected errors ['typeddicts_readonly_kwargs.py:9:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing_extensions.ReadOnly not supported yet [not-supported-yet]'] -""" diff --git a/conformance/results/pytype/typeddicts_readonly_update.toml b/conformance/results/pytype/typeddicts_readonly_update.toml deleted file mode 100644 index 081375bd7..000000000 --- a/conformance/results/pytype/typeddicts_readonly_update.toml +++ /dev/null @@ -1,13 +0,0 @@ -conformant = "Unsupported" -output = """ -typeddicts_readonly_update.py:9:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing_extensions.ReadOnly not supported yet [not-supported-yet] - -from typing_extensions import ReadOnly -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 23: Expected 1 errors -Line 9: Unexpected errors ['typeddicts_readonly_update.py:9:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing_extensions.ReadOnly not supported yet [not-supported-yet]'] -""" diff --git a/conformance/results/pytype/typeddicts_required.toml b/conformance/results/pytype/typeddicts_required.toml deleted file mode 100644 index ff1737fd6..000000000 --- a/conformance/results/pytype/typeddicts_required.toml +++ /dev/null @@ -1,16 +0,0 @@ -conformant = "Partial" -notes = """ -Does not reject use of `Required` in non-TypedDict class. -Does not reject use of `Required` in function parameter annotation. -Does not reject nested use of `Required` in type annotation. -""" -output = """ -RecursionError: maximum recursion depth exceeded -""" -conformance_automated = "Fail" -errors_diff = """ -Line 12: Expected 1 errors -Line 19: Expected 1 errors -Line 62: Expected 1 errors -Line 63: Expected 1 errors -""" diff --git a/conformance/results/pytype/typeddicts_type_consistency.toml b/conformance/results/pytype/typeddicts_type_consistency.toml deleted file mode 100644 index f5be59879..000000000 --- a/conformance/results/pytype/typeddicts_type_consistency.toml +++ /dev/null @@ -1,38 +0,0 @@ -conformant = "Partial" -notes = """ -Does not report some type violations for TypedDict type compatibility. -Incorrectly reports type violation in cases where there is none. -Does not report type incompatibility between TypedDict and `dict[str, Any]`. -""" -output = """ -typeddicts_type_consistency.py:62:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for a3 does not match type of assignment [annotation-type-mismatch] - -a3: A3 = b3 -\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -typeddicts_type_consistency.py:65:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for b3 does not match type of assignment [annotation-type-mismatch] - -b3 = a3 # E -\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -typeddicts_type_consistency.py:69:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for a3_1 does not match type of assignment [annotation-type-mismatch] - -a3_1: A3 = {"x": 0, "y": 0} # E -\u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m - -typeddicts_type_consistency.py:126:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for o2 does not match type of assignment [annotation-type-mismatch] - -o2: Outer1 = {"outer_key": {"inner_key": {"inner_key": 1}}} # E -\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 21: Expected 1 errors -Line 38: Expected 1 errors -Line 76: Expected 1 errors -Line 77: Expected 1 errors -Line 78: Expected 1 errors -Line 82: Expected 1 errors -Line 62: Unexpected errors ['typeddicts_type_consistency.py:62:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for a3 does not match type of assignment [annotation-type-mismatch]'] -""" diff --git a/conformance/results/pytype/typeddicts_usage.toml b/conformance/results/pytype/typeddicts_usage.toml deleted file mode 100644 index 09e50f725..000000000 --- a/conformance/results/pytype/typeddicts_usage.toml +++ /dev/null @@ -1,27 +0,0 @@ -conformant = "Partial" -notes = """ -Does not report errant use of TypedDict in `isinstance` call. -Does not reject use of TypedDict as TypeVar bound. -""" -output = """ -typeddicts_usage.py:23:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : TypedDict Movie does not contain key director [typed-dict-error] - -movie["director"] = "Ridley Scott" # E: invalid key 'director' -\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m - -typeddicts_usage.py:24:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for key year in TypedDict Movie does not match type of assignment [annotation-type-mismatch] - -movie["year"] = "1982" # E: invalid value type ("int" expected) -\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m - -typeddicts_usage.py:28:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for movie2 does not match type of assignment [annotation-type-mismatch] - -movie2: Movie = {"title": "Blade Runner", "year": 1982} # E -\u001b[1m\u001b[31m~~~~~~\u001b[39m\u001b[0m - -""" -conformance_automated = "Fail" -errors_diff = """ -Line 35: Expected 1 errors -Line 40: Expected 1 errors -""" diff --git a/conformance/results/pytype/version.toml b/conformance/results/pytype/version.toml deleted file mode 100644 index 22d96d6b1..000000000 --- a/conformance/results/pytype/version.toml +++ /dev/null @@ -1,2 +0,0 @@ -version = "pytype 2024.10.11" -test_duration = 33.6 diff --git a/conformance/results/results.html b/conformance/results/results.html index c36fa49aa..b881e2373 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -159,899 +159,759 @@

    Python Type System Conformance Test Results

     
    mypy 1.15.0
    -
    2.3sec
    +
    1.8sec
    pyright 1.1.399
    -
    1.4sec
    +
    1.1sec
    pyre 0.9.23
    -
    8.2sec
    +
    9.0sec
    pytype 2024.10.11
    -
    35.2sec
    +
    31.3sec
    diff --git a/conformance/src/main.py b/conformance/src/main.py index 0c8a3b5ad..4c9342a68 100644 --- a/conformance/src/main.py +++ b/conformance/src/main.py @@ -45,13 +45,15 @@ def run_tests( def get_expected_errors(test_case: Path) -> tuple[ dict[int, tuple[int, int]], - dict[str, list[int]], + dict[str, tuple[list[int], bool]], ]: """Return the line numbers where type checkers are expected to produce an error. The return value is a tuple of two dictionaries: - The format of the first is {line number: (number of required errors, number of optional errors)}. - - The format of the second is {error tag: [lines where the error may appear]}. + - The format of the second is {error tag: ([lines where the error may appear], allow multiple}. + If allow multiple is True, the error may appear on multiple lines; otherwise, it must + appear exactly once. For example, the following test case: @@ -64,13 +66,13 @@ def f(): pass # E[final] ( {1: (1, 0), 2: (0, 1)}, - {"final": [3, 4]} + {"final": ([3, 4], False)} ) """ with open(test_case, "r", encoding="utf-8") as f: lines = f.readlines() output: dict[int, tuple[int, int]] = {} - groups: dict[str, list[int]] = {} + groups: dict[str, tuple[list[int], bool]] = {} for i, line in enumerate(lines, start=1): line_without_comment, *_ = line.split("#") # Ignore lines with no non-comment content. This allows commenting out test cases. @@ -86,7 +88,18 @@ def f(): pass # E[final] if required or optional: output[i] = (required, optional) for match in re.finditer(r"# E\[([^\]]+)\]", line): - groups.setdefault(match.group(1), []).append(i) + tag = match.group(1) + if tag.endswith("+"): + allow_multiple = True + tag = tag[:-1] + else: + allow_multiple = False + if tag not in groups: + groups[tag] = ([i], allow_multiple) + else: + if groups[tag][1] != allow_multiple: + raise ValueError(f"Error group {tag} has inconsistent allow_multiple value in {test_case}") + groups[tag][0].append(i) for group, linenos in groups.items(): if len(linenos) == 1: raise ValueError(f"Error group {group} only appears on a single line in {test_case}") @@ -119,11 +132,14 @@ def diff_expected_errors( # We don't report an issue if the count differs, because type checkers may produce # multiple error messages for a single line. linenos_used_by_groups: set[int] = set() - for group, linenos in error_groups.items(): - if not any(lineno in errors for lineno in linenos): + for group, (linenos, allow_multiple) in error_groups.items(): + num_errors = sum(1 for lineno in linenos if lineno in errors) + if num_errors == 0: differences.append(f"Lines {', '.join(map(str, linenos))}: Expected error (tag {group!r})") - else: + elif num_errors == 1 or allow_multiple: linenos_used_by_groups.update(linenos) + else: + differences.append(f"Lines {', '.join(map(str, linenos))}: Expected exactly one error (tag {group!r})") for actual_lineno, actual_errors in errors.items(): if actual_lineno not in expected_errors and actual_lineno not in linenos_used_by_groups: differences.append(f"Line {actual_lineno}: Unexpected errors {actual_errors}") diff --git a/conformance/tests/aliases_type_statement.py b/conformance/tests/aliases_type_statement.py index 024b4098a..c373b53ef 100644 --- a/conformance/tests/aliases_type_statement.py +++ b/conformance/tests/aliases_type_statement.py @@ -85,5 +85,5 @@ def func3(): type RecursiveTypeAlias5[T] = T | list[RecursiveTypeAlias5[T]] -type RecursiveTypeAlias6 = RecursiveTypeAlias7 # E[RTA6]: circular definition -type RecursiveTypeAlias7 = RecursiveTypeAlias6 # E[RTA6]: circular definition +type RecursiveTypeAlias6 = RecursiveTypeAlias7 # E[RTA6+]: circular definition +type RecursiveTypeAlias7 = RecursiveTypeAlias6 # E[RTA6+]: circular definition diff --git a/conformance/tests/overloads_definitions.py b/conformance/tests/overloads_definitions.py index d6c0267e6..bf8be66bb 100644 --- a/conformance/tests/overloads_definitions.py +++ b/conformance/tests/overloads_definitions.py @@ -70,28 +70,28 @@ def not_abstract(self, x: str) -> str: ... class C: @overload # E[func5] @staticmethod - def func5(x: int) -> int: # E[func5] + def func5(x: int, /) -> int: # E[func5] ... @overload @staticmethod - def func5(x: str) -> str: # E[func5] + def func5(x: str, /) -> str: # E[func5] ... - def func5(self, x: int | str) -> int | str: # E[func5] + def func5(*args: object) -> int | str: # E[func5] return 1 @overload # E[func6] @classmethod - def func6(cls, x: int) -> int: # E[func6] + def func6(cls, x: int, /) -> int: # E[func6] ... @overload - def func6(cls, x: str) -> str: # E[func6] + def func6(self, x: str, /) -> str: # E[func6] ... @classmethod - def func6(cls, x: int | str) -> int | str: # E[func6] + def func6(cls, *args: int | str) -> int | str: # E[func6] return 1 @@ -132,14 +132,14 @@ def invalid_final(self, x: int | str) -> int | str: ... # The @final decorator should not be on multiple overloads and # implementation: - @overload # E[invalid_final_2] @final should be on implementation only - @final - def invalid_final_2(self, x: int) -> int: # E[invalid_final_2] + @overload # E[invalid_final_2+]: @final should be on implementation only + @final # E[invalid_final_2+] + def invalid_final_2(self, x: int) -> int: # E[invalid_final_2+] ... @overload - @final - def invalid_final_2(self, x: str) -> str: # E[invalid_final_2] + @final # E[invalid_final_2+] + def invalid_final_2(self, x: str) -> str: # E[invalid_final_2+] ... @final @@ -217,13 +217,13 @@ def good_override(self, x: int | str) -> int | str: ... # This is the wrong way to use @override with an overloaded method, and # should emit an error: - @overload # E[override_impl]: @override should appear only on implementation - @override - def to_override(self, x: int) -> int: ... # E[override_impl] + @overload # E[override_impl+]: @override should appear only on implementation + @override # E[override_impl+] + def to_override(self, x: int) -> int: ... # E[override_impl+] @overload - @override - def to_override(self, x: str) -> str: ... # E[override_impl] + @override # E[override_impl+] + def to_override(self, x: str) -> str: ... # E[override_impl+] @override def to_override(self, x: int | str) -> int | str: ... diff --git a/conformance/tests/overloads_definitions_stub.pyi b/conformance/tests/overloads_definitions_stub.pyi index 3ab48adf5..a61bd0593 100644 --- a/conformance/tests/overloads_definitions_stub.pyi +++ b/conformance/tests/overloads_definitions_stub.pyi @@ -30,18 +30,18 @@ def func2(x: str) -> str: ... # > checkers should report an error if these conditions are not met. class C: @overload # E[func5] - def func5(x: int) -> int: # E[func5] + def func5(self, x: int, /) -> int: # E[func5] ... @overload @staticmethod - def func5(x: str) -> str: # E[func5] + def func5(x: str, /) -> str: # E[func5] ... @overload # E[func6] @classmethod - def func6(cls, x: int) -> int: # E[func6] + def func6(cls, x: int, /) -> int: # E[func6] ... @overload - def func6(cls, x: str) -> str: # E[func6] + def func6(self, *args: str) -> str: # E[func6] ... # > If a ``@final`` or ``@override`` decorator is supplied for a function with diff --git a/conformance/tests/tuples_type_compat.py b/conformance/tests/tuples_type_compat.py index 12a84cb16..27b76921f 100644 --- a/conformance/tests/tuples_type_compat.py +++ b/conformance/tests/tuples_type_compat.py @@ -7,7 +7,7 @@ # > Because tuple contents are immutable, the element types of a tuple are covariant. -from typing import Any, Iterable, Never, Sequence, TypeVar, assert_type +from typing import Any, Iterable, Never, Sequence, TypeAlias, TypeVar, assert_type def func1(t1: tuple[float, complex], t2: tuple[int, int]): @@ -67,19 +67,23 @@ def func4( # NOTE: This type narrowing functionality is optional, not mandated. +Func5Input: TypeAlias = tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int] -def func5(val: tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]): +def func5(val: Func5Input): if len(val) == 1: # Type can be narrowed to tuple[int]. - assert_type(val, tuple[int]) # E?: tuple[int] + assert_type(val, tuple[int]) # E[func5_1] + assert_type(val, Func5Input) # E[func5_1] if len(val) == 2: # Type can be narrowed to tuple[str, str] | tuple[int, int]. - assert_type(val, tuple[str, str] | tuple[int, int]) # E? + assert_type(val, tuple[str, str] | tuple[int, int]) # E[func5_2] + assert_type(val, Func5Input) # E[func5_2] if len(val) == 3: # Type can be narrowed to tuple[int, str, int]. - assert_type(val, tuple[int, str, int]) # E? + assert_type(val, tuple[int, str, int]) # E[func5_3] + assert_type(val, Func5Input) # E[func5_3] # > This property may also be used to safely narrow tuple types within a match @@ -87,20 +91,25 @@ def func5(val: tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]) # NOTE: This type narrowing functionality is optional, not mandated. +Func6Input: TypeAlias = tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int] -def func6(val: tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]): + +def func6(val: Func6Input): match val: case (x,): - # Type can be narrowed to tuple[int]. - assert_type(val, tuple[int]) # E?: tuple[int] + # Type may be narrowed to tuple[int]. + assert_type(val, tuple[int]) # E[func6_1] + assert_type(val, Func6Input) # E[func6_1] case (x, y): - # Type can be narrowed to tuple[str, str] | tuple[int, int]. - assert_type(val, tuple[str, str] | tuple[int, int]) # E? + # Type may be narrowed to tuple[str, str] | tuple[int, int]. + assert_type(val, tuple[str, str] | tuple[int, int]) # E[func6_2] + assert_type(val, Func6Input) # E[func6_2] case (x, y, z): - # Type can be narrowed to tuple[int, str, int]. - assert_type(val, tuple[int, str, int]) # E? + # Type may be narrowed to tuple[int, str, int]. + assert_type(val, tuple[int, str, int]) # E[func6_3] + assert_type(val, Func6Input) # E[func6_3] # > Type checkers may safely use this equivalency rule (tuple expansion) @@ -108,13 +117,17 @@ def func6(val: tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]) # NOTE: This type narrowing functionality is optional, not mandated. +Func7Input: TypeAlias = tuple[int | str, int | str] + -def func7(subj: tuple[int | str, int | str]): +def func7(subj: Func7Input): match subj: case x, str(): - assert_type(subj, tuple[int | str, str]) # E? + assert_type(subj, tuple[int | str, str]) # E[func7_1] + assert_type(subj, Func7Input) # E[func7_1] case y: - assert_type(subj, tuple[int | str, int]) # E? + assert_type(subj, tuple[int | str, int]) # E[func7_2] + assert_type(subj, Func7Input) # E[func7_2] # > The tuple class derives from Sequence[T_co] where ``T_co`` is a covariant From 3149e8ce32ff5bb3c1afd01467d2d7b1f5b64c95 Mon Sep 17 00:00:00 2001 From: PetrGolubev Date: Thu, 24 Apr 2025 18:59:00 +0200 Subject: [PATCH 101/308] Add missing import in enums_members.py (#1985) --- conformance/tests/enums_members.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conformance/tests/enums_members.py b/conformance/tests/enums_members.py index 52007e4d4..0dd8e5509 100644 --- a/conformance/tests/enums_members.py +++ b/conformance/tests/enums_members.py @@ -5,7 +5,7 @@ # Specification: https://typing.readthedocs.io/en/latest/spec/enums.html#defining-members from enum import Enum, member, nonmember -from typing import Literal, assert_type +from typing import Literal, assert_type, reveal_type # > If an attribute is defined in the class body with a type annotation but # > with no assigned value, a type checker should assume this is a non-member From acbf480838e2bae8aaf0b5fe370953798324a9a6 Mon Sep 17 00:00:00 2001 From: Rebecca Chen Date: Tue, 13 May 2025 00:38:28 -0700 Subject: [PATCH 102/308] Clarify that a TypeVarTuple default always has to be unpacked (#1971) * Clarify that a TypeVarTuple default always has to be unpacked. The spec says that: 1. The default of a TypeVarTuple can be another TypeVarTuple 2. TypeVarTuples are always unpacked. Together, these suggest that the default of a TypeVarTuple has to be an *unpacked* TypeVarTuple, and indeed [pyright](https://pyright-play.net/?pyrightVersion=1.1.386&code=GYJw9gtgBALgngBwJYDsDmUkQWEMoAqiApgGoCGIBArggDbEA0UAqiguQMYDWAUAQGcAjFAC8hEhSq0GACgDkgofICU-AQCYxEhGUo16xBYI3zmAE2LBy1OjFFK1ggMzaiuqQbmKBzs1EtrW3s2Dh4AbSUAXRUgA) and [mypy](https://mypy-play.net/?mypy=latest&python=3.12&gist=b6b01c533c7930e1e520765b773d1fe1) both agree. This PR makes that clear and adds a corresponding conformance test. I don't think this needs a discussion + Typing Council approval, since it's just a clarification of an existing rule, but happy to go through the full process if anyone disagrees. --- .../results/mypy/generics_defaults.toml | 28 ++++---- .../results/pyre/generics_defaults.toml | 48 ++++++------- .../results/pyright/generics_defaults.toml | 8 +-- .../results/pytype/generics_defaults.toml | 68 ++++++++++--------- .../results/pytype/specialtypes_never.toml | 7 +- conformance/tests/generics_defaults.py | 7 +- docs/spec/generics.rst | 4 +- 7 files changed, 90 insertions(+), 80 deletions(-) diff --git a/conformance/results/mypy/generics_defaults.toml b/conformance/results/mypy/generics_defaults.toml index 7c73b68ec..bc4145c45 100644 --- a/conformance/results/mypy/generics_defaults.toml +++ b/conformance/results/mypy/generics_defaults.toml @@ -12,19 +12,19 @@ generics_defaults.py:55: error: Expression is of type "type[AllTheDefaults[int, generics_defaults.py:59: error: Expression is of type "type[AllTheDefaults[int, complex, str, int, DefaultBoolT]]", not "type[AllTheDefaults[int, complex, str, int, bool]]" [assert-type] generics_defaults.py:79: error: Expression is of type "type[Class_ParamSpec[DefaultP]]", not "type[Class_ParamSpec[[str, int]]]" [assert-type] generics_defaults.py:94: error: Expression is of type "type[Class_TypeVarTuple[*DefaultTs]]", not "type[Class_TypeVarTuple[str, int]]" [assert-type] -generics_defaults.py:104: error: TypeVar default must be a subtype of the bound type [misc] -generics_defaults.py:111: error: TypeVar default must be one of the constraint types [misc] -generics_defaults.py:151: error: Expression is of type "type[Foo6[*tuple[Any, ...], Any]]", not "type[Foo6[int, str, [float, bool]]]" [assert-type] -generics_defaults.py:151: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [misc] -generics_defaults.py:152: error: Expression is of type "type[Foo6[*tuple[Any, ...], Any]]", not "type[Foo6[int, str, [bytes]]]" [assert-type] -generics_defaults.py:152: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [misc] -generics_defaults.py:166: error: Expression is of type "Callable[[Self], Self]", not "Callable[[Foo7[int]], Foo7[int]]" [assert-type] -generics_defaults.py:167: error: Expression is of type "Any", not "int" [assert-type] -generics_defaults.py:167: error: Access to generic instance variables via class is ambiguous [misc] +generics_defaults.py:107: error: TypeVar default must be a subtype of the bound type [misc] +generics_defaults.py:114: error: TypeVar default must be one of the constraint types [misc] +generics_defaults.py:154: error: Expression is of type "type[Foo6[*tuple[Any, ...], Any]]", not "type[Foo6[int, str, [float, bool]]]" [assert-type] +generics_defaults.py:154: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [misc] +generics_defaults.py:155: error: Expression is of type "type[Foo6[*tuple[Any, ...], Any]]", not "type[Foo6[int, str, [bytes]]]" [assert-type] +generics_defaults.py:155: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [misc] +generics_defaults.py:169: error: Expression is of type "Callable[[Self], Self]", not "Callable[[Foo7[int]], Foo7[int]]" [assert-type] +generics_defaults.py:170: error: Expression is of type "Any", not "int" [assert-type] +generics_defaults.py:170: error: Access to generic instance variables via class is ambiguous [misc] """ conformance_automated = "Fail" errors_diff = """ -Line 138: Expected 1 errors +Line 141: Expected 1 errors Line 30: Unexpected errors ['generics_defaults.py:30: error: Expression is of type "type[NoNonDefaults[DefaultStrT, DefaultIntT]]", not "type[NoNonDefaults[str, int]]" [assert-type]'] Line 31: Unexpected errors ['generics_defaults.py:31: error: Expression is of type "type[NoNonDefaults[str, DefaultIntT]]", not "type[NoNonDefaults[str, int]]" [assert-type]'] Line 38: Unexpected errors ['generics_defaults.py:38: error: Expression is of type "type[OneDefault[float, DefaultBoolT]]", not "type[OneDefault[float, bool]]" [assert-type]'] @@ -35,8 +35,8 @@ Line 55: Unexpected errors ['generics_defaults.py:55: error: Expression is of ty Line 59: Unexpected errors ['generics_defaults.py:59: error: Expression is of type "type[AllTheDefaults[int, complex, str, int, DefaultBoolT]]", not "type[AllTheDefaults[int, complex, str, int, bool]]" [assert-type]'] Line 79: Unexpected errors ['generics_defaults.py:79: error: Expression is of type "type[Class_ParamSpec[DefaultP]]", not "type[Class_ParamSpec[[str, int]]]" [assert-type]'] Line 94: Unexpected errors ['generics_defaults.py:94: error: Expression is of type "type[Class_TypeVarTuple[*DefaultTs]]", not "type[Class_TypeVarTuple[str, int]]" [assert-type]'] -Line 151: Unexpected errors ['generics_defaults.py:151: error: Expression is of type "type[Foo6[*tuple[Any, ...], Any]]", not "type[Foo6[int, str, [float, bool]]]" [assert-type]', 'generics_defaults.py:151: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [misc]'] -Line 152: Unexpected errors ['generics_defaults.py:152: error: Expression is of type "type[Foo6[*tuple[Any, ...], Any]]", not "type[Foo6[int, str, [bytes]]]" [assert-type]', 'generics_defaults.py:152: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [misc]'] -Line 166: Unexpected errors ['generics_defaults.py:166: error: Expression is of type "Callable[[Self], Self]", not "Callable[[Foo7[int]], Foo7[int]]" [assert-type]'] -Line 167: Unexpected errors ['generics_defaults.py:167: error: Expression is of type "Any", not "int" [assert-type]', 'generics_defaults.py:167: error: Access to generic instance variables via class is ambiguous [misc]'] +Line 154: Unexpected errors ['generics_defaults.py:154: error: Expression is of type "type[Foo6[*tuple[Any, ...], Any]]", not "type[Foo6[int, str, [float, bool]]]" [assert-type]', 'generics_defaults.py:154: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [misc]'] +Line 155: Unexpected errors ['generics_defaults.py:155: error: Expression is of type "type[Foo6[*tuple[Any, ...], Any]]", not "type[Foo6[int, str, [bytes]]]" [assert-type]', 'generics_defaults.py:155: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [misc]'] +Line 169: Unexpected errors ['generics_defaults.py:169: error: Expression is of type "Callable[[Self], Self]", not "Callable[[Foo7[int]], Foo7[int]]" [assert-type]'] +Line 170: Unexpected errors ['generics_defaults.py:170: error: Expression is of type "Any", not "int" [assert-type]', 'generics_defaults.py:170: error: Access to generic instance variables via class is ambiguous [misc]'] """ diff --git a/conformance/results/pyre/generics_defaults.toml b/conformance/results/pyre/generics_defaults.toml index 2db9965f2..b39853185 100644 --- a/conformance/results/pyre/generics_defaults.toml +++ b/conformance/results/pyre/generics_defaults.toml @@ -50,26 +50,27 @@ generics_defaults.py:95:34 Invalid type parameters [24]: Non-generic type `Class generics_defaults.py:96:0 Assert type [70]: Expected `Class_TypeVarTuple[]` but got `typing.Any`. generics_defaults.py:96:12 Undefined attribute [16]: `Class_TypeVarTuple` has no attribute `__getitem__`. generics_defaults.py:96:45 Invalid type parameters [24]: Non-generic type `Class_TypeVarTuple` cannot take parameters. -generics_defaults.py:124:13 Undefined or invalid type [11]: Annotation `T4` is not defined as a type. -generics_defaults.py:127:0 Assert type [70]: Expected `int` but got `unknown`. -generics_defaults.py:138:11 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Ts`. -generics_defaults.py:138:11 Undefined or invalid type [11]: Annotation `T5` is not defined as a type. -generics_defaults.py:148:11 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Ts`. -generics_defaults.py:148:11 Undefined or invalid type [11]: Annotation `P` is not defined as a type. -generics_defaults.py:151:0 Assert type [70]: Expected `Type[Foo6[]]` but got `typing.Any`. -generics_defaults.py:151:12 Undefined attribute [16]: `Foo6` has no attribute `__getitem__`. -generics_defaults.py:151:28 Invalid type parameters [24]: Non-generic type `Foo6` cannot take parameters. -generics_defaults.py:152:0 Assert type [70]: Expected `Type[Foo6[]]` but got `typing.Any`. -generics_defaults.py:152:37 Invalid type parameters [24]: Non-generic type `Foo6` cannot take parameters. -generics_defaults.py:166:0 Assert type [70]: Expected `typing.Callable[[Foo7[]], Foo7[]]` but got `typing.Callable(Foo7.meth)[[Variable[_Self_generics_defaults_Foo7__ (bound to Foo7)]], Variable[_Self_generics_defaults_Foo7__ (bound to Foo7)]]`. -generics_defaults.py:166:23 Invalid type parameters [24]: Non-generic type `Foo7` cannot take parameters. -generics_defaults.py:167:0 Assert type [70]: Expected `int` but got `unknown`. +generics_defaults.py:99:67 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T]]` but got `TypeVarTuple`. +generics_defaults.py:127:13 Undefined or invalid type [11]: Annotation `T4` is not defined as a type. +generics_defaults.py:130:0 Assert type [70]: Expected `int` but got `unknown`. +generics_defaults.py:141:11 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Ts`. +generics_defaults.py:141:11 Undefined or invalid type [11]: Annotation `T5` is not defined as a type. +generics_defaults.py:151:11 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Ts`. +generics_defaults.py:151:11 Undefined or invalid type [11]: Annotation `P` is not defined as a type. +generics_defaults.py:154:0 Assert type [70]: Expected `Type[Foo6[]]` but got `typing.Any`. +generics_defaults.py:154:12 Undefined attribute [16]: `Foo6` has no attribute `__getitem__`. +generics_defaults.py:154:28 Invalid type parameters [24]: Non-generic type `Foo6` cannot take parameters. +generics_defaults.py:155:0 Assert type [70]: Expected `Type[Foo6[]]` but got `typing.Any`. +generics_defaults.py:155:37 Invalid type parameters [24]: Non-generic type `Foo6` cannot take parameters. +generics_defaults.py:169:0 Assert type [70]: Expected `typing.Callable[[Foo7[]], Foo7[]]` but got `typing.Callable(Foo7.meth)[[Variable[_Self_generics_defaults_Foo7__ (bound to Foo7)]], Variable[_Self_generics_defaults_Foo7__ (bound to Foo7)]]`. +generics_defaults.py:169:23 Invalid type parameters [24]: Non-generic type `Foo7` cannot take parameters. +generics_defaults.py:170:0 Assert type [70]: Expected `int` but got `unknown`. """ conformance_automated = "Fail" errors_diff = """ Line 50: Expected 1 errors -Line 104: Expected 1 errors -Line 111: Expected 1 errors +Line 107: Expected 1 errors +Line 114: Expected 1 errors Line 27: Unexpected errors ['generics_defaults.py:27:20 Undefined or invalid type [11]: Annotation `DefaultIntT` is not defined as a type.'] Line 30: Unexpected errors ['generics_defaults.py:30:0 Assert type [70]: Expected `Type[NoNonDefaults[]]` but got `Type[NoNonDefaults]`.', 'generics_defaults.py:30:27 Invalid type parameters [24]: Non-generic type `NoNonDefaults` cannot take parameters.'] Line 31: Unexpected errors ['generics_defaults.py:31:0 Assert type [70]: Expected `Type[NoNonDefaults[]]` but got `typing.Any`.', 'generics_defaults.py:31:12 Undefined attribute [16]: `NoNonDefaults` has no attribute `__getitem__`.', 'generics_defaults.py:31:32 Invalid type parameters [24]: Non-generic type `NoNonDefaults` cannot take parameters.'] @@ -97,11 +98,12 @@ Line 91: Unexpected errors ['generics_defaults.py:91:25 Undefined or invalid typ Line 94: Unexpected errors ['generics_defaults.py:94:0 Assert type [70]: Expected `Type[Class_TypeVarTuple[]]` but got `Type[Class_TypeVarTuple]`.', 'generics_defaults.py:94:32 Invalid type parameters [24]: Non-generic type `Class_TypeVarTuple` cannot take parameters.'] Line 95: Unexpected errors ['generics_defaults.py:95:0 Assert type [70]: Expected `Class_TypeVarTuple[]` but got `Class_TypeVarTuple`.', 'generics_defaults.py:95:34 Invalid type parameters [24]: Non-generic type `Class_TypeVarTuple` cannot take parameters.'] Line 96: Unexpected errors ['generics_defaults.py:96:0 Assert type [70]: Expected `Class_TypeVarTuple[]` but got `typing.Any`.', 'generics_defaults.py:96:12 Undefined attribute [16]: `Class_TypeVarTuple` has no attribute `__getitem__`.', 'generics_defaults.py:96:45 Invalid type parameters [24]: Non-generic type `Class_TypeVarTuple` cannot take parameters.'] -Line 124: Unexpected errors ['generics_defaults.py:124:13 Undefined or invalid type [11]: Annotation `T4` is not defined as a type.'] -Line 127: Unexpected errors ['generics_defaults.py:127:0 Assert type [70]: Expected `int` but got `unknown`.'] -Line 148: Unexpected errors ["generics_defaults.py:148:11 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Ts`.", 'generics_defaults.py:148:11 Undefined or invalid type [11]: Annotation `P` is not defined as a type.'] -Line 151: Unexpected errors ['generics_defaults.py:151:0 Assert type [70]: Expected `Type[Foo6[]]` but got `typing.Any`.', 'generics_defaults.py:151:12 Undefined attribute [16]: `Foo6` has no attribute `__getitem__`.', 'generics_defaults.py:151:28 Invalid type parameters [24]: Non-generic type `Foo6` cannot take parameters.'] -Line 152: Unexpected errors ['generics_defaults.py:152:0 Assert type [70]: Expected `Type[Foo6[]]` but got `typing.Any`.', 'generics_defaults.py:152:37 Invalid type parameters [24]: Non-generic type `Foo6` cannot take parameters.'] -Line 166: Unexpected errors ['generics_defaults.py:166:0 Assert type [70]: Expected `typing.Callable[[Foo7[]], Foo7[]]` but got `typing.Callable(Foo7.meth)[[Variable[_Self_generics_defaults_Foo7__ (bound to Foo7)]], Variable[_Self_generics_defaults_Foo7__ (bound to Foo7)]]`.', 'generics_defaults.py:166:23 Invalid type parameters [24]: Non-generic type `Foo7` cannot take parameters.'] -Line 167: Unexpected errors ['generics_defaults.py:167:0 Assert type [70]: Expected `int` but got `unknown`.'] +Line 99: Unexpected errors ['generics_defaults.py:99:67 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T]]` but got `TypeVarTuple`.'] +Line 127: Unexpected errors ['generics_defaults.py:127:13 Undefined or invalid type [11]: Annotation `T4` is not defined as a type.'] +Line 130: Unexpected errors ['generics_defaults.py:130:0 Assert type [70]: Expected `int` but got `unknown`.'] +Line 151: Unexpected errors ["generics_defaults.py:151:11 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Ts`.", 'generics_defaults.py:151:11 Undefined or invalid type [11]: Annotation `P` is not defined as a type.'] +Line 154: Unexpected errors ['generics_defaults.py:154:0 Assert type [70]: Expected `Type[Foo6[]]` but got `typing.Any`.', 'generics_defaults.py:154:12 Undefined attribute [16]: `Foo6` has no attribute `__getitem__`.', 'generics_defaults.py:154:28 Invalid type parameters [24]: Non-generic type `Foo6` cannot take parameters.'] +Line 155: Unexpected errors ['generics_defaults.py:155:0 Assert type [70]: Expected `Type[Foo6[]]` but got `typing.Any`.', 'generics_defaults.py:155:37 Invalid type parameters [24]: Non-generic type `Foo6` cannot take parameters.'] +Line 169: Unexpected errors ['generics_defaults.py:169:0 Assert type [70]: Expected `typing.Callable[[Foo7[]], Foo7[]]` but got `typing.Callable(Foo7.meth)[[Variable[_Self_generics_defaults_Foo7__ (bound to Foo7)]], Variable[_Self_generics_defaults_Foo7__ (bound to Foo7)]]`.', 'generics_defaults.py:169:23 Invalid type parameters [24]: Non-generic type `Foo7` cannot take parameters.'] +Line 170: Unexpected errors ['generics_defaults.py:170:0 Assert type [70]: Expected `int` but got `unknown`.'] """ diff --git a/conformance/results/pyright/generics_defaults.toml b/conformance/results/pyright/generics_defaults.toml index fc55cd200..16b3cc3c1 100644 --- a/conformance/results/pyright/generics_defaults.toml +++ b/conformance/results/pyright/generics_defaults.toml @@ -2,10 +2,10 @@ conformant = "Pass" output = """ generics_defaults.py:24:7 - error: "T" cannot appear after "DefaultStrT" in type parameter list because it has no default type (reportGeneralTypeIssues) generics_defaults.py:50:16 - error: Too few type arguments provided for "AllTheDefaults"; expected 2 but received 1 (reportInvalidTypeArguments) -generics_defaults.py:104:51 - error: TypeVar default type must be a subtype of the bound type (reportGeneralTypeIssues) -generics_defaults.py:111:52 - error: TypeVar default type must be one of the constrained types (reportGeneralTypeIssues) -generics_defaults.py:138:7 - error: TypeVar "T5" has a default value and cannot follow TypeVarTuple "Ts" (reportGeneralTypeIssues) -generics_defaults.py:167:18 - error: Access to generic instance variable through class is ambiguous (reportGeneralTypeIssues) +generics_defaults.py:107:51 - error: TypeVar default type must be a subtype of the bound type (reportGeneralTypeIssues) +generics_defaults.py:114:52 - error: TypeVar default type must be one of the constrained types (reportGeneralTypeIssues) +generics_defaults.py:141:7 - error: TypeVar "T5" has a default value and cannot follow TypeVarTuple "Ts" (reportGeneralTypeIssues) +generics_defaults.py:170:18 - error: Access to generic instance variable through class is ambiguous (reportGeneralTypeIssues) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pytype/generics_defaults.toml b/conformance/results/pytype/generics_defaults.toml index 3f8321859..68c0f8448 100644 --- a/conformance/results/pytype/generics_defaults.toml +++ b/conformance/results/pytype/generics_defaults.toml @@ -185,97 +185,102 @@ generics_defaults.py:96:46: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] +generics_defaults.py:99:61: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +AnotherDefaultTs = TypeVarTuple("AnotherDefaultTs", default=Unpack[DefaultTs]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:106:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] Ok1 = TypeVar("Ok1", bound=float, default=int) # OK \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_defaults.py:104:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] +generics_defaults.py:107:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] Invalid1 = TypeVar("Invalid1", bound=str, default=int) # E: the bound and default are incompatible \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_defaults.py:110:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] +generics_defaults.py:113:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] Ok2 = TypeVar("Ok2", float, str, default=float) # OK \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_defaults.py:111:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] +generics_defaults.py:114:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] Invalid2 = TypeVar("Invalid2", float, str, default=int) # E: expected one of float or str got int \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_defaults.py:121:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] +generics_defaults.py:124:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] T4 = TypeVar("T4", default=int) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_defaults.py:127:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Any [assert-type] +generics_defaults.py:130:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Any [assert-type] assert_type(func1(0), int) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_defaults.py:135:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] +generics_defaults.py:138:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] T5 = TypeVar("T5", default=bool) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_defaults.py:138:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] +generics_defaults.py:141:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] class Foo5(Generic[*Ts, T5]): ... # E \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_defaults.py:145:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] +generics_defaults.py:148:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] P = ParamSpec("P", default=[float, bool]) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_defaults.py:148:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] +generics_defaults.py:151:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] class Foo6(Generic[*Ts, P]): ... # OK \u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_defaults.py:151:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Foo6 is not indexable [not-indexable] +generics_defaults.py:154:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Foo6 is not indexable [not-indexable] assert_type(Foo6[int, str], type[Foo6[int, str, [float, bool]]]) \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_defaults.py:151:34: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Foo6 is not indexable [not-indexable] +generics_defaults.py:154:34: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Foo6 is not indexable [not-indexable] assert_type(Foo6[int, str], type[Foo6[int, str, [float, bool]]]) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_defaults.py:152:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Foo6 is not indexable [not-indexable] +generics_defaults.py:155:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Foo6 is not indexable [not-indexable] assert_type(Foo6[int, str, [bytes]], type[Foo6[int, str, [bytes]]]) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_defaults.py:152:43: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Foo6 is not indexable [not-indexable] +generics_defaults.py:155:43: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Foo6 is not indexable [not-indexable] assert_type(Foo6[int, str, [bytes]], type[Foo6[int, str, [bytes]]]) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_defaults.py:159:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] +generics_defaults.py:162:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] class Foo7(Generic[DefaultIntT]): \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_defaults.py:166:34: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Foo7 is not indexable [not-indexable] +generics_defaults.py:169:34: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Foo7 is not indexable [not-indexable] assert_type(Foo7.meth, Callable[[Foo7[int]], Foo7[int]]) \u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m -generics_defaults.py:166:46: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Foo7 is not indexable [not-indexable] +generics_defaults.py:169:46: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Foo7 is not indexable [not-indexable] assert_type(Foo7.meth, Callable[[Foo7[int]], Foo7[int]]) \u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m -generics_defaults.py:166:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Callable[[Any], Self] [assert-type] +generics_defaults.py:169:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Callable[[Any], Self] [assert-type] assert_type(Foo7.meth, Callable[[Foo7[int]], Foo7[int]]) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_defaults.py:167:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Any [assert-type] +generics_defaults.py:170:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Any [assert-type] assert_type(Foo7.attr, int) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -314,16 +319,17 @@ Line 91: Unexpected errors ["generics_defaults.py:91:26: \\x1b[1m\\x1b[31merror\ Line 94: Unexpected errors ['generics_defaults.py:94:38: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Class_TypeVarTuple is not indexable [not-indexable]'] Line 95: Unexpected errors ['generics_defaults.py:95:35: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Class_TypeVarTuple is not indexable [not-indexable]'] Line 96: Unexpected errors ['generics_defaults.py:96:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Class_TypeVarTuple is not indexable [not-indexable]', 'generics_defaults.py:96:46: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Class_TypeVarTuple is not indexable [not-indexable]'] -Line 103: Unexpected errors ['generics_defaults.py:103:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] -Line 110: Unexpected errors ['generics_defaults.py:110:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] -Line 121: Unexpected errors ['generics_defaults.py:121:6: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] -Line 127: Unexpected errors ['generics_defaults.py:127:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Any [assert-type]'] -Line 135: Unexpected errors ['generics_defaults.py:135:6: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] -Line 145: Unexpected errors ['generics_defaults.py:145:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] -Line 148: Unexpected errors ["generics_defaults.py:148:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] -Line 151: Unexpected errors ['generics_defaults.py:151:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Foo6 is not indexable [not-indexable]', 'generics_defaults.py:151:34: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Foo6 is not indexable [not-indexable]'] -Line 152: Unexpected errors ['generics_defaults.py:152:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Foo6 is not indexable [not-indexable]', 'generics_defaults.py:152:43: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Foo6 is not indexable [not-indexable]'] -Line 159: Unexpected errors ["generics_defaults.py:159:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] -Line 166: Unexpected errors ['generics_defaults.py:166:34: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Foo7 is not indexable [not-indexable]', 'generics_defaults.py:166:46: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Foo7 is not indexable [not-indexable]', 'generics_defaults.py:166:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Callable[[Any], Self] [assert-type]'] -Line 167: Unexpected errors ['generics_defaults.py:167:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Any [assert-type]'] +Line 99: Unexpected errors ["generics_defaults.py:99:61: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 106: Unexpected errors ['generics_defaults.py:106:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] +Line 113: Unexpected errors ['generics_defaults.py:113:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] +Line 124: Unexpected errors ['generics_defaults.py:124:6: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] +Line 130: Unexpected errors ['generics_defaults.py:130:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Any [assert-type]'] +Line 138: Unexpected errors ['generics_defaults.py:138:6: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] +Line 148: Unexpected errors ['generics_defaults.py:148:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] +Line 151: Unexpected errors ["generics_defaults.py:151:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] +Line 154: Unexpected errors ['generics_defaults.py:154:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Foo6 is not indexable [not-indexable]', 'generics_defaults.py:154:34: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Foo6 is not indexable [not-indexable]'] +Line 155: Unexpected errors ['generics_defaults.py:155:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Foo6 is not indexable [not-indexable]', 'generics_defaults.py:155:43: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Foo6 is not indexable [not-indexable]'] +Line 162: Unexpected errors ["generics_defaults.py:162:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] +Line 169: Unexpected errors ['generics_defaults.py:169:34: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Foo7 is not indexable [not-indexable]', 'generics_defaults.py:169:46: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Foo7 is not indexable [not-indexable]', 'generics_defaults.py:169:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Callable[[Any], Self] [assert-type]'] +Line 170: Unexpected errors ['generics_defaults.py:170:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Any [assert-type]'] """ diff --git a/conformance/results/pytype/specialtypes_never.toml b/conformance/results/pytype/specialtypes_never.toml index 7a2318585..be27a72ae 100644 --- a/conformance/results/pytype/specialtypes_never.toml +++ b/conformance/results/pytype/specialtypes_never.toml @@ -8,11 +8,10 @@ specialtypes_never.py:11:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] -Line 21: Unexpected errors ['specialtypes_never.py:21:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: bad return type [bad-return-type]'] +Line 21: Unexpected errors ['specialtypes_never.py:21:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: bad return type [bad-return-type]'] Line 68: Unexpected errors ['specialtypes_never.py:68:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func6: Type annotation for v1 does not match type of assignment [annotation-type-mismatch]'] Line 69: Unexpected errors ['specialtypes_never.py:69:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func6: Type annotation for v2 does not match type of assignment [annotation-type-mismatch]'] Line 70: Unexpected errors ['specialtypes_never.py:70:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func6: Type annotation for v3 does not match type of assignment [annotation-type-mismatch]'] diff --git a/conformance/tests/generics_defaults.py b/conformance/tests/generics_defaults.py index af347b102..7ac1f8ed3 100644 --- a/conformance/tests/generics_defaults.py +++ b/conformance/tests/generics_defaults.py @@ -82,8 +82,8 @@ class Class_ParamSpec(Generic[DefaultP]): ... # > ``TypeVarTuple`` defaults are defined using the same syntax as -# > ``TypeVar`` \ s but use an unpacked tuple of types instead of a single type -# > or another in-scope ``TypeVarTuple`` (see `Scoping Rules`_). +# > ``TypeVar`` \ s, but instead of a single type, they use an unpacked tuple +# > of types or an unpacked, in-scope ``TypeVarTuple`` (see `Scoping Rules`_). DefaultTs = TypeVarTuple("DefaultTs", default=Unpack[tuple[str, int]]) @@ -96,6 +96,9 @@ class Class_TypeVarTuple(Generic[*DefaultTs]): ... assert_type(Class_TypeVarTuple[int, bool](), Class_TypeVarTuple[int, bool]) +AnotherDefaultTs = TypeVarTuple("AnotherDefaultTs", default=Unpack[DefaultTs]) + + # > If both ``bound`` and ``default`` are passed, ``default`` must be a # > subtype of ``bound``. If not, the type checker should generate an # > error. diff --git a/docs/spec/generics.rst b/docs/spec/generics.rst index 65eeea941..942abb66c 100644 --- a/docs/spec/generics.rst +++ b/docs/spec/generics.rst @@ -1919,8 +1919,8 @@ literal "``...``" or another in-scope ``ParamSpec`` (see `Scoping Rules`_). ^^^^^^^^^^^^^^^^^^^^^^^^^ ``TypeVarTuple`` defaults are defined using the same syntax as -``TypeVar`` \ s but use an unpacked tuple of types instead of a single type -or another in-scope ``TypeVarTuple`` (see `Scoping Rules`_). +``TypeVar`` \ s, but instead of a single type, they use an unpacked tuple of +types or an unpacked, in-scope ``TypeVarTuple`` (see `Scoping Rules`_). :: From 431b0231210f26c3ddcf9ef3dca941d09d73fcdf Mon Sep 17 00:00:00 2001 From: PetrGolubev Date: Sat, 17 May 2025 00:19:23 +0200 Subject: [PATCH 103/308] Extend possible error location in overloads_definitions.py (#2004) Allow highlighting decorator instead of a function name in overloads_definitions.py --- conformance/tests/overloads_definitions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conformance/tests/overloads_definitions.py b/conformance/tests/overloads_definitions.py index bf8be66bb..a1bcd030b 100644 --- a/conformance/tests/overloads_definitions.py +++ b/conformance/tests/overloads_definitions.py @@ -194,7 +194,7 @@ def bad_override(self, x: int) -> int: # E[bad_override] @overload def bad_override(self, x: str) -> str: ... - @override + @override # E[bad_override] def bad_override(self, x: int | str) -> int | str: # E[bad_override] ... From be63e7af2bf198c868780658504d06205de0c079 Mon Sep 17 00:00:00 2001 From: PetrGolubev Date: Sat, 17 May 2025 03:10:32 +0200 Subject: [PATCH 104/308] Extend possible error locations overloads_definitions_stub.pyi (#2005) --- conformance/tests/overloads_definitions_stub.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conformance/tests/overloads_definitions_stub.pyi b/conformance/tests/overloads_definitions_stub.pyi index a61bd0593..a399ec553 100644 --- a/conformance/tests/overloads_definitions_stub.pyi +++ b/conformance/tests/overloads_definitions_stub.pyi @@ -118,7 +118,7 @@ class Child(Base): # E[override-final] # there's no `Base.bad_override` method): @overload # E[bad_override] marked as override but doesn't exist in base - @override + @override # E[bad_override] def bad_override(self, x: int) -> int: # E[bad_override] ... @overload From 089d7d37709cb4d05b8593daa102b515cfb08b60 Mon Sep 17 00:00:00 2001 From: KotlinIsland <65446343+KotlinIsland@users.noreply.github.com> Date: Tue, 20 May 2025 11:28:02 +1000 Subject: [PATCH 105/308] =?UTF-8?q?conformance:=20aliases=5Ftypealiastype:?= =?UTF-8?q?=20quote=20recursive=20aliases,=20and=20add=20=E2=80=A6=20(#199?= =?UTF-8?q?8)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * conformance: aliases_typealiastype: quote recursive aliases, and add an invalid case for unquoted * conformance: regenerate report --- .../results/mypy/aliases_typealiastype.toml | 4 +- .../results/pyre/aliases_typealiastype.toml | 5 ++- .../results/pyre/overloads_definitions.toml | 6 --- conformance/results/pyre/version.toml | 2 +- .../pyright/aliases_typealiastype.toml | 8 +++- .../pyright/generics_type_erasure.toml | 9 ++-- conformance/results/pyright/version.toml | 2 +- .../results/pytype/aliases_typealiastype.toml | 41 +++++++++---------- .../results/pytype/overloads_definitions.toml | 4 +- .../pytype/overloads_definitions_stub.toml | 2 +- .../results/pytype/specialtypes_never.toml | 7 ++-- conformance/results/pytype/version.toml | 2 +- conformance/results/results.html | 10 ++--- conformance/tests/aliases_typealiastype.py | 12 +++--- 14 files changed, 57 insertions(+), 57 deletions(-) diff --git a/conformance/results/mypy/aliases_typealiastype.toml b/conformance/results/mypy/aliases_typealiastype.toml index 078f99616..1a034e810 100644 --- a/conformance/results/mypy/aliases_typealiastype.toml +++ b/conformance/results/mypy/aliases_typealiastype.toml @@ -4,7 +4,6 @@ Incorrectly rejects some recursive type aliases using TypeAliasType. Incorrectly rejects the use of a class-scoped TypeVar in a TypeAliasType definition. """ output = """ -aliases_typealiastype.py:19: error: Cannot resolve name "GoodAlias4" (possible cyclic definition) [misc] aliases_typealiastype.py:20: error: Cannot resolve name "GoodAlias5" (possible cyclic definition) [misc] aliases_typealiastype.py:22: error: Cannot resolve name "GoodAlias5" (possible cyclic definition) [misc] aliases_typealiastype.py:27: error: Type variable "T" is not included in type_params [valid-type] @@ -17,7 +16,6 @@ aliases_typealiastype.py:46: error: Cannot resolve name "BadAlias4" (possible cy aliases_typealiastype.py:47: error: Invalid recursive alias: a union item of itself [misc] aliases_typealiastype.py:48: error: Cannot resolve name "BadAlias6" (possible cyclic definition) [misc] aliases_typealiastype.py:48: error: Cannot resolve name "BadAlias7" (possible cyclic definition) [misc] -aliases_typealiastype.py:48: error: Name "BadAlias7" is used before definition [used-before-def] aliases_typealiastype.py:49: error: Cannot resolve name "BadAlias7" (possible cyclic definition) [misc] aliases_typealiastype.py:52: error: Invalid type alias: expression is not a valid type [valid-type] aliases_typealiastype.py:53: error: Bracketed expression "[...]" is not valid as a type [valid-type] @@ -35,10 +33,10 @@ aliases_typealiastype.py:62: error: Invalid type: try using Literal[1] instead? aliases_typealiastype.py:63: error: Invalid type alias: expression is not a valid type [valid-type] aliases_typealiastype.py:63: error: Function "list" could always be true in boolean context [truthy-function] aliases_typealiastype.py:64: error: Invalid type alias: expression is not a valid type [valid-type] +aliases_typealiastype.py:66: error: Cannot resolve name "BadAlias21" (possible cyclic definition) [misc] """ conformance_automated = "Fail" errors_diff = """ -Line 19: Unexpected errors ['aliases_typealiastype.py:19: error: Cannot resolve name "GoodAlias4" (possible cyclic definition) [misc]'] Line 20: Unexpected errors ['aliases_typealiastype.py:20: error: Cannot resolve name "GoodAlias5" (possible cyclic definition) [misc]'] Line 22: Unexpected errors ['aliases_typealiastype.py:22: error: Cannot resolve name "GoodAlias5" (possible cyclic definition) [misc]'] Line 27: Unexpected errors ['aliases_typealiastype.py:27: error: Type variable "T" is not included in type_params [valid-type]'] diff --git a/conformance/results/pyre/aliases_typealiastype.toml b/conformance/results/pyre/aliases_typealiastype.toml index 29cd273f5..ed9e9178e 100644 --- a/conformance/results/pyre/aliases_typealiastype.toml +++ b/conformance/results/pyre/aliases_typealiastype.toml @@ -5,7 +5,7 @@ Support for TypeAliasType is not implemented. output = """ aliases_typealiastype.py:17:41 Undefined attribute [16]: `list` has no attribute `__getitem__`. aliases_typealiastype.py:22:13 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[typing.Any, Type[Variable[$synthetic_attribute_resolution_variable]]]` but got `Tuple[ParamSpec, TypeVar]`. -aliases_typealiastype.py:22:65 Undefined attribute [16]: `tuple` has no attribute `__getitem__`. +aliases_typealiastype.py:22:67 Undefined attribute [16]: `tuple` has no attribute `__getitem__`. aliases_typealiastype.py:32:6 Undefined attribute [16]: `TypeAliasType` has no attribute `other_attrib`. aliases_typealiastype.py:35:4 Undefined or invalid type [11]: Annotation `GoodAlias4` is not defined as a type. aliases_typealiastype.py:37:4 Undefined or invalid type [11]: Annotation `GoodAlias5` is not defined as a type. @@ -32,8 +32,9 @@ Line 61: Expected 1 errors Line 62: Expected 1 errors Line 63: Expected 1 errors Line 64: Expected 1 errors +Line 66: Expected 1 errors Line 17: Unexpected errors ['aliases_typealiastype.py:17:41 Undefined attribute [16]: `list` has no attribute `__getitem__`.'] -Line 22: Unexpected errors ['aliases_typealiastype.py:22:13 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[typing.Any, Type[Variable[$synthetic_attribute_resolution_variable]]]` but got `Tuple[ParamSpec, TypeVar]`.', 'aliases_typealiastype.py:22:65 Undefined attribute [16]: `tuple` has no attribute `__getitem__`.'] +Line 22: Unexpected errors ['aliases_typealiastype.py:22:13 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[typing.Any, Type[Variable[$synthetic_attribute_resolution_variable]]]` but got `Tuple[ParamSpec, TypeVar]`.', 'aliases_typealiastype.py:22:67 Undefined attribute [16]: `tuple` has no attribute `__getitem__`.'] Line 35: Unexpected errors ['aliases_typealiastype.py:35:4 Undefined or invalid type [11]: Annotation `GoodAlias4` is not defined as a type.'] Line 37: Unexpected errors ['aliases_typealiastype.py:37:4 Undefined or invalid type [11]: Annotation `GoodAlias5` is not defined as a type.'] """ diff --git a/conformance/results/pyre/overloads_definitions.toml b/conformance/results/pyre/overloads_definitions.toml index 9462c19ce..ecbcade19 100644 --- a/conformance/results/pyre/overloads_definitions.toml +++ b/conformance/results/pyre/overloads_definitions.toml @@ -5,14 +5,10 @@ Does not allow an overload with no implementation in a Protocol or an abstract b Expects @final/@override on all overloads and implementation, instead of implementation only. """ errors_diff = """ -Lines 71, 73, 78, 81: Expected exactly one error (tag 'func5') Lines 135, 136, 137, 141, 142: Expected error (tag 'invalid_final_2') Lines 220, 221, 222, 225, 226: Expected error (tag 'override_impl') Line 40: Unexpected errors ['overloads_definitions.py:40:4 Missing overload implementation [42]: Overloaded function `MyProto.func3` must have an implementation.'] Line 49: Unexpected errors ['overloads_definitions.py:49:4 Missing overload implementation [42]: Overloaded function `MyAbstractBase.func4` must have an implementation.'] -Line 73: Unexpected errors ['overloads_definitions.py:73:4 Incompatible overload [43]: The implementation of `C.func5` does not accept all possible arguments of overload defined on line `73`.'] -Line 78: Unexpected errors ['overloads_definitions.py:78:4 Incompatible overload [43]: The implementation of `C.func5` does not accept all possible arguments of overload defined on line `78`.'] -Line 81: Unexpected errors ['overloads_definitions.py:81:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).'] Line 117: Unexpected errors ['overloads_definitions.py:117:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).'] Line 215: Unexpected errors ['overloads_definitions.py:215:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).'] """ @@ -22,8 +18,6 @@ overloads_definitions.py:28:0 Missing overload implementation [42]: Overloaded f overloads_definitions.py:40:4 Missing overload implementation [42]: Overloaded function `MyProto.func3` must have an implementation. overloads_definitions.py:49:4 Missing overload implementation [42]: Overloaded function `MyAbstractBase.func4` must have an implementation. overloads_definitions.py:59:4 Missing overload implementation [42]: Overloaded function `MyAbstractBase.not_abstract` must have an implementation. -overloads_definitions.py:73:4 Incompatible overload [43]: The implementation of `C.func5` does not accept all possible arguments of overload defined on line `73`. -overloads_definitions.py:78:4 Incompatible overload [43]: The implementation of `C.func5` does not accept all possible arguments of overload defined on line `78`. overloads_definitions.py:81:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s). overloads_definitions.py:90:4 Incompatible overload [43]: The implementation of `C.func6` does not accept all possible arguments of overload defined on line `90`. overloads_definitions.py:90:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s). diff --git a/conformance/results/pyre/version.toml b/conformance/results/pyre/version.toml index e9c0c954d..cd0a5eb7e 100644 --- a/conformance/results/pyre/version.toml +++ b/conformance/results/pyre/version.toml @@ -1,2 +1,2 @@ version = "pyre 0.9.23" -test_duration = 9.0 +test_duration = 9.8 diff --git a/conformance/results/pyright/aliases_typealiastype.toml b/conformance/results/pyright/aliases_typealiastype.toml index 610c1a96b..732bebde1 100644 --- a/conformance/results/pyright/aliases_typealiastype.toml +++ b/conformance/results/pyright/aliases_typealiastype.toml @@ -1,4 +1,7 @@ -conformant = "Pass" +conformant = "Partial" +notes = """ +Incorrectly allows undefined self reference. +""" output = """ aliases_typealiastype.py:32:18 - error: Cannot access attribute "other_attrib" for class "TypeAliasType"   Attribute "other_attrib" is unknown (reportAttributeAccessIssue) @@ -29,6 +32,7 @@ aliases_typealiastype.py:62:42 - error: Expected class but received "Literal[1]" aliases_typealiastype.py:63:42 - error: Binary operator not allowed in type expression (reportInvalidTypeForm) aliases_typealiastype.py:64:42 - error: Type expressions cannot use format string literals (f-strings) (reportGeneralTypeIssues) """ -conformance_automated = "Pass" +conformance_automated = "Fail" errors_diff = """ +Line 66: Expected 1 errors """ diff --git a/conformance/results/pyright/generics_type_erasure.toml b/conformance/results/pyright/generics_type_erasure.toml index cbbc0d1c6..0cddc4876 100644 --- a/conformance/results/pyright/generics_type_erasure.toml +++ b/conformance/results/pyright/generics_type_erasure.toml @@ -1,4 +1,7 @@ -conformant = "Pass" +conformant = "Partial" +notes = """ +Missing error regarding `type(instance).generic_attribute`. +""" output = """ generics_type_erasure.py:38:16 - error: Argument of type "Literal['']" cannot be assigned to parameter "label" of type "int | None" in function "__init__"   Type "Literal['']" is not assignable to type "int | None" @@ -12,8 +15,8 @@ generics_type_erasure.py:42:11 - error: Access to generic instance variable thro generics_type_erasure.py:43:11 - error: Access to generic instance variable through class is ambiguous (reportGeneralTypeIssues) generics_type_erasure.py:44:6 - error: Access to generic instance variable through class is ambiguous (reportGeneralTypeIssues) generics_type_erasure.py:45:6 - error: Access to generic instance variable through class is ambiguous (reportGeneralTypeIssues) -generics_type_erasure.py:46:10 - error: Access to generic instance variable through class is ambiguous (reportGeneralTypeIssues) """ -conformance_automated = "Pass" +conformance_automated = "Fail" errors_diff = """ +Line 46: Expected 1 errors """ diff --git a/conformance/results/pyright/version.toml b/conformance/results/pyright/version.toml index 03b8b5c64..f105339d2 100644 --- a/conformance/results/pyright/version.toml +++ b/conformance/results/pyright/version.toml @@ -1,2 +1,2 @@ -version = "pyright 1.1.399" +version = "pyright 1.1.400" test_duration = 1.1 diff --git a/conformance/results/pytype/aliases_typealiastype.toml b/conformance/results/pytype/aliases_typealiastype.toml index a9d4ad6b4..da0105cf4 100644 --- a/conformance/results/pytype/aliases_typealiastype.toml +++ b/conformance/results/pytype/aliases_typealiastype.toml @@ -18,40 +18,35 @@ aliases_typealiastype.py:16:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in GoodAlias1 = TypeAliasType("GoodAlias1", int) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -aliases_typealiastype.py:19:51: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Name 'GoodAlias4' is not defined [name-error] +aliases_typealiastype.py:19:42: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : unsupported operand type(s) for |: 'T: TypeVar' and ''list[GoodAlias4[T]]': str' [unsupported-operands] -GoodAlias4 = TypeAliasType("GoodAlias4", T | list[GoodAlias4[T]], type_params=(T,)) - \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m +GoodAlias4 = TypeAliasType("GoodAlias4", T | "list[GoodAlias4[T]]", type_params=(T,)) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -aliases_typealiastype.py:22:40: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Name 'GoodAlias5' is not defined [name-error] +aliases_typealiastype.py:22:68: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] - Callable[P, TStr] | list[S] | list[GoodAlias5[S, TStr, P]] | tuple[*Ts], - \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + Callable[P, TStr] | list[S] | list["GoodAlias5[S, TStr, P]"] | tuple[*Ts], + \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m -aliases_typealiastype.py:22:66: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] +aliases_typealiastype.py:22:35: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] - Callable[P, TStr] | list[S] | list[GoodAlias5[S, TStr, P]] | tuple[*Ts], - \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + Callable[P, TStr] | list[S] | list["GoodAlias5[S, TStr, P]"] | tuple[*Ts], + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m aliases_typealiastype.py:32:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : No attribute 'other_attrib' on TypeAliasType [attribute-error] print(GoodAlias1.other_attrib) # E: unknown attribute \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -aliases_typealiastype.py:46:40: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Name 'BadAlias4' is not defined [name-error] +aliases_typealiastype.py:47:40: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : unsupported operand type(s) for |: 'T: TypeVar' and ''BadAlias5[str]': str' [unsupported-operands] -BadAlias4 = TypeAliasType("BadAlias4", BadAlias4) # E: circular dependency - \u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m +BadAlias5 = TypeAliasType("BadAlias5", T | "BadAlias5[str]", type_params=(T,)) # E: circular dependency + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -aliases_typealiastype.py:47:44: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Name 'BadAlias5' is not defined [name-error] +aliases_typealiastype.py:66:47: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Name 'BadAlias21' is not defined [name-error] -BadAlias5 = TypeAliasType("BadAlias5", T | BadAlias5[str], type_params=(T,)) # E: circular dependency - \u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m - -aliases_typealiastype.py:48:40: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Name 'BadAlias7' is not defined [name-error] - -BadAlias6 = TypeAliasType("BadAlias6", BadAlias7) # E: circular dependency - \u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m +BadAlias21 = TypeAliasType("BadAlias21", list[BadAlias21]) # E + \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m """ conformance_automated = "Fail" @@ -60,6 +55,8 @@ Line 40: Expected 1 errors Line 43: Expected 1 errors Line 44: Expected 1 errors Line 45: Expected 1 errors +Line 46: Expected 1 errors +Line 48: Expected 1 errors Line 52: Expected 1 errors Line 53: Expected 1 errors Line 54: Expected 1 errors @@ -76,6 +73,6 @@ Line 64: Expected 1 errors Line 5: Unexpected errors ['aliases_typealiastype.py:5:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet]'] Line 11: Unexpected errors ['aliases_typealiastype.py:11:6: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] Line 16: Unexpected errors ["aliases_typealiastype.py:16:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] -Line 19: Unexpected errors ["aliases_typealiastype.py:19:51: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Name 'GoodAlias4' is not defined [name-error]"] -Line 22: Unexpected errors ["aliases_typealiastype.py:22:40: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Name 'GoodAlias5' is not defined [name-error]", "aliases_typealiastype.py:22:66: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 19: Unexpected errors ["aliases_typealiastype.py:19:42: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : unsupported operand type(s) for |: 'T: TypeVar' and ''list[GoodAlias4[T]]': str' [unsupported-operands]"] +Line 22: Unexpected errors ["aliases_typealiastype.py:22:68: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", "aliases_typealiastype.py:22:35: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] """ diff --git a/conformance/results/pytype/overloads_definitions.toml b/conformance/results/pytype/overloads_definitions.toml index 5716f0e5b..01f5bab94 100644 --- a/conformance/results/pytype/overloads_definitions.toml +++ b/conformance/results/pytype/overloads_definitions.toml @@ -185,8 +185,8 @@ class Child(Base): # E[override-final] \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m \u001b[1m\u001b[31m\u001b[39m\u001b[0m - @override -\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + @override # E[bad_override] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m def bad_override(self, x: int | str) -> int | str: # E[bad_override] \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m ... diff --git a/conformance/results/pytype/overloads_definitions_stub.toml b/conformance/results/pytype/overloads_definitions_stub.toml index bf1399325..24d83050a 100644 --- a/conformance/results/pytype/overloads_definitions_stub.toml +++ b/conformance/results/pytype/overloads_definitions_stub.toml @@ -10,7 +10,7 @@ Lines 39, 41, 44: Expected error (tag 'func6') Lines 67, 69, 71, 73: Expected error (tag 'invalid_final') Lines 80, 82, 84, 86: Expected error (tag 'invalid_final_2') Lines 102, 107, 108, 111, 113: Expected error (tag 'override-final') -Lines 120, 122: Expected error (tag 'bad_override') +Lines 120, 121, 122: Expected error (tag 'bad_override') Lines 143, 147, 149: Expected error (tag 'override_impl') """ output = """ diff --git a/conformance/results/pytype/specialtypes_never.toml b/conformance/results/pytype/specialtypes_never.toml index be27a72ae..7a2318585 100644 --- a/conformance/results/pytype/specialtypes_never.toml +++ b/conformance/results/pytype/specialtypes_never.toml @@ -8,10 +8,11 @@ specialtypes_never.py:11:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] -Line 21: Unexpected errors ['specialtypes_never.py:21:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: bad return type [bad-return-type]'] +Line 21: Unexpected errors ['specialtypes_never.py:21:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: bad return type [bad-return-type]'] Line 68: Unexpected errors ['specialtypes_never.py:68:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func6: Type annotation for v1 does not match type of assignment [annotation-type-mismatch]'] Line 69: Unexpected errors ['specialtypes_never.py:69:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func6: Type annotation for v2 does not match type of assignment [annotation-type-mismatch]'] Line 70: Unexpected errors ['specialtypes_never.py:70:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func6: Type annotation for v3 does not match type of assignment [annotation-type-mismatch]'] diff --git a/conformance/results/pytype/version.toml b/conformance/results/pytype/version.toml index 3a84f443c..22d96d6b1 100644 --- a/conformance/results/pytype/version.toml +++ b/conformance/results/pytype/version.toml @@ -1,2 +1,2 @@ version = "pytype 2024.10.11" -test_duration = 31.3 +test_duration = 33.6 diff --git a/conformance/results/results.html b/conformance/results/results.html index dc93d81fd..c36fa49aa 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -161,14 +161,14 @@

    Python Type System Conformance Test Results

    mypy 1.15.0
    1.8sec
    pyright 1.1.399
    +
    pyright 1.1.400
    1.1sec
    pyre 0.9.23
    -
    9.0sec
    +
    9.8sec
    pytype 2024.10.11
    -
    31.3sec
    +
    33.6sec
    @@ -356,7 +356,7 @@

    Python Type System Conformance Test Results

         generics_type_erasure
    Partial

    Infers Node[Never] instead of Node[Any] when argument is not provided.

    False negative on instance attribute access on type(node).

    Pass
    Partial

    no error for `type(n1).label`

    Partial

    Does not erase unspecified type variables to `Any` prior to `assert_type` handling.

    False negatives on instance attribute access on the type.

    Does not infer type of `DefaultDict` with explicit type parameters on constructor.

    False negatives on assert_type uses.

    Unsupported
         aliases_typealiastype
    Partial

    Incorrectly rejects some recursive type aliases using TypeAliasType.

    Incorrectly rejects the use of a class-scoped TypeVar in a TypeAliasType definition.

    Pass
    Partial

    incorrectly allows undefined self reference

    Unsupported

    Support for TypeAliasType is not implemented.

    Unsupported

    Support for TypeAliasType is not implemented.

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     
    mypy 1.15.0
    -
    1.8sec
    +
    1.5sec
    pyright 1.1.400
    1.1sec
    pyre 0.9.23
    -
    9.8sec
    -
    pytype 2024.10.11
    -
    33.6sec
    +
    10.7sec
    +
    Type annotations
         annotations_coroutines Pass Pass PassPass
         annotations_forward_refs
    Partial

    Does not report error for a forward reference that is not enclosed in quotes.

    Does not report error for use of quoted type with "|" operator (runtime error).

    Incorrectly generates error for quoted type defined in class scope.

    Pass
    Partial

    Does not report error for a forward reference that is not enclosed in quotes.

    Does not report error for use of quoted type with "|" operator (runtime error).

    Does not reject f-string in quoted type annotation.

    Incorrectly generates error for quoted type defined in class scope.

    Does not generate error for unquoted type defined in class scope.

    Does not treat triple-quoted forward reference annotation as implicitly parenthesized.

    Partial

    Does not reject some illegal type expression forms when quoted.

    Incorrectly generates error for quoted type defined in class scope.

    Evaluates incorrect type for class variable annotated with quoted type expression.

    Does not treat triple-quoted forward reference annotation as implicitly parenthesized.

         annotations_generators
    Partial

    Does not report incompatible Generator type in `yield from` statement.

    Pass
    Partial

    Does not report invalid return type for generator when function implicitly returns None.

    Incorrectly evaluates type of call to async generator.

    Partial

    Does not report invalid return type for generator when function implicitly returns None.

    Reports invalid error when return type of generator is annotated as a compatible protocol.

    Does not report type violation in `yield from` statement.

         annotations_methods
    Pass*

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

    Pass*

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

    Pass*

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

    Pass*

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

         annotations_typeexpr Pass Pass Pass
    Partial

    Does not reject call expressions in type annotation.

    Does not reject call lambda expression in type annotation.

    Does not reject list expression in type annotation.

    Does not reject ternary expression in type annotation.

    Does not reject f-string in type annotation.

    Does not reject module in type annotation.

    +
    Special types in annotations
         specialtypes_any Pass Pass PassPass
         specialtypes_never Pass Pass
    Partial

    Does not treat Never as compatible with all other types.

    Unsupported

    Does not understand NoReturn or Never.

         specialtypes_none Pass Pass Pass
    Partial

    Does not detect type incompatibility between None and type[None].

    Does not detect type incompatibility between None and incompatible protocol.

         specialtypes_promotions Pass Pass
    Partial

    Does not reject use of attribute that is compatible only with float.

    Pass
         specialtypes_type
    Partial

    Does not treat `type` same as `type[Any]` for assert_type.

    Does not allow access to unknown attributes from object of type `type[Any]`.

    Pass
    Partial

    Does not reject Callable when passed to type[T].

    Does not treat `type` same as `type[Any]` for assert_type.

    Does not allow access to unknown attributes from object of type `type[Any]`.

    Does not reject access to unknown attributes from object of type `Type[object]`.

    Reports type incompatibility between `type` and `Callable[..., Any]`.

    Partial

    Does not reject Callable when passed to type[T].

    Does not allow access to known attributes from object of type `type[Any]`.

    +
    Generics
         generics_base_class
    Partial

    Does not detect inconsistent type variable ordering.

    Pass
    Partial

    Does not reject illegal use of Generic.

    Does not allow using generic in assert_type expression.

    Does not detect inconsistent type variable ordering.

    Partial

    False negative on passing SymbolTable to dict[str, list[object]].

    Does not reject illegal use of Generic.

    Wrong type variable order when inheriting from multiple generic base classes.

         generics_basic Pass Pass
    Partial

    False positives in examples using constrained type variables.

    False negative for constraint parameterized by a type variable.

    False negative in custom map example.

    False positive using `iter`.

    False negative for bad type arguments to Generic/Protocol.

    False negative for generic metaclass.

    Partial

    False positives in examples using constrained type variables.

    Argument 'covariant' to TypeVar not supported.

    False negative for type variables missing from Generic/Protocol base class.

    False negative for generic metaclass.

         generics_defaults Partial Pass
    Unsupported

    Does not support generic defaults.

    Unsupported
         generics_defaults_referential Partial Pass UnsupportedUnsupported
         generics_defaults_specialization Partial Pass
    Unsupported

    Does not support generic defaults.

    Unsupported
         generics_paramspec_basic Pass Pass
    Partial

    Does not enforce name consistency for ParamSpec assigned to identifier.

    Incorrectly reports error for legitimate use of ParamSpec in generic type alias.

    Does not reject ParamSpec when used in various invalid locations.

    Unsupported

    Does not support ParamSpec.

         generics_paramspec_components Pass Pass
    Partial

    Does not report illegal use of "P.args" on normal parameter.

    Does not report error when P.args is specified but P.kwargs is missing.

    Does not report error when P is out of scope and P.args and P.kwargs is used.

    Does not report error when calling callback defined with ParamSpec with incorrect arguments.

    Does not report error when keyword argument is specified between P.args and P.kwargs.

    Does not report error when calling callable and argument is missing for concatenated parameters.

    Unsupported

    Does not support ParamSpec.

         generics_paramspec_semantics Pass
    Pass*

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

    Pass
    Unsupported

    Does not support ParamSpec.

         generics_paramspec_specialization Pass Pass
    Partial

    Reports error for legitimate use of `...` to specialize ParamSpec

    Partial

    Rejects valid specialization of ParamSpec using list expression.

    Does not reject invalid specialization of class with both TypeVar and ParamSpec.

    Reports error for valid method call involving ParamSpec.

         generics_scoping
    Partial

    False negative on generic class nested within generic class with same type variable.

    Pass
    Partial

    False negative on generic class nested within generic function with same type variable.

    False negative on generic class nested within generic class with same type variable.

    False negative on assert_type uses.

    Partial

    Fails to reject type alias within generic class that uses class's type variable.

    Fails to reject unbound type variable in constructor call in global scope.

         generics_self_advanced
    Partial

    Does not infer the type of an unannotated `self` parameter to be type `Self`.

    Does not retain `Self` when calling method that returns `Self`.

    Does not infer the type of an unannotated `cls` parameter to be type `type[Self]`.

    Does not retain `Self` when accessing attribute through `type[Self]`.

    Pass
    Partial

    Does not handle use of `Self` within class body correctly.

    False negatives on assert_type uses.

    Unsupported

    Does not understand `Self` type.

         generics_self_attributes Pass Pass
    Unsupported

    Does not understand `Self` type.

    Unsupported

    Does not understand `Self` type.

         generics_self_basic Pass Pass
    Partial

    Does not handle use of `Self` as a generic type.

    Unsupported

    Does not understand `Self` type.

         generics_self_protocols Pass Pass
    Partial

    Does not reject protocol compatibility due to method `Self` return type.

    Partial

    Does not reject protocol compatibility due to method `Self` return type.

         generics_self_usage Pass Pass
    Partial

    Complains in some cases when `self: Self` is used explicitly.

    Does not complain when `Self` is used on a function outside any class definition.

    Does not complain when `self` is annotated explicitly (without `Self`) and `Self` is returned.

    Does not complain on inheritance involving `Self`.

    Does not complain on use of `Self` in static methods.

    Does not complain on use of `Self` in metaclasses.

    Unsupported

    Does not understand `Self` type.

         generics_syntax_compatibility Pass Pass
    Partial

    False negative on mixing legacy and PEP695 syntax.

    Does not detect mixing legacy and PEP695 syntax in methods.

    Unsupported

    Type parameter syntax not yet support.

         generics_syntax_declarations Pass Pass
    Partial

    Does not detect incorrect use of legacy style syntax mixed with PEP695 syntax.

    False negatives due to assert_type use.

    Unsupported

    Type parameter syntax not yet support.

         generics_syntax_infer_variance
    Unsupported

    Type parameter syntax not yet support.

    Pass
    Partial

    Incorrectly determines that a class cannot be instantiated with __getitem__.

    Incorrectly handles mixing legacy and PEP695 syntax.

    Unsupported

    Type parameter syntax not yet support.

         generics_syntax_scoping
    Partial

    Does not following runtime scoping rules for type parameters in all cases.

    Pass
    Partial

    Does not properly handle mixing legacy syntax with PEP695 syntax.

    Unsupported

    Type parameter syntax not yet support.

         generics_type_erasure
    Partial

    Infers Node[Never] instead of Node[Any] when argument is not provided.

    False negative on instance attribute access on type(node).

    Partial

    no error for `type(n1).label`

    Partial

    Missing error regarding `type(instance).generic_attribute`.

    Partial

    Does not erase unspecified type variables to `Any` prior to `assert_type` handling.

    False negatives on instance attribute access on the type.

    Does not infer type of `DefaultDict` with explicit type parameters on constructor.

    False negatives on assert_type uses.

    Unsupported
         generics_typevartuple_args
    Partial

    Does not enforce that tuples captured by TypeVarTuple are same type.

    Pass
    Partial

    Does not property handle TypeVarTuple.

    Unsupported

    Does not support TypeVarTuple.

         generics_typevartuple_basic
    Partial

    Does not enforce that tuples captured by TypeVarTuple are same length.

    Does not enforce that tuples captured by TypeVarTuple are same type.

    Pass
    Partial

    Does not support TypeVarTuple.

    False negatives due to assert_type.

    Unsupported

    Does not support TypeVarTuple.

         generics_typevartuple_callable Pass Pass
    Partial

    False negatives due to assert_type.

    Unsupported

    Does not support TypeVarTuple.

         generics_typevartuple_concat Pass Pass
    Partial

    False negatives due to assert_type.

    False compatability error message.

    Unsupported

    Does not support TypeVarTuple.

         generics_typevartuple_overloads Pass Pass
    Unsupported

    Does not support star expressions for `Unpack`.

    Unsupported

    Does not support TypeVarTuple.

         generics_typevartuple_specialization
    Partial

    Incorrectly specializes generic alias that includes a TypeVar and TypeVarTuple if no type arguments are provided.

    Rejects specialization of generic type alias defined as a tuple containing a TypeVar.

    "More than one Unpack" error message has no line number.

    Pass
    Unsupported

    Does not support star expressions for `Unpack`.

    Unsupported

    Does not support TypeVarTuple.

         generics_typevartuple_unpack Pass Pass Pass
    Unsupported

    Does not support TypeVarTuple.

         generics_upper_bound
    Partial

    Does not reject use of type variable within an upper bound.

    Pass
    Partial

    False positives on valid type expression (`list[T]`) in `bound`.

    Does not complain when bound is used alongside type constraints.

    Partial

    Does not properly support assert_type.

         generics_variance
    Partial

    Does not reject use of class-scoped TypeVar used in a base class when variance is incompatible.

    Pass
    Partial

    Does not reject a TypeVar that is defined as both covariant and contravariant.

    Does not reject use of class-scoped TypeVar used in a base class when variance is incompatible.

    Unsupported

    Does not support covariant or contravariant TypeVars.

         generics_variance_inference Pass Pass
    Partial

    Does not properly handle mixing legacy and PEP695 syntax.

    False negative about a type variable not being present in the function's parameters.

    Unsupported

    Type parameter syntax not yet support.

    +
    Type qualifiers
         qualifiers_annotated
    Partial

    Does not allow ClassVar to be nested within Annotated.

    Does not allow Final to be nested within Annotated.

    Does not allow Required and NotRequired to be nested within Annotated.

    Does not reject type[T] compatibility for type alias defined with Annotated.

    Does not reject call of type alias defined with Annotated.

    Pass
    Partial

    Does not reject Annotated with a single parameter.

    Does not reject call of Annotated with no type arguments.

    Partial

    Does not reject some illegal type expression forms used in Annotated.

    Does not report type incompatibility between Annotated and type[T].

    Does not reject call of Annotated.

    Does not allow TypeVar to be used in type alias when wrapped with Annotated.

         qualifiers_final_annotation
    Partial

    Does not treat use of Final name as if it was replaced by the literal in NamedTuple definition.

    Does not allow conditional assignment of Final instance variable in __init__ method.

    Does not allow redefinition of private class variable that is marked Final in parent class.

    Does not report modification of local Final variable via "for" statement.

    Pass
    Partial

    Does not report Final variable with missing initialization in module scope.

    Does not report error for invalid nesting of Final and ClassVar.

    Does not treat use of Final name as if it was replaced by the literal in NamedTuple definition.

    Does not reject modification of imported variable declared Final.

    Partial

    Does not report Final variable with missing initialization.

    Does not reject Final instance variable declared outside of __init__ method.

    Does not reject modification of global variable declared Final.

    Does not reject modification of local variable declared Final.

    Does not reject modification of imported variable declared Final.

         qualifiers_final_decorator Pass Pass
    Partial

    Reports error for overloaded method implementation marked @final if its overloads do not.

    Does not report error for overloaded @final method defined in stub file.

    Reports misleading error when overload is marked @final but implementation is not.

    Partial

    Does not report error for overloaded @final method defined in stub file.

    Does not report error for overload that is marked @final when implementation is not.

    +
    Class type compatibility
         classes_classvar
    Partial

    Internal error if TypeVarTuple is used in ClassVar.

    Does not reject use of ParamSpec in ClassVar.

    Rejects ClassVar nested in Annotated.

    Does not reject use of ClassVar in TypeAlias definition.

    Pass
    Partial

    Does not reject use of TypeVar in ClassVar.

    Does not reject use of ParamSpec in ClassVar.

    Does not reject use of ClassVar as a generic type argument.

    Does not reject use of ClassVar in parameter type annotation.

    Does not reject use of ClassVar in local variable annotation.

    Does not reject use of ClassVar in instance variable annotation.

    Does not reject use of ClassVar in return type annotation.

    Does not reject use of ClassVar in type alias definition.

    Does not infer type from initialization for bare ClassVar.

    Partial

    Does not reject use of TypeVar in ClassVar.

    Does not reject use of ParamSpec in ClassVar.

    Does not reject use of ClassVar as a generic type argument.

    Rejects initialization of ClassVar if no type argument is provided.

    Does not infer ClassVar with no type argument and no assigned value as Any.

    Does not reject use of ClassVar in parameter type annotation.

    Does not reject use of ClassVar in local variable annotation.

    Does not reject use of ClassVar in instance variable annotation.

    Does not reject use of ClassVar in return type annotation.

    Does not reject use of ClassVar in type alias definition.

    Does not reject assignment of ClassVar through instance of class.

         classes_override
    Partial

    Does not handle case where parent class derives from Any.

    Pass Pass
    Unsupported

    Does not yet support the @override decorator.

    +
    Type aliases
         aliases_explicit
    Partial

    Does not reject specialization of type alias that has already been implicitly specialized.

    Pass
    Partial

    Incorrectly reports error for type alias defined with ParamSpec.

    Incorrectly rejects some valid type aliases when used in annotations.

    Incorrectly evaluates generic type alias with ParamSpec with missing type argument.

    Does not report some illegal annotation forms as invalid type aliases.

    Does not report invalid specialization of generic type aliases.

    Incorrectly rejects import alias of `TypeAlias` when used to define type alias.

    Does not report invalid specialization of already-specialized generic type alias.

    Partial

    Incorrectly reports error for type alias defined with ParamSpec.

    Does not report invalid specialization of generic type alias with bound TypeVar.

    Incorrectly evaluates generic type alias with ParamSpec with missing type argument.

    Does not report some illegal annotation forms as invalid type aliases.

    Does not report invalid specialization of already-specialized generic type alias.

         aliases_implicit Pass Pass
    Partial

    Incorrectly reports error for type alias defined with ParamSpec.

    Incorrectly rejects some valid type aliases when used in annotations.

    Incorrectly evaluates generic type alias with ParamSpec with missing type argument.

    Does not report invalid specialization of generic type aliases.

    Does not report error for attempt to instantiate union type alias.

    Does not report invalid specialization of already-specialized generic type alias.

    Partial

    Incorrectly reports error for type alias defined with ParamSpec.

    Does not report invalid specialization of generic type alias with bound TypeVar.

    Incorrectly evaluates generic type alias with ParamSpec with missing type argument.

    Allows some illegal annotation forms to be interpreted as valid type aliases.

    Does not report invalid specialization of already-specialized generic type alias.

         aliases_newtype Pass Pass
    Partial

    Does not reject use of NewType in `isinstance` call.

    Does not reject use of NewType in class definition statement.

    Does not report inconsistency between name of NewType and assigned identifier name.

    Does not reject use of NewType with generic class with TypeVar.

    Does not reject use of NewType with protocol class.

    Does not reject use of NewType with TypedDict class.

    Does not reject use of NewType with Any.

    Partial

    Does not reject use of NewType in `isinstance` call.

    Does not reject use of NewType in class definition statement.

    Does not report inconsistency between name of NewType and assigned identifier name.

    Does not reject use of NewType with generic class with TypeVar.

    Does not reject use of NewType with protocol class.

    Does not reject use of NewType with TypedDict class.

    Does not reject use of NewType with Any.

         aliases_recursive Pass Pass
    Partial

    Does not properly handle some recursive type aliases.

    Does not properly handle specialization of generic recursive type aliases.

    Partial

    Does not detect type violation for some deeply-nested types.

    Does not properly handle `|` for unions in some recursive type alias definitions.

    Does not detect cyclical references in recursive type alias definition.

         aliases_type_statement
    Partial

    Does not reject type alias defined in function scope.

    Pass
    Partial

    Does not complain when a type alias cannot be used as a base class.

    Does not complain when a type alias cannot be used as a function.

    Does not complain when a type statement definition combines new and old TypeVars.

    Does not complain when a type statement definition uses old TypeVars.

    Does not properly support recursive aliases.

    Unsupported

    Does not support `type` statement.

         aliases_typealiastype
    Partial

    Incorrectly rejects some recursive type aliases using TypeAliasType.

    Incorrectly rejects the use of a class-scoped TypeVar in a TypeAliasType definition.

    Partial

    incorrectly allows undefined self reference

    Unsupported

    Support for TypeAliasType is not implemented.

    Partial

    Incorrectly allows undefined self reference.

    Unsupported

    Support for TypeAliasType is not implemented.

         aliases_variance Pass Pass Pass
    Unsupported

    Does not detect variance incompatibility.

    +
    Literals
         literals_interactions
    Partial

    Does not narrow type of `x` with `x in Literal` type guard pattern.

    Pass
    Partial

    Does not detect out-of-bound tuple literal index.

    Does not perform exhaustiveness checks on enums.

    Does not narrow type of `x` with `x in Literal` type guard pattern.

    Does not narrow type of `x` with `x == Literal` type guard pattern.

    Partial

    Incorrectly rejects some legal Literal annotations.

    Does not reject some illegal Literal annotations.

    Does not use Literal to distinguish overloads.

    Does not narrow based on `x is Literal` type guard pattern.

    Does not narrow based on `x == Literal` type guard pattern.

         literals_literalstring
    Unsupported

    Support for `LiteralString` is not implemented.

    Pass
    Partial

    Incorrectly infers `str` rather than `LiteralString` when literal string `join` is used.

    Unsupported

    Does not understand `LiteralString` special form.

         literals_parameterizations
    Partial

    Does not reject tuple within Literal.

    Pass
    Partial

    Does not support type aliases in Literal type expression.

    Does not support nested Literal type expression.

    Does not reject tuple in Literal type expression.

    Does not reject "bare" Literal in type expression.

    Unsupported

    Does not understand `Literal` type annotation.

         literals_semantics Pass Pass Pass
    Unsupported

    Does not understand `Literal` type annotation.

    +
    Protocols
         protocols_class_objects Pass Pass
    Partial

    Does not reject protocol class assigned to type[Proto].

    Incorrectly reports some class objects as incompatible with a protocol.

    Fails to report some class objects as incompatible with a protocol.

    Partial

    Does not reject protocol class assigned to type[Proto].

    Incorrectly reports some class objects as incompatible with a protocol.

    Fails to report some class objects as incompatible with a protocol.

         protocols_definition
    Partial

    Does not detect protocol mismatch if concrete method is missing annotations.

    Does not detect protocol mismatch if concrete method's parameters are position-only.

    Pass
    Partial

    Does not reject ClassVar in concrete class when attribute in protocol is not ClassVar or vice versa.

    Does not reject read-only property in concrete class when attribute in protocol is mutable.

    Does not reject covariant attribute type when protocol attribute is mutable.

    Does not reject read-only property in concrete class when protocol has settable property.

    Does not reject immutable named tuple attribute in concrete class when protocol attribute is mutable.

    Does not reject immutable frozen dataclass attribute in concrete class when protocol attribute is mutable.

    Partial

    Reports errors for protocol static method with "..." implementation.

    Does not report error when instance variable is set through "self" access in protocol class.

    Does not report protocol mismatch when concrete class has attribute with covariant type and protocol attribute is mutable.

    Does not reject ClassVar in concrete class when attribute in protocol is not ClassVar.

    Does not reject read-only property in concrete class when attribute in protocol is mutable.

    Does not reject covariant attribute type when protocol attribute is mutable.

    Does not detect protocol mismatch if concrete method is missing annotations.

    Does not detect protocol mismatch if concrete method's parameters are keyword-only.

    Does not detect protocol mismatch if concrete method's parameters are position-only.

    Does not detect protocol mismatch if concrete method is a classmethod.

    Does not detect protocol mismatch if concrete method is a staticmethod.

    Does not reject read-only property in concrete class when protocol has settable property.

    Does not reject immutable named tuple attribute in concrete class when protocol attribute is mutable.

    Does not reject immutable frozen dataclass attribute in concrete class when protocol attribute is mutable.

         protocols_explicit
    Pass*

    Does not report unimplemented attributes for class that explicitly derives from protocol until it is instantiated.

    Pass
    Partial

    Does not report error when calling unimplemented protocol method from derived class.

    Does not report error when method is not implemented in derived class.

    Partial

    Reports errors for protocol static method with "..." implementation.

    Does not report error when calling unimplemented protocol method from derived class.

    Does not report type incompatibility when assigning to attribute defined in protocol.

    Does not reject instantiation of class that derives from protocol but doesn't implement attribute.

    Does not report instantiation of class that derives from protocol but doesn't implement method.

         protocols_generic Pass Pass
    Partial

    Does not reject the use of Protocol and Generic together as base classes.

    Does not detect protocol mismatch when method-scoped TypeVar is used in protocol.

    Partial

    Does not correctly enforce contravariance in protocol type compatibility tests.

    Does not correctly enforce invariance in protocol type compatibility tests.

    Does not detect protocol mismatch when method-scoped TypeVar is used in protocol.

         protocols_merging Pass Pass Pass
    Partial

    Does not reject a protocol class that derives from a non-protocol class.

    Does not report attempt to instantiate abstract class downgraded from protocol class.

         protocols_modules Pass Pass
    Unsupported

    Does not perform protocol checks for modules.

    Partial

    Does not report incompatibilities for protocol methods.

         protocols_recursive Pass Pass Pass
    Partial

    Incorrectly reports type error for some recursive protocols.

         protocols_runtime_checkable
    Partial

    Does not report unsafe overlap for runtime_checkable protocol.

    Pass
    Unsupported

    Does not reject isinstance or issubclass call for protocol that is not runtime_checkable.

    Does not reject issubclass call for data protocol.

    Does not report unsafe overlap for runtime_checkable protocol.

    Unsupported

    Does not reject isinstance or issubclass call for protocol that is not runtime_checkable.

    Does not reject issubclass call for data protocol.

    Does not report unsafe overlap for runtime_checkable protocol.

         protocols_self Pass Pass Pass
    Partial

    Does not properly handle Self type within a protocol.

         protocols_subtyping Pass Pass Pass
    Partial

    Does not reject attempt to instantiate protocol class.

    Does not report some protocol type compatibility violations involving contravariance.

         protocols_variance Pass Pass
    Unsupported

    Does not detect incorrect TypeVar variance within generic protocols.

    Unsupported

    Does not detect incorrect TypeVar variance within generic protocols.

    +
    Callables
         callables_annotation
    Partial

    Incorrectly treats "*args: T, **kwargs: T" as "..." when T is specialized to Any.

    Does not treat "*args: Any, **kargs: Any" as "..." when separated by keyword parameter.

    Pass
    Partial

    Does not evaluate correct type for `*args: int` parameter.

    Does not correctly implement type compatibility rules for "...".

    Does not treat "*args: Any, **kwargs: Any" as "...".

    Partial

    Does not support Concatenate.

    Does not treat "*args: Any, **kwargs: Any" as "...".

         callables_kwargs
    Partial

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

    Pass Pass
    Unsupported

    Does not understand Unpack in the context of **kwargs annotation.

         callables_protocol Pass Pass
    Partial

    Does not correctly handle callback protocol that declares attributes in all functions.

    Does not report type incompatibility for callback protocol with positional-only parameters.

    Incorrectly reports type compatibility error with callback that has *args and **kwargs.

    Does not report type incompatibility for callback missing a default argument for positional parameter.

    Does not report type incompatibility for callback missing a default argument for keyword parameter.

    Unsupported

    Does not properly handle type compatibility checks with callback protocols.

         callables_subtyping Pass Pass
    Partial

    Rejects standard parameter as incompatible with keyword-only parameter.

    Rejects use of Callable with ParamSpec in TypeAlias definition.

    Partial

    Does not detect many subtyping rule violations for callables.

    Does not correctly handle type alias parameterized by ParamSpec.

    +
    Constructors
         constructors_call_init
    Partial

    Does not report errors during binding to self parameter of __init__ method.

    Does not reject use of class-scoped type variables in annotation of self parameter in __init__ method.

    Pass
    Partial

    Does not infer type of Self for self parameter of __init__ method.

    Does not report errors during binding to self parameter of __init__ method.

    Does not reject use of class-scoped type variables in annotation of self parameter in __init__ method.

    Incorrectly raises Incompatible overload type errors.

    Incorrectly raises compatibility type errors.

    Partial

    Does not report errors during binding to self parameter of __init__ method.

    Does not infer type of Self for self parameter of __init__ method.

    Rejects valid type annotation for self parameter in __init__ method.

    Does not support function-scoped TypeVars in self annotation in __init__ method.

    Does not reject use of class-scoped type variables in annotation of self parameter in __init__ method.

         constructors_call_metaclass
    Unupported

    Does not honor metaclass __call__ method when evaluating constructor call.

    Does not skip evaluation of __new__ and __init__ if custom metaclass call returns non-class.

    Pass
    Partial

    Does not evaluate __new__ if metaclass __call__ is defined.

    Unupported

    Does not honor metaclass __call__ method when evaluating constructor call.

         constructors_call_new
    Partial

    Does not support __new__ return type that is not a subclass of the class being constructed.

    Does not skip evaluation of __init__ based on __new__ return type.

    Does not report errors during binding to cls parameter of __new__ method.

    Pass
    Partial

    Does not support __new__ return type that is not a subclass of the class being constructed.

    Does not report errors during binding to cls parameter of __new__ method.

    Incorrectly raises compatibility type errors.

    Partial

    Does not honor explicit specialization of generic class when used in constructor call.

    Does not support __new__ return type that is not a subclass of the class being constructed.

    Does not skip evaluation of __init__ based on __new__ return type.

         constructors_call_type
    Partial

    Does not validate call to custom metaclass __call__ method through type[T].

    Pass Pass
    Partial

    Does not validate call to custom metaclass __call__ method through type[T].

         constructors_callable
    Partial

    Does not generate a union type for __new__ and __init__ when converting class to callable.

    Does not ignore __init__ based on __new__ return type when converting class to callable.

    Does not support __new__ return type that is different from class being constructed.

    Pass
    Partial

    Does not generate a union type for __new__ and __init__ when converting class to callable.

    Does not ignore __init__ based on __new__ return type when converting class to callable.

    Does not support __new__ return type that is different from class being constructed.

    Does not use annotated type of self in __init__ method to generate return type of callable.

    Incorrectly raises incompatibility type errors.

    Partial

    Does not generate a union type for __new__ and __init__ when converting class to callable.

    Does not ignore __init__ based on __new__ return type when converting class to callable.

    Does not support __new__ return type that is different from class being constructed.

    Does not use annotated type of self in __init__ method to generate return type of callable.

         constructors_consistency
    Pass*

    Does not report inconsistency between __new__ and __init__ (optional).

    Pass
    Pass*

    Does not report inconsistency between __new__ and __init__ (optional).

    Pass*

    Does not report inconsistency between __new__ and __init__ (optional).

    +
    Overloads
         overloads_basic Pass Pass PassPartial
         overloads_consistency Pass Pass
    Partial

    Does not apply decorator transforms before checking overload consistency.

    Fail

    Doesn't appear to validate overload consistency at all.

         overloads_definitions
    Partial

    Does not allow an overload with no implementation in an abstract base class.

    Allows @override to be on all overloads and implementation, instead of just implementation.

    Pass
    Partial

    Does not allow an overload with no implementation in a Protocol or an abstract base class.

    Expects @final/@override on all overloads and implementation, instead of implementation only.

    Fail

    Does not reject a function with a single @overload signature.

    Does not reject a function with @overload signature but no implementation.

    Does not allow an overload with no implementation in a Protocol or an abstract base class.

    Does not error on overloads inconsistently decorated with `@staticmethod` or `@classmethod`.

    Does not enforce any rules on location of @final or @override decorators.

         overloads_definitions_stub
    Partial

    Allows @override to appear in a stub file not on the first overload.

    Pass
    Partial

    Expects @final and @override to be present on all overloads, not just first.

    Fail

    Does not enforce any of the specified rules regarding overload definitions.

         overloads_evaluation
    Partial

    Does not expand boolean arguments to Literal[True] and Literal[False].

    Does not expand enum arguments to literal variants.

    Does not expand tuple arguments to possible combinations.

    Does not evaluate Any in some cases where overload is ambiguous.

    Evaluates Any in some cases where overload is not ambiguous.

    Partial

    Does not evaluate Any in some cases where overload is ambiguous.

    Partial

    Does not expand boolean arguments to Literal[True] and Literal[False].

    Does not expand enum arguments to literal variants.

    Does not expand type[A | B] to type[A] and type[B].

    Does not expand tuple arguments to possible combinations.

    Does not prefer variadic match to indeterminate-length unpacked argument.

    Does not treat multiple matches due to gradual types as ambiguous.

    Partial

    Does not perform argument expansion (on any types) when matching overloads.

    Does not treat multiple matches due to gradual types as ambiguous.

    Does not prefer variadic match to indeterminate-length unpacked argument.

    +
    Exceptions
         exceptions_context_managers Pass Pass
    Partial

    assert_type causes failures.

    Unsupported

    Does not support code flow analysis.

    +
    Dataclasses
         dataclasses_descriptors
    Partial

    Does not correctly evaluate type of descriptor access.

    Pass
    Partial

    Incorrectly generates error when calling constructor of dataclass with descriptor.

    Incorrectly raises incompatibility type errors.

    Unsupported

    Does not understand descriptor objects in dataclass.

         dataclasses_final
    Partial

    Wrongly requires a Final dataclass field to be initialized at class level.

    Doesn't support Final nested inside ClassVar.

    Pass Pass
    Partial

    Doesn't handle Final nested inside ClassVar.

         dataclasses_frozen Pass Pass Pass
    Unsupported

    Does not report assignment to field within frozen dataclass instance.

    Does not reject frozen dataclass inherited from non-frozen dataclass.

    Does not reject non-frozen dataclass inherited from frozen dataclass.

         dataclasses_hash
    Partial

    Does not report when dataclass is not compatible with Hashable protocol.

    Pass
    Partial

    Does not report when dataclass is not compatible with Hashable protocol.

    Partial

    Does not report when dataclass is not compatible with Hashable protocol.

         dataclasses_inheritance Pass Pass
    Partial

    Does not reject ClassVar that is overridden by instance variable.

    Does not reject instance variable that is overridden by ClassVar.

    Partial

    Does not reject ClassVar that is overridden by instance variable.

    Does not reject instance variable that is overridden by ClassVar.

         dataclasses_kwonly
    Partial

    Incorrectly rejects kw_only field with default before positional field.

    Pass
    Partial

    Rejects legitimate use of dataclass field with `kw_only=True`.

    Partial

    Incorrectly reports error when kw_only field has default value.

    Incorrectly rejects kw_only field with default before positional field.

         dataclasses_order Pass Pass Pass
    Partial

    Does not report type incompatibility with comparison operator.

         dataclasses_postinit Pass Pass
    Partial

    Does not perform validation of `__post_init__` method.

    Incorrectly complains on the assignment of `InitVar` in class bodies.

    Partial

    Does not validate `__post_init__` method.

    Reports incorrect error for incompatible `__post_init__` method override.

         dataclasses_slots
    Partial

    Does not reject write to instance variable that is not defined in __slots__.

    Pass
    Partial

    Does not report error when `slots=True` is used with `__slots__` definition.

    Does not reject write to instance variable that is not defined in __slots__.

    Does not reject access to `__slots__` from dataclass instance when `slots=False`.

    Partial

    Does not report error when `slots=True` is used with `__slots__` definition.

    Does not reject write to instance variable that is not defined in __slots__.

    Incorrectly reports error when accessing `__slots__` when `slots=True`.

         dataclasses_transform_class Pass Pass
    Partial

    Does not support field specifiers.

    Emits "attribute not initialized" error for dataclass field.

    Unsupported

    Does not understand @dataclass_transform.

         dataclasses_transform_converter
    Unsupported

    Converter parameter not yet supported.

    Pass
    Unsupported

    Converter parameter not yet supported.

    Unsupported

    Converter parameter not yet supported.

         dataclasses_transform_field
    Partial

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

    Pass
    Unsupported

    Does not understand dataclass transform field specifiers.

    Unsupported

    Does not understand @dataclass_transform.

         dataclasses_transform_func
    Partial

    Does not handle `kw_only=False` override when `kw_only_default=True`.

    Does not report error when `order=False` and comparison operators are used.

    Pass
    Partial

    Does not understand @dataclass_transform when it is applied only to overloads of a decorator but not the definition.

    Does not detect non-frozen class inheriting from frozen class.

    Emits "attribute not initialized" error for dataclass field.

    Unsupported

    Does not understand @dataclass_transform.

         dataclasses_transform_meta Pass Pass
    Partial

    Does not understand custom field specifiers.

    Incorrectly rejects frozen dataclass that inherits from non-frozen.

    Emits "attribute not initialized" error for dataclass field.

    Unsupported

    Does not understand @dataclass_transform.

         dataclasses_usage
    Pass*

    Does not detect unannotated usage of `dataclasses.field()`.

    Pass
    Partial

    Does not report error when field with no default follows field with default.

    Complains on `assert_type` when used for bound methods vs `Callable`.

    Does not understand `__dataclass_fields__`.

    Incorrectly raises incompatibility type errors.

    Pass
    +
    Typed dictionaries
         typeddicts_alt_syntax
    Pass*

    Does not support keyword-argument form of alternative syntax (deprecated in 3.11).

    Pass
    Partial

    Does not report when name of TypedDict doesn't match assigned identifier name.

    Does not support keyword-argument form of alternative syntax (deprecated in 3.11).

    Partial

    Does not reject use of variable as second argument to `TypedDict` call.

    Does not report when name of TypedDict doesn't match assigned identifier name.

    Does not support keyword-argument form of alternative syntax (deprecated in 3.11).

         typeddicts_class_syntax Pass Pass
    Partial

    Does not reject methods within TypedDict class.

    Does not report when metaclass is provided.

    Does not report when other keyword argument is provided.

    Does not support generic TypedDict class.

    Partial

    Does not reject methods within TypedDict class.

    Does not report when metaclass is provided.

    Does not report when other keyword argument is provided.

         typeddicts_final Pass Pass
    Partial

    Does not handle value with literal type as index to TypedDict object.

    Pass
         typeddicts_inheritance Pass Pass PassPass
         typeddicts_operations Pass Pass Pass
    Partial

    Does not report type violation with TypedDict value assignment.

    Does not report reference to unknown key in TypedDict.

    Does not reject `clear` method on TypedDict with required keys.

    Does not reject delete operation for required key in TypedDict.

         typeddicts_readonly Pass Pass PassUnsupported
         typeddicts_readonly_consistency Pass Pass PassUnsupported
         typeddicts_readonly_inheritance
    Partial

    Incorrectly rejects non-ReadOnly override of ReadOnly item.

    Incorrectly rejects override of ReadOnly item with another ReadOnly item with narrower type.

    Incorrectly rejects override of NotRequired ReadOnly item with a Required ReadOnly item.

    Pass UnsupportedUnsupported
         typeddicts_readonly_kwargs Pass Pass PassUnsupported
         typeddicts_readonly_update
    Partial

    Incorrectly allows update of ReadOnly item.

    Incorrectly rejects update involving an item with Never type.

    Pass PassUnsupported
         typeddicts_required Pass Pass
    Partial

    Does not reject use of `Required` in function parameter annotation.

    Does not reject nested use of `Required` in type annotation.

    Does not support recursive TypedDict definitions.

    Incorrectly complains about uninitialized attributes on TypedDict definitions.

    Incorrectly generates "attribute not initialized" errors for TypedDict fields.

    Partial

    Does not reject use of `Required` in non-TypedDict class.

    Does not reject use of `Required` in function parameter annotation.

    Does not reject nested use of `Required` in type annotation.

         typeddicts_type_consistency Pass Pass
    Partial

    Does not reject assignment of TypedDict with missing key.

    Does not return non-Optional value from `get` method for required key.

    Does not properly handle nested TypedDicts.

    Partial

    Does not report some type violations for TypedDict type compatibility.

    Incorrectly reports type violation in cases where there is none.

    Does not report type incompatibility between TypedDict and `dict[str, Any]`.

         typeddicts_usage Pass Pass
    Pass*

    Does not report errant use of TypedDict in `isinstance` call.

    Does not reject use of TypedDict as TypeVar bound.

    Partial

    Does not report errant use of TypedDict in `isinstance` call.

    Does not reject use of TypedDict as TypeVar bound.

    +
    Tuples
         tuples_type_compat
    Partial

    Does not support tuple narrowing based on `len()` type guard (optional).

    Pass
    Partial

    Does not support some unpacked tuple forms.

    Does not report type violation when assigning `tuple[int, ...]` to `tuple[int]`.

    Does not support tuple narrowing based on `len()` type guard (optional).

    Does not correctly evaluate `Sequence[Never]` for `tuple[()]`.

    Partial

    Does not support unpacked tuple forms.

    Does not report type violation when assigning `tuple[int, ...]` to `tuple[int]`.

    Does not support tuple narrowing based on `len()` type guard (optional).

         tuples_type_form Pass Pass PassPass
         tuples_unpacked
    Partial

    "More than one unpack" error is missing a line number.

    Pass Pass
    Unsupported

    Does not support `typing.Unpack`.

    Does not support unpacked tuples within a tuple type form.

    +
    Named tuples
         namedtuples_define_class
    Partial

    Does not reject override of named tuple attribute in child class.

    Pass
    Partial

    Does not evaluate correct type for indexed named tuple instance with integer.

    Does not evaluate correct type for indexed named tuple instance with slice.

    Does not report out-of-range index access with named tuple instance.

    Does not reject named tuple element with no default value after one with a default.

    Incorrectly rejects assignment of named tuple to a tuple with compatible type.

    Does not reject attempt to use NamedTuple with multiple inheritance.

    Partial

    Incorrectly rejects valid index of named tuple instance when using a negative index.

    Does not evaluate correct type for indexed named tuple instance with slice.

    Does not reject named tuple element with no default value after one with a default.

    Does not reject override of named tuple attribute in child class.

    Evaluates incorrect type for named tuple entry with a generic type.

    Does not reject incorrect argument type passed to specialized generic named tuple constructor.

    Does not reject attempt to use NamedTuple with multiple inheritance.

         namedtuples_define_functional Pass Pass Pass
    Partial

    Does not handle illegal named tuple names the same as runtime.

    Does not support defaults in functional form.

         namedtuples_type_compat Pass Pass PassPass
         namedtuples_usage
    Partial

    Does not reject attempt to delete named tuple field by name.

    Pass Partial
    Partial

    Incorrectly rejects valid index of named tuple instance when using a negative index.

    Does not report out-of-range index access with named tuple instance.

    Does not reject attempt to overwrite named tuple entry by name.

    Does not reject attempt to delete named tuple entry by name.

    +
    Enumerations
         enums_behaviors Pass Pass Pass
    Partial

    Does not enforce that Enum classes are implicitly final.

         enums_definition Pass Pass Pass
    Pass*

    Does not support some functional forms for Enum class definitions (optional).

         enums_expansion
    Partial

    Improperly applies narrowing to Flag subclass.

    Pass Pass
    Partial

    Improperly applies narrowing to Flag subclass.

         enums_member_names
    Pass*

    Does not support special-cased handling of member name literal types in some cases (optional).

    Pass
    Pass*

    Does not support special-cased handling of member name literal types (optional).

    Pass
         enums_member_values
    Partial

    Does not enforce declared type of `_value_`.

    Does not enforce assigned tuple types for enum members (optional).

    Pass Pass
    Partial

    Does not enforce declared type of `_value_`.

    Does not correctly enforce assigned tuple types for enum members (optional).

    Does not evaluate literal types for enum member values (optional).

    Does not evaluate literal types for auto values (optional).

         enums_members
    Partial

    Does not treat attribute with annotation and no assignment as non-member.

    Does not treat callables as non-members.

    Does not honor `enum.member` as method decorator.

    Does not properly handle aliased enum members.

    Does not support `_ignore_` mechanism (optional).

    Does not treat attributes with private names as non-members.

    Pass*

    Does not support `_ignore_` mechanism (optional).

    Partial

    Does not reject use of annotation with enum member.

    Does not treat callables as non-members.

    Does not treat annotated attributes as non-members.

    Does not honor `enum.nonmember` to define non-member attribute.

    Does not honor `enum.member` as method decorator.

    Does not properly handle aliased enum members.

    Rejects use of `_ignore_`.

    Does not support `_ignore_` mechanism (optional).

    Partial

    Does not reject use of annotation with enum member.

    Does not support `enum.member` and `enum.nonmember`.

    Does not support `_ignore_` mechanism (optional).

    +
    Type narrowing
         narrowing_typeguard Pass Pass Pass
    Partial

    Does not reject TypeGuard method with too few parameters.

         narrowing_typeis Pass Pass Pass
    Partial

    Does not narrow correctly on generic tuple type.

    Does not reject covariant use of TypeIs.

    Does not reject TypeIs where return type is not consistent with input type due to variance.

    +
    Type checker directives
         directives_assert_type Pass Pass Pass
    Partial

    Incorrectly allows assert(x, int) where x is a Literal.

         directives_cast Pass Pass Pass
    Partial

    Does not reject a call to "cast" with additional arguments.

         directives_deprecated Pass Pass
    Unsupported

    Does not support @deprecated.

    Unsupported

    Does not support @deprecated.

         directives_no_type_check
    Partial

    Does not honor `@no_type_check` class decorator (allowed).

    Does not reject invalid call of `@no_type_check` function.

    Pass*

    Does not honor `@no_type_check` class decorator (allowed).

    Pass*

    Does not honor @no_type_check decorator.

    Pass*

    Does not honor @no_type_check decorator.

         directives_reveal_type Pass Pass Pass
    Partial

    Does not reject call to reveal_type with zero arguments.

    Does not reject call to reveal_type with too many arguments.

         directives_type_checking Pass Pass PassPass
         directives_type_ignore
    Partial

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

    Pass Pass
    Partial

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

         directives_type_ignore_file1 Pass Pass PassPass
         directives_type_ignore_file2 Pass Pass Pass
    Partial

    Does not ignore `# type: ignore` if it occurs after docstrings in the file.

         directives_version_platform
    Pass*

    Does not understand three-element form of sys.version checks.

    Does not understand os.name checks.

    Pass Pass
    Pass*

    Does not understand three-element form of sys.version checks.

    Does not understand os.name checks.

    +
    Historical and deprecated features
         historical_positional
    Partial

    Does not reject positional-only parameter after non-positional-only parameter.

    Treats keyword-only parameter as positional-only.

    Applies legacy positional-only rules when PEP 570 syntax is used.

    Pass Pass
    Partial

    Does not apply rules for pre-3.8 positional-only parameters in some cases.

    Does not reject positional-only parameter after non-positional-only parameter.

    diff --git a/conformance/src/type_checker.py b/conformance/src/type_checker.py index 05f4485a9..48c869c4f 100644 --- a/conformance/src/type_checker.py +++ b/conformance/src/type_checker.py @@ -7,11 +7,6 @@ from pathlib import Path import os import re -from pytype import config as pytype_config -from pytype import io as pytype_io -from pytype import analyze as pytype_analyze -from pytype.errors import errors as pytype_errors -from pytype import load_pytd as pytype_loader import shutil from subprocess import PIPE, CalledProcessError, run import sys @@ -279,114 +274,8 @@ def parse_errors(self, output: Sequence[str]) -> dict[int, list[str]]: return line_to_errors -class PytypeTypeChecker(TypeChecker): - @property - def name(self) -> str: - return "pytype" - - def install(self) -> bool: - try: - # Uninstall any existing version if present. - run( - [sys.executable, "-m", "pip", "uninstall", "pytype", "-y"], - check=True, - ) - - # Install the latest version. - run( - [sys.executable, "-m", "pip", "install", "pytype"], - check=True, - ) - - return True - except CalledProcessError: - print("Unable to install pytype on this platform") - return False - - def get_version(self) -> str: - proc = run( - [sys.executable, "-m", "pytype", "--version"], stdout=PIPE, text=True - ) - version = proc.stdout.strip() - return f"pytype {version}" - - def run_tests(self, test_files: Sequence[str]) -> dict[str, str]: - # Specify 3.11 for now to work around the fact that pytype - # currently doesn't support 3.12 and emits an error when - # running on 3.12. - options = pytype_config.Options.create(python_version=(3, 11), quick=True) - loader = pytype_loader.create_loader(options) - - # Add results to a dictionary keyed by the file name. - results_dict: dict[str, str] = {} - - for fi in tqdm(os.listdir(".")): - if not fi.endswith(".py"): - continue - options.tweak(input=fi) - with open(fi, "r", encoding="utf-8") as test_file: - src = test_file.read() - try: - analysis: pytype_analyze.Analysis = pytype_io.check_py( - src, options=options, loader=loader - ) - except Exception as e: - results_dict[fi] = f"{e.__class__.__name__}: {e}\n" - else: - results_dict[fi] = self.enforce_consistent_order( - analysis.context.errorlog - ) - return results_dict - - def enforce_consistent_order(self, log: pytype_errors.ErrorLog) -> str: - """Pytype does not guarantee deterministic output across runs. - It does order diagnostics by line number, but if multiple errors - occur on the same line, the ordering appears to change from one - run to the next. We require deterministic and consistent output, - so this method sorts the pytype output by line number and then - alphabetically within a line. - """ - - class ErrorSorter: - def __init__(self, err: pytype_errors.Error) -> None: - # Overwrite the details in the error because these can be - # nondeterministic (differ from run to run) in some cases. - err._details = "" - self._err = err - - def __lt__(self, other: "ErrorSorter", /) -> bool: - lineno_diff = self._err.line - other._err.line - if lineno_diff != 0: - return lineno_diff < 0 - return other._err.message < self._err.message - - def __eq__(self, other: object, /) -> bool: - return ( - isinstance(other, ErrorSorter) - and self._err.line == other._err.line - and other._err.message == self._err.message - ) - - errors: list[pytype_errors.Error] = [ - error for error in log.unique_sorted_errors() - ] - errors.sort(key=ErrorSorter) - return "\n".join(map(str, errors)) + "\n" - - def parse_errors(self, output: Sequence[str]) -> dict[int, list[str]]: - # annotations_forward_refs.py:103:1: unexpected indent [python-compiler-error] - line_to_errors: dict[int, list[str]] = {} - for line in output: - match = re.search(r"^[a-zA-Z0-9_]+.pyi?:(\d+):(\d+): ", line) - if match is not None: - lineno = int(match.group(1)) - line_to_errors.setdefault(int(lineno), []).append(line) - return line_to_errors - - TYPE_CHECKERS: Sequence[TypeChecker] = ( MypyTypeChecker(), PyrightTypeChecker(), *([] if os.name == "nt" else [PyreTypeChecker()]), - PytypeTypeChecker(), ) From ef756488e6318e00b03e7d65e2f01f44f4698c32 Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Tue, 20 May 2025 19:06:47 +0200 Subject: [PATCH 107/308] Add some exceptions when commenting Any (#2000) --- docs/guides/writing_stubs.rst | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/docs/guides/writing_stubs.rst b/docs/guides/writing_stubs.rst index 47f48b40a..605750d08 100644 --- a/docs/guides/writing_stubs.rst +++ b/docs/guides/writing_stubs.rst @@ -772,18 +772,26 @@ all type checkers:: Using ``Any`` and ``object`` ---------------------------- -When adding type hints, avoid using the ``Any`` type when possible. Reserve -the use of ``Any`` for when: +When adding type hints, avoid using the :ref:`Any` type when possible. Reserve +the use of :ref:`Any` for when: * the correct type cannot be expressed in the current type system; and * to avoid union returns (see above). -Note that ``Any`` is not the correct type to use if you want to indicate +Note that :ref:`Any` is not the correct type to use if you want to indicate that some function can accept literally anything: in those cases use -``object`` instead. - -When using ``Any``, document the reason for using it in a comment. Ideally, -document what types could be used. +:class:`object` instead. + +When using :ref:`Any`, document the reason for using it in a comment, unless the +reason is obvious. Ideally, document what types could be used. Obvious +reasons can include: + +* Using :ref:`Any` as a type argument for a generic with invariant type variables + to say "any object of this type is allowed", e.g. ``Future[Any]``. +* Using ``dict[str, Any]`` or ``Mapping[str, Any]`` when the value types + depends on the keys. But consider using :ref:`TypedDict` or + ``dict[str, Incomplete]`` (temporarily) when the keys of the dictionary are + fixed. The ``Any`` Trick ----------------- From d4263de581da5c7bf750951f1f07c230f773051d Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Wed, 28 May 2025 20:41:53 -0700 Subject: [PATCH 108/308] spec: various minor changes (#2013) - Replace an incorrect use of "subtype" with "assignable" - Remove discussion of str/bytes Literal types that seems geared towards Python 2. Instead, say straightforwardly that strings (str objects) and bytes objects are supported. - Rewrite an example that relies on the int/float/complex special case. The example was correct but I think it's confusing to readers if we have examples unnecessarily rely on the special case. Instead, use example types with more straightforward behavior. --- docs/spec/generics.rst | 2 +- docs/spec/literal.rst | 26 ++++++++++---------------- docs/spec/tuples.rst | 2 +- 3 files changed, 12 insertions(+), 18 deletions(-) diff --git a/docs/spec/generics.rst b/docs/spec/generics.rst index 942abb66c..4f4150c44 100644 --- a/docs/spec/generics.rst +++ b/docs/spec/generics.rst @@ -2000,7 +2000,7 @@ Bound Rules T1 = TypeVar("T1", bound=int) TypeVar("Ok", default=T1, bound=float) # Valid TypeVar("AlsoOk", default=T1, bound=int) # Valid - TypeVar("Invalid", default=T1, bound=str) # Invalid: int is not a subtype of str + TypeVar("Invalid", default=T1, bound=str) # Invalid: int is not assignable to str Constraint Rules ^^^^^^^^^^^^^^^^ diff --git a/docs/spec/literal.rst b/docs/spec/literal.rst index 564ddaa44..1e820a63f 100644 --- a/docs/spec/literal.rst +++ b/docs/spec/literal.rst @@ -98,18 +98,23 @@ expressions, and nothing else. Legal parameters for ``Literal`` at type check time """"""""""""""""""""""""""""""""""""""""""""""""""" -``Literal`` may be parameterized with literal ints, byte and unicode strings, -bools, Enum values and ``None``. So for example, all of +``Literal`` may be parameterized with literal ``int``, ``str``, ``bytes``, +and ``bool`` objects, instances of ``enum.Enum`` subclasses, and ``None``. So for example, all of the following would be legal:: Literal[26] - Literal[0x1A] # Exactly equivalent to Literal[26] + Literal[0x1A] # Equivalent to Literal[26] Literal[-4] Literal["hello world"] + Literal[u"hello world"] # Equivalent to Literal["hello world"] Literal[b"hello world"] - Literal[u"hello world"] Literal[True] - Literal[Color.RED] # Assuming Color is some enum + + class Color(enum.Enum): + RED = 1 + GREEN = 2 + + Literal[Color.RED] Literal[None] **Note:** Since the type ``None`` is inhabited by just a single @@ -143,17 +148,6 @@ This should be exactly equivalent to the following type:: Literal[1, 2, 3, "foo", 5] | None -**Note:** String literal types like ``Literal["foo"]`` should subtype either -bytes or unicode in the same way regular string literals do at runtime. - -For example, in Python 3, the type ``Literal["foo"]`` is equivalent to -``Literal[u"foo"]``, since ``"foo"`` is equivalent to ``u"foo"`` in Python 3. - -Similarly, in Python 2, the type ``Literal["foo"]`` is equivalent to -``Literal[b"foo"]`` -- unless the file includes a -``from __future__ import unicode_literals`` import, in which case it would be -equivalent to ``Literal[u"foo"]``. - Illegal parameters for ``Literal`` at type check time """"""""""""""""""""""""""""""""""""""""""""""""""""" diff --git a/docs/spec/tuples.rst b/docs/spec/tuples.rst index 1209cc027..40afc732b 100644 --- a/docs/spec/tuples.rst +++ b/docs/spec/tuples.rst @@ -91,7 +91,7 @@ Type Compatibility Rules ------------------------ Because tuple contents are immutable, the element types of a tuple are covariant. -For example, ``tuple[int, int]`` is a subtype of ``tuple[float, complex]``. +For example, ``tuple[bool, int]`` is a subtype of ``tuple[int, object]``. As discussed above, a homogeneous tuple of arbitrary length is equivalent to a union of tuples of different lengths. That means ``tuple[()]``, From 6c964dd2a94786fa61c97518326d62f5ecb8f2ab Mon Sep 17 00:00:00 2001 From: KotlinIsland <65446343+KotlinIsland@users.noreply.github.com> Date: Thu, 5 Jun 2025 00:53:52 +1000 Subject: [PATCH 109/308] =?UTF-8?q?(=F0=9F=8E=81)=20conformance:=20`NewTyp?= =?UTF-8?q?e`=20isn't=20a=20class=20(#2015)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * conformance: `NewType` isn't a class * conformance: update results --- conformance/results/mypy/aliases_newtype.toml | 34 +++++++++++-------- conformance/results/mypy/version.toml | 2 +- .../results/pyright/aliases_newtype.toml | 30 +++++++++------- .../pyright/aliases_typealiastype.toml | 4 +-- .../results/pyright/callables_protocol.toml | 7 ++-- .../generics_syntax_infer_variance.toml | 9 ++++- .../results/pyright/protocols_definition.toml | 2 +- conformance/results/pyright/version.toml | 4 +-- conformance/results/results.html | 12 +++---- conformance/tests/aliases_newtype.py | 3 ++ 10 files changed, 62 insertions(+), 45 deletions(-) diff --git a/conformance/results/mypy/aliases_newtype.toml b/conformance/results/mypy/aliases_newtype.toml index ed1e9a0d3..e1c8c64a7 100644 --- a/conformance/results/mypy/aliases_newtype.toml +++ b/conformance/results/mypy/aliases_newtype.toml @@ -1,21 +1,25 @@ -conformant = "Pass" +conformant = "Partial" +notes = """ +`NewType`s are considered classes, not functions. +""" output = """ aliases_newtype.py:11: error: Argument 1 to "UserId" has incompatible type "str"; expected "int" [arg-type] aliases_newtype.py:12: error: Incompatible types in assignment (expression has type "int", variable has type "UserId") [assignment] -aliases_newtype.py:20: error: Cannot use isinstance() with NewType type [misc] -aliases_newtype.py:23: error: Cannot subclass "NewType" [misc] -aliases_newtype.py:32: error: String argument 1 "BadName" to NewType(...) does not match variable name "GoodName" [misc] -aliases_newtype.py:38: error: "GoodNewType1" expects no type arguments, but 1 given [type-arg] -aliases_newtype.py:44: error: Argument 2 to NewType(...) must be subclassable (got "int | str") [valid-newtype] -aliases_newtype.py:47: error: Type variable "aliases_newtype.T" is unbound [valid-type] -aliases_newtype.py:47: note: (Hint: Use "Generic[T]" or "Protocol[T]" base class to bind "T" inside a class) -aliases_newtype.py:47: note: (Hint: Use "T" in function signature to bind "T" inside a function) -aliases_newtype.py:49: error: NewType cannot be used with protocol classes [misc] -aliases_newtype.py:51: error: Argument 2 to NewType(...) must be subclassable (got "Literal[7]") [valid-newtype] -aliases_newtype.py:58: error: Argument 2 to NewType(...) must be subclassable (got "TD1") [valid-newtype] -aliases_newtype.py:60: error: NewType(...) expects exactly two positional arguments [misc] -aliases_newtype.py:62: error: Argument 2 to NewType(...) must be subclassable (got "Any") [valid-newtype] +aliases_newtype.py:23: error: Cannot use isinstance() with NewType type [misc] +aliases_newtype.py:26: error: Cannot subclass "NewType" [misc] +aliases_newtype.py:35: error: String argument 1 "BadName" to NewType(...) does not match variable name "GoodName" [misc] +aliases_newtype.py:41: error: "GoodNewType1" expects no type arguments, but 1 given [type-arg] +aliases_newtype.py:47: error: Argument 2 to NewType(...) must be subclassable (got "int | str") [valid-newtype] +aliases_newtype.py:50: error: Type variable "aliases_newtype.T" is unbound [valid-type] +aliases_newtype.py:50: note: (Hint: Use "Generic[T]" or "Protocol[T]" base class to bind "T" inside a class) +aliases_newtype.py:50: note: (Hint: Use "T" in function signature to bind "T" inside a function) +aliases_newtype.py:52: error: NewType cannot be used with protocol classes [misc] +aliases_newtype.py:54: error: Argument 2 to NewType(...) must be subclassable (got "Literal[7]") [valid-newtype] +aliases_newtype.py:61: error: Argument 2 to NewType(...) must be subclassable (got "TD1") [valid-newtype] +aliases_newtype.py:63: error: NewType(...) expects exactly two positional arguments [misc] +aliases_newtype.py:65: error: Argument 2 to NewType(...) must be subclassable (got "Any") [valid-newtype] """ -conformance_automated = "Pass" +conformance_automated = "Fail" errors_diff = """ +Line 18: Expected 1 errors """ diff --git a/conformance/results/mypy/version.toml b/conformance/results/mypy/version.toml index 41659210a..192bb6fbc 100644 --- a/conformance/results/mypy/version.toml +++ b/conformance/results/mypy/version.toml @@ -1,2 +1,2 @@ version = "mypy 1.15.0" -test_duration = 1.5 +test_duration = 1.4 diff --git a/conformance/results/pyright/aliases_newtype.toml b/conformance/results/pyright/aliases_newtype.toml index 256c13616..a0a12c0cd 100644 --- a/conformance/results/pyright/aliases_newtype.toml +++ b/conformance/results/pyright/aliases_newtype.toml @@ -1,22 +1,26 @@ -conformant = "Pass" +conformant = "Partial" +notes = """ +`NewType`s are considered classes, not functions. +""" output = """ aliases_newtype.py:11:8 - error: Argument of type "Literal['user']" cannot be assigned to parameter "_x" of type "int" in function "__init__"   "Literal['user']" is not assignable to "int" (reportArgumentType) aliases_newtype.py:12:14 - error: Type "Literal[42]" is not assignable to declared type "UserId"   "Literal[42]" is not assignable to "UserId" (reportAssignmentType) -aliases_newtype.py:20:16 - error: Second argument to "isinstance" must be a class or tuple of classes +aliases_newtype.py:23:16 - error: Second argument to "isinstance" must be a class or tuple of classes   Class created with NewType cannot be used with instance and class checks (reportArgumentType) -aliases_newtype.py:23:21 - error: Base class "UserId" is marked final and cannot be subclassed (reportGeneralTypeIssues) -aliases_newtype.py:32:1 - error: NewType must be assigned to a variable with the same name (reportGeneralTypeIssues) -aliases_newtype.py:38:19 - error: Expected no type arguments for class "GoodNewType1" (reportInvalidTypeArguments) -aliases_newtype.py:44:38 - error: Expected class as second argument to NewType (reportGeneralTypeIssues) -aliases_newtype.py:47:43 - error: Type variable "T" has no meaning in this context (reportGeneralTypeIssues) -aliases_newtype.py:49:38 - error: NewType cannot be used with structural type (a Protocol or TypedDict class) (reportGeneralTypeIssues) -aliases_newtype.py:51:38 - error: NewType cannot be used with Literal type (reportGeneralTypeIssues) -aliases_newtype.py:58:38 - error: NewType cannot be used with structural type (a Protocol or TypedDict class) (reportGeneralTypeIssues) -aliases_newtype.py:60:15 - error: NewType requires two positional arguments (reportCallIssue) -aliases_newtype.py:62:38 - error: The second argument to NewType must be a known class, not Any or Unknown (reportGeneralTypeIssues) +aliases_newtype.py:26:21 - error: Base class "UserId" is marked final and cannot be subclassed (reportGeneralTypeIssues) +aliases_newtype.py:35:1 - error: NewType must be assigned to a variable with the same name (reportGeneralTypeIssues) +aliases_newtype.py:41:19 - error: Expected no type arguments for class "GoodNewType1" (reportInvalidTypeArguments) +aliases_newtype.py:47:38 - error: Expected class as second argument to NewType (reportGeneralTypeIssues) +aliases_newtype.py:50:43 - error: Type variable "T" has no meaning in this context (reportGeneralTypeIssues) +aliases_newtype.py:52:38 - error: NewType cannot be used with structural type (a Protocol or TypedDict class) (reportGeneralTypeIssues) +aliases_newtype.py:54:38 - error: NewType cannot be used with Literal type (reportGeneralTypeIssues) +aliases_newtype.py:61:38 - error: NewType cannot be used with structural type (a Protocol or TypedDict class) (reportGeneralTypeIssues) +aliases_newtype.py:63:15 - error: NewType requires two positional arguments (reportCallIssue) +aliases_newtype.py:65:38 - error: The second argument to NewType must be a known class, not Any or Unknown (reportGeneralTypeIssues) """ -conformance_automated = "Pass" +conformance_automated = "Fail" errors_diff = """ +Line 18: Expected 1 errors """ diff --git a/conformance/results/pyright/aliases_typealiastype.toml b/conformance/results/pyright/aliases_typealiastype.toml index 732bebde1..e0f4a8c93 100644 --- a/conformance/results/pyright/aliases_typealiastype.toml +++ b/conformance/results/pyright/aliases_typealiastype.toml @@ -31,8 +31,8 @@ aliases_typealiastype.py:61:42 - error: Expected class but received "Literal[Tru aliases_typealiastype.py:62:42 - error: Expected class but received "Literal[1]" (reportGeneralTypeIssues) aliases_typealiastype.py:63:42 - error: Binary operator not allowed in type expression (reportInvalidTypeForm) aliases_typealiastype.py:64:42 - error: Type expressions cannot use format string literals (f-strings) (reportGeneralTypeIssues) +aliases_typealiastype.py:66:47 - error: "BadAlias21" is not defined (reportUndefinedVariable) """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 66: Expected 1 errors """ diff --git a/conformance/results/pyright/callables_protocol.toml b/conformance/results/pyright/callables_protocol.toml index 47af00471..82afbb4c6 100644 --- a/conformance/results/pyright/callables_protocol.toml +++ b/conformance/results/pyright/callables_protocol.toml @@ -32,11 +32,10 @@ callables_protocol.py:70:7 - error: Type "(**b: str) -> None" is not assignable   Type "(**b: str) -> None" is not assignable to type "(*vals: bytes, **kwargs: str) -> None"     Parameter "*vals" has no corresponding parameter (reportAssignmentType) callables_protocol.py:97:16 - error: Type "(x: int) -> None" is not assignable to declared type "Proto4" -  "function" is incompatible with protocol "Proto4" -    "other_attribute" is not present -    "__call__" is not present (reportAssignmentType) +  "FunctionType" is incompatible with protocol "Proto4" +    "other_attribute" is not present (reportAssignmentType) callables_protocol.py:121:18 - error: Type "(*vals: bytes, max_len: int | None = None) -> list[bytes]" is not assignable to declared type "NotProto6" -  "function" is not assignable to "NotProto6" (reportAssignmentType) +  "FunctionType" is not assignable to "NotProto6" (reportAssignmentType) callables_protocol.py:169:7 - error: Type "(x: int) -> Any" is not assignable to declared type "Proto8"   One or more overloads of "__call__" is not assignable     Type "(x: int) -> Any" is not assignable to type "(x: str) -> str" diff --git a/conformance/results/pyright/generics_syntax_infer_variance.toml b/conformance/results/pyright/generics_syntax_infer_variance.toml index b23985d59..05f4c0d51 100644 --- a/conformance/results/pyright/generics_syntax_infer_variance.toml +++ b/conformance/results/pyright/generics_syntax_infer_variance.toml @@ -6,6 +6,12 @@ generics_syntax_infer_variance.py:29:35 - error: Type "ShouldBeCovariant1[float]   "ShouldBeCovariant1[float]" is not assignable to "ShouldBeCovariant1[int]"     Type parameter "T@ShouldBeCovariant1" is covariant, but "float" is not a subtype of "int"       "float" is not assignable to "int" (reportAssignmentType) +generics_syntax_infer_variance.py:36:37 - error: Cannot instantiate abstract class "ShouldBeCovariant2" +  "Collection.__len__" is not implemented +  "Sequence.__getitem__" is not implemented (reportAbstractUsage) +generics_syntax_infer_variance.py:37:35 - error: Cannot instantiate abstract class "ShouldBeCovariant2" +  "Collection.__len__" is not implemented +  "Sequence.__getitem__" is not implemented (reportAbstractUsage) generics_syntax_infer_variance.py:37:35 - error: Type "ShouldBeCovariant2[float]" is not assignable to declared type "ShouldBeCovariant2[int]"   "ShouldBeCovariant2[float]" is not assignable to "ShouldBeCovariant2[int]"     Type parameter "T@ShouldBeCovariant2" is covariant, but "float" is not a subtype of "int" @@ -57,6 +63,7 @@ generics_syntax_infer_variance.py:155:45 - error: Type "ShouldBeContravariant1[i     Type parameter "T@ShouldBeContravariant1" is contravariant, but "int" is not a supertype of "float"       "float" is not assignable to "int" (reportAssignmentType) """ -conformance_automated = "Pass" +conformance_automated = "Fail" errors_diff = """ +Line 36: Unexpected errors ['generics_syntax_infer_variance.py:36:37 - error: Cannot instantiate abstract class "ShouldBeCovariant2"'] """ diff --git a/conformance/results/pyright/protocols_definition.toml b/conformance/results/pyright/protocols_definition.toml index c27a3753d..0ed86d0ff 100644 --- a/conformance/results/pyright/protocols_definition.toml +++ b/conformance/results/pyright/protocols_definition.toml @@ -46,7 +46,7 @@ protocols_definition.py:160:22 - error: Type "Concrete3_Bad5" is not assignable protocols_definition.py:218:22 - error: Type "Concrete4_Bad1" is not assignable to declared type "Template4"   "Concrete4_Bad1" is incompatible with protocol "Template4"     "val1" is an incompatible type -      "function" is not assignable to "Sequence[float]" (reportAssignmentType) +      "FunctionType" is not assignable to "Sequence[float]" (reportAssignmentType) protocols_definition.py:219:22 - error: Type "Concrete4_Bad2" is not assignable to declared type "Template4"   "Concrete4_Bad2" is incompatible with protocol "Template4"     "val1" is not present (reportAssignmentType) diff --git a/conformance/results/pyright/version.toml b/conformance/results/pyright/version.toml index f105339d2..e3b370522 100644 --- a/conformance/results/pyright/version.toml +++ b/conformance/results/pyright/version.toml @@ -1,2 +1,2 @@ -version = "pyright 1.1.400" -test_duration = 1.1 +version = "pyright 1.1.401" +test_duration = 1.0 diff --git a/conformance/results/results.html b/conformance/results/results.html index b881e2373..c88562edd 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -159,13 +159,13 @@

    Python Type System Conformance Test Results

    - - - + + diff --git a/conformance/tests/aliases_newtype.py b/conformance/tests/aliases_newtype.py index 00add697e..713b0bf88 100644 --- a/conformance/tests/aliases_newtype.py +++ b/conformance/tests/aliases_newtype.py @@ -14,6 +14,9 @@ assert_type(UserId(5) + 1, int) +# > NewType('Derived', Base) returns a dummy function +_: type = UserId # E: functions are not instances of `type` + # > Both isinstance and issubclass, as well as subclassing will fail for # > NewType('Derived', Base) since function objects don’t support these # > operations. From 2ed4369fe776c7e2580af168feeab34cf342935d Mon Sep 17 00:00:00 2001 From: Eric Traut Date: Wed, 4 Jun 2025 20:25:27 -0700 Subject: [PATCH 110/308] Updated conformance results for mypy 1.16. (#2019) It addresses a bugs detected by tuples_unpacked, overload_definitions, generics_typevartuple_specialization, and classes_override conformance tests. --- .../results/mypy/classes_override.toml | 9 ++------ .../results/mypy/dataclasses_frozen.toml | 4 ++-- .../mypy/dataclasses_transform_class.toml | 2 +- .../mypy/dataclasses_transform_func.toml | 2 +- .../mypy/dataclasses_transform_meta.toml | 2 +- .../generics_typevartuple_specialization.toml | 6 ++---- .../results/mypy/overloads_definitions.toml | 3 --- .../results/mypy/specialtypes_never.toml | 2 +- conformance/results/mypy/tuples_unpacked.toml | 7 +++---- conformance/results/mypy/version.toml | 4 ++-- conformance/results/pyre/aliases_newtype.toml | 21 ++++++++++--------- conformance/results/pyre/version.toml | 2 +- conformance/results/pyright/version.toml | 2 +- conformance/results/results.html | 8 +++---- 14 files changed, 32 insertions(+), 42 deletions(-) diff --git a/conformance/results/mypy/classes_override.toml b/conformance/results/mypy/classes_override.toml index bb72325de..45cceb4cf 100644 --- a/conformance/results/mypy/classes_override.toml +++ b/conformance/results/mypy/classes_override.toml @@ -1,16 +1,11 @@ -conformant = "Partial" -notes = """ -Does not handle case where parent class derives from Any. -""" +conformant = "Pass" output = """ classes_override.py:53: error: Method "method3" is marked as an override, but no base method was found with this name [misc] classes_override.py:56: error: Method "method4" is marked as an override, but no base method was found with this name [misc] classes_override.py:79: error: Method "static_method1" is marked as an override, but no base method was found with this name [misc] classes_override.py:84: error: Method "class_method1" is marked as an override, but no base method was found with this name [misc] classes_override.py:89: error: Method "property1" is marked as an override, but no base method was found with this name [misc] -classes_override.py:101: error: Method "method1" is marked as an override, but no base method was found with this name [misc] """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 101: Unexpected errors ['classes_override.py:101: error: Method "method1" is marked as an override, but no base method was found with this name [misc]'] """ diff --git a/conformance/results/mypy/dataclasses_frozen.toml b/conformance/results/mypy/dataclasses_frozen.toml index 9ea054ded..465a17f6f 100644 --- a/conformance/results/mypy/dataclasses_frozen.toml +++ b/conformance/results/mypy/dataclasses_frozen.toml @@ -2,8 +2,8 @@ conformant = "Pass" output = """ dataclasses_frozen.py:16: error: Property "a" defined in "DC1" is read-only [misc] dataclasses_frozen.py:17: error: Property "b" defined in "DC1" is read-only [misc] -dataclasses_frozen.py:23: error: Cannot inherit non-frozen dataclass from a frozen one [misc] -dataclasses_frozen.py:33: error: Cannot inherit frozen dataclass from a non-frozen one [misc] +dataclasses_frozen.py:23: error: Non-frozen dataclass cannot inherit from a frozen dataclass [misc] +dataclasses_frozen.py:33: error: Frozen dataclass cannot inherit from a non-frozen dataclass [misc] """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/mypy/dataclasses_transform_class.toml b/conformance/results/mypy/dataclasses_transform_class.toml index 8ca0e9aee..df9f2efd4 100644 --- a/conformance/results/mypy/dataclasses_transform_class.toml +++ b/conformance/results/mypy/dataclasses_transform_class.toml @@ -1,6 +1,6 @@ conformant = "Pass" output = """ -dataclasses_transform_class.py:51: error: Cannot inherit non-frozen dataclass from a frozen one [misc] +dataclasses_transform_class.py:51: error: Non-frozen dataclass cannot inherit from a frozen dataclass [misc] dataclasses_transform_class.py:63: error: Property "id" defined in "Customer1" is read-only [misc] dataclasses_transform_class.py:66: error: Too many positional arguments for "Customer1" [misc] dataclasses_transform_class.py:72: error: Unsupported left operand type for < ("Customer1") [operator] diff --git a/conformance/results/mypy/dataclasses_transform_func.toml b/conformance/results/mypy/dataclasses_transform_func.toml index c15824b79..02d2cdf85 100644 --- a/conformance/results/mypy/dataclasses_transform_func.toml +++ b/conformance/results/mypy/dataclasses_transform_func.toml @@ -8,7 +8,7 @@ dataclasses_transform_func.py:53: error: Too many positional arguments for "Cust dataclasses_transform_func.py:57: error: Incompatible types in assignment (expression has type "int", variable has type "str") [assignment] dataclasses_transform_func.py:65: error: Unexpected keyword argument "salary" for "Customer1" [call-arg] dataclasses_transform_func.py:71: error: Too many positional arguments for "Customer2" [misc] -dataclasses_transform_func.py:90: error: Cannot inherit non-frozen dataclass from a frozen one [misc] +dataclasses_transform_func.py:90: error: Non-frozen dataclass cannot inherit from a frozen dataclass [misc] dataclasses_transform_func.py:97: error: Property "id" defined in "Customer3" is read-only [misc] """ conformance_automated = "Fail" diff --git a/conformance/results/mypy/dataclasses_transform_meta.toml b/conformance/results/mypy/dataclasses_transform_meta.toml index 5d1966324..89585d64a 100644 --- a/conformance/results/mypy/dataclasses_transform_meta.toml +++ b/conformance/results/mypy/dataclasses_transform_meta.toml @@ -1,6 +1,6 @@ conformant = "Pass" output = """ -dataclasses_transform_meta.py:51: error: Cannot inherit non-frozen dataclass from a frozen one [misc] +dataclasses_transform_meta.py:51: error: Non-frozen dataclass cannot inherit from a frozen dataclass [misc] dataclasses_transform_meta.py:63: error: Property "id" defined in "Customer1" is read-only [misc] dataclasses_transform_meta.py:66: error: Too many positional arguments for "Customer1" [misc] dataclasses_transform_meta.py:73: error: Unsupported left operand type for < ("Customer1") [operator] diff --git a/conformance/results/mypy/generics_typevartuple_specialization.toml b/conformance/results/mypy/generics_typevartuple_specialization.toml index 00f8c44e6..68c021237 100644 --- a/conformance/results/mypy/generics_typevartuple_specialization.toml +++ b/conformance/results/mypy/generics_typevartuple_specialization.toml @@ -2,23 +2,21 @@ conformant = "Partial" notes = """ Incorrectly specializes generic alias that includes a TypeVar and TypeVarTuple if no type arguments are provided. Rejects specialization of generic type alias defined as a tuple containing a TypeVar. -"More than one Unpack" error message has no line number. """ output = """ -generics_typevartuple_specialization.py: error: More than one Unpack in a type is not allowed [misc] generics_typevartuple_specialization.py:85: error: Argument 1 to "takes_float_array_with_specific_shape" has incompatible type "Array2[float, *tuple[Any, ...]]"; expected "Array2[float, Height, Width]" [arg-type] generics_typevartuple_specialization.py:108: error: Type application is only supported for generic classes [misc] generics_typevartuple_specialization.py:109: error: Type application is only supported for generic classes [misc] generics_typevartuple_specialization.py:109: error: Unpack is only valid in a variadic position [valid-type] generics_typevartuple_specialization.py:110: error: Type application is only supported for generic classes [misc] generics_typevartuple_specialization.py:110: error: Unpack is only valid in a variadic position [valid-type] +generics_typevartuple_specialization.py:121: error: More than one Unpack in a type is not allowed [misc] +generics_typevartuple_specialization.py:122: error: More than one Unpack in a type is not allowed [misc] generics_typevartuple_specialization.py:127: error: Bad number of arguments for type alias, expected at least 2, given 1 [type-arg] generics_typevartuple_specialization.py:163: error: TypeVarTuple cannot be split [type-arg] """ conformance_automated = "Fail" errors_diff = """ -Line 121: Expected 1 errors -Line 122: Expected 1 errors Line 85: Unexpected errors ['generics_typevartuple_specialization.py:85: error: Argument 1 to "takes_float_array_with_specific_shape" has incompatible type "Array2[float, *tuple[Any, ...]]"; expected "Array2[float, Height, Width]" [arg-type]'] Line 108: Unexpected errors ['generics_typevartuple_specialization.py:108: error: Type application is only supported for generic classes [misc]'] """ diff --git a/conformance/results/mypy/overloads_definitions.toml b/conformance/results/mypy/overloads_definitions.toml index d9485b866..82730d4f1 100644 --- a/conformance/results/mypy/overloads_definitions.toml +++ b/conformance/results/mypy/overloads_definitions.toml @@ -1,17 +1,14 @@ conformant = "Partial" conformance_automated = "Fail" notes = """ -Does not allow an overload with no implementation in an abstract base class. Allows @override to be on all overloads and implementation, instead of just implementation. """ errors_diff = """ Lines 220, 221, 222, 225, 226: Expected error (tag 'override_impl') -Line 47: Unexpected errors ['overloads_definitions.py:47: error: An overloaded function outside a stub file must have an implementation [no-overload-impl]'] """ output = """ overloads_definitions.py:15: error: Single overload definition, multiple required [misc] overloads_definitions.py:27: error: An overloaded function outside a stub file must have an implementation [no-overload-impl] -overloads_definitions.py:47: error: An overloaded function outside a stub file must have an implementation [no-overload-impl] overloads_definitions.py:58: error: An overloaded function outside a stub file must have an implementation [no-overload-impl] overloads_definitions.py:71: error: Overload does not consistently use the "@staticmethod" decorator on all function signatures. [misc] overloads_definitions.py:84: error: Overload does not consistently use the "@classmethod" decorator on all function signatures. [misc] diff --git a/conformance/results/mypy/specialtypes_never.toml b/conformance/results/mypy/specialtypes_never.toml index 2fd4aa191..510a86b66 100644 --- a/conformance/results/mypy/specialtypes_never.toml +++ b/conformance/results/mypy/specialtypes_never.toml @@ -2,7 +2,7 @@ conformant = "Pass" output = """ specialtypes_never.py:19: error: Implicit return in function which does not return [misc] specialtypes_never.py:86: error: Incompatible types in assignment (expression has type "list[Never]", variable has type "list[int]") [assignment] -specialtypes_never.py:86: note: "List" is invariant -- see https://mypy.readthedocs.io/en/stable/common_issues.html#variance +specialtypes_never.py:86: note: "list" is invariant -- see https://mypy.readthedocs.io/en/stable/common_issues.html#variance specialtypes_never.py:86: note: Consider using "Sequence" instead, which is covariant specialtypes_never.py:105: error: Incompatible return value type (got "ClassC[Never]", expected "ClassC[U]") [return-value] """ diff --git a/conformance/results/mypy/tuples_unpacked.toml b/conformance/results/mypy/tuples_unpacked.toml index 5f51cf2b6..bb864687a 100644 --- a/conformance/results/mypy/tuples_unpacked.toml +++ b/conformance/results/mypy/tuples_unpacked.toml @@ -1,15 +1,14 @@ conformant = "Partial" notes = """ -"More than one unpack" error is missing a line number. +"More than one unpack" error is missing in some cases. """ output = """ -tuples_unpacked.py: error: More than one Unpack in a type is not allowed [misc] +tuples_unpacked.py:40: error: More than one Unpack in a type is not allowed [misc] +tuples_unpacked.py:51: error: More than one Unpack in a type is not allowed [misc] tuples_unpacked.py:59: error: More than one Unpack in a type is not allowed [misc] """ conformance_automated = "Fail" errors_diff = """ -Line 40: Expected 1 errors Line 41: Expected 1 errors -Line 51: Expected 1 errors Lines 60, 61: Expected error (tag 't14') """ diff --git a/conformance/results/mypy/version.toml b/conformance/results/mypy/version.toml index 192bb6fbc..eb3ca14aa 100644 --- a/conformance/results/mypy/version.toml +++ b/conformance/results/mypy/version.toml @@ -1,2 +1,2 @@ -version = "mypy 1.15.0" -test_duration = 1.4 +version = "mypy 1.16.0" +test_duration = 1.7 diff --git a/conformance/results/pyre/aliases_newtype.toml b/conformance/results/pyre/aliases_newtype.toml index 86ab3d228..9dada2304 100644 --- a/conformance/results/pyre/aliases_newtype.toml +++ b/conformance/results/pyre/aliases_newtype.toml @@ -11,18 +11,19 @@ Does not reject use of NewType with Any. output = """ aliases_newtype.py:11:7 Incompatible parameter type [6]: In call `UserId.__init__`, for 1st positional argument, expected `int` but got `str`. aliases_newtype.py:12:0 Incompatible variable type [9]: u1 is declared to have type `UserId` but is used as type `int`. -aliases_newtype.py:38:5 Invalid type parameters [24]: Non-generic type `GoodNewType1` cannot take parameters. -aliases_newtype.py:44:37 Invalid inheritance [39]: `typing.Union[int, str]` is not a valid parent class. -aliases_newtype.py:51:37 Invalid inheritance [39]: `typing_extensions.Literal[7]` is not a valid parent class. -aliases_newtype.py:60:14 Too many arguments [19]: Call `NewType.__init__` expects 2 positional arguments, 3 were provided. +aliases_newtype.py:41:5 Invalid type parameters [24]: Non-generic type `GoodNewType1` cannot take parameters. +aliases_newtype.py:47:37 Invalid inheritance [39]: `typing.Union[int, str]` is not a valid parent class. +aliases_newtype.py:54:37 Invalid inheritance [39]: `typing_extensions.Literal[7]` is not a valid parent class. +aliases_newtype.py:63:14 Too many arguments [19]: Call `NewType.__init__` expects 2 positional arguments, 3 were provided. """ conformance_automated = "Fail" errors_diff = """ -Line 20: Expected 1 errors +Line 18: Expected 1 errors Line 23: Expected 1 errors -Line 32: Expected 1 errors -Line 47: Expected 1 errors -Line 49: Expected 1 errors -Line 58: Expected 1 errors -Line 62: Expected 1 errors +Line 26: Expected 1 errors +Line 35: Expected 1 errors +Line 50: Expected 1 errors +Line 52: Expected 1 errors +Line 61: Expected 1 errors +Line 65: Expected 1 errors """ diff --git a/conformance/results/pyre/version.toml b/conformance/results/pyre/version.toml index c759e78d0..bffc62991 100644 --- a/conformance/results/pyre/version.toml +++ b/conformance/results/pyre/version.toml @@ -1,2 +1,2 @@ version = "pyre 0.9.23" -test_duration = 10.7 +test_duration = 5.7 diff --git a/conformance/results/pyright/version.toml b/conformance/results/pyright/version.toml index e3b370522..9fe613445 100644 --- a/conformance/results/pyright/version.toml +++ b/conformance/results/pyright/version.toml @@ -1,2 +1,2 @@ version = "pyright 1.1.401" -test_duration = 1.0 +test_duration = 1.1 diff --git a/conformance/results/results.html b/conformance/results/results.html index c88562edd..6464e5c47 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -158,14 +158,14 @@

    Python Type System Conformance Test Results

     
    mypy 1.15.0
    -
    1.5sec
    +
    1.4sec
    pyright 1.1.400
    -
    1.1sec
    +
    pyright 1.1.401
    +
    1.0sec
    pyre 0.9.23
    -
    10.7sec
    +
    0.6sec
    @@ -422,8 +422,8 @@

    Python Type System Conformance Test Results

    Partial

    Incorrectly reports error for type alias defined with ParamSpec.

    Incorrectly rejects some valid type aliases when used in annotations.

    Incorrectly evaluates generic type alias with ParamSpec with missing type argument.

    Does not report invalid specialization of generic type aliases.

    Does not report error for attempt to instantiate union type alias.

    Does not report invalid specialization of already-specialized generic type alias.

         aliases_newtypePassPass
    Partial

    `NewType`s are considered classes, not functions.

    Partial

    `NewType`s are considered classes, not functions.

    Partial

    Does not reject use of NewType in `isinstance` call.

    Does not reject use of NewType in class definition statement.

    Does not report inconsistency between name of NewType and assigned identifier name.

    Does not reject use of NewType with generic class with TypeVar.

    Does not reject use of NewType with protocol class.

    Does not reject use of NewType with TypedDict class.

    Does not reject use of NewType with Any.

         aliases_recursive
    - + - - + - + - + @@ -2632,12 +2646,12 @@

    Python Type System Conformance Test Results

    - + - +
     
    mypy 1.15.0
    -
    1.4sec
    +
    mypy 1.16.0
    +
    1.7sec
    pyright 1.1.401
    -
    1.0sec
    +
    1.1sec
    pyre 0.9.23
    -
    0.6sec
    +
    5.7sec
    From 9e4ac4732438ecc1231a83ee0e6e0a8990046687 Mon Sep 17 00:00:00 2001 From: Daniil Kalinin Date: Fri, 6 Jun 2025 17:32:23 +0200 Subject: [PATCH 111/308] conformance: dataclasses_inheritance.py - add missing # E (#2017) * conformance: fix missing(?) # E error comment in dataclasses_inheritance.py * conformance: update the results after changes in `dataclasses_inheritance.py` --------- Co-authored-by: Daniil Kalinin --- .../results/mypy/dataclasses_inheritance.toml | 8 ++++++-- conformance/results/mypy/version.toml | 2 +- .../results/pyre/dataclasses_inheritance.toml | 2 ++ conformance/results/pyre/version.toml | 2 +- .../pyright/dataclasses_inheritance.toml | 8 ++++++-- conformance/results/pyright/version.toml | 2 +- conformance/results/results.html | 20 +++++++++---------- conformance/tests/dataclasses_inheritance.py | 2 +- 8 files changed, 28 insertions(+), 18 deletions(-) diff --git a/conformance/results/mypy/dataclasses_inheritance.toml b/conformance/results/mypy/dataclasses_inheritance.toml index 5f7dcc312..1345599e0 100644 --- a/conformance/results/mypy/dataclasses_inheritance.toml +++ b/conformance/results/mypy/dataclasses_inheritance.toml @@ -1,8 +1,12 @@ -conformant = "Pass" +conformant = "Partial" +notes = """ +Does not report when the default value of dataclass field is mutable (is of type list, dict, or set). +""" output = """ dataclasses_inheritance.py:60: error: Cannot override instance variable (previously declared on base class "DC6") with class variable [misc] dataclasses_inheritance.py:64: error: Cannot override class variable (previously declared on base class "DC6") with instance variable [misc] """ -conformance_automated = "Pass" +conformance_automated = "Fail" errors_diff = """ +Line 47: Expected 1 errors """ diff --git a/conformance/results/mypy/version.toml b/conformance/results/mypy/version.toml index eb3ca14aa..a62332be1 100644 --- a/conformance/results/mypy/version.toml +++ b/conformance/results/mypy/version.toml @@ -1,2 +1,2 @@ version = "mypy 1.16.0" -test_duration = 1.7 +test_duration = 2.0 diff --git a/conformance/results/pyre/dataclasses_inheritance.toml b/conformance/results/pyre/dataclasses_inheritance.toml index eb0547dd5..4ace5b68c 100644 --- a/conformance/results/pyre/dataclasses_inheritance.toml +++ b/conformance/results/pyre/dataclasses_inheritance.toml @@ -1,5 +1,6 @@ conformant = "Partial" notes = """ +Does not report when the default value of dataclass field is mutable (is of type list, dict, or set). Does not reject ClassVar that is overridden by instance variable. Does not reject instance variable that is overridden by ClassVar. """ @@ -7,6 +8,7 @@ output = """ """ conformance_automated = "Fail" errors_diff = """ +Line 47: Expected 1 errors Line 60: Expected 1 errors Line 64: Expected 1 errors """ diff --git a/conformance/results/pyre/version.toml b/conformance/results/pyre/version.toml index bffc62991..5b949f6ad 100644 --- a/conformance/results/pyre/version.toml +++ b/conformance/results/pyre/version.toml @@ -1,2 +1,2 @@ version = "pyre 0.9.23" -test_duration = 5.7 +test_duration = 9.1 diff --git a/conformance/results/pyright/dataclasses_inheritance.toml b/conformance/results/pyright/dataclasses_inheritance.toml index a77817ee2..935f8e918 100644 --- a/conformance/results/pyright/dataclasses_inheritance.toml +++ b/conformance/results/pyright/dataclasses_inheritance.toml @@ -1,8 +1,12 @@ -conformant = "Pass" +conformant = "Partial" +notes = """ +Does not report when the default value of dataclass field is mutable (is of type list, dict, or set). +""" output = """ dataclasses_inheritance.py:60:5 - error: Class variable "x" overrides instance variable of same name in class "DC6" (reportIncompatibleVariableOverride) dataclasses_inheritance.py:64:5 - error: Instance variable "y" overrides class variable of same name in class "DC6" (reportIncompatibleVariableOverride) """ -conformance_automated = "Pass" +conformance_automated = "Fail" errors_diff = """ +Line 47: Expected 1 errors """ diff --git a/conformance/results/pyright/version.toml b/conformance/results/pyright/version.toml index 9fe613445..32f55ae40 100644 --- a/conformance/results/pyright/version.toml +++ b/conformance/results/pyright/version.toml @@ -1,2 +1,2 @@ version = "pyright 1.1.401" -test_duration = 1.1 +test_duration = 1.4 diff --git a/conformance/results/results.html b/conformance/results/results.html index 6464e5c47..b50f2db9d 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -159,13 +159,13 @@

    Python Type System Conformance Test Results

    - + @@ -404,7 +404,7 @@

    Python Type System Conformance Test Results

    - + @@ -597,7 +597,7 @@

    Python Type System Conformance Test Results

    - + @@ -643,9 +643,9 @@

    Python Type System Conformance Test Results

    - - - + + + @@ -779,7 +779,7 @@

    Python Type System Conformance Test Results

    - + diff --git a/conformance/tests/dataclasses_inheritance.py b/conformance/tests/dataclasses_inheritance.py index 7468e379c..fe6263e68 100644 --- a/conformance/tests/dataclasses_inheritance.py +++ b/conformance/tests/dataclasses_inheritance.py @@ -44,7 +44,7 @@ class DC4(DC3): class DC5: # This should generate an error because a default value of # type list, dict, or set generate a runtime error. - x: list[int] = [] + x: list[int] = [] # E @dataclass From d25bc6c90cf4afc4b7e6a50f42da2cdd494ee7b1 Mon Sep 17 00:00:00 2001 From: Eric Traut Date: Tue, 17 Jun 2025 10:08:15 -0700 Subject: [PATCH 112/308] Removed mandatory enforcement of a dataclass check (#2022) Removed mandatory enforcement of "default value type of list, dict, or set" for dataclass fields in the `dataclasses_inheritance` test. This error is now optional for type checkers. Also fixed the conformance summary for pyright in the `aliases_typealiastype` test, which was out of date and didn't reflect the fact that pyright now passes this test. --- .../results/mypy/dataclasses_inheritance.toml | 12 ++++-------- conformance/results/mypy/version.toml | 2 +- .../results/pyre/dataclasses_inheritance.toml | 6 ++---- conformance/results/pyre/version.toml | 2 +- .../results/pyright/aliases_typealiastype.toml | 5 +---- .../results/pyright/dataclasses_inheritance.toml | 12 ++++-------- conformance/results/pyright/version.toml | 2 +- conformance/results/results.html | 14 +++++++------- conformance/tests/dataclasses_inheritance.py | 8 +++++--- 9 files changed, 26 insertions(+), 37 deletions(-) diff --git a/conformance/results/mypy/dataclasses_inheritance.toml b/conformance/results/mypy/dataclasses_inheritance.toml index 1345599e0..c90115220 100644 --- a/conformance/results/mypy/dataclasses_inheritance.toml +++ b/conformance/results/mypy/dataclasses_inheritance.toml @@ -1,12 +1,8 @@ -conformant = "Partial" -notes = """ -Does not report when the default value of dataclass field is mutable (is of type list, dict, or set). -""" +conformant = "Pass" output = """ -dataclasses_inheritance.py:60: error: Cannot override instance variable (previously declared on base class "DC6") with class variable [misc] -dataclasses_inheritance.py:64: error: Cannot override class variable (previously declared on base class "DC6") with instance variable [misc] +dataclasses_inheritance.py:62: error: Cannot override instance variable (previously declared on base class "DC6") with class variable [misc] +dataclasses_inheritance.py:66: error: Cannot override class variable (previously declared on base class "DC6") with instance variable [misc] """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 47: Expected 1 errors """ diff --git a/conformance/results/mypy/version.toml b/conformance/results/mypy/version.toml index a62332be1..eb3ca14aa 100644 --- a/conformance/results/mypy/version.toml +++ b/conformance/results/mypy/version.toml @@ -1,2 +1,2 @@ version = "mypy 1.16.0" -test_duration = 2.0 +test_duration = 1.7 diff --git a/conformance/results/pyre/dataclasses_inheritance.toml b/conformance/results/pyre/dataclasses_inheritance.toml index 4ace5b68c..1afca3581 100644 --- a/conformance/results/pyre/dataclasses_inheritance.toml +++ b/conformance/results/pyre/dataclasses_inheritance.toml @@ -1,6 +1,5 @@ conformant = "Partial" notes = """ -Does not report when the default value of dataclass field is mutable (is of type list, dict, or set). Does not reject ClassVar that is overridden by instance variable. Does not reject instance variable that is overridden by ClassVar. """ @@ -8,7 +7,6 @@ output = """ """ conformance_automated = "Fail" errors_diff = """ -Line 47: Expected 1 errors -Line 60: Expected 1 errors -Line 64: Expected 1 errors +Line 62: Expected 1 errors +Line 66: Expected 1 errors """ diff --git a/conformance/results/pyre/version.toml b/conformance/results/pyre/version.toml index 5b949f6ad..cda658b76 100644 --- a/conformance/results/pyre/version.toml +++ b/conformance/results/pyre/version.toml @@ -1,2 +1,2 @@ version = "pyre 0.9.23" -test_duration = 9.1 +test_duration = 6.6 diff --git a/conformance/results/pyright/aliases_typealiastype.toml b/conformance/results/pyright/aliases_typealiastype.toml index e0f4a8c93..8bd8d47da 100644 --- a/conformance/results/pyright/aliases_typealiastype.toml +++ b/conformance/results/pyright/aliases_typealiastype.toml @@ -1,7 +1,4 @@ -conformant = "Partial" -notes = """ -Incorrectly allows undefined self reference. -""" +conformant = "Pass" output = """ aliases_typealiastype.py:32:18 - error: Cannot access attribute "other_attrib" for class "TypeAliasType"   Attribute "other_attrib" is unknown (reportAttributeAccessIssue) diff --git a/conformance/results/pyright/dataclasses_inheritance.toml b/conformance/results/pyright/dataclasses_inheritance.toml index 935f8e918..8576bb702 100644 --- a/conformance/results/pyright/dataclasses_inheritance.toml +++ b/conformance/results/pyright/dataclasses_inheritance.toml @@ -1,12 +1,8 @@ -conformant = "Partial" -notes = """ -Does not report when the default value of dataclass field is mutable (is of type list, dict, or set). -""" +conformant = "Pass" output = """ -dataclasses_inheritance.py:60:5 - error: Class variable "x" overrides instance variable of same name in class "DC6" (reportIncompatibleVariableOverride) -dataclasses_inheritance.py:64:5 - error: Instance variable "y" overrides class variable of same name in class "DC6" (reportIncompatibleVariableOverride) +dataclasses_inheritance.py:62:5 - error: Class variable "x" overrides instance variable of same name in class "DC6" (reportIncompatibleVariableOverride) +dataclasses_inheritance.py:66:5 - error: Instance variable "y" overrides class variable of same name in class "DC6" (reportIncompatibleVariableOverride) """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 47: Expected 1 errors """ diff --git a/conformance/results/pyright/version.toml b/conformance/results/pyright/version.toml index 32f55ae40..e3b370522 100644 --- a/conformance/results/pyright/version.toml +++ b/conformance/results/pyright/version.toml @@ -1,2 +1,2 @@ version = "pyright 1.1.401" -test_duration = 1.4 +test_duration = 1.0 diff --git a/conformance/results/results.html b/conformance/results/results.html index b50f2db9d..1903a7bfd 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -159,13 +159,13 @@

    Python Type System Conformance Test Results

     
    mypy 1.16.0
    -
    1.7sec
    +
    2.0sec
    pyright 1.1.401
    -
    1.1sec
    +
    1.4sec
    pyre 0.9.23
    -
    5.7sec
    +
    9.1sec
    @@ -353,7 +353,7 @@

    Python Type System Conformance Test Results

    Unsupported

    Does not support star expressions for `Unpack`.

         generics_typevartuple_specialization
    Partial

    Incorrectly specializes generic alias that includes a TypeVar and TypeVarTuple if no type arguments are provided.

    Rejects specialization of generic type alias defined as a tuple containing a TypeVar.

    "More than one Unpack" error message has no line number.

    Partial

    Incorrectly specializes generic alias that includes a TypeVar and TypeVarTuple if no type arguments are provided.

    Rejects specialization of generic type alias defined as a tuple containing a TypeVar.

    Pass
    Unsupported

    Does not support star expressions for `Unpack`.

    Partial

    Does not reject use of TypeVar in ClassVar.

    Does not reject use of ParamSpec in ClassVar.

    Does not reject use of ClassVar as a generic type argument.

    Does not reject use of ClassVar in parameter type annotation.

    Does not reject use of ClassVar in local variable annotation.

    Does not reject use of ClassVar in instance variable annotation.

    Does not reject use of ClassVar in return type annotation.

    Does not reject use of ClassVar in type alias definition.

    Does not infer type from initialization for bare ClassVar.

         classes_override
    Partial

    Does not handle case where parent class derives from Any.

    Pass Pass Pass
    Partial

    Does not apply decorator transforms before checking overload consistency.

         overloads_definitions
    Partial

    Does not allow an overload with no implementation in an abstract base class.

    Allows @override to be on all overloads and implementation, instead of just implementation.

    Partial

    Allows @override to be on all overloads and implementation, instead of just implementation.

    Pass
    Partial

    Does not allow an overload with no implementation in a Protocol or an abstract base class.

    Expects @final/@override on all overloads and implementation, instead of implementation only.

    Partial

    Does not report when dataclass is not compatible with Hashable protocol.

         dataclasses_inheritancePassPass
    Partial

    Does not reject ClassVar that is overridden by instance variable.

    Does not reject instance variable that is overridden by ClassVar.

    Partial

    Does not report when the default value of dataclass field is mutable (is of type list, dict, or set).

    Partial

    Does not report when the default value of dataclass field is mutable (is of type list, dict, or set).

    Partial

    Does not report when the default value of dataclass field is mutable (is of type list, dict, or set).

    Does not reject ClassVar that is overridden by instance variable.

    Does not reject instance variable that is overridden by ClassVar.

         dataclasses_kwonly
    Partial

    Incorrectly rejects kw_only field with default before positional field.

    Pass
         tuples_unpacked
    Partial

    "More than one unpack" error is missing a line number.

    Partial

    "More than one unpack" error is missing in some cases.

    Pass Pass
    - + @@ -643,9 +643,9 @@

    Python Type System Conformance Test Results

    - - - + + + diff --git a/conformance/tests/dataclasses_inheritance.py b/conformance/tests/dataclasses_inheritance.py index fe6263e68..3ed0b88db 100644 --- a/conformance/tests/dataclasses_inheritance.py +++ b/conformance/tests/dataclasses_inheritance.py @@ -42,9 +42,11 @@ class DC4(DC3): @dataclass class DC5: - # This should generate an error because a default value of - # type list, dict, or set generate a runtime error. - x: list[int] = [] # E + # While this generates an error at runtime for the stdlib dataclass, + # other libraries that use dataclass_transform don't have similar + # restrictions. It is therefore not required that a type checker + # report an error here. + x: list[int] = [] # E? @dataclass From 3b987a9612283c759a97e9a13399ac20ccf22d85 Mon Sep 17 00:00:00 2001 From: Shantanu <12621235+hauntsaninja@users.noreply.github.com> Date: Sat, 21 Jun 2025 11:54:26 -0700 Subject: [PATCH 113/308] Permit inferring Self for unannotated self (#1860) Co-authored-by: Carl Meyer --- docs/spec/annotations.rst | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/spec/annotations.rst b/docs/spec/annotations.rst index e4bea9116..7f8f599e2 100644 --- a/docs/spec/annotations.rst +++ b/docs/spec/annotations.rst @@ -32,14 +32,10 @@ functions with no annotations, but this behavior is not required. It is recommended but not required that checked functions have annotations for all arguments and the return type. For a checked function, the default annotation for arguments and for the return type -is ``Any``. An exception is the first argument of instance and -class methods. If it is not annotated, then it is assumed to have the -type of the containing class for instance methods, and a type object -type corresponding to the containing class object for class methods. -For example, in class ``A`` the first argument of an instance method -has the implicit type ``A``. In a class method, the precise type of -the first argument cannot be represented using the available type -notation. +is ``Any``. An exception to the above is the first argument of +instance and class methods (conventionally named ``self`` or ``cls``), +which type checkers should assume to have an appropriate type, as per +:ref:`annotating-methods`. (Note that the return type of ``__init__`` ought to be annotated with ``-> None``. The reason for this is subtle. If ``__init__`` assumed @@ -358,10 +354,14 @@ types cannot be specified:: Annotating instance and class methods ------------------------------------- -In most cases the first argument of class and instance methods -does not need to be annotated, and it is assumed to have the -type of the containing class for instance methods, and a type object -type corresponding to the containing class object for class methods. +In most cases the first argument of instance and class methods +(conventionally named ``self`` or ``cls``) does not need to be annotated. + +If the argument is not annotated, then for instance methods it may be +inferred to have either the type of the containing class, or the type :ref:`Self +`. For class methods it may be inferred to have either the type object +type corresponding to the containing class object, or ``type[Self]``. + In addition, the first argument in an instance method can be annotated with a type variable. In this case the return type may use the same type variable, thus making that method a generic function. For example:: From b806c04133760efee732ce5081b177d84def22fe Mon Sep 17 00:00:00 2001 From: Marcell Perger <102254594+MarcellPerger1@users.noreply.github.com> Date: Fri, 27 Jun 2025 19:28:59 +0100 Subject: [PATCH 114/308] Make syntax example render as code (#2033) --- docs/guides/writing_stubs.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guides/writing_stubs.rst b/docs/guides/writing_stubs.rst index 605750d08..0cbf6a7c2 100644 --- a/docs/guides/writing_stubs.rst +++ b/docs/guides/writing_stubs.rst @@ -495,7 +495,7 @@ more concise files. Syntax Example -------------- -The below is an excerpt from the types for the ``datetime`` module. +The below is an excerpt from the types for the ``datetime`` module:: MAXYEAR: int MINYEAR: int From 3fc17d1505b2fff2268c73200ed5317ae0b0a736 Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Sun, 29 Jun 2025 07:47:57 -0700 Subject: [PATCH 115/308] update results for new pyright version (#2035) --- conformance/results/mypy/version.toml | 4 ++-- conformance/results/pyre/version.toml | 2 +- conformance/results/pyright/aliases_newtype.toml | 15 +++++++++------ .../results/pyright/generics_type_erasure.toml | 9 +++------ .../results/pyright/protocols_definition.toml | 2 +- conformance/results/pyright/version.toml | 4 ++-- conformance/results/results.html | 10 +++++----- 7 files changed, 23 insertions(+), 23 deletions(-) diff --git a/conformance/results/mypy/version.toml b/conformance/results/mypy/version.toml index eb3ca14aa..d3740879d 100644 --- a/conformance/results/mypy/version.toml +++ b/conformance/results/mypy/version.toml @@ -1,2 +1,2 @@ -version = "mypy 1.16.0" -test_duration = 1.7 +version = "mypy 1.16.1" +test_duration = 2.2 diff --git a/conformance/results/pyre/version.toml b/conformance/results/pyre/version.toml index cda658b76..c759e78d0 100644 --- a/conformance/results/pyre/version.toml +++ b/conformance/results/pyre/version.toml @@ -1,2 +1,2 @@ version = "pyre 0.9.23" -test_duration = 6.6 +test_duration = 10.7 diff --git a/conformance/results/pyright/aliases_newtype.toml b/conformance/results/pyright/aliases_newtype.toml index a0a12c0cd..00a5767c3 100644 --- a/conformance/results/pyright/aliases_newtype.toml +++ b/conformance/results/pyright/aliases_newtype.toml @@ -1,12 +1,16 @@ -conformant = "Partial" -notes = """ -`NewType`s are considered classes, not functions. -""" +conformant = "Pass" output = """ aliases_newtype.py:11:8 - error: Argument of type "Literal['user']" cannot be assigned to parameter "_x" of type "int" in function "__init__"   "Literal['user']" is not assignable to "int" (reportArgumentType) aliases_newtype.py:12:14 - error: Type "Literal[42]" is not assignable to declared type "UserId"   "Literal[42]" is not assignable to "UserId" (reportAssignmentType) +aliases_newtype.py:18:11 - error: Type "type[UserId]" is not assignable to declared type "type" +  "FunctionType" is not assignable to "type" (reportAssignmentType) +aliases_newtype.py:23:16 - error: Argument of type "type[UserId]" cannot be assigned to parameter "class_or_tuple" of type "_ClassInfo" in function "isinstance" +  Type "FunctionType" is not assignable to type "_ClassInfo" +    "FunctionType" is not assignable to "type" +    "FunctionType" is not assignable to "UnionType" +    "FunctionType" is not assignable to "tuple[_ClassInfo, ...]" (reportArgumentType) aliases_newtype.py:23:16 - error: Second argument to "isinstance" must be a class or tuple of classes   Class created with NewType cannot be used with instance and class checks (reportArgumentType) aliases_newtype.py:26:21 - error: Base class "UserId" is marked final and cannot be subclassed (reportGeneralTypeIssues) @@ -20,7 +24,6 @@ aliases_newtype.py:61:38 - error: NewType cannot be used with structural type (a aliases_newtype.py:63:15 - error: NewType requires two positional arguments (reportCallIssue) aliases_newtype.py:65:38 - error: The second argument to NewType must be a known class, not Any or Unknown (reportGeneralTypeIssues) """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 18: Expected 1 errors """ diff --git a/conformance/results/pyright/generics_type_erasure.toml b/conformance/results/pyright/generics_type_erasure.toml index 0cddc4876..cbbc0d1c6 100644 --- a/conformance/results/pyright/generics_type_erasure.toml +++ b/conformance/results/pyright/generics_type_erasure.toml @@ -1,7 +1,4 @@ -conformant = "Partial" -notes = """ -Missing error regarding `type(instance).generic_attribute`. -""" +conformant = "Pass" output = """ generics_type_erasure.py:38:16 - error: Argument of type "Literal['']" cannot be assigned to parameter "label" of type "int | None" in function "__init__"   Type "Literal['']" is not assignable to type "int | None" @@ -15,8 +12,8 @@ generics_type_erasure.py:42:11 - error: Access to generic instance variable thro generics_type_erasure.py:43:11 - error: Access to generic instance variable through class is ambiguous (reportGeneralTypeIssues) generics_type_erasure.py:44:6 - error: Access to generic instance variable through class is ambiguous (reportGeneralTypeIssues) generics_type_erasure.py:45:6 - error: Access to generic instance variable through class is ambiguous (reportGeneralTypeIssues) +generics_type_erasure.py:46:10 - error: Access to generic instance variable through class is ambiguous (reportGeneralTypeIssues) """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 46: Expected 1 errors """ diff --git a/conformance/results/pyright/protocols_definition.toml b/conformance/results/pyright/protocols_definition.toml index 0ed86d0ff..b8252b8f7 100644 --- a/conformance/results/pyright/protocols_definition.toml +++ b/conformance/results/pyright/protocols_definition.toml @@ -46,7 +46,7 @@ protocols_definition.py:160:22 - error: Type "Concrete3_Bad5" is not assignable protocols_definition.py:218:22 - error: Type "Concrete4_Bad1" is not assignable to declared type "Template4"   "Concrete4_Bad1" is incompatible with protocol "Template4"     "val1" is an incompatible type -      "FunctionType" is not assignable to "Sequence[float]" (reportAssignmentType) +      "MethodType" is not assignable to "Sequence[float]" (reportAssignmentType) protocols_definition.py:219:22 - error: Type "Concrete4_Bad2" is not assignable to declared type "Template4"   "Concrete4_Bad2" is incompatible with protocol "Template4"     "val1" is not present (reportAssignmentType) diff --git a/conformance/results/pyright/version.toml b/conformance/results/pyright/version.toml index e3b370522..ca4eb79ca 100644 --- a/conformance/results/pyright/version.toml +++ b/conformance/results/pyright/version.toml @@ -1,2 +1,2 @@ -version = "pyright 1.1.401" -test_duration = 1.0 +version = "pyright 1.1.402" +test_duration = 1.8 diff --git a/conformance/results/results.html b/conformance/results/results.html index 1903a7bfd..4cc4ea005 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -158,14 +158,14 @@

    Python Type System Conformance Test Results

     
    mypy 1.16.0
    -
    2.0sec
    +
    1.7sec
    pyright 1.1.401
    -
    1.4sec
    +
    1.0sec
    pyre 0.9.23
    -
    9.1sec
    +
    6.6sec
    @@ -438,7 +438,7 @@

    Python Type System Conformance Test Results

         aliases_typealiastype
    Partial

    Incorrectly rejects some recursive type aliases using TypeAliasType.

    Incorrectly rejects the use of a class-scoped TypeVar in a TypeAliasType definition.

    Partial

    Incorrectly allows undefined self reference.

    Pass
    Unsupported

    Support for TypeAliasType is not implemented.

         aliases_variance
    Partial

    Does not report when dataclass is not compatible with Hashable protocol.

         dataclasses_inheritance
    Partial

    Does not report when the default value of dataclass field is mutable (is of type list, dict, or set).

    Partial

    Does not report when the default value of dataclass field is mutable (is of type list, dict, or set).

    Partial

    Does not report when the default value of dataclass field is mutable (is of type list, dict, or set).

    Does not reject ClassVar that is overridden by instance variable.

    Does not reject instance variable that is overridden by ClassVar.

    PassPass
    Partial

    Does not reject ClassVar that is overridden by instance variable.

    Does not reject instance variable that is overridden by ClassVar.

         dataclasses_kwonly
    Partial

    Incorrectly rejects kw_only field with default before positional field.

    - - + + - - - - - + + + + - - - - + + + @@ -2602,12 +2632,12 @@

    Python Type System Conformance Test Results

    - - - - - + + + + +
     
    mypy 1.16.0
    -
    1.7sec
    +
    mypy 1.16.1
    +
    2.2sec
    pyright 1.1.401
    -
    1.0sec
    +
    pyright 1.1.402
    +
    1.8sec
    pyre 0.9.23
    -
    6.6sec
    +
    10.7sec
    From 2d88da2a407b556f5b52b4c6ad1bd659873bb9ac Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Tue, 15 Jul 2025 12:16:13 -0700 Subject: [PATCH 116/308] Clean up @deprecated spec (#2044) --- docs/spec/directives.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/spec/directives.rst b/docs/spec/directives.rst index 62e1b3c4f..3693af494 100644 --- a/docs/spec/directives.rst +++ b/docs/spec/directives.rst @@ -170,7 +170,8 @@ The decorator takes the following arguments: * A required positional-only argument representing the deprecation message. * Two keyword-only arguments, ``category`` and ``stacklevel``, controlling - runtime behavior (see under "Runtime behavior" below). + runtime behavior. These are not relevant to type checker behavior so they are + not further described in this specification. The positional-only argument is of type ``str`` and contains a message that should be shown by the type checker when it encounters a usage of the decorated object. From e35ffb66d6fe8c72f39c2df58e765b3e8598e41a Mon Sep 17 00:00:00 2001 From: Rebecca Chen Date: Mon, 21 Jul 2025 15:00:33 -0700 Subject: [PATCH 117/308] Update conformance results for mypy 1.17.0 and pyre 0.9.25. (#2055) * Update conformance results for mypy 1.17.0 and pyre 0.9.25. I ran the conformance tests and noticed that the results have changed a bit for the latest versions of mypy and pyre. * Update manual conformance result. * Remove stale notes. * Rerun 'python main.py' after change to manual grading. --- .../results/mypy/aliases_recursive.toml | 2 +- .../results/mypy/classes_classvar.toml | 2 +- .../results/mypy/dataclasses_kwonly.toml | 19 ++----------------- .../results/mypy/directives_reveal_type.toml | 2 +- conformance/results/mypy/version.toml | 4 ++-- .../generics_paramspec_specialization.toml | 4 ---- conformance/results/pyre/version.toml | 4 ++-- conformance/results/pyright/version.toml | 4 ++-- conformance/results/results.html | 18 +++++++++--------- 9 files changed, 20 insertions(+), 39 deletions(-) diff --git a/conformance/results/mypy/aliases_recursive.toml b/conformance/results/mypy/aliases_recursive.toml index 01af644dc..5272c3212 100644 --- a/conformance/results/mypy/aliases_recursive.toml +++ b/conformance/results/mypy/aliases_recursive.toml @@ -6,7 +6,7 @@ aliases_recursive.py:38: error: Incompatible types in assignment (expression has aliases_recursive.py:39: error: Name "t6" already defined on line 38 [no-redef] aliases_recursive.py:50: error: Dict entry 0 has incompatible type "str": "list[int]"; expected "str": "str | int | Mapping[str, RecursiveMapping]" [dict-item] aliases_recursive.py:51: error: Dict entry 2 has incompatible type "str": "list[int]"; expected "str": "str | int | Mapping[str, RecursiveMapping]" [dict-item] -aliases_recursive.py:52: error: Dict entry 2 has incompatible type "str": "list[int]"; expected "str": "str | int | Mapping[str, RecursiveMapping]" [dict-item] +aliases_recursive.py:52: error: Dict entry 2 has incompatible type "str": "dict[str, str | int | list[int]]"; expected "str": "str | int | Mapping[str, RecursiveMapping]" [dict-item] aliases_recursive.py:63: error: List item 0 has incompatible type "float"; expected "GenericTypeAlias1[str] | str" [list-item] aliases_recursive.py:69: error: List item 0 has incompatible type "float"; expected "GenericTypeAlias2[str, int] | str | int" [list-item] aliases_recursive.py:72: error: Invalid recursive alias: a union item of itself [misc] diff --git a/conformance/results/mypy/classes_classvar.toml b/conformance/results/mypy/classes_classvar.toml index 0d9662ecf..0072d63f1 100644 --- a/conformance/results/mypy/classes_classvar.toml +++ b/conformance/results/mypy/classes_classvar.toml @@ -20,6 +20,7 @@ classes_classvar.py:70: error: ClassVar can only be used for assignments in clas classes_classvar.py:71: error: ClassVar can only be used for assignments in class body [misc] classes_classvar.py:73: error: ClassVar can only be used for assignments in class body [misc] classes_classvar.py:77: error: ClassVar can only be used for assignments in class body [misc] +classes_classvar.py:78: error: ClassVar[...] can't be used inside a type alias [valid-type] classes_classvar.py:111: error: Cannot assign to class variable "stats" via instance [misc] classes_classvar.py:140: error: Incompatible types in assignment (expression has type "ProtoAImpl", variable has type "ProtoA") [assignment] classes_classvar.py:140: note: "ProtoAImpl" is missing following "ProtoA" protocol member: @@ -30,6 +31,5 @@ classes_classvar.py:140: note: Protocol member ProtoA.y expected class variable, conformance_automated = "Fail" errors_diff = """ Line 47: Expected 1 errors -Line 78: Expected 1 errors Line 67: Unexpected errors ['classes_classvar.py:67: error: Invalid type: ClassVar nested inside other type [valid-type]'] """ diff --git a/conformance/results/mypy/dataclasses_kwonly.toml b/conformance/results/mypy/dataclasses_kwonly.toml index 118448df3..9f83cef04 100644 --- a/conformance/results/mypy/dataclasses_kwonly.toml +++ b/conformance/results/mypy/dataclasses_kwonly.toml @@ -1,24 +1,9 @@ -conformant = "Partial" -notes = """ -Incorrectly rejects kw_only field with default before positional field. -""" +conformant = "Pass" output = """ dataclasses_kwonly.py:23: error: Too many positional arguments for "DC1" [misc] -dataclasses_kwonly.py:29: error: Attributes without a default cannot follow attributes with one [misc] -dataclasses_kwonly.py:32: error: Too many positional arguments for "DC2" [misc] -dataclasses_kwonly.py:32: error: Too few arguments for "DC2" [call-arg] -dataclasses_kwonly.py:32: error: Argument 1 to "DC2" has incompatible type "str"; expected "int" [arg-type] -dataclasses_kwonly.py:35: error: "DC2" gets multiple values for keyword argument "b" [misc] -dataclasses_kwonly.py:35: error: Too few arguments for "DC2" [call-arg] -dataclasses_kwonly.py:35: error: Argument 1 to "DC2" has incompatible type "str"; expected "int" [arg-type] dataclasses_kwonly.py:38: error: Too many positional arguments for "DC2" [misc] -dataclasses_kwonly.py:38: error: Argument 1 to "DC2" has incompatible type "str"; expected "int" [arg-type] -dataclasses_kwonly.py:38: error: Argument 2 to "DC2" has incompatible type "int"; expected "str" [arg-type] dataclasses_kwonly.py:53: error: Too many positional arguments for "DC3" [misc] """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 29: Unexpected errors ['dataclasses_kwonly.py:29: error: Attributes without a default cannot follow attributes with one [misc]'] -Line 32: Unexpected errors ['dataclasses_kwonly.py:32: error: Too many positional arguments for "DC2" [misc]', 'dataclasses_kwonly.py:32: error: Too few arguments for "DC2" [call-arg]', 'dataclasses_kwonly.py:32: error: Argument 1 to "DC2" has incompatible type "str"; expected "int" [arg-type]'] -Line 35: Unexpected errors ['dataclasses_kwonly.py:35: error: "DC2" gets multiple values for keyword argument "b" [misc]', 'dataclasses_kwonly.py:35: error: Too few arguments for "DC2" [call-arg]', 'dataclasses_kwonly.py:35: error: Argument 1 to "DC2" has incompatible type "str"; expected "int" [arg-type]'] """ diff --git a/conformance/results/mypy/directives_reveal_type.toml b/conformance/results/mypy/directives_reveal_type.toml index 8621a0083..c5853ba33 100644 --- a/conformance/results/mypy/directives_reveal_type.toml +++ b/conformance/results/mypy/directives_reveal_type.toml @@ -1,6 +1,6 @@ conformant = "Pass" output = """ -directives_reveal_type.py:14: note: Revealed type is "Union[builtins.int, builtins.str]" +directives_reveal_type.py:14: note: Revealed type is "builtins.int | builtins.str" directives_reveal_type.py:15: note: Revealed type is "builtins.list[builtins.int]" directives_reveal_type.py:16: note: Revealed type is "Any" directives_reveal_type.py:17: note: Revealed type is "directives_reveal_type.ForwardReference" diff --git a/conformance/results/mypy/version.toml b/conformance/results/mypy/version.toml index d3740879d..a9b73efe7 100644 --- a/conformance/results/mypy/version.toml +++ b/conformance/results/mypy/version.toml @@ -1,2 +1,2 @@ -version = "mypy 1.16.1" -test_duration = 2.2 +version = "mypy 1.17.0" +test_duration = 2.7 diff --git a/conformance/results/pyre/generics_paramspec_specialization.toml b/conformance/results/pyre/generics_paramspec_specialization.toml index 34a215ee6..d4da441aa 100644 --- a/conformance/results/pyre/generics_paramspec_specialization.toml +++ b/conformance/results/pyre/generics_paramspec_specialization.toml @@ -3,8 +3,6 @@ notes = """ Reports error for legitimate use of `...` to specialize ParamSpec """ output = """ -generics_paramspec_specialization.py:32:14 Invalid type parameters [24]: Callable parameters expected for parameter specification `P2`, but a single type `...` was given for generic type ClassB. -generics_paramspec_specialization.py:36:14 Invalid type parameters [24]: Callable parameters expected for parameter specification `P1`, but a single type `...` was given for generic type ClassA. generics_paramspec_specialization.py:44:14 Invalid type parameters [24]: Callable parameters expected for parameter specification `P1`, but a single type `int` was given for generic type ClassA. generics_paramspec_specialization.py:53:4 Too many arguments [19]: PositionalOnly call expects 2 positional arguments, 3 were provided. generics_paramspec_specialization.py:54:4 Too many arguments [19]: PositionalOnly call expects 2 positional arguments, 3 were provided. @@ -15,8 +13,6 @@ generics_paramspec_specialization.py:61:4 Too many arguments [19]: PositionalOnl """ conformance_automated = "Fail" errors_diff = """ -Line 32: Unexpected errors ['generics_paramspec_specialization.py:32:14 Invalid type parameters [24]: Callable parameters expected for parameter specification `P2`, but a single type `...` was given for generic type ClassB.'] -Line 36: Unexpected errors ['generics_paramspec_specialization.py:36:14 Invalid type parameters [24]: Callable parameters expected for parameter specification `P1`, but a single type `...` was given for generic type ClassA.'] Line 53: Unexpected errors ['generics_paramspec_specialization.py:53:4 Too many arguments [19]: PositionalOnly call expects 2 positional arguments, 3 were provided.'] Line 59: Unexpected errors ['generics_paramspec_specialization.py:59:4 Too many arguments [19]: PositionalOnly call expects 2 positional arguments, 3 were provided.'] """ diff --git a/conformance/results/pyre/version.toml b/conformance/results/pyre/version.toml index c759e78d0..02af2cfe9 100644 --- a/conformance/results/pyre/version.toml +++ b/conformance/results/pyre/version.toml @@ -1,2 +1,2 @@ -version = "pyre 0.9.23" -test_duration = 10.7 +version = "pyre 0.9.25" +test_duration = 3.9 diff --git a/conformance/results/pyright/version.toml b/conformance/results/pyright/version.toml index ca4eb79ca..a5b181d82 100644 --- a/conformance/results/pyright/version.toml +++ b/conformance/results/pyright/version.toml @@ -1,2 +1,2 @@ -version = "pyright 1.1.402" -test_duration = 1.8 +version = "pyright 1.1.403" +test_duration = 5.6 diff --git a/conformance/results/results.html b/conformance/results/results.html index 4cc4ea005..7b4f244ca 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -158,14 +158,14 @@

    Python Type System Conformance Test Results

    - - - - + @@ -423,7 +423,7 @@

    Python Type System Conformance Test Results

    - + @@ -648,7 +648,7 @@

    Python Type System Conformance Test Results

    - + From d4f39b27a4a47aac8b6d4019e1b0b5b3156fabdc Mon Sep 17 00:00:00 2001 From: Danny Yang Date: Tue, 22 Jul 2025 19:23:18 -0400 Subject: [PATCH 118/308] Edit error marker comments on some tests (#2048) * edit error markers and regenerate results * Add back newline * Add back newline --------- Co-authored-by: Rebecca Chen --- conformance/results/mypy/enums_behaviors.toml | 4 +++- conformance/results/mypy/version.toml | 2 +- conformance/results/pyre/enums_behaviors.toml | 4 +++- .../results/pyre/qualifiers_final_decorator.toml | 4 ++-- conformance/results/pyre/version.toml | 2 +- conformance/results/pyright/enums_behaviors.toml | 4 +++- conformance/results/pyright/version.toml | 2 +- conformance/results/results.html | 6 +++--- conformance/tests/enums_behaviors.py | 11 ++++++++--- conformance/tests/qualifiers_final_decorator.py | 6 +++--- 10 files changed, 28 insertions(+), 17 deletions(-) diff --git a/conformance/results/mypy/enums_behaviors.toml b/conformance/results/mypy/enums_behaviors.toml index 80498e652..a3193b611 100644 --- a/conformance/results/mypy/enums_behaviors.toml +++ b/conformance/results/mypy/enums_behaviors.toml @@ -2,6 +2,8 @@ conformant = "Pass" errors_diff = """ """ output = """ -enums_behaviors.py:39: error: Cannot extend enum with existing members: "Shape" [misc] +enums_behaviors.py:28: error: Expression is of type "Color", not "Literal[Color.RED]" [assert-type] +enums_behaviors.py:32: error: Expression is of type "Color", not "Literal[Color.BLUE]" [assert-type] +enums_behaviors.py:44: error: Cannot extend enum with existing members: "Shape" [misc] """ conformance_automated = "Pass" diff --git a/conformance/results/mypy/version.toml b/conformance/results/mypy/version.toml index a9b73efe7..3c192fd9a 100644 --- a/conformance/results/mypy/version.toml +++ b/conformance/results/mypy/version.toml @@ -1,2 +1,2 @@ version = "mypy 1.17.0" -test_duration = 2.7 +test_duration = 1.9 diff --git a/conformance/results/pyre/enums_behaviors.toml b/conformance/results/pyre/enums_behaviors.toml index 49c045e26..d1c240fc8 100644 --- a/conformance/results/pyre/enums_behaviors.toml +++ b/conformance/results/pyre/enums_behaviors.toml @@ -5,5 +5,7 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -enums_behaviors.py:39:0 Invalid inheritance [39]: Cannot inherit from final enum `Shape`. Enums with defined members cannot be extended. +enums_behaviors.py:28:0 Assert type [70]: Expected `typing_extensions.Literal[Color.RED]` but got `Color`. +enums_behaviors.py:32:0 Assert type [70]: Expected `typing_extensions.Literal[Color.BLUE]` but got `Color`. +enums_behaviors.py:44:0 Invalid inheritance [39]: Cannot inherit from final enum `Shape`. Enums with defined members cannot be extended. """ diff --git a/conformance/results/pyre/qualifiers_final_decorator.toml b/conformance/results/pyre/qualifiers_final_decorator.toml index ef5be734e..09c5e28b2 100644 --- a/conformance/results/pyre/qualifiers_final_decorator.toml +++ b/conformance/results/pyre/qualifiers_final_decorator.toml @@ -18,7 +18,7 @@ qualifiers_final_decorator.py:126:0 Invalid inheritance [39]: `final` cannot be """ conformance_automated = "Fail" errors_diff = """ -Lines 80, 89: Expected error (tag 'Derived3') -Lines 94, 102: Expected error (tag 'Derived4') +Lines 80, 81, 89: Expected error (tag 'Derived3') +Lines 94, 95, 102: Expected error (tag 'Derived4') Line 51: Unexpected errors ['qualifiers_final_decorator.py:51:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).'] """ diff --git a/conformance/results/pyre/version.toml b/conformance/results/pyre/version.toml index 02af2cfe9..de515ba2e 100644 --- a/conformance/results/pyre/version.toml +++ b/conformance/results/pyre/version.toml @@ -1,2 +1,2 @@ version = "pyre 0.9.25" -test_duration = 3.9 +test_duration = 7.4 diff --git a/conformance/results/pyright/enums_behaviors.toml b/conformance/results/pyright/enums_behaviors.toml index 8a9ff77e3..3d5c93daa 100644 --- a/conformance/results/pyright/enums_behaviors.toml +++ b/conformance/results/pyright/enums_behaviors.toml @@ -2,6 +2,8 @@ conformant = "Pass" errors_diff = """ """ output = """ -enums_behaviors.py:39:21 - error: Enum class "Shape" is final and cannot be subclassed (reportGeneralTypeIssues) +enums_behaviors.py:28:13 - error: "assert_type" mismatch: expected "Literal[Color.RED]" but received "Color" (reportAssertTypeFailure) +enums_behaviors.py:32:13 - error: "assert_type" mismatch: expected "Literal[Color.BLUE]" but received "Color" (reportAssertTypeFailure) +enums_behaviors.py:44:21 - error: Enum class "Shape" is final and cannot be subclassed (reportGeneralTypeIssues) """ conformance_automated = "Pass" diff --git a/conformance/results/pyright/version.toml b/conformance/results/pyright/version.toml index a5b181d82..79f18fab5 100644 --- a/conformance/results/pyright/version.toml +++ b/conformance/results/pyright/version.toml @@ -1,2 +1,2 @@ version = "pyright 1.1.403" -test_duration = 5.6 +test_duration = 1.4 diff --git a/conformance/results/results.html b/conformance/results/results.html index 7b4f244ca..aab60e772 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -159,13 +159,13 @@

    Python Type System Conformance Test Results

     
    mypy 1.16.1
    -
    2.2sec
    +
    mypy 1.17.0
    +
    2.7sec
    pyright 1.1.402
    -
    1.8sec
    +
    pyright 1.1.403
    +
    5.6sec
    pyre 0.9.23
    -
    10.7sec
    +
    pyre 0.9.25
    +
    3.9sec
    @@ -324,7 +324,7 @@

    Python Type System Conformance Test Results

         generics_type_erasure
    Partial

    Infers Node[Never] instead of Node[Any] when argument is not provided.

    False negative on instance attribute access on type(node).

    Partial

    Missing error regarding `type(instance).generic_attribute`.

    Pass
    Partial

    Does not erase unspecified type variables to `Any` prior to `assert_type` handling.

    False negatives on instance attribute access on the type.

    Does not infer type of `DefaultDict` with explicit type parameters on constructor.

    False negatives on assert_type uses.

         generics_typevartuple_args
         aliases_newtype
    Partial

    `NewType`s are considered classes, not functions.

    Partial

    `NewType`s are considered classes, not functions.

    Pass
    Partial

    Does not reject use of NewType in `isinstance` call.

    Does not reject use of NewType in class definition statement.

    Does not report inconsistency between name of NewType and assigned identifier name.

    Does not reject use of NewType with generic class with TypeVar.

    Does not reject use of NewType with protocol class.

    Does not reject use of NewType with TypedDict class.

    Does not reject use of NewType with Any.

         aliases_recursive
    Partial

    Does not reject ClassVar that is overridden by instance variable.

    Does not reject instance variable that is overridden by ClassVar.

         dataclasses_kwonly
    Partial

    Incorrectly rejects kw_only field with default before positional field.

    Pass Pass
    Partial

    Rejects legitimate use of dataclass field with `kw_only=True`.

    - @@ -371,7 +371,7 @@

    Python Type System Conformance Test Results

    - + @@ -565,7 +565,7 @@

    Python Type System Conformance Test Results

    - + @@ -707,7 +707,7 @@

    Python Type System Conformance Test Results

    - + @@ -870,7 +870,7 @@

    Python Type System Conformance Test Results

    - + @@ -922,7 +922,7 @@

    Python Type System Conformance Test Results

    - + @@ -1140,7 +1140,7 @@

    Python Type System Conformance Test Results

    - + diff --git a/conformance/results/zuban/callables_kwargs.toml b/conformance/results/zuban/callables_kwargs.toml index f0549f1dc..d68256b7d 100644 --- a/conformance/results/zuban/callables_kwargs.toml +++ b/conformance/results/zuban/callables_kwargs.toml @@ -6,6 +6,8 @@ callables_kwargs.py:46: error: Missing named argument "v1" for "func1" [call-ar callables_kwargs.py:46: error: Missing named argument "v3" for "func1" [call-arg] callables_kwargs.py:51: error: Unexpected keyword argument "v4" for "func1" [call-arg] callables_kwargs.py:52: error: Too many positional arguments for "func1" [call-arg] +callables_kwargs.py:52: error: Missing named argument "v1" for "func1" [call-arg] +callables_kwargs.py:52: error: Missing named argument "v3" for "func1" [call-arg] callables_kwargs.py:58: error: Argument 1 to "func1" has incompatible type "**dict[str, str]"; expected "int" [arg-type] callables_kwargs.py:61: error: Argument 1 to "func1" has incompatible type "**dict[str, int | str]"; expected "int" [arg-type] callables_kwargs.py:61: error: Argument 1 to "func1" has incompatible type "**dict[str, int | str]"; expected "str" [arg-type] diff --git a/conformance/results/zuban/constructors_call_metaclass.toml b/conformance/results/zuban/constructors_call_metaclass.toml index c15a19e3e..c9c2218aa 100644 --- a/conformance/results/zuban/constructors_call_metaclass.toml +++ b/conformance/results/zuban/constructors_call_metaclass.toml @@ -1,18 +1,7 @@ -conformant = "Unupported" -notes = """ -Does not honor metaclass __call__ method when evaluating constructor call. -Does not skip evaluation of __new__ and __init__ if custom metaclass call returns non-class. -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 23: Unexpected errors ['constructors_call_metaclass.py:23: error: Expression is of type "Class1", not "Never" [misc]', 'constructors_call_metaclass.py:23: error: Missing positional argument "x" in call to "Class1" [call-arg]'] -Line 36: Unexpected errors ['constructors_call_metaclass.py:36: error: Expression is of type "Class2", not "int | Meta2" [misc]', 'constructors_call_metaclass.py:36: error: Missing positional argument "x" in call to "Class2" [call-arg]'] """ output = """ -constructors_call_metaclass.py:23: error: Expression is of type "Class1", not "Never" [misc] -constructors_call_metaclass.py:23: error: Missing positional argument "x" in call to "Class1" [call-arg] -constructors_call_metaclass.py:36: error: Expression is of type "Class2", not "int | Meta2" [misc] -constructors_call_metaclass.py:36: error: Missing positional argument "x" in call to "Class2" [call-arg] -constructors_call_metaclass.py:51: error: Missing positional argument "x" in call to "Class3" [call-arg] -constructors_call_metaclass.py:65: error: Missing positional argument "x" in call to "Class4" [call-arg] +constructors_call_metaclass.py:54: error: Missing positional argument "x" in call to "Class3" [call-arg] +constructors_call_metaclass.py:68: error: Missing positional argument "x" in call to "Class4" [call-arg] """ diff --git a/conformance/results/zuban/constructors_callable.toml b/conformance/results/zuban/constructors_callable.toml index 98e51560e..f5e130aed 100644 --- a/conformance/results/zuban/constructors_callable.toml +++ b/conformance/results/zuban/constructors_callable.toml @@ -10,8 +10,6 @@ errors_diff = """ Line 127: Expected 1 errors Line 144: Expected 1 errors Line 73: Unexpected errors ['constructors_callable.py:73: error: Incompatible return type for "__new__" (returns "int", but must return a subtype of "Class4") [misc]'] -Line 100: Unexpected errors ['constructors_callable.py:100: error: Expression is of type "Class5", not "Never" [misc]'] -Line 105: Unexpected errors ['constructors_callable.py:105: error: Expression is of type "Class5", not "Never" [misc]'] Line 116: Unexpected errors ['constructors_callable.py:116: error: Incompatible return type for "__new__" (returns "Class6Proxy", but must return a subtype of "Class6") [misc]'] Line 126: Unexpected errors ['constructors_callable.py:126: error: Expression is of type "Class6", not "Class6Proxy" [misc]', 'constructors_callable.py:126: error: Missing positional argument "x" in call [call-arg]'] Line 143: Unexpected errors ['constructors_callable.py:143: error: Expression is of type "Class6Any", not "Any" [misc]', 'constructors_callable.py:143: error: Missing positional argument "x" in call [call-arg]'] @@ -34,9 +32,7 @@ constructors_callable.py:73: error: Incompatible return type for "__new__" (retu constructors_callable.py:77: note: Revealed type is "def (x: builtins.int) -> builtins.int" constructors_callable.py:79: error: Missing positional argument "x" in call [call-arg] constructors_callable.py:80: error: Unexpected keyword argument "y" [call-arg] -constructors_callable.py:97: note: Revealed type is "def (*args: Any, **kwargs: Any) -> constructors_callable.Class5" -constructors_callable.py:100: error: Expression is of type "Class5", not "Never" [misc] -constructors_callable.py:105: error: Expression is of type "Class5", not "Never" [misc] +constructors_callable.py:97: note: Revealed type is "def (*args: Any, **kwargs: Any) -> Never" constructors_callable.py:116: error: Incompatible return type for "__new__" (returns "Class6Proxy", but must return a subtype of "Class6") [misc] constructors_callable.py:125: note: Revealed type is "def (x: builtins.int) -> constructors_callable.Class6" constructors_callable.py:126: error: Expression is of type "Class6", not "Class6Proxy" [misc] diff --git a/conformance/results/zuban/dataclasses_transform_converter.toml b/conformance/results/zuban/dataclasses_transform_converter.toml index 6e1b3c835..182ab6211 100644 --- a/conformance/results/zuban/dataclasses_transform_converter.toml +++ b/conformance/results/zuban/dataclasses_transform_converter.toml @@ -1,50 +1,20 @@ -conformant = "Unsupported" +conformant = "Partial" notes = """ -Converter parameter not yet supported. +Converters are fully supported, failed to match generic overloads against other generics """ conformance_automated = "Fail" errors_diff = """ -Line 118: Expected 1 errors Line 104: Unexpected errors ['dataclasses_transform_converter.py:104: error: Incompatible callable argument with type vars [arg-type]'] -Line 112: Unexpected errors ['dataclasses_transform_converter.py:112: error: Argument 1 to "DC2" has incompatible type "str"; expected "int" [arg-type]', 'dataclasses_transform_converter.py:112: error: Argument 2 to "DC2" has incompatible type "str"; expected "int" [arg-type]', 'dataclasses_transform_converter.py:112: error: Argument 3 to "DC2" has incompatible type "str"; expected "int" [arg-type]', 'dataclasses_transform_converter.py:112: error: Argument 4 to "DC2" has incompatible type "bytes"; expected "ConverterClass" [arg-type]', 'dataclasses_transform_converter.py:112: error: Argument 5 to "DC2" has incompatible type "list[Never]"; expected "int" [arg-type]'] -Line 114: Unexpected errors ['dataclasses_transform_converter.py:114: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] -Line 115: Unexpected errors ['dataclasses_transform_converter.py:115: error: Incompatible types in assignment (expression has type "str", variable has type "ConverterClass") [assignment]'] -Line 116: Unexpected errors ['dataclasses_transform_converter.py:116: error: Incompatible types in assignment (expression has type "bytes", variable has type "ConverterClass") [assignment]'] -Line 121: Unexpected errors ['dataclasses_transform_converter.py:121: error: Argument 1 to "DC2" has incompatible type "str"; expected "int" [arg-type]', 'dataclasses_transform_converter.py:121: error: Argument 2 to "DC2" has incompatible type "str"; expected "int" [arg-type]', 'dataclasses_transform_converter.py:121: error: Argument 3 to "DC2" has incompatible type "str"; expected "int" [arg-type]', 'dataclasses_transform_converter.py:121: error: Argument 4 to "DC2" has incompatible type "str"; expected "ConverterClass" [arg-type]', 'dataclasses_transform_converter.py:121: error: Argument 5 to "DC2" has incompatible type "str"; expected "int" [arg-type]', 'dataclasses_transform_converter.py:121: error: Argument 6 to "DC2" has incompatible type "tuple[tuple[str, str], tuple[str, str]]"; expected "dict[str, str]" [arg-type]'] """ output = """ dataclasses_transform_converter.py:48: error: Argument "converter" to "model_field" has incompatible type "Callable[[], int]"; expected "Callable[[Never], int]" [arg-type] dataclasses_transform_converter.py:49: error: Argument "converter" to "model_field" has incompatible type "Callable[[NamedArg(int, 'x')], int]"; expected "Callable[[Never], int]" [arg-type] dataclasses_transform_converter.py:104: error: Incompatible callable argument with type vars [arg-type] -dataclasses_transform_converter.py:107: error: Argument 2 to "DC2" has incompatible type "str"; expected "int" [arg-type] -dataclasses_transform_converter.py:107: error: Argument 3 to "DC2" has incompatible type "str"; expected "int" [arg-type] -dataclasses_transform_converter.py:107: error: Argument 4 to "DC2" has incompatible type "bytes"; expected "ConverterClass" [arg-type] -dataclasses_transform_converter.py:107: error: Argument 5 to "DC2" has incompatible type "list[Never]"; expected "int" [arg-type] -dataclasses_transform_converter.py:108: error: Argument 1 to "DC2" has incompatible type "str"; expected "int" [arg-type] -dataclasses_transform_converter.py:108: error: Argument 2 to "DC2" has incompatible type "str"; expected "int" [arg-type] -dataclasses_transform_converter.py:108: error: Argument 3 to "DC2" has incompatible type "str"; expected "int" [arg-type] -dataclasses_transform_converter.py:108: error: Argument 4 to "DC2" has incompatible type "int"; expected "ConverterClass" [arg-type] -dataclasses_transform_converter.py:108: error: Argument 5 to "DC2" has incompatible type "list[Never]"; expected "int" [arg-type] -dataclasses_transform_converter.py:109: error: Argument 1 to "DC2" has incompatible type "str"; expected "int" [arg-type] -dataclasses_transform_converter.py:109: error: Argument 2 to "DC2" has incompatible type "str"; expected "int" [arg-type] -dataclasses_transform_converter.py:109: error: Argument 3 to "DC2" has incompatible type "str"; expected "int" [arg-type] -dataclasses_transform_converter.py:109: error: Argument 4 to "DC2" has incompatible type "str"; expected "ConverterClass" [arg-type] -dataclasses_transform_converter.py:109: error: Argument 5 to "DC2" has incompatible type "complex"; expected "int" [arg-type] -dataclasses_transform_converter.py:112: error: Argument 1 to "DC2" has incompatible type "str"; expected "int" [arg-type] -dataclasses_transform_converter.py:112: error: Argument 2 to "DC2" has incompatible type "str"; expected "int" [arg-type] -dataclasses_transform_converter.py:112: error: Argument 3 to "DC2" has incompatible type "str"; expected "int" [arg-type] -dataclasses_transform_converter.py:112: error: Argument 4 to "DC2" has incompatible type "bytes"; expected "ConverterClass" [arg-type] -dataclasses_transform_converter.py:112: error: Argument 5 to "DC2" has incompatible type "list[Never]"; expected "int" [arg-type] -dataclasses_transform_converter.py:114: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] -dataclasses_transform_converter.py:115: error: Incompatible types in assignment (expression has type "str", variable has type "ConverterClass") [assignment] -dataclasses_transform_converter.py:116: error: Incompatible types in assignment (expression has type "bytes", variable has type "ConverterClass") [assignment] -dataclasses_transform_converter.py:119: error: Incompatible types in assignment (expression has type "int", variable has type "ConverterClass") [assignment] -dataclasses_transform_converter.py:121: error: Argument 1 to "DC2" has incompatible type "str"; expected "int" [arg-type] -dataclasses_transform_converter.py:121: error: Argument 2 to "DC2" has incompatible type "str"; expected "int" [arg-type] -dataclasses_transform_converter.py:121: error: Argument 3 to "DC2" has incompatible type "str"; expected "int" [arg-type] -dataclasses_transform_converter.py:121: error: Argument 4 to "DC2" has incompatible type "str"; expected "ConverterClass" [arg-type] -dataclasses_transform_converter.py:121: error: Argument 5 to "DC2" has incompatible type "str"; expected "int" [arg-type] -dataclasses_transform_converter.py:121: error: Argument 6 to "DC2" has incompatible type "tuple[tuple[str, str], tuple[str, str]]"; expected "dict[str, str]" [arg-type] +dataclasses_transform_converter.py:107: error: Argument 1 to "DC2" has incompatible type "int"; expected "str" [arg-type] +dataclasses_transform_converter.py:108: error: Argument 4 to "DC2" has incompatible type "int"; expected "str | bytes" [arg-type] +dataclasses_transform_converter.py:109: error: Argument 5 to "DC2" has incompatible type "complex"; expected "str | list[str]" [arg-type] +dataclasses_transform_converter.py:118: error: Incompatible types in assignment of a dataclass converter (expression has type "int", expected type "str") [assignment] +dataclasses_transform_converter.py:119: error: Incompatible types in assignment of a dataclass converter (expression has type "int", expected type "str | bytes") [assignment] dataclasses_transform_converter.py:130: error: Argument "default" to "model_field" has incompatible type "int"; expected "str | None" [arg-type] dataclasses_transform_converter.py:133: error: Argument "default_factory" to "model_field" has incompatible type "Type[int]"; expected "Callable[[], str] | None" [arg-type] """ diff --git a/conformance/results/zuban/directives_deprecated.toml b/conformance/results/zuban/directives_deprecated.toml index 2b3718261..691c82a42 100644 --- a/conformance/results/zuban/directives_deprecated.toml +++ b/conformance/results/zuban/directives_deprecated.toml @@ -1,18 +1,17 @@ -conformant = "Unsupported" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 18: Expected 1 errors -Line 24: Expected 1 errors -Line 25: Expected 1 errors -Line 30: Expected 1 errors -Line 41: Expected 1 errors -Line 42: Expected 1 errors -Line 44: Expected 1 errors -Line 47: Expected 1 errors -Line 48: Expected 1 errors -Line 58: Expected 1 errors -Line 69: Expected 1 errors -Line 98: Expected 1 errors """ output = """ +directives_deprecated.py:18: error: class _directives_deprecated_library.Ham is deprecated: Use Spam instead [deprecated] +directives_deprecated.py:24: error: function _directives_deprecated_library.norwegian_blue is deprecated: It is pining for the fjords [deprecated] +directives_deprecated.py:25: error: function _directives_deprecated_library.norwegian_blue is deprecated: It is pining for the fjords [deprecated] +directives_deprecated.py:30: error: overload def (x: builtins.int) -> builtins.str of function _directives_deprecated_library.foo is deprecated: Only str will be allowed [deprecated] +directives_deprecated.py:41: error: function _directives_deprecated_library.Spam.__add__ is deprecated: There is enough spam in the world [deprecated] +directives_deprecated.py:42: error: function _directives_deprecated_library.Spam.__add__ is deprecated: There is enough spam in the world [deprecated] +directives_deprecated.py:44: error: function _directives_deprecated_library.Spam.greasy is deprecated: All spam will be equally greasy [deprecated] +directives_deprecated.py:47: error: function _directives_deprecated_library.Spam.shape is deprecated: Shapes are becoming immutable [deprecated] +directives_deprecated.py:48: error: function _directives_deprecated_library.Spam.shape is deprecated: Shapes are becoming immutable [deprecated] +directives_deprecated.py:58: error: function directives_deprecated.Invocable.__call__ is deprecated: Deprecated [deprecated] +directives_deprecated.py:69: error: function directives_deprecated.lorem is deprecated: Deprecated [deprecated] +directives_deprecated.py:98: error: function directives_deprecated.SupportsFoo1.foo is deprecated: Deprecated [deprecated] """ diff --git a/conformance/results/zuban/enums_members.toml b/conformance/results/zuban/enums_members.toml index 991c40eb6..0a625e68a 100644 --- a/conformance/results/zuban/enums_members.toml +++ b/conformance/results/zuban/enums_members.toml @@ -9,14 +9,10 @@ errors_diff = """ Line 82: Expected 1 errors Line 83: Expected 1 errors Line 116: Expected 1 errors -Line 35: Unexpected errors ['enums_members.py:35: error: Expression is of type "Literal[Pet2.genus]", not "str" [misc]'] -Line 36: Unexpected errors ['enums_members.py:36: error: Expression is of type "Literal[Pet2.species]", not "str" [misc]'] Line 100: Unexpected errors ['enums_members.py:100: error: Expression is of type "Literal[TrafficLight.AMBER]", not "Literal[TrafficLight.YELLOW]" [misc]'] Line 117: Unexpected errors ['enums_members.py:117: error: Parameter 1 of Literal[...] is invalid [valid-type]'] """ output = """ -enums_members.py:35: error: Expression is of type "Literal[Pet2.genus]", not "str" [misc] -enums_members.py:36: error: Expression is of type "Literal[Pet2.species]", not "str" [misc] enums_members.py:50: error: Enum members must be left unannotated [misc] enums_members.py:50: note: See https://typing.readthedocs.io/en/latest/spec/enums.html#defining-members enums_members.py:84: error: Parameter 1 of Literal[...] is invalid [valid-type] diff --git a/conformance/results/zuban/generics_syntax_infer_variance.toml b/conformance/results/zuban/generics_syntax_infer_variance.toml index 338d876e9..f6f762210 100644 --- a/conformance/results/zuban/generics_syntax_infer_variance.toml +++ b/conformance/results/zuban/generics_syntax_infer_variance.toml @@ -1,67 +1,31 @@ -conformant = "Unsupported" +conformant = "Partial" notes = """ -Type parameter syntax not yet support. +Final is handled a bit different (questionable if this is an issue) """ conformance_automated = "Fail" errors_diff = """ -Line 11: Unexpected errors ['generics_syntax_infer_variance.py:11: error: Unexpected argument to "TypeVar()": "infer_variance" [misc]'] -Line 12: Unexpected errors ['generics_syntax_infer_variance.py:12: error: Unexpected argument to "TypeVar()": "infer_variance" [misc]'] -Line 13: Unexpected errors ['generics_syntax_infer_variance.py:13: error: Unexpected argument to "TypeVar()": "infer_variance" [misc]'] -Line 28: Unexpected errors ['generics_syntax_infer_variance.py:28: error: "ShouldBeCovariant1" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_infer_variance.py:28: error: "ShouldBeCovariant1" expects no type arguments, but 1 given [type-arg]'] -Line 36: Unexpected errors ['generics_syntax_infer_variance.py:36: error: "ShouldBeCovariant2" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_infer_variance.py:36: error: "ShouldBeCovariant2" expects no type arguments, but 1 given [type-arg]'] -Line 41: Unexpected errors ['generics_syntax_infer_variance.py:41: error: "ShouldBeCovariant2" expects no type arguments, but 1 given [type-arg]'] -Line 45: Unexpected errors ['generics_syntax_infer_variance.py:45: error: "ShouldBeCovariant3" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_infer_variance.py:45: error: "ShouldBeCovariant3" expects no type arguments, but 1 given [type-arg]'] -Line 74: Unexpected errors ['generics_syntax_infer_variance.py:74: error: "ShouldBeCovariant5" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_infer_variance.py:74: error: "ShouldBeCovariant5" expects no type arguments, but 1 given [type-arg]'] -Line 85: Unexpected errors ['generics_syntax_infer_variance.py:85: error: "ShouldBeCovariant6" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_infer_variance.py:85: error: "ShouldBeCovariant6" expects no type arguments, but 1 given [type-arg]'] -Line 156: Unexpected errors ['generics_syntax_infer_variance.py:156: error: "ShouldBeContravariant1" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_infer_variance.py:156: error: "ShouldBeContravariant1" expects no type arguments, but 1 given [type-arg]'] +Line 79: Unexpected errors ['generics_syntax_infer_variance.py:79: error: Final name declared in class body cannot depend on type variables [misc]'] +Line 85: Unexpected errors ['generics_syntax_infer_variance.py:85: error: Incompatible types in assignment (expression has type "ShouldBeCovariant6[int]", variable has type "ShouldBeCovariant6[float]") [assignment]'] """ output = """ -generics_syntax_infer_variance.py:11: error: Unexpected argument to "TypeVar()": "infer_variance" [misc] -generics_syntax_infer_variance.py:12: error: Unexpected argument to "TypeVar()": "infer_variance" [misc] -generics_syntax_infer_variance.py:13: error: Unexpected argument to "TypeVar()": "infer_variance" [misc] -generics_syntax_infer_variance.py:15: error: Unexpected argument to "TypeVar()": "infer_variance" [misc] -generics_syntax_infer_variance.py:17: error: Unexpected argument to "TypeVar()": "infer_variance" [misc] -generics_syntax_infer_variance.py:28: error: "ShouldBeCovariant1" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:28: error: "ShouldBeCovariant1" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:29: error: "ShouldBeCovariant1" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:29: error: "ShouldBeCovariant1" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:36: error: "ShouldBeCovariant2" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:36: error: "ShouldBeCovariant2" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:37: error: "ShouldBeCovariant2" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:37: error: "ShouldBeCovariant2" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:41: error: "ShouldBeCovariant2" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:45: error: "ShouldBeCovariant3" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:45: error: "ShouldBeCovariant3" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:46: error: "ShouldBeCovariant3" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:46: error: "ShouldBeCovariant3" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:74: error: "ShouldBeCovariant5" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:74: error: "ShouldBeCovariant5" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:75: error: "ShouldBeCovariant5" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:75: error: "ShouldBeCovariant5" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:85: error: "ShouldBeCovariant6" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:85: error: "ShouldBeCovariant6" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:86: error: "ShouldBeCovariant6" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:86: error: "ShouldBeCovariant6" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:102: error: "ShouldBeInvariant1" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:102: error: "ShouldBeInvariant1" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:103: error: "ShouldBeInvariant1" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:103: error: "ShouldBeInvariant1" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:117: error: "ShouldBeInvariant2" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:117: error: "ShouldBeInvariant2" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:118: error: "ShouldBeInvariant2" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:118: error: "ShouldBeInvariant2" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:125: error: "ShouldBeInvariant3" expects no type arguments, but 2 given [type-arg] -generics_syntax_infer_variance.py:125: error: "ShouldBeInvariant3" expects no type arguments, but 2 given [type-arg] -generics_syntax_infer_variance.py:126: error: "ShouldBeInvariant3" expects no type arguments, but 2 given [type-arg] -generics_syntax_infer_variance.py:126: error: "ShouldBeInvariant3" expects no type arguments, but 2 given [type-arg] -generics_syntax_infer_variance.py:127: error: "ShouldBeInvariant3" expects no type arguments, but 2 given [type-arg] -generics_syntax_infer_variance.py:127: error: "ShouldBeInvariant3" expects no type arguments, but 2 given [type-arg] -generics_syntax_infer_variance.py:128: error: "ShouldBeInvariant3" expects no type arguments, but 2 given [type-arg] -generics_syntax_infer_variance.py:128: error: "ShouldBeInvariant3" expects no type arguments, but 2 given [type-arg] +generics_syntax_infer_variance.py:15: error: Cannot use covariant with infer_variance [misc] +generics_syntax_infer_variance.py:17: error: Cannot use contravariant with infer_variance [misc] +generics_syntax_infer_variance.py:29: error: Incompatible types in assignment (expression has type "ShouldBeCovariant1[float]", variable has type "ShouldBeCovariant1[int]") [assignment] +generics_syntax_infer_variance.py:37: error: Incompatible types in assignment (expression has type "ShouldBeCovariant2[float]", variable has type "ShouldBeCovariant2[int]") [assignment] +generics_syntax_infer_variance.py:46: error: Incompatible types in assignment (expression has type "ShouldBeCovariant3[float]", variable has type "ShouldBeCovariant3[int]") [assignment] +generics_syntax_infer_variance.py:75: error: Incompatible types in assignment (expression has type "ShouldBeCovariant5[float]", variable has type "ShouldBeCovariant5[int]") [assignment] +generics_syntax_infer_variance.py:79: error: Final name declared in class body cannot depend on type variables [misc] +generics_syntax_infer_variance.py:85: error: Incompatible types in assignment (expression has type "ShouldBeCovariant6[int]", variable has type "ShouldBeCovariant6[float]") [assignment] +generics_syntax_infer_variance.py:86: error: Incompatible types in assignment (expression has type "ShouldBeCovariant6[float]", variable has type "ShouldBeCovariant6[int]") [assignment] +generics_syntax_infer_variance.py:102: error: Incompatible types in assignment (expression has type "ShouldBeInvariant1[int]", variable has type "ShouldBeInvariant1[float]") [assignment] +generics_syntax_infer_variance.py:103: error: Incompatible types in assignment (expression has type "ShouldBeInvariant1[float]", variable has type "ShouldBeInvariant1[int]") [assignment] +generics_syntax_infer_variance.py:117: error: Incompatible types in assignment (expression has type "ShouldBeInvariant2[int]", variable has type "ShouldBeInvariant2[float]") [assignment] +generics_syntax_infer_variance.py:118: error: Incompatible types in assignment (expression has type "ShouldBeInvariant2[float]", variable has type "ShouldBeInvariant2[int]") [assignment] +generics_syntax_infer_variance.py:125: error: Incompatible types in assignment (expression has type "ShouldBeInvariant3[int, str]", variable has type "ShouldBeInvariant3[float, str]") [assignment] +generics_syntax_infer_variance.py:126: error: Incompatible types in assignment (expression has type "ShouldBeInvariant3[float, str]", variable has type "ShouldBeInvariant3[int, str]") [assignment] +generics_syntax_infer_variance.py:127: error: Incompatible types in assignment (expression has type "ShouldBeInvariant3[str, int]", variable has type "ShouldBeInvariant3[str, float]") [assignment] +generics_syntax_infer_variance.py:128: error: Incompatible types in assignment (expression has type "ShouldBeInvariant3[str, float]", variable has type "ShouldBeInvariant3[str, int]") [assignment] generics_syntax_infer_variance.py:136: error: Incompatible types in assignment (expression has type "ShouldBeInvariant4[int]", variable has type "ShouldBeInvariant4[float]") [assignment] generics_syntax_infer_variance.py:144: error: Incompatible types in assignment (expression has type "ShouldBeInvariant5[int]", variable has type "ShouldBeInvariant5[float]") [assignment] -generics_syntax_infer_variance.py:155: error: "ShouldBeContravariant1" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:155: error: "ShouldBeContravariant1" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:156: error: "ShouldBeContravariant1" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:156: error: "ShouldBeContravariant1" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:155: error: Incompatible types in assignment (expression has type "ShouldBeContravariant1[int]", variable has type "ShouldBeContravariant1[float]") [assignment] """ diff --git a/conformance/results/zuban/generics_syntax_scoping.toml b/conformance/results/zuban/generics_syntax_scoping.toml index 3d864b80f..7f32a0ca8 100644 --- a/conformance/results/zuban/generics_syntax_scoping.toml +++ b/conformance/results/zuban/generics_syntax_scoping.toml @@ -4,9 +4,6 @@ Does not following runtime scoping rules for type parameters in all cases. """ conformance_automated = "Fail" errors_diff = """ -Line 92: Expected 1 errors -Line 95: Expected 1 errors -Line 98: Expected 1 errors Line 31: Unexpected errors ['generics_syntax_scoping.py:31: error: Type variable "generics_syntax_scoping.T" is unbound [misc]'] Line 56: Unexpected errors ['generics_syntax_scoping.py:56: error: Name "S" already defined on line 55 [no-redef]'] Line 62: Unexpected errors ['generics_syntax_scoping.py:62: error: Expression is of type "TypeVar", not "str" [misc]'] @@ -35,6 +32,9 @@ generics_syntax_scoping.py:56: error: Name "S" already defined on line 55 [no-r generics_syntax_scoping.py:62: error: Expression is of type "TypeVar", not "str" [misc] generics_syntax_scoping.py:88: error: Argument 1 has incompatible type "Type[ClassE]"; expected "Callable[Never, Never]" [arg-type] generics_syntax_scoping.py:90: error: Name "T" already defined on line 89 [no-redef] +generics_syntax_scoping.py:92: error: "T" already defined as a type parameter [misc] +generics_syntax_scoping.py:95: error: "T" already defined as a type parameter [misc] +generics_syntax_scoping.py:98: error: "T" already defined as a type parameter [misc] generics_syntax_scoping.py:106: error: Name "T" already defined on line 105 [no-redef] generics_syntax_scoping.py:108: error: Expression is of type "TypeVar", not "int" [misc] generics_syntax_scoping.py:116: error: Expression is of type "int", not "TypeVar" [misc] diff --git a/conformance/results/zuban/literals_literalstring.toml b/conformance/results/zuban/literals_literalstring.toml index c223e5f64..8084711df 100644 --- a/conformance/results/zuban/literals_literalstring.toml +++ b/conformance/results/zuban/literals_literalstring.toml @@ -1,22 +1,16 @@ -conformant = "Unsupported" -notes = """ -Support for `LiteralString` is not implemented. -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 66: Expected 1 errors -Line 120: Expected 1 errors -Line 134: Expected 1 errors -Line 171: Expected 1 errors -Line 157: Unexpected errors ["literals_literalstring.py:157: error: Overloaded function signature 3 will never be matched: signature 2's parameter type(s) are the same or broader [overload-cannot-match]"] -Line 167: Unexpected errors ['literals_literalstring.py:167: error: Expression is of type "B", not "A" [misc]'] """ output = """ literals_literalstring.py:36: error: Parameter 2 of Literal[...] is invalid [valid-type] literals_literalstring.py:37: error: Parameter 1 of Literal[...] is invalid [valid-type] literals_literalstring.py:43: error: Incompatible types in assignment (expression has type "Literal['two']", variable has type "Literal['']") [assignment] -literals_literalstring.py:74: error: Incompatible types in assignment (expression has type "int", variable has type "str") [assignment] -literals_literalstring.py:75: error: Incompatible types in assignment (expression has type "bytes", variable has type "str") [assignment] -literals_literalstring.py:157: error: Overloaded function signature 3 will never be matched: signature 2's parameter type(s) are the same or broader [overload-cannot-match] -literals_literalstring.py:167: error: Expression is of type "B", not "A" [misc] +literals_literalstring.py:66: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString") [assignment] +literals_literalstring.py:74: error: Incompatible types in assignment (expression has type "Literal[3]", variable has type "LiteralString") [assignment] +literals_literalstring.py:75: error: Incompatible types in assignment (expression has type "Literal[b'test']", variable has type "LiteralString") [assignment] +literals_literalstring.py:120: error: Value of type variable "TLiteral" of "literal_identity" cannot be "str" [type-var] +literals_literalstring.py:134: error: Value of type variable "T" of "Container" cannot be "str" [type-var] +literals_literalstring.py:171: error: Incompatible types in assignment (expression has type "list[LiteralString]", variable has type "list[str]") [assignment] +literals_literalstring.py:171: note: "List" is invariant -- see https://mypy.readthedocs.io/en/stable/common_issues.html#variance +literals_literalstring.py:171: note: Consider using "Sequence" instead, which is covariant """ diff --git a/conformance/results/zuban/literals_semantics.toml b/conformance/results/zuban/literals_semantics.toml index ccd8e842f..57c26e052 100644 --- a/conformance/results/zuban/literals_semantics.toml +++ b/conformance/results/zuban/literals_semantics.toml @@ -5,5 +5,5 @@ output = """ literals_semantics.py:10: error: Incompatible types in assignment (expression has type "Literal[4]", variable has type "Literal[3]") [assignment] literals_semantics.py:24: error: Incompatible types in assignment (expression has type "Literal[0]", variable has type "Literal[False]") [assignment] literals_semantics.py:25: error: Incompatible types in assignment (expression has type "Literal[False]", variable has type "Literal[0]") [assignment] -literals_semantics.py:33: error: Incompatible types in assignment (expression has type "int", variable has type "Literal[3, 4, 5]") [assignment] +literals_semantics.py:33: error: Incompatible types in assignment (expression has type "Literal[6, 7, 8]", variable has type "Literal[3, 4, 5]") [assignment] """ diff --git a/conformance/results/zuban/tuples_type_compat.toml b/conformance/results/zuban/tuples_type_compat.toml index 991732fef..b6ac1afb8 100644 --- a/conformance/results/zuban/tuples_type_compat.toml +++ b/conformance/results/zuban/tuples_type_compat.toml @@ -2,11 +2,8 @@ conformant = "Pass" notes = """ Does not support tuple narrowing based on `len()` type guard (optional). """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Lines 80, 81: Expected exactly one error (tag 'func5_2') -Line 80: Unexpected errors ['tuples_type_compat.py:80: error: Expression is of type "tuple[str, str]", not "tuple[str, str] | tuple[int, int]" [misc]'] -Line 81: Unexpected errors ['tuples_type_compat.py:81: error: Expression is of type "tuple[str, str]", not "tuple[int] | tuple[str, str] | tuple[int, Unpack[Tuple[str, ...]], int]" [misc]'] """ output = """ tuples_type_compat.py:15: error: Incompatible types in assignment (expression has type "tuple[float, complex]", variable has type "tuple[int, int]") [assignment] @@ -16,8 +13,7 @@ tuples_type_compat.py:33: error: Incompatible types in assignment (expression ha tuples_type_compat.py:43: error: Incompatible types in assignment (expression has type "tuple[int, ...]", variable has type "tuple[int]") [assignment] tuples_type_compat.py:62: error: Incompatible types in assignment (expression has type "tuple[int, ...]", variable has type "tuple[int, int]") [assignment] tuples_type_compat.py:76: error: Expression is of type "tuple[int]", not "tuple[int] | tuple[str, str] | tuple[int, Unpack[Tuple[str, ...]], int]" [misc] -tuples_type_compat.py:80: error: Expression is of type "tuple[str, str]", not "tuple[str, str] | tuple[int, int]" [misc] -tuples_type_compat.py:81: error: Expression is of type "tuple[str, str]", not "tuple[int] | tuple[str, str] | tuple[int, Unpack[Tuple[str, ...]], int]" [misc] +tuples_type_compat.py:81: error: Expression is of type "tuple[str, str] | tuple[int, int]", not "tuple[int] | tuple[str, str] | tuple[int, Unpack[Tuple[str, ...]], int]" [misc] tuples_type_compat.py:86: error: Expression is of type "tuple[int, str, int]", not "tuple[int] | tuple[str, str] | tuple[int, Unpack[Tuple[str, ...]], int]" [misc] tuples_type_compat.py:101: error: Expression is of type "tuple[int] | tuple[str, str] | tuple[int, Unpack[Tuple[str, ...]], int]", not "tuple[int]" [misc] tuples_type_compat.py:106: error: Expression is of type "tuple[int] | tuple[str, str] | tuple[int, Unpack[Tuple[str, ...]], int]", not "tuple[str, str] | tuple[int, int]" [misc] diff --git a/conformance/results/zuban/typeddicts_alt_syntax.toml b/conformance/results/zuban/typeddicts_alt_syntax.toml index f98d65882..afb3f8a67 100644 --- a/conformance/results/zuban/typeddicts_alt_syntax.toml +++ b/conformance/results/zuban/typeddicts_alt_syntax.toml @@ -8,6 +8,6 @@ output = """ typeddicts_alt_syntax.py:23: error: TypedDict() expects a dictionary literal as the second argument [misc] typeddicts_alt_syntax.py:27: error: Invalid TypedDict() field name [misc] typeddicts_alt_syntax.py:31: error: First argument "WrongName" to TypedDict() does not match variable name "BadTypedDict3" [name-match] -typeddicts_alt_syntax.py:35: error: Too many arguments for "TODO()" [call-arg] +typeddicts_alt_syntax.py:35: error: Unexpected keyword argument "other" for "TypedDict" [call-arg] typeddicts_alt_syntax.py:41: error: TypedDict() expects a dictionary literal as the second argument [misc] """ diff --git a/conformance/results/zuban/typeddicts_class_syntax.toml b/conformance/results/zuban/typeddicts_class_syntax.toml index cbf24ab32..68741c76d 100644 --- a/conformance/results/zuban/typeddicts_class_syntax.toml +++ b/conformance/results/zuban/typeddicts_class_syntax.toml @@ -5,6 +5,6 @@ output = """ typeddicts_class_syntax.py:29: error: Invalid statement in TypedDict definition; expected "field_name: field_type" [misc] typeddicts_class_syntax.py:33: error: Invalid statement in TypedDict definition; expected "field_name: field_type" [misc] typeddicts_class_syntax.py:38: error: Invalid statement in TypedDict definition; expected "field_name: field_type" [misc] -typeddicts_class_syntax.py:44: error: Unexpected keyword argument "metaclass" for TypedDict [call-arg] -typeddicts_class_syntax.py:49: error: Unexpected keyword argument "other" for TypedDict [call-arg] +typeddicts_class_syntax.py:44: error: Unexpected keyword argument "metaclass" for "TypedDict" [call-arg] +typeddicts_class_syntax.py:49: error: Unexpected keyword argument "other" for "TypedDict" [call-arg] """ diff --git a/conformance/results/zuban/typeddicts_extra_items.toml b/conformance/results/zuban/typeddicts_extra_items.toml index 86048bc37..82f60b5fd 100644 --- a/conformance/results/zuban/typeddicts_extra_items.toml +++ b/conformance/results/zuban/typeddicts_extra_items.toml @@ -1,143 +1,33 @@ -conformant = "Unsupported" -notes = """ -Not supported. -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 22: Expected 1 errors -Line 215: Expected 1 errors -Line 222: Expected 1 errors -Line 242: Expected 1 errors -Line 256: Expected 1 errors -Line 257: Expected 1 errors -Line 268: Expected 1 errors -Lines 91, 92: Expected error (tag 'MovieC') -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 11: Unexpected errors ['typeddicts_extra_items.py:11: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg]'] -Line 14: Unexpected errors ['typeddicts_extra_items.py:14: error: Extra key "novel_adaptation" for TypedDict "Movie" [typeddict-unknown-key]'] -Line 19: Unexpected errors ['typeddicts_extra_items.py:19: error: Unexpected keyword argument "extra_items" for "TypedDict" [call-arg]'] -Line 29: Unexpected errors ['typeddicts_extra_items.py:29: error: Expression is of type "Any", not "bool" [misc]', 'typeddicts_extra_items.py:29: error: TypedDict "Movie" has no key "novel_adaptation" [typeddict-item]'] -Line 33: Unexpected errors ['typeddicts_extra_items.py:33: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg]'] -Line 40: Unexpected errors ['typeddicts_extra_items.py:40: error: Extra key "other_extra_key" for TypedDict "InheritedMovie" [typeddict-unknown-key]'] -Line 55: Unexpected errors ['typeddicts_extra_items.py:55: error: Unexpected keyword argument "closed" for TypedDict [call-arg]'] -Line 64: Unexpected errors ['typeddicts_extra_items.py:64: error: Unexpected keyword argument "closed" for TypedDict [call-arg]'] -Line 70: Unexpected errors ['typeddicts_extra_items.py:70: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg]'] -Line 82: Unexpected errors ['typeddicts_extra_items.py:82: error: Unexpected keyword argument "closed" for TypedDict [call-arg]'] -Line 88: Unexpected errors ['typeddicts_extra_items.py:88: error: Unexpected keyword argument "closed" for TypedDict [call-arg]'] -Line 100: Unexpected errors ['typeddicts_extra_items.py:100: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg]'] -Line 103: Unexpected errors ['typeddicts_extra_items.py:103: error: Unexpected keyword argument "closed" for TypedDict [call-arg]'] -Line 106: Unexpected errors ['typeddicts_extra_items.py:106: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg]'] -Line 124: Unexpected errors ['typeddicts_extra_items.py:124: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg]'] -Line 129: Unexpected errors ['typeddicts_extra_items.py:129: error: TypedDict "MovieEI" has no key "year" [typeddict-unknown-key]'] -Line 137: Unexpected errors ['typeddicts_extra_items.py:137: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg]'] -Line 144: Unexpected errors ['typeddicts_extra_items.py:144: error: Unexpected keyword argument "year" for "unpack_extra" [call-arg]'] -Line 149: Unexpected errors ['typeddicts_extra_items.py:149: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg]'] -Line 152: Unexpected errors ['typeddicts_extra_items.py:152: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg]'] -Line 155: Unexpected errors ['typeddicts_extra_items.py:155: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg]'] -Line 165: Unexpected errors ['typeddicts_extra_items.py:165: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg]'] -Line 171: Unexpected errors ['typeddicts_extra_items.py:171: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg]'] -Line 181: Unexpected errors ['typeddicts_extra_items.py:181: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg]'] -Line 193: Unexpected errors ['typeddicts_extra_items.py:193: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg]'] -Line 210: Unexpected errors ['typeddicts_extra_items.py:210: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg]'] -Line 217: Unexpected errors ['typeddicts_extra_items.py:217: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg]'] -Line 228: Unexpected errors ['typeddicts_extra_items.py:228: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg]'] -Line 231: Unexpected errors ['typeddicts_extra_items.py:231: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg]'] -Line 235: Unexpected errors ['typeddicts_extra_items.py:235: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg]'] -Line 248: Unexpected errors ['typeddicts_extra_items.py:248: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg]'] -Line 251: Unexpected errors ['typeddicts_extra_items.py:251: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg]'] -Line 254: Unexpected errors ['typeddicts_extra_items.py:254: error: Extra key "year" for TypedDict "MovieExtraInt" [typeddict-unknown-key]'] -Line 255: Unexpected errors ['typeddicts_extra_items.py:255: error: Extra key "description" for TypedDict "MovieExtraStr" [typeddict-unknown-key]'] -Line 266: Unexpected errors ['typeddicts_extra_items.py:266: error: Extra key "year" for TypedDict "MovieExtraInt" [typeddict-unknown-key]'] -Line 280: Unexpected errors ['typeddicts_extra_items.py:280: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg]'] -Line 284: Unexpected errors ['typeddicts_extra_items.py:284: error: Extra key "year" for TypedDict "ExtraMovie" [typeddict-unknown-key]'] -Line 289: Unexpected errors ['typeddicts_extra_items.py:289: error: Unexpected keyword argument "closed" for TypedDict [call-arg]'] -Line 299: Unexpected errors ['typeddicts_extra_items.py:299: error: Extra key "summary" for TypedDict "MovieExtraStr" [typeddict-unknown-key]'] -Line 300: Unexpected errors ['typeddicts_extra_items.py:300: error: Incompatible types in assignment (expression has type "MovieExtraStr", variable has type "Mapping[str, str]") [assignment]'] -Line 302: Unexpected errors ['typeddicts_extra_items.py:302: error: Extra key "year" for TypedDict "MovieExtraInt" [typeddict-unknown-key]'] -Line 304: Unexpected errors ['typeddicts_extra_items.py:304: error: Incompatible types in assignment (expression has type "MovieExtraInt", variable has type "Mapping[str, int | str]") [assignment]'] -Line 310: Unexpected errors ['typeddicts_extra_items.py:310: error: Expression is of type "list[tuple[str, object]]", not "list[tuple[str, int | str]]" [misc]'] -Line 311: Unexpected errors ['typeddicts_extra_items.py:311: error: Expression is of type "list[object]", not "list[int | str]" [misc]'] -Line 319: Unexpected errors ['typeddicts_extra_items.py:319: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg]'] -Line 326: Unexpected errors ['typeddicts_extra_items.py:326: error: Incompatible types in assignment (expression has type "IntDict", variable has type "dict[str, int]") [assignment]'] -Line 329: Unexpected errors ['typeddicts_extra_items.py:329: error: Extra key "bar" for TypedDict "IntDictWithNum" [typeddict-unknown-key]'] -Line 330: Unexpected errors ['typeddicts_extra_items.py:330: error: Incompatible types in assignment (expression has type "IntDictWithNum", variable has type "dict[str, int]") [assignment]'] -Line 337: Unexpected errors ['typeddicts_extra_items.py:337: error: "IntDictWithNum" has no attribute "clear" [attr-defined]'] -Line 339: Unexpected errors ['typeddicts_extra_items.py:339: error: Expression is of type "Any", not "tuple[str, int]" [misc]', 'typeddicts_extra_items.py:339: error: "IntDictWithNum" has no attribute "popitem" [attr-defined]'] -Line 342: Unexpected errors ['typeddicts_extra_items.py:342: error: TypedDict key must be a string literal; expected one of ("num") [misc]'] -Line 343: Unexpected errors ['typeddicts_extra_items.py:343: error: Expected TypedDict key to be string literal [misc]'] """ output = """ -typeddicts_extra_items.py:11: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg] -typeddicts_extra_items.py:14: error: Extra key "novel_adaptation" for TypedDict "Movie" [typeddict-unknown-key] -typeddicts_extra_items.py:15: error: Extra key "year" for TypedDict "Movie" [typeddict-unknown-key] -typeddicts_extra_items.py:19: error: Unexpected keyword argument "extra_items" for "TypedDict" [call-arg] -typeddicts_extra_items.py:29: error: Expression is of type "Any", not "bool" [misc] -typeddicts_extra_items.py:29: error: TypedDict "Movie" has no key "novel_adaptation" [typeddict-item] -typeddicts_extra_items.py:33: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg] +typeddicts_extra_items.py:15: error: Incompatible types (expression has type "int", TypedDict item "year" has type "bool") [typeddict-item] +typeddicts_extra_items.py:22: error: Incompatible types (expression has type "int", TypedDict item "year" has type "bool") [typeddict-item] typeddicts_extra_items.py:39: error: Incompatible types (expression has type "None", TypedDict item "year" has type "int") [typeddict-item] -typeddicts_extra_items.py:40: error: Extra key "other_extra_key" for TypedDict "InheritedMovie" [typeddict-unknown-key] -typeddicts_extra_items.py:49: error: Unexpected keyword argument "closed" for TypedDict [call-arg] -typeddicts_extra_items.py:55: error: Unexpected keyword argument "closed" for TypedDict [call-arg] -typeddicts_extra_items.py:64: error: Unexpected keyword argument "closed" for TypedDict [call-arg] -typeddicts_extra_items.py:67: error: Unexpected keyword argument "closed" for TypedDict [call-arg] -typeddicts_extra_items.py:70: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg] -typeddicts_extra_items.py:73: error: Unexpected keyword argument "closed" for TypedDict [call-arg] -typeddicts_extra_items.py:82: error: Unexpected keyword argument "closed" for TypedDict [call-arg] -typeddicts_extra_items.py:88: error: Unexpected keyword argument "closed" for TypedDict [call-arg] -typeddicts_extra_items.py:100: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg] -typeddicts_extra_items.py:103: error: Unexpected keyword argument "closed" for TypedDict [call-arg] -typeddicts_extra_items.py:106: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg] -typeddicts_extra_items.py:109: error: Unexpected keyword argument "closed" for TypedDict [call-arg] -typeddicts_extra_items.py:114: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg] -typeddicts_extra_items.py:117: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg] -typeddicts_extra_items.py:124: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg] +typeddicts_extra_items.py:49: error: "closed" argument must be a True or False literal [misc] +typeddicts_extra_items.py:67: error: Cannot set "closed=False" when superclass is "closed=True" [misc] +typeddicts_extra_items.py:73: error: Cannot set "closed=False" when superclass has "extra_items" [misc] +typeddicts_extra_items.py:92: error: TypedDict member "age" is required, but the extra_items of the super class are not [misc] +typeddicts_extra_items.py:95: error: TypedDict member "age" is required, but the extra_items of the super class are not [misc] +typeddicts_extra_items.py:109: error: Cannot set "closed=True" when superclass has non-read-only "extra_items" [misc] +typeddicts_extra_items.py:114: error: "extra_items" value cannot be "Required[...]" [misc] +typeddicts_extra_items.py:117: error: "extra_items" value cannot be "NotRequired[...]" [misc] typeddicts_extra_items.py:128: error: Key "name" of TypedDict "MovieEI" cannot be deleted [misc] -typeddicts_extra_items.py:129: error: TypedDict "MovieEI" has no key "year" [typeddict-unknown-key] -typeddicts_extra_items.py:137: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg] typeddicts_extra_items.py:143: error: Unexpected keyword argument "year" for "unpack_no_extra" [call-arg] -typeddicts_extra_items.py:144: error: Unexpected keyword argument "year" for "unpack_extra" [call-arg] -typeddicts_extra_items.py:149: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg] -typeddicts_extra_items.py:152: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg] -typeddicts_extra_items.py:155: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg] -typeddicts_extra_items.py:165: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg] -typeddicts_extra_items.py:171: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg] -typeddicts_extra_items.py:174: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg] -typeddicts_extra_items.py:181: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg] -typeddicts_extra_items.py:193: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg] -typeddicts_extra_items.py:210: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg] -typeddicts_extra_items.py:217: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg] -typeddicts_extra_items.py:228: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg] -typeddicts_extra_items.py:231: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg] -typeddicts_extra_items.py:235: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg] -typeddicts_extra_items.py:248: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg] -typeddicts_extra_items.py:251: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg] -typeddicts_extra_items.py:254: error: Extra key "year" for TypedDict "MovieExtraInt" [typeddict-unknown-key] -typeddicts_extra_items.py:255: error: Extra key "description" for TypedDict "MovieExtraStr" [typeddict-unknown-key] -typeddicts_extra_items.py:266: error: Extra key "year" for TypedDict "MovieExtraInt" [typeddict-unknown-key] +typeddicts_extra_items.py:174: error: Cannot change "extra_items" type unless it is "ReadOnly" in the superclass [misc] +typeddicts_extra_items.py:185: error: TypedDict member "year" is required, but the extra_items of the super class are not [misc] +typeddicts_extra_items.py:188: error: TypedDict member "year" type "int" is not assignable, but the extra_items of the super class are of type "int | None" [misc] +typeddicts_extra_items.py:197: error: TypedDict member "publisher" type "str" is not assignable, but the extra_items of the super class are of type "int | None" [misc] +typeddicts_extra_items.py:215: error: Incompatible types in assignment (expression has type "MovieDetails", variable has type "MovieBase2") [assignment] +typeddicts_extra_items.py:222: error: Incompatible types in assignment (expression has type "MovieWithYear2", variable has type "MovieBase2") [assignment] +typeddicts_extra_items.py:242: error: Incompatible types in assignment (expression has type "MovieDetails5", variable has type "MovieSI") [assignment] +typeddicts_extra_items.py:256: error: Incompatible types in assignment (expression has type "MovieExtraStr", variable has type "MovieExtraInt") [assignment] +typeddicts_extra_items.py:257: error: Incompatible types in assignment (expression has type "MovieExtraInt", variable has type "MovieExtraStr") [assignment] +typeddicts_extra_items.py:268: error: Incompatible types in assignment (expression has type "MovieNotClosed", variable has type "MovieExtraInt") [assignment] typeddicts_extra_items.py:278: error: Extra key "year" for TypedDict "NonClosedMovie" [typeddict-unknown-key] -typeddicts_extra_items.py:280: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg] -typeddicts_extra_items.py:284: error: Extra key "year" for TypedDict "ExtraMovie" [typeddict-unknown-key] -typeddicts_extra_items.py:285: error: Extra key "language" for TypedDict "ExtraMovie" [typeddict-unknown-key] -typeddicts_extra_items.py:289: error: Unexpected keyword argument "closed" for TypedDict [call-arg] -typeddicts_extra_items.py:293: error: Extra key "year" for TypedDict "ClosedMovie" [typeddict-unknown-key] -typeddicts_extra_items.py:299: error: Extra key "summary" for TypedDict "MovieExtraStr" [typeddict-unknown-key] -typeddicts_extra_items.py:300: error: Incompatible types in assignment (expression has type "MovieExtraStr", variable has type "Mapping[str, str]") [assignment] -typeddicts_extra_items.py:302: error: Extra key "year" for TypedDict "MovieExtraInt" [typeddict-unknown-key] +typeddicts_extra_items.py:285: error: Incompatible types (expression has type "str", TypedDict item "language" has type "int") [typeddict-item] +typeddicts_extra_items.py:293: error: Incompatible types (expression has type "int", TypedDict item "year" has type "Never") [typeddict-item] typeddicts_extra_items.py:303: error: Incompatible types in assignment (expression has type "MovieExtraInt", variable has type "Mapping[str, int]") [assignment] -typeddicts_extra_items.py:304: error: Incompatible types in assignment (expression has type "MovieExtraInt", variable has type "Mapping[str, int | str]") [assignment] -typeddicts_extra_items.py:310: error: Expression is of type "list[tuple[str, object]]", not "list[tuple[str, int | str]]" [misc] -typeddicts_extra_items.py:311: error: Expression is of type "list[object]", not "list[int | str]" [misc] -typeddicts_extra_items.py:319: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg] -typeddicts_extra_items.py:326: error: Incompatible types in assignment (expression has type "IntDict", variable has type "dict[str, int]") [assignment] -typeddicts_extra_items.py:329: error: Extra key "bar" for TypedDict "IntDictWithNum" [typeddict-unknown-key] -typeddicts_extra_items.py:330: error: Incompatible types in assignment (expression has type "IntDictWithNum", variable has type "dict[str, int]") [assignment] -typeddicts_extra_items.py:337: error: "IntDictWithNum" has no attribute "clear" [attr-defined] -typeddicts_extra_items.py:339: error: Expression is of type "Any", not "tuple[str, int]" [misc] -typeddicts_extra_items.py:339: error: "IntDictWithNum" has no attribute "popitem" [attr-defined] -typeddicts_extra_items.py:342: error: TypedDict key must be a string literal; expected one of ("num") [misc] -typeddicts_extra_items.py:343: error: Expected TypedDict key to be string literal [misc] typeddicts_extra_items.py:352: error: Incompatible types in assignment (expression has type "dict[str, int]", variable has type "IntDict") [assignment] """ diff --git a/conformance/results/zuban/version.toml b/conformance/results/zuban/version.toml index a41318177..88a02908d 100644 --- a/conformance/results/zuban/version.toml +++ b/conformance/results/zuban/version.toml @@ -1 +1 @@ -version = "zuban 0.0.20" +version = "zuban 0.0.24" diff --git a/conformance/src/main.py b/conformance/src/main.py index 4b8a683dd..62a827bc4 100644 --- a/conformance/src/main.py +++ b/conformance/src/main.py @@ -260,6 +260,8 @@ def main(): # Run each test case with each type checker. for type_checker in TYPE_CHECKERS: + if options.only_run and options.only_run != type_checker.name: + continue if not type_checker.install(): print(f"Skipping tests for {type_checker.name}") else: diff --git a/conformance/src/options.py b/conformance/src/options.py index 89120774e..76c2c5beb 100644 --- a/conformance/src/options.py +++ b/conformance/src/options.py @@ -5,10 +5,12 @@ import argparse from dataclasses import dataclass +from type_checker import TYPE_CHECKERS @dataclass class _Options: report_only: bool | None + only_run: str | None def parse_options(argv: list[str]) -> _Options: @@ -19,5 +21,10 @@ def parse_options(argv: list[str]) -> _Options: action="store_true", help="regenerates the test suite report from past results", ) + reporting_group.add_argument( + "--only-run", + help="Only runs the type checker", + choices=[tc.name for tc in TYPE_CHECKERS] + ) ret = _Options(**vars(parser.parse_args(argv))) return ret diff --git a/conformance/tests/constructors_call_metaclass.py b/conformance/tests/constructors_call_metaclass.py index fa35bdf18..0b40dfc7c 100644 --- a/conformance/tests/constructors_call_metaclass.py +++ b/conformance/tests/constructors_call_metaclass.py @@ -20,7 +20,10 @@ def __new__(cls, x: int) -> Self: return super().__new__(cls) -assert_type(Class1(), NoReturn) +# This needs to be in a separate scope, because some type checkers might mark +# the statements after it as unreachable. +if bool(): + assert_type(Class1(), NoReturn) class Meta2(type): From b3f46cfd3b331469880d75808d60e40df20bca42 Mon Sep 17 00:00:00 2001 From: StarrFox Date: Thu, 9 Oct 2025 18:39:53 -0500 Subject: [PATCH 141/308] add discord invite (#2094) Adds a discord invite for the type-hinting channel so it can be accessed by people not already in the discord --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3624c5041..8bc02d48a 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ repository. For conversations that are more suitable to a chat platform, you can use one of the following: - [gitter](https://gitter.im/python/typing) -- [discord](https://discord.com/channels/267624335836053506/891788761371906108) `#type-hinting` channel +- [discord](https://discord.com/invite/python) [#type-hinting](https://discord.com/channels/267624335836053506/891788761371906108) channel ## Repository Content From 89f5f7c67be138880a9d57658c80dd1b32c37f7c Mon Sep 17 00:00:00 2001 From: David Peter Date: Fri, 10 Oct 2025 16:50:00 +0200 Subject: [PATCH 142/308] Make deferred-annotation errors optional (depends on version) (#2096) --- conformance/tests/annotations_forward_refs.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/conformance/tests/annotations_forward_refs.py b/conformance/tests/annotations_forward_refs.py index 18f111e0c..70c644700 100644 --- a/conformance/tests/annotations_forward_refs.py +++ b/conformance/tests/annotations_forward_refs.py @@ -19,8 +19,8 @@ def func1( assert_type(p4, list[ClassA | int]) -bad1: ClassA # E: Runtime error: requires quotes -bad2: list[ClassA] # E: Runtime error: requires quotes +bad1: ClassA # E?: Runtime error prior to 3.14: requires quotes +bad2: list[ClassA] # E?: Runtime error prior to 3.14: requires quotes bad3: "ClassA" | int # E: Runtime error bad4: int | "ClassA" # E: Runtime error @@ -63,7 +63,7 @@ def invalid_annotations( class ClassB: - def method1(self) -> ClassB: # E: Runtime error + def method1(self) -> ClassB: # E?: Runtime error prior to 3.14 return ClassB() def method2(self) -> "ClassB": # OK From ecc212940ea9dd794604a5b5a68af38a95400d8f Mon Sep 17 00:00:00 2001 From: Rebecca Chen Date: Fri, 10 Oct 2025 10:48:45 -0700 Subject: [PATCH 143/308] Update conformance tests (#2095) * Update unexpected_fails.py to allow omitting the `conformant` field for passing tests. * Add pyrefly.toml. * Update results for pyrefly 0.36.2. * Update manual conformance. * Fixes to tests for type errors and incorrect expectations. * Regenerate results. * Address review comments. * Remove no-longer-needed import. --- .../results/mypy/classes_classvar.toml | 6 +- .../mypy/constructors_call_metaclass.toml | 20 +- .../mypy/dataclasses_transform_converter.toml | 2 +- .../results/mypy/enums_member_values.toml | 1 - conformance/results/mypy/generics_basic.toml | 2 +- .../results/mypy/generics_defaults.toml | 20 +- .../results/mypy/generics_scoping.toml | 8 +- .../results/mypy/generics_self_advanced.toml | 4 - .../mypy/generics_syntax_infer_variance.toml | 209 +++++++++--------- .../mypy/generics_typevartuple_basic.toml | 4 +- .../generics_typevartuple_specialization.toml | 4 +- .../results/mypy/protocols_explicit.toml | 9 +- conformance/results/mypy/tuples_unpacked.toml | 6 +- .../results/mypy/typeddicts_required.toml | 6 +- conformance/results/mypy/version.toml | 2 +- .../pyre/constructors_call_metaclass.toml | 6 +- .../results/pyre/generics_defaults.toml | 35 +-- .../pyre/generics_syntax_infer_variance.toml | 37 ++-- .../pyre/namedtuples_define_class.toml | 9 - .../results/pyre/namedtuples_usage.toml | 3 - .../results/pyre/protocols_explicit.toml | 9 +- .../results/pyre/typeddicts_required.toml | 10 +- .../results/pyrefly/aliases_explicit.toml | 2 +- .../results/pyrefly/aliases_implicit.toml | 2 +- .../results/pyrefly/aliases_recursive.toml | 18 +- .../pyrefly/aliases_type_statement.toml | 4 +- .../pyrefly/aliases_typealiastype.toml | 61 ++--- .../results/pyrefly/callables_kwargs.toml | 8 +- .../pyrefly/constructors_call_metaclass.toml | 4 +- .../pyrefly/constructors_callable.toml | 10 - .../results/pyrefly/dataclasses_final.toml | 2 +- .../results/pyrefly/dataclasses_postinit.toml | 4 +- .../pyrefly/directives_deprecated.toml | 2 +- .../pyrefly/directives_reveal_type.toml | 4 - .../results/pyrefly/enums_behaviors.toml | 8 +- .../results/pyrefly/enums_member_values.toml | 3 +- .../results/pyrefly/enums_members.toml | 11 +- .../results/pyrefly/generics_basic.toml | 2 +- .../results/pyrefly/generics_defaults.toml | 14 +- .../pyrefly/generics_paramspec_basic.toml | 2 +- .../pyrefly/generics_self_advanced.toml | 8 +- .../pyrefly/generics_self_attributes.toml | 8 +- .../pyrefly/generics_self_protocols.toml | 8 +- .../generics_syntax_compatibility.toml | 1 - .../generics_syntax_infer_variance.toml | 30 +-- .../pyrefly/generics_syntax_scoping.toml | 6 - .../pyrefly/generics_type_erasure.toml | 10 +- .../results/pyrefly/generics_upper_bound.toml | 8 +- .../pyrefly/literals_literalstring.toml | 12 +- .../pyrefly/overloads_consistency.toml | 4 +- .../pyrefly/overloads_definitions.toml | 15 +- .../pyrefly/overloads_definitions_stub.toml | 17 +- .../results/pyrefly/overloads_evaluation.toml | 20 -- .../results/pyrefly/protocols_explicit.toml | 9 +- .../results/pyrefly/protocols_generic.toml | 8 +- .../results/pyrefly/protocols_merging.toml | 8 +- .../results/pyrefly/protocols_self.toml | 10 +- .../results/pyrefly/protocols_variance.toml | 1 + .../pyrefly/qualifiers_final_decorator.toml | 8 +- .../results/pyrefly/specialtypes_none.toml | 2 +- .../pyrefly/typeddicts_extra_items.toml | 29 +-- .../results/pyrefly/typeddicts_readonly.toml | 12 +- .../typeddicts_readonly_inheritance.toml | 2 +- .../pyrefly/typeddicts_readonly_kwargs.toml | 2 +- .../results/pyrefly/typeddicts_required.toml | 12 +- conformance/results/pyrefly/version.toml | 2 +- .../results/pyright/aliases_newtype.toml | 2 +- .../pyright/constructors_call_metaclass.toml | 4 +- .../pyright/dataclasses_match_args.toml | 9 +- .../results/pyright/enums_members.toml | 6 +- .../results/pyright/generics_defaults.toml | 4 +- .../generics_syntax_infer_variance.toml | 39 ++-- .../results/pyright/protocols_explicit.toml | 13 +- .../pyright/typeddicts_extra_items.toml | 10 +- .../results/pyright/typeddicts_required.toml | 11 +- conformance/results/pyright/version.toml | 2 +- conformance/results/results.html | 50 ++--- .../results/zuban/generics_defaults.toml | 15 +- .../results/zuban/generics_self_advanced.toml | 4 +- .../zuban/generics_syntax_infer_variance.toml | 40 ++-- .../results/zuban/generics_type_erasure.toml | 4 +- .../results/zuban/protocols_explicit.toml | 13 +- .../results/zuban/qualifiers_annotated.toml | 8 +- .../results/zuban/typeddicts_required.toml | 6 +- conformance/src/unexpected_fails.py | 5 +- conformance/tests/enums_members.py | 4 +- conformance/tests/generics_defaults.py | 5 +- .../tests/generics_syntax_infer_variance.py | 14 +- conformance/tests/overloads_definitions.py | 2 +- conformance/tests/protocols_explicit.py | 3 +- conformance/tests/pyrefly.toml | 1 + conformance/tests/typeddicts_required.py | 3 - 92 files changed, 450 insertions(+), 652 deletions(-) create mode 100644 conformance/tests/pyrefly.toml diff --git a/conformance/results/mypy/classes_classvar.toml b/conformance/results/mypy/classes_classvar.toml index 0072d63f1..fd95469f5 100644 --- a/conformance/results/mypy/classes_classvar.toml +++ b/conformance/results/mypy/classes_classvar.toml @@ -9,8 +9,6 @@ output = """ classes_classvar.py:38: error: ClassVar[...] must have at most one type argument [valid-type] classes_classvar.py:39: error: Invalid type: try using Literal[3] instead? [valid-type] classes_classvar.py:40: error: Name "var" is not defined [name-defined] -classes_classvar.py:45: error: ClassVar cannot contain type variables [misc] -classes_classvar.py:46: error: ClassVar cannot contain type variables [misc] classes_classvar.py:52: error: Incompatible types in assignment (expression has type "dict[Never, Never]", variable has type "list[str]") [assignment] classes_classvar.py:54: error: Variable should not be annotated with both ClassVar and Final [misc] classes_classvar.py:55: error: Invalid type: ClassVar nested inside other type [valid-type] @@ -22,6 +20,7 @@ classes_classvar.py:73: error: ClassVar can only be used for assignments in clas classes_classvar.py:77: error: ClassVar can only be used for assignments in class body [misc] classes_classvar.py:78: error: ClassVar[...] can't be used inside a type alias [valid-type] classes_classvar.py:111: error: Cannot assign to class variable "stats" via instance [misc] +classes_classvar.py:130: error: All protocol members must have explicitly declared types [misc] classes_classvar.py:140: error: Incompatible types in assignment (expression has type "ProtoAImpl", variable has type "ProtoA") [assignment] classes_classvar.py:140: note: "ProtoAImpl" is missing following "ProtoA" protocol member: classes_classvar.py:140: note: z @@ -30,6 +29,9 @@ classes_classvar.py:140: note: Protocol member ProtoA.y expected class variable, """ conformance_automated = "Fail" errors_diff = """ +Line 45: Expected 1 errors +Line 46: Expected 1 errors Line 47: Expected 1 errors Line 67: Unexpected errors ['classes_classvar.py:67: error: Invalid type: ClassVar nested inside other type [valid-type]'] +Line 130: Unexpected errors ['classes_classvar.py:130: error: All protocol members must have explicitly declared types [misc]'] """ diff --git a/conformance/results/mypy/constructors_call_metaclass.toml b/conformance/results/mypy/constructors_call_metaclass.toml index 355939b52..8ee382dfc 100644 --- a/conformance/results/mypy/constructors_call_metaclass.toml +++ b/conformance/results/mypy/constructors_call_metaclass.toml @@ -5,16 +5,16 @@ Does not skip evaluation of __new__ and __init__ if custom metaclass call return """ conformance_automated = "Fail" errors_diff = """ -Line 23: Unexpected errors ['constructors_call_metaclass.py:23: error: Expression is of type "Class1", not "Never" [assert-type]', 'constructors_call_metaclass.py:23: error: Missing positional argument "x" in call to "Class1" [call-arg]'] -Line 36: Unexpected errors ['constructors_call_metaclass.py:36: error: Expression is of type "Class2", not "int | Meta2" [assert-type]', 'constructors_call_metaclass.py:36: error: Missing positional argument "x" in call to "Class2" [call-arg]'] -Line 43: Unexpected errors ['constructors_call_metaclass.py:43: error: Argument 2 for "super" not an instance of argument 1 [misc]'] +Line 26: Unexpected errors ['constructors_call_metaclass.py:26: error: Expression is of type "Class1", not "Never" [assert-type]', 'constructors_call_metaclass.py:26: error: Missing positional argument "x" in call to "Class1" [call-arg]'] +Line 39: Unexpected errors ['constructors_call_metaclass.py:39: error: Expression is of type "Class2", not "int | Meta2" [assert-type]', 'constructors_call_metaclass.py:39: error: Missing positional argument "x" in call to "Class2" [call-arg]'] +Line 46: Unexpected errors ['constructors_call_metaclass.py:46: error: Argument 2 for "super" not an instance of argument 1 [misc]'] """ output = """ -constructors_call_metaclass.py:23: error: Expression is of type "Class1", not "Never" [assert-type] -constructors_call_metaclass.py:23: error: Missing positional argument "x" in call to "Class1" [call-arg] -constructors_call_metaclass.py:36: error: Expression is of type "Class2", not "int | Meta2" [assert-type] -constructors_call_metaclass.py:36: error: Missing positional argument "x" in call to "Class2" [call-arg] -constructors_call_metaclass.py:43: error: Argument 2 for "super" not an instance of argument 1 [misc] -constructors_call_metaclass.py:51: error: Missing positional argument "x" in call to "Class3" [call-arg] -constructors_call_metaclass.py:65: error: Missing positional argument "x" in call to "Class4" [call-arg] +constructors_call_metaclass.py:26: error: Expression is of type "Class1", not "Never" [assert-type] +constructors_call_metaclass.py:26: error: Missing positional argument "x" in call to "Class1" [call-arg] +constructors_call_metaclass.py:39: error: Expression is of type "Class2", not "int | Meta2" [assert-type] +constructors_call_metaclass.py:39: error: Missing positional argument "x" in call to "Class2" [call-arg] +constructors_call_metaclass.py:46: error: Argument 2 for "super" not an instance of argument 1 [misc] +constructors_call_metaclass.py:54: error: Missing positional argument "x" in call to "Class3" [call-arg] +constructors_call_metaclass.py:68: error: Missing positional argument "x" in call to "Class4" [call-arg] """ diff --git a/conformance/results/mypy/dataclasses_transform_converter.toml b/conformance/results/mypy/dataclasses_transform_converter.toml index bd9b1b6d5..cc316bee1 100644 --- a/conformance/results/mypy/dataclasses_transform_converter.toml +++ b/conformance/results/mypy/dataclasses_transform_converter.toml @@ -44,5 +44,5 @@ dataclasses_transform_converter.py:121: error: Argument 4 to "DC2" has incompati dataclasses_transform_converter.py:121: error: Argument 5 to "DC2" has incompatible type "str"; expected "int" [arg-type] dataclasses_transform_converter.py:121: error: Argument 6 to "DC2" has incompatible type "tuple[tuple[str, str], tuple[str, str]]"; expected "dict[str, str]" [arg-type] dataclasses_transform_converter.py:130: error: Argument "converter" to "model_field" has incompatible type "Callable[[str], int]"; expected "Callable[[int], int]" [arg-type] -dataclasses_transform_converter.py:133: error: Cannot infer type argument 1 of "model_field" [misc] +dataclasses_transform_converter.py:133: error: Cannot infer value of type parameter "S" of "model_field" [misc] """ diff --git a/conformance/results/mypy/enums_member_values.toml b/conformance/results/mypy/enums_member_values.toml index 87ec4a09c..f6ddcffe7 100644 --- a/conformance/results/mypy/enums_member_values.toml +++ b/conformance/results/mypy/enums_member_values.toml @@ -12,5 +12,4 @@ enums_member_values.py:26: error: Expression is of type "Any", not "Literal[1, 3 enums_member_values.py:54: error: Expression is of type "tuple[int, float, float]", not "Literal[1]" [assert-type] enums_member_values.py:68: error: Expression is of type "int", not "Literal[1]" [assert-type] enums_member_values.py:85: error: Incompatible types in assignment (expression has type "int", variable has type "str") [assignment] -enums_member_values.py:96: error: Expression is of type "EllipsisType", not "int" [assert-type] """ diff --git a/conformance/results/mypy/generics_basic.toml b/conformance/results/mypy/generics_basic.toml index 322d9ff72..3c95445b9 100644 --- a/conformance/results/mypy/generics_basic.toml +++ b/conformance/results/mypy/generics_basic.toml @@ -12,7 +12,7 @@ generics_basic.py:162: error: Free type variable expected in Generic[...] [misc generics_basic.py:163: error: Free type variable expected in Protocol[...] [misc] generics_basic.py:171: error: If Generic[...] or Protocol[...] is present it should list all type variables [misc] generics_basic.py:172: error: If Generic[...] or Protocol[...] is present it should list all type variables [misc] -generics_basic.py:208: error: Dynamic metaclass not supported for "GenericMetaInstance" [misc] +generics_basic.py:208: error: Dynamic metaclass not supported for "GenericMetaInstance" [metaclass] generics_basic.py:208: error: Type variable "generics_basic.T" is unbound [valid-type] generics_basic.py:208: note: (Hint: Use "Generic[T]" or "Protocol[T]" base class to bind "T" inside a class) generics_basic.py:208: note: (Hint: Use "T" in function signature to bind "T" inside a function) diff --git a/conformance/results/mypy/generics_defaults.toml b/conformance/results/mypy/generics_defaults.toml index bc4145c45..ba432041c 100644 --- a/conformance/results/mypy/generics_defaults.toml +++ b/conformance/results/mypy/generics_defaults.toml @@ -14,17 +14,16 @@ generics_defaults.py:79: error: Expression is of type "type[Class_ParamSpec[Defa generics_defaults.py:94: error: Expression is of type "type[Class_TypeVarTuple[*DefaultTs]]", not "type[Class_TypeVarTuple[str, int]]" [assert-type] generics_defaults.py:107: error: TypeVar default must be a subtype of the bound type [misc] generics_defaults.py:114: error: TypeVar default must be one of the constraint types [misc] -generics_defaults.py:154: error: Expression is of type "type[Foo6[*tuple[Any, ...], Any]]", not "type[Foo6[int, str, [float, bool]]]" [assert-type] -generics_defaults.py:154: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [misc] -generics_defaults.py:155: error: Expression is of type "type[Foo6[*tuple[Any, ...], Any]]", not "type[Foo6[int, str, [bytes]]]" [assert-type] +generics_defaults.py:131: error: Expression is of type "int", not "Any" [assert-type] +generics_defaults.py:155: error: Expression is of type "type[Foo6[*tuple[Any, ...], Any]]", not "type[Foo6[int, str, [float, bool]]]" [assert-type] generics_defaults.py:155: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [misc] -generics_defaults.py:169: error: Expression is of type "Callable[[Self], Self]", not "Callable[[Foo7[int]], Foo7[int]]" [assert-type] -generics_defaults.py:170: error: Expression is of type "Any", not "int" [assert-type] -generics_defaults.py:170: error: Access to generic instance variables via class is ambiguous [misc] +generics_defaults.py:156: error: Expression is of type "type[Foo6[*tuple[Any, ...], Any]]", not "type[Foo6[int, str, [bytes]]]" [assert-type] +generics_defaults.py:156: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [misc] +generics_defaults.py:170: error: Expression is of type "Callable[[Self], Self]", not "Callable[[Foo7[int]], Foo7[int]]" [assert-type] """ conformance_automated = "Fail" errors_diff = """ -Line 141: Expected 1 errors +Line 142: Expected 1 errors Line 30: Unexpected errors ['generics_defaults.py:30: error: Expression is of type "type[NoNonDefaults[DefaultStrT, DefaultIntT]]", not "type[NoNonDefaults[str, int]]" [assert-type]'] Line 31: Unexpected errors ['generics_defaults.py:31: error: Expression is of type "type[NoNonDefaults[str, DefaultIntT]]", not "type[NoNonDefaults[str, int]]" [assert-type]'] Line 38: Unexpected errors ['generics_defaults.py:38: error: Expression is of type "type[OneDefault[float, DefaultBoolT]]", not "type[OneDefault[float, bool]]" [assert-type]'] @@ -35,8 +34,7 @@ Line 55: Unexpected errors ['generics_defaults.py:55: error: Expression is of ty Line 59: Unexpected errors ['generics_defaults.py:59: error: Expression is of type "type[AllTheDefaults[int, complex, str, int, DefaultBoolT]]", not "type[AllTheDefaults[int, complex, str, int, bool]]" [assert-type]'] Line 79: Unexpected errors ['generics_defaults.py:79: error: Expression is of type "type[Class_ParamSpec[DefaultP]]", not "type[Class_ParamSpec[[str, int]]]" [assert-type]'] Line 94: Unexpected errors ['generics_defaults.py:94: error: Expression is of type "type[Class_TypeVarTuple[*DefaultTs]]", not "type[Class_TypeVarTuple[str, int]]" [assert-type]'] -Line 154: Unexpected errors ['generics_defaults.py:154: error: Expression is of type "type[Foo6[*tuple[Any, ...], Any]]", not "type[Foo6[int, str, [float, bool]]]" [assert-type]', 'generics_defaults.py:154: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [misc]'] -Line 155: Unexpected errors ['generics_defaults.py:155: error: Expression is of type "type[Foo6[*tuple[Any, ...], Any]]", not "type[Foo6[int, str, [bytes]]]" [assert-type]', 'generics_defaults.py:155: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [misc]'] -Line 169: Unexpected errors ['generics_defaults.py:169: error: Expression is of type "Callable[[Self], Self]", not "Callable[[Foo7[int]], Foo7[int]]" [assert-type]'] -Line 170: Unexpected errors ['generics_defaults.py:170: error: Expression is of type "Any", not "int" [assert-type]', 'generics_defaults.py:170: error: Access to generic instance variables via class is ambiguous [misc]'] +Line 155: Unexpected errors ['generics_defaults.py:155: error: Expression is of type "type[Foo6[*tuple[Any, ...], Any]]", not "type[Foo6[int, str, [float, bool]]]" [assert-type]', 'generics_defaults.py:155: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [misc]'] +Line 156: Unexpected errors ['generics_defaults.py:156: error: Expression is of type "type[Foo6[*tuple[Any, ...], Any]]", not "type[Foo6[int, str, [bytes]]]" [assert-type]', 'generics_defaults.py:156: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [misc]'] +Line 170: Unexpected errors ['generics_defaults.py:170: error: Expression is of type "Callable[[Self], Self]", not "Callable[[Foo7[int]], Foo7[int]]" [assert-type]'] """ diff --git a/conformance/results/mypy/generics_scoping.toml b/conformance/results/mypy/generics_scoping.toml index d9be0a027..3c3e0054e 100644 --- a/conformance/results/mypy/generics_scoping.toml +++ b/conformance/results/mypy/generics_scoping.toml @@ -1,7 +1,3 @@ -conformant = "Partial" -notes = """ -False negative on generic class nested within generic class with same type variable. -""" output = """ generics_scoping.py:29: error: Argument 1 to "meth_2" of "MyClass" has incompatible type "str"; expected "int" [arg-type] generics_scoping.py:50: error: Type variable "generics_scoping.S" is unbound [valid-type] @@ -11,6 +7,7 @@ generics_scoping.py:54: error: Type variable "generics_scoping.S" is unbound [v generics_scoping.py:54: note: (Hint: Use "Generic[S]" or "Protocol[S]" base class to bind "S" inside a class) generics_scoping.py:54: note: (Hint: Use "S" in function signature to bind "S" inside a function) generics_scoping.py:65: error: Free type variable expected in Generic[...] [misc] +generics_scoping.py:75: error: Type variable "T" is bound by an outer class [valid-type] generics_scoping.py:78: error: Type variable "generics_scoping.T" is unbound [valid-type] generics_scoping.py:78: note: (Hint: Use "Generic[T]" or "Protocol[T]" base class to bind "T" inside a class) generics_scoping.py:78: note: (Hint: Use "T" in function signature to bind "T" inside a function) @@ -25,7 +22,6 @@ generics_scoping.py:96: error: Type variable "generics_scoping.T" is unbound [v generics_scoping.py:96: note: (Hint: Use "Generic[T]" or "Protocol[T]" base class to bind "T" inside a class) generics_scoping.py:96: note: (Hint: Use "T" in function signature to bind "T" inside a function) """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 75: Expected 1 errors """ diff --git a/conformance/results/mypy/generics_self_advanced.toml b/conformance/results/mypy/generics_self_advanced.toml index b8cb3c16c..92f523341 100644 --- a/conformance/results/mypy/generics_self_advanced.toml +++ b/conformance/results/mypy/generics_self_advanced.toml @@ -9,8 +9,6 @@ output = """ generics_self_advanced.py:35: error: Expression is of type "ChildB", not "Self" [assert-type] generics_self_advanced.py:38: error: Expression is of type "ChildB", not "Self" [assert-type] generics_self_advanced.py:42: error: Expression is of type "type[ChildB]", not "type[Self]" [assert-type] -generics_self_advanced.py:43: error: Expression is of type "list[Any]", not "list[Self]" [assert-type] -generics_self_advanced.py:44: error: Expression is of type "Any", not "Self" [assert-type] generics_self_advanced.py:45: error: Expression is of type "ChildB", not "Self" [assert-type] """ conformance_automated = "Fail" @@ -18,7 +16,5 @@ errors_diff = """ Line 35: Unexpected errors ['generics_self_advanced.py:35: error: Expression is of type "ChildB", not "Self" [assert-type]'] Line 38: Unexpected errors ['generics_self_advanced.py:38: error: Expression is of type "ChildB", not "Self" [assert-type]'] Line 42: Unexpected errors ['generics_self_advanced.py:42: error: Expression is of type "type[ChildB]", not "type[Self]" [assert-type]'] -Line 43: Unexpected errors ['generics_self_advanced.py:43: error: Expression is of type "list[Any]", not "list[Self]" [assert-type]'] -Line 44: Unexpected errors ['generics_self_advanced.py:44: error: Expression is of type "Any", not "Self" [assert-type]'] Line 45: Unexpected errors ['generics_self_advanced.py:45: error: Expression is of type "ChildB", not "Self" [assert-type]'] """ diff --git a/conformance/results/mypy/generics_syntax_infer_variance.toml b/conformance/results/mypy/generics_syntax_infer_variance.toml index 4a4ecc71f..81b7b1da2 100644 --- a/conformance/results/mypy/generics_syntax_infer_variance.toml +++ b/conformance/results/mypy/generics_syntax_infer_variance.toml @@ -19,83 +19,89 @@ generics_syntax_infer_variance.py:29: error: "ShouldBeCovariant1" expects no typ generics_syntax_infer_variance.py:29: error: The type "type[ShouldBeCovariant1]" is not generic and not indexable [misc] generics_syntax_infer_variance.py:32: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] generics_syntax_infer_variance.py:32: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:36: error: "ShouldBeCovariant2" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:36: error: The type "type[ShouldBeCovariant2]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:37: error: "ShouldBeCovariant2" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:37: error: The type "type[ShouldBeCovariant2]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:40: error: Free type variable expected in Generic[...] [misc] -generics_syntax_infer_variance.py:41: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:41: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:41: error: "ShouldBeCovariant2" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:45: error: "ShouldBeCovariant3" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:45: error: The type "type[ShouldBeCovariant3]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:46: error: "ShouldBeCovariant3" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:46: error: The type "type[ShouldBeCovariant3]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:34: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:34: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:37: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:37: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:39: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:39: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:46: error: "ShouldBeCovariant2" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:46: error: The type "type[ShouldBeCovariant2]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:47: error: "ShouldBeCovariant2" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:47: error: The type "type[ShouldBeCovariant2]" is not generic and not indexable [misc] generics_syntax_infer_variance.py:50: error: Free type variable expected in Generic[...] [misc] generics_syntax_infer_variance.py:51: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] generics_syntax_infer_variance.py:51: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:65: error: Free type variable expected in Generic[...] [misc] -generics_syntax_infer_variance.py:66: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:66: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:70: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:70: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:74: error: "ShouldBeCovariant5" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:74: error: The type "type[ShouldBeCovariant5]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:75: error: "ShouldBeCovariant5" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:75: error: The type "type[ShouldBeCovariant5]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:78: error: Free type variable expected in Generic[...] [misc] -generics_syntax_infer_variance.py:79: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:79: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:81: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:81: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:85: error: "ShouldBeCovariant6" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:85: error: The type "type[ShouldBeCovariant6]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:86: error: "ShouldBeCovariant6" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:86: error: The type "type[ShouldBeCovariant6]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:89: error: Free type variable expected in Generic[...] [misc] -generics_syntax_infer_variance.py:90: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:90: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:94: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:94: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:98: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:98: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:102: error: "ShouldBeInvariant1" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:102: error: The type "type[ShouldBeInvariant1]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:103: error: "ShouldBeInvariant1" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:103: error: The type "type[ShouldBeInvariant1]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:106: error: Free type variable expected in Generic[...] [misc] -generics_syntax_infer_variance.py:107: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:107: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:110: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:110: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:113: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:113: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:117: error: "ShouldBeInvariant2" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:117: error: The type "type[ShouldBeInvariant2]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:118: error: "ShouldBeInvariant2" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:118: error: The type "type[ShouldBeInvariant2]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:121: error: Variable "generics_syntax_infer_variance.K" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:121: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:121: error: Variable "generics_syntax_infer_variance.V" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:125: error: "ShouldBeInvariant3" expects no type arguments, but 2 given [type-arg] -generics_syntax_infer_variance.py:125: error: The type "type[ShouldBeInvariant3]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:126: error: "ShouldBeInvariant3" expects no type arguments, but 2 given [type-arg] -generics_syntax_infer_variance.py:126: error: The type "type[ShouldBeInvariant3]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:127: error: "ShouldBeInvariant3" expects no type arguments, but 2 given [type-arg] -generics_syntax_infer_variance.py:127: error: The type "type[ShouldBeInvariant3]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:128: error: "ShouldBeInvariant3" expects no type arguments, but 2 given [type-arg] -generics_syntax_infer_variance.py:128: error: The type "type[ShouldBeInvariant3]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:136: error: Incompatible types in assignment (expression has type "ShouldBeInvariant4[int]", variable has type "ShouldBeInvariant4[float]") [assignment] -generics_syntax_infer_variance.py:144: error: Incompatible types in assignment (expression has type "ShouldBeInvariant5[int]", variable has type "ShouldBeInvariant5[float]") [assignment] -generics_syntax_infer_variance.py:147: error: Free type variable expected in Generic[...] [misc] -generics_syntax_infer_variance.py:148: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:148: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:151: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:151: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:155: error: "ShouldBeContravariant1" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:155: error: The type "type[ShouldBeContravariant1]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:156: error: "ShouldBeContravariant1" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:156: error: The type "type[ShouldBeContravariant1]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:51: error: "ShouldBeCovariant2" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:55: error: "ShouldBeCovariant3" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:55: error: The type "type[ShouldBeCovariant3]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:56: error: "ShouldBeCovariant3" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:56: error: The type "type[ShouldBeCovariant3]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:60: error: Free type variable expected in Generic[...] [misc] +generics_syntax_infer_variance.py:61: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:61: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:75: error: Free type variable expected in Generic[...] [misc] +generics_syntax_infer_variance.py:76: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:76: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:80: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:80: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:84: error: "ShouldBeCovariant5" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:84: error: The type "type[ShouldBeCovariant5]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:85: error: "ShouldBeCovariant5" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:85: error: The type "type[ShouldBeCovariant5]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:88: error: Free type variable expected in Generic[...] [misc] +generics_syntax_infer_variance.py:89: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:89: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:91: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:91: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:95: error: "ShouldBeCovariant6" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:95: error: The type "type[ShouldBeCovariant6]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:96: error: "ShouldBeCovariant6" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:96: error: The type "type[ShouldBeCovariant6]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:99: error: Free type variable expected in Generic[...] [misc] +generics_syntax_infer_variance.py:100: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:100: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:104: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:104: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:108: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:108: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:112: error: "ShouldBeInvariant1" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:112: error: The type "type[ShouldBeInvariant1]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:113: error: "ShouldBeInvariant1" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:113: error: The type "type[ShouldBeInvariant1]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:116: error: Free type variable expected in Generic[...] [misc] +generics_syntax_infer_variance.py:117: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:117: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:120: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:120: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:123: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:123: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:127: error: "ShouldBeInvariant2" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:127: error: The type "type[ShouldBeInvariant2]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:128: error: "ShouldBeInvariant2" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:128: error: The type "type[ShouldBeInvariant2]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:131: error: Variable "generics_syntax_infer_variance.K" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:131: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:131: error: Variable "generics_syntax_infer_variance.V" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:135: error: "ShouldBeInvariant3" expects no type arguments, but 2 given [type-arg] +generics_syntax_infer_variance.py:135: error: The type "type[ShouldBeInvariant3]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:136: error: "ShouldBeInvariant3" expects no type arguments, but 2 given [type-arg] +generics_syntax_infer_variance.py:136: error: The type "type[ShouldBeInvariant3]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:137: error: "ShouldBeInvariant3" expects no type arguments, but 2 given [type-arg] +generics_syntax_infer_variance.py:137: error: The type "type[ShouldBeInvariant3]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:138: error: "ShouldBeInvariant3" expects no type arguments, but 2 given [type-arg] +generics_syntax_infer_variance.py:138: error: The type "type[ShouldBeInvariant3]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:146: error: Incompatible types in assignment (expression has type "ShouldBeInvariant4[int]", variable has type "ShouldBeInvariant4[float]") [assignment] +generics_syntax_infer_variance.py:154: error: Incompatible types in assignment (expression has type "ShouldBeInvariant5[int]", variable has type "ShouldBeInvariant5[float]") [assignment] +generics_syntax_infer_variance.py:157: error: Free type variable expected in Generic[...] [misc] +generics_syntax_infer_variance.py:158: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:158: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:161: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:161: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:165: error: "ShouldBeContravariant1" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:165: error: The type "type[ShouldBeContravariant1]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:166: error: "ShouldBeContravariant1" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:166: error: The type "type[ShouldBeContravariant1]" is not generic and not indexable [misc] """ conformance_automated = "Fail" errors_diff = """ @@ -107,31 +113,34 @@ Line 21: Unexpected errors ['generics_syntax_infer_variance.py:21: error: Variab Line 24: Unexpected errors ['generics_syntax_infer_variance.py:24: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] Line 28: Unexpected errors ['generics_syntax_infer_variance.py:28: error: "ShouldBeCovariant1" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_infer_variance.py:28: error: The type "type[ShouldBeCovariant1]" is not generic and not indexable [misc]'] Line 32: Unexpected errors ['generics_syntax_infer_variance.py:32: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 36: Unexpected errors ['generics_syntax_infer_variance.py:36: error: "ShouldBeCovariant2" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_infer_variance.py:36: error: The type "type[ShouldBeCovariant2]" is not generic and not indexable [misc]'] -Line 40: Unexpected errors ['generics_syntax_infer_variance.py:40: error: Free type variable expected in Generic[...] [misc]'] -Line 41: Unexpected errors ['generics_syntax_infer_variance.py:41: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]', 'generics_syntax_infer_variance.py:41: error: "ShouldBeCovariant2" expects no type arguments, but 1 given [type-arg]'] -Line 45: Unexpected errors ['generics_syntax_infer_variance.py:45: error: "ShouldBeCovariant3" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_infer_variance.py:45: error: The type "type[ShouldBeCovariant3]" is not generic and not indexable [misc]'] +Line 34: Unexpected errors ['generics_syntax_infer_variance.py:34: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 37: Unexpected errors ['generics_syntax_infer_variance.py:37: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 39: Unexpected errors ['generics_syntax_infer_variance.py:39: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 46: Unexpected errors ['generics_syntax_infer_variance.py:46: error: "ShouldBeCovariant2" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_infer_variance.py:46: error: The type "type[ShouldBeCovariant2]" is not generic and not indexable [misc]'] Line 50: Unexpected errors ['generics_syntax_infer_variance.py:50: error: Free type variable expected in Generic[...] [misc]'] -Line 51: Unexpected errors ['generics_syntax_infer_variance.py:51: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 65: Unexpected errors ['generics_syntax_infer_variance.py:65: error: Free type variable expected in Generic[...] [misc]'] -Line 66: Unexpected errors ['generics_syntax_infer_variance.py:66: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 70: Unexpected errors ['generics_syntax_infer_variance.py:70: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 74: Unexpected errors ['generics_syntax_infer_variance.py:74: error: "ShouldBeCovariant5" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_infer_variance.py:74: error: The type "type[ShouldBeCovariant5]" is not generic and not indexable [misc]'] -Line 78: Unexpected errors ['generics_syntax_infer_variance.py:78: error: Free type variable expected in Generic[...] [misc]'] -Line 79: Unexpected errors ['generics_syntax_infer_variance.py:79: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 81: Unexpected errors ['generics_syntax_infer_variance.py:81: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 85: Unexpected errors ['generics_syntax_infer_variance.py:85: error: "ShouldBeCovariant6" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_infer_variance.py:85: error: The type "type[ShouldBeCovariant6]" is not generic and not indexable [misc]'] -Line 89: Unexpected errors ['generics_syntax_infer_variance.py:89: error: Free type variable expected in Generic[...] [misc]'] -Line 90: Unexpected errors ['generics_syntax_infer_variance.py:90: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 94: Unexpected errors ['generics_syntax_infer_variance.py:94: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 98: Unexpected errors ['generics_syntax_infer_variance.py:98: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 106: Unexpected errors ['generics_syntax_infer_variance.py:106: error: Free type variable expected in Generic[...] [misc]'] -Line 107: Unexpected errors ['generics_syntax_infer_variance.py:107: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 110: Unexpected errors ['generics_syntax_infer_variance.py:110: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 113: Unexpected errors ['generics_syntax_infer_variance.py:113: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 121: Unexpected errors ['generics_syntax_infer_variance.py:121: error: Variable "generics_syntax_infer_variance.K" is not valid as a type [valid-type]', 'generics_syntax_infer_variance.py:121: error: Variable "generics_syntax_infer_variance.V" is not valid as a type [valid-type]'] -Line 147: Unexpected errors ['generics_syntax_infer_variance.py:147: error: Free type variable expected in Generic[...] [misc]'] -Line 148: Unexpected errors ['generics_syntax_infer_variance.py:148: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 151: Unexpected errors ['generics_syntax_infer_variance.py:151: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 156: Unexpected errors ['generics_syntax_infer_variance.py:156: error: "ShouldBeContravariant1" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_infer_variance.py:156: error: The type "type[ShouldBeContravariant1]" is not generic and not indexable [misc]'] +Line 51: Unexpected errors ['generics_syntax_infer_variance.py:51: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]', 'generics_syntax_infer_variance.py:51: error: "ShouldBeCovariant2" expects no type arguments, but 1 given [type-arg]'] +Line 55: Unexpected errors ['generics_syntax_infer_variance.py:55: error: "ShouldBeCovariant3" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_infer_variance.py:55: error: The type "type[ShouldBeCovariant3]" is not generic and not indexable [misc]'] +Line 60: Unexpected errors ['generics_syntax_infer_variance.py:60: error: Free type variable expected in Generic[...] [misc]'] +Line 61: Unexpected errors ['generics_syntax_infer_variance.py:61: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 75: Unexpected errors ['generics_syntax_infer_variance.py:75: error: Free type variable expected in Generic[...] [misc]'] +Line 76: Unexpected errors ['generics_syntax_infer_variance.py:76: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 80: Unexpected errors ['generics_syntax_infer_variance.py:80: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 84: Unexpected errors ['generics_syntax_infer_variance.py:84: error: "ShouldBeCovariant5" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_infer_variance.py:84: error: The type "type[ShouldBeCovariant5]" is not generic and not indexable [misc]'] +Line 88: Unexpected errors ['generics_syntax_infer_variance.py:88: error: Free type variable expected in Generic[...] [misc]'] +Line 89: Unexpected errors ['generics_syntax_infer_variance.py:89: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 91: Unexpected errors ['generics_syntax_infer_variance.py:91: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 95: Unexpected errors ['generics_syntax_infer_variance.py:95: error: "ShouldBeCovariant6" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_infer_variance.py:95: error: The type "type[ShouldBeCovariant6]" is not generic and not indexable [misc]'] +Line 99: Unexpected errors ['generics_syntax_infer_variance.py:99: error: Free type variable expected in Generic[...] [misc]'] +Line 100: Unexpected errors ['generics_syntax_infer_variance.py:100: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 104: Unexpected errors ['generics_syntax_infer_variance.py:104: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 108: Unexpected errors ['generics_syntax_infer_variance.py:108: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 116: Unexpected errors ['generics_syntax_infer_variance.py:116: error: Free type variable expected in Generic[...] [misc]'] +Line 117: Unexpected errors ['generics_syntax_infer_variance.py:117: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 120: Unexpected errors ['generics_syntax_infer_variance.py:120: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 123: Unexpected errors ['generics_syntax_infer_variance.py:123: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 131: Unexpected errors ['generics_syntax_infer_variance.py:131: error: Variable "generics_syntax_infer_variance.K" is not valid as a type [valid-type]', 'generics_syntax_infer_variance.py:131: error: Variable "generics_syntax_infer_variance.V" is not valid as a type [valid-type]'] +Line 157: Unexpected errors ['generics_syntax_infer_variance.py:157: error: Free type variable expected in Generic[...] [misc]'] +Line 158: Unexpected errors ['generics_syntax_infer_variance.py:158: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 161: Unexpected errors ['generics_syntax_infer_variance.py:161: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 166: Unexpected errors ['generics_syntax_infer_variance.py:166: error: "ShouldBeContravariant1" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_infer_variance.py:166: error: The type "type[ShouldBeContravariant1]" is not generic and not indexable [misc]'] """ diff --git a/conformance/results/mypy/generics_typevartuple_basic.toml b/conformance/results/mypy/generics_typevartuple_basic.toml index 1219f7a88..e127cd54d 100644 --- a/conformance/results/mypy/generics_typevartuple_basic.toml +++ b/conformance/results/mypy/generics_typevartuple_basic.toml @@ -15,8 +15,8 @@ generics_typevartuple_basic.py:59: error: TypeVarTuple "Shape" is only valid wit generics_typevartuple_basic.py:65: error: Unexpected keyword argument "covariant" for "TypeVarTuple" [misc] generics_typevartuple_basic.py:66: error: Too many positional arguments for "TypeVarTuple" [misc] generics_typevartuple_basic.py:67: error: Unexpected keyword argument "bound" for "TypeVarTuple" [misc] -generics_typevartuple_basic.py:99: error: Cannot infer type argument 1 of "multiply" [misc] -generics_typevartuple_basic.py:100: error: Cannot infer type argument 1 of "multiply" [misc] +generics_typevartuple_basic.py:99: error: Cannot infer value of type parameter "Shape" of "multiply" [misc] +generics_typevartuple_basic.py:100: error: Cannot infer value of type parameter "Shape" of "multiply" [misc] generics_typevartuple_basic.py:106: error: Can only use one type var tuple in a class def [misc] """ conformance_automated = "Fail" diff --git a/conformance/results/mypy/generics_typevartuple_specialization.toml b/conformance/results/mypy/generics_typevartuple_specialization.toml index 68c021237..7d23a81f1 100644 --- a/conformance/results/mypy/generics_typevartuple_specialization.toml +++ b/conformance/results/mypy/generics_typevartuple_specialization.toml @@ -10,8 +10,8 @@ generics_typevartuple_specialization.py:109: error: Type application is only sup generics_typevartuple_specialization.py:109: error: Unpack is only valid in a variadic position [valid-type] generics_typevartuple_specialization.py:110: error: Type application is only supported for generic classes [misc] generics_typevartuple_specialization.py:110: error: Unpack is only valid in a variadic position [valid-type] -generics_typevartuple_specialization.py:121: error: More than one Unpack in a type is not allowed [misc] -generics_typevartuple_specialization.py:122: error: More than one Unpack in a type is not allowed [misc] +generics_typevartuple_specialization.py:121: error: More than one variadic Unpack in a type is not allowed [misc] +generics_typevartuple_specialization.py:122: error: More than one variadic Unpack in a type is not allowed [misc] generics_typevartuple_specialization.py:127: error: Bad number of arguments for type alias, expected at least 2, given 1 [type-arg] generics_typevartuple_specialization.py:163: error: TypeVarTuple cannot be split [type-arg] """ diff --git a/conformance/results/mypy/protocols_explicit.toml b/conformance/results/mypy/protocols_explicit.toml index 5c4cea2ea..80ef20393 100644 --- a/conformance/results/mypy/protocols_explicit.toml +++ b/conformance/results/mypy/protocols_explicit.toml @@ -6,11 +6,10 @@ output = """ protocols_explicit.py:27: error: Call to abstract method "draw" of "PColor" with trivial body via super() is unsafe [safe-super] protocols_explicit.py:56: error: Incompatible types in assignment (expression has type "tuple[int, int, str]", base class "RGB" defined the type as "tuple[int, int, int]") [assignment] protocols_explicit.py:60: error: Cannot instantiate abstract class "Point" with abstract attributes "intensity" and "transparency" [abstract] -protocols_explicit.py:135: error: Cannot instantiate abstract class "Concrete5" with abstract attribute "method1" [abstract] -protocols_explicit.py:165: error: Cannot instantiate abstract class "Concrete7A" with abstract attribute "method1" [abstract] +protocols_explicit.py:89: error: Cannot instantiate abstract class "Concrete1" with abstract attribute "cm1" [abstract] +protocols_explicit.py:134: error: Cannot instantiate abstract class "Concrete5" with abstract attribute "method1" [abstract] +protocols_explicit.py:164: error: Cannot instantiate abstract class "Concrete7A" with abstract attribute "method1" [abstract] """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 90: Expected 1 errors -Line 110: Expected 1 errors """ diff --git a/conformance/results/mypy/tuples_unpacked.toml b/conformance/results/mypy/tuples_unpacked.toml index bb864687a..12dee95c6 100644 --- a/conformance/results/mypy/tuples_unpacked.toml +++ b/conformance/results/mypy/tuples_unpacked.toml @@ -3,9 +3,9 @@ notes = """ "More than one unpack" error is missing in some cases. """ output = """ -tuples_unpacked.py:40: error: More than one Unpack in a type is not allowed [misc] -tuples_unpacked.py:51: error: More than one Unpack in a type is not allowed [misc] -tuples_unpacked.py:59: error: More than one Unpack in a type is not allowed [misc] +tuples_unpacked.py:40: error: More than one variadic Unpack in a type is not allowed [misc] +tuples_unpacked.py:51: error: More than one variadic Unpack in a type is not allowed [misc] +tuples_unpacked.py:59: error: More than one variadic Unpack in a type is not allowed [misc] """ conformance_automated = "Fail" errors_diff = """ diff --git a/conformance/results/mypy/typeddicts_required.toml b/conformance/results/mypy/typeddicts_required.toml index 96ef50072..85c143e90 100644 --- a/conformance/results/mypy/typeddicts_required.toml +++ b/conformance/results/mypy/typeddicts_required.toml @@ -1,9 +1,9 @@ conformant = "Pass" output = """ typeddicts_required.py:12: error: Required[] can be only used in a TypedDict definition [valid-type] -typeddicts_required.py:19: error: NotRequired[] can be only used in a TypedDict definition [valid-type] -typeddicts_required.py:62: error: "Required[]" type cannot be nested [valid-type] -typeddicts_required.py:63: error: "NotRequired[]" type cannot be nested [valid-type] +typeddicts_required.py:16: error: NotRequired[] can be only used in a TypedDict definition [valid-type] +typeddicts_required.py:59: error: "Required[]" type cannot be nested [valid-type] +typeddicts_required.py:60: error: "NotRequired[]" type cannot be nested [valid-type] """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/mypy/version.toml b/conformance/results/mypy/version.toml index b72d4180d..7ce901e6d 100644 --- a/conformance/results/mypy/version.toml +++ b/conformance/results/mypy/version.toml @@ -1 +1 @@ -version = "mypy 1.17.1" +version = "mypy 1.18.2" diff --git a/conformance/results/pyre/constructors_call_metaclass.toml b/conformance/results/pyre/constructors_call_metaclass.toml index 9fb54b5f8..2eb021bba 100644 --- a/conformance/results/pyre/constructors_call_metaclass.toml +++ b/conformance/results/pyre/constructors_call_metaclass.toml @@ -4,8 +4,10 @@ Does not evaluate __new__ if metaclass __call__ is defined. """ conformance_automated = "Fail" errors_diff = """ -Line 51: Expected 1 errors -Line 65: Expected 1 errors +Line 54: Expected 1 errors +Line 68: Expected 1 errors +Line 69: Unexpected errors ['constructors_call_metaclass.py:69:0 Assert type [70]: Expected `Class4` but got `typing.Any`.'] """ output = """ +constructors_call_metaclass.py:69:0 Assert type [70]: Expected `Class4` but got `typing.Any`. """ diff --git a/conformance/results/pyre/generics_defaults.toml b/conformance/results/pyre/generics_defaults.toml index b39853185..b758eed33 100644 --- a/conformance/results/pyre/generics_defaults.toml +++ b/conformance/results/pyre/generics_defaults.toml @@ -53,24 +53,26 @@ generics_defaults.py:96:45 Invalid type parameters [24]: Non-generic type `Class generics_defaults.py:99:67 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T]]` but got `TypeVarTuple`. generics_defaults.py:127:13 Undefined or invalid type [11]: Annotation `T4` is not defined as a type. generics_defaults.py:130:0 Assert type [70]: Expected `int` but got `unknown`. -generics_defaults.py:141:11 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Ts`. -generics_defaults.py:141:11 Undefined or invalid type [11]: Annotation `T5` is not defined as a type. -generics_defaults.py:151:11 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Ts`. -generics_defaults.py:151:11 Undefined or invalid type [11]: Annotation `P` is not defined as a type. -generics_defaults.py:154:0 Assert type [70]: Expected `Type[Foo6[]]` but got `typing.Any`. -generics_defaults.py:154:12 Undefined attribute [16]: `Foo6` has no attribute `__getitem__`. -generics_defaults.py:154:28 Invalid type parameters [24]: Non-generic type `Foo6` cannot take parameters. +generics_defaults.py:131:0 Assert type [70]: Expected `typing.Any` but got `unknown`. +generics_defaults.py:142:11 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Ts`. +generics_defaults.py:142:11 Undefined or invalid type [11]: Annotation `T5` is not defined as a type. +generics_defaults.py:152:11 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Ts`. +generics_defaults.py:152:11 Undefined or invalid type [11]: Annotation `P` is not defined as a type. generics_defaults.py:155:0 Assert type [70]: Expected `Type[Foo6[]]` but got `typing.Any`. -generics_defaults.py:155:37 Invalid type parameters [24]: Non-generic type `Foo6` cannot take parameters. -generics_defaults.py:169:0 Assert type [70]: Expected `typing.Callable[[Foo7[]], Foo7[]]` but got `typing.Callable(Foo7.meth)[[Variable[_Self_generics_defaults_Foo7__ (bound to Foo7)]], Variable[_Self_generics_defaults_Foo7__ (bound to Foo7)]]`. -generics_defaults.py:169:23 Invalid type parameters [24]: Non-generic type `Foo7` cannot take parameters. -generics_defaults.py:170:0 Assert type [70]: Expected `int` but got `unknown`. +generics_defaults.py:155:12 Undefined attribute [16]: `Foo6` has no attribute `__getitem__`. +generics_defaults.py:155:28 Invalid type parameters [24]: Non-generic type `Foo6` cannot take parameters. +generics_defaults.py:156:0 Assert type [70]: Expected `Type[Foo6[]]` but got `typing.Any`. +generics_defaults.py:156:37 Invalid type parameters [24]: Non-generic type `Foo6` cannot take parameters. +generics_defaults.py:170:0 Assert type [70]: Expected `typing.Callable[[Foo7[]], Foo7[]]` but got `typing.Callable(Foo7.meth)[[Variable[_Self_generics_defaults_Foo7__ (bound to Foo7)]], Variable[_Self_generics_defaults_Foo7__ (bound to Foo7)]]`. +generics_defaults.py:170:23 Invalid type parameters [24]: Non-generic type `Foo7` cannot take parameters. +generics_defaults.py:171:0 Assert type [70]: Expected `int` but got `unknown`. """ conformance_automated = "Fail" errors_diff = """ Line 50: Expected 1 errors Line 107: Expected 1 errors Line 114: Expected 1 errors +Lines 130, 131: Expected exactly one error (tag 'optional-default-use') Line 27: Unexpected errors ['generics_defaults.py:27:20 Undefined or invalid type [11]: Annotation `DefaultIntT` is not defined as a type.'] Line 30: Unexpected errors ['generics_defaults.py:30:0 Assert type [70]: Expected `Type[NoNonDefaults[]]` but got `Type[NoNonDefaults]`.', 'generics_defaults.py:30:27 Invalid type parameters [24]: Non-generic type `NoNonDefaults` cannot take parameters.'] Line 31: Unexpected errors ['generics_defaults.py:31:0 Assert type [70]: Expected `Type[NoNonDefaults[]]` but got `typing.Any`.', 'generics_defaults.py:31:12 Undefined attribute [16]: `NoNonDefaults` has no attribute `__getitem__`.', 'generics_defaults.py:31:32 Invalid type parameters [24]: Non-generic type `NoNonDefaults` cannot take parameters.'] @@ -101,9 +103,10 @@ Line 96: Unexpected errors ['generics_defaults.py:96:0 Assert type [70]: Expecte Line 99: Unexpected errors ['generics_defaults.py:99:67 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T]]` but got `TypeVarTuple`.'] Line 127: Unexpected errors ['generics_defaults.py:127:13 Undefined or invalid type [11]: Annotation `T4` is not defined as a type.'] Line 130: Unexpected errors ['generics_defaults.py:130:0 Assert type [70]: Expected `int` but got `unknown`.'] -Line 151: Unexpected errors ["generics_defaults.py:151:11 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Ts`.", 'generics_defaults.py:151:11 Undefined or invalid type [11]: Annotation `P` is not defined as a type.'] -Line 154: Unexpected errors ['generics_defaults.py:154:0 Assert type [70]: Expected `Type[Foo6[]]` but got `typing.Any`.', 'generics_defaults.py:154:12 Undefined attribute [16]: `Foo6` has no attribute `__getitem__`.', 'generics_defaults.py:154:28 Invalid type parameters [24]: Non-generic type `Foo6` cannot take parameters.'] -Line 155: Unexpected errors ['generics_defaults.py:155:0 Assert type [70]: Expected `Type[Foo6[]]` but got `typing.Any`.', 'generics_defaults.py:155:37 Invalid type parameters [24]: Non-generic type `Foo6` cannot take parameters.'] -Line 169: Unexpected errors ['generics_defaults.py:169:0 Assert type [70]: Expected `typing.Callable[[Foo7[]], Foo7[]]` but got `typing.Callable(Foo7.meth)[[Variable[_Self_generics_defaults_Foo7__ (bound to Foo7)]], Variable[_Self_generics_defaults_Foo7__ (bound to Foo7)]]`.', 'generics_defaults.py:169:23 Invalid type parameters [24]: Non-generic type `Foo7` cannot take parameters.'] -Line 170: Unexpected errors ['generics_defaults.py:170:0 Assert type [70]: Expected `int` but got `unknown`.'] +Line 131: Unexpected errors ['generics_defaults.py:131:0 Assert type [70]: Expected `typing.Any` but got `unknown`.'] +Line 152: Unexpected errors ["generics_defaults.py:152:11 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Ts`.", 'generics_defaults.py:152:11 Undefined or invalid type [11]: Annotation `P` is not defined as a type.'] +Line 155: Unexpected errors ['generics_defaults.py:155:0 Assert type [70]: Expected `Type[Foo6[]]` but got `typing.Any`.', 'generics_defaults.py:155:12 Undefined attribute [16]: `Foo6` has no attribute `__getitem__`.', 'generics_defaults.py:155:28 Invalid type parameters [24]: Non-generic type `Foo6` cannot take parameters.'] +Line 156: Unexpected errors ['generics_defaults.py:156:0 Assert type [70]: Expected `Type[Foo6[]]` but got `typing.Any`.', 'generics_defaults.py:156:37 Invalid type parameters [24]: Non-generic type `Foo6` cannot take parameters.'] +Line 170: Unexpected errors ['generics_defaults.py:170:0 Assert type [70]: Expected `typing.Callable[[Foo7[]], Foo7[]]` but got `typing.Callable(Foo7.meth)[[Variable[_Self_generics_defaults_Foo7__ (bound to Foo7)]], Variable[_Self_generics_defaults_Foo7__ (bound to Foo7)]]`.', 'generics_defaults.py:170:23 Invalid type parameters [24]: Non-generic type `Foo7` cannot take parameters.'] +Line 171: Unexpected errors ['generics_defaults.py:171:0 Assert type [70]: Expected `int` but got `unknown`.'] """ diff --git a/conformance/results/pyre/generics_syntax_infer_variance.toml b/conformance/results/pyre/generics_syntax_infer_variance.toml index 2894b29bd..6339780b7 100644 --- a/conformance/results/pyre/generics_syntax_infer_variance.toml +++ b/conformance/results/pyre/generics_syntax_infer_variance.toml @@ -7,27 +7,24 @@ output = """ generics_syntax_infer_variance.py:15:0 Invalid variance definition [77]: Cannot use infer_variance with predefined variance. generics_syntax_infer_variance.py:17:0 Invalid variance definition [77]: Cannot use infer_variance with predefined variance. generics_syntax_infer_variance.py:29:0 Incompatible variable type [9]: vco1_2 is declared to have type `ShouldBeCovariant1[int]` but is used as type `ShouldBeCovariant1[float]`. -generics_syntax_infer_variance.py:36:36 Invalid class instantiation [45]: Cannot instantiate abstract class `ShouldBeCovariant2` with abstract methods `__getitem__`, `__len__`. -generics_syntax_infer_variance.py:37:0 Incompatible variable type [9]: vco2_2 is declared to have type `ShouldBeCovariant2[int]` but is used as type `ShouldBeCovariant2[float]`. -generics_syntax_infer_variance.py:37:34 Invalid class instantiation [45]: Cannot instantiate abstract class `ShouldBeCovariant2` with abstract methods `__getitem__`, `__len__`. -generics_syntax_infer_variance.py:46:0 Incompatible variable type [9]: vco3_2 is declared to have type `ShouldBeCovariant3[int]` but is used as type `ShouldBeCovariant3[float]`. -generics_syntax_infer_variance.py:75:0 Incompatible variable type [9]: vo5_2 is declared to have type `ShouldBeCovariant5[int]` but is used as type `ShouldBeCovariant5[float]`. -generics_syntax_infer_variance.py:86:0 Incompatible variable type [9]: vo6_2 is declared to have type `ShouldBeCovariant6[int]` but is used as type `ShouldBeCovariant6[float]`. -generics_syntax_infer_variance.py:102:0 Incompatible variable type [9]: vinv1_1 is declared to have type `ShouldBeInvariant1[float]` but is used as type `ShouldBeInvariant1[int]`. -generics_syntax_infer_variance.py:103:0 Incompatible variable type [9]: vinv1_2 is declared to have type `ShouldBeInvariant1[int]` but is used as type `ShouldBeInvariant1[float]`. -generics_syntax_infer_variance.py:117:0 Incompatible variable type [9]: vinv2_1 is declared to have type `ShouldBeInvariant2[float]` but is used as type `ShouldBeInvariant2[int]`. -generics_syntax_infer_variance.py:118:0 Incompatible variable type [9]: vinv2_2 is declared to have type `ShouldBeInvariant2[int]` but is used as type `ShouldBeInvariant2[float]`. -generics_syntax_infer_variance.py:125:0 Incompatible variable type [9]: vinv3_1 is declared to have type `ShouldBeInvariant3[float, str]` but is used as type `ShouldBeInvariant3[int, str]`. -generics_syntax_infer_variance.py:126:0 Incompatible variable type [9]: vinv3_2 is declared to have type `ShouldBeInvariant3[int, str]` but is used as type `ShouldBeInvariant3[float, str]`. -generics_syntax_infer_variance.py:127:0 Incompatible variable type [9]: vinv3_3 is declared to have type `ShouldBeInvariant3[str, float]` but is used as type `ShouldBeInvariant3[str, int]`. -generics_syntax_infer_variance.py:128:0 Incompatible variable type [9]: vinv3_4 is declared to have type `ShouldBeInvariant3[str, int]` but is used as type `ShouldBeInvariant3[str, float]`. -generics_syntax_infer_variance.py:133:7 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Variable[T]`. To reference the type variable, you can modify the class to inherit from `typing.Generic[T]`. -generics_syntax_infer_variance.py:155:0 Incompatible variable type [9]: vcontra1_1 is declared to have type `ShouldBeContravariant1[float]` but is used as type `ShouldBeContravariant1[int]`. +generics_syntax_infer_variance.py:47:0 Incompatible variable type [9]: vco2_2 is declared to have type `ShouldBeCovariant2[int]` but is used as type `ShouldBeCovariant2[float]`. +generics_syntax_infer_variance.py:56:0 Incompatible variable type [9]: vco3_2 is declared to have type `ShouldBeCovariant3[int]` but is used as type `ShouldBeCovariant3[float]`. +generics_syntax_infer_variance.py:85:0 Incompatible variable type [9]: vo5_2 is declared to have type `ShouldBeCovariant5[int]` but is used as type `ShouldBeCovariant5[float]`. +generics_syntax_infer_variance.py:96:0 Incompatible variable type [9]: vo6_2 is declared to have type `ShouldBeCovariant6[int]` but is used as type `ShouldBeCovariant6[float]`. +generics_syntax_infer_variance.py:112:0 Incompatible variable type [9]: vinv1_1 is declared to have type `ShouldBeInvariant1[float]` but is used as type `ShouldBeInvariant1[int]`. +generics_syntax_infer_variance.py:113:0 Incompatible variable type [9]: vinv1_2 is declared to have type `ShouldBeInvariant1[int]` but is used as type `ShouldBeInvariant1[float]`. +generics_syntax_infer_variance.py:127:0 Incompatible variable type [9]: vinv2_1 is declared to have type `ShouldBeInvariant2[float]` but is used as type `ShouldBeInvariant2[int]`. +generics_syntax_infer_variance.py:128:0 Incompatible variable type [9]: vinv2_2 is declared to have type `ShouldBeInvariant2[int]` but is used as type `ShouldBeInvariant2[float]`. +generics_syntax_infer_variance.py:135:0 Incompatible variable type [9]: vinv3_1 is declared to have type `ShouldBeInvariant3[float, str]` but is used as type `ShouldBeInvariant3[int, str]`. +generics_syntax_infer_variance.py:136:0 Incompatible variable type [9]: vinv3_2 is declared to have type `ShouldBeInvariant3[int, str]` but is used as type `ShouldBeInvariant3[float, str]`. +generics_syntax_infer_variance.py:137:0 Incompatible variable type [9]: vinv3_3 is declared to have type `ShouldBeInvariant3[str, float]` but is used as type `ShouldBeInvariant3[str, int]`. +generics_syntax_infer_variance.py:138:0 Incompatible variable type [9]: vinv3_4 is declared to have type `ShouldBeInvariant3[str, int]` but is used as type `ShouldBeInvariant3[str, float]`. +generics_syntax_infer_variance.py:143:7 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Variable[T]`. To reference the type variable, you can modify the class to inherit from `typing.Generic[T]`. +generics_syntax_infer_variance.py:165:0 Incompatible variable type [9]: vcontra1_1 is declared to have type `ShouldBeContravariant1[float]` but is used as type `ShouldBeContravariant1[int]`. """ conformance_automated = "Fail" errors_diff = """ -Line 136: Expected 1 errors -Line 144: Expected 1 errors -Line 36: Unexpected errors ['generics_syntax_infer_variance.py:36:36 Invalid class instantiation [45]: Cannot instantiate abstract class `ShouldBeCovariant2` with abstract methods `__getitem__`, `__len__`.'] -Line 133: Unexpected errors ["generics_syntax_infer_variance.py:133:7 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Variable[T]`. To reference the type variable, you can modify the class to inherit from `typing.Generic[T]`."] +Line 146: Expected 1 errors +Line 154: Expected 1 errors +Line 143: Unexpected errors ["generics_syntax_infer_variance.py:143:7 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Variable[T]`. To reference the type variable, you can modify the class to inherit from `typing.Generic[T]`."] """ diff --git a/conformance/results/pyre/namedtuples_define_class.toml b/conformance/results/pyre/namedtuples_define_class.toml index 3ce86df71..e6f039183 100644 --- a/conformance/results/pyre/namedtuples_define_class.toml +++ b/conformance/results/pyre/namedtuples_define_class.toml @@ -1,12 +1,3 @@ -conformant = "Partial" -notes = """ -Does not evaluate correct type for indexed named tuple instance with integer. -Does not evaluate correct type for indexed named tuple instance with slice. -Does not report out-of-range index access with named tuple instance. -Does not reject named tuple element with no default value after one with a default. -Incorrectly rejects assignment of named tuple to a tuple with compatible type. -Does not reject attempt to use NamedTuple with multiple inheritance. -""" output = """ namedtuples_define_class.py:32:6 Invalid tuple index [73]: Index 3 is out of bounds for concrete tuple with 3 members. namedtuples_define_class.py:33:6 Invalid tuple index [73]: Index -4 is out of bounds for concrete tuple with 3 members. diff --git a/conformance/results/pyre/namedtuples_usage.toml b/conformance/results/pyre/namedtuples_usage.toml index 785cef05a..9997fdec9 100644 --- a/conformance/results/pyre/namedtuples_usage.toml +++ b/conformance/results/pyre/namedtuples_usage.toml @@ -1,6 +1,3 @@ -conformant = "Partial" -notes = """ -""" output = """ namedtuples_usage.py:34:6 Invalid tuple index [73]: Index 3 is out of bounds for concrete tuple with 3 members. namedtuples_usage.py:35:6 Invalid tuple index [73]: Index -4 is out of bounds for concrete tuple with 3 members. diff --git a/conformance/results/pyre/protocols_explicit.toml b/conformance/results/pyre/protocols_explicit.toml index 0e7d70ef0..5a36eda0d 100644 --- a/conformance/results/pyre/protocols_explicit.toml +++ b/conformance/results/pyre/protocols_explicit.toml @@ -5,13 +5,14 @@ Does not report error when method is not implemented in derived class. """ output = """ protocols_explicit.py:60:4 Invalid class instantiation [45]: Cannot instantiate abstract class `Point` with abstract method `intensity`. -protocols_explicit.py:165:6 Invalid class instantiation [45]: Cannot instantiate abstract class `Concrete7A` with abstract method `method1`. +protocols_explicit.py:83:0 Uninitialized attribute [13]: Attribute `cm1` inherited from protocol `Proto1` in class `Concrete1` to have type `int` but is never initialized. +protocols_explicit.py:164:6 Invalid class instantiation [45]: Cannot instantiate abstract class `Concrete7A` with abstract method `method1`. """ conformance_automated = "Fail" errors_diff = """ Line 27: Expected 1 errors Line 56: Expected 1 errors -Line 90: Expected 1 errors -Line 110: Expected 1 errors -Line 135: Expected 1 errors +Line 89: Expected 1 errors +Line 134: Expected 1 errors +Line 83: Unexpected errors ['protocols_explicit.py:83:0 Uninitialized attribute [13]: Attribute `cm1` inherited from protocol `Proto1` in class `Concrete1` to have type `int` but is never initialized.'] """ diff --git a/conformance/results/pyre/typeddicts_required.toml b/conformance/results/pyre/typeddicts_required.toml index 60e6c0ce5..923f2b19e 100644 --- a/conformance/results/pyre/typeddicts_required.toml +++ b/conformance/results/pyre/typeddicts_required.toml @@ -7,13 +7,11 @@ Incorrectly complains about uninitialized attributes on TypedDict definitions. Incorrectly generates "attribute not initialized" errors for TypedDict fields. """ output = """ -typeddicts_required.py:15:8 Incompatible attribute type [8]: Attribute `x` declared in class `NotTypedDict` has type `Required[int]` but is used as type `int`. +typeddicts_required.py:12:4 Uninitialized attribute [13]: Attribute `x` is declared in class `NotTypedDict` to have type `Required[int]` but is never initialized. """ conformance_automated = "Fail" errors_diff = """ -Line 12: Expected 1 errors -Line 19: Expected 1 errors -Line 62: Expected 1 errors -Line 63: Expected 1 errors -Line 15: Unexpected errors ['typeddicts_required.py:15:8 Incompatible attribute type [8]: Attribute `x` declared in class `NotTypedDict` has type `Required[int]` but is used as type `int`.'] +Line 16: Expected 1 errors +Line 59: Expected 1 errors +Line 60: Expected 1 errors """ diff --git a/conformance/results/pyrefly/aliases_explicit.toml b/conformance/results/pyrefly/aliases_explicit.toml index ced5ae989..3eaadf112 100644 --- a/conformance/results/pyrefly/aliases_explicit.toml +++ b/conformance/results/pyrefly/aliases_explicit.toml @@ -24,6 +24,6 @@ ERROR aliases_explicit.py:89:22-23: number literal cannot be used in annotations ERROR aliases_explicit.py:90:22-33: boolean operation cannot be used in annotations [invalid-annotation] ERROR aliases_explicit.py:91:22-32: f-string cannot be used in annotations [invalid-annotation] ERROR aliases_explicit.py:100:5-19: `TypeAlias[ListAlias, type[list[Unknown]]]` is not subscriptable [unsupported-operation] -ERROR aliases_explicit.py:101:6-20: Expected a callable, got TypeAlias[ListOrSetAlias, type[list[Unknown] | set[Unknown]]] [not-callable] +ERROR aliases_explicit.py:101:6-20: Expected a callable, got `TypeAlias[ListOrSetAlias, type[list[Unknown] | set[Unknown]]]` [not-callable] ERROR aliases_explicit.py:102:5-24: `TypeAlias[ListOrSetAlias, type[list[Unknown] | set[Unknown]]]` is not subscriptable [unsupported-operation] """ diff --git a/conformance/results/pyrefly/aliases_implicit.toml b/conformance/results/pyrefly/aliases_implicit.toml index ee563bb49..7b1bfb607 100644 --- a/conformance/results/pyrefly/aliases_implicit.toml +++ b/conformance/results/pyrefly/aliases_implicit.toml @@ -26,6 +26,6 @@ ERROR aliases_implicit.py:115:10-24: Expected a type form, got instance of `Lite ERROR aliases_implicit.py:116:10-24: Expected a type form, got instance of `Literal[1]` [not-a-type] ERROR aliases_implicit.py:118:10-24: Expected a type form, got instance of `Literal['int']` [not-a-type] ERROR aliases_implicit.py:119:10-24: Expected a type form, got instance of `Literal['int | str']` [not-a-type] -ERROR aliases_implicit.py:133:6-20: Expected a callable, got type[list[Unknown] | set[Unknown]] [not-callable] +ERROR aliases_implicit.py:133:6-20: Expected a callable, got `type[list[Unknown] | set[Unknown]]` [not-callable] ERROR aliases_implicit.py:135:5-24: `type[list[Unknown] | set[Unknown]]` is not subscriptable [unsupported-operation] """ diff --git a/conformance/results/pyrefly/aliases_recursive.toml b/conformance/results/pyrefly/aliases_recursive.toml index e227e2baf..a83dc7e6b 100644 --- a/conformance/results/pyrefly/aliases_recursive.toml +++ b/conformance/results/pyrefly/aliases_recursive.toml @@ -8,26 +8,12 @@ Line 39: Expected 1 errors Line 50: Expected 1 errors Line 51: Expected 1 errors Line 52: Expected 1 errors +Line 63: Expected 1 errors +Line 69: Expected 1 errors Line 72: Expected 1 errors Line 75: Expected 1 errors -Line 30: Unexpected errors ["Expected a type form, got instance of `Literal['RecursiveTuple']` [not-a-type]"] Line 42: Unexpected errors ["Expected a type form, got instance of `Literal['RecursiveMapping']` [not-a-type]"] -Line 58: Unexpected errors ['Expected a type form, got instance of `_SpecialForm` [not-a-type]'] -Line 59: Unexpected errors ['`type[list[Unknown]]` is not subscriptable [unsupported-operation]'] -Line 62: Unexpected errors ['`type[list[Unknown]]` is not subscriptable [unsupported-operation]'] -Line 65: Unexpected errors ['Expected a type form, got instance of `_SpecialForm` [not-a-type]'] -Line 67: Unexpected errors ['`type[list[Unknown]]` is not subscriptable [unsupported-operation]'] -Line 68: Unexpected errors ['`type[list[Unknown]]` is not subscriptable [unsupported-operation]'] """ output = """ -ERROR aliases_recursive.py:30:36-52: Expected a type form, got instance of `Literal['RecursiveTuple']` [not-a-type] ERROR aliases_recursive.py:42:45-63: Expected a type form, got instance of `Literal['RecursiveMapping']` [not-a-type] -ERROR aliases_recursive.py:58:26-54: Expected a type form, got instance of `_SpecialForm` [not-a-type] -ERROR aliases_recursive.py:59:25-47: `type[list[Unknown]]` is not subscriptable [unsupported-operation] -ERROR aliases_recursive.py:62:5-27: `type[list[Unknown]]` is not subscriptable [unsupported-operation] -ERROR aliases_recursive.py:63:5-27: `type[list[Unknown]]` is not subscriptable [unsupported-operation] -ERROR aliases_recursive.py:65:26-63: Expected a type form, got instance of `_SpecialForm` [not-a-type] -ERROR aliases_recursive.py:67:5-32: `type[list[Unknown]]` is not subscriptable [unsupported-operation] -ERROR aliases_recursive.py:68:5-34: `type[list[Unknown]]` is not subscriptable [unsupported-operation] -ERROR aliases_recursive.py:69:5-32: `type[list[Unknown]]` is not subscriptable [unsupported-operation] """ diff --git a/conformance/results/pyrefly/aliases_type_statement.toml b/conformance/results/pyrefly/aliases_type_statement.toml index a838d5576..f887262d2 100644 --- a/conformance/results/pyrefly/aliases_type_statement.toml +++ b/conformance/results/pyrefly/aliases_type_statement.toml @@ -6,7 +6,6 @@ Does not detect circular definitions. """ conformance_automated = "Fail" errors_diff = """ -Line 26: Expected 1 errors Line 82: Expected 1 errors Line 84: Expected 1 errors Lines 51, 52: Expected error (tag 'TA14') @@ -14,8 +13,9 @@ Lines 88, 89: Expected error (tag 'RTA6') """ output = """ ERROR aliases_type_statement.py:17:1-21: Object of class `TypeAliasType` has no attribute `bit_count` [missing-attribute] -ERROR aliases_type_statement.py:19:1-11: Expected a callable, got TypeAlias[GoodAlias1, type[int]] [not-callable] +ERROR aliases_type_statement.py:19:1-11: Expected a callable, got `TypeAlias[GoodAlias1, type[int]]` [not-callable] ERROR aliases_type_statement.py:23:7-30: Object of class `TypeAliasType` has no attribute `other_attrib` [missing-attribute] +ERROR aliases_type_statement.py:26:18-28: Cannot use scoped type alias `GoodAlias1` as a base class. Use a legacy type alias instead: `GoodAlias1: TypeAlias = type[int]` [invalid-inheritance] ERROR aliases_type_statement.py:31:22-32: Expected class object, got `TypeAliasType` [invalid-argument] ERROR aliases_type_statement.py:37:22-62: function call cannot be used in annotations [invalid-annotation] ERROR aliases_type_statement.py:38:22-32: list literal cannot be used in annotations [invalid-annotation] diff --git a/conformance/results/pyrefly/aliases_typealiastype.toml b/conformance/results/pyrefly/aliases_typealiastype.toml index 80989c4cf..ddb3a209c 100644 --- a/conformance/results/pyrefly/aliases_typealiastype.toml +++ b/conformance/results/pyrefly/aliases_typealiastype.toml @@ -1,49 +1,30 @@ conformant = "Unsupported" conformance_automated = "Fail" errors_diff = """ -Line 44: Expected 1 errors Line 46: Expected 1 errors +Line 47: Expected 1 errors Line 48: Expected 1 errors -Line 52: Expected 1 errors -Line 53: Expected 1 errors -Line 54: Expected 1 errors -Line 55: Expected 1 errors -Line 56: Expected 1 errors -Line 57: Expected 1 errors -Line 58: Expected 1 errors -Line 59: Expected 1 errors -Line 60: Expected 1 errors -Line 61: Expected 1 errors -Line 62: Expected 1 errors -Line 63: Expected 1 errors -Line 64: Expected 1 errors -Line 17: Unexpected errors ['Argument `tuple[type[TypeVar[T]]]` is not assignable to parameter `type_params` with type `tuple[ParamSpec | TypeVar | TypeVarTuple, ...]` in function `typing.TypeAliasType.__new__` [bad-argument-type]'] -Line 18: Unexpected errors ['Argument `tuple[type[TypeVar[S]], type[TypeVar[T]]]` is not assignable to parameter `type_params` with type `tuple[ParamSpec | TypeVar | TypeVarTuple, ...]` in function `typing.TypeAliasType.__new__` [bad-argument-type]'] -Line 19: Unexpected errors ['Argument `tuple[type[TypeVar[T]]]` is not assignable to parameter `type_params` with type `tuple[ParamSpec | TypeVar | TypeVarTuple, ...]` in function `typing.TypeAliasType.__new__` [bad-argument-type]'] -Line 22: Unexpected errors ["Expected a type form, got instance of `Literal['GoodAlias5[S, TStr, P]']` [not-a-type]"] -Line 23: Unexpected errors ['Argument `tuple[type[TypeVar[S]], type[TypeVar[TStr]], type[ParamSpec[P]], type[TypeVarTuple[Ts]]]` is not assignable to parameter `type_params` with type `tuple[ParamSpec | TypeVar | TypeVarTuple, ...]` in function `typing.TypeAliasType.__new__` [bad-argument-type]'] -Line 35: Unexpected errors ['Expected a type form, got instance of `GenericAlias` [not-a-type]'] -Line 36: Unexpected errors ['Expected a type form, got instance of `GenericAlias` [not-a-type]'] -Line 37: Unexpected errors ['Expected a type form, got instance of `GenericAlias` [not-a-type]'] -Line 38: Unexpected errors ['Expected a type form, got instance of `GenericAlias` [not-a-type]'] -Line 39: Unexpected errors ['Expected a type form, got instance of `GenericAlias` [not-a-type]', 'Expected an iterable, got `type[tuple[int, str, int]]` [not-iterable]'] +Line 66: Expected 1 errors """ output = """ -ERROR aliases_typealiastype.py:17:63-67: Argument `tuple[type[TypeVar[T]]]` is not assignable to parameter `type_params` with type `tuple[ParamSpec | TypeVar | TypeVarTuple, ...]` in function `typing.TypeAliasType.__new__` [bad-argument-type] -ERROR aliases_typealiastype.py:18:73-79: Argument `tuple[type[TypeVar[S]], type[TypeVar[T]]]` is not assignable to parameter `type_params` with type `tuple[ParamSpec | TypeVar | TypeVarTuple, ...]` in function `typing.TypeAliasType.__new__` [bad-argument-type] -ERROR aliases_typealiastype.py:19:81-85: Argument `tuple[type[TypeVar[T]]]` is not assignable to parameter `type_params` with type `tuple[ParamSpec | TypeVar | TypeVarTuple, ...]` in function `typing.TypeAliasType.__new__` [bad-argument-type] -ERROR aliases_typealiastype.py:22:40-64: Expected a type form, got instance of `Literal['GoodAlias5[S, TStr, P]']` [not-a-type] -ERROR aliases_typealiastype.py:23:17-33: Argument `tuple[type[TypeVar[S]], type[TypeVar[TStr]], type[ParamSpec[P]], type[TypeVarTuple[Ts]]]` is not assignable to parameter `type_params` with type `tuple[ParamSpec | TypeVar | TypeVarTuple, ...]` in function `typing.TypeAliasType.__new__` [bad-argument-type] ERROR aliases_typealiastype.py:32:7-30: Object of class `TypeAliasType` has no attribute `other_attrib` [missing-attribute] -ERROR aliases_typealiastype.py:35:5-20: Expected a type form, got instance of `GenericAlias` [not-a-type] -ERROR aliases_typealiastype.py:36:5-20: Expected a type form, got instance of `GenericAlias` [not-a-type] -ERROR aliases_typealiastype.py:37:5-40: Expected a type form, got instance of `GenericAlias` [not-a-type] -ERROR aliases_typealiastype.py:38:5-40: Expected a type form, got instance of `GenericAlias` [not-a-type] -ERROR aliases_typealiastype.py:39:5-60: Expected a type form, got instance of `GenericAlias` [not-a-type] -ERROR aliases_typealiastype.py:39:16-59: Expected an iterable, got `type[tuple[int, str, int]]` [not-iterable] -ERROR aliases_typealiastype.py:40:5-30: Expected a type form, got instance of `GenericAlias` [not-a-type] -ERROR aliases_typealiastype.py:43:61-65: Argument `tuple[type[TypeVar[T]]]` is not assignable to parameter `type_params` with type `tuple[ParamSpec | TypeVar | TypeVarTuple, ...]` in function `typing.TypeAliasType.__new__` [bad-argument-type] -ERROR aliases_typealiastype.py:45:57-65: Argument `tuple[type[TypeVar[S]], type[TypeVar[T]]]` is not assignable to parameter `type_params` with type `tuple[ParamSpec | TypeVar | TypeVarTuple, ...]` in function `typing.TypeAliasType.__new__` [bad-argument-type] -ERROR aliases_typealiastype.py:47:74-78: Argument `tuple[type[TypeVar[T]]]` is not assignable to parameter `type_params` with type `tuple[ParamSpec | TypeVar | TypeVarTuple, ...]` in function `typing.TypeAliasType.__new__` [bad-argument-type] -ERROR aliases_typealiastype.py:66:47-57: `BadAlias21` is uninitialized [unbound-name] +ERROR aliases_typealiastype.py:40:5-30: Type `int` is not assignable to upper bound `str` of type variable `TStr` [bad-specialization] +ERROR aliases_typealiastype.py:43:40-47: Type variable `S` is out of scope for this `TypeAliasType` [type-alias-error] +ERROR aliases_typealiastype.py:44:40-47: Type variable `S` is out of scope for this `TypeAliasType` [type-alias-error] +ERROR aliases_typealiastype.py:45:45-65: Value for argument `type_params` must be a tuple literal [type-alias-error] +ERROR aliases_typealiastype.py:52:40-80: function call cannot be used in annotations [invalid-annotation] +ERROR aliases_typealiastype.py:53:40-50: list literal cannot be used in annotations [invalid-annotation] +ERROR aliases_typealiastype.py:54:42-55: tuple literal cannot be used in annotations [invalid-annotation] +ERROR aliases_typealiastype.py:55:42-65: list comprehension cannot be used in annotations [invalid-annotation] +ERROR aliases_typealiastype.py:56:42-52: dict literal cannot be used in annotations [invalid-annotation] +ERROR aliases_typealiastype.py:56:44-45: Could not find name `a` [unknown-name] +ERROR aliases_typealiastype.py:56:49-50: Could not find name `b` [unknown-name] +ERROR aliases_typealiastype.py:57:42-57: function call cannot be used in annotations [invalid-annotation] +ERROR aliases_typealiastype.py:58:42-50: invalid subscript expression cannot be used in annotations [invalid-annotation] +ERROR aliases_typealiastype.py:59:42-63: if expression cannot be used in annotations [invalid-annotation] +ERROR aliases_typealiastype.py:60:42-46: Expected `BadAlias16` to be a type alias, got `Literal[3]` [type-alias-error] +ERROR aliases_typealiastype.py:61:42-46: bool literal cannot be used in annotations [invalid-annotation] +ERROR aliases_typealiastype.py:62:42-43: number literal cannot be used in annotations [invalid-annotation] +ERROR aliases_typealiastype.py:63:42-53: boolean operation cannot be used in annotations [invalid-annotation] +ERROR aliases_typealiastype.py:64:42-52: f-string cannot be used in annotations [invalid-annotation] """ diff --git a/conformance/results/pyrefly/callables_kwargs.toml b/conformance/results/pyrefly/callables_kwargs.toml index 7e70cf52b..ea7fa4326 100644 --- a/conformance/results/pyrefly/callables_kwargs.toml +++ b/conformance/results/pyrefly/callables_kwargs.toml @@ -1,10 +1,5 @@ -conformant = "Partial" -notes = """ -Does not reject overlap between unpacked TypedDict kwarg and named parameters -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 111: Expected 1 errors """ output = """ ERROR callables_kwargs.py:46:10-12: Missing argument `v1` in function `func1` [missing-argument] @@ -24,6 +19,7 @@ ERROR callables_kwargs.py:65:17-22: Multiple values for argument `v1` in functio ERROR callables_kwargs.py:101:19-24: `(**kwargs: Unpack[TypedDict[TD2]]) -> None` is not assignable to `TDProtocol3` [bad-assignment] ERROR callables_kwargs.py:102:19-24: `(**kwargs: Unpack[TypedDict[TD2]]) -> None` is not assignable to `TDProtocol4` [bad-assignment] ERROR callables_kwargs.py:103:19-24: `(**kwargs: Unpack[TypedDict[TD2]]) -> None` is not assignable to `TDProtocol5` [bad-assignment] +ERROR callables_kwargs.py:111:20-41: TypedDict key 'v1' in **kwargs overlaps with parameter 'v1' [bad-function-definition] ERROR callables_kwargs.py:122:21-30: `Unpack` in **kwargs annotation must be used only with a `TypedDict` [invalid-annotation] ERROR callables_kwargs.py:134:19-24: `(*, v1: int, v3: str, v2: str = '') -> None` is not assignable to `TDProtocol6` [bad-assignment] """ diff --git a/conformance/results/pyrefly/constructors_call_metaclass.toml b/conformance/results/pyrefly/constructors_call_metaclass.toml index 44d131a2c..5471a7404 100644 --- a/conformance/results/pyrefly/constructors_call_metaclass.toml +++ b/conformance/results/pyrefly/constructors_call_metaclass.toml @@ -3,6 +3,6 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR constructors_call_metaclass.py:51:7-9: Missing argument `x` in function `Class3.__new__` [missing-argument] -ERROR constructors_call_metaclass.py:65:7-9: Missing argument `x` in function `Class4.__new__` [missing-argument] +ERROR constructors_call_metaclass.py:54:7-9: Missing argument `x` in function `Class3.__new__` [missing-argument] +ERROR constructors_call_metaclass.py:68:7-9: Missing argument `x` in function `Class4.__new__` [missing-argument] """ diff --git a/conformance/results/pyrefly/constructors_callable.toml b/conformance/results/pyrefly/constructors_callable.toml index 42087455d..edbb81b14 100644 --- a/conformance/results/pyrefly/constructors_callable.toml +++ b/conformance/results/pyrefly/constructors_callable.toml @@ -18,28 +18,18 @@ Line 165: Unexpected errors ['assert_type(Class7[Any], Class7[str]) failed [asse Line 183: Unexpected errors ['assert_type(Class8[Any], Class8[str]) failed [assert-type]'] """ output = """ - constructors_callable.py:36:12-16: revealed type: (x: int) -> Class1 [reveal-type] ERROR constructors_callable.py:38:3-5: Missing argument `x` [missing-argument] ERROR constructors_callable.py:39:3-8: Missing argument `x` [missing-argument] ERROR constructors_callable.py:39:4-5: Unexpected keyword argument `y` [unexpected-keyword] - constructors_callable.py:49:12-16: revealed type: () -> Class2 [reveal-type] ERROR constructors_callable.py:51:4-5: Expected 0 positional arguments, got 1 [bad-argument-count] ERROR constructors_callable.py:62:23-29: Argument `type[Class3]` is not assignable to parameter `cb` with type `(*args: Unknown, **kwargs: Unknown) -> Class3` in function `accepts_callable` [bad-argument-type] - constructors_callable.py:63:12-16: revealed type: (*args: Unknown, **kwargs: Unknown) -> Class3 [reveal-type] - constructors_callable.py:77:12-16: revealed type: (x: int) -> int [reveal-type] ERROR constructors_callable.py:79:3-5: Missing argument `x` [missing-argument] ERROR constructors_callable.py:80:3-8: Missing argument `x` [missing-argument] ERROR constructors_callable.py:80:4-5: Unexpected keyword argument `y` [unexpected-keyword] - constructors_callable.py:97:12-16: revealed type: (*args: Any, **kwargs: Any) -> NoReturn [reveal-type] - constructors_callable.py:125:12-16: revealed type: () -> Class6Proxy [reveal-type] ERROR constructors_callable.py:127:4-5: Expected 0 positional arguments, got 1 [bad-argument-count] - constructors_callable.py:142:12-20: revealed type: () -> Any [reveal-type] ERROR constructors_callable.py:144:8-9: Expected 0 positional arguments, got 1 [bad-argument-count] - constructors_callable.py:161:12-163:2: revealed type: (x: int) -> Class7[Unknown] [reveal-type] ERROR constructors_callable.py:164:12-32: assert_type(Class7[Any], Class7[int]) failed [assert-type] ERROR constructors_callable.py:165:12-33: assert_type(Class7[Any], Class7[str]) failed [assert-type] ERROR constructors_callable.py:165:16-18: Argument `Literal['']` is not assignable to parameter `x` with type `int` [bad-argument-type] - constructors_callable.py:182:12-16: revealed type: (x: list[Unknown], y: list[Unknown]) -> Class8[Unknown] [reveal-type] ERROR constructors_callable.py:183:12-41: assert_type(Class8[Any], Class8[str]) failed [assert-type] - constructors_callable.py:193:12-16: revealed type: (x: list[@_], y: list[@_]) -> Class9 [reveal-type] """ diff --git a/conformance/results/pyrefly/dataclasses_final.toml b/conformance/results/pyrefly/dataclasses_final.toml index 9afd7169e..eed3df1b9 100644 --- a/conformance/results/pyrefly/dataclasses_final.toml +++ b/conformance/results/pyrefly/dataclasses_final.toml @@ -5,10 +5,10 @@ Allows assignment to final attributes that are not initialized on the class conformance_automated = "Fail" errors_diff = """ Line 35: Expected 1 errors +Line 37: Expected 1 errors """ output = """ ERROR dataclasses_final.py:27:1-17: Cannot set field `final_classvar` [read-only] ERROR dataclasses_final.py:36:1-21: Cannot set field `final_with_default` [read-only] -ERROR dataclasses_final.py:37:1-19: Instance-only attribute `final_no_default` of class `D` is not visible on the class [no-access] ERROR dataclasses_final.py:38:1-21: Cannot set field `final_with_default` [read-only] """ diff --git a/conformance/results/pyrefly/dataclasses_postinit.toml b/conformance/results/pyrefly/dataclasses_postinit.toml index 7691703f0..5e94c099b 100644 --- a/conformance/results/pyrefly/dataclasses_postinit.toml +++ b/conformance/results/pyrefly/dataclasses_postinit.toml @@ -3,8 +3,8 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR dataclasses_postinit.py:19:9-22: `__post_init__` type `BoundMethod[DC1, (self: Self@DC1, x: int, y: int) -> None]` is not assignable to expected type `(x: int, y: str) -> object` generated from the dataclass's `InitVar` fields [bad-function-definition] +ERROR dataclasses_postinit.py:19:9-22: `__post_init__` type `BoundMethod[DC1, (self: DC1, x: int, y: int) -> None]` is not assignable to expected type `(x: int, y: str) -> object` generated from the dataclass's `InitVar` fields [bad-function-definition] ERROR dataclasses_postinit.py:28:7-12: Object of class `DC1` has no attribute `x` [missing-attribute] ERROR dataclasses_postinit.py:29:7-12: Object of class `DC1` has no attribute `y` [missing-attribute] -ERROR dataclasses_postinit.py:36:9-22: `__post_init__` type `BoundMethod[DC2, (self: Self@DC2, x: int) -> None]` is not assignable to expected type `(x: int, y: str) -> object` generated from the dataclass's `InitVar` fields [bad-function-definition] +ERROR dataclasses_postinit.py:36:9-22: `__post_init__` type `BoundMethod[DC2, (self: DC2, x: int) -> None]` is not assignable to expected type `(x: int, y: str) -> object` generated from the dataclass's `InitVar` fields [bad-function-definition] """ diff --git a/conformance/results/pyrefly/directives_deprecated.toml b/conformance/results/pyrefly/directives_deprecated.toml index 74a726540..2b3718261 100644 --- a/conformance/results/pyrefly/directives_deprecated.toml +++ b/conformance/results/pyrefly/directives_deprecated.toml @@ -1,6 +1,7 @@ conformant = "Unsupported" conformance_automated = "Fail" errors_diff = """ +Line 18: Expected 1 errors Line 24: Expected 1 errors Line 25: Expected 1 errors Line 30: Expected 1 errors @@ -14,5 +15,4 @@ Line 69: Expected 1 errors Line 98: Expected 1 errors """ output = """ - directives_deprecated.py:18:44-47: `Ham` is deprecated [deprecated] """ diff --git a/conformance/results/pyrefly/directives_reveal_type.toml b/conformance/results/pyrefly/directives_reveal_type.toml index 2257de40a..5cd063da4 100644 --- a/conformance/results/pyrefly/directives_reveal_type.toml +++ b/conformance/results/pyrefly/directives_reveal_type.toml @@ -3,10 +3,6 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ - directives_reveal_type.py:14:16-19: revealed type: int | str [reveal-type] - directives_reveal_type.py:15:16-19: revealed type: list[int] [reveal-type] - directives_reveal_type.py:16:16-19: revealed type: Any [reveal-type] - directives_reveal_type.py:17:16-19: revealed type: ForwardReference [reveal-type] ERROR directives_reveal_type.py:19:16-18: reveal_type needs 1 positional argument, got 0 [bad-argument-count] ERROR directives_reveal_type.py:20:16-22: reveal_type needs 1 positional argument, got 2 [bad-argument-count] """ diff --git a/conformance/results/pyrefly/enums_behaviors.toml b/conformance/results/pyrefly/enums_behaviors.toml index 40b63a7e1..8d785714b 100644 --- a/conformance/results/pyrefly/enums_behaviors.toml +++ b/conformance/results/pyrefly/enums_behaviors.toml @@ -1,13 +1,7 @@ -conformant = "Partial" -notes = """ -Iterating an enum class gives Any -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 20: Unexpected errors ['assert_type(Any, Color) failed [assert-type]'] """ output = """ -ERROR enums_behaviors.py:20:16-30: assert_type(Any, Color) failed [assert-type] ERROR enums_behaviors.py:27:12-33: assert_type(Literal[Color.RED], Color) failed [assert-type] ERROR enums_behaviors.py:32:12-43: assert_type(Color, Literal[Color.BLUE]) failed [assert-type] ERROR enums_behaviors.py:44:21-26: Cannot extend final class `Shape` [invalid-inheritance] diff --git a/conformance/results/pyrefly/enums_member_values.toml b/conformance/results/pyrefly/enums_member_values.toml index 103ac0050..135c7a1b4 100644 --- a/conformance/results/pyrefly/enums_member_values.toml +++ b/conformance/results/pyrefly/enums_member_values.toml @@ -7,9 +7,8 @@ ERROR enums_member_values.py:21:12-43: assert_type(int, Literal[1]) failed [asse ERROR enums_member_values.py:22:12-41: assert_type(int, Literal[1]) failed [assert-type] ERROR enums_member_values.py:26:16-50: assert_type(int, Literal[1, 3]) failed [assert-type] ERROR enums_member_values.py:30:16-51: assert_type(int, Literal[1, 2, 3]) failed [assert-type] -ERROR enums_member_values.py:54:12-46: assert_type(tuple[Literal[1], float, float], Literal[1]) failed [assert-type] +ERROR enums_member_values.py:54:12-46: assert_type(Any, Literal[1]) failed [assert-type] ERROR enums_member_values.py:68:12-42: assert_type(auto, Literal[1]) failed [assert-type] ERROR enums_member_values.py:78:5-10: Enum member `GREEN` has type `str`, must match the `_value_` attribute annotation of `int` [bad-assignment] ERROR enums_member_values.py:85:24-29: `int` is not assignable to attribute `_value_` with type `str` [bad-assignment] -ERROR enums_member_values.py:96:12-41: assert_type(Ellipsis, int) failed [assert-type] """ diff --git a/conformance/results/pyrefly/enums_members.toml b/conformance/results/pyrefly/enums_members.toml index 5e14c87e0..7b0090a0d 100644 --- a/conformance/results/pyrefly/enums_members.toml +++ b/conformance/results/pyrefly/enums_members.toml @@ -4,28 +4,21 @@ Enum members that are aliases of other members do not resolved to the aliased me """ conformance_automated = "Fail" errors_diff = """ -Line 27: Unexpected errors ['assert_type(Any, str) failed [assert-type]', 'Instance-only attribute `genus` of class `Pet` is not visible on the class [missing-attribute]'] -Line 28: Unexpected errors ['assert_type(Any, str) failed [assert-type]', 'Instance-only attribute `species` of class `Pet` is not visible on the class [missing-attribute]'] Line 100: Unexpected errors ['assert_type(Literal[TrafficLight.AMBER], Literal[TrafficLight.YELLOW]) failed [assert-type]'] """ output = """ -ERROR enums_members.py:27:12-28: assert_type(Any, str) failed [assert-type] -ERROR enums_members.py:27:13-22: Instance-only attribute `genus` of class `Pet` is not visible on the class [missing-attribute] -ERROR enums_members.py:28:12-30: assert_type(Any, str) failed [assert-type] -ERROR enums_members.py:28:13-24: Instance-only attribute `species` of class `Pet` is not visible on the class [missing-attribute] ERROR enums_members.py:50:5-8: Enum member `DOG` may not be annotated directly. Instead, annotate the `_value_` attribute. [invalid-annotation] ERROR enums_members.py:82:12-53: assert_type((x: Any) -> str, Any) failed [assert-type] ERROR enums_members.py:82:37-51: `Pet4.converter` is not a valid enum member [invalid-literal] ERROR enums_members.py:83:12-53: assert_type((x: int) -> int, Any) failed [assert-type] ERROR enums_members.py:83:37-51: `Pet4.transform` is not a valid enum member [invalid-literal] -ERROR enums_members.py:84:12-49: assert_type((self: Self) -> str, Any) failed [assert-type] +ERROR enums_members.py:84:12-49: assert_type((self: Pet4) -> str, Any) failed [assert-type] ERROR enums_members.py:84:35-47: `Pet4.species` is not a valid enum member [invalid-literal] -ERROR enums_members.py:85:12-45: assert_type((self: Self) -> None, Any) failed [assert-type] +ERROR enums_members.py:85:12-45: assert_type((self: Pet4) -> None, Any) failed [assert-type] ERROR enums_members.py:85:33-43: `Pet4.speak` is not a valid enum member [invalid-literal] ERROR enums_members.py:100:12-62: assert_type(Literal[TrafficLight.AMBER], Literal[TrafficLight.YELLOW]) failed [assert-type] ERROR enums_members.py:116:12-43: assert_type(nonmember[int], Any) failed [assert-type] ERROR enums_members.py:116:32-41: `Example.b` is not a valid enum member [invalid-literal] - enums_members.py:128:20-34: revealed type: int [reveal-type] ERROR enums_members.py:129:20-57: assert_type(int, Any) failed [assert-type] ERROR enums_members.py:129:43-55: `Example2.__B` is not a valid enum member [invalid-literal] ERROR enums_members.py:146:12-27: assert_type(Literal[Pet5.DOG], int) failed [assert-type] diff --git a/conformance/results/pyrefly/generics_basic.toml b/conformance/results/pyrefly/generics_basic.toml index 209981f5d..c0b28fb8e 100644 --- a/conformance/results/pyrefly/generics_basic.toml +++ b/conformance/results/pyrefly/generics_basic.toml @@ -6,7 +6,6 @@ Constrained type var resolves to subtype instead of explcitly listed constraint """ conformance_automated = "Fail" errors_diff = """ -Line 49: Expected 1 errors Line 34: Unexpected errors ['`+` is not supported between `AnyStr` and `AnyStr` [unsupported-operation]', '`+` is not supported between `AnyStr` and `AnyStr` [unsupported-operation]', 'Returned type `bytes | Unknown` is not assignable to declared return type `AnyStr` [bad-return]'] Line 67: Unexpected errors ['assert_type(MyStr, str) failed [assert-type]'] Line 68: Unexpected errors ['assert_type(MyStr, str) failed [assert-type]', 'Argument `str` is not assignable to parameter `y` with type `MyStr` in function `concat` [bad-argument-type]'] @@ -17,6 +16,7 @@ ERROR generics_basic.py:34:12-17: `+` is not supported between `AnyStr` and `Any ERROR generics_basic.py:34:12-17: Returned type `bytes | Unknown` is not assignable to declared return type `AnyStr` [bad-return] ERROR generics_basic.py:40:15-16: Argument `bytes` is not assignable to parameter `y` with type `str` in function `concat` [bad-argument-type] ERROR generics_basic.py:41:15-16: Argument `str` is not assignable to parameter `y` with type `bytes` in function `concat` [bad-argument-type] +ERROR generics_basic.py:49:18-48: Expected at least 2 constraints in TypeVar `BadConstraint1`, got 1 [invalid-type-var] ERROR generics_basic.py:55:53-60: Type variable bounds and constraints must be concrete [invalid-annotation] ERROR generics_basic.py:67:16-35: assert_type(MyStr, str) failed [assert-type] ERROR generics_basic.py:68:16-35: assert_type(MyStr, str) failed [assert-type] diff --git a/conformance/results/pyrefly/generics_defaults.toml b/conformance/results/pyrefly/generics_defaults.toml index 4b3618525..3216033da 100644 --- a/conformance/results/pyrefly/generics_defaults.toml +++ b/conformance/results/pyrefly/generics_defaults.toml @@ -1,12 +1,10 @@ -conformant = "Pass" +conformant = "Partial" notes = """ -Unsolved type var is not always resolved to default (optional) +Defaults are not bound by attribute access """ conformance_automated = "Fail" errors_diff = """ -Line 130: Unexpected errors ['assert_type(Any, int) failed [assert-type]'] -Line 169: Unexpected errors ['assert_type([DefaultIntT](Foo7[DefaultIntT]) -> Foo7[DefaultIntT], (Foo7[int]) -> Foo7[int]) failed [assert-type]'] -Line 170: Unexpected errors ['assert_type(Any, int) failed [assert-type]', 'Instance-only attribute `attr` of class `Foo7` is not visible on the class [missing-attribute]'] +Line 170: Unexpected errors ['assert_type([DefaultIntT](Foo7[DefaultIntT]) -> Foo7[DefaultIntT], (Foo7[int]) -> Foo7[int]) failed [assert-type]'] """ output = """ ERROR generics_defaults.py:24:7-31: Type parameter `T` without a default cannot follow type parameter `DefaultStrT` with a default [invalid-type-var] @@ -14,8 +12,6 @@ ERROR generics_defaults.py:50:1-20: Expected 5 type arguments for `AllTheDefault ERROR generics_defaults.py:107:51-54: Expected default `int` of `Invalid1` to be assignable to the upper bound of `str` [invalid-type-var] ERROR generics_defaults.py:114:52-55: Expected default `int` of `Invalid2` to be one of the following constraints: `float`, `str` [invalid-type-var] ERROR generics_defaults.py:130:12-27: assert_type(Any, int) failed [assert-type] -ERROR generics_defaults.py:141:7-11: TypeVar `T5` with a default cannot follow TypeVarTuple `Ts` [invalid-type-var] -ERROR generics_defaults.py:169:12-57: assert_type([DefaultIntT](Foo7[DefaultIntT]) -> Foo7[DefaultIntT], (Foo7[int]) -> Foo7[int]) failed [assert-type] -ERROR generics_defaults.py:170:12-28: assert_type(Any, int) failed [assert-type] -ERROR generics_defaults.py:170:13-22: Instance-only attribute `attr` of class `Foo7` is not visible on the class [missing-attribute] +ERROR generics_defaults.py:142:7-11: TypeVar `T5` with a default cannot follow TypeVarTuple `Ts` [invalid-type-var] +ERROR generics_defaults.py:170:12-57: assert_type([DefaultIntT](Foo7[DefaultIntT]) -> Foo7[DefaultIntT], (Foo7[int]) -> Foo7[int]) failed [assert-type] """ diff --git a/conformance/results/pyrefly/generics_paramspec_basic.toml b/conformance/results/pyrefly/generics_paramspec_basic.toml index 5529454da..b446dd177 100644 --- a/conformance/results/pyrefly/generics_paramspec_basic.toml +++ b/conformance/results/pyrefly/generics_paramspec_basic.toml @@ -4,7 +4,7 @@ errors_diff = """ """ output = """ ERROR generics_paramspec_basic.py:10:13-31: ParamSpec must be assigned to a variable named `NotIt` [invalid-param-spec] -ERROR generics_paramspec_basic.py:15:18-19: `ParamSpec[P]` is not allowed in this context [invalid-annotation] +ERROR generics_paramspec_basic.py:15:18-19: `ParamSpec` is not allowed in this context [invalid-annotation] ERROR generics_paramspec_basic.py:23:14-15: `ParamSpec` is not allowed in this context [invalid-annotation] ERROR generics_paramspec_basic.py:23:20-21: `ParamSpec` is not allowed in this context [invalid-annotation] ERROR generics_paramspec_basic.py:27:14-33: `Concatenate[int, P]` is not allowed in this context [invalid-annotation] diff --git a/conformance/results/pyrefly/generics_self_advanced.toml b/conformance/results/pyrefly/generics_self_advanced.toml index f671925ce..fb11f7c63 100644 --- a/conformance/results/pyrefly/generics_self_advanced.toml +++ b/conformance/results/pyrefly/generics_self_advanced.toml @@ -2,14 +2,8 @@ conformant = "Pass" notes = """ Treats attributes not initialized on the class as instance-only """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 43: Unexpected errors ['assert_type(Any, list[Self]) failed [assert-type]', 'Instance-only attribute `a` of class `ChildB` is not visible on the class [missing-attribute]'] -Line 44: Unexpected errors ['assert_type(Any, Self) failed [assert-type]', 'Instance-only attribute `a` of class `ChildB` is not visible on the class [missing-attribute]'] """ output = """ -ERROR generics_self_advanced.py:43:20-39: assert_type(Any, list[Self]) failed [assert-type] -ERROR generics_self_advanced.py:43:21-26: Instance-only attribute `a` of class `ChildB` is not visible on the class [missing-attribute] -ERROR generics_self_advanced.py:44:20-36: assert_type(Any, Self) failed [assert-type] -ERROR generics_self_advanced.py:44:21-26: Instance-only attribute `a` of class `ChildB` is not visible on the class [missing-attribute] """ diff --git a/conformance/results/pyrefly/generics_self_attributes.toml b/conformance/results/pyrefly/generics_self_attributes.toml index e93cf3661..70866175a 100644 --- a/conformance/results/pyrefly/generics_self_attributes.toml +++ b/conformance/results/pyrefly/generics_self_attributes.toml @@ -1,11 +1,7 @@ -conformant = "Partial" -notes = """ -Does not reject incorrect direct assignment to attribute w/ Self -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 32: Expected 1 errors """ output = """ ERROR generics_self_attributes.py:26:38-62: Argument `LinkedList[int]` is not assignable to parameter `next` with type `OrdinalLinkedList | None` in function `OrdinalLinkedList.__init__` [bad-argument-type] +ERROR generics_self_attributes.py:32:15-50: `LinkedList[int]` is not assignable to attribute `next` with type `OrdinalLinkedList | None` [bad-assignment] """ diff --git a/conformance/results/pyrefly/generics_self_protocols.toml b/conformance/results/pyrefly/generics_self_protocols.toml index 41968988b..befe1eef6 100644 --- a/conformance/results/pyrefly/generics_self_protocols.toml +++ b/conformance/results/pyrefly/generics_self_protocols.toml @@ -1,13 +1,7 @@ -conformant = "Partial" -notes = """ -Protocol subtyping does not work with Self in return annotation -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 58: Unexpected errors ['Argument `ReturnConcreteShape` is not assignable to parameter `shape` with type `ShapeProtocol` in function `accepts_shape` [bad-argument-type]'] """ output = """ -ERROR generics_self_protocols.py:58:19-40: Argument `ReturnConcreteShape` is not assignable to parameter `shape` with type `ShapeProtocol` in function `accepts_shape` [bad-argument-type] ERROR generics_self_protocols.py:61:19-34: Argument `BadReturnType` is not assignable to parameter `shape` with type `ShapeProtocol` in function `accepts_shape` [bad-argument-type] ERROR generics_self_protocols.py:64:19-41: Argument `ReturnDifferentClass` is not assignable to parameter `shape` with type `ShapeProtocol` in function `accepts_shape` [bad-argument-type] """ diff --git a/conformance/results/pyrefly/generics_syntax_compatibility.toml b/conformance/results/pyrefly/generics_syntax_compatibility.toml index 1ed01bdef..d6e72a2c5 100644 --- a/conformance/results/pyrefly/generics_syntax_compatibility.toml +++ b/conformance/results/pyrefly/generics_syntax_compatibility.toml @@ -6,5 +6,4 @@ output = """ ERROR generics_syntax_compatibility.py:14:7-13: Class `ClassA` uses type variables not specified in `Generic` or `Protocol` base [invalid-type-var] ERROR generics_syntax_compatibility.py:14:22-23: Type parameter K is not included in the type parameter list [invalid-type-var] ERROR generics_syntax_compatibility.py:26:35-36: Type parameter K is not included in the type parameter list [invalid-type-var] -ERROR generics_syntax_compatibility.py:26:45-46: Type parameter K is not included in the type parameter list [invalid-type-var] """ diff --git a/conformance/results/pyrefly/generics_syntax_infer_variance.toml b/conformance/results/pyrefly/generics_syntax_infer_variance.toml index eec9124da..422d6031b 100644 --- a/conformance/results/pyrefly/generics_syntax_infer_variance.toml +++ b/conformance/results/pyrefly/generics_syntax_infer_variance.toml @@ -6,19 +6,19 @@ output = """ ERROR generics_syntax_infer_variance.py:15:36-55: Contradictory variance specifications [invalid-type-var] ERROR generics_syntax_infer_variance.py:17:40-59: Contradictory variance specifications [invalid-type-var] ERROR generics_syntax_infer_variance.py:29:35-62: `ShouldBeCovariant1[float]` is not assignable to `ShouldBeCovariant1[int]` [bad-assignment] -ERROR generics_syntax_infer_variance.py:37:35-62: `ShouldBeCovariant2[float]` is not assignable to `ShouldBeCovariant2[int]` [bad-assignment] -ERROR generics_syntax_infer_variance.py:46:35-62: `ShouldBeCovariant3[float]` is not assignable to `ShouldBeCovariant3[int]` [bad-assignment] -ERROR generics_syntax_infer_variance.py:75:34-64: `ShouldBeCovariant5[float]` is not assignable to `ShouldBeCovariant5[int]` [bad-assignment] -ERROR generics_syntax_infer_variance.py:86:34-64: `ShouldBeCovariant6[float]` is not assignable to `ShouldBeCovariant6[int]` [bad-assignment] -ERROR generics_syntax_infer_variance.py:102:38-64: `ShouldBeInvariant1[int]` is not assignable to `ShouldBeInvariant1[float]` [bad-assignment] -ERROR generics_syntax_infer_variance.py:103:36-66: `ShouldBeInvariant1[float]` is not assignable to `ShouldBeInvariant1[int]` [bad-assignment] -ERROR generics_syntax_infer_variance.py:117:38-64: `ShouldBeInvariant2[int]` is not assignable to `ShouldBeInvariant2[float]` [bad-assignment] -ERROR generics_syntax_infer_variance.py:118:36-66: `ShouldBeInvariant2[float]` is not assignable to `ShouldBeInvariant2[int]` [bad-assignment] -ERROR generics_syntax_infer_variance.py:125:43-73: `ShouldBeInvariant3[int, str]` is not assignable to `ShouldBeInvariant3[float, str]` [bad-assignment] -ERROR generics_syntax_infer_variance.py:126:41-73: `ShouldBeInvariant3[float, str]` is not assignable to `ShouldBeInvariant3[int, str]` [bad-assignment] -ERROR generics_syntax_infer_variance.py:127:43-73: `ShouldBeInvariant3[str, int]` is not assignable to `ShouldBeInvariant3[str, float]` [bad-assignment] -ERROR generics_syntax_infer_variance.py:128:41-73: `ShouldBeInvariant3[str, float]` is not assignable to `ShouldBeInvariant3[str, int]` [bad-assignment] -ERROR generics_syntax_infer_variance.py:136:38-64: `ShouldBeInvariant4[int]` is not assignable to `ShouldBeInvariant4[float]` [bad-assignment] -ERROR generics_syntax_infer_variance.py:144:38-64: `ShouldBeInvariant5[int]` is not assignable to `ShouldBeInvariant5[float]` [bad-assignment] -ERROR generics_syntax_infer_variance.py:155:45-75: `ShouldBeContravariant1[int]` is not assignable to `ShouldBeContravariant1[float]` [bad-assignment] +ERROR generics_syntax_infer_variance.py:47:35-62: `ShouldBeCovariant2[float]` is not assignable to `ShouldBeCovariant2[int]` [bad-assignment] +ERROR generics_syntax_infer_variance.py:56:35-62: `ShouldBeCovariant3[float]` is not assignable to `ShouldBeCovariant3[int]` [bad-assignment] +ERROR generics_syntax_infer_variance.py:85:34-64: `ShouldBeCovariant5[float]` is not assignable to `ShouldBeCovariant5[int]` [bad-assignment] +ERROR generics_syntax_infer_variance.py:96:34-64: `ShouldBeCovariant6[float]` is not assignable to `ShouldBeCovariant6[int]` [bad-assignment] +ERROR generics_syntax_infer_variance.py:112:38-64: `ShouldBeInvariant1[int]` is not assignable to `ShouldBeInvariant1[float]` [bad-assignment] +ERROR generics_syntax_infer_variance.py:113:36-66: `ShouldBeInvariant1[float]` is not assignable to `ShouldBeInvariant1[int]` [bad-assignment] +ERROR generics_syntax_infer_variance.py:127:38-64: `ShouldBeInvariant2[int]` is not assignable to `ShouldBeInvariant2[float]` [bad-assignment] +ERROR generics_syntax_infer_variance.py:128:36-66: `ShouldBeInvariant2[float]` is not assignable to `ShouldBeInvariant2[int]` [bad-assignment] +ERROR generics_syntax_infer_variance.py:135:43-73: `ShouldBeInvariant3[int, str]` is not assignable to `ShouldBeInvariant3[float, str]` [bad-assignment] +ERROR generics_syntax_infer_variance.py:136:41-73: `ShouldBeInvariant3[float, str]` is not assignable to `ShouldBeInvariant3[int, str]` [bad-assignment] +ERROR generics_syntax_infer_variance.py:137:43-73: `ShouldBeInvariant3[str, int]` is not assignable to `ShouldBeInvariant3[str, float]` [bad-assignment] +ERROR generics_syntax_infer_variance.py:138:41-73: `ShouldBeInvariant3[str, float]` is not assignable to `ShouldBeInvariant3[str, int]` [bad-assignment] +ERROR generics_syntax_infer_variance.py:146:38-64: `ShouldBeInvariant4[int]` is not assignable to `ShouldBeInvariant4[float]` [bad-assignment] +ERROR generics_syntax_infer_variance.py:154:38-64: `ShouldBeInvariant5[int]` is not assignable to `ShouldBeInvariant5[float]` [bad-assignment] +ERROR generics_syntax_infer_variance.py:165:45-75: `ShouldBeContravariant1[int]` is not assignable to `ShouldBeContravariant1[float]` [bad-assignment] """ diff --git a/conformance/results/pyrefly/generics_syntax_scoping.toml b/conformance/results/pyrefly/generics_syntax_scoping.toml index c0270e159..f569cc931 100644 --- a/conformance/results/pyrefly/generics_syntax_scoping.toml +++ b/conformance/results/pyrefly/generics_syntax_scoping.toml @@ -7,9 +7,6 @@ errors_diff = """ Line 92: Expected 1 errors Line 95: Expected 1 errors Line 98: Expected 1 errors -Line 66: Unexpected errors ['Found `S`, but it was not the global scope [unknown-name]'] -Line 67: Unexpected errors ['assert_type(Any, int) failed [assert-type]'] -Line 116: Unexpected errors ['assert_type(type[T], TypeVar) failed [assert-type]'] """ output = """ ERROR generics_syntax_scoping.py:14:20-31: Type variable bounds and constraints must be concrete [invalid-annotation] @@ -17,7 +14,4 @@ ERROR generics_syntax_scoping.py:18:26-27: Expected a type form, got instance of ERROR generics_syntax_scoping.py:35:7-8: `T` is uninitialized [unbound-name] ERROR generics_syntax_scoping.py:44:17-18: `T` is uninitialized [unbound-name] ERROR generics_syntax_scoping.py:44:17-18: Expected a type form, got instance of `int` [not-a-type] -ERROR generics_syntax_scoping.py:66:20-21: Found `S`, but it was not the global scope [unknown-name] -ERROR generics_syntax_scoping.py:67:24-32: assert_type(Any, int) failed [assert-type] -ERROR generics_syntax_scoping.py:116:24-36: assert_type(type[T], TypeVar) failed [assert-type] """ diff --git a/conformance/results/pyrefly/generics_type_erasure.toml b/conformance/results/pyrefly/generics_type_erasure.toml index dbbeeacb5..efb957387 100644 --- a/conformance/results/pyrefly/generics_type_erasure.toml +++ b/conformance/results/pyrefly/generics_type_erasure.toml @@ -5,9 +5,9 @@ errors_diff = """ output = """ ERROR generics_type_erasure.py:38:16-18: Argument `Literal['']` is not assignable to parameter `label` with type `int | None` in function `Node.__init__` [bad-argument-type] ERROR generics_type_erasure.py:40:16-17: Argument `Literal[0]` is not assignable to parameter `label` with type `str | None` in function `Node.__init__` [bad-argument-type] -ERROR generics_type_erasure.py:42:1-16: Instance-only attribute `label` of class `Node` is not visible on the class [no-access] -ERROR generics_type_erasure.py:43:1-16: Instance-only attribute `label` of class `Node` is not visible on the class [missing-attribute] -ERROR generics_type_erasure.py:44:1-11: Instance-only attribute `label` of class `Node` is not visible on the class [no-access] -ERROR generics_type_erasure.py:45:1-11: Instance-only attribute `label` of class `Node` is not visible on the class [missing-attribute] -ERROR generics_type_erasure.py:46:1-15: Instance-only attribute `label` of class `Node` is not visible on the class [missing-attribute] +ERROR generics_type_erasure.py:42:1-16: Generic attribute `label` of class `Node` is not visible on the class [no-access] +ERROR generics_type_erasure.py:43:1-16: Generic attribute `label` of class `Node` is not visible on the class [missing-attribute] +ERROR generics_type_erasure.py:44:1-11: Generic attribute `label` of class `Node` is not visible on the class [no-access] +ERROR generics_type_erasure.py:45:1-11: Generic attribute `label` of class `Node` is not visible on the class [missing-attribute] +ERROR generics_type_erasure.py:46:1-15: Generic attribute `label` of class `Node` is not visible on the class [missing-attribute] """ diff --git a/conformance/results/pyrefly/generics_upper_bound.toml b/conformance/results/pyrefly/generics_upper_bound.toml index d2778f5c1..cfbb661e9 100644 --- a/conformance/results/pyrefly/generics_upper_bound.toml +++ b/conformance/results/pyrefly/generics_upper_bound.toml @@ -1,14 +1,10 @@ -conformant = "Partial" -notes = """ -Instantiation is not validated against bound -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 51: Expected 1 errors """ output = """ ERROR generics_upper_bound.py:24:38-45: Type variable bounds and constraints must be concrete [invalid-annotation] ERROR generics_upper_bound.py:43:12-55: assert_type(list[int], list[int] | set[int]) failed [assert-type] ERROR generics_upper_bound.py:43:25-31: Argument `set[int]` is not assignable to parameter `y` with type `list[int]` in function `longer` [bad-argument-type] +ERROR generics_upper_bound.py:51:7-13: Type `int` is not assignable to upper bound `Sized` of type variable `ST` [bad-specialization] ERROR generics_upper_bound.py:56:38-49: TypeVar cannot have both constraints and bound [invalid-type-var] """ diff --git a/conformance/results/pyrefly/literals_literalstring.toml b/conformance/results/pyrefly/literals_literalstring.toml index 1e52195ae..d9f744fdc 100644 --- a/conformance/results/pyrefly/literals_literalstring.toml +++ b/conformance/results/pyrefly/literals_literalstring.toml @@ -1,12 +1,5 @@ -conformant = "Partial" -notes = """ -LiteralString is sometimes converted to str -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 120: Expected 1 errors -Line 111: Unexpected errors ["assert_type(str, Literal['hello']) failed [assert-type]"] -Line 116: Unexpected errors ['assert_type(str, LiteralString) failed [assert-type]'] """ output = """ ERROR literals_literalstring.py:36:29-42: Invalid type inside literal, `LiteralString` [invalid-literal] @@ -15,8 +8,7 @@ ERROR literals_literalstring.py:43:23-24: `Literal['two']` is not assignable to ERROR literals_literalstring.py:66:25-47: `str` is not assignable to `LiteralString` [bad-assignment] ERROR literals_literalstring.py:74:25-26: `Literal[3]` is not assignable to `LiteralString` [bad-assignment] ERROR literals_literalstring.py:75:25-32: `Literal[b'test']` is not assignable to `LiteralString` [bad-assignment] -ERROR literals_literalstring.py:111:16-37: assert_type(str, Literal['hello']) failed [assert-type] -ERROR literals_literalstring.py:116:16-35: assert_type(str, LiteralString) failed [assert-type] +ERROR literals_literalstring.py:120:21-24: Type `str` is not assignable to upper bound `LiteralString` of type variable `TLiteral` [bad-specialization] ERROR literals_literalstring.py:134:51-52: Argument `str` is not assignable to parameter `value` with type `LiteralString` in function `Container.__init__` [bad-argument-type] ERROR literals_literalstring.py:171:21-24: `list[LiteralString]` is not assignable to `list[str]` [bad-assignment] """ diff --git a/conformance/results/pyrefly/overloads_consistency.toml b/conformance/results/pyrefly/overloads_consistency.toml index c7e562825..da6c71193 100644 --- a/conformance/results/pyrefly/overloads_consistency.toml +++ b/conformance/results/pyrefly/overloads_consistency.toml @@ -3,6 +3,6 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR overloads_consistency.py:25:5-16: Overload return type `str` is not assignable to implementation return type `int` [invalid-overload] -ERROR overloads_consistency.py:41:5-19: Implementation signature `(x: int) -> int | str` does not accept all arguments that overload signature `(x: str) -> str` accepts [invalid-overload] +ERROR overloads_consistency.py:25:5-16: Overload return type `str` is not assignable to implementation return type `int` [inconsistent-overload] +ERROR overloads_consistency.py:41:5-19: Implementation signature `(x: int) -> int | str` does not accept all arguments that overload signature `(x: str) -> str` accepts [inconsistent-overload] """ diff --git a/conformance/results/pyrefly/overloads_definitions.toml b/conformance/results/pyrefly/overloads_definitions.toml index ab58e4fba..302bc4a2c 100644 --- a/conformance/results/pyrefly/overloads_definitions.toml +++ b/conformance/results/pyrefly/overloads_definitions.toml @@ -5,20 +5,21 @@ Does not require some decorators that need to appear on every overload """ conformance_automated = "Fail" errors_diff = """ -Lines 71, 73, 78, 81: Expected error (tag 'func5') -Lines 121, 122, 123, 127: Expected error (tag 'invalid_final') -Lines 135, 136, 137, 141, 142: Expected error (tag 'invalid_final_2') -Lines 170, 175, 181, 183: Expected error (tag 'override-final') -Lines 220, 221, 222, 225, 226: Expected error (tag 'override_impl') Line 49: Unexpected errors ['Overloaded function must have an implementation [invalid-overload]'] -Line 176: Unexpected errors ['`final_method` is declared as final in parent class `Base` [bad-override]'] """ output = """ ERROR overloads_definitions.py:16:5-10: Overloaded function needs at least two @overload declarations [invalid-overload] ERROR overloads_definitions.py:28:5-10: Overloaded function must have an implementation [invalid-overload] ERROR overloads_definitions.py:49:9-14: Overloaded function must have an implementation [invalid-overload] ERROR overloads_definitions.py:59:9-21: Overloaded function must have an implementation [invalid-overload] -ERROR overloads_definitions.py:90:9-14: Implementation signature `(cls: type[Self@C], *args: int | str) -> int | str` does not accept all arguments that overload signature `(self: Self@C, x: str, /) -> str` accepts [invalid-overload] +ERROR overloads_definitions.py:81:9-14: If `@staticmethod` is present on any overload or the implementation, it should be on every overload and the implementation. [invalid-overload] +ERROR overloads_definitions.py:90:9-14: If `@classmethod` is present on any overload or the implementation, it should be on every overload and the implementation. [invalid-overload] +ERROR overloads_definitions.py:90:9-14: Implementation signature `(cls: type[Self@C], *args: int | str) -> int | str` does not accept all arguments that overload signature `(self: Self@C, x: str, /) -> str` accepts [inconsistent-overload] +ERROR overloads_definitions.py:123:9-22: `@final` should only be applied to the implementation of an overloaded function. [invalid-overload] +ERROR overloads_definitions.py:137:9-24: `@final` should only be applied to the implementation of an overloaded function. [invalid-overload] +ERROR overloads_definitions.py:142:9-24: `@final` should only be applied to the implementation of an overloaded function. [invalid-overload] ERROR overloads_definitions.py:176:9-21: `final_method` is declared as final in parent class `Base` [bad-override] ERROR overloads_definitions.py:191:9-21: Class member `Child.bad_override` is marked as an override, but no parent class has a matching attribute [bad-override] +ERROR overloads_definitions.py:222:9-20: `@override` should only be applied to the implementation of an overloaded function. [invalid-overload] +ERROR overloads_definitions.py:226:9-20: `@override` should only be applied to the implementation of an overloaded function. [invalid-overload] """ diff --git a/conformance/results/pyrefly/overloads_definitions_stub.toml b/conformance/results/pyrefly/overloads_definitions_stub.toml index 18ba0b318..d3bd427e3 100644 --- a/conformance/results/pyrefly/overloads_definitions_stub.toml +++ b/conformance/results/pyrefly/overloads_definitions_stub.toml @@ -1,18 +1,13 @@ -conformant = "Partial" -notes = """ -Does not restrict some decorators to the first overload -Does not require some decorators that need to appear on every overload -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Lines 32, 33, 37: Expected error (tag 'func5') -Lines 39, 41, 44: Expected error (tag 'func6') -Lines 67, 69, 71, 72, 73: Expected error (tag 'invalid_final') -Lines 80, 82, 84, 85, 86: Expected error (tag 'invalid_final_2') -Lines 143, 146, 147, 149: Expected error (tag 'override_impl') """ output = """ ERROR overloads_definitions_stub.pyi:14:5-10: Overloaded function needs at least two @overload declarations [invalid-overload] +ERROR overloads_definitions_stub.pyi:33:9-14: If `@staticmethod` is present on one overload, all overloads must have that decorator. [invalid-overload] +ERROR overloads_definitions_stub.pyi:44:9-14: If `@classmethod` is present on one overload, all overloads must have that decorator. [invalid-overload] +ERROR overloads_definitions_stub.pyi:73:9-22: If an overloaded function has no implementation, `@final` should be applied to the first overload only. [invalid-overload] +ERROR overloads_definitions_stub.pyi:86:9-24: If an overloaded function has no implementation, `@final` should be applied to the first overload only. [invalid-overload] ERROR overloads_definitions_stub.pyi:108:9-21: `final_method` is declared as final in parent class `Base` [bad-override] ERROR overloads_definitions_stub.pyi:122:9-21: Class member `Child.bad_override` is marked as an override, but no parent class has a matching attribute [bad-override] +ERROR overloads_definitions_stub.pyi:147:9-20: If an overloaded function has no implementation, `@override` should be applied to the first overload only. [invalid-overload] """ diff --git a/conformance/results/pyrefly/overloads_evaluation.toml b/conformance/results/pyrefly/overloads_evaluation.toml index 70360bd2e..2d0abc7cd 100644 --- a/conformance/results/pyrefly/overloads_evaluation.toml +++ b/conformance/results/pyrefly/overloads_evaluation.toml @@ -5,16 +5,6 @@ Does not perform argument expansion """ conformance_automated = "Fail" errors_diff = """ -Line 105: Unexpected errors ['No matching overload found for function `example2` [no-matching-overload]'] -Line 106: Unexpected errors ['assert_type(Any, int | str) failed [assert-type]'] -Line 134: Unexpected errors ['No matching overload found for function `expand_bool` [no-matching-overload]'] -Line 135: Unexpected errors ['assert_type(Any, Literal[0, 1]) failed [assert-type]'] -Line 160: Unexpected errors ['No matching overload found for function `expand_enum` [no-matching-overload]'] -Line 161: Unexpected errors ['assert_type(Any, Literal[0, 1]) failed [assert-type]'] -Line 180: Unexpected errors ['No matching overload found for function `expand_type_union` [no-matching-overload]'] -Line 181: Unexpected errors ['assert_type(Any, int | str) failed [assert-type]'] -Line 204: Unexpected errors ['No matching overload found for function `expand_tuple` [no-matching-overload]'] -Line 205: Unexpected errors ['assert_type(Any, int | str) failed [assert-type]'] Line 234: Unexpected errors ['assert_type(str, int) failed [assert-type]'] Line 264: Unexpected errors ['assert_type(list[int], Any) failed [assert-type]'] Line 280: Unexpected errors ['assert_type(list[int], Any) failed [assert-type]'] @@ -24,17 +14,7 @@ output = """ ERROR overloads_evaluation.py:38:11-13: No matching overload found for function `example1_1` [no-matching-overload] ERROR overloads_evaluation.py:46:11-17: No matching overload found for function `example1_1` [no-matching-overload] ERROR overloads_evaluation.py:51:11-14: No matching overload found for function `example1_1` [no-matching-overload] -ERROR overloads_evaluation.py:105:20-29: No matching overload found for function `example2` [no-matching-overload] -ERROR overloads_evaluation.py:106:16-33: assert_type(Any, int | str) failed [assert-type] ERROR overloads_evaluation.py:115:13-22: No matching overload found for function `example2` [no-matching-overload] -ERROR overloads_evaluation.py:134:23-26: No matching overload found for function `expand_bool` [no-matching-overload] -ERROR overloads_evaluation.py:135:16-37: assert_type(Any, Literal[0, 1]) failed [assert-type] -ERROR overloads_evaluation.py:160:23-26: No matching overload found for function `expand_enum` [no-matching-overload] -ERROR overloads_evaluation.py:161:16-37: assert_type(Any, Literal[0, 1]) failed [assert-type] -ERROR overloads_evaluation.py:180:29-32: No matching overload found for function `expand_type_union` [no-matching-overload] -ERROR overloads_evaluation.py:181:16-33: assert_type(Any, int | str) failed [assert-type] -ERROR overloads_evaluation.py:204:24-32: No matching overload found for function `expand_tuple` [no-matching-overload] -ERROR overloads_evaluation.py:205:16-33: assert_type(Any, int | str) failed [assert-type] ERROR overloads_evaluation.py:234:16-27: assert_type(str, int) failed [assert-type] ERROR overloads_evaluation.py:264:16-27: assert_type(list[int], Any) failed [assert-type] ERROR overloads_evaluation.py:280:16-34: assert_type(list[int], Any) failed [assert-type] diff --git a/conformance/results/pyrefly/protocols_explicit.toml b/conformance/results/pyrefly/protocols_explicit.toml index 5e1815915..bdb414d48 100644 --- a/conformance/results/pyrefly/protocols_explicit.toml +++ b/conformance/results/pyrefly/protocols_explicit.toml @@ -5,12 +5,11 @@ Does not check against abstract class instantiations conformance_automated = "Fail" errors_diff = """ Line 27: Expected 1 errors -Line 60: Expected 1 errors -Line 90: Expected 1 errors -Line 110: Expected 1 errors -Line 135: Expected 1 errors -Line 165: Expected 1 errors +Line 89: Expected 1 errors +Line 134: Expected 1 errors """ output = """ ERROR protocols_explicit.py:56:20-36: `tuple[int, int, str]` is not assignable to attribute `rgb` with type `tuple[int, int, int]` [bad-assignment] +ERROR protocols_explicit.py:60:10-20: Cannot instantiate `Point` because the following members are abstract: `intensity` [bad-instantiation] +ERROR protocols_explicit.py:164:17-19: Cannot instantiate `Concrete7A` because the following members are abstract: `method1` [bad-instantiation] """ diff --git a/conformance/results/pyrefly/protocols_generic.toml b/conformance/results/pyrefly/protocols_generic.toml index 908c30134..86b534695 100644 --- a/conformance/results/pyrefly/protocols_generic.toml +++ b/conformance/results/pyrefly/protocols_generic.toml @@ -1,10 +1,5 @@ -conformant = "Partial" -notes = """ -Fails one protocol subtyping example involving @property -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 144: Unexpected errors ['`ConcreteHasProperty1` is not assignable to `HasPropertyProto` [bad-assignment]'] """ output = """ ERROR protocols_generic.py:40:24-35: `Concrete1` is not assignable to `Proto1[int, str]` [bad-assignment] @@ -13,7 +8,6 @@ ERROR protocols_generic.py:56:20-29: `Box[float]` is not assignable to `Box[int] ERROR protocols_generic.py:66:25-35: `Sender[int]` is not assignable to `Sender[float]` [bad-assignment] ERROR protocols_generic.py:74:28-36: `AttrProto[int]` is not assignable to `AttrProto[float]` [bad-assignment] ERROR protocols_generic.py:75:26-36: `AttrProto[float]` is not assignable to `AttrProto[int]` [bad-assignment] -ERROR protocols_generic.py:144:25-47: `ConcreteHasProperty1` is not assignable to `HasPropertyProto` [bad-assignment] ERROR protocols_generic.py:145:25-47: `ConcreteHasProperty2` is not assignable to `HasPropertyProto` [bad-assignment] ERROR protocols_generic.py:146:25-47: `ConcreteHasProperty3` is not assignable to `HasPropertyProto` [bad-assignment] ERROR protocols_generic.py:147:25-47: `ConcreteHasProperty4` is not assignable to `HasPropertyProto` [bad-assignment] diff --git a/conformance/results/pyrefly/protocols_merging.toml b/conformance/results/pyrefly/protocols_merging.toml index d24c0828f..ad33e85e6 100644 --- a/conformance/results/pyrefly/protocols_merging.toml +++ b/conformance/results/pyrefly/protocols_merging.toml @@ -1,15 +1,11 @@ -conformant = "Partial" -notes = """ -Does not check against abstract class instantiations -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 82: Expected 1 errors """ output = """ ERROR protocols_merging.py:52:25-38: `SCConcrete2` is not assignable to `SizedAndClosable1` [bad-assignment] ERROR protocols_merging.py:53:25-38: `SCConcrete2` is not assignable to `SizedAndClosable2` [bad-assignment] ERROR protocols_merging.py:54:25-38: `SCConcrete2` is not assignable to `SizedAndClosable3` [bad-assignment] ERROR protocols_merging.py:67:16-33: If `Protocol` is included as a base class, all other bases must be protocols [invalid-inheritance] +ERROR protocols_merging.py:82:22-24: Cannot instantiate `SizedAndClosable4` because the following members are abstract: `close` [bad-instantiation] ERROR protocols_merging.py:83:24-37: `SCConcrete1` is not assignable to `SizedAndClosable4` [bad-assignment] """ diff --git a/conformance/results/pyrefly/protocols_self.toml b/conformance/results/pyrefly/protocols_self.toml index df568b19f..cdd4d0cd9 100644 --- a/conformance/results/pyrefly/protocols_self.toml +++ b/conformance/results/pyrefly/protocols_self.toml @@ -1,13 +1,5 @@ -conformant = "Partial" -notes = """ -Fails some protocol subtyping examples when self is annotated with a type var -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 32: Unexpected errors ['`One` is not assignable to variable `c` with type `Copyable` [bad-assignment]'] -Line 33: Unexpected errors ['`Other` is not assignable to variable `c` with type `Copyable` [bad-assignment]'] """ output = """ -ERROR protocols_self.py:32:5-10: `One` is not assignable to variable `c` with type `Copyable` [bad-assignment] -ERROR protocols_self.py:33:5-12: `Other` is not assignable to variable `c` with type `Copyable` [bad-assignment] """ diff --git a/conformance/results/pyrefly/protocols_variance.toml b/conformance/results/pyrefly/protocols_variance.toml index a9c170036..957bf05b5 100644 --- a/conformance/results/pyrefly/protocols_variance.toml +++ b/conformance/results/pyrefly/protocols_variance.toml @@ -1,3 +1,4 @@ +conformant = "Unsupported" conformance_automated = "Fail" errors_diff = """ Line 21: Expected 1 errors diff --git a/conformance/results/pyrefly/qualifiers_final_decorator.toml b/conformance/results/pyrefly/qualifiers_final_decorator.toml index e4d7d3abb..c129fa545 100644 --- a/conformance/results/pyrefly/qualifiers_final_decorator.toml +++ b/conformance/results/pyrefly/qualifiers_final_decorator.toml @@ -1,10 +1,5 @@ -conformant = "Partial" -notes = """ -Does not ban final decorator on overload when implementation exists -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Lines 84, 85, 86: Expected error (tag 'Derived3-2') """ output = """ ERROR qualifiers_final_decorator.py:21:16-21: Cannot extend final class `Base1` [invalid-inheritance] @@ -13,6 +8,7 @@ ERROR qualifiers_final_decorator.py:60:9-16: `method2` is declared as final in p ERROR qualifiers_final_decorator.py:64:9-16: `method3` is declared as final in parent class `Base2` [bad-override] ERROR qualifiers_final_decorator.py:68:9-16: `method4` is declared as final in parent class `Base2` [bad-override] ERROR qualifiers_final_decorator.py:81:9-15: `method` is declared as final in parent class `Base3` [bad-override] +ERROR qualifiers_final_decorator.py:86:9-15: `@final` should only be applied to the implementation of an overloaded function. [invalid-overload] ERROR qualifiers_final_decorator.py:95:9-15: `method` is declared as final in parent class `Base4` [bad-override] ERROR qualifiers_final_decorator.py:118:9-15: `method` is declared as final in parent class `Base5_2` [bad-override] ERROR qualifiers_final_decorator.py:125:1-7: Decorator `@final` can only be used on methods. [invalid-decorator] diff --git a/conformance/results/pyrefly/specialtypes_none.toml b/conformance/results/pyrefly/specialtypes_none.toml index fcd2fb564..6d4c240e0 100644 --- a/conformance/results/pyrefly/specialtypes_none.toml +++ b/conformance/results/pyrefly/specialtypes_none.toml @@ -3,7 +3,7 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR specialtypes_none.py:21:7-17: Argument `type` is not assignable to parameter `val1` with type `None` in function `func1` [bad-argument-type] +ERROR specialtypes_none.py:21:7-17: Argument `type[NoneType]` is not assignable to parameter `val1` with type `None` in function `func1` [bad-argument-type] ERROR specialtypes_none.py:27:19-23: `None` is not assignable to `Iterable[Unknown]` [bad-assignment] ERROR specialtypes_none.py:41:7-11: Argument `None` is not assignable to parameter `val1` with type `type[None]` in function `func2` [bad-argument-type] """ diff --git a/conformance/results/pyrefly/typeddicts_extra_items.toml b/conformance/results/pyrefly/typeddicts_extra_items.toml index 341dd6c96..1ae173356 100644 --- a/conformance/results/pyrefly/typeddicts_extra_items.toml +++ b/conformance/results/pyrefly/typeddicts_extra_items.toml @@ -1,22 +1,9 @@ -conformant = "Partial" -notes = """ -Does not fully support extra_items for typed dicts -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 129: Unexpected errors ['TypedDict `MovieEI` does not have key `year` [typed-dict-key-error]'] -Line 144: Unexpected errors ['Unexpected keyword argument `year` in function `unpack_extra` [unexpected-keyword]'] -Line 300: Unexpected errors ['`TypedDict[MovieExtraStr]` is not assignable to `Mapping[str, str]` [bad-assignment]'] -Line 304: Unexpected errors ['`TypedDict[MovieExtraInt]` is not assignable to `Mapping[str, int | str]` [bad-assignment]'] -Line 326: Unexpected errors ['`TypedDict[IntDict]` is not assignable to `dict[str, int]` [bad-assignment]'] -Line 330: Unexpected errors ['`TypedDict[IntDictWithNum]` is not assignable to `dict[str, int]` [bad-assignment]'] -Line 337: Unexpected errors ['Object of class `IntDictWithNum` has no attribute `clear` [missing-attribute]'] -Line 339: Unexpected errors ['assert_type(Any, tuple[str, int]) failed [assert-type]', 'Object of class `IntDictWithNum` has no attribute `popitem` [missing-attribute]'] -Line 343: Unexpected errors ['Cannot delete item in `TypedDict[IntDictWithNum]` [unsupported-operation]'] """ output = """ -ERROR typeddicts_extra_items.py:15:45-49: `Literal[1982]` is not assignable to TypedDict `extra_items` type `bool` [typed-dict-key-error] -ERROR typeddicts_extra_items.py:22:55-59: `Literal[1982]` is not assignable to TypedDict `extra_items` type `bool` [typed-dict-key-error] +ERROR typeddicts_extra_items.py:15:45-49: `Literal[1982]` is not assignable to TypedDict key with type `bool` [typed-dict-key-error] +ERROR typeddicts_extra_items.py:22:55-59: `Literal[1982]` is not assignable to TypedDict key with type `bool` [typed-dict-key-error] ERROR typeddicts_extra_items.py:39:54-58: `None` is not assignable to TypedDict key `year` with type `int` [typed-dict-key-error] ERROR typeddicts_extra_items.py:49:7-16: Expected literal True or False for keyword `closed`, got instance of `bool` [bad-typed-dict] ERROR typeddicts_extra_items.py:67:7-20: Non-closed TypedDict cannot inherit from closed TypedDict `ClosedBase` [bad-typed-dict] @@ -27,9 +14,7 @@ ERROR typeddicts_extra_items.py:109:7-30: Closed TypedDict cannot inherit from T ERROR typeddicts_extra_items.py:114:50-63: `Required` is not allowed in this context [invalid-annotation] ERROR typeddicts_extra_items.py:117:57-73: `NotRequired` is not allowed in this context [invalid-annotation] ERROR typeddicts_extra_items.py:128:15-21: Key `name` in TypedDict `MovieEI` may not be deleted [delete-error] -ERROR typeddicts_extra_items.py:129:15-21: TypedDict `MovieEI` does not have key `year` [typed-dict-key-error] ERROR typeddicts_extra_items.py:143:48-52: Unexpected keyword argument `year` in function `unpack_no_extra` [unexpected-keyword] -ERROR typeddicts_extra_items.py:144:45-49: Unexpected keyword argument `year` in function `unpack_extra` [unexpected-keyword] ERROR typeddicts_extra_items.py:174:7-12: Cannot change the non-read-only extra items type of TypedDict `Parent` [bad-typed-dict] ERROR typeddicts_extra_items.py:185:5-9: TypedDict `MovieBase2` with non-read-only `extra_items` cannot be extended with required extra item `year` [typed-dict-key-error] ERROR typeddicts_extra_items.py:188:5-9: `int` is not consistent with `extra_items` type `int | None` of TypedDict `MovieBase2` [typed-dict-key-error] @@ -43,14 +28,6 @@ ERROR typeddicts_extra_items.py:268:14-24: `TypedDict[MovieNotClosed]` is not as ERROR typeddicts_extra_items.py:278:47-51: Unexpected keyword argument `year` in function `NonClosedMovie.__init__` [unexpected-keyword] ERROR typeddicts_extra_items.py:285:52-61: Keyword argument `language` with type `Literal['English']` is not assignable to kwargs type `int` in function `ExtraMovie.__init__` [bad-argument-type] ERROR typeddicts_extra_items.py:293:44-48: Unexpected keyword argument `year` in function `ClosedMovie.__init__` [unexpected-keyword] -ERROR typeddicts_extra_items.py:300:34-44: `TypedDict[MovieExtraStr]` is not assignable to `Mapping[str, str]` [bad-assignment] ERROR typeddicts_extra_items.py:303:34-44: `TypedDict[MovieExtraInt]` is not assignable to `Mapping[str, int]` [bad-assignment] -ERROR typeddicts_extra_items.py:304:44-54: `TypedDict[MovieExtraInt]` is not assignable to `Mapping[str, int | str]` [bad-assignment] -ERROR typeddicts_extra_items.py:326:25-26: `TypedDict[IntDict]` is not assignable to `dict[str, int]` [bad-assignment] -ERROR typeddicts_extra_items.py:330:32-53: `TypedDict[IntDictWithNum]` is not assignable to `dict[str, int]` [bad-assignment] -ERROR typeddicts_extra_items.py:337:1-28: Object of class `IntDictWithNum` has no attribute `clear` [missing-attribute] -ERROR typeddicts_extra_items.py:339:12-62: assert_type(Any, tuple[str, int]) failed [assert-type] -ERROR typeddicts_extra_items.py:339:13-42: Object of class `IntDictWithNum` has no attribute `popitem` [missing-attribute] -ERROR typeddicts_extra_items.py:343:9-35: Cannot delete item in `TypedDict[IntDictWithNum]` [unsupported-operation] ERROR typeddicts_extra_items.py:352:25-52: `dict[str, int]` is not assignable to `TypedDict[IntDict]` [bad-assignment] """ diff --git a/conformance/results/pyrefly/typeddicts_readonly.toml b/conformance/results/pyrefly/typeddicts_readonly.toml index 8b0f34d7a..08517495c 100644 --- a/conformance/results/pyrefly/typeddicts_readonly.toml +++ b/conformance/results/pyrefly/typeddicts_readonly.toml @@ -3,10 +3,10 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR typeddicts_readonly.py:24:1-14: Key `members` in TypedDict `Band` is read-only [read-only] -ERROR typeddicts_readonly.py:36:1-14: Key `members` in TypedDict `Band2` is read-only [read-only] -ERROR typeddicts_readonly.py:50:1-12: Key `title` in TypedDict `Movie1` is read-only [read-only] -ERROR typeddicts_readonly.py:51:1-11: Key `year` in TypedDict `Movie1` is read-only [read-only] -ERROR typeddicts_readonly.py:60:1-12: Key `title` in TypedDict `Movie2` is read-only [read-only] -ERROR typeddicts_readonly.py:61:1-11: Key `year` in TypedDict `Movie2` is read-only [read-only] +ERROR typeddicts_readonly.py:24:4-13: Key `members` in TypedDict `Band` is read-only [read-only] +ERROR typeddicts_readonly.py:36:4-13: Key `members` in TypedDict `Band2` is read-only [read-only] +ERROR typeddicts_readonly.py:50:4-11: Key `title` in TypedDict `Movie1` is read-only [read-only] +ERROR typeddicts_readonly.py:51:4-10: Key `year` in TypedDict `Movie1` is read-only [read-only] +ERROR typeddicts_readonly.py:60:4-11: Key `title` in TypedDict `Movie2` is read-only [read-only] +ERROR typeddicts_readonly.py:61:4-10: Key `year` in TypedDict `Movie2` is read-only [read-only] """ diff --git a/conformance/results/pyrefly/typeddicts_readonly_inheritance.toml b/conformance/results/pyrefly/typeddicts_readonly_inheritance.toml index 1c90b6692..ad8d736e4 100644 --- a/conformance/results/pyrefly/typeddicts_readonly_inheritance.toml +++ b/conformance/results/pyrefly/typeddicts_readonly_inheritance.toml @@ -10,7 +10,7 @@ Line 119: Expected 1 errors Line 132: Expected 1 errors """ output = """ -ERROR typeddicts_readonly_inheritance.py:36:1-11: Key `name` in TypedDict `Album2` is read-only [read-only] +ERROR typeddicts_readonly_inheritance.py:36:4-10: Key `name` in TypedDict `Album2` is read-only [read-only] ERROR typeddicts_readonly_inheritance.py:50:5-8: Class member `RecordShop.alt` overrides parent class `AlbumCollection` in an inconsistent manner [bad-override] ERROR typeddicts_readonly_inheritance.py:65:19-21: Missing required key `name` for TypedDict `RequiredName` [typed-dict-key-error] ERROR typeddicts_readonly_inheritance.py:82:14-15: `Literal[3]` is not assignable to TypedDict key `ident` with type `str` [typed-dict-key-error] diff --git a/conformance/results/pyrefly/typeddicts_readonly_kwargs.toml b/conformance/results/pyrefly/typeddicts_readonly_kwargs.toml index 7d4318302..0be703f17 100644 --- a/conformance/results/pyrefly/typeddicts_readonly_kwargs.toml +++ b/conformance/results/pyrefly/typeddicts_readonly_kwargs.toml @@ -3,5 +3,5 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR typeddicts_readonly_kwargs.py:33:5-19: Key `key1` in TypedDict `ReadOnlyArgs` is read-only [read-only] +ERROR typeddicts_readonly_kwargs.py:33:12-18: Key `key1` in TypedDict `ReadOnlyArgs` is read-only [read-only] """ diff --git a/conformance/results/pyrefly/typeddicts_required.toml b/conformance/results/pyrefly/typeddicts_required.toml index cd9d0280d..8af582147 100644 --- a/conformance/results/pyrefly/typeddicts_required.toml +++ b/conformance/results/pyrefly/typeddicts_required.toml @@ -4,13 +4,13 @@ Does not handle recursive typed dicts in functional syntax """ conformance_automated = "Fail" errors_diff = """ -Line 74: Unexpected errors ["Expected a type form, got instance of `Literal['RecursiveMovie']` [not-a-type]"] +Line 71: Unexpected errors ["Expected a type form, got instance of `Literal['RecursiveMovie']` [not-a-type]"] """ output = """ ERROR typeddicts_required.py:12:5-6: `Required` may only be used for TypedDict members [invalid-annotation] -ERROR typeddicts_required.py:19:8-19: `NotRequired` is only allowed inside a class body [invalid-annotation] -ERROR typeddicts_required.py:19:8-24: `NotRequired` is not allowed in this context [invalid-annotation] -ERROR typeddicts_required.py:62:8-31: Duplicate qualifier `Required` [invalid-annotation] -ERROR typeddicts_required.py:63:8-34: Cannot combine `Required` and `NotRequired` for a TypedDict field [invalid-annotation] -ERROR typeddicts_required.py:74:75-91: Expected a type form, got instance of `Literal['RecursiveMovie']` [not-a-type] +ERROR typeddicts_required.py:16:8-19: `NotRequired` is only allowed inside a class body [invalid-annotation] +ERROR typeddicts_required.py:16:8-24: `NotRequired` is not allowed in this context [invalid-annotation] +ERROR typeddicts_required.py:59:8-31: Duplicate qualifier `Required` [invalid-annotation] +ERROR typeddicts_required.py:60:8-34: Cannot combine `Required` and `NotRequired` for a TypedDict field [invalid-annotation] +ERROR typeddicts_required.py:71:75-91: Expected a type form, got instance of `Literal['RecursiveMovie']` [not-a-type] """ diff --git a/conformance/results/pyrefly/version.toml b/conformance/results/pyrefly/version.toml index 7aed889a8..5542fe39a 100644 --- a/conformance/results/pyrefly/version.toml +++ b/conformance/results/pyrefly/version.toml @@ -1 +1 @@ -version = "pyrefly 0.30.0" +version = "pyrefly 0.36.2" diff --git a/conformance/results/pyright/aliases_newtype.toml b/conformance/results/pyright/aliases_newtype.toml index 00a5767c3..4e70b6d53 100644 --- a/conformance/results/pyright/aliases_newtype.toml +++ b/conformance/results/pyright/aliases_newtype.toml @@ -12,7 +12,7 @@ aliases_newtype.py:23:16 - error: Argument of type "type[UserId]" cannot be assi     "FunctionType" is not assignable to "UnionType"     "FunctionType" is not assignable to "tuple[_ClassInfo, ...]" (reportArgumentType) aliases_newtype.py:23:16 - error: Second argument to "isinstance" must be a class or tuple of classes -  Class created with NewType cannot be used with instance and class checks (reportArgumentType) +  Type created with NewType cannot be used with instance and class checks (reportArgumentType) aliases_newtype.py:26:21 - error: Base class "UserId" is marked final and cannot be subclassed (reportGeneralTypeIssues) aliases_newtype.py:35:1 - error: NewType must be assigned to a variable with the same name (reportGeneralTypeIssues) aliases_newtype.py:41:19 - error: Expected no type arguments for class "GoodNewType1" (reportInvalidTypeArguments) diff --git a/conformance/results/pyright/constructors_call_metaclass.toml b/conformance/results/pyright/constructors_call_metaclass.toml index 0736d700b..96498014e 100644 --- a/conformance/results/pyright/constructors_call_metaclass.toml +++ b/conformance/results/pyright/constructors_call_metaclass.toml @@ -2,7 +2,7 @@ conformant = "Pass" errors_diff = """ """ output = """ -constructors_call_metaclass.py:51:1 - error: Argument missing for parameter "x" (reportCallIssue) -constructors_call_metaclass.py:65:1 - error: Argument missing for parameter "x" (reportCallIssue) +constructors_call_metaclass.py:54:1 - error: Argument missing for parameter "x" (reportCallIssue) +constructors_call_metaclass.py:68:1 - error: Argument missing for parameter "x" (reportCallIssue) """ conformance_automated = "Pass" diff --git a/conformance/results/pyright/dataclasses_match_args.toml b/conformance/results/pyright/dataclasses_match_args.toml index e85cc6da0..570ca46c9 100644 --- a/conformance/results/pyright/dataclasses_match_args.toml +++ b/conformance/results/pyright/dataclasses_match_args.toml @@ -1,10 +1,7 @@ -conformant = "Partial" -notes = """ -Generates __match_args__ when match_args=False. -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 42: Expected 1 errors """ output = """ +dataclasses_match_args.py:42:5 - error: Cannot access attribute "__match_args__" for class "type[DC4]" +  Attribute "__match_args__" is unknown (reportAttributeAccessIssue) """ diff --git a/conformance/results/pyright/enums_members.toml b/conformance/results/pyright/enums_members.toml index 54a2c1b82..d09aadcdd 100644 --- a/conformance/results/pyright/enums_members.toml +++ b/conformance/results/pyright/enums_members.toml @@ -2,14 +2,10 @@ conformant = "Pass" notes = """ Does not support `_ignore_` mechanism (optional). """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 19: Unexpected errors ['enums_members.py:19:11 - error: Argument missing for parameter "species" (reportCallIssue)'] -Line 20: Unexpected errors ['enums_members.py:20:11 - error: Argument missing for parameter "species" (reportCallIssue)'] """ output = """ -enums_members.py:19:11 - error: Argument missing for parameter "species" (reportCallIssue) -enums_members.py:20:11 - error: Argument missing for parameter "species" (reportCallIssue) enums_members.py:50:5 - error: Type annotations are not allowed for enum members (reportGeneralTypeIssues) enums_members.py:82:13 - error: "assert_type" mismatch: expected "Unknown" but received "(x: Unknown) -> str" (reportAssertTypeFailure) enums_members.py:82:37 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) diff --git a/conformance/results/pyright/generics_defaults.toml b/conformance/results/pyright/generics_defaults.toml index 16b3cc3c1..55f1dd651 100644 --- a/conformance/results/pyright/generics_defaults.toml +++ b/conformance/results/pyright/generics_defaults.toml @@ -4,8 +4,8 @@ generics_defaults.py:24:7 - error: "T" cannot appear after "DefaultStrT" in type generics_defaults.py:50:16 - error: Too few type arguments provided for "AllTheDefaults"; expected 2 but received 1 (reportInvalidTypeArguments) generics_defaults.py:107:51 - error: TypeVar default type must be a subtype of the bound type (reportGeneralTypeIssues) generics_defaults.py:114:52 - error: TypeVar default type must be one of the constrained types (reportGeneralTypeIssues) -generics_defaults.py:141:7 - error: TypeVar "T5" has a default value and cannot follow TypeVarTuple "Ts" (reportGeneralTypeIssues) -generics_defaults.py:170:18 - error: Access to generic instance variable through class is ambiguous (reportGeneralTypeIssues) +generics_defaults.py:131:13 - error: "assert_type" mismatch: expected "Any" but received "int" (reportAssertTypeFailure) +generics_defaults.py:142:7 - error: TypeVar "T5" has a default value and cannot follow TypeVarTuple "Ts" (reportGeneralTypeIssues) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/generics_syntax_infer_variance.toml b/conformance/results/pyright/generics_syntax_infer_variance.toml index 05f4c0d51..a871ffee0 100644 --- a/conformance/results/pyright/generics_syntax_infer_variance.toml +++ b/conformance/results/pyright/generics_syntax_infer_variance.toml @@ -6,64 +6,57 @@ generics_syntax_infer_variance.py:29:35 - error: Type "ShouldBeCovariant1[float]   "ShouldBeCovariant1[float]" is not assignable to "ShouldBeCovariant1[int]"     Type parameter "T@ShouldBeCovariant1" is covariant, but "float" is not a subtype of "int"       "float" is not assignable to "int" (reportAssignmentType) -generics_syntax_infer_variance.py:36:37 - error: Cannot instantiate abstract class "ShouldBeCovariant2" -  "Collection.__len__" is not implemented -  "Sequence.__getitem__" is not implemented (reportAbstractUsage) -generics_syntax_infer_variance.py:37:35 - error: Cannot instantiate abstract class "ShouldBeCovariant2" -  "Collection.__len__" is not implemented -  "Sequence.__getitem__" is not implemented (reportAbstractUsage) -generics_syntax_infer_variance.py:37:35 - error: Type "ShouldBeCovariant2[float]" is not assignable to declared type "ShouldBeCovariant2[int]" +generics_syntax_infer_variance.py:47:35 - error: Type "ShouldBeCovariant2[float]" is not assignable to declared type "ShouldBeCovariant2[int]"   "ShouldBeCovariant2[float]" is not assignable to "ShouldBeCovariant2[int]"     Type parameter "T@ShouldBeCovariant2" is covariant, but "float" is not a subtype of "int"       "float" is not assignable to "int" (reportAssignmentType) -generics_syntax_infer_variance.py:46:35 - error: Type "ShouldBeCovariant3[float]" is not assignable to declared type "ShouldBeCovariant3[int]" +generics_syntax_infer_variance.py:56:35 - error: Type "ShouldBeCovariant3[float]" is not assignable to declared type "ShouldBeCovariant3[int]"   "ShouldBeCovariant3[float]" is not assignable to "ShouldBeCovariant3[int]"     Type parameter "T@ShouldBeCovariant3" is covariant, but "float" is not a subtype of "int"       "float" is not assignable to "int" (reportAssignmentType) -generics_syntax_infer_variance.py:75:34 - error: Type "ShouldBeCovariant5[float]" is not assignable to declared type "ShouldBeCovariant5[int]" +generics_syntax_infer_variance.py:85:34 - error: Type "ShouldBeCovariant5[float]" is not assignable to declared type "ShouldBeCovariant5[int]"   "ShouldBeCovariant5[float]" is not assignable to "ShouldBeCovariant5[int]"     Type parameter "T@ShouldBeCovariant5" is covariant, but "float" is not a subtype of "int"       "float" is not assignable to "int" (reportAssignmentType) -generics_syntax_infer_variance.py:86:34 - error: Type "ShouldBeCovariant6[float]" is not assignable to declared type "ShouldBeCovariant6[int]" +generics_syntax_infer_variance.py:96:34 - error: Type "ShouldBeCovariant6[float]" is not assignable to declared type "ShouldBeCovariant6[int]"   "ShouldBeCovariant6[float]" is not assignable to "ShouldBeCovariant6[int]"     Type parameter "T@ShouldBeCovariant6" is covariant, but "float" is not a subtype of "int"       "float" is not assignable to "int" (reportAssignmentType) -generics_syntax_infer_variance.py:102:38 - error: Type "ShouldBeInvariant1[int]" is not assignable to declared type "ShouldBeInvariant1[float]" +generics_syntax_infer_variance.py:112:38 - error: Type "ShouldBeInvariant1[int]" is not assignable to declared type "ShouldBeInvariant1[float]"   "ShouldBeInvariant1[int]" is not assignable to "ShouldBeInvariant1[float]"     Type parameter "T@ShouldBeInvariant1" is invariant, but "int" is not the same as "float" (reportAssignmentType) -generics_syntax_infer_variance.py:103:36 - error: Type "ShouldBeInvariant1[float]" is not assignable to declared type "ShouldBeInvariant1[int]" +generics_syntax_infer_variance.py:113:36 - error: Type "ShouldBeInvariant1[float]" is not assignable to declared type "ShouldBeInvariant1[int]"   "ShouldBeInvariant1[float]" is not assignable to "ShouldBeInvariant1[int]"     Type parameter "T@ShouldBeInvariant1" is invariant, but "float" is not the same as "int" (reportAssignmentType) -generics_syntax_infer_variance.py:117:38 - error: Type "ShouldBeInvariant2[int]" is not assignable to declared type "ShouldBeInvariant2[float]" +generics_syntax_infer_variance.py:127:38 - error: Type "ShouldBeInvariant2[int]" is not assignable to declared type "ShouldBeInvariant2[float]"   "ShouldBeInvariant2[int]" is not assignable to "ShouldBeInvariant2[float]"     Type parameter "T@ShouldBeInvariant2" is invariant, but "int" is not the same as "float" (reportAssignmentType) -generics_syntax_infer_variance.py:118:36 - error: Type "ShouldBeInvariant2[float]" is not assignable to declared type "ShouldBeInvariant2[int]" +generics_syntax_infer_variance.py:128:36 - error: Type "ShouldBeInvariant2[float]" is not assignable to declared type "ShouldBeInvariant2[int]"   "ShouldBeInvariant2[float]" is not assignable to "ShouldBeInvariant2[int]"     Type parameter "T@ShouldBeInvariant2" is invariant, but "float" is not the same as "int" (reportAssignmentType) -generics_syntax_infer_variance.py:125:43 - error: Type "ShouldBeInvariant3[int, str]" is not assignable to declared type "ShouldBeInvariant3[float, str]" +generics_syntax_infer_variance.py:135:43 - error: Type "ShouldBeInvariant3[int, str]" is not assignable to declared type "ShouldBeInvariant3[float, str]"   "ShouldBeInvariant3[int, str]" is not assignable to "ShouldBeInvariant3[float, str]"     Type parameter "K@ShouldBeInvariant3" is invariant, but "int" is not the same as "float" (reportAssignmentType) -generics_syntax_infer_variance.py:126:41 - error: Type "ShouldBeInvariant3[float, str]" is not assignable to declared type "ShouldBeInvariant3[int, str]" +generics_syntax_infer_variance.py:136:41 - error: Type "ShouldBeInvariant3[float, str]" is not assignable to declared type "ShouldBeInvariant3[int, str]"   "ShouldBeInvariant3[float, str]" is not assignable to "ShouldBeInvariant3[int, str]"     Type parameter "K@ShouldBeInvariant3" is invariant, but "float" is not the same as "int" (reportAssignmentType) -generics_syntax_infer_variance.py:127:43 - error: Type "ShouldBeInvariant3[str, int]" is not assignable to declared type "ShouldBeInvariant3[str, float]" +generics_syntax_infer_variance.py:137:43 - error: Type "ShouldBeInvariant3[str, int]" is not assignable to declared type "ShouldBeInvariant3[str, float]"   "ShouldBeInvariant3[str, int]" is not assignable to "ShouldBeInvariant3[str, float]"     Type parameter "V@ShouldBeInvariant3" is invariant, but "int" is not the same as "float" (reportAssignmentType) -generics_syntax_infer_variance.py:128:41 - error: Type "ShouldBeInvariant3[str, float]" is not assignable to declared type "ShouldBeInvariant3[str, int]" +generics_syntax_infer_variance.py:138:41 - error: Type "ShouldBeInvariant3[str, float]" is not assignable to declared type "ShouldBeInvariant3[str, int]"   "ShouldBeInvariant3[str, float]" is not assignable to "ShouldBeInvariant3[str, int]"     Type parameter "V@ShouldBeInvariant3" is invariant, but "float" is not the same as "int" (reportAssignmentType) -generics_syntax_infer_variance.py:136:38 - error: Type "ShouldBeInvariant4[int]" is not assignable to declared type "ShouldBeInvariant4[float]" +generics_syntax_infer_variance.py:146:38 - error: Type "ShouldBeInvariant4[int]" is not assignable to declared type "ShouldBeInvariant4[float]"   "ShouldBeInvariant4[int]" is not assignable to "ShouldBeInvariant4[float]"     Type parameter "T@ShouldBeInvariant4" is invariant, but "int" is not the same as "float" (reportAssignmentType) -generics_syntax_infer_variance.py:144:38 - error: Type "ShouldBeInvariant5[int]" is not assignable to declared type "ShouldBeInvariant5[float]" +generics_syntax_infer_variance.py:154:38 - error: Type "ShouldBeInvariant5[int]" is not assignable to declared type "ShouldBeInvariant5[float]"   "ShouldBeInvariant5[int]" is not assignable to "ShouldBeInvariant5[float]"     Type parameter "T@ShouldBeInvariant5" is invariant, but "int" is not the same as "float" (reportAssignmentType) -generics_syntax_infer_variance.py:155:45 - error: Type "ShouldBeContravariant1[int]" is not assignable to declared type "ShouldBeContravariant1[float]" +generics_syntax_infer_variance.py:165:45 - error: Type "ShouldBeContravariant1[int]" is not assignable to declared type "ShouldBeContravariant1[float]"   "ShouldBeContravariant1[int]" is not assignable to "ShouldBeContravariant1[float]"     Type parameter "T@ShouldBeContravariant1" is contravariant, but "int" is not a supertype of "float"       "float" is not assignable to "int" (reportAssignmentType) """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 36: Unexpected errors ['generics_syntax_infer_variance.py:36:37 - error: Cannot instantiate abstract class "ShouldBeCovariant2"'] """ diff --git a/conformance/results/pyright/protocols_explicit.toml b/conformance/results/pyright/protocols_explicit.toml index cdb926916..aad78c2f3 100644 --- a/conformance/results/pyright/protocols_explicit.toml +++ b/conformance/results/pyright/protocols_explicit.toml @@ -6,16 +6,13 @@ protocols_explicit.py:56:32 - error: Cannot assign to attribute "rgb" for class protocols_explicit.py:60:5 - error: Cannot instantiate abstract class "Point"   "RGB.intensity" is not implemented   "RGB.transparency" is not implemented (reportAbstractUsage) -protocols_explicit.py:85:14 - error: Cannot assign to attribute "cm1" for class "Concrete1*" -  Attribute "cm1" cannot be assigned through a class instance because it is a ClassVar (reportAttributeAccessIssue) -protocols_explicit.py:135:6 - error: Cannot instantiate abstract class "Concrete5" +protocols_explicit.py:89:6 - error: Cannot instantiate abstract class "Concrete1" +  "Proto1.cm1" is not implemented (reportAbstractUsage) +protocols_explicit.py:134:6 - error: Cannot instantiate abstract class "Concrete5"   "Proto5.method1" is not implemented (reportAbstractUsage) -protocols_explicit.py:165:7 - error: Cannot instantiate abstract class "Concrete7A" +protocols_explicit.py:164:7 - error: Cannot instantiate abstract class "Concrete7A"   "Proto7.method1" is not implemented (reportAbstractUsage) """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 90: Expected 1 errors -Line 110: Expected 1 errors -Line 85: Unexpected errors ['protocols_explicit.py:85:14 - error: Cannot assign to attribute "cm1" for class "Concrete1*"'] """ diff --git a/conformance/results/pyright/typeddicts_extra_items.toml b/conformance/results/pyright/typeddicts_extra_items.toml index d54c48d99..0eb4f16ba 100644 --- a/conformance/results/pyright/typeddicts_extra_items.toml +++ b/conformance/results/pyright/typeddicts_extra_items.toml @@ -1,11 +1,5 @@ -conformant = "Partial" -notes = """ -Does not flag illegal use of `closed=False` when inheriting from a non-open TypedDict. -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 67: Expected 1 errors -Line 73: Expected 1 errors """ output = """ typeddicts_extra_items.py:15:45 - error: Type "dict[str, str | int]" is not assignable to declared type "Movie" @@ -15,6 +9,8 @@ typeddicts_extra_items.py:22:55 - error: Type "dict[str, str | int]" is not assi typeddicts_extra_items.py:39:54 - error: Type "dict[str, str | None]" is not assignable to declared type "InheritedMovie"   "None" is not assignable to "int" (reportAssignmentType) typeddicts_extra_items.py:49:35 - error: Expected "closed" parameter to have a value of True or False (reportGeneralTypeIssues) +typeddicts_extra_items.py:67:40 - error: Base class "ClosedBase" is not an open TypedDict; closed=False is not allowed (reportGeneralTypeIssues) +typeddicts_extra_items.py:73:44 - error: Base class "ExtraItemsBase" is not an open TypedDict; closed=False is not allowed (reportGeneralTypeIssues) typeddicts_extra_items.py:91:7 - error: Base class "MovieA" is a TypedDict that limits the type of extra items to type "Never"   Cannot add item "age" (reportIncompatibleVariableOverride) typeddicts_extra_items.py:94:7 - error: Base class "MovieB" is a TypedDict that limits the type of extra items to type "Never" diff --git a/conformance/results/pyright/typeddicts_required.toml b/conformance/results/pyright/typeddicts_required.toml index 9f041f9fc..b612b7c02 100644 --- a/conformance/results/pyright/typeddicts_required.toml +++ b/conformance/results/pyright/typeddicts_required.toml @@ -1,13 +1,10 @@ conformant = "Pass" output = """ typeddicts_required.py:12:8 - error: "Required" is not allowed in this context (reportInvalidTypeForm) -typeddicts_required.py:15:18 - error: Cannot assign to attribute "x" for class "NotTypedDict*" -  "int" is not assignable to "Required" (reportAttributeAccessIssue) -typeddicts_required.py:19:8 - error: "NotRequired" is not allowed in this context (reportInvalidTypeForm) -typeddicts_required.py:62:8 - error: "Required" is not allowed in this context (reportInvalidTypeForm) -typeddicts_required.py:63:8 - error: "Required" is not allowed in this context (reportInvalidTypeForm) +typeddicts_required.py:16:8 - error: "NotRequired" is not allowed in this context (reportInvalidTypeForm) +typeddicts_required.py:59:8 - error: "Required" is not allowed in this context (reportInvalidTypeForm) +typeddicts_required.py:60:8 - error: "Required" is not allowed in this context (reportInvalidTypeForm) """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 15: Unexpected errors ['typeddicts_required.py:15:18 - error: Cannot assign to attribute "x" for class "NotTypedDict*"'] """ diff --git a/conformance/results/pyright/version.toml b/conformance/results/pyright/version.toml index 60d8230bc..739cc3b7f 100644 --- a/conformance/results/pyright/version.toml +++ b/conformance/results/pyright/version.toml @@ -1 +1 @@ -version = "pyright 1.1.404" +version = "pyright 1.1.406" diff --git a/conformance/results/results.html b/conformance/results/results.html index 35401d356..68b02c4ad 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -158,15 +158,15 @@

    Python Type System Conformance Test Results

     
    mypy 1.17.0
    -
    2.7sec
    +
    1.9sec
    pyright 1.1.403
    -
    5.6sec
    +
    1.4sec
    pyre 0.9.25
    -
    3.9sec
    +
    7.4sec
    diff --git a/conformance/tests/enums_behaviors.py b/conformance/tests/enums_behaviors.py index fa3aeec7d..eeb74ddfd 100644 --- a/conformance/tests/enums_behaviors.py +++ b/conformance/tests/enums_behaviors.py @@ -5,7 +5,7 @@ # Specification: https://typing.readthedocs.io/en/latest/spec/enums.html#enum-definition from enum import Enum -from typing import assert_type +from typing import assert_type, Literal # > Enum classes are iterable and indexable, and they can be called with a # > value to look up the enum member with that value. Type checkers should @@ -23,8 +23,13 @@ class Color(Enum): # > constructor. Instead, the call performs a value-based lookup of an # > enum member. -assert_type(Color["RED"], Color) # 'Literal[Color.RED]' is also acceptable -assert_type(Color(3), Color) # 'Literal[Color.BLUE]' is also acceptable +# 'Literal[Color.RED]' and 'Color' are both acceptable +assert_type(Color["RED"], Color) # E[red] +assert_type(Color["RED"], Literal[Color.RED]) # E[red] + +# 'Literal[Color.BLUE]' and 'Color' are both acceptable +assert_type(Color(3), Color) # E[blue] +assert_type(Color(3), Literal[Color.BLUE]) # E[blue] # > An Enum class with one or more defined members cannot be subclassed. diff --git a/conformance/tests/qualifiers_final_decorator.py b/conformance/tests/qualifiers_final_decorator.py index 3523ae531..5f131f462 100644 --- a/conformance/tests/qualifiers_final_decorator.py +++ b/conformance/tests/qualifiers_final_decorator.py @@ -65,7 +65,7 @@ def method3() -> None: # E[method3] pass @overload # E[method4] - def method4(self, x: int) -> int: + def method4(self, x: int) -> int: # E[method4] ... @overload @@ -78,7 +78,7 @@ def method4(self, x: int | str) -> int | str: # E[method4] class Derived3(Base3): @overload # E[Derived3] - def method(self, x: int) -> int: + def method(self, x: int) -> int: # E[Derived3] ... @overload # E[Derived3-2] @@ -92,7 +92,7 @@ def method(self, x: int | str) -> int | str: # E[Derived3] class Derived4(Base4): @overload # E[Derived4] - def method(self, x: int) -> int: + def method(self, x: int) -> int: # E[Derived4] ... @overload From c141cdfb9d7085c1aafa76726c8ce08362837e8b Mon Sep 17 00:00:00 2001 From: Rebecca Chen Date: Fri, 1 Aug 2025 18:16:25 -0700 Subject: [PATCH 119/308] Small improvements to the conformance tests (#2061) --- .../results/mypy/aliases_recursive.toml | 2 +- .../results/mypy/annotations_generators.toml | 2 - .../mypy/dataclasses_transform_func.toml | 16 ++--- conformance/results/mypy/version.toml | 4 +- .../pyre/dataclasses_transform_func.toml | 60 +++++++++---------- conformance/results/pyre/version.toml | 2 +- .../pyright/dataclasses_transform_func.toml | 12 ++-- conformance/results/pyright/version.toml | 2 +- conformance/results/results.html | 8 +-- conformance/tests/annotations_generators.py | 4 +- conformance/tests/classes_override.py | 2 +- .../tests/dataclasses_transform_func.py | 1 - 12 files changed, 56 insertions(+), 59 deletions(-) diff --git a/conformance/results/mypy/aliases_recursive.toml b/conformance/results/mypy/aliases_recursive.toml index 5272c3212..01af644dc 100644 --- a/conformance/results/mypy/aliases_recursive.toml +++ b/conformance/results/mypy/aliases_recursive.toml @@ -6,7 +6,7 @@ aliases_recursive.py:38: error: Incompatible types in assignment (expression has aliases_recursive.py:39: error: Name "t6" already defined on line 38 [no-redef] aliases_recursive.py:50: error: Dict entry 0 has incompatible type "str": "list[int]"; expected "str": "str | int | Mapping[str, RecursiveMapping]" [dict-item] aliases_recursive.py:51: error: Dict entry 2 has incompatible type "str": "list[int]"; expected "str": "str | int | Mapping[str, RecursiveMapping]" [dict-item] -aliases_recursive.py:52: error: Dict entry 2 has incompatible type "str": "dict[str, str | int | list[int]]"; expected "str": "str | int | Mapping[str, RecursiveMapping]" [dict-item] +aliases_recursive.py:52: error: Dict entry 2 has incompatible type "str": "list[int]"; expected "str": "str | int | Mapping[str, RecursiveMapping]" [dict-item] aliases_recursive.py:63: error: List item 0 has incompatible type "float"; expected "GenericTypeAlias1[str] | str" [list-item] aliases_recursive.py:69: error: List item 0 has incompatible type "float"; expected "GenericTypeAlias2[str, int] | str | int" [list-item] aliases_recursive.py:72: error: Invalid recursive alias: a union item of itself [misc] diff --git a/conformance/results/mypy/annotations_generators.toml b/conformance/results/mypy/annotations_generators.toml index 475411412..e14ede973 100644 --- a/conformance/results/mypy/annotations_generators.toml +++ b/conformance/results/mypy/annotations_generators.toml @@ -16,7 +16,5 @@ annotations_generators.py:119: error: Incompatible types in "yield from" (actual """ conformance_automated = "Fail" errors_diff = """ -Line 87: Expected 1 errors -Line 92: Expected 1 errors Line 135: Expected 1 errors """ diff --git a/conformance/results/mypy/dataclasses_transform_func.toml b/conformance/results/mypy/dataclasses_transform_func.toml index 02d2cdf85..5861a2808 100644 --- a/conformance/results/mypy/dataclasses_transform_func.toml +++ b/conformance/results/mypy/dataclasses_transform_func.toml @@ -4,15 +4,15 @@ Does not handle `kw_only=False` override when `kw_only_default=True`. Does not report error when `order=False` and comparison operators are used. """ output = """ -dataclasses_transform_func.py:53: error: Too many positional arguments for "Customer1" [misc] -dataclasses_transform_func.py:57: error: Incompatible types in assignment (expression has type "int", variable has type "str") [assignment] -dataclasses_transform_func.py:65: error: Unexpected keyword argument "salary" for "Customer1" [call-arg] -dataclasses_transform_func.py:71: error: Too many positional arguments for "Customer2" [misc] -dataclasses_transform_func.py:90: error: Non-frozen dataclass cannot inherit from a frozen dataclass [misc] -dataclasses_transform_func.py:97: error: Property "id" defined in "Customer3" is read-only [misc] +dataclasses_transform_func.py:52: error: Too many positional arguments for "Customer1" [misc] +dataclasses_transform_func.py:56: error: Incompatible types in assignment (expression has type "int", variable has type "str") [assignment] +dataclasses_transform_func.py:64: error: Unexpected keyword argument "salary" for "Customer1" [call-arg] +dataclasses_transform_func.py:70: error: Too many positional arguments for "Customer2" [misc] +dataclasses_transform_func.py:89: error: Non-frozen dataclass cannot inherit from a frozen dataclass [misc] +dataclasses_transform_func.py:96: error: Property "id" defined in "Customer3" is read-only [misc] """ conformance_automated = "Fail" errors_diff = """ -Line 61: Expected 1 errors -Line 53: Unexpected errors ['dataclasses_transform_func.py:53: error: Too many positional arguments for "Customer1" [misc]'] +Line 60: Expected 1 errors +Line 52: Unexpected errors ['dataclasses_transform_func.py:52: error: Too many positional arguments for "Customer1" [misc]'] """ diff --git a/conformance/results/mypy/version.toml b/conformance/results/mypy/version.toml index 3c192fd9a..55be4d997 100644 --- a/conformance/results/mypy/version.toml +++ b/conformance/results/mypy/version.toml @@ -1,2 +1,2 @@ -version = "mypy 1.17.0" -test_duration = 1.9 +version = "mypy 1.17.1" +test_duration = 2.8 diff --git a/conformance/results/pyre/dataclasses_transform_func.toml b/conformance/results/pyre/dataclasses_transform_func.toml index 1cefede1c..0d764047b 100644 --- a/conformance/results/pyre/dataclasses_transform_func.toml +++ b/conformance/results/pyre/dataclasses_transform_func.toml @@ -5,37 +5,37 @@ Does not detect non-frozen class inheriting from frozen class. Emits "attribute not initialized" error for dataclass field. """ output = """ -dataclasses_transform_func.py:25:5 Invalid type variable [34]: The type variable `Variable[T]` isn't present in the function's parameters. -dataclasses_transform_func.py:29:0 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s). -dataclasses_transform_func.py:35:4 Uninitialized attribute [13]: Attribute `id` is declared in class `Customer1` to have type `int` but is never initialized. -dataclasses_transform_func.py:36:4 Uninitialized attribute [13]: Attribute `name` is declared in class `Customer1` to have type `str` but is never initialized. -dataclasses_transform_func.py:41:4 Uninitialized attribute [13]: Attribute `id` is declared in class `Customer2` to have type `int` but is never initialized. -dataclasses_transform_func.py:42:4 Uninitialized attribute [13]: Attribute `name` is declared in class `Customer2` to have type `str` but is never initialized. -dataclasses_transform_func.py:47:4 Uninitialized attribute [13]: Attribute `salary` is declared in class `Customer2Subclass` to have type `float` but is never initialized. -dataclasses_transform_func.py:50:7 Unexpected keyword [28]: Unexpected keyword argument `id` to call `object.__init__`. -dataclasses_transform_func.py:53:7 Too many arguments [19]: Call `object.__init__` expects 0 positional arguments, 2 were provided. -dataclasses_transform_func.py:57:0 Incompatible attribute type [8]: Attribute `name` declared in class `Customer1` has type `str` but is used as type `int`. -dataclasses_transform_func.py:61:5 Unsupported operand [58]: `<` is not supported for operand types `Customer1` and `Customer1`. -dataclasses_transform_func.py:65:7 Unexpected keyword [28]: Unexpected keyword argument `id` to call `object.__init__`. -dataclasses_transform_func.py:67:7 Unexpected keyword [28]: Unexpected keyword argument `id` to call `object.__init__`. -dataclasses_transform_func.py:71:7 Too many arguments [19]: Call `object.__init__` expects 0 positional arguments, 2 were provided. -dataclasses_transform_func.py:73:5 Unsupported operand [58]: `<` is not supported for operand types `Customer2` and `Customer2`. -dataclasses_transform_func.py:91:4 Uninitialized attribute [13]: Attribute `age` is declared in class `Customer3Subclass` to have type `int` but is never initialized. -dataclasses_transform_func.py:97:0 Invalid assignment [41]: Cannot reassign final attribute `c3_1.id`. +dataclasses_transform_func.py:19:0 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s). +dataclasses_transform_func.py:24:5 Invalid type variable [34]: The type variable `Variable[T]` isn't present in the function's parameters. +dataclasses_transform_func.py:34:4 Uninitialized attribute [13]: Attribute `id` is declared in class `Customer1` to have type `int` but is never initialized. +dataclasses_transform_func.py:35:4 Uninitialized attribute [13]: Attribute `name` is declared in class `Customer1` to have type `str` but is never initialized. +dataclasses_transform_func.py:40:4 Uninitialized attribute [13]: Attribute `id` is declared in class `Customer2` to have type `int` but is never initialized. +dataclasses_transform_func.py:41:4 Uninitialized attribute [13]: Attribute `name` is declared in class `Customer2` to have type `str` but is never initialized. +dataclasses_transform_func.py:46:4 Uninitialized attribute [13]: Attribute `salary` is declared in class `Customer2Subclass` to have type `float` but is never initialized. +dataclasses_transform_func.py:49:7 Unexpected keyword [28]: Unexpected keyword argument `id` to call `object.__init__`. +dataclasses_transform_func.py:52:7 Too many arguments [19]: Call `object.__init__` expects 0 positional arguments, 2 were provided. +dataclasses_transform_func.py:56:0 Incompatible attribute type [8]: Attribute `name` declared in class `Customer1` has type `str` but is used as type `int`. +dataclasses_transform_func.py:60:5 Unsupported operand [58]: `<` is not supported for operand types `Customer1` and `Customer1`. +dataclasses_transform_func.py:64:7 Unexpected keyword [28]: Unexpected keyword argument `id` to call `object.__init__`. +dataclasses_transform_func.py:66:7 Unexpected keyword [28]: Unexpected keyword argument `id` to call `object.__init__`. +dataclasses_transform_func.py:70:7 Too many arguments [19]: Call `object.__init__` expects 0 positional arguments, 2 were provided. +dataclasses_transform_func.py:72:5 Unsupported operand [58]: `<` is not supported for operand types `Customer2` and `Customer2`. +dataclasses_transform_func.py:90:4 Uninitialized attribute [13]: Attribute `age` is declared in class `Customer3Subclass` to have type `int` but is never initialized. +dataclasses_transform_func.py:96:0 Invalid assignment [41]: Cannot reassign final attribute `c3_1.id`. """ conformance_automated = "Fail" errors_diff = """ -Lines 89, 90: Expected error (tag 'Customer3Subclass') -Line 25: Unexpected errors ["dataclasses_transform_func.py:25:5 Invalid type variable [34]: The type variable `Variable[T]` isn't present in the function's parameters."] -Line 29: Unexpected errors ['dataclasses_transform_func.py:29:0 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).'] -Line 35: Unexpected errors ['dataclasses_transform_func.py:35:4 Uninitialized attribute [13]: Attribute `id` is declared in class `Customer1` to have type `int` but is never initialized.'] -Line 36: Unexpected errors ['dataclasses_transform_func.py:36:4 Uninitialized attribute [13]: Attribute `name` is declared in class `Customer1` to have type `str` but is never initialized.'] -Line 41: Unexpected errors ['dataclasses_transform_func.py:41:4 Uninitialized attribute [13]: Attribute `id` is declared in class `Customer2` to have type `int` but is never initialized.'] -Line 42: Unexpected errors ['dataclasses_transform_func.py:42:4 Uninitialized attribute [13]: Attribute `name` is declared in class `Customer2` to have type `str` but is never initialized.'] -Line 47: Unexpected errors ['dataclasses_transform_func.py:47:4 Uninitialized attribute [13]: Attribute `salary` is declared in class `Customer2Subclass` to have type `float` but is never initialized.'] -Line 50: Unexpected errors ['dataclasses_transform_func.py:50:7 Unexpected keyword [28]: Unexpected keyword argument `id` to call `object.__init__`.'] -Line 53: Unexpected errors ['dataclasses_transform_func.py:53:7 Too many arguments [19]: Call `object.__init__` expects 0 positional arguments, 2 were provided.'] -Line 67: Unexpected errors ['dataclasses_transform_func.py:67:7 Unexpected keyword [28]: Unexpected keyword argument `id` to call `object.__init__`.'] -Line 73: Unexpected errors ['dataclasses_transform_func.py:73:5 Unsupported operand [58]: `<` is not supported for operand types `Customer2` and `Customer2`.'] -Line 91: Unexpected errors ['dataclasses_transform_func.py:91:4 Uninitialized attribute [13]: Attribute `age` is declared in class `Customer3Subclass` to have type `int` but is never initialized.'] +Lines 88, 89: Expected error (tag 'Customer3Subclass') +Line 19: Unexpected errors ['dataclasses_transform_func.py:19:0 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).'] +Line 24: Unexpected errors ["dataclasses_transform_func.py:24:5 Invalid type variable [34]: The type variable `Variable[T]` isn't present in the function's parameters."] +Line 34: Unexpected errors ['dataclasses_transform_func.py:34:4 Uninitialized attribute [13]: Attribute `id` is declared in class `Customer1` to have type `int` but is never initialized.'] +Line 35: Unexpected errors ['dataclasses_transform_func.py:35:4 Uninitialized attribute [13]: Attribute `name` is declared in class `Customer1` to have type `str` but is never initialized.'] +Line 40: Unexpected errors ['dataclasses_transform_func.py:40:4 Uninitialized attribute [13]: Attribute `id` is declared in class `Customer2` to have type `int` but is never initialized.'] +Line 41: Unexpected errors ['dataclasses_transform_func.py:41:4 Uninitialized attribute [13]: Attribute `name` is declared in class `Customer2` to have type `str` but is never initialized.'] +Line 46: Unexpected errors ['dataclasses_transform_func.py:46:4 Uninitialized attribute [13]: Attribute `salary` is declared in class `Customer2Subclass` to have type `float` but is never initialized.'] +Line 49: Unexpected errors ['dataclasses_transform_func.py:49:7 Unexpected keyword [28]: Unexpected keyword argument `id` to call `object.__init__`.'] +Line 52: Unexpected errors ['dataclasses_transform_func.py:52:7 Too many arguments [19]: Call `object.__init__` expects 0 positional arguments, 2 were provided.'] +Line 66: Unexpected errors ['dataclasses_transform_func.py:66:7 Unexpected keyword [28]: Unexpected keyword argument `id` to call `object.__init__`.'] +Line 72: Unexpected errors ['dataclasses_transform_func.py:72:5 Unsupported operand [58]: `<` is not supported for operand types `Customer2` and `Customer2`.'] +Line 90: Unexpected errors ['dataclasses_transform_func.py:90:4 Uninitialized attribute [13]: Attribute `age` is declared in class `Customer3Subclass` to have type `int` but is never initialized.'] """ diff --git a/conformance/results/pyre/version.toml b/conformance/results/pyre/version.toml index de515ba2e..bdbaef2d2 100644 --- a/conformance/results/pyre/version.toml +++ b/conformance/results/pyre/version.toml @@ -1,2 +1,2 @@ version = "pyre 0.9.25" -test_duration = 7.4 +test_duration = 5.4 diff --git a/conformance/results/pyright/dataclasses_transform_func.toml b/conformance/results/pyright/dataclasses_transform_func.toml index 164f93379..86e12bfcf 100644 --- a/conformance/results/pyright/dataclasses_transform_func.toml +++ b/conformance/results/pyright/dataclasses_transform_func.toml @@ -1,12 +1,12 @@ conformant = "Pass" output = """ -dataclasses_transform_func.py:57:13 - error: Cannot assign to attribute "name" for class "Customer1" +dataclasses_transform_func.py:56:13 - error: Cannot assign to attribute "name" for class "Customer1"   "Literal[3]" is not assignable to "str" (reportAttributeAccessIssue) -dataclasses_transform_func.py:61:6 - error: Operator "<" not supported for types "Customer1" and "Customer1" (reportOperatorIssue) -dataclasses_transform_func.py:65:36 - error: No parameter named "salary" (reportCallIssue) -dataclasses_transform_func.py:71:18 - error: Expected 0 positional arguments (reportCallIssue) -dataclasses_transform_func.py:89:1 - error: A non-frozen class cannot inherit from a class that is frozen (reportGeneralTypeIssues) -dataclasses_transform_func.py:97:6 - error: Cannot assign to attribute "id" for class "Customer3" +dataclasses_transform_func.py:60:6 - error: Operator "<" not supported for types "Customer1" and "Customer1" (reportOperatorIssue) +dataclasses_transform_func.py:64:36 - error: No parameter named "salary" (reportCallIssue) +dataclasses_transform_func.py:70:18 - error: Expected 0 positional arguments (reportCallIssue) +dataclasses_transform_func.py:88:1 - error: A non-frozen class cannot inherit from a class that is frozen (reportGeneralTypeIssues) +dataclasses_transform_func.py:96:6 - error: Cannot assign to attribute "id" for class "Customer3"   Attribute "id" is read-only (reportAttributeAccessIssue) """ conformance_automated = "Pass" diff --git a/conformance/results/pyright/version.toml b/conformance/results/pyright/version.toml index 79f18fab5..1199839e0 100644 --- a/conformance/results/pyright/version.toml +++ b/conformance/results/pyright/version.toml @@ -1,2 +1,2 @@ version = "pyright 1.1.403" -test_duration = 1.4 +test_duration = 4.3 diff --git a/conformance/results/results.html b/conformance/results/results.html index aab60e772..265f795cb 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -158,14 +158,14 @@

    Python Type System Conformance Test Results

    -") summary_html.append("") @@ -90,6 +94,12 @@ def generate_summary_html(root_dir: Path) -> str: raw_notes = results.get("notes", "").strip() conformance = results.get("conformant", "Unknown") + if conformance == "Unknown": + # Try to look up the automated test results and use + # that if the test passes + automated = results.get("conformance_automated") + if automated == "Pass": + conformance = "Pass" notes = "".join( [f"

    {note}

    " for note in raw_notes.split("\n")] ) diff --git a/conformance/src/type_checker.py b/conformance/src/type_checker.py index 48c869c4f..3f02c9ee2 100644 --- a/conformance/src/type_checker.py +++ b/conformance/src/type_checker.py @@ -273,9 +273,73 @@ def parse_errors(self, output: Sequence[str]) -> dict[int, list[str]]: line_to_errors.setdefault(int(lineno), []).append(line) return line_to_errors +class ZubanLSTypeChecker(MypyTypeChecker): + @property + def name(self) -> str: + return "zuban" + + def install(self) -> bool: + try: + # Uninstall any existing version if present. + run( + [sys.executable, "-m", "pip", "uninstall", "zuban", "-y"], + check=True, + ) + + # Install the latest version. + run( + [sys.executable, "-m", "pip", "install", "zuban"], + check=True, + ) + return True + except CalledProcessError: + print("Unable to install zuban") + return False + + def get_version(self) -> str: + proc = run(["zmypy", "--version"], stdout=PIPE, text=True) + return proc.stdout.strip().replace("zmypy", "zuban") + + def run_tests(self, test_files: Sequence[str]) -> dict[str, str]: + command = [ + "zmypy", + ".", + "--disable-error-code", + "empty-body", + "--enable-error-code", + "deprecated", + "--no-warn-unreachable", + "--no-mypy-compatible", + ] + proc = run(command, stdout=PIPE, text=True, encoding="utf-8") + lines = proc.stdout.split("\n") + + # Add results to a dictionary keyed by the file name. + results_dict: dict[str, str] = {} + for line in lines: + file_name = line.split(":")[0].strip() + results_dict[file_name] = results_dict.get(file_name, "") + line + "\n" + + return results_dict + + def parse_errors(self, output: Sequence[str]) -> dict[int, list[str]]: + # narrowing_typeguard.py:102: error: TypeGuard functions must have a positional argument [valid-type] + line_to_errors: dict[int, list[str]] = {} + for line in output: + if line.count(":") < 3: + continue + _, lineno, kind, _ = line.split(":", maxsplit=3) + kind = kind.strip() + if kind != "error": + continue + line_to_errors.setdefault(int(lineno), []).append(line) + return line_to_errors + + TYPE_CHECKERS: Sequence[TypeChecker] = ( MypyTypeChecker(), PyrightTypeChecker(), *([] if os.name == "nt" else [PyreTypeChecker()]), + ZubanLSTypeChecker(), ) diff --git a/conformance/tests/classes_classvar.py b/conformance/tests/classes_classvar.py index 2f6ed04fb..3f94fe5a6 100644 --- a/conformance/tests/classes_classvar.py +++ b/conformance/tests/classes_classvar.py @@ -63,7 +63,7 @@ class ClassA(Generic[T, P]): good4: ClassVar = 3.1 # > If the `ClassVar` qualifier is used without any assigned value, the type # > should be inferred as `Any`: - good5: ClassVar #E? Type checkers may error on uninitialized ClassVar + good5: ClassVar # E?: Type checkers may error on uninitialized ClassVar good6: Annotated[ClassVar[list[int]], ""] = [] def method1(self, a: ClassVar[int]): # E: ClassVar not allowed here diff --git a/conformance/tests/overloads_definitions.py b/conformance/tests/overloads_definitions.py index a1bcd030b..8870cd3e6 100644 --- a/conformance/tests/overloads_definitions.py +++ b/conformance/tests/overloads_definitions.py @@ -119,7 +119,7 @@ def final_method(self, x: int | str) -> int | str: ... # The @final decorator should not be on one of the overloads: @overload # E[invalid_final] @final should be on implementation only - @final + @final # E[invalid_final] def invalid_final(self, x: int) -> int: # E[invalid_final] ... diff --git a/conformance/tests/overloads_definitions_stub.pyi b/conformance/tests/overloads_definitions_stub.pyi index a399ec553..b9bd7eb61 100644 --- a/conformance/tests/overloads_definitions_stub.pyi +++ b/conformance/tests/overloads_definitions_stub.pyi @@ -69,7 +69,7 @@ class Base: def invalid_final(self, x: int) -> int: # E[invalid_final] ... @overload # E[invalid_final] - @final + @final # E[invalid_final] def invalid_final(self, x: str) -> str: # E[invalid_final] ... @overload @@ -82,7 +82,7 @@ class Base: def invalid_final_2(self, x: int) -> int: # E[invalid_final_2] ... @overload # E[invalid_final_2] - @final + @final # E[invalid_final_2] def invalid_final_2(self, x: str) -> str: ... # E[invalid_final_2] # These methods are just here for the @override test below. We use an @@ -143,7 +143,7 @@ class Child(Base): # E[override-final] @overload # E[override_impl]: @override should appear only on first overload def to_override(self, x: int) -> int: ... @overload - @override + @override # E[override_impl]: @override should appear only on first overload def to_override( # E[override_impl]: @override should appear only on first overload self, x: str ) -> str: # E[override_impl]: @override should appear only on first overload diff --git a/conformance/tests/qualifiers_annotated.py b/conformance/tests/qualifiers_annotated.py index adc4f78db..ebbab4ad2 100644 --- a/conformance/tests/qualifiers_annotated.py +++ b/conformance/tests/qualifiers_annotated.py @@ -115,7 +115,4 @@ class ClassC(TypedDict): TA1: TypeAlias = Annotated[int | str, ""] TA2 = Annotated[Literal[1, 2], ""] - -T = TypeVar("T") - TA3 = Annotated[T, ""] diff --git a/conformance/tests/typeddicts_alt_syntax.py b/conformance/tests/typeddicts_alt_syntax.py index a08b10555..93d1b4334 100644 --- a/conformance/tests/typeddicts_alt_syntax.py +++ b/conformance/tests/typeddicts_alt_syntax.py @@ -42,4 +42,4 @@ movie2: Movie2 movie2 = {"name": "Blade Runner", "year": 1982} # E?: May generate errors if keyword-argument syntax is unsupported -movie2 = {"name": "Blade Runner", "year": ""} # E: Incorrect type for year +movie2 = {"name": "Blade Runner", "year": ""} # E?: Incorrect type for year From d945fea12116c2a84bc56173cc1b8d5f418d3e68 Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Sat, 16 Aug 2025 18:38:27 +0200 Subject: [PATCH 123/308] Add a tutorial for using external libraries (#2046) --- docs/guides/writing_stubs.rst | 3 +- docs/index.rst | 11 +++++++ docs/tutorials/external_libraries.rst | 42 +++++++++++++++++++++++++++ docs/tutorials/index.rst | 15 ++++++++++ 4 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 docs/tutorials/external_libraries.rst create mode 100644 docs/tutorials/index.rst diff --git a/docs/guides/writing_stubs.rst b/docs/guides/writing_stubs.rst index 0cbf6a7c2..23966933a 100644 --- a/docs/guides/writing_stubs.rst +++ b/docs/guides/writing_stubs.rst @@ -5,7 +5,8 @@ Writing and Maintaining Stub Files ********************************** Stub files are a means of providing type information for Python modules. -For a full reference, refer to :ref:`stub-files`. +For a quick introduction, see :ref:`external_libraries`. For a full reference, +refer to :ref:`distributing-type`. Maintaining stubs can be a little cumbersome because they are separated from the implementation. This page lists some tools that make writing and maintaining diff --git a/docs/index.rst b/docs/index.rst index 7bd07ba3a..7f59e7b60 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -2,6 +2,17 @@ Static Typing with Python ************************* +Tutorials +========= + +.. + Keep in sync with tutorials/index.rst. + +.. toctree:: + :maxdepth: 1 + + tutorials/external_libraries + Guides ====== diff --git a/docs/tutorials/external_libraries.rst b/docs/tutorials/external_libraries.rst new file mode 100644 index 000000000..66a1d5452 --- /dev/null +++ b/docs/tutorials/external_libraries.rst @@ -0,0 +1,42 @@ +.. _external_libraries: + +************************ +Using External Libraries +************************ + +.. seealso:: + If you are looking for information on how to write type hints for + external libraries, see the :ref:`writing_stubs` guide. + +Many external libraries -- whether installed from the +`Python Package Index `_ (PyPI) or from other sources -- +provide their own type hints. This is indicated by the presence of a +``py.typed`` file in the library's root directory. If you install such a +library, you can use it with any type checker without any additional +configuration. + +Type hints can either be included in the library's source code the same way +as in your own code, or they can be provided in separate so-called +*stub files*. Stub files are named ``.pyi`` and contain only type +hints, without any implementation. + +For libraries that don't include their own type hints, a separate +*stub package* may provide them. These stub packages are often written by the +library authors themselves, by the contributors to the +`typeshed `_ project, or by third-party +contributors. These packages are usually named ``types-`` +or ``-stubs``. These packages can be installed from PyPI as usual, and +they will be automatically discovered by type checkers:: + + pip install requests types-requests + +.. warning:: + + The usual security considerations apply when installing third-party + packages. Only install packages from sources you trust. Stub packages + have the same security implications as any other package. + +.. + TODO: Once development dependencies are supported by pyproject.toml, + and described in https://packaging.python.org/en/latest/guides/writing-pyproject-toml/ + we should recommend installing type stubs as a development dependency. diff --git a/docs/tutorials/index.rst b/docs/tutorials/index.rst new file mode 100644 index 000000000..f84673dad --- /dev/null +++ b/docs/tutorials/index.rst @@ -0,0 +1,15 @@ +:orphan: + +********************* +Type System Tutorials +********************* + +.. + Keep in sync with docs/index.rst. + + +.. toctree:: + :maxdepth: 2 + :caption: Contents: + + external_libraries From d2f9b087da989626b8d06107aedbeb8baaf94533 Mon Sep 17 00:00:00 2001 From: Rebecca Chen Date: Sat, 16 Aug 2025 09:41:30 -0700 Subject: [PATCH 124/308] Add conformance tests for the 'match_args' parameter to dataclass. (#2056) The spec lists 'match_args' as a dataclass parameter that static type checkers must honor, so it would be good to have tests for it. --- .../results/mypy/dataclasses_match_args.toml | 7 +++ conformance/results/mypy/version.toml | 2 +- .../results/pyre/dataclasses_match_args.toml | 12 +++++ conformance/results/pyre/version.toml | 2 +- .../pyright/dataclasses_match_args.toml | 10 ++++ conformance/results/pyright/version.toml | 2 +- conformance/results/results.html | 14 ++++-- .../results/zuban/dataclasses_match_args.toml | 7 +++ conformance/results/zuban/version.toml | 2 +- conformance/tests/dataclasses_match_args.py | 49 +++++++++++++++++++ 10 files changed, 99 insertions(+), 8 deletions(-) create mode 100644 conformance/results/mypy/dataclasses_match_args.toml create mode 100644 conformance/results/pyre/dataclasses_match_args.toml create mode 100644 conformance/results/pyright/dataclasses_match_args.toml create mode 100644 conformance/results/zuban/dataclasses_match_args.toml create mode 100644 conformance/tests/dataclasses_match_args.py diff --git a/conformance/results/mypy/dataclasses_match_args.toml b/conformance/results/mypy/dataclasses_match_args.toml new file mode 100644 index 000000000..1309854f5 --- /dev/null +++ b/conformance/results/mypy/dataclasses_match_args.toml @@ -0,0 +1,7 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +dataclasses_match_args.py:42: error: "type[DC4]" has no attribute "__match_args__" [attr-defined] +""" diff --git a/conformance/results/mypy/version.toml b/conformance/results/mypy/version.toml index 731bf6fb8..867a79fe2 100644 --- a/conformance/results/mypy/version.toml +++ b/conformance/results/mypy/version.toml @@ -1,2 +1,2 @@ version = "mypy 1.17.1" -test_duration = 2.96 +test_duration = 2.04 diff --git a/conformance/results/pyre/dataclasses_match_args.toml b/conformance/results/pyre/dataclasses_match_args.toml new file mode 100644 index 000000000..d7bd79617 --- /dev/null +++ b/conformance/results/pyre/dataclasses_match_args.toml @@ -0,0 +1,12 @@ +conformant = "Partial" +notes = """ +Adds kw-only fields to __match_args__. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 18: Unexpected errors ["dataclasses_match_args.py:18:0 Assert type [70]: Expected `Tuple[typing_extensions.Literal['x']]` but got `Tuple[typing_extensions.Literal['x'], typing_extensions.Literal['*'], typing_extensions.Literal['y']]`."] +""" +output = """ +dataclasses_match_args.py:18:0 Assert type [70]: Expected `Tuple[typing_extensions.Literal['x']]` but got `Tuple[typing_extensions.Literal['x'], typing_extensions.Literal['*'], typing_extensions.Literal['y']]`. +dataclasses_match_args.py:42:0 Undefined attribute [16]: `DC4` has no attribute `__match_args__`. +""" diff --git a/conformance/results/pyre/version.toml b/conformance/results/pyre/version.toml index 95cf3faa9..9c24e3412 100644 --- a/conformance/results/pyre/version.toml +++ b/conformance/results/pyre/version.toml @@ -1,2 +1,2 @@ version = "pyre 0.9.25" -test_duration = 5.93 +test_duration = 10.27 diff --git a/conformance/results/pyright/dataclasses_match_args.toml b/conformance/results/pyright/dataclasses_match_args.toml new file mode 100644 index 000000000..e85cc6da0 --- /dev/null +++ b/conformance/results/pyright/dataclasses_match_args.toml @@ -0,0 +1,10 @@ +conformant = "Partial" +notes = """ +Generates __match_args__ when match_args=False. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 42: Expected 1 errors +""" +output = """ +""" diff --git a/conformance/results/pyright/version.toml b/conformance/results/pyright/version.toml index 2944d808b..7e373c1a8 100644 --- a/conformance/results/pyright/version.toml +++ b/conformance/results/pyright/version.toml @@ -1,2 +1,2 @@ version = "pyright 1.1.403" -test_duration = 3.15 +test_duration = 1.83 diff --git a/conformance/results/results.html b/conformance/results/results.html index 6203268b8..cce50c1e0 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -159,16 +159,16 @@

    Python Type System Conformance Test Results

     
    mypy 1.17.0
    -
    1.9sec
    +
    mypy 1.17.1
    +
    2.8sec
    pyright 1.1.403
    -
    1.4sec
    +
    4.3sec
    pyre 0.9.25
    -
    7.4sec
    +
    5.4sec
    diff --git a/conformance/tests/annotations_generators.py b/conformance/tests/annotations_generators.py index 2def79eaa..2ad75808d 100644 --- a/conformance/tests/annotations_generators.py +++ b/conformance/tests/annotations_generators.py @@ -84,12 +84,12 @@ def generator7() -> Iterator[dict[str, int]]: def generator8() -> int: # E: incompatible return type - yield None # E + yield None # E? return 0 async def generator9() -> int: # E: incompatible return type - yield None # E + yield None # E? class IntIterator(Protocol): diff --git a/conformance/tests/classes_override.py b/conformance/tests/classes_override.py index 2f3147d2c..831e37d05 100644 --- a/conformance/tests/classes_override.py +++ b/conformance/tests/classes_override.py @@ -54,7 +54,7 @@ def method3(self) -> int: # E[method3]: no matching signature in ancestor return 1 @overload # E[method4] - def method4(self, x: int) -> int: + def method4(self, x: int) -> int: # E[method4] ... @overload diff --git a/conformance/tests/dataclasses_transform_func.py b/conformance/tests/dataclasses_transform_func.py index c93cf4c00..c2eb1f34f 100644 --- a/conformance/tests/dataclasses_transform_func.py +++ b/conformance/tests/dataclasses_transform_func.py @@ -16,7 +16,6 @@ def create_model(cls: T) -> T: @overload -@dataclass_transform(kw_only_default=True, order_default=True) def create_model( *, frozen: bool = False, From 04a2c191a33581495700fe41cff8bff0325dff6f Mon Sep 17 00:00:00 2001 From: wyattscarpenter Date: Fri, 8 Aug 2025 09:02:09 -0700 Subject: [PATCH 120/308] =?UTF-8?q?Update=20unreachable.rst:=20mention=20m?= =?UTF-8?q?atch=20exhaustiveness=20codes=20from=20checkers=20type=20?= =?UTF-8?q?=E2=80=A6=20(#2062)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/guides/unreachable.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/guides/unreachable.rst b/docs/guides/unreachable.rst index d14e3cf06..7ad519b01 100644 --- a/docs/guides/unreachable.rst +++ b/docs/guides/unreachable.rst @@ -86,6 +86,14 @@ and is also present in ``typing_extensions`` starting at version 4.1. However, it is also possible to define a similar function in your own code, for example if you want to customize the runtime error message. +This use of match statements for comprehensive matching is common +enough that some typecheckers have direct support for checking all match +statements for exhaustiveness, regardless of whether or not they have an +``assert_never``-style function in their default arm. For instance, in pyright +this can be enabled by enabling the diagnostic code ``reportMatchNotExhaustive`` +(on by default in strict mode), and in mypy it can be enabled by enabling +the error code ``exhaustive-match``. + You can also use ``assert_never()`` with a sequence of ``if`` statements: .. code:: python From 2f043ef545cb54b24b07e80b4e55f754fdb53e75 Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Mon, 11 Aug 2025 15:59:43 +0200 Subject: [PATCH 121/308] Table of Content improvements (#2045) * Remove extra top levels from main ToC. * Reduce the ToC level by one on the guides index. --- docs/guides/index.rst | 7 ++++++- docs/index.rst | 23 +++++++++++++++++++---- docs/reference/index.rst | 5 +++++ 3 files changed, 30 insertions(+), 5 deletions(-) diff --git a/docs/guides/index.rst b/docs/guides/index.rst index 9a3bbe28a..b13e03486 100644 --- a/docs/guides/index.rst +++ b/docs/guides/index.rst @@ -1,9 +1,14 @@ +:orphan: + ****************** Type System Guides ****************** +.. + Keep in sync with docs/index.rst. + .. toctree:: - :maxdepth: 2 + :maxdepth: 1 :caption: Contents: libraries diff --git a/docs/index.rst b/docs/index.rst index 0dfdf131d..7bd07ba3a 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -5,18 +5,33 @@ Static Typing with Python Guides ====== +.. + Keep in sync with docs/guides/index.rst. + .. toctree:: - :maxdepth: 2 + :maxdepth: 1 - guides/index + guides/libraries + guides/writing_stubs + guides/modernizing + guides/unreachable + guides/type_narrowing + guides/typing_anti_pitch Reference ========= +.. + Keep in sync with docs/reference/index.rst. + .. toctree:: - :maxdepth: 2 + :maxdepth: 1 - reference/index + reference/generics + reference/protocols + reference/best_practices + reference/quality + typing Module Documentation .. seealso:: diff --git a/docs/reference/index.rst b/docs/reference/index.rst index 720e21277..bab77a268 100644 --- a/docs/reference/index.rst +++ b/docs/reference/index.rst @@ -1,7 +1,12 @@ +:orphan: + ********************* Type System Reference ********************* +.. + Keep in sync with docs/index.rst. + .. toctree:: :maxdepth: 2 :caption: Contents: From 945656bf42105b0669699195055356496eba4eaa Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Sat, 16 Aug 2025 15:20:33 +0000 Subject: [PATCH 122/308] Add the Zuban Type Checker (#2067) --- .../mypy/overloads_definitions_stub.toml | 2 +- .../results/mypy/qualifiers_annotated.toml | 3 - conformance/results/mypy/version.toml | 2 +- .../results/pyre/classes_classvar.toml | 1 - .../pyre/overloads_definitions_stub.toml | 4 +- .../results/pyre/typeddicts_alt_syntax.toml | 1 - conformance/results/pyre/version.toml | 2 +- conformance/results/pyright/version.toml | 2 +- conformance/results/results.html | 186 ++++++++++++++--- .../results/zuban/aliases_explicit.toml | 29 +++ .../results/zuban/aliases_implicit.toml | 41 ++++ .../results/zuban/aliases_newtype.toml | 21 ++ .../results/zuban/aliases_recursive.toml | 17 ++ .../results/zuban/aliases_type_statement.toml | 35 ++++ .../results/zuban/aliases_typealiastype.toml | 38 ++++ .../results/zuban/aliases_variance.toml | 9 + .../results/zuban/annotations_coroutines.toml | 5 + .../zuban/annotations_forward_refs.toml | 52 +++++ .../results/zuban/annotations_generators.toml | 16 ++ .../results/zuban/annotations_methods.toml | 6 + .../results/zuban/annotations_typeexpr.toml | 24 +++ .../results/zuban/callables_annotation.toml | 36 ++++ .../results/zuban/callables_kwargs.toml | 23 +++ .../results/zuban/callables_protocol.toml | 24 +++ .../results/zuban/callables_subtyping.toml | 187 ++++++++++++++++++ .../results/zuban/classes_classvar.toml | 27 +++ .../results/zuban/classes_override.toml | 10 + .../results/zuban/constructors_call_init.toml | 15 ++ .../zuban/constructors_call_metaclass.toml | 18 ++ .../results/zuban/constructors_call_new.toml | 31 +++ .../results/zuban/constructors_call_type.toml | 17 ++ .../results/zuban/constructors_callable.toml | 59 ++++++ .../zuban/constructors_consistency.toml | 5 + .../zuban/dataclasses_descriptors.toml | 5 + .../results/zuban/dataclasses_final.toml | 21 ++ .../results/zuban/dataclasses_frozen.toml | 9 + .../results/zuban/dataclasses_hash.toml | 11 ++ .../zuban/dataclasses_inheritance.toml | 7 + .../results/zuban/dataclasses_kwonly.toml | 8 + .../results/zuban/dataclasses_order.toml | 6 + .../results/zuban/dataclasses_postinit.toml | 13 ++ .../results/zuban/dataclasses_slots.toml | 14 ++ .../zuban/dataclasses_transform_class.toml | 11 ++ .../dataclasses_transform_converter.toml | 50 +++++ .../zuban/dataclasses_transform_field.toml | 7 + .../zuban/dataclasses_transform_func.toml | 11 ++ .../zuban/dataclasses_transform_meta.toml | 11 ++ .../results/zuban/dataclasses_usage.toml | 16 ++ .../results/zuban/directives_assert_type.toml | 11 ++ .../results/zuban/directives_cast.toml | 8 + .../results/zuban/directives_deprecated.toml | 18 ++ .../zuban/directives_no_type_check.toml | 7 + .../results/zuban/directives_reveal_type.toml | 11 ++ .../zuban/directives_type_checking.toml | 5 + .../results/zuban/directives_type_ignore.toml | 14 ++ .../zuban/directives_type_ignore_file1.toml | 5 + .../zuban/directives_type_ignore_file2.toml | 6 + .../zuban/directives_version_platform.toml | 9 + .../results/zuban/enums_behaviors.toml | 8 + .../results/zuban/enums_definition.toml | 6 + .../results/zuban/enums_expansion.toml | 13 ++ .../results/zuban/enums_member_names.toml | 6 + .../results/zuban/enums_member_values.toml | 14 ++ conformance/results/zuban/enums_members.toml | 30 +++ .../zuban/exceptions_context_managers.toml | 5 + .../results/zuban/generics_base_class.toml | 18 ++ conformance/results/zuban/generics_basic.toml | 18 ++ .../results/zuban/generics_defaults.toml | 23 +++ .../zuban/generics_defaults_referential.toml | 12 ++ .../generics_defaults_specialization.toml | 7 + .../zuban/generics_paramspec_basic.toml | 22 +++ .../zuban/generics_paramspec_components.toml | 27 +++ .../zuban/generics_paramspec_semantics.toml | 15 ++ .../generics_paramspec_specialization.toml | 10 + .../results/zuban/generics_scoping.toml | 31 +++ .../results/zuban/generics_self_advanced.toml | 13 ++ .../zuban/generics_self_attributes.toml | 7 + .../results/zuban/generics_self_basic.toml | 8 + .../zuban/generics_self_protocols.toml | 17 ++ .../results/zuban/generics_self_usage.toml | 22 +++ .../zuban/generics_syntax_compatibility.toml | 7 + .../zuban/generics_syntax_declarations.toml | 17 ++ .../zuban/generics_syntax_infer_variance.toml | 67 +++++++ .../zuban/generics_syntax_scoping.toml | 43 ++++ .../results/zuban/generics_type_erasure.toml | 20 ++ .../zuban/generics_typevartuple_args.toml | 19 ++ .../zuban/generics_typevartuple_basic.toml | 31 +++ .../zuban/generics_typevartuple_callable.toml | 6 + .../zuban/generics_typevartuple_concat.toml | 5 + .../generics_typevartuple_overloads.toml | 5 + .../generics_typevartuple_specialization.toml | 12 ++ .../zuban/generics_typevartuple_unpack.toml | 6 + .../results/zuban/generics_upper_bound.toml | 13 ++ .../results/zuban/generics_variance.toml | 22 +++ .../zuban/generics_variance_inference.toml | 28 +++ .../results/zuban/historical_positional.toml | 17 ++ .../results/zuban/literals_interactions.toml | 17 ++ .../results/zuban/literals_literalstring.toml | 22 +++ .../zuban/literals_parameterizations.toml | 24 +++ .../results/zuban/literals_semantics.toml | 9 + .../zuban/namedtuples_define_class.toml | 21 ++ .../zuban/namedtuples_define_functional.toml | 17 ++ .../zuban/namedtuples_type_compat.toml | 7 + .../results/zuban/namedtuples_usage.toml | 13 ++ .../results/zuban/narrowing_typeguard.toml | 9 + .../results/zuban/narrowing_typeis.toml | 14 ++ .../results/zuban/overloads_basic.toml | 9 + .../results/zuban/overloads_consistency.toml | 7 + .../results/zuban/overloads_definitions.toml | 17 ++ .../zuban/overloads_definitions_stub.toml | 13 ++ .../results/zuban/overloads_evaluation.toml | 53 +++++ .../zuban/protocols_class_objects.toml | 25 +++ .../results/zuban/protocols_definition.toml | 60 ++++++ .../results/zuban/protocols_explicit.toml | 16 ++ .../results/zuban/protocols_generic.toml | 39 ++++ .../results/zuban/protocols_merging.toml | 15 ++ .../results/zuban/protocols_modules.toml | 15 ++ .../results/zuban/protocols_recursive.toml | 5 + .../zuban/protocols_runtime_checkable.toml | 17 ++ conformance/results/zuban/protocols_self.toml | 5 + .../results/zuban/protocols_subtyping.toml | 34 ++++ .../results/zuban/protocols_variance.toml | 14 ++ .../results/zuban/qualifiers_annotated.toml | 27 +++ .../zuban/qualifiers_final_annotation.toml | 41 ++++ .../zuban/qualifiers_final_decorator.toml | 20 ++ .../results/zuban/specialtypes_any.toml | 5 + .../results/zuban/specialtypes_never.toml | 10 + .../results/zuban/specialtypes_none.toml | 8 + .../zuban/specialtypes_promotions.toml | 6 + .../results/zuban/specialtypes_type.toml | 14 ++ .../results/zuban/tuples_type_compat.toml | 37 ++++ .../results/zuban/tuples_type_form.toml | 16 ++ .../results/zuban/tuples_unpacked.toml | 10 + .../results/zuban/typeddicts_alt_syntax.toml | 13 ++ .../zuban/typeddicts_class_syntax.toml | 10 + .../results/zuban/typeddicts_final.toml | 5 + .../results/zuban/typeddicts_inheritance.toml | 8 + .../results/zuban/typeddicts_operations.toml | 16 ++ .../results/zuban/typeddicts_readonly.toml | 11 ++ .../typeddicts_readonly_consistency.toml | 12 ++ .../typeddicts_readonly_inheritance.toml | 34 ++++ .../zuban/typeddicts_readonly_kwargs.toml | 6 + .../zuban/typeddicts_readonly_update.toml | 10 + .../results/zuban/typeddicts_required.toml | 9 + .../zuban/typeddicts_type_consistency.toml | 16 ++ .../results/zuban/typeddicts_usage.toml | 11 ++ conformance/results/zuban/version.toml | 2 + conformance/src/main.py | 2 +- conformance/src/reporting.py | 12 +- conformance/src/type_checker.py | 64 ++++++ conformance/tests/classes_classvar.py | 2 +- conformance/tests/overloads_definitions.py | 2 +- .../tests/overloads_definitions_stub.pyi | 6 +- conformance/tests/qualifiers_annotated.py | 3 - conformance/tests/typeddicts_alt_syntax.py | 2 +- 155 files changed, 2794 insertions(+), 45 deletions(-) create mode 100644 conformance/results/zuban/aliases_explicit.toml create mode 100644 conformance/results/zuban/aliases_implicit.toml create mode 100644 conformance/results/zuban/aliases_newtype.toml create mode 100644 conformance/results/zuban/aliases_recursive.toml create mode 100644 conformance/results/zuban/aliases_type_statement.toml create mode 100644 conformance/results/zuban/aliases_typealiastype.toml create mode 100644 conformance/results/zuban/aliases_variance.toml create mode 100644 conformance/results/zuban/annotations_coroutines.toml create mode 100644 conformance/results/zuban/annotations_forward_refs.toml create mode 100644 conformance/results/zuban/annotations_generators.toml create mode 100644 conformance/results/zuban/annotations_methods.toml create mode 100644 conformance/results/zuban/annotations_typeexpr.toml create mode 100644 conformance/results/zuban/callables_annotation.toml create mode 100644 conformance/results/zuban/callables_kwargs.toml create mode 100644 conformance/results/zuban/callables_protocol.toml create mode 100644 conformance/results/zuban/callables_subtyping.toml create mode 100644 conformance/results/zuban/classes_classvar.toml create mode 100644 conformance/results/zuban/classes_override.toml create mode 100644 conformance/results/zuban/constructors_call_init.toml create mode 100644 conformance/results/zuban/constructors_call_metaclass.toml create mode 100644 conformance/results/zuban/constructors_call_new.toml create mode 100644 conformance/results/zuban/constructors_call_type.toml create mode 100644 conformance/results/zuban/constructors_callable.toml create mode 100644 conformance/results/zuban/constructors_consistency.toml create mode 100644 conformance/results/zuban/dataclasses_descriptors.toml create mode 100644 conformance/results/zuban/dataclasses_final.toml create mode 100644 conformance/results/zuban/dataclasses_frozen.toml create mode 100644 conformance/results/zuban/dataclasses_hash.toml create mode 100644 conformance/results/zuban/dataclasses_inheritance.toml create mode 100644 conformance/results/zuban/dataclasses_kwonly.toml create mode 100644 conformance/results/zuban/dataclasses_order.toml create mode 100644 conformance/results/zuban/dataclasses_postinit.toml create mode 100644 conformance/results/zuban/dataclasses_slots.toml create mode 100644 conformance/results/zuban/dataclasses_transform_class.toml create mode 100644 conformance/results/zuban/dataclasses_transform_converter.toml create mode 100644 conformance/results/zuban/dataclasses_transform_field.toml create mode 100644 conformance/results/zuban/dataclasses_transform_func.toml create mode 100644 conformance/results/zuban/dataclasses_transform_meta.toml create mode 100644 conformance/results/zuban/dataclasses_usage.toml create mode 100644 conformance/results/zuban/directives_assert_type.toml create mode 100644 conformance/results/zuban/directives_cast.toml create mode 100644 conformance/results/zuban/directives_deprecated.toml create mode 100644 conformance/results/zuban/directives_no_type_check.toml create mode 100644 conformance/results/zuban/directives_reveal_type.toml create mode 100644 conformance/results/zuban/directives_type_checking.toml create mode 100644 conformance/results/zuban/directives_type_ignore.toml create mode 100644 conformance/results/zuban/directives_type_ignore_file1.toml create mode 100644 conformance/results/zuban/directives_type_ignore_file2.toml create mode 100644 conformance/results/zuban/directives_version_platform.toml create mode 100644 conformance/results/zuban/enums_behaviors.toml create mode 100644 conformance/results/zuban/enums_definition.toml create mode 100644 conformance/results/zuban/enums_expansion.toml create mode 100644 conformance/results/zuban/enums_member_names.toml create mode 100644 conformance/results/zuban/enums_member_values.toml create mode 100644 conformance/results/zuban/enums_members.toml create mode 100644 conformance/results/zuban/exceptions_context_managers.toml create mode 100644 conformance/results/zuban/generics_base_class.toml create mode 100644 conformance/results/zuban/generics_basic.toml create mode 100644 conformance/results/zuban/generics_defaults.toml create mode 100644 conformance/results/zuban/generics_defaults_referential.toml create mode 100644 conformance/results/zuban/generics_defaults_specialization.toml create mode 100644 conformance/results/zuban/generics_paramspec_basic.toml create mode 100644 conformance/results/zuban/generics_paramspec_components.toml create mode 100644 conformance/results/zuban/generics_paramspec_semantics.toml create mode 100644 conformance/results/zuban/generics_paramspec_specialization.toml create mode 100644 conformance/results/zuban/generics_scoping.toml create mode 100644 conformance/results/zuban/generics_self_advanced.toml create mode 100644 conformance/results/zuban/generics_self_attributes.toml create mode 100644 conformance/results/zuban/generics_self_basic.toml create mode 100644 conformance/results/zuban/generics_self_protocols.toml create mode 100644 conformance/results/zuban/generics_self_usage.toml create mode 100644 conformance/results/zuban/generics_syntax_compatibility.toml create mode 100644 conformance/results/zuban/generics_syntax_declarations.toml create mode 100644 conformance/results/zuban/generics_syntax_infer_variance.toml create mode 100644 conformance/results/zuban/generics_syntax_scoping.toml create mode 100644 conformance/results/zuban/generics_type_erasure.toml create mode 100644 conformance/results/zuban/generics_typevartuple_args.toml create mode 100644 conformance/results/zuban/generics_typevartuple_basic.toml create mode 100644 conformance/results/zuban/generics_typevartuple_callable.toml create mode 100644 conformance/results/zuban/generics_typevartuple_concat.toml create mode 100644 conformance/results/zuban/generics_typevartuple_overloads.toml create mode 100644 conformance/results/zuban/generics_typevartuple_specialization.toml create mode 100644 conformance/results/zuban/generics_typevartuple_unpack.toml create mode 100644 conformance/results/zuban/generics_upper_bound.toml create mode 100644 conformance/results/zuban/generics_variance.toml create mode 100644 conformance/results/zuban/generics_variance_inference.toml create mode 100644 conformance/results/zuban/historical_positional.toml create mode 100644 conformance/results/zuban/literals_interactions.toml create mode 100644 conformance/results/zuban/literals_literalstring.toml create mode 100644 conformance/results/zuban/literals_parameterizations.toml create mode 100644 conformance/results/zuban/literals_semantics.toml create mode 100644 conformance/results/zuban/namedtuples_define_class.toml create mode 100644 conformance/results/zuban/namedtuples_define_functional.toml create mode 100644 conformance/results/zuban/namedtuples_type_compat.toml create mode 100644 conformance/results/zuban/namedtuples_usage.toml create mode 100644 conformance/results/zuban/narrowing_typeguard.toml create mode 100644 conformance/results/zuban/narrowing_typeis.toml create mode 100644 conformance/results/zuban/overloads_basic.toml create mode 100644 conformance/results/zuban/overloads_consistency.toml create mode 100644 conformance/results/zuban/overloads_definitions.toml create mode 100644 conformance/results/zuban/overloads_definitions_stub.toml create mode 100644 conformance/results/zuban/overloads_evaluation.toml create mode 100644 conformance/results/zuban/protocols_class_objects.toml create mode 100644 conformance/results/zuban/protocols_definition.toml create mode 100644 conformance/results/zuban/protocols_explicit.toml create mode 100644 conformance/results/zuban/protocols_generic.toml create mode 100644 conformance/results/zuban/protocols_merging.toml create mode 100644 conformance/results/zuban/protocols_modules.toml create mode 100644 conformance/results/zuban/protocols_recursive.toml create mode 100644 conformance/results/zuban/protocols_runtime_checkable.toml create mode 100644 conformance/results/zuban/protocols_self.toml create mode 100644 conformance/results/zuban/protocols_subtyping.toml create mode 100644 conformance/results/zuban/protocols_variance.toml create mode 100644 conformance/results/zuban/qualifiers_annotated.toml create mode 100644 conformance/results/zuban/qualifiers_final_annotation.toml create mode 100644 conformance/results/zuban/qualifiers_final_decorator.toml create mode 100644 conformance/results/zuban/specialtypes_any.toml create mode 100644 conformance/results/zuban/specialtypes_never.toml create mode 100644 conformance/results/zuban/specialtypes_none.toml create mode 100644 conformance/results/zuban/specialtypes_promotions.toml create mode 100644 conformance/results/zuban/specialtypes_type.toml create mode 100644 conformance/results/zuban/tuples_type_compat.toml create mode 100644 conformance/results/zuban/tuples_type_form.toml create mode 100644 conformance/results/zuban/tuples_unpacked.toml create mode 100644 conformance/results/zuban/typeddicts_alt_syntax.toml create mode 100644 conformance/results/zuban/typeddicts_class_syntax.toml create mode 100644 conformance/results/zuban/typeddicts_final.toml create mode 100644 conformance/results/zuban/typeddicts_inheritance.toml create mode 100644 conformance/results/zuban/typeddicts_operations.toml create mode 100644 conformance/results/zuban/typeddicts_readonly.toml create mode 100644 conformance/results/zuban/typeddicts_readonly_consistency.toml create mode 100644 conformance/results/zuban/typeddicts_readonly_inheritance.toml create mode 100644 conformance/results/zuban/typeddicts_readonly_kwargs.toml create mode 100644 conformance/results/zuban/typeddicts_readonly_update.toml create mode 100644 conformance/results/zuban/typeddicts_required.toml create mode 100644 conformance/results/zuban/typeddicts_type_consistency.toml create mode 100644 conformance/results/zuban/typeddicts_usage.toml create mode 100644 conformance/results/zuban/version.toml diff --git a/conformance/results/mypy/overloads_definitions_stub.toml b/conformance/results/mypy/overloads_definitions_stub.toml index 2fccd76a3..51a1aa393 100644 --- a/conformance/results/mypy/overloads_definitions_stub.toml +++ b/conformance/results/mypy/overloads_definitions_stub.toml @@ -4,7 +4,7 @@ Allows @override to appear in a stub file not on the first overload. """ conformance_automated = "Fail" errors_diff = """ -Lines 143, 147, 149: Expected error (tag 'override_impl') +Lines 143, 146, 147, 149: Expected error (tag 'override_impl') """ output = """ overloads_definitions_stub.pyi:13: error: Single overload definition, multiple required [misc] diff --git a/conformance/results/mypy/qualifiers_annotated.toml b/conformance/results/mypy/qualifiers_annotated.toml index b93e964ac..c21e2043d 100644 --- a/conformance/results/mypy/qualifiers_annotated.toml +++ b/conformance/results/mypy/qualifiers_annotated.toml @@ -28,8 +28,6 @@ qualifiers_annotated.py:91: error: "" not callable [operat qualifiers_annotated.py:92: error: "" not callable [operator] qualifiers_annotated.py:98: error: Invalid type: ClassVar nested inside other type [valid-type] qualifiers_annotated.py:100: error: Final can be only used as an outermost qualifier in a variable annotation [valid-type] -qualifiers_annotated.py:119: error: Cannot redefine "T" as a type variable [misc] -qualifiers_annotated.py:119: error: Invalid assignment target [misc] """ conformance_automated = "Fail" errors_diff = """ @@ -38,5 +36,4 @@ Line 85: Expected 1 errors Line 93: Expected 1 errors Line 98: Unexpected errors ['qualifiers_annotated.py:98: error: Invalid type: ClassVar nested inside other type [valid-type]'] Line 100: Unexpected errors ['qualifiers_annotated.py:100: error: Final can be only used as an outermost qualifier in a variable annotation [valid-type]'] -Line 119: Unexpected errors ['qualifiers_annotated.py:119: error: Cannot redefine "T" as a type variable [misc]', 'qualifiers_annotated.py:119: error: Invalid assignment target [misc]'] """ diff --git a/conformance/results/mypy/version.toml b/conformance/results/mypy/version.toml index 55be4d997..731bf6fb8 100644 --- a/conformance/results/mypy/version.toml +++ b/conformance/results/mypy/version.toml @@ -1,2 +1,2 @@ version = "mypy 1.17.1" -test_duration = 2.8 +test_duration = 2.96 diff --git a/conformance/results/pyre/classes_classvar.toml b/conformance/results/pyre/classes_classvar.toml index 77c9e7265..1f3bb297f 100644 --- a/conformance/results/pyre/classes_classvar.toml +++ b/conformance/results/pyre/classes_classvar.toml @@ -33,6 +33,5 @@ Line 70: Expected 1 errors Line 73: Expected 1 errors Line 77: Expected 1 errors Line 78: Expected 1 errors -Line 66: Unexpected errors ['classes_classvar.py:66:4 Uninitialized attribute [13]: Attribute `good5` is declared in class `ClassA` to have type `typing.Any` but is never initialized.'] Line 74: Unexpected errors ['classes_classvar.py:74:8 Incompatible return type [7]: Expected `CV[int]` but got `int`.'] """ diff --git a/conformance/results/pyre/overloads_definitions_stub.toml b/conformance/results/pyre/overloads_definitions_stub.toml index 4a9239556..7734a4421 100644 --- a/conformance/results/pyre/overloads_definitions_stub.toml +++ b/conformance/results/pyre/overloads_definitions_stub.toml @@ -4,8 +4,8 @@ Expects @final and @override to be present on all overloads, not just first. """ conformance_automated = "Fail" errors_diff = """ -Lines 67, 69, 71, 73: Expected error (tag 'invalid_final') -Lines 80, 82, 84, 86: Expected error (tag 'invalid_final_2') +Lines 67, 69, 71, 72, 73: Expected error (tag 'invalid_final') +Lines 80, 82, 84, 85, 86: Expected error (tag 'invalid_final_2') Lines 102, 107, 108, 111, 113: Expected error (tag 'override-final') Line 63: Unexpected errors ['overloads_definitions_stub.pyi:63:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).'] Line 76: Unexpected errors ['overloads_definitions_stub.pyi:76:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).'] diff --git a/conformance/results/pyre/typeddicts_alt_syntax.toml b/conformance/results/pyre/typeddicts_alt_syntax.toml index c172f19d5..04257f60c 100644 --- a/conformance/results/pyre/typeddicts_alt_syntax.toml +++ b/conformance/results/pyre/typeddicts_alt_syntax.toml @@ -13,6 +13,5 @@ errors_diff = """ Line 27: Expected 1 errors Line 31: Expected 1 errors Line 35: Expected 1 errors -Line 45: Expected 1 errors Line 43: Unexpected errors ['typeddicts_alt_syntax.py:43:8 Undefined or invalid type [11]: Annotation `Movie2` is not defined as a type.'] """ diff --git a/conformance/results/pyre/version.toml b/conformance/results/pyre/version.toml index bdbaef2d2..95cf3faa9 100644 --- a/conformance/results/pyre/version.toml +++ b/conformance/results/pyre/version.toml @@ -1,2 +1,2 @@ version = "pyre 0.9.25" -test_duration = 5.4 +test_duration = 5.93 diff --git a/conformance/results/pyright/version.toml b/conformance/results/pyright/version.toml index 1199839e0..2944d808b 100644 --- a/conformance/results/pyright/version.toml +++ b/conformance/results/pyright/version.toml @@ -1,2 +1,2 @@ version = "pyright 1.1.403" -test_duration = 4.3 +test_duration = 3.15 diff --git a/conformance/results/results.html b/conformance/results/results.html index 265f795cb..6203268b8 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -159,759 +159,899 @@

    Python Type System Conformance Test Results

    + - + + + + + - + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + - + + - + + + + + + + - + + + + - + + + + + + + + + + + - + + + + - + + + + + + - + + + + + - + - + + + + + + + + + + + + + + + - + + + + + + + + + + + + + - + + + - + + + + - + + + + + + - + + - + + + + + + + + + + - +
     
    mypy 1.17.1
    -
    2.8sec
    +
    3.0sec
    pyright 1.1.403
    -
    4.3sec
    +
    3.1sec
    pyre 0.9.25
    -
    5.4sec
    +
    5.9sec
    +
    zuban 0.0.19
    +
    0.15sec
    +
    Type annotations
         annotations_coroutines Pass Pass PassPass
         annotations_forward_refs
    Partial

    Does not report error for a forward reference that is not enclosed in quotes.

    Does not report error for use of quoted type with "|" operator (runtime error).

    Incorrectly generates error for quoted type defined in class scope.

    Pass
    Partial

    Does not report error for a forward reference that is not enclosed in quotes.

    Does not report error for use of quoted type with "|" operator (runtime error).

    Does not reject f-string in quoted type annotation.

    Incorrectly generates error for quoted type defined in class scope.

    Does not generate error for unquoted type defined in class scope.

    Does not treat triple-quoted forward reference annotation as implicitly parenthesized.

    Partial

    Does not report error for a forward reference that is not enclosed in quotes.

    Incorrectly generates error for quoted type defined in class scope.

    Does not ignore newlines in multi-line unions

         annotations_generators
    Partial

    Does not report incompatible Generator type in `yield from` statement.

    Pass
    Partial

    Does not report invalid return type for generator when function implicitly returns None.

    Incorrectly evaluates type of call to async generator.

    Pass
         annotations_methods
    Pass*

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

    Pass*

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

    Pass*

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

    Pass
         annotations_typeexpr Pass Pass PassPass
    +
    Special types in annotations
         specialtypes_any Pass Pass PassPass
         specialtypes_never Pass Pass
    Partial

    Does not treat Never as compatible with all other types.

    Pass
         specialtypes_none Pass Pass PassPass
         specialtypes_promotions Pass Pass
    Partial

    Does not reject use of attribute that is compatible only with float.

    Pass
         specialtypes_type
    Partial

    Does not treat `type` same as `type[Any]` for assert_type.

    Does not allow access to unknown attributes from object of type `type[Any]`.

    Pass
    Partial

    Does not reject Callable when passed to type[T].

    Does not treat `type` same as `type[Any]` for assert_type.

    Does not allow access to unknown attributes from object of type `type[Any]`.

    Does not reject access to unknown attributes from object of type `Type[object]`.

    Reports type incompatibility between `type` and `Callable[..., Any]`.

    Pass
    +
    Generics
         generics_base_class
    Partial

    Does not detect inconsistent type variable ordering.

    Pass
    Partial

    Does not reject illegal use of Generic.

    Does not allow using generic in assert_type expression.

    Does not detect inconsistent type variable ordering.

    Partial

    Does not detect inconsistent type variable ordering in multi-inheritance.

         generics_basic Pass Pass
    Partial

    False positives in examples using constrained type variables.

    False negative for constraint parameterized by a type variable.

    False negative in custom map example.

    False positive using `iter`.

    False negative for bad type arguments to Generic/Protocol.

    False negative for generic metaclass.

    Pass
         generics_defaults Partial Pass
    Unsupported

    Does not support generic defaults.

    Partial

    Does not reject TypeVars with defaults after a TypeVarTuple

    Type parameter defaults are not bound by attribute access

    ParamSpec after TypeVarTuple is not always handled correctly

         generics_defaults_referential Partial Pass UnsupportedPass
         generics_defaults_specialization Partial Pass
    Unsupported

    Does not support generic defaults.

    Pass
         generics_paramspec_basic Pass Pass
    Partial

    Does not enforce name consistency for ParamSpec assigned to identifier.

    Incorrectly reports error for legitimate use of ParamSpec in generic type alias.

    Does not reject ParamSpec when used in various invalid locations.

    Pass
         generics_paramspec_components Pass Pass
    Partial

    Does not report illegal use of "P.args" on normal parameter.

    Does not report error when P.args is specified but P.kwargs is missing.

    Does not report error when P is out of scope and P.args and P.kwargs is used.

    Does not report error when calling callback defined with ParamSpec with incorrect arguments.

    Does not report error when keyword argument is specified between P.args and P.kwargs.

    Does not report error when calling callable and argument is missing for concatenated parameters.

    Pass
         generics_paramspec_semantics Pass
    Pass*

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

    PassPass
         generics_paramspec_specialization Pass Pass
    Partial

    Reports error for legitimate use of `...` to specialize ParamSpec

    Pass
         generics_scoping
    Partial

    False negative on generic class nested within generic class with same type variable.

    Pass
    Partial

    False negative on generic class nested within generic function with same type variable.

    False negative on generic class nested within generic class with same type variable.

    False negative on assert_type uses.

    Partial

    False negative on generic class nested within generic class with same type variable.

         generics_self_advanced
    Partial

    Does not infer the type of an unannotated `self` parameter to be type `Self`.

    Does not retain `Self` when calling method that returns `Self`.

    Does not infer the type of an unannotated `cls` parameter to be type `type[Self]`.

    Does not retain `Self` when accessing attribute through `type[Self]`.

    Pass
    Partial

    Does not handle use of `Self` within class body correctly.

    False negatives on assert_type uses.

    Pass*

    True positive: Writing to a variable that contains Self (with a class) should error

         generics_self_attributes Pass Pass
    Unsupported

    Does not understand `Self` type.

    Pass
         generics_self_basic Pass Pass
    Partial

    Does not handle use of `Self` as a generic type.

    Pass
         generics_self_protocols Pass Pass
    Partial

    Does not reject protocol compatibility due to method `Self` return type.

    Pass
         generics_self_usage Pass Pass
    Partial

    Complains in some cases when `self: Self` is used explicitly.

    Does not complain when `Self` is used on a function outside any class definition.

    Does not complain when `self` is annotated explicitly (without `Self`) and `Self` is returned.

    Does not complain on inheritance involving `Self`.

    Does not complain on use of `Self` in static methods.

    Does not complain on use of `Self` in metaclasses.

    Partial

    Does not detect invalid Self when Self is not properly bound

         generics_syntax_compatibility Pass Pass
    Partial

    False negative on mixing legacy and PEP695 syntax.

    Does not detect mixing legacy and PEP695 syntax in methods.

    Pass
         generics_syntax_declarations Pass Pass
    Partial

    Does not detect incorrect use of legacy style syntax mixed with PEP695 syntax.

    False negatives due to assert_type use.

    Pass
         generics_syntax_infer_variance
    Unsupported

    Type parameter syntax not yet support.

    Pass
    Partial

    Incorrectly determines that a class cannot be instantiated with __getitem__.

    Incorrectly handles mixing legacy and PEP695 syntax.

    Unsupported

    Type parameter syntax not yet support.

         generics_syntax_scoping
    Partial

    Does not following runtime scoping rules for type parameters in all cases.

    Pass
    Partial

    Does not properly handle mixing legacy syntax with PEP695 syntax.

    Partial

    Does not following runtime scoping rules for type parameters in all cases.

         generics_type_erasure
    Partial

    Infers Node[Never] instead of Node[Any] when argument is not provided.

    False negative on instance attribute access on type(node).

    Pass
    Partial

    Does not erase unspecified type variables to `Any` prior to `assert_type` handling.

    False negatives on instance attribute access on the type.

    Does not infer type of `DefaultDict` with explicit type parameters on constructor.

    False negatives on assert_type uses.

    Pass*

    True positive: Undefined type vars should be inferred as Never not Any (avoiding to introduce Any)

         generics_typevartuple_args
    Partial

    Does not enforce that tuples captured by TypeVarTuple are same type.

    Pass
    Partial

    Does not property handle TypeVarTuple.

    Partial

    Does not enforce that tuples captured by TypeVarTuple are same type.

         generics_typevartuple_basic
    Partial

    Does not enforce that tuples captured by TypeVarTuple are same length.

    Does not enforce that tuples captured by TypeVarTuple are same type.

    Pass
    Partial

    Does not support TypeVarTuple.

    False negatives due to assert_type.

    Partial

    Does not enforce that tuples captured by TypeVarTuple are same length.

    Does not enforce that tuples captured by TypeVarTuple are same type.

         generics_typevartuple_callable Pass Pass
    Partial

    False negatives due to assert_type.

    Pass
         generics_typevartuple_concat Pass Pass
    Partial

    False negatives due to assert_type.

    False compatability error message.

    Pass
         generics_typevartuple_overloads Pass Pass
    Unsupported

    Does not support star expressions for `Unpack`.

    Pass
         generics_typevartuple_specialization
    Partial

    Incorrectly specializes generic alias that includes a TypeVar and TypeVarTuple if no type arguments are provided.

    Rejects specialization of generic type alias defined as a tuple containing a TypeVar.

    Pass
    Unsupported

    Does not support star expressions for `Unpack`.

    Pass
         generics_typevartuple_unpack Pass Pass PassPass
         generics_upper_bound
    Partial

    Does not reject use of type variable within an upper bound.

    Pass
    Partial

    False positives on valid type expression (`list[T]`) in `bound`.

    Does not complain when bound is used alongside type constraints.

    Partial

    Does not reject use of type variable within an upper bound.

         generics_variance
    Partial

    Does not reject use of class-scoped TypeVar used in a base class when variance is incompatible.

    Pass
    Partial

    Does not reject a TypeVar that is defined as both covariant and contravariant.

    Does not reject use of class-scoped TypeVar used in a base class when variance is incompatible.

    Partial

    Does not reject use of class-scoped TypeVar used in a base class when variance is incompatible.

         generics_variance_inference Pass Pass
    Partial

    Does not properly handle mixing legacy and PEP695 syntax.

    False negative about a type variable not being present in the function's parameters.

    Pass
    +
    Type qualifiers
         qualifiers_annotated
    Partial

    Does not allow ClassVar to be nested within Annotated.

    Does not allow Final to be nested within Annotated.

    Does not allow Required and NotRequired to be nested within Annotated.

    Does not reject type[T] compatibility for type alias defined with Annotated.

    Does not reject call of type alias defined with Annotated.

    Pass
    Partial

    Does not reject Annotated with a single parameter.

    Does not reject call of Annotated with no type arguments.

    Pass
         qualifiers_final_annotation
    Partial

    Does not treat use of Final name as if it was replaced by the literal in NamedTuple definition.

    Does not allow conditional assignment of Final instance variable in __init__ method.

    Does not allow redefinition of private class variable that is marked Final in parent class.

    Does not report modification of local Final variable via "for" statement.

    Pass
    Partial

    Does not report Final variable with missing initialization in module scope.

    Does not report error for invalid nesting of Final and ClassVar.

    Does not treat use of Final name as if it was replaced by the literal in NamedTuple definition.

    Does not reject modification of imported variable declared Final.

    Partial

    Does not treat use of Final name as if it was replaced by the literal in NamedTuple definition.

    Does not allow conditional assignment of Final instance variable in __init__ method.

         qualifiers_final_decorator Pass Pass
    Partial

    Reports error for overloaded method implementation marked @final if its overloads do not.

    Does not report error for overloaded @final method defined in stub file.

    Reports misleading error when overload is marked @final but implementation is not.

    Pass
    +
    Class type compatibility
         classes_classvar
    Partial

    Internal error if TypeVarTuple is used in ClassVar.

    Does not reject use of ParamSpec in ClassVar.

    Rejects ClassVar nested in Annotated.

    Does not reject use of ClassVar in TypeAlias definition.

    Pass
    Partial

    Does not reject use of TypeVar in ClassVar.

    Does not reject use of ParamSpec in ClassVar.

    Does not reject use of ClassVar as a generic type argument.

    Does not reject use of ClassVar in parameter type annotation.

    Does not reject use of ClassVar in local variable annotation.

    Does not reject use of ClassVar in instance variable annotation.

    Does not reject use of ClassVar in return type annotation.

    Does not reject use of ClassVar in type alias definition.

    Does not infer type from initialization for bare ClassVar.

    Pass
         classes_override Pass Pass PassPass
    +
    Type aliases
         aliases_explicit
    Partial

    Does not reject specialization of type alias that has already been implicitly specialized.

    Pass
    Partial

    Incorrectly reports error for type alias defined with ParamSpec.

    Incorrectly rejects some valid type aliases when used in annotations.

    Incorrectly evaluates generic type alias with ParamSpec with missing type argument.

    Does not report some illegal annotation forms as invalid type aliases.

    Does not report invalid specialization of generic type aliases.

    Incorrectly rejects import alias of `TypeAlias` when used to define type alias.

    Does not report invalid specialization of already-specialized generic type alias.

    Pass
         aliases_implicit Pass Pass
    Partial

    Incorrectly reports error for type alias defined with ParamSpec.

    Incorrectly rejects some valid type aliases when used in annotations.

    Incorrectly evaluates generic type alias with ParamSpec with missing type argument.

    Does not report invalid specialization of generic type aliases.

    Does not report error for attempt to instantiate union type alias.

    Does not report invalid specialization of already-specialized generic type alias.

    Pass
         aliases_newtype
    Partial

    `NewType`s are considered classes, not functions.

    Pass
    Partial

    Does not reject use of NewType in `isinstance` call.

    Does not reject use of NewType in class definition statement.

    Does not report inconsistency between name of NewType and assigned identifier name.

    Does not reject use of NewType with generic class with TypeVar.

    Does not reject use of NewType with protocol class.

    Does not reject use of NewType with TypedDict class.

    Does not reject use of NewType with Any.

    Pass
         aliases_recursive Pass Pass
    Partial

    Does not properly handle some recursive type aliases.

    Does not properly handle specialization of generic recursive type aliases.

    Pass
         aliases_type_statement
    Partial

    Does not reject type alias defined in function scope.

    Pass
    Partial

    Does not complain when a type alias cannot be used as a base class.

    Does not complain when a type alias cannot be used as a function.

    Does not complain when a type statement definition combines new and old TypeVars.

    Does not complain when a type statement definition uses old TypeVars.

    Does not properly support recursive aliases.

    Pass
         aliases_typealiastype
    Partial

    Incorrectly rejects some recursive type aliases using TypeAliasType.

    Incorrectly rejects the use of a class-scoped TypeVar in a TypeAliasType definition.

    Pass
    Unsupported

    Support for TypeAliasType is not implemented.

    Partial

    Incorrectly rejects the use of a class-scoped TypeVar in a TypeAliasType definition.

    Incorrectly allows type_params= to be an arbitrary tuple.

         aliases_variance Pass Pass PassPass
    +
    Literals
         literals_interactions
    Partial

    Does not narrow type of `x` with `x in Literal` type guard pattern.

    Pass
    Partial

    Does not detect out-of-bound tuple literal index.

    Does not perform exhaustiveness checks on enums.

    Does not narrow type of `x` with `x in Literal` type guard pattern.

    Does not narrow type of `x` with `x == Literal` type guard pattern.

    Partial

    Does not narrow type of `x` with `x in Literal` type guard pattern.

         literals_literalstring
    Unsupported

    Support for `LiteralString` is not implemented.

    Pass
    Partial

    Incorrectly infers `str` rather than `LiteralString` when literal string `join` is used.

    Unsupported

    Support for `LiteralString` is not implemented.

         literals_parameterizations
    Partial

    Does not reject tuple within Literal.

    Pass
    Partial

    Does not support type aliases in Literal type expression.

    Does not support nested Literal type expression.

    Does not reject tuple in Literal type expression.

    Does not reject "bare" Literal in type expression.

    Pass
         literals_semantics Pass Pass PassPass
    +
    Protocols
         protocols_class_objects Pass Pass
    Partial

    Does not reject protocol class assigned to type[Proto].

    Incorrectly reports some class objects as incompatible with a protocol.

    Fails to report some class objects as incompatible with a protocol.

    Pass
         protocols_definition
    Partial

    Does not detect protocol mismatch if concrete method is missing annotations.

    Does not detect protocol mismatch if concrete method's parameters are position-only.

    Pass
    Partial

    Does not reject ClassVar in concrete class when attribute in protocol is not ClassVar or vice versa.

    Does not reject read-only property in concrete class when attribute in protocol is mutable.

    Does not reject covariant attribute type when protocol attribute is mutable.

    Does not reject read-only property in concrete class when protocol has settable property.

    Does not reject immutable named tuple attribute in concrete class when protocol attribute is mutable.

    Does not reject immutable frozen dataclass attribute in concrete class when protocol attribute is mutable.

    Partial

    Does not detect protocol mismatch if concrete method is missing annotations.

    Does not detect protocol mismatch if concrete method's parameters are position-only.

         protocols_explicit
    Pass*

    Does not report unimplemented attributes for class that explicitly derives from protocol until it is instantiated.

    Pass
    Partial

    Does not report error when calling unimplemented protocol method from derived class.

    Does not report error when method is not implemented in derived class.

    Pass*

    Does not report unimplemented attributes for class that explicitly derives from protocol until it is instantiated.

         protocols_generic Pass Pass
    Partial

    Does not reject the use of Protocol and Generic together as base classes.

    Does not detect protocol mismatch when method-scoped TypeVar is used in protocol.

    Pass
         protocols_merging Pass Pass PassPass
         protocols_modules Pass Pass
    Unsupported

    Does not perform protocol checks for modules.

    Pass
         protocols_recursive Pass Pass PassPass
         protocols_runtime_checkable
    Partial

    Does not report unsafe overlap for runtime_checkable protocol.

    Pass
    Unsupported

    Does not reject isinstance or issubclass call for protocol that is not runtime_checkable.

    Does not reject issubclass call for data protocol.

    Does not report unsafe overlap for runtime_checkable protocol.

    Partial

    Does not report unsafe overlap for runtime_checkable protocol.

         protocols_self Pass Pass PassPass
         protocols_subtyping Pass Pass PassPass
         protocols_variance Pass Pass
    Unsupported

    Does not detect incorrect TypeVar variance within generic protocols.

    Pass
    +
    Callables
         callables_annotation
    Partial

    Incorrectly treats "*args: T, **kwargs: T" as "..." when T is specialized to Any.

    Does not treat "*args: Any, **kargs: Any" as "..." when separated by keyword parameter.

    Pass
    Partial

    Does not evaluate correct type for `*args: int` parameter.

    Does not correctly implement type compatibility rules for "...".

    Does not treat "*args: Any, **kwargs: Any" as "...".

    Partial

    Incorrectly treats "*args: T, **kwargs: T" as "..." when T is specialized to Any.

    Does not treat "*args: Any, **kargs: Any" as "..." when separated by keyword parameter.

         callables_kwargs
    Partial

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

    Pass PassPass
         callables_protocol Pass Pass
    Partial

    Does not correctly handle callback protocol that declares attributes in all functions.

    Does not report type incompatibility for callback protocol with positional-only parameters.

    Incorrectly reports type compatibility error with callback that has *args and **kwargs.

    Does not report type incompatibility for callback missing a default argument for positional parameter.

    Does not report type incompatibility for callback missing a default argument for keyword parameter.

    Pass
         callables_subtyping Pass Pass
    Partial

    Rejects standard parameter as incompatible with keyword-only parameter.

    Rejects use of Callable with ParamSpec in TypeAlias definition.

    Pass
    +
    Constructors
         constructors_call_init
    Partial

    Does not report errors during binding to self parameter of __init__ method.

    Does not reject use of class-scoped type variables in annotation of self parameter in __init__ method.

    Pass
    Partial

    Does not infer type of Self for self parameter of __init__ method.

    Does not report errors during binding to self parameter of __init__ method.

    Does not reject use of class-scoped type variables in annotation of self parameter in __init__ method.

    Incorrectly raises Incompatible overload type errors.

    Incorrectly raises compatibility type errors.

    Partial

    Does not report errors during binding to self parameter of __init__ method.

    Does not reject use of class-scoped type variables in annotation of self parameter in __init__ method.

         constructors_call_metaclass
    Unupported

    Does not honor metaclass __call__ method when evaluating constructor call.

    Does not skip evaluation of __new__ and __init__ if custom metaclass call returns non-class.

    Pass
    Partial

    Does not evaluate __new__ if metaclass __call__ is defined.

    Unupported

    Does not honor metaclass __call__ method when evaluating constructor call.

    Does not skip evaluation of __new__ and __init__ if custom metaclass call returns non-class.

         constructors_call_new
    Partial

    Does not support __new__ return type that is not a subclass of the class being constructed.

    Does not skip evaluation of __init__ based on __new__ return type.

    Does not report errors during binding to cls parameter of __new__ method.

    Pass
    Partial

    Does not support __new__ return type that is not a subclass of the class being constructed.

    Does not report errors during binding to cls parameter of __new__ method.

    Incorrectly raises compatibility type errors.

    Partial

    Does not support __new__ return type that is not a subclass of the class being constructed.

    Does not skip evaluation of __init__ based on __new__ return type.

    Does not report errors during binding to cls parameter of __new__ method.

         constructors_call_type
    Partial

    Does not validate call to custom metaclass __call__ method through type[T].

    Pass Pass
    Partial

    Does not validate call to custom metaclass __call__ method through type[T].

         constructors_callable
    Partial

    Does not generate a union type for __new__ and __init__ when converting class to callable.

    Does not ignore __init__ based on __new__ return type when converting class to callable.

    Does not support __new__ return type that is different from class being constructed.

    Pass
    Partial

    Does not generate a union type for __new__ and __init__ when converting class to callable.

    Does not ignore __init__ based on __new__ return type when converting class to callable.

    Does not support __new__ return type that is different from class being constructed.

    Does not use annotated type of self in __init__ method to generate return type of callable.

    Incorrectly raises incompatibility type errors.

    Partial

    Does not generate a union type for __new__ and __init__ when converting class to callable.

    Does not ignore __init__ based on __new__ return type when converting class to callable.

    Does not support __new__ return type that is different from class being constructed.

    Struggles with some cases of self types

         constructors_consistency
    Pass*

    Does not report inconsistency between __new__ and __init__ (optional).

    Pass
    Pass*

    Does not report inconsistency between __new__ and __init__ (optional).

    Pass
    +
    Overloads
         overloads_basic Pass Pass PassPass
         overloads_consistency Pass Pass
    Partial

    Does not apply decorator transforms before checking overload consistency.

    Pass
         overloads_definitions
    Partial

    Allows @override to be on all overloads and implementation, instead of just implementation.

    Pass
    Partial

    Does not allow an overload with no implementation in a Protocol or an abstract base class.

    Expects @final/@override on all overloads and implementation, instead of implementation only.

    Pass
         overloads_definitions_stub
    Partial

    Allows @override to appear in a stub file not on the first overload.

    Pass
    Partial

    Expects @final and @override to be present on all overloads, not just first.

    Pass
         overloads_evaluation
    Partial

    Does not expand boolean arguments to Literal[True] and Literal[False].

    Does not expand enum arguments to literal variants.

    Does not expand tuple arguments to possible combinations.

    Does not evaluate Any in some cases where overload is ambiguous.

    Evaluates Any in some cases where overload is not ambiguous.

    Partial

    Does not evaluate Any in some cases where overload is ambiguous.

    Partial

    Does not expand boolean arguments to Literal[True] and Literal[False].

    Does not expand enum arguments to literal variants.

    Does not expand type[A | B] to type[A] and type[B].

    Does not expand tuple arguments to possible combinations.

    Does not prefer variadic match to indeterminate-length unpacked argument.

    Does not treat multiple matches due to gradual types as ambiguous.

    Partial

    Does not expand boolean arguments to Literal[True] and Literal[False].

    Does not expand enum arguments to literal variants.

    Does not expand tuple arguments to possible combinations.

    Does not evaluate Any in some cases where overload is ambiguous.

    Evaluates Any in some cases where overload is not ambiguous.

    +
    Exceptions
         exceptions_context_managers Pass Pass
    Partial

    assert_type causes failures.

    Pass
    +
    Dataclasses
         dataclasses_descriptors
    Partial

    Does not correctly evaluate type of descriptor access.

    Pass
    Partial

    Incorrectly generates error when calling constructor of dataclass with descriptor.

    Incorrectly raises incompatibility type errors.

    Pass
         dataclasses_final
    Partial

    Wrongly requires a Final dataclass field to be initialized at class level.

    Doesn't support Final nested inside ClassVar.

    Pass Pass
    Partial

    Wrongly requires a Final dataclass field to be initialized at class level.

    Doesn't support Final nested inside ClassVar.

         dataclasses_frozen Pass Pass PassPass
         dataclasses_hash
    Partial

    Does not report when dataclass is not compatible with Hashable protocol.

    Pass
    Partial

    Does not report when dataclass is not compatible with Hashable protocol.

    Partial

    Does not report when dataclass is not compatible with Hashable protocol.

         dataclasses_inheritance Pass Pass
    Partial

    Does not reject ClassVar that is overridden by instance variable.

    Does not reject instance variable that is overridden by ClassVar.

    Pass
         dataclasses_kwonly Pass Pass
    Partial

    Rejects legitimate use of dataclass field with `kw_only=True`.

    Pass
         dataclasses_order Pass Pass PassPass
         dataclasses_postinit Pass Pass
    Partial

    Does not perform validation of `__post_init__` method.

    Incorrectly complains on the assignment of `InitVar` in class bodies.

    Pass
         dataclasses_slots
    Partial

    Does not reject write to instance variable that is not defined in __slots__.

    Pass
    Partial

    Does not report error when `slots=True` is used with `__slots__` definition.

    Does not reject write to instance variable that is not defined in __slots__.

    Does not reject access to `__slots__` from dataclass instance when `slots=False`.

    Partial

    Does not reject write to instance variable that is not defined in __slots__.

         dataclasses_transform_class Pass Pass
    Partial

    Does not support field specifiers.

    Emits "attribute not initialized" error for dataclass field.

    Pass
         dataclasses_transform_converter
    Unsupported

    Converter parameter not yet supported.

    Pass
    Unsupported

    Converter parameter not yet supported.

    Unsupported

    Converter parameter not yet supported.

         dataclasses_transform_field
    Partial

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

    Pass
    Unsupported

    Does not understand dataclass transform field specifiers.

    Pass
         dataclasses_transform_func
    Partial

    Does not handle `kw_only=False` override when `kw_only_default=True`.

    Does not report error when `order=False` and comparison operators are used.

    Pass
    Partial

    Does not understand @dataclass_transform when it is applied only to overloads of a decorator but not the definition.

    Does not detect non-frozen class inheriting from frozen class.

    Emits "attribute not initialized" error for dataclass field.

    Pass
         dataclasses_transform_meta Pass Pass
    Partial

    Does not understand custom field specifiers.

    Incorrectly rejects frozen dataclass that inherits from non-frozen.

    Emits "attribute not initialized" error for dataclass field.

    Pass
         dataclasses_usage
    Pass*

    Does not detect unannotated usage of `dataclasses.field()`.

    Pass
    Partial

    Does not report error when field with no default follows field with default.

    Complains on `assert_type` when used for bound methods vs `Callable`.

    Does not understand `__dataclass_fields__`.

    Incorrectly raises incompatibility type errors.

    Pass
    +
    Typed dictionaries
         typeddicts_alt_syntax
    Pass*

    Does not support keyword-argument form of alternative syntax (deprecated in 3.11).

    Pass
    Partial

    Does not report when name of TypedDict doesn't match assigned identifier name.

    Does not support keyword-argument form of alternative syntax (deprecated in 3.11).

    Pass*

    Does not support keyword-argument form of alternative syntax (deprecated in 3.11).

         typeddicts_class_syntax Pass Pass
    Partial

    Does not reject methods within TypedDict class.

    Does not report when metaclass is provided.

    Does not report when other keyword argument is provided.

    Does not support generic TypedDict class.

    Pass
         typeddicts_final Pass Pass
    Partial

    Does not handle value with literal type as index to TypedDict object.

    Pass
         typeddicts_inheritance Pass Pass PassPass
         typeddicts_operations Pass Pass PassPass
         typeddicts_readonly Pass Pass PassPass
         typeddicts_readonly_consistency Pass Pass PassPass
         typeddicts_readonly_inheritance
    Partial

    Incorrectly rejects non-ReadOnly override of ReadOnly item.

    Incorrectly rejects override of ReadOnly item with another ReadOnly item with narrower type.

    Incorrectly rejects override of NotRequired ReadOnly item with a Required ReadOnly item.

    Pass Unsupported
    Partial

    Incorrectly rejects non-ReadOnly override of ReadOnly item.

    Incorrectly rejects override of ReadOnly item with another ReadOnly item with narrower type.

    Incorrectly rejects override of NotRequired ReadOnly item with a Required ReadOnly item.

         typeddicts_readonly_kwargs Pass Pass PassPass
         typeddicts_readonly_update
    Partial

    Incorrectly allows update of ReadOnly item.

    Incorrectly rejects update involving an item with Never type.

    Pass Pass
    Partial

    Incorrectly allows update of ReadOnly item.

         typeddicts_required Pass Pass
    Partial

    Does not reject use of `Required` in function parameter annotation.

    Does not reject nested use of `Required` in type annotation.

    Does not support recursive TypedDict definitions.

    Incorrectly complains about uninitialized attributes on TypedDict definitions.

    Incorrectly generates "attribute not initialized" errors for TypedDict fields.

    Pass
         typeddicts_type_consistency Pass Pass
    Partial

    Does not reject assignment of TypedDict with missing key.

    Does not return non-Optional value from `get` method for required key.

    Does not properly handle nested TypedDicts.

    Pass
         typeddicts_usage Pass Pass
    Pass*

    Does not report errant use of TypedDict in `isinstance` call.

    Does not reject use of TypedDict as TypeVar bound.

    Pass
    +
    Tuples
         tuples_type_compat
    Partial

    Does not support tuple narrowing based on `len()` type guard (optional).

    Pass
    Partial

    Does not support some unpacked tuple forms.

    Does not report type violation when assigning `tuple[int, ...]` to `tuple[int]`.

    Does not support tuple narrowing based on `len()` type guard (optional).

    Does not correctly evaluate `Sequence[Never]` for `tuple[()]`.

    Pass*

    Does not support tuple narrowing based on `len()` type guard (optional).

         tuples_type_form Pass Pass PassPass
         tuples_unpacked
    Partial

    "More than one unpack" error is missing in some cases.

    Pass PassPass
    +
    Named tuples
         namedtuples_define_class
    Partial

    Does not reject override of named tuple attribute in child class.

    Pass
    Partial

    Does not evaluate correct type for indexed named tuple instance with integer.

    Does not evaluate correct type for indexed named tuple instance with slice.

    Does not report out-of-range index access with named tuple instance.

    Does not reject named tuple element with no default value after one with a default.

    Incorrectly rejects assignment of named tuple to a tuple with compatible type.

    Does not reject attempt to use NamedTuple with multiple inheritance.

    Partial

    Does not reject override of named tuple attribute in child class.

         namedtuples_define_functional Pass Pass PassPass
         namedtuples_type_compat Pass Pass PassPass
         namedtuples_usage
    Partial

    Does not reject attempt to delete named tuple field by name.

    Pass PartialPass
    +
    Enumerations
         enums_behaviors Pass Pass PassPass
         enums_definition Pass Pass PassPass
         enums_expansion
    Partial

    Improperly applies narrowing to Flag subclass.

    Pass Pass
    Partial

    Improperly applies narrowing to Flag subclass.

         enums_member_names
    Pass*

    Does not support special-cased handling of member name literal types in some cases (optional).

    Pass
    Pass*

    Does not support special-cased handling of member name literal types (optional).

    Pass
         enums_member_values
    Partial

    Does not enforce declared type of `_value_`.

    Does not enforce assigned tuple types for enum members (optional).

    Pass Pass
    Partial

    Does not enforce declared type of `_value_`.

         enums_members
    Partial

    Does not treat attribute with annotation and no assignment as non-member.

    Does not treat callables as non-members.

    Does not honor `enum.member` as method decorator.

    Does not properly handle aliased enum members.

    Does not support `_ignore_` mechanism (optional).

    Does not treat attributes with private names as non-members.

    Pass*

    Does not support `_ignore_` mechanism (optional).

    Partial

    Does not reject use of annotation with enum member.

    Does not treat callables as non-members.

    Does not treat annotated attributes as non-members.

    Does not honor `enum.nonmember` to define non-member attribute.

    Does not honor `enum.member` as method decorator.

    Does not properly handle aliased enum members.

    Rejects use of `_ignore_`.

    Does not support `_ignore_` mechanism (optional).

    Partial

    Does not honor `enum.member` as method decorator.

    Does not properly handle aliased enum members.

    Does not treat somecallables as non-members.

    +
    Type narrowing
         narrowing_typeguard Pass Pass PassPass
         narrowing_typeis Pass Pass PassPass
    +
    Type checker directives
         directives_assert_type Pass Pass PassPass
         directives_cast Pass Pass PassPass
         directives_deprecated Pass Pass
    Unsupported

    Does not support @deprecated.

    Unsupported
         directives_no_type_check
    Partial

    Does not honor `@no_type_check` class decorator (allowed).

    Does not reject invalid call of `@no_type_check` function.

    Pass*

    Does not honor `@no_type_check` class decorator (allowed).

    Pass*

    Does not honor @no_type_check decorator.

    Pass
         directives_reveal_type Pass Pass PassPass
         directives_type_checking Pass Pass PassPass
         directives_type_ignore
    Partial

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

    Pass Pass
    Partial

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

         directives_type_ignore_file1 Pass Pass PassPass
         directives_type_ignore_file2 Pass Pass PassPass
         directives_version_platform
    Pass*

    Does not understand three-element form of sys.version checks.

    Does not understand os.name checks.

    Pass PassPass
    +
    Historical and deprecated features
         historical_positional
    Partial

    Does not reject positional-only parameter after non-positional-only parameter.

    Treats keyword-only parameter as positional-only.

    Applies legacy positional-only rules when PEP 570 syntax is used.

    Pass Pass
    Partial

    Does not reject positional-only parameter after non-positional-only parameter.

    Treats keyword-only parameter as positional-only.

    Applies legacy positional-only rules when PEP 570 syntax is used.

    diff --git a/conformance/results/zuban/aliases_explicit.toml b/conformance/results/zuban/aliases_explicit.toml new file mode 100644 index 000000000..3f056707b --- /dev/null +++ b/conformance/results/zuban/aliases_explicit.toml @@ -0,0 +1,29 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +aliases_explicit.py:67: error: Bad number of arguments for type alias, expected 0, given 1 +aliases_explicit.py:68: error: Bad number of arguments for type alias, expected 0, given 1 +aliases_explicit.py:69: error: Bad number of arguments for type alias, expected 1, given 2 +aliases_explicit.py:70: error: Bad number of arguments for type alias, expected 1, given 2 +aliases_explicit.py:71: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "int" +aliases_explicit.py:79: error: Invalid type alias: expression is not a valid type +aliases_explicit.py:80: error: Bracketed expression "[...]" is not valid as a type +aliases_explicit.py:80: note: Did you mean "List[...]"? +aliases_explicit.py:81: error: Syntax error in type annotation +aliases_explicit.py:81: note: Suggestion: Is there a spurious trailing comma? +aliases_explicit.py:82: error: Invalid type alias: expression is not a valid type +aliases_explicit.py:83: error: Invalid type alias: expression is not a valid type +aliases_explicit.py:84: error: Invalid type alias: expression is not a valid type +aliases_explicit.py:85: error: Invalid type alias: expression is not a valid type +aliases_explicit.py:86: error: Invalid type alias: expression is not a valid type +aliases_explicit.py:87: error: Variable "aliases_explicit.var1" is not valid as a type +aliases_explicit.py:87: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +aliases_explicit.py:88: error: Invalid type alias: expression is not a valid type +aliases_explicit.py:89: error: Invalid type: try using Literal[1] instead? +aliases_explicit.py:90: error: Invalid type alias: expression is not a valid type +aliases_explicit.py:91: error: Invalid type alias: expression is not a valid type +aliases_explicit.py:100: error: Bad number of arguments for type alias, expected 0, given 1 +aliases_explicit.py:101: error: "" not callable +aliases_explicit.py:102: error: Bad number of arguments for type alias, expected 0, given 1 +""" diff --git a/conformance/results/zuban/aliases_implicit.toml b/conformance/results/zuban/aliases_implicit.toml new file mode 100644 index 000000000..000b3d757 --- /dev/null +++ b/conformance/results/zuban/aliases_implicit.toml @@ -0,0 +1,41 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +aliases_implicit.py:76: error: Bad number of arguments for type alias, expected 0, given 1 +aliases_implicit.py:77: error: Bad number of arguments for type alias, expected 0, given 1 +aliases_implicit.py:78: error: Bad number of arguments for type alias, expected 1, given 2 +aliases_implicit.py:79: error: Bad number of arguments for type alias, expected 1, given 2 +aliases_implicit.py:80: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "int" +aliases_implicit.py:81: error: Type argument "str" of "GoodTypeAlias12" must be a subtype of "float" +aliases_implicit.py:106: error: Variable "aliases_implicit.BadTypeAlias1" is not valid as a type +aliases_implicit.py:106: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +aliases_implicit.py:107: error: Variable "aliases_implicit.BadTypeAlias2" is not valid as a type +aliases_implicit.py:107: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +aliases_implicit.py:108: error: Variable "aliases_implicit.BadTypeAlias3" is not valid as a type +aliases_implicit.py:108: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +aliases_implicit.py:109: error: Variable "aliases_implicit.BadTypeAlias4" is not valid as a type +aliases_implicit.py:109: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +aliases_implicit.py:110: error: Variable "aliases_implicit.BadTypeAlias5" is not valid as a type +aliases_implicit.py:110: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +aliases_implicit.py:111: error: Variable "aliases_implicit.BadTypeAlias6" is not valid as a type +aliases_implicit.py:111: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +aliases_implicit.py:112: error: Variable "aliases_implicit.BadTypeAlias7" is not valid as a type +aliases_implicit.py:112: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +aliases_implicit.py:113: error: Variable "aliases_implicit.BadTypeAlias8" is not valid as a type +aliases_implicit.py:113: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +aliases_implicit.py:114: error: Variable "aliases_implicit.var1" is not valid as a type +aliases_implicit.py:114: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +aliases_implicit.py:115: error: Variable "aliases_implicit.BadTypeAlias10" is not valid as a type +aliases_implicit.py:115: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +aliases_implicit.py:116: error: Variable "aliases_implicit.BadTypeAlias11" is not valid as a type +aliases_implicit.py:116: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +aliases_implicit.py:117: error: Variable "aliases_implicit.BadTypeAlias12" is not valid as a type +aliases_implicit.py:117: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +aliases_implicit.py:118: error: Variable "aliases_implicit.BadTypeAlias13" is not valid as a type +aliases_implicit.py:118: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +aliases_implicit.py:119: error: Variable "aliases_implicit.BadTypeAlias14" is not valid as a type +aliases_implicit.py:119: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +aliases_implicit.py:133: error: "UnionType" not callable +aliases_implicit.py:135: error: Bad number of arguments for type alias, expected 0, given 1 +""" diff --git a/conformance/results/zuban/aliases_newtype.toml b/conformance/results/zuban/aliases_newtype.toml new file mode 100644 index 000000000..2500008d3 --- /dev/null +++ b/conformance/results/zuban/aliases_newtype.toml @@ -0,0 +1,21 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +aliases_newtype.py:11: error: Argument 1 to "UserId" has incompatible type "str"; expected "int" +aliases_newtype.py:12: error: Incompatible types in assignment (expression has type "int", variable has type "UserId") +aliases_newtype.py:18: error: Incompatible types in assignment (expression has type "Type[UserId]", variable has type "Type[Any]") +aliases_newtype.py:23: error: Cannot use isinstance() with NewType type +aliases_newtype.py:26: error: Cannot subclass "NewType" +aliases_newtype.py:35: error: String argument 1 "BadName" to NewType(...) does not match variable name "GoodName" +aliases_newtype.py:41: error: Bad number of arguments for type alias, expected 0, given 1 +aliases_newtype.py:47: error: Argument 2 to NewType(...) must be subclassable (got "int | str") +aliases_newtype.py:50: error: Type variable "aliases_newtype.T" is unbound +aliases_newtype.py:50: note: (Hint: Use "Generic[T]" or "Protocol[T]" base class to bind "T" inside a class) +aliases_newtype.py:50: note: (Hint: Use "T" in function signature to bind "T" inside a function) +aliases_newtype.py:52: error: NewType cannot be used with protocol classes +aliases_newtype.py:54: error: Argument 2 to NewType(...) must be subclassable (got "Literal[7]") +aliases_newtype.py:61: error: Argument 2 to NewType(...) must be subclassable (got "TD1") +aliases_newtype.py:63: error: NewType(...) expects exactly two positional arguments +aliases_newtype.py:65: error: Argument 2 to NewType(...) must be subclassable (got "Any") +""" diff --git a/conformance/results/zuban/aliases_recursive.toml b/conformance/results/zuban/aliases_recursive.toml new file mode 100644 index 000000000..daf88ae2f --- /dev/null +++ b/conformance/results/zuban/aliases_recursive.toml @@ -0,0 +1,17 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +aliases_recursive.py:19: error: Dict entry 1 has incompatible type "str": "complex"; expected "str": "None | int | str | float | list[Json] | dict[str, Json]" +aliases_recursive.py:20: error: List item 1 has incompatible type "complex"; expected "None | int | str | float | list[Json] | dict[str, Json]" +aliases_recursive.py:38: error: Incompatible types in assignment (expression has type "tuple[int, tuple[str, int], tuple[int, tuple[int, list[int]]]]", variable has type "str | int | tuple[RecursiveTuple, ...]") +aliases_recursive.py:39: error: Name "t6" already defined on line 38 +aliases_recursive.py:39: error: Incompatible types in assignment (expression has type "tuple[int, list[int]]", variable has type "str | int | tuple[RecursiveTuple, ...]") +aliases_recursive.py:50: error: Dict entry 0 has incompatible type "str": "list[int]"; expected "str": "str | int | Mapping[str, str | int | Mapping[str, RecursiveMapping]]" +aliases_recursive.py:51: error: Dict entry 2 has incompatible type "str": "list[int]"; expected "str": "str | int | Mapping[str, str | int | Mapping[str, RecursiveMapping]]" +aliases_recursive.py:52: error: Dict entry 2 has incompatible type "str": "list[int]"; expected "str": "str | int | Mapping[str, str | int | Mapping[str, RecursiveMapping]]" +aliases_recursive.py:63: error: List item 0 has incompatible type "float"; expected "GenericTypeAlias1[str] | str" +aliases_recursive.py:69: error: List item 0 has incompatible type "float"; expected "GenericTypeAlias2[str, int] | str | int" +aliases_recursive.py:72: error: Invalid recursive alias: a union item of itself +aliases_recursive.py:75: error: Invalid recursive alias: a union item of itself +""" diff --git a/conformance/results/zuban/aliases_type_statement.toml b/conformance/results/zuban/aliases_type_statement.toml new file mode 100644 index 000000000..02494e07c --- /dev/null +++ b/conformance/results/zuban/aliases_type_statement.toml @@ -0,0 +1,35 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +aliases_type_statement.py:17: error: "TypeAliasType" has no attribute "bit_count" +aliases_type_statement.py:19: error: "TypeAliasType" not callable +aliases_type_statement.py:23: error: "TypeAliasType" has no attribute "other_attrib" +aliases_type_statement.py:26: error: Type alias defined using "type" statement not valid as base class +aliases_type_statement.py:31: error: Argument 2 to "isinstance" has incompatible type "TypeAliasType"; expected "Type[Any] | UnionType | tuple[_ClassInfo, ...]" +aliases_type_statement.py:37: error: Invalid type alias: expression is not a valid type +aliases_type_statement.py:38: error: Bracketed expression "[...]" is not valid as a type +aliases_type_statement.py:38: note: Did you mean "List[...]"? +aliases_type_statement.py:39: error: Syntax error in type annotation +aliases_type_statement.py:39: note: Suggestion: Is there a spurious trailing comma? +aliases_type_statement.py:40: error: Invalid type alias: expression is not a valid type +aliases_type_statement.py:41: error: Invalid type alias: expression is not a valid type +aliases_type_statement.py:42: error: Invalid type alias: expression is not a valid type +aliases_type_statement.py:43: error: Invalid type alias: expression is not a valid type +aliases_type_statement.py:44: error: Invalid type alias: expression is not a valid type +aliases_type_statement.py:45: error: Variable "aliases_type_statement.var1" is not valid as a type +aliases_type_statement.py:45: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +aliases_type_statement.py:46: error: Invalid type alias: expression is not a valid type +aliases_type_statement.py:47: error: Invalid type: try using Literal[1] instead? +aliases_type_statement.py:48: error: Invalid type alias: expression is not a valid type +aliases_type_statement.py:49: error: Invalid type alias: expression is not a valid type +aliases_type_statement.py:52: error: Name "BadTypeAlias14" already defined on line 51 +aliases_type_statement.py:56: error: Type alias not allowed in function +aliases_type_statement.py:62: error: All type parameters should be declared ("V" not declared) +aliases_type_statement.py:67: error: All type parameters should be declared ("T1" not declared) +aliases_type_statement.py:77: error: Type argument "str" of "RecursiveTypeAlias2" must be a subtype of "int" +aliases_type_statement.py:79: error: Type argument "int" of "RecursiveTypeAlias2" must be a subtype of "str" +aliases_type_statement.py:82: error: Invalid recursive alias: a union item of itself +aliases_type_statement.py:84: error: Invalid recursive alias: a union item of itself +aliases_type_statement.py:88: error: Invalid recursive alias: a union item of itself +""" diff --git a/conformance/results/zuban/aliases_typealiastype.toml b/conformance/results/zuban/aliases_typealiastype.toml new file mode 100644 index 000000000..99edcc60d --- /dev/null +++ b/conformance/results/zuban/aliases_typealiastype.toml @@ -0,0 +1,38 @@ +conformant = "Partial" +notes = """ +Incorrectly rejects the use of a class-scoped TypeVar in a TypeAliasType definition. +Incorrectly allows type_params= to be an arbitrary tuple. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 45: Expected 1 errors +Line 27: Unexpected errors ['aliases_typealiastype.py:27: error: Can\\'t use bound type variable "T" to define generic alias'] +""" +output = """ +aliases_typealiastype.py:27: error: Can't use bound type variable "T" to define generic alias +aliases_typealiastype.py:32: error: "TypeAliasType" has no attribute "other_attrib" +aliases_typealiastype.py:40: error: Type argument "int" of "GoodAlias5" must be a subtype of "str" +aliases_typealiastype.py:43: error: All type parameters should be declared ("S" not declared) +aliases_typealiastype.py:44: error: All type parameters should be declared ("S" not declared) +aliases_typealiastype.py:46: error: Invalid recursive alias: a union item of itself +aliases_typealiastype.py:47: error: Invalid recursive alias: a union item of itself +aliases_typealiastype.py:48: error: Variable "aliases_typealiastype.BadAlias7" is not valid as a type +aliases_typealiastype.py:48: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +aliases_typealiastype.py:52: error: Invalid type alias: expression is not a valid type +aliases_typealiastype.py:53: error: Bracketed expression "[...]" is not valid as a type +aliases_typealiastype.py:53: note: Did you mean "List[...]"? +aliases_typealiastype.py:54: error: Syntax error in type annotation +aliases_typealiastype.py:54: note: Suggestion: Is there a spurious trailing comma? +aliases_typealiastype.py:55: error: Invalid type alias: expression is not a valid type +aliases_typealiastype.py:56: error: Invalid type alias: expression is not a valid type +aliases_typealiastype.py:57: error: Invalid type alias: expression is not a valid type +aliases_typealiastype.py:58: error: Invalid type alias: expression is not a valid type +aliases_typealiastype.py:59: error: Invalid type alias: expression is not a valid type +aliases_typealiastype.py:60: error: Variable "aliases_typealiastype.var1" is not valid as a type +aliases_typealiastype.py:60: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +aliases_typealiastype.py:61: error: Invalid type alias: expression is not a valid type +aliases_typealiastype.py:62: error: Invalid type: try using Literal[1] instead? +aliases_typealiastype.py:63: error: Invalid type alias: expression is not a valid type +aliases_typealiastype.py:64: error: Invalid type alias: expression is not a valid type +aliases_typealiastype.py:66: error: Name "BadAlias21" is used before definition +""" diff --git a/conformance/results/zuban/aliases_variance.toml b/conformance/results/zuban/aliases_variance.toml new file mode 100644 index 000000000..461ba7dcc --- /dev/null +++ b/conformance/results/zuban/aliases_variance.toml @@ -0,0 +1,9 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +aliases_variance.py:24: error: Variance of TypeVar "T_co" incompatible with variance in parent type +aliases_variance.py:28: error: Variance of TypeVar "T_co" incompatible with variance in parent type +aliases_variance.py:32: error: Variance of TypeVar "T_co" incompatible with variance in parent type +aliases_variance.py:44: error: Variance of TypeVar "T_contra" incompatible with variance in parent type +""" diff --git a/conformance/results/zuban/annotations_coroutines.toml b/conformance/results/zuban/annotations_coroutines.toml new file mode 100644 index 000000000..cdd4d0cd9 --- /dev/null +++ b/conformance/results/zuban/annotations_coroutines.toml @@ -0,0 +1,5 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +""" diff --git a/conformance/results/zuban/annotations_forward_refs.toml b/conformance/results/zuban/annotations_forward_refs.toml new file mode 100644 index 000000000..8fcc15164 --- /dev/null +++ b/conformance/results/zuban/annotations_forward_refs.toml @@ -0,0 +1,52 @@ +conformant = "Partial" +notes = """ +Does not report error for a forward reference that is not enclosed in quotes. +Incorrectly generates error for quoted type defined in class scope. +Does not ignore newlines in multi-line unions +""" +conformance_automated = "Fail" +errors_diff = """ +Line 22: Expected 1 errors +Line 23: Expected 1 errors +Line 24: Expected 1 errors +Line 25: Expected 1 errors +Line 66: Expected 1 errors +Line 82: Unexpected errors ['annotations_forward_refs.py:82: error: Name "str" is not defined'] +Line 87: Unexpected errors ['annotations_forward_refs.py:87: error: Function "annotations_forward_refs.ClassD.int" is not valid as a type'] +Line 95: Unexpected errors ['annotations_forward_refs.py:95: error: Expression is of type "Any", not "str"'] +Line 96: Unexpected errors ['annotations_forward_refs.py:96: error: Expression is of type "Any", not "int"'] +Line 104: Unexpected errors ['annotations_forward_refs.py:104: error: invalid syntax'] +Line 105: Unexpected errors ['annotations_forward_refs.py:105: error: invalid syntax', 'annotations_forward_refs.py:105: error: invalid syntax'] +""" +output = """ +annotations_forward_refs.py:41: error: Invalid type comment or annotation +annotations_forward_refs.py:42: error: Bracketed expression "[...]" is not valid as a type +annotations_forward_refs.py:42: note: Did you mean "List[...]"? +annotations_forward_refs.py:43: error: Syntax error in type annotation +annotations_forward_refs.py:43: note: Suggestion: Use Tuple[T1, ..., Tn] instead of (T1, ..., Tn) +annotations_forward_refs.py:44: error: Invalid type comment or annotation +annotations_forward_refs.py:45: error: Invalid type comment or annotation +annotations_forward_refs.py:46: error: Invalid type comment or annotation +annotations_forward_refs.py:47: error: Invalid type comment or annotation +annotations_forward_refs.py:48: error: Invalid type comment or annotation +annotations_forward_refs.py:49: error: Variable "annotations_forward_refs.var1" is not valid as a type +annotations_forward_refs.py:49: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +annotations_forward_refs.py:50: error: Invalid type comment or annotation +annotations_forward_refs.py:51: error: Invalid type: try using Literal[1] instead? +annotations_forward_refs.py:52: error: Invalid type comment or annotation +annotations_forward_refs.py:53: error: Invalid type comment or annotation +annotations_forward_refs.py:54: error: Invalid type comment or annotation +annotations_forward_refs.py:55: error: Module "types" is not valid as a type +annotations_forward_refs.py:55: note: Perhaps you meant to use a protocol matching the module structure? +annotations_forward_refs.py:80: error: Name "ClassF" is not defined +annotations_forward_refs.py:82: error: Name "str" is not defined +annotations_forward_refs.py:87: error: Function "annotations_forward_refs.ClassD.int" is not valid as a type +annotations_forward_refs.py:87: note: Perhaps you need "Callable[...]" or a callback protocol? +annotations_forward_refs.py:89: error: Function "annotations_forward_refs.ClassD.int" is not valid as a type +annotations_forward_refs.py:89: note: Perhaps you need "Callable[...]" or a callback protocol? +annotations_forward_refs.py:95: error: Expression is of type "Any", not "str" +annotations_forward_refs.py:96: error: Expression is of type "Any", not "int" +annotations_forward_refs.py:104: error: invalid syntax +annotations_forward_refs.py:105: error: invalid syntax +annotations_forward_refs.py:105: error: invalid syntax +""" diff --git a/conformance/results/zuban/annotations_generators.toml b/conformance/results/zuban/annotations_generators.toml new file mode 100644 index 000000000..fa4ba7567 --- /dev/null +++ b/conformance/results/zuban/annotations_generators.toml @@ -0,0 +1,16 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +annotations_generators.py:51: error: Missing return statement +annotations_generators.py:54: error: Incompatible return value type (got "bool", expected "C") +annotations_generators.py:57: error: Incompatible types in "yield" (actual type "int", expected type "A") +annotations_generators.py:66: error: Incompatible types in "yield" (actual type "int", expected type "A") +annotations_generators.py:71: error: No return value expected +annotations_generators.py:75: error: Incompatible types in "yield" (actual type "B", expected type "A") +annotations_generators.py:86: error: The return type of a generator function should be "Generator" or one of its supertypes +annotations_generators.py:91: error: The return type of an async generator function should be "AsyncGenerator" or one of its supertypes +annotations_generators.py:118: error: Incompatible types in "yield from" (actual type "A", expected type "B") +annotations_generators.py:119: error: Incompatible types in "yield from" (actual type "int", expected type "B") +annotations_generators.py:135: error: Incompatible send types in yield from (actual type "int", expected type "str") +""" diff --git a/conformance/results/zuban/annotations_methods.toml b/conformance/results/zuban/annotations_methods.toml new file mode 100644 index 000000000..bd95236e4 --- /dev/null +++ b/conformance/results/zuban/annotations_methods.toml @@ -0,0 +1,6 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +annotations_methods.py:42: error: Expression is of type "B", not "A" +""" diff --git a/conformance/results/zuban/annotations_typeexpr.toml b/conformance/results/zuban/annotations_typeexpr.toml new file mode 100644 index 000000000..3ac4eea14 --- /dev/null +++ b/conformance/results/zuban/annotations_typeexpr.toml @@ -0,0 +1,24 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +annotations_typeexpr.py:88: error: Invalid type comment or annotation +annotations_typeexpr.py:89: error: Bracketed expression "[...]" is not valid as a type +annotations_typeexpr.py:89: note: Did you mean "List[...]"? +annotations_typeexpr.py:90: error: Syntax error in type annotation +annotations_typeexpr.py:90: note: Suggestion: Use Tuple[T1, ..., Tn] instead of (T1, ..., Tn) +annotations_typeexpr.py:91: error: Invalid type comment or annotation +annotations_typeexpr.py:92: error: Invalid type comment or annotation +annotations_typeexpr.py:93: error: Invalid type comment or annotation +annotations_typeexpr.py:94: error: Invalid type comment or annotation +annotations_typeexpr.py:95: error: Invalid type comment or annotation +annotations_typeexpr.py:96: error: Variable "annotations_typeexpr.var1" is not valid as a type +annotations_typeexpr.py:96: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +annotations_typeexpr.py:97: error: Invalid type comment or annotation +annotations_typeexpr.py:98: error: Invalid type: try using Literal[1] instead? +annotations_typeexpr.py:99: error: Invalid type comment or annotation +annotations_typeexpr.py:100: error: Invalid type comment or annotation +annotations_typeexpr.py:101: error: Invalid type comment or annotation +annotations_typeexpr.py:102: error: Module "types" is not valid as a type +annotations_typeexpr.py:102: note: Perhaps you meant to use a protocol matching the module structure? +""" diff --git a/conformance/results/zuban/callables_annotation.toml b/conformance/results/zuban/callables_annotation.toml new file mode 100644 index 000000000..5f7ccb0f9 --- /dev/null +++ b/conformance/results/zuban/callables_annotation.toml @@ -0,0 +1,36 @@ +conformant = "Partial" +notes = """ +Incorrectly treats "*args: T, **kwargs: T" as "..." when T is specialized to Any. +Does not treat "*args: Any, **kargs: Any" as "..." when separated by keyword parameter. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 159: Expected 1 errors +Line 157: Unexpected errors ['callables_annotation.py:157: error: Incompatible types in assignment (expression has type "Proto7", variable has type "Proto6")'] +""" +output = """ +callables_annotation.py:25: error: Too few arguments +callables_annotation.py:26: error: Argument 2 has incompatible type "int"; expected "str" +callables_annotation.py:27: error: Too many arguments +callables_annotation.py:29: error: Unexpected keyword argument "a" +callables_annotation.py:29: error: Unexpected keyword argument "b" +callables_annotation.py:35: error: Too many arguments +callables_annotation.py:55: error: Please use "Callable[[], ]" or "Callable" +callables_annotation.py:56: error: The first argument to Callable must be a list of types, parameter specification, or "..." +callables_annotation.py:56: note: See https://mypy.readthedocs.io/en/stable/kinds_of_types.html#callable-types-and-lambdas +callables_annotation.py:57: error: Bracketed expression "[...]" is not valid as a type +callables_annotation.py:57: note: Did you mean "List[...]"? +callables_annotation.py:58: error: Please use "Callable[[], ]" or "Callable" +callables_annotation.py:59: error: Unexpected "..." +callables_annotation.py:91: error: Incompatible types in assignment (expression has type "Callable[[], str]", variable has type "Callable[[int, VarArg(Any), KwArg(Any)], str]") +callables_annotation.py:93: error: Incompatible types in assignment (expression has type "Callable[[NamedArg(int, 'a')], str]", variable has type "Callable[[int, VarArg(Any), KwArg(Any)], str]") +callables_annotation.py:157: error: Incompatible types in assignment (expression has type "Proto7", variable has type "Proto6") +callables_annotation.py:157: note: Following member(s) of "Proto7" have conflicts: +callables_annotation.py:157: note: Expected: +callables_annotation.py:157: note: def __call__(self, int, /, *args: Any, k: str, **kwargs: Any) -> None +callables_annotation.py:157: note: Got: +callables_annotation.py:157: note: def __call__(self, float, /, b: int, *, k: str, m: str) -> None +callables_annotation.py:172: error: Incompatible types in assignment (expression has type "Callable[[], str]", variable has type "Callable[[int, VarArg(Any), KwArg(Any)], str]") +callables_annotation.py:187: error: Incompatible types in assignment (expression has type "Callable[[int, str], str]", variable has type "Callable[[str, VarArg(Any), KwArg(Any)], str]") +callables_annotation.py:189: error: Incompatible types in assignment (expression has type "Callable[[int, str], str]", variable has type "Callable[[str, VarArg(Any), KwArg(Any)], str]") +""" diff --git a/conformance/results/zuban/callables_kwargs.toml b/conformance/results/zuban/callables_kwargs.toml new file mode 100644 index 000000000..4e3308105 --- /dev/null +++ b/conformance/results/zuban/callables_kwargs.toml @@ -0,0 +1,23 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +callables_kwargs.py:46: error: Missing named argument "v1" for "func1" +callables_kwargs.py:46: error: Missing named argument "v3" for "func1" +callables_kwargs.py:51: error: Unexpected keyword argument "v4" for "func1" +callables_kwargs.py:52: error: Too many positional arguments for "func1" +callables_kwargs.py:58: error: Argument 1 to "func1" has incompatible type "**dict[str, str]"; expected "int" +callables_kwargs.py:61: error: Argument 1 to "func1" has incompatible type "**dict[str, int | str]"; expected "int" +callables_kwargs.py:61: error: Argument 1 to "func1" has incompatible type "**dict[str, int | str]"; expected "str" +callables_kwargs.py:61: error: Argument 1 to "func1" has incompatible type "**dict[str, int | str]"; expected "str" +callables_kwargs.py:63: error: "func1" gets multiple values for keyword argument "v1" +callables_kwargs.py:64: error: Argument 1 to "func2" has incompatible type "int"; expected "str" +callables_kwargs.py:64: error: "func2" gets multiple values for keyword argument "v3" +callables_kwargs.py:65: error: "func2" gets multiple values for keyword argument "v1" +callables_kwargs.py:101: error: Incompatible types in assignment (expression has type "Callable[[**Unpack[TD2]], None]", variable has type "TDProtocol3") +callables_kwargs.py:102: error: Incompatible types in assignment (expression has type "Callable[[**Unpack[TD2]], None]", variable has type "TDProtocol4") +callables_kwargs.py:103: error: Incompatible types in assignment (expression has type "Callable[[**Unpack[TD2]], None]", variable has type "TDProtocol5") +callables_kwargs.py:111: error: Overlap between argument names and ** TypedDict items: "v1" +callables_kwargs.py:122: error: Unpack item in ** argument must be a TypedDict +callables_kwargs.py:134: error: Incompatible types in assignment (expression has type "Callable[[NamedArg(int, 'v1'), NamedArg(str, 'v3'), DefaultNamedArg(str, 'v2')], None]", variable has type "TDProtocol6") +""" diff --git a/conformance/results/zuban/callables_protocol.toml b/conformance/results/zuban/callables_protocol.toml new file mode 100644 index 000000000..dad94dc56 --- /dev/null +++ b/conformance/results/zuban/callables_protocol.toml @@ -0,0 +1,24 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +callables_protocol.py:35: error: Incompatible types in assignment (expression has type "Callable[[VarArg(bytes), NamedArg(int | None, 'max_items')], list[bytes]]", variable has type "Proto1") +callables_protocol.py:36: error: Incompatible types in assignment (expression has type "Callable[[VarArg(bytes)], list[bytes]]", variable has type "Proto1") +callables_protocol.py:37: error: Incompatible types in assignment (expression has type "Callable[[VarArg(bytes), NamedArg(str | None, 'max_len')], list[bytes]]", variable has type "Proto1") +callables_protocol.py:67: error: Incompatible types in assignment (expression has type "Callable[[VarArg(bytes)], None]", variable has type "Proto2") +callables_protocol.py:68: error: Incompatible types in assignment (expression has type "Callable[[VarArg(str), KwArg(str)], None]", variable has type "Proto2") +callables_protocol.py:69: error: Incompatible types in assignment (expression has type "Callable[[VarArg(bytes), KwArg(bytes)], None]", variable has type "Proto2") +callables_protocol.py:70: error: Incompatible types in assignment (expression has type "Callable[[KwArg(str)], None]", variable has type "Proto2") +callables_protocol.py:97: error: Incompatible types in assignment (expression has type "Callable[[int], None]", variable has type "Proto4") +callables_protocol.py:97: note: "Callable[[int], None]" is missing following "Proto4" protocol member: +callables_protocol.py:97: note: other_attribute +callables_protocol.py:121: error: Incompatible types in assignment (expression has type "Callable[[VarArg(bytes), DefaultNamedArg(int | None, 'max_len')], list[bytes]]", variable has type "NotProto6") +callables_protocol.py:169: error: Incompatible types in assignment (expression has type "Callable[[int], Any]", variable has type "Proto8") +callables_protocol.py:186: error: Incompatible types in assignment (expression has type "str", variable has type "int") +callables_protocol.py:187: error: "Proto9[P, R]" has no attribute "xxx" +callables_protocol.py:197: error: "Proto9[[x: int], str]" has no attribute "other_attribute2" +callables_protocol.py:238: error: Incompatible types in assignment (expression has type "Callable[[int, str], Any]", variable has type "Proto11") +callables_protocol.py:260: error: Incompatible types in assignment (expression has type "Callable[[VarArg(Any), NamedArg(Any, 'kwarg0')], None]", variable has type "Proto12") +callables_protocol.py:284: error: Incompatible types in assignment (expression has type "Callable[[str], str]", variable has type "Proto13_Default") +callables_protocol.py:311: error: Incompatible types in assignment (expression has type "Callable[[NamedArg(str, 'path')], str]", variable has type "Proto14_Default") +""" diff --git a/conformance/results/zuban/callables_subtyping.toml b/conformance/results/zuban/callables_subtyping.toml new file mode 100644 index 000000000..ff4f95664 --- /dev/null +++ b/conformance/results/zuban/callables_subtyping.toml @@ -0,0 +1,187 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +callables_subtyping.py:26: error: Incompatible types in assignment (expression has type "Callable[[int], int]", variable has type "Callable[[float], float]") +callables_subtyping.py:29: error: Incompatible types in assignment (expression has type "Callable[[float], float]", variable has type "Callable[[int], int]") +callables_subtyping.py:51: error: Incompatible types in assignment (expression has type "PosOnly2", variable has type "Standard2") +callables_subtyping.py:51: note: Following member(s) of "PosOnly2" have conflicts: +callables_subtyping.py:51: note: Expected: +callables_subtyping.py:51: note: def __call__(self, a: int, b: int) -> None +callables_subtyping.py:51: note: Got: +callables_subtyping.py:51: note: def __call__(self, int, int, /) -> None +callables_subtyping.py:52: error: Incompatible types in assignment (expression has type "KwOnly2", variable has type "Standard2") +callables_subtyping.py:52: note: Following member(s) of "KwOnly2" have conflicts: +callables_subtyping.py:52: note: Expected: +callables_subtyping.py:52: note: def __call__(self, a: int, b: int) -> None +callables_subtyping.py:52: note: Got: +callables_subtyping.py:52: note: def __call__(self, *, b: int, a: int) -> None +callables_subtyping.py:55: error: Incompatible types in assignment (expression has type "KwOnly2", variable has type "PosOnly2") +callables_subtyping.py:55: note: Following member(s) of "KwOnly2" have conflicts: +callables_subtyping.py:55: note: Expected: +callables_subtyping.py:55: note: def __call__(self, int, int, /) -> None +callables_subtyping.py:55: note: Got: +callables_subtyping.py:55: note: def __call__(self, *, b: int, a: int) -> None +callables_subtyping.py:58: error: Incompatible types in assignment (expression has type "PosOnly2", variable has type "KwOnly2") +callables_subtyping.py:58: note: Following member(s) of "PosOnly2" have conflicts: +callables_subtyping.py:58: note: Expected: +callables_subtyping.py:58: note: def __call__(self, *, b: int, a: int) -> None +callables_subtyping.py:58: note: Got: +callables_subtyping.py:58: note: def __call__(self, int, int, /) -> None +callables_subtyping.py:82: error: Incompatible types in assignment (expression has type "NoArgs3", variable has type "IntArgs3") +callables_subtyping.py:82: note: Following member(s) of "NoArgs3" have conflicts: +callables_subtyping.py:82: note: Expected: +callables_subtyping.py:82: note: def __call__(self, *args: int) -> None +callables_subtyping.py:82: note: Got: +callables_subtyping.py:82: note: def __call__(self) -> None +callables_subtyping.py:85: error: Incompatible types in assignment (expression has type "NoArgs3", variable has type "FloatArgs3") +callables_subtyping.py:85: note: Following member(s) of "NoArgs3" have conflicts: +callables_subtyping.py:85: note: Expected: +callables_subtyping.py:85: note: def __call__(self, *args: float) -> None +callables_subtyping.py:85: note: Got: +callables_subtyping.py:85: note: def __call__(self) -> None +callables_subtyping.py:86: error: Incompatible types in assignment (expression has type "IntArgs3", variable has type "FloatArgs3") +callables_subtyping.py:86: note: Following member(s) of "IntArgs3" have conflicts: +callables_subtyping.py:86: note: Expected: +callables_subtyping.py:86: note: def __call__(self, *args: float) -> None +callables_subtyping.py:86: note: Got: +callables_subtyping.py:86: note: def __call__(self, *args: int) -> None +callables_subtyping.py:116: error: Incompatible types in assignment (expression has type "IntArgs4", variable has type "PosOnly4") +callables_subtyping.py:116: note: Following member(s) of "IntArgs4" have conflicts: +callables_subtyping.py:116: note: Expected: +callables_subtyping.py:116: note: def __call__(self, int, str, /) -> None +callables_subtyping.py:116: note: Got: +callables_subtyping.py:116: note: def __call__(self, *args: int) -> None +callables_subtyping.py:119: error: Incompatible types in assignment (expression has type "StrArgs4", variable has type "IntStrArgs4") +callables_subtyping.py:119: note: Following member(s) of "StrArgs4" have conflicts: +callables_subtyping.py:119: note: Expected: +callables_subtyping.py:119: note: def __call__(self, *args: int | str) -> None +callables_subtyping.py:119: note: Got: +callables_subtyping.py:119: note: def __call__(self, int, /, *args: str) -> None +callables_subtyping.py:120: error: Incompatible types in assignment (expression has type "IntArgs4", variable has type "IntStrArgs4") +callables_subtyping.py:120: note: Following member(s) of "IntArgs4" have conflicts: +callables_subtyping.py:120: note: Expected: +callables_subtyping.py:120: note: def __call__(self, *args: int | str) -> None +callables_subtyping.py:120: note: Got: +callables_subtyping.py:120: note: def __call__(self, *args: int) -> None +callables_subtyping.py:122: error: Incompatible types in assignment (expression has type "IntArgs4", variable has type "StrArgs4") +callables_subtyping.py:122: note: Following member(s) of "IntArgs4" have conflicts: +callables_subtyping.py:122: note: Expected: +callables_subtyping.py:122: note: def __call__(self, int, /, *args: str) -> None +callables_subtyping.py:122: note: Got: +callables_subtyping.py:122: note: def __call__(self, *args: int) -> None +callables_subtyping.py:124: error: Incompatible types in assignment (expression has type "StrArgs4", variable has type "IntArgs4") +callables_subtyping.py:124: note: Following member(s) of "StrArgs4" have conflicts: +callables_subtyping.py:124: note: Expected: +callables_subtyping.py:124: note: def __call__(self, *args: int) -> None +callables_subtyping.py:124: note: Got: +callables_subtyping.py:124: note: def __call__(self, int, /, *args: str) -> None +callables_subtyping.py:125: error: Incompatible types in assignment (expression has type "IntStrArgs4", variable has type "Standard4") +callables_subtyping.py:125: note: Following member(s) of "IntStrArgs4" have conflicts: +callables_subtyping.py:125: note: Expected: +callables_subtyping.py:125: note: def __call__(self, a: int, b: str) -> None +callables_subtyping.py:125: note: Got: +callables_subtyping.py:125: note: def __call__(self, *args: int | str) -> None +callables_subtyping.py:126: error: Incompatible types in assignment (expression has type "StrArgs4", variable has type "Standard4") +callables_subtyping.py:126: note: Following member(s) of "StrArgs4" have conflicts: +callables_subtyping.py:126: note: Expected: +callables_subtyping.py:126: note: def __call__(self, a: int, b: str) -> None +callables_subtyping.py:126: note: Got: +callables_subtyping.py:126: note: def __call__(self, int, /, *args: str) -> None +callables_subtyping.py:151: error: Incompatible types in assignment (expression has type "NoKwargs5", variable has type "IntKwargs5") +callables_subtyping.py:151: note: Following member(s) of "NoKwargs5" have conflicts: +callables_subtyping.py:151: note: Expected: +callables_subtyping.py:151: note: def __call__(self, **kwargs: int) -> None +callables_subtyping.py:151: note: Got: +callables_subtyping.py:151: note: def __call__(self) -> None +callables_subtyping.py:154: error: Incompatible types in assignment (expression has type "NoKwargs5", variable has type "FloatKwargs5") +callables_subtyping.py:154: note: Following member(s) of "NoKwargs5" have conflicts: +callables_subtyping.py:154: note: Expected: +callables_subtyping.py:154: note: def __call__(self, **kwargs: float) -> None +callables_subtyping.py:154: note: Got: +callables_subtyping.py:154: note: def __call__(self) -> None +callables_subtyping.py:155: error: Incompatible types in assignment (expression has type "IntKwargs5", variable has type "FloatKwargs5") +callables_subtyping.py:155: note: Following member(s) of "IntKwargs5" have conflicts: +callables_subtyping.py:155: note: Expected: +callables_subtyping.py:155: note: def __call__(self, **kwargs: float) -> None +callables_subtyping.py:155: note: Got: +callables_subtyping.py:155: note: def __call__(self, **kwargs: int) -> None +callables_subtyping.py:187: error: Incompatible types in assignment (expression has type "IntKwargs6", variable has type "KwOnly6") +callables_subtyping.py:187: note: Following member(s) of "IntKwargs6" have conflicts: +callables_subtyping.py:187: note: Expected: +callables_subtyping.py:187: note: def __call__(self, *, a: int, b: str) -> None +callables_subtyping.py:187: note: Got: +callables_subtyping.py:187: note: def __call__(self, **kwargs: int) -> None +callables_subtyping.py:190: error: Incompatible types in assignment (expression has type "StrKwargs6", variable has type "IntStrKwargs6") +callables_subtyping.py:190: note: Following member(s) of "StrKwargs6" have conflicts: +callables_subtyping.py:190: note: Expected: +callables_subtyping.py:190: note: def __call__(self, **kwargs: int | str) -> None +callables_subtyping.py:190: note: Got: +callables_subtyping.py:190: note: def __call__(self, *, a: int, **kwargs: str) -> None +callables_subtyping.py:191: error: Incompatible types in assignment (expression has type "IntKwargs6", variable has type "IntStrKwargs6") +callables_subtyping.py:191: note: Following member(s) of "IntKwargs6" have conflicts: +callables_subtyping.py:191: note: Expected: +callables_subtyping.py:191: note: def __call__(self, **kwargs: int | str) -> None +callables_subtyping.py:191: note: Got: +callables_subtyping.py:191: note: def __call__(self, **kwargs: int) -> None +callables_subtyping.py:193: error: Incompatible types in assignment (expression has type "IntKwargs6", variable has type "StrKwargs6") +callables_subtyping.py:193: note: Following member(s) of "IntKwargs6" have conflicts: +callables_subtyping.py:193: note: Expected: +callables_subtyping.py:193: note: def __call__(self, *, a: int, **kwargs: str) -> None +callables_subtyping.py:193: note: Got: +callables_subtyping.py:193: note: def __call__(self, **kwargs: int) -> None +callables_subtyping.py:195: error: Incompatible types in assignment (expression has type "StrKwargs6", variable has type "IntKwargs6") +callables_subtyping.py:195: note: Following member(s) of "StrKwargs6" have conflicts: +callables_subtyping.py:195: note: Expected: +callables_subtyping.py:195: note: def __call__(self, **kwargs: int) -> None +callables_subtyping.py:195: note: Got: +callables_subtyping.py:195: note: def __call__(self, *, a: int, **kwargs: str) -> None +callables_subtyping.py:196: error: Incompatible types in assignment (expression has type "IntStrKwargs6", variable has type "Standard6") +callables_subtyping.py:196: note: Following member(s) of "IntStrKwargs6" have conflicts: +callables_subtyping.py:196: note: Expected: +callables_subtyping.py:196: note: def __call__(self, a: int, b: str) -> None +callables_subtyping.py:196: note: Got: +callables_subtyping.py:196: note: def __call__(self, **kwargs: int | str) -> None +callables_subtyping.py:197: error: Incompatible types in assignment (expression has type "StrKwargs6", variable has type "Standard6") +callables_subtyping.py:197: note: Following member(s) of "StrKwargs6" have conflicts: +callables_subtyping.py:197: note: Expected: +callables_subtyping.py:197: note: def __call__(self, a: int, b: str) -> None +callables_subtyping.py:197: note: Got: +callables_subtyping.py:197: note: def __call__(self, *, a: int, **kwargs: str) -> None +callables_subtyping.py:236: error: Incompatible types in assignment (expression has type "NoDefaultArg8", variable has type "DefaultArg8") +callables_subtyping.py:236: note: Following member(s) of "NoDefaultArg8" have conflicts: +callables_subtyping.py:236: note: Expected: +callables_subtyping.py:236: note: def __call__(self, x: int = ...) -> None +callables_subtyping.py:236: note: Got: +callables_subtyping.py:236: note: def __call__(self, x: int) -> None +callables_subtyping.py:237: error: Incompatible types in assignment (expression has type "NoX8", variable has type "DefaultArg8") +callables_subtyping.py:237: note: Following member(s) of "NoX8" have conflicts: +callables_subtyping.py:237: note: Expected: +callables_subtyping.py:237: note: def __call__(self, x: int = ...) -> None +callables_subtyping.py:237: note: Got: +callables_subtyping.py:237: note: def __call__(self) -> None +callables_subtyping.py:240: error: Incompatible types in assignment (expression has type "NoX8", variable has type "NoDefaultArg8") +callables_subtyping.py:240: note: Following member(s) of "NoX8" have conflicts: +callables_subtyping.py:240: note: Expected: +callables_subtyping.py:240: note: def __call__(self, x: int) -> None +callables_subtyping.py:240: note: Got: +callables_subtyping.py:240: note: def __call__(self) -> None +callables_subtyping.py:243: error: Incompatible types in assignment (expression has type "NoDefaultArg8", variable has type "NoX8") +callables_subtyping.py:243: note: Following member(s) of "NoDefaultArg8" have conflicts: +callables_subtyping.py:243: note: Expected: +callables_subtyping.py:243: note: def __call__(self) -> None +callables_subtyping.py:243: note: Got: +callables_subtyping.py:243: note: def __call__(self, x: int) -> None +callables_subtyping.py:273: error: Incompatible types in assignment (expression has type "Overloaded9", variable has type "FloatArg9") +callables_subtyping.py:273: note: Following member(s) of "Overloaded9" have conflicts: +callables_subtyping.py:273: note: Expected: +callables_subtyping.py:273: note: def __call__(self: FloatArg9, x: float) -> float +callables_subtyping.py:273: note: Got: +callables_subtyping.py:273: note: def __call__(*args: Any, **kwds: Any) -> Any +callables_subtyping.py:297: error: Incompatible types in assignment (expression has type "StrArg10", variable has type "Overloaded10") +callables_subtyping.py:297: note: Following member(s) of "StrArg10" have conflicts: +callables_subtyping.py:297: note: Expected: +callables_subtyping.py:297: note: def __call__(*args: Any, **kwds: Any) -> Any +callables_subtyping.py:297: note: Got: +callables_subtyping.py:297: note: def __call__(self: StrArg10, x: str) -> complex +""" diff --git a/conformance/results/zuban/classes_classvar.toml b/conformance/results/zuban/classes_classvar.toml new file mode 100644 index 000000000..88e7b0a93 --- /dev/null +++ b/conformance/results/zuban/classes_classvar.toml @@ -0,0 +1,27 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +classes_classvar.py:38: error: ClassVar[...] must have at most one type argument +classes_classvar.py:39: error: Invalid type: try using Literal[3] instead? +classes_classvar.py:40: error: Name "var" is not defined +classes_classvar.py:45: error: ClassVar cannot contain type variables +classes_classvar.py:46: error: ClassVar cannot contain type variables +classes_classvar.py:47: error: ClassVar cannot contain type variables +classes_classvar.py:52: error: Incompatible types in assignment (expression has type "dict[Never, Never]", variable has type "list[str]") +classes_classvar.py:54: error: Variable should not be annotated with both ClassVar and Final +classes_classvar.py:55: error: Invalid Type: ClassVar nested inside other type +classes_classvar.py:66: error: Type in ClassVar[...] can only be omitted if there is an initializer +classes_classvar.py:69: error: ClassVar can only be used for assignments in class body +classes_classvar.py:70: error: ClassVar can only be used for assignments in class body +classes_classvar.py:71: error: ClassVar can only be used for assignments in class body +classes_classvar.py:73: error: ClassVar can only be used for assignments in class body +classes_classvar.py:77: error: ClassVar can only be used for assignments in class body +classes_classvar.py:78: error: ClassVar can only be used for assignments in class body +classes_classvar.py:111: error: Cannot assign to class variable "stats" via instance +classes_classvar.py:140: error: Incompatible types in assignment (expression has type "ProtoAImpl", variable has type "ProtoA") +classes_classvar.py:140: note: Protocol member ProtoA.x expected class variable, got instance variable +classes_classvar.py:140: note: Protocol member ProtoA.y expected class variable, got instance variable +classes_classvar.py:140: note: "ProtoAImpl" is missing following "ProtoA" protocol member: +classes_classvar.py:140: note: z +""" diff --git a/conformance/results/zuban/classes_override.toml b/conformance/results/zuban/classes_override.toml new file mode 100644 index 000000000..cd420c0b1 --- /dev/null +++ b/conformance/results/zuban/classes_override.toml @@ -0,0 +1,10 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +classes_override.py:53: error: Method "method3" is marked as an override, but no base method was found with this name +classes_override.py:56: error: Method "method4" is marked as an override, but no base method was found with this name +classes_override.py:79: error: Method "static_method1" is marked as an override, but no base method was found with this name +classes_override.py:84: error: Method "class_method1" is marked as an override, but no base method was found with this name +classes_override.py:89: error: Method "property1" is marked as an override, but no base method was found with this name +""" diff --git a/conformance/results/zuban/constructors_call_init.toml b/conformance/results/zuban/constructors_call_init.toml new file mode 100644 index 000000000..1f5db5904 --- /dev/null +++ b/conformance/results/zuban/constructors_call_init.toml @@ -0,0 +1,15 @@ +conformant = "Partial" +notes = """ +Does not report errors during binding to self parameter of __init__ method. +Does not reject use of class-scoped type variables in annotation of self parameter in __init__ method. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 56: Expected 1 errors +Line 107: Expected 1 errors +""" +output = """ +constructors_call_init.py:21: error: Argument 1 to "Class1" has incompatible type "float"; expected "int" +constructors_call_init.py:42: error: Argument 1 to "Class3" has incompatible type "Class2[Never]"; expected "Self | None" +constructors_call_init.py:130: error: Too many arguments for "Class11" +""" diff --git a/conformance/results/zuban/constructors_call_metaclass.toml b/conformance/results/zuban/constructors_call_metaclass.toml new file mode 100644 index 000000000..87caf96ab --- /dev/null +++ b/conformance/results/zuban/constructors_call_metaclass.toml @@ -0,0 +1,18 @@ +conformant = "Unupported" +notes = """ +Does not honor metaclass __call__ method when evaluating constructor call. +Does not skip evaluation of __new__ and __init__ if custom metaclass call returns non-class. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 23: Unexpected errors ['constructors_call_metaclass.py:23: error: Expression is of type "Class1", not "Never"', 'constructors_call_metaclass.py:23: error: Missing positional argument "x" in call to "Class1"'] +Line 36: Unexpected errors ['constructors_call_metaclass.py:36: error: Expression is of type "Class2", not "int | Meta2"', 'constructors_call_metaclass.py:36: error: Missing positional argument "x" in call to "Class2"'] +""" +output = """ +constructors_call_metaclass.py:23: error: Expression is of type "Class1", not "Never" +constructors_call_metaclass.py:23: error: Missing positional argument "x" in call to "Class1" +constructors_call_metaclass.py:36: error: Expression is of type "Class2", not "int | Meta2" +constructors_call_metaclass.py:36: error: Missing positional argument "x" in call to "Class2" +constructors_call_metaclass.py:51: error: Missing positional argument "x" in call to "Class3" +constructors_call_metaclass.py:65: error: Missing positional argument "x" in call to "Class4" +""" diff --git a/conformance/results/zuban/constructors_call_new.toml b/conformance/results/zuban/constructors_call_new.toml new file mode 100644 index 000000000..22f9a6d9a --- /dev/null +++ b/conformance/results/zuban/constructors_call_new.toml @@ -0,0 +1,31 @@ +conformant = "Partial" +notes = """ +Does not support __new__ return type that is not a subclass of the class being constructed. +Does not skip evaluation of __init__ based on __new__ return type. +Does not report errors during binding to cls parameter of __new__ method. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 145: Expected 1 errors +Line 40: Unexpected errors ['constructors_call_new.py:40: error: Incompatible return type for "__new__" (returns "int", but must return a subtype of "Class3")'] +Line 49: Unexpected errors ['constructors_call_new.py:49: error: Expression is of type "Class3", not "int"', 'constructors_call_new.py:49: error: Missing positional argument "x" in call to "Class3"'] +Line 57: Unexpected errors ['constructors_call_new.py:57: error: "__new__" must return a class instance (got "Class4 | Any")'] +Line 64: Unexpected errors ['constructors_call_new.py:64: error: Expression is of type "Class4", not "Class4 | Any"', 'constructors_call_new.py:64: error: Missing positional argument "x" in call to "Class4"'] +Line 76: Unexpected errors ['constructors_call_new.py:76: error: Expression is of type "Class5", not "Never"', 'constructors_call_new.py:76: error: Missing positional argument "x" in call to "Class5"'] +Line 82: Unexpected errors ['constructors_call_new.py:82: error: "__new__" must return a class instance (got "int | Class6")'] +Line 89: Unexpected errors ['constructors_call_new.py:89: error: Expression is of type "Class6", not "int | Class6"', 'constructors_call_new.py:89: error: Missing positional argument "x" in call to "Class6"'] +""" +output = """ +constructors_call_new.py:21: error: Argument 1 to "Class1" has incompatible type "float"; expected "int" +constructors_call_new.py:40: error: Incompatible return type for "__new__" (returns "int", but must return a subtype of "Class3") +constructors_call_new.py:49: error: Expression is of type "Class3", not "int" +constructors_call_new.py:49: error: Missing positional argument "x" in call to "Class3" +constructors_call_new.py:57: error: "__new__" must return a class instance (got "Class4 | Any") +constructors_call_new.py:64: error: Expression is of type "Class4", not "Class4 | Any" +constructors_call_new.py:64: error: Missing positional argument "x" in call to "Class4" +constructors_call_new.py:76: error: Expression is of type "Class5", not "Never" +constructors_call_new.py:76: error: Missing positional argument "x" in call to "Class5" +constructors_call_new.py:82: error: "__new__" must return a class instance (got "int | Class6") +constructors_call_new.py:89: error: Expression is of type "Class6", not "int | Class6" +constructors_call_new.py:89: error: Missing positional argument "x" in call to "Class6" +""" diff --git a/conformance/results/zuban/constructors_call_type.toml b/conformance/results/zuban/constructors_call_type.toml new file mode 100644 index 000000000..27868a835 --- /dev/null +++ b/conformance/results/zuban/constructors_call_type.toml @@ -0,0 +1,17 @@ +conformant = "Partial" +notes = """ +Does not validate call to custom metaclass __call__ method through type[T]. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 30: Expected 1 errors +Line 72: Expected 1 errors +""" +output = """ +constructors_call_type.py:40: error: Missing positional arguments "x", "y" in call to "Class2" +constructors_call_type.py:50: error: Missing positional arguments "x", "y" in call to "Class3" +constructors_call_type.py:59: error: Too many arguments for "Class4" +constructors_call_type.py:64: error: Too many arguments for "object" +constructors_call_type.py:81: error: Missing positional argument "y" in call to "Class2" +constructors_call_type.py:82: error: Argument 2 to "Class2" has incompatible type "int"; expected "str" +""" diff --git a/conformance/results/zuban/constructors_callable.toml b/conformance/results/zuban/constructors_callable.toml new file mode 100644 index 000000000..2bbc76b36 --- /dev/null +++ b/conformance/results/zuban/constructors_callable.toml @@ -0,0 +1,59 @@ +conformant = "Partial" +notes = """ +Does not generate a union type for __new__ and __init__ when converting class to callable. +Does not ignore __init__ based on __new__ return type when converting class to callable. +Does not support __new__ return type that is different from class being constructed. +Struggles with some cases of self types +""" +conformance_automated = "Fail" +errors_diff = """ +Line 127: Expected 1 errors +Line 144: Expected 1 errors +Line 73: Unexpected errors ['constructors_callable.py:73: error: Incompatible return type for "__new__" (returns "int", but must return a subtype of "Class4")'] +Line 100: Unexpected errors ['constructors_callable.py:100: error: Expression is of type "Class5", not "Never"'] +Line 105: Unexpected errors ['constructors_callable.py:105: error: Expression is of type "Class5", not "Never"'] +Line 116: Unexpected errors ['constructors_callable.py:116: error: Incompatible return type for "__new__" (returns "Class6Proxy", but must return a subtype of "Class6")'] +Line 126: Unexpected errors ['constructors_callable.py:126: error: Expression is of type "Class6", not "Class6Proxy"', 'constructors_callable.py:126: error: Missing positional argument "x" in call'] +Line 143: Unexpected errors ['constructors_callable.py:143: error: Expression is of type "Class6Any", not "Any"', 'constructors_callable.py:143: error: Missing positional argument "x" in call'] +Line 160: Unexpected errors ['constructors_callable.py:160: error: Need type annotation for "r7"'] +Line 164: Unexpected errors ['constructors_callable.py:164: error: Expression is of type "Class7[Any]", not "Class7[int]"'] +Line 165: Unexpected errors ['constructors_callable.py:165: error: Expression is of type "Class7[Any]", not "Class7[str]"', 'constructors_callable.py:165: error: Argument 1 has incompatible type "str"; expected "int"'] +Line 194: Unexpected errors ['constructors_callable.py:194: error: List item 0 has incompatible type "str"; expected "T"', 'constructors_callable.py:194: error: List item 0 has incompatible type "str"; expected "T"'] +""" +output = """ +constructors_callable.py:36: note: Revealed type is "def (x: builtins.int) -> constructors_callable.Class1" +constructors_callable.py:38: error: Missing positional argument "x" in call +constructors_callable.py:39: error: Unexpected keyword argument "y" +constructors_callable.py:49: note: Revealed type is "def () -> constructors_callable.Class2" +constructors_callable.py:51: error: Too many arguments +constructors_callable.py:63: note: Revealed type is "def (x: builtins.int) -> constructors_callable.Class3" +constructors_callable.py:65: error: Missing positional argument "x" in call +constructors_callable.py:66: error: Unexpected keyword argument "y" +constructors_callable.py:67: error: Too many arguments +constructors_callable.py:73: error: Incompatible return type for "__new__" (returns "int", but must return a subtype of "Class4") +constructors_callable.py:77: note: Revealed type is "def (x: builtins.int) -> builtins.int" +constructors_callable.py:79: error: Missing positional argument "x" in call +constructors_callable.py:80: error: Unexpected keyword argument "y" +constructors_callable.py:97: note: Revealed type is "def (*args: Any, **kwargs: Any) -> constructors_callable.Class5" +constructors_callable.py:100: error: Expression is of type "Class5", not "Never" +constructors_callable.py:105: error: Expression is of type "Class5", not "Never" +constructors_callable.py:116: error: Incompatible return type for "__new__" (returns "Class6Proxy", but must return a subtype of "Class6") +constructors_callable.py:125: note: Revealed type is "def (x: builtins.int) -> constructors_callable.Class6" +constructors_callable.py:126: error: Expression is of type "Class6", not "Class6Proxy" +constructors_callable.py:126: error: Missing positional argument "x" in call +constructors_callable.py:142: note: Revealed type is "def (x: builtins.int) -> constructors_callable.Class6Any" +constructors_callable.py:143: error: Expression is of type "Class6Any", not "Any" +constructors_callable.py:143: error: Missing positional argument "x" in call +constructors_callable.py:160: error: Need type annotation for "r7" +constructors_callable.py:162: note: Revealed type is "def (x: builtins.int) -> constructors_callable.Class7[Any]" +constructors_callable.py:164: error: Expression is of type "Class7[Any]", not "Class7[int]" +constructors_callable.py:165: error: Expression is of type "Class7[Any]", not "Class7[str]" +constructors_callable.py:165: error: Argument 1 has incompatible type "str"; expected "int" +constructors_callable.py:182: note: Revealed type is "def [T] (x: builtins.list[T], y: builtins.list[T]) -> constructors_callable.Class8[T]" +constructors_callable.py:184: error: List item 0 has incompatible type "str"; expected "int" +constructors_callable.py:193: note: Revealed type is "def (x: builtins.list[T], y: builtins.list[T]) -> constructors_callable.Class9" +constructors_callable.py:194: error: List item 0 has incompatible type "str"; expected "T" +constructors_callable.py:194: error: List item 0 has incompatible type "str"; expected "T" +constructors_callable.py:195: error: List item 0 has incompatible type "int"; expected "T" +constructors_callable.py:195: error: List item 0 has incompatible type "str"; expected "T" +""" diff --git a/conformance/results/zuban/constructors_consistency.toml b/conformance/results/zuban/constructors_consistency.toml new file mode 100644 index 000000000..cdd4d0cd9 --- /dev/null +++ b/conformance/results/zuban/constructors_consistency.toml @@ -0,0 +1,5 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +""" diff --git a/conformance/results/zuban/dataclasses_descriptors.toml b/conformance/results/zuban/dataclasses_descriptors.toml new file mode 100644 index 000000000..cdd4d0cd9 --- /dev/null +++ b/conformance/results/zuban/dataclasses_descriptors.toml @@ -0,0 +1,5 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +""" diff --git a/conformance/results/zuban/dataclasses_final.toml b/conformance/results/zuban/dataclasses_final.toml new file mode 100644 index 000000000..637d07db2 --- /dev/null +++ b/conformance/results/zuban/dataclasses_final.toml @@ -0,0 +1,21 @@ +conformant = "Partial" +notes = """ +Wrongly requires a Final dataclass field to be initialized at class level. +Doesn't support Final nested inside ClassVar. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 27: Expected 1 errors +Line 16: Unexpected errors ['dataclasses_final.py:16: error: Final name must be initialized with a value'] +Line 18: Unexpected errors ['dataclasses_final.py:18: error: Final can be only used as an outermost qualifier in a variable annotation'] +Line 24: Unexpected errors ['dataclasses_final.py:24: error: Expression is of type "Any", not "int"'] +""" +output = """ +dataclasses_final.py:16: error: Final name must be initialized with a value +dataclasses_final.py:18: error: Final can be only used as an outermost qualifier in a variable annotation +dataclasses_final.py:24: error: Expression is of type "Any", not "int" +dataclasses_final.py:35: error: Cannot assign to final attribute "final_no_default" +dataclasses_final.py:36: error: Cannot assign to final attribute "final_with_default" +dataclasses_final.py:37: error: Cannot assign to final attribute "final_no_default" +dataclasses_final.py:38: error: Cannot assign to final attribute "final_with_default" +""" diff --git a/conformance/results/zuban/dataclasses_frozen.toml b/conformance/results/zuban/dataclasses_frozen.toml new file mode 100644 index 000000000..bd41573c9 --- /dev/null +++ b/conformance/results/zuban/dataclasses_frozen.toml @@ -0,0 +1,9 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +dataclasses_frozen.py:16: error: Property "a" defined in "DC1" is read-only +dataclasses_frozen.py:17: error: Property "b" defined in "DC1" is read-only +dataclasses_frozen.py:23: error: Non-frozen dataclass cannot inherit from a frozen dataclass +dataclasses_frozen.py:33: error: Frozen dataclass cannot inherit from a non-frozen dataclass +""" diff --git a/conformance/results/zuban/dataclasses_hash.toml b/conformance/results/zuban/dataclasses_hash.toml new file mode 100644 index 000000000..1e0314518 --- /dev/null +++ b/conformance/results/zuban/dataclasses_hash.toml @@ -0,0 +1,11 @@ +conformant = "Partial" +notes = """ +Does not report when dataclass is not compatible with Hashable protocol. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 15: Expected 1 errors +Line 32: Expected 1 errors +""" +output = """ +""" diff --git a/conformance/results/zuban/dataclasses_inheritance.toml b/conformance/results/zuban/dataclasses_inheritance.toml new file mode 100644 index 000000000..8ca154124 --- /dev/null +++ b/conformance/results/zuban/dataclasses_inheritance.toml @@ -0,0 +1,7 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +dataclasses_inheritance.py:62: error: Cannot override instance variable (previously declared on base class "DC6") with class variable +dataclasses_inheritance.py:66: error: Cannot override class variable (previously declared on base class "DC6") with instance variable +""" diff --git a/conformance/results/zuban/dataclasses_kwonly.toml b/conformance/results/zuban/dataclasses_kwonly.toml new file mode 100644 index 000000000..9037fe428 --- /dev/null +++ b/conformance/results/zuban/dataclasses_kwonly.toml @@ -0,0 +1,8 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +dataclasses_kwonly.py:23: error: Too many positional arguments for "DC1" +dataclasses_kwonly.py:38: error: Too many positional arguments for "DC2" +dataclasses_kwonly.py:53: error: Too many positional arguments for "DC3" +""" diff --git a/conformance/results/zuban/dataclasses_order.toml b/conformance/results/zuban/dataclasses_order.toml new file mode 100644 index 000000000..52acf1978 --- /dev/null +++ b/conformance/results/zuban/dataclasses_order.toml @@ -0,0 +1,6 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +dataclasses_order.py:50: error: Unsupported operand types for < ("DC1" and "DC2") +""" diff --git a/conformance/results/zuban/dataclasses_postinit.toml b/conformance/results/zuban/dataclasses_postinit.toml new file mode 100644 index 000000000..2f08fcabb --- /dev/null +++ b/conformance/results/zuban/dataclasses_postinit.toml @@ -0,0 +1,13 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +dataclasses_postinit.py:19: error: Argument 2 of "__post_init__" is incompatible with supertype "dataclass"; supertype defines the argument type as "str" +dataclasses_postinit.py:28: error: "DC1" has no attribute "x" +dataclasses_postinit.py:29: error: "DC1" has no attribute "y" +dataclasses_postinit.py:36: error: Signature of "__post_init__" incompatible with supertype "dataclass" +dataclasses_postinit.py:36: note: Superclass: +dataclasses_postinit.py:36: note: def __post_init__(self, x: int, y: str) -> None +dataclasses_postinit.py:36: note: Subclass: +dataclasses_postinit.py:36: note: def __post_init__(self, x: int) -> None +""" diff --git a/conformance/results/zuban/dataclasses_slots.toml b/conformance/results/zuban/dataclasses_slots.toml new file mode 100644 index 000000000..9c236711c --- /dev/null +++ b/conformance/results/zuban/dataclasses_slots.toml @@ -0,0 +1,14 @@ +conformant = "Partial" +notes = """ +Does not reject write to instance variable that is not defined in __slots__. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 25: Expected 1 errors +""" +output = """ +dataclasses_slots.py:11: error: "DC1" both defines "__slots__" and is used with "slots=True" +dataclasses_slots.py:38: error: Trying to assign name "y" that is not in "__slots__" of type "dataclasses_slots.DC3" +dataclasses_slots.py:66: error: "Type[DC6]" has no attribute "__slots__" +dataclasses_slots.py:69: error: "DC6" has no attribute "__slots__" +""" diff --git a/conformance/results/zuban/dataclasses_transform_class.toml b/conformance/results/zuban/dataclasses_transform_class.toml new file mode 100644 index 000000000..8aeb303ed --- /dev/null +++ b/conformance/results/zuban/dataclasses_transform_class.toml @@ -0,0 +1,11 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +dataclasses_transform_class.py:51: error: Non-frozen dataclass cannot inherit from a frozen dataclass +dataclasses_transform_class.py:63: error: Property "id" defined in "Customer1" is read-only +dataclasses_transform_class.py:66: error: Too many positional arguments for "Customer1" +dataclasses_transform_class.py:72: error: Unsupported left operand type for < ("Customer1") +dataclasses_transform_class.py:82: error: Too many positional arguments for "Customer2" +dataclasses_transform_class.py:122: error: Property "id" defined in "Customer3" is read-only +""" diff --git a/conformance/results/zuban/dataclasses_transform_converter.toml b/conformance/results/zuban/dataclasses_transform_converter.toml new file mode 100644 index 000000000..32952f2a8 --- /dev/null +++ b/conformance/results/zuban/dataclasses_transform_converter.toml @@ -0,0 +1,50 @@ +conformant = "Unsupported" +notes = """ +Converter parameter not yet supported. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 118: Expected 1 errors +Line 104: Unexpected errors ['dataclasses_transform_converter.py:104: error: Incompatible callable argument with type vars'] +Line 112: Unexpected errors ['dataclasses_transform_converter.py:112: error: Argument 1 to "DC2" has incompatible type "str"; expected "int"', 'dataclasses_transform_converter.py:112: error: Argument 2 to "DC2" has incompatible type "str"; expected "int"', 'dataclasses_transform_converter.py:112: error: Argument 3 to "DC2" has incompatible type "str"; expected "int"', 'dataclasses_transform_converter.py:112: error: Argument 4 to "DC2" has incompatible type "bytes"; expected "ConverterClass"', 'dataclasses_transform_converter.py:112: error: Argument 5 to "DC2" has incompatible type "list[Never]"; expected "int"'] +Line 114: Unexpected errors ['dataclasses_transform_converter.py:114: error: Incompatible types in assignment (expression has type "str", variable has type "int")'] +Line 115: Unexpected errors ['dataclasses_transform_converter.py:115: error: Incompatible types in assignment (expression has type "str", variable has type "ConverterClass")'] +Line 116: Unexpected errors ['dataclasses_transform_converter.py:116: error: Incompatible types in assignment (expression has type "bytes", variable has type "ConverterClass")'] +Line 121: Unexpected errors ['dataclasses_transform_converter.py:121: error: Argument 1 to "DC2" has incompatible type "str"; expected "int"', 'dataclasses_transform_converter.py:121: error: Argument 2 to "DC2" has incompatible type "str"; expected "int"', 'dataclasses_transform_converter.py:121: error: Argument 3 to "DC2" has incompatible type "str"; expected "int"', 'dataclasses_transform_converter.py:121: error: Argument 4 to "DC2" has incompatible type "str"; expected "ConverterClass"', 'dataclasses_transform_converter.py:121: error: Argument 5 to "DC2" has incompatible type "str"; expected "int"', 'dataclasses_transform_converter.py:121: error: Argument 6 to "DC2" has incompatible type "tuple[tuple[str, str], tuple[str, str]]"; expected "dict[str, str]"'] +""" +output = """ +dataclasses_transform_converter.py:48: error: Argument "converter" to "model_field" has incompatible type "Callable[[], int]"; expected "Callable[[Never], int]" +dataclasses_transform_converter.py:49: error: Argument "converter" to "model_field" has incompatible type "Callable[[NamedArg(int, 'x')], int]"; expected "Callable[[Never], int]" +dataclasses_transform_converter.py:104: error: Incompatible callable argument with type vars +dataclasses_transform_converter.py:107: error: Argument 2 to "DC2" has incompatible type "str"; expected "int" +dataclasses_transform_converter.py:107: error: Argument 3 to "DC2" has incompatible type "str"; expected "int" +dataclasses_transform_converter.py:107: error: Argument 4 to "DC2" has incompatible type "bytes"; expected "ConverterClass" +dataclasses_transform_converter.py:107: error: Argument 5 to "DC2" has incompatible type "list[Never]"; expected "int" +dataclasses_transform_converter.py:108: error: Argument 1 to "DC2" has incompatible type "str"; expected "int" +dataclasses_transform_converter.py:108: error: Argument 2 to "DC2" has incompatible type "str"; expected "int" +dataclasses_transform_converter.py:108: error: Argument 3 to "DC2" has incompatible type "str"; expected "int" +dataclasses_transform_converter.py:108: error: Argument 4 to "DC2" has incompatible type "int"; expected "ConverterClass" +dataclasses_transform_converter.py:108: error: Argument 5 to "DC2" has incompatible type "list[Never]"; expected "int" +dataclasses_transform_converter.py:109: error: Argument 1 to "DC2" has incompatible type "str"; expected "int" +dataclasses_transform_converter.py:109: error: Argument 2 to "DC2" has incompatible type "str"; expected "int" +dataclasses_transform_converter.py:109: error: Argument 3 to "DC2" has incompatible type "str"; expected "int" +dataclasses_transform_converter.py:109: error: Argument 4 to "DC2" has incompatible type "str"; expected "ConverterClass" +dataclasses_transform_converter.py:109: error: Argument 5 to "DC2" has incompatible type "complex"; expected "int" +dataclasses_transform_converter.py:112: error: Argument 1 to "DC2" has incompatible type "str"; expected "int" +dataclasses_transform_converter.py:112: error: Argument 2 to "DC2" has incompatible type "str"; expected "int" +dataclasses_transform_converter.py:112: error: Argument 3 to "DC2" has incompatible type "str"; expected "int" +dataclasses_transform_converter.py:112: error: Argument 4 to "DC2" has incompatible type "bytes"; expected "ConverterClass" +dataclasses_transform_converter.py:112: error: Argument 5 to "DC2" has incompatible type "list[Never]"; expected "int" +dataclasses_transform_converter.py:114: error: Incompatible types in assignment (expression has type "str", variable has type "int") +dataclasses_transform_converter.py:115: error: Incompatible types in assignment (expression has type "str", variable has type "ConverterClass") +dataclasses_transform_converter.py:116: error: Incompatible types in assignment (expression has type "bytes", variable has type "ConverterClass") +dataclasses_transform_converter.py:119: error: Incompatible types in assignment (expression has type "int", variable has type "ConverterClass") +dataclasses_transform_converter.py:121: error: Argument 1 to "DC2" has incompatible type "str"; expected "int" +dataclasses_transform_converter.py:121: error: Argument 2 to "DC2" has incompatible type "str"; expected "int" +dataclasses_transform_converter.py:121: error: Argument 3 to "DC2" has incompatible type "str"; expected "int" +dataclasses_transform_converter.py:121: error: Argument 4 to "DC2" has incompatible type "str"; expected "ConverterClass" +dataclasses_transform_converter.py:121: error: Argument 5 to "DC2" has incompatible type "str"; expected "int" +dataclasses_transform_converter.py:121: error: Argument 6 to "DC2" has incompatible type "tuple[tuple[str, str], tuple[str, str]]"; expected "dict[str, str]" +dataclasses_transform_converter.py:130: error: Argument "default" to "model_field" has incompatible type "int"; expected "str | None" +dataclasses_transform_converter.py:133: error: Argument "default_factory" to "model_field" has incompatible type "Type[int]"; expected "Callable[[], str] | None" +""" diff --git a/conformance/results/zuban/dataclasses_transform_field.toml b/conformance/results/zuban/dataclasses_transform_field.toml new file mode 100644 index 000000000..26b9ea8c4 --- /dev/null +++ b/conformance/results/zuban/dataclasses_transform_field.toml @@ -0,0 +1,7 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +dataclasses_transform_field.py:64: error: Unexpected keyword argument "id" for "CustomerModel1" +dataclasses_transform_field.py:75: error: Too many positional arguments for "CustomerModel2" +""" diff --git a/conformance/results/zuban/dataclasses_transform_func.toml b/conformance/results/zuban/dataclasses_transform_func.toml new file mode 100644 index 000000000..9bd8738f4 --- /dev/null +++ b/conformance/results/zuban/dataclasses_transform_func.toml @@ -0,0 +1,11 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +dataclasses_transform_func.py:56: error: Incompatible types in assignment (expression has type "int", variable has type "str") +dataclasses_transform_func.py:60: error: Unsupported left operand type for < ("Customer1") +dataclasses_transform_func.py:64: error: Unexpected keyword argument "salary" for "Customer1" +dataclasses_transform_func.py:70: error: Too many positional arguments for "Customer2" +dataclasses_transform_func.py:89: error: Non-frozen dataclass cannot inherit from a frozen dataclass +dataclasses_transform_func.py:96: error: Property "id" defined in "Customer3" is read-only +""" diff --git a/conformance/results/zuban/dataclasses_transform_meta.toml b/conformance/results/zuban/dataclasses_transform_meta.toml new file mode 100644 index 000000000..91a673e7e --- /dev/null +++ b/conformance/results/zuban/dataclasses_transform_meta.toml @@ -0,0 +1,11 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +dataclasses_transform_meta.py:51: error: Non-frozen dataclass cannot inherit from a frozen dataclass +dataclasses_transform_meta.py:63: error: Property "id" defined in "Customer1" is read-only +dataclasses_transform_meta.py:66: error: Too many positional arguments for "Customer1" +dataclasses_transform_meta.py:73: error: Unsupported left operand type for < ("Customer1") +dataclasses_transform_meta.py:83: error: Too many positional arguments for "Customer2" +dataclasses_transform_meta.py:103: error: Property "id" defined in "Customer3" is read-only +""" diff --git a/conformance/results/zuban/dataclasses_usage.toml b/conformance/results/zuban/dataclasses_usage.toml new file mode 100644 index 000000000..657b30298 --- /dev/null +++ b/conformance/results/zuban/dataclasses_usage.toml @@ -0,0 +1,16 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +dataclasses_usage.py:50: error: Missing positional argument "unit_price" in call to "InventoryItem" +dataclasses_usage.py:51: error: Argument 2 to "InventoryItem" has incompatible type "str"; expected "float" +dataclasses_usage.py:52: error: Too many arguments for "InventoryItem" +dataclasses_usage.py:61: error: Attributes without a default cannot follow attributes with one +dataclasses_usage.py:67: error: Attributes without a default cannot follow attributes with one +dataclasses_usage.py:73: error: Attributes without a default cannot follow attributes with one +dataclasses_usage.py:83: error: Too many arguments for "DC4" +dataclasses_usage.py:88: error: Argument "default_factory" to "field" has incompatible type "Type[str]"; expected "Callable[[], int]" +dataclasses_usage.py:127: error: Too many arguments for "DC7" +dataclasses_usage.py:130: error: Missing positional argument "y" in call to "DC8" +dataclasses_usage.py:179: error: Too many arguments for "DC13" +""" diff --git a/conformance/results/zuban/directives_assert_type.toml b/conformance/results/zuban/directives_assert_type.toml new file mode 100644 index 000000000..cb5f42c91 --- /dev/null +++ b/conformance/results/zuban/directives_assert_type.toml @@ -0,0 +1,11 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +directives_assert_type.py:27: error: Expression is of type "int | str", not "int" +directives_assert_type.py:28: error: Expression is of type "Any", not "int" +directives_assert_type.py:29: error: Expression is of type "Literal[4]", not "int" +directives_assert_type.py:31: error: "assert_type" expects 2 arguments +directives_assert_type.py:32: error: Expression is of type "Literal['']", not "int" +directives_assert_type.py:33: error: "assert_type" expects 2 arguments +""" diff --git a/conformance/results/zuban/directives_cast.toml b/conformance/results/zuban/directives_cast.toml new file mode 100644 index 000000000..2929dc71c --- /dev/null +++ b/conformance/results/zuban/directives_cast.toml @@ -0,0 +1,8 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +directives_cast.py:15: error: "cast" expects 2 arguments +directives_cast.py:16: error: Invalid type: try using Literal[1] instead? +directives_cast.py:17: error: "cast" expects 2 arguments +""" diff --git a/conformance/results/zuban/directives_deprecated.toml b/conformance/results/zuban/directives_deprecated.toml new file mode 100644 index 000000000..2b3718261 --- /dev/null +++ b/conformance/results/zuban/directives_deprecated.toml @@ -0,0 +1,18 @@ +conformant = "Unsupported" +conformance_automated = "Fail" +errors_diff = """ +Line 18: Expected 1 errors +Line 24: Expected 1 errors +Line 25: Expected 1 errors +Line 30: Expected 1 errors +Line 41: Expected 1 errors +Line 42: Expected 1 errors +Line 44: Expected 1 errors +Line 47: Expected 1 errors +Line 48: Expected 1 errors +Line 58: Expected 1 errors +Line 69: Expected 1 errors +Line 98: Expected 1 errors +""" +output = """ +""" diff --git a/conformance/results/zuban/directives_no_type_check.toml b/conformance/results/zuban/directives_no_type_check.toml new file mode 100644 index 000000000..ffa3b903a --- /dev/null +++ b/conformance/results/zuban/directives_no_type_check.toml @@ -0,0 +1,7 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +directives_no_type_check.py:15: error: Incompatible types in assignment (expression has type "str", variable has type "int") +directives_no_type_check.py:32: error: Missing positional arguments "a", "b" in call to "func1" +""" diff --git a/conformance/results/zuban/directives_reveal_type.toml b/conformance/results/zuban/directives_reveal_type.toml new file mode 100644 index 000000000..ca00eb927 --- /dev/null +++ b/conformance/results/zuban/directives_reveal_type.toml @@ -0,0 +1,11 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +directives_reveal_type.py:14: note: Revealed type is "builtins.int | builtins.str" +directives_reveal_type.py:15: note: Revealed type is "builtins.list[builtins.int]" +directives_reveal_type.py:16: note: Revealed type is "Any" +directives_reveal_type.py:17: note: Revealed type is "directives_reveal_type.ForwardReference" +directives_reveal_type.py:19: error: Too few arguments for "reveal_type" +directives_reveal_type.py:20: error: Too many arguments for "reveal_type" +""" diff --git a/conformance/results/zuban/directives_type_checking.toml b/conformance/results/zuban/directives_type_checking.toml new file mode 100644 index 000000000..cdd4d0cd9 --- /dev/null +++ b/conformance/results/zuban/directives_type_checking.toml @@ -0,0 +1,5 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +""" diff --git a/conformance/results/zuban/directives_type_ignore.toml b/conformance/results/zuban/directives_type_ignore.toml new file mode 100644 index 000000000..4de75baee --- /dev/null +++ b/conformance/results/zuban/directives_type_ignore.toml @@ -0,0 +1,14 @@ +conformant = "Partial" +notes = """ +Does not honor "# type: ignore" comment if comment includes additional text. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 11: Unexpected errors ['directives_type_ignore.py:11: error: Incompatible types in assignment (expression has type "str", variable has type "int")'] +Line 14: Unexpected errors ['directives_type_ignore.py:14: error: Incompatible types in assignment (expression has type "str", variable has type "int")'] +""" +output = """ +directives_type_ignore.py:11: error: Incompatible types in assignment (expression has type "str", variable has type "int") +directives_type_ignore.py:14: error: Incompatible types in assignment (expression has type "str", variable has type "int") +directives_type_ignore.py:14: note: Error code "assignment" not covered by "type: ignore" comment +""" diff --git a/conformance/results/zuban/directives_type_ignore_file1.toml b/conformance/results/zuban/directives_type_ignore_file1.toml new file mode 100644 index 000000000..cdd4d0cd9 --- /dev/null +++ b/conformance/results/zuban/directives_type_ignore_file1.toml @@ -0,0 +1,5 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +""" diff --git a/conformance/results/zuban/directives_type_ignore_file2.toml b/conformance/results/zuban/directives_type_ignore_file2.toml new file mode 100644 index 000000000..8a3521e92 --- /dev/null +++ b/conformance/results/zuban/directives_type_ignore_file2.toml @@ -0,0 +1,6 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +directives_type_ignore_file2.py:14: error: Incompatible types in assignment (expression has type "str", variable has type "int") +""" diff --git a/conformance/results/zuban/directives_version_platform.toml b/conformance/results/zuban/directives_version_platform.toml new file mode 100644 index 000000000..01082d4b6 --- /dev/null +++ b/conformance/results/zuban/directives_version_platform.toml @@ -0,0 +1,9 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +directives_version_platform.py:19: error: Incompatible types in assignment (expression has type "str", variable has type "int") +directives_version_platform.py:27: error: Incompatible types in assignment (expression has type "str", variable has type "int") +directives_version_platform.py:40: error: Incompatible types in assignment (expression has type "str", variable has type "int") +directives_version_platform.py:45: error: Incompatible types in assignment (expression has type "str", variable has type "int") +""" diff --git a/conformance/results/zuban/enums_behaviors.toml b/conformance/results/zuban/enums_behaviors.toml new file mode 100644 index 000000000..1328d68ab --- /dev/null +++ b/conformance/results/zuban/enums_behaviors.toml @@ -0,0 +1,8 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +enums_behaviors.py:28: error: Expression is of type "Color", not "Literal[Color.RED]" +enums_behaviors.py:32: error: Expression is of type "Color", not "Literal[Color.BLUE]" +enums_behaviors.py:44: error: Cannot extend enum with existing members: "Shape" +""" diff --git a/conformance/results/zuban/enums_definition.toml b/conformance/results/zuban/enums_definition.toml new file mode 100644 index 000000000..5fd9eb7c4 --- /dev/null +++ b/conformance/results/zuban/enums_definition.toml @@ -0,0 +1,6 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +enums_definition.py:24: error: Too many arguments for Enum() +""" diff --git a/conformance/results/zuban/enums_expansion.toml b/conformance/results/zuban/enums_expansion.toml new file mode 100644 index 000000000..aac06a242 --- /dev/null +++ b/conformance/results/zuban/enums_expansion.toml @@ -0,0 +1,13 @@ +conformant = "Partial" +notes = """ +Improperly applies narrowing to Flag subclass. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 53: Expected 1 errors +Line 52: Unexpected errors ['enums_expansion.py:52: error: Expression is of type "Literal[CustomFlags.FLAG3]", not "CustomFlags"'] +""" +output = """ +enums_expansion.py:35: error: Expression is of type "Color", not "Never" +enums_expansion.py:52: error: Expression is of type "Literal[CustomFlags.FLAG3]", not "CustomFlags" +""" diff --git a/conformance/results/zuban/enums_member_names.toml b/conformance/results/zuban/enums_member_names.toml new file mode 100644 index 000000000..7026fbd73 --- /dev/null +++ b/conformance/results/zuban/enums_member_names.toml @@ -0,0 +1,6 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +enums_member_names.py:30: error: Expression is of type "str", not "Literal['RED', 'BLUE', 'GREEN']" +""" diff --git a/conformance/results/zuban/enums_member_values.toml b/conformance/results/zuban/enums_member_values.toml new file mode 100644 index 000000000..0898b966a --- /dev/null +++ b/conformance/results/zuban/enums_member_values.toml @@ -0,0 +1,14 @@ +conformant = "Partial" +notes = """ +Does not enforce declared type of `_value_`. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 78: Expected 1 errors +""" +output = """ +enums_member_values.py:54: error: Expression is of type "tuple[Literal[1], float, float]", not "Literal[1]" +enums_member_values.py:68: error: Expression is of type "int", not "Literal[1]" +enums_member_values.py:85: error: Incompatible types in assignment (expression has type "int", variable has type "str") +enums_member_values.py:96: error: Expression is of type "EllipsisType", not "int" +""" diff --git a/conformance/results/zuban/enums_members.toml b/conformance/results/zuban/enums_members.toml new file mode 100644 index 000000000..a9c41a462 --- /dev/null +++ b/conformance/results/zuban/enums_members.toml @@ -0,0 +1,30 @@ +conformant = "Partial" +notes = """ +Does not honor `enum.member` as method decorator. +Does not properly handle aliased enum members. +Does not treat somecallables as non-members. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 82: Expected 1 errors +Line 83: Expected 1 errors +Line 116: Expected 1 errors +Line 35: Unexpected errors ['enums_members.py:35: error: Expression is of type "Literal[Pet2.genus]", not "str"'] +Line 36: Unexpected errors ['enums_members.py:36: error: Expression is of type "Literal[Pet2.species]", not "str"'] +Line 100: Unexpected errors ['enums_members.py:100: error: Expression is of type "Literal[TrafficLight.AMBER]", not "Literal[TrafficLight.YELLOW]"'] +Line 117: Unexpected errors ['enums_members.py:117: error: Parameter 1 of Literal[...] is invalid'] +""" +output = """ +enums_members.py:35: error: Expression is of type "Literal[Pet2.genus]", not "str" +enums_members.py:36: error: Expression is of type "Literal[Pet2.species]", not "str" +enums_members.py:50: error: Enum members must be left unannotated +enums_members.py:50: note: See https://typing.readthedocs.io/en/latest/spec/enums.html#defining-members +enums_members.py:84: error: Parameter 1 of Literal[...] is invalid +enums_members.py:85: error: Parameter 1 of Literal[...] is invalid +enums_members.py:100: error: Expression is of type "Literal[TrafficLight.AMBER]", not "Literal[TrafficLight.YELLOW]" +enums_members.py:117: error: Parameter 1 of Literal[...] is invalid +enums_members.py:128: note: Revealed type is "builtins.int" +enums_members.py:129: error: Parameter 1 of Literal[...] is invalid +enums_members.py:146: error: Expression is of type "Literal[Pet5.DOG]", not "int" +enums_members.py:147: error: Expression is of type "Literal[Pet5.FISH]", not "int" +""" diff --git a/conformance/results/zuban/exceptions_context_managers.toml b/conformance/results/zuban/exceptions_context_managers.toml new file mode 100644 index 000000000..cdd4d0cd9 --- /dev/null +++ b/conformance/results/zuban/exceptions_context_managers.toml @@ -0,0 +1,5 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +""" diff --git a/conformance/results/zuban/generics_base_class.toml b/conformance/results/zuban/generics_base_class.toml new file mode 100644 index 000000000..486fb5e8c --- /dev/null +++ b/conformance/results/zuban/generics_base_class.toml @@ -0,0 +1,18 @@ +conformant = "Partial" +notes = """ +Does not detect inconsistent type variable ordering in multi-inheritance. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 98: Expected 1 errors +Line 38: Unexpected errors ['generics_base_class.py:38: error: Can only assign concrete classes to a variable of type "Type[Iterable]"'] +""" +output = """ +generics_base_class.py:26: error: Argument 1 to "takes_dict_incorrect" has incompatible type "SymbolTable"; expected "dict[str, list[object]]" +generics_base_class.py:29: error: Invalid type +generics_base_class.py:30: error: Invalid type +generics_base_class.py:38: error: Can only assign concrete classes to a variable of type "Type[Iterable]" +generics_base_class.py:49: error: "LinkedList" expects 1 type argument, but 2 given +generics_base_class.py:61: error: "MyDict" expects 1 type argument, but 2 given +generics_base_class.py:68: error: Duplicate type variables in Generic[...] or Protocol[...] +""" diff --git a/conformance/results/zuban/generics_basic.toml b/conformance/results/zuban/generics_basic.toml new file mode 100644 index 000000000..db0b02d3a --- /dev/null +++ b/conformance/results/zuban/generics_basic.toml @@ -0,0 +1,18 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +generics_basic.py:40: error: Argument 2 to "concat" has incompatible type "bytes"; expected "str" +generics_basic.py:41: error: Argument 2 to "concat" has incompatible type "str"; expected "bytes" +generics_basic.py:49: error: Type variable must have at least two constrained types +generics_basic.py:55: error: TypeVar constraint type cannot be parametrized by type variables +generics_basic.py:69: error: Argument 2 to "concat" has incompatible type "bytes"; expected "str" +generics_basic.py:121: error: Duplicate type variables in Generic[...] or Protocol[...] +generics_basic.py:157: error: Invalid index type "int" for "MyMap1[str, int]"; expected type "str" +generics_basic.py:158: error: Invalid index type "int" for "MyMap2[int, str]"; expected type "str" +generics_basic.py:162: error: Free type variable expected in Generic[...] +generics_basic.py:163: error: Free type variable expected in Protocol[...] +generics_basic.py:171: error: If Generic[...] or Protocol[...] is present it should list all type variables +generics_basic.py:172: error: If Generic[...] or Protocol[...] is present it should list all type variables +generics_basic.py:208: error: Invalid metaclass "GenericMeta[T]" +""" diff --git a/conformance/results/zuban/generics_defaults.toml b/conformance/results/zuban/generics_defaults.toml new file mode 100644 index 000000000..f54654743 --- /dev/null +++ b/conformance/results/zuban/generics_defaults.toml @@ -0,0 +1,23 @@ +conformant = "Partial" +notes = """ +Does not reject TypeVars with defaults after a TypeVarTuple +Type parameter defaults are not bound by attribute access +ParamSpec after TypeVarTuple is not always handled correctly +""" +conformance_automated = "Fail" +errors_diff = """ +Line 141: Expected 1 errors +Line 154: Unexpected errors ['generics_defaults.py:154: error: Expression is of type "Type[Foo6[int, [*Any, **Any]]]", not "Type[Foo6[int, str, [float, bool]]]"', 'generics_defaults.py:154: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str"'] +Line 169: Unexpected errors ['generics_defaults.py:169: error: Expression is of type "Callable[[Self], Self]", not "Callable[[Foo7[int]], Foo7[int]]"'] +Line 170: Unexpected errors ['generics_defaults.py:170: error: Access to generic instance variables via class is ambiguous'] +""" +output = """ +generics_defaults.py:24: error: "T" cannot appear after "DefaultStrT" in type parameter list because it has no default type +generics_defaults.py:50: error: "AllTheDefaults" expects between 2 and 5 type arguments, but 1 given +generics_defaults.py:107: error: TypeVar default must be a subtype of the bound type +generics_defaults.py:114: error: TypeVar default must be one of the constraint types +generics_defaults.py:154: error: Expression is of type "Type[Foo6[int, [*Any, **Any]]]", not "Type[Foo6[int, str, [float, bool]]]" +generics_defaults.py:154: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" +generics_defaults.py:169: error: Expression is of type "Callable[[Self], Self]", not "Callable[[Foo7[int]], Foo7[int]]" +generics_defaults.py:170: error: Access to generic instance variables via class is ambiguous +""" diff --git a/conformance/results/zuban/generics_defaults_referential.toml b/conformance/results/zuban/generics_defaults_referential.toml new file mode 100644 index 000000000..f5dc26363 --- /dev/null +++ b/conformance/results/zuban/generics_defaults_referential.toml @@ -0,0 +1,12 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +generics_defaults_referential.py:36: error: Argument 2 to "Foo" has incompatible type "str"; expected "int" +generics_defaults_referential.py:37: error: Argument 1 to "Foo" has incompatible type "str"; expected "int" +generics_defaults_referential.py:53: error: Type parameter "Start2T" has a default type that refers to one or more type variables that are out of scope +generics_defaults_referential.py:60: error: Type parameter "S2" has a default type that refers to one or more type variables that are out of scope +generics_defaults_referential.py:68: error: TypeVar default must be a subtype of the bound type +generics_defaults_referential.py:74: error: TypeVar default must be one of the constraint types +generics_defaults_referential.py:78: error: TypeVar default must be one of the constraint types +""" diff --git a/conformance/results/zuban/generics_defaults_specialization.toml b/conformance/results/zuban/generics_defaults_specialization.toml new file mode 100644 index 000000000..29f44e4f7 --- /dev/null +++ b/conformance/results/zuban/generics_defaults_specialization.toml @@ -0,0 +1,7 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +generics_defaults_specialization.py:30: error: Bad number of arguments for type alias, expected between 0 and 1, given 2 +generics_defaults_specialization.py:55: error: "Foo" expects no type arguments, but 1 given +""" diff --git a/conformance/results/zuban/generics_paramspec_basic.toml b/conformance/results/zuban/generics_paramspec_basic.toml new file mode 100644 index 000000000..97048c7ba --- /dev/null +++ b/conformance/results/zuban/generics_paramspec_basic.toml @@ -0,0 +1,22 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +generics_paramspec_basic.py:10: error: String argument 1 "NotIt" to ParamSpec(...) does not match variable name "WrongName" +generics_paramspec_basic.py:15: error: Invalid location for ParamSpec "P" +generics_paramspec_basic.py:15: note: You can use ParamSpec as the first argument to Callable, e.g., "Callable[P, int]" +generics_paramspec_basic.py:23: error: Invalid location for ParamSpec "P" +generics_paramspec_basic.py:23: note: You can use ParamSpec as the first argument to Callable, e.g., "Callable[P, int]" +generics_paramspec_basic.py:23: error: Invalid location for ParamSpec "P" +generics_paramspec_basic.py:23: note: You can use ParamSpec as the first argument to Callable, e.g., "Callable[P, int]" +generics_paramspec_basic.py:27: error: Invalid location for Concatenate +generics_paramspec_basic.py:27: note: You can use Concatenate as the first argument to Callable +generics_paramspec_basic.py:31: error: Invalid location for ParamSpec "P" +generics_paramspec_basic.py:31: note: You can use ParamSpec as the first argument to Callable, e.g., "Callable[P, int]" +generics_paramspec_basic.py:35: error: Invalid location for ParamSpec "P" +generics_paramspec_basic.py:35: note: You can use ParamSpec as the first argument to Callable, e.g., "Callable[P, int]" +generics_paramspec_basic.py:39: error: Invalid location for ParamSpec "P" +generics_paramspec_basic.py:39: note: You can use ParamSpec as the first argument to Callable, e.g., "Callable[P, int]" +generics_paramspec_basic.py:39: error: Invalid location for ParamSpec "P" +generics_paramspec_basic.py:39: note: You can use ParamSpec as the first argument to Callable, e.g., "Callable[P, int]" +""" diff --git a/conformance/results/zuban/generics_paramspec_components.toml b/conformance/results/zuban/generics_paramspec_components.toml new file mode 100644 index 000000000..5c8e9bfea --- /dev/null +++ b/conformance/results/zuban/generics_paramspec_components.toml @@ -0,0 +1,27 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +generics_paramspec_components.py:17: error: Use "P.args" for variadic "*" parameter +generics_paramspec_components.py:17: error: Use "P.kwargs" for variadic "**" parameter +generics_paramspec_components.py:20: error: ParamSpec components are not allowed here +generics_paramspec_components.py:23: error: Use "P.kwargs" for variadic "**" parameter +generics_paramspec_components.py:26: error: ParamSpec must have "*args" typed as "P.args" and "**kwargs" typed as "P.kwargs" +generics_paramspec_components.py:30: error: ParamSpec "P" is unbound +generics_paramspec_components.py:35: error: ParamSpec components are not allowed here +generics_paramspec_components.py:36: error: ParamSpec components are not allowed here +generics_paramspec_components.py:38: error: ParamSpec must have "*args" typed as "P.args" and "**kwargs" typed as "P.kwargs" +generics_paramspec_components.py:41: error: ParamSpec must have "*args" typed as "P.args" and "**kwargs" typed as "P.kwargs" +generics_paramspec_components.py:49: error: Argument 1 has incompatible type "*P.kwargs"; expected "P.args" +generics_paramspec_components.py:49: error: Argument after ** must be a mapping, not "P.args" +generics_paramspec_components.py:51: error: Argument 1 has incompatible type "int"; expected "P.args" +generics_paramspec_components.py:60: error: Arguments not allowed after ParamSpec.args +generics_paramspec_components.py:70: error: Too few arguments +generics_paramspec_components.py:70: error: ParamSpec arguments must be of types "*P.args, **P.kwargs" +generics_paramspec_components.py:70: error: Argument 3 has incompatible type "**P.kwargs"; expected "P.kwargs" +generics_paramspec_components.py:72: error: Too few arguments +generics_paramspec_components.py:83: error: Argument "x" to "foo" has incompatible type "int"; expected "P.args" +generics_paramspec_components.py:83: error: Argument 2 to "foo" has incompatible type "*P.args"; expected "int" +generics_paramspec_components.py:98: error: Argument 2 to "twice" has incompatible type "str"; expected "int" +generics_paramspec_components.py:98: error: Argument 3 to "twice" has incompatible type "int"; expected "str" +""" diff --git a/conformance/results/zuban/generics_paramspec_semantics.toml b/conformance/results/zuban/generics_paramspec_semantics.toml new file mode 100644 index 000000000..d25400dca --- /dev/null +++ b/conformance/results/zuban/generics_paramspec_semantics.toml @@ -0,0 +1,15 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +generics_paramspec_semantics.py:26: error: Unexpected keyword argument "a" +generics_paramspec_semantics.py:26: error: Unexpected keyword argument "b" +generics_paramspec_semantics.py:27: error: Argument 2 has incompatible type "str"; expected "bool" +generics_paramspec_semantics.py:61: error: Argument 2 to "func1" has incompatible type "Callable[[NamedArg(int, 'y')], int]"; expected "Callable[[NamedArg(int, 'x')], int]" +generics_paramspec_semantics.py:98: error: Argument 1 has incompatible type "int"; expected "str" +generics_paramspec_semantics.py:108: error: Argument 1 has incompatible type "int"; expected "bool" +generics_paramspec_semantics.py:120: error: Argument 1 has incompatible type "int"; expected "str" +generics_paramspec_semantics.py:127: error: Argument 1 to "expects_int_first" has incompatible type "Callable[[str], int]"; expected "Callable[[int], int]" +generics_paramspec_semantics.py:132: error: Argument 1 to "expects_int_first" has incompatible type "Callable[[NamedArg(int, 'x')], int]"; expected "Callable[[int, Never], int]" +generics_paramspec_semantics.py:137: error: Argument 1 to "expects_int_first" has incompatible type "Callable[[KwArg(int)], int]"; expected "Callable[[int, Never], int]" +""" diff --git a/conformance/results/zuban/generics_paramspec_specialization.toml b/conformance/results/zuban/generics_paramspec_specialization.toml new file mode 100644 index 000000000..aa32f55b0 --- /dev/null +++ b/conformance/results/zuban/generics_paramspec_specialization.toml @@ -0,0 +1,10 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +generics_paramspec_specialization.py:44: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "int" +generics_paramspec_specialization.py:54: error: Argument 1 has incompatible type "str"; expected "int" +generics_paramspec_specialization.py:55: error: Argument 3 has incompatible type "str"; expected "bool" +generics_paramspec_specialization.py:60: error: Argument 1 has incompatible type "str"; expected "int" +generics_paramspec_specialization.py:61: error: Argument 3 has incompatible type "str"; expected "bool" +""" diff --git a/conformance/results/zuban/generics_scoping.toml b/conformance/results/zuban/generics_scoping.toml new file mode 100644 index 000000000..4d20365fd --- /dev/null +++ b/conformance/results/zuban/generics_scoping.toml @@ -0,0 +1,31 @@ +conformant = "Partial" +notes = """ +False negative on generic class nested within generic class with same type variable. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 80: Unexpected errors ['generics_scoping.py:80: error: Type variable "T" is bound by an outer class'] +""" +output = """ +generics_scoping.py:29: error: Argument 1 to "meth_2" of "MyClass" has incompatible type "str"; expected "int" +generics_scoping.py:50: error: Type variable "generics_scoping.S" is unbound +generics_scoping.py:50: note: (Hint: Use "Generic[S]" or "Protocol[S]" base class to bind "S" inside a class) +generics_scoping.py:50: note: (Hint: Use "S" in function signature to bind "S" inside a function) +generics_scoping.py:54: error: Type variable "generics_scoping.S" is unbound +generics_scoping.py:54: note: (Hint: Use "Generic[S]" or "Protocol[S]" base class to bind "S" inside a class) +generics_scoping.py:54: note: (Hint: Use "S" in function signature to bind "S" inside a function) +generics_scoping.py:65: error: Free type variable expected in Generic[...] +generics_scoping.py:75: error: Type variable "T" is bound by an outer class +generics_scoping.py:78: error: Type variable "T" is bound by an outer class +generics_scoping.py:80: error: Type variable "T" is bound by an outer class +generics_scoping.py:87: error: Can't use bound type variable "T" to define generic alias +generics_scoping.py:94: error: Type variable "generics_scoping.T" is unbound +generics_scoping.py:94: note: (Hint: Use "Generic[T]" or "Protocol[T]" base class to bind "T" inside a class) +generics_scoping.py:94: note: (Hint: Use "T" in function signature to bind "T" inside a function) +generics_scoping.py:95: error: Type variable "generics_scoping.T" is unbound +generics_scoping.py:95: note: (Hint: Use "Generic[T]" or "Protocol[T]" base class to bind "T" inside a class) +generics_scoping.py:95: note: (Hint: Use "T" in function signature to bind "T" inside a function) +generics_scoping.py:96: error: Type variable "generics_scoping.T" is unbound +generics_scoping.py:96: note: (Hint: Use "Generic[T]" or "Protocol[T]" base class to bind "T" inside a class) +generics_scoping.py:96: note: (Hint: Use "T" in function signature to bind "T" inside a function) +""" diff --git a/conformance/results/zuban/generics_self_advanced.toml b/conformance/results/zuban/generics_self_advanced.toml new file mode 100644 index 000000000..ddd4e1d21 --- /dev/null +++ b/conformance/results/zuban/generics_self_advanced.toml @@ -0,0 +1,13 @@ +conformant = "Pass" +notes = """ +True positive: Writing to a variable that contains Self (with a class) should error +""" +conformance_automated = "Fail" +errors_diff = """ +Line 43: Unexpected errors ['generics_self_advanced.py:43: error: Access to generic instance variables via class is ambiguous'] +Line 44: Unexpected errors ['generics_self_advanced.py:44: error: Access to generic instance variables via class is ambiguous'] +""" +output = """ +generics_self_advanced.py:43: error: Access to generic instance variables via class is ambiguous +generics_self_advanced.py:44: error: Access to generic instance variables via class is ambiguous +""" diff --git a/conformance/results/zuban/generics_self_attributes.toml b/conformance/results/zuban/generics_self_attributes.toml new file mode 100644 index 000000000..1c95e98a6 --- /dev/null +++ b/conformance/results/zuban/generics_self_attributes.toml @@ -0,0 +1,7 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +generics_self_attributes.py:26: error: Argument "next" to "OrdinalLinkedList" has incompatible type "LinkedList[int]"; expected "OrdinalLinkedList | None" +generics_self_attributes.py:32: error: Incompatible types in assignment (expression has type "LinkedList[int]", variable has type "OrdinalLinkedList | None") +""" diff --git a/conformance/results/zuban/generics_self_basic.toml b/conformance/results/zuban/generics_self_basic.toml new file mode 100644 index 000000000..60e1b62b2 --- /dev/null +++ b/conformance/results/zuban/generics_self_basic.toml @@ -0,0 +1,8 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +generics_self_basic.py:20: error: Incompatible return value type (got "Shape", expected "Self") +generics_self_basic.py:33: error: Incompatible return value type (got "Shape", expected "Self") +generics_self_basic.py:67: error: Self type cannot have type arguments +""" diff --git a/conformance/results/zuban/generics_self_protocols.toml b/conformance/results/zuban/generics_self_protocols.toml new file mode 100644 index 000000000..b62c21667 --- /dev/null +++ b/conformance/results/zuban/generics_self_protocols.toml @@ -0,0 +1,17 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +generics_self_protocols.py:61: error: Argument 1 to "accepts_shape" has incompatible type "BadReturnType"; expected "ShapeProtocol" +generics_self_protocols.py:61: note: Following member(s) of "BadReturnType" have conflicts: +generics_self_protocols.py:61: note: Expected: +generics_self_protocols.py:61: note: def [Self: BadReturnType] set_scale(self, scale: float) -> Self +generics_self_protocols.py:61: note: Got: +generics_self_protocols.py:61: note: def set_scale(self, scale: float) -> int +generics_self_protocols.py:64: error: Argument 1 to "accepts_shape" has incompatible type "ReturnDifferentClass"; expected "ShapeProtocol" +generics_self_protocols.py:64: note: Following member(s) of "ReturnDifferentClass" have conflicts: +generics_self_protocols.py:64: note: Expected: +generics_self_protocols.py:64: note: def [Self: ReturnDifferentClass] set_scale(self, scale: float) -> Self +generics_self_protocols.py:64: note: Got: +generics_self_protocols.py:64: note: def set_scale(self, scale: float) -> ReturnConcreteShape +""" diff --git a/conformance/results/zuban/generics_self_usage.toml b/conformance/results/zuban/generics_self_usage.toml new file mode 100644 index 000000000..b3c5b50f8 --- /dev/null +++ b/conformance/results/zuban/generics_self_usage.toml @@ -0,0 +1,22 @@ +conformant = "Partial" +notes = """ +Does not detect invalid Self when Self is not properly bound""" +conformance_automated = "Fail" +errors_diff = """ +Line 82: Expected 1 errors +Line 111: Expected 1 errors +Line 116: Expected 1 errors +Line 50: Unexpected errors ['generics_self_usage.py:50: error: Incompatible types in assignment (expression has type "Callable[[CallableAttribute], int]", variable has type "Callable[[Self], int]")'] +""" +output = """ +generics_self_usage.py:50: error: Incompatible types in assignment (expression has type "Callable[[CallableAttribute], int]", variable has type "Callable[[Self], int]") +generics_self_usage.py:73: error: Self type is only allowed in annotations within class definition +generics_self_usage.py:73: error: Self type is only allowed in annotations within class definition +generics_self_usage.py:76: error: Self type is only allowed in annotations within class definition +generics_self_usage.py:86: error: Incompatible return value type (got "Foo3", expected "Self") +generics_self_usage.py:101: error: Self type is only allowed in annotations within class definition +generics_self_usage.py:103: error: Self type is only allowed in annotations within class definition +generics_self_usage.py:106: error: Self type cannot be used in type alias target +generics_self_usage.py:121: error: Self type cannot be used in a metaclass +generics_self_usage.py:125: error: Self type cannot be used in a metaclass +""" diff --git a/conformance/results/zuban/generics_syntax_compatibility.toml b/conformance/results/zuban/generics_syntax_compatibility.toml new file mode 100644 index 000000000..77ec435b5 --- /dev/null +++ b/conformance/results/zuban/generics_syntax_compatibility.toml @@ -0,0 +1,7 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +generics_syntax_compatibility.py:14: error: All type parameters should be declared ("K" not declared) +generics_syntax_compatibility.py:26: error: All type parameters should be declared ("K" not declared) +""" diff --git a/conformance/results/zuban/generics_syntax_declarations.toml b/conformance/results/zuban/generics_syntax_declarations.toml new file mode 100644 index 000000000..c497a4436 --- /dev/null +++ b/conformance/results/zuban/generics_syntax_declarations.toml @@ -0,0 +1,17 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +generics_syntax_declarations.py:17: error: Generic[...] base class is redundant +generics_syntax_declarations.py:25: error: No arguments expected for "Protocol" base class +generics_syntax_declarations.py:32: error: "T" has no attribute "is_integer" +generics_syntax_declarations.py:44: error: "V" may not be used, because it's defined in an outer class +generics_syntax_declarations.py:48: error: Bracketed expression "[...]" is not valid as a type +generics_syntax_declarations.py:48: note: Did you mean "List[...]"? +generics_syntax_declarations.py:60: error: Type variable must have at least two constrained types +generics_syntax_declarations.py:64: error: Type variable must have at least two constrained types +generics_syntax_declarations.py:71: error: Variable "generics_syntax_declarations.t1" is not valid as a type +generics_syntax_declarations.py:71: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_declarations.py:75: error: Invalid type: try using Literal[3] instead? +generics_syntax_declarations.py:79: error: Name "S" is not defined +""" diff --git a/conformance/results/zuban/generics_syntax_infer_variance.toml b/conformance/results/zuban/generics_syntax_infer_variance.toml new file mode 100644 index 000000000..cf981f5ec --- /dev/null +++ b/conformance/results/zuban/generics_syntax_infer_variance.toml @@ -0,0 +1,67 @@ +conformant = "Unsupported" +notes = """ +Type parameter syntax not yet support. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 11: Unexpected errors ['generics_syntax_infer_variance.py:11: error: Unexpected argument to "TypeVar()": "infer_variance"'] +Line 12: Unexpected errors ['generics_syntax_infer_variance.py:12: error: Unexpected argument to "TypeVar()": "infer_variance"'] +Line 13: Unexpected errors ['generics_syntax_infer_variance.py:13: error: Unexpected argument to "TypeVar()": "infer_variance"'] +Line 28: Unexpected errors ['generics_syntax_infer_variance.py:28: error: "ShouldBeCovariant1" expects no type arguments, but 1 given', 'generics_syntax_infer_variance.py:28: error: "ShouldBeCovariant1" expects no type arguments, but 1 given'] +Line 36: Unexpected errors ['generics_syntax_infer_variance.py:36: error: "ShouldBeCovariant2" expects no type arguments, but 1 given', 'generics_syntax_infer_variance.py:36: error: "ShouldBeCovariant2" expects no type arguments, but 1 given'] +Line 41: Unexpected errors ['generics_syntax_infer_variance.py:41: error: "ShouldBeCovariant2" expects no type arguments, but 1 given'] +Line 45: Unexpected errors ['generics_syntax_infer_variance.py:45: error: "ShouldBeCovariant3" expects no type arguments, but 1 given', 'generics_syntax_infer_variance.py:45: error: "ShouldBeCovariant3" expects no type arguments, but 1 given'] +Line 74: Unexpected errors ['generics_syntax_infer_variance.py:74: error: "ShouldBeCovariant5" expects no type arguments, but 1 given', 'generics_syntax_infer_variance.py:74: error: "ShouldBeCovariant5" expects no type arguments, but 1 given'] +Line 85: Unexpected errors ['generics_syntax_infer_variance.py:85: error: "ShouldBeCovariant6" expects no type arguments, but 1 given', 'generics_syntax_infer_variance.py:85: error: "ShouldBeCovariant6" expects no type arguments, but 1 given'] +Line 156: Unexpected errors ['generics_syntax_infer_variance.py:156: error: "ShouldBeContravariant1" expects no type arguments, but 1 given', 'generics_syntax_infer_variance.py:156: error: "ShouldBeContravariant1" expects no type arguments, but 1 given'] +""" +output = """ +generics_syntax_infer_variance.py:11: error: Unexpected argument to "TypeVar()": "infer_variance" +generics_syntax_infer_variance.py:12: error: Unexpected argument to "TypeVar()": "infer_variance" +generics_syntax_infer_variance.py:13: error: Unexpected argument to "TypeVar()": "infer_variance" +generics_syntax_infer_variance.py:15: error: Unexpected argument to "TypeVar()": "infer_variance" +generics_syntax_infer_variance.py:17: error: Unexpected argument to "TypeVar()": "infer_variance" +generics_syntax_infer_variance.py:28: error: "ShouldBeCovariant1" expects no type arguments, but 1 given +generics_syntax_infer_variance.py:28: error: "ShouldBeCovariant1" expects no type arguments, but 1 given +generics_syntax_infer_variance.py:29: error: "ShouldBeCovariant1" expects no type arguments, but 1 given +generics_syntax_infer_variance.py:29: error: "ShouldBeCovariant1" expects no type arguments, but 1 given +generics_syntax_infer_variance.py:36: error: "ShouldBeCovariant2" expects no type arguments, but 1 given +generics_syntax_infer_variance.py:36: error: "ShouldBeCovariant2" expects no type arguments, but 1 given +generics_syntax_infer_variance.py:37: error: "ShouldBeCovariant2" expects no type arguments, but 1 given +generics_syntax_infer_variance.py:37: error: "ShouldBeCovariant2" expects no type arguments, but 1 given +generics_syntax_infer_variance.py:41: error: "ShouldBeCovariant2" expects no type arguments, but 1 given +generics_syntax_infer_variance.py:45: error: "ShouldBeCovariant3" expects no type arguments, but 1 given +generics_syntax_infer_variance.py:45: error: "ShouldBeCovariant3" expects no type arguments, but 1 given +generics_syntax_infer_variance.py:46: error: "ShouldBeCovariant3" expects no type arguments, but 1 given +generics_syntax_infer_variance.py:46: error: "ShouldBeCovariant3" expects no type arguments, but 1 given +generics_syntax_infer_variance.py:74: error: "ShouldBeCovariant5" expects no type arguments, but 1 given +generics_syntax_infer_variance.py:74: error: "ShouldBeCovariant5" expects no type arguments, but 1 given +generics_syntax_infer_variance.py:75: error: "ShouldBeCovariant5" expects no type arguments, but 1 given +generics_syntax_infer_variance.py:75: error: "ShouldBeCovariant5" expects no type arguments, but 1 given +generics_syntax_infer_variance.py:85: error: "ShouldBeCovariant6" expects no type arguments, but 1 given +generics_syntax_infer_variance.py:85: error: "ShouldBeCovariant6" expects no type arguments, but 1 given +generics_syntax_infer_variance.py:86: error: "ShouldBeCovariant6" expects no type arguments, but 1 given +generics_syntax_infer_variance.py:86: error: "ShouldBeCovariant6" expects no type arguments, but 1 given +generics_syntax_infer_variance.py:102: error: "ShouldBeInvariant1" expects no type arguments, but 1 given +generics_syntax_infer_variance.py:102: error: "ShouldBeInvariant1" expects no type arguments, but 1 given +generics_syntax_infer_variance.py:103: error: "ShouldBeInvariant1" expects no type arguments, but 1 given +generics_syntax_infer_variance.py:103: error: "ShouldBeInvariant1" expects no type arguments, but 1 given +generics_syntax_infer_variance.py:117: error: "ShouldBeInvariant2" expects no type arguments, but 1 given +generics_syntax_infer_variance.py:117: error: "ShouldBeInvariant2" expects no type arguments, but 1 given +generics_syntax_infer_variance.py:118: error: "ShouldBeInvariant2" expects no type arguments, but 1 given +generics_syntax_infer_variance.py:118: error: "ShouldBeInvariant2" expects no type arguments, but 1 given +generics_syntax_infer_variance.py:125: error: "ShouldBeInvariant3" expects no type arguments, but 2 given +generics_syntax_infer_variance.py:125: error: "ShouldBeInvariant3" expects no type arguments, but 2 given +generics_syntax_infer_variance.py:126: error: "ShouldBeInvariant3" expects no type arguments, but 2 given +generics_syntax_infer_variance.py:126: error: "ShouldBeInvariant3" expects no type arguments, but 2 given +generics_syntax_infer_variance.py:127: error: "ShouldBeInvariant3" expects no type arguments, but 2 given +generics_syntax_infer_variance.py:127: error: "ShouldBeInvariant3" expects no type arguments, but 2 given +generics_syntax_infer_variance.py:128: error: "ShouldBeInvariant3" expects no type arguments, but 2 given +generics_syntax_infer_variance.py:128: error: "ShouldBeInvariant3" expects no type arguments, but 2 given +generics_syntax_infer_variance.py:136: error: Incompatible types in assignment (expression has type "ShouldBeInvariant4[int]", variable has type "ShouldBeInvariant4[float]") +generics_syntax_infer_variance.py:144: error: Incompatible types in assignment (expression has type "ShouldBeInvariant5[int]", variable has type "ShouldBeInvariant5[float]") +generics_syntax_infer_variance.py:155: error: "ShouldBeContravariant1" expects no type arguments, but 1 given +generics_syntax_infer_variance.py:155: error: "ShouldBeContravariant1" expects no type arguments, but 1 given +generics_syntax_infer_variance.py:156: error: "ShouldBeContravariant1" expects no type arguments, but 1 given +generics_syntax_infer_variance.py:156: error: "ShouldBeContravariant1" expects no type arguments, but 1 given +""" diff --git a/conformance/results/zuban/generics_syntax_scoping.toml b/conformance/results/zuban/generics_syntax_scoping.toml new file mode 100644 index 000000000..d00420b47 --- /dev/null +++ b/conformance/results/zuban/generics_syntax_scoping.toml @@ -0,0 +1,43 @@ +conformant = "Partial" +notes = """ +Does not following runtime scoping rules for type parameters in all cases. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 92: Expected 1 errors +Line 95: Expected 1 errors +Line 98: Expected 1 errors +Line 31: Unexpected errors ['generics_syntax_scoping.py:31: error: Type variable "generics_syntax_scoping.T" is unbound'] +Line 56: Unexpected errors ['generics_syntax_scoping.py:56: error: Name "S" already defined on line 55'] +Line 62: Unexpected errors ['generics_syntax_scoping.py:62: error: Expression is of type "TypeVar", not "str"'] +Line 88: Unexpected errors ['generics_syntax_scoping.py:88: error: Argument 1 has incompatible type "Type[ClassE]"; expected "Callable[Never, Never]"'] +Line 90: Unexpected errors ['generics_syntax_scoping.py:90: error: Name "T" already defined on line 89'] +Line 106: Unexpected errors ['generics_syntax_scoping.py:106: error: Name "T" already defined on line 105'] +Line 108: Unexpected errors ['generics_syntax_scoping.py:108: error: Expression is of type "TypeVar", not "int"'] +Line 116: Unexpected errors ['generics_syntax_scoping.py:116: error: Expression is of type "int", not "TypeVar"'] +Line 121: Unexpected errors ['generics_syntax_scoping.py:121: error: Expression is of type "TypeVar", not "complex"'] +Line 124: Unexpected errors ['generics_syntax_scoping.py:124: error: Expression is of type "TypeVar", not "complex"'] +""" +output = """ +generics_syntax_scoping.py:14: error: Variable "generics_syntax_scoping.S" is not valid as a type +generics_syntax_scoping.py:14: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_scoping.py:18: error: Variable "generics_syntax_scoping.T" is not valid as a type +generics_syntax_scoping.py:18: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_scoping.py:31: error: Type variable "generics_syntax_scoping.T" is unbound +generics_syntax_scoping.py:31: note: (Hint: Use "Generic[T]" or "Protocol[T]" base class to bind "T" inside a class) +generics_syntax_scoping.py:31: note: (Hint: Use "T" in function signature to bind "T" inside a function) +generics_syntax_scoping.py:35: error: Name "T" is used before definition +generics_syntax_scoping.py:44: error: Argument 1 has incompatible type "Type[ClassD]"; expected "Callable[Never, Never]" +generics_syntax_scoping.py:44: error: Name "T" is used before definition +generics_syntax_scoping.py:44: error: Variable "generics_syntax_scoping.T" is not valid as a type +generics_syntax_scoping.py:44: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_scoping.py:56: error: Name "S" already defined on line 55 +generics_syntax_scoping.py:62: error: Expression is of type "TypeVar", not "str" +generics_syntax_scoping.py:88: error: Argument 1 has incompatible type "Type[ClassE]"; expected "Callable[Never, Never]" +generics_syntax_scoping.py:90: error: Name "T" already defined on line 89 +generics_syntax_scoping.py:106: error: Name "T" already defined on line 105 +generics_syntax_scoping.py:108: error: Expression is of type "TypeVar", not "int" +generics_syntax_scoping.py:116: error: Expression is of type "int", not "TypeVar" +generics_syntax_scoping.py:121: error: Expression is of type "TypeVar", not "complex" +generics_syntax_scoping.py:124: error: Expression is of type "TypeVar", not "complex" +""" diff --git a/conformance/results/zuban/generics_type_erasure.toml b/conformance/results/zuban/generics_type_erasure.toml new file mode 100644 index 000000000..01da12864 --- /dev/null +++ b/conformance/results/zuban/generics_type_erasure.toml @@ -0,0 +1,20 @@ +conformant = "Pass" +notes = """ +True positive: Undefined type vars should be inferred as Never not Any (avoiding to introduce Any) +""" +conformance_automated = "Fail" +errors_diff = """ +Line 19: Unexpected errors ['generics_type_erasure.py:19: error: Expression is of type "Node[Never]", not "Node[Any]"'] +Line 22: Unexpected errors ['generics_type_erasure.py:22: error: Expression is of type "Never", not "Any"'] +""" +output = """ +generics_type_erasure.py:19: error: Expression is of type "Node[Never]", not "Node[Any]" +generics_type_erasure.py:22: error: Expression is of type "Never", not "Any" +generics_type_erasure.py:38: error: Argument 1 to "Node" has incompatible type "str"; expected "int | None" +generics_type_erasure.py:40: error: Argument 1 to "Node" has incompatible type "int"; expected "str | None" +generics_type_erasure.py:42: error: Access to generic instance variables via class is ambiguous +generics_type_erasure.py:43: error: Access to generic instance variables via class is ambiguous +generics_type_erasure.py:44: error: Access to generic instance variables via class is ambiguous +generics_type_erasure.py:45: error: Access to generic instance variables via class is ambiguous +generics_type_erasure.py:46: error: Access to generic instance variables via class is ambiguous +""" diff --git a/conformance/results/zuban/generics_typevartuple_args.toml b/conformance/results/zuban/generics_typevartuple_args.toml new file mode 100644 index 000000000..1253bce91 --- /dev/null +++ b/conformance/results/zuban/generics_typevartuple_args.toml @@ -0,0 +1,19 @@ +conformant = "Partial" +notes = """ +Does not enforce that tuples captured by TypeVarTuple are same type. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 75: Expected 1 errors +Line 76: Expected 1 errors +""" +output = """ +generics_typevartuple_args.py:33: error: Argument 3 to "exec_le" has incompatible type "str"; expected "Env" +generics_typevartuple_args.py:34: error: Argument 3 to "exec_le" has incompatible type "str"; expected "Env" +generics_typevartuple_args.py:48: error: Argument 2 to "func1" has incompatible type "str"; expected "int" +generics_typevartuple_args.py:57: error: Argument 2 to "func2" has incompatible type "int"; expected "str" +generics_typevartuple_args.py:58: error: Too few arguments for "func2" +generics_typevartuple_args.py:59: error: Too few arguments for "func2" +generics_typevartuple_args.py:59: error: Argument 1 to "func2" has incompatible type "str"; expected "int" +generics_typevartuple_args.py:67: error: Too few arguments for "func3" +""" diff --git a/conformance/results/zuban/generics_typevartuple_basic.toml b/conformance/results/zuban/generics_typevartuple_basic.toml new file mode 100644 index 000000000..300c70d5b --- /dev/null +++ b/conformance/results/zuban/generics_typevartuple_basic.toml @@ -0,0 +1,31 @@ +conformant = "Partial" +notes = """ +Does not enforce that tuples captured by TypeVarTuple are same length. +Does not enforce that tuples captured by TypeVarTuple are same type. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 89: Expected 1 errors +Line 90: Expected 1 errors +Line 99: Expected 1 errors +Line 100: Expected 1 errors +Line 54: Unexpected errors ['generics_typevartuple_basic.py:54: error: Incompatible types in assignment (expression has type "tuple[Any]", variable has type "tuple[Unpack[Shape]]")'] +Line 57: Unexpected errors ['generics_typevartuple_basic.py:57: error: Incompatible return value type (got "tuple[Unpack[Shape]]", expected "tuple[Any]")'] +Line 84: Unexpected errors ['generics_typevartuple_basic.py:84: error: Expression is of type "tuple[Literal[0, 1]]", not "tuple[int]"'] +""" +output = """ +generics_typevartuple_basic.py:42: error: Argument 1 to "Array" has incompatible type "Height"; expected "tuple[Height, Width]" +generics_typevartuple_basic.py:43: error: Argument 1 to "Array" has incompatible type "tuple[Batch, Width]"; expected "tuple[Batch, Height, Width]" +generics_typevartuple_basic.py:45: error: Argument 1 to "Array" has incompatible type "tuple[Time, Batch, Width, Height]"; expected "tuple[Time, Batch, Height, Width]" +generics_typevartuple_basic.py:52: error: Free type variable expected in Generic[...] +generics_typevartuple_basic.py:53: error: TypeVarTuple "Shape" is only valid with an unpack +generics_typevartuple_basic.py:54: error: Incompatible types in assignment (expression has type "tuple[Any]", variable has type "tuple[Unpack[Shape]]") +generics_typevartuple_basic.py:56: error: TypeVarTuple "Shape" is only valid with an unpack +generics_typevartuple_basic.py:57: error: Incompatible return value type (got "tuple[Unpack[Shape]]", expected "tuple[Any]") +generics_typevartuple_basic.py:59: error: TypeVarTuple "Shape" is only valid with an unpack +generics_typevartuple_basic.py:65: error: Unexpected keyword argument "covariant" for "TypeVarTuple" +generics_typevartuple_basic.py:66: error: Too many positional arguments for "TypeVarTuple" +generics_typevartuple_basic.py:67: error: Unexpected keyword argument "bound" for "TypeVarTuple" +generics_typevartuple_basic.py:84: error: Expression is of type "tuple[Literal[0, 1]]", not "tuple[int]" +generics_typevartuple_basic.py:106: error: Can only use one type var tuple in a class def +""" diff --git a/conformance/results/zuban/generics_typevartuple_callable.toml b/conformance/results/zuban/generics_typevartuple_callable.toml new file mode 100644 index 000000000..6692b4b4f --- /dev/null +++ b/conformance/results/zuban/generics_typevartuple_callable.toml @@ -0,0 +1,6 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +generics_typevartuple_callable.py:26: error: Argument "args" to "Process" has incompatible type "tuple[str, int]"; expected "tuple[int, str]" +""" diff --git a/conformance/results/zuban/generics_typevartuple_concat.toml b/conformance/results/zuban/generics_typevartuple_concat.toml new file mode 100644 index 000000000..cdd4d0cd9 --- /dev/null +++ b/conformance/results/zuban/generics_typevartuple_concat.toml @@ -0,0 +1,5 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +""" diff --git a/conformance/results/zuban/generics_typevartuple_overloads.toml b/conformance/results/zuban/generics_typevartuple_overloads.toml new file mode 100644 index 000000000..cdd4d0cd9 --- /dev/null +++ b/conformance/results/zuban/generics_typevartuple_overloads.toml @@ -0,0 +1,5 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +""" diff --git a/conformance/results/zuban/generics_typevartuple_specialization.toml b/conformance/results/zuban/generics_typevartuple_specialization.toml new file mode 100644 index 000000000..0ace1caab --- /dev/null +++ b/conformance/results/zuban/generics_typevartuple_specialization.toml @@ -0,0 +1,12 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +generics_typevartuple_specialization.py:109: error: Unpack is only valid in a variadic position +generics_typevartuple_specialization.py:109: error: TypeVarTuple "Ts" is unbound +generics_typevartuple_specialization.py:110: error: Unpack is only valid in a variadic position +generics_typevartuple_specialization.py:121: error: More than one Unpack in a type is not allowed +generics_typevartuple_specialization.py:122: error: More than one Unpack in a type is not allowed +generics_typevartuple_specialization.py:127: error: Bad number of arguments for type alias, expected at least 2, given 2 +generics_typevartuple_specialization.py:163: error: TypeVarTuple cannot be split +""" diff --git a/conformance/results/zuban/generics_typevartuple_unpack.toml b/conformance/results/zuban/generics_typevartuple_unpack.toml new file mode 100644 index 000000000..4f43a5231 --- /dev/null +++ b/conformance/results/zuban/generics_typevartuple_unpack.toml @@ -0,0 +1,6 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +generics_typevartuple_unpack.py:30: error: Argument 1 to "process_batch_channels" has incompatible type "Array[Batch]"; expected "Array[Batch, Unpack[Tuple[Any, ...]], Channels]" +""" diff --git a/conformance/results/zuban/generics_upper_bound.toml b/conformance/results/zuban/generics_upper_bound.toml new file mode 100644 index 000000000..60e86bbaf --- /dev/null +++ b/conformance/results/zuban/generics_upper_bound.toml @@ -0,0 +1,13 @@ +conformant = "Partial" +notes = """ +Does not reject use of type variable within an upper bound. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 24: Expected 1 errors +""" +output = """ +generics_upper_bound.py:51: error: Value of type variable "ST" of "longer" cannot be "int" +generics_upper_bound.py:51: error: Value of type variable "ST" of "longer" cannot be "int" +generics_upper_bound.py:56: error: TypeVar cannot have both values and an upper bound +""" diff --git a/conformance/results/zuban/generics_variance.toml b/conformance/results/zuban/generics_variance.toml new file mode 100644 index 000000000..a363a8378 --- /dev/null +++ b/conformance/results/zuban/generics_variance.toml @@ -0,0 +1,22 @@ +conformant = "Partial" +notes = """ +Does not reject use of class-scoped TypeVar used in a base class when variance is incompatible. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 113: Expected 1 errors +Line 163: Expected 1 errors +Line 167: Expected 1 errors +Line 191: Expected 1 errors +Lines 141, 142: Expected error (tag 'CoContra_Child5') +Lines 195, 196: Expected error (tag 'ContraToContraToContra_WithTA') +""" +output = """ +generics_variance.py:14: error: TypeVar cannot be both covariant and contravariant +generics_variance.py:77: error: Variance of TypeVar "T_co" incompatible with variance in parent type +generics_variance.py:81: error: Variance of TypeVar "T_contra" incompatible with variance in parent type +generics_variance.py:93: error: Variance of TypeVar "T_contra" incompatible with variance in parent type +generics_variance.py:105: error: Variance of TypeVar "T_co" incompatible with variance in parent type +generics_variance.py:126: error: Variance of TypeVar "T_co" incompatible with variance in parent type +generics_variance.py:132: error: Variance of TypeVar "T_contra" incompatible with variance in parent type +""" diff --git a/conformance/results/zuban/generics_variance_inference.toml b/conformance/results/zuban/generics_variance_inference.toml new file mode 100644 index 000000000..1ffa25b3b --- /dev/null +++ b/conformance/results/zuban/generics_variance_inference.toml @@ -0,0 +1,28 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +generics_variance_inference.py:24: error: Incompatible types in assignment (expression has type "ClassA[float, int, int]", variable has type "ClassA[int, int, int]") +generics_variance_inference.py:25: error: Incompatible types in assignment (expression has type "ClassA[float, int, int]", variable has type "ClassA[float, float, int]") +generics_variance_inference.py:28: error: Incompatible types in assignment (expression has type "ClassA[int, float, float]", variable has type "ClassA[int, int, int]") +generics_variance_inference.py:41: error: Incompatible types in assignment (expression has type "ShouldBeCovariant1[float]", variable has type "ShouldBeCovariant1[int]") +generics_variance_inference.py:49: error: Incompatible types in assignment (expression has type "ShouldBeCovariant2[float]", variable has type "ShouldBeCovariant2[int]") +generics_variance_inference.py:58: error: Incompatible types in assignment (expression has type "ShouldBeCovariant3[float]", variable has type "ShouldBeCovariant3[int]") +generics_variance_inference.py:67: error: Incompatible types in assignment (expression has type "ShouldBeCovariant4[float]", variable has type "ShouldBeCovariant4[int]") +generics_variance_inference.py:80: error: Incompatible types in assignment (expression has type "ShouldBeCovariant5[float]", variable has type "ShouldBeCovariant5[int]") +generics_variance_inference.py:96: error: Incompatible types in assignment (expression has type "ShouldBeInvariant1[int]", variable has type "ShouldBeInvariant1[float]") +generics_variance_inference.py:97: error: Incompatible types in assignment (expression has type "ShouldBeInvariant1[float]", variable has type "ShouldBeInvariant1[int]") +generics_variance_inference.py:111: error: Incompatible types in assignment (expression has type "ShouldBeInvariant2[int]", variable has type "ShouldBeInvariant2[float]") +generics_variance_inference.py:112: error: Incompatible types in assignment (expression has type "ShouldBeInvariant2[float]", variable has type "ShouldBeInvariant2[int]") +generics_variance_inference.py:119: error: Incompatible types in assignment (expression has type "ShouldBeInvariant3[int, str]", variable has type "ShouldBeInvariant3[float, str]") +generics_variance_inference.py:120: error: Incompatible types in assignment (expression has type "ShouldBeInvariant3[float, str]", variable has type "ShouldBeInvariant3[int, str]") +generics_variance_inference.py:121: error: Incompatible types in assignment (expression has type "ShouldBeInvariant3[str, int]", variable has type "ShouldBeInvariant3[str, float]") +generics_variance_inference.py:122: error: Incompatible types in assignment (expression has type "ShouldBeInvariant3[str, float]", variable has type "ShouldBeInvariant3[str, int]") +generics_variance_inference.py:130: error: Incompatible types in assignment (expression has type "ShouldBeInvariant4[int]", variable has type "ShouldBeInvariant4[float]") +generics_variance_inference.py:138: error: Incompatible types in assignment (expression has type "ShouldBeInvariant5[int]", variable has type "ShouldBeInvariant5[float]") +generics_variance_inference.py:149: error: Incompatible types in assignment (expression has type "ShouldBeContravariant1[int]", variable has type "ShouldBeContravariant1[float]") +generics_variance_inference.py:169: error: Incompatible types in assignment (expression has type "ShouldBeInvariant6[float]", variable has type "ShouldBeInvariant6[int]") +generics_variance_inference.py:170: error: Incompatible types in assignment (expression has type "ShouldBeInvariant6[int]", variable has type "ShouldBeInvariant6[float]") +generics_variance_inference.py:181: error: Incompatible types in assignment (expression has type "ShouldBeCovariant6[float]", variable has type "ShouldBeCovariant6[int]") +generics_variance_inference.py:194: error: Incompatible types in assignment (expression has type "ShouldBeContravariant2[int]", variable has type "ShouldBeContravariant2[float]") +""" diff --git a/conformance/results/zuban/historical_positional.toml b/conformance/results/zuban/historical_positional.toml new file mode 100644 index 000000000..50a395d0d --- /dev/null +++ b/conformance/results/zuban/historical_positional.toml @@ -0,0 +1,17 @@ +conformant = "Partial" +notes = """ +Does not reject positional-only parameter after non-positional-only parameter. +Treats keyword-only parameter as positional-only. +Applies legacy positional-only rules when PEP 570 syntax is used. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 26: Expected 1 errors +Line 38: Expected 1 errors +Line 53: Unexpected errors ['historical_positional.py:53: error: Unexpected keyword argument "__y" for "f4"'] +""" +output = """ +historical_positional.py:18: error: Unexpected keyword argument "__x" for "f1" +historical_positional.py:43: error: Unexpected keyword argument "__x" for "m1" of "A" +historical_positional.py:53: error: Unexpected keyword argument "__y" for "f4" +""" diff --git a/conformance/results/zuban/literals_interactions.toml b/conformance/results/zuban/literals_interactions.toml new file mode 100644 index 000000000..8beb65e72 --- /dev/null +++ b/conformance/results/zuban/literals_interactions.toml @@ -0,0 +1,17 @@ +conformant = "Partial" +notes = """ +Does not narrow type of `x` with `x in Literal` type guard pattern. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 106: Unexpected errors ['literals_interactions.py:106: error: Argument 1 to "expects_bad_status" has incompatible type "str"; expected "Literal[\\'MALFORMED\\', \\'ABORTED\\']"'] +Line 109: Unexpected errors ['literals_interactions.py:109: error: Argument 1 to "expects_pending_status" has incompatible type "str"; expected "Literal[\\'PENDING\\']"'] +""" +output = """ +literals_interactions.py:15: error: Tuple index out of range +literals_interactions.py:16: error: Tuple index out of range +literals_interactions.py:17: error: Tuple index out of range +literals_interactions.py:18: error: Tuple index out of range +literals_interactions.py:106: error: Argument 1 to "expects_bad_status" has incompatible type "str"; expected "Literal['MALFORMED', 'ABORTED']" +literals_interactions.py:109: error: Argument 1 to "expects_pending_status" has incompatible type "str"; expected "Literal['PENDING']" +""" diff --git a/conformance/results/zuban/literals_literalstring.toml b/conformance/results/zuban/literals_literalstring.toml new file mode 100644 index 000000000..fbc6b507f --- /dev/null +++ b/conformance/results/zuban/literals_literalstring.toml @@ -0,0 +1,22 @@ +conformant = "Unsupported" +notes = """ +Support for `LiteralString` is not implemented. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 66: Expected 1 errors +Line 120: Expected 1 errors +Line 134: Expected 1 errors +Line 171: Expected 1 errors +Line 157: Unexpected errors ["literals_literalstring.py:157: error: Overloaded function signature 3 will never be matched: signature 2's parameter type(s) are the same or broader"] +Line 167: Unexpected errors ['literals_literalstring.py:167: error: Expression is of type "B", not "A"'] +""" +output = """ +literals_literalstring.py:36: error: Parameter 2 of Literal[...] is invalid +literals_literalstring.py:37: error: Parameter 1 of Literal[...] is invalid +literals_literalstring.py:43: error: Incompatible types in assignment (expression has type "Literal['two']", variable has type "Literal['']") +literals_literalstring.py:74: error: Incompatible types in assignment (expression has type "int", variable has type "str") +literals_literalstring.py:75: error: Incompatible types in assignment (expression has type "bytes", variable has type "str") +literals_literalstring.py:157: error: Overloaded function signature 3 will never be matched: signature 2's parameter type(s) are the same or broader +literals_literalstring.py:167: error: Expression is of type "B", not "A" +""" diff --git a/conformance/results/zuban/literals_parameterizations.toml b/conformance/results/zuban/literals_parameterizations.toml new file mode 100644 index 000000000..06c6df1b4 --- /dev/null +++ b/conformance/results/zuban/literals_parameterizations.toml @@ -0,0 +1,24 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +literals_parameterizations.py:41: error: Invalid type: Literal[...] cannot contain arbitrary expressions +literals_parameterizations.py:42: error: Invalid type: Literal[...] cannot contain arbitrary expressions +literals_parameterizations.py:43: error: Invalid type: Literal[...] cannot contain arbitrary expressions +literals_parameterizations.py:44: error: Invalid type: Literal[...] cannot contain arbitrary expressions +literals_parameterizations.py:45: error: Invalid type: Literal[...] cannot contain arbitrary expressions +literals_parameterizations.py:46: error: Invalid type: Literal[...] cannot contain arbitrary expressions +literals_parameterizations.py:47: error: Invalid type: Literal[...] cannot contain arbitrary expressions +literals_parameterizations.py:48: error: Parameter 1 of Literal[...] is invalid +literals_parameterizations.py:49: error: Parameter 1 of Literal[...] is invalid +literals_parameterizations.py:50: error: Type variable "literals_parameterizations.T" is unbound +literals_parameterizations.py:50: note: (Hint: Use "Generic[T]" or "Protocol[T]" base class to bind "T" inside a class) +literals_parameterizations.py:50: note: (Hint: Use "T" in function signature to bind "T" inside a function) +literals_parameterizations.py:51: error: Parameter 1 of Literal[...] cannot be of type "float" +literals_parameterizations.py:52: error: Parameter 1 of Literal[...] cannot be of type "Any" +literals_parameterizations.py:53: error: Invalid type: Literal[...] cannot contain arbitrary expressions +literals_parameterizations.py:56: error: Invalid type: Literal[...] cannot contain arbitrary expressions +literals_parameterizations.py:60: error: Literal[...] must have at least one parameter +literals_parameterizations.py:61: error: Parameter 1 of Literal[...] is invalid +literals_parameterizations.py:65: error: Incompatible types in assignment (expression has type "Literal[Color.RED]", variable has type "Literal['Color.RED']") +""" diff --git a/conformance/results/zuban/literals_semantics.toml b/conformance/results/zuban/literals_semantics.toml new file mode 100644 index 000000000..053b2add6 --- /dev/null +++ b/conformance/results/zuban/literals_semantics.toml @@ -0,0 +1,9 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +literals_semantics.py:10: error: Incompatible types in assignment (expression has type "Literal[4]", variable has type "Literal[3]") +literals_semantics.py:24: error: Incompatible types in assignment (expression has type "Literal[0]", variable has type "Literal[False]") +literals_semantics.py:25: error: Incompatible types in assignment (expression has type "Literal[False]", variable has type "Literal[0]") +literals_semantics.py:33: error: Incompatible types in assignment (expression has type "int", variable has type "Literal[3, 4, 5]") +""" diff --git a/conformance/results/zuban/namedtuples_define_class.toml b/conformance/results/zuban/namedtuples_define_class.toml new file mode 100644 index 000000000..22fde13ae --- /dev/null +++ b/conformance/results/zuban/namedtuples_define_class.toml @@ -0,0 +1,21 @@ +conformant = "Partial" +notes = """ +Does not reject override of named tuple attribute in child class. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 79: Expected 1 errors +""" +output = """ +namedtuples_define_class.py:32: error: Tuple index out of range +namedtuples_define_class.py:33: error: Tuple index out of range +namedtuples_define_class.py:44: error: Missing positional argument "y" in call to "Point" +namedtuples_define_class.py:45: error: Missing positional argument "y" in call to "Point" +namedtuples_define_class.py:46: error: Argument 2 to "Point" has incompatible type "str"; expected "int" +namedtuples_define_class.py:47: error: Argument "units" to "Point" has incompatible type "int"; expected "str" +namedtuples_define_class.py:48: error: Too many arguments for "Point" +namedtuples_define_class.py:49: error: Unexpected keyword argument "other" for "Point" +namedtuples_define_class.py:59: error: Non-default NamedTuple fields cannot follow default fields +namedtuples_define_class.py:98: error: Argument 2 to "Property" has incompatible type "float"; expected "str" +namedtuples_define_class.py:105: error: NamedTuple should be a single base +""" diff --git a/conformance/results/zuban/namedtuples_define_functional.toml b/conformance/results/zuban/namedtuples_define_functional.toml new file mode 100644 index 000000000..3c3045694 --- /dev/null +++ b/conformance/results/zuban/namedtuples_define_functional.toml @@ -0,0 +1,17 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +namedtuples_define_functional.py:16: error: Missing positional argument "y" in call to "Point1" +namedtuples_define_functional.py:21: error: Missing positional arguments "x", "y" in call to "Point2" +namedtuples_define_functional.py:26: error: Too many arguments for "Point3" +namedtuples_define_functional.py:31: error: Unexpected keyword argument "z" for "Point4" +namedtuples_define_functional.py:36: error: Argument 2 to "Point5" has incompatible type "str"; expected "int" +namedtuples_define_functional.py:37: error: Too many arguments for "Point5" +namedtuples_define_functional.py:42: error: Argument 2 to "Point6" has incompatible type "str"; expected "int" +namedtuples_define_functional.py:43: error: Argument "x" to "Point6" has incompatible type "float"; expected "int" +namedtuples_define_functional.py:52: error: "namedtuple()" has duplicate field name "a" +namedtuples_define_functional.py:53: error: "namedtuple()" field name "def" is a keyword +namedtuples_define_functional.py:54: error: "namedtuple()" field name "def" is a keyword +namedtuples_define_functional.py:66: error: Missing positional argument "a" in call to "NT5" +""" diff --git a/conformance/results/zuban/namedtuples_type_compat.toml b/conformance/results/zuban/namedtuples_type_compat.toml new file mode 100644 index 000000000..958d58be0 --- /dev/null +++ b/conformance/results/zuban/namedtuples_type_compat.toml @@ -0,0 +1,7 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +namedtuples_type_compat.py:22: error: Incompatible types in assignment (expression has type "Point", variable has type "tuple[int, int]") +namedtuples_type_compat.py:23: error: Incompatible types in assignment (expression has type "Point", variable has type "tuple[int, str, str]") +""" diff --git a/conformance/results/zuban/namedtuples_usage.toml b/conformance/results/zuban/namedtuples_usage.toml new file mode 100644 index 000000000..1de5df047 --- /dev/null +++ b/conformance/results/zuban/namedtuples_usage.toml @@ -0,0 +1,13 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +namedtuples_usage.py:34: error: Tuple index out of range +namedtuples_usage.py:35: error: Tuple index out of range +namedtuples_usage.py:40: error: Property "x" defined in "Point" is read-only +namedtuples_usage.py:41: error: Unsupported target for indexed assignment ("Point") +namedtuples_usage.py:42: error: NamedTuple attributes cannot be deleted +namedtuples_usage.py:43: error: "Point" has no attribute "__delitem__" +namedtuples_usage.py:52: error: Too many values to unpack (2 expected, 3 provided) +namedtuples_usage.py:53: error: Need more than 3 values to unpack (4 expected) +""" diff --git a/conformance/results/zuban/narrowing_typeguard.toml b/conformance/results/zuban/narrowing_typeguard.toml new file mode 100644 index 000000000..e63346008 --- /dev/null +++ b/conformance/results/zuban/narrowing_typeguard.toml @@ -0,0 +1,9 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +narrowing_typeguard.py:102: error: TypeGuard functions must have a positional argument +narrowing_typeguard.py:107: error: TypeGuard functions must have a positional argument +narrowing_typeguard.py:128: error: Argument 1 to "takes_callable_str" has incompatible type "Callable[[object], TypeGuard[int]]"; expected "Callable[[object], str]" +narrowing_typeguard.py:148: error: Argument 1 to "takes_callable_str_proto" has incompatible type "Callable[[object], TypeGuard[int]]"; expected "CallableStrProto" +""" diff --git a/conformance/results/zuban/narrowing_typeis.toml b/conformance/results/zuban/narrowing_typeis.toml new file mode 100644 index 000000000..ff20cda3a --- /dev/null +++ b/conformance/results/zuban/narrowing_typeis.toml @@ -0,0 +1,14 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +narrowing_typeis.py:105: error: "TypeIs" functions must have a positional argument +narrowing_typeis.py:110: error: "TypeIs" functions must have a positional argument +narrowing_typeis.py:132: error: Argument 1 to "takes_callable_str" has incompatible type "Callable[[object], TypeIs[int]]"; expected "Callable[[object], str]" +narrowing_typeis.py:152: error: Argument 1 to "takes_callable_str_proto" has incompatible type "Callable[[object], TypeIs[int]]"; expected "CallableStrProto" +narrowing_typeis.py:169: error: Argument 1 to "takes_typeguard" has incompatible type "Callable[[object], TypeIs[int]]"; expected "Callable[[object], TypeGuard[int]]" +narrowing_typeis.py:170: error: Argument 1 to "takes_typeis" has incompatible type "Callable[[object], TypeGuard[int]]"; expected "Callable[[object], TypeIs[int]]" +narrowing_typeis.py:191: error: Argument 1 to "takes_int_typeis" has incompatible type "Callable[[object], TypeIs[bool]]"; expected "Callable[[object], TypeIs[int]]" +narrowing_typeis.py:195: error: Narrowed type "str" is not a subtype of input type "int" +narrowing_typeis.py:199: error: Narrowed type "list[int]" is not a subtype of input type "list[object]" +""" diff --git a/conformance/results/zuban/overloads_basic.toml b/conformance/results/zuban/overloads_basic.toml new file mode 100644 index 000000000..d2a447746 --- /dev/null +++ b/conformance/results/zuban/overloads_basic.toml @@ -0,0 +1,9 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +overloads_basic.py:39: error: No overload variant of "__getitem__" of "Bytes" matches argument type "str" +overloads_basic.py:39: note: Possible overload variants: +overloads_basic.py:39: note: def __getitem__(self, int, /) -> int +overloads_basic.py:39: note: def __getitem__(self, slice[Any, Any, Any], /) -> bytes +""" diff --git a/conformance/results/zuban/overloads_consistency.toml b/conformance/results/zuban/overloads_consistency.toml new file mode 100644 index 000000000..41c2ec4fb --- /dev/null +++ b/conformance/results/zuban/overloads_consistency.toml @@ -0,0 +1,7 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +overloads_consistency.py:28: error: Overloaded function implementation cannot produce return type of signature 2 +overloads_consistency.py:44: error: Overloaded function implementation does not accept all possible arguments of signature 2 +""" diff --git a/conformance/results/zuban/overloads_definitions.toml b/conformance/results/zuban/overloads_definitions.toml new file mode 100644 index 000000000..200451cd1 --- /dev/null +++ b/conformance/results/zuban/overloads_definitions.toml @@ -0,0 +1,17 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +overloads_definitions.py:15: error: Single overload definition, multiple required +overloads_definitions.py:28: error: An overloaded function outside a stub file must have an implementation +overloads_definitions.py:59: error: An overloaded function outside a stub file must have an implementation +overloads_definitions.py:71: error: Overload does not consistently use the "@staticmethod" decorator on all function signatures. +overloads_definitions.py:84: error: Overload does not consistently use the "@classmethod" decorator on all function signatures. +overloads_definitions.py:122: error: @final should be applied only to overload implementation +overloads_definitions.py:136: error: @final should be applied only to overload implementation +overloads_definitions.py:141: error: @final should be applied only to overload implementation +overloads_definitions.py:175: error: Cannot override final attribute "final_method" (previously declared in base class "Base") +overloads_definitions.py:190: error: Method "bad_override" is marked as an override, but no base method was found with this name +overloads_definitions.py:221: error: @override should be applied only to overload implementation +overloads_definitions.py:225: error: @override should be applied only to overload implementation +""" diff --git a/conformance/results/zuban/overloads_definitions_stub.toml b/conformance/results/zuban/overloads_definitions_stub.toml new file mode 100644 index 000000000..8bb641f43 --- /dev/null +++ b/conformance/results/zuban/overloads_definitions_stub.toml @@ -0,0 +1,13 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +overloads_definitions_stub.pyi:13: error: Single overload definition, multiple required +overloads_definitions_stub.pyi:32: error: Overload does not consistently use the "@staticmethod" decorator on all function signatures. +overloads_definitions_stub.pyi:39: error: Overload does not consistently use the "@classmethod" decorator on all function signatures. +overloads_definitions_stub.pyi:72: error: In a stub file @final must be applied only to the first overload +overloads_definitions_stub.pyi:85: error: In a stub file @final must be applied only to the first overload +overloads_definitions_stub.pyi:107: error: Cannot override final attribute "final_method" (previously declared in base class "Base") +overloads_definitions_stub.pyi:120: error: Method "bad_override" is marked as an override, but no base method was found with this name +overloads_definitions_stub.pyi:146: error: In a stub file @override must be applied only to the first overload +""" diff --git a/conformance/results/zuban/overloads_evaluation.toml b/conformance/results/zuban/overloads_evaluation.toml new file mode 100644 index 000000000..45c1a5e73 --- /dev/null +++ b/conformance/results/zuban/overloads_evaluation.toml @@ -0,0 +1,53 @@ +conformant = "Partial" +notes = """ +Does not expand boolean arguments to Literal[True] and Literal[False]. +Does not expand enum arguments to literal variants. +Does not expand tuple arguments to possible combinations. +Does not evaluate Any in some cases where overload is ambiguous. +Evaluates Any in some cases where overload is not ambiguous. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 134: Unexpected errors ['overloads_evaluation.py:134: error: No overload variant of "expand_bool" matches argument type "bool"'] +Line 135: Unexpected errors ['overloads_evaluation.py:135: error: Expression is of type "Any", not "Literal[0, 1]"'] +Line 160: Unexpected errors ['overloads_evaluation.py:160: error: No overload variant of "expand_enum" matches argument type "Color"'] +Line 161: Unexpected errors ['overloads_evaluation.py:161: error: Expression is of type "Any", not "Literal[0, 1]"'] +Line 204: Unexpected errors ['overloads_evaluation.py:204: error: Argument 1 to "expand_tuple" has incompatible type "tuple[int, int | str]"; expected "tuple[int, int]"'] +Line 205: Unexpected errors ['overloads_evaluation.py:205: error: Expression is of type "int", not "int | str"'] +Line 261: Unexpected errors ['overloads_evaluation.py:261: error: Expression is of type "list[Any]", not "list[int]"'] +Line 264: Unexpected errors ['overloads_evaluation.py:264: error: Expression is of type "list[Any]", not "Any"'] +Line 280: Unexpected errors ['overloads_evaluation.py:280: error: Expression is of type "list[Any]", not "Any"'] +Line 345: Unexpected errors ['overloads_evaluation.py:345: error: Expression is of type "list[Any]", not "Any"'] +""" +output = """ +overloads_evaluation.py:38: error: All overload variants of "example1_1" require at least one argument +overloads_evaluation.py:38: note: Possible overload variants: +overloads_evaluation.py:38: note: def example1_1(x: int, y: str) -> int +overloads_evaluation.py:38: note: def example1_1(x: str) -> str +overloads_evaluation.py:46: error: No overload variant of "example1_1" matches argument types "int", "int" +overloads_evaluation.py:46: note: Possible overload variants: +overloads_evaluation.py:46: note: def example1_1(x: int, y: str) -> int +overloads_evaluation.py:46: note: def example1_1(x: str) -> str +overloads_evaluation.py:51: error: No overload variant of "example1_1" matches argument type "int" +overloads_evaluation.py:51: note: Possible overload variants: +overloads_evaluation.py:51: note: def example1_1(x: int, y: str) -> int +overloads_evaluation.py:51: note: def example1_1(x: str) -> str +overloads_evaluation.py:115: error: Argument 1 to "example2" has incompatible type "int | str"; expected "int" +overloads_evaluation.py:115: error: Argument 2 to "example2" has incompatible type "int | str"; expected "str" +overloads_evaluation.py:134: error: No overload variant of "expand_bool" matches argument type "bool" +overloads_evaluation.py:134: note: Possible overload variants: +overloads_evaluation.py:134: note: def expand_bool(x: Literal[False]) -> Literal[0] +overloads_evaluation.py:134: note: def expand_bool(x: Literal[True]) -> Literal[1] +overloads_evaluation.py:135: error: Expression is of type "Any", not "Literal[0, 1]" +overloads_evaluation.py:160: error: No overload variant of "expand_enum" matches argument type "Color" +overloads_evaluation.py:160: note: Possible overload variants: +overloads_evaluation.py:160: note: def expand_enum(x: Literal[Color.RED]) -> Literal[0] +overloads_evaluation.py:160: note: def expand_enum(x: Literal[Color.BLUE]) -> Literal[1] +overloads_evaluation.py:161: error: Expression is of type "Any", not "Literal[0, 1]" +overloads_evaluation.py:204: error: Argument 1 to "expand_tuple" has incompatible type "tuple[int, int | str]"; expected "tuple[int, int]" +overloads_evaluation.py:205: error: Expression is of type "int", not "int | str" +overloads_evaluation.py:261: error: Expression is of type "list[Any]", not "list[int]" +overloads_evaluation.py:264: error: Expression is of type "list[Any]", not "Any" +overloads_evaluation.py:280: error: Expression is of type "list[Any]", not "Any" +overloads_evaluation.py:345: error: Expression is of type "list[Any]", not "Any" +""" diff --git a/conformance/results/zuban/protocols_class_objects.toml b/conformance/results/zuban/protocols_class_objects.toml new file mode 100644 index 000000000..29f10b1b2 --- /dev/null +++ b/conformance/results/zuban/protocols_class_objects.toml @@ -0,0 +1,25 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +protocols_class_objects.py:29: error: Only concrete class can be given where "Type[Proto]" is expected +protocols_class_objects.py:34: error: Can only assign concrete classes to a variable of type "Type[Proto]" +protocols_class_objects.py:58: error: Incompatible types in assignment (expression has type "Type[ConcreteA]", variable has type "ProtoA1") +protocols_class_objects.py:58: note: Following member(s) of "ConcreteA" have conflicts: +protocols_class_objects.py:58: note: Expected: +protocols_class_objects.py:58: note: def method1(x: int) -> int +protocols_class_objects.py:58: note: Got: +protocols_class_objects.py:58: note: def method1(self: ConcreteA, x: int) -> int +protocols_class_objects.py:74: error: Incompatible types in assignment (expression has type "Type[ConcreteB]", variable has type "ProtoB1") +protocols_class_objects.py:74: note: Following member(s) of "ConcreteB" have conflicts: +protocols_class_objects.py:74: note: prop1: expected "int", got "property" +protocols_class_objects.py:104: error: Incompatible types in assignment (expression has type "Type[ConcreteC1]", variable has type "ProtoC1") +protocols_class_objects.py:104: note: ClassVar protocol member ProtoC1.attr1 can never be matched by a class object +protocols_class_objects.py:106: error: Incompatible types in assignment (expression has type "Type[ConcreteC2]", variable has type "ProtoC1") +protocols_class_objects.py:106: note: Protocol member ProtoC1.attr1 expected class variable, got instance variable +protocols_class_objects.py:106: note: Only class variables allowed for class object access on protocols, attr1 is an instance variable of "ConcreteC2" +protocols_class_objects.py:107: error: Incompatible types in assignment (expression has type "Type[ConcreteC2]", variable has type "ProtoC2") +protocols_class_objects.py:107: note: Only class variables allowed for class object access on protocols, attr1 is an instance variable of "ConcreteC2" +protocols_class_objects.py:108: error: Incompatible types in assignment (expression has type "Type[ConcreteC3]", variable has type "ProtoC1") +protocols_class_objects.py:108: note: ClassVar protocol member ProtoC1.attr1 can never be matched by a class object +""" diff --git a/conformance/results/zuban/protocols_definition.toml b/conformance/results/zuban/protocols_definition.toml new file mode 100644 index 000000000..a1ce5c87c --- /dev/null +++ b/conformance/results/zuban/protocols_definition.toml @@ -0,0 +1,60 @@ +conformant = "Partial" +notes = """ +Does not detect protocol mismatch if concrete method is missing annotations. +Does not detect protocol mismatch if concrete method's parameters are position-only. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 285: Expected 1 errors +Line 286: Expected 1 errors +Line 288: Expected 1 errors +""" +output = """ +protocols_definition.py:30: error: List item 0 has incompatible type "int"; expected "SupportsClose" +protocols_definition.py:67: error: Protocol members cannot be defined via assignment to self +protocols_definition.py:67: error: "Template" has no attribute "temp" +protocols_definition.py:114: error: Incompatible types in assignment (expression has type "Concrete2_Bad1", variable has type "Template2") +protocols_definition.py:115: error: Incompatible types in assignment (expression has type "Concrete2_Bad2", variable has type "Template2") +protocols_definition.py:115: note: Following member(s) of "Concrete2_Bad2" have conflicts: +protocols_definition.py:115: note: val1: expected "Sequence[int]", got "Sequence[float]" +protocols_definition.py:115: note: Protocol member Template2.val1 expected class variable, got instance variable +protocols_definition.py:116: error: Incompatible types in assignment (expression has type "Concrete2_Bad3", variable has type "Template2") +protocols_definition.py:116: note: Following member(s) of "Concrete2_Bad3" have conflicts: +protocols_definition.py:116: note: val1: expected "Sequence[int]", got "list[int]" +protocols_definition.py:116: note: Protocol member Template2.val1 expected class variable, got instance variable +protocols_definition.py:117: error: Incompatible types in assignment (expression has type "Concrete2_Bad4", variable has type "Template2") +protocols_definition.py:117: note: Protocol member Template2.val1 expected class variable, got instance variable +protocols_definition.py:156: error: Incompatible types in assignment (expression has type "Concrete3_Bad1", variable has type "Template3") +protocols_definition.py:157: error: Incompatible types in assignment (expression has type "Concrete3_Bad2", variable has type "Template3") +protocols_definition.py:157: note: Protocol member Template3.val1 expected instance variable, got class variable +protocols_definition.py:158: error: Incompatible types in assignment (expression has type "Concrete3_Bad3", variable has type "Template3") +protocols_definition.py:158: note: Protocol member Template3.val1 expected settable variable, got read-only attribute +protocols_definition.py:159: error: Incompatible types in assignment (expression has type "Concrete3_Bad4", variable has type "Template3") +protocols_definition.py:159: note: Following member(s) of "Concrete3_Bad4" have conflicts: +protocols_definition.py:159: note: val1: expected "Sequence[int]", got "Sequence[float]" +protocols_definition.py:160: error: Incompatible types in assignment (expression has type "Concrete3_Bad5", variable has type "Template3") +protocols_definition.py:160: note: Following member(s) of "Concrete3_Bad5" have conflicts: +protocols_definition.py:160: note: val1: expected "Sequence[int]", got "list[int]" +protocols_definition.py:218: error: Incompatible types in assignment (expression has type "Concrete4_Bad1", variable has type "Template4") +protocols_definition.py:218: note: Following member(s) of "Concrete4_Bad1" have conflicts: +protocols_definition.py:218: note: val1: expected "Sequence[float]", got "Callable[[], Sequence[int]]" +protocols_definition.py:219: error: Incompatible types in assignment (expression has type "Concrete4_Bad2", variable has type "Template4") +protocols_definition.py:287: error: Incompatible types in assignment (expression has type "Concrete5_Bad3", variable has type "Template5") +protocols_definition.py:287: note: Following member(s) of "Concrete5_Bad3" have conflicts: +protocols_definition.py:287: note: Expected: +protocols_definition.py:287: note: def method1(self, a: int, b: int) -> float +protocols_definition.py:287: note: Got: +protocols_definition.py:287: note: def method1(self, *, a: int, b: int) -> float +protocols_definition.py:289: error: Incompatible types in assignment (expression has type "Concrete5_Bad5", variable has type "Template5") +protocols_definition.py:289: note: Following member(s) of "Concrete5_Bad5" have conflicts: +protocols_definition.py:289: note: Expected: +protocols_definition.py:289: note: def method1(self: Template5, a: int, b: int) -> float +protocols_definition.py:289: note: Got: +protocols_definition.py:289: note: def method1(self: Any, a: int, b: int) -> float +protocols_definition.py:339: error: Incompatible types in assignment (expression has type "Concrete6_Bad1", variable has type "Template6") +protocols_definition.py:339: note: Protocol member Template6.val1 expected settable variable, got read-only attribute +protocols_definition.py:340: error: Incompatible types in assignment (expression has type "Concrete6_Bad2", variable has type "Template6") +protocols_definition.py:340: note: Protocol member Template6.val1 expected settable variable, got read-only attribute +protocols_definition.py:341: error: Incompatible types in assignment (expression has type "Concrete6_Bad3", variable has type "Template6") +protocols_definition.py:341: note: Protocol member Template6.val1 expected settable variable, got read-only attribute +""" diff --git a/conformance/results/zuban/protocols_explicit.toml b/conformance/results/zuban/protocols_explicit.toml new file mode 100644 index 000000000..3a515ecf3 --- /dev/null +++ b/conformance/results/zuban/protocols_explicit.toml @@ -0,0 +1,16 @@ +conformant = "Pass" +conformance_automated = "Fail" +notes = """ +Does not report unimplemented attributes for class that explicitly derives from protocol until it is instantiated. +""" +errors_diff = """ +Line 90: Expected 1 errors +Line 110: Expected 1 errors +""" +output = """ +protocols_explicit.py:27: error: Call to abstract method "draw" of "PColor" with trivial body via super() is unsafe +protocols_explicit.py:56: error: Incompatible types in assignment (expression has type "tuple[int, int, str]", variable has type "tuple[int, int, int]") +protocols_explicit.py:60: error: Cannot instantiate abstract class "Point" with abstract attributes "intensity" and "transparency" +protocols_explicit.py:135: error: Cannot instantiate abstract class "Concrete5" with abstract attribute "method1" +protocols_explicit.py:165: error: Cannot instantiate abstract class "Concrete7A" with abstract attribute "method1" +""" diff --git a/conformance/results/zuban/protocols_generic.toml b/conformance/results/zuban/protocols_generic.toml new file mode 100644 index 000000000..ab3b3ae35 --- /dev/null +++ b/conformance/results/zuban/protocols_generic.toml @@ -0,0 +1,39 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +protocols_generic.py:40: error: Incompatible types in assignment (expression has type "Concrete1", variable has type "Proto1[int, str]") +protocols_generic.py:40: note: Following member(s) of "Concrete1" have conflicts: +protocols_generic.py:40: note: Expected: +protocols_generic.py:40: note: def method1(self, x: int) -> int +protocols_generic.py:40: note: Got: +protocols_generic.py:40: note: def method1(self, x: str) -> str +protocols_generic.py:40: note: Expected: +protocols_generic.py:40: note: def __iter__(self) -> Iterator[str] +protocols_generic.py:40: note: Got: +protocols_generic.py:40: note: def __iter__(self) -> Iterator[int] +protocols_generic.py:44: error: Only single Generic[...] or Protocol[...] can be in bases +protocols_generic.py:56: error: Incompatible types in assignment (expression has type "Box[float]", variable has type "Box[int]") +protocols_generic.py:66: error: Incompatible types in assignment (expression has type "Sender[int]", variable has type "Sender[float]") +protocols_generic.py:74: error: Incompatible types in assignment (expression has type "AttrProto[int]", variable has type "AttrProto[float]") +protocols_generic.py:75: error: Incompatible types in assignment (expression has type "AttrProto[float]", variable has type "AttrProto[int]") +protocols_generic.py:145: error: Incompatible types in assignment (expression has type "ConcreteHasProperty2", variable has type "HasPropertyProto") +protocols_generic.py:145: note: Following member(s) of "ConcreteHasProperty2" have conflicts: +protocols_generic.py:145: note: Expected: +protocols_generic.py:145: note: def [T] m(self, item: T, callback: Callable[[T], str]) -> str +protocols_generic.py:145: note: Got: +protocols_generic.py:145: note: def m(self, item: int, callback: Callable[[int], str]) -> str +protocols_generic.py:146: error: Incompatible types in assignment (expression has type "ConcreteHasProperty3", variable has type "HasPropertyProto") +protocols_generic.py:146: note: Following member(s) of "ConcreteHasProperty3" have conflicts: +protocols_generic.py:146: note: f: expected "ConcreteHasProperty3", got "int" +protocols_generic.py:146: note: Expected: +protocols_generic.py:146: note: def [T] m(self, item: T, callback: Callable[[T], str]) -> str +protocols_generic.py:146: note: Got: +protocols_generic.py:146: note: def m(self, item: int, callback: Callable[[int], str]) -> str +protocols_generic.py:147: error: Incompatible types in assignment (expression has type "ConcreteHasProperty4", variable has type "HasPropertyProto") +protocols_generic.py:147: note: Following member(s) of "ConcreteHasProperty4" have conflicts: +protocols_generic.py:147: note: Expected: +protocols_generic.py:147: note: def [T] m(self, item: T, callback: Callable[[T], str]) -> str +protocols_generic.py:147: note: Got: +protocols_generic.py:147: note: def m(self, item: str, callback: Callable[[int], str]) -> str +""" diff --git a/conformance/results/zuban/protocols_merging.toml b/conformance/results/zuban/protocols_merging.toml new file mode 100644 index 000000000..747ee0b5f --- /dev/null +++ b/conformance/results/zuban/protocols_merging.toml @@ -0,0 +1,15 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +protocols_merging.py:52: error: Incompatible types in assignment (expression has type "SCConcrete2", variable has type "SizedAndClosable1") +protocols_merging.py:52: note: "SCConcrete2" is missing following "SizedAndClosable1" protocol member: +protocols_merging.py:52: note: __len__ +protocols_merging.py:53: error: Incompatible types in assignment (expression has type "SCConcrete2", variable has type "SizedAndClosable2") +protocols_merging.py:53: note: "SCConcrete2" is missing following "SizedAndClosable2" protocol member: +protocols_merging.py:53: note: __len__ +protocols_merging.py:54: error: Incompatible types in assignment (expression has type "SCConcrete2", variable has type "SizedAndClosable3") +protocols_merging.py:67: error: All bases of a protocol must be protocols +protocols_merging.py:82: error: Cannot instantiate abstract class "SizedAndClosable4" with abstract attribute "close" +protocols_merging.py:83: error: Incompatible types in assignment (expression has type "SCConcrete1", variable has type "SizedAndClosable4") +""" diff --git a/conformance/results/zuban/protocols_modules.toml b/conformance/results/zuban/protocols_modules.toml new file mode 100644 index 000000000..76e6f70f5 --- /dev/null +++ b/conformance/results/zuban/protocols_modules.toml @@ -0,0 +1,15 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +protocols_modules.py:26: error: Incompatible types in assignment (expression has type "ModuleType", variable has type "Options2") +protocols_modules.py:26: note: Following member(s) of Module "_protocols_modules1" have conflicts: +protocols_modules.py:26: note: timeout: expected "str", got "int" +protocols_modules.py:48: error: Incompatible types in assignment (expression has type "ModuleType", variable has type "Reporter2") +protocols_modules.py:48: note: Following member(s) of Module "_protocols_modules2" have conflicts: +protocols_modules.py:48: note: Expected: +protocols_modules.py:48: note: def on_error(x: int) -> int +protocols_modules.py:48: note: Got: +protocols_modules.py:48: note: def on_error(x: int) -> None +protocols_modules.py:49: error: Incompatible types in assignment (expression has type "ModuleType", variable has type "Reporter3") +""" diff --git a/conformance/results/zuban/protocols_recursive.toml b/conformance/results/zuban/protocols_recursive.toml new file mode 100644 index 000000000..cdd4d0cd9 --- /dev/null +++ b/conformance/results/zuban/protocols_recursive.toml @@ -0,0 +1,5 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +""" diff --git a/conformance/results/zuban/protocols_runtime_checkable.toml b/conformance/results/zuban/protocols_runtime_checkable.toml new file mode 100644 index 000000000..b31703915 --- /dev/null +++ b/conformance/results/zuban/protocols_runtime_checkable.toml @@ -0,0 +1,17 @@ +conformant = "Partial" +notes = """ +Does not report unsafe overlap for runtime_checkable protocol. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 88: Expected 1 errors +Line 92: Expected 1 errors +Line 96: Expected 1 errors +""" +output = """ +protocols_runtime_checkable.py:23: error: Only @runtime_checkable protocols can be used with instance and class checks +protocols_runtime_checkable.py:55: error: Only protocols that don't have non-method members can be used with issubclass() +protocols_runtime_checkable.py:55: note: Protocol "DataProtocol" has non-method member(s): name +protocols_runtime_checkable.py:61: error: Only protocols that don't have non-method members can be used with issubclass() +protocols_runtime_checkable.py:61: note: Protocol "DataProtocol" has non-method member(s): name +""" diff --git a/conformance/results/zuban/protocols_self.toml b/conformance/results/zuban/protocols_self.toml new file mode 100644 index 000000000..cdd4d0cd9 --- /dev/null +++ b/conformance/results/zuban/protocols_self.toml @@ -0,0 +1,5 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +""" diff --git a/conformance/results/zuban/protocols_subtyping.toml b/conformance/results/zuban/protocols_subtyping.toml new file mode 100644 index 000000000..6ba591cb3 --- /dev/null +++ b/conformance/results/zuban/protocols_subtyping.toml @@ -0,0 +1,34 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +protocols_subtyping.py:16: error: Cannot instantiate protocol class "Proto1" +protocols_subtyping.py:38: error: Incompatible types in assignment (expression has type "Proto2", variable has type "Concrete2") +protocols_subtyping.py:55: error: Incompatible types in assignment (expression has type "Proto2", variable has type "Proto3") +protocols_subtyping.py:55: note: "Proto2" is missing following "Proto3" protocol member: +protocols_subtyping.py:55: note: method2 +protocols_subtyping.py:79: error: Incompatible types in assignment (expression has type "Proto5[int]", variable has type "Proto4[int, float]") +protocols_subtyping.py:79: note: Following member(s) of "Proto5[int]" have conflicts: +protocols_subtyping.py:79: note: Expected: +protocols_subtyping.py:79: note: def method1(self, a: int, b: float) -> tuple[int, float] +protocols_subtyping.py:79: note: Got: +protocols_subtyping.py:79: note: def method1(self, a: int, b: int) -> tuple[int, int] +protocols_subtyping.py:80: error: Incompatible types in assignment (expression has type "Proto4[int, int]", variable has type "Proto5[float]") +protocols_subtyping.py:80: note: Following member(s) of "Proto4[int, int]" have conflicts: +protocols_subtyping.py:80: note: Expected: +protocols_subtyping.py:80: note: def method1(self, a: float, b: float) -> tuple[float, float] +protocols_subtyping.py:80: note: Got: +protocols_subtyping.py:80: note: def method1(self, a: int, b: int) -> tuple[int, int] +protocols_subtyping.py:102: error: Incompatible types in assignment (expression has type "Proto6[float, float]", variable has type "Proto7[int, float]") +protocols_subtyping.py:102: note: Following member(s) of "Proto6[float, float]" have conflicts: +protocols_subtyping.py:102: note: Expected: +protocols_subtyping.py:102: note: def method1(self, a: float) -> Sequence[int] +protocols_subtyping.py:102: note: Got: +protocols_subtyping.py:102: note: def method1(self, a: float) -> Sequence[float] +protocols_subtyping.py:103: error: Incompatible types in assignment (expression has type "Proto6[float, float]", variable has type "Proto7[float, object]") +protocols_subtyping.py:103: note: Following member(s) of "Proto6[float, float]" have conflicts: +protocols_subtyping.py:103: note: Expected: +protocols_subtyping.py:103: note: def method1(self, a: object) -> Sequence[float] +protocols_subtyping.py:103: note: Got: +protocols_subtyping.py:103: note: def method1(self, a: float) -> Sequence[float] +""" diff --git a/conformance/results/zuban/protocols_variance.toml b/conformance/results/zuban/protocols_variance.toml new file mode 100644 index 000000000..c8525a48d --- /dev/null +++ b/conformance/results/zuban/protocols_variance.toml @@ -0,0 +1,14 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +protocols_variance.py:21: error: Invariant type variable "T1" used in protocol where Covariant one is expected +protocols_variance.py:40: error: Invariant type variable "T3" used in protocol where Contravariant one is expected +protocols_variance.py:56: error: Invariant type variable "T1" used in protocol where Contravariant one is expected +protocols_variance.py:61: error: Covariant type variable "T1_co" used in protocol where Contravariant one is expected +protocols_variance.py:62: error: Cannot use a covariant type variable as a parameter +protocols_variance.py:66: error: Invariant type variable "T1" used in protocol where Covariant one is expected +protocols_variance.py:71: error: Contravariant type variable "T1_contra" used in protocol where Covariant one is expected +protocols_variance.py:72: error: Cannot use a contravariant type variable as return type +protocols_variance.py:104: error: Invariant type variable "T1" used in protocol where Covariant one is expected +""" diff --git a/conformance/results/zuban/qualifiers_annotated.toml b/conformance/results/zuban/qualifiers_annotated.toml new file mode 100644 index 000000000..822a7e8e0 --- /dev/null +++ b/conformance/results/zuban/qualifiers_annotated.toml @@ -0,0 +1,27 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +qualifiers_annotated.py:43: error: Bracketed expression "[...]" is not valid as a type +qualifiers_annotated.py:43: note: Did you mean "List[...]"? +qualifiers_annotated.py:44: error: Syntax error in type annotation +qualifiers_annotated.py:44: note: Suggestion: Is there a spurious trailing comma? +qualifiers_annotated.py:45: error: Invalid type comment or annotation +qualifiers_annotated.py:46: error: Invalid type comment or annotation +qualifiers_annotated.py:47: error: Invalid type comment or annotation +qualifiers_annotated.py:48: error: Invalid type comment or annotation +qualifiers_annotated.py:49: error: Invalid type comment or annotation +qualifiers_annotated.py:50: error: Name "var1" is not defined +qualifiers_annotated.py:51: error: Invalid type comment or annotation +qualifiers_annotated.py:52: error: Invalid type: try using Literal[1] instead? +qualifiers_annotated.py:53: error: Invalid type comment or annotation +qualifiers_annotated.py:54: error: Invalid type comment or annotation +qualifiers_annotated.py:64: error: Annotated[...] must have exactly one type argument and at least one annotation +qualifiers_annotated.py:76: error: Incompatible types in assignment (expression has type "_SpecialForm", variable has type "Type[Any]") +qualifiers_annotated.py:77: error: Incompatible types in assignment (expression has type "_SpecialForm", variable has type "Type[Any]") +qualifiers_annotated.py:84: error: Argument 1 to "func4" has incompatible type "_SpecialForm"; expected "Type[Never]" +qualifiers_annotated.py:85: error: Argument 1 to "func4" has incompatible type "_SpecialForm"; expected "Type[Never]" +qualifiers_annotated.py:91: error: "_SpecialForm" not callable +qualifiers_annotated.py:92: error: "_SpecialForm" not callable +qualifiers_annotated.py:93: error: "" not callable +""" diff --git a/conformance/results/zuban/qualifiers_final_annotation.toml b/conformance/results/zuban/qualifiers_final_annotation.toml new file mode 100644 index 000000000..aa317cadb --- /dev/null +++ b/conformance/results/zuban/qualifiers_final_annotation.toml @@ -0,0 +1,41 @@ +conformant = "Partial" +notes = """ +Does not treat use of Final name as if it was replaced by the literal in NamedTuple definition. +Does not allow conditional assignment of Final instance variable in __init__ method. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 134: Expected 1 errors +Line 135: Expected 1 errors +Line 59: Unexpected errors ['qualifiers_final_annotation.py:59: error: Cannot assign to final attribute "ID6"'] +Line 131: Unexpected errors ['qualifiers_final_annotation.py:131: error: Invalid "NamedTuple()" field name'] +""" +output = """ +qualifiers_final_annotation.py:16: error: Type in Final[...] can only be omitted if there is an initializer +qualifiers_final_annotation.py:18: error: Final[...] takes at most one type argument +qualifiers_final_annotation.py:34: error: Type in Final[...] can only be omitted if there is an initializer +qualifiers_final_annotation.py:38: error: Final name must be initialized with a value +qualifiers_final_annotation.py:54: error: Cannot assign to final attribute "ID5" +qualifiers_final_annotation.py:59: error: Cannot assign to final attribute "ID6" +qualifiers_final_annotation.py:62: error: Can only declare a final attribute in class body or __init__ +qualifiers_final_annotation.py:63: error: Can only declare a final attribute in class body or __init__ +qualifiers_final_annotation.py:65: error: Cannot assign to final attribute "ID7" +qualifiers_final_annotation.py:67: error: Cannot assign to final attribute "ID7" +qualifiers_final_annotation.py:71: error: Cannot assign to final name "RATE" +qualifiers_final_annotation.py:81: error: Cannot assign to final attribute "DEFAULT_ID" +qualifiers_final_annotation.py:94: error: Cannot assign to final name "BORDER_WIDTH" +qualifiers_final_annotation.py:107: error: Final can be only used as an outermost qualifier in a variable annotation +qualifiers_final_annotation.py:108: error: Invalid Type: ClassVar nested inside other type +qualifiers_final_annotation.py:118: error: Final can be only used as an outermost qualifier in a variable annotation +qualifiers_final_annotation.py:121: error: Final can be only used as an outermost qualifier in a variable annotation +qualifiers_final_annotation.py:131: error: Invalid "NamedTuple()" field name +qualifiers_final_annotation.py:141: error: Cannot assign to final name "ID1" +qualifiers_final_annotation.py:145: error: Cannot assign to final name "x" +qualifiers_final_annotation.py:147: error: Cannot assign to final name "x" +qualifiers_final_annotation.py:149: error: Cannot assign to final name "x" +qualifiers_final_annotation.py:152: error: Cannot assign to final name "x" +qualifiers_final_annotation.py:152: error: Incompatible types in assignment (expression has type "TextIOWrapper[_WrappedBuffer]", variable has type "int") +qualifiers_final_annotation.py:155: error: Cannot assign to final name "x" +qualifiers_final_annotation.py:166: error: Cannot assign to final name "TEN" +qualifiers_final_annotation.py:170: error: Cannot assign to final name "PI" +""" diff --git a/conformance/results/zuban/qualifiers_final_decorator.toml b/conformance/results/zuban/qualifiers_final_decorator.toml new file mode 100644 index 000000000..92903082a --- /dev/null +++ b/conformance/results/zuban/qualifiers_final_decorator.toml @@ -0,0 +1,20 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +qualifiers_final_decorator.py:21: error: Cannot inherit from final class "Base1" +qualifiers_final_decorator.py:56: error: Cannot override final attribute "method1" (previously declared in base class "Base2") +qualifiers_final_decorator.py:59: error: Cannot override final attribute "method2" (previously declared in base class "Base2") +qualifiers_final_decorator.py:63: error: Cannot override final attribute "method3" (previously declared in base class "Base2") +qualifiers_final_decorator.py:67: error: Cannot override final attribute "method4" (previously declared in base class "Base2") +qualifiers_final_decorator.py:80: error: Cannot override final attribute "method" (previously declared in base class "Base3") +qualifiers_final_decorator.py:85: error: @final should be applied only to overload implementation +qualifiers_final_decorator.py:94: error: Cannot override final attribute "method" (previously declared in base class "Base4") +qualifiers_final_decorator.py:118: error: Cannot override final attribute "method" (previously declared in base class "Base5_2") +qualifiers_final_decorator.py:118: error: Signature of "method" incompatible with supertype "Base5_2" +qualifiers_final_decorator.py:118: note: Superclass: +qualifiers_final_decorator.py:118: note: def method(self, v: int) -> None +qualifiers_final_decorator.py:118: note: Subclass: +qualifiers_final_decorator.py:118: note: def method(self) -> None +qualifiers_final_decorator.py:125: error: @final cannot be used with non-method functions +""" diff --git a/conformance/results/zuban/specialtypes_any.toml b/conformance/results/zuban/specialtypes_any.toml new file mode 100644 index 000000000..cdd4d0cd9 --- /dev/null +++ b/conformance/results/zuban/specialtypes_any.toml @@ -0,0 +1,5 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +""" diff --git a/conformance/results/zuban/specialtypes_never.toml b/conformance/results/zuban/specialtypes_never.toml new file mode 100644 index 000000000..dbdbe2e69 --- /dev/null +++ b/conformance/results/zuban/specialtypes_never.toml @@ -0,0 +1,10 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +specialtypes_never.py:19: error: Implicit return in function which does not return +specialtypes_never.py:86: error: Incompatible types in assignment (expression has type "list[Never]", variable has type "list[int]") +specialtypes_never.py:86: note: "List" is invariant -- see https://mypy.readthedocs.io/en/stable/common_issues.html#variance +specialtypes_never.py:86: note: Consider using "Sequence" instead, which is covariant +specialtypes_never.py:105: error: Incompatible return value type (got "ClassC[Never]", expected "ClassC[U]") +""" diff --git a/conformance/results/zuban/specialtypes_none.toml b/conformance/results/zuban/specialtypes_none.toml new file mode 100644 index 000000000..698c02f17 --- /dev/null +++ b/conformance/results/zuban/specialtypes_none.toml @@ -0,0 +1,8 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +specialtypes_none.py:21: error: Argument 1 to "func1" has incompatible type "Type[None]"; expected "None" +specialtypes_none.py:27: error: Incompatible types in assignment (expression has type "None", variable has type "Iterable[Any]") +specialtypes_none.py:41: error: Argument 1 to "func2" has incompatible type "None"; expected "Type[None]" +""" diff --git a/conformance/results/zuban/specialtypes_promotions.toml b/conformance/results/zuban/specialtypes_promotions.toml new file mode 100644 index 000000000..469985d2b --- /dev/null +++ b/conformance/results/zuban/specialtypes_promotions.toml @@ -0,0 +1,6 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +specialtypes_promotions.py:13: error: "float" has no attribute "numerator" +""" diff --git a/conformance/results/zuban/specialtypes_type.toml b/conformance/results/zuban/specialtypes_type.toml new file mode 100644 index 000000000..01efce3ec --- /dev/null +++ b/conformance/results/zuban/specialtypes_type.toml @@ -0,0 +1,14 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +specialtypes_type.py:56: error: Argument 1 to "func4" has incompatible type "Type[TeamUser]"; expected "Type[BasicUser | ProUser]" +specialtypes_type.py:70: error: Argument 1 to "func5" has incompatible type "_SpecialForm"; expected "Type[Never]" +specialtypes_type.py:76: error: Invalid type comment or annotation +specialtypes_type.py:117: error: "Type[object]" has no attribute "unknown" +specialtypes_type.py:120: error: "Type[object]" has no attribute "unknown" +specialtypes_type.py:143: error: "_SpecialForm" has no attribute "unknown" +specialtypes_type.py:144: error: "_SpecialForm" has no attribute "unknown" +specialtypes_type.py:145: error: "_SpecialForm" has no attribute "unknown" +specialtypes_type.py:146: error: "_SpecialForm" has no attribute "unknown" +""" diff --git a/conformance/results/zuban/tuples_type_compat.toml b/conformance/results/zuban/tuples_type_compat.toml new file mode 100644 index 000000000..fe4bd5008 --- /dev/null +++ b/conformance/results/zuban/tuples_type_compat.toml @@ -0,0 +1,37 @@ +conformant = "Pass" +notes = """ +Does not support tuple narrowing based on `len()` type guard (optional). +""" +conformance_automated = "Fail" +errors_diff = """ +Lines 80, 81: Expected exactly one error (tag 'func5_2') +Line 80: Unexpected errors ['tuples_type_compat.py:80: error: Expression is of type "tuple[str, str]", not "tuple[str, str] | tuple[int, int]"'] +Line 81: Unexpected errors ['tuples_type_compat.py:81: error: Expression is of type "tuple[str, str]", not "tuple[int] | tuple[str, str] | tuple[int, Unpack[Tuple[str, ...]], int]"'] +""" +output = """ +tuples_type_compat.py:15: error: Incompatible types in assignment (expression has type "tuple[float, complex]", variable has type "tuple[int, int]") +tuples_type_compat.py:29: error: Incompatible types in assignment (expression has type "tuple[int, ...]", variable has type "tuple[int, Unpack[Tuple[int, ...]]]") +tuples_type_compat.py:32: error: Incompatible types in assignment (expression has type "tuple[int, Unpack[Tuple[int, ...]]]", variable has type "tuple[int]") +tuples_type_compat.py:33: error: Incompatible types in assignment (expression has type "tuple[int, ...]", variable has type "tuple[int]") +tuples_type_compat.py:43: error: Incompatible types in assignment (expression has type "tuple[int, ...]", variable has type "tuple[int]") +tuples_type_compat.py:62: error: Incompatible types in assignment (expression has type "tuple[int, ...]", variable has type "tuple[int, int]") +tuples_type_compat.py:76: error: Expression is of type "tuple[int]", not "tuple[int] | tuple[str, str] | tuple[int, Unpack[Tuple[str, ...]], int]" +tuples_type_compat.py:80: error: Expression is of type "tuple[str, str]", not "tuple[str, str] | tuple[int, int]" +tuples_type_compat.py:81: error: Expression is of type "tuple[str, str]", not "tuple[int] | tuple[str, str] | tuple[int, Unpack[Tuple[str, ...]], int]" +tuples_type_compat.py:86: error: Expression is of type "tuple[int, str, int]", not "tuple[int] | tuple[str, str] | tuple[int, Unpack[Tuple[str, ...]], int]" +tuples_type_compat.py:101: error: Expression is of type "tuple[int] | tuple[str, str] | tuple[int, Unpack[Tuple[str, ...]], int]", not "tuple[int]" +tuples_type_compat.py:106: error: Expression is of type "tuple[int] | tuple[str, str] | tuple[int, Unpack[Tuple[str, ...]], int]", not "tuple[str, str] | tuple[int, int]" +tuples_type_compat.py:111: error: Expression is of type "tuple[int] | tuple[str, str] | tuple[int, Unpack[Tuple[str, ...]], int]", not "tuple[int, str, int]" +tuples_type_compat.py:126: error: Expression is of type "tuple[int | str, int | str]", not "tuple[int | str, str]" +tuples_type_compat.py:129: error: Expression is of type "tuple[int | str, int | str]", not "tuple[int | str, int]" +tuples_type_compat.py:157: error: Incompatible types in assignment (expression has type "tuple[int, str, str]", variable has type "tuple[int, str]") +tuples_type_compat.py:162: error: Incompatible types in assignment (expression has type "tuple[int, int, str]", variable has type "tuple[int, Unpack[Tuple[str, ...]]]") +tuples_type_compat.py:163: error: Incompatible types in assignment (expression has type "tuple[int, str, int]", variable has type "tuple[int, Unpack[Tuple[str, ...]]]") +tuples_type_compat.py:169: error: Incompatible types in assignment (expression has type "tuple[int, str, str]", variable has type "tuple[int, Unpack[Tuple[str, ...]], int]") +tuples_type_compat.py:170: error: Incompatible types in assignment (expression has type "tuple[int, str, str, float]", variable has type "tuple[int, Unpack[Tuple[str, ...]], int]") +tuples_type_compat.py:175: error: Incompatible types in assignment (expression has type "tuple[int, str, int]", variable has type "tuple[Unpack[Tuple[str, ...]], int]") +tuples_type_compat.py:176: error: Incompatible types in assignment (expression has type "tuple[str, str, float]", variable has type "tuple[Unpack[Tuple[str, ...]], int]") +tuples_type_compat.py:181: error: Incompatible types in assignment (expression has type "tuple[str, str]", variable has type "tuple[str, str, int]") +tuples_type_compat.py:184: error: Incompatible types in assignment (expression has type "tuple[str, str]", variable has type "tuple[str, str, str, Unpack[Tuple[str, ...]]]") +tuples_type_compat.py:188: error: Incompatible types in assignment (expression has type "tuple[str, str]", variable has type "tuple[Unpack[Tuple[str, ...]], str, str, str]") +""" diff --git a/conformance/results/zuban/tuples_type_form.toml b/conformance/results/zuban/tuples_type_form.toml new file mode 100644 index 000000000..7d1d7edab --- /dev/null +++ b/conformance/results/zuban/tuples_type_form.toml @@ -0,0 +1,16 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +tuples_type_form.py:12: error: Incompatible types in assignment (expression has type "tuple[int, int]", variable has type "tuple[int]") +tuples_type_form.py:14: error: Incompatible types in assignment (expression has type "tuple[int]", variable has type "tuple[int, int]") +tuples_type_form.py:15: error: Incompatible types in assignment (expression has type "tuple[int, str]", variable has type "tuple[int, int]") +tuples_type_form.py:25: error: Incompatible types in assignment (expression has type "tuple[int]", variable has type "tuple[()]") +tuples_type_form.py:36: error: Incompatible types in assignment (expression has type "tuple[int, int, int, str]", variable has type "tuple[int, ...]") +tuples_type_form.py:40: error: Unexpected "..." +tuples_type_form.py:41: error: Unexpected "..." +tuples_type_form.py:42: error: Unexpected "..." +tuples_type_form.py:43: error: Unexpected "..." +tuples_type_form.py:44: error: Unpack is only valid in a variadic position +tuples_type_form.py:45: error: Unpack is only valid in a variadic position +""" diff --git a/conformance/results/zuban/tuples_unpacked.toml b/conformance/results/zuban/tuples_unpacked.toml new file mode 100644 index 000000000..e8422d81c --- /dev/null +++ b/conformance/results/zuban/tuples_unpacked.toml @@ -0,0 +1,10 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +tuples_unpacked.py:40: error: More than one Unpack in a type is not allowed +tuples_unpacked.py:41: error: More than one Unpack in a type is not allowed +tuples_unpacked.py:51: error: More than one Unpack in a type is not allowed +tuples_unpacked.py:59: error: More than one Unpack in a type is not allowed +tuples_unpacked.py:61: error: More than one Unpack in a type is not allowed +""" diff --git a/conformance/results/zuban/typeddicts_alt_syntax.toml b/conformance/results/zuban/typeddicts_alt_syntax.toml new file mode 100644 index 000000000..16ef84dce --- /dev/null +++ b/conformance/results/zuban/typeddicts_alt_syntax.toml @@ -0,0 +1,13 @@ +conformance_automated = "Pass" +notes = """ +Does not support keyword-argument form of alternative syntax (deprecated in 3.11). +""" +errors_diff = """ +""" +output = """ +typeddicts_alt_syntax.py:23: error: TypedDict() expects a dictionary literal as the second argument +typeddicts_alt_syntax.py:27: error: Invalid TypedDict() field name +typeddicts_alt_syntax.py:31: error: First argument "WrongName" to TypedDict() does not match variable name "BadTypedDict3" +typeddicts_alt_syntax.py:35: error: Too many arguments for "TODO()" +typeddicts_alt_syntax.py:41: error: TypedDict() expects a dictionary literal as the second argument +""" diff --git a/conformance/results/zuban/typeddicts_class_syntax.toml b/conformance/results/zuban/typeddicts_class_syntax.toml new file mode 100644 index 000000000..8f550a254 --- /dev/null +++ b/conformance/results/zuban/typeddicts_class_syntax.toml @@ -0,0 +1,10 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +typeddicts_class_syntax.py:29: error: Invalid statement in TypedDict definition; expected "field_name: field_type" +typeddicts_class_syntax.py:33: error: Invalid statement in TypedDict definition; expected "field_name: field_type" +typeddicts_class_syntax.py:38: error: Invalid statement in TypedDict definition; expected "field_name: field_type" +typeddicts_class_syntax.py:44: error: Unexpected keyword argument "metaclass" for TypedDict +typeddicts_class_syntax.py:49: error: Unexpected keyword argument "other" for TypedDict +""" diff --git a/conformance/results/zuban/typeddicts_final.toml b/conformance/results/zuban/typeddicts_final.toml new file mode 100644 index 000000000..cdd4d0cd9 --- /dev/null +++ b/conformance/results/zuban/typeddicts_final.toml @@ -0,0 +1,5 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +""" diff --git a/conformance/results/zuban/typeddicts_inheritance.toml b/conformance/results/zuban/typeddicts_inheritance.toml new file mode 100644 index 000000000..a4ea1936f --- /dev/null +++ b/conformance/results/zuban/typeddicts_inheritance.toml @@ -0,0 +1,8 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +typeddicts_inheritance.py:44: error: All bases of a new TypedDict must be TypedDict types +typeddicts_inheritance.py:55: error: Overwriting TypedDict field "x" while extending +typeddicts_inheritance.py:65: error: Overwriting TypedDict field "x" while merging +""" diff --git a/conformance/results/zuban/typeddicts_operations.toml b/conformance/results/zuban/typeddicts_operations.toml new file mode 100644 index 000000000..fbe20908f --- /dev/null +++ b/conformance/results/zuban/typeddicts_operations.toml @@ -0,0 +1,16 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +typeddicts_operations.py:22: error: Value of "name" has incompatible type "int"; expected "str" +typeddicts_operations.py:23: error: Value of "year" has incompatible type "str"; expected "int" +typeddicts_operations.py:24: error: TypedDict "Movie" has no key "other" +typeddicts_operations.py:26: error: TypedDict "Movie" has no key "other" +typeddicts_operations.py:28: error: Missing key "year" for TypedDict "Movie" +typeddicts_operations.py:29: error: Incompatible types (expression has type "float", TypedDict item "year" has type "int") +typeddicts_operations.py:32: error: Extra key "other" for TypedDict "Movie" +typeddicts_operations.py:37: error: Expected TypedDict key to be string literal +typeddicts_operations.py:47: error: "Movie" has no attribute "clear" +typeddicts_operations.py:49: error: Key "name" of TypedDict "Movie" cannot be deleted +typeddicts_operations.py:62: error: "MovieOptional" has no attribute "clear" +""" diff --git a/conformance/results/zuban/typeddicts_readonly.toml b/conformance/results/zuban/typeddicts_readonly.toml new file mode 100644 index 000000000..3185cff8d --- /dev/null +++ b/conformance/results/zuban/typeddicts_readonly.toml @@ -0,0 +1,11 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +typeddicts_readonly.py:24: error: ReadOnly TypedDict key "members" TypedDict is mutated +typeddicts_readonly.py:36: error: ReadOnly TypedDict key "members" TypedDict is mutated +typeddicts_readonly.py:50: error: ReadOnly TypedDict key "title" TypedDict is mutated +typeddicts_readonly.py:51: error: ReadOnly TypedDict key "year" TypedDict is mutated +typeddicts_readonly.py:60: error: ReadOnly TypedDict key "title" TypedDict is mutated +typeddicts_readonly.py:61: error: ReadOnly TypedDict key "year" TypedDict is mutated +""" diff --git a/conformance/results/zuban/typeddicts_readonly_consistency.toml b/conformance/results/zuban/typeddicts_readonly_consistency.toml new file mode 100644 index 000000000..4a317175c --- /dev/null +++ b/conformance/results/zuban/typeddicts_readonly_consistency.toml @@ -0,0 +1,12 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +typeddicts_readonly_consistency.py:37: error: Incompatible types in assignment (expression has type "A1", variable has type "B1") +typeddicts_readonly_consistency.py:38: error: Incompatible types in assignment (expression has type "C1", variable has type "B1") +typeddicts_readonly_consistency.py:40: error: Incompatible types in assignment (expression has type "A1", variable has type "C1") +typeddicts_readonly_consistency.py:81: error: Incompatible types in assignment (expression has type "A2", variable has type "B2") +typeddicts_readonly_consistency.py:82: error: Incompatible types in assignment (expression has type "C2", variable has type "B2") +typeddicts_readonly_consistency.py:84: error: Incompatible types in assignment (expression has type "A2", variable has type "C2") +typeddicts_readonly_consistency.py:85: error: Incompatible types in assignment (expression has type "B2", variable has type "C2") +""" diff --git a/conformance/results/zuban/typeddicts_readonly_inheritance.toml b/conformance/results/zuban/typeddicts_readonly_inheritance.toml new file mode 100644 index 000000000..791935087 --- /dev/null +++ b/conformance/results/zuban/typeddicts_readonly_inheritance.toml @@ -0,0 +1,34 @@ +conformant = "Partial" +notes = """ +Incorrectly rejects non-ReadOnly override of ReadOnly item. +Incorrectly rejects override of ReadOnly item with another ReadOnly item with narrower type. +Incorrectly rejects override of NotRequired ReadOnly item with a Required ReadOnly item. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 19: Unexpected errors ['typeddicts_readonly_inheritance.py:19: error: Overwriting TypedDict field "name" while extending'] +Line 49: Unexpected errors ['typeddicts_readonly_inheritance.py:49: error: Overwriting TypedDict field "albums" while extending'] +Line 62: Unexpected errors ['typeddicts_readonly_inheritance.py:62: error: Overwriting TypedDict field "name" while extending'] +Line 76: Unexpected errors ['typeddicts_readonly_inheritance.py:76: error: Overwriting TypedDict field "ident" while extending'] +Line 102: Unexpected errors ['typeddicts_readonly_inheritance.py:102: error: Overwriting TypedDict field "b" while extending'] +""" +output = """ +typeddicts_readonly_inheritance.py:19: error: Overwriting TypedDict field "name" while extending +typeddicts_readonly_inheritance.py:36: error: ReadOnly TypedDict key "name" TypedDict is mutated +typeddicts_readonly_inheritance.py:49: error: Overwriting TypedDict field "albums" while extending +typeddicts_readonly_inheritance.py:50: error: Overwriting TypedDict field "alt" while extending +typeddicts_readonly_inheritance.py:62: error: Overwriting TypedDict field "name" while extending +typeddicts_readonly_inheritance.py:65: error: Missing key "name" for TypedDict "RequiredName" +typeddicts_readonly_inheritance.py:76: error: Overwriting TypedDict field "ident" while extending +typeddicts_readonly_inheritance.py:82: error: Value of "ident" has incompatible type "int"; expected "str" +typeddicts_readonly_inheritance.py:83: error: Incompatible types (expression has type "int", TypedDict item "ident" has type "str") +typeddicts_readonly_inheritance.py:84: error: Missing key "ident" for TypedDict "User" +typeddicts_readonly_inheritance.py:94: error: Overwriting TypedDict field "a" while extending +typeddicts_readonly_inheritance.py:98: error: Overwriting TypedDict field "a" while extending +typeddicts_readonly_inheritance.py:102: error: Overwriting TypedDict field "b" while extending +typeddicts_readonly_inheritance.py:106: error: Overwriting TypedDict field "c" while extending +typeddicts_readonly_inheritance.py:119: error: Overwriting TypedDict field "x" while merging +typeddicts_readonly_inheritance.py:119: error: Overwriting TypedDict field "y" while merging +typeddicts_readonly_inheritance.py:132: error: Overwriting TypedDict field "x" while merging +typeddicts_readonly_inheritance.py:132: error: Overwriting TypedDict field "y" while merging +""" diff --git a/conformance/results/zuban/typeddicts_readonly_kwargs.toml b/conformance/results/zuban/typeddicts_readonly_kwargs.toml new file mode 100644 index 000000000..4889dc9b3 --- /dev/null +++ b/conformance/results/zuban/typeddicts_readonly_kwargs.toml @@ -0,0 +1,6 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +typeddicts_readonly_kwargs.py:33: error: ReadOnly TypedDict key "key1" TypedDict is mutated +""" diff --git a/conformance/results/zuban/typeddicts_readonly_update.toml b/conformance/results/zuban/typeddicts_readonly_update.toml new file mode 100644 index 000000000..54c32eb20 --- /dev/null +++ b/conformance/results/zuban/typeddicts_readonly_update.toml @@ -0,0 +1,10 @@ +conformant = "Partial" +notes = """ +Incorrectly allows update of ReadOnly item. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 23: Expected 1 errors +""" +output = """ +""" diff --git a/conformance/results/zuban/typeddicts_required.toml b/conformance/results/zuban/typeddicts_required.toml new file mode 100644 index 000000000..1d81007d5 --- /dev/null +++ b/conformance/results/zuban/typeddicts_required.toml @@ -0,0 +1,9 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +typeddicts_required.py:12: error: Required[] can be only used in a TypedDict definition +typeddicts_required.py:19: error: NotRequired[] can be only used in a TypedDict definition +typeddicts_required.py:62: error: "Required[]" type cannot be nested +typeddicts_required.py:63: error: "NotRequired[]" type cannot be nested +""" diff --git a/conformance/results/zuban/typeddicts_type_consistency.toml b/conformance/results/zuban/typeddicts_type_consistency.toml new file mode 100644 index 000000000..7ad2d28a5 --- /dev/null +++ b/conformance/results/zuban/typeddicts_type_consistency.toml @@ -0,0 +1,16 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +typeddicts_type_consistency.py:21: error: Incompatible types in assignment (expression has type "B1", variable has type "A1") +typeddicts_type_consistency.py:38: error: Incompatible types in assignment (expression has type "B2", variable has type "A2") +typeddicts_type_consistency.py:65: error: Incompatible types in assignment (expression has type "A3", variable has type "B3") +typeddicts_type_consistency.py:69: error: Extra key "y" for TypedDict "A3" +typeddicts_type_consistency.py:76: error: Incompatible types in assignment (expression has type "B3", variable has type "dict[str, int]") +typeddicts_type_consistency.py:77: error: Incompatible types in assignment (expression has type "B3", variable has type "dict[str, object]") +typeddicts_type_consistency.py:78: error: Incompatible types in assignment (expression has type "B3", variable has type "dict[Any, Any]") +typeddicts_type_consistency.py:82: error: Incompatible types in assignment (expression has type "B3", variable has type "Mapping[str, int]") +typeddicts_type_consistency.py:101: error: Incompatible types in assignment (expression has type "str | None", variable has type "str") +typeddicts_type_consistency.py:107: error: Incompatible types in assignment (expression has type "int | str", variable has type "int") +typeddicts_type_consistency.py:126: error: Incompatible types (expression has type "int", TypedDict item "inner_key" has type "str") +""" diff --git a/conformance/results/zuban/typeddicts_usage.toml b/conformance/results/zuban/typeddicts_usage.toml new file mode 100644 index 000000000..d34748faf --- /dev/null +++ b/conformance/results/zuban/typeddicts_usage.toml @@ -0,0 +1,11 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +typeddicts_usage.py:23: error: TypedDict "Movie" has no key "director" +typeddicts_usage.py:24: error: Value of "year" has incompatible type "str"; expected "int" +typeddicts_usage.py:28: error: Extra key "title" for TypedDict "Movie" +typeddicts_usage.py:28: error: Missing key "name" for TypedDict "Movie" +typeddicts_usage.py:35: error: Cannot use isinstance() with TypedDict type +typeddicts_usage.py:40: error: Invalid type +""" diff --git a/conformance/results/zuban/version.toml b/conformance/results/zuban/version.toml new file mode 100644 index 000000000..120befcc1 --- /dev/null +++ b/conformance/results/zuban/version.toml @@ -0,0 +1,2 @@ +version = "zuban 0.0.19" +test_duration = 0.15 diff --git a/conformance/src/main.py b/conformance/src/main.py index 4c9342a68..484688b77 100644 --- a/conformance/src/main.py +++ b/conformance/src/main.py @@ -235,7 +235,7 @@ def update_type_checker_info( existing_info["version"] = type_checker.get_version() if not skip_timing: - existing_info["test_duration"] = round(test_duration, 1) + existing_info["test_duration"] = round(test_duration, 2) version_file.parent.mkdir(parents=True, exist_ok=True) with open(version_file, "w") as f: diff --git a/conformance/src/reporting.py b/conformance/src/reporting.py index 1c4243709..c17687240 100644 --- a/conformance/src/reporting.py +++ b/conformance/src/reporting.py @@ -50,7 +50,11 @@ def generate_summary_html(root_dir: Path) -> str: summary_html.append(f"
    {version}
    ") if test_duration is not None: - summary_html.append(f"
    {test_duration:.1f}sec
    ") + if test_duration < 1: + duration = f"{test_duration:.2f}" + else: + duration = f"{test_duration:.1f}" + summary_html.append(f"
    {duration}sec
    ") summary_html.append("
    + + + + + + diff --git a/conformance/results/zuban/dataclasses_match_args.toml b/conformance/results/zuban/dataclasses_match_args.toml new file mode 100644 index 000000000..28af5c889 --- /dev/null +++ b/conformance/results/zuban/dataclasses_match_args.toml @@ -0,0 +1,7 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +dataclasses_match_args.py:42: error: "Type[DC4]" has no attribute "__match_args__" +""" diff --git a/conformance/results/zuban/version.toml b/conformance/results/zuban/version.toml index 120befcc1..1f4c294b7 100644 --- a/conformance/results/zuban/version.toml +++ b/conformance/results/zuban/version.toml @@ -1,2 +1,2 @@ version = "zuban 0.0.19" -test_duration = 0.15 +test_duration = 0.35 diff --git a/conformance/tests/dataclasses_match_args.py b/conformance/tests/dataclasses_match_args.py new file mode 100644 index 000000000..6593fa205 --- /dev/null +++ b/conformance/tests/dataclasses_match_args.py @@ -0,0 +1,49 @@ +""" +Tests the match_args feature of dataclass added in Python 3.10. +""" + +# Specification: https://docs.python.org/3/library/dataclasses.html#module-contents + +from dataclasses import dataclass, KW_ONLY +from typing import assert_type, Literal + +# If true, the __match_args__ tuple will be created from the list of non keyword-only parameters to the generated __init__() method + +@dataclass(match_args=True) +class DC1: + x: int + _: KW_ONLY + y: str + +assert_type(DC1.__match_args__, tuple[Literal['x']]) + +# The match_args default is True + +@dataclass +class DC2: + x: int + +assert_type(DC2.__match_args__, tuple[Literal['x']]) + +# __match_args__ is created even if __init__() is not generated + +@dataclass(match_args=True, init=False) +class DC3: + x: int = 0 + +assert_type(DC3.__match_args__, tuple[Literal['x']]) + +# If false, or if __match_args__ is already defined in the class, then __match_args__ will not be generated. + +@dataclass(match_args=False) +class DC4: + x: int + +DC4.__match_args__ # E + +@dataclass(match_args=True) +class DC5: + __match_args__ = () + x: int + +assert_type(DC5.__match_args__, tuple[()]) From b57e1ff4924ea9e1fca87240bc5db8b5564f7b2e Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Sun, 17 Aug 2025 07:32:34 -0700 Subject: [PATCH 125/308] Add spec and tests for PEP 728 (#2068) I mostly copied the spec from PEP 728, with light editing to remove references to "this PEP" and fix links. In a followup I plan to reorganize the TypedDict spec. The conformance tests primarily derive from the examples in the PEP. Co-authored-by: Brian Schubert Co-authored-by: Rob Hand <146272+sinon@users.noreply.github.com> --- .../results/mypy/typeddicts_extra_items.toml | 143 +++++ .../results/pyre/typeddicts_extra_items.toml | 139 +++++ .../pyright/typeddicts_extra_items.toml | 65 ++ conformance/results/results.html | 12 +- .../results/zuban/typeddicts_extra_items.toml | 139 +++++ conformance/results/zuban/version.toml | 2 +- conformance/tests/typeddicts_extra_items.py | 347 +++++++++++ docs/spec/typeddict.rst | 554 ++++++++++++++++++ 8 files changed, 1397 insertions(+), 4 deletions(-) create mode 100644 conformance/results/mypy/typeddicts_extra_items.toml create mode 100644 conformance/results/pyre/typeddicts_extra_items.toml create mode 100644 conformance/results/pyright/typeddicts_extra_items.toml create mode 100644 conformance/results/zuban/typeddicts_extra_items.toml create mode 100644 conformance/tests/typeddicts_extra_items.py diff --git a/conformance/results/mypy/typeddicts_extra_items.toml b/conformance/results/mypy/typeddicts_extra_items.toml new file mode 100644 index 000000000..9f1bde568 --- /dev/null +++ b/conformance/results/mypy/typeddicts_extra_items.toml @@ -0,0 +1,143 @@ +conformant = "Unsupported" +notes = """ +Not supported. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 181: Expected 1 errors +Line 184: Expected 1 errors +Line 206: Expected 1 errors +Line 213: Expected 1 errors +Line 233: Expected 1 errors +Line 247: Expected 1 errors +Line 248: Expected 1 errors +Line 259: Expected 1 errors +Lines 91, 92: Expected error (tag 'MovieC') +Lines 94, 95: Expected error (tag 'MovieD') +Line 11: Unexpected errors ['typeddicts_extra_items.py:11: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] +Line 14: Unexpected errors ['typeddicts_extra_items.py:14: error: Extra key "novel_adaptation" for TypedDict "Movie" [typeddict-unknown-key]'] +Line 19: Unexpected errors ['typeddicts_extra_items.py:19: error: Unexpected keyword argument "extra_items" for "TypedDict" [misc]'] +Line 21: Unexpected errors ['typeddicts_extra_items.py:21: error: Extra keys ("name", "novel_adaptation") for TypedDict "MovieFunctional" [typeddict-unknown-key]'] +Line 29: Unexpected errors ['typeddicts_extra_items.py:29: error: Expression is of type "Any", not "bool" [assert-type]', 'typeddicts_extra_items.py:29: error: TypedDict "Movie" has no key "novel_adaptation" [typeddict-item]'] +Line 33: Unexpected errors ['typeddicts_extra_items.py:33: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] +Line 40: Unexpected errors ['typeddicts_extra_items.py:40: error: Extra key "other_extra_key" for TypedDict "InheritedMovie" [typeddict-unknown-key]'] +Line 55: Unexpected errors ['typeddicts_extra_items.py:55: error: Unexpected keyword argument "closed" for "__init_subclass__" of "TypedDict" [call-arg]'] +Line 64: Unexpected errors ['typeddicts_extra_items.py:64: error: Unexpected keyword argument "closed" for "__init_subclass__" of "TypedDict" [call-arg]'] +Line 70: Unexpected errors ['typeddicts_extra_items.py:70: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] +Line 82: Unexpected errors ['typeddicts_extra_items.py:82: error: Unexpected keyword argument "closed" for "__init_subclass__" of "TypedDict" [call-arg]'] +Line 88: Unexpected errors ['typeddicts_extra_items.py:88: error: Unexpected keyword argument "closed" for "__init_subclass__" of "TypedDict" [call-arg]'] +Line 100: Unexpected errors ['typeddicts_extra_items.py:100: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] +Line 103: Unexpected errors ['typeddicts_extra_items.py:103: error: Unexpected keyword argument "closed" for "__init_subclass__" of "TypedDict" [call-arg]'] +Line 106: Unexpected errors ['typeddicts_extra_items.py:106: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] +Line 121: Unexpected errors ['typeddicts_extra_items.py:121: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] +Line 126: Unexpected errors ['typeddicts_extra_items.py:126: error: TypedDict "MovieEI" has no key "year" [typeddict-item]'] +Line 134: Unexpected errors ['typeddicts_extra_items.py:134: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] +Line 141: Unexpected errors ['typeddicts_extra_items.py:141: error: Unexpected keyword argument "year" for "unpack_extra" [call-arg]'] +Line 146: Unexpected errors ['typeddicts_extra_items.py:146: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] +Line 149: Unexpected errors ['typeddicts_extra_items.py:149: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] +Line 152: Unexpected errors ['typeddicts_extra_items.py:152: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] +Line 162: Unexpected errors ['typeddicts_extra_items.py:162: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] +Line 168: Unexpected errors ['typeddicts_extra_items.py:168: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] +Line 178: Unexpected errors ['typeddicts_extra_items.py:178: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] +Line 201: Unexpected errors ['typeddicts_extra_items.py:201: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] +Line 208: Unexpected errors ['typeddicts_extra_items.py:208: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] +Line 219: Unexpected errors ['typeddicts_extra_items.py:219: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] +Line 222: Unexpected errors ['typeddicts_extra_items.py:222: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] +Line 226: Unexpected errors ['typeddicts_extra_items.py:226: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] +Line 239: Unexpected errors ['typeddicts_extra_items.py:239: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] +Line 242: Unexpected errors ['typeddicts_extra_items.py:242: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] +Line 245: Unexpected errors ['typeddicts_extra_items.py:245: error: Extra key "year" for TypedDict "MovieExtraInt" [typeddict-unknown-key]'] +Line 246: Unexpected errors ['typeddicts_extra_items.py:246: error: Extra key "description" for TypedDict "MovieExtraStr" [typeddict-unknown-key]'] +Line 257: Unexpected errors ['typeddicts_extra_items.py:257: error: Extra key "year" for TypedDict "MovieExtraInt" [typeddict-unknown-key]'] +Line 271: Unexpected errors ['typeddicts_extra_items.py:271: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] +Line 275: Unexpected errors ['typeddicts_extra_items.py:275: error: Extra key "year" for TypedDict "ExtraMovie" [typeddict-unknown-key]'] +Line 280: Unexpected errors ['typeddicts_extra_items.py:280: error: Unexpected keyword argument "closed" for "__init_subclass__" of "TypedDict" [call-arg]'] +Line 290: Unexpected errors ['typeddicts_extra_items.py:290: error: Extra key "summary" for TypedDict "MovieExtraStr" [typeddict-unknown-key]'] +Line 291: Unexpected errors ['typeddicts_extra_items.py:291: error: Incompatible types in assignment (expression has type "MovieExtraStr", variable has type "Mapping[str, str]") [assignment]'] +Line 293: Unexpected errors ['typeddicts_extra_items.py:293: error: Extra key "year" for TypedDict "MovieExtraInt" [typeddict-unknown-key]'] +Line 295: Unexpected errors ['typeddicts_extra_items.py:295: error: Incompatible types in assignment (expression has type "MovieExtraInt", variable has type "Mapping[str, int | str]") [assignment]'] +Line 301: Unexpected errors ['typeddicts_extra_items.py:301: error: Expression is of type "list[tuple[str, object]]", not "list[tuple[str, int | str]]" [assert-type]'] +Line 302: Unexpected errors ['typeddicts_extra_items.py:302: error: Expression is of type "list[object]", not "list[int | str]" [assert-type]'] +Line 310: Unexpected errors ['typeddicts_extra_items.py:310: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] +Line 317: Unexpected errors ['typeddicts_extra_items.py:317: error: Incompatible types in assignment (expression has type "IntDict", variable has type "dict[str, int]") [assignment]'] +Line 320: Unexpected errors ['typeddicts_extra_items.py:320: error: Extra key "bar" for TypedDict "IntDictWithNum" [typeddict-unknown-key]'] +Line 321: Unexpected errors ['typeddicts_extra_items.py:321: error: Incompatible types in assignment (expression has type "IntDictWithNum", variable has type "dict[str, int]") [assignment]'] +Line 328: Unexpected errors ['typeddicts_extra_items.py:328: error: "IntDictWithNum" has no attribute "clear" [attr-defined]'] +Line 330: Unexpected errors ['typeddicts_extra_items.py:330: error: Expression is of type "Any", not "tuple[str, int]" [assert-type]', 'typeddicts_extra_items.py:330: error: "IntDictWithNum" has no attribute "popitem" [attr-defined]'] +Line 333: Unexpected errors ['typeddicts_extra_items.py:333: error: TypedDict key must be a string literal; expected one of ("num") [literal-required]'] +Line 334: Unexpected errors ['typeddicts_extra_items.py:334: error: Expected TypedDict key to be string literal [misc]'] +""" +output = """ +typeddicts_extra_items.py:11: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_extra_items.py:14: error: Extra key "novel_adaptation" for TypedDict "Movie" [typeddict-unknown-key] +typeddicts_extra_items.py:15: error: Extra key "year" for TypedDict "Movie" [typeddict-unknown-key] +typeddicts_extra_items.py:19: error: Unexpected keyword argument "extra_items" for "TypedDict" [misc] +typeddicts_extra_items.py:21: error: Extra keys ("name", "novel_adaptation") for TypedDict "MovieFunctional" [typeddict-unknown-key] +typeddicts_extra_items.py:22: error: Extra keys ("name", "year") for TypedDict "MovieFunctional" [typeddict-unknown-key] +typeddicts_extra_items.py:29: error: Expression is of type "Any", not "bool" [assert-type] +typeddicts_extra_items.py:29: error: TypedDict "Movie" has no key "novel_adaptation" [typeddict-item] +typeddicts_extra_items.py:33: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_extra_items.py:39: error: Incompatible types (expression has type "None", TypedDict item "year" has type "int") [typeddict-item] +typeddicts_extra_items.py:40: error: Extra key "other_extra_key" for TypedDict "InheritedMovie" [typeddict-unknown-key] +typeddicts_extra_items.py:49: error: Unexpected keyword argument "closed" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_extra_items.py:55: error: Unexpected keyword argument "closed" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_extra_items.py:64: error: Unexpected keyword argument "closed" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_extra_items.py:67: error: Unexpected keyword argument "closed" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_extra_items.py:70: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_extra_items.py:73: error: Unexpected keyword argument "closed" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_extra_items.py:82: error: Unexpected keyword argument "closed" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_extra_items.py:88: error: Unexpected keyword argument "closed" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_extra_items.py:100: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_extra_items.py:103: error: Unexpected keyword argument "closed" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_extra_items.py:106: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_extra_items.py:111: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_extra_items.py:114: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_extra_items.py:121: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_extra_items.py:125: error: Key "name" of TypedDict "MovieEI" cannot be deleted [misc] +typeddicts_extra_items.py:126: error: TypedDict "MovieEI" has no key "year" [typeddict-item] +typeddicts_extra_items.py:134: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_extra_items.py:137: note: "unpack_no_extra" defined here +typeddicts_extra_items.py:138: note: "unpack_extra" defined here +typeddicts_extra_items.py:140: error: Unexpected keyword argument "year" for "unpack_no_extra" [call-arg] +typeddicts_extra_items.py:141: error: Unexpected keyword argument "year" for "unpack_extra" [call-arg] +typeddicts_extra_items.py:146: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_extra_items.py:149: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_extra_items.py:152: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_extra_items.py:162: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_extra_items.py:168: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_extra_items.py:171: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_extra_items.py:178: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_extra_items.py:201: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_extra_items.py:208: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_extra_items.py:219: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_extra_items.py:222: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_extra_items.py:226: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_extra_items.py:239: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_extra_items.py:242: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_extra_items.py:245: error: Extra key "year" for TypedDict "MovieExtraInt" [typeddict-unknown-key] +typeddicts_extra_items.py:246: error: Extra key "description" for TypedDict "MovieExtraStr" [typeddict-unknown-key] +typeddicts_extra_items.py:257: error: Extra key "year" for TypedDict "MovieExtraInt" [typeddict-unknown-key] +typeddicts_extra_items.py:269: error: Extra key "year" for TypedDict "NonClosedMovie" [typeddict-unknown-key] +typeddicts_extra_items.py:271: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_extra_items.py:275: error: Extra key "year" for TypedDict "ExtraMovie" [typeddict-unknown-key] +typeddicts_extra_items.py:276: error: Extra key "language" for TypedDict "ExtraMovie" [typeddict-unknown-key] +typeddicts_extra_items.py:280: error: Unexpected keyword argument "closed" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_extra_items.py:284: error: Extra key "year" for TypedDict "ClosedMovie" [typeddict-unknown-key] +typeddicts_extra_items.py:290: error: Extra key "summary" for TypedDict "MovieExtraStr" [typeddict-unknown-key] +typeddicts_extra_items.py:291: error: Incompatible types in assignment (expression has type "MovieExtraStr", variable has type "Mapping[str, str]") [assignment] +typeddicts_extra_items.py:293: error: Extra key "year" for TypedDict "MovieExtraInt" [typeddict-unknown-key] +typeddicts_extra_items.py:294: error: Incompatible types in assignment (expression has type "MovieExtraInt", variable has type "Mapping[str, int]") [assignment] +typeddicts_extra_items.py:295: error: Incompatible types in assignment (expression has type "MovieExtraInt", variable has type "Mapping[str, int | str]") [assignment] +typeddicts_extra_items.py:301: error: Expression is of type "list[tuple[str, object]]", not "list[tuple[str, int | str]]" [assert-type] +typeddicts_extra_items.py:302: error: Expression is of type "list[object]", not "list[int | str]" [assert-type] +typeddicts_extra_items.py:310: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_extra_items.py:317: error: Incompatible types in assignment (expression has type "IntDict", variable has type "dict[str, int]") [assignment] +typeddicts_extra_items.py:320: error: Extra key "bar" for TypedDict "IntDictWithNum" [typeddict-unknown-key] +typeddicts_extra_items.py:321: error: Incompatible types in assignment (expression has type "IntDictWithNum", variable has type "dict[str, int]") [assignment] +typeddicts_extra_items.py:328: error: "IntDictWithNum" has no attribute "clear" [attr-defined] +typeddicts_extra_items.py:330: error: Expression is of type "Any", not "tuple[str, int]" [assert-type] +typeddicts_extra_items.py:330: error: "IntDictWithNum" has no attribute "popitem" [attr-defined] +typeddicts_extra_items.py:333: error: TypedDict key must be a string literal; expected one of ("num") [literal-required] +typeddicts_extra_items.py:334: error: Expected TypedDict key to be string literal [misc] +typeddicts_extra_items.py:343: error: Incompatible types in assignment (expression has type "dict[str, int]", variable has type "IntDict") [assignment] +""" diff --git a/conformance/results/pyre/typeddicts_extra_items.toml b/conformance/results/pyre/typeddicts_extra_items.toml new file mode 100644 index 000000000..aa91c7f41 --- /dev/null +++ b/conformance/results/pyre/typeddicts_extra_items.toml @@ -0,0 +1,139 @@ +conformant = "Unsupported" +notes = """ +Not supported. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 181: Expected 1 errors +Line 184: Expected 1 errors +Line 206: Expected 1 errors +Line 213: Expected 1 errors +Line 233: Expected 1 errors +Line 247: Expected 1 errors +Line 248: Expected 1 errors +Line 259: Expected 1 errors +Lines 91, 92: Expected error (tag 'MovieC') +Lines 94, 95: Expected error (tag 'MovieD') +Line 11: Unexpected errors ['typeddicts_extra_items.py:11:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] +Line 14: Unexpected errors ['typeddicts_extra_items.py:14:11 TypedDict initialization error [55]: TypedDict `Movie` has no field `novel_adaptation`.'] +Line 21: Unexpected errors ['typeddicts_extra_items.py:21:21 TypedDict initialization error [55]: TypedDict `MovieFunctional` has no field `novel_adaptation`.'] +Line 29: Unexpected errors ['typeddicts_extra_items.py:29:4 Assert type [70]: Expected `bool` but got `str`.', 'typeddicts_extra_items.py:29:22 TypedDict accessed with a missing key [27]: TypedDict `Movie` has no key `novel_adaptation`.'] +Line 33: Unexpected errors ['typeddicts_extra_items.py:33:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] +Line 40: Unexpected errors ['typeddicts_extra_items.py:40:20 TypedDict initialization error [55]: TypedDict `InheritedMovie` has no field `other_extra_key`.'] +Line 55: Unexpected errors ['typeddicts_extra_items.py:55:0 Unexpected keyword [28]: Unexpected keyword argument `closed` to call `object.__init_subclass__`.'] +Line 64: Unexpected errors ['typeddicts_extra_items.py:64:0 Unexpected keyword [28]: Unexpected keyword argument `closed` to call `object.__init_subclass__`.'] +Line 70: Unexpected errors ['typeddicts_extra_items.py:70:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] +Line 82: Unexpected errors ['typeddicts_extra_items.py:82:0 Unexpected keyword [28]: Unexpected keyword argument `closed` to call `object.__init_subclass__`.'] +Line 88: Unexpected errors ['typeddicts_extra_items.py:88:0 Unexpected keyword [28]: Unexpected keyword argument `closed` to call `object.__init_subclass__`.'] +Line 100: Unexpected errors ['typeddicts_extra_items.py:100:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] +Line 103: Unexpected errors ['typeddicts_extra_items.py:103:0 Unexpected keyword [28]: Unexpected keyword argument `closed` to call `object.__init_subclass__`.'] +Line 106: Unexpected errors ['typeddicts_extra_items.py:106:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] +Line 121: Unexpected errors ['typeddicts_extra_items.py:121:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] +Line 126: Unexpected errors ['typeddicts_extra_items.py:126:14 TypedDict accessed with a missing key [27]: TypedDict `MovieEI` has no key `year`.'] +Line 134: Unexpected errors ['typeddicts_extra_items.py:134:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] +Line 141: Unexpected errors ['typeddicts_extra_items.py:141:0 Unexpected keyword [28]: Unexpected keyword argument `year` to call `unpack_extra`.'] +Line 146: Unexpected errors ['typeddicts_extra_items.py:146:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] +Line 149: Unexpected errors ['typeddicts_extra_items.py:149:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] +Line 152: Unexpected errors ['typeddicts_extra_items.py:152:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] +Line 162: Unexpected errors ['typeddicts_extra_items.py:162:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] +Line 168: Unexpected errors ['typeddicts_extra_items.py:168:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] +Line 178: Unexpected errors ['typeddicts_extra_items.py:178:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] +Line 201: Unexpected errors ['typeddicts_extra_items.py:201:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] +Line 208: Unexpected errors ['typeddicts_extra_items.py:208:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] +Line 219: Unexpected errors ['typeddicts_extra_items.py:219:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] +Line 222: Unexpected errors ['typeddicts_extra_items.py:222:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] +Line 226: Unexpected errors ['typeddicts_extra_items.py:226:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] +Line 239: Unexpected errors ['typeddicts_extra_items.py:239:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] +Line 242: Unexpected errors ['typeddicts_extra_items.py:242:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] +Line 245: Unexpected errors ['typeddicts_extra_items.py:245:27 TypedDict initialization error [55]: TypedDict `MovieExtraInt` has no field `year`.'] +Line 246: Unexpected errors ['typeddicts_extra_items.py:246:27 TypedDict initialization error [55]: TypedDict `MovieExtraStr` has no field `description`.'] +Line 257: Unexpected errors ['typeddicts_extra_items.py:257:28 TypedDict initialization error [55]: TypedDict `MovieExtraInt` has no field `year`.'] +Line 271: Unexpected errors ['typeddicts_extra_items.py:271:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] +Line 275: Unexpected errors ['typeddicts_extra_items.py:275:0 Unexpected keyword [28]: Unexpected keyword argument `year` to call `ExtraMovie.__init__`.'] +Line 280: Unexpected errors ['typeddicts_extra_items.py:280:0 Unexpected keyword [28]: Unexpected keyword argument `closed` to call `object.__init_subclass__`.'] +Line 290: Unexpected errors ['typeddicts_extra_items.py:290:28 TypedDict initialization error [55]: TypedDict `MovieExtraStr` has no field `summary`.'] +Line 291: Unexpected errors ['typeddicts_extra_items.py:291:0 Incompatible variable type [9]: str_mapping is declared to have type `Mapping[str, str]` but is used as type `MovieExtraStr`.'] +Line 293: Unexpected errors ['typeddicts_extra_items.py:293:28 TypedDict initialization error [55]: TypedDict `MovieExtraInt` has no field `year`.'] +Line 295: Unexpected errors ['typeddicts_extra_items.py:295:0 Incompatible variable type [9]: int_str_mapping is declared to have type `Mapping[str, Union[int, str]]` but is used as type `MovieExtraInt`.'] +Line 301: Unexpected errors ['typeddicts_extra_items.py:301:4 Assert type [70]: Expected `List[Tuple[str, Union[int, str]]]` but got `List[Tuple[str, object]]`.'] +Line 302: Unexpected errors ['typeddicts_extra_items.py:302:4 Assert type [70]: Expected `List[Union[int, str]]` but got `List[object]`.'] +Line 310: Unexpected errors ['typeddicts_extra_items.py:310:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] +Line 317: Unexpected errors ['typeddicts_extra_items.py:317:4 Incompatible variable type [9]: v is declared to have type `Dict[str, int]` but is used as type `IntDict`.'] +Line 320: Unexpected errors ['typeddicts_extra_items.py:320:40 TypedDict initialization error [55]: TypedDict `IntDictWithNum` has no field `bar`.'] +Line 321: Unexpected errors ['typeddicts_extra_items.py:321:0 Incompatible variable type [9]: regular_dict is declared to have type `Dict[str, int]` but is used as type `IntDictWithNum`.'] +Line 328: Unexpected errors ['typeddicts_extra_items.py:328:0 Undefined attribute [16]: `IntDictWithNum` has no attribute `clear`.'] +Line 330: Unexpected errors ['typeddicts_extra_items.py:330:0 Assert type [70]: Expected `Tuple[str, int]` but got `typing.Any`.', 'typeddicts_extra_items.py:330:12 Undefined attribute [16]: `IntDictWithNum` has no attribute `popitem`.'] +Line 333: Unexpected errors ["typeddicts_extra_items.py:333:26 TypedDict accessed with a non-literal [26]: TypedDict key must be a string literal. Expected one of ('num')."] +Line 334: Unexpected errors ["typeddicts_extra_items.py:334:30 TypedDict accessed with a non-literal [26]: TypedDict key must be a string literal. Expected one of ('num')."] +""" +output = """ +typeddicts_extra_items.py:11:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. +typeddicts_extra_items.py:14:11 TypedDict initialization error [55]: TypedDict `Movie` has no field `novel_adaptation`. +typeddicts_extra_items.py:15:11 TypedDict initialization error [55]: TypedDict `Movie` has no field `year`. +typeddicts_extra_items.py:21:21 TypedDict initialization error [55]: TypedDict `MovieFunctional` has no field `novel_adaptation`. +typeddicts_extra_items.py:22:21 TypedDict initialization error [55]: TypedDict `MovieFunctional` has no field `year`. +typeddicts_extra_items.py:29:4 Assert type [70]: Expected `bool` but got `str`. +typeddicts_extra_items.py:29:22 TypedDict accessed with a missing key [27]: TypedDict `Movie` has no key `novel_adaptation`. +typeddicts_extra_items.py:33:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. +typeddicts_extra_items.py:39:20 TypedDict initialization error [55]: Expected type `int` for `InheritedMovie` field `year` but got `None`. +typeddicts_extra_items.py:40:20 TypedDict initialization error [55]: TypedDict `InheritedMovie` has no field `other_extra_key`. +typeddicts_extra_items.py:49:0 Unexpected keyword [28]: Unexpected keyword argument `closed` to call `object.__init_subclass__`. +typeddicts_extra_items.py:55:0 Unexpected keyword [28]: Unexpected keyword argument `closed` to call `object.__init_subclass__`. +typeddicts_extra_items.py:64:0 Unexpected keyword [28]: Unexpected keyword argument `closed` to call `object.__init_subclass__`. +typeddicts_extra_items.py:67:0 Unexpected keyword [28]: Unexpected keyword argument `closed` to call `object.__init_subclass__`. +typeddicts_extra_items.py:70:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. +typeddicts_extra_items.py:73:0 Unexpected keyword [28]: Unexpected keyword argument `closed` to call `object.__init_subclass__`. +typeddicts_extra_items.py:82:0 Unexpected keyword [28]: Unexpected keyword argument `closed` to call `object.__init_subclass__`. +typeddicts_extra_items.py:88:0 Unexpected keyword [28]: Unexpected keyword argument `closed` to call `object.__init_subclass__`. +typeddicts_extra_items.py:100:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. +typeddicts_extra_items.py:103:0 Unexpected keyword [28]: Unexpected keyword argument `closed` to call `object.__init_subclass__`. +typeddicts_extra_items.py:106:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. +typeddicts_extra_items.py:111:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. +typeddicts_extra_items.py:114:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. +typeddicts_extra_items.py:121:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. +typeddicts_extra_items.py:125:4 Invalid TypedDict operation [54]: Cannot delete required field `name` from TypedDict `MovieEI`. +typeddicts_extra_items.py:126:14 TypedDict accessed with a missing key [27]: TypedDict `MovieEI` has no key `year`. +typeddicts_extra_items.py:134:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. +typeddicts_extra_items.py:140:0 Unexpected keyword [28]: Unexpected keyword argument `year` to call `unpack_no_extra`. +typeddicts_extra_items.py:141:0 Unexpected keyword [28]: Unexpected keyword argument `year` to call `unpack_extra`. +typeddicts_extra_items.py:146:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. +typeddicts_extra_items.py:149:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. +typeddicts_extra_items.py:152:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. +typeddicts_extra_items.py:162:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. +typeddicts_extra_items.py:168:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. +typeddicts_extra_items.py:171:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. +typeddicts_extra_items.py:178:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. +typeddicts_extra_items.py:201:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. +typeddicts_extra_items.py:208:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. +typeddicts_extra_items.py:219:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. +typeddicts_extra_items.py:222:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. +typeddicts_extra_items.py:226:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. +typeddicts_extra_items.py:239:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. +typeddicts_extra_items.py:242:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. +typeddicts_extra_items.py:245:27 TypedDict initialization error [55]: TypedDict `MovieExtraInt` has no field `year`. +typeddicts_extra_items.py:246:27 TypedDict initialization error [55]: TypedDict `MovieExtraStr` has no field `description`. +typeddicts_extra_items.py:257:28 TypedDict initialization error [55]: TypedDict `MovieExtraInt` has no field `year`. +typeddicts_extra_items.py:269:0 Unexpected keyword [28]: Unexpected keyword argument `year` to call `NonClosedMovie.__init__`. +typeddicts_extra_items.py:271:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. +typeddicts_extra_items.py:275:0 Unexpected keyword [28]: Unexpected keyword argument `year` to call `ExtraMovie.__init__`. +typeddicts_extra_items.py:276:0 Unexpected keyword [28]: Unexpected keyword argument `language` to call `ExtraMovie.__init__`. +typeddicts_extra_items.py:280:0 Unexpected keyword [28]: Unexpected keyword argument `closed` to call `object.__init_subclass__`. +typeddicts_extra_items.py:284:0 Unexpected keyword [28]: Unexpected keyword argument `year` to call `ClosedMovie.__init__`. +typeddicts_extra_items.py:290:28 TypedDict initialization error [55]: TypedDict `MovieExtraStr` has no field `summary`. +typeddicts_extra_items.py:291:0 Incompatible variable type [9]: str_mapping is declared to have type `Mapping[str, str]` but is used as type `MovieExtraStr`. +typeddicts_extra_items.py:293:28 TypedDict initialization error [55]: TypedDict `MovieExtraInt` has no field `year`. +typeddicts_extra_items.py:294:0 Incompatible variable type [9]: int_mapping is declared to have type `Mapping[str, int]` but is used as type `MovieExtraInt`. +typeddicts_extra_items.py:295:0 Incompatible variable type [9]: int_str_mapping is declared to have type `Mapping[str, Union[int, str]]` but is used as type `MovieExtraInt`. +typeddicts_extra_items.py:301:4 Assert type [70]: Expected `List[Tuple[str, Union[int, str]]]` but got `List[Tuple[str, object]]`. +typeddicts_extra_items.py:302:4 Assert type [70]: Expected `List[Union[int, str]]` but got `List[object]`. +typeddicts_extra_items.py:310:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. +typeddicts_extra_items.py:317:4 Incompatible variable type [9]: v is declared to have type `Dict[str, int]` but is used as type `IntDict`. +typeddicts_extra_items.py:320:40 TypedDict initialization error [55]: TypedDict `IntDictWithNum` has no field `bar`. +typeddicts_extra_items.py:321:0 Incompatible variable type [9]: regular_dict is declared to have type `Dict[str, int]` but is used as type `IntDictWithNum`. +typeddicts_extra_items.py:328:0 Undefined attribute [16]: `IntDictWithNum` has no attribute `clear`. +typeddicts_extra_items.py:330:0 Assert type [70]: Expected `Tuple[str, int]` but got `typing.Any`. +typeddicts_extra_items.py:330:12 Undefined attribute [16]: `IntDictWithNum` has no attribute `popitem`. +typeddicts_extra_items.py:333:26 TypedDict accessed with a non-literal [26]: TypedDict key must be a string literal. Expected one of ('num'). +typeddicts_extra_items.py:334:30 TypedDict accessed with a non-literal [26]: TypedDict key must be a string literal. Expected one of ('num'). +typeddicts_extra_items.py:343:4 Incompatible variable type [9]: int_dict is declared to have type `IntDict` but is used as type `Dict[str, int]`. +""" diff --git a/conformance/results/pyright/typeddicts_extra_items.toml b/conformance/results/pyright/typeddicts_extra_items.toml new file mode 100644 index 000000000..8bdb0fab3 --- /dev/null +++ b/conformance/results/pyright/typeddicts_extra_items.toml @@ -0,0 +1,65 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +typeddicts_extra_items.py:15:45 - error: Type "dict[str, str | int]" is not assignable to declared type "Movie" +  "Literal[1982]" is not assignable to "bool" (reportAssignmentType) +typeddicts_extra_items.py:22:55 - error: Type "dict[str, str | int]" is not assignable to declared type "MovieFunctional" +  "Literal[1982]" is not assignable to "bool" (reportAssignmentType) +typeddicts_extra_items.py:39:54 - error: Type "dict[str, str | None]" is not assignable to declared type "InheritedMovie" +  "None" is not assignable to "int" (reportAssignmentType) +typeddicts_extra_items.py:49:35 - error: Expected "closed" parameter to have a value of True or False (reportGeneralTypeIssues) +typeddicts_extra_items.py:67:7 - error: Base class "ClosedBase" is a TypedDict that limits the type of extra items to type "Never" +  Cannot add item "age" (reportIncompatibleVariableOverride) +typeddicts_extra_items.py:73:7 - error: Base class "ExtraItemsBase" is a TypedDict that limits the type of extra items to type "int" +  Cannot add item "age" because it must be NotRequired (reportIncompatibleVariableOverride) +typeddicts_extra_items.py:91:7 - error: Base class "MovieA" is a TypedDict that limits the type of extra items to type "Never" +  Cannot add item "age" (reportIncompatibleVariableOverride) +typeddicts_extra_items.py:94:7 - error: Base class "MovieB" is a TypedDict that limits the type of extra items to type "Never" +  Cannot add item "age" (reportIncompatibleVariableOverride) +typeddicts_extra_items.py:111:50 - error: "Required" is not allowed in this context (reportInvalidTypeForm) +typeddicts_extra_items.py:114:57 - error: "NotRequired" is not allowed in this context (reportInvalidTypeForm) +typeddicts_extra_items.py:125:9 - error: Could not delete item in TypedDict +  "name" is a required key and cannot be deleted (reportGeneralTypeIssues) +typeddicts_extra_items.py:140:48 - error: No parameter named "year" (reportCallIssue) +typeddicts_extra_items.py:171:7 - error: Base class "Parent" is a TypedDict that limits the type of extra items to type "int | None" +  Cannot add item "extra_items" with type "int" (reportIncompatibleVariableOverride) +typeddicts_extra_items.py:181:7 - error: Base class "MovieBase2" is a TypedDict that limits the type of extra items to type "int | None" +  Cannot add item "year" because it must be NotRequired (reportIncompatibleVariableOverride) +typeddicts_extra_items.py:184:7 - error: Base class "MovieBase2" is a TypedDict that limits the type of extra items to type "int | None" +  Cannot add item "year" with type "int" (reportIncompatibleVariableOverride) +typeddicts_extra_items.py:206:22 - error: Type "MovieDetails" is not assignable to declared type "MovieBase2" +  Type of "year" is incompatible with type of "extra_items" in "MovieBase2" +    Type "int" is not assignable to type "int | None" +      "int" is not assignable to "None" (reportAssignmentType) +typeddicts_extra_items.py:213:22 - error: Type "MovieWithYear2" is not assignable to declared type "MovieBase2" +  "year" is not required in "MovieBase2" (reportAssignmentType) +typeddicts_extra_items.py:233:19 - error: Type "MovieDetails5" is not assignable to declared type "MovieSI" +  Type of "actors" is incompatible with type of "extra_items" in "MovieSI" +    Type "list[str]" is not assignable to type "str | int" +      "list[str]" is not assignable to "str" +      "list[str]" is not assignable to "int" (reportAssignmentType) +typeddicts_extra_items.py:247:13 - error: Type "MovieExtraStr" is not assignable to declared type "MovieExtraInt" +  Type of "extra_items" is incompatible with type of "extra_items" in "MovieExtraStr" +    "str" is not assignable to "int" (reportAssignmentType) +typeddicts_extra_items.py:248:13 - error: Type "MovieExtraInt" is not assignable to declared type "MovieExtraStr" +  Type of "extra_items" is incompatible with type of "extra_items" in "MovieExtraInt" +    "int" is not assignable to "str" (reportAssignmentType) +typeddicts_extra_items.py:259:14 - error: Type "MovieNotClosed" is not assignable to declared type "MovieExtraInt" +  Type of "extra_items" is incompatible with type of "extra_items" in "MovieNotClosed" +    "object" is not assignable to "int" (reportAssignmentType) +typeddicts_extra_items.py:269:1 - error: No overloads for "__init__" match the provided arguments +  Argument types: (Literal['No Country for Old Men'], Literal[2007]) (reportCallIssue) +typeddicts_extra_items.py:276:52 - error: Argument of type "Literal['English']" cannot be assigned to parameter "language" of type "int" in function "__init__" +  "Literal['English']" is not assignable to "int" (reportArgumentType) +typeddicts_extra_items.py:284:1 - error: No overloads for "__init__" match the provided arguments +  Argument types: (Literal['No Country for Old Men'], Literal[2007]) (reportCallIssue) +typeddicts_extra_items.py:294:34 - error: Type "MovieExtraInt" is not assignable to declared type "Mapping[str, int]" +  "Mapping[str, str | int]" is not assignable to "Mapping[str, int]" +    Type parameter "_VT_co@Mapping" is covariant, but "str | int" is not a subtype of "int" +      Type "str | int" is not assignable to type "int" +        "str" is not assignable to "int" (reportAssignmentType) +typeddicts_extra_items.py:343:25 - error: Type "dict[str, int]" is not assignable to declared type "IntDict" +  "dict[str, int]" is not assignable to "IntDict" (reportAssignmentType) +""" diff --git a/conformance/results/results.html b/conformance/results/results.html index cce50c1e0..40ce04d0b 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -162,13 +162,13 @@

    Python Type System Conformance Test Results

    2.0sec
    + + + + + + diff --git a/conformance/results/zuban/typeddicts_extra_items.toml b/conformance/results/zuban/typeddicts_extra_items.toml new file mode 100644 index 000000000..0cc9199f6 --- /dev/null +++ b/conformance/results/zuban/typeddicts_extra_items.toml @@ -0,0 +1,139 @@ +conformant = "Unsupported" +notes = """ +Not supported. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 22: Expected 1 errors +Line 181: Expected 1 errors +Line 184: Expected 1 errors +Line 206: Expected 1 errors +Line 213: Expected 1 errors +Line 233: Expected 1 errors +Line 247: Expected 1 errors +Line 248: Expected 1 errors +Line 259: Expected 1 errors +Lines 91, 92: Expected error (tag 'MovieC') +Lines 94, 95: Expected error (tag 'MovieD') +Line 11: Unexpected errors ['typeddicts_extra_items.py:11: error: Unexpected keyword argument "extra_items" for TypedDict'] +Line 14: Unexpected errors ['typeddicts_extra_items.py:14: error: Extra key "novel_adaptation" for TypedDict "Movie"'] +Line 19: Unexpected errors ['typeddicts_extra_items.py:19: error: Unexpected keyword argument "extra_items" for "TypedDict"'] +Line 29: Unexpected errors ['typeddicts_extra_items.py:29: error: Expression is of type "Any", not "bool"', 'typeddicts_extra_items.py:29: error: TypedDict "Movie" has no key "novel_adaptation"'] +Line 33: Unexpected errors ['typeddicts_extra_items.py:33: error: Unexpected keyword argument "extra_items" for TypedDict'] +Line 40: Unexpected errors ['typeddicts_extra_items.py:40: error: Extra key "other_extra_key" for TypedDict "InheritedMovie"'] +Line 55: Unexpected errors ['typeddicts_extra_items.py:55: error: Unexpected keyword argument "closed" for TypedDict'] +Line 64: Unexpected errors ['typeddicts_extra_items.py:64: error: Unexpected keyword argument "closed" for TypedDict'] +Line 70: Unexpected errors ['typeddicts_extra_items.py:70: error: Unexpected keyword argument "extra_items" for TypedDict'] +Line 82: Unexpected errors ['typeddicts_extra_items.py:82: error: Unexpected keyword argument "closed" for TypedDict'] +Line 88: Unexpected errors ['typeddicts_extra_items.py:88: error: Unexpected keyword argument "closed" for TypedDict'] +Line 100: Unexpected errors ['typeddicts_extra_items.py:100: error: Unexpected keyword argument "extra_items" for TypedDict'] +Line 103: Unexpected errors ['typeddicts_extra_items.py:103: error: Unexpected keyword argument "closed" for TypedDict'] +Line 106: Unexpected errors ['typeddicts_extra_items.py:106: error: Unexpected keyword argument "extra_items" for TypedDict'] +Line 121: Unexpected errors ['typeddicts_extra_items.py:121: error: Unexpected keyword argument "extra_items" for TypedDict'] +Line 126: Unexpected errors ['typeddicts_extra_items.py:126: error: TypedDict "MovieEI" has no key "year"'] +Line 134: Unexpected errors ['typeddicts_extra_items.py:134: error: Unexpected keyword argument "extra_items" for TypedDict'] +Line 141: Unexpected errors ['typeddicts_extra_items.py:141: error: Unexpected keyword argument "year" for "unpack_extra"'] +Line 146: Unexpected errors ['typeddicts_extra_items.py:146: error: Unexpected keyword argument "extra_items" for TypedDict'] +Line 149: Unexpected errors ['typeddicts_extra_items.py:149: error: Unexpected keyword argument "extra_items" for TypedDict'] +Line 152: Unexpected errors ['typeddicts_extra_items.py:152: error: Unexpected keyword argument "extra_items" for TypedDict'] +Line 162: Unexpected errors ['typeddicts_extra_items.py:162: error: Unexpected keyword argument "extra_items" for TypedDict'] +Line 168: Unexpected errors ['typeddicts_extra_items.py:168: error: Unexpected keyword argument "extra_items" for TypedDict'] +Line 178: Unexpected errors ['typeddicts_extra_items.py:178: error: Unexpected keyword argument "extra_items" for TypedDict'] +Line 201: Unexpected errors ['typeddicts_extra_items.py:201: error: Unexpected keyword argument "extra_items" for TypedDict'] +Line 208: Unexpected errors ['typeddicts_extra_items.py:208: error: Unexpected keyword argument "extra_items" for TypedDict'] +Line 219: Unexpected errors ['typeddicts_extra_items.py:219: error: Unexpected keyword argument "extra_items" for TypedDict'] +Line 222: Unexpected errors ['typeddicts_extra_items.py:222: error: Unexpected keyword argument "extra_items" for TypedDict'] +Line 226: Unexpected errors ['typeddicts_extra_items.py:226: error: Unexpected keyword argument "extra_items" for TypedDict'] +Line 239: Unexpected errors ['typeddicts_extra_items.py:239: error: Unexpected keyword argument "extra_items" for TypedDict'] +Line 242: Unexpected errors ['typeddicts_extra_items.py:242: error: Unexpected keyword argument "extra_items" for TypedDict'] +Line 245: Unexpected errors ['typeddicts_extra_items.py:245: error: Extra key "year" for TypedDict "MovieExtraInt"'] +Line 246: Unexpected errors ['typeddicts_extra_items.py:246: error: Extra key "description" for TypedDict "MovieExtraStr"'] +Line 257: Unexpected errors ['typeddicts_extra_items.py:257: error: Extra key "year" for TypedDict "MovieExtraInt"'] +Line 271: Unexpected errors ['typeddicts_extra_items.py:271: error: Unexpected keyword argument "extra_items" for TypedDict'] +Line 275: Unexpected errors ['typeddicts_extra_items.py:275: error: Extra key "year" for TypedDict "ExtraMovie"'] +Line 280: Unexpected errors ['typeddicts_extra_items.py:280: error: Unexpected keyword argument "closed" for TypedDict'] +Line 290: Unexpected errors ['typeddicts_extra_items.py:290: error: Extra key "summary" for TypedDict "MovieExtraStr"'] +Line 291: Unexpected errors ['typeddicts_extra_items.py:291: error: Incompatible types in assignment (expression has type "MovieExtraStr", variable has type "Mapping[str, str]")'] +Line 293: Unexpected errors ['typeddicts_extra_items.py:293: error: Extra key "year" for TypedDict "MovieExtraInt"'] +Line 295: Unexpected errors ['typeddicts_extra_items.py:295: error: Incompatible types in assignment (expression has type "MovieExtraInt", variable has type "Mapping[str, int | str]")'] +Line 301: Unexpected errors ['typeddicts_extra_items.py:301: error: Expression is of type "list[tuple[str, object]]", not "list[tuple[str, int | str]]"'] +Line 302: Unexpected errors ['typeddicts_extra_items.py:302: error: Expression is of type "list[object]", not "list[int | str]"'] +Line 310: Unexpected errors ['typeddicts_extra_items.py:310: error: Unexpected keyword argument "extra_items" for TypedDict'] +Line 317: Unexpected errors ['typeddicts_extra_items.py:317: error: Incompatible types in assignment (expression has type "IntDict", variable has type "dict[str, int]")'] +Line 320: Unexpected errors ['typeddicts_extra_items.py:320: error: Extra key "bar" for TypedDict "IntDictWithNum"'] +Line 321: Unexpected errors ['typeddicts_extra_items.py:321: error: Incompatible types in assignment (expression has type "IntDictWithNum", variable has type "dict[str, int]")'] +Line 328: Unexpected errors ['typeddicts_extra_items.py:328: error: "IntDictWithNum" has no attribute "clear"'] +Line 330: Unexpected errors ['typeddicts_extra_items.py:330: error: Expression is of type "Any", not "tuple[str, int]"', 'typeddicts_extra_items.py:330: error: "IntDictWithNum" has no attribute "popitem"'] +Line 333: Unexpected errors ['typeddicts_extra_items.py:333: error: TypedDict key must be a string literal; expected one of ("num")'] +Line 334: Unexpected errors ['typeddicts_extra_items.py:334: error: Expected TypedDict key to be string literal'] +""" +output = """ +typeddicts_extra_items.py:11: error: Unexpected keyword argument "extra_items" for TypedDict +typeddicts_extra_items.py:14: error: Extra key "novel_adaptation" for TypedDict "Movie" +typeddicts_extra_items.py:15: error: Extra key "year" for TypedDict "Movie" +typeddicts_extra_items.py:19: error: Unexpected keyword argument "extra_items" for "TypedDict" +typeddicts_extra_items.py:29: error: Expression is of type "Any", not "bool" +typeddicts_extra_items.py:29: error: TypedDict "Movie" has no key "novel_adaptation" +typeddicts_extra_items.py:33: error: Unexpected keyword argument "extra_items" for TypedDict +typeddicts_extra_items.py:39: error: Incompatible types (expression has type "None", TypedDict item "year" has type "int") +typeddicts_extra_items.py:40: error: Extra key "other_extra_key" for TypedDict "InheritedMovie" +typeddicts_extra_items.py:49: error: Unexpected keyword argument "closed" for TypedDict +typeddicts_extra_items.py:55: error: Unexpected keyword argument "closed" for TypedDict +typeddicts_extra_items.py:64: error: Unexpected keyword argument "closed" for TypedDict +typeddicts_extra_items.py:67: error: Unexpected keyword argument "closed" for TypedDict +typeddicts_extra_items.py:70: error: Unexpected keyword argument "extra_items" for TypedDict +typeddicts_extra_items.py:73: error: Unexpected keyword argument "closed" for TypedDict +typeddicts_extra_items.py:82: error: Unexpected keyword argument "closed" for TypedDict +typeddicts_extra_items.py:88: error: Unexpected keyword argument "closed" for TypedDict +typeddicts_extra_items.py:100: error: Unexpected keyword argument "extra_items" for TypedDict +typeddicts_extra_items.py:103: error: Unexpected keyword argument "closed" for TypedDict +typeddicts_extra_items.py:106: error: Unexpected keyword argument "extra_items" for TypedDict +typeddicts_extra_items.py:111: error: Unexpected keyword argument "extra_items" for TypedDict +typeddicts_extra_items.py:114: error: Unexpected keyword argument "extra_items" for TypedDict +typeddicts_extra_items.py:121: error: Unexpected keyword argument "extra_items" for TypedDict +typeddicts_extra_items.py:125: error: Key "name" of TypedDict "MovieEI" cannot be deleted +typeddicts_extra_items.py:126: error: TypedDict "MovieEI" has no key "year" +typeddicts_extra_items.py:134: error: Unexpected keyword argument "extra_items" for TypedDict +typeddicts_extra_items.py:140: error: Unexpected keyword argument "year" for "unpack_no_extra" +typeddicts_extra_items.py:141: error: Unexpected keyword argument "year" for "unpack_extra" +typeddicts_extra_items.py:146: error: Unexpected keyword argument "extra_items" for TypedDict +typeddicts_extra_items.py:149: error: Unexpected keyword argument "extra_items" for TypedDict +typeddicts_extra_items.py:152: error: Unexpected keyword argument "extra_items" for TypedDict +typeddicts_extra_items.py:162: error: Unexpected keyword argument "extra_items" for TypedDict +typeddicts_extra_items.py:168: error: Unexpected keyword argument "extra_items" for TypedDict +typeddicts_extra_items.py:171: error: Unexpected keyword argument "extra_items" for TypedDict +typeddicts_extra_items.py:178: error: Unexpected keyword argument "extra_items" for TypedDict +typeddicts_extra_items.py:201: error: Unexpected keyword argument "extra_items" for TypedDict +typeddicts_extra_items.py:208: error: Unexpected keyword argument "extra_items" for TypedDict +typeddicts_extra_items.py:219: error: Unexpected keyword argument "extra_items" for TypedDict +typeddicts_extra_items.py:222: error: Unexpected keyword argument "extra_items" for TypedDict +typeddicts_extra_items.py:226: error: Unexpected keyword argument "extra_items" for TypedDict +typeddicts_extra_items.py:239: error: Unexpected keyword argument "extra_items" for TypedDict +typeddicts_extra_items.py:242: error: Unexpected keyword argument "extra_items" for TypedDict +typeddicts_extra_items.py:245: error: Extra key "year" for TypedDict "MovieExtraInt" +typeddicts_extra_items.py:246: error: Extra key "description" for TypedDict "MovieExtraStr" +typeddicts_extra_items.py:257: error: Extra key "year" for TypedDict "MovieExtraInt" +typeddicts_extra_items.py:269: error: Extra key "year" for TypedDict "NonClosedMovie" +typeddicts_extra_items.py:271: error: Unexpected keyword argument "extra_items" for TypedDict +typeddicts_extra_items.py:275: error: Extra key "year" for TypedDict "ExtraMovie" +typeddicts_extra_items.py:276: error: Extra key "language" for TypedDict "ExtraMovie" +typeddicts_extra_items.py:280: error: Unexpected keyword argument "closed" for TypedDict +typeddicts_extra_items.py:284: error: Extra key "year" for TypedDict "ClosedMovie" +typeddicts_extra_items.py:290: error: Extra key "summary" for TypedDict "MovieExtraStr" +typeddicts_extra_items.py:291: error: Incompatible types in assignment (expression has type "MovieExtraStr", variable has type "Mapping[str, str]") +typeddicts_extra_items.py:293: error: Extra key "year" for TypedDict "MovieExtraInt" +typeddicts_extra_items.py:294: error: Incompatible types in assignment (expression has type "MovieExtraInt", variable has type "Mapping[str, int]") +typeddicts_extra_items.py:295: error: Incompatible types in assignment (expression has type "MovieExtraInt", variable has type "Mapping[str, int | str]") +typeddicts_extra_items.py:301: error: Expression is of type "list[tuple[str, object]]", not "list[tuple[str, int | str]]" +typeddicts_extra_items.py:302: error: Expression is of type "list[object]", not "list[int | str]" +typeddicts_extra_items.py:310: error: Unexpected keyword argument "extra_items" for TypedDict +typeddicts_extra_items.py:317: error: Incompatible types in assignment (expression has type "IntDict", variable has type "dict[str, int]") +typeddicts_extra_items.py:320: error: Extra key "bar" for TypedDict "IntDictWithNum" +typeddicts_extra_items.py:321: error: Incompatible types in assignment (expression has type "IntDictWithNum", variable has type "dict[str, int]") +typeddicts_extra_items.py:328: error: "IntDictWithNum" has no attribute "clear" +typeddicts_extra_items.py:330: error: Expression is of type "Any", not "tuple[str, int]" +typeddicts_extra_items.py:330: error: "IntDictWithNum" has no attribute "popitem" +typeddicts_extra_items.py:333: error: TypedDict key must be a string literal; expected one of ("num") +typeddicts_extra_items.py:334: error: Expected TypedDict key to be string literal +typeddicts_extra_items.py:343: error: Incompatible types in assignment (expression has type "dict[str, int]", variable has type "IntDict") +""" diff --git a/conformance/results/zuban/version.toml b/conformance/results/zuban/version.toml index 1f4c294b7..d3d2104dc 100644 --- a/conformance/results/zuban/version.toml +++ b/conformance/results/zuban/version.toml @@ -1,2 +1,2 @@ version = "zuban 0.0.19" -test_duration = 0.35 +test_duration = 0.32 diff --git a/conformance/tests/typeddicts_extra_items.py b/conformance/tests/typeddicts_extra_items.py new file mode 100644 index 000000000..b0a797ee7 --- /dev/null +++ b/conformance/tests/typeddicts_extra_items.py @@ -0,0 +1,347 @@ +# pyright: enableExperimentalFeatures=true +from collections.abc import Mapping +from typing_extensions import ReadOnly, TypedDict, Unpack +from typing import assert_type, Required, NotRequired, Never + + +# > For a TypedDict type that specifies +# > ``extra_items``, during construction, the value type of each unknown item +# is expected to be non-required and assignable to the ``extra_items`` argument. + +class Movie(TypedDict, extra_items=bool): + name: str + +a: Movie = {"name": "Blade Runner", "novel_adaptation": True} # OK +b: Movie = {"name": "Blade Runner", "year": 1982} # E: 'int' is not assignable to 'bool' + +# > The alternative inline syntax is also supported:: + +MovieFunctional = TypedDict("MovieFunctional", {"name": str}, extra_items=bool) + +c: MovieFunctional = {"name": "Blade Runner", "novel_adaptation": True} # OK +d: MovieFunctional = {"name": "Blade Runner", "year": 1982} # E: 'int' is not assignable to 'bool' + +# > Accessing extra items is allowed. Type checkers must infer their value type from +# > the ``extra_items`` argument + +def movie_keys(movie: Movie) -> None: + assert_type(movie["name"], str) + assert_type(movie["novel_adaptation"], bool) + +# > ``extra_items`` is inherited through subclassing + +class MovieBase(TypedDict, extra_items=ReadOnly[int | None]): + name: str + +class InheritedMovie(MovieBase): + year: int + +e: InheritedMovie = {"name": "Blade Runner", "year": None} # E: 'None' is incompatible with 'int' +f: InheritedMovie = { + "name": "Blade Runner", + "year": 1982, + "other_extra_key": None, +} # OK + +# > Similar to ``total``, only a literal ``True`` or ``False`` is supported as the +# > value of the ``closed`` argument. Type checkers should reject any non-literal value. + +class IllegalTD(TypedDict, closed=42 == 42): # E: Argument to "closed" must be a literal True or False + name: str + +# > Passing ``closed=False`` explicitly requests the default TypedDict behavior, +# > where arbitrary other keys may be present and subclasses may add arbitrary items. + +class BaseTD(TypedDict, closed=False): + name: str + +class ChildTD(BaseTD): # OK + age: int + +# > It is a type checker error to pass ``closed=False`` if a superclass has +# > ``closed=True`` or sets ``extra_items``. + +class ClosedBase(TypedDict, closed=True): + name: str + +class IllegalChild1(ClosedBase, closed=False): # E: Cannot set 'closed=False' when superclass is 'closed=True' + age: int + +class ExtraItemsBase(TypedDict, extra_items=int): + name: str + +class IllegalChild2(ExtraItemsBase, closed=False): # E: Cannot set 'closed=False' when superclass has 'extra_items' + age: int + +# > If ``closed`` is not provided, the behavior is inherited from the superclass. +# > If the superclass is TypedDict itself or the superclass does not have ``closed=True`` +# > or the ``extra_items`` parameter, the previous TypedDict behavior is preserved: +# > arbitrary extra items are allowed. If the superclass has ``closed=True``, the +# > child class is also closed. + +class BaseMovie(TypedDict, closed=True): + name: str + +class MovieA(BaseMovie): # OK, still closed + pass + +class MovieB(BaseMovie, closed=True): # OK, but redundant + pass + +class MovieC(MovieA): # E[MovieC] + age: int # E[MovieC]: "MovieC" is a closed TypedDict; extra key "age" not allowed + +class MovieD(MovieB): # E[MovieD] + age: int # E[MovieD]: "MovieD" is a closed TypedDict; extra key "age" not allowed + +# > It is possible to use ``closed=True`` when subclassing if the ``extra_items`` +# > argument is a read-only type. + +class MovieES(TypedDict, extra_items=ReadOnly[str]): + pass + +class MovieClosed(MovieES, closed=True): # OK + pass + +class MovieNever(MovieES, extra_items=Never): # OK, but 'closed=True' is preferred + pass + +# > It is an error to use ``Required[]`` or ``NotRequired[]`` with ``extra_items``. + +class IllegalExtraItemsTD(TypedDict, extra_items=Required[int]): # E: 'extra_items' value cannot be 'Required[...]' + name: str + +class AnotherIllegalExtraItemsTD(TypedDict, extra_items=NotRequired[int]): # E: 'extra_items' value cannot be 'NotRequired[...]' + name: str + +# > The extra items are non-required, regardless of the totality of the +# > TypedDict. Operations that are available to ``NotRequired`` items should also be available to the +# > extra items. + +class MovieEI(TypedDict, extra_items=int): + name: str + +def del_items(movie: MovieEI) -> None: + del movie["name"] # E: The value type of 'name' is 'Required[str]' + del movie["year"] # OK: The value type of 'year' is 'NotRequired[int]' + +# > For type checking purposes, ``Unpack[SomeTypedDict]`` with extra items should be +# > treated as its equivalent in regular parameters. + +class MovieNoExtra(TypedDict): + name: str + +class MovieExtra(TypedDict, extra_items=int): + name: str + +def unpack_no_extra(**kwargs: Unpack[MovieNoExtra]) -> None: ... +def unpack_extra(**kwargs: Unpack[MovieExtra]) -> None: ... + +unpack_no_extra(name="No Country for Old Men", year=2007) # E: Unrecognized item +unpack_extra(name="No Country for Old Men", year=2007) # OK + +# > Notably, if the TypedDict type specifies ``extra_items`` to be read-only, +# > subclasses of the TypedDict type may redeclare ``extra_items``. + +class ReadOnlyBase(TypedDict, extra_items=ReadOnly[int]): + pass + +class ReadOnlyChild(ReadOnlyBase, extra_items=ReadOnly[bool]): # OK + pass + +class MutableChild(ReadOnlyBase, extra_items=int): # OK + pass + +# > Because a non-closed TypedDict type implicitly allows non-required extra items +# > of value type ``ReadOnly[object]``, its subclass can override the +# > ``extra_items`` argument with more specific types. + +class NonClosedBase(TypedDict): + name: str + +class SpecificExtraItems(NonClosedBase, extra_items=bytes): # OK + year: int + +# > First, it is not allowed to change the value of ``extra_items`` in a subclass +# > unless it is declared to be ``ReadOnly`` in the superclass. + +class Parent(TypedDict, extra_items=int | None): + pass + +class Child(Parent, extra_items=int): # E: Cannot change 'extra_items' type unless it is 'ReadOnly' in the superclass + pass + +# > Second, ``extra_items=T`` effectively defines the value type of any unnamed +# > items accepted to the TypedDict and marks them as non-required. Thus, the above +# > restriction applies to any additional items defined in a subclass. + +class MovieBase2(TypedDict, extra_items=int | None): + name: str + +class MovieRequiredYear(MovieBase2): # E: Required key 'year' is not known to 'MovieBase' + year: int | None + +class MovieNotRequiredYear(MovieBase2): # E: 'int | None' is not consistent with 'int' + year: NotRequired[int] + +class MovieWithYear(MovieBase): # OK + year: NotRequired[int | None] + +# > Let ``S`` be the set of keys of the explicitly defined items on a TypedDict +# > type. If it specifies ``extra_items=T``, the TypedDict type is considered to +# > have an infinite set of items that all satisfy the following conditions. +# > - If ``extra_items`` is read-only: +# > - The key's value type is :term:`assignable` to ``T``. +# > - The key is not in ``S``. +# > - If ``extra_items`` is not read-only: +# > - The key is non-required. +# > - The key's value type is :term:`consistent` with ``T``. +# > - The key is not in ``S``. + +class MovieDetails(TypedDict, extra_items=int | None): + name: str + year: NotRequired[int] + +details2: MovieDetails = {"name": "Kill Bill Vol. 1", "year": 2003} +movie2: MovieBase2 = details2 # E: While 'int' is not consistent with 'int | None' + +class MovieWithYear2(TypedDict, extra_items=int | None): + name: str + year: int | None + +details3: MovieWithYear2 = {"name": "Kill Bill Vol. 1", "year": 2003} +movie3: MovieBase2 = details3 # E:'year' is not required in 'Movie', but it is required in 'MovieWithYear2' + +# > When ``extra_items`` is specified to be read-only on a TypedDict type, it is +# > possible for an item to have a :term:`narrower ` type than the +# > ``extra_items`` argument. + +class MovieSI(TypedDict, extra_items=ReadOnly[str | int]): + name: str + +class MovieDetails4(TypedDict, extra_items=int): + name: str + year: NotRequired[int] + +class MovieDetails5(TypedDict, extra_items=int): + name: str + actors: list[str] + +details4: MovieDetails4 = {"name": "Kill Bill Vol. 2", "year": 2004} +details5: MovieDetails5 = {"name": "Kill Bill Vol. 2", "actors": ["Uma Thurman"]} +movie4: MovieSI = details4 # OK. 'int' is assignable to 'str | int'. +movie5: MovieSI = details5 # E: 'list[str]' is not assignable to 'str | int'. + +# > ``extra_items`` as a pseudo-item follows the same rules that other items have, +# > so when both TypedDicts types specify ``extra_items``, this check is naturally +# > enforced. + +class MovieExtraInt(TypedDict, extra_items=int): + name: str + +class MovieExtraStr(TypedDict, extra_items=str): + name: str + +extra_int: MovieExtraInt = {"name": "No Country for Old Men", "year": 2007} +extra_str: MovieExtraStr = {"name": "No Country for Old Men", "description": ""} +extra_int = extra_str # E: 'str' is not assignable to extra items type 'int' +extra_str = extra_int # E: 'int' is not assignable to extra items type 'str' + +# > A non-closed TypedDict type implicitly allows non-required extra keys of value +# > type ``ReadOnly[object]``. Applying the assignability rules between this type +# > and a closed TypedDict type is allowed. + +class MovieNotClosed(TypedDict): + name: str + +extra_int2: MovieExtraInt = {"name": "No Country for Old Men", "year": 2007} +not_closed: MovieNotClosed = {"name": "No Country for Old Men"} +extra_int2 = not_closed # E: 'extra_items=ReadOnly[object]' implicitly on 'MovieNotClosed' is not assignable to with 'extra_items=int' +not_closed = extra_int2 # OK + +# > TypedDicts that allow extra items of type ``T`` also allow arbitrary keyword +# > arguments of this type when constructed by calling the class object. + +class NonClosedMovie(TypedDict): + name: str + +NonClosedMovie(name="No Country for Old Men") # OK +NonClosedMovie(name="No Country for Old Men", year=2007) # E: Unrecognized item + +class ExtraMovie(TypedDict, extra_items=int): + name: str + +ExtraMovie(name="No Country for Old Men") # OK +ExtraMovie(name="No Country for Old Men", year=2007) # OK +ExtraMovie(name="No Country for Old Men", language="English") # E: Wrong type for extra item 'language' + +# This implies 'extra_items=Never', +# so extra keyword arguments would produce an error +class ClosedMovie(TypedDict, closed=True): + name: str + +ClosedMovie(name="No Country for Old Men") # OK +ClosedMovie(name="No Country for Old Men", year=2007) # E: Extra items not allowed + +# > A TypedDict type is :term:`assignable` to a type of the form ``Mapping[str, VT]`` +# > when all value types of the items in the TypedDict +# > are assignable to ``VT``. + +extra_str3: MovieExtraStr = {"name": "Blade Runner", "summary": ""} +str_mapping: Mapping[str, str] = extra_str3 # OK + +extra_int3: MovieExtraInt = {"name": "Blade Runner", "year": 1982} +int_mapping: Mapping[str, int] = extra_int3 # E: 'int | str' is not assignable with 'int' +int_str_mapping: Mapping[str, int | str] = extra_int3 # OK + +# > Type checkers should infer the precise signatures of ``values()`` and ``items()`` +# > on such TypedDict types. + +def foo(movie: MovieExtraInt) -> None: + assert_type(list(movie.items()), list[tuple[str, int | str]]) + assert_type(list(movie.values()), list[int | str]) + +# > The TypedDict type is :term:`assignable` to ``dict[str, VT]`` if all +# > items on the TypedDict type satisfy the following conditions: +# > - The value type of the item is :term:`consistent` with ``VT``. +# > - The item is not read-only. +# > - The item is not required. + +class IntDict(TypedDict, extra_items=int): + pass + +class IntDictWithNum(IntDict): + num: NotRequired[int] + +def clear_intdict(x: IntDict) -> None: + v: dict[str, int] = x # OK + v.clear() # OK + +not_required_num_dict: IntDictWithNum = {"num": 1, "bar": 2} +regular_dict: dict[str, int] = not_required_num_dict # OK +clear_intdict(not_required_num_dict) # OK + +# > In this case, methods that are previously unavailable on a TypedDict are allowed, +# > with signatures matching ``dict[str, VT]`` +# > (e.g.: ``__setitem__(self, key: str, value: VT) -> None``). + +not_required_num_dict.clear() # OK + +assert_type(not_required_num_dict.popitem(), tuple[str, int]) + +def nrnd(not_required_num_dict: IntDictWithNum, key: str): + not_required_num_dict[key] = 42 # OK + del not_required_num_dict[key] # OK + +# > ``dict[str, VT]`` is not assignable to a TypedDict type, +# > because such dict can be a subtype of dict. + +class CustomDict(dict[str, int]): + pass + +def might_not_be(might_not_be_a_builtin_dict: dict[str, int]): + int_dict: IntDict = might_not_be_a_builtin_dict # E + print(int_dict) + +not_a_builtin_dict = CustomDict({"num": 1}) +might_not_be(not_a_builtin_dict) diff --git a/docs/spec/typeddict.rst b/docs/spec/typeddict.rst index 4cbeedba3..153fd0b76 100644 --- a/docs/spec/typeddict.rst +++ b/docs/spec/typeddict.rst @@ -285,6 +285,8 @@ refers to a dictionary object does not need to be supported, to simplify implementation. +.. _typeddict-assignability: + Assignability ^^^^^^^^^^^^^ @@ -410,6 +412,8 @@ Discussion: f(b) +.. _typeddict-operations: + Supported and Unsupported Operations ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -841,3 +845,553 @@ As discussed in the section :ref:`unpack-kwargs`, an unpacked ``TypedDict`` can kwargs["key1"] = 3 # Type check error: key1 is readonly fn: Function = impl # Accepted by type checker: function signatures are identical + +Extra Items and Closed TypedDicts +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +(Originally specified in :pep:`728`.) + +This section discusses the ``extra_items`` and ``closed`` class parameters. + +If ``extra_items`` is specified, extra items are treated as :ref:`non-required +` +items matching the ``extra_items`` argument, whose keys are allowed when +determining :ref:`supported and unsupported operations +`. + +The ``extra_items`` Class Parameter +----------------------------------- + +By default ``extra_items`` is unset. For a TypedDict type that specifies +``extra_items``, during construction, the value type of each unknown item +is expected to be non-required and assignable to the ``extra_items`` argument. +For example:: + + class Movie(TypedDict, extra_items=bool): + name: str + + a: Movie = {"name": "Blade Runner", "novel_adaptation": True} # OK + b: Movie = { + "name": "Blade Runner", + "year": 1982, # Not OK. 'int' is not assignable to 'bool' + } + +Here, ``extra_items=bool`` specifies that items other than ``'name'`` +have a value type of ``bool`` and are non-required. + +The alternative inline syntax is also supported:: + + Movie = TypedDict("Movie", {"name": str}, extra_items=bool) + +Accessing extra items is allowed. Type checkers must infer their value type from +the ``extra_items`` argument:: + + def f(movie: Movie) -> None: + reveal_type(movie["name"]) # Revealed type is 'str' + reveal_type(movie["novel_adaptation"]) # Revealed type is 'bool' + +``extra_items`` is inherited through subclassing:: + + class MovieBase(TypedDict, extra_items=ReadOnly[int | None]): + name: str + + class Movie(MovieBase): + year: int + + a: Movie = {"name": "Blade Runner", "year": None} # Not OK. 'None' is incompatible with 'int' + b: Movie = { + "name": "Blade Runner", + "year": 1982, + "other_extra_key": None, + } # OK + +Here, ``'year'`` in ``a`` is an extra key defined on ``Movie`` whose value type +is ``int``. ``'other_extra_key'`` in ``b`` is another extra key whose value type +must be assignable to the value of ``extra_items`` defined on ``MovieBase``. + +.. _typed-dict-closed: + +The ``closed`` Class Parameter +------------------------------ + +When neither ``extra_items`` nor ``closed=True`` is specified, ``closed=False`` +is assumed. The TypedDict should allow non-required extra items of value type +``ReadOnly[object]`` during inheritance or assignability checks, to +preserve the default TypedDict behavior. Extra keys included in TypedDict +object construction should still be caught, as mentioned :ref:`above `. + +When ``closed=True`` is set, no extra items are allowed. This is equivalent to +``extra_items=Never``, because there can't be a value type that is assignable to +:class:`~typing.Never`. It is a runtime error to use the ``closed`` and +``extra_items`` parameters in the same TypedDict definition. + +Similar to ``total``, only a literal ``True`` or ``False`` is supported as the +value of the ``closed`` argument. Type checkers should reject any non-literal value. + +Passing ``closed=False`` explicitly requests the default TypedDict behavior, +where arbitrary other keys may be present and subclasses may add arbitrary items. +It is a type checker error to pass ``closed=False`` if a superclass has +``closed=True`` or sets ``extra_items``. + +If ``closed`` is not provided, the behavior is inherited from the superclass. +If the superclass is TypedDict itself or the superclass does not have ``closed=True`` +or the ``extra_items`` parameter, the previous TypedDict behavior is preserved: +arbitrary extra items are allowed. If the superclass has ``closed=True``, the +child class is also closed:: + + class BaseMovie(TypedDict, closed=True): + name: str + + class MovieA(BaseMovie): # OK, still closed + pass + + class MovieB(BaseMovie, closed=True): # OK, but redundant + pass + + class MovieC(BaseMovie, closed=False): # Type checker error + pass + +As a consequence of ``closed=True`` being equivalent to ``extra_items=Never``, +the same rules that apply to ``extra_items=Never`` also apply to +``closed=True``. While they both have the same effect, ``closed=True`` is +preferred over ``extra_items=Never``. + +It is possible to use ``closed=True`` when subclassing if the ``extra_items`` +argument is a read-only type:: + + class Movie(TypedDict, extra_items=ReadOnly[str]): + pass + + class MovieClosed(Movie, closed=True): # OK + pass + + class MovieNever(Movie, extra_items=Never): # OK, but 'closed=True' is preferred + pass + +This will be further discussed in +:ref:`a later section `. + +``closed`` is also supported with the functional syntax:: + + Movie = TypedDict("Movie", {"name": str}, closed=True) + +Interaction with Totality +------------------------- + +It is an error to use ``Required[]`` or ``NotRequired[]`` with ``extra_items``. +``total=False`` and ``total=True`` have no effect on ``extra_items`` itself. + +The extra items are non-required, regardless of the `totality +`__ of the +TypedDict. :ref:`Operations ` +that are available to ``NotRequired`` items should also be available to the +extra items:: + + class Movie(TypedDict, extra_items=int): + name: str + + def f(movie: Movie) -> None: + del movie["name"] # Not OK. The value type of 'name' is 'Required[int]' + del movie["year"] # OK. The value type of 'year' is 'NotRequired[int]' + +Interaction with ``Unpack`` +--------------------------- + +For type checking purposes, ``Unpack[SomeTypedDict]`` with extra items should be +treated as its equivalent in regular parameters, and the existing rules for +function parameters still apply:: + + class MovieNoExtra(TypedDict): + name: str + + class MovieExtra(TypedDict, extra_items=int): + name: str + + def f(**kwargs: Unpack[MovieNoExtra]) -> None: ... + def g(**kwargs: Unpack[MovieExtra]) -> None: ... + + # Should be equivalent to: + def f(*, name: str) -> None: ... + def g(*, name: str, **kwargs: int) -> None: ... + + f(name="No Country for Old Men", year=2007) # Not OK. Unrecognized item + g(name="No Country for Old Men", year=2007) # OK + +Interaction with Read-only Items +-------------------------------- + +When the ``extra_items`` argument is annotated with the ``ReadOnly[]`` +:term:`type qualifier`, the extra items on the TypedDict have the +properties of read-only items. This interacts with inheritance rules specified +in :ref:`Read-only Items `. + +Notably, if the TypedDict type specifies ``extra_items`` to be read-only, +subclasses of the TypedDict type may redeclare ``extra_items``. + +Because a non-closed TypedDict type implicitly allows non-required extra items +of value type ``ReadOnly[object]``, its subclass can override the +``extra_items`` argument with more specific types. + +More details are discussed in the later sections. + +Inheritance +----------- + +``extra_items`` is inherited in a similar way as a regular ``key: value_type`` +item. As with the other keys, the `inheritance rules +`__ +and :ref:`Read-only Items ` inheritance rules apply. + +We need to reinterpret these rules to define how ``extra_items`` interacts with +them. + + * Changing a field type of a parent TypedDict class in a subclass is not allowed. + +First, it is not allowed to change the value of ``extra_items`` in a subclass +unless it is declared to be ``ReadOnly`` in the superclass:: + + class Parent(TypedDict, extra_items=int | None): + pass + + class Child(Parent, extra_items=int): # Not OK. Like any other TypedDict item, extra_items's type cannot be changed + pass + +Second, ``extra_items=T`` effectively defines the value type of any unnamed +items accepted to the TypedDict and marks them as non-required. Thus, the above +restriction applies to any additional items defined in a subclass. For each item +added in a subclass, all of the following conditions should apply: + +.. _pep728-inheritance-read-only: + +- If ``extra_items`` is read-only + + - The item can be either required or non-required + + - The item's value type is :term:`assignable` to ``T`` + +- If ``extra_items`` is not read-only + + - The item is non-required + + - The item's value type is :term:`consistent` with ``T`` + +- If ``extra_items`` is not overridden, the subclass inherits it as-is. + +For example:: + + class MovieBase(TypedDict, extra_items=int | None): + name: str + + class MovieRequiredYear(MovieBase): # Not OK. Required key 'year' is not known to 'MovieBase' + year: int | None + + class MovieNotRequiredYear(MovieBase): # Not OK. 'int | None' is not consistent with 'int' + year: NotRequired[int] + + class MovieWithYear(MovieBase): # OK + year: NotRequired[int | None] + + class BookBase(TypedDict, extra_items=ReadOnly[int | str]): + title: str + + class Book(BookBase, extra_items=str): # OK + year: int # OK + +An important side effect of the inheritance rules is that we can define a +TypedDict type that disallows additional items:: + + class MovieClosed(TypedDict, extra_items=Never): + name: str + +Here, passing the value :class:`~typing.Never` to ``extra_items`` specifies that +there can be no other keys in ``MovieFinal`` other than the known ones. +Because of its potential common use, there is a preferred alternative:: + + class MovieClosed(TypedDict, closed=True): + name: str + +where we implicitly assume that ``extra_items=Never``. + +Assignability +------------- + +Let ``S`` be the set of keys of the explicitly defined items on a TypedDict +type. If it specifies ``extra_items=T``, the TypedDict type is considered to +have an infinite set of items that all satisfy the following conditions. + +- If ``extra_items`` is read-only: + + - The key's value type is :term:`assignable` to ``T``. + + - The key is not in ``S``. + +- If ``extra_items`` is not read-only: + + - The key is non-required. + + - The key's value type is :term:`consistent` with ``T``. + + - The key is not in ``S``. + +For type checking purposes, let ``extra_items`` be a non-required pseudo-item +when checking for assignability according to rules defined in the +:ref:`Read-only Items ` section, with a new rule added in bold +text as follows: + + A TypedDict type ``B`` is :term:`assignable` to a TypedDict type + ``A`` if ``B`` is :term:`structurally ` assignable to + ``A``. This is true if and only if all of the following are satisfied: + + * **[If no key with the same name can be found in ``B``, the 'extra_items' + argument is considered the value type of the corresponding key.]** + + * For each item in ``A``, ``B`` has the corresponding key, unless the item in + ``A`` is read-only, not required, and of top value type + (``ReadOnly[NotRequired[object]]``). + + * For each item in ``A``, if ``B`` has the corresponding key, the corresponding + value type in ``B`` is assignable to the value type in ``A``. + + * For each non-read-only item in ``A``, its value type is assignable to the + corresponding value type in ``B``, and the corresponding key is not read-only + in ``B``. + + * For each required key in ``A``, the corresponding key is required in ``B``. + + * For each non-required key in ``A``, if the item is not read-only in ``A``, + the corresponding key is not required in ``B``. + +The following examples illustrate these checks in action. + +``extra_items`` puts various restrictions on additional items for assignability +checks:: + + class Movie(TypedDict, extra_items=int | None): + name: str + + class MovieDetails(TypedDict, extra_items=int | None): + name: str + year: NotRequired[int] + + details: MovieDetails = {"name": "Kill Bill Vol. 1", "year": 2003} + movie: Movie = details # Not OK. While 'int' is assignable to 'int | None', + # 'int | None' is not assignable to 'int' + + class MovieWithYear(TypedDict, extra_items=int | None): + name: str + year: int | None + + details: MovieWithYear = {"name": "Kill Bill Vol. 1", "year": 2003} + movie: Movie = details # Not OK. 'year' is not required in 'Movie', + # but it is required in 'MovieWithYear' + +where ``MovieWithYear`` (B) is not assignable to ``Movie`` (A) +according to this rule: + + * For each non-required key in ``A``, if the item is not read-only in ``A``, + the corresponding key is not required in ``B``. + +When ``extra_items`` is specified to be read-only on a TypedDict type, it is +possible for an item to have a :term:`narrower ` type than the +``extra_items`` argument:: + + class Movie(TypedDict, extra_items=ReadOnly[str | int]): + name: str + + class MovieDetails(TypedDict, extra_items=int): + name: str + year: NotRequired[int] + + details: MovieDetails = {"name": "Kill Bill Vol. 2", "year": 2004} + movie: Movie = details # OK. 'int' is assignable to 'str | int'. + +This behaves the same way as if ``year: ReadOnly[str | int]`` is an item +explicitly defined in ``Movie``. + +``extra_items`` as a pseudo-item follows the same rules that other items have, +so when both TypedDicts types specify ``extra_items``, this check is naturally +enforced:: + + class MovieExtraInt(TypedDict, extra_items=int): + name: str + + class MovieExtraStr(TypedDict, extra_items=str): + name: str + + extra_int: MovieExtraInt = {"name": "No Country for Old Men", "year": 2007} + extra_str: MovieExtraStr = {"name": "No Country for Old Men", "description": ""} + extra_int = extra_str # Not OK. 'str' is not assignable to extra items type 'int' + extra_str = extra_int # Not OK. 'int' is not assignable to extra items type 'str' + +A non-closed TypedDict type implicitly allows non-required extra keys of value +type ``ReadOnly[object]``. Applying the assignability rules between this type +and a closed TypedDict type is allowed:: + + class MovieNotClosed(TypedDict): + name: str + + extra_int: MovieExtraInt = {"name": "No Country for Old Men", "year": 2007} + not_closed: MovieNotClosed = {"name": "No Country for Old Men"} + extra_int = not_closed # Not OK. + # 'extra_items=ReadOnly[object]' implicitly on 'MovieNotClosed' + # is not assignable to with 'extra_items=int' + not_closed = extra_int # OK + +Interaction with Constructors +----------------------------- + +TypedDicts that allow extra items of type ``T`` also allow arbitrary keyword +arguments of this type when constructed by calling the class object:: + + class NonClosedMovie(TypedDict): + name: str + + NonClosedMovie(name="No Country for Old Men") # OK + NonClosedMovie(name="No Country for Old Men", year=2007) # Not OK. Unrecognized item + + class ExtraMovie(TypedDict, extra_items=int): + name: str + + ExtraMovie(name="No Country for Old Men") # OK + ExtraMovie(name="No Country for Old Men", year=2007) # OK + ExtraMovie( + name="No Country for Old Men", + language="English", + ) # Not OK. Wrong type for extra item 'language' + + # This implies 'extra_items=Never', + # so extra keyword arguments would produce an error + class ClosedMovie(TypedDict, closed=True): + name: str + + ClosedMovie(name="No Country for Old Men") # OK + ClosedMovie( + name="No Country for Old Men", + year=2007, + ) # Not OK. Extra items not allowed + +Supported and Unsupported Operations +------------------------------------ + +This statement from :ref:`above ` still holds true. + + Operations with arbitrary str keys (instead of string literals or other + expressions with known string values) should generally be rejected. + +Operations that already apply to ``NotRequired`` items should generally also +apply to extra items, following the same rationale from :ref:`above `: + + The exact type checking rules are up to each type checker to decide. In some + cases potentially unsafe operations may be accepted if the alternative is to + generate false positive errors for idiomatic code. + +Some operations, including indexed accesses and assignments with arbitrary str keys, +may be allowed due to the TypedDict being :term:`assignable` to +``Mapping[str, VT]`` or ``dict[str, VT]``. The two following sections will expand +on that. + +Interaction with Mapping[str, VT] +--------------------------------- + +A TypedDict type is :term:`assignable` to a type of the form ``Mapping[str, VT]`` +when all value types of the items in the TypedDict +are assignable to ``VT``. For the purpose of this rule, a +TypedDict that does not have ``extra_items=`` or ``closed=`` set is considered +to have an item with a value of type ``ReadOnly[object]``. This extends the +general rule for :ref:`TypedDict assignability `. + +For example:: + + class MovieExtraStr(TypedDict, extra_items=str): + name: str + + extra_str: MovieExtraStr = {"name": "Blade Runner", "summary": ""} + str_mapping: Mapping[str, str] = extra_str # OK + + class MovieExtraInt(TypedDict, extra_items=int): + name: str + + extra_int: MovieExtraInt = {"name": "Blade Runner", "year": 1982} + int_mapping: Mapping[str, int] = extra_int # Not OK. 'int | str' is not assignable with 'int' + int_str_mapping: Mapping[str, int | str] = extra_int # OK + +Type checkers should infer the precise signatures of ``values()`` and ``items()`` +on such TypedDict types:: + + def foo(movie: MovieExtraInt) -> None: + reveal_type(movie.items()) # Revealed type is 'dict_items[str, str | int]' + reveal_type(movie.values()) # Revealed type is 'dict_values[str, str | int]' + +By extension of this assignability rule, type checkers may allow indexed accesses +with arbitrary str keys when ``extra_items`` or ``closed=True`` is specified. +For example:: + + def bar(movie: MovieExtraInt, key: str) -> None: + reveal_type(movie[key]) # Revealed type is 'str | int' + +.. _pep728-type-narrowing: + +Defining the type narrowing behavior for TypedDict is out-of-scope for this spec. +This leaves flexibility for a type checker to be more/less restrictive about +indexed accesses with arbitrary str keys. For example, a type checker may opt +for more restriction by requiring an explicit ``'x' in d`` check. + +Interaction with dict[str, VT] +------------------------------ + +Because the presence of ``extra_items`` on a closed TypedDict type +prohibits additional required keys in its :term:`structural` +:term:`subtypes `, we can determine if the TypedDict type and +its structural subtypes will ever have any required key during static analysis. + +The TypedDict type is :term:`assignable` to ``dict[str, VT]`` if all +items on the TypedDict type satisfy the following conditions: + +- The value type of the item is :term:`consistent` with ``VT``. + +- The item is not read-only. + +- The item is not required. + +For example:: + + class IntDict(TypedDict, extra_items=int): + pass + + class IntDictWithNum(IntDict): + num: NotRequired[int] + + def f(x: IntDict) -> None: + v: dict[str, int] = x # OK + v.clear() # OK + + not_required_num_dict: IntDictWithNum = {"num": 1, "bar": 2} + regular_dict: dict[str, int] = not_required_num_dict # OK + f(not_required_num_dict) # OK + +In this case, methods that are previously unavailable on a TypedDict are allowed, +with signatures matching ``dict[str, VT]`` +(e.g.: ``__setitem__(self, key: str, value: VT) -> None``):: + + not_required_num_dict.clear() # OK + + reveal_type(not_required_num_dict.popitem()) # OK. Revealed type is 'tuple[str, int]' + + def f(not_required_num_dict: IntDictWithNum, key: str): + not_required_num_dict[key] = 42 # OK + del not_required_num_dict[key] # OK + +:ref:`Notes on indexed accesses ` from the previous section +still apply. + +``dict[str, VT]`` is not assignable to a TypedDict type, +because such dict can be a subtype of dict:: + + class CustomDict(dict[str, int]): + pass + + def f(might_not_be_a_builtin_dict: dict[str, int]): + int_dict: IntDict = might_not_be_a_builtin_dict # Not OK + + not_a_builtin_dict = CustomDict({"num": 1}) + f(not_a_builtin_dict) From 9d613b10bd1bfab483a9d0ccf82a3c6f6b1c4603 Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Mon, 18 Aug 2025 18:22:50 -0700 Subject: [PATCH 126/308] conformance tests: drop timing information (#2070) Timing information is nice to have but the current data is not very reliable, as it is the timing on whatever machine was used by the person who most recently regenerated the results. It's also a big source of merge conflicts, basically meaning that every pair of changes to the conformance suite will merge conflict with each other. To make it more pleasant to work with the conformance suite, let's just drop the timings. --- conformance/results/mypy/version.toml | 1 - conformance/results/pyright/version.toml | 1 - conformance/results/results.html | 4 ---- conformance/results/zuban/version.toml | 1 - conformance/src/main.py | 13 +++++-------- conformance/src/options.py | 6 ------ conformance/src/reporting.py | 7 ------- 7 files changed, 5 insertions(+), 28 deletions(-) diff --git a/conformance/results/mypy/version.toml b/conformance/results/mypy/version.toml index 867a79fe2..b72d4180d 100644 --- a/conformance/results/mypy/version.toml +++ b/conformance/results/mypy/version.toml @@ -1,2 +1 @@ version = "mypy 1.17.1" -test_duration = 2.04 diff --git a/conformance/results/pyright/version.toml b/conformance/results/pyright/version.toml index 7e373c1a8..ec4415b18 100644 --- a/conformance/results/pyright/version.toml +++ b/conformance/results/pyright/version.toml @@ -1,2 +1 @@ version = "pyright 1.1.403" -test_duration = 1.83 diff --git a/conformance/results/results.html b/conformance/results/results.html index 40ce04d0b..151069d7a 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -159,16 +159,12 @@

    Python Type System Conformance Test Results

     
    mypy 1.17.1
    -
    3.0sec
    +
    2.0sec
    pyright 1.1.403
    -
    3.1sec
    +
    1.8sec
    pyre 0.9.25
    -
    5.9sec
    +
    10.3sec
    zuban 0.0.19
    -
    0.15sec
    +
    0.35sec
    @@ -744,6 +744,12 @@

    Python Type System Conformance Test Results

    Partial

    Rejects legitimate use of dataclass field with `kw_only=True`.

    Pass
         dataclasses_match_argsPass
    Partial

    Generates __match_args__ when match_args=False.

    Partial

    Adds kw-only fields to __match_args__.

    Pass
         dataclasses_order Pass Pass
    pyright 1.1.403
    -
    1.8sec
    +
    1.3sec
    pyre 0.9.25
    -
    10.3sec
    +
    10.2sec
    zuban 0.0.19
    -
    0.35sec
    +
    0.32sec
    @@ -819,6 +819,12 @@

    Python Type System Conformance Test Results

    Partial

    Does not reject methods within TypedDict class.

    Does not report when metaclass is provided.

    Does not report when other keyword argument is provided.

    Does not support generic TypedDict class.

    Pass
         typeddicts_extra_items
    Unsupported

    Not supported.

    Pass
    Unsupported

    Not supported.

    Unsupported

    Not supported.

         typeddicts_final Pass Pass
    ") summary_html.append("") From 63534a9245bf2e82ad7182ddaf852922d063f837 Mon Sep 17 00:00:00 2001 From: Shahriar Heidrich Date: Wed, 20 Aug 2025 18:50:56 +0200 Subject: [PATCH 127/308] Replace typing_extensions -> typing in examples (#1987) --- docs/guides/unreachable.rst | 7 ++++++- docs/reference/generics.rst | 17 +++++++++-------- docs/reference/protocols.rst | 14 +++++--------- docs/reference/quality.rst | 7 ++++++- 4 files changed, 26 insertions(+), 19 deletions(-) diff --git a/docs/guides/unreachable.rst b/docs/guides/unreachable.rst index 7ad519b01..e72fe2f6b 100644 --- a/docs/guides/unreachable.rst +++ b/docs/guides/unreachable.rst @@ -54,7 +54,7 @@ As an example, consider this simple calculator: .. code:: python import enum - from typing_extensions import Never + from typing import Never def assert_never(arg: Never) -> Never: raise AssertionError("Expected code to be unreachable") @@ -72,6 +72,11 @@ As an example, consider this simple calculator: case _: assert_never(op) +.. note:: + + To use this feature on Python versions earlier than 3.11, you will need to + import ``Never`` from ``typing_extensions`` (version 4.1 or newer). + The ``match`` statement covers all members of the ``Op`` enum, so the ``assert_never()`` call is unreachable and the type checker will accept this code. However, if you add another member to the diff --git a/docs/reference/generics.rst b/docs/reference/generics.rst index 120124566..c39d2bc11 100644 --- a/docs/reference/generics.rst +++ b/docs/reference/generics.rst @@ -651,8 +651,7 @@ for a more faithful type annotation: .. code-block:: python - from typing import Callable, TypeVar - from typing_extensions import ParamSpec + from typing import Callable, ParamSpec, TypeVar P = ParamSpec('P') T = TypeVar('T') @@ -663,13 +662,17 @@ for a more faithful type annotation: return func(*args, **kwds) return wrapper +.. note:: + + To use this feature on Python versions earlier than 3.10, you will need to + import ``ParamSpec`` and ``Concatenate`` from ``typing_extensions``. + Parameter specifications also allow you to describe decorators that alter the signature of the input function: .. code-block:: python - from typing import Callable, TypeVar - from typing_extensions import ParamSpec + from typing import Callable, ParamSpec, TypeVar P = ParamSpec('P') T = TypeVar('T') @@ -692,8 +695,7 @@ Or insert an argument: .. code-block:: python - from typing import Callable, TypeVar - from typing_extensions import Concatenate, ParamSpec + from typing import Callable, Concatenate, ParamSpec, TypeVar P = ParamSpec('P') T = TypeVar('T') @@ -774,8 +776,7 @@ Example: .. code-block:: python - from typing import TypeVar - from typing_extensions import Protocol + from typing import Protocol, TypeVar T = TypeVar('T') diff --git a/docs/reference/protocols.rst b/docs/reference/protocols.rst index 13b2e9ca8..72d1a3e80 100644 --- a/docs/reference/protocols.rst +++ b/docs/reference/protocols.rst @@ -71,8 +71,7 @@ You can define your own protocol class by inheriting from the special .. code-block:: python - from typing import Iterable - from typing_extensions import Protocol + from typing import Iterable, Protocol class SupportsClose(Protocol): # Empty method body (explicit '...') @@ -231,8 +230,7 @@ such as trees and linked lists: .. code-block:: python - from typing import TypeVar, Optional - from typing_extensions import Protocol + from typing import TypeVar, Optional, Protocol class TreeLike(Protocol): value: int @@ -260,7 +258,7 @@ rudimentary support for runtime structural checks: .. code-block:: python - from typing_extensions import Protocol, runtime_checkable + from typing import Protocol, runtime_checkable @runtime_checkable class Portable(Protocol): @@ -303,8 +301,7 @@ member: .. code-block:: python - from typing import Optional, Iterable - from typing_extensions import Protocol + from typing import Optional, Iterable, Protocol class Combiner(Protocol): def __call__(self, *vals: bytes, maxlen: Optional[int] = None) -> list[bytes]: ... @@ -328,8 +325,7 @@ a double underscore prefix is used. For example: .. code-block:: python - from typing import Callable, TypeVar - from typing_extensions import Protocol + from typing import Callable, TypeVar, Protocol T = TypeVar('T') diff --git a/docs/reference/quality.rst b/docs/reference/quality.rst index 8ec08aed8..12b665363 100644 --- a/docs/reference/quality.rst +++ b/docs/reference/quality.rst @@ -40,10 +40,15 @@ then the following file tests ``foo.py``: .. code-block:: python - from typing_extensions import assert_type + from typing import assert_type assert_type(bar(42), str) +.. note:: + + To use this feature on Python versions earlier than 3.11, you will need to + import ``assert_type`` from ``typing_extensions`` (version 4.2 or newer). + Clever use of ``mypy --warn-unused-ignores`` can be used to check that certain expressions are or are not well-typed. The idea is to have valid expressions along with invalid expressions annotated with ``type: ignore`` comments. When From 05afd79aa2befd49d242361cf96da198cedc3bcc Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Wed, 20 Aug 2025 19:13:25 +0100 Subject: [PATCH 128/308] Fixup language around `NewType` in the spec (#2075) --- conformance/results/mypy/aliases_newtype.toml | 2 +- conformance/results/results.html | 2 +- conformance/tests/aliases_newtype.py | 12 ++++++------ docs/spec/aliases.rst | 15 +++++++++------ docs/spec/protocol.rst | 1 + 5 files changed, 18 insertions(+), 14 deletions(-) diff --git a/conformance/results/mypy/aliases_newtype.toml b/conformance/results/mypy/aliases_newtype.toml index e1c8c64a7..f4c4bc856 100644 --- a/conformance/results/mypy/aliases_newtype.toml +++ b/conformance/results/mypy/aliases_newtype.toml @@ -1,6 +1,6 @@ conformant = "Partial" notes = """ -`NewType`s are considered classes, not functions. +`NewType`s are incorrectly considered to be classes. """ output = """ aliases_newtype.py:11: error: Argument 1 to "UserId" has incompatible type "str"; expected "int" [arg-type] diff --git a/conformance/results/results.html b/conformance/results/results.html index 151069d7a..6cbe8f005 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -468,7 +468,7 @@

    Python Type System Conformance Test Results

    - + diff --git a/conformance/tests/aliases_newtype.py b/conformance/tests/aliases_newtype.py index 713b0bf88..58baeb8af 100644 --- a/conformance/tests/aliases_newtype.py +++ b/conformance/tests/aliases_newtype.py @@ -1,5 +1,5 @@ """ -Tests the `typing.NewType` function. +Tests the `typing.NewType` type constructor. """ # Specification: https://typing.readthedocs.io/en/latest/spec/aliases.html#newtype @@ -14,12 +14,12 @@ assert_type(UserId(5) + 1, int) -# > NewType('Derived', Base) returns a dummy function -_: type = UserId # E: functions are not instances of `type` +# > NewType('Derived', Base) returns a dummy object +_: type = UserId # E: `NewType()` does not return an instance of `type` -# > Both isinstance and issubclass, as well as subclassing will fail for -# > NewType('Derived', Base) since function objects don’t support these -# > operations. +# > Both ``isinstance`` and ``issubclass``, as well as subclassing will fail +# > for ``NewType('Derived', Base)``, since the object returned by a call to +# > ``NewType`` is not a class. isinstance(u2, UserId) # E: not allowed in isinstance call diff --git a/docs/spec/aliases.rst b/docs/spec/aliases.rst index adf303440..a965eca41 100644 --- a/docs/spec/aliases.rst +++ b/docs/spec/aliases.rst @@ -156,9 +156,9 @@ to a definition:: def __init__(self, _x: Base) -> None: ... -While at runtime, ``NewType('Derived', Base)`` returns a dummy function -that simply returns its argument. Type checkers require explicit casts -from ``int`` where ``UserId`` is expected, while implicitly casting +While at runtime, ``NewType('Derived', Base)`` returns a dummy object +that simply returns its argument when called. Type checkers require explicit +casts from ``int`` where ``UserId`` is expected, while implicitly casting from ``UserId`` where ``int`` is expected. Examples:: UserId = NewType('UserId', int) @@ -176,7 +176,7 @@ from ``UserId`` where ``int`` is expected. Examples:: ``NewType`` accepts exactly two arguments: a name for the new unique type, and a base class. The latter should be a proper class (i.e., not a type construct like ``Union``, etc.), or another unique type created -by calling ``NewType``. The function returned by ``NewType`` +by calling ``NewType``. The callable returned by ``NewType`` accepts only one argument; this is equivalent to supporting only one constructor accepting an instance of the base class (see above). Example:: @@ -193,5 +193,8 @@ constructor accepting an instance of the base class (see above). Example:: tcp_packet = TcpPacketId(127, 0) # Fails in type checker and at runtime Both ``isinstance`` and ``issubclass``, as well as subclassing will fail -for ``NewType('Derived', Base)`` since function objects don't support -these operations. +for ``NewType('Derived', Base)``, since the object returned by a call to +``NewType`` is not a class. + +See also :ref:`protocol-newtype-aliases` for a discussion of how +``NewType`` interacts with protocol definitions. diff --git a/docs/spec/protocol.rst b/docs/spec/protocol.rst index 50b64f372..39e7a82a6 100644 --- a/docs/spec/protocol.rst +++ b/docs/spec/protocol.rst @@ -514,6 +514,7 @@ For example:: a: ProtoA = C # Type check error, signatures don't match! b: ProtoB = C # OK +.. _`protocol-newtype-aliases`: ``NewType()`` and type aliases ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ From 3be5b1ce467372393b58f1082d9d2b701ffedd61 Mon Sep 17 00:00:00 2001 From: Daniel Sperber Date: Mon, 25 Aug 2025 08:34:06 +0200 Subject: [PATCH 129/308] Remove free return in snippet (#2076) --- docs/guides/writing_stubs.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guides/writing_stubs.rst b/docs/guides/writing_stubs.rst index 23966933a..852dee743 100644 --- a/docs/guides/writing_stubs.rst +++ b/docs/guides/writing_stubs.rst @@ -811,7 +811,7 @@ This avoid forcing the user to check for ``None``:: match = re.fullmatch(r"\d+_(.*)", some_string) assert match is not None name_group = match.group(1) # The user knows that this will never be None - return name_group.uper() # This typo will be flagged by the type checker + name_group.uper() # This typo will be flagged by the type checker In this case, the user of ``match.group()`` must be prepared to handle a ``str``, but type checkers are happy with ``if name_group is None`` checks, because we're From 9228c3aabd495c42e7a137abbcd2d69806b11701 Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Tue, 26 Aug 2025 16:13:33 +0100 Subject: [PATCH 130/308] Add link anchors for each step of the overload call evaluation algorithm (#2077) --- docs/spec/overload.rst | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/docs/spec/overload.rst b/docs/spec/overload.rst index 9ddfe601d..52982c54a 100644 --- a/docs/spec/overload.rst +++ b/docs/spec/overload.rst @@ -196,8 +196,10 @@ Only the overloads (the ``@overload``-decorated signatures) should be considered for matching purposes. The implementation, if provided, should be ignored for purposes of overload matching. +Step 1 +~~~~~~ -Step 1: Examine the argument list to determine the number of +Examine the argument list to determine the number of positional and keyword arguments. Use this information to eliminate any overload candidates that are not plausible based on their input signatures. @@ -207,8 +209,10 @@ input signatures. it as if it were a non-overloaded function call and stop. - If two or more candidate overloads remain, proceed to step 2. +Step 2 +~~~~~~ -Step 2: Evaluate each remaining overload as a regular (non-overloaded) +Evaluate each remaining overload as a regular (non-overloaded) call to determine whether it is compatible with the supplied argument list. Unlike step 1, this step considers the types of the parameters and arguments. During this step, do not generate any user-visible errors. @@ -219,8 +223,10 @@ Simply record which of the overloads result in evaluation errors. Evaluate it as if it were a non-overloaded function call and stop. - If two or more candidate overloads remain, proceed to step 4. +Step 3 +~~~~~~ -Step 3: If step 2 produces errors for all overloads, perform +If step 2 produces errors for all overloads, perform "argument type expansion". Union types can be expanded into their constituent subtypes. For example, the type ``int | str`` can be expanded into ``int`` and ``str``. @@ -248,8 +254,10 @@ expanded argument lists. For additional details about argument type expansion, see `argument-type-expansion`_ below. +Step 4 +~~~~~~ -Step 4: If the argument list is compatible with two or more overloads, +If the argument list is compatible with two or more overloads, determine whether one or more of the overloads has a variadic parameter (either ``*args`` or ``**kwargs``) that maps to a corresponding argument that supplies an indeterminate number of positional or keyword arguments. @@ -260,8 +268,10 @@ If so, eliminate overloads that do not have a variadic parameter. call and stop. - If two or more candidate overloads remain, proceed to step 5. +Step 5 +~~~~~~ -Step 5: For all arguments, determine whether all possible +For all arguments, determine whether all possible :term:`materializations ` of the argument's type are assignable to the corresponding parameter type for each of the remaining overloads. If so, eliminate all of the subsequent remaining overloads. @@ -295,10 +305,15 @@ for all remaining overloads are :term:`equivalent`, proceed to step 6. If the return types are not equivalent, overload matching is ambiguous. In this case, assume a return type of ``Any`` and stop. +Step 6 +~~~~~~ -Step 6: Choose the first remaining candidate overload as the winning +Choose the first remaining candidate overload as the winning match. Evaluate it as if it were a non-overloaded function call and stop. +Examples +~~~~~~~~ + Example 1:: @overload From fb7fe96ce71669a1679d6f3229856ed2426e27e9 Mon Sep 17 00:00:00 2001 From: Rebecca Chen Date: Wed, 27 Aug 2025 14:54:35 -0700 Subject: [PATCH 131/308] Make some minor fixes and improvements to the typedddicts_extra_items test (#2073) * Make some minor fixes and improvements to the typedddicts_extra_items test. * Add BookBase base class. --- conformance/requirements.txt | 1 + .../results/mypy/typeddicts_extra_items.toml | 182 +++++++++--------- .../results/pyre/typeddicts_extra_items.toml | 178 ++++++++--------- .../pyright/typeddicts_extra_items.toml | 53 ++--- conformance/results/results.html | 2 +- .../results/zuban/typeddicts_extra_items.toml | 178 ++++++++--------- conformance/tests/typeddicts_extra_items.py | 23 ++- 7 files changed, 322 insertions(+), 295 deletions(-) diff --git a/conformance/requirements.txt b/conformance/requirements.txt index 973d0bf51..0e2f33c6e 100644 --- a/conformance/requirements.txt +++ b/conformance/requirements.txt @@ -5,3 +5,4 @@ pyright mypy pip pyre-check; platform_system != "Windows" +zuban diff --git a/conformance/results/mypy/typeddicts_extra_items.toml b/conformance/results/mypy/typeddicts_extra_items.toml index 9f1bde568..1fdda3d4d 100644 --- a/conformance/results/mypy/typeddicts_extra_items.toml +++ b/conformance/results/mypy/typeddicts_extra_items.toml @@ -4,16 +4,17 @@ Not supported. """ conformance_automated = "Fail" errors_diff = """ -Line 181: Expected 1 errors -Line 184: Expected 1 errors -Line 206: Expected 1 errors -Line 213: Expected 1 errors -Line 233: Expected 1 errors -Line 247: Expected 1 errors -Line 248: Expected 1 errors -Line 259: Expected 1 errors +Line 215: Expected 1 errors +Line 222: Expected 1 errors +Line 242: Expected 1 errors +Line 256: Expected 1 errors +Line 257: Expected 1 errors +Line 268: Expected 1 errors Lines 91, 92: Expected error (tag 'MovieC') 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 11: Unexpected errors ['typeddicts_extra_items.py:11: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] Line 14: Unexpected errors ['typeddicts_extra_items.py:14: error: Extra key "novel_adaptation" for TypedDict "Movie" [typeddict-unknown-key]'] Line 19: Unexpected errors ['typeddicts_extra_items.py:19: error: Unexpected keyword argument "extra_items" for "TypedDict" [misc]'] @@ -29,43 +30,44 @@ Line 88: Unexpected errors ['typeddicts_extra_items.py:88: error: Unexpected key Line 100: Unexpected errors ['typeddicts_extra_items.py:100: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] Line 103: Unexpected errors ['typeddicts_extra_items.py:103: error: Unexpected keyword argument "closed" for "__init_subclass__" of "TypedDict" [call-arg]'] Line 106: Unexpected errors ['typeddicts_extra_items.py:106: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] -Line 121: Unexpected errors ['typeddicts_extra_items.py:121: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] -Line 126: Unexpected errors ['typeddicts_extra_items.py:126: error: TypedDict "MovieEI" has no key "year" [typeddict-item]'] -Line 134: Unexpected errors ['typeddicts_extra_items.py:134: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] -Line 141: Unexpected errors ['typeddicts_extra_items.py:141: error: Unexpected keyword argument "year" for "unpack_extra" [call-arg]'] -Line 146: Unexpected errors ['typeddicts_extra_items.py:146: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] +Line 124: Unexpected errors ['typeddicts_extra_items.py:124: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] +Line 129: Unexpected errors ['typeddicts_extra_items.py:129: error: TypedDict "MovieEI" has no key "year" [typeddict-item]'] +Line 137: Unexpected errors ['typeddicts_extra_items.py:137: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] +Line 144: Unexpected errors ['typeddicts_extra_items.py:144: error: Unexpected keyword argument "year" for "unpack_extra" [call-arg]'] Line 149: Unexpected errors ['typeddicts_extra_items.py:149: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] Line 152: Unexpected errors ['typeddicts_extra_items.py:152: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] -Line 162: Unexpected errors ['typeddicts_extra_items.py:162: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] -Line 168: Unexpected errors ['typeddicts_extra_items.py:168: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] -Line 178: Unexpected errors ['typeddicts_extra_items.py:178: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] -Line 201: Unexpected errors ['typeddicts_extra_items.py:201: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] -Line 208: Unexpected errors ['typeddicts_extra_items.py:208: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] -Line 219: Unexpected errors ['typeddicts_extra_items.py:219: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] -Line 222: Unexpected errors ['typeddicts_extra_items.py:222: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] -Line 226: Unexpected errors ['typeddicts_extra_items.py:226: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] -Line 239: Unexpected errors ['typeddicts_extra_items.py:239: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] -Line 242: Unexpected errors ['typeddicts_extra_items.py:242: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] -Line 245: Unexpected errors ['typeddicts_extra_items.py:245: error: Extra key "year" for TypedDict "MovieExtraInt" [typeddict-unknown-key]'] -Line 246: Unexpected errors ['typeddicts_extra_items.py:246: error: Extra key "description" for TypedDict "MovieExtraStr" [typeddict-unknown-key]'] -Line 257: Unexpected errors ['typeddicts_extra_items.py:257: error: Extra key "year" for TypedDict "MovieExtraInt" [typeddict-unknown-key]'] -Line 271: Unexpected errors ['typeddicts_extra_items.py:271: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] -Line 275: Unexpected errors ['typeddicts_extra_items.py:275: error: Extra key "year" for TypedDict "ExtraMovie" [typeddict-unknown-key]'] -Line 280: Unexpected errors ['typeddicts_extra_items.py:280: error: Unexpected keyword argument "closed" for "__init_subclass__" of "TypedDict" [call-arg]'] -Line 290: Unexpected errors ['typeddicts_extra_items.py:290: error: Extra key "summary" for TypedDict "MovieExtraStr" [typeddict-unknown-key]'] -Line 291: Unexpected errors ['typeddicts_extra_items.py:291: error: Incompatible types in assignment (expression has type "MovieExtraStr", variable has type "Mapping[str, str]") [assignment]'] -Line 293: Unexpected errors ['typeddicts_extra_items.py:293: error: Extra key "year" for TypedDict "MovieExtraInt" [typeddict-unknown-key]'] -Line 295: Unexpected errors ['typeddicts_extra_items.py:295: error: Incompatible types in assignment (expression has type "MovieExtraInt", variable has type "Mapping[str, int | str]") [assignment]'] -Line 301: Unexpected errors ['typeddicts_extra_items.py:301: error: Expression is of type "list[tuple[str, object]]", not "list[tuple[str, int | str]]" [assert-type]'] -Line 302: Unexpected errors ['typeddicts_extra_items.py:302: error: Expression is of type "list[object]", not "list[int | str]" [assert-type]'] -Line 310: Unexpected errors ['typeddicts_extra_items.py:310: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] -Line 317: Unexpected errors ['typeddicts_extra_items.py:317: error: Incompatible types in assignment (expression has type "IntDict", variable has type "dict[str, int]") [assignment]'] -Line 320: Unexpected errors ['typeddicts_extra_items.py:320: error: Extra key "bar" for TypedDict "IntDictWithNum" [typeddict-unknown-key]'] -Line 321: Unexpected errors ['typeddicts_extra_items.py:321: error: Incompatible types in assignment (expression has type "IntDictWithNum", variable has type "dict[str, int]") [assignment]'] -Line 328: Unexpected errors ['typeddicts_extra_items.py:328: error: "IntDictWithNum" has no attribute "clear" [attr-defined]'] -Line 330: Unexpected errors ['typeddicts_extra_items.py:330: error: Expression is of type "Any", not "tuple[str, int]" [assert-type]', 'typeddicts_extra_items.py:330: error: "IntDictWithNum" has no attribute "popitem" [attr-defined]'] -Line 333: Unexpected errors ['typeddicts_extra_items.py:333: error: TypedDict key must be a string literal; expected one of ("num") [literal-required]'] -Line 334: Unexpected errors ['typeddicts_extra_items.py:334: error: Expected TypedDict key to be string literal [misc]'] +Line 155: Unexpected errors ['typeddicts_extra_items.py:155: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] +Line 165: Unexpected errors ['typeddicts_extra_items.py:165: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] +Line 171: Unexpected errors ['typeddicts_extra_items.py:171: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] +Line 181: Unexpected errors ['typeddicts_extra_items.py:181: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] +Line 193: Unexpected errors ['typeddicts_extra_items.py:193: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] +Line 210: Unexpected errors ['typeddicts_extra_items.py:210: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] +Line 217: Unexpected errors ['typeddicts_extra_items.py:217: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] +Line 228: Unexpected errors ['typeddicts_extra_items.py:228: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] +Line 231: Unexpected errors ['typeddicts_extra_items.py:231: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] +Line 235: Unexpected errors ['typeddicts_extra_items.py:235: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] +Line 248: Unexpected errors ['typeddicts_extra_items.py:248: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] +Line 251: Unexpected errors ['typeddicts_extra_items.py:251: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] +Line 254: Unexpected errors ['typeddicts_extra_items.py:254: error: Extra key "year" for TypedDict "MovieExtraInt" [typeddict-unknown-key]'] +Line 255: Unexpected errors ['typeddicts_extra_items.py:255: error: Extra key "description" for TypedDict "MovieExtraStr" [typeddict-unknown-key]'] +Line 266: Unexpected errors ['typeddicts_extra_items.py:266: error: Extra key "year" for TypedDict "MovieExtraInt" [typeddict-unknown-key]'] +Line 280: Unexpected errors ['typeddicts_extra_items.py:280: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] +Line 284: Unexpected errors ['typeddicts_extra_items.py:284: error: Extra key "year" for TypedDict "ExtraMovie" [typeddict-unknown-key]'] +Line 289: Unexpected errors ['typeddicts_extra_items.py:289: error: Unexpected keyword argument "closed" for "__init_subclass__" of "TypedDict" [call-arg]'] +Line 299: Unexpected errors ['typeddicts_extra_items.py:299: error: Extra key "summary" for TypedDict "MovieExtraStr" [typeddict-unknown-key]'] +Line 300: Unexpected errors ['typeddicts_extra_items.py:300: error: Incompatible types in assignment (expression has type "MovieExtraStr", variable has type "Mapping[str, str]") [assignment]'] +Line 302: Unexpected errors ['typeddicts_extra_items.py:302: error: Extra key "year" for TypedDict "MovieExtraInt" [typeddict-unknown-key]'] +Line 304: Unexpected errors ['typeddicts_extra_items.py:304: error: Incompatible types in assignment (expression has type "MovieExtraInt", variable has type "Mapping[str, int | str]") [assignment]'] +Line 310: Unexpected errors ['typeddicts_extra_items.py:310: error: Expression is of type "list[tuple[str, object]]", not "list[tuple[str, int | str]]" [assert-type]'] +Line 311: Unexpected errors ['typeddicts_extra_items.py:311: error: Expression is of type "list[object]", not "list[int | str]" [assert-type]'] +Line 319: Unexpected errors ['typeddicts_extra_items.py:319: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] +Line 326: Unexpected errors ['typeddicts_extra_items.py:326: error: Incompatible types in assignment (expression has type "IntDict", variable has type "dict[str, int]") [assignment]'] +Line 329: Unexpected errors ['typeddicts_extra_items.py:329: error: Extra key "bar" for TypedDict "IntDictWithNum" [typeddict-unknown-key]'] +Line 330: Unexpected errors ['typeddicts_extra_items.py:330: error: Incompatible types in assignment (expression has type "IntDictWithNum", variable has type "dict[str, int]") [assignment]'] +Line 337: Unexpected errors ['typeddicts_extra_items.py:337: error: "IntDictWithNum" has no attribute "clear" [attr-defined]'] +Line 339: Unexpected errors ['typeddicts_extra_items.py:339: error: Expression is of type "Any", not "tuple[str, int]" [assert-type]', 'typeddicts_extra_items.py:339: error: "IntDictWithNum" has no attribute "popitem" [attr-defined]'] +Line 342: Unexpected errors ['typeddicts_extra_items.py:342: error: TypedDict key must be a string literal; expected one of ("num") [literal-required]'] +Line 343: Unexpected errors ['typeddicts_extra_items.py:343: error: Expected TypedDict key to be string literal [misc]'] """ output = """ typeddicts_extra_items.py:11: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] @@ -90,54 +92,56 @@ typeddicts_extra_items.py:88: error: Unexpected keyword argument "closed" for "_ typeddicts_extra_items.py:100: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] typeddicts_extra_items.py:103: error: Unexpected keyword argument "closed" for "__init_subclass__" of "TypedDict" [call-arg] typeddicts_extra_items.py:106: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] -typeddicts_extra_items.py:111: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_extra_items.py:109: error: Unexpected keyword argument "closed" for "__init_subclass__" of "TypedDict" [call-arg] typeddicts_extra_items.py:114: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] -typeddicts_extra_items.py:121: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] -typeddicts_extra_items.py:125: error: Key "name" of TypedDict "MovieEI" cannot be deleted [misc] -typeddicts_extra_items.py:126: error: TypedDict "MovieEI" has no key "year" [typeddict-item] -typeddicts_extra_items.py:134: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] -typeddicts_extra_items.py:137: note: "unpack_no_extra" defined here -typeddicts_extra_items.py:138: note: "unpack_extra" defined here -typeddicts_extra_items.py:140: error: Unexpected keyword argument "year" for "unpack_no_extra" [call-arg] -typeddicts_extra_items.py:141: error: Unexpected keyword argument "year" for "unpack_extra" [call-arg] -typeddicts_extra_items.py:146: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_extra_items.py:117: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_extra_items.py:124: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_extra_items.py:128: error: Key "name" of TypedDict "MovieEI" cannot be deleted [misc] +typeddicts_extra_items.py:129: error: TypedDict "MovieEI" has no key "year" [typeddict-item] +typeddicts_extra_items.py:137: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_extra_items.py:140: note: "unpack_no_extra" defined here +typeddicts_extra_items.py:141: note: "unpack_extra" defined here +typeddicts_extra_items.py:143: error: Unexpected keyword argument "year" for "unpack_no_extra" [call-arg] +typeddicts_extra_items.py:144: error: Unexpected keyword argument "year" for "unpack_extra" [call-arg] typeddicts_extra_items.py:149: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] typeddicts_extra_items.py:152: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] -typeddicts_extra_items.py:162: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] -typeddicts_extra_items.py:168: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_extra_items.py:155: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_extra_items.py:165: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] typeddicts_extra_items.py:171: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] -typeddicts_extra_items.py:178: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] -typeddicts_extra_items.py:201: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] -typeddicts_extra_items.py:208: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] -typeddicts_extra_items.py:219: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] -typeddicts_extra_items.py:222: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] -typeddicts_extra_items.py:226: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] -typeddicts_extra_items.py:239: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] -typeddicts_extra_items.py:242: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] -typeddicts_extra_items.py:245: error: Extra key "year" for TypedDict "MovieExtraInt" [typeddict-unknown-key] -typeddicts_extra_items.py:246: error: Extra key "description" for TypedDict "MovieExtraStr" [typeddict-unknown-key] -typeddicts_extra_items.py:257: error: Extra key "year" for TypedDict "MovieExtraInt" [typeddict-unknown-key] -typeddicts_extra_items.py:269: error: Extra key "year" for TypedDict "NonClosedMovie" [typeddict-unknown-key] -typeddicts_extra_items.py:271: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] -typeddicts_extra_items.py:275: error: Extra key "year" for TypedDict "ExtraMovie" [typeddict-unknown-key] -typeddicts_extra_items.py:276: error: Extra key "language" for TypedDict "ExtraMovie" [typeddict-unknown-key] -typeddicts_extra_items.py:280: error: Unexpected keyword argument "closed" for "__init_subclass__" of "TypedDict" [call-arg] -typeddicts_extra_items.py:284: error: Extra key "year" for TypedDict "ClosedMovie" [typeddict-unknown-key] -typeddicts_extra_items.py:290: error: Extra key "summary" for TypedDict "MovieExtraStr" [typeddict-unknown-key] -typeddicts_extra_items.py:291: error: Incompatible types in assignment (expression has type "MovieExtraStr", variable has type "Mapping[str, str]") [assignment] -typeddicts_extra_items.py:293: error: Extra key "year" for TypedDict "MovieExtraInt" [typeddict-unknown-key] -typeddicts_extra_items.py:294: error: Incompatible types in assignment (expression has type "MovieExtraInt", variable has type "Mapping[str, int]") [assignment] -typeddicts_extra_items.py:295: error: Incompatible types in assignment (expression has type "MovieExtraInt", variable has type "Mapping[str, int | str]") [assignment] -typeddicts_extra_items.py:301: error: Expression is of type "list[tuple[str, object]]", not "list[tuple[str, int | str]]" [assert-type] -typeddicts_extra_items.py:302: error: Expression is of type "list[object]", not "list[int | str]" [assert-type] -typeddicts_extra_items.py:310: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] -typeddicts_extra_items.py:317: error: Incompatible types in assignment (expression has type "IntDict", variable has type "dict[str, int]") [assignment] -typeddicts_extra_items.py:320: error: Extra key "bar" for TypedDict "IntDictWithNum" [typeddict-unknown-key] -typeddicts_extra_items.py:321: error: Incompatible types in assignment (expression has type "IntDictWithNum", variable has type "dict[str, int]") [assignment] -typeddicts_extra_items.py:328: error: "IntDictWithNum" has no attribute "clear" [attr-defined] -typeddicts_extra_items.py:330: error: Expression is of type "Any", not "tuple[str, int]" [assert-type] -typeddicts_extra_items.py:330: error: "IntDictWithNum" has no attribute "popitem" [attr-defined] -typeddicts_extra_items.py:333: error: TypedDict key must be a string literal; expected one of ("num") [literal-required] -typeddicts_extra_items.py:334: error: Expected TypedDict key to be string literal [misc] -typeddicts_extra_items.py:343: error: Incompatible types in assignment (expression has type "dict[str, int]", variable has type "IntDict") [assignment] +typeddicts_extra_items.py:174: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_extra_items.py:181: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_extra_items.py:193: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_extra_items.py:210: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_extra_items.py:217: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_extra_items.py:228: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_extra_items.py:231: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_extra_items.py:235: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_extra_items.py:248: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_extra_items.py:251: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_extra_items.py:254: error: Extra key "year" for TypedDict "MovieExtraInt" [typeddict-unknown-key] +typeddicts_extra_items.py:255: error: Extra key "description" for TypedDict "MovieExtraStr" [typeddict-unknown-key] +typeddicts_extra_items.py:266: error: Extra key "year" for TypedDict "MovieExtraInt" [typeddict-unknown-key] +typeddicts_extra_items.py:278: error: Extra key "year" for TypedDict "NonClosedMovie" [typeddict-unknown-key] +typeddicts_extra_items.py:280: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_extra_items.py:284: error: Extra key "year" for TypedDict "ExtraMovie" [typeddict-unknown-key] +typeddicts_extra_items.py:285: error: Extra key "language" for TypedDict "ExtraMovie" [typeddict-unknown-key] +typeddicts_extra_items.py:289: error: Unexpected keyword argument "closed" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_extra_items.py:293: error: Extra key "year" for TypedDict "ClosedMovie" [typeddict-unknown-key] +typeddicts_extra_items.py:299: error: Extra key "summary" for TypedDict "MovieExtraStr" [typeddict-unknown-key] +typeddicts_extra_items.py:300: error: Incompatible types in assignment (expression has type "MovieExtraStr", variable has type "Mapping[str, str]") [assignment] +typeddicts_extra_items.py:302: error: Extra key "year" for TypedDict "MovieExtraInt" [typeddict-unknown-key] +typeddicts_extra_items.py:303: error: Incompatible types in assignment (expression has type "MovieExtraInt", variable has type "Mapping[str, int]") [assignment] +typeddicts_extra_items.py:304: error: Incompatible types in assignment (expression has type "MovieExtraInt", variable has type "Mapping[str, int | str]") [assignment] +typeddicts_extra_items.py:310: error: Expression is of type "list[tuple[str, object]]", not "list[tuple[str, int | str]]" [assert-type] +typeddicts_extra_items.py:311: error: Expression is of type "list[object]", not "list[int | str]" [assert-type] +typeddicts_extra_items.py:319: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_extra_items.py:326: error: Incompatible types in assignment (expression has type "IntDict", variable has type "dict[str, int]") [assignment] +typeddicts_extra_items.py:329: error: Extra key "bar" for TypedDict "IntDictWithNum" [typeddict-unknown-key] +typeddicts_extra_items.py:330: error: Incompatible types in assignment (expression has type "IntDictWithNum", variable has type "dict[str, int]") [assignment] +typeddicts_extra_items.py:337: error: "IntDictWithNum" has no attribute "clear" [attr-defined] +typeddicts_extra_items.py:339: error: Expression is of type "Any", not "tuple[str, int]" [assert-type] +typeddicts_extra_items.py:339: error: "IntDictWithNum" has no attribute "popitem" [attr-defined] +typeddicts_extra_items.py:342: error: TypedDict key must be a string literal; expected one of ("num") [literal-required] +typeddicts_extra_items.py:343: error: Expected TypedDict key to be string literal [misc] +typeddicts_extra_items.py:352: error: Incompatible types in assignment (expression has type "dict[str, int]", variable has type "IntDict") [assignment] """ diff --git a/conformance/results/pyre/typeddicts_extra_items.toml b/conformance/results/pyre/typeddicts_extra_items.toml index aa91c7f41..a1f9253c9 100644 --- a/conformance/results/pyre/typeddicts_extra_items.toml +++ b/conformance/results/pyre/typeddicts_extra_items.toml @@ -4,16 +4,17 @@ Not supported. """ conformance_automated = "Fail" errors_diff = """ -Line 181: Expected 1 errors -Line 184: Expected 1 errors -Line 206: Expected 1 errors -Line 213: Expected 1 errors -Line 233: Expected 1 errors -Line 247: Expected 1 errors -Line 248: Expected 1 errors -Line 259: Expected 1 errors +Line 215: Expected 1 errors +Line 222: Expected 1 errors +Line 242: Expected 1 errors +Line 256: Expected 1 errors +Line 257: Expected 1 errors +Line 268: Expected 1 errors Lines 91, 92: Expected error (tag 'MovieC') 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 11: Unexpected errors ['typeddicts_extra_items.py:11:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] Line 14: Unexpected errors ['typeddicts_extra_items.py:14:11 TypedDict initialization error [55]: TypedDict `Movie` has no field `novel_adaptation`.'] Line 21: Unexpected errors ['typeddicts_extra_items.py:21:21 TypedDict initialization error [55]: TypedDict `MovieFunctional` has no field `novel_adaptation`.'] @@ -28,43 +29,44 @@ Line 88: Unexpected errors ['typeddicts_extra_items.py:88:0 Unexpected keyword [ Line 100: Unexpected errors ['typeddicts_extra_items.py:100:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] Line 103: Unexpected errors ['typeddicts_extra_items.py:103:0 Unexpected keyword [28]: Unexpected keyword argument `closed` to call `object.__init_subclass__`.'] Line 106: Unexpected errors ['typeddicts_extra_items.py:106:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] -Line 121: Unexpected errors ['typeddicts_extra_items.py:121:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] -Line 126: Unexpected errors ['typeddicts_extra_items.py:126:14 TypedDict accessed with a missing key [27]: TypedDict `MovieEI` has no key `year`.'] -Line 134: Unexpected errors ['typeddicts_extra_items.py:134:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] -Line 141: Unexpected errors ['typeddicts_extra_items.py:141:0 Unexpected keyword [28]: Unexpected keyword argument `year` to call `unpack_extra`.'] -Line 146: Unexpected errors ['typeddicts_extra_items.py:146:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] +Line 124: Unexpected errors ['typeddicts_extra_items.py:124:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] +Line 129: Unexpected errors ['typeddicts_extra_items.py:129:14 TypedDict accessed with a missing key [27]: TypedDict `MovieEI` has no key `year`.'] +Line 137: Unexpected errors ['typeddicts_extra_items.py:137:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] +Line 144: Unexpected errors ['typeddicts_extra_items.py:144:0 Unexpected keyword [28]: Unexpected keyword argument `year` to call `unpack_extra`.'] Line 149: Unexpected errors ['typeddicts_extra_items.py:149:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] Line 152: Unexpected errors ['typeddicts_extra_items.py:152:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] -Line 162: Unexpected errors ['typeddicts_extra_items.py:162:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] -Line 168: Unexpected errors ['typeddicts_extra_items.py:168:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] -Line 178: Unexpected errors ['typeddicts_extra_items.py:178:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] -Line 201: Unexpected errors ['typeddicts_extra_items.py:201:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] -Line 208: Unexpected errors ['typeddicts_extra_items.py:208:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] -Line 219: Unexpected errors ['typeddicts_extra_items.py:219:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] -Line 222: Unexpected errors ['typeddicts_extra_items.py:222:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] -Line 226: Unexpected errors ['typeddicts_extra_items.py:226:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] -Line 239: Unexpected errors ['typeddicts_extra_items.py:239:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] -Line 242: Unexpected errors ['typeddicts_extra_items.py:242:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] -Line 245: Unexpected errors ['typeddicts_extra_items.py:245:27 TypedDict initialization error [55]: TypedDict `MovieExtraInt` has no field `year`.'] -Line 246: Unexpected errors ['typeddicts_extra_items.py:246:27 TypedDict initialization error [55]: TypedDict `MovieExtraStr` has no field `description`.'] -Line 257: Unexpected errors ['typeddicts_extra_items.py:257:28 TypedDict initialization error [55]: TypedDict `MovieExtraInt` has no field `year`.'] -Line 271: Unexpected errors ['typeddicts_extra_items.py:271:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] -Line 275: Unexpected errors ['typeddicts_extra_items.py:275:0 Unexpected keyword [28]: Unexpected keyword argument `year` to call `ExtraMovie.__init__`.'] -Line 280: Unexpected errors ['typeddicts_extra_items.py:280:0 Unexpected keyword [28]: Unexpected keyword argument `closed` to call `object.__init_subclass__`.'] -Line 290: Unexpected errors ['typeddicts_extra_items.py:290:28 TypedDict initialization error [55]: TypedDict `MovieExtraStr` has no field `summary`.'] -Line 291: Unexpected errors ['typeddicts_extra_items.py:291:0 Incompatible variable type [9]: str_mapping is declared to have type `Mapping[str, str]` but is used as type `MovieExtraStr`.'] -Line 293: Unexpected errors ['typeddicts_extra_items.py:293:28 TypedDict initialization error [55]: TypedDict `MovieExtraInt` has no field `year`.'] -Line 295: Unexpected errors ['typeddicts_extra_items.py:295:0 Incompatible variable type [9]: int_str_mapping is declared to have type `Mapping[str, Union[int, str]]` but is used as type `MovieExtraInt`.'] -Line 301: Unexpected errors ['typeddicts_extra_items.py:301:4 Assert type [70]: Expected `List[Tuple[str, Union[int, str]]]` but got `List[Tuple[str, object]]`.'] -Line 302: Unexpected errors ['typeddicts_extra_items.py:302:4 Assert type [70]: Expected `List[Union[int, str]]` but got `List[object]`.'] -Line 310: Unexpected errors ['typeddicts_extra_items.py:310:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] -Line 317: Unexpected errors ['typeddicts_extra_items.py:317:4 Incompatible variable type [9]: v is declared to have type `Dict[str, int]` but is used as type `IntDict`.'] -Line 320: Unexpected errors ['typeddicts_extra_items.py:320:40 TypedDict initialization error [55]: TypedDict `IntDictWithNum` has no field `bar`.'] -Line 321: Unexpected errors ['typeddicts_extra_items.py:321:0 Incompatible variable type [9]: regular_dict is declared to have type `Dict[str, int]` but is used as type `IntDictWithNum`.'] -Line 328: Unexpected errors ['typeddicts_extra_items.py:328:0 Undefined attribute [16]: `IntDictWithNum` has no attribute `clear`.'] -Line 330: Unexpected errors ['typeddicts_extra_items.py:330:0 Assert type [70]: Expected `Tuple[str, int]` but got `typing.Any`.', 'typeddicts_extra_items.py:330:12 Undefined attribute [16]: `IntDictWithNum` has no attribute `popitem`.'] -Line 333: Unexpected errors ["typeddicts_extra_items.py:333:26 TypedDict accessed with a non-literal [26]: TypedDict key must be a string literal. Expected one of ('num')."] -Line 334: Unexpected errors ["typeddicts_extra_items.py:334:30 TypedDict accessed with a non-literal [26]: TypedDict key must be a string literal. Expected one of ('num')."] +Line 155: Unexpected errors ['typeddicts_extra_items.py:155:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] +Line 165: Unexpected errors ['typeddicts_extra_items.py:165:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] +Line 171: Unexpected errors ['typeddicts_extra_items.py:171:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] +Line 181: Unexpected errors ['typeddicts_extra_items.py:181:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] +Line 193: Unexpected errors ['typeddicts_extra_items.py:193:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] +Line 210: Unexpected errors ['typeddicts_extra_items.py:210:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] +Line 217: Unexpected errors ['typeddicts_extra_items.py:217:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] +Line 228: Unexpected errors ['typeddicts_extra_items.py:228:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] +Line 231: Unexpected errors ['typeddicts_extra_items.py:231:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] +Line 235: Unexpected errors ['typeddicts_extra_items.py:235:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] +Line 248: Unexpected errors ['typeddicts_extra_items.py:248:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] +Line 251: Unexpected errors ['typeddicts_extra_items.py:251:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] +Line 254: Unexpected errors ['typeddicts_extra_items.py:254:27 TypedDict initialization error [55]: TypedDict `MovieExtraInt` has no field `year`.'] +Line 255: Unexpected errors ['typeddicts_extra_items.py:255:27 TypedDict initialization error [55]: TypedDict `MovieExtraStr` has no field `description`.'] +Line 266: Unexpected errors ['typeddicts_extra_items.py:266:28 TypedDict initialization error [55]: TypedDict `MovieExtraInt` has no field `year`.'] +Line 280: Unexpected errors ['typeddicts_extra_items.py:280:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] +Line 284: Unexpected errors ['typeddicts_extra_items.py:284:0 Unexpected keyword [28]: Unexpected keyword argument `year` to call `ExtraMovie.__init__`.'] +Line 289: Unexpected errors ['typeddicts_extra_items.py:289:0 Unexpected keyword [28]: Unexpected keyword argument `closed` to call `object.__init_subclass__`.'] +Line 299: Unexpected errors ['typeddicts_extra_items.py:299:28 TypedDict initialization error [55]: TypedDict `MovieExtraStr` has no field `summary`.'] +Line 300: Unexpected errors ['typeddicts_extra_items.py:300:0 Incompatible variable type [9]: str_mapping is declared to have type `Mapping[str, str]` but is used as type `MovieExtraStr`.'] +Line 302: Unexpected errors ['typeddicts_extra_items.py:302:28 TypedDict initialization error [55]: TypedDict `MovieExtraInt` has no field `year`.'] +Line 304: Unexpected errors ['typeddicts_extra_items.py:304:0 Incompatible variable type [9]: int_str_mapping is declared to have type `Mapping[str, Union[int, str]]` but is used as type `MovieExtraInt`.'] +Line 310: Unexpected errors ['typeddicts_extra_items.py:310:4 Assert type [70]: Expected `List[Tuple[str, Union[int, str]]]` but got `List[Tuple[str, object]]`.'] +Line 311: Unexpected errors ['typeddicts_extra_items.py:311:4 Assert type [70]: Expected `List[Union[int, str]]` but got `List[object]`.'] +Line 319: Unexpected errors ['typeddicts_extra_items.py:319:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] +Line 326: Unexpected errors ['typeddicts_extra_items.py:326:4 Incompatible variable type [9]: v is declared to have type `Dict[str, int]` but is used as type `IntDict`.'] +Line 329: Unexpected errors ['typeddicts_extra_items.py:329:40 TypedDict initialization error [55]: TypedDict `IntDictWithNum` has no field `bar`.'] +Line 330: Unexpected errors ['typeddicts_extra_items.py:330:0 Incompatible variable type [9]: regular_dict is declared to have type `Dict[str, int]` but is used as type `IntDictWithNum`.'] +Line 337: Unexpected errors ['typeddicts_extra_items.py:337:0 Undefined attribute [16]: `IntDictWithNum` has no attribute `clear`.'] +Line 339: Unexpected errors ['typeddicts_extra_items.py:339:0 Assert type [70]: Expected `Tuple[str, int]` but got `typing.Any`.', 'typeddicts_extra_items.py:339:12 Undefined attribute [16]: `IntDictWithNum` has no attribute `popitem`.'] +Line 342: Unexpected errors ["typeddicts_extra_items.py:342:26 TypedDict accessed with a non-literal [26]: TypedDict key must be a string literal. Expected one of ('num')."] +Line 343: Unexpected errors ["typeddicts_extra_items.py:343:30 TypedDict accessed with a non-literal [26]: TypedDict key must be a string literal. Expected one of ('num')."] """ output = """ typeddicts_extra_items.py:11:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. @@ -88,52 +90,54 @@ typeddicts_extra_items.py:88:0 Unexpected keyword [28]: Unexpected keyword argum typeddicts_extra_items.py:100:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. typeddicts_extra_items.py:103:0 Unexpected keyword [28]: Unexpected keyword argument `closed` to call `object.__init_subclass__`. typeddicts_extra_items.py:106:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. -typeddicts_extra_items.py:111:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. +typeddicts_extra_items.py:109:0 Unexpected keyword [28]: Unexpected keyword argument `closed` to call `object.__init_subclass__`. typeddicts_extra_items.py:114:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. -typeddicts_extra_items.py:121:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. -typeddicts_extra_items.py:125:4 Invalid TypedDict operation [54]: Cannot delete required field `name` from TypedDict `MovieEI`. -typeddicts_extra_items.py:126:14 TypedDict accessed with a missing key [27]: TypedDict `MovieEI` has no key `year`. -typeddicts_extra_items.py:134:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. -typeddicts_extra_items.py:140:0 Unexpected keyword [28]: Unexpected keyword argument `year` to call `unpack_no_extra`. -typeddicts_extra_items.py:141:0 Unexpected keyword [28]: Unexpected keyword argument `year` to call `unpack_extra`. -typeddicts_extra_items.py:146:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. +typeddicts_extra_items.py:117:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. +typeddicts_extra_items.py:124:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. +typeddicts_extra_items.py:128:4 Invalid TypedDict operation [54]: Cannot delete required field `name` from TypedDict `MovieEI`. +typeddicts_extra_items.py:129:14 TypedDict accessed with a missing key [27]: TypedDict `MovieEI` has no key `year`. +typeddicts_extra_items.py:137:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. +typeddicts_extra_items.py:143:0 Unexpected keyword [28]: Unexpected keyword argument `year` to call `unpack_no_extra`. +typeddicts_extra_items.py:144:0 Unexpected keyword [28]: Unexpected keyword argument `year` to call `unpack_extra`. typeddicts_extra_items.py:149:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. typeddicts_extra_items.py:152:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. -typeddicts_extra_items.py:162:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. -typeddicts_extra_items.py:168:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. +typeddicts_extra_items.py:155:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. +typeddicts_extra_items.py:165:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. typeddicts_extra_items.py:171:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. -typeddicts_extra_items.py:178:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. -typeddicts_extra_items.py:201:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. -typeddicts_extra_items.py:208:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. -typeddicts_extra_items.py:219:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. -typeddicts_extra_items.py:222:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. -typeddicts_extra_items.py:226:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. -typeddicts_extra_items.py:239:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. -typeddicts_extra_items.py:242:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. -typeddicts_extra_items.py:245:27 TypedDict initialization error [55]: TypedDict `MovieExtraInt` has no field `year`. -typeddicts_extra_items.py:246:27 TypedDict initialization error [55]: TypedDict `MovieExtraStr` has no field `description`. -typeddicts_extra_items.py:257:28 TypedDict initialization error [55]: TypedDict `MovieExtraInt` has no field `year`. -typeddicts_extra_items.py:269:0 Unexpected keyword [28]: Unexpected keyword argument `year` to call `NonClosedMovie.__init__`. -typeddicts_extra_items.py:271:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. -typeddicts_extra_items.py:275:0 Unexpected keyword [28]: Unexpected keyword argument `year` to call `ExtraMovie.__init__`. -typeddicts_extra_items.py:276:0 Unexpected keyword [28]: Unexpected keyword argument `language` to call `ExtraMovie.__init__`. -typeddicts_extra_items.py:280:0 Unexpected keyword [28]: Unexpected keyword argument `closed` to call `object.__init_subclass__`. -typeddicts_extra_items.py:284:0 Unexpected keyword [28]: Unexpected keyword argument `year` to call `ClosedMovie.__init__`. -typeddicts_extra_items.py:290:28 TypedDict initialization error [55]: TypedDict `MovieExtraStr` has no field `summary`. -typeddicts_extra_items.py:291:0 Incompatible variable type [9]: str_mapping is declared to have type `Mapping[str, str]` but is used as type `MovieExtraStr`. -typeddicts_extra_items.py:293:28 TypedDict initialization error [55]: TypedDict `MovieExtraInt` has no field `year`. -typeddicts_extra_items.py:294:0 Incompatible variable type [9]: int_mapping is declared to have type `Mapping[str, int]` but is used as type `MovieExtraInt`. -typeddicts_extra_items.py:295:0 Incompatible variable type [9]: int_str_mapping is declared to have type `Mapping[str, Union[int, str]]` but is used as type `MovieExtraInt`. -typeddicts_extra_items.py:301:4 Assert type [70]: Expected `List[Tuple[str, Union[int, str]]]` but got `List[Tuple[str, object]]`. -typeddicts_extra_items.py:302:4 Assert type [70]: Expected `List[Union[int, str]]` but got `List[object]`. -typeddicts_extra_items.py:310:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. -typeddicts_extra_items.py:317:4 Incompatible variable type [9]: v is declared to have type `Dict[str, int]` but is used as type `IntDict`. -typeddicts_extra_items.py:320:40 TypedDict initialization error [55]: TypedDict `IntDictWithNum` has no field `bar`. -typeddicts_extra_items.py:321:0 Incompatible variable type [9]: regular_dict is declared to have type `Dict[str, int]` but is used as type `IntDictWithNum`. -typeddicts_extra_items.py:328:0 Undefined attribute [16]: `IntDictWithNum` has no attribute `clear`. -typeddicts_extra_items.py:330:0 Assert type [70]: Expected `Tuple[str, int]` but got `typing.Any`. -typeddicts_extra_items.py:330:12 Undefined attribute [16]: `IntDictWithNum` has no attribute `popitem`. -typeddicts_extra_items.py:333:26 TypedDict accessed with a non-literal [26]: TypedDict key must be a string literal. Expected one of ('num'). -typeddicts_extra_items.py:334:30 TypedDict accessed with a non-literal [26]: TypedDict key must be a string literal. Expected one of ('num'). -typeddicts_extra_items.py:343:4 Incompatible variable type [9]: int_dict is declared to have type `IntDict` but is used as type `Dict[str, int]`. +typeddicts_extra_items.py:174:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. +typeddicts_extra_items.py:181:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. +typeddicts_extra_items.py:193:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. +typeddicts_extra_items.py:210:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. +typeddicts_extra_items.py:217:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. +typeddicts_extra_items.py:228:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. +typeddicts_extra_items.py:231:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. +typeddicts_extra_items.py:235:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. +typeddicts_extra_items.py:248:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. +typeddicts_extra_items.py:251:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. +typeddicts_extra_items.py:254:27 TypedDict initialization error [55]: TypedDict `MovieExtraInt` has no field `year`. +typeddicts_extra_items.py:255:27 TypedDict initialization error [55]: TypedDict `MovieExtraStr` has no field `description`. +typeddicts_extra_items.py:266:28 TypedDict initialization error [55]: TypedDict `MovieExtraInt` has no field `year`. +typeddicts_extra_items.py:278:0 Unexpected keyword [28]: Unexpected keyword argument `year` to call `NonClosedMovie.__init__`. +typeddicts_extra_items.py:280:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. +typeddicts_extra_items.py:284:0 Unexpected keyword [28]: Unexpected keyword argument `year` to call `ExtraMovie.__init__`. +typeddicts_extra_items.py:285:0 Unexpected keyword [28]: Unexpected keyword argument `language` to call `ExtraMovie.__init__`. +typeddicts_extra_items.py:289:0 Unexpected keyword [28]: Unexpected keyword argument `closed` to call `object.__init_subclass__`. +typeddicts_extra_items.py:293:0 Unexpected keyword [28]: Unexpected keyword argument `year` to call `ClosedMovie.__init__`. +typeddicts_extra_items.py:299:28 TypedDict initialization error [55]: TypedDict `MovieExtraStr` has no field `summary`. +typeddicts_extra_items.py:300:0 Incompatible variable type [9]: str_mapping is declared to have type `Mapping[str, str]` but is used as type `MovieExtraStr`. +typeddicts_extra_items.py:302:28 TypedDict initialization error [55]: TypedDict `MovieExtraInt` has no field `year`. +typeddicts_extra_items.py:303:0 Incompatible variable type [9]: int_mapping is declared to have type `Mapping[str, int]` but is used as type `MovieExtraInt`. +typeddicts_extra_items.py:304:0 Incompatible variable type [9]: int_str_mapping is declared to have type `Mapping[str, Union[int, str]]` but is used as type `MovieExtraInt`. +typeddicts_extra_items.py:310:4 Assert type [70]: Expected `List[Tuple[str, Union[int, str]]]` but got `List[Tuple[str, object]]`. +typeddicts_extra_items.py:311:4 Assert type [70]: Expected `List[Union[int, str]]` but got `List[object]`. +typeddicts_extra_items.py:319:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. +typeddicts_extra_items.py:326:4 Incompatible variable type [9]: v is declared to have type `Dict[str, int]` but is used as type `IntDict`. +typeddicts_extra_items.py:329:40 TypedDict initialization error [55]: TypedDict `IntDictWithNum` has no field `bar`. +typeddicts_extra_items.py:330:0 Incompatible variable type [9]: regular_dict is declared to have type `Dict[str, int]` but is used as type `IntDictWithNum`. +typeddicts_extra_items.py:337:0 Undefined attribute [16]: `IntDictWithNum` has no attribute `clear`. +typeddicts_extra_items.py:339:0 Assert type [70]: Expected `Tuple[str, int]` but got `typing.Any`. +typeddicts_extra_items.py:339:12 Undefined attribute [16]: `IntDictWithNum` has no attribute `popitem`. +typeddicts_extra_items.py:342:26 TypedDict accessed with a non-literal [26]: TypedDict key must be a string literal. Expected one of ('num'). +typeddicts_extra_items.py:343:30 TypedDict accessed with a non-literal [26]: TypedDict key must be a string literal. Expected one of ('num'). +typeddicts_extra_items.py:352:4 Incompatible variable type [9]: int_dict is declared to have type `IntDict` but is used as type `Dict[str, int]`. """ diff --git a/conformance/results/pyright/typeddicts_extra_items.toml b/conformance/results/pyright/typeddicts_extra_items.toml index 8bdb0fab3..d54c48d99 100644 --- a/conformance/results/pyright/typeddicts_extra_items.toml +++ b/conformance/results/pyright/typeddicts_extra_items.toml @@ -1,6 +1,11 @@ -conformant = "Pass" -conformance_automated = "Pass" +conformant = "Partial" +notes = """ +Does not flag illegal use of `closed=False` when inheriting from a non-open TypedDict. +""" +conformance_automated = "Fail" errors_diff = """ +Line 67: Expected 1 errors +Line 73: Expected 1 errors """ output = """ typeddicts_extra_items.py:15:45 - error: Type "dict[str, str | int]" is not assignable to declared type "Movie" @@ -10,56 +15,56 @@ typeddicts_extra_items.py:22:55 - error: Type "dict[str, str | int]" is not assi typeddicts_extra_items.py:39:54 - error: Type "dict[str, str | None]" is not assignable to declared type "InheritedMovie"   "None" is not assignable to "int" (reportAssignmentType) typeddicts_extra_items.py:49:35 - error: Expected "closed" parameter to have a value of True or False (reportGeneralTypeIssues) -typeddicts_extra_items.py:67:7 - error: Base class "ClosedBase" is a TypedDict that limits the type of extra items to type "Never" -  Cannot add item "age" (reportIncompatibleVariableOverride) -typeddicts_extra_items.py:73:7 - error: Base class "ExtraItemsBase" is a TypedDict that limits the type of extra items to type "int" -  Cannot add item "age" because it must be NotRequired (reportIncompatibleVariableOverride) typeddicts_extra_items.py:91:7 - error: Base class "MovieA" is a TypedDict that limits the type of extra items to type "Never"   Cannot add item "age" (reportIncompatibleVariableOverride) typeddicts_extra_items.py:94:7 - error: Base class "MovieB" is a TypedDict that limits the type of extra items to type "Never"   Cannot add item "age" (reportIncompatibleVariableOverride) -typeddicts_extra_items.py:111:50 - error: "Required" is not allowed in this context (reportInvalidTypeForm) -typeddicts_extra_items.py:114:57 - error: "NotRequired" is not allowed in this context (reportInvalidTypeForm) -typeddicts_extra_items.py:125:9 - error: Could not delete item in TypedDict +typeddicts_extra_items.py:109:7 - error: Base class "ExtraItemsBase" is a TypedDict that limits the type of extra items to type "int" +  Cannot add item "extra_items" with type "Never" (reportIncompatibleVariableOverride) +typeddicts_extra_items.py:114:50 - error: "Required" is not allowed in this context (reportInvalidTypeForm) +typeddicts_extra_items.py:117:57 - error: "NotRequired" is not allowed in this context (reportInvalidTypeForm) +typeddicts_extra_items.py:128:9 - error: Could not delete item in TypedDict   "name" is a required key and cannot be deleted (reportGeneralTypeIssues) -typeddicts_extra_items.py:140:48 - error: No parameter named "year" (reportCallIssue) -typeddicts_extra_items.py:171:7 - error: Base class "Parent" is a TypedDict that limits the type of extra items to type "int | None" +typeddicts_extra_items.py:143:48 - error: No parameter named "year" (reportCallIssue) +typeddicts_extra_items.py:174:7 - error: Base class "Parent" is a TypedDict that limits the type of extra items to type "int | None"   Cannot add item "extra_items" with type "int" (reportIncompatibleVariableOverride) -typeddicts_extra_items.py:181:7 - error: Base class "MovieBase2" is a TypedDict that limits the type of extra items to type "int | None" -  Cannot add item "year" because it must be NotRequired (reportIncompatibleVariableOverride) typeddicts_extra_items.py:184:7 - error: Base class "MovieBase2" is a TypedDict that limits the type of extra items to type "int | None" +  Cannot add item "year" because it must be NotRequired (reportIncompatibleVariableOverride) +typeddicts_extra_items.py:187:7 - error: Base class "MovieBase2" is a TypedDict that limits the type of extra items to type "int | None"   Cannot add item "year" with type "int" (reportIncompatibleVariableOverride) -typeddicts_extra_items.py:206:22 - error: Type "MovieDetails" is not assignable to declared type "MovieBase2" +typeddicts_extra_items.py:196:7 - error: Base class "BookBase" is a TypedDict that limits the type of extra items to type "int | None" +  Cannot add item "publisher" with type "str" (reportIncompatibleVariableOverride) +typeddicts_extra_items.py:215:22 - error: Type "MovieDetails" is not assignable to declared type "MovieBase2"   Type of "year" is incompatible with type of "extra_items" in "MovieBase2"     Type "int" is not assignable to type "int | None"       "int" is not assignable to "None" (reportAssignmentType) -typeddicts_extra_items.py:213:22 - error: Type "MovieWithYear2" is not assignable to declared type "MovieBase2" +typeddicts_extra_items.py:222:22 - error: Type "MovieWithYear2" is not assignable to declared type "MovieBase2"   "year" is not required in "MovieBase2" (reportAssignmentType) -typeddicts_extra_items.py:233:19 - error: Type "MovieDetails5" is not assignable to declared type "MovieSI" +typeddicts_extra_items.py:242:19 - error: Type "MovieDetails5" is not assignable to declared type "MovieSI"   Type of "actors" is incompatible with type of "extra_items" in "MovieSI"     Type "list[str]" is not assignable to type "str | int"       "list[str]" is not assignable to "str"       "list[str]" is not assignable to "int" (reportAssignmentType) -typeddicts_extra_items.py:247:13 - error: Type "MovieExtraStr" is not assignable to declared type "MovieExtraInt" +typeddicts_extra_items.py:256:13 - error: Type "MovieExtraStr" is not assignable to declared type "MovieExtraInt"   Type of "extra_items" is incompatible with type of "extra_items" in "MovieExtraStr"     "str" is not assignable to "int" (reportAssignmentType) -typeddicts_extra_items.py:248:13 - error: Type "MovieExtraInt" is not assignable to declared type "MovieExtraStr" +typeddicts_extra_items.py:257:13 - error: Type "MovieExtraInt" is not assignable to declared type "MovieExtraStr"   Type of "extra_items" is incompatible with type of "extra_items" in "MovieExtraInt"     "int" is not assignable to "str" (reportAssignmentType) -typeddicts_extra_items.py:259:14 - error: Type "MovieNotClosed" is not assignable to declared type "MovieExtraInt" +typeddicts_extra_items.py:268:14 - error: Type "MovieNotClosed" is not assignable to declared type "MovieExtraInt"   Type of "extra_items" is incompatible with type of "extra_items" in "MovieNotClosed"     "object" is not assignable to "int" (reportAssignmentType) -typeddicts_extra_items.py:269:1 - error: No overloads for "__init__" match the provided arguments +typeddicts_extra_items.py:278:1 - error: No overloads for "__init__" match the provided arguments   Argument types: (Literal['No Country for Old Men'], Literal[2007]) (reportCallIssue) -typeddicts_extra_items.py:276:52 - error: Argument of type "Literal['English']" cannot be assigned to parameter "language" of type "int" in function "__init__" +typeddicts_extra_items.py:285:52 - error: Argument of type "Literal['English']" cannot be assigned to parameter "language" of type "int" in function "__init__"   "Literal['English']" is not assignable to "int" (reportArgumentType) -typeddicts_extra_items.py:284:1 - error: No overloads for "__init__" match the provided arguments +typeddicts_extra_items.py:293:1 - error: No overloads for "__init__" match the provided arguments   Argument types: (Literal['No Country for Old Men'], Literal[2007]) (reportCallIssue) -typeddicts_extra_items.py:294:34 - error: Type "MovieExtraInt" is not assignable to declared type "Mapping[str, int]" +typeddicts_extra_items.py:303:34 - error: Type "MovieExtraInt" is not assignable to declared type "Mapping[str, int]"   "Mapping[str, str | int]" is not assignable to "Mapping[str, int]"     Type parameter "_VT_co@Mapping" is covariant, but "str | int" is not a subtype of "int"       Type "str | int" is not assignable to type "int"         "str" is not assignable to "int" (reportAssignmentType) -typeddicts_extra_items.py:343:25 - error: Type "dict[str, int]" is not assignable to declared type "IntDict" +typeddicts_extra_items.py:352:25 - error: Type "dict[str, int]" is not assignable to declared type "IntDict"   "dict[str, int]" is not assignable to "IntDict" (reportAssignmentType) """ diff --git a/conformance/results/results.html b/conformance/results/results.html index 6cbe8f005..f62bd7860 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -817,7 +817,7 @@

    Python Type System Conformance Test Results

    - + diff --git a/conformance/results/zuban/typeddicts_extra_items.toml b/conformance/results/zuban/typeddicts_extra_items.toml index 0cc9199f6..b58404031 100644 --- a/conformance/results/zuban/typeddicts_extra_items.toml +++ b/conformance/results/zuban/typeddicts_extra_items.toml @@ -5,16 +5,17 @@ Not supported. conformance_automated = "Fail" errors_diff = """ Line 22: Expected 1 errors -Line 181: Expected 1 errors -Line 184: Expected 1 errors -Line 206: Expected 1 errors -Line 213: Expected 1 errors -Line 233: Expected 1 errors -Line 247: Expected 1 errors -Line 248: Expected 1 errors -Line 259: Expected 1 errors +Line 215: Expected 1 errors +Line 222: Expected 1 errors +Line 242: Expected 1 errors +Line 256: Expected 1 errors +Line 257: Expected 1 errors +Line 268: Expected 1 errors Lines 91, 92: Expected error (tag 'MovieC') 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 11: Unexpected errors ['typeddicts_extra_items.py:11: error: Unexpected keyword argument "extra_items" for TypedDict'] Line 14: Unexpected errors ['typeddicts_extra_items.py:14: error: Extra key "novel_adaptation" for TypedDict "Movie"'] Line 19: Unexpected errors ['typeddicts_extra_items.py:19: error: Unexpected keyword argument "extra_items" for "TypedDict"'] @@ -29,43 +30,44 @@ Line 88: Unexpected errors ['typeddicts_extra_items.py:88: error: Unexpected key Line 100: Unexpected errors ['typeddicts_extra_items.py:100: error: Unexpected keyword argument "extra_items" for TypedDict'] Line 103: Unexpected errors ['typeddicts_extra_items.py:103: error: Unexpected keyword argument "closed" for TypedDict'] Line 106: Unexpected errors ['typeddicts_extra_items.py:106: error: Unexpected keyword argument "extra_items" for TypedDict'] -Line 121: Unexpected errors ['typeddicts_extra_items.py:121: error: Unexpected keyword argument "extra_items" for TypedDict'] -Line 126: Unexpected errors ['typeddicts_extra_items.py:126: error: TypedDict "MovieEI" has no key "year"'] -Line 134: Unexpected errors ['typeddicts_extra_items.py:134: error: Unexpected keyword argument "extra_items" for TypedDict'] -Line 141: Unexpected errors ['typeddicts_extra_items.py:141: error: Unexpected keyword argument "year" for "unpack_extra"'] -Line 146: Unexpected errors ['typeddicts_extra_items.py:146: error: Unexpected keyword argument "extra_items" for TypedDict'] +Line 124: Unexpected errors ['typeddicts_extra_items.py:124: error: Unexpected keyword argument "extra_items" for TypedDict'] +Line 129: Unexpected errors ['typeddicts_extra_items.py:129: error: TypedDict "MovieEI" has no key "year"'] +Line 137: Unexpected errors ['typeddicts_extra_items.py:137: error: Unexpected keyword argument "extra_items" for TypedDict'] +Line 144: Unexpected errors ['typeddicts_extra_items.py:144: error: Unexpected keyword argument "year" for "unpack_extra"'] Line 149: Unexpected errors ['typeddicts_extra_items.py:149: error: Unexpected keyword argument "extra_items" for TypedDict'] Line 152: Unexpected errors ['typeddicts_extra_items.py:152: error: Unexpected keyword argument "extra_items" for TypedDict'] -Line 162: Unexpected errors ['typeddicts_extra_items.py:162: error: Unexpected keyword argument "extra_items" for TypedDict'] -Line 168: Unexpected errors ['typeddicts_extra_items.py:168: error: Unexpected keyword argument "extra_items" for TypedDict'] -Line 178: Unexpected errors ['typeddicts_extra_items.py:178: error: Unexpected keyword argument "extra_items" for TypedDict'] -Line 201: Unexpected errors ['typeddicts_extra_items.py:201: error: Unexpected keyword argument "extra_items" for TypedDict'] -Line 208: Unexpected errors ['typeddicts_extra_items.py:208: error: Unexpected keyword argument "extra_items" for TypedDict'] -Line 219: Unexpected errors ['typeddicts_extra_items.py:219: error: Unexpected keyword argument "extra_items" for TypedDict'] -Line 222: Unexpected errors ['typeddicts_extra_items.py:222: error: Unexpected keyword argument "extra_items" for TypedDict'] -Line 226: Unexpected errors ['typeddicts_extra_items.py:226: error: Unexpected keyword argument "extra_items" for TypedDict'] -Line 239: Unexpected errors ['typeddicts_extra_items.py:239: error: Unexpected keyword argument "extra_items" for TypedDict'] -Line 242: Unexpected errors ['typeddicts_extra_items.py:242: error: Unexpected keyword argument "extra_items" for TypedDict'] -Line 245: Unexpected errors ['typeddicts_extra_items.py:245: error: Extra key "year" for TypedDict "MovieExtraInt"'] -Line 246: Unexpected errors ['typeddicts_extra_items.py:246: error: Extra key "description" for TypedDict "MovieExtraStr"'] -Line 257: Unexpected errors ['typeddicts_extra_items.py:257: error: Extra key "year" for TypedDict "MovieExtraInt"'] -Line 271: Unexpected errors ['typeddicts_extra_items.py:271: error: Unexpected keyword argument "extra_items" for TypedDict'] -Line 275: Unexpected errors ['typeddicts_extra_items.py:275: error: Extra key "year" for TypedDict "ExtraMovie"'] -Line 280: Unexpected errors ['typeddicts_extra_items.py:280: error: Unexpected keyword argument "closed" for TypedDict'] -Line 290: Unexpected errors ['typeddicts_extra_items.py:290: error: Extra key "summary" for TypedDict "MovieExtraStr"'] -Line 291: Unexpected errors ['typeddicts_extra_items.py:291: error: Incompatible types in assignment (expression has type "MovieExtraStr", variable has type "Mapping[str, str]")'] -Line 293: Unexpected errors ['typeddicts_extra_items.py:293: error: Extra key "year" for TypedDict "MovieExtraInt"'] -Line 295: Unexpected errors ['typeddicts_extra_items.py:295: error: Incompatible types in assignment (expression has type "MovieExtraInt", variable has type "Mapping[str, int | str]")'] -Line 301: Unexpected errors ['typeddicts_extra_items.py:301: error: Expression is of type "list[tuple[str, object]]", not "list[tuple[str, int | str]]"'] -Line 302: Unexpected errors ['typeddicts_extra_items.py:302: error: Expression is of type "list[object]", not "list[int | str]"'] -Line 310: Unexpected errors ['typeddicts_extra_items.py:310: error: Unexpected keyword argument "extra_items" for TypedDict'] -Line 317: Unexpected errors ['typeddicts_extra_items.py:317: error: Incompatible types in assignment (expression has type "IntDict", variable has type "dict[str, int]")'] -Line 320: Unexpected errors ['typeddicts_extra_items.py:320: error: Extra key "bar" for TypedDict "IntDictWithNum"'] -Line 321: Unexpected errors ['typeddicts_extra_items.py:321: error: Incompatible types in assignment (expression has type "IntDictWithNum", variable has type "dict[str, int]")'] -Line 328: Unexpected errors ['typeddicts_extra_items.py:328: error: "IntDictWithNum" has no attribute "clear"'] -Line 330: Unexpected errors ['typeddicts_extra_items.py:330: error: Expression is of type "Any", not "tuple[str, int]"', 'typeddicts_extra_items.py:330: error: "IntDictWithNum" has no attribute "popitem"'] -Line 333: Unexpected errors ['typeddicts_extra_items.py:333: error: TypedDict key must be a string literal; expected one of ("num")'] -Line 334: Unexpected errors ['typeddicts_extra_items.py:334: error: Expected TypedDict key to be string literal'] +Line 155: Unexpected errors ['typeddicts_extra_items.py:155: error: Unexpected keyword argument "extra_items" for TypedDict'] +Line 165: Unexpected errors ['typeddicts_extra_items.py:165: error: Unexpected keyword argument "extra_items" for TypedDict'] +Line 171: Unexpected errors ['typeddicts_extra_items.py:171: error: Unexpected keyword argument "extra_items" for TypedDict'] +Line 181: Unexpected errors ['typeddicts_extra_items.py:181: error: Unexpected keyword argument "extra_items" for TypedDict'] +Line 193: Unexpected errors ['typeddicts_extra_items.py:193: error: Unexpected keyword argument "extra_items" for TypedDict'] +Line 210: Unexpected errors ['typeddicts_extra_items.py:210: error: Unexpected keyword argument "extra_items" for TypedDict'] +Line 217: Unexpected errors ['typeddicts_extra_items.py:217: error: Unexpected keyword argument "extra_items" for TypedDict'] +Line 228: Unexpected errors ['typeddicts_extra_items.py:228: error: Unexpected keyword argument "extra_items" for TypedDict'] +Line 231: Unexpected errors ['typeddicts_extra_items.py:231: error: Unexpected keyword argument "extra_items" for TypedDict'] +Line 235: Unexpected errors ['typeddicts_extra_items.py:235: error: Unexpected keyword argument "extra_items" for TypedDict'] +Line 248: Unexpected errors ['typeddicts_extra_items.py:248: error: Unexpected keyword argument "extra_items" for TypedDict'] +Line 251: Unexpected errors ['typeddicts_extra_items.py:251: error: Unexpected keyword argument "extra_items" for TypedDict'] +Line 254: Unexpected errors ['typeddicts_extra_items.py:254: error: Extra key "year" for TypedDict "MovieExtraInt"'] +Line 255: Unexpected errors ['typeddicts_extra_items.py:255: error: Extra key "description" for TypedDict "MovieExtraStr"'] +Line 266: Unexpected errors ['typeddicts_extra_items.py:266: error: Extra key "year" for TypedDict "MovieExtraInt"'] +Line 280: Unexpected errors ['typeddicts_extra_items.py:280: error: Unexpected keyword argument "extra_items" for TypedDict'] +Line 284: Unexpected errors ['typeddicts_extra_items.py:284: error: Extra key "year" for TypedDict "ExtraMovie"'] +Line 289: Unexpected errors ['typeddicts_extra_items.py:289: error: Unexpected keyword argument "closed" for TypedDict'] +Line 299: Unexpected errors ['typeddicts_extra_items.py:299: error: Extra key "summary" for TypedDict "MovieExtraStr"'] +Line 300: Unexpected errors ['typeddicts_extra_items.py:300: error: Incompatible types in assignment (expression has type "MovieExtraStr", variable has type "Mapping[str, str]")'] +Line 302: Unexpected errors ['typeddicts_extra_items.py:302: error: Extra key "year" for TypedDict "MovieExtraInt"'] +Line 304: Unexpected errors ['typeddicts_extra_items.py:304: error: Incompatible types in assignment (expression has type "MovieExtraInt", variable has type "Mapping[str, int | str]")'] +Line 310: Unexpected errors ['typeddicts_extra_items.py:310: error: Expression is of type "list[tuple[str, object]]", not "list[tuple[str, int | str]]"'] +Line 311: Unexpected errors ['typeddicts_extra_items.py:311: error: Expression is of type "list[object]", not "list[int | str]"'] +Line 319: Unexpected errors ['typeddicts_extra_items.py:319: error: Unexpected keyword argument "extra_items" for TypedDict'] +Line 326: Unexpected errors ['typeddicts_extra_items.py:326: error: Incompatible types in assignment (expression has type "IntDict", variable has type "dict[str, int]")'] +Line 329: Unexpected errors ['typeddicts_extra_items.py:329: error: Extra key "bar" for TypedDict "IntDictWithNum"'] +Line 330: Unexpected errors ['typeddicts_extra_items.py:330: error: Incompatible types in assignment (expression has type "IntDictWithNum", variable has type "dict[str, int]")'] +Line 337: Unexpected errors ['typeddicts_extra_items.py:337: error: "IntDictWithNum" has no attribute "clear"'] +Line 339: Unexpected errors ['typeddicts_extra_items.py:339: error: Expression is of type "Any", not "tuple[str, int]"', 'typeddicts_extra_items.py:339: error: "IntDictWithNum" has no attribute "popitem"'] +Line 342: Unexpected errors ['typeddicts_extra_items.py:342: error: TypedDict key must be a string literal; expected one of ("num")'] +Line 343: Unexpected errors ['typeddicts_extra_items.py:343: error: Expected TypedDict key to be string literal'] """ output = """ typeddicts_extra_items.py:11: error: Unexpected keyword argument "extra_items" for TypedDict @@ -88,52 +90,54 @@ typeddicts_extra_items.py:88: error: Unexpected keyword argument "closed" for Ty typeddicts_extra_items.py:100: error: Unexpected keyword argument "extra_items" for TypedDict typeddicts_extra_items.py:103: error: Unexpected keyword argument "closed" for TypedDict typeddicts_extra_items.py:106: error: Unexpected keyword argument "extra_items" for TypedDict -typeddicts_extra_items.py:111: error: Unexpected keyword argument "extra_items" for TypedDict +typeddicts_extra_items.py:109: error: Unexpected keyword argument "closed" for TypedDict typeddicts_extra_items.py:114: error: Unexpected keyword argument "extra_items" for TypedDict -typeddicts_extra_items.py:121: error: Unexpected keyword argument "extra_items" for TypedDict -typeddicts_extra_items.py:125: error: Key "name" of TypedDict "MovieEI" cannot be deleted -typeddicts_extra_items.py:126: error: TypedDict "MovieEI" has no key "year" -typeddicts_extra_items.py:134: error: Unexpected keyword argument "extra_items" for TypedDict -typeddicts_extra_items.py:140: error: Unexpected keyword argument "year" for "unpack_no_extra" -typeddicts_extra_items.py:141: error: Unexpected keyword argument "year" for "unpack_extra" -typeddicts_extra_items.py:146: error: Unexpected keyword argument "extra_items" for TypedDict +typeddicts_extra_items.py:117: error: Unexpected keyword argument "extra_items" for TypedDict +typeddicts_extra_items.py:124: error: Unexpected keyword argument "extra_items" for TypedDict +typeddicts_extra_items.py:128: error: Key "name" of TypedDict "MovieEI" cannot be deleted +typeddicts_extra_items.py:129: error: TypedDict "MovieEI" has no key "year" +typeddicts_extra_items.py:137: error: Unexpected keyword argument "extra_items" for TypedDict +typeddicts_extra_items.py:143: error: Unexpected keyword argument "year" for "unpack_no_extra" +typeddicts_extra_items.py:144: error: Unexpected keyword argument "year" for "unpack_extra" typeddicts_extra_items.py:149: error: Unexpected keyword argument "extra_items" for TypedDict typeddicts_extra_items.py:152: error: Unexpected keyword argument "extra_items" for TypedDict -typeddicts_extra_items.py:162: error: Unexpected keyword argument "extra_items" for TypedDict -typeddicts_extra_items.py:168: error: Unexpected keyword argument "extra_items" for TypedDict +typeddicts_extra_items.py:155: error: Unexpected keyword argument "extra_items" for TypedDict +typeddicts_extra_items.py:165: error: Unexpected keyword argument "extra_items" for TypedDict typeddicts_extra_items.py:171: error: Unexpected keyword argument "extra_items" for TypedDict -typeddicts_extra_items.py:178: error: Unexpected keyword argument "extra_items" for TypedDict -typeddicts_extra_items.py:201: error: Unexpected keyword argument "extra_items" for TypedDict -typeddicts_extra_items.py:208: error: Unexpected keyword argument "extra_items" for TypedDict -typeddicts_extra_items.py:219: error: Unexpected keyword argument "extra_items" for TypedDict -typeddicts_extra_items.py:222: error: Unexpected keyword argument "extra_items" for TypedDict -typeddicts_extra_items.py:226: error: Unexpected keyword argument "extra_items" for TypedDict -typeddicts_extra_items.py:239: error: Unexpected keyword argument "extra_items" for TypedDict -typeddicts_extra_items.py:242: error: Unexpected keyword argument "extra_items" for TypedDict -typeddicts_extra_items.py:245: error: Extra key "year" for TypedDict "MovieExtraInt" -typeddicts_extra_items.py:246: error: Extra key "description" for TypedDict "MovieExtraStr" -typeddicts_extra_items.py:257: error: Extra key "year" for TypedDict "MovieExtraInt" -typeddicts_extra_items.py:269: error: Extra key "year" for TypedDict "NonClosedMovie" -typeddicts_extra_items.py:271: error: Unexpected keyword argument "extra_items" for TypedDict -typeddicts_extra_items.py:275: error: Extra key "year" for TypedDict "ExtraMovie" -typeddicts_extra_items.py:276: error: Extra key "language" for TypedDict "ExtraMovie" -typeddicts_extra_items.py:280: error: Unexpected keyword argument "closed" for TypedDict -typeddicts_extra_items.py:284: error: Extra key "year" for TypedDict "ClosedMovie" -typeddicts_extra_items.py:290: error: Extra key "summary" for TypedDict "MovieExtraStr" -typeddicts_extra_items.py:291: error: Incompatible types in assignment (expression has type "MovieExtraStr", variable has type "Mapping[str, str]") -typeddicts_extra_items.py:293: error: Extra key "year" for TypedDict "MovieExtraInt" -typeddicts_extra_items.py:294: error: Incompatible types in assignment (expression has type "MovieExtraInt", variable has type "Mapping[str, int]") -typeddicts_extra_items.py:295: error: Incompatible types in assignment (expression has type "MovieExtraInt", variable has type "Mapping[str, int | str]") -typeddicts_extra_items.py:301: error: Expression is of type "list[tuple[str, object]]", not "list[tuple[str, int | str]]" -typeddicts_extra_items.py:302: error: Expression is of type "list[object]", not "list[int | str]" -typeddicts_extra_items.py:310: error: Unexpected keyword argument "extra_items" for TypedDict -typeddicts_extra_items.py:317: error: Incompatible types in assignment (expression has type "IntDict", variable has type "dict[str, int]") -typeddicts_extra_items.py:320: error: Extra key "bar" for TypedDict "IntDictWithNum" -typeddicts_extra_items.py:321: error: Incompatible types in assignment (expression has type "IntDictWithNum", variable has type "dict[str, int]") -typeddicts_extra_items.py:328: error: "IntDictWithNum" has no attribute "clear" -typeddicts_extra_items.py:330: error: Expression is of type "Any", not "tuple[str, int]" -typeddicts_extra_items.py:330: error: "IntDictWithNum" has no attribute "popitem" -typeddicts_extra_items.py:333: error: TypedDict key must be a string literal; expected one of ("num") -typeddicts_extra_items.py:334: error: Expected TypedDict key to be string literal -typeddicts_extra_items.py:343: error: Incompatible types in assignment (expression has type "dict[str, int]", variable has type "IntDict") +typeddicts_extra_items.py:174: error: Unexpected keyword argument "extra_items" for TypedDict +typeddicts_extra_items.py:181: error: Unexpected keyword argument "extra_items" for TypedDict +typeddicts_extra_items.py:193: error: Unexpected keyword argument "extra_items" for TypedDict +typeddicts_extra_items.py:210: error: Unexpected keyword argument "extra_items" for TypedDict +typeddicts_extra_items.py:217: error: Unexpected keyword argument "extra_items" for TypedDict +typeddicts_extra_items.py:228: error: Unexpected keyword argument "extra_items" for TypedDict +typeddicts_extra_items.py:231: error: Unexpected keyword argument "extra_items" for TypedDict +typeddicts_extra_items.py:235: error: Unexpected keyword argument "extra_items" for TypedDict +typeddicts_extra_items.py:248: error: Unexpected keyword argument "extra_items" for TypedDict +typeddicts_extra_items.py:251: error: Unexpected keyword argument "extra_items" for TypedDict +typeddicts_extra_items.py:254: error: Extra key "year" for TypedDict "MovieExtraInt" +typeddicts_extra_items.py:255: error: Extra key "description" for TypedDict "MovieExtraStr" +typeddicts_extra_items.py:266: error: Extra key "year" for TypedDict "MovieExtraInt" +typeddicts_extra_items.py:278: error: Extra key "year" for TypedDict "NonClosedMovie" +typeddicts_extra_items.py:280: error: Unexpected keyword argument "extra_items" for TypedDict +typeddicts_extra_items.py:284: error: Extra key "year" for TypedDict "ExtraMovie" +typeddicts_extra_items.py:285: error: Extra key "language" for TypedDict "ExtraMovie" +typeddicts_extra_items.py:289: error: Unexpected keyword argument "closed" for TypedDict +typeddicts_extra_items.py:293: error: Extra key "year" for TypedDict "ClosedMovie" +typeddicts_extra_items.py:299: error: Extra key "summary" for TypedDict "MovieExtraStr" +typeddicts_extra_items.py:300: error: Incompatible types in assignment (expression has type "MovieExtraStr", variable has type "Mapping[str, str]") +typeddicts_extra_items.py:302: error: Extra key "year" for TypedDict "MovieExtraInt" +typeddicts_extra_items.py:303: error: Incompatible types in assignment (expression has type "MovieExtraInt", variable has type "Mapping[str, int]") +typeddicts_extra_items.py:304: error: Incompatible types in assignment (expression has type "MovieExtraInt", variable has type "Mapping[str, int | str]") +typeddicts_extra_items.py:310: error: Expression is of type "list[tuple[str, object]]", not "list[tuple[str, int | str]]" +typeddicts_extra_items.py:311: error: Expression is of type "list[object]", not "list[int | str]" +typeddicts_extra_items.py:319: error: Unexpected keyword argument "extra_items" for TypedDict +typeddicts_extra_items.py:326: error: Incompatible types in assignment (expression has type "IntDict", variable has type "dict[str, int]") +typeddicts_extra_items.py:329: error: Extra key "bar" for TypedDict "IntDictWithNum" +typeddicts_extra_items.py:330: error: Incompatible types in assignment (expression has type "IntDictWithNum", variable has type "dict[str, int]") +typeddicts_extra_items.py:337: error: "IntDictWithNum" has no attribute "clear" +typeddicts_extra_items.py:339: error: Expression is of type "Any", not "tuple[str, int]" +typeddicts_extra_items.py:339: error: "IntDictWithNum" has no attribute "popitem" +typeddicts_extra_items.py:342: error: TypedDict key must be a string literal; expected one of ("num") +typeddicts_extra_items.py:343: error: Expected TypedDict key to be string literal +typeddicts_extra_items.py:352: error: Incompatible types in assignment (expression has type "dict[str, int]", variable has type "IntDict") """ diff --git a/conformance/tests/typeddicts_extra_items.py b/conformance/tests/typeddicts_extra_items.py index b0a797ee7..b8a9c53fa 100644 --- a/conformance/tests/typeddicts_extra_items.py +++ b/conformance/tests/typeddicts_extra_items.py @@ -65,13 +65,13 @@ class ClosedBase(TypedDict, closed=True): name: str class IllegalChild1(ClosedBase, closed=False): # E: Cannot set 'closed=False' when superclass is 'closed=True' - age: int + pass class ExtraItemsBase(TypedDict, extra_items=int): name: str class IllegalChild2(ExtraItemsBase, closed=False): # E: Cannot set 'closed=False' when superclass has 'extra_items' - age: int + pass # > If ``closed`` is not provided, the behavior is inherited from the superclass. # > If the superclass is TypedDict itself or the superclass does not have ``closed=True`` @@ -106,6 +106,9 @@ class MovieClosed(MovieES, closed=True): # OK class MovieNever(MovieES, extra_items=Never): # OK, but 'closed=True' is preferred pass +class IllegalCloseNonReadOnly(ExtraItemsBase, closed=True): # E: Cannot set 'closed=True' when superclass has non-read-only 'extra_items' + pass + # > It is an error to use ``Required[]`` or ``NotRequired[]`` with ``extra_items``. class IllegalExtraItemsTD(TypedDict, extra_items=Required[int]): # E: 'extra_items' value cannot be 'Required[...]' @@ -178,15 +181,21 @@ class Child(Parent, extra_items=int): # E: Cannot change 'extra_items' type unle class MovieBase2(TypedDict, extra_items=int | None): name: str -class MovieRequiredYear(MovieBase2): # E: Required key 'year' is not known to 'MovieBase' - year: int | None +class MovieRequiredYear(MovieBase2): # E[MovieRequiredYear]: Required key 'year' is not known to 'MovieBase' + year: int | None # E[MovieRequiredYear] -class MovieNotRequiredYear(MovieBase2): # E: 'int | None' is not consistent with 'int' - year: NotRequired[int] +class MovieNotRequiredYear(MovieBase2): # E[MovieNotRequiredYear]: 'int | None' is not consistent with 'int' + year: NotRequired[int] # E[MovieNotRequiredYear] -class MovieWithYear(MovieBase): # OK +class MovieWithYear(MovieBase2): # OK year: NotRequired[int | None] +class BookBase(TypedDict, extra_items=ReadOnly[int | None]): + name: str + +class BookWithPublisher(BookBase): # E[BookWithPublisher]: 'str' is not assignable to 'int | None' + publisher: str # E[BookWithPublisher] + # > Let ``S`` be the set of keys of the explicitly defined items on a TypedDict # > type. If it specifies ``extra_items=T``, the TypedDict type is considered to # > have an infinite set of items that all satisfy the following conditions. From 8fd3f9c4c487e66c74c594e256bd664141c9fbf6 Mon Sep 17 00:00:00 2001 From: Rob Hand <146272+sinon@users.noreply.github.com> Date: Fri, 29 Aug 2025 14:25:08 +0100 Subject: [PATCH 132/308] chore: Remove unused library tqdm (#2078) --- conformance/requirements.txt | 1 - conformance/src/type_checker.py | 1 - 2 files changed, 2 deletions(-) diff --git a/conformance/requirements.txt b/conformance/requirements.txt index 0e2f33c6e..6cd6c8968 100644 --- a/conformance/requirements.txt +++ b/conformance/requirements.txt @@ -1,6 +1,5 @@ tomli tomlkit -tqdm pyright mypy pip diff --git a/conformance/src/type_checker.py b/conformance/src/type_checker.py index 3f02c9ee2..12e16cde1 100644 --- a/conformance/src/type_checker.py +++ b/conformance/src/type_checker.py @@ -10,7 +10,6 @@ import shutil from subprocess import PIPE, CalledProcessError, run import sys -from tqdm import tqdm from typing import Sequence From 5c925620bba46ce2f17fce518de4cda2cae17ffb Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Fri, 29 Aug 2025 16:58:46 +0000 Subject: [PATCH 133/308] Zuban executable changes (#2079) --- conformance/results/pyright/version.toml | 2 +- conformance/results/results.html | 4 +- .../results/zuban/aliases_explicit.toml | 42 +-- .../results/zuban/aliases_implicit.toml | 44 ++-- .../results/zuban/aliases_newtype.toml | 28 +- .../results/zuban/aliases_recursive.toml | 24 +- .../results/zuban/aliases_type_statement.toml | 54 ++-- .../results/zuban/aliases_typealiastype.toml | 46 ++-- .../results/zuban/aliases_variance.toml | 8 +- .../zuban/annotations_forward_refs.toml | 60 ++--- .../results/zuban/annotations_generators.toml | 22 +- .../results/zuban/annotations_methods.toml | 2 +- .../results/zuban/annotations_typeexpr.toml | 30 +-- .../results/zuban/callables_annotation.toml | 36 +-- .../results/zuban/callables_kwargs.toml | 36 +-- .../results/zuban/callables_protocol.toml | 34 +-- .../results/zuban/callables_subtyping.toml | 64 ++--- .../results/zuban/classes_classvar.toml | 36 +-- .../results/zuban/classes_override.toml | 10 +- .../results/zuban/constructors_call_init.toml | 6 +- .../zuban/constructors_call_metaclass.toml | 16 +- .../results/zuban/constructors_call_new.toml | 38 +-- .../results/zuban/constructors_call_type.toml | 12 +- .../results/zuban/constructors_callable.toml | 70 ++--- .../results/zuban/dataclasses_final.toml | 20 +- .../results/zuban/dataclasses_frozen.toml | 8 +- .../zuban/dataclasses_inheritance.toml | 4 +- .../results/zuban/dataclasses_kwonly.toml | 6 +- .../results/zuban/dataclasses_match_args.toml | 2 +- .../results/zuban/dataclasses_order.toml | 2 +- .../results/zuban/dataclasses_postinit.toml | 8 +- .../results/zuban/dataclasses_slots.toml | 8 +- .../zuban/dataclasses_transform_class.toml | 12 +- .../dataclasses_transform_converter.toml | 80 +++--- .../zuban/dataclasses_transform_field.toml | 4 +- .../zuban/dataclasses_transform_func.toml | 12 +- .../zuban/dataclasses_transform_meta.toml | 12 +- .../results/zuban/dataclasses_usage.toml | 22 +- .../results/zuban/directives_assert_type.toml | 12 +- .../results/zuban/directives_cast.toml | 6 +- .../zuban/directives_no_type_check.toml | 4 +- .../results/zuban/directives_reveal_type.toml | 4 +- .../results/zuban/directives_type_ignore.toml | 8 +- .../zuban/directives_type_ignore_file2.toml | 2 +- .../zuban/directives_version_platform.toml | 8 +- .../results/zuban/enums_behaviors.toml | 6 +- .../results/zuban/enums_definition.toml | 2 +- .../results/zuban/enums_expansion.toml | 6 +- .../results/zuban/enums_member_names.toml | 2 +- .../results/zuban/enums_member_values.toml | 8 +- conformance/results/zuban/enums_members.toml | 28 +- .../results/zuban/generics_base_class.toml | 16 +- conformance/results/zuban/generics_basic.toml | 26 +- .../results/zuban/generics_defaults.toml | 22 +- .../zuban/generics_defaults_referential.toml | 14 +- .../generics_defaults_specialization.toml | 4 +- .../zuban/generics_paramspec_basic.toml | 18 +- .../zuban/generics_paramspec_components.toml | 44 ++-- .../zuban/generics_paramspec_semantics.toml | 20 +- .../generics_paramspec_specialization.toml | 10 +- .../results/zuban/generics_scoping.toml | 24 +- .../results/zuban/generics_self_advanced.toml | 8 +- .../zuban/generics_self_attributes.toml | 4 +- .../results/zuban/generics_self_basic.toml | 6 +- .../zuban/generics_self_protocols.toml | 4 +- .../results/zuban/generics_self_usage.toml | 22 +- .../zuban/generics_syntax_compatibility.toml | 4 +- .../zuban/generics_syntax_declarations.toml | 20 +- .../zuban/generics_syntax_infer_variance.toml | 116 ++++----- .../zuban/generics_syntax_scoping.toml | 52 ++-- .../results/zuban/generics_type_erasure.toml | 22 +- .../zuban/generics_typevartuple_args.toml | 16 +- .../zuban/generics_typevartuple_basic.toml | 34 +-- .../zuban/generics_typevartuple_callable.toml | 2 +- .../generics_typevartuple_specialization.toml | 14 +- .../zuban/generics_typevartuple_unpack.toml | 2 +- .../results/zuban/generics_upper_bound.toml | 6 +- .../results/zuban/generics_variance.toml | 14 +- .../zuban/generics_variance_inference.toml | 46 ++-- .../results/zuban/historical_positional.toml | 8 +- .../results/zuban/literals_interactions.toml | 16 +- .../results/zuban/literals_literalstring.toml | 18 +- .../zuban/literals_parameterizations.toml | 34 +-- .../results/zuban/literals_semantics.toml | 8 +- .../zuban/namedtuples_define_class.toml | 22 +- .../zuban/namedtuples_define_functional.toml | 24 +- .../zuban/namedtuples_type_compat.toml | 4 +- .../results/zuban/namedtuples_usage.toml | 16 +- .../results/zuban/narrowing_typeguard.toml | 8 +- .../results/zuban/narrowing_typeis.toml | 18 +- .../results/zuban/overloads_basic.toml | 2 +- .../results/zuban/overloads_consistency.toml | 4 +- .../results/zuban/overloads_definitions.toml | 24 +- .../zuban/overloads_definitions_stub.toml | 16 +- .../results/zuban/overloads_evaluation.toml | 50 ++-- .../zuban/protocols_class_objects.toml | 16 +- .../results/zuban/protocols_definition.toml | 38 +-- .../results/zuban/protocols_explicit.toml | 10 +- .../results/zuban/protocols_generic.toml | 18 +- .../results/zuban/protocols_merging.toml | 12 +- .../results/zuban/protocols_modules.toml | 6 +- .../zuban/protocols_runtime_checkable.toml | 6 +- .../results/zuban/protocols_subtyping.toml | 14 +- .../results/zuban/protocols_variance.toml | 18 +- .../results/zuban/qualifiers_annotated.toml | 40 +-- .../zuban/qualifiers_final_annotation.toml | 58 ++--- .../zuban/qualifiers_final_decorator.toml | 22 +- .../results/zuban/specialtypes_never.toml | 6 +- .../results/zuban/specialtypes_none.toml | 6 +- .../zuban/specialtypes_promotions.toml | 2 +- .../results/zuban/specialtypes_type.toml | 18 +- .../results/zuban/tuples_type_compat.toml | 54 ++-- .../results/zuban/tuples_type_form.toml | 22 +- .../results/zuban/tuples_unpacked.toml | 10 +- .../results/zuban/typeddicts_alt_syntax.toml | 10 +- .../zuban/typeddicts_class_syntax.toml | 10 +- .../results/zuban/typeddicts_extra_items.toml | 244 +++++++++--------- .../results/zuban/typeddicts_inheritance.toml | 6 +- .../results/zuban/typeddicts_operations.toml | 22 +- .../results/zuban/typeddicts_readonly.toml | 12 +- .../typeddicts_readonly_consistency.toml | 14 +- .../typeddicts_readonly_inheritance.toml | 46 ++-- .../zuban/typeddicts_readonly_kwargs.toml | 2 +- .../results/zuban/typeddicts_required.toml | 8 +- .../zuban/typeddicts_type_consistency.toml | 22 +- .../results/zuban/typeddicts_usage.toml | 12 +- conformance/results/zuban/version.toml | 2 +- conformance/src/type_checker.py | 8 +- 128 files changed, 1338 insertions(+), 1338 deletions(-) diff --git a/conformance/results/pyright/version.toml b/conformance/results/pyright/version.toml index ec4415b18..60d8230bc 100644 --- a/conformance/results/pyright/version.toml +++ b/conformance/results/pyright/version.toml @@ -1 +1 @@ -version = "pyright 1.1.403" +version = "pyright 1.1.404" diff --git a/conformance/results/results.html b/conformance/results/results.html index f62bd7860..dc9f244a2 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -160,11 +160,11 @@

    Python Type System Conformance Test Results

    - - + - @@ -175,32 +177,37 @@

    Python Type System Conformance Test Results

    + + + + + - @@ -208,32 +215,37 @@

    Python Type System Conformance Test Results

    + + + + + - @@ -241,182 +253,212 @@

    Python Type System Conformance Test Results

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - @@ -424,20 +466,23 @@

    Python Type System Conformance Test Results

    + + + - @@ -445,14 +490,16 @@

    Python Type System Conformance Test Results

    + + - @@ -460,44 +507,51 @@

    Python Type System Conformance Test Results

    + + + + + + + - @@ -505,26 +559,30 @@

    Python Type System Conformance Test Results

    + + + + - @@ -532,68 +590,79 @@

    Python Type System Conformance Test Results

    + + + + + + + + + + + - @@ -601,26 +670,30 @@

    Python Type System Conformance Test Results

    + + + + - @@ -628,38 +701,44 @@

    Python Type System Conformance Test Results

    + + + + + + - @@ -667,32 +746,37 @@

    Python Type System Conformance Test Results

    + + + + + - @@ -700,8 +784,9 @@

    Python Type System Conformance Test Results

    + - @@ -709,98 +794,114 @@

    Python Type System Conformance Test Results

    + + + + + + + + + + + + + + + + - @@ -808,86 +909,100 @@

    Python Type System Conformance Test Results

    + + + + + + + + + + + + + + - @@ -895,20 +1010,23 @@

    Python Type System Conformance Test Results

    + + + - @@ -916,26 +1034,30 @@

    Python Type System Conformance Test Results

    + + + + - @@ -943,38 +1065,44 @@

    Python Type System Conformance Test Results

    + + + + + + - @@ -982,14 +1110,16 @@

    Python Type System Conformance Test Results

    + + - @@ -997,62 +1127,72 @@

    Python Type System Conformance Test Results

    + + + + + + + + + + - @@ -1060,6 +1200,7 @@

    Python Type System Conformance Test Results

    +
     
    mypy 1.17.1
    -
    2.0sec
    pyright 1.1.403
    -
    1.3sec
    pyre 0.9.25
    -
    10.2sec
    zuban 0.0.19
    -
    0.32sec
    diff --git a/conformance/results/zuban/version.toml b/conformance/results/zuban/version.toml index d3d2104dc..9f28f9ef3 100644 --- a/conformance/results/zuban/version.toml +++ b/conformance/results/zuban/version.toml @@ -1,2 +1 @@ version = "zuban 0.0.19" -test_duration = 0.32 diff --git a/conformance/src/main.py b/conformance/src/main.py index 484688b77..4b8a683dd 100644 --- a/conformance/src/main.py +++ b/conformance/src/main.py @@ -22,7 +22,6 @@ def run_tests( root_dir: Path, type_checker: TypeChecker, test_cases: Sequence[Path], - skip_timing: bool = False, ): print(f"Running tests for {type_checker.name}") @@ -30,6 +29,8 @@ def run_tests( tests_output = type_checker.run_tests([file.name for file in test_cases]) test_duration = time() - test_start_time + print(f"Completed tests for {type_checker.name} in {test_duration:.2f} seconds") + for _, output in tests_output.items(): type_checker.parse_errors(output.splitlines()) @@ -40,7 +41,7 @@ def run_tests( type_checker, results_dir, test_case, tests_output.get(test_case.name, "") ) - update_type_checker_info(type_checker, root_dir, test_duration, skip_timing=skip_timing) + update_type_checker_info(type_checker, root_dir) def get_expected_errors(test_case: Path) -> tuple[ @@ -217,9 +218,7 @@ def update_output_for_test( tomlkit.dump(existing_results, f) -def update_type_checker_info( - type_checker: TypeChecker, root_dir: Path, test_duration: float, skip_timing: bool = False -): +def update_type_checker_info(type_checker: TypeChecker, root_dir: Path): # Record the version of the type checker used for the latest run. version_file = root_dir / "results" / type_checker.name / "version.toml" @@ -234,8 +233,6 @@ def update_type_checker_info( existing_info = {} existing_info["version"] = type_checker.get_version() - if not skip_timing: - existing_info["test_duration"] = round(test_duration, 2) version_file.parent.mkdir(parents=True, exist_ok=True) with open(version_file, "w") as f: @@ -266,7 +263,7 @@ def main(): if not type_checker.install(): print(f"Skipping tests for {type_checker.name}") else: - run_tests(root_dir, type_checker, test_cases, skip_timing=options.skip_timing) + run_tests(root_dir, type_checker, test_cases) # Generate a summary report. generate_summary(root_dir) diff --git a/conformance/src/options.py b/conformance/src/options.py index 93caef022..89120774e 100644 --- a/conformance/src/options.py +++ b/conformance/src/options.py @@ -9,7 +9,6 @@ @dataclass class _Options: report_only: bool | None - skip_timing: bool def parse_options(argv: list[str]) -> _Options: @@ -20,10 +19,5 @@ def parse_options(argv: list[str]) -> _Options: action="store_true", help="regenerates the test suite report from past results", ) - reporting_group.add_argument( - "--skip-timing", - action="store_true", - help="do not update timing information in the output files", - ) ret = _Options(**vars(parser.parse_args(argv))) return ret diff --git a/conformance/src/reporting.py b/conformance/src/reporting.py index c17687240..cff2dc465 100644 --- a/conformance/src/reporting.py +++ b/conformance/src/reporting.py @@ -46,15 +46,8 @@ def generate_summary_html(root_dir: Path) -> str: existing_info = {} version = existing_info["version"] or "Unknown version" - test_duration = existing_info.get("test_duration") summary_html.append(f"
    {version}
    ") - if test_duration is not None: - if test_duration < 1: - duration = f"{test_duration:.2f}" - else: - duration = f"{test_duration:.1f}" - summary_html.append(f"
    {duration}sec
    ") summary_html.append("
    Pass
         aliases_newtype
    Partial

    `NewType`s are considered classes, not functions.

    Partial

    `NewType`s are incorrectly considered to be classes.

    Pass
    Partial

    Does not reject use of NewType in `isinstance` call.

    Does not reject use of NewType in class definition statement.

    Does not report inconsistency between name of NewType and assigned identifier name.

    Does not reject use of NewType with generic class with TypeVar.

    Does not reject use of NewType with protocol class.

    Does not reject use of NewType with TypedDict class.

    Does not reject use of NewType with Any.

    Pass
         typeddicts_extra_items
    Unsupported

    Not supported.

    Pass
    Partial

    Does not flag illegal use of `closed=False` when inheriting from a non-open TypedDict.

    Unsupported

    Not supported.

    Unsupported

    Not supported.

     
    mypy 1.17.1
    pyright 1.1.403
    +
    pyright 1.1.404
    pyre 0.9.25
    zuban 0.0.19
    +
    zuban 0.0.20
    diff --git a/conformance/results/zuban/aliases_explicit.toml b/conformance/results/zuban/aliases_explicit.toml index 3f056707b..655fb9268 100644 --- a/conformance/results/zuban/aliases_explicit.toml +++ b/conformance/results/zuban/aliases_explicit.toml @@ -2,28 +2,28 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -aliases_explicit.py:67: error: Bad number of arguments for type alias, expected 0, given 1 -aliases_explicit.py:68: error: Bad number of arguments for type alias, expected 0, given 1 -aliases_explicit.py:69: error: Bad number of arguments for type alias, expected 1, given 2 -aliases_explicit.py:70: error: Bad number of arguments for type alias, expected 1, given 2 -aliases_explicit.py:71: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "int" -aliases_explicit.py:79: error: Invalid type alias: expression is not a valid type -aliases_explicit.py:80: error: Bracketed expression "[...]" is not valid as a type +aliases_explicit.py:67: error: Bad number of arguments for type alias, expected 0, given 1 [misc] +aliases_explicit.py:68: error: Bad number of arguments for type alias, expected 0, given 1 [misc] +aliases_explicit.py:69: error: Bad number of arguments for type alias, expected 1, given 2 [misc] +aliases_explicit.py:70: error: Bad number of arguments for type alias, expected 1, given 2 [misc] +aliases_explicit.py:71: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "int" [misc] +aliases_explicit.py:79: error: Invalid type alias: expression is not a valid type [valid-type] +aliases_explicit.py:80: error: Bracketed expression "[...]" is not valid as a type [valid-type] aliases_explicit.py:80: note: Did you mean "List[...]"? -aliases_explicit.py:81: error: Syntax error in type annotation +aliases_explicit.py:81: error: Syntax error in type annotation [valid-type] aliases_explicit.py:81: note: Suggestion: Is there a spurious trailing comma? -aliases_explicit.py:82: error: Invalid type alias: expression is not a valid type -aliases_explicit.py:83: error: Invalid type alias: expression is not a valid type -aliases_explicit.py:84: error: Invalid type alias: expression is not a valid type -aliases_explicit.py:85: error: Invalid type alias: expression is not a valid type -aliases_explicit.py:86: error: Invalid type alias: expression is not a valid type -aliases_explicit.py:87: error: Variable "aliases_explicit.var1" is not valid as a type +aliases_explicit.py:82: error: Invalid type alias: expression is not a valid type [valid-type] +aliases_explicit.py:83: error: Invalid type alias: expression is not a valid type [valid-type] +aliases_explicit.py:84: error: Invalid type alias: expression is not a valid type [valid-type] +aliases_explicit.py:85: error: Invalid type alias: expression is not a valid type [valid-type] +aliases_explicit.py:86: error: Invalid type alias: expression is not a valid type [valid-type] +aliases_explicit.py:87: error: Variable "aliases_explicit.var1" is not valid as a type [valid-type] aliases_explicit.py:87: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -aliases_explicit.py:88: error: Invalid type alias: expression is not a valid type -aliases_explicit.py:89: error: Invalid type: try using Literal[1] instead? -aliases_explicit.py:90: error: Invalid type alias: expression is not a valid type -aliases_explicit.py:91: error: Invalid type alias: expression is not a valid type -aliases_explicit.py:100: error: Bad number of arguments for type alias, expected 0, given 1 -aliases_explicit.py:101: error: "" not callable -aliases_explicit.py:102: error: Bad number of arguments for type alias, expected 0, given 1 +aliases_explicit.py:88: error: Invalid type alias: expression is not a valid type [valid-type] +aliases_explicit.py:89: error: Invalid type: try using Literal[1] instead? [valid-type] +aliases_explicit.py:90: error: Invalid type alias: expression is not a valid type [valid-type] +aliases_explicit.py:91: error: Invalid type alias: expression is not a valid type [valid-type] +aliases_explicit.py:100: error: Bad number of arguments for type alias, expected 0, given 1 [misc] +aliases_explicit.py:101: error: "" not callable [operator] +aliases_explicit.py:102: error: Bad number of arguments for type alias, expected 0, given 1 [misc] """ diff --git a/conformance/results/zuban/aliases_implicit.toml b/conformance/results/zuban/aliases_implicit.toml index 000b3d757..39572ce2e 100644 --- a/conformance/results/zuban/aliases_implicit.toml +++ b/conformance/results/zuban/aliases_implicit.toml @@ -2,40 +2,40 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -aliases_implicit.py:76: error: Bad number of arguments for type alias, expected 0, given 1 -aliases_implicit.py:77: error: Bad number of arguments for type alias, expected 0, given 1 -aliases_implicit.py:78: error: Bad number of arguments for type alias, expected 1, given 2 -aliases_implicit.py:79: error: Bad number of arguments for type alias, expected 1, given 2 -aliases_implicit.py:80: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "int" -aliases_implicit.py:81: error: Type argument "str" of "GoodTypeAlias12" must be a subtype of "float" -aliases_implicit.py:106: error: Variable "aliases_implicit.BadTypeAlias1" is not valid as a type +aliases_implicit.py:76: error: Bad number of arguments for type alias, expected 0, given 1 [misc] +aliases_implicit.py:77: error: Bad number of arguments for type alias, expected 0, given 1 [misc] +aliases_implicit.py:78: error: Bad number of arguments for type alias, expected 1, given 2 [misc] +aliases_implicit.py:79: error: Bad number of arguments for type alias, expected 1, given 2 [misc] +aliases_implicit.py:80: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "int" [misc] +aliases_implicit.py:81: error: Type argument "str" of "GoodTypeAlias12" must be a subtype of "float" [type-var] +aliases_implicit.py:106: error: Variable "aliases_implicit.BadTypeAlias1" is not valid as a type [valid-type] aliases_implicit.py:106: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -aliases_implicit.py:107: error: Variable "aliases_implicit.BadTypeAlias2" is not valid as a type +aliases_implicit.py:107: error: Variable "aliases_implicit.BadTypeAlias2" is not valid as a type [valid-type] aliases_implicit.py:107: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -aliases_implicit.py:108: error: Variable "aliases_implicit.BadTypeAlias3" is not valid as a type +aliases_implicit.py:108: error: Variable "aliases_implicit.BadTypeAlias3" is not valid as a type [valid-type] aliases_implicit.py:108: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -aliases_implicit.py:109: error: Variable "aliases_implicit.BadTypeAlias4" is not valid as a type +aliases_implicit.py:109: error: Variable "aliases_implicit.BadTypeAlias4" is not valid as a type [valid-type] aliases_implicit.py:109: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -aliases_implicit.py:110: error: Variable "aliases_implicit.BadTypeAlias5" is not valid as a type +aliases_implicit.py:110: error: Variable "aliases_implicit.BadTypeAlias5" is not valid as a type [valid-type] aliases_implicit.py:110: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -aliases_implicit.py:111: error: Variable "aliases_implicit.BadTypeAlias6" is not valid as a type +aliases_implicit.py:111: error: Variable "aliases_implicit.BadTypeAlias6" is not valid as a type [valid-type] aliases_implicit.py:111: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -aliases_implicit.py:112: error: Variable "aliases_implicit.BadTypeAlias7" is not valid as a type +aliases_implicit.py:112: error: Variable "aliases_implicit.BadTypeAlias7" is not valid as a type [valid-type] aliases_implicit.py:112: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -aliases_implicit.py:113: error: Variable "aliases_implicit.BadTypeAlias8" is not valid as a type +aliases_implicit.py:113: error: Variable "aliases_implicit.BadTypeAlias8" is not valid as a type [valid-type] aliases_implicit.py:113: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -aliases_implicit.py:114: error: Variable "aliases_implicit.var1" is not valid as a type +aliases_implicit.py:114: error: Variable "aliases_implicit.var1" is not valid as a type [valid-type] aliases_implicit.py:114: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -aliases_implicit.py:115: error: Variable "aliases_implicit.BadTypeAlias10" is not valid as a type +aliases_implicit.py:115: error: Variable "aliases_implicit.BadTypeAlias10" is not valid as a type [valid-type] aliases_implicit.py:115: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -aliases_implicit.py:116: error: Variable "aliases_implicit.BadTypeAlias11" is not valid as a type +aliases_implicit.py:116: error: Variable "aliases_implicit.BadTypeAlias11" is not valid as a type [valid-type] aliases_implicit.py:116: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -aliases_implicit.py:117: error: Variable "aliases_implicit.BadTypeAlias12" is not valid as a type +aliases_implicit.py:117: error: Variable "aliases_implicit.BadTypeAlias12" is not valid as a type [valid-type] aliases_implicit.py:117: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -aliases_implicit.py:118: error: Variable "aliases_implicit.BadTypeAlias13" is not valid as a type +aliases_implicit.py:118: error: Variable "aliases_implicit.BadTypeAlias13" is not valid as a type [valid-type] aliases_implicit.py:118: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -aliases_implicit.py:119: error: Variable "aliases_implicit.BadTypeAlias14" is not valid as a type +aliases_implicit.py:119: error: Variable "aliases_implicit.BadTypeAlias14" is not valid as a type [valid-type] aliases_implicit.py:119: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -aliases_implicit.py:133: error: "UnionType" not callable -aliases_implicit.py:135: error: Bad number of arguments for type alias, expected 0, given 1 +aliases_implicit.py:133: error: "UnionType" not callable [operator] +aliases_implicit.py:135: error: Bad number of arguments for type alias, expected 0, given 1 [misc] """ diff --git a/conformance/results/zuban/aliases_newtype.toml b/conformance/results/zuban/aliases_newtype.toml index 2500008d3..ed7a88d52 100644 --- a/conformance/results/zuban/aliases_newtype.toml +++ b/conformance/results/zuban/aliases_newtype.toml @@ -2,20 +2,20 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -aliases_newtype.py:11: error: Argument 1 to "UserId" has incompatible type "str"; expected "int" -aliases_newtype.py:12: error: Incompatible types in assignment (expression has type "int", variable has type "UserId") -aliases_newtype.py:18: error: Incompatible types in assignment (expression has type "Type[UserId]", variable has type "Type[Any]") -aliases_newtype.py:23: error: Cannot use isinstance() with NewType type -aliases_newtype.py:26: error: Cannot subclass "NewType" -aliases_newtype.py:35: error: String argument 1 "BadName" to NewType(...) does not match variable name "GoodName" -aliases_newtype.py:41: error: Bad number of arguments for type alias, expected 0, given 1 -aliases_newtype.py:47: error: Argument 2 to NewType(...) must be subclassable (got "int | str") -aliases_newtype.py:50: error: Type variable "aliases_newtype.T" is unbound +aliases_newtype.py:11: error: Argument 1 to "UserId" has incompatible type "str"; expected "int" [arg-type] +aliases_newtype.py:12: error: Incompatible types in assignment (expression has type "int", variable has type "UserId") [assignment] +aliases_newtype.py:18: error: Incompatible types in assignment (expression has type "Type[UserId]", variable has type "Type[Any]") [assignment] +aliases_newtype.py:23: error: Cannot use isinstance() with NewType type [misc] +aliases_newtype.py:26: error: Cannot subclass "NewType" [misc] +aliases_newtype.py:35: error: String argument 1 "BadName" to NewType(...) does not match variable name "GoodName" [misc] +aliases_newtype.py:41: error: Bad number of arguments for type alias, expected 0, given 1 [misc] +aliases_newtype.py:47: error: Argument 2 to NewType(...) must be subclassable (got "int | str") [valid-newtype] +aliases_newtype.py:50: error: Type variable "aliases_newtype.T" is unbound [misc] aliases_newtype.py:50: note: (Hint: Use "Generic[T]" or "Protocol[T]" base class to bind "T" inside a class) aliases_newtype.py:50: note: (Hint: Use "T" in function signature to bind "T" inside a function) -aliases_newtype.py:52: error: NewType cannot be used with protocol classes -aliases_newtype.py:54: error: Argument 2 to NewType(...) must be subclassable (got "Literal[7]") -aliases_newtype.py:61: error: Argument 2 to NewType(...) must be subclassable (got "TD1") -aliases_newtype.py:63: error: NewType(...) expects exactly two positional arguments -aliases_newtype.py:65: error: Argument 2 to NewType(...) must be subclassable (got "Any") +aliases_newtype.py:52: error: NewType cannot be used with protocol classes [misc] +aliases_newtype.py:54: error: Argument 2 to NewType(...) must be subclassable (got "Literal[7]") [valid-newtype] +aliases_newtype.py:61: error: Argument 2 to NewType(...) must be subclassable (got "TD1") [valid-newtype] +aliases_newtype.py:63: error: NewType(...) expects exactly two positional arguments [call-arg] +aliases_newtype.py:65: error: Argument 2 to NewType(...) must be subclassable (got "Any") [valid-newtype] """ diff --git a/conformance/results/zuban/aliases_recursive.toml b/conformance/results/zuban/aliases_recursive.toml index daf88ae2f..151d0978d 100644 --- a/conformance/results/zuban/aliases_recursive.toml +++ b/conformance/results/zuban/aliases_recursive.toml @@ -2,16 +2,16 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -aliases_recursive.py:19: error: Dict entry 1 has incompatible type "str": "complex"; expected "str": "None | int | str | float | list[Json] | dict[str, Json]" -aliases_recursive.py:20: error: List item 1 has incompatible type "complex"; expected "None | int | str | float | list[Json] | dict[str, Json]" -aliases_recursive.py:38: error: Incompatible types in assignment (expression has type "tuple[int, tuple[str, int], tuple[int, tuple[int, list[int]]]]", variable has type "str | int | tuple[RecursiveTuple, ...]") -aliases_recursive.py:39: error: Name "t6" already defined on line 38 -aliases_recursive.py:39: error: Incompatible types in assignment (expression has type "tuple[int, list[int]]", variable has type "str | int | tuple[RecursiveTuple, ...]") -aliases_recursive.py:50: error: Dict entry 0 has incompatible type "str": "list[int]"; expected "str": "str | int | Mapping[str, str | int | Mapping[str, RecursiveMapping]]" -aliases_recursive.py:51: error: Dict entry 2 has incompatible type "str": "list[int]"; expected "str": "str | int | Mapping[str, str | int | Mapping[str, RecursiveMapping]]" -aliases_recursive.py:52: error: Dict entry 2 has incompatible type "str": "list[int]"; expected "str": "str | int | Mapping[str, str | int | Mapping[str, RecursiveMapping]]" -aliases_recursive.py:63: error: List item 0 has incompatible type "float"; expected "GenericTypeAlias1[str] | str" -aliases_recursive.py:69: error: List item 0 has incompatible type "float"; expected "GenericTypeAlias2[str, int] | str | int" -aliases_recursive.py:72: error: Invalid recursive alias: a union item of itself -aliases_recursive.py:75: error: Invalid recursive alias: a union item of itself +aliases_recursive.py:19: error: Dict entry 1 has incompatible type "str": "complex"; expected "str": "None | int | str | float | list[Json] | dict[str, Json]" [dict-item] +aliases_recursive.py:20: error: List item 1 has incompatible type "complex"; expected "None | int | str | float | list[Json] | dict[str, Json]" [list-item] +aliases_recursive.py:38: error: Incompatible types in assignment (expression has type "tuple[int, tuple[str, int], tuple[int, tuple[int, list[int]]]]", variable has type "str | int | tuple[RecursiveTuple, ...]") [assignment] +aliases_recursive.py:39: error: Name "t6" already defined on line 38 [no-redef] +aliases_recursive.py:39: error: Incompatible types in assignment (expression has type "tuple[int, list[int]]", variable has type "str | int | tuple[RecursiveTuple, ...]") [assignment] +aliases_recursive.py:50: error: Dict entry 0 has incompatible type "str": "list[int]"; expected "str": "str | int | Mapping[str, str | int | Mapping[str, RecursiveMapping]]" [dict-item] +aliases_recursive.py:51: error: Dict entry 2 has incompatible type "str": "list[int]"; expected "str": "str | int | Mapping[str, str | int | Mapping[str, RecursiveMapping]]" [dict-item] +aliases_recursive.py:52: error: Dict entry 2 has incompatible type "str": "list[int]"; expected "str": "str | int | Mapping[str, str | int | Mapping[str, RecursiveMapping]]" [dict-item] +aliases_recursive.py:63: error: List item 0 has incompatible type "float"; expected "GenericTypeAlias1[str] | str" [list-item] +aliases_recursive.py:69: error: List item 0 has incompatible type "float"; expected "GenericTypeAlias2[str, int] | str | int" [list-item] +aliases_recursive.py:72: error: Invalid recursive alias: a union item of itself [misc] +aliases_recursive.py:75: error: Invalid recursive alias: a union item of itself [misc] """ diff --git a/conformance/results/zuban/aliases_type_statement.toml b/conformance/results/zuban/aliases_type_statement.toml index 02494e07c..85111674f 100644 --- a/conformance/results/zuban/aliases_type_statement.toml +++ b/conformance/results/zuban/aliases_type_statement.toml @@ -2,34 +2,34 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -aliases_type_statement.py:17: error: "TypeAliasType" has no attribute "bit_count" -aliases_type_statement.py:19: error: "TypeAliasType" not callable -aliases_type_statement.py:23: error: "TypeAliasType" has no attribute "other_attrib" -aliases_type_statement.py:26: error: Type alias defined using "type" statement not valid as base class -aliases_type_statement.py:31: error: Argument 2 to "isinstance" has incompatible type "TypeAliasType"; expected "Type[Any] | UnionType | tuple[_ClassInfo, ...]" -aliases_type_statement.py:37: error: Invalid type alias: expression is not a valid type -aliases_type_statement.py:38: error: Bracketed expression "[...]" is not valid as a type +aliases_type_statement.py:17: error: "TypeAliasType" has no attribute "bit_count" [attr-defined] +aliases_type_statement.py:19: error: "TypeAliasType" not callable [operator] +aliases_type_statement.py:23: error: "TypeAliasType" has no attribute "other_attrib" [attr-defined] +aliases_type_statement.py:26: error: Type alias defined using "type" statement not valid as base class [misc] +aliases_type_statement.py:31: error: Argument 2 to "isinstance" has incompatible type "TypeAliasType"; expected "Type[Any] | UnionType | tuple[_ClassInfo, ...]" [arg-type] +aliases_type_statement.py:37: error: Invalid type alias: expression is not a valid type [valid-type] +aliases_type_statement.py:38: error: Bracketed expression "[...]" is not valid as a type [valid-type] aliases_type_statement.py:38: note: Did you mean "List[...]"? -aliases_type_statement.py:39: error: Syntax error in type annotation +aliases_type_statement.py:39: error: Syntax error in type annotation [valid-type] aliases_type_statement.py:39: note: Suggestion: Is there a spurious trailing comma? -aliases_type_statement.py:40: error: Invalid type alias: expression is not a valid type -aliases_type_statement.py:41: error: Invalid type alias: expression is not a valid type -aliases_type_statement.py:42: error: Invalid type alias: expression is not a valid type -aliases_type_statement.py:43: error: Invalid type alias: expression is not a valid type -aliases_type_statement.py:44: error: Invalid type alias: expression is not a valid type -aliases_type_statement.py:45: error: Variable "aliases_type_statement.var1" is not valid as a type +aliases_type_statement.py:40: error: Invalid type alias: expression is not a valid type [valid-type] +aliases_type_statement.py:41: error: Invalid type alias: expression is not a valid type [valid-type] +aliases_type_statement.py:42: error: Invalid type alias: expression is not a valid type [valid-type] +aliases_type_statement.py:43: error: Invalid type alias: expression is not a valid type [valid-type] +aliases_type_statement.py:44: error: Invalid type alias: expression is not a valid type [valid-type] +aliases_type_statement.py:45: error: Variable "aliases_type_statement.var1" is not valid as a type [valid-type] aliases_type_statement.py:45: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -aliases_type_statement.py:46: error: Invalid type alias: expression is not a valid type -aliases_type_statement.py:47: error: Invalid type: try using Literal[1] instead? -aliases_type_statement.py:48: error: Invalid type alias: expression is not a valid type -aliases_type_statement.py:49: error: Invalid type alias: expression is not a valid type -aliases_type_statement.py:52: error: Name "BadTypeAlias14" already defined on line 51 -aliases_type_statement.py:56: error: Type alias not allowed in function -aliases_type_statement.py:62: error: All type parameters should be declared ("V" not declared) -aliases_type_statement.py:67: error: All type parameters should be declared ("T1" not declared) -aliases_type_statement.py:77: error: Type argument "str" of "RecursiveTypeAlias2" must be a subtype of "int" -aliases_type_statement.py:79: error: Type argument "int" of "RecursiveTypeAlias2" must be a subtype of "str" -aliases_type_statement.py:82: error: Invalid recursive alias: a union item of itself -aliases_type_statement.py:84: error: Invalid recursive alias: a union item of itself -aliases_type_statement.py:88: error: Invalid recursive alias: a union item of itself +aliases_type_statement.py:46: error: Invalid type alias: expression is not a valid type [valid-type] +aliases_type_statement.py:47: error: Invalid type: try using Literal[1] instead? [valid-type] +aliases_type_statement.py:48: error: Invalid type alias: expression is not a valid type [valid-type] +aliases_type_statement.py:49: error: Invalid type alias: expression is not a valid type [valid-type] +aliases_type_statement.py:52: error: Name "BadTypeAlias14" already defined on line 51 [no-redef] +aliases_type_statement.py:56: error: Type alias not allowed in function [misc] +aliases_type_statement.py:62: error: All type parameters should be declared ("V" not declared) [misc] +aliases_type_statement.py:67: error: All type parameters should be declared ("T1" not declared) [misc] +aliases_type_statement.py:77: error: Type argument "str" of "RecursiveTypeAlias2" must be a subtype of "int" [type-var] +aliases_type_statement.py:79: error: Type argument "int" of "RecursiveTypeAlias2" must be a subtype of "str" [type-var] +aliases_type_statement.py:82: error: Invalid recursive alias: a union item of itself [misc] +aliases_type_statement.py:84: error: Invalid recursive alias: a union item of itself [misc] +aliases_type_statement.py:88: error: Invalid recursive alias: a union item of itself [misc] """ diff --git a/conformance/results/zuban/aliases_typealiastype.toml b/conformance/results/zuban/aliases_typealiastype.toml index 99edcc60d..88fb5f8a5 100644 --- a/conformance/results/zuban/aliases_typealiastype.toml +++ b/conformance/results/zuban/aliases_typealiastype.toml @@ -6,33 +6,33 @@ Incorrectly allows type_params= to be an arbitrary tuple. conformance_automated = "Fail" errors_diff = """ Line 45: Expected 1 errors -Line 27: Unexpected errors ['aliases_typealiastype.py:27: error: Can\\'t use bound type variable "T" to define generic alias'] +Line 27: Unexpected errors ['aliases_typealiastype.py:27: error: Can\\'t use bound type variable "T" to define generic alias [misc]'] """ output = """ -aliases_typealiastype.py:27: error: Can't use bound type variable "T" to define generic alias -aliases_typealiastype.py:32: error: "TypeAliasType" has no attribute "other_attrib" -aliases_typealiastype.py:40: error: Type argument "int" of "GoodAlias5" must be a subtype of "str" -aliases_typealiastype.py:43: error: All type parameters should be declared ("S" not declared) -aliases_typealiastype.py:44: error: All type parameters should be declared ("S" not declared) -aliases_typealiastype.py:46: error: Invalid recursive alias: a union item of itself -aliases_typealiastype.py:47: error: Invalid recursive alias: a union item of itself -aliases_typealiastype.py:48: error: Variable "aliases_typealiastype.BadAlias7" is not valid as a type +aliases_typealiastype.py:27: error: Can't use bound type variable "T" to define generic alias [misc] +aliases_typealiastype.py:32: error: "TypeAliasType" has no attribute "other_attrib" [attr-defined] +aliases_typealiastype.py:40: error: Type argument "int" of "GoodAlias5" must be a subtype of "str" [type-var] +aliases_typealiastype.py:43: error: All type parameters should be declared ("S" not declared) [misc] +aliases_typealiastype.py:44: error: All type parameters should be declared ("S" not declared) [misc] +aliases_typealiastype.py:46: error: Invalid recursive alias: a union item of itself [misc] +aliases_typealiastype.py:47: error: Invalid recursive alias: a union item of itself [misc] +aliases_typealiastype.py:48: error: Variable "aliases_typealiastype.BadAlias7" is not valid as a type [valid-type] aliases_typealiastype.py:48: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -aliases_typealiastype.py:52: error: Invalid type alias: expression is not a valid type -aliases_typealiastype.py:53: error: Bracketed expression "[...]" is not valid as a type +aliases_typealiastype.py:52: error: Invalid type alias: expression is not a valid type [valid-type] +aliases_typealiastype.py:53: error: Bracketed expression "[...]" is not valid as a type [valid-type] aliases_typealiastype.py:53: note: Did you mean "List[...]"? -aliases_typealiastype.py:54: error: Syntax error in type annotation +aliases_typealiastype.py:54: error: Syntax error in type annotation [valid-type] aliases_typealiastype.py:54: note: Suggestion: Is there a spurious trailing comma? -aliases_typealiastype.py:55: error: Invalid type alias: expression is not a valid type -aliases_typealiastype.py:56: error: Invalid type alias: expression is not a valid type -aliases_typealiastype.py:57: error: Invalid type alias: expression is not a valid type -aliases_typealiastype.py:58: error: Invalid type alias: expression is not a valid type -aliases_typealiastype.py:59: error: Invalid type alias: expression is not a valid type -aliases_typealiastype.py:60: error: Variable "aliases_typealiastype.var1" is not valid as a type +aliases_typealiastype.py:55: error: Invalid type alias: expression is not a valid type [valid-type] +aliases_typealiastype.py:56: error: Invalid type alias: expression is not a valid type [valid-type] +aliases_typealiastype.py:57: error: Invalid type alias: expression is not a valid type [valid-type] +aliases_typealiastype.py:58: error: Invalid type alias: expression is not a valid type [valid-type] +aliases_typealiastype.py:59: error: Invalid type alias: expression is not a valid type [valid-type] +aliases_typealiastype.py:60: error: Variable "aliases_typealiastype.var1" is not valid as a type [valid-type] aliases_typealiastype.py:60: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -aliases_typealiastype.py:61: error: Invalid type alias: expression is not a valid type -aliases_typealiastype.py:62: error: Invalid type: try using Literal[1] instead? -aliases_typealiastype.py:63: error: Invalid type alias: expression is not a valid type -aliases_typealiastype.py:64: error: Invalid type alias: expression is not a valid type -aliases_typealiastype.py:66: error: Name "BadAlias21" is used before definition +aliases_typealiastype.py:61: error: Invalid type alias: expression is not a valid type [valid-type] +aliases_typealiastype.py:62: error: Invalid type: try using Literal[1] instead? [valid-type] +aliases_typealiastype.py:63: error: Invalid type alias: expression is not a valid type [valid-type] +aliases_typealiastype.py:64: error: Invalid type alias: expression is not a valid type [valid-type] +aliases_typealiastype.py:66: error: Name "BadAlias21" is used before definition [used-before-def] """ diff --git a/conformance/results/zuban/aliases_variance.toml b/conformance/results/zuban/aliases_variance.toml index 461ba7dcc..8d4c8f1f1 100644 --- a/conformance/results/zuban/aliases_variance.toml +++ b/conformance/results/zuban/aliases_variance.toml @@ -2,8 +2,8 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -aliases_variance.py:24: error: Variance of TypeVar "T_co" incompatible with variance in parent type -aliases_variance.py:28: error: Variance of TypeVar "T_co" incompatible with variance in parent type -aliases_variance.py:32: error: Variance of TypeVar "T_co" incompatible with variance in parent type -aliases_variance.py:44: error: Variance of TypeVar "T_contra" incompatible with variance in parent type +aliases_variance.py:24: error: Variance of TypeVar "T_co" incompatible with variance in parent type [type-var] +aliases_variance.py:28: error: Variance of TypeVar "T_co" incompatible with variance in parent type [type-var] +aliases_variance.py:32: error: Variance of TypeVar "T_co" incompatible with variance in parent type [type-var] +aliases_variance.py:44: error: Variance of TypeVar "T_contra" incompatible with variance in parent type [type-var] """ diff --git a/conformance/results/zuban/annotations_forward_refs.toml b/conformance/results/zuban/annotations_forward_refs.toml index 8fcc15164..eda32687b 100644 --- a/conformance/results/zuban/annotations_forward_refs.toml +++ b/conformance/results/zuban/annotations_forward_refs.toml @@ -11,42 +11,42 @@ Line 23: Expected 1 errors Line 24: Expected 1 errors Line 25: Expected 1 errors Line 66: Expected 1 errors -Line 82: Unexpected errors ['annotations_forward_refs.py:82: error: Name "str" is not defined'] -Line 87: Unexpected errors ['annotations_forward_refs.py:87: error: Function "annotations_forward_refs.ClassD.int" is not valid as a type'] -Line 95: Unexpected errors ['annotations_forward_refs.py:95: error: Expression is of type "Any", not "str"'] -Line 96: Unexpected errors ['annotations_forward_refs.py:96: error: Expression is of type "Any", not "int"'] -Line 104: Unexpected errors ['annotations_forward_refs.py:104: error: invalid syntax'] -Line 105: Unexpected errors ['annotations_forward_refs.py:105: error: invalid syntax', 'annotations_forward_refs.py:105: error: invalid syntax'] +Line 82: Unexpected errors ['annotations_forward_refs.py:82: error: Name "str" is not defined [name-defined]'] +Line 87: Unexpected errors ['annotations_forward_refs.py:87: error: Function "annotations_forward_refs.ClassD.int" is not valid as a type [valid-type]'] +Line 95: Unexpected errors ['annotations_forward_refs.py:95: error: Expression is of type "Any", not "str" [misc]'] +Line 96: Unexpected errors ['annotations_forward_refs.py:96: error: Expression is of type "Any", not "int" [misc]'] +Line 104: Unexpected errors ['annotations_forward_refs.py:104: error: invalid syntax [syntax]'] +Line 105: Unexpected errors ['annotations_forward_refs.py:105: error: invalid syntax [syntax]', 'annotations_forward_refs.py:105: error: invalid syntax [syntax]'] """ output = """ -annotations_forward_refs.py:41: error: Invalid type comment or annotation -annotations_forward_refs.py:42: error: Bracketed expression "[...]" is not valid as a type +annotations_forward_refs.py:41: error: Invalid type comment or annotation [valid-type] +annotations_forward_refs.py:42: error: Bracketed expression "[...]" is not valid as a type [valid-type] annotations_forward_refs.py:42: note: Did you mean "List[...]"? -annotations_forward_refs.py:43: error: Syntax error in type annotation +annotations_forward_refs.py:43: error: Syntax error in type annotation [valid-type] annotations_forward_refs.py:43: note: Suggestion: Use Tuple[T1, ..., Tn] instead of (T1, ..., Tn) -annotations_forward_refs.py:44: error: Invalid type comment or annotation -annotations_forward_refs.py:45: error: Invalid type comment or annotation -annotations_forward_refs.py:46: error: Invalid type comment or annotation -annotations_forward_refs.py:47: error: Invalid type comment or annotation -annotations_forward_refs.py:48: error: Invalid type comment or annotation -annotations_forward_refs.py:49: error: Variable "annotations_forward_refs.var1" is not valid as a type +annotations_forward_refs.py:44: error: Invalid type comment or annotation [valid-type] +annotations_forward_refs.py:45: error: Invalid type comment or annotation [valid-type] +annotations_forward_refs.py:46: error: Invalid type comment or annotation [valid-type] +annotations_forward_refs.py:47: error: Invalid type comment or annotation [valid-type] +annotations_forward_refs.py:48: error: Invalid type comment or annotation [valid-type] +annotations_forward_refs.py:49: error: Variable "annotations_forward_refs.var1" is not valid as a type [valid-type] annotations_forward_refs.py:49: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -annotations_forward_refs.py:50: error: Invalid type comment or annotation -annotations_forward_refs.py:51: error: Invalid type: try using Literal[1] instead? -annotations_forward_refs.py:52: error: Invalid type comment or annotation -annotations_forward_refs.py:53: error: Invalid type comment or annotation -annotations_forward_refs.py:54: error: Invalid type comment or annotation -annotations_forward_refs.py:55: error: Module "types" is not valid as a type +annotations_forward_refs.py:50: error: Invalid type comment or annotation [valid-type] +annotations_forward_refs.py:51: error: Invalid type: try using Literal[1] instead? [valid-type] +annotations_forward_refs.py:52: error: Invalid type comment or annotation [valid-type] +annotations_forward_refs.py:53: error: Invalid type comment or annotation [valid-type] +annotations_forward_refs.py:54: error: Invalid type comment or annotation [valid-type] +annotations_forward_refs.py:55: error: Module "types" is not valid as a type [valid-type] annotations_forward_refs.py:55: note: Perhaps you meant to use a protocol matching the module structure? -annotations_forward_refs.py:80: error: Name "ClassF" is not defined -annotations_forward_refs.py:82: error: Name "str" is not defined -annotations_forward_refs.py:87: error: Function "annotations_forward_refs.ClassD.int" is not valid as a type +annotations_forward_refs.py:80: error: Name "ClassF" is not defined [name-defined] +annotations_forward_refs.py:82: error: Name "str" is not defined [name-defined] +annotations_forward_refs.py:87: error: Function "annotations_forward_refs.ClassD.int" is not valid as a type [valid-type] annotations_forward_refs.py:87: note: Perhaps you need "Callable[...]" or a callback protocol? -annotations_forward_refs.py:89: error: Function "annotations_forward_refs.ClassD.int" is not valid as a type +annotations_forward_refs.py:89: error: Function "annotations_forward_refs.ClassD.int" is not valid as a type [valid-type] annotations_forward_refs.py:89: note: Perhaps you need "Callable[...]" or a callback protocol? -annotations_forward_refs.py:95: error: Expression is of type "Any", not "str" -annotations_forward_refs.py:96: error: Expression is of type "Any", not "int" -annotations_forward_refs.py:104: error: invalid syntax -annotations_forward_refs.py:105: error: invalid syntax -annotations_forward_refs.py:105: error: invalid syntax +annotations_forward_refs.py:95: error: Expression is of type "Any", not "str" [misc] +annotations_forward_refs.py:96: error: Expression is of type "Any", not "int" [misc] +annotations_forward_refs.py:104: error: invalid syntax [syntax] +annotations_forward_refs.py:105: error: invalid syntax [syntax] +annotations_forward_refs.py:105: error: invalid syntax [syntax] """ diff --git a/conformance/results/zuban/annotations_generators.toml b/conformance/results/zuban/annotations_generators.toml index fa4ba7567..21bd62604 100644 --- a/conformance/results/zuban/annotations_generators.toml +++ b/conformance/results/zuban/annotations_generators.toml @@ -2,15 +2,15 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -annotations_generators.py:51: error: Missing return statement -annotations_generators.py:54: error: Incompatible return value type (got "bool", expected "C") -annotations_generators.py:57: error: Incompatible types in "yield" (actual type "int", expected type "A") -annotations_generators.py:66: error: Incompatible types in "yield" (actual type "int", expected type "A") -annotations_generators.py:71: error: No return value expected -annotations_generators.py:75: error: Incompatible types in "yield" (actual type "B", expected type "A") -annotations_generators.py:86: error: The return type of a generator function should be "Generator" or one of its supertypes -annotations_generators.py:91: error: The return type of an async generator function should be "AsyncGenerator" or one of its supertypes -annotations_generators.py:118: error: Incompatible types in "yield from" (actual type "A", expected type "B") -annotations_generators.py:119: error: Incompatible types in "yield from" (actual type "int", expected type "B") -annotations_generators.py:135: error: Incompatible send types in yield from (actual type "int", expected type "str") +annotations_generators.py:51: error: Missing return statement [return] +annotations_generators.py:54: error: Incompatible return value type (got "bool", expected "C") [return-value] +annotations_generators.py:57: error: Incompatible types in "yield" (actual type "int", expected type "A") [misc] +annotations_generators.py:66: error: Incompatible types in "yield" (actual type "int", expected type "A") [misc] +annotations_generators.py:71: error: No return value expected [return-value] +annotations_generators.py:75: error: Incompatible types in "yield" (actual type "B", expected type "A") [misc] +annotations_generators.py:86: error: The return type of a generator function should be "Generator" or one of its supertypes [misc] +annotations_generators.py:91: error: The return type of an async generator function should be "AsyncGenerator" or one of its supertypes [misc] +annotations_generators.py:118: error: Incompatible types in "yield from" (actual type "A", expected type "B") [misc] +annotations_generators.py:119: error: Incompatible types in "yield from" (actual type "int", expected type "B") [misc] +annotations_generators.py:135: error: Incompatible send types in yield from (actual type "int", expected type "str") [misc] """ diff --git a/conformance/results/zuban/annotations_methods.toml b/conformance/results/zuban/annotations_methods.toml index bd95236e4..bd2004812 100644 --- a/conformance/results/zuban/annotations_methods.toml +++ b/conformance/results/zuban/annotations_methods.toml @@ -2,5 +2,5 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -annotations_methods.py:42: error: Expression is of type "B", not "A" +annotations_methods.py:42: error: Expression is of type "B", not "A" [misc] """ diff --git a/conformance/results/zuban/annotations_typeexpr.toml b/conformance/results/zuban/annotations_typeexpr.toml index 3ac4eea14..dbd9f1b55 100644 --- a/conformance/results/zuban/annotations_typeexpr.toml +++ b/conformance/results/zuban/annotations_typeexpr.toml @@ -2,23 +2,23 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -annotations_typeexpr.py:88: error: Invalid type comment or annotation -annotations_typeexpr.py:89: error: Bracketed expression "[...]" is not valid as a type +annotations_typeexpr.py:88: error: Invalid type comment or annotation [valid-type] +annotations_typeexpr.py:89: error: Bracketed expression "[...]" is not valid as a type [valid-type] annotations_typeexpr.py:89: note: Did you mean "List[...]"? -annotations_typeexpr.py:90: error: Syntax error in type annotation +annotations_typeexpr.py:90: error: Syntax error in type annotation [valid-type] annotations_typeexpr.py:90: note: Suggestion: Use Tuple[T1, ..., Tn] instead of (T1, ..., Tn) -annotations_typeexpr.py:91: error: Invalid type comment or annotation -annotations_typeexpr.py:92: error: Invalid type comment or annotation -annotations_typeexpr.py:93: error: Invalid type comment or annotation -annotations_typeexpr.py:94: error: Invalid type comment or annotation -annotations_typeexpr.py:95: error: Invalid type comment or annotation -annotations_typeexpr.py:96: error: Variable "annotations_typeexpr.var1" is not valid as a type +annotations_typeexpr.py:91: error: Invalid type comment or annotation [valid-type] +annotations_typeexpr.py:92: error: Invalid type comment or annotation [valid-type] +annotations_typeexpr.py:93: error: Invalid type comment or annotation [valid-type] +annotations_typeexpr.py:94: error: Invalid type comment or annotation [valid-type] +annotations_typeexpr.py:95: error: Invalid type comment or annotation [valid-type] +annotations_typeexpr.py:96: error: Variable "annotations_typeexpr.var1" is not valid as a type [valid-type] annotations_typeexpr.py:96: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -annotations_typeexpr.py:97: error: Invalid type comment or annotation -annotations_typeexpr.py:98: error: Invalid type: try using Literal[1] instead? -annotations_typeexpr.py:99: error: Invalid type comment or annotation -annotations_typeexpr.py:100: error: Invalid type comment or annotation -annotations_typeexpr.py:101: error: Invalid type comment or annotation -annotations_typeexpr.py:102: error: Module "types" is not valid as a type +annotations_typeexpr.py:97: error: Invalid type comment or annotation [valid-type] +annotations_typeexpr.py:98: error: Invalid type: try using Literal[1] instead? [valid-type] +annotations_typeexpr.py:99: error: Invalid type comment or annotation [valid-type] +annotations_typeexpr.py:100: error: Invalid type comment or annotation [valid-type] +annotations_typeexpr.py:101: error: Invalid type comment or annotation [valid-type] +annotations_typeexpr.py:102: error: Module "types" is not valid as a type [valid-type] annotations_typeexpr.py:102: note: Perhaps you meant to use a protocol matching the module structure? """ diff --git a/conformance/results/zuban/callables_annotation.toml b/conformance/results/zuban/callables_annotation.toml index 5f7ccb0f9..c365d70fe 100644 --- a/conformance/results/zuban/callables_annotation.toml +++ b/conformance/results/zuban/callables_annotation.toml @@ -6,31 +6,31 @@ Does not treat "*args: Any, **kargs: Any" as "..." when separated by keyword par conformance_automated = "Fail" errors_diff = """ Line 159: Expected 1 errors -Line 157: Unexpected errors ['callables_annotation.py:157: error: Incompatible types in assignment (expression has type "Proto7", variable has type "Proto6")'] +Line 157: Unexpected errors ['callables_annotation.py:157: error: Incompatible types in assignment (expression has type "Proto7", variable has type "Proto6") [assignment]'] """ output = """ -callables_annotation.py:25: error: Too few arguments -callables_annotation.py:26: error: Argument 2 has incompatible type "int"; expected "str" -callables_annotation.py:27: error: Too many arguments -callables_annotation.py:29: error: Unexpected keyword argument "a" -callables_annotation.py:29: error: Unexpected keyword argument "b" -callables_annotation.py:35: error: Too many arguments -callables_annotation.py:55: error: Please use "Callable[[], ]" or "Callable" -callables_annotation.py:56: error: The first argument to Callable must be a list of types, parameter specification, or "..." +callables_annotation.py:25: error: Too few arguments [call-arg] +callables_annotation.py:26: error: Argument 2 has incompatible type "int"; expected "str" [arg-type] +callables_annotation.py:27: error: Too many arguments [call-arg] +callables_annotation.py:29: error: Unexpected keyword argument "a" [call-arg] +callables_annotation.py:29: error: Unexpected keyword argument "b" [call-arg] +callables_annotation.py:35: error: Too many arguments [call-arg] +callables_annotation.py:55: error: Please use "Callable[[], ]" or "Callable" [misc] +callables_annotation.py:56: error: The first argument to Callable must be a list of types, parameter specification, or "..." [misc] callables_annotation.py:56: note: See https://mypy.readthedocs.io/en/stable/kinds_of_types.html#callable-types-and-lambdas -callables_annotation.py:57: error: Bracketed expression "[...]" is not valid as a type +callables_annotation.py:57: error: Bracketed expression "[...]" is not valid as a type [valid-type] callables_annotation.py:57: note: Did you mean "List[...]"? -callables_annotation.py:58: error: Please use "Callable[[], ]" or "Callable" -callables_annotation.py:59: error: Unexpected "..." -callables_annotation.py:91: error: Incompatible types in assignment (expression has type "Callable[[], str]", variable has type "Callable[[int, VarArg(Any), KwArg(Any)], str]") -callables_annotation.py:93: error: Incompatible types in assignment (expression has type "Callable[[NamedArg(int, 'a')], str]", variable has type "Callable[[int, VarArg(Any), KwArg(Any)], str]") -callables_annotation.py:157: error: Incompatible types in assignment (expression has type "Proto7", variable has type "Proto6") +callables_annotation.py:58: error: Please use "Callable[[], ]" or "Callable" [misc] +callables_annotation.py:59: error: Unexpected "..." [valid-type] +callables_annotation.py:91: error: Incompatible types in assignment (expression has type "Callable[[], str]", variable has type "Callable[[int, VarArg(Any), KwArg(Any)], str]") [assignment] +callables_annotation.py:93: error: Incompatible types in assignment (expression has type "Callable[[NamedArg(int, 'a')], str]", variable has type "Callable[[int, VarArg(Any), KwArg(Any)], str]") [assignment] +callables_annotation.py:157: error: Incompatible types in assignment (expression has type "Proto7", variable has type "Proto6") [assignment] callables_annotation.py:157: note: Following member(s) of "Proto7" have conflicts: callables_annotation.py:157: note: Expected: callables_annotation.py:157: note: def __call__(self, int, /, *args: Any, k: str, **kwargs: Any) -> None callables_annotation.py:157: note: Got: callables_annotation.py:157: note: def __call__(self, float, /, b: int, *, k: str, m: str) -> None -callables_annotation.py:172: error: Incompatible types in assignment (expression has type "Callable[[], str]", variable has type "Callable[[int, VarArg(Any), KwArg(Any)], str]") -callables_annotation.py:187: error: Incompatible types in assignment (expression has type "Callable[[int, str], str]", variable has type "Callable[[str, VarArg(Any), KwArg(Any)], str]") -callables_annotation.py:189: error: Incompatible types in assignment (expression has type "Callable[[int, str], str]", variable has type "Callable[[str, VarArg(Any), KwArg(Any)], str]") +callables_annotation.py:172: error: Incompatible types in assignment (expression has type "Callable[[], str]", variable has type "Callable[[int, VarArg(Any), KwArg(Any)], str]") [assignment] +callables_annotation.py:187: error: Incompatible types in assignment (expression has type "Callable[[int, str], str]", variable has type "Callable[[str, VarArg(Any), KwArg(Any)], str]") [assignment] +callables_annotation.py:189: error: Incompatible types in assignment (expression has type "Callable[[int, str], str]", variable has type "Callable[[str, VarArg(Any), KwArg(Any)], str]") [assignment] """ diff --git a/conformance/results/zuban/callables_kwargs.toml b/conformance/results/zuban/callables_kwargs.toml index 4e3308105..f0549f1dc 100644 --- a/conformance/results/zuban/callables_kwargs.toml +++ b/conformance/results/zuban/callables_kwargs.toml @@ -2,22 +2,22 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -callables_kwargs.py:46: error: Missing named argument "v1" for "func1" -callables_kwargs.py:46: error: Missing named argument "v3" for "func1" -callables_kwargs.py:51: error: Unexpected keyword argument "v4" for "func1" -callables_kwargs.py:52: error: Too many positional arguments for "func1" -callables_kwargs.py:58: error: Argument 1 to "func1" has incompatible type "**dict[str, str]"; expected "int" -callables_kwargs.py:61: error: Argument 1 to "func1" has incompatible type "**dict[str, int | str]"; expected "int" -callables_kwargs.py:61: error: Argument 1 to "func1" has incompatible type "**dict[str, int | str]"; expected "str" -callables_kwargs.py:61: error: Argument 1 to "func1" has incompatible type "**dict[str, int | str]"; expected "str" -callables_kwargs.py:63: error: "func1" gets multiple values for keyword argument "v1" -callables_kwargs.py:64: error: Argument 1 to "func2" has incompatible type "int"; expected "str" -callables_kwargs.py:64: error: "func2" gets multiple values for keyword argument "v3" -callables_kwargs.py:65: error: "func2" gets multiple values for keyword argument "v1" -callables_kwargs.py:101: error: Incompatible types in assignment (expression has type "Callable[[**Unpack[TD2]], None]", variable has type "TDProtocol3") -callables_kwargs.py:102: error: Incompatible types in assignment (expression has type "Callable[[**Unpack[TD2]], None]", variable has type "TDProtocol4") -callables_kwargs.py:103: error: Incompatible types in assignment (expression has type "Callable[[**Unpack[TD2]], None]", variable has type "TDProtocol5") -callables_kwargs.py:111: error: Overlap between argument names and ** TypedDict items: "v1" -callables_kwargs.py:122: error: Unpack item in ** argument must be a TypedDict -callables_kwargs.py:134: error: Incompatible types in assignment (expression has type "Callable[[NamedArg(int, 'v1'), NamedArg(str, 'v3'), DefaultNamedArg(str, 'v2')], None]", variable has type "TDProtocol6") +callables_kwargs.py:46: error: Missing named argument "v1" for "func1" [call-arg] +callables_kwargs.py:46: error: Missing named argument "v3" for "func1" [call-arg] +callables_kwargs.py:51: error: Unexpected keyword argument "v4" for "func1" [call-arg] +callables_kwargs.py:52: error: Too many positional arguments for "func1" [call-arg] +callables_kwargs.py:58: error: Argument 1 to "func1" has incompatible type "**dict[str, str]"; expected "int" [arg-type] +callables_kwargs.py:61: error: Argument 1 to "func1" has incompatible type "**dict[str, int | str]"; expected "int" [arg-type] +callables_kwargs.py:61: error: Argument 1 to "func1" has incompatible type "**dict[str, int | str]"; expected "str" [arg-type] +callables_kwargs.py:61: error: Argument 1 to "func1" has incompatible type "**dict[str, int | str]"; expected "str" [arg-type] +callables_kwargs.py:63: error: "func1" gets multiple values for keyword argument "v1" [call-arg] +callables_kwargs.py:64: error: Argument 1 to "func2" has incompatible type "int"; expected "str" [arg-type] +callables_kwargs.py:64: error: "func2" gets multiple values for keyword argument "v3" [call-arg] +callables_kwargs.py:65: error: "func2" gets multiple values for keyword argument "v1" [call-arg] +callables_kwargs.py:101: error: Incompatible types in assignment (expression has type "Callable[[**Unpack[TD2]], None]", variable has type "TDProtocol3") [assignment] +callables_kwargs.py:102: error: Incompatible types in assignment (expression has type "Callable[[**Unpack[TD2]], None]", variable has type "TDProtocol4") [assignment] +callables_kwargs.py:103: error: Incompatible types in assignment (expression has type "Callable[[**Unpack[TD2]], None]", variable has type "TDProtocol5") [assignment] +callables_kwargs.py:111: error: Overlap between argument names and ** TypedDict items: "v1" [misc] +callables_kwargs.py:122: error: Unpack item in ** argument must be a TypedDict [misc] +callables_kwargs.py:134: error: Incompatible types in assignment (expression has type "Callable[[NamedArg(int, 'v1'), NamedArg(str, 'v3'), DefaultNamedArg(str, 'v2')], None]", variable has type "TDProtocol6") [assignment] """ diff --git a/conformance/results/zuban/callables_protocol.toml b/conformance/results/zuban/callables_protocol.toml index dad94dc56..c4aff31cc 100644 --- a/conformance/results/zuban/callables_protocol.toml +++ b/conformance/results/zuban/callables_protocol.toml @@ -2,23 +2,23 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -callables_protocol.py:35: error: Incompatible types in assignment (expression has type "Callable[[VarArg(bytes), NamedArg(int | None, 'max_items')], list[bytes]]", variable has type "Proto1") -callables_protocol.py:36: error: Incompatible types in assignment (expression has type "Callable[[VarArg(bytes)], list[bytes]]", variable has type "Proto1") -callables_protocol.py:37: error: Incompatible types in assignment (expression has type "Callable[[VarArg(bytes), NamedArg(str | None, 'max_len')], list[bytes]]", variable has type "Proto1") -callables_protocol.py:67: error: Incompatible types in assignment (expression has type "Callable[[VarArg(bytes)], None]", variable has type "Proto2") -callables_protocol.py:68: error: Incompatible types in assignment (expression has type "Callable[[VarArg(str), KwArg(str)], None]", variable has type "Proto2") -callables_protocol.py:69: error: Incompatible types in assignment (expression has type "Callable[[VarArg(bytes), KwArg(bytes)], None]", variable has type "Proto2") -callables_protocol.py:70: error: Incompatible types in assignment (expression has type "Callable[[KwArg(str)], None]", variable has type "Proto2") -callables_protocol.py:97: error: Incompatible types in assignment (expression has type "Callable[[int], None]", variable has type "Proto4") +callables_protocol.py:35: error: Incompatible types in assignment (expression has type "Callable[[VarArg(bytes), NamedArg(int | None, 'max_items')], list[bytes]]", variable has type "Proto1") [assignment] +callables_protocol.py:36: error: Incompatible types in assignment (expression has type "Callable[[VarArg(bytes)], list[bytes]]", variable has type "Proto1") [assignment] +callables_protocol.py:37: error: Incompatible types in assignment (expression has type "Callable[[VarArg(bytes), NamedArg(str | None, 'max_len')], list[bytes]]", variable has type "Proto1") [assignment] +callables_protocol.py:67: error: Incompatible types in assignment (expression has type "Callable[[VarArg(bytes)], None]", variable has type "Proto2") [assignment] +callables_protocol.py:68: error: Incompatible types in assignment (expression has type "Callable[[VarArg(str), KwArg(str)], None]", variable has type "Proto2") [assignment] +callables_protocol.py:69: error: Incompatible types in assignment (expression has type "Callable[[VarArg(bytes), KwArg(bytes)], None]", variable has type "Proto2") [assignment] +callables_protocol.py:70: error: Incompatible types in assignment (expression has type "Callable[[KwArg(str)], None]", variable has type "Proto2") [assignment] +callables_protocol.py:97: error: Incompatible types in assignment (expression has type "Callable[[int], None]", variable has type "Proto4") [assignment] callables_protocol.py:97: note: "Callable[[int], None]" is missing following "Proto4" protocol member: callables_protocol.py:97: note: other_attribute -callables_protocol.py:121: error: Incompatible types in assignment (expression has type "Callable[[VarArg(bytes), DefaultNamedArg(int | None, 'max_len')], list[bytes]]", variable has type "NotProto6") -callables_protocol.py:169: error: Incompatible types in assignment (expression has type "Callable[[int], Any]", variable has type "Proto8") -callables_protocol.py:186: error: Incompatible types in assignment (expression has type "str", variable has type "int") -callables_protocol.py:187: error: "Proto9[P, R]" has no attribute "xxx" -callables_protocol.py:197: error: "Proto9[[x: int], str]" has no attribute "other_attribute2" -callables_protocol.py:238: error: Incompatible types in assignment (expression has type "Callable[[int, str], Any]", variable has type "Proto11") -callables_protocol.py:260: error: Incompatible types in assignment (expression has type "Callable[[VarArg(Any), NamedArg(Any, 'kwarg0')], None]", variable has type "Proto12") -callables_protocol.py:284: error: Incompatible types in assignment (expression has type "Callable[[str], str]", variable has type "Proto13_Default") -callables_protocol.py:311: error: Incompatible types in assignment (expression has type "Callable[[NamedArg(str, 'path')], str]", variable has type "Proto14_Default") +callables_protocol.py:121: error: Incompatible types in assignment (expression has type "Callable[[VarArg(bytes), DefaultNamedArg(int | None, 'max_len')], list[bytes]]", variable has type "NotProto6") [assignment] +callables_protocol.py:169: error: Incompatible types in assignment (expression has type "Callable[[int], Any]", variable has type "Proto8") [assignment] +callables_protocol.py:186: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +callables_protocol.py:187: error: "Proto9[P, R]" has no attribute "xxx" [attr-defined] +callables_protocol.py:197: error: "Proto9[[x: int], str]" has no attribute "other_attribute2" [attr-defined] +callables_protocol.py:238: error: Incompatible types in assignment (expression has type "Callable[[int, str], Any]", variable has type "Proto11") [assignment] +callables_protocol.py:260: error: Incompatible types in assignment (expression has type "Callable[[VarArg(Any), NamedArg(Any, 'kwarg0')], None]", variable has type "Proto12") [assignment] +callables_protocol.py:284: error: Incompatible types in assignment (expression has type "Callable[[str], str]", variable has type "Proto13_Default") [assignment] +callables_protocol.py:311: error: Incompatible types in assignment (expression has type "Callable[[NamedArg(str, 'path')], str]", variable has type "Proto14_Default") [assignment] """ diff --git a/conformance/results/zuban/callables_subtyping.toml b/conformance/results/zuban/callables_subtyping.toml index ff4f95664..81e71c806 100644 --- a/conformance/results/zuban/callables_subtyping.toml +++ b/conformance/results/zuban/callables_subtyping.toml @@ -2,183 +2,183 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -callables_subtyping.py:26: error: Incompatible types in assignment (expression has type "Callable[[int], int]", variable has type "Callable[[float], float]") -callables_subtyping.py:29: error: Incompatible types in assignment (expression has type "Callable[[float], float]", variable has type "Callable[[int], int]") -callables_subtyping.py:51: error: Incompatible types in assignment (expression has type "PosOnly2", variable has type "Standard2") +callables_subtyping.py:26: error: Incompatible types in assignment (expression has type "Callable[[int], int]", variable has type "Callable[[float], float]") [assignment] +callables_subtyping.py:29: error: Incompatible types in assignment (expression has type "Callable[[float], float]", variable has type "Callable[[int], int]") [assignment] +callables_subtyping.py:51: error: Incompatible types in assignment (expression has type "PosOnly2", variable has type "Standard2") [assignment] callables_subtyping.py:51: note: Following member(s) of "PosOnly2" have conflicts: callables_subtyping.py:51: note: Expected: callables_subtyping.py:51: note: def __call__(self, a: int, b: int) -> None callables_subtyping.py:51: note: Got: callables_subtyping.py:51: note: def __call__(self, int, int, /) -> None -callables_subtyping.py:52: error: Incompatible types in assignment (expression has type "KwOnly2", variable has type "Standard2") +callables_subtyping.py:52: error: Incompatible types in assignment (expression has type "KwOnly2", variable has type "Standard2") [assignment] callables_subtyping.py:52: note: Following member(s) of "KwOnly2" have conflicts: callables_subtyping.py:52: note: Expected: callables_subtyping.py:52: note: def __call__(self, a: int, b: int) -> None callables_subtyping.py:52: note: Got: callables_subtyping.py:52: note: def __call__(self, *, b: int, a: int) -> None -callables_subtyping.py:55: error: Incompatible types in assignment (expression has type "KwOnly2", variable has type "PosOnly2") +callables_subtyping.py:55: error: Incompatible types in assignment (expression has type "KwOnly2", variable has type "PosOnly2") [assignment] callables_subtyping.py:55: note: Following member(s) of "KwOnly2" have conflicts: callables_subtyping.py:55: note: Expected: callables_subtyping.py:55: note: def __call__(self, int, int, /) -> None callables_subtyping.py:55: note: Got: callables_subtyping.py:55: note: def __call__(self, *, b: int, a: int) -> None -callables_subtyping.py:58: error: Incompatible types in assignment (expression has type "PosOnly2", variable has type "KwOnly2") +callables_subtyping.py:58: error: Incompatible types in assignment (expression has type "PosOnly2", variable has type "KwOnly2") [assignment] callables_subtyping.py:58: note: Following member(s) of "PosOnly2" have conflicts: callables_subtyping.py:58: note: Expected: callables_subtyping.py:58: note: def __call__(self, *, b: int, a: int) -> None callables_subtyping.py:58: note: Got: callables_subtyping.py:58: note: def __call__(self, int, int, /) -> None -callables_subtyping.py:82: error: Incompatible types in assignment (expression has type "NoArgs3", variable has type "IntArgs3") +callables_subtyping.py:82: error: Incompatible types in assignment (expression has type "NoArgs3", variable has type "IntArgs3") [assignment] callables_subtyping.py:82: note: Following member(s) of "NoArgs3" have conflicts: callables_subtyping.py:82: note: Expected: callables_subtyping.py:82: note: def __call__(self, *args: int) -> None callables_subtyping.py:82: note: Got: callables_subtyping.py:82: note: def __call__(self) -> None -callables_subtyping.py:85: error: Incompatible types in assignment (expression has type "NoArgs3", variable has type "FloatArgs3") +callables_subtyping.py:85: error: Incompatible types in assignment (expression has type "NoArgs3", variable has type "FloatArgs3") [assignment] callables_subtyping.py:85: note: Following member(s) of "NoArgs3" have conflicts: callables_subtyping.py:85: note: Expected: callables_subtyping.py:85: note: def __call__(self, *args: float) -> None callables_subtyping.py:85: note: Got: callables_subtyping.py:85: note: def __call__(self) -> None -callables_subtyping.py:86: error: Incompatible types in assignment (expression has type "IntArgs3", variable has type "FloatArgs3") +callables_subtyping.py:86: error: Incompatible types in assignment (expression has type "IntArgs3", variable has type "FloatArgs3") [assignment] callables_subtyping.py:86: note: Following member(s) of "IntArgs3" have conflicts: callables_subtyping.py:86: note: Expected: callables_subtyping.py:86: note: def __call__(self, *args: float) -> None callables_subtyping.py:86: note: Got: callables_subtyping.py:86: note: def __call__(self, *args: int) -> None -callables_subtyping.py:116: error: Incompatible types in assignment (expression has type "IntArgs4", variable has type "PosOnly4") +callables_subtyping.py:116: error: Incompatible types in assignment (expression has type "IntArgs4", variable has type "PosOnly4") [assignment] callables_subtyping.py:116: note: Following member(s) of "IntArgs4" have conflicts: callables_subtyping.py:116: note: Expected: callables_subtyping.py:116: note: def __call__(self, int, str, /) -> None callables_subtyping.py:116: note: Got: callables_subtyping.py:116: note: def __call__(self, *args: int) -> None -callables_subtyping.py:119: error: Incompatible types in assignment (expression has type "StrArgs4", variable has type "IntStrArgs4") +callables_subtyping.py:119: error: Incompatible types in assignment (expression has type "StrArgs4", variable has type "IntStrArgs4") [assignment] callables_subtyping.py:119: note: Following member(s) of "StrArgs4" have conflicts: callables_subtyping.py:119: note: Expected: callables_subtyping.py:119: note: def __call__(self, *args: int | str) -> None callables_subtyping.py:119: note: Got: callables_subtyping.py:119: note: def __call__(self, int, /, *args: str) -> None -callables_subtyping.py:120: error: Incompatible types in assignment (expression has type "IntArgs4", variable has type "IntStrArgs4") +callables_subtyping.py:120: error: Incompatible types in assignment (expression has type "IntArgs4", variable has type "IntStrArgs4") [assignment] callables_subtyping.py:120: note: Following member(s) of "IntArgs4" have conflicts: callables_subtyping.py:120: note: Expected: callables_subtyping.py:120: note: def __call__(self, *args: int | str) -> None callables_subtyping.py:120: note: Got: callables_subtyping.py:120: note: def __call__(self, *args: int) -> None -callables_subtyping.py:122: error: Incompatible types in assignment (expression has type "IntArgs4", variable has type "StrArgs4") +callables_subtyping.py:122: error: Incompatible types in assignment (expression has type "IntArgs4", variable has type "StrArgs4") [assignment] callables_subtyping.py:122: note: Following member(s) of "IntArgs4" have conflicts: callables_subtyping.py:122: note: Expected: callables_subtyping.py:122: note: def __call__(self, int, /, *args: str) -> None callables_subtyping.py:122: note: Got: callables_subtyping.py:122: note: def __call__(self, *args: int) -> None -callables_subtyping.py:124: error: Incompatible types in assignment (expression has type "StrArgs4", variable has type "IntArgs4") +callables_subtyping.py:124: error: Incompatible types in assignment (expression has type "StrArgs4", variable has type "IntArgs4") [assignment] callables_subtyping.py:124: note: Following member(s) of "StrArgs4" have conflicts: callables_subtyping.py:124: note: Expected: callables_subtyping.py:124: note: def __call__(self, *args: int) -> None callables_subtyping.py:124: note: Got: callables_subtyping.py:124: note: def __call__(self, int, /, *args: str) -> None -callables_subtyping.py:125: error: Incompatible types in assignment (expression has type "IntStrArgs4", variable has type "Standard4") +callables_subtyping.py:125: error: Incompatible types in assignment (expression has type "IntStrArgs4", variable has type "Standard4") [assignment] callables_subtyping.py:125: note: Following member(s) of "IntStrArgs4" have conflicts: callables_subtyping.py:125: note: Expected: callables_subtyping.py:125: note: def __call__(self, a: int, b: str) -> None callables_subtyping.py:125: note: Got: callables_subtyping.py:125: note: def __call__(self, *args: int | str) -> None -callables_subtyping.py:126: error: Incompatible types in assignment (expression has type "StrArgs4", variable has type "Standard4") +callables_subtyping.py:126: error: Incompatible types in assignment (expression has type "StrArgs4", variable has type "Standard4") [assignment] callables_subtyping.py:126: note: Following member(s) of "StrArgs4" have conflicts: callables_subtyping.py:126: note: Expected: callables_subtyping.py:126: note: def __call__(self, a: int, b: str) -> None callables_subtyping.py:126: note: Got: callables_subtyping.py:126: note: def __call__(self, int, /, *args: str) -> None -callables_subtyping.py:151: error: Incompatible types in assignment (expression has type "NoKwargs5", variable has type "IntKwargs5") +callables_subtyping.py:151: error: Incompatible types in assignment (expression has type "NoKwargs5", variable has type "IntKwargs5") [assignment] callables_subtyping.py:151: note: Following member(s) of "NoKwargs5" have conflicts: callables_subtyping.py:151: note: Expected: callables_subtyping.py:151: note: def __call__(self, **kwargs: int) -> None callables_subtyping.py:151: note: Got: callables_subtyping.py:151: note: def __call__(self) -> None -callables_subtyping.py:154: error: Incompatible types in assignment (expression has type "NoKwargs5", variable has type "FloatKwargs5") +callables_subtyping.py:154: error: Incompatible types in assignment (expression has type "NoKwargs5", variable has type "FloatKwargs5") [assignment] callables_subtyping.py:154: note: Following member(s) of "NoKwargs5" have conflicts: callables_subtyping.py:154: note: Expected: callables_subtyping.py:154: note: def __call__(self, **kwargs: float) -> None callables_subtyping.py:154: note: Got: callables_subtyping.py:154: note: def __call__(self) -> None -callables_subtyping.py:155: error: Incompatible types in assignment (expression has type "IntKwargs5", variable has type "FloatKwargs5") +callables_subtyping.py:155: error: Incompatible types in assignment (expression has type "IntKwargs5", variable has type "FloatKwargs5") [assignment] callables_subtyping.py:155: note: Following member(s) of "IntKwargs5" have conflicts: callables_subtyping.py:155: note: Expected: callables_subtyping.py:155: note: def __call__(self, **kwargs: float) -> None callables_subtyping.py:155: note: Got: callables_subtyping.py:155: note: def __call__(self, **kwargs: int) -> None -callables_subtyping.py:187: error: Incompatible types in assignment (expression has type "IntKwargs6", variable has type "KwOnly6") +callables_subtyping.py:187: error: Incompatible types in assignment (expression has type "IntKwargs6", variable has type "KwOnly6") [assignment] callables_subtyping.py:187: note: Following member(s) of "IntKwargs6" have conflicts: callables_subtyping.py:187: note: Expected: callables_subtyping.py:187: note: def __call__(self, *, a: int, b: str) -> None callables_subtyping.py:187: note: Got: callables_subtyping.py:187: note: def __call__(self, **kwargs: int) -> None -callables_subtyping.py:190: error: Incompatible types in assignment (expression has type "StrKwargs6", variable has type "IntStrKwargs6") +callables_subtyping.py:190: error: Incompatible types in assignment (expression has type "StrKwargs6", variable has type "IntStrKwargs6") [assignment] callables_subtyping.py:190: note: Following member(s) of "StrKwargs6" have conflicts: callables_subtyping.py:190: note: Expected: callables_subtyping.py:190: note: def __call__(self, **kwargs: int | str) -> None callables_subtyping.py:190: note: Got: callables_subtyping.py:190: note: def __call__(self, *, a: int, **kwargs: str) -> None -callables_subtyping.py:191: error: Incompatible types in assignment (expression has type "IntKwargs6", variable has type "IntStrKwargs6") +callables_subtyping.py:191: error: Incompatible types in assignment (expression has type "IntKwargs6", variable has type "IntStrKwargs6") [assignment] callables_subtyping.py:191: note: Following member(s) of "IntKwargs6" have conflicts: callables_subtyping.py:191: note: Expected: callables_subtyping.py:191: note: def __call__(self, **kwargs: int | str) -> None callables_subtyping.py:191: note: Got: callables_subtyping.py:191: note: def __call__(self, **kwargs: int) -> None -callables_subtyping.py:193: error: Incompatible types in assignment (expression has type "IntKwargs6", variable has type "StrKwargs6") +callables_subtyping.py:193: error: Incompatible types in assignment (expression has type "IntKwargs6", variable has type "StrKwargs6") [assignment] callables_subtyping.py:193: note: Following member(s) of "IntKwargs6" have conflicts: callables_subtyping.py:193: note: Expected: callables_subtyping.py:193: note: def __call__(self, *, a: int, **kwargs: str) -> None callables_subtyping.py:193: note: Got: callables_subtyping.py:193: note: def __call__(self, **kwargs: int) -> None -callables_subtyping.py:195: error: Incompatible types in assignment (expression has type "StrKwargs6", variable has type "IntKwargs6") +callables_subtyping.py:195: error: Incompatible types in assignment (expression has type "StrKwargs6", variable has type "IntKwargs6") [assignment] callables_subtyping.py:195: note: Following member(s) of "StrKwargs6" have conflicts: callables_subtyping.py:195: note: Expected: callables_subtyping.py:195: note: def __call__(self, **kwargs: int) -> None callables_subtyping.py:195: note: Got: callables_subtyping.py:195: note: def __call__(self, *, a: int, **kwargs: str) -> None -callables_subtyping.py:196: error: Incompatible types in assignment (expression has type "IntStrKwargs6", variable has type "Standard6") +callables_subtyping.py:196: error: Incompatible types in assignment (expression has type "IntStrKwargs6", variable has type "Standard6") [assignment] callables_subtyping.py:196: note: Following member(s) of "IntStrKwargs6" have conflicts: callables_subtyping.py:196: note: Expected: callables_subtyping.py:196: note: def __call__(self, a: int, b: str) -> None callables_subtyping.py:196: note: Got: callables_subtyping.py:196: note: def __call__(self, **kwargs: int | str) -> None -callables_subtyping.py:197: error: Incompatible types in assignment (expression has type "StrKwargs6", variable has type "Standard6") +callables_subtyping.py:197: error: Incompatible types in assignment (expression has type "StrKwargs6", variable has type "Standard6") [assignment] callables_subtyping.py:197: note: Following member(s) of "StrKwargs6" have conflicts: callables_subtyping.py:197: note: Expected: callables_subtyping.py:197: note: def __call__(self, a: int, b: str) -> None callables_subtyping.py:197: note: Got: callables_subtyping.py:197: note: def __call__(self, *, a: int, **kwargs: str) -> None -callables_subtyping.py:236: error: Incompatible types in assignment (expression has type "NoDefaultArg8", variable has type "DefaultArg8") +callables_subtyping.py:236: error: Incompatible types in assignment (expression has type "NoDefaultArg8", variable has type "DefaultArg8") [assignment] callables_subtyping.py:236: note: Following member(s) of "NoDefaultArg8" have conflicts: callables_subtyping.py:236: note: Expected: callables_subtyping.py:236: note: def __call__(self, x: int = ...) -> None callables_subtyping.py:236: note: Got: callables_subtyping.py:236: note: def __call__(self, x: int) -> None -callables_subtyping.py:237: error: Incompatible types in assignment (expression has type "NoX8", variable has type "DefaultArg8") +callables_subtyping.py:237: error: Incompatible types in assignment (expression has type "NoX8", variable has type "DefaultArg8") [assignment] callables_subtyping.py:237: note: Following member(s) of "NoX8" have conflicts: callables_subtyping.py:237: note: Expected: callables_subtyping.py:237: note: def __call__(self, x: int = ...) -> None callables_subtyping.py:237: note: Got: callables_subtyping.py:237: note: def __call__(self) -> None -callables_subtyping.py:240: error: Incompatible types in assignment (expression has type "NoX8", variable has type "NoDefaultArg8") +callables_subtyping.py:240: error: Incompatible types in assignment (expression has type "NoX8", variable has type "NoDefaultArg8") [assignment] callables_subtyping.py:240: note: Following member(s) of "NoX8" have conflicts: callables_subtyping.py:240: note: Expected: callables_subtyping.py:240: note: def __call__(self, x: int) -> None callables_subtyping.py:240: note: Got: callables_subtyping.py:240: note: def __call__(self) -> None -callables_subtyping.py:243: error: Incompatible types in assignment (expression has type "NoDefaultArg8", variable has type "NoX8") +callables_subtyping.py:243: error: Incompatible types in assignment (expression has type "NoDefaultArg8", variable has type "NoX8") [assignment] callables_subtyping.py:243: note: Following member(s) of "NoDefaultArg8" have conflicts: callables_subtyping.py:243: note: Expected: callables_subtyping.py:243: note: def __call__(self) -> None callables_subtyping.py:243: note: Got: callables_subtyping.py:243: note: def __call__(self, x: int) -> None -callables_subtyping.py:273: error: Incompatible types in assignment (expression has type "Overloaded9", variable has type "FloatArg9") +callables_subtyping.py:273: error: Incompatible types in assignment (expression has type "Overloaded9", variable has type "FloatArg9") [assignment] callables_subtyping.py:273: note: Following member(s) of "Overloaded9" have conflicts: callables_subtyping.py:273: note: Expected: callables_subtyping.py:273: note: def __call__(self: FloatArg9, x: float) -> float callables_subtyping.py:273: note: Got: callables_subtyping.py:273: note: def __call__(*args: Any, **kwds: Any) -> Any -callables_subtyping.py:297: error: Incompatible types in assignment (expression has type "StrArg10", variable has type "Overloaded10") +callables_subtyping.py:297: error: Incompatible types in assignment (expression has type "StrArg10", variable has type "Overloaded10") [assignment] callables_subtyping.py:297: note: Following member(s) of "StrArg10" have conflicts: callables_subtyping.py:297: note: Expected: callables_subtyping.py:297: note: def __call__(*args: Any, **kwds: Any) -> Any diff --git a/conformance/results/zuban/classes_classvar.toml b/conformance/results/zuban/classes_classvar.toml index 88e7b0a93..47ee309f5 100644 --- a/conformance/results/zuban/classes_classvar.toml +++ b/conformance/results/zuban/classes_classvar.toml @@ -2,24 +2,24 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -classes_classvar.py:38: error: ClassVar[...] must have at most one type argument -classes_classvar.py:39: error: Invalid type: try using Literal[3] instead? -classes_classvar.py:40: error: Name "var" is not defined -classes_classvar.py:45: error: ClassVar cannot contain type variables -classes_classvar.py:46: error: ClassVar cannot contain type variables -classes_classvar.py:47: error: ClassVar cannot contain type variables -classes_classvar.py:52: error: Incompatible types in assignment (expression has type "dict[Never, Never]", variable has type "list[str]") -classes_classvar.py:54: error: Variable should not be annotated with both ClassVar and Final -classes_classvar.py:55: error: Invalid Type: ClassVar nested inside other type -classes_classvar.py:66: error: Type in ClassVar[...] can only be omitted if there is an initializer -classes_classvar.py:69: error: ClassVar can only be used for assignments in class body -classes_classvar.py:70: error: ClassVar can only be used for assignments in class body -classes_classvar.py:71: error: ClassVar can only be used for assignments in class body -classes_classvar.py:73: error: ClassVar can only be used for assignments in class body -classes_classvar.py:77: error: ClassVar can only be used for assignments in class body -classes_classvar.py:78: error: ClassVar can only be used for assignments in class body -classes_classvar.py:111: error: Cannot assign to class variable "stats" via instance -classes_classvar.py:140: error: Incompatible types in assignment (expression has type "ProtoAImpl", variable has type "ProtoA") +classes_classvar.py:38: error: ClassVar[...] must have at most one type argument [misc] +classes_classvar.py:39: error: Invalid type: try using Literal[3] instead? [valid-type] +classes_classvar.py:40: error: Name "var" is not defined [name-defined] +classes_classvar.py:45: error: ClassVar cannot contain type variables [misc] +classes_classvar.py:46: error: ClassVar cannot contain type variables [misc] +classes_classvar.py:47: error: ClassVar cannot contain type variables [misc] +classes_classvar.py:52: error: Incompatible types in assignment (expression has type "dict[Never, Never]", variable has type "list[str]") [assignment] +classes_classvar.py:54: error: Variable should not be annotated with both ClassVar and Final [misc] +classes_classvar.py:55: error: Invalid Type: ClassVar nested inside other type [misc] +classes_classvar.py:66: error: Type in ClassVar[...] can only be omitted if there is an initializer [misc] +classes_classvar.py:69: error: ClassVar can only be used for assignments in class body [misc] +classes_classvar.py:70: error: ClassVar can only be used for assignments in class body [misc] +classes_classvar.py:71: error: ClassVar can only be used for assignments in class body [misc] +classes_classvar.py:73: error: ClassVar can only be used for assignments in class body [misc] +classes_classvar.py:77: error: ClassVar can only be used for assignments in class body [misc] +classes_classvar.py:78: error: ClassVar can only be used for assignments in class body [misc] +classes_classvar.py:111: error: Cannot assign to class variable "stats" via instance [misc] +classes_classvar.py:140: error: Incompatible types in assignment (expression has type "ProtoAImpl", variable has type "ProtoA") [assignment] classes_classvar.py:140: note: Protocol member ProtoA.x expected class variable, got instance variable classes_classvar.py:140: note: Protocol member ProtoA.y expected class variable, got instance variable classes_classvar.py:140: note: "ProtoAImpl" is missing following "ProtoA" protocol member: diff --git a/conformance/results/zuban/classes_override.toml b/conformance/results/zuban/classes_override.toml index cd420c0b1..6bc2112ca 100644 --- a/conformance/results/zuban/classes_override.toml +++ b/conformance/results/zuban/classes_override.toml @@ -2,9 +2,9 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -classes_override.py:53: error: Method "method3" is marked as an override, but no base method was found with this name -classes_override.py:56: error: Method "method4" is marked as an override, but no base method was found with this name -classes_override.py:79: error: Method "static_method1" is marked as an override, but no base method was found with this name -classes_override.py:84: error: Method "class_method1" is marked as an override, but no base method was found with this name -classes_override.py:89: error: Method "property1" is marked as an override, but no base method was found with this name +classes_override.py:53: error: Method "method3" is marked as an override, but no base method was found with this name [misc] +classes_override.py:56: error: Method "method4" is marked as an override, but no base method was found with this name [misc] +classes_override.py:79: error: Method "static_method1" is marked as an override, but no base method was found with this name [misc] +classes_override.py:84: error: Method "class_method1" is marked as an override, but no base method was found with this name [misc] +classes_override.py:89: error: Method "property1" is marked as an override, but no base method was found with this name [misc] """ diff --git a/conformance/results/zuban/constructors_call_init.toml b/conformance/results/zuban/constructors_call_init.toml index 1f5db5904..e488f058e 100644 --- a/conformance/results/zuban/constructors_call_init.toml +++ b/conformance/results/zuban/constructors_call_init.toml @@ -9,7 +9,7 @@ Line 56: Expected 1 errors Line 107: Expected 1 errors """ output = """ -constructors_call_init.py:21: error: Argument 1 to "Class1" has incompatible type "float"; expected "int" -constructors_call_init.py:42: error: Argument 1 to "Class3" has incompatible type "Class2[Never]"; expected "Self | None" -constructors_call_init.py:130: error: Too many arguments for "Class11" +constructors_call_init.py:21: error: Argument 1 to "Class1" has incompatible type "float"; expected "int" [arg-type] +constructors_call_init.py:42: error: Argument 1 to "Class3" has incompatible type "Class2[Never]"; expected "Self | None" [arg-type] +constructors_call_init.py:130: error: Too many arguments for "Class11" [call-arg] """ diff --git a/conformance/results/zuban/constructors_call_metaclass.toml b/conformance/results/zuban/constructors_call_metaclass.toml index 87caf96ab..c15a19e3e 100644 --- a/conformance/results/zuban/constructors_call_metaclass.toml +++ b/conformance/results/zuban/constructors_call_metaclass.toml @@ -5,14 +5,14 @@ Does not skip evaluation of __new__ and __init__ if custom metaclass call return """ conformance_automated = "Fail" errors_diff = """ -Line 23: Unexpected errors ['constructors_call_metaclass.py:23: error: Expression is of type "Class1", not "Never"', 'constructors_call_metaclass.py:23: error: Missing positional argument "x" in call to "Class1"'] -Line 36: Unexpected errors ['constructors_call_metaclass.py:36: error: Expression is of type "Class2", not "int | Meta2"', 'constructors_call_metaclass.py:36: error: Missing positional argument "x" in call to "Class2"'] +Line 23: Unexpected errors ['constructors_call_metaclass.py:23: error: Expression is of type "Class1", not "Never" [misc]', 'constructors_call_metaclass.py:23: error: Missing positional argument "x" in call to "Class1" [call-arg]'] +Line 36: Unexpected errors ['constructors_call_metaclass.py:36: error: Expression is of type "Class2", not "int | Meta2" [misc]', 'constructors_call_metaclass.py:36: error: Missing positional argument "x" in call to "Class2" [call-arg]'] """ output = """ -constructors_call_metaclass.py:23: error: Expression is of type "Class1", not "Never" -constructors_call_metaclass.py:23: error: Missing positional argument "x" in call to "Class1" -constructors_call_metaclass.py:36: error: Expression is of type "Class2", not "int | Meta2" -constructors_call_metaclass.py:36: error: Missing positional argument "x" in call to "Class2" -constructors_call_metaclass.py:51: error: Missing positional argument "x" in call to "Class3" -constructors_call_metaclass.py:65: error: Missing positional argument "x" in call to "Class4" +constructors_call_metaclass.py:23: error: Expression is of type "Class1", not "Never" [misc] +constructors_call_metaclass.py:23: error: Missing positional argument "x" in call to "Class1" [call-arg] +constructors_call_metaclass.py:36: error: Expression is of type "Class2", not "int | Meta2" [misc] +constructors_call_metaclass.py:36: error: Missing positional argument "x" in call to "Class2" [call-arg] +constructors_call_metaclass.py:51: error: Missing positional argument "x" in call to "Class3" [call-arg] +constructors_call_metaclass.py:65: error: Missing positional argument "x" in call to "Class4" [call-arg] """ diff --git a/conformance/results/zuban/constructors_call_new.toml b/conformance/results/zuban/constructors_call_new.toml index 22f9a6d9a..3c94ad4ec 100644 --- a/conformance/results/zuban/constructors_call_new.toml +++ b/conformance/results/zuban/constructors_call_new.toml @@ -7,25 +7,25 @@ Does not report errors during binding to cls parameter of __new__ method. conformance_automated = "Fail" errors_diff = """ Line 145: Expected 1 errors -Line 40: Unexpected errors ['constructors_call_new.py:40: error: Incompatible return type for "__new__" (returns "int", but must return a subtype of "Class3")'] -Line 49: Unexpected errors ['constructors_call_new.py:49: error: Expression is of type "Class3", not "int"', 'constructors_call_new.py:49: error: Missing positional argument "x" in call to "Class3"'] -Line 57: Unexpected errors ['constructors_call_new.py:57: error: "__new__" must return a class instance (got "Class4 | Any")'] -Line 64: Unexpected errors ['constructors_call_new.py:64: error: Expression is of type "Class4", not "Class4 | Any"', 'constructors_call_new.py:64: error: Missing positional argument "x" in call to "Class4"'] -Line 76: Unexpected errors ['constructors_call_new.py:76: error: Expression is of type "Class5", not "Never"', 'constructors_call_new.py:76: error: Missing positional argument "x" in call to "Class5"'] -Line 82: Unexpected errors ['constructors_call_new.py:82: error: "__new__" must return a class instance (got "int | Class6")'] -Line 89: Unexpected errors ['constructors_call_new.py:89: error: Expression is of type "Class6", not "int | Class6"', 'constructors_call_new.py:89: error: Missing positional argument "x" in call to "Class6"'] +Line 40: Unexpected errors ['constructors_call_new.py:40: error: Incompatible return type for "__new__" (returns "int", but must return a subtype of "Class3") [misc]'] +Line 49: Unexpected errors ['constructors_call_new.py:49: error: Expression is of type "Class3", not "int" [misc]', 'constructors_call_new.py:49: error: Missing positional argument "x" in call to "Class3" [call-arg]'] +Line 57: Unexpected errors ['constructors_call_new.py:57: error: "__new__" must return a class instance (got "Class4 | Any") [misc]'] +Line 64: Unexpected errors ['constructors_call_new.py:64: error: Expression is of type "Class4", not "Class4 | Any" [misc]', 'constructors_call_new.py:64: error: Missing positional argument "x" in call to "Class4" [call-arg]'] +Line 76: Unexpected errors ['constructors_call_new.py:76: error: Expression is of type "Class5", not "Never" [misc]', 'constructors_call_new.py:76: error: Missing positional argument "x" in call to "Class5" [call-arg]'] +Line 82: Unexpected errors ['constructors_call_new.py:82: error: "__new__" must return a class instance (got "int | Class6") [misc]'] +Line 89: Unexpected errors ['constructors_call_new.py:89: error: Expression is of type "Class6", not "int | Class6" [misc]', 'constructors_call_new.py:89: error: Missing positional argument "x" in call to "Class6" [call-arg]'] """ output = """ -constructors_call_new.py:21: error: Argument 1 to "Class1" has incompatible type "float"; expected "int" -constructors_call_new.py:40: error: Incompatible return type for "__new__" (returns "int", but must return a subtype of "Class3") -constructors_call_new.py:49: error: Expression is of type "Class3", not "int" -constructors_call_new.py:49: error: Missing positional argument "x" in call to "Class3" -constructors_call_new.py:57: error: "__new__" must return a class instance (got "Class4 | Any") -constructors_call_new.py:64: error: Expression is of type "Class4", not "Class4 | Any" -constructors_call_new.py:64: error: Missing positional argument "x" in call to "Class4" -constructors_call_new.py:76: error: Expression is of type "Class5", not "Never" -constructors_call_new.py:76: error: Missing positional argument "x" in call to "Class5" -constructors_call_new.py:82: error: "__new__" must return a class instance (got "int | Class6") -constructors_call_new.py:89: error: Expression is of type "Class6", not "int | Class6" -constructors_call_new.py:89: error: Missing positional argument "x" in call to "Class6" +constructors_call_new.py:21: error: Argument 1 to "Class1" has incompatible type "float"; expected "int" [arg-type] +constructors_call_new.py:40: error: Incompatible return type for "__new__" (returns "int", but must return a subtype of "Class3") [misc] +constructors_call_new.py:49: error: Expression is of type "Class3", not "int" [misc] +constructors_call_new.py:49: error: Missing positional argument "x" in call to "Class3" [call-arg] +constructors_call_new.py:57: error: "__new__" must return a class instance (got "Class4 | Any") [misc] +constructors_call_new.py:64: error: Expression is of type "Class4", not "Class4 | Any" [misc] +constructors_call_new.py:64: error: Missing positional argument "x" in call to "Class4" [call-arg] +constructors_call_new.py:76: error: Expression is of type "Class5", not "Never" [misc] +constructors_call_new.py:76: error: Missing positional argument "x" in call to "Class5" [call-arg] +constructors_call_new.py:82: error: "__new__" must return a class instance (got "int | Class6") [misc] +constructors_call_new.py:89: error: Expression is of type "Class6", not "int | Class6" [misc] +constructors_call_new.py:89: error: Missing positional argument "x" in call to "Class6" [call-arg] """ diff --git a/conformance/results/zuban/constructors_call_type.toml b/conformance/results/zuban/constructors_call_type.toml index 27868a835..7ba573760 100644 --- a/conformance/results/zuban/constructors_call_type.toml +++ b/conformance/results/zuban/constructors_call_type.toml @@ -8,10 +8,10 @@ Line 30: Expected 1 errors Line 72: Expected 1 errors """ output = """ -constructors_call_type.py:40: error: Missing positional arguments "x", "y" in call to "Class2" -constructors_call_type.py:50: error: Missing positional arguments "x", "y" in call to "Class3" -constructors_call_type.py:59: error: Too many arguments for "Class4" -constructors_call_type.py:64: error: Too many arguments for "object" -constructors_call_type.py:81: error: Missing positional argument "y" in call to "Class2" -constructors_call_type.py:82: error: Argument 2 to "Class2" has incompatible type "int"; expected "str" +constructors_call_type.py:40: error: Missing positional arguments "x", "y" in call to "Class2" [call-arg] +constructors_call_type.py:50: error: Missing positional arguments "x", "y" in call to "Class3" [call-arg] +constructors_call_type.py:59: error: Too many arguments for "Class4" [call-arg] +constructors_call_type.py:64: error: Too many arguments for "object" [call-arg] +constructors_call_type.py:81: error: Missing positional argument "y" in call to "Class2" [call-arg] +constructors_call_type.py:82: error: Argument 2 to "Class2" has incompatible type "int"; expected "str" [arg-type] """ diff --git a/conformance/results/zuban/constructors_callable.toml b/conformance/results/zuban/constructors_callable.toml index 2bbc76b36..98e51560e 100644 --- a/conformance/results/zuban/constructors_callable.toml +++ b/conformance/results/zuban/constructors_callable.toml @@ -9,51 +9,51 @@ conformance_automated = "Fail" errors_diff = """ Line 127: Expected 1 errors Line 144: Expected 1 errors -Line 73: Unexpected errors ['constructors_callable.py:73: error: Incompatible return type for "__new__" (returns "int", but must return a subtype of "Class4")'] -Line 100: Unexpected errors ['constructors_callable.py:100: error: Expression is of type "Class5", not "Never"'] -Line 105: Unexpected errors ['constructors_callable.py:105: error: Expression is of type "Class5", not "Never"'] -Line 116: Unexpected errors ['constructors_callable.py:116: error: Incompatible return type for "__new__" (returns "Class6Proxy", but must return a subtype of "Class6")'] -Line 126: Unexpected errors ['constructors_callable.py:126: error: Expression is of type "Class6", not "Class6Proxy"', 'constructors_callable.py:126: error: Missing positional argument "x" in call'] -Line 143: Unexpected errors ['constructors_callable.py:143: error: Expression is of type "Class6Any", not "Any"', 'constructors_callable.py:143: error: Missing positional argument "x" in call'] -Line 160: Unexpected errors ['constructors_callable.py:160: error: Need type annotation for "r7"'] -Line 164: Unexpected errors ['constructors_callable.py:164: error: Expression is of type "Class7[Any]", not "Class7[int]"'] -Line 165: Unexpected errors ['constructors_callable.py:165: error: Expression is of type "Class7[Any]", not "Class7[str]"', 'constructors_callable.py:165: error: Argument 1 has incompatible type "str"; expected "int"'] -Line 194: Unexpected errors ['constructors_callable.py:194: error: List item 0 has incompatible type "str"; expected "T"', 'constructors_callable.py:194: error: List item 0 has incompatible type "str"; expected "T"'] +Line 73: Unexpected errors ['constructors_callable.py:73: error: Incompatible return type for "__new__" (returns "int", but must return a subtype of "Class4") [misc]'] +Line 100: Unexpected errors ['constructors_callable.py:100: error: Expression is of type "Class5", not "Never" [misc]'] +Line 105: Unexpected errors ['constructors_callable.py:105: error: Expression is of type "Class5", not "Never" [misc]'] +Line 116: Unexpected errors ['constructors_callable.py:116: error: Incompatible return type for "__new__" (returns "Class6Proxy", but must return a subtype of "Class6") [misc]'] +Line 126: Unexpected errors ['constructors_callable.py:126: error: Expression is of type "Class6", not "Class6Proxy" [misc]', 'constructors_callable.py:126: error: Missing positional argument "x" in call [call-arg]'] +Line 143: Unexpected errors ['constructors_callable.py:143: error: Expression is of type "Class6Any", not "Any" [misc]', 'constructors_callable.py:143: error: Missing positional argument "x" in call [call-arg]'] +Line 160: Unexpected errors ['constructors_callable.py:160: error: Need type annotation for "r7" [var-annotated]'] +Line 164: Unexpected errors ['constructors_callable.py:164: error: Expression is of type "Class7[Any]", not "Class7[int]" [misc]'] +Line 165: Unexpected errors ['constructors_callable.py:165: error: Expression is of type "Class7[Any]", not "Class7[str]" [misc]', 'constructors_callable.py:165: error: Argument 1 has incompatible type "str"; expected "int" [arg-type]'] +Line 194: Unexpected errors ['constructors_callable.py:194: error: List item 0 has incompatible type "str"; expected "T" [list-item]', 'constructors_callable.py:194: error: List item 0 has incompatible type "str"; expected "T" [list-item]'] """ output = """ constructors_callable.py:36: note: Revealed type is "def (x: builtins.int) -> constructors_callable.Class1" -constructors_callable.py:38: error: Missing positional argument "x" in call -constructors_callable.py:39: error: Unexpected keyword argument "y" +constructors_callable.py:38: error: Missing positional argument "x" in call [call-arg] +constructors_callable.py:39: error: Unexpected keyword argument "y" [call-arg] constructors_callable.py:49: note: Revealed type is "def () -> constructors_callable.Class2" -constructors_callable.py:51: error: Too many arguments +constructors_callable.py:51: error: Too many arguments [call-arg] constructors_callable.py:63: note: Revealed type is "def (x: builtins.int) -> constructors_callable.Class3" -constructors_callable.py:65: error: Missing positional argument "x" in call -constructors_callable.py:66: error: Unexpected keyword argument "y" -constructors_callable.py:67: error: Too many arguments -constructors_callable.py:73: error: Incompatible return type for "__new__" (returns "int", but must return a subtype of "Class4") +constructors_callable.py:65: error: Missing positional argument "x" in call [call-arg] +constructors_callable.py:66: error: Unexpected keyword argument "y" [call-arg] +constructors_callable.py:67: error: Too many arguments [call-arg] +constructors_callable.py:73: error: Incompatible return type for "__new__" (returns "int", but must return a subtype of "Class4") [misc] constructors_callable.py:77: note: Revealed type is "def (x: builtins.int) -> builtins.int" -constructors_callable.py:79: error: Missing positional argument "x" in call -constructors_callable.py:80: error: Unexpected keyword argument "y" +constructors_callable.py:79: error: Missing positional argument "x" in call [call-arg] +constructors_callable.py:80: error: Unexpected keyword argument "y" [call-arg] constructors_callable.py:97: note: Revealed type is "def (*args: Any, **kwargs: Any) -> constructors_callable.Class5" -constructors_callable.py:100: error: Expression is of type "Class5", not "Never" -constructors_callable.py:105: error: Expression is of type "Class5", not "Never" -constructors_callable.py:116: error: Incompatible return type for "__new__" (returns "Class6Proxy", but must return a subtype of "Class6") +constructors_callable.py:100: error: Expression is of type "Class5", not "Never" [misc] +constructors_callable.py:105: error: Expression is of type "Class5", not "Never" [misc] +constructors_callable.py:116: error: Incompatible return type for "__new__" (returns "Class6Proxy", but must return a subtype of "Class6") [misc] constructors_callable.py:125: note: Revealed type is "def (x: builtins.int) -> constructors_callable.Class6" -constructors_callable.py:126: error: Expression is of type "Class6", not "Class6Proxy" -constructors_callable.py:126: error: Missing positional argument "x" in call +constructors_callable.py:126: error: Expression is of type "Class6", not "Class6Proxy" [misc] +constructors_callable.py:126: error: Missing positional argument "x" in call [call-arg] constructors_callable.py:142: note: Revealed type is "def (x: builtins.int) -> constructors_callable.Class6Any" -constructors_callable.py:143: error: Expression is of type "Class6Any", not "Any" -constructors_callable.py:143: error: Missing positional argument "x" in call -constructors_callable.py:160: error: Need type annotation for "r7" +constructors_callable.py:143: error: Expression is of type "Class6Any", not "Any" [misc] +constructors_callable.py:143: error: Missing positional argument "x" in call [call-arg] +constructors_callable.py:160: error: Need type annotation for "r7" [var-annotated] constructors_callable.py:162: note: Revealed type is "def (x: builtins.int) -> constructors_callable.Class7[Any]" -constructors_callable.py:164: error: Expression is of type "Class7[Any]", not "Class7[int]" -constructors_callable.py:165: error: Expression is of type "Class7[Any]", not "Class7[str]" -constructors_callable.py:165: error: Argument 1 has incompatible type "str"; expected "int" +constructors_callable.py:164: error: Expression is of type "Class7[Any]", not "Class7[int]" [misc] +constructors_callable.py:165: error: Expression is of type "Class7[Any]", not "Class7[str]" [misc] +constructors_callable.py:165: error: Argument 1 has incompatible type "str"; expected "int" [arg-type] constructors_callable.py:182: note: Revealed type is "def [T] (x: builtins.list[T], y: builtins.list[T]) -> constructors_callable.Class8[T]" -constructors_callable.py:184: error: List item 0 has incompatible type "str"; expected "int" +constructors_callable.py:184: error: List item 0 has incompatible type "str"; expected "int" [list-item] constructors_callable.py:193: note: Revealed type is "def (x: builtins.list[T], y: builtins.list[T]) -> constructors_callable.Class9" -constructors_callable.py:194: error: List item 0 has incompatible type "str"; expected "T" -constructors_callable.py:194: error: List item 0 has incompatible type "str"; expected "T" -constructors_callable.py:195: error: List item 0 has incompatible type "int"; expected "T" -constructors_callable.py:195: error: List item 0 has incompatible type "str"; expected "T" +constructors_callable.py:194: error: List item 0 has incompatible type "str"; expected "T" [list-item] +constructors_callable.py:194: error: List item 0 has incompatible type "str"; expected "T" [list-item] +constructors_callable.py:195: error: List item 0 has incompatible type "int"; expected "T" [list-item] +constructors_callable.py:195: error: List item 0 has incompatible type "str"; expected "T" [list-item] """ diff --git a/conformance/results/zuban/dataclasses_final.toml b/conformance/results/zuban/dataclasses_final.toml index 637d07db2..bbe33fd0d 100644 --- a/conformance/results/zuban/dataclasses_final.toml +++ b/conformance/results/zuban/dataclasses_final.toml @@ -6,16 +6,16 @@ Doesn't support Final nested inside ClassVar. conformance_automated = "Fail" errors_diff = """ Line 27: Expected 1 errors -Line 16: Unexpected errors ['dataclasses_final.py:16: error: Final name must be initialized with a value'] -Line 18: Unexpected errors ['dataclasses_final.py:18: error: Final can be only used as an outermost qualifier in a variable annotation'] -Line 24: Unexpected errors ['dataclasses_final.py:24: error: Expression is of type "Any", not "int"'] +Line 16: Unexpected errors ['dataclasses_final.py:16: error: Final name must be initialized with a value [misc]'] +Line 18: Unexpected errors ['dataclasses_final.py:18: error: Final can be only used as an outermost qualifier in a variable annotation [misc]'] +Line 24: Unexpected errors ['dataclasses_final.py:24: error: Expression is of type "Any", not "int" [misc]'] """ output = """ -dataclasses_final.py:16: error: Final name must be initialized with a value -dataclasses_final.py:18: error: Final can be only used as an outermost qualifier in a variable annotation -dataclasses_final.py:24: error: Expression is of type "Any", not "int" -dataclasses_final.py:35: error: Cannot assign to final attribute "final_no_default" -dataclasses_final.py:36: error: Cannot assign to final attribute "final_with_default" -dataclasses_final.py:37: error: Cannot assign to final attribute "final_no_default" -dataclasses_final.py:38: error: Cannot assign to final attribute "final_with_default" +dataclasses_final.py:16: error: Final name must be initialized with a value [misc] +dataclasses_final.py:18: error: Final can be only used as an outermost qualifier in a variable annotation [misc] +dataclasses_final.py:24: error: Expression is of type "Any", not "int" [misc] +dataclasses_final.py:35: error: Cannot assign to final attribute "final_no_default" [misc] +dataclasses_final.py:36: error: Cannot assign to final attribute "final_with_default" [misc] +dataclasses_final.py:37: error: Cannot assign to final attribute "final_no_default" [misc] +dataclasses_final.py:38: error: Cannot assign to final attribute "final_with_default" [misc] """ diff --git a/conformance/results/zuban/dataclasses_frozen.toml b/conformance/results/zuban/dataclasses_frozen.toml index bd41573c9..81262e632 100644 --- a/conformance/results/zuban/dataclasses_frozen.toml +++ b/conformance/results/zuban/dataclasses_frozen.toml @@ -2,8 +2,8 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -dataclasses_frozen.py:16: error: Property "a" defined in "DC1" is read-only -dataclasses_frozen.py:17: error: Property "b" defined in "DC1" is read-only -dataclasses_frozen.py:23: error: Non-frozen dataclass cannot inherit from a frozen dataclass -dataclasses_frozen.py:33: error: Frozen dataclass cannot inherit from a non-frozen dataclass +dataclasses_frozen.py:16: error: Property "a" defined in "DC1" is read-only [misc] +dataclasses_frozen.py:17: error: Property "b" defined in "DC1" is read-only [misc] +dataclasses_frozen.py:23: error: Non-frozen dataclass cannot inherit from a frozen dataclass [misc] +dataclasses_frozen.py:33: error: Frozen dataclass cannot inherit from a non-frozen dataclass [misc] """ diff --git a/conformance/results/zuban/dataclasses_inheritance.toml b/conformance/results/zuban/dataclasses_inheritance.toml index 8ca154124..3baad3e38 100644 --- a/conformance/results/zuban/dataclasses_inheritance.toml +++ b/conformance/results/zuban/dataclasses_inheritance.toml @@ -2,6 +2,6 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -dataclasses_inheritance.py:62: error: Cannot override instance variable (previously declared on base class "DC6") with class variable -dataclasses_inheritance.py:66: error: Cannot override class variable (previously declared on base class "DC6") with instance variable +dataclasses_inheritance.py:62: error: Cannot override instance variable (previously declared on base class "DC6") with class variable [misc] +dataclasses_inheritance.py:66: error: Cannot override class variable (previously declared on base class "DC6") with instance variable [misc] """ diff --git a/conformance/results/zuban/dataclasses_kwonly.toml b/conformance/results/zuban/dataclasses_kwonly.toml index 9037fe428..88c32379f 100644 --- a/conformance/results/zuban/dataclasses_kwonly.toml +++ b/conformance/results/zuban/dataclasses_kwonly.toml @@ -2,7 +2,7 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -dataclasses_kwonly.py:23: error: Too many positional arguments for "DC1" -dataclasses_kwonly.py:38: error: Too many positional arguments for "DC2" -dataclasses_kwonly.py:53: error: Too many positional arguments for "DC3" +dataclasses_kwonly.py:23: error: Too many positional arguments for "DC1" [call-arg] +dataclasses_kwonly.py:38: error: Too many positional arguments for "DC2" [call-arg] +dataclasses_kwonly.py:53: error: Too many positional arguments for "DC3" [call-arg] """ diff --git a/conformance/results/zuban/dataclasses_match_args.toml b/conformance/results/zuban/dataclasses_match_args.toml index 28af5c889..9a707d050 100644 --- a/conformance/results/zuban/dataclasses_match_args.toml +++ b/conformance/results/zuban/dataclasses_match_args.toml @@ -3,5 +3,5 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -dataclasses_match_args.py:42: error: "Type[DC4]" has no attribute "__match_args__" +dataclasses_match_args.py:42: error: "Type[DC4]" has no attribute "__match_args__" [attr-defined] """ diff --git a/conformance/results/zuban/dataclasses_order.toml b/conformance/results/zuban/dataclasses_order.toml index 52acf1978..712ba3e1e 100644 --- a/conformance/results/zuban/dataclasses_order.toml +++ b/conformance/results/zuban/dataclasses_order.toml @@ -2,5 +2,5 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -dataclasses_order.py:50: error: Unsupported operand types for < ("DC1" and "DC2") +dataclasses_order.py:50: error: Unsupported operand types for < ("DC1" and "DC2") [operator] """ diff --git a/conformance/results/zuban/dataclasses_postinit.toml b/conformance/results/zuban/dataclasses_postinit.toml index 2f08fcabb..cd08f520c 100644 --- a/conformance/results/zuban/dataclasses_postinit.toml +++ b/conformance/results/zuban/dataclasses_postinit.toml @@ -2,10 +2,10 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -dataclasses_postinit.py:19: error: Argument 2 of "__post_init__" is incompatible with supertype "dataclass"; supertype defines the argument type as "str" -dataclasses_postinit.py:28: error: "DC1" has no attribute "x" -dataclasses_postinit.py:29: error: "DC1" has no attribute "y" -dataclasses_postinit.py:36: error: Signature of "__post_init__" incompatible with supertype "dataclass" +dataclasses_postinit.py:19: error: Argument 2 of "__post_init__" is incompatible with supertype "dataclass"; supertype defines the argument type as "str" [override] +dataclasses_postinit.py:28: error: "DC1" has no attribute "x" [attr-defined] +dataclasses_postinit.py:29: error: "DC1" has no attribute "y" [attr-defined] +dataclasses_postinit.py:36: error: Signature of "__post_init__" incompatible with supertype "dataclass" [override] dataclasses_postinit.py:36: note: Superclass: dataclasses_postinit.py:36: note: def __post_init__(self, x: int, y: str) -> None dataclasses_postinit.py:36: note: Subclass: diff --git a/conformance/results/zuban/dataclasses_slots.toml b/conformance/results/zuban/dataclasses_slots.toml index 9c236711c..9d9413f96 100644 --- a/conformance/results/zuban/dataclasses_slots.toml +++ b/conformance/results/zuban/dataclasses_slots.toml @@ -7,8 +7,8 @@ errors_diff = """ Line 25: Expected 1 errors """ output = """ -dataclasses_slots.py:11: error: "DC1" both defines "__slots__" and is used with "slots=True" -dataclasses_slots.py:38: error: Trying to assign name "y" that is not in "__slots__" of type "dataclasses_slots.DC3" -dataclasses_slots.py:66: error: "Type[DC6]" has no attribute "__slots__" -dataclasses_slots.py:69: error: "DC6" has no attribute "__slots__" +dataclasses_slots.py:11: error: "DC1" both defines "__slots__" and is used with "slots=True" [misc] +dataclasses_slots.py:38: error: Trying to assign name "y" that is not in "__slots__" of type "dataclasses_slots.DC3" [misc] +dataclasses_slots.py:66: error: "Type[DC6]" has no attribute "__slots__" [attr-defined] +dataclasses_slots.py:69: error: "DC6" has no attribute "__slots__" [attr-defined] """ diff --git a/conformance/results/zuban/dataclasses_transform_class.toml b/conformance/results/zuban/dataclasses_transform_class.toml index 8aeb303ed..e007f5906 100644 --- a/conformance/results/zuban/dataclasses_transform_class.toml +++ b/conformance/results/zuban/dataclasses_transform_class.toml @@ -2,10 +2,10 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -dataclasses_transform_class.py:51: error: Non-frozen dataclass cannot inherit from a frozen dataclass -dataclasses_transform_class.py:63: error: Property "id" defined in "Customer1" is read-only -dataclasses_transform_class.py:66: error: Too many positional arguments for "Customer1" -dataclasses_transform_class.py:72: error: Unsupported left operand type for < ("Customer1") -dataclasses_transform_class.py:82: error: Too many positional arguments for "Customer2" -dataclasses_transform_class.py:122: error: Property "id" defined in "Customer3" is read-only +dataclasses_transform_class.py:51: error: Non-frozen dataclass cannot inherit from a frozen dataclass [misc] +dataclasses_transform_class.py:63: error: Property "id" defined in "Customer1" is read-only [misc] +dataclasses_transform_class.py:66: error: Too many positional arguments for "Customer1" [call-arg] +dataclasses_transform_class.py:72: error: Unsupported left operand type for < ("Customer1") [operator] +dataclasses_transform_class.py:82: error: Too many positional arguments for "Customer2" [call-arg] +dataclasses_transform_class.py:122: error: Property "id" defined in "Customer3" is read-only [misc] """ diff --git a/conformance/results/zuban/dataclasses_transform_converter.toml b/conformance/results/zuban/dataclasses_transform_converter.toml index 32952f2a8..6e1b3c835 100644 --- a/conformance/results/zuban/dataclasses_transform_converter.toml +++ b/conformance/results/zuban/dataclasses_transform_converter.toml @@ -5,46 +5,46 @@ Converter parameter not yet supported. conformance_automated = "Fail" errors_diff = """ Line 118: Expected 1 errors -Line 104: Unexpected errors ['dataclasses_transform_converter.py:104: error: Incompatible callable argument with type vars'] -Line 112: Unexpected errors ['dataclasses_transform_converter.py:112: error: Argument 1 to "DC2" has incompatible type "str"; expected "int"', 'dataclasses_transform_converter.py:112: error: Argument 2 to "DC2" has incompatible type "str"; expected "int"', 'dataclasses_transform_converter.py:112: error: Argument 3 to "DC2" has incompatible type "str"; expected "int"', 'dataclasses_transform_converter.py:112: error: Argument 4 to "DC2" has incompatible type "bytes"; expected "ConverterClass"', 'dataclasses_transform_converter.py:112: error: Argument 5 to "DC2" has incompatible type "list[Never]"; expected "int"'] -Line 114: Unexpected errors ['dataclasses_transform_converter.py:114: error: Incompatible types in assignment (expression has type "str", variable has type "int")'] -Line 115: Unexpected errors ['dataclasses_transform_converter.py:115: error: Incompatible types in assignment (expression has type "str", variable has type "ConverterClass")'] -Line 116: Unexpected errors ['dataclasses_transform_converter.py:116: error: Incompatible types in assignment (expression has type "bytes", variable has type "ConverterClass")'] -Line 121: Unexpected errors ['dataclasses_transform_converter.py:121: error: Argument 1 to "DC2" has incompatible type "str"; expected "int"', 'dataclasses_transform_converter.py:121: error: Argument 2 to "DC2" has incompatible type "str"; expected "int"', 'dataclasses_transform_converter.py:121: error: Argument 3 to "DC2" has incompatible type "str"; expected "int"', 'dataclasses_transform_converter.py:121: error: Argument 4 to "DC2" has incompatible type "str"; expected "ConverterClass"', 'dataclasses_transform_converter.py:121: error: Argument 5 to "DC2" has incompatible type "str"; expected "int"', 'dataclasses_transform_converter.py:121: error: Argument 6 to "DC2" has incompatible type "tuple[tuple[str, str], tuple[str, str]]"; expected "dict[str, str]"'] +Line 104: Unexpected errors ['dataclasses_transform_converter.py:104: error: Incompatible callable argument with type vars [arg-type]'] +Line 112: Unexpected errors ['dataclasses_transform_converter.py:112: error: Argument 1 to "DC2" has incompatible type "str"; expected "int" [arg-type]', 'dataclasses_transform_converter.py:112: error: Argument 2 to "DC2" has incompatible type "str"; expected "int" [arg-type]', 'dataclasses_transform_converter.py:112: error: Argument 3 to "DC2" has incompatible type "str"; expected "int" [arg-type]', 'dataclasses_transform_converter.py:112: error: Argument 4 to "DC2" has incompatible type "bytes"; expected "ConverterClass" [arg-type]', 'dataclasses_transform_converter.py:112: error: Argument 5 to "DC2" has incompatible type "list[Never]"; expected "int" [arg-type]'] +Line 114: Unexpected errors ['dataclasses_transform_converter.py:114: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] +Line 115: Unexpected errors ['dataclasses_transform_converter.py:115: error: Incompatible types in assignment (expression has type "str", variable has type "ConverterClass") [assignment]'] +Line 116: Unexpected errors ['dataclasses_transform_converter.py:116: error: Incompatible types in assignment (expression has type "bytes", variable has type "ConverterClass") [assignment]'] +Line 121: Unexpected errors ['dataclasses_transform_converter.py:121: error: Argument 1 to "DC2" has incompatible type "str"; expected "int" [arg-type]', 'dataclasses_transform_converter.py:121: error: Argument 2 to "DC2" has incompatible type "str"; expected "int" [arg-type]', 'dataclasses_transform_converter.py:121: error: Argument 3 to "DC2" has incompatible type "str"; expected "int" [arg-type]', 'dataclasses_transform_converter.py:121: error: Argument 4 to "DC2" has incompatible type "str"; expected "ConverterClass" [arg-type]', 'dataclasses_transform_converter.py:121: error: Argument 5 to "DC2" has incompatible type "str"; expected "int" [arg-type]', 'dataclasses_transform_converter.py:121: error: Argument 6 to "DC2" has incompatible type "tuple[tuple[str, str], tuple[str, str]]"; expected "dict[str, str]" [arg-type]'] """ output = """ -dataclasses_transform_converter.py:48: error: Argument "converter" to "model_field" has incompatible type "Callable[[], int]"; expected "Callable[[Never], int]" -dataclasses_transform_converter.py:49: error: Argument "converter" to "model_field" has incompatible type "Callable[[NamedArg(int, 'x')], int]"; expected "Callable[[Never], int]" -dataclasses_transform_converter.py:104: error: Incompatible callable argument with type vars -dataclasses_transform_converter.py:107: error: Argument 2 to "DC2" has incompatible type "str"; expected "int" -dataclasses_transform_converter.py:107: error: Argument 3 to "DC2" has incompatible type "str"; expected "int" -dataclasses_transform_converter.py:107: error: Argument 4 to "DC2" has incompatible type "bytes"; expected "ConverterClass" -dataclasses_transform_converter.py:107: error: Argument 5 to "DC2" has incompatible type "list[Never]"; expected "int" -dataclasses_transform_converter.py:108: error: Argument 1 to "DC2" has incompatible type "str"; expected "int" -dataclasses_transform_converter.py:108: error: Argument 2 to "DC2" has incompatible type "str"; expected "int" -dataclasses_transform_converter.py:108: error: Argument 3 to "DC2" has incompatible type "str"; expected "int" -dataclasses_transform_converter.py:108: error: Argument 4 to "DC2" has incompatible type "int"; expected "ConverterClass" -dataclasses_transform_converter.py:108: error: Argument 5 to "DC2" has incompatible type "list[Never]"; expected "int" -dataclasses_transform_converter.py:109: error: Argument 1 to "DC2" has incompatible type "str"; expected "int" -dataclasses_transform_converter.py:109: error: Argument 2 to "DC2" has incompatible type "str"; expected "int" -dataclasses_transform_converter.py:109: error: Argument 3 to "DC2" has incompatible type "str"; expected "int" -dataclasses_transform_converter.py:109: error: Argument 4 to "DC2" has incompatible type "str"; expected "ConverterClass" -dataclasses_transform_converter.py:109: error: Argument 5 to "DC2" has incompatible type "complex"; expected "int" -dataclasses_transform_converter.py:112: error: Argument 1 to "DC2" has incompatible type "str"; expected "int" -dataclasses_transform_converter.py:112: error: Argument 2 to "DC2" has incompatible type "str"; expected "int" -dataclasses_transform_converter.py:112: error: Argument 3 to "DC2" has incompatible type "str"; expected "int" -dataclasses_transform_converter.py:112: error: Argument 4 to "DC2" has incompatible type "bytes"; expected "ConverterClass" -dataclasses_transform_converter.py:112: error: Argument 5 to "DC2" has incompatible type "list[Never]"; expected "int" -dataclasses_transform_converter.py:114: error: Incompatible types in assignment (expression has type "str", variable has type "int") -dataclasses_transform_converter.py:115: error: Incompatible types in assignment (expression has type "str", variable has type "ConverterClass") -dataclasses_transform_converter.py:116: error: Incompatible types in assignment (expression has type "bytes", variable has type "ConverterClass") -dataclasses_transform_converter.py:119: error: Incompatible types in assignment (expression has type "int", variable has type "ConverterClass") -dataclasses_transform_converter.py:121: error: Argument 1 to "DC2" has incompatible type "str"; expected "int" -dataclasses_transform_converter.py:121: error: Argument 2 to "DC2" has incompatible type "str"; expected "int" -dataclasses_transform_converter.py:121: error: Argument 3 to "DC2" has incompatible type "str"; expected "int" -dataclasses_transform_converter.py:121: error: Argument 4 to "DC2" has incompatible type "str"; expected "ConverterClass" -dataclasses_transform_converter.py:121: error: Argument 5 to "DC2" has incompatible type "str"; expected "int" -dataclasses_transform_converter.py:121: error: Argument 6 to "DC2" has incompatible type "tuple[tuple[str, str], tuple[str, str]]"; expected "dict[str, str]" -dataclasses_transform_converter.py:130: error: Argument "default" to "model_field" has incompatible type "int"; expected "str | None" -dataclasses_transform_converter.py:133: error: Argument "default_factory" to "model_field" has incompatible type "Type[int]"; expected "Callable[[], str] | None" +dataclasses_transform_converter.py:48: error: Argument "converter" to "model_field" has incompatible type "Callable[[], int]"; expected "Callable[[Never], int]" [arg-type] +dataclasses_transform_converter.py:49: error: Argument "converter" to "model_field" has incompatible type "Callable[[NamedArg(int, 'x')], int]"; expected "Callable[[Never], int]" [arg-type] +dataclasses_transform_converter.py:104: error: Incompatible callable argument with type vars [arg-type] +dataclasses_transform_converter.py:107: error: Argument 2 to "DC2" has incompatible type "str"; expected "int" [arg-type] +dataclasses_transform_converter.py:107: error: Argument 3 to "DC2" has incompatible type "str"; expected "int" [arg-type] +dataclasses_transform_converter.py:107: error: Argument 4 to "DC2" has incompatible type "bytes"; expected "ConverterClass" [arg-type] +dataclasses_transform_converter.py:107: error: Argument 5 to "DC2" has incompatible type "list[Never]"; expected "int" [arg-type] +dataclasses_transform_converter.py:108: error: Argument 1 to "DC2" has incompatible type "str"; expected "int" [arg-type] +dataclasses_transform_converter.py:108: error: Argument 2 to "DC2" has incompatible type "str"; expected "int" [arg-type] +dataclasses_transform_converter.py:108: error: Argument 3 to "DC2" has incompatible type "str"; expected "int" [arg-type] +dataclasses_transform_converter.py:108: error: Argument 4 to "DC2" has incompatible type "int"; expected "ConverterClass" [arg-type] +dataclasses_transform_converter.py:108: error: Argument 5 to "DC2" has incompatible type "list[Never]"; expected "int" [arg-type] +dataclasses_transform_converter.py:109: error: Argument 1 to "DC2" has incompatible type "str"; expected "int" [arg-type] +dataclasses_transform_converter.py:109: error: Argument 2 to "DC2" has incompatible type "str"; expected "int" [arg-type] +dataclasses_transform_converter.py:109: error: Argument 3 to "DC2" has incompatible type "str"; expected "int" [arg-type] +dataclasses_transform_converter.py:109: error: Argument 4 to "DC2" has incompatible type "str"; expected "ConverterClass" [arg-type] +dataclasses_transform_converter.py:109: error: Argument 5 to "DC2" has incompatible type "complex"; expected "int" [arg-type] +dataclasses_transform_converter.py:112: error: Argument 1 to "DC2" has incompatible type "str"; expected "int" [arg-type] +dataclasses_transform_converter.py:112: error: Argument 2 to "DC2" has incompatible type "str"; expected "int" [arg-type] +dataclasses_transform_converter.py:112: error: Argument 3 to "DC2" has incompatible type "str"; expected "int" [arg-type] +dataclasses_transform_converter.py:112: error: Argument 4 to "DC2" has incompatible type "bytes"; expected "ConverterClass" [arg-type] +dataclasses_transform_converter.py:112: error: Argument 5 to "DC2" has incompatible type "list[Never]"; expected "int" [arg-type] +dataclasses_transform_converter.py:114: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +dataclasses_transform_converter.py:115: error: Incompatible types in assignment (expression has type "str", variable has type "ConverterClass") [assignment] +dataclasses_transform_converter.py:116: error: Incompatible types in assignment (expression has type "bytes", variable has type "ConverterClass") [assignment] +dataclasses_transform_converter.py:119: error: Incompatible types in assignment (expression has type "int", variable has type "ConverterClass") [assignment] +dataclasses_transform_converter.py:121: error: Argument 1 to "DC2" has incompatible type "str"; expected "int" [arg-type] +dataclasses_transform_converter.py:121: error: Argument 2 to "DC2" has incompatible type "str"; expected "int" [arg-type] +dataclasses_transform_converter.py:121: error: Argument 3 to "DC2" has incompatible type "str"; expected "int" [arg-type] +dataclasses_transform_converter.py:121: error: Argument 4 to "DC2" has incompatible type "str"; expected "ConverterClass" [arg-type] +dataclasses_transform_converter.py:121: error: Argument 5 to "DC2" has incompatible type "str"; expected "int" [arg-type] +dataclasses_transform_converter.py:121: error: Argument 6 to "DC2" has incompatible type "tuple[tuple[str, str], tuple[str, str]]"; expected "dict[str, str]" [arg-type] +dataclasses_transform_converter.py:130: error: Argument "default" to "model_field" has incompatible type "int"; expected "str | None" [arg-type] +dataclasses_transform_converter.py:133: error: Argument "default_factory" to "model_field" has incompatible type "Type[int]"; expected "Callable[[], str] | None" [arg-type] """ diff --git a/conformance/results/zuban/dataclasses_transform_field.toml b/conformance/results/zuban/dataclasses_transform_field.toml index 26b9ea8c4..90f98c551 100644 --- a/conformance/results/zuban/dataclasses_transform_field.toml +++ b/conformance/results/zuban/dataclasses_transform_field.toml @@ -2,6 +2,6 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -dataclasses_transform_field.py:64: error: Unexpected keyword argument "id" for "CustomerModel1" -dataclasses_transform_field.py:75: error: Too many positional arguments for "CustomerModel2" +dataclasses_transform_field.py:64: error: Unexpected keyword argument "id" for "CustomerModel1" [call-arg] +dataclasses_transform_field.py:75: error: Too many positional arguments for "CustomerModel2" [call-arg] """ diff --git a/conformance/results/zuban/dataclasses_transform_func.toml b/conformance/results/zuban/dataclasses_transform_func.toml index 9bd8738f4..4ebe35382 100644 --- a/conformance/results/zuban/dataclasses_transform_func.toml +++ b/conformance/results/zuban/dataclasses_transform_func.toml @@ -2,10 +2,10 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -dataclasses_transform_func.py:56: error: Incompatible types in assignment (expression has type "int", variable has type "str") -dataclasses_transform_func.py:60: error: Unsupported left operand type for < ("Customer1") -dataclasses_transform_func.py:64: error: Unexpected keyword argument "salary" for "Customer1" -dataclasses_transform_func.py:70: error: Too many positional arguments for "Customer2" -dataclasses_transform_func.py:89: error: Non-frozen dataclass cannot inherit from a frozen dataclass -dataclasses_transform_func.py:96: error: Property "id" defined in "Customer3" is read-only +dataclasses_transform_func.py:56: error: Incompatible types in assignment (expression has type "int", variable has type "str") [assignment] +dataclasses_transform_func.py:60: error: Unsupported left operand type for < ("Customer1") [operator] +dataclasses_transform_func.py:64: error: Unexpected keyword argument "salary" for "Customer1" [call-arg] +dataclasses_transform_func.py:70: error: Too many positional arguments for "Customer2" [call-arg] +dataclasses_transform_func.py:89: error: Non-frozen dataclass cannot inherit from a frozen dataclass [misc] +dataclasses_transform_func.py:96: error: Property "id" defined in "Customer3" is read-only [misc] """ diff --git a/conformance/results/zuban/dataclasses_transform_meta.toml b/conformance/results/zuban/dataclasses_transform_meta.toml index 91a673e7e..f19fbfd87 100644 --- a/conformance/results/zuban/dataclasses_transform_meta.toml +++ b/conformance/results/zuban/dataclasses_transform_meta.toml @@ -2,10 +2,10 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -dataclasses_transform_meta.py:51: error: Non-frozen dataclass cannot inherit from a frozen dataclass -dataclasses_transform_meta.py:63: error: Property "id" defined in "Customer1" is read-only -dataclasses_transform_meta.py:66: error: Too many positional arguments for "Customer1" -dataclasses_transform_meta.py:73: error: Unsupported left operand type for < ("Customer1") -dataclasses_transform_meta.py:83: error: Too many positional arguments for "Customer2" -dataclasses_transform_meta.py:103: error: Property "id" defined in "Customer3" is read-only +dataclasses_transform_meta.py:51: error: Non-frozen dataclass cannot inherit from a frozen dataclass [misc] +dataclasses_transform_meta.py:63: error: Property "id" defined in "Customer1" is read-only [misc] +dataclasses_transform_meta.py:66: error: Too many positional arguments for "Customer1" [call-arg] +dataclasses_transform_meta.py:73: error: Unsupported left operand type for < ("Customer1") [operator] +dataclasses_transform_meta.py:83: error: Too many positional arguments for "Customer2" [call-arg] +dataclasses_transform_meta.py:103: error: Property "id" defined in "Customer3" is read-only [misc] """ diff --git a/conformance/results/zuban/dataclasses_usage.toml b/conformance/results/zuban/dataclasses_usage.toml index 657b30298..42fae5899 100644 --- a/conformance/results/zuban/dataclasses_usage.toml +++ b/conformance/results/zuban/dataclasses_usage.toml @@ -2,15 +2,15 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -dataclasses_usage.py:50: error: Missing positional argument "unit_price" in call to "InventoryItem" -dataclasses_usage.py:51: error: Argument 2 to "InventoryItem" has incompatible type "str"; expected "float" -dataclasses_usage.py:52: error: Too many arguments for "InventoryItem" -dataclasses_usage.py:61: error: Attributes without a default cannot follow attributes with one -dataclasses_usage.py:67: error: Attributes without a default cannot follow attributes with one -dataclasses_usage.py:73: error: Attributes without a default cannot follow attributes with one -dataclasses_usage.py:83: error: Too many arguments for "DC4" -dataclasses_usage.py:88: error: Argument "default_factory" to "field" has incompatible type "Type[str]"; expected "Callable[[], int]" -dataclasses_usage.py:127: error: Too many arguments for "DC7" -dataclasses_usage.py:130: error: Missing positional argument "y" in call to "DC8" -dataclasses_usage.py:179: error: Too many arguments for "DC13" +dataclasses_usage.py:50: error: Missing positional argument "unit_price" in call to "InventoryItem" [call-arg] +dataclasses_usage.py:51: error: Argument 2 to "InventoryItem" has incompatible type "str"; expected "float" [arg-type] +dataclasses_usage.py:52: error: Too many arguments for "InventoryItem" [call-arg] +dataclasses_usage.py:61: error: Attributes without a default cannot follow attributes with one [misc] +dataclasses_usage.py:67: error: Attributes without a default cannot follow attributes with one [misc] +dataclasses_usage.py:73: error: Attributes without a default cannot follow attributes with one [misc] +dataclasses_usage.py:83: error: Too many arguments for "DC4" [call-arg] +dataclasses_usage.py:88: error: Argument "default_factory" to "field" has incompatible type "Type[str]"; expected "Callable[[], int]" [arg-type] +dataclasses_usage.py:127: error: Too many arguments for "DC7" [call-arg] +dataclasses_usage.py:130: error: Missing positional argument "y" in call to "DC8" [call-arg] +dataclasses_usage.py:179: error: Too many arguments for "DC13" [call-arg] """ diff --git a/conformance/results/zuban/directives_assert_type.toml b/conformance/results/zuban/directives_assert_type.toml index cb5f42c91..15ed60cb4 100644 --- a/conformance/results/zuban/directives_assert_type.toml +++ b/conformance/results/zuban/directives_assert_type.toml @@ -2,10 +2,10 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -directives_assert_type.py:27: error: Expression is of type "int | str", not "int" -directives_assert_type.py:28: error: Expression is of type "Any", not "int" -directives_assert_type.py:29: error: Expression is of type "Literal[4]", not "int" -directives_assert_type.py:31: error: "assert_type" expects 2 arguments -directives_assert_type.py:32: error: Expression is of type "Literal['']", not "int" -directives_assert_type.py:33: error: "assert_type" expects 2 arguments +directives_assert_type.py:27: error: Expression is of type "int | str", not "int" [misc] +directives_assert_type.py:28: error: Expression is of type "Any", not "int" [misc] +directives_assert_type.py:29: error: Expression is of type "Literal[4]", not "int" [misc] +directives_assert_type.py:31: error: "assert_type" expects 2 arguments [call-arg] +directives_assert_type.py:32: error: Expression is of type "Literal['']", not "int" [misc] +directives_assert_type.py:33: error: "assert_type" expects 2 arguments [call-arg] """ diff --git a/conformance/results/zuban/directives_cast.toml b/conformance/results/zuban/directives_cast.toml index 2929dc71c..5f0624563 100644 --- a/conformance/results/zuban/directives_cast.toml +++ b/conformance/results/zuban/directives_cast.toml @@ -2,7 +2,7 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -directives_cast.py:15: error: "cast" expects 2 arguments -directives_cast.py:16: error: Invalid type: try using Literal[1] instead? -directives_cast.py:17: error: "cast" expects 2 arguments +directives_cast.py:15: error: "cast" expects 2 arguments [call-arg] +directives_cast.py:16: error: Invalid type: try using Literal[1] instead? [valid-type] +directives_cast.py:17: error: "cast" expects 2 arguments [call-arg] """ diff --git a/conformance/results/zuban/directives_no_type_check.toml b/conformance/results/zuban/directives_no_type_check.toml index ffa3b903a..722db58b0 100644 --- a/conformance/results/zuban/directives_no_type_check.toml +++ b/conformance/results/zuban/directives_no_type_check.toml @@ -2,6 +2,6 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -directives_no_type_check.py:15: error: Incompatible types in assignment (expression has type "str", variable has type "int") -directives_no_type_check.py:32: error: Missing positional arguments "a", "b" in call to "func1" +directives_no_type_check.py:15: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_no_type_check.py:32: error: Missing positional arguments "a", "b" in call to "func1" [call-arg] """ diff --git a/conformance/results/zuban/directives_reveal_type.toml b/conformance/results/zuban/directives_reveal_type.toml index ca00eb927..753a0a2ac 100644 --- a/conformance/results/zuban/directives_reveal_type.toml +++ b/conformance/results/zuban/directives_reveal_type.toml @@ -6,6 +6,6 @@ directives_reveal_type.py:14: note: Revealed type is "builtins.int | builtins.st directives_reveal_type.py:15: note: Revealed type is "builtins.list[builtins.int]" directives_reveal_type.py:16: note: Revealed type is "Any" directives_reveal_type.py:17: note: Revealed type is "directives_reveal_type.ForwardReference" -directives_reveal_type.py:19: error: Too few arguments for "reveal_type" -directives_reveal_type.py:20: error: Too many arguments for "reveal_type" +directives_reveal_type.py:19: error: Too few arguments for "reveal_type" [call-arg] +directives_reveal_type.py:20: error: Too many arguments for "reveal_type" [call-arg] """ diff --git a/conformance/results/zuban/directives_type_ignore.toml b/conformance/results/zuban/directives_type_ignore.toml index 4de75baee..7f7a32e76 100644 --- a/conformance/results/zuban/directives_type_ignore.toml +++ b/conformance/results/zuban/directives_type_ignore.toml @@ -4,11 +4,11 @@ Does not honor "# type: ignore" comment if comment includes additional text. """ conformance_automated = "Fail" errors_diff = """ -Line 11: Unexpected errors ['directives_type_ignore.py:11: error: Incompatible types in assignment (expression has type "str", variable has type "int")'] -Line 14: Unexpected errors ['directives_type_ignore.py:14: error: Incompatible types in assignment (expression has type "str", variable has type "int")'] +Line 11: Unexpected errors ['directives_type_ignore.py:11: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] +Line 14: Unexpected errors ['directives_type_ignore.py:14: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] """ output = """ -directives_type_ignore.py:11: error: Incompatible types in assignment (expression has type "str", variable has type "int") -directives_type_ignore.py:14: error: Incompatible types in assignment (expression has type "str", variable has type "int") +directives_type_ignore.py:11: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_type_ignore.py:14: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] directives_type_ignore.py:14: note: Error code "assignment" not covered by "type: ignore" comment """ diff --git a/conformance/results/zuban/directives_type_ignore_file2.toml b/conformance/results/zuban/directives_type_ignore_file2.toml index 8a3521e92..afe027f9b 100644 --- a/conformance/results/zuban/directives_type_ignore_file2.toml +++ b/conformance/results/zuban/directives_type_ignore_file2.toml @@ -2,5 +2,5 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -directives_type_ignore_file2.py:14: error: Incompatible types in assignment (expression has type "str", variable has type "int") +directives_type_ignore_file2.py:14: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] """ diff --git a/conformance/results/zuban/directives_version_platform.toml b/conformance/results/zuban/directives_version_platform.toml index 01082d4b6..dd33e2bef 100644 --- a/conformance/results/zuban/directives_version_platform.toml +++ b/conformance/results/zuban/directives_version_platform.toml @@ -2,8 +2,8 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -directives_version_platform.py:19: error: Incompatible types in assignment (expression has type "str", variable has type "int") -directives_version_platform.py:27: error: Incompatible types in assignment (expression has type "str", variable has type "int") -directives_version_platform.py:40: error: Incompatible types in assignment (expression has type "str", variable has type "int") -directives_version_platform.py:45: error: Incompatible types in assignment (expression has type "str", variable has type "int") +directives_version_platform.py:19: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_version_platform.py:27: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_version_platform.py:40: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_version_platform.py:45: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] """ diff --git a/conformance/results/zuban/enums_behaviors.toml b/conformance/results/zuban/enums_behaviors.toml index 1328d68ab..cf90125a2 100644 --- a/conformance/results/zuban/enums_behaviors.toml +++ b/conformance/results/zuban/enums_behaviors.toml @@ -2,7 +2,7 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -enums_behaviors.py:28: error: Expression is of type "Color", not "Literal[Color.RED]" -enums_behaviors.py:32: error: Expression is of type "Color", not "Literal[Color.BLUE]" -enums_behaviors.py:44: error: Cannot extend enum with existing members: "Shape" +enums_behaviors.py:28: error: Expression is of type "Color", not "Literal[Color.RED]" [misc] +enums_behaviors.py:32: error: Expression is of type "Color", not "Literal[Color.BLUE]" [misc] +enums_behaviors.py:44: error: Cannot extend enum with existing members: "Shape" [misc] """ diff --git a/conformance/results/zuban/enums_definition.toml b/conformance/results/zuban/enums_definition.toml index 5fd9eb7c4..a98bcdae3 100644 --- a/conformance/results/zuban/enums_definition.toml +++ b/conformance/results/zuban/enums_definition.toml @@ -2,5 +2,5 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -enums_definition.py:24: error: Too many arguments for Enum() +enums_definition.py:24: error: Too many arguments for Enum() [call-arg] """ diff --git a/conformance/results/zuban/enums_expansion.toml b/conformance/results/zuban/enums_expansion.toml index aac06a242..44138b03f 100644 --- a/conformance/results/zuban/enums_expansion.toml +++ b/conformance/results/zuban/enums_expansion.toml @@ -5,9 +5,9 @@ Improperly applies narrowing to Flag subclass. conformance_automated = "Fail" errors_diff = """ Line 53: Expected 1 errors -Line 52: Unexpected errors ['enums_expansion.py:52: error: Expression is of type "Literal[CustomFlags.FLAG3]", not "CustomFlags"'] +Line 52: Unexpected errors ['enums_expansion.py:52: error: Expression is of type "Literal[CustomFlags.FLAG3]", not "CustomFlags" [misc]'] """ output = """ -enums_expansion.py:35: error: Expression is of type "Color", not "Never" -enums_expansion.py:52: error: Expression is of type "Literal[CustomFlags.FLAG3]", not "CustomFlags" +enums_expansion.py:35: error: Expression is of type "Color", not "Never" [misc] +enums_expansion.py:52: error: Expression is of type "Literal[CustomFlags.FLAG3]", not "CustomFlags" [misc] """ diff --git a/conformance/results/zuban/enums_member_names.toml b/conformance/results/zuban/enums_member_names.toml index 7026fbd73..f22302d47 100644 --- a/conformance/results/zuban/enums_member_names.toml +++ b/conformance/results/zuban/enums_member_names.toml @@ -2,5 +2,5 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -enums_member_names.py:30: error: Expression is of type "str", not "Literal['RED', 'BLUE', 'GREEN']" +enums_member_names.py:30: error: Expression is of type "str", not "Literal['RED', 'BLUE', 'GREEN']" [misc] """ diff --git a/conformance/results/zuban/enums_member_values.toml b/conformance/results/zuban/enums_member_values.toml index 0898b966a..95ead33c4 100644 --- a/conformance/results/zuban/enums_member_values.toml +++ b/conformance/results/zuban/enums_member_values.toml @@ -7,8 +7,8 @@ errors_diff = """ Line 78: Expected 1 errors """ output = """ -enums_member_values.py:54: error: Expression is of type "tuple[Literal[1], float, float]", not "Literal[1]" -enums_member_values.py:68: error: Expression is of type "int", not "Literal[1]" -enums_member_values.py:85: error: Incompatible types in assignment (expression has type "int", variable has type "str") -enums_member_values.py:96: error: Expression is of type "EllipsisType", not "int" +enums_member_values.py:54: error: Expression is of type "tuple[Literal[1], float, float]", not "Literal[1]" [misc] +enums_member_values.py:68: error: Expression is of type "int", not "Literal[1]" [misc] +enums_member_values.py:85: error: Incompatible types in assignment (expression has type "int", variable has type "str") [assignment] +enums_member_values.py:96: error: Expression is of type "EllipsisType", not "int" [misc] """ diff --git a/conformance/results/zuban/enums_members.toml b/conformance/results/zuban/enums_members.toml index a9c41a462..991c40eb6 100644 --- a/conformance/results/zuban/enums_members.toml +++ b/conformance/results/zuban/enums_members.toml @@ -9,22 +9,22 @@ errors_diff = """ Line 82: Expected 1 errors Line 83: Expected 1 errors Line 116: Expected 1 errors -Line 35: Unexpected errors ['enums_members.py:35: error: Expression is of type "Literal[Pet2.genus]", not "str"'] -Line 36: Unexpected errors ['enums_members.py:36: error: Expression is of type "Literal[Pet2.species]", not "str"'] -Line 100: Unexpected errors ['enums_members.py:100: error: Expression is of type "Literal[TrafficLight.AMBER]", not "Literal[TrafficLight.YELLOW]"'] -Line 117: Unexpected errors ['enums_members.py:117: error: Parameter 1 of Literal[...] is invalid'] +Line 35: Unexpected errors ['enums_members.py:35: error: Expression is of type "Literal[Pet2.genus]", not "str" [misc]'] +Line 36: Unexpected errors ['enums_members.py:36: error: Expression is of type "Literal[Pet2.species]", not "str" [misc]'] +Line 100: Unexpected errors ['enums_members.py:100: error: Expression is of type "Literal[TrafficLight.AMBER]", not "Literal[TrafficLight.YELLOW]" [misc]'] +Line 117: Unexpected errors ['enums_members.py:117: error: Parameter 1 of Literal[...] is invalid [valid-type]'] """ output = """ -enums_members.py:35: error: Expression is of type "Literal[Pet2.genus]", not "str" -enums_members.py:36: error: Expression is of type "Literal[Pet2.species]", not "str" -enums_members.py:50: error: Enum members must be left unannotated +enums_members.py:35: error: Expression is of type "Literal[Pet2.genus]", not "str" [misc] +enums_members.py:36: error: Expression is of type "Literal[Pet2.species]", not "str" [misc] +enums_members.py:50: error: Enum members must be left unannotated [misc] enums_members.py:50: note: See https://typing.readthedocs.io/en/latest/spec/enums.html#defining-members -enums_members.py:84: error: Parameter 1 of Literal[...] is invalid -enums_members.py:85: error: Parameter 1 of Literal[...] is invalid -enums_members.py:100: error: Expression is of type "Literal[TrafficLight.AMBER]", not "Literal[TrafficLight.YELLOW]" -enums_members.py:117: error: Parameter 1 of Literal[...] is invalid +enums_members.py:84: error: Parameter 1 of Literal[...] is invalid [valid-type] +enums_members.py:85: error: Parameter 1 of Literal[...] is invalid [valid-type] +enums_members.py:100: error: Expression is of type "Literal[TrafficLight.AMBER]", not "Literal[TrafficLight.YELLOW]" [misc] +enums_members.py:117: error: Parameter 1 of Literal[...] is invalid [valid-type] enums_members.py:128: note: Revealed type is "builtins.int" -enums_members.py:129: error: Parameter 1 of Literal[...] is invalid -enums_members.py:146: error: Expression is of type "Literal[Pet5.DOG]", not "int" -enums_members.py:147: error: Expression is of type "Literal[Pet5.FISH]", not "int" +enums_members.py:129: error: Parameter 1 of Literal[...] is invalid [valid-type] +enums_members.py:146: error: Expression is of type "Literal[Pet5.DOG]", not "int" [misc] +enums_members.py:147: error: Expression is of type "Literal[Pet5.FISH]", not "int" [misc] """ diff --git a/conformance/results/zuban/generics_base_class.toml b/conformance/results/zuban/generics_base_class.toml index 486fb5e8c..81a4e00e3 100644 --- a/conformance/results/zuban/generics_base_class.toml +++ b/conformance/results/zuban/generics_base_class.toml @@ -5,14 +5,14 @@ Does not detect inconsistent type variable ordering in multi-inheritance. conformance_automated = "Fail" errors_diff = """ Line 98: Expected 1 errors -Line 38: Unexpected errors ['generics_base_class.py:38: error: Can only assign concrete classes to a variable of type "Type[Iterable]"'] +Line 38: Unexpected errors ['generics_base_class.py:38: error: Can only assign concrete classes to a variable of type "Type[Iterable]" [misc]'] """ output = """ -generics_base_class.py:26: error: Argument 1 to "takes_dict_incorrect" has incompatible type "SymbolTable"; expected "dict[str, list[object]]" -generics_base_class.py:29: error: Invalid type -generics_base_class.py:30: error: Invalid type -generics_base_class.py:38: error: Can only assign concrete classes to a variable of type "Type[Iterable]" -generics_base_class.py:49: error: "LinkedList" expects 1 type argument, but 2 given -generics_base_class.py:61: error: "MyDict" expects 1 type argument, but 2 given -generics_base_class.py:68: error: Duplicate type variables in Generic[...] or Protocol[...] +generics_base_class.py:26: error: Argument 1 to "takes_dict_incorrect" has incompatible type "SymbolTable"; expected "dict[str, list[object]]" [arg-type] +generics_base_class.py:29: error: Invalid type [valid-type] +generics_base_class.py:30: error: Invalid type [valid-type] +generics_base_class.py:38: error: Can only assign concrete classes to a variable of type "Type[Iterable]" [misc] +generics_base_class.py:49: error: "LinkedList" expects 1 type argument, but 2 given [type-arg] +generics_base_class.py:61: error: "MyDict" expects 1 type argument, but 2 given [type-arg] +generics_base_class.py:68: error: Duplicate type variables in Generic[...] or Protocol[...] [misc] """ diff --git a/conformance/results/zuban/generics_basic.toml b/conformance/results/zuban/generics_basic.toml index db0b02d3a..707f3c78f 100644 --- a/conformance/results/zuban/generics_basic.toml +++ b/conformance/results/zuban/generics_basic.toml @@ -2,17 +2,17 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -generics_basic.py:40: error: Argument 2 to "concat" has incompatible type "bytes"; expected "str" -generics_basic.py:41: error: Argument 2 to "concat" has incompatible type "str"; expected "bytes" -generics_basic.py:49: error: Type variable must have at least two constrained types -generics_basic.py:55: error: TypeVar constraint type cannot be parametrized by type variables -generics_basic.py:69: error: Argument 2 to "concat" has incompatible type "bytes"; expected "str" -generics_basic.py:121: error: Duplicate type variables in Generic[...] or Protocol[...] -generics_basic.py:157: error: Invalid index type "int" for "MyMap1[str, int]"; expected type "str" -generics_basic.py:158: error: Invalid index type "int" for "MyMap2[int, str]"; expected type "str" -generics_basic.py:162: error: Free type variable expected in Generic[...] -generics_basic.py:163: error: Free type variable expected in Protocol[...] -generics_basic.py:171: error: If Generic[...] or Protocol[...] is present it should list all type variables -generics_basic.py:172: error: If Generic[...] or Protocol[...] is present it should list all type variables -generics_basic.py:208: error: Invalid metaclass "GenericMeta[T]" +generics_basic.py:40: error: Argument 2 to "concat" has incompatible type "bytes"; expected "str" [arg-type] +generics_basic.py:41: error: Argument 2 to "concat" has incompatible type "str"; expected "bytes" [arg-type] +generics_basic.py:49: error: Type variable must have at least two constrained types [misc] +generics_basic.py:55: error: TypeVar constraint type cannot be parametrized by type variables [misc] +generics_basic.py:69: error: Argument 2 to "concat" has incompatible type "bytes"; expected "str" [arg-type] +generics_basic.py:121: error: Duplicate type variables in Generic[...] or Protocol[...] [misc] +generics_basic.py:157: error: Invalid index type "int" for "MyMap1[str, int]"; expected type "str" [index] +generics_basic.py:158: error: Invalid index type "int" for "MyMap2[int, str]"; expected type "str" [index] +generics_basic.py:162: error: Free type variable expected in Generic[...] [misc] +generics_basic.py:163: error: Free type variable expected in Protocol[...] [misc] +generics_basic.py:171: error: If Generic[...] or Protocol[...] is present it should list all type variables [misc] +generics_basic.py:172: error: If Generic[...] or Protocol[...] is present it should list all type variables [misc] +generics_basic.py:208: error: Invalid metaclass "GenericMeta[T]" [misc] """ diff --git a/conformance/results/zuban/generics_defaults.toml b/conformance/results/zuban/generics_defaults.toml index f54654743..63d7f7d88 100644 --- a/conformance/results/zuban/generics_defaults.toml +++ b/conformance/results/zuban/generics_defaults.toml @@ -7,17 +7,17 @@ ParamSpec after TypeVarTuple is not always handled correctly conformance_automated = "Fail" errors_diff = """ Line 141: Expected 1 errors -Line 154: Unexpected errors ['generics_defaults.py:154: error: Expression is of type "Type[Foo6[int, [*Any, **Any]]]", not "Type[Foo6[int, str, [float, bool]]]"', 'generics_defaults.py:154: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str"'] -Line 169: Unexpected errors ['generics_defaults.py:169: error: Expression is of type "Callable[[Self], Self]", not "Callable[[Foo7[int]], Foo7[int]]"'] -Line 170: Unexpected errors ['generics_defaults.py:170: error: Access to generic instance variables via class is ambiguous'] +Line 154: Unexpected errors ['generics_defaults.py:154: error: Expression is of type "Type[Foo6[int, [*Any, **Any]]]", not "Type[Foo6[int, str, [float, bool]]]" [misc]', 'generics_defaults.py:154: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [misc]'] +Line 169: Unexpected errors ['generics_defaults.py:169: error: Expression is of type "Callable[[Self], Self]", not "Callable[[Foo7[int]], Foo7[int]]" [misc]'] +Line 170: Unexpected errors ['generics_defaults.py:170: error: Access to generic instance variables via class is ambiguous [misc]'] """ output = """ -generics_defaults.py:24: error: "T" cannot appear after "DefaultStrT" in type parameter list because it has no default type -generics_defaults.py:50: error: "AllTheDefaults" expects between 2 and 5 type arguments, but 1 given -generics_defaults.py:107: error: TypeVar default must be a subtype of the bound type -generics_defaults.py:114: error: TypeVar default must be one of the constraint types -generics_defaults.py:154: error: Expression is of type "Type[Foo6[int, [*Any, **Any]]]", not "Type[Foo6[int, str, [float, bool]]]" -generics_defaults.py:154: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" -generics_defaults.py:169: error: Expression is of type "Callable[[Self], Self]", not "Callable[[Foo7[int]], Foo7[int]]" -generics_defaults.py:170: error: Access to generic instance variables via class is ambiguous +generics_defaults.py:24: error: "T" cannot appear after "DefaultStrT" in type parameter list because it has no default type [misc] +generics_defaults.py:50: error: "AllTheDefaults" expects between 2 and 5 type arguments, but 1 given [type-arg] +generics_defaults.py:107: error: TypeVar default must be a subtype of the bound type [misc] +generics_defaults.py:114: error: TypeVar default must be one of the constraint types [misc] +generics_defaults.py:154: error: Expression is of type "Type[Foo6[int, [*Any, **Any]]]", not "Type[Foo6[int, str, [float, bool]]]" [misc] +generics_defaults.py:154: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [misc] +generics_defaults.py:169: error: Expression is of type "Callable[[Self], Self]", not "Callable[[Foo7[int]], Foo7[int]]" [misc] +generics_defaults.py:170: error: Access to generic instance variables via class is ambiguous [misc] """ diff --git a/conformance/results/zuban/generics_defaults_referential.toml b/conformance/results/zuban/generics_defaults_referential.toml index f5dc26363..874e32116 100644 --- a/conformance/results/zuban/generics_defaults_referential.toml +++ b/conformance/results/zuban/generics_defaults_referential.toml @@ -2,11 +2,11 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -generics_defaults_referential.py:36: error: Argument 2 to "Foo" has incompatible type "str"; expected "int" -generics_defaults_referential.py:37: error: Argument 1 to "Foo" has incompatible type "str"; expected "int" -generics_defaults_referential.py:53: error: Type parameter "Start2T" has a default type that refers to one or more type variables that are out of scope -generics_defaults_referential.py:60: error: Type parameter "S2" has a default type that refers to one or more type variables that are out of scope -generics_defaults_referential.py:68: error: TypeVar default must be a subtype of the bound type -generics_defaults_referential.py:74: error: TypeVar default must be one of the constraint types -generics_defaults_referential.py:78: error: TypeVar default must be one of the constraint types +generics_defaults_referential.py:36: error: Argument 2 to "Foo" has incompatible type "str"; expected "int" [arg-type] +generics_defaults_referential.py:37: error: Argument 1 to "Foo" has incompatible type "str"; expected "int" [arg-type] +generics_defaults_referential.py:53: error: Type parameter "Start2T" has a default type that refers to one or more type variables that are out of scope [misc] +generics_defaults_referential.py:60: error: Type parameter "S2" has a default type that refers to one or more type variables that are out of scope [misc] +generics_defaults_referential.py:68: error: TypeVar default must be a subtype of the bound type [misc] +generics_defaults_referential.py:74: error: TypeVar default must be one of the constraint types [misc] +generics_defaults_referential.py:78: error: TypeVar default must be one of the constraint types [misc] """ diff --git a/conformance/results/zuban/generics_defaults_specialization.toml b/conformance/results/zuban/generics_defaults_specialization.toml index 29f44e4f7..5b68604f1 100644 --- a/conformance/results/zuban/generics_defaults_specialization.toml +++ b/conformance/results/zuban/generics_defaults_specialization.toml @@ -2,6 +2,6 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -generics_defaults_specialization.py:30: error: Bad number of arguments for type alias, expected between 0 and 1, given 2 -generics_defaults_specialization.py:55: error: "Foo" expects no type arguments, but 1 given +generics_defaults_specialization.py:30: error: Bad number of arguments for type alias, expected between 0 and 1, given 2 [misc] +generics_defaults_specialization.py:55: error: "Foo" expects no type arguments, but 1 given [type-arg] """ diff --git a/conformance/results/zuban/generics_paramspec_basic.toml b/conformance/results/zuban/generics_paramspec_basic.toml index 97048c7ba..4d3ada23c 100644 --- a/conformance/results/zuban/generics_paramspec_basic.toml +++ b/conformance/results/zuban/generics_paramspec_basic.toml @@ -2,21 +2,21 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -generics_paramspec_basic.py:10: error: String argument 1 "NotIt" to ParamSpec(...) does not match variable name "WrongName" -generics_paramspec_basic.py:15: error: Invalid location for ParamSpec "P" +generics_paramspec_basic.py:10: error: String argument 1 "NotIt" to ParamSpec(...) does not match variable name "WrongName" [misc] +generics_paramspec_basic.py:15: error: Invalid location for ParamSpec "P" [valid-type] generics_paramspec_basic.py:15: note: You can use ParamSpec as the first argument to Callable, e.g., "Callable[P, int]" -generics_paramspec_basic.py:23: error: Invalid location for ParamSpec "P" +generics_paramspec_basic.py:23: error: Invalid location for ParamSpec "P" [valid-type] generics_paramspec_basic.py:23: note: You can use ParamSpec as the first argument to Callable, e.g., "Callable[P, int]" -generics_paramspec_basic.py:23: error: Invalid location for ParamSpec "P" +generics_paramspec_basic.py:23: error: Invalid location for ParamSpec "P" [valid-type] generics_paramspec_basic.py:23: note: You can use ParamSpec as the first argument to Callable, e.g., "Callable[P, int]" -generics_paramspec_basic.py:27: error: Invalid location for Concatenate +generics_paramspec_basic.py:27: error: Invalid location for Concatenate [valid-type] generics_paramspec_basic.py:27: note: You can use Concatenate as the first argument to Callable -generics_paramspec_basic.py:31: error: Invalid location for ParamSpec "P" +generics_paramspec_basic.py:31: error: Invalid location for ParamSpec "P" [valid-type] generics_paramspec_basic.py:31: note: You can use ParamSpec as the first argument to Callable, e.g., "Callable[P, int]" -generics_paramspec_basic.py:35: error: Invalid location for ParamSpec "P" +generics_paramspec_basic.py:35: error: Invalid location for ParamSpec "P" [valid-type] generics_paramspec_basic.py:35: note: You can use ParamSpec as the first argument to Callable, e.g., "Callable[P, int]" -generics_paramspec_basic.py:39: error: Invalid location for ParamSpec "P" +generics_paramspec_basic.py:39: error: Invalid location for ParamSpec "P" [valid-type] generics_paramspec_basic.py:39: note: You can use ParamSpec as the first argument to Callable, e.g., "Callable[P, int]" -generics_paramspec_basic.py:39: error: Invalid location for ParamSpec "P" +generics_paramspec_basic.py:39: error: Invalid location for ParamSpec "P" [valid-type] generics_paramspec_basic.py:39: note: You can use ParamSpec as the first argument to Callable, e.g., "Callable[P, int]" """ diff --git a/conformance/results/zuban/generics_paramspec_components.toml b/conformance/results/zuban/generics_paramspec_components.toml index 5c8e9bfea..0e1fa0041 100644 --- a/conformance/results/zuban/generics_paramspec_components.toml +++ b/conformance/results/zuban/generics_paramspec_components.toml @@ -2,26 +2,26 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -generics_paramspec_components.py:17: error: Use "P.args" for variadic "*" parameter -generics_paramspec_components.py:17: error: Use "P.kwargs" for variadic "**" parameter -generics_paramspec_components.py:20: error: ParamSpec components are not allowed here -generics_paramspec_components.py:23: error: Use "P.kwargs" for variadic "**" parameter -generics_paramspec_components.py:26: error: ParamSpec must have "*args" typed as "P.args" and "**kwargs" typed as "P.kwargs" -generics_paramspec_components.py:30: error: ParamSpec "P" is unbound -generics_paramspec_components.py:35: error: ParamSpec components are not allowed here -generics_paramspec_components.py:36: error: ParamSpec components are not allowed here -generics_paramspec_components.py:38: error: ParamSpec must have "*args" typed as "P.args" and "**kwargs" typed as "P.kwargs" -generics_paramspec_components.py:41: error: ParamSpec must have "*args" typed as "P.args" and "**kwargs" typed as "P.kwargs" -generics_paramspec_components.py:49: error: Argument 1 has incompatible type "*P.kwargs"; expected "P.args" -generics_paramspec_components.py:49: error: Argument after ** must be a mapping, not "P.args" -generics_paramspec_components.py:51: error: Argument 1 has incompatible type "int"; expected "P.args" -generics_paramspec_components.py:60: error: Arguments not allowed after ParamSpec.args -generics_paramspec_components.py:70: error: Too few arguments -generics_paramspec_components.py:70: error: ParamSpec arguments must be of types "*P.args, **P.kwargs" -generics_paramspec_components.py:70: error: Argument 3 has incompatible type "**P.kwargs"; expected "P.kwargs" -generics_paramspec_components.py:72: error: Too few arguments -generics_paramspec_components.py:83: error: Argument "x" to "foo" has incompatible type "int"; expected "P.args" -generics_paramspec_components.py:83: error: Argument 2 to "foo" has incompatible type "*P.args"; expected "int" -generics_paramspec_components.py:98: error: Argument 2 to "twice" has incompatible type "str"; expected "int" -generics_paramspec_components.py:98: error: Argument 3 to "twice" has incompatible type "int"; expected "str" +generics_paramspec_components.py:17: error: Use "P.args" for variadic "*" parameter [misc] +generics_paramspec_components.py:17: error: Use "P.kwargs" for variadic "**" parameter [misc] +generics_paramspec_components.py:20: error: ParamSpec components are not allowed here [misc] +generics_paramspec_components.py:23: error: Use "P.kwargs" for variadic "**" parameter [misc] +generics_paramspec_components.py:26: error: ParamSpec must have "*args" typed as "P.args" and "**kwargs" typed as "P.kwargs" [misc] +generics_paramspec_components.py:30: error: ParamSpec "P" is unbound [misc] +generics_paramspec_components.py:35: error: ParamSpec components are not allowed here [misc] +generics_paramspec_components.py:36: error: ParamSpec components are not allowed here [misc] +generics_paramspec_components.py:38: error: ParamSpec must have "*args" typed as "P.args" and "**kwargs" typed as "P.kwargs" [misc] +generics_paramspec_components.py:41: error: ParamSpec must have "*args" typed as "P.args" and "**kwargs" typed as "P.kwargs" [misc] +generics_paramspec_components.py:49: error: Argument 1 has incompatible type "*P.kwargs"; expected "P.args" [arg-type] +generics_paramspec_components.py:49: error: Argument after ** must be a mapping, not "P.args" [arg-type] +generics_paramspec_components.py:51: error: Argument 1 has incompatible type "int"; expected "P.args" [arg-type] +generics_paramspec_components.py:60: error: Arguments not allowed after ParamSpec.args [misc] +generics_paramspec_components.py:70: error: Too few arguments [call-arg] +generics_paramspec_components.py:70: error: ParamSpec arguments must be of types "*P.args, **P.kwargs" [misc] +generics_paramspec_components.py:70: error: Argument 3 has incompatible type "**P.kwargs"; expected "P.kwargs" [arg-type] +generics_paramspec_components.py:72: error: Too few arguments [call-arg] +generics_paramspec_components.py:83: error: Argument "x" to "foo" has incompatible type "int"; expected "P.args" [arg-type] +generics_paramspec_components.py:83: error: Argument 2 to "foo" has incompatible type "*P.args"; expected "int" [arg-type] +generics_paramspec_components.py:98: error: Argument 2 to "twice" has incompatible type "str"; expected "int" [arg-type] +generics_paramspec_components.py:98: error: Argument 3 to "twice" has incompatible type "int"; expected "str" [arg-type] """ diff --git a/conformance/results/zuban/generics_paramspec_semantics.toml b/conformance/results/zuban/generics_paramspec_semantics.toml index d25400dca..f6fe67e47 100644 --- a/conformance/results/zuban/generics_paramspec_semantics.toml +++ b/conformance/results/zuban/generics_paramspec_semantics.toml @@ -2,14 +2,14 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -generics_paramspec_semantics.py:26: error: Unexpected keyword argument "a" -generics_paramspec_semantics.py:26: error: Unexpected keyword argument "b" -generics_paramspec_semantics.py:27: error: Argument 2 has incompatible type "str"; expected "bool" -generics_paramspec_semantics.py:61: error: Argument 2 to "func1" has incompatible type "Callable[[NamedArg(int, 'y')], int]"; expected "Callable[[NamedArg(int, 'x')], int]" -generics_paramspec_semantics.py:98: error: Argument 1 has incompatible type "int"; expected "str" -generics_paramspec_semantics.py:108: error: Argument 1 has incompatible type "int"; expected "bool" -generics_paramspec_semantics.py:120: error: Argument 1 has incompatible type "int"; expected "str" -generics_paramspec_semantics.py:127: error: Argument 1 to "expects_int_first" has incompatible type "Callable[[str], int]"; expected "Callable[[int], int]" -generics_paramspec_semantics.py:132: error: Argument 1 to "expects_int_first" has incompatible type "Callable[[NamedArg(int, 'x')], int]"; expected "Callable[[int, Never], int]" -generics_paramspec_semantics.py:137: error: Argument 1 to "expects_int_first" has incompatible type "Callable[[KwArg(int)], int]"; expected "Callable[[int, Never], int]" +generics_paramspec_semantics.py:26: error: Unexpected keyword argument "a" [call-arg] +generics_paramspec_semantics.py:26: error: Unexpected keyword argument "b" [call-arg] +generics_paramspec_semantics.py:27: error: Argument 2 has incompatible type "str"; expected "bool" [arg-type] +generics_paramspec_semantics.py:61: error: Argument 2 to "func1" has incompatible type "Callable[[NamedArg(int, 'y')], int]"; expected "Callable[[NamedArg(int, 'x')], int]" [arg-type] +generics_paramspec_semantics.py:98: error: Argument 1 has incompatible type "int"; expected "str" [arg-type] +generics_paramspec_semantics.py:108: error: Argument 1 has incompatible type "int"; expected "bool" [arg-type] +generics_paramspec_semantics.py:120: error: Argument 1 has incompatible type "int"; expected "str" [arg-type] +generics_paramspec_semantics.py:127: error: Argument 1 to "expects_int_first" has incompatible type "Callable[[str], int]"; expected "Callable[[int], int]" [arg-type] +generics_paramspec_semantics.py:132: error: Argument 1 to "expects_int_first" has incompatible type "Callable[[NamedArg(int, 'x')], int]"; expected "Callable[[int, Never], int]" [arg-type] +generics_paramspec_semantics.py:137: error: Argument 1 to "expects_int_first" has incompatible type "Callable[[KwArg(int)], int]"; expected "Callable[[int, Never], int]" [arg-type] """ diff --git a/conformance/results/zuban/generics_paramspec_specialization.toml b/conformance/results/zuban/generics_paramspec_specialization.toml index aa32f55b0..70ea88ccc 100644 --- a/conformance/results/zuban/generics_paramspec_specialization.toml +++ b/conformance/results/zuban/generics_paramspec_specialization.toml @@ -2,9 +2,9 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -generics_paramspec_specialization.py:44: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "int" -generics_paramspec_specialization.py:54: error: Argument 1 has incompatible type "str"; expected "int" -generics_paramspec_specialization.py:55: error: Argument 3 has incompatible type "str"; expected "bool" -generics_paramspec_specialization.py:60: error: Argument 1 has incompatible type "str"; expected "int" -generics_paramspec_specialization.py:61: error: Argument 3 has incompatible type "str"; expected "bool" +generics_paramspec_specialization.py:44: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "int" [misc] +generics_paramspec_specialization.py:54: error: Argument 1 has incompatible type "str"; expected "int" [arg-type] +generics_paramspec_specialization.py:55: error: Argument 3 has incompatible type "str"; expected "bool" [arg-type] +generics_paramspec_specialization.py:60: error: Argument 1 has incompatible type "str"; expected "int" [arg-type] +generics_paramspec_specialization.py:61: error: Argument 3 has incompatible type "str"; expected "bool" [arg-type] """ diff --git a/conformance/results/zuban/generics_scoping.toml b/conformance/results/zuban/generics_scoping.toml index 4d20365fd..19c63482e 100644 --- a/conformance/results/zuban/generics_scoping.toml +++ b/conformance/results/zuban/generics_scoping.toml @@ -4,28 +4,28 @@ False negative on generic class nested within generic class with same type varia """ conformance_automated = "Fail" errors_diff = """ -Line 80: Unexpected errors ['generics_scoping.py:80: error: Type variable "T" is bound by an outer class'] +Line 80: Unexpected errors ['generics_scoping.py:80: error: Type variable "T" is bound by an outer class [misc]'] """ output = """ -generics_scoping.py:29: error: Argument 1 to "meth_2" of "MyClass" has incompatible type "str"; expected "int" -generics_scoping.py:50: error: Type variable "generics_scoping.S" is unbound +generics_scoping.py:29: error: Argument 1 to "meth_2" of "MyClass" has incompatible type "str"; expected "int" [arg-type] +generics_scoping.py:50: error: Type variable "generics_scoping.S" is unbound [misc] generics_scoping.py:50: note: (Hint: Use "Generic[S]" or "Protocol[S]" base class to bind "S" inside a class) generics_scoping.py:50: note: (Hint: Use "S" in function signature to bind "S" inside a function) -generics_scoping.py:54: error: Type variable "generics_scoping.S" is unbound +generics_scoping.py:54: error: Type variable "generics_scoping.S" is unbound [misc] generics_scoping.py:54: note: (Hint: Use "Generic[S]" or "Protocol[S]" base class to bind "S" inside a class) generics_scoping.py:54: note: (Hint: Use "S" in function signature to bind "S" inside a function) -generics_scoping.py:65: error: Free type variable expected in Generic[...] -generics_scoping.py:75: error: Type variable "T" is bound by an outer class -generics_scoping.py:78: error: Type variable "T" is bound by an outer class -generics_scoping.py:80: error: Type variable "T" is bound by an outer class -generics_scoping.py:87: error: Can't use bound type variable "T" to define generic alias -generics_scoping.py:94: error: Type variable "generics_scoping.T" is unbound +generics_scoping.py:65: error: Free type variable expected in Generic[...] [misc] +generics_scoping.py:75: error: Type variable "T" is bound by an outer class [misc] +generics_scoping.py:78: error: Type variable "T" is bound by an outer class [misc] +generics_scoping.py:80: error: Type variable "T" is bound by an outer class [misc] +generics_scoping.py:87: error: Can't use bound type variable "T" to define generic alias [misc] +generics_scoping.py:94: error: Type variable "generics_scoping.T" is unbound [misc] generics_scoping.py:94: note: (Hint: Use "Generic[T]" or "Protocol[T]" base class to bind "T" inside a class) generics_scoping.py:94: note: (Hint: Use "T" in function signature to bind "T" inside a function) -generics_scoping.py:95: error: Type variable "generics_scoping.T" is unbound +generics_scoping.py:95: error: Type variable "generics_scoping.T" is unbound [misc] generics_scoping.py:95: note: (Hint: Use "Generic[T]" or "Protocol[T]" base class to bind "T" inside a class) generics_scoping.py:95: note: (Hint: Use "T" in function signature to bind "T" inside a function) -generics_scoping.py:96: error: Type variable "generics_scoping.T" is unbound +generics_scoping.py:96: error: Type variable "generics_scoping.T" is unbound [misc] generics_scoping.py:96: note: (Hint: Use "Generic[T]" or "Protocol[T]" base class to bind "T" inside a class) generics_scoping.py:96: note: (Hint: Use "T" in function signature to bind "T" inside a function) """ diff --git a/conformance/results/zuban/generics_self_advanced.toml b/conformance/results/zuban/generics_self_advanced.toml index ddd4e1d21..16e410b4f 100644 --- a/conformance/results/zuban/generics_self_advanced.toml +++ b/conformance/results/zuban/generics_self_advanced.toml @@ -4,10 +4,10 @@ True positive: Writing to a variable that contains Self (with a class) should er """ conformance_automated = "Fail" errors_diff = """ -Line 43: Unexpected errors ['generics_self_advanced.py:43: error: Access to generic instance variables via class is ambiguous'] -Line 44: Unexpected errors ['generics_self_advanced.py:44: error: Access to generic instance variables via class is ambiguous'] +Line 43: Unexpected errors ['generics_self_advanced.py:43: error: Access to generic instance variables via class is ambiguous [misc]'] +Line 44: Unexpected errors ['generics_self_advanced.py:44: error: Access to generic instance variables via class is ambiguous [misc]'] """ output = """ -generics_self_advanced.py:43: error: Access to generic instance variables via class is ambiguous -generics_self_advanced.py:44: error: Access to generic instance variables via class is ambiguous +generics_self_advanced.py:43: error: Access to generic instance variables via class is ambiguous [misc] +generics_self_advanced.py:44: error: Access to generic instance variables via class is ambiguous [misc] """ diff --git a/conformance/results/zuban/generics_self_attributes.toml b/conformance/results/zuban/generics_self_attributes.toml index 1c95e98a6..449b88a32 100644 --- a/conformance/results/zuban/generics_self_attributes.toml +++ b/conformance/results/zuban/generics_self_attributes.toml @@ -2,6 +2,6 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -generics_self_attributes.py:26: error: Argument "next" to "OrdinalLinkedList" has incompatible type "LinkedList[int]"; expected "OrdinalLinkedList | None" -generics_self_attributes.py:32: error: Incompatible types in assignment (expression has type "LinkedList[int]", variable has type "OrdinalLinkedList | None") +generics_self_attributes.py:26: error: Argument "next" to "OrdinalLinkedList" has incompatible type "LinkedList[int]"; expected "OrdinalLinkedList | None" [arg-type] +generics_self_attributes.py:32: error: Incompatible types in assignment (expression has type "LinkedList[int]", variable has type "OrdinalLinkedList | None") [assignment] """ diff --git a/conformance/results/zuban/generics_self_basic.toml b/conformance/results/zuban/generics_self_basic.toml index 60e1b62b2..7bb339c7a 100644 --- a/conformance/results/zuban/generics_self_basic.toml +++ b/conformance/results/zuban/generics_self_basic.toml @@ -2,7 +2,7 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -generics_self_basic.py:20: error: Incompatible return value type (got "Shape", expected "Self") -generics_self_basic.py:33: error: Incompatible return value type (got "Shape", expected "Self") -generics_self_basic.py:67: error: Self type cannot have type arguments +generics_self_basic.py:20: error: Incompatible return value type (got "Shape", expected "Self") [return-value] +generics_self_basic.py:33: error: Incompatible return value type (got "Shape", expected "Self") [return-value] +generics_self_basic.py:67: error: Self type cannot have type arguments [valid-type] """ diff --git a/conformance/results/zuban/generics_self_protocols.toml b/conformance/results/zuban/generics_self_protocols.toml index b62c21667..7d25923b6 100644 --- a/conformance/results/zuban/generics_self_protocols.toml +++ b/conformance/results/zuban/generics_self_protocols.toml @@ -2,13 +2,13 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -generics_self_protocols.py:61: error: Argument 1 to "accepts_shape" has incompatible type "BadReturnType"; expected "ShapeProtocol" +generics_self_protocols.py:61: error: Argument 1 to "accepts_shape" has incompatible type "BadReturnType"; expected "ShapeProtocol" [arg-type] generics_self_protocols.py:61: note: Following member(s) of "BadReturnType" have conflicts: generics_self_protocols.py:61: note: Expected: generics_self_protocols.py:61: note: def [Self: BadReturnType] set_scale(self, scale: float) -> Self generics_self_protocols.py:61: note: Got: generics_self_protocols.py:61: note: def set_scale(self, scale: float) -> int -generics_self_protocols.py:64: error: Argument 1 to "accepts_shape" has incompatible type "ReturnDifferentClass"; expected "ShapeProtocol" +generics_self_protocols.py:64: error: Argument 1 to "accepts_shape" has incompatible type "ReturnDifferentClass"; expected "ShapeProtocol" [arg-type] generics_self_protocols.py:64: note: Following member(s) of "ReturnDifferentClass" have conflicts: generics_self_protocols.py:64: note: Expected: generics_self_protocols.py:64: note: def [Self: ReturnDifferentClass] set_scale(self, scale: float) -> Self diff --git a/conformance/results/zuban/generics_self_usage.toml b/conformance/results/zuban/generics_self_usage.toml index b3c5b50f8..eae8958de 100644 --- a/conformance/results/zuban/generics_self_usage.toml +++ b/conformance/results/zuban/generics_self_usage.toml @@ -6,17 +6,17 @@ errors_diff = """ Line 82: Expected 1 errors Line 111: Expected 1 errors Line 116: Expected 1 errors -Line 50: Unexpected errors ['generics_self_usage.py:50: error: Incompatible types in assignment (expression has type "Callable[[CallableAttribute], int]", variable has type "Callable[[Self], int]")'] +Line 50: Unexpected errors ['generics_self_usage.py:50: error: Incompatible types in assignment (expression has type "Callable[[CallableAttribute], int]", variable has type "Callable[[Self], int]") [assignment]'] """ output = """ -generics_self_usage.py:50: error: Incompatible types in assignment (expression has type "Callable[[CallableAttribute], int]", variable has type "Callable[[Self], int]") -generics_self_usage.py:73: error: Self type is only allowed in annotations within class definition -generics_self_usage.py:73: error: Self type is only allowed in annotations within class definition -generics_self_usage.py:76: error: Self type is only allowed in annotations within class definition -generics_self_usage.py:86: error: Incompatible return value type (got "Foo3", expected "Self") -generics_self_usage.py:101: error: Self type is only allowed in annotations within class definition -generics_self_usage.py:103: error: Self type is only allowed in annotations within class definition -generics_self_usage.py:106: error: Self type cannot be used in type alias target -generics_self_usage.py:121: error: Self type cannot be used in a metaclass -generics_self_usage.py:125: error: Self type cannot be used in a metaclass +generics_self_usage.py:50: error: Incompatible types in assignment (expression has type "Callable[[CallableAttribute], int]", variable has type "Callable[[Self], int]") [assignment] +generics_self_usage.py:73: error: Self type is only allowed in annotations within class definition [misc] +generics_self_usage.py:73: error: Self type is only allowed in annotations within class definition [misc] +generics_self_usage.py:76: error: Self type is only allowed in annotations within class definition [misc] +generics_self_usage.py:86: error: Incompatible return value type (got "Foo3", expected "Self") [return-value] +generics_self_usage.py:101: error: Self type is only allowed in annotations within class definition [misc] +generics_self_usage.py:103: error: Self type is only allowed in annotations within class definition [misc] +generics_self_usage.py:106: error: Self type cannot be used in type alias target [misc] +generics_self_usage.py:121: error: Self type cannot be used in a metaclass [misc] +generics_self_usage.py:125: error: Self type cannot be used in a metaclass [misc] """ diff --git a/conformance/results/zuban/generics_syntax_compatibility.toml b/conformance/results/zuban/generics_syntax_compatibility.toml index 77ec435b5..9eb19efc3 100644 --- a/conformance/results/zuban/generics_syntax_compatibility.toml +++ b/conformance/results/zuban/generics_syntax_compatibility.toml @@ -2,6 +2,6 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -generics_syntax_compatibility.py:14: error: All type parameters should be declared ("K" not declared) -generics_syntax_compatibility.py:26: error: All type parameters should be declared ("K" not declared) +generics_syntax_compatibility.py:14: error: All type parameters should be declared ("K" not declared) [misc] +generics_syntax_compatibility.py:26: error: All type parameters should be declared ("K" not declared) [misc] """ diff --git a/conformance/results/zuban/generics_syntax_declarations.toml b/conformance/results/zuban/generics_syntax_declarations.toml index c497a4436..90b4c1512 100644 --- a/conformance/results/zuban/generics_syntax_declarations.toml +++ b/conformance/results/zuban/generics_syntax_declarations.toml @@ -2,16 +2,16 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -generics_syntax_declarations.py:17: error: Generic[...] base class is redundant -generics_syntax_declarations.py:25: error: No arguments expected for "Protocol" base class -generics_syntax_declarations.py:32: error: "T" has no attribute "is_integer" -generics_syntax_declarations.py:44: error: "V" may not be used, because it's defined in an outer class -generics_syntax_declarations.py:48: error: Bracketed expression "[...]" is not valid as a type +generics_syntax_declarations.py:17: error: Generic[...] base class is redundant [misc] +generics_syntax_declarations.py:25: error: No arguments expected for "Protocol" base class [misc] +generics_syntax_declarations.py:32: error: "T" has no attribute "is_integer" [attr-defined] +generics_syntax_declarations.py:44: error: "V" may not be used, because it's defined in an outer class [misc] +generics_syntax_declarations.py:48: error: Bracketed expression "[...]" is not valid as a type [valid-type] generics_syntax_declarations.py:48: note: Did you mean "List[...]"? -generics_syntax_declarations.py:60: error: Type variable must have at least two constrained types -generics_syntax_declarations.py:64: error: Type variable must have at least two constrained types -generics_syntax_declarations.py:71: error: Variable "generics_syntax_declarations.t1" is not valid as a type +generics_syntax_declarations.py:60: error: Type variable must have at least two constrained types [misc] +generics_syntax_declarations.py:64: error: Type variable must have at least two constrained types [misc] +generics_syntax_declarations.py:71: error: Variable "generics_syntax_declarations.t1" is not valid as a type [valid-type] generics_syntax_declarations.py:71: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_declarations.py:75: error: Invalid type: try using Literal[3] instead? -generics_syntax_declarations.py:79: error: Name "S" is not defined +generics_syntax_declarations.py:75: error: Invalid type: try using Literal[3] instead? [valid-type] +generics_syntax_declarations.py:79: error: Name "S" is not defined [name-defined] """ diff --git a/conformance/results/zuban/generics_syntax_infer_variance.toml b/conformance/results/zuban/generics_syntax_infer_variance.toml index cf981f5ec..338d876e9 100644 --- a/conformance/results/zuban/generics_syntax_infer_variance.toml +++ b/conformance/results/zuban/generics_syntax_infer_variance.toml @@ -4,64 +4,64 @@ Type parameter syntax not yet support. """ conformance_automated = "Fail" errors_diff = """ -Line 11: Unexpected errors ['generics_syntax_infer_variance.py:11: error: Unexpected argument to "TypeVar()": "infer_variance"'] -Line 12: Unexpected errors ['generics_syntax_infer_variance.py:12: error: Unexpected argument to "TypeVar()": "infer_variance"'] -Line 13: Unexpected errors ['generics_syntax_infer_variance.py:13: error: Unexpected argument to "TypeVar()": "infer_variance"'] -Line 28: Unexpected errors ['generics_syntax_infer_variance.py:28: error: "ShouldBeCovariant1" expects no type arguments, but 1 given', 'generics_syntax_infer_variance.py:28: error: "ShouldBeCovariant1" expects no type arguments, but 1 given'] -Line 36: Unexpected errors ['generics_syntax_infer_variance.py:36: error: "ShouldBeCovariant2" expects no type arguments, but 1 given', 'generics_syntax_infer_variance.py:36: error: "ShouldBeCovariant2" expects no type arguments, but 1 given'] -Line 41: Unexpected errors ['generics_syntax_infer_variance.py:41: error: "ShouldBeCovariant2" expects no type arguments, but 1 given'] -Line 45: Unexpected errors ['generics_syntax_infer_variance.py:45: error: "ShouldBeCovariant3" expects no type arguments, but 1 given', 'generics_syntax_infer_variance.py:45: error: "ShouldBeCovariant3" expects no type arguments, but 1 given'] -Line 74: Unexpected errors ['generics_syntax_infer_variance.py:74: error: "ShouldBeCovariant5" expects no type arguments, but 1 given', 'generics_syntax_infer_variance.py:74: error: "ShouldBeCovariant5" expects no type arguments, but 1 given'] -Line 85: Unexpected errors ['generics_syntax_infer_variance.py:85: error: "ShouldBeCovariant6" expects no type arguments, but 1 given', 'generics_syntax_infer_variance.py:85: error: "ShouldBeCovariant6" expects no type arguments, but 1 given'] -Line 156: Unexpected errors ['generics_syntax_infer_variance.py:156: error: "ShouldBeContravariant1" expects no type arguments, but 1 given', 'generics_syntax_infer_variance.py:156: error: "ShouldBeContravariant1" expects no type arguments, but 1 given'] +Line 11: Unexpected errors ['generics_syntax_infer_variance.py:11: error: Unexpected argument to "TypeVar()": "infer_variance" [misc]'] +Line 12: Unexpected errors ['generics_syntax_infer_variance.py:12: error: Unexpected argument to "TypeVar()": "infer_variance" [misc]'] +Line 13: Unexpected errors ['generics_syntax_infer_variance.py:13: error: Unexpected argument to "TypeVar()": "infer_variance" [misc]'] +Line 28: Unexpected errors ['generics_syntax_infer_variance.py:28: error: "ShouldBeCovariant1" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_infer_variance.py:28: error: "ShouldBeCovariant1" expects no type arguments, but 1 given [type-arg]'] +Line 36: Unexpected errors ['generics_syntax_infer_variance.py:36: error: "ShouldBeCovariant2" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_infer_variance.py:36: error: "ShouldBeCovariant2" expects no type arguments, but 1 given [type-arg]'] +Line 41: Unexpected errors ['generics_syntax_infer_variance.py:41: error: "ShouldBeCovariant2" expects no type arguments, but 1 given [type-arg]'] +Line 45: Unexpected errors ['generics_syntax_infer_variance.py:45: error: "ShouldBeCovariant3" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_infer_variance.py:45: error: "ShouldBeCovariant3" expects no type arguments, but 1 given [type-arg]'] +Line 74: Unexpected errors ['generics_syntax_infer_variance.py:74: error: "ShouldBeCovariant5" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_infer_variance.py:74: error: "ShouldBeCovariant5" expects no type arguments, but 1 given [type-arg]'] +Line 85: Unexpected errors ['generics_syntax_infer_variance.py:85: error: "ShouldBeCovariant6" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_infer_variance.py:85: error: "ShouldBeCovariant6" expects no type arguments, but 1 given [type-arg]'] +Line 156: Unexpected errors ['generics_syntax_infer_variance.py:156: error: "ShouldBeContravariant1" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_infer_variance.py:156: error: "ShouldBeContravariant1" expects no type arguments, but 1 given [type-arg]'] """ output = """ -generics_syntax_infer_variance.py:11: error: Unexpected argument to "TypeVar()": "infer_variance" -generics_syntax_infer_variance.py:12: error: Unexpected argument to "TypeVar()": "infer_variance" -generics_syntax_infer_variance.py:13: error: Unexpected argument to "TypeVar()": "infer_variance" -generics_syntax_infer_variance.py:15: error: Unexpected argument to "TypeVar()": "infer_variance" -generics_syntax_infer_variance.py:17: error: Unexpected argument to "TypeVar()": "infer_variance" -generics_syntax_infer_variance.py:28: error: "ShouldBeCovariant1" expects no type arguments, but 1 given -generics_syntax_infer_variance.py:28: error: "ShouldBeCovariant1" expects no type arguments, but 1 given -generics_syntax_infer_variance.py:29: error: "ShouldBeCovariant1" expects no type arguments, but 1 given -generics_syntax_infer_variance.py:29: error: "ShouldBeCovariant1" expects no type arguments, but 1 given -generics_syntax_infer_variance.py:36: error: "ShouldBeCovariant2" expects no type arguments, but 1 given -generics_syntax_infer_variance.py:36: error: "ShouldBeCovariant2" expects no type arguments, but 1 given -generics_syntax_infer_variance.py:37: error: "ShouldBeCovariant2" expects no type arguments, but 1 given -generics_syntax_infer_variance.py:37: error: "ShouldBeCovariant2" expects no type arguments, but 1 given -generics_syntax_infer_variance.py:41: error: "ShouldBeCovariant2" expects no type arguments, but 1 given -generics_syntax_infer_variance.py:45: error: "ShouldBeCovariant3" expects no type arguments, but 1 given -generics_syntax_infer_variance.py:45: error: "ShouldBeCovariant3" expects no type arguments, but 1 given -generics_syntax_infer_variance.py:46: error: "ShouldBeCovariant3" expects no type arguments, but 1 given -generics_syntax_infer_variance.py:46: error: "ShouldBeCovariant3" expects no type arguments, but 1 given -generics_syntax_infer_variance.py:74: error: "ShouldBeCovariant5" expects no type arguments, but 1 given -generics_syntax_infer_variance.py:74: error: "ShouldBeCovariant5" expects no type arguments, but 1 given -generics_syntax_infer_variance.py:75: error: "ShouldBeCovariant5" expects no type arguments, but 1 given -generics_syntax_infer_variance.py:75: error: "ShouldBeCovariant5" expects no type arguments, but 1 given -generics_syntax_infer_variance.py:85: error: "ShouldBeCovariant6" expects no type arguments, but 1 given -generics_syntax_infer_variance.py:85: error: "ShouldBeCovariant6" expects no type arguments, but 1 given -generics_syntax_infer_variance.py:86: error: "ShouldBeCovariant6" expects no type arguments, but 1 given -generics_syntax_infer_variance.py:86: error: "ShouldBeCovariant6" expects no type arguments, but 1 given -generics_syntax_infer_variance.py:102: error: "ShouldBeInvariant1" expects no type arguments, but 1 given -generics_syntax_infer_variance.py:102: error: "ShouldBeInvariant1" expects no type arguments, but 1 given -generics_syntax_infer_variance.py:103: error: "ShouldBeInvariant1" expects no type arguments, but 1 given -generics_syntax_infer_variance.py:103: error: "ShouldBeInvariant1" expects no type arguments, but 1 given -generics_syntax_infer_variance.py:117: error: "ShouldBeInvariant2" expects no type arguments, but 1 given -generics_syntax_infer_variance.py:117: error: "ShouldBeInvariant2" expects no type arguments, but 1 given -generics_syntax_infer_variance.py:118: error: "ShouldBeInvariant2" expects no type arguments, but 1 given -generics_syntax_infer_variance.py:118: error: "ShouldBeInvariant2" expects no type arguments, but 1 given -generics_syntax_infer_variance.py:125: error: "ShouldBeInvariant3" expects no type arguments, but 2 given -generics_syntax_infer_variance.py:125: error: "ShouldBeInvariant3" expects no type arguments, but 2 given -generics_syntax_infer_variance.py:126: error: "ShouldBeInvariant3" expects no type arguments, but 2 given -generics_syntax_infer_variance.py:126: error: "ShouldBeInvariant3" expects no type arguments, but 2 given -generics_syntax_infer_variance.py:127: error: "ShouldBeInvariant3" expects no type arguments, but 2 given -generics_syntax_infer_variance.py:127: error: "ShouldBeInvariant3" expects no type arguments, but 2 given -generics_syntax_infer_variance.py:128: error: "ShouldBeInvariant3" expects no type arguments, but 2 given -generics_syntax_infer_variance.py:128: error: "ShouldBeInvariant3" expects no type arguments, but 2 given -generics_syntax_infer_variance.py:136: error: Incompatible types in assignment (expression has type "ShouldBeInvariant4[int]", variable has type "ShouldBeInvariant4[float]") -generics_syntax_infer_variance.py:144: error: Incompatible types in assignment (expression has type "ShouldBeInvariant5[int]", variable has type "ShouldBeInvariant5[float]") -generics_syntax_infer_variance.py:155: error: "ShouldBeContravariant1" expects no type arguments, but 1 given -generics_syntax_infer_variance.py:155: error: "ShouldBeContravariant1" expects no type arguments, but 1 given -generics_syntax_infer_variance.py:156: error: "ShouldBeContravariant1" expects no type arguments, but 1 given -generics_syntax_infer_variance.py:156: error: "ShouldBeContravariant1" expects no type arguments, but 1 given +generics_syntax_infer_variance.py:11: error: Unexpected argument to "TypeVar()": "infer_variance" [misc] +generics_syntax_infer_variance.py:12: error: Unexpected argument to "TypeVar()": "infer_variance" [misc] +generics_syntax_infer_variance.py:13: error: Unexpected argument to "TypeVar()": "infer_variance" [misc] +generics_syntax_infer_variance.py:15: error: Unexpected argument to "TypeVar()": "infer_variance" [misc] +generics_syntax_infer_variance.py:17: error: Unexpected argument to "TypeVar()": "infer_variance" [misc] +generics_syntax_infer_variance.py:28: error: "ShouldBeCovariant1" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:28: error: "ShouldBeCovariant1" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:29: error: "ShouldBeCovariant1" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:29: error: "ShouldBeCovariant1" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:36: error: "ShouldBeCovariant2" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:36: error: "ShouldBeCovariant2" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:37: error: "ShouldBeCovariant2" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:37: error: "ShouldBeCovariant2" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:41: error: "ShouldBeCovariant2" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:45: error: "ShouldBeCovariant3" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:45: error: "ShouldBeCovariant3" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:46: error: "ShouldBeCovariant3" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:46: error: "ShouldBeCovariant3" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:74: error: "ShouldBeCovariant5" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:74: error: "ShouldBeCovariant5" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:75: error: "ShouldBeCovariant5" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:75: error: "ShouldBeCovariant5" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:85: error: "ShouldBeCovariant6" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:85: error: "ShouldBeCovariant6" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:86: error: "ShouldBeCovariant6" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:86: error: "ShouldBeCovariant6" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:102: error: "ShouldBeInvariant1" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:102: error: "ShouldBeInvariant1" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:103: error: "ShouldBeInvariant1" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:103: error: "ShouldBeInvariant1" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:117: error: "ShouldBeInvariant2" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:117: error: "ShouldBeInvariant2" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:118: error: "ShouldBeInvariant2" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:118: error: "ShouldBeInvariant2" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:125: error: "ShouldBeInvariant3" expects no type arguments, but 2 given [type-arg] +generics_syntax_infer_variance.py:125: error: "ShouldBeInvariant3" expects no type arguments, but 2 given [type-arg] +generics_syntax_infer_variance.py:126: error: "ShouldBeInvariant3" expects no type arguments, but 2 given [type-arg] +generics_syntax_infer_variance.py:126: error: "ShouldBeInvariant3" expects no type arguments, but 2 given [type-arg] +generics_syntax_infer_variance.py:127: error: "ShouldBeInvariant3" expects no type arguments, but 2 given [type-arg] +generics_syntax_infer_variance.py:127: error: "ShouldBeInvariant3" expects no type arguments, but 2 given [type-arg] +generics_syntax_infer_variance.py:128: error: "ShouldBeInvariant3" expects no type arguments, but 2 given [type-arg] +generics_syntax_infer_variance.py:128: error: "ShouldBeInvariant3" expects no type arguments, but 2 given [type-arg] +generics_syntax_infer_variance.py:136: error: Incompatible types in assignment (expression has type "ShouldBeInvariant4[int]", variable has type "ShouldBeInvariant4[float]") [assignment] +generics_syntax_infer_variance.py:144: error: Incompatible types in assignment (expression has type "ShouldBeInvariant5[int]", variable has type "ShouldBeInvariant5[float]") [assignment] +generics_syntax_infer_variance.py:155: error: "ShouldBeContravariant1" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:155: error: "ShouldBeContravariant1" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:156: error: "ShouldBeContravariant1" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:156: error: "ShouldBeContravariant1" expects no type arguments, but 1 given [type-arg] """ diff --git a/conformance/results/zuban/generics_syntax_scoping.toml b/conformance/results/zuban/generics_syntax_scoping.toml index d00420b47..3d864b80f 100644 --- a/conformance/results/zuban/generics_syntax_scoping.toml +++ b/conformance/results/zuban/generics_syntax_scoping.toml @@ -7,37 +7,37 @@ errors_diff = """ Line 92: Expected 1 errors Line 95: Expected 1 errors Line 98: Expected 1 errors -Line 31: Unexpected errors ['generics_syntax_scoping.py:31: error: Type variable "generics_syntax_scoping.T" is unbound'] -Line 56: Unexpected errors ['generics_syntax_scoping.py:56: error: Name "S" already defined on line 55'] -Line 62: Unexpected errors ['generics_syntax_scoping.py:62: error: Expression is of type "TypeVar", not "str"'] -Line 88: Unexpected errors ['generics_syntax_scoping.py:88: error: Argument 1 has incompatible type "Type[ClassE]"; expected "Callable[Never, Never]"'] -Line 90: Unexpected errors ['generics_syntax_scoping.py:90: error: Name "T" already defined on line 89'] -Line 106: Unexpected errors ['generics_syntax_scoping.py:106: error: Name "T" already defined on line 105'] -Line 108: Unexpected errors ['generics_syntax_scoping.py:108: error: Expression is of type "TypeVar", not "int"'] -Line 116: Unexpected errors ['generics_syntax_scoping.py:116: error: Expression is of type "int", not "TypeVar"'] -Line 121: Unexpected errors ['generics_syntax_scoping.py:121: error: Expression is of type "TypeVar", not "complex"'] -Line 124: Unexpected errors ['generics_syntax_scoping.py:124: error: Expression is of type "TypeVar", not "complex"'] +Line 31: Unexpected errors ['generics_syntax_scoping.py:31: error: Type variable "generics_syntax_scoping.T" is unbound [misc]'] +Line 56: Unexpected errors ['generics_syntax_scoping.py:56: error: Name "S" already defined on line 55 [no-redef]'] +Line 62: Unexpected errors ['generics_syntax_scoping.py:62: error: Expression is of type "TypeVar", not "str" [misc]'] +Line 88: Unexpected errors ['generics_syntax_scoping.py:88: error: Argument 1 has incompatible type "Type[ClassE]"; expected "Callable[Never, Never]" [arg-type]'] +Line 90: Unexpected errors ['generics_syntax_scoping.py:90: error: Name "T" already defined on line 89 [no-redef]'] +Line 106: Unexpected errors ['generics_syntax_scoping.py:106: error: Name "T" already defined on line 105 [no-redef]'] +Line 108: Unexpected errors ['generics_syntax_scoping.py:108: error: Expression is of type "TypeVar", not "int" [misc]'] +Line 116: Unexpected errors ['generics_syntax_scoping.py:116: error: Expression is of type "int", not "TypeVar" [misc]'] +Line 121: Unexpected errors ['generics_syntax_scoping.py:121: error: Expression is of type "TypeVar", not "complex" [misc]'] +Line 124: Unexpected errors ['generics_syntax_scoping.py:124: error: Expression is of type "TypeVar", not "complex" [misc]'] """ output = """ -generics_syntax_scoping.py:14: error: Variable "generics_syntax_scoping.S" is not valid as a type +generics_syntax_scoping.py:14: error: Variable "generics_syntax_scoping.S" is not valid as a type [valid-type] generics_syntax_scoping.py:14: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_scoping.py:18: error: Variable "generics_syntax_scoping.T" is not valid as a type +generics_syntax_scoping.py:18: error: Variable "generics_syntax_scoping.T" is not valid as a type [valid-type] generics_syntax_scoping.py:18: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_scoping.py:31: error: Type variable "generics_syntax_scoping.T" is unbound +generics_syntax_scoping.py:31: error: Type variable "generics_syntax_scoping.T" is unbound [misc] generics_syntax_scoping.py:31: note: (Hint: Use "Generic[T]" or "Protocol[T]" base class to bind "T" inside a class) generics_syntax_scoping.py:31: note: (Hint: Use "T" in function signature to bind "T" inside a function) -generics_syntax_scoping.py:35: error: Name "T" is used before definition -generics_syntax_scoping.py:44: error: Argument 1 has incompatible type "Type[ClassD]"; expected "Callable[Never, Never]" -generics_syntax_scoping.py:44: error: Name "T" is used before definition -generics_syntax_scoping.py:44: error: Variable "generics_syntax_scoping.T" is not valid as a type +generics_syntax_scoping.py:35: error: Name "T" is used before definition [used-before-def] +generics_syntax_scoping.py:44: error: Argument 1 has incompatible type "Type[ClassD]"; expected "Callable[Never, Never]" [arg-type] +generics_syntax_scoping.py:44: error: Name "T" is used before definition [used-before-def] +generics_syntax_scoping.py:44: error: Variable "generics_syntax_scoping.T" is not valid as a type [valid-type] generics_syntax_scoping.py:44: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_scoping.py:56: error: Name "S" already defined on line 55 -generics_syntax_scoping.py:62: error: Expression is of type "TypeVar", not "str" -generics_syntax_scoping.py:88: error: Argument 1 has incompatible type "Type[ClassE]"; expected "Callable[Never, Never]" -generics_syntax_scoping.py:90: error: Name "T" already defined on line 89 -generics_syntax_scoping.py:106: error: Name "T" already defined on line 105 -generics_syntax_scoping.py:108: error: Expression is of type "TypeVar", not "int" -generics_syntax_scoping.py:116: error: Expression is of type "int", not "TypeVar" -generics_syntax_scoping.py:121: error: Expression is of type "TypeVar", not "complex" -generics_syntax_scoping.py:124: error: Expression is of type "TypeVar", not "complex" +generics_syntax_scoping.py:56: error: Name "S" already defined on line 55 [no-redef] +generics_syntax_scoping.py:62: error: Expression is of type "TypeVar", not "str" [misc] +generics_syntax_scoping.py:88: error: Argument 1 has incompatible type "Type[ClassE]"; expected "Callable[Never, Never]" [arg-type] +generics_syntax_scoping.py:90: error: Name "T" already defined on line 89 [no-redef] +generics_syntax_scoping.py:106: error: Name "T" already defined on line 105 [no-redef] +generics_syntax_scoping.py:108: error: Expression is of type "TypeVar", not "int" [misc] +generics_syntax_scoping.py:116: error: Expression is of type "int", not "TypeVar" [misc] +generics_syntax_scoping.py:121: error: Expression is of type "TypeVar", not "complex" [misc] +generics_syntax_scoping.py:124: error: Expression is of type "TypeVar", not "complex" [misc] """ diff --git a/conformance/results/zuban/generics_type_erasure.toml b/conformance/results/zuban/generics_type_erasure.toml index 01da12864..403b62d09 100644 --- a/conformance/results/zuban/generics_type_erasure.toml +++ b/conformance/results/zuban/generics_type_erasure.toml @@ -4,17 +4,17 @@ True positive: Undefined type vars should be inferred as Never not Any (avoiding """ conformance_automated = "Fail" errors_diff = """ -Line 19: Unexpected errors ['generics_type_erasure.py:19: error: Expression is of type "Node[Never]", not "Node[Any]"'] -Line 22: Unexpected errors ['generics_type_erasure.py:22: error: Expression is of type "Never", not "Any"'] +Line 19: Unexpected errors ['generics_type_erasure.py:19: error: Expression is of type "Node[Never]", not "Node[Any]" [misc]'] +Line 22: Unexpected errors ['generics_type_erasure.py:22: error: Expression is of type "Never", not "Any" [misc]'] """ output = """ -generics_type_erasure.py:19: error: Expression is of type "Node[Never]", not "Node[Any]" -generics_type_erasure.py:22: error: Expression is of type "Never", not "Any" -generics_type_erasure.py:38: error: Argument 1 to "Node" has incompatible type "str"; expected "int | None" -generics_type_erasure.py:40: error: Argument 1 to "Node" has incompatible type "int"; expected "str | None" -generics_type_erasure.py:42: error: Access to generic instance variables via class is ambiguous -generics_type_erasure.py:43: error: Access to generic instance variables via class is ambiguous -generics_type_erasure.py:44: error: Access to generic instance variables via class is ambiguous -generics_type_erasure.py:45: error: Access to generic instance variables via class is ambiguous -generics_type_erasure.py:46: error: Access to generic instance variables via class is ambiguous +generics_type_erasure.py:19: error: Expression is of type "Node[Never]", not "Node[Any]" [misc] +generics_type_erasure.py:22: error: Expression is of type "Never", not "Any" [misc] +generics_type_erasure.py:38: error: Argument 1 to "Node" has incompatible type "str"; expected "int | None" [arg-type] +generics_type_erasure.py:40: error: Argument 1 to "Node" has incompatible type "int"; expected "str | None" [arg-type] +generics_type_erasure.py:42: error: Access to generic instance variables via class is ambiguous [misc] +generics_type_erasure.py:43: error: Access to generic instance variables via class is ambiguous [misc] +generics_type_erasure.py:44: error: Access to generic instance variables via class is ambiguous [misc] +generics_type_erasure.py:45: error: Access to generic instance variables via class is ambiguous [misc] +generics_type_erasure.py:46: error: Access to generic instance variables via class is ambiguous [misc] """ diff --git a/conformance/results/zuban/generics_typevartuple_args.toml b/conformance/results/zuban/generics_typevartuple_args.toml index 1253bce91..e3d4632d5 100644 --- a/conformance/results/zuban/generics_typevartuple_args.toml +++ b/conformance/results/zuban/generics_typevartuple_args.toml @@ -8,12 +8,12 @@ Line 75: Expected 1 errors Line 76: Expected 1 errors """ output = """ -generics_typevartuple_args.py:33: error: Argument 3 to "exec_le" has incompatible type "str"; expected "Env" -generics_typevartuple_args.py:34: error: Argument 3 to "exec_le" has incompatible type "str"; expected "Env" -generics_typevartuple_args.py:48: error: Argument 2 to "func1" has incompatible type "str"; expected "int" -generics_typevartuple_args.py:57: error: Argument 2 to "func2" has incompatible type "int"; expected "str" -generics_typevartuple_args.py:58: error: Too few arguments for "func2" -generics_typevartuple_args.py:59: error: Too few arguments for "func2" -generics_typevartuple_args.py:59: error: Argument 1 to "func2" has incompatible type "str"; expected "int" -generics_typevartuple_args.py:67: error: Too few arguments for "func3" +generics_typevartuple_args.py:33: error: Argument 3 to "exec_le" has incompatible type "str"; expected "Env" [arg-type] +generics_typevartuple_args.py:34: error: Argument 3 to "exec_le" has incompatible type "str"; expected "Env" [arg-type] +generics_typevartuple_args.py:48: error: Argument 2 to "func1" has incompatible type "str"; expected "int" [arg-type] +generics_typevartuple_args.py:57: error: Argument 2 to "func2" has incompatible type "int"; expected "str" [arg-type] +generics_typevartuple_args.py:58: error: Too few arguments for "func2" [call-arg] +generics_typevartuple_args.py:59: error: Too few arguments for "func2" [call-arg] +generics_typevartuple_args.py:59: error: Argument 1 to "func2" has incompatible type "str"; expected "int" [arg-type] +generics_typevartuple_args.py:67: error: Too few arguments for "func3" [call-arg] """ diff --git a/conformance/results/zuban/generics_typevartuple_basic.toml b/conformance/results/zuban/generics_typevartuple_basic.toml index 300c70d5b..50dd49ad2 100644 --- a/conformance/results/zuban/generics_typevartuple_basic.toml +++ b/conformance/results/zuban/generics_typevartuple_basic.toml @@ -9,23 +9,23 @@ Line 89: Expected 1 errors Line 90: Expected 1 errors Line 99: Expected 1 errors Line 100: Expected 1 errors -Line 54: Unexpected errors ['generics_typevartuple_basic.py:54: error: Incompatible types in assignment (expression has type "tuple[Any]", variable has type "tuple[Unpack[Shape]]")'] -Line 57: Unexpected errors ['generics_typevartuple_basic.py:57: error: Incompatible return value type (got "tuple[Unpack[Shape]]", expected "tuple[Any]")'] -Line 84: Unexpected errors ['generics_typevartuple_basic.py:84: error: Expression is of type "tuple[Literal[0, 1]]", not "tuple[int]"'] +Line 54: Unexpected errors ['generics_typevartuple_basic.py:54: error: Incompatible types in assignment (expression has type "tuple[Any]", variable has type "tuple[Unpack[Shape]]") [assignment]'] +Line 57: Unexpected errors ['generics_typevartuple_basic.py:57: error: Incompatible return value type (got "tuple[Unpack[Shape]]", expected "tuple[Any]") [return-value]'] +Line 84: Unexpected errors ['generics_typevartuple_basic.py:84: error: Expression is of type "tuple[Literal[0, 1]]", not "tuple[int]" [misc]'] """ output = """ -generics_typevartuple_basic.py:42: error: Argument 1 to "Array" has incompatible type "Height"; expected "tuple[Height, Width]" -generics_typevartuple_basic.py:43: error: Argument 1 to "Array" has incompatible type "tuple[Batch, Width]"; expected "tuple[Batch, Height, Width]" -generics_typevartuple_basic.py:45: error: Argument 1 to "Array" has incompatible type "tuple[Time, Batch, Width, Height]"; expected "tuple[Time, Batch, Height, Width]" -generics_typevartuple_basic.py:52: error: Free type variable expected in Generic[...] -generics_typevartuple_basic.py:53: error: TypeVarTuple "Shape" is only valid with an unpack -generics_typevartuple_basic.py:54: error: Incompatible types in assignment (expression has type "tuple[Any]", variable has type "tuple[Unpack[Shape]]") -generics_typevartuple_basic.py:56: error: TypeVarTuple "Shape" is only valid with an unpack -generics_typevartuple_basic.py:57: error: Incompatible return value type (got "tuple[Unpack[Shape]]", expected "tuple[Any]") -generics_typevartuple_basic.py:59: error: TypeVarTuple "Shape" is only valid with an unpack -generics_typevartuple_basic.py:65: error: Unexpected keyword argument "covariant" for "TypeVarTuple" -generics_typevartuple_basic.py:66: error: Too many positional arguments for "TypeVarTuple" -generics_typevartuple_basic.py:67: error: Unexpected keyword argument "bound" for "TypeVarTuple" -generics_typevartuple_basic.py:84: error: Expression is of type "tuple[Literal[0, 1]]", not "tuple[int]" -generics_typevartuple_basic.py:106: error: Can only use one type var tuple in a class def +generics_typevartuple_basic.py:42: error: Argument 1 to "Array" has incompatible type "Height"; expected "tuple[Height, Width]" [arg-type] +generics_typevartuple_basic.py:43: error: Argument 1 to "Array" has incompatible type "tuple[Batch, Width]"; expected "tuple[Batch, Height, Width]" [arg-type] +generics_typevartuple_basic.py:45: error: Argument 1 to "Array" has incompatible type "tuple[Time, Batch, Width, Height]"; expected "tuple[Time, Batch, Height, Width]" [arg-type] +generics_typevartuple_basic.py:52: error: Free type variable expected in Generic[...] [misc] +generics_typevartuple_basic.py:53: error: TypeVarTuple "Shape" is only valid with an unpack [valid-type] +generics_typevartuple_basic.py:54: error: Incompatible types in assignment (expression has type "tuple[Any]", variable has type "tuple[Unpack[Shape]]") [assignment] +generics_typevartuple_basic.py:56: error: TypeVarTuple "Shape" is only valid with an unpack [valid-type] +generics_typevartuple_basic.py:57: error: Incompatible return value type (got "tuple[Unpack[Shape]]", expected "tuple[Any]") [return-value] +generics_typevartuple_basic.py:59: error: TypeVarTuple "Shape" is only valid with an unpack [valid-type] +generics_typevartuple_basic.py:65: error: Unexpected keyword argument "covariant" for "TypeVarTuple" [call-arg] +generics_typevartuple_basic.py:66: error: Too many positional arguments for "TypeVarTuple" [call-arg] +generics_typevartuple_basic.py:67: error: Unexpected keyword argument "bound" for "TypeVarTuple" [call-arg] +generics_typevartuple_basic.py:84: error: Expression is of type "tuple[Literal[0, 1]]", not "tuple[int]" [misc] +generics_typevartuple_basic.py:106: error: Can only use one type var tuple in a class def [misc] """ diff --git a/conformance/results/zuban/generics_typevartuple_callable.toml b/conformance/results/zuban/generics_typevartuple_callable.toml index 6692b4b4f..d18ba3c57 100644 --- a/conformance/results/zuban/generics_typevartuple_callable.toml +++ b/conformance/results/zuban/generics_typevartuple_callable.toml @@ -2,5 +2,5 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -generics_typevartuple_callable.py:26: error: Argument "args" to "Process" has incompatible type "tuple[str, int]"; expected "tuple[int, str]" +generics_typevartuple_callable.py:26: error: Argument "args" to "Process" has incompatible type "tuple[str, int]"; expected "tuple[int, str]" [arg-type] """ diff --git a/conformance/results/zuban/generics_typevartuple_specialization.toml b/conformance/results/zuban/generics_typevartuple_specialization.toml index 0ace1caab..e7148e564 100644 --- a/conformance/results/zuban/generics_typevartuple_specialization.toml +++ b/conformance/results/zuban/generics_typevartuple_specialization.toml @@ -2,11 +2,11 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -generics_typevartuple_specialization.py:109: error: Unpack is only valid in a variadic position -generics_typevartuple_specialization.py:109: error: TypeVarTuple "Ts" is unbound -generics_typevartuple_specialization.py:110: error: Unpack is only valid in a variadic position -generics_typevartuple_specialization.py:121: error: More than one Unpack in a type is not allowed -generics_typevartuple_specialization.py:122: error: More than one Unpack in a type is not allowed -generics_typevartuple_specialization.py:127: error: Bad number of arguments for type alias, expected at least 2, given 2 -generics_typevartuple_specialization.py:163: error: TypeVarTuple cannot be split +generics_typevartuple_specialization.py:109: error: Unpack is only valid in a variadic position [misc] +generics_typevartuple_specialization.py:109: error: TypeVarTuple "Ts" is unbound [misc] +generics_typevartuple_specialization.py:110: error: Unpack is only valid in a variadic position [misc] +generics_typevartuple_specialization.py:121: error: More than one Unpack in a type is not allowed [misc] +generics_typevartuple_specialization.py:122: error: More than one Unpack in a type is not allowed [misc] +generics_typevartuple_specialization.py:127: error: Bad number of arguments for type alias, expected at least 2, given 2 [misc] +generics_typevartuple_specialization.py:163: error: TypeVarTuple cannot be split [misc] """ diff --git a/conformance/results/zuban/generics_typevartuple_unpack.toml b/conformance/results/zuban/generics_typevartuple_unpack.toml index 4f43a5231..5f2652dd0 100644 --- a/conformance/results/zuban/generics_typevartuple_unpack.toml +++ b/conformance/results/zuban/generics_typevartuple_unpack.toml @@ -2,5 +2,5 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -generics_typevartuple_unpack.py:30: error: Argument 1 to "process_batch_channels" has incompatible type "Array[Batch]"; expected "Array[Batch, Unpack[Tuple[Any, ...]], Channels]" +generics_typevartuple_unpack.py:30: error: Argument 1 to "process_batch_channels" has incompatible type "Array[Batch]"; expected "Array[Batch, Unpack[Tuple[Any, ...]], Channels]" [arg-type] """ diff --git a/conformance/results/zuban/generics_upper_bound.toml b/conformance/results/zuban/generics_upper_bound.toml index 60e86bbaf..c1b62c749 100644 --- a/conformance/results/zuban/generics_upper_bound.toml +++ b/conformance/results/zuban/generics_upper_bound.toml @@ -7,7 +7,7 @@ errors_diff = """ Line 24: Expected 1 errors """ output = """ -generics_upper_bound.py:51: error: Value of type variable "ST" of "longer" cannot be "int" -generics_upper_bound.py:51: error: Value of type variable "ST" of "longer" cannot be "int" -generics_upper_bound.py:56: error: TypeVar cannot have both values and an upper bound +generics_upper_bound.py:51: error: Value of type variable "ST" of "longer" cannot be "int" [type-var] +generics_upper_bound.py:51: error: Value of type variable "ST" of "longer" cannot be "int" [type-var] +generics_upper_bound.py:56: error: TypeVar cannot have both values and an upper bound [misc] """ diff --git a/conformance/results/zuban/generics_variance.toml b/conformance/results/zuban/generics_variance.toml index a363a8378..b051fcdbb 100644 --- a/conformance/results/zuban/generics_variance.toml +++ b/conformance/results/zuban/generics_variance.toml @@ -12,11 +12,11 @@ Lines 141, 142: Expected error (tag 'CoContra_Child5') Lines 195, 196: Expected error (tag 'ContraToContraToContra_WithTA') """ output = """ -generics_variance.py:14: error: TypeVar cannot be both covariant and contravariant -generics_variance.py:77: error: Variance of TypeVar "T_co" incompatible with variance in parent type -generics_variance.py:81: error: Variance of TypeVar "T_contra" incompatible with variance in parent type -generics_variance.py:93: error: Variance of TypeVar "T_contra" incompatible with variance in parent type -generics_variance.py:105: error: Variance of TypeVar "T_co" incompatible with variance in parent type -generics_variance.py:126: error: Variance of TypeVar "T_co" incompatible with variance in parent type -generics_variance.py:132: error: Variance of TypeVar "T_contra" incompatible with variance in parent type +generics_variance.py:14: error: TypeVar cannot be both covariant and contravariant [misc] +generics_variance.py:77: error: Variance of TypeVar "T_co" incompatible with variance in parent type [type-var] +generics_variance.py:81: error: Variance of TypeVar "T_contra" incompatible with variance in parent type [type-var] +generics_variance.py:93: error: Variance of TypeVar "T_contra" incompatible with variance in parent type [type-var] +generics_variance.py:105: error: Variance of TypeVar "T_co" incompatible with variance in parent type [type-var] +generics_variance.py:126: error: Variance of TypeVar "T_co" incompatible with variance in parent type [type-var] +generics_variance.py:132: error: Variance of TypeVar "T_contra" incompatible with variance in parent type [type-var] """ diff --git a/conformance/results/zuban/generics_variance_inference.toml b/conformance/results/zuban/generics_variance_inference.toml index 1ffa25b3b..722cb1739 100644 --- a/conformance/results/zuban/generics_variance_inference.toml +++ b/conformance/results/zuban/generics_variance_inference.toml @@ -2,27 +2,27 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -generics_variance_inference.py:24: error: Incompatible types in assignment (expression has type "ClassA[float, int, int]", variable has type "ClassA[int, int, int]") -generics_variance_inference.py:25: error: Incompatible types in assignment (expression has type "ClassA[float, int, int]", variable has type "ClassA[float, float, int]") -generics_variance_inference.py:28: error: Incompatible types in assignment (expression has type "ClassA[int, float, float]", variable has type "ClassA[int, int, int]") -generics_variance_inference.py:41: error: Incompatible types in assignment (expression has type "ShouldBeCovariant1[float]", variable has type "ShouldBeCovariant1[int]") -generics_variance_inference.py:49: error: Incompatible types in assignment (expression has type "ShouldBeCovariant2[float]", variable has type "ShouldBeCovariant2[int]") -generics_variance_inference.py:58: error: Incompatible types in assignment (expression has type "ShouldBeCovariant3[float]", variable has type "ShouldBeCovariant3[int]") -generics_variance_inference.py:67: error: Incompatible types in assignment (expression has type "ShouldBeCovariant4[float]", variable has type "ShouldBeCovariant4[int]") -generics_variance_inference.py:80: error: Incompatible types in assignment (expression has type "ShouldBeCovariant5[float]", variable has type "ShouldBeCovariant5[int]") -generics_variance_inference.py:96: error: Incompatible types in assignment (expression has type "ShouldBeInvariant1[int]", variable has type "ShouldBeInvariant1[float]") -generics_variance_inference.py:97: error: Incompatible types in assignment (expression has type "ShouldBeInvariant1[float]", variable has type "ShouldBeInvariant1[int]") -generics_variance_inference.py:111: error: Incompatible types in assignment (expression has type "ShouldBeInvariant2[int]", variable has type "ShouldBeInvariant2[float]") -generics_variance_inference.py:112: error: Incompatible types in assignment (expression has type "ShouldBeInvariant2[float]", variable has type "ShouldBeInvariant2[int]") -generics_variance_inference.py:119: error: Incompatible types in assignment (expression has type "ShouldBeInvariant3[int, str]", variable has type "ShouldBeInvariant3[float, str]") -generics_variance_inference.py:120: error: Incompatible types in assignment (expression has type "ShouldBeInvariant3[float, str]", variable has type "ShouldBeInvariant3[int, str]") -generics_variance_inference.py:121: error: Incompatible types in assignment (expression has type "ShouldBeInvariant3[str, int]", variable has type "ShouldBeInvariant3[str, float]") -generics_variance_inference.py:122: error: Incompatible types in assignment (expression has type "ShouldBeInvariant3[str, float]", variable has type "ShouldBeInvariant3[str, int]") -generics_variance_inference.py:130: error: Incompatible types in assignment (expression has type "ShouldBeInvariant4[int]", variable has type "ShouldBeInvariant4[float]") -generics_variance_inference.py:138: error: Incompatible types in assignment (expression has type "ShouldBeInvariant5[int]", variable has type "ShouldBeInvariant5[float]") -generics_variance_inference.py:149: error: Incompatible types in assignment (expression has type "ShouldBeContravariant1[int]", variable has type "ShouldBeContravariant1[float]") -generics_variance_inference.py:169: error: Incompatible types in assignment (expression has type "ShouldBeInvariant6[float]", variable has type "ShouldBeInvariant6[int]") -generics_variance_inference.py:170: error: Incompatible types in assignment (expression has type "ShouldBeInvariant6[int]", variable has type "ShouldBeInvariant6[float]") -generics_variance_inference.py:181: error: Incompatible types in assignment (expression has type "ShouldBeCovariant6[float]", variable has type "ShouldBeCovariant6[int]") -generics_variance_inference.py:194: error: Incompatible types in assignment (expression has type "ShouldBeContravariant2[int]", variable has type "ShouldBeContravariant2[float]") +generics_variance_inference.py:24: error: Incompatible types in assignment (expression has type "ClassA[float, int, int]", variable has type "ClassA[int, int, int]") [assignment] +generics_variance_inference.py:25: error: Incompatible types in assignment (expression has type "ClassA[float, int, int]", variable has type "ClassA[float, float, int]") [assignment] +generics_variance_inference.py:28: error: Incompatible types in assignment (expression has type "ClassA[int, float, float]", variable has type "ClassA[int, int, int]") [assignment] +generics_variance_inference.py:41: error: Incompatible types in assignment (expression has type "ShouldBeCovariant1[float]", variable has type "ShouldBeCovariant1[int]") [assignment] +generics_variance_inference.py:49: error: Incompatible types in assignment (expression has type "ShouldBeCovariant2[float]", variable has type "ShouldBeCovariant2[int]") [assignment] +generics_variance_inference.py:58: error: Incompatible types in assignment (expression has type "ShouldBeCovariant3[float]", variable has type "ShouldBeCovariant3[int]") [assignment] +generics_variance_inference.py:67: error: Incompatible types in assignment (expression has type "ShouldBeCovariant4[float]", variable has type "ShouldBeCovariant4[int]") [assignment] +generics_variance_inference.py:80: error: Incompatible types in assignment (expression has type "ShouldBeCovariant5[float]", variable has type "ShouldBeCovariant5[int]") [assignment] +generics_variance_inference.py:96: error: Incompatible types in assignment (expression has type "ShouldBeInvariant1[int]", variable has type "ShouldBeInvariant1[float]") [assignment] +generics_variance_inference.py:97: error: Incompatible types in assignment (expression has type "ShouldBeInvariant1[float]", variable has type "ShouldBeInvariant1[int]") [assignment] +generics_variance_inference.py:111: error: Incompatible types in assignment (expression has type "ShouldBeInvariant2[int]", variable has type "ShouldBeInvariant2[float]") [assignment] +generics_variance_inference.py:112: error: Incompatible types in assignment (expression has type "ShouldBeInvariant2[float]", variable has type "ShouldBeInvariant2[int]") [assignment] +generics_variance_inference.py:119: error: Incompatible types in assignment (expression has type "ShouldBeInvariant3[int, str]", variable has type "ShouldBeInvariant3[float, str]") [assignment] +generics_variance_inference.py:120: error: Incompatible types in assignment (expression has type "ShouldBeInvariant3[float, str]", variable has type "ShouldBeInvariant3[int, str]") [assignment] +generics_variance_inference.py:121: error: Incompatible types in assignment (expression has type "ShouldBeInvariant3[str, int]", variable has type "ShouldBeInvariant3[str, float]") [assignment] +generics_variance_inference.py:122: error: Incompatible types in assignment (expression has type "ShouldBeInvariant3[str, float]", variable has type "ShouldBeInvariant3[str, int]") [assignment] +generics_variance_inference.py:130: error: Incompatible types in assignment (expression has type "ShouldBeInvariant4[int]", variable has type "ShouldBeInvariant4[float]") [assignment] +generics_variance_inference.py:138: error: Incompatible types in assignment (expression has type "ShouldBeInvariant5[int]", variable has type "ShouldBeInvariant5[float]") [assignment] +generics_variance_inference.py:149: error: Incompatible types in assignment (expression has type "ShouldBeContravariant1[int]", variable has type "ShouldBeContravariant1[float]") [assignment] +generics_variance_inference.py:169: error: Incompatible types in assignment (expression has type "ShouldBeInvariant6[float]", variable has type "ShouldBeInvariant6[int]") [assignment] +generics_variance_inference.py:170: error: Incompatible types in assignment (expression has type "ShouldBeInvariant6[int]", variable has type "ShouldBeInvariant6[float]") [assignment] +generics_variance_inference.py:181: error: Incompatible types in assignment (expression has type "ShouldBeCovariant6[float]", variable has type "ShouldBeCovariant6[int]") [assignment] +generics_variance_inference.py:194: error: Incompatible types in assignment (expression has type "ShouldBeContravariant2[int]", variable has type "ShouldBeContravariant2[float]") [assignment] """ diff --git a/conformance/results/zuban/historical_positional.toml b/conformance/results/zuban/historical_positional.toml index 50a395d0d..5d5888464 100644 --- a/conformance/results/zuban/historical_positional.toml +++ b/conformance/results/zuban/historical_positional.toml @@ -8,10 +8,10 @@ conformance_automated = "Fail" errors_diff = """ Line 26: Expected 1 errors Line 38: Expected 1 errors -Line 53: Unexpected errors ['historical_positional.py:53: error: Unexpected keyword argument "__y" for "f4"'] +Line 53: Unexpected errors ['historical_positional.py:53: error: Unexpected keyword argument "__y" for "f4" [call-arg]'] """ output = """ -historical_positional.py:18: error: Unexpected keyword argument "__x" for "f1" -historical_positional.py:43: error: Unexpected keyword argument "__x" for "m1" of "A" -historical_positional.py:53: error: Unexpected keyword argument "__y" for "f4" +historical_positional.py:18: error: Unexpected keyword argument "__x" for "f1" [call-arg] +historical_positional.py:43: error: Unexpected keyword argument "__x" for "m1" of "A" [call-arg] +historical_positional.py:53: error: Unexpected keyword argument "__y" for "f4" [call-arg] """ diff --git a/conformance/results/zuban/literals_interactions.toml b/conformance/results/zuban/literals_interactions.toml index 8beb65e72..40c6f282b 100644 --- a/conformance/results/zuban/literals_interactions.toml +++ b/conformance/results/zuban/literals_interactions.toml @@ -4,14 +4,14 @@ Does not narrow type of `x` with `x in Literal` type guard pattern. """ conformance_automated = "Fail" errors_diff = """ -Line 106: Unexpected errors ['literals_interactions.py:106: error: Argument 1 to "expects_bad_status" has incompatible type "str"; expected "Literal[\\'MALFORMED\\', \\'ABORTED\\']"'] -Line 109: Unexpected errors ['literals_interactions.py:109: error: Argument 1 to "expects_pending_status" has incompatible type "str"; expected "Literal[\\'PENDING\\']"'] +Line 106: Unexpected errors ['literals_interactions.py:106: error: Argument 1 to "expects_bad_status" has incompatible type "str"; expected "Literal[\\'MALFORMED\\', \\'ABORTED\\']" [arg-type]'] +Line 109: Unexpected errors ['literals_interactions.py:109: error: Argument 1 to "expects_pending_status" has incompatible type "str"; expected "Literal[\\'PENDING\\']" [arg-type]'] """ output = """ -literals_interactions.py:15: error: Tuple index out of range -literals_interactions.py:16: error: Tuple index out of range -literals_interactions.py:17: error: Tuple index out of range -literals_interactions.py:18: error: Tuple index out of range -literals_interactions.py:106: error: Argument 1 to "expects_bad_status" has incompatible type "str"; expected "Literal['MALFORMED', 'ABORTED']" -literals_interactions.py:109: error: Argument 1 to "expects_pending_status" has incompatible type "str"; expected "Literal['PENDING']" +literals_interactions.py:15: error: Tuple index out of range [misc] +literals_interactions.py:16: error: Tuple index out of range [misc] +literals_interactions.py:17: error: Tuple index out of range [misc] +literals_interactions.py:18: error: Tuple index out of range [misc] +literals_interactions.py:106: error: Argument 1 to "expects_bad_status" has incompatible type "str"; expected "Literal['MALFORMED', 'ABORTED']" [arg-type] +literals_interactions.py:109: error: Argument 1 to "expects_pending_status" has incompatible type "str"; expected "Literal['PENDING']" [arg-type] """ diff --git a/conformance/results/zuban/literals_literalstring.toml b/conformance/results/zuban/literals_literalstring.toml index fbc6b507f..c223e5f64 100644 --- a/conformance/results/zuban/literals_literalstring.toml +++ b/conformance/results/zuban/literals_literalstring.toml @@ -8,15 +8,15 @@ Line 66: Expected 1 errors Line 120: Expected 1 errors Line 134: Expected 1 errors Line 171: Expected 1 errors -Line 157: Unexpected errors ["literals_literalstring.py:157: error: Overloaded function signature 3 will never be matched: signature 2's parameter type(s) are the same or broader"] -Line 167: Unexpected errors ['literals_literalstring.py:167: error: Expression is of type "B", not "A"'] +Line 157: Unexpected errors ["literals_literalstring.py:157: error: Overloaded function signature 3 will never be matched: signature 2's parameter type(s) are the same or broader [overload-cannot-match]"] +Line 167: Unexpected errors ['literals_literalstring.py:167: error: Expression is of type "B", not "A" [misc]'] """ output = """ -literals_literalstring.py:36: error: Parameter 2 of Literal[...] is invalid -literals_literalstring.py:37: error: Parameter 1 of Literal[...] is invalid -literals_literalstring.py:43: error: Incompatible types in assignment (expression has type "Literal['two']", variable has type "Literal['']") -literals_literalstring.py:74: error: Incompatible types in assignment (expression has type "int", variable has type "str") -literals_literalstring.py:75: error: Incompatible types in assignment (expression has type "bytes", variable has type "str") -literals_literalstring.py:157: error: Overloaded function signature 3 will never be matched: signature 2's parameter type(s) are the same or broader -literals_literalstring.py:167: error: Expression is of type "B", not "A" +literals_literalstring.py:36: error: Parameter 2 of Literal[...] is invalid [valid-type] +literals_literalstring.py:37: error: Parameter 1 of Literal[...] is invalid [valid-type] +literals_literalstring.py:43: error: Incompatible types in assignment (expression has type "Literal['two']", variable has type "Literal['']") [assignment] +literals_literalstring.py:74: error: Incompatible types in assignment (expression has type "int", variable has type "str") [assignment] +literals_literalstring.py:75: error: Incompatible types in assignment (expression has type "bytes", variable has type "str") [assignment] +literals_literalstring.py:157: error: Overloaded function signature 3 will never be matched: signature 2's parameter type(s) are the same or broader [overload-cannot-match] +literals_literalstring.py:167: error: Expression is of type "B", not "A" [misc] """ diff --git a/conformance/results/zuban/literals_parameterizations.toml b/conformance/results/zuban/literals_parameterizations.toml index 06c6df1b4..fd128510e 100644 --- a/conformance/results/zuban/literals_parameterizations.toml +++ b/conformance/results/zuban/literals_parameterizations.toml @@ -2,23 +2,23 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -literals_parameterizations.py:41: error: Invalid type: Literal[...] cannot contain arbitrary expressions -literals_parameterizations.py:42: error: Invalid type: Literal[...] cannot contain arbitrary expressions -literals_parameterizations.py:43: error: Invalid type: Literal[...] cannot contain arbitrary expressions -literals_parameterizations.py:44: error: Invalid type: Literal[...] cannot contain arbitrary expressions -literals_parameterizations.py:45: error: Invalid type: Literal[...] cannot contain arbitrary expressions -literals_parameterizations.py:46: error: Invalid type: Literal[...] cannot contain arbitrary expressions -literals_parameterizations.py:47: error: Invalid type: Literal[...] cannot contain arbitrary expressions -literals_parameterizations.py:48: error: Parameter 1 of Literal[...] is invalid -literals_parameterizations.py:49: error: Parameter 1 of Literal[...] is invalid -literals_parameterizations.py:50: error: Type variable "literals_parameterizations.T" is unbound +literals_parameterizations.py:41: error: Invalid type: Literal[...] cannot contain arbitrary expressions [valid-type] +literals_parameterizations.py:42: error: Invalid type: Literal[...] cannot contain arbitrary expressions [valid-type] +literals_parameterizations.py:43: error: Invalid type: Literal[...] cannot contain arbitrary expressions [valid-type] +literals_parameterizations.py:44: error: Invalid type: Literal[...] cannot contain arbitrary expressions [valid-type] +literals_parameterizations.py:45: error: Invalid type: Literal[...] cannot contain arbitrary expressions [valid-type] +literals_parameterizations.py:46: error: Invalid type: Literal[...] cannot contain arbitrary expressions [valid-type] +literals_parameterizations.py:47: error: Invalid type: Literal[...] cannot contain arbitrary expressions [valid-type] +literals_parameterizations.py:48: error: Parameter 1 of Literal[...] is invalid [valid-type] +literals_parameterizations.py:49: error: Parameter 1 of Literal[...] is invalid [valid-type] +literals_parameterizations.py:50: error: Type variable "literals_parameterizations.T" is unbound [misc] literals_parameterizations.py:50: note: (Hint: Use "Generic[T]" or "Protocol[T]" base class to bind "T" inside a class) literals_parameterizations.py:50: note: (Hint: Use "T" in function signature to bind "T" inside a function) -literals_parameterizations.py:51: error: Parameter 1 of Literal[...] cannot be of type "float" -literals_parameterizations.py:52: error: Parameter 1 of Literal[...] cannot be of type "Any" -literals_parameterizations.py:53: error: Invalid type: Literal[...] cannot contain arbitrary expressions -literals_parameterizations.py:56: error: Invalid type: Literal[...] cannot contain arbitrary expressions -literals_parameterizations.py:60: error: Literal[...] must have at least one parameter -literals_parameterizations.py:61: error: Parameter 1 of Literal[...] is invalid -literals_parameterizations.py:65: error: Incompatible types in assignment (expression has type "Literal[Color.RED]", variable has type "Literal['Color.RED']") +literals_parameterizations.py:51: error: Parameter 1 of Literal[...] cannot be of type "float" [valid-type] +literals_parameterizations.py:52: error: Parameter 1 of Literal[...] cannot be of type "Any" [valid-type] +literals_parameterizations.py:53: error: Invalid type: Literal[...] cannot contain arbitrary expressions [valid-type] +literals_parameterizations.py:56: error: Invalid type: Literal[...] cannot contain arbitrary expressions [valid-type] +literals_parameterizations.py:60: error: Literal[...] must have at least one parameter [valid-type] +literals_parameterizations.py:61: error: Parameter 1 of Literal[...] is invalid [valid-type] +literals_parameterizations.py:65: error: Incompatible types in assignment (expression has type "Literal[Color.RED]", variable has type "Literal['Color.RED']") [assignment] """ diff --git a/conformance/results/zuban/literals_semantics.toml b/conformance/results/zuban/literals_semantics.toml index 053b2add6..ccd8e842f 100644 --- a/conformance/results/zuban/literals_semantics.toml +++ b/conformance/results/zuban/literals_semantics.toml @@ -2,8 +2,8 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -literals_semantics.py:10: error: Incompatible types in assignment (expression has type "Literal[4]", variable has type "Literal[3]") -literals_semantics.py:24: error: Incompatible types in assignment (expression has type "Literal[0]", variable has type "Literal[False]") -literals_semantics.py:25: error: Incompatible types in assignment (expression has type "Literal[False]", variable has type "Literal[0]") -literals_semantics.py:33: error: Incompatible types in assignment (expression has type "int", variable has type "Literal[3, 4, 5]") +literals_semantics.py:10: error: Incompatible types in assignment (expression has type "Literal[4]", variable has type "Literal[3]") [assignment] +literals_semantics.py:24: error: Incompatible types in assignment (expression has type "Literal[0]", variable has type "Literal[False]") [assignment] +literals_semantics.py:25: error: Incompatible types in assignment (expression has type "Literal[False]", variable has type "Literal[0]") [assignment] +literals_semantics.py:33: error: Incompatible types in assignment (expression has type "int", variable has type "Literal[3, 4, 5]") [assignment] """ diff --git a/conformance/results/zuban/namedtuples_define_class.toml b/conformance/results/zuban/namedtuples_define_class.toml index 22fde13ae..397c708f7 100644 --- a/conformance/results/zuban/namedtuples_define_class.toml +++ b/conformance/results/zuban/namedtuples_define_class.toml @@ -7,15 +7,15 @@ errors_diff = """ Line 79: Expected 1 errors """ output = """ -namedtuples_define_class.py:32: error: Tuple index out of range -namedtuples_define_class.py:33: error: Tuple index out of range -namedtuples_define_class.py:44: error: Missing positional argument "y" in call to "Point" -namedtuples_define_class.py:45: error: Missing positional argument "y" in call to "Point" -namedtuples_define_class.py:46: error: Argument 2 to "Point" has incompatible type "str"; expected "int" -namedtuples_define_class.py:47: error: Argument "units" to "Point" has incompatible type "int"; expected "str" -namedtuples_define_class.py:48: error: Too many arguments for "Point" -namedtuples_define_class.py:49: error: Unexpected keyword argument "other" for "Point" -namedtuples_define_class.py:59: error: Non-default NamedTuple fields cannot follow default fields -namedtuples_define_class.py:98: error: Argument 2 to "Property" has incompatible type "float"; expected "str" -namedtuples_define_class.py:105: error: NamedTuple should be a single base +namedtuples_define_class.py:32: error: Tuple index out of range [misc] +namedtuples_define_class.py:33: error: Tuple index out of range [misc] +namedtuples_define_class.py:44: error: Missing positional argument "y" in call to "Point" [call-arg] +namedtuples_define_class.py:45: error: Missing positional argument "y" in call to "Point" [call-arg] +namedtuples_define_class.py:46: error: Argument 2 to "Point" has incompatible type "str"; expected "int" [arg-type] +namedtuples_define_class.py:47: error: Argument "units" to "Point" has incompatible type "int"; expected "str" [arg-type] +namedtuples_define_class.py:48: error: Too many arguments for "Point" [call-arg] +namedtuples_define_class.py:49: error: Unexpected keyword argument "other" for "Point" [call-arg] +namedtuples_define_class.py:59: error: Non-default NamedTuple fields cannot follow default fields [misc] +namedtuples_define_class.py:98: error: Argument 2 to "Property" has incompatible type "float"; expected "str" [arg-type] +namedtuples_define_class.py:105: error: NamedTuple should be a single base [misc] """ diff --git a/conformance/results/zuban/namedtuples_define_functional.toml b/conformance/results/zuban/namedtuples_define_functional.toml index 3c3045694..5a6041664 100644 --- a/conformance/results/zuban/namedtuples_define_functional.toml +++ b/conformance/results/zuban/namedtuples_define_functional.toml @@ -2,16 +2,16 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -namedtuples_define_functional.py:16: error: Missing positional argument "y" in call to "Point1" -namedtuples_define_functional.py:21: error: Missing positional arguments "x", "y" in call to "Point2" -namedtuples_define_functional.py:26: error: Too many arguments for "Point3" -namedtuples_define_functional.py:31: error: Unexpected keyword argument "z" for "Point4" -namedtuples_define_functional.py:36: error: Argument 2 to "Point5" has incompatible type "str"; expected "int" -namedtuples_define_functional.py:37: error: Too many arguments for "Point5" -namedtuples_define_functional.py:42: error: Argument 2 to "Point6" has incompatible type "str"; expected "int" -namedtuples_define_functional.py:43: error: Argument "x" to "Point6" has incompatible type "float"; expected "int" -namedtuples_define_functional.py:52: error: "namedtuple()" has duplicate field name "a" -namedtuples_define_functional.py:53: error: "namedtuple()" field name "def" is a keyword -namedtuples_define_functional.py:54: error: "namedtuple()" field name "def" is a keyword -namedtuples_define_functional.py:66: error: Missing positional argument "a" in call to "NT5" +namedtuples_define_functional.py:16: error: Missing positional argument "y" in call to "Point1" [call-arg] +namedtuples_define_functional.py:21: error: Missing positional arguments "x", "y" in call to "Point2" [call-arg] +namedtuples_define_functional.py:26: error: Too many arguments for "Point3" [call-arg] +namedtuples_define_functional.py:31: error: Unexpected keyword argument "z" for "Point4" [call-arg] +namedtuples_define_functional.py:36: error: Argument 2 to "Point5" has incompatible type "str"; expected "int" [arg-type] +namedtuples_define_functional.py:37: error: Too many arguments for "Point5" [call-arg] +namedtuples_define_functional.py:42: error: Argument 2 to "Point6" has incompatible type "str"; expected "int" [arg-type] +namedtuples_define_functional.py:43: error: Argument "x" to "Point6" has incompatible type "float"; expected "int" [arg-type] +namedtuples_define_functional.py:52: error: "namedtuple()" has duplicate field name "a" [misc] +namedtuples_define_functional.py:53: error: "namedtuple()" field name "def" is a keyword [misc] +namedtuples_define_functional.py:54: error: "namedtuple()" field name "def" is a keyword [misc] +namedtuples_define_functional.py:66: error: Missing positional argument "a" in call to "NT5" [call-arg] """ diff --git a/conformance/results/zuban/namedtuples_type_compat.toml b/conformance/results/zuban/namedtuples_type_compat.toml index 958d58be0..bddb6fd78 100644 --- a/conformance/results/zuban/namedtuples_type_compat.toml +++ b/conformance/results/zuban/namedtuples_type_compat.toml @@ -2,6 +2,6 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -namedtuples_type_compat.py:22: error: Incompatible types in assignment (expression has type "Point", variable has type "tuple[int, int]") -namedtuples_type_compat.py:23: error: Incompatible types in assignment (expression has type "Point", variable has type "tuple[int, str, str]") +namedtuples_type_compat.py:22: error: Incompatible types in assignment (expression has type "Point", variable has type "tuple[int, int]") [assignment] +namedtuples_type_compat.py:23: error: Incompatible types in assignment (expression has type "Point", variable has type "tuple[int, str, str]") [assignment] """ diff --git a/conformance/results/zuban/namedtuples_usage.toml b/conformance/results/zuban/namedtuples_usage.toml index 1de5df047..75ebf0e03 100644 --- a/conformance/results/zuban/namedtuples_usage.toml +++ b/conformance/results/zuban/namedtuples_usage.toml @@ -2,12 +2,12 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -namedtuples_usage.py:34: error: Tuple index out of range -namedtuples_usage.py:35: error: Tuple index out of range -namedtuples_usage.py:40: error: Property "x" defined in "Point" is read-only -namedtuples_usage.py:41: error: Unsupported target for indexed assignment ("Point") -namedtuples_usage.py:42: error: NamedTuple attributes cannot be deleted -namedtuples_usage.py:43: error: "Point" has no attribute "__delitem__" -namedtuples_usage.py:52: error: Too many values to unpack (2 expected, 3 provided) -namedtuples_usage.py:53: error: Need more than 3 values to unpack (4 expected) +namedtuples_usage.py:34: error: Tuple index out of range [misc] +namedtuples_usage.py:35: error: Tuple index out of range [misc] +namedtuples_usage.py:40: error: Property "x" defined in "Point" is read-only [misc] +namedtuples_usage.py:41: error: Unsupported target for indexed assignment ("Point") [index] +namedtuples_usage.py:42: error: NamedTuple attributes cannot be deleted [misc] +namedtuples_usage.py:43: error: "Point" has no attribute "__delitem__" [attr-defined] +namedtuples_usage.py:52: error: Too many values to unpack (2 expected, 3 provided) [misc] +namedtuples_usage.py:53: error: Need more than 3 values to unpack (4 expected) [misc] """ diff --git a/conformance/results/zuban/narrowing_typeguard.toml b/conformance/results/zuban/narrowing_typeguard.toml index e63346008..b8892b074 100644 --- a/conformance/results/zuban/narrowing_typeguard.toml +++ b/conformance/results/zuban/narrowing_typeguard.toml @@ -2,8 +2,8 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -narrowing_typeguard.py:102: error: TypeGuard functions must have a positional argument -narrowing_typeguard.py:107: error: TypeGuard functions must have a positional argument -narrowing_typeguard.py:128: error: Argument 1 to "takes_callable_str" has incompatible type "Callable[[object], TypeGuard[int]]"; expected "Callable[[object], str]" -narrowing_typeguard.py:148: error: Argument 1 to "takes_callable_str_proto" has incompatible type "Callable[[object], TypeGuard[int]]"; expected "CallableStrProto" +narrowing_typeguard.py:102: error: TypeGuard functions must have a positional argument [misc] +narrowing_typeguard.py:107: error: TypeGuard functions must have a positional argument [misc] +narrowing_typeguard.py:128: error: Argument 1 to "takes_callable_str" has incompatible type "Callable[[object], TypeGuard[int]]"; expected "Callable[[object], str]" [arg-type] +narrowing_typeguard.py:148: error: Argument 1 to "takes_callable_str_proto" has incompatible type "Callable[[object], TypeGuard[int]]"; expected "CallableStrProto" [arg-type] """ diff --git a/conformance/results/zuban/narrowing_typeis.toml b/conformance/results/zuban/narrowing_typeis.toml index ff20cda3a..e62ce8120 100644 --- a/conformance/results/zuban/narrowing_typeis.toml +++ b/conformance/results/zuban/narrowing_typeis.toml @@ -2,13 +2,13 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -narrowing_typeis.py:105: error: "TypeIs" functions must have a positional argument -narrowing_typeis.py:110: error: "TypeIs" functions must have a positional argument -narrowing_typeis.py:132: error: Argument 1 to "takes_callable_str" has incompatible type "Callable[[object], TypeIs[int]]"; expected "Callable[[object], str]" -narrowing_typeis.py:152: error: Argument 1 to "takes_callable_str_proto" has incompatible type "Callable[[object], TypeIs[int]]"; expected "CallableStrProto" -narrowing_typeis.py:169: error: Argument 1 to "takes_typeguard" has incompatible type "Callable[[object], TypeIs[int]]"; expected "Callable[[object], TypeGuard[int]]" -narrowing_typeis.py:170: error: Argument 1 to "takes_typeis" has incompatible type "Callable[[object], TypeGuard[int]]"; expected "Callable[[object], TypeIs[int]]" -narrowing_typeis.py:191: error: Argument 1 to "takes_int_typeis" has incompatible type "Callable[[object], TypeIs[bool]]"; expected "Callable[[object], TypeIs[int]]" -narrowing_typeis.py:195: error: Narrowed type "str" is not a subtype of input type "int" -narrowing_typeis.py:199: error: Narrowed type "list[int]" is not a subtype of input type "list[object]" +narrowing_typeis.py:105: error: "TypeIs" functions must have a positional argument [misc] +narrowing_typeis.py:110: error: "TypeIs" functions must have a positional argument [misc] +narrowing_typeis.py:132: error: Argument 1 to "takes_callable_str" has incompatible type "Callable[[object], TypeIs[int]]"; expected "Callable[[object], str]" [arg-type] +narrowing_typeis.py:152: error: Argument 1 to "takes_callable_str_proto" has incompatible type "Callable[[object], TypeIs[int]]"; expected "CallableStrProto" [arg-type] +narrowing_typeis.py:169: error: Argument 1 to "takes_typeguard" has incompatible type "Callable[[object], TypeIs[int]]"; expected "Callable[[object], TypeGuard[int]]" [arg-type] +narrowing_typeis.py:170: error: Argument 1 to "takes_typeis" has incompatible type "Callable[[object], TypeGuard[int]]"; expected "Callable[[object], TypeIs[int]]" [arg-type] +narrowing_typeis.py:191: error: Argument 1 to "takes_int_typeis" has incompatible type "Callable[[object], TypeIs[bool]]"; expected "Callable[[object], TypeIs[int]]" [arg-type] +narrowing_typeis.py:195: error: Narrowed type "str" is not a subtype of input type "int" [narrowed-type-not-subtype] +narrowing_typeis.py:199: error: Narrowed type "list[int]" is not a subtype of input type "list[object]" [narrowed-type-not-subtype] """ diff --git a/conformance/results/zuban/overloads_basic.toml b/conformance/results/zuban/overloads_basic.toml index d2a447746..6c3455642 100644 --- a/conformance/results/zuban/overloads_basic.toml +++ b/conformance/results/zuban/overloads_basic.toml @@ -2,7 +2,7 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -overloads_basic.py:39: error: No overload variant of "__getitem__" of "Bytes" matches argument type "str" +overloads_basic.py:39: error: No overload variant of "__getitem__" of "Bytes" matches argument type "str" [call-overload] overloads_basic.py:39: note: Possible overload variants: overloads_basic.py:39: note: def __getitem__(self, int, /) -> int overloads_basic.py:39: note: def __getitem__(self, slice[Any, Any, Any], /) -> bytes diff --git a/conformance/results/zuban/overloads_consistency.toml b/conformance/results/zuban/overloads_consistency.toml index 41c2ec4fb..8d5f032d7 100644 --- a/conformance/results/zuban/overloads_consistency.toml +++ b/conformance/results/zuban/overloads_consistency.toml @@ -2,6 +2,6 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -overloads_consistency.py:28: error: Overloaded function implementation cannot produce return type of signature 2 -overloads_consistency.py:44: error: Overloaded function implementation does not accept all possible arguments of signature 2 +overloads_consistency.py:28: error: Overloaded function implementation cannot produce return type of signature 2 [misc] +overloads_consistency.py:44: error: Overloaded function implementation does not accept all possible arguments of signature 2 [misc] """ diff --git a/conformance/results/zuban/overloads_definitions.toml b/conformance/results/zuban/overloads_definitions.toml index 200451cd1..af18910fa 100644 --- a/conformance/results/zuban/overloads_definitions.toml +++ b/conformance/results/zuban/overloads_definitions.toml @@ -2,16 +2,16 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -overloads_definitions.py:15: error: Single overload definition, multiple required -overloads_definitions.py:28: error: An overloaded function outside a stub file must have an implementation -overloads_definitions.py:59: error: An overloaded function outside a stub file must have an implementation -overloads_definitions.py:71: error: Overload does not consistently use the "@staticmethod" decorator on all function signatures. -overloads_definitions.py:84: error: Overload does not consistently use the "@classmethod" decorator on all function signatures. -overloads_definitions.py:122: error: @final should be applied only to overload implementation -overloads_definitions.py:136: error: @final should be applied only to overload implementation -overloads_definitions.py:141: error: @final should be applied only to overload implementation -overloads_definitions.py:175: error: Cannot override final attribute "final_method" (previously declared in base class "Base") -overloads_definitions.py:190: error: Method "bad_override" is marked as an override, but no base method was found with this name -overloads_definitions.py:221: error: @override should be applied only to overload implementation -overloads_definitions.py:225: error: @override should be applied only to overload implementation +overloads_definitions.py:15: error: Single overload definition, multiple required [misc] +overloads_definitions.py:28: error: An overloaded function outside a stub file must have an implementation [no-overload-impl] +overloads_definitions.py:59: error: An overloaded function outside a stub file must have an implementation [no-overload-impl] +overloads_definitions.py:71: error: Overload does not consistently use the "@staticmethod" decorator on all function signatures. [misc] +overloads_definitions.py:84: error: Overload does not consistently use the "@classmethod" decorator on all function signatures. [misc] +overloads_definitions.py:122: error: @final should be applied only to overload implementation [misc] +overloads_definitions.py:136: error: @final should be applied only to overload implementation [misc] +overloads_definitions.py:141: error: @final should be applied only to overload implementation [misc] +overloads_definitions.py:175: error: Cannot override final attribute "final_method" (previously declared in base class "Base") [misc] +overloads_definitions.py:190: error: Method "bad_override" is marked as an override, but no base method was found with this name [misc] +overloads_definitions.py:221: error: @override should be applied only to overload implementation [misc] +overloads_definitions.py:225: error: @override should be applied only to overload implementation [misc] """ diff --git a/conformance/results/zuban/overloads_definitions_stub.toml b/conformance/results/zuban/overloads_definitions_stub.toml index 8bb641f43..0dbbf6319 100644 --- a/conformance/results/zuban/overloads_definitions_stub.toml +++ b/conformance/results/zuban/overloads_definitions_stub.toml @@ -2,12 +2,12 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -overloads_definitions_stub.pyi:13: error: Single overload definition, multiple required -overloads_definitions_stub.pyi:32: error: Overload does not consistently use the "@staticmethod" decorator on all function signatures. -overloads_definitions_stub.pyi:39: error: Overload does not consistently use the "@classmethod" decorator on all function signatures. -overloads_definitions_stub.pyi:72: error: In a stub file @final must be applied only to the first overload -overloads_definitions_stub.pyi:85: error: In a stub file @final must be applied only to the first overload -overloads_definitions_stub.pyi:107: error: Cannot override final attribute "final_method" (previously declared in base class "Base") -overloads_definitions_stub.pyi:120: error: Method "bad_override" is marked as an override, but no base method was found with this name -overloads_definitions_stub.pyi:146: error: In a stub file @override must be applied only to the first overload +overloads_definitions_stub.pyi:13: error: Single overload definition, multiple required [misc] +overloads_definitions_stub.pyi:32: error: Overload does not consistently use the "@staticmethod" decorator on all function signatures. [misc] +overloads_definitions_stub.pyi:39: error: Overload does not consistently use the "@classmethod" decorator on all function signatures. [misc] +overloads_definitions_stub.pyi:72: error: In a stub file @final must be applied only to the first overload [misc] +overloads_definitions_stub.pyi:85: error: In a stub file @final must be applied only to the first overload [misc] +overloads_definitions_stub.pyi:107: error: Cannot override final attribute "final_method" (previously declared in base class "Base") [misc] +overloads_definitions_stub.pyi:120: error: Method "bad_override" is marked as an override, but no base method was found with this name [misc] +overloads_definitions_stub.pyi:146: error: In a stub file @override must be applied only to the first overload [misc] """ diff --git a/conformance/results/zuban/overloads_evaluation.toml b/conformance/results/zuban/overloads_evaluation.toml index 45c1a5e73..893e0fcba 100644 --- a/conformance/results/zuban/overloads_evaluation.toml +++ b/conformance/results/zuban/overloads_evaluation.toml @@ -8,46 +8,46 @@ Evaluates Any in some cases where overload is not ambiguous. """ conformance_automated = "Fail" errors_diff = """ -Line 134: Unexpected errors ['overloads_evaluation.py:134: error: No overload variant of "expand_bool" matches argument type "bool"'] -Line 135: Unexpected errors ['overloads_evaluation.py:135: error: Expression is of type "Any", not "Literal[0, 1]"'] -Line 160: Unexpected errors ['overloads_evaluation.py:160: error: No overload variant of "expand_enum" matches argument type "Color"'] -Line 161: Unexpected errors ['overloads_evaluation.py:161: error: Expression is of type "Any", not "Literal[0, 1]"'] -Line 204: Unexpected errors ['overloads_evaluation.py:204: error: Argument 1 to "expand_tuple" has incompatible type "tuple[int, int | str]"; expected "tuple[int, int]"'] -Line 205: Unexpected errors ['overloads_evaluation.py:205: error: Expression is of type "int", not "int | str"'] -Line 261: Unexpected errors ['overloads_evaluation.py:261: error: Expression is of type "list[Any]", not "list[int]"'] -Line 264: Unexpected errors ['overloads_evaluation.py:264: error: Expression is of type "list[Any]", not "Any"'] -Line 280: Unexpected errors ['overloads_evaluation.py:280: error: Expression is of type "list[Any]", not "Any"'] -Line 345: Unexpected errors ['overloads_evaluation.py:345: error: Expression is of type "list[Any]", not "Any"'] +Line 134: Unexpected errors ['overloads_evaluation.py:134: error: No overload variant of "expand_bool" matches argument type "bool" [call-overload]'] +Line 135: Unexpected errors ['overloads_evaluation.py:135: error: Expression is of type "Any", not "Literal[0, 1]" [misc]'] +Line 160: Unexpected errors ['overloads_evaluation.py:160: error: No overload variant of "expand_enum" matches argument type "Color" [call-overload]'] +Line 161: Unexpected errors ['overloads_evaluation.py:161: error: Expression is of type "Any", not "Literal[0, 1]" [misc]'] +Line 204: Unexpected errors ['overloads_evaluation.py:204: error: Argument 1 to "expand_tuple" has incompatible type "tuple[int, int | str]"; expected "tuple[int, int]" [arg-type]'] +Line 205: Unexpected errors ['overloads_evaluation.py:205: error: Expression is of type "int", not "int | str" [misc]'] +Line 261: Unexpected errors ['overloads_evaluation.py:261: error: Expression is of type "list[Any]", not "list[int]" [misc]'] +Line 264: Unexpected errors ['overloads_evaluation.py:264: error: Expression is of type "list[Any]", not "Any" [misc]'] +Line 280: Unexpected errors ['overloads_evaluation.py:280: error: Expression is of type "list[Any]", not "Any" [misc]'] +Line 345: Unexpected errors ['overloads_evaluation.py:345: error: Expression is of type "list[Any]", not "Any" [misc]'] """ output = """ -overloads_evaluation.py:38: error: All overload variants of "example1_1" require at least one argument +overloads_evaluation.py:38: error: All overload variants of "example1_1" require at least one argument [call-overload] overloads_evaluation.py:38: note: Possible overload variants: overloads_evaluation.py:38: note: def example1_1(x: int, y: str) -> int overloads_evaluation.py:38: note: def example1_1(x: str) -> str -overloads_evaluation.py:46: error: No overload variant of "example1_1" matches argument types "int", "int" +overloads_evaluation.py:46: error: No overload variant of "example1_1" matches argument types "int", "int" [call-overload] overloads_evaluation.py:46: note: Possible overload variants: overloads_evaluation.py:46: note: def example1_1(x: int, y: str) -> int overloads_evaluation.py:46: note: def example1_1(x: str) -> str -overloads_evaluation.py:51: error: No overload variant of "example1_1" matches argument type "int" +overloads_evaluation.py:51: error: No overload variant of "example1_1" matches argument type "int" [call-overload] overloads_evaluation.py:51: note: Possible overload variants: overloads_evaluation.py:51: note: def example1_1(x: int, y: str) -> int overloads_evaluation.py:51: note: def example1_1(x: str) -> str -overloads_evaluation.py:115: error: Argument 1 to "example2" has incompatible type "int | str"; expected "int" -overloads_evaluation.py:115: error: Argument 2 to "example2" has incompatible type "int | str"; expected "str" -overloads_evaluation.py:134: error: No overload variant of "expand_bool" matches argument type "bool" +overloads_evaluation.py:115: error: Argument 1 to "example2" has incompatible type "int | str"; expected "int" [arg-type] +overloads_evaluation.py:115: error: Argument 2 to "example2" has incompatible type "int | str"; expected "str" [arg-type] +overloads_evaluation.py:134: error: No overload variant of "expand_bool" matches argument type "bool" [call-overload] overloads_evaluation.py:134: note: Possible overload variants: overloads_evaluation.py:134: note: def expand_bool(x: Literal[False]) -> Literal[0] overloads_evaluation.py:134: note: def expand_bool(x: Literal[True]) -> Literal[1] -overloads_evaluation.py:135: error: Expression is of type "Any", not "Literal[0, 1]" -overloads_evaluation.py:160: error: No overload variant of "expand_enum" matches argument type "Color" +overloads_evaluation.py:135: error: Expression is of type "Any", not "Literal[0, 1]" [misc] +overloads_evaluation.py:160: error: No overload variant of "expand_enum" matches argument type "Color" [call-overload] overloads_evaluation.py:160: note: Possible overload variants: overloads_evaluation.py:160: note: def expand_enum(x: Literal[Color.RED]) -> Literal[0] overloads_evaluation.py:160: note: def expand_enum(x: Literal[Color.BLUE]) -> Literal[1] -overloads_evaluation.py:161: error: Expression is of type "Any", not "Literal[0, 1]" -overloads_evaluation.py:204: error: Argument 1 to "expand_tuple" has incompatible type "tuple[int, int | str]"; expected "tuple[int, int]" -overloads_evaluation.py:205: error: Expression is of type "int", not "int | str" -overloads_evaluation.py:261: error: Expression is of type "list[Any]", not "list[int]" -overloads_evaluation.py:264: error: Expression is of type "list[Any]", not "Any" -overloads_evaluation.py:280: error: Expression is of type "list[Any]", not "Any" -overloads_evaluation.py:345: error: Expression is of type "list[Any]", not "Any" +overloads_evaluation.py:161: error: Expression is of type "Any", not "Literal[0, 1]" [misc] +overloads_evaluation.py:204: error: Argument 1 to "expand_tuple" has incompatible type "tuple[int, int | str]"; expected "tuple[int, int]" [arg-type] +overloads_evaluation.py:205: error: Expression is of type "int", not "int | str" [misc] +overloads_evaluation.py:261: error: Expression is of type "list[Any]", not "list[int]" [misc] +overloads_evaluation.py:264: error: Expression is of type "list[Any]", not "Any" [misc] +overloads_evaluation.py:280: error: Expression is of type "list[Any]", not "Any" [misc] +overloads_evaluation.py:345: error: Expression is of type "list[Any]", not "Any" [misc] """ diff --git a/conformance/results/zuban/protocols_class_objects.toml b/conformance/results/zuban/protocols_class_objects.toml index 29f10b1b2..f02bb9de5 100644 --- a/conformance/results/zuban/protocols_class_objects.toml +++ b/conformance/results/zuban/protocols_class_objects.toml @@ -2,24 +2,24 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -protocols_class_objects.py:29: error: Only concrete class can be given where "Type[Proto]" is expected -protocols_class_objects.py:34: error: Can only assign concrete classes to a variable of type "Type[Proto]" -protocols_class_objects.py:58: error: Incompatible types in assignment (expression has type "Type[ConcreteA]", variable has type "ProtoA1") +protocols_class_objects.py:29: error: Only concrete class can be given where "Type[Proto]" is expected [misc] +protocols_class_objects.py:34: error: Can only assign concrete classes to a variable of type "Type[Proto]" [misc] +protocols_class_objects.py:58: error: Incompatible types in assignment (expression has type "Type[ConcreteA]", variable has type "ProtoA1") [assignment] protocols_class_objects.py:58: note: Following member(s) of "ConcreteA" have conflicts: protocols_class_objects.py:58: note: Expected: protocols_class_objects.py:58: note: def method1(x: int) -> int protocols_class_objects.py:58: note: Got: protocols_class_objects.py:58: note: def method1(self: ConcreteA, x: int) -> int -protocols_class_objects.py:74: error: Incompatible types in assignment (expression has type "Type[ConcreteB]", variable has type "ProtoB1") +protocols_class_objects.py:74: error: Incompatible types in assignment (expression has type "Type[ConcreteB]", variable has type "ProtoB1") [assignment] protocols_class_objects.py:74: note: Following member(s) of "ConcreteB" have conflicts: protocols_class_objects.py:74: note: prop1: expected "int", got "property" -protocols_class_objects.py:104: error: Incompatible types in assignment (expression has type "Type[ConcreteC1]", variable has type "ProtoC1") +protocols_class_objects.py:104: error: Incompatible types in assignment (expression has type "Type[ConcreteC1]", variable has type "ProtoC1") [assignment] protocols_class_objects.py:104: note: ClassVar protocol member ProtoC1.attr1 can never be matched by a class object -protocols_class_objects.py:106: error: Incompatible types in assignment (expression has type "Type[ConcreteC2]", variable has type "ProtoC1") +protocols_class_objects.py:106: error: Incompatible types in assignment (expression has type "Type[ConcreteC2]", variable has type "ProtoC1") [assignment] protocols_class_objects.py:106: note: Protocol member ProtoC1.attr1 expected class variable, got instance variable protocols_class_objects.py:106: note: Only class variables allowed for class object access on protocols, attr1 is an instance variable of "ConcreteC2" -protocols_class_objects.py:107: error: Incompatible types in assignment (expression has type "Type[ConcreteC2]", variable has type "ProtoC2") +protocols_class_objects.py:107: error: Incompatible types in assignment (expression has type "Type[ConcreteC2]", variable has type "ProtoC2") [assignment] protocols_class_objects.py:107: note: Only class variables allowed for class object access on protocols, attr1 is an instance variable of "ConcreteC2" -protocols_class_objects.py:108: error: Incompatible types in assignment (expression has type "Type[ConcreteC3]", variable has type "ProtoC1") +protocols_class_objects.py:108: error: Incompatible types in assignment (expression has type "Type[ConcreteC3]", variable has type "ProtoC1") [assignment] protocols_class_objects.py:108: note: ClassVar protocol member ProtoC1.attr1 can never be matched by a class object """ diff --git a/conformance/results/zuban/protocols_definition.toml b/conformance/results/zuban/protocols_definition.toml index a1ce5c87c..b4ca17e49 100644 --- a/conformance/results/zuban/protocols_definition.toml +++ b/conformance/results/zuban/protocols_definition.toml @@ -10,51 +10,51 @@ Line 286: Expected 1 errors Line 288: Expected 1 errors """ output = """ -protocols_definition.py:30: error: List item 0 has incompatible type "int"; expected "SupportsClose" -protocols_definition.py:67: error: Protocol members cannot be defined via assignment to self -protocols_definition.py:67: error: "Template" has no attribute "temp" -protocols_definition.py:114: error: Incompatible types in assignment (expression has type "Concrete2_Bad1", variable has type "Template2") -protocols_definition.py:115: error: Incompatible types in assignment (expression has type "Concrete2_Bad2", variable has type "Template2") +protocols_definition.py:30: error: List item 0 has incompatible type "int"; expected "SupportsClose" [list-item] +protocols_definition.py:67: error: Protocol members cannot be defined via assignment to self [misc] +protocols_definition.py:67: error: "Template" has no attribute "temp" [attr-defined] +protocols_definition.py:114: error: Incompatible types in assignment (expression has type "Concrete2_Bad1", variable has type "Template2") [assignment] +protocols_definition.py:115: error: Incompatible types in assignment (expression has type "Concrete2_Bad2", variable has type "Template2") [assignment] protocols_definition.py:115: note: Following member(s) of "Concrete2_Bad2" have conflicts: protocols_definition.py:115: note: val1: expected "Sequence[int]", got "Sequence[float]" protocols_definition.py:115: note: Protocol member Template2.val1 expected class variable, got instance variable -protocols_definition.py:116: error: Incompatible types in assignment (expression has type "Concrete2_Bad3", variable has type "Template2") +protocols_definition.py:116: error: Incompatible types in assignment (expression has type "Concrete2_Bad3", variable has type "Template2") [assignment] protocols_definition.py:116: note: Following member(s) of "Concrete2_Bad3" have conflicts: protocols_definition.py:116: note: val1: expected "Sequence[int]", got "list[int]" protocols_definition.py:116: note: Protocol member Template2.val1 expected class variable, got instance variable -protocols_definition.py:117: error: Incompatible types in assignment (expression has type "Concrete2_Bad4", variable has type "Template2") +protocols_definition.py:117: error: Incompatible types in assignment (expression has type "Concrete2_Bad4", variable has type "Template2") [assignment] protocols_definition.py:117: note: Protocol member Template2.val1 expected class variable, got instance variable -protocols_definition.py:156: error: Incompatible types in assignment (expression has type "Concrete3_Bad1", variable has type "Template3") -protocols_definition.py:157: error: Incompatible types in assignment (expression has type "Concrete3_Bad2", variable has type "Template3") +protocols_definition.py:156: error: Incompatible types in assignment (expression has type "Concrete3_Bad1", variable has type "Template3") [assignment] +protocols_definition.py:157: error: Incompatible types in assignment (expression has type "Concrete3_Bad2", variable has type "Template3") [assignment] protocols_definition.py:157: note: Protocol member Template3.val1 expected instance variable, got class variable -protocols_definition.py:158: error: Incompatible types in assignment (expression has type "Concrete3_Bad3", variable has type "Template3") +protocols_definition.py:158: error: Incompatible types in assignment (expression has type "Concrete3_Bad3", variable has type "Template3") [assignment] protocols_definition.py:158: note: Protocol member Template3.val1 expected settable variable, got read-only attribute -protocols_definition.py:159: error: Incompatible types in assignment (expression has type "Concrete3_Bad4", variable has type "Template3") +protocols_definition.py:159: error: Incompatible types in assignment (expression has type "Concrete3_Bad4", variable has type "Template3") [assignment] protocols_definition.py:159: note: Following member(s) of "Concrete3_Bad4" have conflicts: protocols_definition.py:159: note: val1: expected "Sequence[int]", got "Sequence[float]" -protocols_definition.py:160: error: Incompatible types in assignment (expression has type "Concrete3_Bad5", variable has type "Template3") +protocols_definition.py:160: error: Incompatible types in assignment (expression has type "Concrete3_Bad5", variable has type "Template3") [assignment] protocols_definition.py:160: note: Following member(s) of "Concrete3_Bad5" have conflicts: protocols_definition.py:160: note: val1: expected "Sequence[int]", got "list[int]" -protocols_definition.py:218: error: Incompatible types in assignment (expression has type "Concrete4_Bad1", variable has type "Template4") +protocols_definition.py:218: error: Incompatible types in assignment (expression has type "Concrete4_Bad1", variable has type "Template4") [assignment] protocols_definition.py:218: note: Following member(s) of "Concrete4_Bad1" have conflicts: protocols_definition.py:218: note: val1: expected "Sequence[float]", got "Callable[[], Sequence[int]]" -protocols_definition.py:219: error: Incompatible types in assignment (expression has type "Concrete4_Bad2", variable has type "Template4") -protocols_definition.py:287: error: Incompatible types in assignment (expression has type "Concrete5_Bad3", variable has type "Template5") +protocols_definition.py:219: error: Incompatible types in assignment (expression has type "Concrete4_Bad2", variable has type "Template4") [assignment] +protocols_definition.py:287: error: Incompatible types in assignment (expression has type "Concrete5_Bad3", variable has type "Template5") [assignment] protocols_definition.py:287: note: Following member(s) of "Concrete5_Bad3" have conflicts: protocols_definition.py:287: note: Expected: protocols_definition.py:287: note: def method1(self, a: int, b: int) -> float protocols_definition.py:287: note: Got: protocols_definition.py:287: note: def method1(self, *, a: int, b: int) -> float -protocols_definition.py:289: error: Incompatible types in assignment (expression has type "Concrete5_Bad5", variable has type "Template5") +protocols_definition.py:289: error: Incompatible types in assignment (expression has type "Concrete5_Bad5", variable has type "Template5") [assignment] protocols_definition.py:289: note: Following member(s) of "Concrete5_Bad5" have conflicts: protocols_definition.py:289: note: Expected: protocols_definition.py:289: note: def method1(self: Template5, a: int, b: int) -> float protocols_definition.py:289: note: Got: protocols_definition.py:289: note: def method1(self: Any, a: int, b: int) -> float -protocols_definition.py:339: error: Incompatible types in assignment (expression has type "Concrete6_Bad1", variable has type "Template6") +protocols_definition.py:339: error: Incompatible types in assignment (expression has type "Concrete6_Bad1", variable has type "Template6") [assignment] protocols_definition.py:339: note: Protocol member Template6.val1 expected settable variable, got read-only attribute -protocols_definition.py:340: error: Incompatible types in assignment (expression has type "Concrete6_Bad2", variable has type "Template6") +protocols_definition.py:340: error: Incompatible types in assignment (expression has type "Concrete6_Bad2", variable has type "Template6") [assignment] protocols_definition.py:340: note: Protocol member Template6.val1 expected settable variable, got read-only attribute -protocols_definition.py:341: error: Incompatible types in assignment (expression has type "Concrete6_Bad3", variable has type "Template6") +protocols_definition.py:341: error: Incompatible types in assignment (expression has type "Concrete6_Bad3", variable has type "Template6") [assignment] protocols_definition.py:341: note: Protocol member Template6.val1 expected settable variable, got read-only attribute """ diff --git a/conformance/results/zuban/protocols_explicit.toml b/conformance/results/zuban/protocols_explicit.toml index 3a515ecf3..4a0f7c2a4 100644 --- a/conformance/results/zuban/protocols_explicit.toml +++ b/conformance/results/zuban/protocols_explicit.toml @@ -8,9 +8,9 @@ Line 90: Expected 1 errors Line 110: Expected 1 errors """ output = """ -protocols_explicit.py:27: error: Call to abstract method "draw" of "PColor" with trivial body via super() is unsafe -protocols_explicit.py:56: error: Incompatible types in assignment (expression has type "tuple[int, int, str]", variable has type "tuple[int, int, int]") -protocols_explicit.py:60: error: Cannot instantiate abstract class "Point" with abstract attributes "intensity" and "transparency" -protocols_explicit.py:135: error: Cannot instantiate abstract class "Concrete5" with abstract attribute "method1" -protocols_explicit.py:165: error: Cannot instantiate abstract class "Concrete7A" with abstract attribute "method1" +protocols_explicit.py:27: error: Call to abstract method "draw" of "PColor" with trivial body via super() is unsafe [safe-super] +protocols_explicit.py:56: error: Incompatible types in assignment (expression has type "tuple[int, int, str]", variable has type "tuple[int, int, int]") [assignment] +protocols_explicit.py:60: error: Cannot instantiate abstract class "Point" with abstract attributes "intensity" and "transparency" [abstract] +protocols_explicit.py:135: error: Cannot instantiate abstract class "Concrete5" with abstract attribute "method1" [abstract] +protocols_explicit.py:165: error: Cannot instantiate abstract class "Concrete7A" with abstract attribute "method1" [abstract] """ diff --git a/conformance/results/zuban/protocols_generic.toml b/conformance/results/zuban/protocols_generic.toml index ab3b3ae35..102540dd1 100644 --- a/conformance/results/zuban/protocols_generic.toml +++ b/conformance/results/zuban/protocols_generic.toml @@ -2,7 +2,7 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -protocols_generic.py:40: error: Incompatible types in assignment (expression has type "Concrete1", variable has type "Proto1[int, str]") +protocols_generic.py:40: error: Incompatible types in assignment (expression has type "Concrete1", variable has type "Proto1[int, str]") [assignment] protocols_generic.py:40: note: Following member(s) of "Concrete1" have conflicts: protocols_generic.py:40: note: Expected: protocols_generic.py:40: note: def method1(self, x: int) -> int @@ -12,25 +12,25 @@ protocols_generic.py:40: note: Expected: protocols_generic.py:40: note: def __iter__(self) -> Iterator[str] protocols_generic.py:40: note: Got: protocols_generic.py:40: note: def __iter__(self) -> Iterator[int] -protocols_generic.py:44: error: Only single Generic[...] or Protocol[...] can be in bases -protocols_generic.py:56: error: Incompatible types in assignment (expression has type "Box[float]", variable has type "Box[int]") -protocols_generic.py:66: error: Incompatible types in assignment (expression has type "Sender[int]", variable has type "Sender[float]") -protocols_generic.py:74: error: Incompatible types in assignment (expression has type "AttrProto[int]", variable has type "AttrProto[float]") -protocols_generic.py:75: error: Incompatible types in assignment (expression has type "AttrProto[float]", variable has type "AttrProto[int]") -protocols_generic.py:145: error: Incompatible types in assignment (expression has type "ConcreteHasProperty2", variable has type "HasPropertyProto") +protocols_generic.py:44: error: Only single Generic[...] or Protocol[...] can be in bases [misc] +protocols_generic.py:56: error: Incompatible types in assignment (expression has type "Box[float]", variable has type "Box[int]") [assignment] +protocols_generic.py:66: error: Incompatible types in assignment (expression has type "Sender[int]", variable has type "Sender[float]") [assignment] +protocols_generic.py:74: error: Incompatible types in assignment (expression has type "AttrProto[int]", variable has type "AttrProto[float]") [assignment] +protocols_generic.py:75: error: Incompatible types in assignment (expression has type "AttrProto[float]", variable has type "AttrProto[int]") [assignment] +protocols_generic.py:145: error: Incompatible types in assignment (expression has type "ConcreteHasProperty2", variable has type "HasPropertyProto") [assignment] protocols_generic.py:145: note: Following member(s) of "ConcreteHasProperty2" have conflicts: protocols_generic.py:145: note: Expected: protocols_generic.py:145: note: def [T] m(self, item: T, callback: Callable[[T], str]) -> str protocols_generic.py:145: note: Got: protocols_generic.py:145: note: def m(self, item: int, callback: Callable[[int], str]) -> str -protocols_generic.py:146: error: Incompatible types in assignment (expression has type "ConcreteHasProperty3", variable has type "HasPropertyProto") +protocols_generic.py:146: error: Incompatible types in assignment (expression has type "ConcreteHasProperty3", variable has type "HasPropertyProto") [assignment] protocols_generic.py:146: note: Following member(s) of "ConcreteHasProperty3" have conflicts: protocols_generic.py:146: note: f: expected "ConcreteHasProperty3", got "int" protocols_generic.py:146: note: Expected: protocols_generic.py:146: note: def [T] m(self, item: T, callback: Callable[[T], str]) -> str protocols_generic.py:146: note: Got: protocols_generic.py:146: note: def m(self, item: int, callback: Callable[[int], str]) -> str -protocols_generic.py:147: error: Incompatible types in assignment (expression has type "ConcreteHasProperty4", variable has type "HasPropertyProto") +protocols_generic.py:147: error: Incompatible types in assignment (expression has type "ConcreteHasProperty4", variable has type "HasPropertyProto") [assignment] protocols_generic.py:147: note: Following member(s) of "ConcreteHasProperty4" have conflicts: protocols_generic.py:147: note: Expected: protocols_generic.py:147: note: def [T] m(self, item: T, callback: Callable[[T], str]) -> str diff --git a/conformance/results/zuban/protocols_merging.toml b/conformance/results/zuban/protocols_merging.toml index 747ee0b5f..96fe626e1 100644 --- a/conformance/results/zuban/protocols_merging.toml +++ b/conformance/results/zuban/protocols_merging.toml @@ -2,14 +2,14 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -protocols_merging.py:52: error: Incompatible types in assignment (expression has type "SCConcrete2", variable has type "SizedAndClosable1") +protocols_merging.py:52: error: Incompatible types in assignment (expression has type "SCConcrete2", variable has type "SizedAndClosable1") [assignment] protocols_merging.py:52: note: "SCConcrete2" is missing following "SizedAndClosable1" protocol member: protocols_merging.py:52: note: __len__ -protocols_merging.py:53: error: Incompatible types in assignment (expression has type "SCConcrete2", variable has type "SizedAndClosable2") +protocols_merging.py:53: error: Incompatible types in assignment (expression has type "SCConcrete2", variable has type "SizedAndClosable2") [assignment] protocols_merging.py:53: note: "SCConcrete2" is missing following "SizedAndClosable2" protocol member: protocols_merging.py:53: note: __len__ -protocols_merging.py:54: error: Incompatible types in assignment (expression has type "SCConcrete2", variable has type "SizedAndClosable3") -protocols_merging.py:67: error: All bases of a protocol must be protocols -protocols_merging.py:82: error: Cannot instantiate abstract class "SizedAndClosable4" with abstract attribute "close" -protocols_merging.py:83: error: Incompatible types in assignment (expression has type "SCConcrete1", variable has type "SizedAndClosable4") +protocols_merging.py:54: error: Incompatible types in assignment (expression has type "SCConcrete2", variable has type "SizedAndClosable3") [assignment] +protocols_merging.py:67: error: All bases of a protocol must be protocols [misc] +protocols_merging.py:82: error: Cannot instantiate abstract class "SizedAndClosable4" with abstract attribute "close" [abstract] +protocols_merging.py:83: error: Incompatible types in assignment (expression has type "SCConcrete1", variable has type "SizedAndClosable4") [assignment] """ diff --git a/conformance/results/zuban/protocols_modules.toml b/conformance/results/zuban/protocols_modules.toml index 76e6f70f5..204ef50fb 100644 --- a/conformance/results/zuban/protocols_modules.toml +++ b/conformance/results/zuban/protocols_modules.toml @@ -2,14 +2,14 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -protocols_modules.py:26: error: Incompatible types in assignment (expression has type "ModuleType", variable has type "Options2") +protocols_modules.py:26: error: Incompatible types in assignment (expression has type "ModuleType", variable has type "Options2") [assignment] protocols_modules.py:26: note: Following member(s) of Module "_protocols_modules1" have conflicts: protocols_modules.py:26: note: timeout: expected "str", got "int" -protocols_modules.py:48: error: Incompatible types in assignment (expression has type "ModuleType", variable has type "Reporter2") +protocols_modules.py:48: error: Incompatible types in assignment (expression has type "ModuleType", variable has type "Reporter2") [assignment] protocols_modules.py:48: note: Following member(s) of Module "_protocols_modules2" have conflicts: protocols_modules.py:48: note: Expected: protocols_modules.py:48: note: def on_error(x: int) -> int protocols_modules.py:48: note: Got: protocols_modules.py:48: note: def on_error(x: int) -> None -protocols_modules.py:49: error: Incompatible types in assignment (expression has type "ModuleType", variable has type "Reporter3") +protocols_modules.py:49: error: Incompatible types in assignment (expression has type "ModuleType", variable has type "Reporter3") [assignment] """ diff --git a/conformance/results/zuban/protocols_runtime_checkable.toml b/conformance/results/zuban/protocols_runtime_checkable.toml index b31703915..aec23be68 100644 --- a/conformance/results/zuban/protocols_runtime_checkable.toml +++ b/conformance/results/zuban/protocols_runtime_checkable.toml @@ -9,9 +9,9 @@ Line 92: Expected 1 errors Line 96: Expected 1 errors """ output = """ -protocols_runtime_checkable.py:23: error: Only @runtime_checkable protocols can be used with instance and class checks -protocols_runtime_checkable.py:55: error: Only protocols that don't have non-method members can be used with issubclass() +protocols_runtime_checkable.py:23: error: Only @runtime_checkable protocols can be used with instance and class checks [misc] +protocols_runtime_checkable.py:55: error: Only protocols that don't have non-method members can be used with issubclass() [misc] protocols_runtime_checkable.py:55: note: Protocol "DataProtocol" has non-method member(s): name -protocols_runtime_checkable.py:61: error: Only protocols that don't have non-method members can be used with issubclass() +protocols_runtime_checkable.py:61: error: Only protocols that don't have non-method members can be used with issubclass() [misc] protocols_runtime_checkable.py:61: note: Protocol "DataProtocol" has non-method member(s): name """ diff --git a/conformance/results/zuban/protocols_subtyping.toml b/conformance/results/zuban/protocols_subtyping.toml index 6ba591cb3..159857a45 100644 --- a/conformance/results/zuban/protocols_subtyping.toml +++ b/conformance/results/zuban/protocols_subtyping.toml @@ -2,30 +2,30 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -protocols_subtyping.py:16: error: Cannot instantiate protocol class "Proto1" -protocols_subtyping.py:38: error: Incompatible types in assignment (expression has type "Proto2", variable has type "Concrete2") -protocols_subtyping.py:55: error: Incompatible types in assignment (expression has type "Proto2", variable has type "Proto3") +protocols_subtyping.py:16: error: Cannot instantiate protocol class "Proto1" [misc] +protocols_subtyping.py:38: error: Incompatible types in assignment (expression has type "Proto2", variable has type "Concrete2") [assignment] +protocols_subtyping.py:55: error: Incompatible types in assignment (expression has type "Proto2", variable has type "Proto3") [assignment] protocols_subtyping.py:55: note: "Proto2" is missing following "Proto3" protocol member: protocols_subtyping.py:55: note: method2 -protocols_subtyping.py:79: error: Incompatible types in assignment (expression has type "Proto5[int]", variable has type "Proto4[int, float]") +protocols_subtyping.py:79: error: Incompatible types in assignment (expression has type "Proto5[int]", variable has type "Proto4[int, float]") [assignment] protocols_subtyping.py:79: note: Following member(s) of "Proto5[int]" have conflicts: protocols_subtyping.py:79: note: Expected: protocols_subtyping.py:79: note: def method1(self, a: int, b: float) -> tuple[int, float] protocols_subtyping.py:79: note: Got: protocols_subtyping.py:79: note: def method1(self, a: int, b: int) -> tuple[int, int] -protocols_subtyping.py:80: error: Incompatible types in assignment (expression has type "Proto4[int, int]", variable has type "Proto5[float]") +protocols_subtyping.py:80: error: Incompatible types in assignment (expression has type "Proto4[int, int]", variable has type "Proto5[float]") [assignment] protocols_subtyping.py:80: note: Following member(s) of "Proto4[int, int]" have conflicts: protocols_subtyping.py:80: note: Expected: protocols_subtyping.py:80: note: def method1(self, a: float, b: float) -> tuple[float, float] protocols_subtyping.py:80: note: Got: protocols_subtyping.py:80: note: def method1(self, a: int, b: int) -> tuple[int, int] -protocols_subtyping.py:102: error: Incompatible types in assignment (expression has type "Proto6[float, float]", variable has type "Proto7[int, float]") +protocols_subtyping.py:102: error: Incompatible types in assignment (expression has type "Proto6[float, float]", variable has type "Proto7[int, float]") [assignment] protocols_subtyping.py:102: note: Following member(s) of "Proto6[float, float]" have conflicts: protocols_subtyping.py:102: note: Expected: protocols_subtyping.py:102: note: def method1(self, a: float) -> Sequence[int] protocols_subtyping.py:102: note: Got: protocols_subtyping.py:102: note: def method1(self, a: float) -> Sequence[float] -protocols_subtyping.py:103: error: Incompatible types in assignment (expression has type "Proto6[float, float]", variable has type "Proto7[float, object]") +protocols_subtyping.py:103: error: Incompatible types in assignment (expression has type "Proto6[float, float]", variable has type "Proto7[float, object]") [assignment] protocols_subtyping.py:103: note: Following member(s) of "Proto6[float, float]" have conflicts: protocols_subtyping.py:103: note: Expected: protocols_subtyping.py:103: note: def method1(self, a: object) -> Sequence[float] diff --git a/conformance/results/zuban/protocols_variance.toml b/conformance/results/zuban/protocols_variance.toml index c8525a48d..ba95f1366 100644 --- a/conformance/results/zuban/protocols_variance.toml +++ b/conformance/results/zuban/protocols_variance.toml @@ -2,13 +2,13 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -protocols_variance.py:21: error: Invariant type variable "T1" used in protocol where Covariant one is expected -protocols_variance.py:40: error: Invariant type variable "T3" used in protocol where Contravariant one is expected -protocols_variance.py:56: error: Invariant type variable "T1" used in protocol where Contravariant one is expected -protocols_variance.py:61: error: Covariant type variable "T1_co" used in protocol where Contravariant one is expected -protocols_variance.py:62: error: Cannot use a covariant type variable as a parameter -protocols_variance.py:66: error: Invariant type variable "T1" used in protocol where Covariant one is expected -protocols_variance.py:71: error: Contravariant type variable "T1_contra" used in protocol where Covariant one is expected -protocols_variance.py:72: error: Cannot use a contravariant type variable as return type -protocols_variance.py:104: error: Invariant type variable "T1" used in protocol where Covariant one is expected +protocols_variance.py:21: error: Invariant type variable "T1" used in protocol where Covariant one is expected [misc] +protocols_variance.py:40: error: Invariant type variable "T3" used in protocol where Contravariant one is expected [misc] +protocols_variance.py:56: error: Invariant type variable "T1" used in protocol where Contravariant one is expected [misc] +protocols_variance.py:61: error: Covariant type variable "T1_co" used in protocol where Contravariant one is expected [misc] +protocols_variance.py:62: error: Cannot use a covariant type variable as a parameter [type-var] +protocols_variance.py:66: error: Invariant type variable "T1" used in protocol where Covariant one is expected [misc] +protocols_variance.py:71: error: Contravariant type variable "T1_contra" used in protocol where Covariant one is expected [misc] +protocols_variance.py:72: error: Cannot use a contravariant type variable as return type [type-var] +protocols_variance.py:104: error: Invariant type variable "T1" used in protocol where Covariant one is expected [misc] """ diff --git a/conformance/results/zuban/qualifiers_annotated.toml b/conformance/results/zuban/qualifiers_annotated.toml index 822a7e8e0..76e441230 100644 --- a/conformance/results/zuban/qualifiers_annotated.toml +++ b/conformance/results/zuban/qualifiers_annotated.toml @@ -2,26 +2,26 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -qualifiers_annotated.py:43: error: Bracketed expression "[...]" is not valid as a type +qualifiers_annotated.py:43: error: Bracketed expression "[...]" is not valid as a type [valid-type] qualifiers_annotated.py:43: note: Did you mean "List[...]"? -qualifiers_annotated.py:44: error: Syntax error in type annotation +qualifiers_annotated.py:44: error: Syntax error in type annotation [valid-type] qualifiers_annotated.py:44: note: Suggestion: Is there a spurious trailing comma? -qualifiers_annotated.py:45: error: Invalid type comment or annotation -qualifiers_annotated.py:46: error: Invalid type comment or annotation -qualifiers_annotated.py:47: error: Invalid type comment or annotation -qualifiers_annotated.py:48: error: Invalid type comment or annotation -qualifiers_annotated.py:49: error: Invalid type comment or annotation -qualifiers_annotated.py:50: error: Name "var1" is not defined -qualifiers_annotated.py:51: error: Invalid type comment or annotation -qualifiers_annotated.py:52: error: Invalid type: try using Literal[1] instead? -qualifiers_annotated.py:53: error: Invalid type comment or annotation -qualifiers_annotated.py:54: error: Invalid type comment or annotation -qualifiers_annotated.py:64: error: Annotated[...] must have exactly one type argument and at least one annotation -qualifiers_annotated.py:76: error: Incompatible types in assignment (expression has type "_SpecialForm", variable has type "Type[Any]") -qualifiers_annotated.py:77: error: Incompatible types in assignment (expression has type "_SpecialForm", variable has type "Type[Any]") -qualifiers_annotated.py:84: error: Argument 1 to "func4" has incompatible type "_SpecialForm"; expected "Type[Never]" -qualifiers_annotated.py:85: error: Argument 1 to "func4" has incompatible type "_SpecialForm"; expected "Type[Never]" -qualifiers_annotated.py:91: error: "_SpecialForm" not callable -qualifiers_annotated.py:92: error: "_SpecialForm" not callable -qualifiers_annotated.py:93: error: "" not callable +qualifiers_annotated.py:45: error: Invalid type comment or annotation [valid-type] +qualifiers_annotated.py:46: error: Invalid type comment or annotation [valid-type] +qualifiers_annotated.py:47: error: Invalid type comment or annotation [valid-type] +qualifiers_annotated.py:48: error: Invalid type comment or annotation [valid-type] +qualifiers_annotated.py:49: error: Invalid type comment or annotation [valid-type] +qualifiers_annotated.py:50: error: Name "var1" is not defined [name-defined] +qualifiers_annotated.py:51: error: Invalid type comment or annotation [valid-type] +qualifiers_annotated.py:52: error: Invalid type: try using Literal[1] instead? [valid-type] +qualifiers_annotated.py:53: error: Invalid type comment or annotation [valid-type] +qualifiers_annotated.py:54: error: Invalid type comment or annotation [valid-type] +qualifiers_annotated.py:64: error: Annotated[...] must have exactly one type argument and at least one annotation [valid-type] +qualifiers_annotated.py:76: error: Incompatible types in assignment (expression has type "_SpecialForm", variable has type "Type[Any]") [assignment] +qualifiers_annotated.py:77: error: Incompatible types in assignment (expression has type "_SpecialForm", variable has type "Type[Any]") [assignment] +qualifiers_annotated.py:84: error: Argument 1 to "func4" has incompatible type "_SpecialForm"; expected "Type[Never]" [arg-type] +qualifiers_annotated.py:85: error: Argument 1 to "func4" has incompatible type "_SpecialForm"; expected "Type[Never]" [arg-type] +qualifiers_annotated.py:91: error: "_SpecialForm" not callable [operator] +qualifiers_annotated.py:92: error: "_SpecialForm" not callable [operator] +qualifiers_annotated.py:93: error: "" not callable [operator] """ diff --git a/conformance/results/zuban/qualifiers_final_annotation.toml b/conformance/results/zuban/qualifiers_final_annotation.toml index aa317cadb..98d471086 100644 --- a/conformance/results/zuban/qualifiers_final_annotation.toml +++ b/conformance/results/zuban/qualifiers_final_annotation.toml @@ -7,35 +7,35 @@ conformance_automated = "Fail" errors_diff = """ Line 134: Expected 1 errors Line 135: Expected 1 errors -Line 59: Unexpected errors ['qualifiers_final_annotation.py:59: error: Cannot assign to final attribute "ID6"'] -Line 131: Unexpected errors ['qualifiers_final_annotation.py:131: error: Invalid "NamedTuple()" field name'] +Line 59: Unexpected errors ['qualifiers_final_annotation.py:59: error: Cannot assign to final attribute "ID6" [misc]'] +Line 131: Unexpected errors ['qualifiers_final_annotation.py:131: error: Invalid "NamedTuple()" field name [misc]'] """ output = """ -qualifiers_final_annotation.py:16: error: Type in Final[...] can only be omitted if there is an initializer -qualifiers_final_annotation.py:18: error: Final[...] takes at most one type argument -qualifiers_final_annotation.py:34: error: Type in Final[...] can only be omitted if there is an initializer -qualifiers_final_annotation.py:38: error: Final name must be initialized with a value -qualifiers_final_annotation.py:54: error: Cannot assign to final attribute "ID5" -qualifiers_final_annotation.py:59: error: Cannot assign to final attribute "ID6" -qualifiers_final_annotation.py:62: error: Can only declare a final attribute in class body or __init__ -qualifiers_final_annotation.py:63: error: Can only declare a final attribute in class body or __init__ -qualifiers_final_annotation.py:65: error: Cannot assign to final attribute "ID7" -qualifiers_final_annotation.py:67: error: Cannot assign to final attribute "ID7" -qualifiers_final_annotation.py:71: error: Cannot assign to final name "RATE" -qualifiers_final_annotation.py:81: error: Cannot assign to final attribute "DEFAULT_ID" -qualifiers_final_annotation.py:94: error: Cannot assign to final name "BORDER_WIDTH" -qualifiers_final_annotation.py:107: error: Final can be only used as an outermost qualifier in a variable annotation -qualifiers_final_annotation.py:108: error: Invalid Type: ClassVar nested inside other type -qualifiers_final_annotation.py:118: error: Final can be only used as an outermost qualifier in a variable annotation -qualifiers_final_annotation.py:121: error: Final can be only used as an outermost qualifier in a variable annotation -qualifiers_final_annotation.py:131: error: Invalid "NamedTuple()" field name -qualifiers_final_annotation.py:141: error: Cannot assign to final name "ID1" -qualifiers_final_annotation.py:145: error: Cannot assign to final name "x" -qualifiers_final_annotation.py:147: error: Cannot assign to final name "x" -qualifiers_final_annotation.py:149: error: Cannot assign to final name "x" -qualifiers_final_annotation.py:152: error: Cannot assign to final name "x" -qualifiers_final_annotation.py:152: error: Incompatible types in assignment (expression has type "TextIOWrapper[_WrappedBuffer]", variable has type "int") -qualifiers_final_annotation.py:155: error: Cannot assign to final name "x" -qualifiers_final_annotation.py:166: error: Cannot assign to final name "TEN" -qualifiers_final_annotation.py:170: error: Cannot assign to final name "PI" +qualifiers_final_annotation.py:16: error: Type in Final[...] can only be omitted if there is an initializer [misc] +qualifiers_final_annotation.py:18: error: Final[...] takes at most one type argument [misc] +qualifiers_final_annotation.py:34: error: Type in Final[...] can only be omitted if there is an initializer [misc] +qualifiers_final_annotation.py:38: error: Final name must be initialized with a value [misc] +qualifiers_final_annotation.py:54: error: Cannot assign to final attribute "ID5" [misc] +qualifiers_final_annotation.py:59: error: Cannot assign to final attribute "ID6" [misc] +qualifiers_final_annotation.py:62: error: Can only declare a final attribute in class body or __init__ [misc] +qualifiers_final_annotation.py:63: error: Can only declare a final attribute in class body or __init__ [misc] +qualifiers_final_annotation.py:65: error: Cannot assign to final attribute "ID7" [misc] +qualifiers_final_annotation.py:67: error: Cannot assign to final attribute "ID7" [misc] +qualifiers_final_annotation.py:71: error: Cannot assign to final name "RATE" [misc] +qualifiers_final_annotation.py:81: error: Cannot assign to final attribute "DEFAULT_ID" [misc] +qualifiers_final_annotation.py:94: error: Cannot assign to final name "BORDER_WIDTH" [misc] +qualifiers_final_annotation.py:107: error: Final can be only used as an outermost qualifier in a variable annotation [misc] +qualifiers_final_annotation.py:108: error: Invalid Type: ClassVar nested inside other type [misc] +qualifiers_final_annotation.py:118: error: Final can be only used as an outermost qualifier in a variable annotation [misc] +qualifiers_final_annotation.py:121: error: Final can be only used as an outermost qualifier in a variable annotation [misc] +qualifiers_final_annotation.py:131: error: Invalid "NamedTuple()" field name [misc] +qualifiers_final_annotation.py:141: error: Cannot assign to final name "ID1" [misc] +qualifiers_final_annotation.py:145: error: Cannot assign to final name "x" [misc] +qualifiers_final_annotation.py:147: error: Cannot assign to final name "x" [misc] +qualifiers_final_annotation.py:149: error: Cannot assign to final name "x" [misc] +qualifiers_final_annotation.py:152: error: Cannot assign to final name "x" [misc] +qualifiers_final_annotation.py:152: error: Incompatible types in assignment (expression has type "TextIOWrapper[_WrappedBuffer]", variable has type "int") [assignment] +qualifiers_final_annotation.py:155: error: Cannot assign to final name "x" [misc] +qualifiers_final_annotation.py:166: error: Cannot assign to final name "TEN" [misc] +qualifiers_final_annotation.py:170: error: Cannot assign to final name "PI" [misc] """ diff --git a/conformance/results/zuban/qualifiers_final_decorator.toml b/conformance/results/zuban/qualifiers_final_decorator.toml index 92903082a..bbedc5e60 100644 --- a/conformance/results/zuban/qualifiers_final_decorator.toml +++ b/conformance/results/zuban/qualifiers_final_decorator.toml @@ -2,19 +2,19 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -qualifiers_final_decorator.py:21: error: Cannot inherit from final class "Base1" -qualifiers_final_decorator.py:56: error: Cannot override final attribute "method1" (previously declared in base class "Base2") -qualifiers_final_decorator.py:59: error: Cannot override final attribute "method2" (previously declared in base class "Base2") -qualifiers_final_decorator.py:63: error: Cannot override final attribute "method3" (previously declared in base class "Base2") -qualifiers_final_decorator.py:67: error: Cannot override final attribute "method4" (previously declared in base class "Base2") -qualifiers_final_decorator.py:80: error: Cannot override final attribute "method" (previously declared in base class "Base3") -qualifiers_final_decorator.py:85: error: @final should be applied only to overload implementation -qualifiers_final_decorator.py:94: error: Cannot override final attribute "method" (previously declared in base class "Base4") -qualifiers_final_decorator.py:118: error: Cannot override final attribute "method" (previously declared in base class "Base5_2") -qualifiers_final_decorator.py:118: error: Signature of "method" incompatible with supertype "Base5_2" +qualifiers_final_decorator.py:21: error: Cannot inherit from final class "Base1" [misc] +qualifiers_final_decorator.py:56: error: Cannot override final attribute "method1" (previously declared in base class "Base2") [misc] +qualifiers_final_decorator.py:59: error: Cannot override final attribute "method2" (previously declared in base class "Base2") [misc] +qualifiers_final_decorator.py:63: error: Cannot override final attribute "method3" (previously declared in base class "Base2") [misc] +qualifiers_final_decorator.py:67: error: Cannot override final attribute "method4" (previously declared in base class "Base2") [misc] +qualifiers_final_decorator.py:80: error: Cannot override final attribute "method" (previously declared in base class "Base3") [misc] +qualifiers_final_decorator.py:85: error: @final should be applied only to overload implementation [misc] +qualifiers_final_decorator.py:94: error: Cannot override final attribute "method" (previously declared in base class "Base4") [misc] +qualifiers_final_decorator.py:118: error: Cannot override final attribute "method" (previously declared in base class "Base5_2") [misc] +qualifiers_final_decorator.py:118: error: Signature of "method" incompatible with supertype "Base5_2" [override] qualifiers_final_decorator.py:118: note: Superclass: qualifiers_final_decorator.py:118: note: def method(self, v: int) -> None qualifiers_final_decorator.py:118: note: Subclass: qualifiers_final_decorator.py:118: note: def method(self) -> None -qualifiers_final_decorator.py:125: error: @final cannot be used with non-method functions +qualifiers_final_decorator.py:125: error: @final cannot be used with non-method functions [misc] """ diff --git a/conformance/results/zuban/specialtypes_never.toml b/conformance/results/zuban/specialtypes_never.toml index dbdbe2e69..5face3bbf 100644 --- a/conformance/results/zuban/specialtypes_never.toml +++ b/conformance/results/zuban/specialtypes_never.toml @@ -2,9 +2,9 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -specialtypes_never.py:19: error: Implicit return in function which does not return -specialtypes_never.py:86: error: Incompatible types in assignment (expression has type "list[Never]", variable has type "list[int]") +specialtypes_never.py:19: error: Implicit return in function which does not return [misc] +specialtypes_never.py:86: error: Incompatible types in assignment (expression has type "list[Never]", variable has type "list[int]") [assignment] specialtypes_never.py:86: note: "List" is invariant -- see https://mypy.readthedocs.io/en/stable/common_issues.html#variance specialtypes_never.py:86: note: Consider using "Sequence" instead, which is covariant -specialtypes_never.py:105: error: Incompatible return value type (got "ClassC[Never]", expected "ClassC[U]") +specialtypes_never.py:105: error: Incompatible return value type (got "ClassC[Never]", expected "ClassC[U]") [return-value] """ diff --git a/conformance/results/zuban/specialtypes_none.toml b/conformance/results/zuban/specialtypes_none.toml index 698c02f17..4cc99a4a7 100644 --- a/conformance/results/zuban/specialtypes_none.toml +++ b/conformance/results/zuban/specialtypes_none.toml @@ -2,7 +2,7 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -specialtypes_none.py:21: error: Argument 1 to "func1" has incompatible type "Type[None]"; expected "None" -specialtypes_none.py:27: error: Incompatible types in assignment (expression has type "None", variable has type "Iterable[Any]") -specialtypes_none.py:41: error: Argument 1 to "func2" has incompatible type "None"; expected "Type[None]" +specialtypes_none.py:21: error: Argument 1 to "func1" has incompatible type "Type[None]"; expected "None" [arg-type] +specialtypes_none.py:27: error: Incompatible types in assignment (expression has type "None", variable has type "Iterable[Any]") [assignment] +specialtypes_none.py:41: error: Argument 1 to "func2" has incompatible type "None"; expected "Type[None]" [arg-type] """ diff --git a/conformance/results/zuban/specialtypes_promotions.toml b/conformance/results/zuban/specialtypes_promotions.toml index 469985d2b..a261c18d2 100644 --- a/conformance/results/zuban/specialtypes_promotions.toml +++ b/conformance/results/zuban/specialtypes_promotions.toml @@ -2,5 +2,5 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -specialtypes_promotions.py:13: error: "float" has no attribute "numerator" +specialtypes_promotions.py:13: error: "float" has no attribute "numerator" [attr-defined] """ diff --git a/conformance/results/zuban/specialtypes_type.toml b/conformance/results/zuban/specialtypes_type.toml index 01efce3ec..31f3a8488 100644 --- a/conformance/results/zuban/specialtypes_type.toml +++ b/conformance/results/zuban/specialtypes_type.toml @@ -2,13 +2,13 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -specialtypes_type.py:56: error: Argument 1 to "func4" has incompatible type "Type[TeamUser]"; expected "Type[BasicUser | ProUser]" -specialtypes_type.py:70: error: Argument 1 to "func5" has incompatible type "_SpecialForm"; expected "Type[Never]" -specialtypes_type.py:76: error: Invalid type comment or annotation -specialtypes_type.py:117: error: "Type[object]" has no attribute "unknown" -specialtypes_type.py:120: error: "Type[object]" has no attribute "unknown" -specialtypes_type.py:143: error: "_SpecialForm" has no attribute "unknown" -specialtypes_type.py:144: error: "_SpecialForm" has no attribute "unknown" -specialtypes_type.py:145: error: "_SpecialForm" has no attribute "unknown" -specialtypes_type.py:146: error: "_SpecialForm" has no attribute "unknown" +specialtypes_type.py:56: error: Argument 1 to "func4" has incompatible type "Type[TeamUser]"; expected "Type[BasicUser | ProUser]" [arg-type] +specialtypes_type.py:70: error: Argument 1 to "func5" has incompatible type "_SpecialForm"; expected "Type[Never]" [arg-type] +specialtypes_type.py:76: error: Invalid type comment or annotation [valid-type] +specialtypes_type.py:117: error: "Type[object]" has no attribute "unknown" [attr-defined] +specialtypes_type.py:120: error: "Type[object]" has no attribute "unknown" [attr-defined] +specialtypes_type.py:143: error: "_SpecialForm" has no attribute "unknown" [attr-defined] +specialtypes_type.py:144: error: "_SpecialForm" has no attribute "unknown" [attr-defined] +specialtypes_type.py:145: error: "_SpecialForm" has no attribute "unknown" [attr-defined] +specialtypes_type.py:146: error: "_SpecialForm" has no attribute "unknown" [attr-defined] """ diff --git a/conformance/results/zuban/tuples_type_compat.toml b/conformance/results/zuban/tuples_type_compat.toml index fe4bd5008..991732fef 100644 --- a/conformance/results/zuban/tuples_type_compat.toml +++ b/conformance/results/zuban/tuples_type_compat.toml @@ -5,33 +5,33 @@ Does not support tuple narrowing based on `len()` type guard (optional). conformance_automated = "Fail" errors_diff = """ Lines 80, 81: Expected exactly one error (tag 'func5_2') -Line 80: Unexpected errors ['tuples_type_compat.py:80: error: Expression is of type "tuple[str, str]", not "tuple[str, str] | tuple[int, int]"'] -Line 81: Unexpected errors ['tuples_type_compat.py:81: error: Expression is of type "tuple[str, str]", not "tuple[int] | tuple[str, str] | tuple[int, Unpack[Tuple[str, ...]], int]"'] +Line 80: Unexpected errors ['tuples_type_compat.py:80: error: Expression is of type "tuple[str, str]", not "tuple[str, str] | tuple[int, int]" [misc]'] +Line 81: Unexpected errors ['tuples_type_compat.py:81: error: Expression is of type "tuple[str, str]", not "tuple[int] | tuple[str, str] | tuple[int, Unpack[Tuple[str, ...]], int]" [misc]'] """ output = """ -tuples_type_compat.py:15: error: Incompatible types in assignment (expression has type "tuple[float, complex]", variable has type "tuple[int, int]") -tuples_type_compat.py:29: error: Incompatible types in assignment (expression has type "tuple[int, ...]", variable has type "tuple[int, Unpack[Tuple[int, ...]]]") -tuples_type_compat.py:32: error: Incompatible types in assignment (expression has type "tuple[int, Unpack[Tuple[int, ...]]]", variable has type "tuple[int]") -tuples_type_compat.py:33: error: Incompatible types in assignment (expression has type "tuple[int, ...]", variable has type "tuple[int]") -tuples_type_compat.py:43: error: Incompatible types in assignment (expression has type "tuple[int, ...]", variable has type "tuple[int]") -tuples_type_compat.py:62: error: Incompatible types in assignment (expression has type "tuple[int, ...]", variable has type "tuple[int, int]") -tuples_type_compat.py:76: error: Expression is of type "tuple[int]", not "tuple[int] | tuple[str, str] | tuple[int, Unpack[Tuple[str, ...]], int]" -tuples_type_compat.py:80: error: Expression is of type "tuple[str, str]", not "tuple[str, str] | tuple[int, int]" -tuples_type_compat.py:81: error: Expression is of type "tuple[str, str]", not "tuple[int] | tuple[str, str] | tuple[int, Unpack[Tuple[str, ...]], int]" -tuples_type_compat.py:86: error: Expression is of type "tuple[int, str, int]", not "tuple[int] | tuple[str, str] | tuple[int, Unpack[Tuple[str, ...]], int]" -tuples_type_compat.py:101: error: Expression is of type "tuple[int] | tuple[str, str] | tuple[int, Unpack[Tuple[str, ...]], int]", not "tuple[int]" -tuples_type_compat.py:106: error: Expression is of type "tuple[int] | tuple[str, str] | tuple[int, Unpack[Tuple[str, ...]], int]", not "tuple[str, str] | tuple[int, int]" -tuples_type_compat.py:111: error: Expression is of type "tuple[int] | tuple[str, str] | tuple[int, Unpack[Tuple[str, ...]], int]", not "tuple[int, str, int]" -tuples_type_compat.py:126: error: Expression is of type "tuple[int | str, int | str]", not "tuple[int | str, str]" -tuples_type_compat.py:129: error: Expression is of type "tuple[int | str, int | str]", not "tuple[int | str, int]" -tuples_type_compat.py:157: error: Incompatible types in assignment (expression has type "tuple[int, str, str]", variable has type "tuple[int, str]") -tuples_type_compat.py:162: error: Incompatible types in assignment (expression has type "tuple[int, int, str]", variable has type "tuple[int, Unpack[Tuple[str, ...]]]") -tuples_type_compat.py:163: error: Incompatible types in assignment (expression has type "tuple[int, str, int]", variable has type "tuple[int, Unpack[Tuple[str, ...]]]") -tuples_type_compat.py:169: error: Incompatible types in assignment (expression has type "tuple[int, str, str]", variable has type "tuple[int, Unpack[Tuple[str, ...]], int]") -tuples_type_compat.py:170: error: Incompatible types in assignment (expression has type "tuple[int, str, str, float]", variable has type "tuple[int, Unpack[Tuple[str, ...]], int]") -tuples_type_compat.py:175: error: Incompatible types in assignment (expression has type "tuple[int, str, int]", variable has type "tuple[Unpack[Tuple[str, ...]], int]") -tuples_type_compat.py:176: error: Incompatible types in assignment (expression has type "tuple[str, str, float]", variable has type "tuple[Unpack[Tuple[str, ...]], int]") -tuples_type_compat.py:181: error: Incompatible types in assignment (expression has type "tuple[str, str]", variable has type "tuple[str, str, int]") -tuples_type_compat.py:184: error: Incompatible types in assignment (expression has type "tuple[str, str]", variable has type "tuple[str, str, str, Unpack[Tuple[str, ...]]]") -tuples_type_compat.py:188: error: Incompatible types in assignment (expression has type "tuple[str, str]", variable has type "tuple[Unpack[Tuple[str, ...]], str, str, str]") +tuples_type_compat.py:15: error: Incompatible types in assignment (expression has type "tuple[float, complex]", variable has type "tuple[int, int]") [assignment] +tuples_type_compat.py:29: error: Incompatible types in assignment (expression has type "tuple[int, ...]", variable has type "tuple[int, Unpack[Tuple[int, ...]]]") [assignment] +tuples_type_compat.py:32: error: Incompatible types in assignment (expression has type "tuple[int, Unpack[Tuple[int, ...]]]", variable has type "tuple[int]") [assignment] +tuples_type_compat.py:33: error: Incompatible types in assignment (expression has type "tuple[int, ...]", variable has type "tuple[int]") [assignment] +tuples_type_compat.py:43: error: Incompatible types in assignment (expression has type "tuple[int, ...]", variable has type "tuple[int]") [assignment] +tuples_type_compat.py:62: error: Incompatible types in assignment (expression has type "tuple[int, ...]", variable has type "tuple[int, int]") [assignment] +tuples_type_compat.py:76: error: Expression is of type "tuple[int]", not "tuple[int] | tuple[str, str] | tuple[int, Unpack[Tuple[str, ...]], int]" [misc] +tuples_type_compat.py:80: error: Expression is of type "tuple[str, str]", not "tuple[str, str] | tuple[int, int]" [misc] +tuples_type_compat.py:81: error: Expression is of type "tuple[str, str]", not "tuple[int] | tuple[str, str] | tuple[int, Unpack[Tuple[str, ...]], int]" [misc] +tuples_type_compat.py:86: error: Expression is of type "tuple[int, str, int]", not "tuple[int] | tuple[str, str] | tuple[int, Unpack[Tuple[str, ...]], int]" [misc] +tuples_type_compat.py:101: error: Expression is of type "tuple[int] | tuple[str, str] | tuple[int, Unpack[Tuple[str, ...]], int]", not "tuple[int]" [misc] +tuples_type_compat.py:106: error: Expression is of type "tuple[int] | tuple[str, str] | tuple[int, Unpack[Tuple[str, ...]], int]", not "tuple[str, str] | tuple[int, int]" [misc] +tuples_type_compat.py:111: error: Expression is of type "tuple[int] | tuple[str, str] | tuple[int, Unpack[Tuple[str, ...]], int]", not "tuple[int, str, int]" [misc] +tuples_type_compat.py:126: error: Expression is of type "tuple[int | str, int | str]", not "tuple[int | str, str]" [misc] +tuples_type_compat.py:129: error: Expression is of type "tuple[int | str, int | str]", not "tuple[int | str, int]" [misc] +tuples_type_compat.py:157: error: Incompatible types in assignment (expression has type "tuple[int, str, str]", variable has type "tuple[int, str]") [assignment] +tuples_type_compat.py:162: error: Incompatible types in assignment (expression has type "tuple[int, int, str]", variable has type "tuple[int, Unpack[Tuple[str, ...]]]") [assignment] +tuples_type_compat.py:163: error: Incompatible types in assignment (expression has type "tuple[int, str, int]", variable has type "tuple[int, Unpack[Tuple[str, ...]]]") [assignment] +tuples_type_compat.py:169: error: Incompatible types in assignment (expression has type "tuple[int, str, str]", variable has type "tuple[int, Unpack[Tuple[str, ...]], int]") [assignment] +tuples_type_compat.py:170: error: Incompatible types in assignment (expression has type "tuple[int, str, str, float]", variable has type "tuple[int, Unpack[Tuple[str, ...]], int]") [assignment] +tuples_type_compat.py:175: error: Incompatible types in assignment (expression has type "tuple[int, str, int]", variable has type "tuple[Unpack[Tuple[str, ...]], int]") [assignment] +tuples_type_compat.py:176: error: Incompatible types in assignment (expression has type "tuple[str, str, float]", variable has type "tuple[Unpack[Tuple[str, ...]], int]") [assignment] +tuples_type_compat.py:181: error: Incompatible types in assignment (expression has type "tuple[str, str]", variable has type "tuple[str, str, int]") [assignment] +tuples_type_compat.py:184: error: Incompatible types in assignment (expression has type "tuple[str, str]", variable has type "tuple[str, str, str, Unpack[Tuple[str, ...]]]") [assignment] +tuples_type_compat.py:188: error: Incompatible types in assignment (expression has type "tuple[str, str]", variable has type "tuple[Unpack[Tuple[str, ...]], str, str, str]") [assignment] """ diff --git a/conformance/results/zuban/tuples_type_form.toml b/conformance/results/zuban/tuples_type_form.toml index 7d1d7edab..c363b015b 100644 --- a/conformance/results/zuban/tuples_type_form.toml +++ b/conformance/results/zuban/tuples_type_form.toml @@ -2,15 +2,15 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -tuples_type_form.py:12: error: Incompatible types in assignment (expression has type "tuple[int, int]", variable has type "tuple[int]") -tuples_type_form.py:14: error: Incompatible types in assignment (expression has type "tuple[int]", variable has type "tuple[int, int]") -tuples_type_form.py:15: error: Incompatible types in assignment (expression has type "tuple[int, str]", variable has type "tuple[int, int]") -tuples_type_form.py:25: error: Incompatible types in assignment (expression has type "tuple[int]", variable has type "tuple[()]") -tuples_type_form.py:36: error: Incompatible types in assignment (expression has type "tuple[int, int, int, str]", variable has type "tuple[int, ...]") -tuples_type_form.py:40: error: Unexpected "..." -tuples_type_form.py:41: error: Unexpected "..." -tuples_type_form.py:42: error: Unexpected "..." -tuples_type_form.py:43: error: Unexpected "..." -tuples_type_form.py:44: error: Unpack is only valid in a variadic position -tuples_type_form.py:45: error: Unpack is only valid in a variadic position +tuples_type_form.py:12: error: Incompatible types in assignment (expression has type "tuple[int, int]", variable has type "tuple[int]") [assignment] +tuples_type_form.py:14: error: Incompatible types in assignment (expression has type "tuple[int]", variable has type "tuple[int, int]") [assignment] +tuples_type_form.py:15: error: Incompatible types in assignment (expression has type "tuple[int, str]", variable has type "tuple[int, int]") [assignment] +tuples_type_form.py:25: error: Incompatible types in assignment (expression has type "tuple[int]", variable has type "tuple[()]") [assignment] +tuples_type_form.py:36: error: Incompatible types in assignment (expression has type "tuple[int, int, int, str]", variable has type "tuple[int, ...]") [assignment] +tuples_type_form.py:40: error: Unexpected "..." [valid-type] +tuples_type_form.py:41: error: Unexpected "..." [valid-type] +tuples_type_form.py:42: error: Unexpected "..." [valid-type] +tuples_type_form.py:43: error: Unexpected "..." [valid-type] +tuples_type_form.py:44: error: Unpack is only valid in a variadic position [misc] +tuples_type_form.py:45: error: Unpack is only valid in a variadic position [misc] """ diff --git a/conformance/results/zuban/tuples_unpacked.toml b/conformance/results/zuban/tuples_unpacked.toml index e8422d81c..ab51bf6da 100644 --- a/conformance/results/zuban/tuples_unpacked.toml +++ b/conformance/results/zuban/tuples_unpacked.toml @@ -2,9 +2,9 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -tuples_unpacked.py:40: error: More than one Unpack in a type is not allowed -tuples_unpacked.py:41: error: More than one Unpack in a type is not allowed -tuples_unpacked.py:51: error: More than one Unpack in a type is not allowed -tuples_unpacked.py:59: error: More than one Unpack in a type is not allowed -tuples_unpacked.py:61: error: More than one Unpack in a type is not allowed +tuples_unpacked.py:40: error: More than one Unpack in a type is not allowed [misc] +tuples_unpacked.py:41: error: More than one Unpack in a type is not allowed [misc] +tuples_unpacked.py:51: error: More than one Unpack in a type is not allowed [misc] +tuples_unpacked.py:59: error: More than one Unpack in a type is not allowed [misc] +tuples_unpacked.py:61: error: More than one Unpack in a type is not allowed [misc] """ diff --git a/conformance/results/zuban/typeddicts_alt_syntax.toml b/conformance/results/zuban/typeddicts_alt_syntax.toml index 16ef84dce..f98d65882 100644 --- a/conformance/results/zuban/typeddicts_alt_syntax.toml +++ b/conformance/results/zuban/typeddicts_alt_syntax.toml @@ -5,9 +5,9 @@ Does not support keyword-argument form of alternative syntax (deprecated in 3.11 errors_diff = """ """ output = """ -typeddicts_alt_syntax.py:23: error: TypedDict() expects a dictionary literal as the second argument -typeddicts_alt_syntax.py:27: error: Invalid TypedDict() field name -typeddicts_alt_syntax.py:31: error: First argument "WrongName" to TypedDict() does not match variable name "BadTypedDict3" -typeddicts_alt_syntax.py:35: error: Too many arguments for "TODO()" -typeddicts_alt_syntax.py:41: error: TypedDict() expects a dictionary literal as the second argument +typeddicts_alt_syntax.py:23: error: TypedDict() expects a dictionary literal as the second argument [misc] +typeddicts_alt_syntax.py:27: error: Invalid TypedDict() field name [misc] +typeddicts_alt_syntax.py:31: error: First argument "WrongName" to TypedDict() does not match variable name "BadTypedDict3" [name-match] +typeddicts_alt_syntax.py:35: error: Too many arguments for "TODO()" [call-arg] +typeddicts_alt_syntax.py:41: error: TypedDict() expects a dictionary literal as the second argument [misc] """ diff --git a/conformance/results/zuban/typeddicts_class_syntax.toml b/conformance/results/zuban/typeddicts_class_syntax.toml index 8f550a254..cbf24ab32 100644 --- a/conformance/results/zuban/typeddicts_class_syntax.toml +++ b/conformance/results/zuban/typeddicts_class_syntax.toml @@ -2,9 +2,9 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -typeddicts_class_syntax.py:29: error: Invalid statement in TypedDict definition; expected "field_name: field_type" -typeddicts_class_syntax.py:33: error: Invalid statement in TypedDict definition; expected "field_name: field_type" -typeddicts_class_syntax.py:38: error: Invalid statement in TypedDict definition; expected "field_name: field_type" -typeddicts_class_syntax.py:44: error: Unexpected keyword argument "metaclass" for TypedDict -typeddicts_class_syntax.py:49: error: Unexpected keyword argument "other" for TypedDict +typeddicts_class_syntax.py:29: error: Invalid statement in TypedDict definition; expected "field_name: field_type" [misc] +typeddicts_class_syntax.py:33: error: Invalid statement in TypedDict definition; expected "field_name: field_type" [misc] +typeddicts_class_syntax.py:38: error: Invalid statement in TypedDict definition; expected "field_name: field_type" [misc] +typeddicts_class_syntax.py:44: error: Unexpected keyword argument "metaclass" for TypedDict [call-arg] +typeddicts_class_syntax.py:49: error: Unexpected keyword argument "other" for TypedDict [call-arg] """ diff --git a/conformance/results/zuban/typeddicts_extra_items.toml b/conformance/results/zuban/typeddicts_extra_items.toml index b58404031..86048bc37 100644 --- a/conformance/results/zuban/typeddicts_extra_items.toml +++ b/conformance/results/zuban/typeddicts_extra_items.toml @@ -16,128 +16,128 @@ 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 11: Unexpected errors ['typeddicts_extra_items.py:11: error: Unexpected keyword argument "extra_items" for TypedDict'] -Line 14: Unexpected errors ['typeddicts_extra_items.py:14: error: Extra key "novel_adaptation" for TypedDict "Movie"'] -Line 19: Unexpected errors ['typeddicts_extra_items.py:19: error: Unexpected keyword argument "extra_items" for "TypedDict"'] -Line 29: Unexpected errors ['typeddicts_extra_items.py:29: error: Expression is of type "Any", not "bool"', 'typeddicts_extra_items.py:29: error: TypedDict "Movie" has no key "novel_adaptation"'] -Line 33: Unexpected errors ['typeddicts_extra_items.py:33: error: Unexpected keyword argument "extra_items" for TypedDict'] -Line 40: Unexpected errors ['typeddicts_extra_items.py:40: error: Extra key "other_extra_key" for TypedDict "InheritedMovie"'] -Line 55: Unexpected errors ['typeddicts_extra_items.py:55: error: Unexpected keyword argument "closed" for TypedDict'] -Line 64: Unexpected errors ['typeddicts_extra_items.py:64: error: Unexpected keyword argument "closed" for TypedDict'] -Line 70: Unexpected errors ['typeddicts_extra_items.py:70: error: Unexpected keyword argument "extra_items" for TypedDict'] -Line 82: Unexpected errors ['typeddicts_extra_items.py:82: error: Unexpected keyword argument "closed" for TypedDict'] -Line 88: Unexpected errors ['typeddicts_extra_items.py:88: error: Unexpected keyword argument "closed" for TypedDict'] -Line 100: Unexpected errors ['typeddicts_extra_items.py:100: error: Unexpected keyword argument "extra_items" for TypedDict'] -Line 103: Unexpected errors ['typeddicts_extra_items.py:103: error: Unexpected keyword argument "closed" for TypedDict'] -Line 106: Unexpected errors ['typeddicts_extra_items.py:106: error: Unexpected keyword argument "extra_items" for TypedDict'] -Line 124: Unexpected errors ['typeddicts_extra_items.py:124: error: Unexpected keyword argument "extra_items" for TypedDict'] -Line 129: Unexpected errors ['typeddicts_extra_items.py:129: error: TypedDict "MovieEI" has no key "year"'] -Line 137: Unexpected errors ['typeddicts_extra_items.py:137: error: Unexpected keyword argument "extra_items" for TypedDict'] -Line 144: Unexpected errors ['typeddicts_extra_items.py:144: error: Unexpected keyword argument "year" for "unpack_extra"'] -Line 149: Unexpected errors ['typeddicts_extra_items.py:149: error: Unexpected keyword argument "extra_items" for TypedDict'] -Line 152: Unexpected errors ['typeddicts_extra_items.py:152: error: Unexpected keyword argument "extra_items" for TypedDict'] -Line 155: Unexpected errors ['typeddicts_extra_items.py:155: error: Unexpected keyword argument "extra_items" for TypedDict'] -Line 165: Unexpected errors ['typeddicts_extra_items.py:165: error: Unexpected keyword argument "extra_items" for TypedDict'] -Line 171: Unexpected errors ['typeddicts_extra_items.py:171: error: Unexpected keyword argument "extra_items" for TypedDict'] -Line 181: Unexpected errors ['typeddicts_extra_items.py:181: error: Unexpected keyword argument "extra_items" for TypedDict'] -Line 193: Unexpected errors ['typeddicts_extra_items.py:193: error: Unexpected keyword argument "extra_items" for TypedDict'] -Line 210: Unexpected errors ['typeddicts_extra_items.py:210: error: Unexpected keyword argument "extra_items" for TypedDict'] -Line 217: Unexpected errors ['typeddicts_extra_items.py:217: error: Unexpected keyword argument "extra_items" for TypedDict'] -Line 228: Unexpected errors ['typeddicts_extra_items.py:228: error: Unexpected keyword argument "extra_items" for TypedDict'] -Line 231: Unexpected errors ['typeddicts_extra_items.py:231: error: Unexpected keyword argument "extra_items" for TypedDict'] -Line 235: Unexpected errors ['typeddicts_extra_items.py:235: error: Unexpected keyword argument "extra_items" for TypedDict'] -Line 248: Unexpected errors ['typeddicts_extra_items.py:248: error: Unexpected keyword argument "extra_items" for TypedDict'] -Line 251: Unexpected errors ['typeddicts_extra_items.py:251: error: Unexpected keyword argument "extra_items" for TypedDict'] -Line 254: Unexpected errors ['typeddicts_extra_items.py:254: error: Extra key "year" for TypedDict "MovieExtraInt"'] -Line 255: Unexpected errors ['typeddicts_extra_items.py:255: error: Extra key "description" for TypedDict "MovieExtraStr"'] -Line 266: Unexpected errors ['typeddicts_extra_items.py:266: error: Extra key "year" for TypedDict "MovieExtraInt"'] -Line 280: Unexpected errors ['typeddicts_extra_items.py:280: error: Unexpected keyword argument "extra_items" for TypedDict'] -Line 284: Unexpected errors ['typeddicts_extra_items.py:284: error: Extra key "year" for TypedDict "ExtraMovie"'] -Line 289: Unexpected errors ['typeddicts_extra_items.py:289: error: Unexpected keyword argument "closed" for TypedDict'] -Line 299: Unexpected errors ['typeddicts_extra_items.py:299: error: Extra key "summary" for TypedDict "MovieExtraStr"'] -Line 300: Unexpected errors ['typeddicts_extra_items.py:300: error: Incompatible types in assignment (expression has type "MovieExtraStr", variable has type "Mapping[str, str]")'] -Line 302: Unexpected errors ['typeddicts_extra_items.py:302: error: Extra key "year" for TypedDict "MovieExtraInt"'] -Line 304: Unexpected errors ['typeddicts_extra_items.py:304: error: Incompatible types in assignment (expression has type "MovieExtraInt", variable has type "Mapping[str, int | str]")'] -Line 310: Unexpected errors ['typeddicts_extra_items.py:310: error: Expression is of type "list[tuple[str, object]]", not "list[tuple[str, int | str]]"'] -Line 311: Unexpected errors ['typeddicts_extra_items.py:311: error: Expression is of type "list[object]", not "list[int | str]"'] -Line 319: Unexpected errors ['typeddicts_extra_items.py:319: error: Unexpected keyword argument "extra_items" for TypedDict'] -Line 326: Unexpected errors ['typeddicts_extra_items.py:326: error: Incompatible types in assignment (expression has type "IntDict", variable has type "dict[str, int]")'] -Line 329: Unexpected errors ['typeddicts_extra_items.py:329: error: Extra key "bar" for TypedDict "IntDictWithNum"'] -Line 330: Unexpected errors ['typeddicts_extra_items.py:330: error: Incompatible types in assignment (expression has type "IntDictWithNum", variable has type "dict[str, int]")'] -Line 337: Unexpected errors ['typeddicts_extra_items.py:337: error: "IntDictWithNum" has no attribute "clear"'] -Line 339: Unexpected errors ['typeddicts_extra_items.py:339: error: Expression is of type "Any", not "tuple[str, int]"', 'typeddicts_extra_items.py:339: error: "IntDictWithNum" has no attribute "popitem"'] -Line 342: Unexpected errors ['typeddicts_extra_items.py:342: error: TypedDict key must be a string literal; expected one of ("num")'] -Line 343: Unexpected errors ['typeddicts_extra_items.py:343: error: Expected TypedDict key to be string literal'] +Line 11: Unexpected errors ['typeddicts_extra_items.py:11: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg]'] +Line 14: Unexpected errors ['typeddicts_extra_items.py:14: error: Extra key "novel_adaptation" for TypedDict "Movie" [typeddict-unknown-key]'] +Line 19: Unexpected errors ['typeddicts_extra_items.py:19: error: Unexpected keyword argument "extra_items" for "TypedDict" [call-arg]'] +Line 29: Unexpected errors ['typeddicts_extra_items.py:29: error: Expression is of type "Any", not "bool" [misc]', 'typeddicts_extra_items.py:29: error: TypedDict "Movie" has no key "novel_adaptation" [typeddict-item]'] +Line 33: Unexpected errors ['typeddicts_extra_items.py:33: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg]'] +Line 40: Unexpected errors ['typeddicts_extra_items.py:40: error: Extra key "other_extra_key" for TypedDict "InheritedMovie" [typeddict-unknown-key]'] +Line 55: Unexpected errors ['typeddicts_extra_items.py:55: error: Unexpected keyword argument "closed" for TypedDict [call-arg]'] +Line 64: Unexpected errors ['typeddicts_extra_items.py:64: error: Unexpected keyword argument "closed" for TypedDict [call-arg]'] +Line 70: Unexpected errors ['typeddicts_extra_items.py:70: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg]'] +Line 82: Unexpected errors ['typeddicts_extra_items.py:82: error: Unexpected keyword argument "closed" for TypedDict [call-arg]'] +Line 88: Unexpected errors ['typeddicts_extra_items.py:88: error: Unexpected keyword argument "closed" for TypedDict [call-arg]'] +Line 100: Unexpected errors ['typeddicts_extra_items.py:100: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg]'] +Line 103: Unexpected errors ['typeddicts_extra_items.py:103: error: Unexpected keyword argument "closed" for TypedDict [call-arg]'] +Line 106: Unexpected errors ['typeddicts_extra_items.py:106: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg]'] +Line 124: Unexpected errors ['typeddicts_extra_items.py:124: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg]'] +Line 129: Unexpected errors ['typeddicts_extra_items.py:129: error: TypedDict "MovieEI" has no key "year" [typeddict-unknown-key]'] +Line 137: Unexpected errors ['typeddicts_extra_items.py:137: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg]'] +Line 144: Unexpected errors ['typeddicts_extra_items.py:144: error: Unexpected keyword argument "year" for "unpack_extra" [call-arg]'] +Line 149: Unexpected errors ['typeddicts_extra_items.py:149: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg]'] +Line 152: Unexpected errors ['typeddicts_extra_items.py:152: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg]'] +Line 155: Unexpected errors ['typeddicts_extra_items.py:155: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg]'] +Line 165: Unexpected errors ['typeddicts_extra_items.py:165: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg]'] +Line 171: Unexpected errors ['typeddicts_extra_items.py:171: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg]'] +Line 181: Unexpected errors ['typeddicts_extra_items.py:181: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg]'] +Line 193: Unexpected errors ['typeddicts_extra_items.py:193: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg]'] +Line 210: Unexpected errors ['typeddicts_extra_items.py:210: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg]'] +Line 217: Unexpected errors ['typeddicts_extra_items.py:217: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg]'] +Line 228: Unexpected errors ['typeddicts_extra_items.py:228: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg]'] +Line 231: Unexpected errors ['typeddicts_extra_items.py:231: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg]'] +Line 235: Unexpected errors ['typeddicts_extra_items.py:235: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg]'] +Line 248: Unexpected errors ['typeddicts_extra_items.py:248: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg]'] +Line 251: Unexpected errors ['typeddicts_extra_items.py:251: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg]'] +Line 254: Unexpected errors ['typeddicts_extra_items.py:254: error: Extra key "year" for TypedDict "MovieExtraInt" [typeddict-unknown-key]'] +Line 255: Unexpected errors ['typeddicts_extra_items.py:255: error: Extra key "description" for TypedDict "MovieExtraStr" [typeddict-unknown-key]'] +Line 266: Unexpected errors ['typeddicts_extra_items.py:266: error: Extra key "year" for TypedDict "MovieExtraInt" [typeddict-unknown-key]'] +Line 280: Unexpected errors ['typeddicts_extra_items.py:280: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg]'] +Line 284: Unexpected errors ['typeddicts_extra_items.py:284: error: Extra key "year" for TypedDict "ExtraMovie" [typeddict-unknown-key]'] +Line 289: Unexpected errors ['typeddicts_extra_items.py:289: error: Unexpected keyword argument "closed" for TypedDict [call-arg]'] +Line 299: Unexpected errors ['typeddicts_extra_items.py:299: error: Extra key "summary" for TypedDict "MovieExtraStr" [typeddict-unknown-key]'] +Line 300: Unexpected errors ['typeddicts_extra_items.py:300: error: Incompatible types in assignment (expression has type "MovieExtraStr", variable has type "Mapping[str, str]") [assignment]'] +Line 302: Unexpected errors ['typeddicts_extra_items.py:302: error: Extra key "year" for TypedDict "MovieExtraInt" [typeddict-unknown-key]'] +Line 304: Unexpected errors ['typeddicts_extra_items.py:304: error: Incompatible types in assignment (expression has type "MovieExtraInt", variable has type "Mapping[str, int | str]") [assignment]'] +Line 310: Unexpected errors ['typeddicts_extra_items.py:310: error: Expression is of type "list[tuple[str, object]]", not "list[tuple[str, int | str]]" [misc]'] +Line 311: Unexpected errors ['typeddicts_extra_items.py:311: error: Expression is of type "list[object]", not "list[int | str]" [misc]'] +Line 319: Unexpected errors ['typeddicts_extra_items.py:319: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg]'] +Line 326: Unexpected errors ['typeddicts_extra_items.py:326: error: Incompatible types in assignment (expression has type "IntDict", variable has type "dict[str, int]") [assignment]'] +Line 329: Unexpected errors ['typeddicts_extra_items.py:329: error: Extra key "bar" for TypedDict "IntDictWithNum" [typeddict-unknown-key]'] +Line 330: Unexpected errors ['typeddicts_extra_items.py:330: error: Incompatible types in assignment (expression has type "IntDictWithNum", variable has type "dict[str, int]") [assignment]'] +Line 337: Unexpected errors ['typeddicts_extra_items.py:337: error: "IntDictWithNum" has no attribute "clear" [attr-defined]'] +Line 339: Unexpected errors ['typeddicts_extra_items.py:339: error: Expression is of type "Any", not "tuple[str, int]" [misc]', 'typeddicts_extra_items.py:339: error: "IntDictWithNum" has no attribute "popitem" [attr-defined]'] +Line 342: Unexpected errors ['typeddicts_extra_items.py:342: error: TypedDict key must be a string literal; expected one of ("num") [misc]'] +Line 343: Unexpected errors ['typeddicts_extra_items.py:343: error: Expected TypedDict key to be string literal [misc]'] """ output = """ -typeddicts_extra_items.py:11: error: Unexpected keyword argument "extra_items" for TypedDict -typeddicts_extra_items.py:14: error: Extra key "novel_adaptation" for TypedDict "Movie" -typeddicts_extra_items.py:15: error: Extra key "year" for TypedDict "Movie" -typeddicts_extra_items.py:19: error: Unexpected keyword argument "extra_items" for "TypedDict" -typeddicts_extra_items.py:29: error: Expression is of type "Any", not "bool" -typeddicts_extra_items.py:29: error: TypedDict "Movie" has no key "novel_adaptation" -typeddicts_extra_items.py:33: error: Unexpected keyword argument "extra_items" for TypedDict -typeddicts_extra_items.py:39: error: Incompatible types (expression has type "None", TypedDict item "year" has type "int") -typeddicts_extra_items.py:40: error: Extra key "other_extra_key" for TypedDict "InheritedMovie" -typeddicts_extra_items.py:49: error: Unexpected keyword argument "closed" for TypedDict -typeddicts_extra_items.py:55: error: Unexpected keyword argument "closed" for TypedDict -typeddicts_extra_items.py:64: error: Unexpected keyword argument "closed" for TypedDict -typeddicts_extra_items.py:67: error: Unexpected keyword argument "closed" for TypedDict -typeddicts_extra_items.py:70: error: Unexpected keyword argument "extra_items" for TypedDict -typeddicts_extra_items.py:73: error: Unexpected keyword argument "closed" for TypedDict -typeddicts_extra_items.py:82: error: Unexpected keyword argument "closed" for TypedDict -typeddicts_extra_items.py:88: error: Unexpected keyword argument "closed" for TypedDict -typeddicts_extra_items.py:100: error: Unexpected keyword argument "extra_items" for TypedDict -typeddicts_extra_items.py:103: error: Unexpected keyword argument "closed" for TypedDict -typeddicts_extra_items.py:106: error: Unexpected keyword argument "extra_items" for TypedDict -typeddicts_extra_items.py:109: error: Unexpected keyword argument "closed" for TypedDict -typeddicts_extra_items.py:114: error: Unexpected keyword argument "extra_items" for TypedDict -typeddicts_extra_items.py:117: error: Unexpected keyword argument "extra_items" for TypedDict -typeddicts_extra_items.py:124: error: Unexpected keyword argument "extra_items" for TypedDict -typeddicts_extra_items.py:128: error: Key "name" of TypedDict "MovieEI" cannot be deleted -typeddicts_extra_items.py:129: error: TypedDict "MovieEI" has no key "year" -typeddicts_extra_items.py:137: error: Unexpected keyword argument "extra_items" for TypedDict -typeddicts_extra_items.py:143: error: Unexpected keyword argument "year" for "unpack_no_extra" -typeddicts_extra_items.py:144: error: Unexpected keyword argument "year" for "unpack_extra" -typeddicts_extra_items.py:149: error: Unexpected keyword argument "extra_items" for TypedDict -typeddicts_extra_items.py:152: error: Unexpected keyword argument "extra_items" for TypedDict -typeddicts_extra_items.py:155: error: Unexpected keyword argument "extra_items" for TypedDict -typeddicts_extra_items.py:165: error: Unexpected keyword argument "extra_items" for TypedDict -typeddicts_extra_items.py:171: error: Unexpected keyword argument "extra_items" for TypedDict -typeddicts_extra_items.py:174: error: Unexpected keyword argument "extra_items" for TypedDict -typeddicts_extra_items.py:181: error: Unexpected keyword argument "extra_items" for TypedDict -typeddicts_extra_items.py:193: error: Unexpected keyword argument "extra_items" for TypedDict -typeddicts_extra_items.py:210: error: Unexpected keyword argument "extra_items" for TypedDict -typeddicts_extra_items.py:217: error: Unexpected keyword argument "extra_items" for TypedDict -typeddicts_extra_items.py:228: error: Unexpected keyword argument "extra_items" for TypedDict -typeddicts_extra_items.py:231: error: Unexpected keyword argument "extra_items" for TypedDict -typeddicts_extra_items.py:235: error: Unexpected keyword argument "extra_items" for TypedDict -typeddicts_extra_items.py:248: error: Unexpected keyword argument "extra_items" for TypedDict -typeddicts_extra_items.py:251: error: Unexpected keyword argument "extra_items" for TypedDict -typeddicts_extra_items.py:254: error: Extra key "year" for TypedDict "MovieExtraInt" -typeddicts_extra_items.py:255: error: Extra key "description" for TypedDict "MovieExtraStr" -typeddicts_extra_items.py:266: error: Extra key "year" for TypedDict "MovieExtraInt" -typeddicts_extra_items.py:278: error: Extra key "year" for TypedDict "NonClosedMovie" -typeddicts_extra_items.py:280: error: Unexpected keyword argument "extra_items" for TypedDict -typeddicts_extra_items.py:284: error: Extra key "year" for TypedDict "ExtraMovie" -typeddicts_extra_items.py:285: error: Extra key "language" for TypedDict "ExtraMovie" -typeddicts_extra_items.py:289: error: Unexpected keyword argument "closed" for TypedDict -typeddicts_extra_items.py:293: error: Extra key "year" for TypedDict "ClosedMovie" -typeddicts_extra_items.py:299: error: Extra key "summary" for TypedDict "MovieExtraStr" -typeddicts_extra_items.py:300: error: Incompatible types in assignment (expression has type "MovieExtraStr", variable has type "Mapping[str, str]") -typeddicts_extra_items.py:302: error: Extra key "year" for TypedDict "MovieExtraInt" -typeddicts_extra_items.py:303: error: Incompatible types in assignment (expression has type "MovieExtraInt", variable has type "Mapping[str, int]") -typeddicts_extra_items.py:304: error: Incompatible types in assignment (expression has type "MovieExtraInt", variable has type "Mapping[str, int | str]") -typeddicts_extra_items.py:310: error: Expression is of type "list[tuple[str, object]]", not "list[tuple[str, int | str]]" -typeddicts_extra_items.py:311: error: Expression is of type "list[object]", not "list[int | str]" -typeddicts_extra_items.py:319: error: Unexpected keyword argument "extra_items" for TypedDict -typeddicts_extra_items.py:326: error: Incompatible types in assignment (expression has type "IntDict", variable has type "dict[str, int]") -typeddicts_extra_items.py:329: error: Extra key "bar" for TypedDict "IntDictWithNum" -typeddicts_extra_items.py:330: error: Incompatible types in assignment (expression has type "IntDictWithNum", variable has type "dict[str, int]") -typeddicts_extra_items.py:337: error: "IntDictWithNum" has no attribute "clear" -typeddicts_extra_items.py:339: error: Expression is of type "Any", not "tuple[str, int]" -typeddicts_extra_items.py:339: error: "IntDictWithNum" has no attribute "popitem" -typeddicts_extra_items.py:342: error: TypedDict key must be a string literal; expected one of ("num") -typeddicts_extra_items.py:343: error: Expected TypedDict key to be string literal -typeddicts_extra_items.py:352: error: Incompatible types in assignment (expression has type "dict[str, int]", variable has type "IntDict") +typeddicts_extra_items.py:11: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg] +typeddicts_extra_items.py:14: error: Extra key "novel_adaptation" for TypedDict "Movie" [typeddict-unknown-key] +typeddicts_extra_items.py:15: error: Extra key "year" for TypedDict "Movie" [typeddict-unknown-key] +typeddicts_extra_items.py:19: error: Unexpected keyword argument "extra_items" for "TypedDict" [call-arg] +typeddicts_extra_items.py:29: error: Expression is of type "Any", not "bool" [misc] +typeddicts_extra_items.py:29: error: TypedDict "Movie" has no key "novel_adaptation" [typeddict-item] +typeddicts_extra_items.py:33: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg] +typeddicts_extra_items.py:39: error: Incompatible types (expression has type "None", TypedDict item "year" has type "int") [typeddict-item] +typeddicts_extra_items.py:40: error: Extra key "other_extra_key" for TypedDict "InheritedMovie" [typeddict-unknown-key] +typeddicts_extra_items.py:49: error: Unexpected keyword argument "closed" for TypedDict [call-arg] +typeddicts_extra_items.py:55: error: Unexpected keyword argument "closed" for TypedDict [call-arg] +typeddicts_extra_items.py:64: error: Unexpected keyword argument "closed" for TypedDict [call-arg] +typeddicts_extra_items.py:67: error: Unexpected keyword argument "closed" for TypedDict [call-arg] +typeddicts_extra_items.py:70: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg] +typeddicts_extra_items.py:73: error: Unexpected keyword argument "closed" for TypedDict [call-arg] +typeddicts_extra_items.py:82: error: Unexpected keyword argument "closed" for TypedDict [call-arg] +typeddicts_extra_items.py:88: error: Unexpected keyword argument "closed" for TypedDict [call-arg] +typeddicts_extra_items.py:100: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg] +typeddicts_extra_items.py:103: error: Unexpected keyword argument "closed" for TypedDict [call-arg] +typeddicts_extra_items.py:106: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg] +typeddicts_extra_items.py:109: error: Unexpected keyword argument "closed" for TypedDict [call-arg] +typeddicts_extra_items.py:114: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg] +typeddicts_extra_items.py:117: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg] +typeddicts_extra_items.py:124: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg] +typeddicts_extra_items.py:128: error: Key "name" of TypedDict "MovieEI" cannot be deleted [misc] +typeddicts_extra_items.py:129: error: TypedDict "MovieEI" has no key "year" [typeddict-unknown-key] +typeddicts_extra_items.py:137: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg] +typeddicts_extra_items.py:143: error: Unexpected keyword argument "year" for "unpack_no_extra" [call-arg] +typeddicts_extra_items.py:144: error: Unexpected keyword argument "year" for "unpack_extra" [call-arg] +typeddicts_extra_items.py:149: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg] +typeddicts_extra_items.py:152: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg] +typeddicts_extra_items.py:155: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg] +typeddicts_extra_items.py:165: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg] +typeddicts_extra_items.py:171: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg] +typeddicts_extra_items.py:174: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg] +typeddicts_extra_items.py:181: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg] +typeddicts_extra_items.py:193: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg] +typeddicts_extra_items.py:210: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg] +typeddicts_extra_items.py:217: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg] +typeddicts_extra_items.py:228: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg] +typeddicts_extra_items.py:231: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg] +typeddicts_extra_items.py:235: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg] +typeddicts_extra_items.py:248: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg] +typeddicts_extra_items.py:251: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg] +typeddicts_extra_items.py:254: error: Extra key "year" for TypedDict "MovieExtraInt" [typeddict-unknown-key] +typeddicts_extra_items.py:255: error: Extra key "description" for TypedDict "MovieExtraStr" [typeddict-unknown-key] +typeddicts_extra_items.py:266: error: Extra key "year" for TypedDict "MovieExtraInt" [typeddict-unknown-key] +typeddicts_extra_items.py:278: error: Extra key "year" for TypedDict "NonClosedMovie" [typeddict-unknown-key] +typeddicts_extra_items.py:280: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg] +typeddicts_extra_items.py:284: error: Extra key "year" for TypedDict "ExtraMovie" [typeddict-unknown-key] +typeddicts_extra_items.py:285: error: Extra key "language" for TypedDict "ExtraMovie" [typeddict-unknown-key] +typeddicts_extra_items.py:289: error: Unexpected keyword argument "closed" for TypedDict [call-arg] +typeddicts_extra_items.py:293: error: Extra key "year" for TypedDict "ClosedMovie" [typeddict-unknown-key] +typeddicts_extra_items.py:299: error: Extra key "summary" for TypedDict "MovieExtraStr" [typeddict-unknown-key] +typeddicts_extra_items.py:300: error: Incompatible types in assignment (expression has type "MovieExtraStr", variable has type "Mapping[str, str]") [assignment] +typeddicts_extra_items.py:302: error: Extra key "year" for TypedDict "MovieExtraInt" [typeddict-unknown-key] +typeddicts_extra_items.py:303: error: Incompatible types in assignment (expression has type "MovieExtraInt", variable has type "Mapping[str, int]") [assignment] +typeddicts_extra_items.py:304: error: Incompatible types in assignment (expression has type "MovieExtraInt", variable has type "Mapping[str, int | str]") [assignment] +typeddicts_extra_items.py:310: error: Expression is of type "list[tuple[str, object]]", not "list[tuple[str, int | str]]" [misc] +typeddicts_extra_items.py:311: error: Expression is of type "list[object]", not "list[int | str]" [misc] +typeddicts_extra_items.py:319: error: Unexpected keyword argument "extra_items" for TypedDict [call-arg] +typeddicts_extra_items.py:326: error: Incompatible types in assignment (expression has type "IntDict", variable has type "dict[str, int]") [assignment] +typeddicts_extra_items.py:329: error: Extra key "bar" for TypedDict "IntDictWithNum" [typeddict-unknown-key] +typeddicts_extra_items.py:330: error: Incompatible types in assignment (expression has type "IntDictWithNum", variable has type "dict[str, int]") [assignment] +typeddicts_extra_items.py:337: error: "IntDictWithNum" has no attribute "clear" [attr-defined] +typeddicts_extra_items.py:339: error: Expression is of type "Any", not "tuple[str, int]" [misc] +typeddicts_extra_items.py:339: error: "IntDictWithNum" has no attribute "popitem" [attr-defined] +typeddicts_extra_items.py:342: error: TypedDict key must be a string literal; expected one of ("num") [misc] +typeddicts_extra_items.py:343: error: Expected TypedDict key to be string literal [misc] +typeddicts_extra_items.py:352: error: Incompatible types in assignment (expression has type "dict[str, int]", variable has type "IntDict") [assignment] """ diff --git a/conformance/results/zuban/typeddicts_inheritance.toml b/conformance/results/zuban/typeddicts_inheritance.toml index a4ea1936f..51cd4730d 100644 --- a/conformance/results/zuban/typeddicts_inheritance.toml +++ b/conformance/results/zuban/typeddicts_inheritance.toml @@ -2,7 +2,7 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -typeddicts_inheritance.py:44: error: All bases of a new TypedDict must be TypedDict types -typeddicts_inheritance.py:55: error: Overwriting TypedDict field "x" while extending -typeddicts_inheritance.py:65: error: Overwriting TypedDict field "x" while merging +typeddicts_inheritance.py:44: error: All bases of a new TypedDict must be TypedDict types [misc] +typeddicts_inheritance.py:55: error: Overwriting TypedDict field "x" while extending [misc] +typeddicts_inheritance.py:65: error: Overwriting TypedDict field "x" while merging [misc] """ diff --git a/conformance/results/zuban/typeddicts_operations.toml b/conformance/results/zuban/typeddicts_operations.toml index fbe20908f..1f0db30f5 100644 --- a/conformance/results/zuban/typeddicts_operations.toml +++ b/conformance/results/zuban/typeddicts_operations.toml @@ -2,15 +2,15 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -typeddicts_operations.py:22: error: Value of "name" has incompatible type "int"; expected "str" -typeddicts_operations.py:23: error: Value of "year" has incompatible type "str"; expected "int" -typeddicts_operations.py:24: error: TypedDict "Movie" has no key "other" -typeddicts_operations.py:26: error: TypedDict "Movie" has no key "other" -typeddicts_operations.py:28: error: Missing key "year" for TypedDict "Movie" -typeddicts_operations.py:29: error: Incompatible types (expression has type "float", TypedDict item "year" has type "int") -typeddicts_operations.py:32: error: Extra key "other" for TypedDict "Movie" -typeddicts_operations.py:37: error: Expected TypedDict key to be string literal -typeddicts_operations.py:47: error: "Movie" has no attribute "clear" -typeddicts_operations.py:49: error: Key "name" of TypedDict "Movie" cannot be deleted -typeddicts_operations.py:62: error: "MovieOptional" has no attribute "clear" +typeddicts_operations.py:22: error: Value of "name" has incompatible type "int"; expected "str" [typeddict-item] +typeddicts_operations.py:23: error: Value of "year" has incompatible type "str"; expected "int" [typeddict-item] +typeddicts_operations.py:24: error: TypedDict "Movie" has no key "other" [typeddict-unknown-key] +typeddicts_operations.py:26: error: TypedDict "Movie" has no key "other" [typeddict-item] +typeddicts_operations.py:28: error: Missing key "year" for TypedDict "Movie" [typeddict-item] +typeddicts_operations.py:29: error: Incompatible types (expression has type "float", TypedDict item "year" has type "int") [typeddict-item] +typeddicts_operations.py:32: error: Extra key "other" for TypedDict "Movie" [typeddict-unknown-key] +typeddicts_operations.py:37: error: Expected TypedDict key to be string literal [misc] +typeddicts_operations.py:47: error: "Movie" has no attribute "clear" [attr-defined] +typeddicts_operations.py:49: error: Key "name" of TypedDict "Movie" cannot be deleted [misc] +typeddicts_operations.py:62: error: "MovieOptional" has no attribute "clear" [attr-defined] """ diff --git a/conformance/results/zuban/typeddicts_readonly.toml b/conformance/results/zuban/typeddicts_readonly.toml index 3185cff8d..a9a626030 100644 --- a/conformance/results/zuban/typeddicts_readonly.toml +++ b/conformance/results/zuban/typeddicts_readonly.toml @@ -2,10 +2,10 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -typeddicts_readonly.py:24: error: ReadOnly TypedDict key "members" TypedDict is mutated -typeddicts_readonly.py:36: error: ReadOnly TypedDict key "members" TypedDict is mutated -typeddicts_readonly.py:50: error: ReadOnly TypedDict key "title" TypedDict is mutated -typeddicts_readonly.py:51: error: ReadOnly TypedDict key "year" TypedDict is mutated -typeddicts_readonly.py:60: error: ReadOnly TypedDict key "title" TypedDict is mutated -typeddicts_readonly.py:61: error: ReadOnly TypedDict key "year" TypedDict is mutated +typeddicts_readonly.py:24: error: ReadOnly TypedDict key "members" TypedDict is mutated [typeddict-readonly-mutated] +typeddicts_readonly.py:36: error: ReadOnly TypedDict key "members" TypedDict is mutated [typeddict-readonly-mutated] +typeddicts_readonly.py:50: error: ReadOnly TypedDict key "title" TypedDict is mutated [typeddict-readonly-mutated] +typeddicts_readonly.py:51: error: ReadOnly TypedDict key "year" TypedDict is mutated [typeddict-readonly-mutated] +typeddicts_readonly.py:60: error: ReadOnly TypedDict key "title" TypedDict is mutated [typeddict-readonly-mutated] +typeddicts_readonly.py:61: error: ReadOnly TypedDict key "year" TypedDict is mutated [typeddict-readonly-mutated] """ diff --git a/conformance/results/zuban/typeddicts_readonly_consistency.toml b/conformance/results/zuban/typeddicts_readonly_consistency.toml index 4a317175c..183704fe6 100644 --- a/conformance/results/zuban/typeddicts_readonly_consistency.toml +++ b/conformance/results/zuban/typeddicts_readonly_consistency.toml @@ -2,11 +2,11 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -typeddicts_readonly_consistency.py:37: error: Incompatible types in assignment (expression has type "A1", variable has type "B1") -typeddicts_readonly_consistency.py:38: error: Incompatible types in assignment (expression has type "C1", variable has type "B1") -typeddicts_readonly_consistency.py:40: error: Incompatible types in assignment (expression has type "A1", variable has type "C1") -typeddicts_readonly_consistency.py:81: error: Incompatible types in assignment (expression has type "A2", variable has type "B2") -typeddicts_readonly_consistency.py:82: error: Incompatible types in assignment (expression has type "C2", variable has type "B2") -typeddicts_readonly_consistency.py:84: error: Incompatible types in assignment (expression has type "A2", variable has type "C2") -typeddicts_readonly_consistency.py:85: error: Incompatible types in assignment (expression has type "B2", variable has type "C2") +typeddicts_readonly_consistency.py:37: error: Incompatible types in assignment (expression has type "A1", variable has type "B1") [assignment] +typeddicts_readonly_consistency.py:38: error: Incompatible types in assignment (expression has type "C1", variable has type "B1") [assignment] +typeddicts_readonly_consistency.py:40: error: Incompatible types in assignment (expression has type "A1", variable has type "C1") [assignment] +typeddicts_readonly_consistency.py:81: error: Incompatible types in assignment (expression has type "A2", variable has type "B2") [assignment] +typeddicts_readonly_consistency.py:82: error: Incompatible types in assignment (expression has type "C2", variable has type "B2") [assignment] +typeddicts_readonly_consistency.py:84: error: Incompatible types in assignment (expression has type "A2", variable has type "C2") [assignment] +typeddicts_readonly_consistency.py:85: error: Incompatible types in assignment (expression has type "B2", variable has type "C2") [assignment] """ diff --git a/conformance/results/zuban/typeddicts_readonly_inheritance.toml b/conformance/results/zuban/typeddicts_readonly_inheritance.toml index 791935087..1cc7d5751 100644 --- a/conformance/results/zuban/typeddicts_readonly_inheritance.toml +++ b/conformance/results/zuban/typeddicts_readonly_inheritance.toml @@ -6,29 +6,29 @@ Incorrectly rejects override of NotRequired ReadOnly item with a Required ReadOn """ conformance_automated = "Fail" errors_diff = """ -Line 19: Unexpected errors ['typeddicts_readonly_inheritance.py:19: error: Overwriting TypedDict field "name" while extending'] -Line 49: Unexpected errors ['typeddicts_readonly_inheritance.py:49: error: Overwriting TypedDict field "albums" while extending'] -Line 62: Unexpected errors ['typeddicts_readonly_inheritance.py:62: error: Overwriting TypedDict field "name" while extending'] -Line 76: Unexpected errors ['typeddicts_readonly_inheritance.py:76: error: Overwriting TypedDict field "ident" while extending'] -Line 102: Unexpected errors ['typeddicts_readonly_inheritance.py:102: error: Overwriting TypedDict field "b" while extending'] +Line 19: Unexpected errors ['typeddicts_readonly_inheritance.py:19: error: Overwriting TypedDict field "name" while extending [misc]'] +Line 49: Unexpected errors ['typeddicts_readonly_inheritance.py:49: error: Overwriting TypedDict field "albums" while extending [misc]'] +Line 62: Unexpected errors ['typeddicts_readonly_inheritance.py:62: error: Overwriting TypedDict field "name" while extending [misc]'] +Line 76: Unexpected errors ['typeddicts_readonly_inheritance.py:76: error: Overwriting TypedDict field "ident" while extending [misc]'] +Line 102: Unexpected errors ['typeddicts_readonly_inheritance.py:102: error: Overwriting TypedDict field "b" while extending [misc]'] """ output = """ -typeddicts_readonly_inheritance.py:19: error: Overwriting TypedDict field "name" while extending -typeddicts_readonly_inheritance.py:36: error: ReadOnly TypedDict key "name" TypedDict is mutated -typeddicts_readonly_inheritance.py:49: error: Overwriting TypedDict field "albums" while extending -typeddicts_readonly_inheritance.py:50: error: Overwriting TypedDict field "alt" while extending -typeddicts_readonly_inheritance.py:62: error: Overwriting TypedDict field "name" while extending -typeddicts_readonly_inheritance.py:65: error: Missing key "name" for TypedDict "RequiredName" -typeddicts_readonly_inheritance.py:76: error: Overwriting TypedDict field "ident" while extending -typeddicts_readonly_inheritance.py:82: error: Value of "ident" has incompatible type "int"; expected "str" -typeddicts_readonly_inheritance.py:83: error: Incompatible types (expression has type "int", TypedDict item "ident" has type "str") -typeddicts_readonly_inheritance.py:84: error: Missing key "ident" for TypedDict "User" -typeddicts_readonly_inheritance.py:94: error: Overwriting TypedDict field "a" while extending -typeddicts_readonly_inheritance.py:98: error: Overwriting TypedDict field "a" while extending -typeddicts_readonly_inheritance.py:102: error: Overwriting TypedDict field "b" while extending -typeddicts_readonly_inheritance.py:106: error: Overwriting TypedDict field "c" while extending -typeddicts_readonly_inheritance.py:119: error: Overwriting TypedDict field "x" while merging -typeddicts_readonly_inheritance.py:119: error: Overwriting TypedDict field "y" while merging -typeddicts_readonly_inheritance.py:132: error: Overwriting TypedDict field "x" while merging -typeddicts_readonly_inheritance.py:132: error: Overwriting TypedDict field "y" while merging +typeddicts_readonly_inheritance.py:19: error: Overwriting TypedDict field "name" while extending [misc] +typeddicts_readonly_inheritance.py:36: error: ReadOnly TypedDict key "name" TypedDict is mutated [typeddict-readonly-mutated] +typeddicts_readonly_inheritance.py:49: error: Overwriting TypedDict field "albums" while extending [misc] +typeddicts_readonly_inheritance.py:50: error: Overwriting TypedDict field "alt" while extending [misc] +typeddicts_readonly_inheritance.py:62: error: Overwriting TypedDict field "name" while extending [misc] +typeddicts_readonly_inheritance.py:65: error: Missing key "name" for TypedDict "RequiredName" [typeddict-item] +typeddicts_readonly_inheritance.py:76: error: Overwriting TypedDict field "ident" while extending [misc] +typeddicts_readonly_inheritance.py:82: error: Value of "ident" has incompatible type "int"; expected "str" [typeddict-item] +typeddicts_readonly_inheritance.py:83: error: Incompatible types (expression has type "int", TypedDict item "ident" has type "str") [typeddict-item] +typeddicts_readonly_inheritance.py:84: error: Missing key "ident" for TypedDict "User" [typeddict-item] +typeddicts_readonly_inheritance.py:94: error: Overwriting TypedDict field "a" while extending [misc] +typeddicts_readonly_inheritance.py:98: error: Overwriting TypedDict field "a" while extending [misc] +typeddicts_readonly_inheritance.py:102: error: Overwriting TypedDict field "b" while extending [misc] +typeddicts_readonly_inheritance.py:106: error: Overwriting TypedDict field "c" while extending [misc] +typeddicts_readonly_inheritance.py:119: error: Overwriting TypedDict field "x" while merging [misc] +typeddicts_readonly_inheritance.py:119: error: Overwriting TypedDict field "y" while merging [misc] +typeddicts_readonly_inheritance.py:132: error: Overwriting TypedDict field "x" while merging [misc] +typeddicts_readonly_inheritance.py:132: error: Overwriting TypedDict field "y" while merging [misc] """ diff --git a/conformance/results/zuban/typeddicts_readonly_kwargs.toml b/conformance/results/zuban/typeddicts_readonly_kwargs.toml index 4889dc9b3..48f979f9b 100644 --- a/conformance/results/zuban/typeddicts_readonly_kwargs.toml +++ b/conformance/results/zuban/typeddicts_readonly_kwargs.toml @@ -2,5 +2,5 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -typeddicts_readonly_kwargs.py:33: error: ReadOnly TypedDict key "key1" TypedDict is mutated +typeddicts_readonly_kwargs.py:33: error: ReadOnly TypedDict key "key1" TypedDict is mutated [typeddict-readonly-mutated] """ diff --git a/conformance/results/zuban/typeddicts_required.toml b/conformance/results/zuban/typeddicts_required.toml index 1d81007d5..71d502073 100644 --- a/conformance/results/zuban/typeddicts_required.toml +++ b/conformance/results/zuban/typeddicts_required.toml @@ -2,8 +2,8 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -typeddicts_required.py:12: error: Required[] can be only used in a TypedDict definition -typeddicts_required.py:19: error: NotRequired[] can be only used in a TypedDict definition -typeddicts_required.py:62: error: "Required[]" type cannot be nested -typeddicts_required.py:63: error: "NotRequired[]" type cannot be nested +typeddicts_required.py:12: error: Required[] can be only used in a TypedDict definition [valid-type] +typeddicts_required.py:19: error: NotRequired[] can be only used in a TypedDict definition [valid-type] +typeddicts_required.py:62: error: "Required[]" type cannot be nested [misc] +typeddicts_required.py:63: error: "NotRequired[]" type cannot be nested [misc] """ diff --git a/conformance/results/zuban/typeddicts_type_consistency.toml b/conformance/results/zuban/typeddicts_type_consistency.toml index 7ad2d28a5..54fba6af7 100644 --- a/conformance/results/zuban/typeddicts_type_consistency.toml +++ b/conformance/results/zuban/typeddicts_type_consistency.toml @@ -2,15 +2,15 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -typeddicts_type_consistency.py:21: error: Incompatible types in assignment (expression has type "B1", variable has type "A1") -typeddicts_type_consistency.py:38: error: Incompatible types in assignment (expression has type "B2", variable has type "A2") -typeddicts_type_consistency.py:65: error: Incompatible types in assignment (expression has type "A3", variable has type "B3") -typeddicts_type_consistency.py:69: error: Extra key "y" for TypedDict "A3" -typeddicts_type_consistency.py:76: error: Incompatible types in assignment (expression has type "B3", variable has type "dict[str, int]") -typeddicts_type_consistency.py:77: error: Incompatible types in assignment (expression has type "B3", variable has type "dict[str, object]") -typeddicts_type_consistency.py:78: error: Incompatible types in assignment (expression has type "B3", variable has type "dict[Any, Any]") -typeddicts_type_consistency.py:82: error: Incompatible types in assignment (expression has type "B3", variable has type "Mapping[str, int]") -typeddicts_type_consistency.py:101: error: Incompatible types in assignment (expression has type "str | None", variable has type "str") -typeddicts_type_consistency.py:107: error: Incompatible types in assignment (expression has type "int | str", variable has type "int") -typeddicts_type_consistency.py:126: error: Incompatible types (expression has type "int", TypedDict item "inner_key" has type "str") +typeddicts_type_consistency.py:21: error: Incompatible types in assignment (expression has type "B1", variable has type "A1") [assignment] +typeddicts_type_consistency.py:38: error: Incompatible types in assignment (expression has type "B2", variable has type "A2") [assignment] +typeddicts_type_consistency.py:65: error: Incompatible types in assignment (expression has type "A3", variable has type "B3") [assignment] +typeddicts_type_consistency.py:69: error: Extra key "y" for TypedDict "A3" [typeddict-unknown-key] +typeddicts_type_consistency.py:76: error: Incompatible types in assignment (expression has type "B3", variable has type "dict[str, int]") [assignment] +typeddicts_type_consistency.py:77: error: Incompatible types in assignment (expression has type "B3", variable has type "dict[str, object]") [assignment] +typeddicts_type_consistency.py:78: error: Incompatible types in assignment (expression has type "B3", variable has type "dict[Any, Any]") [assignment] +typeddicts_type_consistency.py:82: error: Incompatible types in assignment (expression has type "B3", variable has type "Mapping[str, int]") [assignment] +typeddicts_type_consistency.py:101: error: Incompatible types in assignment (expression has type "str | None", variable has type "str") [assignment] +typeddicts_type_consistency.py:107: error: Incompatible types in assignment (expression has type "int | str", variable has type "int") [assignment] +typeddicts_type_consistency.py:126: error: Incompatible types (expression has type "int", TypedDict item "inner_key" has type "str") [typeddict-item] """ diff --git a/conformance/results/zuban/typeddicts_usage.toml b/conformance/results/zuban/typeddicts_usage.toml index d34748faf..b77f80f23 100644 --- a/conformance/results/zuban/typeddicts_usage.toml +++ b/conformance/results/zuban/typeddicts_usage.toml @@ -2,10 +2,10 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -typeddicts_usage.py:23: error: TypedDict "Movie" has no key "director" -typeddicts_usage.py:24: error: Value of "year" has incompatible type "str"; expected "int" -typeddicts_usage.py:28: error: Extra key "title" for TypedDict "Movie" -typeddicts_usage.py:28: error: Missing key "name" for TypedDict "Movie" -typeddicts_usage.py:35: error: Cannot use isinstance() with TypedDict type -typeddicts_usage.py:40: error: Invalid type +typeddicts_usage.py:23: error: TypedDict "Movie" has no key "director" [typeddict-unknown-key] +typeddicts_usage.py:24: error: Value of "year" has incompatible type "str"; expected "int" [typeddict-item] +typeddicts_usage.py:28: error: Extra key "title" for TypedDict "Movie" [typeddict-unknown-key] +typeddicts_usage.py:28: error: Missing key "name" for TypedDict "Movie" [typeddict-item] +typeddicts_usage.py:35: error: Cannot use isinstance() with TypedDict type [misc] +typeddicts_usage.py:40: error: Invalid type [valid-type] """ diff --git a/conformance/results/zuban/version.toml b/conformance/results/zuban/version.toml index 9f28f9ef3..a41318177 100644 --- a/conformance/results/zuban/version.toml +++ b/conformance/results/zuban/version.toml @@ -1 +1 @@ -version = "zuban 0.0.19" +version = "zuban 0.0.20" diff --git a/conformance/src/type_checker.py b/conformance/src/type_checker.py index 12e16cde1..a2663425d 100644 --- a/conformance/src/type_checker.py +++ b/conformance/src/type_checker.py @@ -296,19 +296,19 @@ def install(self) -> bool: return False def get_version(self) -> str: - proc = run(["zmypy", "--version"], stdout=PIPE, text=True) - return proc.stdout.strip().replace("zmypy", "zuban") + proc = run(["zuban", "--version"], stdout=PIPE, text=True) + return proc.stdout.strip() def run_tests(self, test_files: Sequence[str]) -> dict[str, str]: command = [ - "zmypy", + "zuban", + "check", ".", "--disable-error-code", "empty-body", "--enable-error-code", "deprecated", "--no-warn-unreachable", - "--no-mypy-compatible", ] proc = run(command, stdout=PIPE, text=True, encoding="utf-8") lines = proc.stdout.split("\n") From f2f4c40d6db2a2751ada90ee3a428e7392beb0f6 Mon Sep 17 00:00:00 2001 From: Danny Yang Date: Sun, 31 Aug 2025 18:23:33 -0400 Subject: [PATCH 134/308] Add Pyrefly (#2080) * add pyrefly type checker * manually audit pyrefly results * update repoort * mark mostly/completely unsupported features as such * regenerate HTML --- conformance/requirements.txt | 1 + .../results/pyrefly/aliases_explicit.toml | 28 +++ .../results/pyrefly/aliases_implicit.toml | 31 +++ .../results/pyrefly/aliases_newtype.toml | 19 ++ .../results/pyrefly/aliases_recursive.toml | 33 ++++ .../pyrefly/aliases_type_statement.toml | 40 ++++ .../pyrefly/aliases_typealiastype.toml | 49 +++++ .../results/pyrefly/aliases_variance.toml | 10 + .../pyrefly/annotations_coroutines.toml | 5 + .../pyrefly/annotations_forward_refs.toml | 36 ++++ .../pyrefly/annotations_generators.toml | 22 +++ .../results/pyrefly/annotations_methods.toml | 6 + .../results/pyrefly/annotations_typeexpr.toml | 20 ++ .../results/pyrefly/callables_annotation.toml | 31 +++ .../results/pyrefly/callables_kwargs.toml | 29 +++ .../results/pyrefly/callables_protocol.toml | 22 +++ .../results/pyrefly/callables_subtyping.toml | 37 ++++ .../results/pyrefly/classes_classvar.toml | 26 +++ .../results/pyrefly/classes_override.toml | 10 + .../pyrefly/constructors_call_init.toml | 14 ++ .../pyrefly/constructors_call_metaclass.toml | 7 + .../pyrefly/constructors_call_new.toml | 7 + .../pyrefly/constructors_call_type.toml | 20 ++ .../pyrefly/constructors_callable.toml | 35 ++++ .../pyrefly/constructors_consistency.toml | 5 + .../pyrefly/dataclasses_descriptors.toml | 5 + .../results/pyrefly/dataclasses_final.toml | 14 ++ .../results/pyrefly/dataclasses_frozen.toml | 9 + .../results/pyrefly/dataclasses_hash.toml | 7 + .../pyrefly/dataclasses_inheritance.toml | 7 + .../results/pyrefly/dataclasses_kwonly.toml | 8 + .../pyrefly/dataclasses_match_args.toml | 6 + .../results/pyrefly/dataclasses_order.toml | 6 + .../results/pyrefly/dataclasses_postinit.toml | 9 + .../results/pyrefly/dataclasses_slots.toml | 14 ++ .../pyrefly/dataclasses_transform_class.toml | 13 ++ .../dataclasses_transform_converter.toml | 16 ++ .../pyrefly/dataclasses_transform_field.toml | 7 + .../pyrefly/dataclasses_transform_func.toml | 12 ++ .../pyrefly/dataclasses_transform_meta.toml | 13 ++ .../results/pyrefly/dataclasses_usage.toml | 16 ++ .../pyrefly/directives_assert_type.toml | 11 ++ .../results/pyrefly/directives_cast.toml | 9 + .../pyrefly/directives_deprecated.toml | 18 ++ .../pyrefly/directives_no_type_check.toml | 10 + .../pyrefly/directives_reveal_type.toml | 7 + .../pyrefly/directives_type_checking.toml | 5 + .../pyrefly/directives_type_ignore.toml | 5 + .../pyrefly/directives_type_ignore_file1.toml | 5 + .../pyrefly/directives_type_ignore_file2.toml | 6 + .../pyrefly/directives_version_platform.toml | 7 + .../results/pyrefly/enums_behaviors.toml | 14 ++ .../results/pyrefly/enums_definition.toml | 5 + .../results/pyrefly/enums_expansion.toml | 6 + .../results/pyrefly/enums_member_names.toml | 6 + .../results/pyrefly/enums_member_values.toml | 14 ++ .../results/pyrefly/enums_members.toml | 32 ++++ .../pyrefly/exceptions_context_managers.toml | 13 ++ .../results/pyrefly/generics_base_class.toml | 16 ++ .../results/pyrefly/generics_basic.toml | 33 ++++ .../results/pyrefly/generics_defaults.toml | 21 ++ .../generics_defaults_referential.toml | 19 ++ .../generics_defaults_specialization.toml | 7 + .../pyrefly/generics_paramspec_basic.toml | 14 ++ .../generics_paramspec_components.toml | 29 +++ .../pyrefly/generics_paramspec_semantics.toml | 16 ++ .../generics_paramspec_specialization.toml | 10 + .../results/pyrefly/generics_scoping.toml | 19 ++ .../pyrefly/generics_self_advanced.toml | 15 ++ .../pyrefly/generics_self_attributes.toml | 11 ++ .../results/pyrefly/generics_self_basic.toml | 12 ++ .../pyrefly/generics_self_protocols.toml | 13 ++ .../results/pyrefly/generics_self_usage.toml | 20 ++ .../generics_syntax_compatibility.toml | 9 + .../pyrefly/generics_syntax_declarations.toml | 15 ++ .../generics_syntax_infer_variance.toml | 23 +++ .../pyrefly/generics_syntax_scoping.toml | 23 +++ .../pyrefly/generics_type_erasure.toml | 12 ++ .../pyrefly/generics_typevartuple_args.toml | 14 ++ .../pyrefly/generics_typevartuple_basic.toml | 26 +++ .../generics_typevartuple_callable.toml | 6 + .../pyrefly/generics_typevartuple_concat.toml | 11 ++ .../generics_typevartuple_overloads.toml | 5 + .../generics_typevartuple_specialization.toml | 23 +++ .../pyrefly/generics_typevartuple_unpack.toml | 6 + .../results/pyrefly/generics_upper_bound.toml | 14 ++ .../results/pyrefly/generics_variance.toml | 19 ++ .../pyrefly/generics_variance_inference.toml | 28 +++ .../pyrefly/historical_positional.toml | 9 + .../pyrefly/literals_interactions.toml | 17 ++ .../pyrefly/literals_literalstring.toml | 22 +++ .../pyrefly/literals_parameterizations.toml | 22 +++ .../results/pyrefly/literals_semantics.toml | 9 + .../pyrefly/namedtuples_define_class.toml | 17 ++ .../namedtuples_define_functional.toml | 19 ++ .../pyrefly/namedtuples_type_compat.toml | 7 + .../results/pyrefly/namedtuples_usage.toml | 13 ++ .../results/pyrefly/narrowing_typeguard.toml | 9 + .../results/pyrefly/narrowing_typeis.toml | 14 ++ .../results/pyrefly/overloads_basic.toml | 6 + .../pyrefly/overloads_consistency.toml | 7 + .../pyrefly/overloads_definitions.toml | 24 +++ .../pyrefly/overloads_definitions_stub.toml | 18 ++ .../results/pyrefly/overloads_evaluation.toml | 42 ++++ .../pyrefly/protocols_class_objects.toml | 19 ++ .../results/pyrefly/protocols_definition.toml | 33 ++++ .../results/pyrefly/protocols_explicit.toml | 16 ++ .../results/pyrefly/protocols_generic.toml | 20 ++ .../results/pyrefly/protocols_merging.toml | 15 ++ .../results/pyrefly/protocols_modules.toml | 14 ++ .../results/pyrefly/protocols_recursive.toml | 5 + .../pyrefly/protocols_runtime_checkable.toml | 15 ++ .../results/pyrefly/protocols_self.toml | 13 ++ .../results/pyrefly/protocols_subtyping.toml | 12 ++ .../results/pyrefly/protocols_variance.toml | 12 ++ .../results/pyrefly/qualifiers_annotated.toml | 31 +++ .../pyrefly/qualifiers_final_annotation.toml | 43 +++++ .../pyrefly/qualifiers_final_decorator.toml | 19 ++ .../results/pyrefly/specialtypes_any.toml | 5 + .../results/pyrefly/specialtypes_never.toml | 14 ++ .../results/pyrefly/specialtypes_none.toml | 8 + .../pyrefly/specialtypes_promotions.toml | 6 + .../results/pyrefly/specialtypes_type.toml | 32 ++++ .../results/pyrefly/tuples_type_compat.toml | 29 +++ .../results/pyrefly/tuples_type_form.toml | 16 ++ .../results/pyrefly/tuples_unpacked.toml | 10 + .../pyrefly/typeddicts_alt_syntax.toml | 16 ++ .../pyrefly/typeddicts_class_syntax.toml | 10 + .../pyrefly/typeddicts_extra_items.toml | 56 ++++++ .../results/pyrefly/typeddicts_final.toml | 5 + .../pyrefly/typeddicts_inheritance.toml | 12 ++ .../pyrefly/typeddicts_operations.toml | 17 ++ .../results/pyrefly/typeddicts_readonly.toml | 11 ++ .../typeddicts_readonly_consistency.toml | 12 ++ .../typeddicts_readonly_inheritance.toml | 20 ++ .../pyrefly/typeddicts_readonly_kwargs.toml | 6 + .../pyrefly/typeddicts_readonly_update.toml | 6 + .../results/pyrefly/typeddicts_required.toml | 16 ++ .../pyrefly/typeddicts_type_consistency.toml | 14 ++ .../results/pyrefly/typeddicts_usage.toml | 11 ++ conformance/results/pyrefly/version.toml | 1 + conformance/results/results.html | 181 ++++++++++++++++-- conformance/src/type_checker.py | 57 ++++++ 143 files changed, 2440 insertions(+), 20 deletions(-) create mode 100644 conformance/results/pyrefly/aliases_explicit.toml create mode 100644 conformance/results/pyrefly/aliases_implicit.toml create mode 100644 conformance/results/pyrefly/aliases_newtype.toml create mode 100644 conformance/results/pyrefly/aliases_recursive.toml create mode 100644 conformance/results/pyrefly/aliases_type_statement.toml create mode 100644 conformance/results/pyrefly/aliases_typealiastype.toml create mode 100644 conformance/results/pyrefly/aliases_variance.toml create mode 100644 conformance/results/pyrefly/annotations_coroutines.toml create mode 100644 conformance/results/pyrefly/annotations_forward_refs.toml create mode 100644 conformance/results/pyrefly/annotations_generators.toml create mode 100644 conformance/results/pyrefly/annotations_methods.toml create mode 100644 conformance/results/pyrefly/annotations_typeexpr.toml create mode 100644 conformance/results/pyrefly/callables_annotation.toml create mode 100644 conformance/results/pyrefly/callables_kwargs.toml create mode 100644 conformance/results/pyrefly/callables_protocol.toml create mode 100644 conformance/results/pyrefly/callables_subtyping.toml create mode 100644 conformance/results/pyrefly/classes_classvar.toml create mode 100644 conformance/results/pyrefly/classes_override.toml create mode 100644 conformance/results/pyrefly/constructors_call_init.toml create mode 100644 conformance/results/pyrefly/constructors_call_metaclass.toml create mode 100644 conformance/results/pyrefly/constructors_call_new.toml create mode 100644 conformance/results/pyrefly/constructors_call_type.toml create mode 100644 conformance/results/pyrefly/constructors_callable.toml create mode 100644 conformance/results/pyrefly/constructors_consistency.toml create mode 100644 conformance/results/pyrefly/dataclasses_descriptors.toml create mode 100644 conformance/results/pyrefly/dataclasses_final.toml create mode 100644 conformance/results/pyrefly/dataclasses_frozen.toml create mode 100644 conformance/results/pyrefly/dataclasses_hash.toml create mode 100644 conformance/results/pyrefly/dataclasses_inheritance.toml create mode 100644 conformance/results/pyrefly/dataclasses_kwonly.toml create mode 100644 conformance/results/pyrefly/dataclasses_match_args.toml create mode 100644 conformance/results/pyrefly/dataclasses_order.toml create mode 100644 conformance/results/pyrefly/dataclasses_postinit.toml create mode 100644 conformance/results/pyrefly/dataclasses_slots.toml create mode 100644 conformance/results/pyrefly/dataclasses_transform_class.toml create mode 100644 conformance/results/pyrefly/dataclasses_transform_converter.toml create mode 100644 conformance/results/pyrefly/dataclasses_transform_field.toml create mode 100644 conformance/results/pyrefly/dataclasses_transform_func.toml create mode 100644 conformance/results/pyrefly/dataclasses_transform_meta.toml create mode 100644 conformance/results/pyrefly/dataclasses_usage.toml create mode 100644 conformance/results/pyrefly/directives_assert_type.toml create mode 100644 conformance/results/pyrefly/directives_cast.toml create mode 100644 conformance/results/pyrefly/directives_deprecated.toml create mode 100644 conformance/results/pyrefly/directives_no_type_check.toml create mode 100644 conformance/results/pyrefly/directives_reveal_type.toml create mode 100644 conformance/results/pyrefly/directives_type_checking.toml create mode 100644 conformance/results/pyrefly/directives_type_ignore.toml create mode 100644 conformance/results/pyrefly/directives_type_ignore_file1.toml create mode 100644 conformance/results/pyrefly/directives_type_ignore_file2.toml create mode 100644 conformance/results/pyrefly/directives_version_platform.toml create mode 100644 conformance/results/pyrefly/enums_behaviors.toml create mode 100644 conformance/results/pyrefly/enums_definition.toml create mode 100644 conformance/results/pyrefly/enums_expansion.toml create mode 100644 conformance/results/pyrefly/enums_member_names.toml create mode 100644 conformance/results/pyrefly/enums_member_values.toml create mode 100644 conformance/results/pyrefly/enums_members.toml create mode 100644 conformance/results/pyrefly/exceptions_context_managers.toml create mode 100644 conformance/results/pyrefly/generics_base_class.toml create mode 100644 conformance/results/pyrefly/generics_basic.toml create mode 100644 conformance/results/pyrefly/generics_defaults.toml create mode 100644 conformance/results/pyrefly/generics_defaults_referential.toml create mode 100644 conformance/results/pyrefly/generics_defaults_specialization.toml create mode 100644 conformance/results/pyrefly/generics_paramspec_basic.toml create mode 100644 conformance/results/pyrefly/generics_paramspec_components.toml create mode 100644 conformance/results/pyrefly/generics_paramspec_semantics.toml create mode 100644 conformance/results/pyrefly/generics_paramspec_specialization.toml create mode 100644 conformance/results/pyrefly/generics_scoping.toml create mode 100644 conformance/results/pyrefly/generics_self_advanced.toml create mode 100644 conformance/results/pyrefly/generics_self_attributes.toml create mode 100644 conformance/results/pyrefly/generics_self_basic.toml create mode 100644 conformance/results/pyrefly/generics_self_protocols.toml create mode 100644 conformance/results/pyrefly/generics_self_usage.toml create mode 100644 conformance/results/pyrefly/generics_syntax_compatibility.toml create mode 100644 conformance/results/pyrefly/generics_syntax_declarations.toml create mode 100644 conformance/results/pyrefly/generics_syntax_infer_variance.toml create mode 100644 conformance/results/pyrefly/generics_syntax_scoping.toml create mode 100644 conformance/results/pyrefly/generics_type_erasure.toml create mode 100644 conformance/results/pyrefly/generics_typevartuple_args.toml create mode 100644 conformance/results/pyrefly/generics_typevartuple_basic.toml create mode 100644 conformance/results/pyrefly/generics_typevartuple_callable.toml create mode 100644 conformance/results/pyrefly/generics_typevartuple_concat.toml create mode 100644 conformance/results/pyrefly/generics_typevartuple_overloads.toml create mode 100644 conformance/results/pyrefly/generics_typevartuple_specialization.toml create mode 100644 conformance/results/pyrefly/generics_typevartuple_unpack.toml create mode 100644 conformance/results/pyrefly/generics_upper_bound.toml create mode 100644 conformance/results/pyrefly/generics_variance.toml create mode 100644 conformance/results/pyrefly/generics_variance_inference.toml create mode 100644 conformance/results/pyrefly/historical_positional.toml create mode 100644 conformance/results/pyrefly/literals_interactions.toml create mode 100644 conformance/results/pyrefly/literals_literalstring.toml create mode 100644 conformance/results/pyrefly/literals_parameterizations.toml create mode 100644 conformance/results/pyrefly/literals_semantics.toml create mode 100644 conformance/results/pyrefly/namedtuples_define_class.toml create mode 100644 conformance/results/pyrefly/namedtuples_define_functional.toml create mode 100644 conformance/results/pyrefly/namedtuples_type_compat.toml create mode 100644 conformance/results/pyrefly/namedtuples_usage.toml create mode 100644 conformance/results/pyrefly/narrowing_typeguard.toml create mode 100644 conformance/results/pyrefly/narrowing_typeis.toml create mode 100644 conformance/results/pyrefly/overloads_basic.toml create mode 100644 conformance/results/pyrefly/overloads_consistency.toml create mode 100644 conformance/results/pyrefly/overloads_definitions.toml create mode 100644 conformance/results/pyrefly/overloads_definitions_stub.toml create mode 100644 conformance/results/pyrefly/overloads_evaluation.toml create mode 100644 conformance/results/pyrefly/protocols_class_objects.toml create mode 100644 conformance/results/pyrefly/protocols_definition.toml create mode 100644 conformance/results/pyrefly/protocols_explicit.toml create mode 100644 conformance/results/pyrefly/protocols_generic.toml create mode 100644 conformance/results/pyrefly/protocols_merging.toml create mode 100644 conformance/results/pyrefly/protocols_modules.toml create mode 100644 conformance/results/pyrefly/protocols_recursive.toml create mode 100644 conformance/results/pyrefly/protocols_runtime_checkable.toml create mode 100644 conformance/results/pyrefly/protocols_self.toml create mode 100644 conformance/results/pyrefly/protocols_subtyping.toml create mode 100644 conformance/results/pyrefly/protocols_variance.toml create mode 100644 conformance/results/pyrefly/qualifiers_annotated.toml create mode 100644 conformance/results/pyrefly/qualifiers_final_annotation.toml create mode 100644 conformance/results/pyrefly/qualifiers_final_decorator.toml create mode 100644 conformance/results/pyrefly/specialtypes_any.toml create mode 100644 conformance/results/pyrefly/specialtypes_never.toml create mode 100644 conformance/results/pyrefly/specialtypes_none.toml create mode 100644 conformance/results/pyrefly/specialtypes_promotions.toml create mode 100644 conformance/results/pyrefly/specialtypes_type.toml create mode 100644 conformance/results/pyrefly/tuples_type_compat.toml create mode 100644 conformance/results/pyrefly/tuples_type_form.toml create mode 100644 conformance/results/pyrefly/tuples_unpacked.toml create mode 100644 conformance/results/pyrefly/typeddicts_alt_syntax.toml create mode 100644 conformance/results/pyrefly/typeddicts_class_syntax.toml create mode 100644 conformance/results/pyrefly/typeddicts_extra_items.toml create mode 100644 conformance/results/pyrefly/typeddicts_final.toml create mode 100644 conformance/results/pyrefly/typeddicts_inheritance.toml create mode 100644 conformance/results/pyrefly/typeddicts_operations.toml create mode 100644 conformance/results/pyrefly/typeddicts_readonly.toml create mode 100644 conformance/results/pyrefly/typeddicts_readonly_consistency.toml create mode 100644 conformance/results/pyrefly/typeddicts_readonly_inheritance.toml create mode 100644 conformance/results/pyrefly/typeddicts_readonly_kwargs.toml create mode 100644 conformance/results/pyrefly/typeddicts_readonly_update.toml create mode 100644 conformance/results/pyrefly/typeddicts_required.toml create mode 100644 conformance/results/pyrefly/typeddicts_type_consistency.toml create mode 100644 conformance/results/pyrefly/typeddicts_usage.toml create mode 100644 conformance/results/pyrefly/version.toml diff --git a/conformance/requirements.txt b/conformance/requirements.txt index 6cd6c8968..cf7ee5852 100644 --- a/conformance/requirements.txt +++ b/conformance/requirements.txt @@ -5,3 +5,4 @@ mypy pip pyre-check; platform_system != "Windows" zuban +pyrefly diff --git a/conformance/results/pyrefly/aliases_explicit.toml b/conformance/results/pyrefly/aliases_explicit.toml new file mode 100644 index 000000000..bb7b6d777 --- /dev/null +++ b/conformance/results/pyrefly/aliases_explicit.toml @@ -0,0 +1,28 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_explicit.py:67:9-28: `TypeAlias[GoodTypeAlias2, type[int | None]]` is not subscriptable [unsupported-operation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_explicit.py:68:9-28: `TypeAlias[GoodTypeAlias3, type[list[int | None]]]` is not subscriptable [unsupported-operation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_explicit.py:69:9-33: Expected 1 type argument for `GoodTypeAlias4`, got 2 [bad-specialization] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_explicit.py:70:9-33: Expected 1 type argument for `GoodTypeAlias8`, got 2 [bad-specialization] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_explicit.py:71:9-33: Expected a valid ParamSpec expression, got `int` [invalid-param-spec] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_explicit.py:79:21-61: function call cannot be used in annotations [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_explicit.py:80:21-31: list literal cannot be used in annotations [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_explicit.py:81:21-34: tuple literal cannot be used in annotations [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_explicit.py:82:21-44: list comprehension cannot be used in annotations [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_explicit.py:83:21-31: dict literal cannot be used in annotations [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_explicit.py:83:23-24: Could not find name `a` [unknown-name] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_explicit.py:83:28-29: Could not find name `b` [unknown-name] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_explicit.py:84:21-36: function call cannot be used in annotations [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_explicit.py:85:21-29: invalid subscript expression cannot be used in annotations [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_explicit.py:86:21-42: if expression cannot be used in annotations [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_explicit.py:87:21-25: Expected `BadTypeAlias9` to be a type alias, got `Literal[3]` [type-alias-error] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_explicit.py:88:22-26: bool literal cannot be used in annotations [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_explicit.py:89:22-23: number literal cannot be used in annotations [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_explicit.py:90:22-33: boolean operation cannot be used in annotations [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_explicit.py:91:22-32: f-string cannot be used in annotations [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_explicit.py:100:5-19: `TypeAlias[ListAlias, type[list[Unknown]]]` is not subscriptable [unsupported-operation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_explicit.py:101:6-20: Expected a callable, got TypeAlias[ListOrSetAlias, type[list[Unknown] | set[Unknown]]] [not-callable] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_explicit.py:102:5-24: `TypeAlias[ListOrSetAlias, type[list[Unknown] | set[Unknown]]]` is not subscriptable [unsupported-operation] +""" diff --git a/conformance/results/pyrefly/aliases_implicit.toml b/conformance/results/pyrefly/aliases_implicit.toml new file mode 100644 index 000000000..124c1a3b9 --- /dev/null +++ b/conformance/results/pyrefly/aliases_implicit.toml @@ -0,0 +1,31 @@ +conformant = "Partial" +notes = """ +Does not reject invalid syntax in implicit type aliases. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 106: Expected 1 errors +Line 111: Expected 1 errors +Line 112: Expected 1 errors +Line 113: Expected 1 errors +Line 117: Expected 1 errors +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_implicit.py:76:9-28: `type[int | None]` is not subscriptable [unsupported-operation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_implicit.py:77:9-28: `type[list[int | None]]` is not subscriptable [unsupported-operation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_implicit.py:78:9-33: Expected 1 type argument for `GoodTypeAlias4`, got 2 [bad-specialization] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_implicit.py:79:9-33: Expected 1 type argument for `GoodTypeAlias8`, got 2 [bad-specialization] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_implicit.py:80:9-33: Expected a valid ParamSpec expression, got `int` [invalid-param-spec] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_implicit.py:81:9-29: Type `str` is not assignable to upper bound `float` of type variable `TFloat` [bad-specialization] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_implicit.py:107:9-22: Expected a type form, got instance of `list[type[int] | type[str]]` [not-a-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_implicit.py:108:9-22: Expected a type form, got instance of `tuple[tuple[type[int], type[str]]]` [not-a-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_implicit.py:109:9-22: Expected a type form, got instance of `list[type[int]]` [not-a-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_implicit.py:110:9-22: Expected a type form, got instance of `dict[str, str]` [not-a-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_implicit.py:114:9-22: Expected a type form, got instance of `Literal[3]` [not-a-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_implicit.py:115:10-24: Expected a type form, got instance of `Literal[True]` [not-a-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_implicit.py:116:10-24: Expected a type form, got instance of `Literal[1]` [not-a-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_implicit.py:118:10-24: Expected a type form, got instance of `Literal['int']` [not-a-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_implicit.py:119:10-24: Expected a type form, got instance of `Literal['int | str']` [not-a-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_implicit.py:133:6-20: Expected a callable, got type[list[Unknown] | set[Unknown]] [not-callable] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_implicit.py:135:5-24: `type[list[Unknown] | set[Unknown]]` is not subscriptable [unsupported-operation] +""" diff --git a/conformance/results/pyrefly/aliases_newtype.toml b/conformance/results/pyrefly/aliases_newtype.toml new file mode 100644 index 000000000..31a4d5e20 --- /dev/null +++ b/conformance/results/pyrefly/aliases_newtype.toml @@ -0,0 +1,19 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_newtype.py:11:8-14: Argument `Literal['user']` is not assignable to parameter `_x` with type `int` in function `UserId.__new__` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_newtype.py:12:14-16: `Literal[42]` is not assignable to `UserId` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_newtype.py:18:11-17: `type[UserId]` is not assignable to `type` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_newtype.py:23:16-22: NewType `UserId` not allowed in isinstance() [invalid-argument] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_newtype.py:26:21-27: Subclassing a NewType not allowed [invalid-inheritance] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_newtype.py:35:20-29: Expected string literal "GoodName" [invalid-argument] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_newtype.py:41:6-23: Expected 0 type arguments for `GoodNewType1`, got 1 [bad-specialization] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_newtype.py:47:38-47: Second argument to NewType is invalid [invalid-argument] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_newtype.py:50:38-45: Second argument to NewType cannot be an unbound generic [invalid-argument] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_newtype.py:52:38-46: Second argument to NewType cannot be a protocol [invalid-argument] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_newtype.py:54:38-48: Second argument to NewType is invalid [invalid-argument] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_newtype.py:61:38-41: Second argument to NewType is invalid [invalid-argument] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_newtype.py:63:43-46: Expected 2 positional arguments, got 3 in function `typing.NewType.__init__` [bad-argument-count] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_newtype.py:65:38-41: Second argument to NewType is invalid [invalid-argument] +""" diff --git a/conformance/results/pyrefly/aliases_recursive.toml b/conformance/results/pyrefly/aliases_recursive.toml new file mode 100644 index 000000000..2d08b464d --- /dev/null +++ b/conformance/results/pyrefly/aliases_recursive.toml @@ -0,0 +1,33 @@ +conformant = "Unsupported" +conformance_automated = "Fail" +errors_diff = """ +Line 19: Expected 1 errors +Line 20: Expected 1 errors +Line 38: Expected 1 errors +Line 39: Expected 1 errors +Line 50: Expected 1 errors +Line 51: Expected 1 errors +Line 52: Expected 1 errors +Line 72: Expected 1 errors +Line 75: Expected 1 errors +Line 30: Unexpected errors ["Expected a type form, got instance of `Literal['RecursiveTuple']` [not-a-type]"] +Line 42: Unexpected errors ["Expected a type form, got instance of `Literal['RecursiveMapping']` [not-a-type]"] +Line 58: Unexpected errors ['Expected a type form, got instance of `_SpecialForm` [not-a-type]'] +Line 59: Unexpected errors ['`type[list[Unknown]]` is not subscriptable [unsupported-operation]'] +Line 62: Unexpected errors ['`type[list[Unknown]]` is not subscriptable [unsupported-operation]'] +Line 65: Unexpected errors ['Expected a type form, got instance of `_SpecialForm` [not-a-type]'] +Line 67: Unexpected errors ['`type[list[Unknown]]` is not subscriptable [unsupported-operation]'] +Line 68: Unexpected errors ['`type[list[Unknown]]` is not subscriptable [unsupported-operation]'] +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_recursive.py:30:36-52: Expected a type form, got instance of `Literal['RecursiveTuple']` [not-a-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_recursive.py:42:45-63: Expected a type form, got instance of `Literal['RecursiveMapping']` [not-a-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_recursive.py:58:26-54: Expected a type form, got instance of `_SpecialForm` [not-a-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_recursive.py:59:25-47: `type[list[Unknown]]` is not subscriptable [unsupported-operation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_recursive.py:62:5-27: `type[list[Unknown]]` is not subscriptable [unsupported-operation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_recursive.py:63:5-27: `type[list[Unknown]]` is not subscriptable [unsupported-operation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_recursive.py:65:26-63: Expected a type form, got instance of `_SpecialForm` [not-a-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_recursive.py:67:5-32: `type[list[Unknown]]` is not subscriptable [unsupported-operation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_recursive.py:68:5-34: `type[list[Unknown]]` is not subscriptable [unsupported-operation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_recursive.py:69:5-32: `type[list[Unknown]]` is not subscriptable [unsupported-operation] +""" diff --git a/conformance/results/pyrefly/aliases_type_statement.toml b/conformance/results/pyrefly/aliases_type_statement.toml new file mode 100644 index 000000000..3e8999c57 --- /dev/null +++ b/conformance/results/pyrefly/aliases_type_statement.toml @@ -0,0 +1,40 @@ +conformant = "Partial" +notes = """ +Does not reject type alias defined with type statement in base class list +Does not reject redeclaration of type alias with the same name. +Does not detect circular definitions. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 26: Expected 1 errors +Line 82: Expected 1 errors +Line 84: Expected 1 errors +Lines 51, 52: Expected error (tag 'TA14') +Lines 88, 89: Expected error (tag 'RTA6') +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_type_statement.py:17:1-21: Object of class `TypeAliasType` has no attribute `bit_count` [missing-attribute] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_type_statement.py:19:1-11: Expected a callable, got TypeAlias[GoodAlias1, type[int]] [not-callable] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_type_statement.py:23:7-30: Object of class `TypeAliasType` has no attribute `other_attrib` [missing-attribute] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_type_statement.py:31:22-32: Expected class object, got `TypeAliasType` [invalid-argument] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_type_statement.py:37:22-62: function call cannot be used in annotations [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_type_statement.py:38:22-32: list literal cannot be used in annotations [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_type_statement.py:39:22-35: tuple literal cannot be used in annotations [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_type_statement.py:40:22-45: list comprehension cannot be used in annotations [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_type_statement.py:41:22-32: dict literal cannot be used in annotations [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_type_statement.py:41:24-25: Could not find name `a` [unknown-name] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_type_statement.py:41:29-30: Could not find name `b` [unknown-name] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_type_statement.py:42:22-37: function call cannot be used in annotations [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_type_statement.py:43:22-30: invalid subscript expression cannot be used in annotations [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_type_statement.py:44:22-43: if expression cannot be used in annotations [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_type_statement.py:45:22-26: Expected `BadTypeAlias9` to be a type alias, got `Literal[1]` [type-alias-error] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_type_statement.py:46:23-27: bool literal cannot be used in annotations [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_type_statement.py:47:23-24: number literal cannot be used in annotations [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_type_statement.py:48:23-34: boolean operation cannot be used in annotations [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_type_statement.py:49:23-33: f-string cannot be used in annotations [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_type_statement.py:56:5-30: `type` statement is not allowed in this context [invalid-syntax] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_type_statement.py:62:15-25: Type parameters used in `TA1` but not declared [invalid-type-var] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_type_statement.py:67:12-20: Type parameters used in `TA2` but not declared [invalid-type-var] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_type_statement.py:77:7-41: Type `str` is not assignable to upper bound `int` of type variable `S` [bad-specialization] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_type_statement.py:79:7-41: Type `int` is not assignable to upper bound `str` of type variable `T` [bad-specialization] +""" diff --git a/conformance/results/pyrefly/aliases_typealiastype.toml b/conformance/results/pyrefly/aliases_typealiastype.toml new file mode 100644 index 000000000..1ba0492ec --- /dev/null +++ b/conformance/results/pyrefly/aliases_typealiastype.toml @@ -0,0 +1,49 @@ +conformant = "Unsupported" +conformance_automated = "Fail" +errors_diff = """ +Line 44: Expected 1 errors +Line 46: Expected 1 errors +Line 48: Expected 1 errors +Line 52: Expected 1 errors +Line 53: Expected 1 errors +Line 54: Expected 1 errors +Line 55: Expected 1 errors +Line 56: Expected 1 errors +Line 57: Expected 1 errors +Line 58: Expected 1 errors +Line 59: Expected 1 errors +Line 60: Expected 1 errors +Line 61: Expected 1 errors +Line 62: Expected 1 errors +Line 63: Expected 1 errors +Line 64: Expected 1 errors +Line 17: Unexpected errors ['Argument `tuple[type[TypeVar[T]]]` is not assignable to parameter `type_params` with type `tuple[ParamSpec | TypeVar | TypeVarTuple, ...]` in function `typing.TypeAliasType.__new__` [bad-argument-type]'] +Line 18: Unexpected errors ['Argument `tuple[type[TypeVar[S]], type[TypeVar[T]]]` is not assignable to parameter `type_params` with type `tuple[ParamSpec | TypeVar | TypeVarTuple, ...]` in function `typing.TypeAliasType.__new__` [bad-argument-type]'] +Line 19: Unexpected errors ['Argument `tuple[type[TypeVar[T]]]` is not assignable to parameter `type_params` with type `tuple[ParamSpec | TypeVar | TypeVarTuple, ...]` in function `typing.TypeAliasType.__new__` [bad-argument-type]'] +Line 22: Unexpected errors ["Expected a type form, got instance of `Literal['GoodAlias5[S, TStr, P]']` [not-a-type]"] +Line 23: Unexpected errors ['Argument `tuple[type[TypeVar[S]], type[TypeVar[TStr]], type[ParamSpec[P]], type[TypeVarTuple[Ts]]]` is not assignable to parameter `type_params` with type `tuple[ParamSpec | TypeVar | TypeVarTuple, ...]` in function `typing.TypeAliasType.__new__` [bad-argument-type]'] +Line 35: Unexpected errors ['Expected a type form, got instance of `GenericAlias` [not-a-type]'] +Line 36: Unexpected errors ['Expected a type form, got instance of `GenericAlias` [not-a-type]'] +Line 37: Unexpected errors ['Expected a type form, got instance of `GenericAlias` [not-a-type]'] +Line 38: Unexpected errors ['Expected a type form, got instance of `GenericAlias` [not-a-type]'] +Line 39: Unexpected errors ['Expected a type form, got instance of `GenericAlias` [not-a-type]', 'Expected an iterable, got `type[tuple[int, str, int]]` [not-iterable]'] +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_typealiastype.py:17:63-67: Argument `tuple[type[TypeVar[T]]]` is not assignable to parameter `type_params` with type `tuple[ParamSpec | TypeVar | TypeVarTuple, ...]` in function `typing.TypeAliasType.__new__` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_typealiastype.py:18:73-79: Argument `tuple[type[TypeVar[S]], type[TypeVar[T]]]` is not assignable to parameter `type_params` with type `tuple[ParamSpec | TypeVar | TypeVarTuple, ...]` in function `typing.TypeAliasType.__new__` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_typealiastype.py:19:81-85: Argument `tuple[type[TypeVar[T]]]` is not assignable to parameter `type_params` with type `tuple[ParamSpec | TypeVar | TypeVarTuple, ...]` in function `typing.TypeAliasType.__new__` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_typealiastype.py:22:40-64: Expected a type form, got instance of `Literal['GoodAlias5[S, TStr, P]']` [not-a-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_typealiastype.py:23:17-33: Argument `tuple[type[TypeVar[S]], type[TypeVar[TStr]], type[ParamSpec[P]], type[TypeVarTuple[Ts]]]` is not assignable to parameter `type_params` with type `tuple[ParamSpec | TypeVar | TypeVarTuple, ...]` in function `typing.TypeAliasType.__new__` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_typealiastype.py:32:7-30: Object of class `TypeAliasType` has no attribute `other_attrib` [missing-attribute] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_typealiastype.py:35:5-20: Expected a type form, got instance of `GenericAlias` [not-a-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_typealiastype.py:36:5-20: Expected a type form, got instance of `GenericAlias` [not-a-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_typealiastype.py:37:5-40: Expected a type form, got instance of `GenericAlias` [not-a-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_typealiastype.py:38:5-40: Expected a type form, got instance of `GenericAlias` [not-a-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_typealiastype.py:39:5-60: Expected a type form, got instance of `GenericAlias` [not-a-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_typealiastype.py:39:16-59: Expected an iterable, got `type[tuple[int, str, int]]` [not-iterable] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_typealiastype.py:40:5-30: Expected a type form, got instance of `GenericAlias` [not-a-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_typealiastype.py:43:61-65: Argument `tuple[type[TypeVar[T]]]` is not assignable to parameter `type_params` with type `tuple[ParamSpec | TypeVar | TypeVarTuple, ...]` in function `typing.TypeAliasType.__new__` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_typealiastype.py:45:57-65: Argument `tuple[type[TypeVar[S]], type[TypeVar[T]]]` is not assignable to parameter `type_params` with type `tuple[ParamSpec | TypeVar | TypeVarTuple, ...]` in function `typing.TypeAliasType.__new__` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_typealiastype.py:47:74-78: Argument `tuple[type[TypeVar[T]]]` is not assignable to parameter `type_params` with type `tuple[ParamSpec | TypeVar | TypeVarTuple, ...]` in function `typing.TypeAliasType.__new__` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_typealiastype.py:66:47-57: `BadAlias21` is uninitialized [unbound-name] +""" diff --git a/conformance/results/pyrefly/aliases_variance.toml b/conformance/results/pyrefly/aliases_variance.toml new file mode 100644 index 000000000..bd3d6dcdd --- /dev/null +++ b/conformance/results/pyrefly/aliases_variance.toml @@ -0,0 +1,10 @@ +conformant = "Unsupported" +conformance_automated = "Fail" +errors_diff = """ +Line 24: Expected 1 errors +Line 28: Expected 1 errors +Line 32: Expected 1 errors +Line 44: Expected 1 errors +""" +output = """ +""" diff --git a/conformance/results/pyrefly/annotations_coroutines.toml b/conformance/results/pyrefly/annotations_coroutines.toml new file mode 100644 index 000000000..cdd4d0cd9 --- /dev/null +++ b/conformance/results/pyrefly/annotations_coroutines.toml @@ -0,0 +1,5 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +""" diff --git a/conformance/results/pyrefly/annotations_forward_refs.toml b/conformance/results/pyrefly/annotations_forward_refs.toml new file mode 100644 index 000000000..59fcdaa3e --- /dev/null +++ b/conformance/results/pyrefly/annotations_forward_refs.toml @@ -0,0 +1,36 @@ +conformant = "Partial" +notes = """ +Types in quotes incorrectly refer to shadowing class member. +Does not reject some type forms that require quotes. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 22: Expected 1 errors +Line 23: Expected 1 errors +Line 24: Expected 1 errors +Line 25: Expected 1 errors +Line 66: Expected 1 errors +Line 87: Unexpected errors ['Expected a type form, got instance of `(self: Self@ClassD) -> None` [not-a-type]'] +Line 96: Unexpected errors ['assert_type(Any, int) failed [assert-type]'] +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_forward_refs.py:41:10-50: function call cannot be used in annotations [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_forward_refs.py:42:10-20: list literal cannot be used in annotations [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_forward_refs.py:43:10-20: tuple literal cannot be used in annotations [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_forward_refs.py:44:10-33: list comprehension cannot be used in annotations [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_forward_refs.py:45:10-12: dict literal cannot be used in annotations [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_forward_refs.py:46:10-26: function call cannot be used in annotations [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_forward_refs.py:47:10-18: invalid subscript expression cannot be used in annotations [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_forward_refs.py:48:10-31: if expression cannot be used in annotations [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_forward_refs.py:49:10-14: Expected a type form, got instance of `Literal[1]` [not-a-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_forward_refs.py:50:11-15: bool literal cannot be used in annotations [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_forward_refs.py:51:11-12: number literal cannot be used in annotations [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_forward_refs.py:52:11-13: unary operation cannot be used in annotations [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_forward_refs.py:53:11-21: boolean operation cannot be used in annotations [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_forward_refs.py:54:11-17: f-string cannot be used in annotations [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_forward_refs.py:55:11-16: Expected a type form, got instance of `Module[types]` [not-a-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_forward_refs.py:80:14-20: Could not find name `ClassF` [unknown-name] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_forward_refs.py:87:9-12: Expected a type form, got instance of `(self: Self@ClassD) -> None` [not-a-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_forward_refs.py:89:8-11: Expected a type form, got instance of `(self: Self@ClassD) -> None` [not-a-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_forward_refs.py:96:12-27: assert_type(Any, int) failed [assert-type] +""" diff --git a/conformance/results/pyrefly/annotations_generators.toml b/conformance/results/pyrefly/annotations_generators.toml new file mode 100644 index 000000000..84f9fd220 --- /dev/null +++ b/conformance/results/pyrefly/annotations_generators.toml @@ -0,0 +1,22 @@ +conformant = "Partial" +notes = """ +Does not detect that invalid yield is unreachable +""" +conformance_automated = "Fail" +errors_diff = """ +Line 190: Unexpected errors ['Expected to yield a value of type `int`, but a bare `yield` gives `None` instead [invalid-yield]'] +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_generators.py:51:21-39: Function declared to return `C`, but one or more paths are missing an explicit `return` [bad-return] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_generators.py:54:16-21: Returned type `Literal[False]` is not assignable to declared return type `C` [bad-return] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_generators.py:57:15-16: Type of yielded value `Literal[3]` is not assignable to declared return type `A` [invalid-yield] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_generators.py:66:15-16: Type of yielded value `Literal[3]` is not assignable to declared return type `A` [invalid-yield] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_generators.py:71:12-16: Returned type `Literal[True]` is not assignable to declared return type `None` [bad-return] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_generators.py:75:11-14: Type of yielded value `B` is not assignable to declared return type `A` [invalid-yield] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_generators.py:86:21-24: Generator function should return `Generator` [bad-return] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_generators.py:91:27-30: Async generator function should return `AsyncGenerator` [bad-return] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_generators.py:118:5-29: Cannot yield from a generator of type `Generator[A, None, None]` because it does not match the declared return type `Generator[B, None, Unknown]` [invalid-yield] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_generators.py:119:5-19: Cannot yield from a generator of type `Generator[int, None, None]` because it does not match the declared return type `Generator[B, None, Unknown]` [invalid-yield] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_generators.py:135:5-29: Cannot yield from a generator of type `Generator[None, int, None]` because it does not match the declared return type `Generator[None, str, Unknown]` [invalid-yield] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_generators.py:190:5-10: Expected to yield a value of type `int`, but a bare `yield` gives `None` instead [invalid-yield] +""" diff --git a/conformance/results/pyrefly/annotations_methods.toml b/conformance/results/pyrefly/annotations_methods.toml new file mode 100644 index 000000000..e6ff9bd03 --- /dev/null +++ b/conformance/results/pyrefly/annotations_methods.toml @@ -0,0 +1,6 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_methods.py:42:12-28: assert_type(B, A) failed [assert-type] +""" diff --git a/conformance/results/pyrefly/annotations_typeexpr.toml b/conformance/results/pyrefly/annotations_typeexpr.toml new file mode 100644 index 000000000..c9494e67b --- /dev/null +++ b/conformance/results/pyrefly/annotations_typeexpr.toml @@ -0,0 +1,20 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_typeexpr.py:88:9-49: function call cannot be used in annotations [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_typeexpr.py:89:9-19: list literal cannot be used in annotations [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_typeexpr.py:90:9-19: tuple literal cannot be used in annotations [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_typeexpr.py:91:9-32: list comprehension cannot be used in annotations [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_typeexpr.py:92:9-11: dict literal cannot be used in annotations [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_typeexpr.py:93:9-24: function call cannot be used in annotations [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_typeexpr.py:94:9-17: invalid subscript expression cannot be used in annotations [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_typeexpr.py:95:9-30: if expression cannot be used in annotations [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_typeexpr.py:96:9-13: Expected a type form, got instance of `Literal[3]` [not-a-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_typeexpr.py:97:10-14: bool literal cannot be used in annotations [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_typeexpr.py:98:10-11: number literal cannot be used in annotations [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_typeexpr.py:99:10-12: unary operation cannot be used in annotations [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_typeexpr.py:100:10-20: boolean operation cannot be used in annotations [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_typeexpr.py:101:10-16: f-string cannot be used in annotations [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_typeexpr.py:102:10-15: Expected a type form, got instance of `Module[types]` [not-a-type] +""" diff --git a/conformance/results/pyrefly/callables_annotation.toml b/conformance/results/pyrefly/callables_annotation.toml new file mode 100644 index 000000000..fb0057684 --- /dev/null +++ b/conformance/results/pyrefly/callables_annotation.toml @@ -0,0 +1,31 @@ +conformant = "Partial" +notes = """ +Parameter names are lost when resolving ParamSpec +""" +conformance_automated = "Fail" +errors_diff = """ +Line 156: Unexpected errors ['`Proto4[Ellipsis]` is not assignable to `Proto3` [bad-assignment]'] +Line 157: Unexpected errors ['`Proto7` is not assignable to `Proto6` [bad-assignment]'] +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_annotation.py:25:7-10: Expected 1 more positional argument [bad-argument-count] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_annotation.py:26:11-12: Argument `Literal[2]` is not assignable to parameter with type `str` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_annotation.py:27:15-16: Expected 2 positional arguments, got 3 [bad-argument-count] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_annotation.py:29:8-9: Unexpected keyword argument `a` [unexpected-keyword] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_annotation.py:29:8-11: Expected 2 more positional arguments [bad-argument-count] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_annotation.py:29:13-14: Unexpected keyword argument `b` [unexpected-keyword] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_annotation.py:35:8-9: Expected 0 positional arguments, got 1 [bad-argument-count] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_annotation.py:55:5-18: `Callable` requires exactly two arguments but 1 was found [bad-specialization] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_annotation.py:56:14-17: Callable types can only have `ParamSpec` in this position, got `int` [bad-specialization] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_annotation.py:57:18-23: Expected a type form, got instance of `list[type[int]]` [not-a-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_annotation.py:58:5-28: `Callable` requires exactly two arguments but 3 was found [bad-specialization] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_annotation.py:59:15-18: Invalid position for `...` [invalid-argument] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_annotation.py:91:7-15: `() -> str` is not assignable to variable `cb3` with type `(int, ...) -> str` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_annotation.py:93:7-15: `(*, a: int) -> str` is not assignable to variable `cb3` with type `(int, ...) -> str` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_annotation.py:156:20-22: `Proto4[Ellipsis]` is not assignable to `Proto3` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_annotation.py:157:20-22: `Proto7` is not assignable to `Proto6` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_annotation.py:159:25-27: `Proto8` is not assignable to `Proto5[Any]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_annotation.py:172:26-29: `() -> str` is not assignable to `(int, ...) -> str` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_annotation.py:187:48-50: `(int, str) -> str` is not assignable to `(str, ...) -> str` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_annotation.py:189:32-34: `(int, str) -> str` is not assignable to `(str, ...) -> str` [bad-assignment] +""" diff --git a/conformance/results/pyrefly/callables_kwargs.toml b/conformance/results/pyrefly/callables_kwargs.toml new file mode 100644 index 000000000..e58b0006e --- /dev/null +++ b/conformance/results/pyrefly/callables_kwargs.toml @@ -0,0 +1,29 @@ +conformant = "Partial" +notes = """ +Does not reject overlap between unpacked TypedDict kwarg and named parameters +""" +conformance_automated = "Fail" +errors_diff = """ +Line 111: Expected 1 errors +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_kwargs.py:46:10-12: Missing argument `v1` in function `func1` [missing-argument] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_kwargs.py:46:10-12: Missing argument `v3` in function `func1` [missing-argument] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_kwargs.py:51:32-34: Unexpected keyword argument `v4` in function `func1` [unexpected-keyword] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_kwargs.py:52:11-12: Expected argument `v1` to be passed by name in function `func1` [unexpected-positional-argument] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_kwargs.py:52:11-12: Expected 0 positional arguments, got 3 in function `func1` [bad-argument-count] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_kwargs.py:52:14-16: Expected argument `v3` to be passed by name in function `func1` [unexpected-positional-argument] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_kwargs.py:58:11-20: Unpacked keyword argument `str` is not assignable to parameter `v1` with type `int` in function `func1` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_kwargs.py:61:11-15: Unpacked keyword argument `int | str` is not assignable to parameter `v1` with type `int` in function `func1` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_kwargs.py:61:11-15: Unpacked keyword argument `int | str` is not assignable to parameter `v2` with type `str` in function `func1` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_kwargs.py:61:11-15: Unpacked keyword argument `int | str` is not assignable to parameter `v3` with type `str` in function `func1` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_kwargs.py:63:17-22: Multiple values for argument `v1` in function `func1` [bad-keyword-argument] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_kwargs.py:64:11-12: Argument `Literal[1]` is not assignable to parameter `v3` with type `str` in function `func2` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_kwargs.py:64:14-19: Multiple values for argument `v3` in function `func2` [bad-keyword-argument] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_kwargs.py:65:17-22: Multiple values for argument `v1` in function `func2` [bad-keyword-argument] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_kwargs.py:101:19-24: `(**kwargs: Unpack[TypedDict[TD2]]) -> None` is not assignable to `TDProtocol3` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_kwargs.py:102:19-24: `(**kwargs: Unpack[TypedDict[TD2]]) -> None` is not assignable to `TDProtocol4` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_kwargs.py:103:19-24: `(**kwargs: Unpack[TypedDict[TD2]]) -> None` is not assignable to `TDProtocol5` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_kwargs.py:122:21-30: `Unpack` in **kwargs annotation must be used only with a `TypedDict` [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_kwargs.py:134:19-24: `(*, v1: int, v3: str, v2: str = '') -> None` is not assignable to `TDProtocol6` [bad-assignment] +""" diff --git a/conformance/results/pyrefly/callables_protocol.toml b/conformance/results/pyrefly/callables_protocol.toml new file mode 100644 index 000000000..027e769ea --- /dev/null +++ b/conformance/results/pyrefly/callables_protocol.toml @@ -0,0 +1,22 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_protocol.py:35:7-15: `(*vals: bytes, *, max_items: int | None) -> list[bytes]` is not assignable to variable `cb1` with type `Proto1` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_protocol.py:36:7-15: `(*vals: bytes) -> list[bytes]` is not assignable to variable `cb1` with type `Proto1` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_protocol.py:37:7-15: `(*vals: bytes, *, max_len: str | None) -> list[bytes]` is not assignable to variable `cb1` with type `Proto1` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_protocol.py:67:7-15: `(*a: bytes) -> None` is not assignable to variable `cb2` with type `Proto2` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_protocol.py:68:7-15: `(*a: str, **b: str) -> None` is not assignable to variable `cb2` with type `Proto2` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_protocol.py:69:7-15: `(*a: bytes, **b: bytes) -> None` is not assignable to variable `cb2` with type `Proto2` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_protocol.py:70:7-15: `(**b: str) -> None` is not assignable to variable `cb2` with type `Proto2` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_protocol.py:97:16-24: `(x: int) -> None` is not assignable to `Proto4` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_protocol.py:121:18-26: `(*vals: bytes, *, max_len: int | None = None) -> list[bytes]` is not assignable to `NotProto6` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_protocol.py:169:7-15: `(x: int) -> Any` is not assignable to variable `cb8` with type `Proto8` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_protocol.py:186:33-38: `Literal['str']` is not assignable to attribute `other_attribute` with type `int` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_protocol.py:187:5-18: Object of class `Proto9` has no attribute `xxx` [missing-attribute] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_protocol.py:197:7-32: Object of class `Proto9` has no attribute `other_attribute2` [missing-attribute] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_protocol.py:238:8-17: `(x: int, y: str, /) -> Any` is not assignable to variable `cb11` with type `Proto11` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_protocol.py:260:8-17: `(*args: Any, *, kwarg0: Any) -> None` is not assignable to variable `cb12` with type `Proto12` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_protocol.py:284:27-42: `(path: str) -> str` is not assignable to `Proto13_Default` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_protocol.py:311:27-42: `(*, path: str) -> str` is not assignable to `Proto14_Default` [bad-assignment] +""" diff --git a/conformance/results/pyrefly/callables_subtyping.toml b/conformance/results/pyrefly/callables_subtyping.toml new file mode 100644 index 000000000..e97776ab4 --- /dev/null +++ b/conformance/results/pyrefly/callables_subtyping.toml @@ -0,0 +1,37 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_subtyping.py:26:36-39: `(int) -> int` is not assignable to `(float) -> float` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_subtyping.py:29:32-35: `(float) -> float` is not assignable to `(int) -> int` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_subtyping.py:51:21-29: `PosOnly2` is not assignable to `Standard2` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_subtyping.py:52:21-28: `KwOnly2` is not assignable to `Standard2` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_subtyping.py:55:20-27: `KwOnly2` is not assignable to `PosOnly2` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_subtyping.py:58:19-27: `PosOnly2` is not assignable to `KwOnly2` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_subtyping.py:82:20-27: `NoArgs3` is not assignable to `IntArgs3` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_subtyping.py:85:22-29: `NoArgs3` is not assignable to `FloatArgs3` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_subtyping.py:86:22-30: `IntArgs3` is not assignable to `FloatArgs3` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_subtyping.py:116:20-28: `IntArgs4` is not assignable to `PosOnly4` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_subtyping.py:119:23-31: `StrArgs4` is not assignable to `IntStrArgs4` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_subtyping.py:120:23-31: `IntArgs4` is not assignable to `IntStrArgs4` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_subtyping.py:122:20-28: `IntArgs4` is not assignable to `StrArgs4` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_subtyping.py:124:20-28: `StrArgs4` is not assignable to `IntArgs4` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_subtyping.py:125:22-34: `IntStrArgs4` is not assignable to `Standard4` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_subtyping.py:126:22-30: `StrArgs4` is not assignable to `Standard4` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_subtyping.py:151:22-31: `NoKwargs5` is not assignable to `IntKwargs5` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_subtyping.py:154:24-33: `NoKwargs5` is not assignable to `FloatKwargs5` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_subtyping.py:155:24-34: `IntKwargs5` is not assignable to `FloatKwargs5` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_subtyping.py:187:19-29: `IntKwargs6` is not assignable to `KwOnly6` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_subtyping.py:190:25-35: `StrKwargs6` is not assignable to `IntStrKwargs6` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_subtyping.py:191:25-35: `IntKwargs6` is not assignable to `IntStrKwargs6` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_subtyping.py:193:22-32: `IntKwargs6` is not assignable to `StrKwargs6` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_subtyping.py:195:22-32: `StrKwargs6` is not assignable to `IntKwargs6` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_subtyping.py:196:22-36: `IntStrKwargs6` is not assignable to `Standard6` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_subtyping.py:197:22-32: `StrKwargs6` is not assignable to `Standard6` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_subtyping.py:236:23-37: `NoDefaultArg8` is not assignable to `DefaultArg8` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_subtyping.py:237:23-27: `NoX8` is not assignable to `DefaultArg8` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_subtyping.py:240:25-29: `NoX8` is not assignable to `NoDefaultArg8` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_subtyping.py:243:16-30: `NoDefaultArg8` is not assignable to `NoX8` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_subtyping.py:273:21-31: `Overloaded9` is not assignable to `FloatArg9` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_subtyping.py:297:24-31: `StrArg10` is not assignable to `Overloaded10` [bad-assignment] +""" diff --git a/conformance/results/pyrefly/classes_classvar.toml b/conformance/results/pyrefly/classes_classvar.toml new file mode 100644 index 000000000..923b87ddb --- /dev/null +++ b/conformance/results/pyrefly/classes_classvar.toml @@ -0,0 +1,26 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/classes_classvar.py:38:11-29: Expected 1 type argument for `ClassVar`, got 2 [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/classes_classvar.py:39:14-15: number literal cannot be used in annotations [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/classes_classvar.py:40:14-17: Could not find name `var` [unknown-name] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/classes_classvar.py:45:20-21: `ClassVar` arguments may not contain any type variables [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/classes_classvar.py:46:20-27: `ClassVar` arguments may not contain any type variables [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/classes_classvar.py:47:20-36: `ClassVar` arguments may not contain any type variables [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/classes_classvar.py:52:33-35: `dict[@_, @_]` is not assignable to `list[str]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/classes_classvar.py:54:17-30: `ClassVar` may not be nested inside `Final` [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/classes_classvar.py:55:17-30: `ClassVar` is not allowed in this context [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/classes_classvar.py:69:26-34: `ClassVar` is only allowed inside a class body [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/classes_classvar.py:69:26-39: `ClassVar` is not allowed in this context [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/classes_classvar.py:70:12-20: `ClassVar` is only allowed inside a class body [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/classes_classvar.py:70:12-25: `ClassVar` is not allowed in this context [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/classes_classvar.py:71:9-16: Cannot set field `xx` [read-only] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/classes_classvar.py:73:26-34: `ClassVar` is only allowed inside a class body [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/classes_classvar.py:73:26-39: `ClassVar` is not allowed in this context [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/classes_classvar.py:77:8-16: `ClassVar` is only allowed inside a class body [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/classes_classvar.py:77:8-21: `ClassVar` is not allowed in this context [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/classes_classvar.py:78:20-33: `ClassVar` is not allowed in this context [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/classes_classvar.py:111:1-19: Cannot set field `stats` [read-only] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/classes_classvar.py:140:13-25: `ProtoAImpl` is not assignable to `ProtoA` [bad-assignment] +""" diff --git a/conformance/results/pyrefly/classes_override.toml b/conformance/results/pyrefly/classes_override.toml new file mode 100644 index 000000000..9fee418e5 --- /dev/null +++ b/conformance/results/pyrefly/classes_override.toml @@ -0,0 +1,10 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/classes_override.py:53:9-16: Class member `ChildA.method3` is marked as an override, but no parent class has a matching attribute [bad-override] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/classes_override.py:57:9-16: Class member `ChildA.method4` is marked as an override, but no parent class has a matching attribute [bad-override] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/classes_override.py:79:9-23: Class member `ChildA.static_method1` is marked as an override, but no parent class has a matching attribute [bad-override] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/classes_override.py:84:9-22: Class member `ChildA.class_method1` is marked as an override, but no parent class has a matching attribute [bad-override] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/classes_override.py:89:9-18: Class member `ChildA.property1` is marked as an override, but no parent class has a matching attribute [bad-override] +""" diff --git a/conformance/results/pyrefly/constructors_call_init.toml b/conformance/results/pyrefly/constructors_call_init.toml new file mode 100644 index 000000000..eb8a3f961 --- /dev/null +++ b/conformance/results/pyrefly/constructors_call_init.toml @@ -0,0 +1,14 @@ +conformant = "Partial" +notes = """ +Does not reject class-scoped type var in self param annotation +""" +conformance_automated = "Fail" +errors_diff = """ +Line 107: Expected 1 errors +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/constructors_call_init.py:21:13-16: Argument `float` is not assignable to parameter `x` with type `int` in function `Class1.__init__` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/constructors_call_init.py:42:8-20: Argument `Class2[@_]` is not assignable to parameter `x` with type `Class3 | None` in function `Class2.__init__` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/constructors_call_init.py:56:12-14: Argument `Class4[str]` is not assignable to parameter `self` with type `Class4[int]` in function `Class4.__init__` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/constructors_call_init.py:130:9-10: Expected 0 positional arguments, got 1 in function `object.__init__` [bad-argument-count] +""" diff --git a/conformance/results/pyrefly/constructors_call_metaclass.toml b/conformance/results/pyrefly/constructors_call_metaclass.toml new file mode 100644 index 000000000..3489e9c99 --- /dev/null +++ b/conformance/results/pyrefly/constructors_call_metaclass.toml @@ -0,0 +1,7 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/constructors_call_metaclass.py:51:7-9: Missing argument `x` in function `Class3.__new__` [missing-argument] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/constructors_call_metaclass.py:65:7-9: Missing argument `x` in function `Class4.__new__` [missing-argument] +""" diff --git a/conformance/results/pyrefly/constructors_call_new.toml b/conformance/results/pyrefly/constructors_call_new.toml new file mode 100644 index 000000000..53092d1e9 --- /dev/null +++ b/conformance/results/pyrefly/constructors_call_new.toml @@ -0,0 +1,7 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/constructors_call_new.py:21:13-16: Argument `float` is not assignable to parameter `x` with type `int` in function `Class1.__new__` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/constructors_call_new.py:145:13-15: Argument `type[Class11[str]]` is not assignable to parameter `cls` with type `type[Class11[int]]` in function `Class11.__new__` [bad-argument-type] +""" diff --git a/conformance/results/pyrefly/constructors_call_type.toml b/conformance/results/pyrefly/constructors_call_type.toml new file mode 100644 index 000000000..d5820d3eb --- /dev/null +++ b/conformance/results/pyrefly/constructors_call_type.toml @@ -0,0 +1,20 @@ +conformant = "Partial" +notes = """ +Does not check TypeVar type constructor using upper bound's __new__ +""" +conformance_automated = "Fail" +errors_diff = """ +Line 64: Expected 1 errors +Line 72: Expected 1 errors +Line 81: Expected 1 errors +Line 82: Expected 1 errors +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/constructors_call_type.py:30:8-10: Missing argument `x` in function `Meta1.__call__` [missing-argument] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/constructors_call_type.py:30:8-10: Missing argument `y` in function `Meta1.__call__` [missing-argument] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/constructors_call_type.py:40:8-10: Missing argument `x` in function `Class2.__new__` [missing-argument] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/constructors_call_type.py:40:8-10: Missing argument `y` in function `Class2.__new__` [missing-argument] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/constructors_call_type.py:50:8-10: Missing argument `x` in function `Class3.__init__` [missing-argument] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/constructors_call_type.py:50:8-10: Missing argument `y` in function `Class3.__init__` [missing-argument] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/constructors_call_type.py:59:9-10: Expected 0 positional arguments, got 1 in function `object.__init__` [bad-argument-count] +""" diff --git a/conformance/results/pyrefly/constructors_callable.toml b/conformance/results/pyrefly/constructors_callable.toml new file mode 100644 index 000000000..714ec541b --- /dev/null +++ b/conformance/results/pyrefly/constructors_callable.toml @@ -0,0 +1,35 @@ +conformant = "Partial" +notes = """ +Some overloaded constructors are not resolved correctly. +Converting constructor to callable does not preserve class-scoped type params. +Converting constructor to callable does not substitute Self in __new__ +Converting constructor to callable uses __new__ signature instead of __init__ +""" +conformance_automated = "Fail" +errors_diff = """ +Line 65: Expected 1 errors +Line 66: Expected 1 errors +Line 67: Expected 1 errors +Line 184: Expected 1 errors +Line 195: Expected 1 errors +Line 62: Unexpected errors ['Argument `type[Class3]` is not assignable to parameter `cb` with type `(*args: Unknown, **kwargs: Unknown) -> Class3` in function `accepts_callable` [bad-argument-type]'] +Line 164: Unexpected errors ['assert_type(Class7[Any], Class7[int]) failed [assert-type]'] +Line 165: Unexpected errors ['assert_type(Class7[Any], Class7[str]) failed [assert-type]', "Argument `Literal['']` is not assignable to parameter `x` with type `int` [bad-argument-type]"] +Line 183: Unexpected errors ['assert_type(Class8[Any], Class8[str]) failed [assert-type]'] +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/constructors_callable.py:38:3-5: Missing argument `x` [missing-argument] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/constructors_callable.py:39:3-8: Missing argument `x` [missing-argument] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/constructors_callable.py:39:4-5: Unexpected keyword argument `y` [unexpected-keyword] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/constructors_callable.py:51:4-5: Expected 0 positional arguments, got 1 [bad-argument-count] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/constructors_callable.py:62:23-29: Argument `type[Class3]` is not assignable to parameter `cb` with type `(*args: Unknown, **kwargs: Unknown) -> Class3` in function `accepts_callable` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/constructors_callable.py:79:3-5: Missing argument `x` [missing-argument] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/constructors_callable.py:80:3-8: Missing argument `x` [missing-argument] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/constructors_callable.py:80:4-5: Unexpected keyword argument `y` [unexpected-keyword] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/constructors_callable.py:127:4-5: Expected 0 positional arguments, got 1 [bad-argument-count] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/constructors_callable.py:144:8-9: Expected 0 positional arguments, got 1 [bad-argument-count] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/constructors_callable.py:164:12-32: assert_type(Class7[Any], Class7[int]) failed [assert-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/constructors_callable.py:165:12-33: assert_type(Class7[Any], Class7[str]) failed [assert-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/constructors_callable.py:165:16-18: Argument `Literal['']` is not assignable to parameter `x` with type `int` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/constructors_callable.py:183:12-41: assert_type(Class8[Any], Class8[str]) failed [assert-type] +""" diff --git a/conformance/results/pyrefly/constructors_consistency.toml b/conformance/results/pyrefly/constructors_consistency.toml new file mode 100644 index 000000000..cdd4d0cd9 --- /dev/null +++ b/conformance/results/pyrefly/constructors_consistency.toml @@ -0,0 +1,5 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +""" diff --git a/conformance/results/pyrefly/dataclasses_descriptors.toml b/conformance/results/pyrefly/dataclasses_descriptors.toml new file mode 100644 index 000000000..cdd4d0cd9 --- /dev/null +++ b/conformance/results/pyrefly/dataclasses_descriptors.toml @@ -0,0 +1,5 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +""" diff --git a/conformance/results/pyrefly/dataclasses_final.toml b/conformance/results/pyrefly/dataclasses_final.toml new file mode 100644 index 000000000..e6db899d3 --- /dev/null +++ b/conformance/results/pyrefly/dataclasses_final.toml @@ -0,0 +1,14 @@ +conformant = "Partial" +notes = """ +Allows assignment to final attributes that are not initialized on the class +""" +conformance_automated = "Fail" +errors_diff = """ +Line 35: Expected 1 errors +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_final.py:27:1-17: Cannot set field `final_classvar` [read-only] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_final.py:36:1-21: Cannot set field `final_with_default` [read-only] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_final.py:37:1-19: Instance-only attribute `final_no_default` of class `D` is not visible on the class [no-access] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_final.py:38:1-21: Cannot set field `final_with_default` [read-only] +""" diff --git a/conformance/results/pyrefly/dataclasses_frozen.toml b/conformance/results/pyrefly/dataclasses_frozen.toml new file mode 100644 index 000000000..b5a6081d7 --- /dev/null +++ b/conformance/results/pyrefly/dataclasses_frozen.toml @@ -0,0 +1,9 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_frozen.py:16:1-6: Cannot set field `a` [read-only] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_frozen.py:17:1-6: Cannot set field `b` [read-only] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_frozen.py:23:7-10: Cannot inherit non-frozen dataclass `DC2` from frozen dataclass `DC1` [invalid-inheritance] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_frozen.py:33:7-10: Cannot inherit frozen dataclass `DC4` from non-frozen dataclass `DC3` [invalid-inheritance] +""" diff --git a/conformance/results/pyrefly/dataclasses_hash.toml b/conformance/results/pyrefly/dataclasses_hash.toml new file mode 100644 index 000000000..bd8e2906d --- /dev/null +++ b/conformance/results/pyrefly/dataclasses_hash.toml @@ -0,0 +1,7 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_hash.py:15:16-22: `DC1` is not assignable to `Hashable` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_hash.py:32:16-22: `DC3` is not assignable to `Hashable` [bad-assignment] +""" diff --git a/conformance/results/pyrefly/dataclasses_inheritance.toml b/conformance/results/pyrefly/dataclasses_inheritance.toml new file mode 100644 index 000000000..045a85092 --- /dev/null +++ b/conformance/results/pyrefly/dataclasses_inheritance.toml @@ -0,0 +1,7 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_inheritance.py:62:5-6: ClassVar `DC7.x` overrides instance variable of the same name in parent class `DC6` [bad-override] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_inheritance.py:66:5-6: Instance variable `DC7.y` overrides ClassVar of the same name in parent class `DC6` [bad-override] +""" diff --git a/conformance/results/pyrefly/dataclasses_kwonly.toml b/conformance/results/pyrefly/dataclasses_kwonly.toml new file mode 100644 index 000000000..c4d80ab21 --- /dev/null +++ b/conformance/results/pyrefly/dataclasses_kwonly.toml @@ -0,0 +1,8 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_kwonly.py:23:11-12: Expected 1 positional argument, got 2 in function `DC1.__init__` [bad-argument-count] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_kwonly.py:38:11-12: Expected 1 positional argument, got 2 in function `DC2.__init__` [bad-argument-count] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_kwonly.py:53:11-12: Expected 1 positional argument, got 2 in function `DC3.__init__` [bad-argument-count] +""" diff --git a/conformance/results/pyrefly/dataclasses_match_args.toml b/conformance/results/pyrefly/dataclasses_match_args.toml new file mode 100644 index 000000000..1d8d664f8 --- /dev/null +++ b/conformance/results/pyrefly/dataclasses_match_args.toml @@ -0,0 +1,6 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_match_args.py:42:1-19: Class `DC4` has no class attribute `__match_args__` [missing-attribute] +""" diff --git a/conformance/results/pyrefly/dataclasses_order.toml b/conformance/results/pyrefly/dataclasses_order.toml new file mode 100644 index 000000000..589b66f46 --- /dev/null +++ b/conformance/results/pyrefly/dataclasses_order.toml @@ -0,0 +1,6 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_order.py:50:4-17: `<` is not supported between `DC1` and `DC2` [unsupported-operation] +""" diff --git a/conformance/results/pyrefly/dataclasses_postinit.toml b/conformance/results/pyrefly/dataclasses_postinit.toml new file mode 100644 index 000000000..dbef33c77 --- /dev/null +++ b/conformance/results/pyrefly/dataclasses_postinit.toml @@ -0,0 +1,9 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_postinit.py:19:9-22: `__post_init__` type `BoundMethod[DC1, (self: Self@DC1, x: int, y: int) -> None]` is not assignable to expected type `(x: int, y: str) -> object` generated from the dataclass's `InitVar` fields [bad-function-definition] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_postinit.py:28:7-12: Object of class `DC1` has no attribute `x` [missing-attribute] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_postinit.py:29:7-12: Object of class `DC1` has no attribute `y` [missing-attribute] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_postinit.py:36:9-22: `__post_init__` type `BoundMethod[DC2, (self: Self@DC2, x: int) -> None]` is not assignable to expected type `(x: int, y: str) -> object` generated from the dataclass's `InitVar` fields [bad-function-definition] +""" diff --git a/conformance/results/pyrefly/dataclasses_slots.toml b/conformance/results/pyrefly/dataclasses_slots.toml new file mode 100644 index 000000000..b7f8c6a93 --- /dev/null +++ b/conformance/results/pyrefly/dataclasses_slots.toml @@ -0,0 +1,14 @@ +conformant = "Partial" +notes = """ +__slots__ is generated but not checked during attribute assignment +""" +conformance_automated = "Fail" +errors_diff = """ +Line 25: Expected 1 errors +Line 38: Expected 1 errors +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_slots.py:11:7-10: Cannot specify both `slots=True` and `__slots__` [bad-class-definition] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_slots.py:66:1-14: Class `DC6` has no class attribute `__slots__` [missing-attribute] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_slots.py:69:1-17: Object of class `DC6` has no attribute `__slots__` [missing-attribute] +""" diff --git a/conformance/results/pyrefly/dataclasses_transform_class.toml b/conformance/results/pyrefly/dataclasses_transform_class.toml new file mode 100644 index 000000000..73f281cd3 --- /dev/null +++ b/conformance/results/pyrefly/dataclasses_transform_class.toml @@ -0,0 +1,13 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_transform_class.py:51:7-24: Cannot inherit non-frozen dataclass `Customer1Subclass` from frozen dataclass `Customer1` [invalid-inheritance] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_transform_class.py:63:1-8: Cannot set field `id` [read-only] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_transform_class.py:66:18-19: Expected argument `id` to be passed by name in function `Customer1.__init__` [unexpected-positional-argument] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_transform_class.py:66:21-26: Expected argument `name` to be passed by name in function `Customer1.__init__` [unexpected-positional-argument] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_transform_class.py:72:6-17: `<` is not supported between `Customer1` and `Customer1` [unsupported-operation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_transform_class.py:82:18-19: Expected argument `id` to be passed by name in function `Customer2.__init__` [unexpected-positional-argument] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_transform_class.py:82:18-19: Expected 0 positional arguments, got 2 in function `Customer2.__init__` [bad-argument-count] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_transform_class.py:122:1-8: Cannot set field `id` [read-only] +""" diff --git a/conformance/results/pyrefly/dataclasses_transform_converter.toml b/conformance/results/pyrefly/dataclasses_transform_converter.toml new file mode 100644 index 000000000..ce39fc49d --- /dev/null +++ b/conformance/results/pyrefly/dataclasses_transform_converter.toml @@ -0,0 +1,16 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_transform_converter.py:48:41-55: Argument `() -> int` is not assignable to parameter `converter` with type `(@_) -> int` in function `model_field` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_transform_converter.py:48:41-55: Argument `() -> int` is not assignable to parameter `converter` with type `(@_) -> @_` in function `model_field` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_transform_converter.py:49:41-55: Argument `(*, x: int) -> int` is not assignable to parameter `converter` with type `(@_) -> int` in function `model_field` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_transform_converter.py:49:41-55: Argument `(*, x: int) -> int` is not assignable to parameter `converter` with type `(@_) -> @_` in function `model_field` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_transform_converter.py:107:5-6: Argument `Literal[1]` is not assignable to parameter `field0` with type `str` in function `DC2.__init__` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_transform_converter.py:108:23-24: Argument `Literal[1]` is not assignable to parameter `field3` with type `bytes | str` in function `DC2.__init__` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_transform_converter.py:109:29-31: Argument `complex` is not assignable to parameter `field4` with type `list[str] | str` in function `DC2.__init__` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_transform_converter.py:118:14-15: `Literal[1]` is not assignable to attribute `field0` with type `str` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_transform_converter.py:119:14-15: `Literal[1]` is not assignable to attribute `field3` with type `bytes | str` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_transform_converter.py:130:67-68: Argument `Literal[1]` is not assignable to parameter `default` with type `str | None` in function `model_field` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_transform_converter.py:133:75-78: Argument `type[int]` is not assignable to parameter `default_factory` with type `(() -> str) | None` in function `model_field` [bad-argument-type] +""" diff --git a/conformance/results/pyrefly/dataclasses_transform_field.toml b/conformance/results/pyrefly/dataclasses_transform_field.toml new file mode 100644 index 000000000..bbfec45a1 --- /dev/null +++ b/conformance/results/pyrefly/dataclasses_transform_field.toml @@ -0,0 +1,7 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_transform_field.py:64:16-18: Unexpected keyword argument `id` in function `CustomerModel1.__init__` [unexpected-keyword] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_transform_field.py:75:16-17: Expected argument `name` to be passed by name in function `CustomerModel2.__init__` [unexpected-positional-argument] +""" diff --git a/conformance/results/pyrefly/dataclasses_transform_func.toml b/conformance/results/pyrefly/dataclasses_transform_func.toml new file mode 100644 index 000000000..a58ceeab7 --- /dev/null +++ b/conformance/results/pyrefly/dataclasses_transform_func.toml @@ -0,0 +1,12 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_transform_func.py:56:13-14: `Literal[3]` is not assignable to attribute `name` with type `str` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_transform_func.py:60:6-17: `<` is not supported between `Customer1` and `Customer1` [unsupported-operation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_transform_func.py:64:36-42: Unexpected keyword argument `salary` in function `Customer1.__init__` [unexpected-keyword] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_transform_func.py:70:18-19: Expected argument `id` to be passed by name in function `Customer2.__init__` [unexpected-positional-argument] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_transform_func.py:70:21-27: Expected argument `name` to be passed by name in function `Customer2.__init__` [unexpected-positional-argument] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_transform_func.py:89:7-24: Cannot inherit non-frozen dataclass `Customer3Subclass` from frozen dataclass `Customer3` [invalid-inheritance] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_transform_func.py:96:1-8: Cannot set field `id` [read-only] +""" diff --git a/conformance/results/pyrefly/dataclasses_transform_meta.toml b/conformance/results/pyrefly/dataclasses_transform_meta.toml new file mode 100644 index 000000000..869e74a7c --- /dev/null +++ b/conformance/results/pyrefly/dataclasses_transform_meta.toml @@ -0,0 +1,13 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_transform_meta.py:51:7-24: Cannot inherit non-frozen dataclass `Customer1Subclass` from frozen dataclass `Customer1` [invalid-inheritance] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_transform_meta.py:63:1-8: Cannot set field `id` [read-only] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_transform_meta.py:66:18-19: Expected argument `id` to be passed by name in function `Customer1.__init__` [unexpected-positional-argument] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_transform_meta.py:66:21-26: Expected argument `name` to be passed by name in function `Customer1.__init__` [unexpected-positional-argument] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_transform_meta.py:73:6-17: `<` is not supported between `Customer1` and `Customer1` [unsupported-operation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_transform_meta.py:83:18-19: Expected argument `id` to be passed by name in function `Customer2.__init__` [unexpected-positional-argument] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_transform_meta.py:83:18-19: Expected 0 positional arguments, got 2 in function `Customer2.__init__` [bad-argument-count] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_transform_meta.py:103:1-8: Cannot set field `id` [read-only] +""" diff --git a/conformance/results/pyrefly/dataclasses_usage.toml b/conformance/results/pyrefly/dataclasses_usage.toml new file mode 100644 index 000000000..927f4a09d --- /dev/null +++ b/conformance/results/pyrefly/dataclasses_usage.toml @@ -0,0 +1,16 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_usage.py:50:19-27: Missing argument `unit_price` in function `InventoryItem.__init__` [missing-argument] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_usage.py:51:28-35: Argument `Literal['price']` is not assignable to parameter `unit_price` with type `float` in function `InventoryItem.__init__` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_usage.py:52:36-37: Expected 3 positional arguments, got 4 in function `InventoryItem.__init__` [bad-argument-count] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_usage.py:61:5-6: Dataclass field `b` without a default may not follow dataclass field with a default [bad-class-definition] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_usage.py:67:5-6: Dataclass field `b` without a default may not follow dataclass field with a default [bad-class-definition] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_usage.py:73:5-6: Dataclass field `b` without a default may not follow dataclass field with a default [bad-class-definition] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_usage.py:83:13-14: Expected 1 positional argument, got 2 in function `DC4.__init__` [bad-argument-count] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_usage.py:88:14-40: `str` is not assignable to `int` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_usage.py:127:8-9: Expected 1 positional argument, got 2 in function `DC7.__init__` [bad-argument-count] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_usage.py:130:4-7: Missing argument `y` in function `DC8.__init__` [missing-argument] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_usage.py:179:6-7: Expected 0 positional arguments, got 1 in function `object.__init__` [bad-argument-count] +""" diff --git a/conformance/results/pyrefly/directives_assert_type.toml b/conformance/results/pyrefly/directives_assert_type.toml new file mode 100644 index 000000000..2f8958910 --- /dev/null +++ b/conformance/results/pyrefly/directives_assert_type.toml @@ -0,0 +1,11 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/directives_assert_type.py:27:16-24: assert_type(int | str, int) failed [assert-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/directives_assert_type.py:28:16-24: assert_type(Any, int) failed [assert-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/directives_assert_type.py:29:16-24: assert_type(Literal[4], int) failed [assert-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/directives_assert_type.py:31:16-18: assert_type needs 2 positional arguments, got 0 [bad-argument-count] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/directives_assert_type.py:32:16-25: assert_type(Literal[''], int) failed [assert-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/directives_assert_type.py:33:16-33: assert_type needs 2 positional arguments, got 3 [bad-argument-count] +""" diff --git a/conformance/results/pyrefly/directives_cast.toml b/conformance/results/pyrefly/directives_cast.toml new file mode 100644 index 000000000..15b1539c0 --- /dev/null +++ b/conformance/results/pyrefly/directives_cast.toml @@ -0,0 +1,9 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/directives_cast.py:15:12-14: `typing.cast` missing required argument `typ` [missing-argument] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/directives_cast.py:15:12-14: `typing.cast` missing required argument `val` [missing-argument] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/directives_cast.py:16:12-19: First argument to `typing.cast` must be a type [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/directives_cast.py:17:12-25: `typing.cast` expected 2 arguments, got 3 [bad-argument-count] +""" diff --git a/conformance/results/pyrefly/directives_deprecated.toml b/conformance/results/pyrefly/directives_deprecated.toml new file mode 100644 index 000000000..2b3718261 --- /dev/null +++ b/conformance/results/pyrefly/directives_deprecated.toml @@ -0,0 +1,18 @@ +conformant = "Unsupported" +conformance_automated = "Fail" +errors_diff = """ +Line 18: Expected 1 errors +Line 24: Expected 1 errors +Line 25: Expected 1 errors +Line 30: Expected 1 errors +Line 41: Expected 1 errors +Line 42: Expected 1 errors +Line 44: Expected 1 errors +Line 47: Expected 1 errors +Line 48: Expected 1 errors +Line 58: Expected 1 errors +Line 69: Expected 1 errors +Line 98: Expected 1 errors +""" +output = """ +""" diff --git a/conformance/results/pyrefly/directives_no_type_check.toml b/conformance/results/pyrefly/directives_no_type_check.toml new file mode 100644 index 000000000..a7d97bfb9 --- /dev/null +++ b/conformance/results/pyrefly/directives_no_type_check.toml @@ -0,0 +1,10 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/directives_no_type_check.py:15:14-16: `Literal['']` is not assignable to `int` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/directives_no_type_check.py:29:7-17: Argument `Literal[b'invalid']` is not assignable to parameter `a` with type `int` in function `func1` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/directives_no_type_check.py:29:19-31: Argument `Literal[b'arguments']` is not assignable to parameter `b` with type `str` in function `func1` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/directives_no_type_check.py:32:6-8: Missing argument `a` in function `func1` [missing-argument] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/directives_no_type_check.py:32:6-8: Missing argument `b` in function `func1` [missing-argument] +""" diff --git a/conformance/results/pyrefly/directives_reveal_type.toml b/conformance/results/pyrefly/directives_reveal_type.toml new file mode 100644 index 000000000..3ae85a4fd --- /dev/null +++ b/conformance/results/pyrefly/directives_reveal_type.toml @@ -0,0 +1,7 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/directives_reveal_type.py:19:16-18: reveal_type needs 1 positional argument, got 0 [bad-argument-count] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/directives_reveal_type.py:20:16-22: reveal_type needs 1 positional argument, got 2 [bad-argument-count] +""" diff --git a/conformance/results/pyrefly/directives_type_checking.toml b/conformance/results/pyrefly/directives_type_checking.toml new file mode 100644 index 000000000..cdd4d0cd9 --- /dev/null +++ b/conformance/results/pyrefly/directives_type_checking.toml @@ -0,0 +1,5 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +""" diff --git a/conformance/results/pyrefly/directives_type_ignore.toml b/conformance/results/pyrefly/directives_type_ignore.toml new file mode 100644 index 000000000..cdd4d0cd9 --- /dev/null +++ b/conformance/results/pyrefly/directives_type_ignore.toml @@ -0,0 +1,5 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +""" diff --git a/conformance/results/pyrefly/directives_type_ignore_file1.toml b/conformance/results/pyrefly/directives_type_ignore_file1.toml new file mode 100644 index 000000000..cdd4d0cd9 --- /dev/null +++ b/conformance/results/pyrefly/directives_type_ignore_file1.toml @@ -0,0 +1,5 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +""" diff --git a/conformance/results/pyrefly/directives_type_ignore_file2.toml b/conformance/results/pyrefly/directives_type_ignore_file2.toml new file mode 100644 index 000000000..294d88e9e --- /dev/null +++ b/conformance/results/pyrefly/directives_type_ignore_file2.toml @@ -0,0 +1,6 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/directives_type_ignore_file2.py:14:10-12: `Literal['']` is not assignable to `int` [bad-assignment] +""" diff --git a/conformance/results/pyrefly/directives_version_platform.toml b/conformance/results/pyrefly/directives_version_platform.toml new file mode 100644 index 000000000..6d176aaaa --- /dev/null +++ b/conformance/results/pyrefly/directives_version_platform.toml @@ -0,0 +1,7 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/directives_version_platform.py:40:17-19: `Literal['']` is not assignable to `int` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/directives_version_platform.py:45:17-19: `Literal['']` is not assignable to `int` [bad-assignment] +""" diff --git a/conformance/results/pyrefly/enums_behaviors.toml b/conformance/results/pyrefly/enums_behaviors.toml new file mode 100644 index 000000000..70e74c9d3 --- /dev/null +++ b/conformance/results/pyrefly/enums_behaviors.toml @@ -0,0 +1,14 @@ +conformant = "Partial" +notes = """ +Iterating an enum class gives Any +""" +conformance_automated = "Fail" +errors_diff = """ +Line 20: Unexpected errors ['assert_type(Any, Color) failed [assert-type]'] +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/enums_behaviors.py:20:16-30: assert_type(Any, Color) failed [assert-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/enums_behaviors.py:27:12-33: assert_type(Literal[Color.RED], Color) failed [assert-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/enums_behaviors.py:32:12-43: assert_type(Color, Literal[Color.BLUE]) failed [assert-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/enums_behaviors.py:44:21-26: Cannot extend final class `Shape` [invalid-inheritance] +""" diff --git a/conformance/results/pyrefly/enums_definition.toml b/conformance/results/pyrefly/enums_definition.toml new file mode 100644 index 000000000..cdd4d0cd9 --- /dev/null +++ b/conformance/results/pyrefly/enums_definition.toml @@ -0,0 +1,5 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +""" diff --git a/conformance/results/pyrefly/enums_expansion.toml b/conformance/results/pyrefly/enums_expansion.toml new file mode 100644 index 000000000..a05e64357 --- /dev/null +++ b/conformance/results/pyrefly/enums_expansion.toml @@ -0,0 +1,6 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/enums_expansion.py:53:20-51: assert_type(CustomFlags, Literal[CustomFlags.FLAG3]) failed [assert-type] +""" diff --git a/conformance/results/pyrefly/enums_member_names.toml b/conformance/results/pyrefly/enums_member_names.toml new file mode 100644 index 000000000..9650f2d3c --- /dev/null +++ b/conformance/results/pyrefly/enums_member_names.toml @@ -0,0 +1,6 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/enums_member_names.py:30:16-65: assert_type(str, Literal['BLUE', 'GREEN', 'RED']) failed [assert-type] +""" diff --git a/conformance/results/pyrefly/enums_member_values.toml b/conformance/results/pyrefly/enums_member_values.toml new file mode 100644 index 000000000..ef8220628 --- /dev/null +++ b/conformance/results/pyrefly/enums_member_values.toml @@ -0,0 +1,14 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/enums_member_values.py:21:12-43: assert_type(int, Literal[1]) failed [assert-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/enums_member_values.py:22:12-41: assert_type(int, Literal[1]) failed [assert-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/enums_member_values.py:26:16-50: assert_type(int, Literal[1, 3]) failed [assert-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/enums_member_values.py:30:16-51: assert_type(int, Literal[1, 2, 3]) failed [assert-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/enums_member_values.py:54:12-46: assert_type(tuple[Literal[1], float, float], Literal[1]) failed [assert-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/enums_member_values.py:68:12-42: assert_type(auto, Literal[1]) failed [assert-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/enums_member_values.py:78:5-10: Enum member `GREEN` has type `str`, must match the `_value_` attribute annotation of `int` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/enums_member_values.py:85:24-29: `int` is not assignable to attribute `_value_` with type `str` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/enums_member_values.py:96:12-41: assert_type(Ellipsis, int) failed [assert-type] +""" diff --git a/conformance/results/pyrefly/enums_members.toml b/conformance/results/pyrefly/enums_members.toml new file mode 100644 index 000000000..9e9397d03 --- /dev/null +++ b/conformance/results/pyrefly/enums_members.toml @@ -0,0 +1,32 @@ +conformant = "Partial" +notes = """ +Enum members that are aliases of other members do not resolved to the aliased member's type +""" +conformance_automated = "Fail" +errors_diff = """ +Line 27: Unexpected errors ['assert_type(Any, str) failed [assert-type]', 'Instance-only attribute `genus` of class `Pet` is not visible on the class [missing-attribute]'] +Line 28: Unexpected errors ['assert_type(Any, str) failed [assert-type]', 'Instance-only attribute `species` of class `Pet` is not visible on the class [missing-attribute]'] +Line 100: Unexpected errors ['assert_type(Literal[TrafficLight.AMBER], Literal[TrafficLight.YELLOW]) failed [assert-type]'] +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/enums_members.py:27:12-28: assert_type(Any, str) failed [assert-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/enums_members.py:27:13-22: Instance-only attribute `genus` of class `Pet` is not visible on the class [missing-attribute] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/enums_members.py:28:12-30: assert_type(Any, str) failed [assert-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/enums_members.py:28:13-24: Instance-only attribute `species` of class `Pet` is not visible on the class [missing-attribute] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/enums_members.py:50:5-8: Enum member `DOG` may not be annotated directly. Instead, annotate the `_value_` attribute. [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/enums_members.py:82:12-53: assert_type((x: Any) -> str, Any) failed [assert-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/enums_members.py:82:37-51: `Pet4.converter` is not a valid enum member [invalid-literal] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/enums_members.py:83:12-53: assert_type((x: int) -> int, Any) failed [assert-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/enums_members.py:83:37-51: `Pet4.transform` is not a valid enum member [invalid-literal] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/enums_members.py:84:12-49: assert_type((self: Self) -> str, Any) failed [assert-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/enums_members.py:84:35-47: `Pet4.species` is not a valid enum member [invalid-literal] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/enums_members.py:85:12-45: assert_type((self: Self) -> None, Any) failed [assert-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/enums_members.py:85:33-43: `Pet4.speak` is not a valid enum member [invalid-literal] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/enums_members.py:100:12-62: assert_type(Literal[TrafficLight.AMBER], Literal[TrafficLight.YELLOW]) failed [assert-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/enums_members.py:116:12-43: assert_type(nonmember[int], Any) failed [assert-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/enums_members.py:116:32-41: `Example.b` is not a valid enum member [invalid-literal] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/enums_members.py:129:20-57: assert_type(int, Any) failed [assert-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/enums_members.py:129:43-55: `Example2.__B` is not a valid enum member [invalid-literal] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/enums_members.py:146:12-27: assert_type(Literal[Pet5.DOG], int) failed [assert-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/enums_members.py:147:12-28: assert_type(Literal[Pet5.FISH], int) failed [assert-type] +""" diff --git a/conformance/results/pyrefly/exceptions_context_managers.toml b/conformance/results/pyrefly/exceptions_context_managers.toml new file mode 100644 index 000000000..8a98cd1f6 --- /dev/null +++ b/conformance/results/pyrefly/exceptions_context_managers.toml @@ -0,0 +1,13 @@ +conformant = "Partial" +notes = """ +Some error suppressing context managers are not detected +""" +conformance_automated = "Fail" +errors_diff = """ +Line 50: Unexpected errors ['assert_type(str, int | str) failed [assert-type]'] +Line 57: Unexpected errors ['assert_type(str, int | str) failed [assert-type]'] +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/exceptions_context_managers.py:50:16-30: assert_type(str, int | str) failed [assert-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/exceptions_context_managers.py:57:16-30: assert_type(str, int | str) failed [assert-type] +""" diff --git a/conformance/results/pyrefly/generics_base_class.toml b/conformance/results/pyrefly/generics_base_class.toml new file mode 100644 index 000000000..bcae642c5 --- /dev/null +++ b/conformance/results/pyrefly/generics_base_class.toml @@ -0,0 +1,16 @@ +conformant = "Partial" +notes = """ +Does not reject inconsistent ordering of type variables in different base classes. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 98: Expected 1 errors +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_base_class.py:26:26-27: Argument `SymbolTable` is not assignable to parameter `x` with type `dict[str, list[object]]` in function `takes_dict_incorrect` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_base_class.py:29:14-24: `Generic` is not allowed in this context [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_base_class.py:30:8-15: Expected a type argument for `Generic` [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_base_class.py:49:22-42: Expected 1 type argument for `LinkedList`, got 2 [bad-specialization] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_base_class.py:61:18-34: Expected 1 type argument for `MyDict`, got 2 [bad-specialization] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_base_class.py:68:28-29: Duplicated type parameter declaration `T` [invalid-inheritance] +""" diff --git a/conformance/results/pyrefly/generics_basic.toml b/conformance/results/pyrefly/generics_basic.toml new file mode 100644 index 000000000..331dd0f2e --- /dev/null +++ b/conformance/results/pyrefly/generics_basic.toml @@ -0,0 +1,33 @@ +conformant = "Partial" +notes = """ +Does not reject Type Var definition with only 1 constraint +Incorrect rejects + between two AnyStr +Constrained type var resolves to subtype instead of explcitly listed constraint +""" +conformance_automated = "Fail" +errors_diff = """ +Line 49: Expected 1 errors +Line 34: Unexpected errors ['`+` is not supported between `AnyStr` and `AnyStr` [unsupported-operation]', '`+` is not supported between `AnyStr` and `AnyStr` [unsupported-operation]', 'Returned type `bytes | Unknown` is not assignable to declared return type `AnyStr` [bad-return]'] +Line 67: Unexpected errors ['assert_type(MyStr, str) failed [assert-type]'] +Line 68: Unexpected errors ['assert_type(MyStr, str) failed [assert-type]', 'Argument `str` is not assignable to parameter `y` with type `MyStr` in function `concat` [bad-argument-type]'] +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_basic.py:34:12-17: `+` is not supported between `AnyStr` and `AnyStr` [unsupported-operation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_basic.py:34:12-17: `+` is not supported between `AnyStr` and `AnyStr` [unsupported-operation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_basic.py:34:12-17: Returned type `bytes | Unknown` is not assignable to declared return type `AnyStr` [bad-return] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_basic.py:40:15-16: Argument `bytes` is not assignable to parameter `y` with type `str` in function `concat` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_basic.py:41:15-16: Argument `str` is not assignable to parameter `y` with type `bytes` in function `concat` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_basic.py:55:53-60: Type variable bounds and constraints must be concrete [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_basic.py:67:16-35: assert_type(MyStr, str) failed [assert-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_basic.py:68:16-35: assert_type(MyStr, str) failed [assert-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_basic.py:68:27-28: Argument `str` is not assignable to parameter `y` with type `MyStr` in function `concat` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_basic.py:69:15-16: Argument `bytes` is not assignable to parameter `y` with type `MyStr` in function `concat` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_basic.py:121:24-25: Duplicated type parameter declaration `T` [invalid-inheritance] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_basic.py:157:8-9: Cannot index into `MyMap1[str, int]` [index-error] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_basic.py:158:8-9: Cannot index into `MyMap2[int, str]` [index-error] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_basic.py:162:7-11: Expected a type variable, got `int` [invalid-type-var] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_basic.py:163:7-11: Expected a type variable, got `int` [invalid-type-var] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_basic.py:171:7-11: Class `Bad3` uses type variables not specified in `Generic` or `Protocol` base [invalid-type-var] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_basic.py:172:7-11: Class `Bad4` uses type variables not specified in `Generic` or `Protocol` base [invalid-type-var] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_basic.py:208:7-26: Metaclass may not be an unbound generic [invalid-inheritance] +""" diff --git a/conformance/results/pyrefly/generics_defaults.toml b/conformance/results/pyrefly/generics_defaults.toml new file mode 100644 index 000000000..c8cf6291e --- /dev/null +++ b/conformance/results/pyrefly/generics_defaults.toml @@ -0,0 +1,21 @@ +conformant = "Pass" +notes = """ +Unsolved type var is not always resolved to default (optional) +""" +conformance_automated = "Fail" +errors_diff = """ +Line 130: Unexpected errors ['assert_type(Any, int) failed [assert-type]'] +Line 169: Unexpected errors ['assert_type([DefaultIntT](Foo7[DefaultIntT]) -> Foo7[DefaultIntT], (Foo7[int]) -> Foo7[int]) failed [assert-type]'] +Line 170: Unexpected errors ['assert_type(Any, int) failed [assert-type]', 'Instance-only attribute `attr` of class `Foo7` is not visible on the class [missing-attribute]'] +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_defaults.py:24:7-31: Type parameter `T` without a default cannot follow type parameter `DefaultStrT` with a default [invalid-type-var] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_defaults.py:50:1-20: Expected 5 type arguments for `AllTheDefaults`, got 1 [bad-specialization] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_defaults.py:107:51-54: Expected default `int` of `Invalid1` to be assignable to the upper bound of `str` [invalid-type-var] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_defaults.py:114:52-55: Expected default `int` of `Invalid2` to be one of the following constraints: `float`, `str` [invalid-type-var] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_defaults.py:130:12-27: assert_type(Any, int) failed [assert-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_defaults.py:141:7-11: TypeVar `T5` with a default cannot follow TypeVarTuple `Ts` [invalid-type-var] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_defaults.py:169:12-57: assert_type([DefaultIntT](Foo7[DefaultIntT]) -> Foo7[DefaultIntT], (Foo7[int]) -> Foo7[int]) failed [assert-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_defaults.py:170:12-28: assert_type(Any, int) failed [assert-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_defaults.py:170:13-22: Instance-only attribute `attr` of class `Foo7` is not visible on the class [missing-attribute] +""" diff --git a/conformance/results/pyrefly/generics_defaults_referential.toml b/conformance/results/pyrefly/generics_defaults_referential.toml new file mode 100644 index 000000000..c57630b20 --- /dev/null +++ b/conformance/results/pyrefly/generics_defaults_referential.toml @@ -0,0 +1,19 @@ +conformant = "Unsupported" +conformance_automated = "Fail" +errors_diff = """ +Line 66: Unexpected errors ['Expected default `TypeVar[X1]` of `Ok1` to be assignable to the upper bound of `float` [invalid-type-var]'] +Line 67: Unexpected errors ['Expected default `TypeVar[X1]` of `AlsoOk1` to be assignable to the upper bound of `int` [invalid-type-var]'] +Line 77: Unexpected errors ['Expected default `TypeVar[Y2]` of `AlsoOk2` to be one of the following constraints: `int`, `str`, `bool` [invalid-type-var]'] +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_defaults_referential.py:36:13-15: Argument `Literal['']` is not assignable to parameter `b` with type `int` in function `Foo.__init__` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_defaults_referential.py:37:10-12: Argument `Literal['']` is not assignable to parameter `a` with type `int` in function `Foo.__init__` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_defaults_referential.py:53:7-13: Default of type parameter `Start2T` refers to out-of-scope type parameter `StopT` [invalid-type-var] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_defaults_referential.py:60:11-15: Default of type parameter `S2` refers to out-of-scope type parameter `S1` [invalid-type-var] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_defaults_referential.py:66:30-32: Expected default `TypeVar[X1]` of `Ok1` to be assignable to the upper bound of `float` [invalid-type-var] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_defaults_referential.py:67:38-40: Expected default `TypeVar[X1]` of `AlsoOk1` to be assignable to the upper bound of `int` [invalid-type-var] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_defaults_referential.py:68:40-42: Expected default `TypeVar[X1]` of `Invalid1` to be assignable to the upper bound of `str` [invalid-type-var] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_defaults_referential.py:74:52-54: Expected default `TypeVar[Y1]` of `Invalid2` to be one of the following constraints: `float`, `str` [invalid-type-var] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_defaults_referential.py:77:54-56: Expected default `TypeVar[Y2]` of `AlsoOk2` to be one of the following constraints: `int`, `str`, `bool` [invalid-type-var] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_defaults_referential.py:78:63-65: Expected default `TypeVar[Y2]` of `AlsoInvalid2` to be one of the following constraints: `bool`, `complex` [invalid-type-var] +""" diff --git a/conformance/results/pyrefly/generics_defaults_specialization.toml b/conformance/results/pyrefly/generics_defaults_specialization.toml new file mode 100644 index 000000000..d89049e1b --- /dev/null +++ b/conformance/results/pyrefly/generics_defaults_specialization.toml @@ -0,0 +1,7 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_defaults_specialization.py:30:1-19: Expected 1 type argument for `MyAlias`, got 2 [bad-specialization] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_defaults_specialization.py:55:1-9: Expected 0 type arguments for `Foo`, got 1 [bad-specialization] +""" diff --git a/conformance/results/pyrefly/generics_paramspec_basic.toml b/conformance/results/pyrefly/generics_paramspec_basic.toml new file mode 100644 index 000000000..99912409b --- /dev/null +++ b/conformance/results/pyrefly/generics_paramspec_basic.toml @@ -0,0 +1,14 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_basic.py:10:13-31: ParamSpec must be assigned to a variable named `NotIt` [invalid-param-spec] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_basic.py:15:18-19: `ParamSpec[P]` is not allowed in this context [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_basic.py:23:14-15: `ParamSpec` is not allowed in this context [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_basic.py:23:20-21: `ParamSpec` is not allowed in this context [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_basic.py:27:14-33: `Concatenate[int, P]` is not allowed in this context [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_basic.py:31:14-21: `ParamSpec` cannot be used for type parameter [invalid-param-spec] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_basic.py:35:35-36: `ParamSpec` is not allowed in this context [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_basic.py:39:18-19: `ParamSpec` is not allowed in this context [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_basic.py:39:31-32: `ParamSpec` is not allowed in this context [invalid-annotation] +""" diff --git a/conformance/results/pyrefly/generics_paramspec_components.toml b/conformance/results/pyrefly/generics_paramspec_components.toml new file mode 100644 index 000000000..4c0782458 --- /dev/null +++ b/conformance/results/pyrefly/generics_paramspec_components.toml @@ -0,0 +1,29 @@ +conformant = "Partial" +notes = """ +Does not reject usage of args/kwargs for out-of-scope ParamSpec +""" +conformance_automated = "Fail" +errors_diff = """ +Line 30: Expected 1 errors +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_components.py:17:25-33: `ParamSpec` **kwargs is only allowed in a **kwargs annotation [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_components.py:17:45-51: `ParamSpec` *args is only allowed in an *args annotation [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_components.py:20:23-29: `ParamSpec` *args is only allowed in an *args annotation [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_components.py:23:5-24:13: `ParamSpec` *args and **kwargs must be used together [invalid-param-spec] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_components.py:23:46-52: `ParamSpec` *args is only allowed in an *args annotation [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_components.py:26:5-27:13: `ParamSpec` *args and **kwargs must be used together [invalid-param-spec] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_components.py:35:18-24: `ParamSpec` *args is only allowed in an *args annotation [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_components.py:36:20-28: `ParamSpec` **kwargs is only allowed in a **kwargs annotation [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_components.py:38:5-39:13: `ParamSpec` *args and **kwargs must be used together [invalid-param-spec] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_components.py:41:5-42:13: `ParamSpec` *args and **kwargs must be used together [invalid-param-spec] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_components.py:49:10-27: Expected *-unpacked P.args and **-unpacked P.kwargs [invalid-param-spec] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_components.py:51:11-12: Expected 0 positional arguments, got 1 [bad-argument-count] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_components.py:60:28-34: Keyword-only parameter `s` may not appear after ParamSpec args parameter [bad-function-definition] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_components.py:70:10-30: Expected *-unpacked P.args and **-unpacked P.kwargs [invalid-param-spec] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_components.py:72:10-27: Expected 1 more positional argument [bad-argument-count] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_components.py:83:13-14: Unexpected keyword argument `x` in function `foo` [unexpected-keyword] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_components.py:83:13-16: Expected 1 more positional argument in function `foo` [bad-argument-count] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_components.py:98:20-23: Argument `Literal['A']` is not assignable to parameter `a` with type `int` in function `twice` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_components.py:98:25-26: Argument `Literal[1]` is not assignable to parameter `b` with type `str` in function `twice` [bad-argument-type] +""" diff --git a/conformance/results/pyrefly/generics_paramspec_semantics.toml b/conformance/results/pyrefly/generics_paramspec_semantics.toml new file mode 100644 index 000000000..024db6d84 --- /dev/null +++ b/conformance/results/pyrefly/generics_paramspec_semantics.toml @@ -0,0 +1,16 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_semantics.py:26:4-5: Expected argument `a` to be positional [unexpected-keyword] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_semantics.py:26:11-12: Expected argument `b` to be positional [unexpected-keyword] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_semantics.py:27:9-12: Argument `Literal['A']` is not assignable to parameter `b` with type `bool` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_semantics.py:46:17-20: Argument `(y: int, x: str) -> int` is not assignable to parameter `y` with type `(x: int, y: str) -> int` in function `func1` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_semantics.py:61:23-37: Argument `(*, y: int) -> int` is not assignable to parameter `y` with type `(*, x: int) -> int` in function `func1` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_semantics.py:98:4-5: Argument `Literal[1]` is not assignable to parameter with type `str` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_semantics.py:108:4-5: Argument `Literal[1]` is not assignable to parameter `*args` with type `bool` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_semantics.py:120:4-5: Argument `Literal[1]` is not assignable to parameter with type `str` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_semantics.py:127:1-19: Argument `(x: str) -> int` is not assignable to parameter `x` with type `(int, ParamSpec(@_)) -> int` in function `expects_int_first` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_semantics.py:132:1-19: Argument `(*, x: int) -> int` is not assignable to parameter `x` with type `(int, ParamSpec(@_)) -> int` in function `expects_int_first` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_semantics.py:137:1-19: Argument `(**kwargs: int) -> int` is not assignable to parameter `x` with type `(int, ParamSpec(@_)) -> int` in function `expects_int_first` [bad-argument-type] +""" diff --git a/conformance/results/pyrefly/generics_paramspec_specialization.toml b/conformance/results/pyrefly/generics_paramspec_specialization.toml new file mode 100644 index 000000000..88c54566c --- /dev/null +++ b/conformance/results/pyrefly/generics_paramspec_specialization.toml @@ -0,0 +1,10 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_specialization.py:44:15-31: Expected a valid ParamSpec expression, got `int` [invalid-param-spec] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_specialization.py:54:9-11: Argument `Literal['']` is not assignable to parameter with type `int` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_specialization.py:55:16-18: Argument `Literal['']` is not assignable to parameter with type `bool` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_specialization.py:60:9-11: Argument `Literal['']` is not assignable to parameter with type `int` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_specialization.py:61:16-18: Argument `Literal['']` is not assignable to parameter with type `bool` [bad-argument-type] +""" diff --git a/conformance/results/pyrefly/generics_scoping.toml b/conformance/results/pyrefly/generics_scoping.toml new file mode 100644 index 000000000..e4c192fa1 --- /dev/null +++ b/conformance/results/pyrefly/generics_scoping.toml @@ -0,0 +1,19 @@ +conformant = "Partial" +notes = """ +Does not implement several scoping checks/restrictions for generics +""" +conformance_automated = "Fail" +errors_diff = """ +Line 50: Expected 1 errors +Line 54: Expected 1 errors +Line 75: Expected 1 errors +Line 78: Expected 1 errors +Line 87: Expected 1 errors +Line 94: Expected 1 errors +Line 95: Expected 1 errors +Line 96: Expected 1 errors +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_scoping.py:29:10-13: Argument `Literal['a']` is not assignable to parameter `x` with type `int` in function `MyClass.meth_2` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_scoping.py:65:11-20: Redundant type parameter declaration [invalid-type-var] +""" diff --git a/conformance/results/pyrefly/generics_self_advanced.toml b/conformance/results/pyrefly/generics_self_advanced.toml new file mode 100644 index 000000000..381cfcaa3 --- /dev/null +++ b/conformance/results/pyrefly/generics_self_advanced.toml @@ -0,0 +1,15 @@ +conformant = "Pass" +notes = """ +Treats attributes not initialized on the class as instance-only +""" +conformance_automated = "Fail" +errors_diff = """ +Line 43: Unexpected errors ['assert_type(Any, list[Self]) failed [assert-type]', 'Instance-only attribute `a` of class `ChildB` is not visible on the class [missing-attribute]'] +Line 44: Unexpected errors ['assert_type(Any, Self) failed [assert-type]', 'Instance-only attribute `a` of class `ChildB` is not visible on the class [missing-attribute]'] +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_self_advanced.py:43:20-39: assert_type(Any, list[Self]) failed [assert-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_self_advanced.py:43:21-26: Instance-only attribute `a` of class `ChildB` is not visible on the class [missing-attribute] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_self_advanced.py:44:20-36: assert_type(Any, Self) failed [assert-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_self_advanced.py:44:21-26: Instance-only attribute `a` of class `ChildB` is not visible on the class [missing-attribute] +""" diff --git a/conformance/results/pyrefly/generics_self_attributes.toml b/conformance/results/pyrefly/generics_self_attributes.toml new file mode 100644 index 000000000..ef6159750 --- /dev/null +++ b/conformance/results/pyrefly/generics_self_attributes.toml @@ -0,0 +1,11 @@ +conformant = "Partial" +notes = """ +Does not reject incorrect direct assignment to attribute w/ Self +""" +conformance_automated = "Fail" +errors_diff = """ +Line 32: Expected 1 errors +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_self_attributes.py:26:38-62: Argument `LinkedList[int]` is not assignable to parameter `next` with type `OrdinalLinkedList | None` in function `OrdinalLinkedList.__init__` [bad-argument-type] +""" diff --git a/conformance/results/pyrefly/generics_self_basic.toml b/conformance/results/pyrefly/generics_self_basic.toml new file mode 100644 index 000000000..5f0cfdd19 --- /dev/null +++ b/conformance/results/pyrefly/generics_self_basic.toml @@ -0,0 +1,12 @@ +conformant = "Partial" +notes = """ +Return annotation of Self allows returning the concrete instance of the current class. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 20: Expected 1 errors +Line 33: Expected 1 errors +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_self_basic.py:67:26-35: `type[Self@Container]` is not subscriptable [unsupported-operation] +""" diff --git a/conformance/results/pyrefly/generics_self_protocols.toml b/conformance/results/pyrefly/generics_self_protocols.toml new file mode 100644 index 000000000..5b4c54c56 --- /dev/null +++ b/conformance/results/pyrefly/generics_self_protocols.toml @@ -0,0 +1,13 @@ +conformant = "Partial" +notes = """ +Protocol subtyping does not work with Self in return annotation +""" +conformance_automated = "Fail" +errors_diff = """ +Line 58: Unexpected errors ['Argument `ReturnConcreteShape` is not assignable to parameter `shape` with type `ShapeProtocol` in function `accepts_shape` [bad-argument-type]'] +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_self_protocols.py:58:19-40: Argument `ReturnConcreteShape` is not assignable to parameter `shape` with type `ShapeProtocol` in function `accepts_shape` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_self_protocols.py:61:19-34: Argument `BadReturnType` is not assignable to parameter `shape` with type `ShapeProtocol` in function `accepts_shape` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_self_protocols.py:64:19-41: Argument `ReturnDifferentClass` is not assignable to parameter `shape` with type `ShapeProtocol` in function `accepts_shape` [bad-argument-type] +""" diff --git a/conformance/results/pyrefly/generics_self_usage.toml b/conformance/results/pyrefly/generics_self_usage.toml new file mode 100644 index 000000000..5394826c8 --- /dev/null +++ b/conformance/results/pyrefly/generics_self_usage.toml @@ -0,0 +1,20 @@ +conformant = "Partial" +notes = """ +Does not implement some restrictions on where Self can be used +""" +conformance_automated = "Fail" +errors_diff = """ +Line 73: Expected 1 errors +Line 76: Expected 1 errors +Line 82: Expected 1 errors +Line 86: Expected 1 errors +Line 101: Expected 1 errors +Line 106: Expected 1 errors +Line 111: Expected 1 errors +Line 116: Expected 1 errors +Line 121: Expected 1 errors +Line 125: Expected 1 errors +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_self_usage.py:103:12-16: Invalid base class: `Self` [invalid-inheritance] +""" diff --git a/conformance/results/pyrefly/generics_syntax_compatibility.toml b/conformance/results/pyrefly/generics_syntax_compatibility.toml new file mode 100644 index 000000000..8a9785fcf --- /dev/null +++ b/conformance/results/pyrefly/generics_syntax_compatibility.toml @@ -0,0 +1,9 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_syntax_compatibility.py:14:7-13: Class `ClassA` uses type variables not specified in `Generic` or `Protocol` base [invalid-type-var] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_syntax_compatibility.py:14:22-23: Type parameter K is not included in the type parameter list [invalid-type-var] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_syntax_compatibility.py:26:35-36: Type parameter K is not included in the type parameter list [invalid-type-var] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_syntax_compatibility.py:26:45-46: Type parameter K is not included in the type parameter list [invalid-type-var] +""" diff --git a/conformance/results/pyrefly/generics_syntax_declarations.toml b/conformance/results/pyrefly/generics_syntax_declarations.toml new file mode 100644 index 000000000..bce6e15af --- /dev/null +++ b/conformance/results/pyrefly/generics_syntax_declarations.toml @@ -0,0 +1,15 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_syntax_declarations.py:17:7-13: Redundant type parameter declaration [invalid-type-var] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_syntax_declarations.py:25:7-13: Redundant type parameter declaration [invalid-type-var] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_syntax_declarations.py:32:9-21: Object of class `str` has no attribute `is_integer` [missing-attribute] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_syntax_declarations.py:44:21-33: Type variable bounds and constraints must be concrete [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_syntax_declarations.py:48:17-27: Expected a type form, got instance of `list[type[int] | type[str]]` [not-a-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_syntax_declarations.py:60:17-19: Expected at least 2 constraints in TypeVar `T`, got 0 [invalid-type-var] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_syntax_declarations.py:64:17-23: Expected at least 2 constraints in TypeVar `T`, got 1 [invalid-type-var] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_syntax_declarations.py:71:17-19: Expected a type form, got instance of `tuple[type[bytes], type[str]]` [not-a-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_syntax_declarations.py:75:18-19: Expected a type form, got instance of `Literal[3]` [not-a-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_syntax_declarations.py:79:23-24: Could not find name `S` [unknown-name] +""" diff --git a/conformance/results/pyrefly/generics_syntax_infer_variance.toml b/conformance/results/pyrefly/generics_syntax_infer_variance.toml new file mode 100644 index 000000000..a1328db4b --- /dev/null +++ b/conformance/results/pyrefly/generics_syntax_infer_variance.toml @@ -0,0 +1,23 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_syntax_infer_variance.py:15:36-55: Contradictory variance specifications [invalid-type-var] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_syntax_infer_variance.py:17:40-59: Contradictory variance specifications [invalid-type-var] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_syntax_infer_variance.py:29:35-62: `ShouldBeCovariant1[float]` is not assignable to `ShouldBeCovariant1[int]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_syntax_infer_variance.py:37:35-62: `ShouldBeCovariant2[float]` is not assignable to `ShouldBeCovariant2[int]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_syntax_infer_variance.py:46:35-62: `ShouldBeCovariant3[float]` is not assignable to `ShouldBeCovariant3[int]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_syntax_infer_variance.py:75:34-64: `ShouldBeCovariant5[float]` is not assignable to `ShouldBeCovariant5[int]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_syntax_infer_variance.py:86:34-64: `ShouldBeCovariant6[float]` is not assignable to `ShouldBeCovariant6[int]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_syntax_infer_variance.py:102:38-64: `ShouldBeInvariant1[int]` is not assignable to `ShouldBeInvariant1[float]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_syntax_infer_variance.py:103:36-66: `ShouldBeInvariant1[float]` is not assignable to `ShouldBeInvariant1[int]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_syntax_infer_variance.py:117:38-64: `ShouldBeInvariant2[int]` is not assignable to `ShouldBeInvariant2[float]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_syntax_infer_variance.py:118:36-66: `ShouldBeInvariant2[float]` is not assignable to `ShouldBeInvariant2[int]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_syntax_infer_variance.py:125:43-73: `ShouldBeInvariant3[int, str]` is not assignable to `ShouldBeInvariant3[float, str]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_syntax_infer_variance.py:126:41-73: `ShouldBeInvariant3[float, str]` is not assignable to `ShouldBeInvariant3[int, str]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_syntax_infer_variance.py:127:43-73: `ShouldBeInvariant3[str, int]` is not assignable to `ShouldBeInvariant3[str, float]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_syntax_infer_variance.py:128:41-73: `ShouldBeInvariant3[str, float]` is not assignable to `ShouldBeInvariant3[str, int]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_syntax_infer_variance.py:136:38-64: `ShouldBeInvariant4[int]` is not assignable to `ShouldBeInvariant4[float]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_syntax_infer_variance.py:144:38-64: `ShouldBeInvariant5[int]` is not assignable to `ShouldBeInvariant5[float]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_syntax_infer_variance.py:155:45-75: `ShouldBeContravariant1[int]` is not assignable to `ShouldBeContravariant1[float]` [bad-assignment] +""" diff --git a/conformance/results/pyrefly/generics_syntax_scoping.toml b/conformance/results/pyrefly/generics_syntax_scoping.toml new file mode 100644 index 000000000..213931876 --- /dev/null +++ b/conformance/results/pyrefly/generics_syntax_scoping.toml @@ -0,0 +1,23 @@ +conformant = "Partial" +notes = """ +Does not implement some scoping restrictions for PEP695 generic syntax +""" +conformance_automated = "Fail" +errors_diff = """ +Line 92: Expected 1 errors +Line 95: Expected 1 errors +Line 98: Expected 1 errors +Line 66: Unexpected errors ['Found `S`, but it was not the global scope [unknown-name]'] +Line 67: Unexpected errors ['assert_type(Any, int) failed [assert-type]'] +Line 116: Unexpected errors ['assert_type(type[T], TypeVar) failed [assert-type]'] +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_syntax_scoping.py:14:20-31: Type variable bounds and constraints must be concrete [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_syntax_scoping.py:18:26-27: Expected a type form, got instance of `int` [not-a-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_syntax_scoping.py:35:7-8: `T` is uninitialized [unbound-name] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_syntax_scoping.py:44:17-18: `T` is uninitialized [unbound-name] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_syntax_scoping.py:44:17-18: Expected a type form, got instance of `int` [not-a-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_syntax_scoping.py:66:20-21: Found `S`, but it was not the global scope [unknown-name] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_syntax_scoping.py:67:24-32: assert_type(Any, int) failed [assert-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_syntax_scoping.py:116:24-36: assert_type(type[T], TypeVar) failed [assert-type] +""" diff --git a/conformance/results/pyrefly/generics_type_erasure.toml b/conformance/results/pyrefly/generics_type_erasure.toml new file mode 100644 index 000000000..8b46cceaf --- /dev/null +++ b/conformance/results/pyrefly/generics_type_erasure.toml @@ -0,0 +1,12 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_type_erasure.py:38:16-18: Argument `Literal['']` is not assignable to parameter `label` with type `int | None` in function `Node.__init__` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_type_erasure.py:40:16-17: Argument `Literal[0]` is not assignable to parameter `label` with type `str | None` in function `Node.__init__` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_type_erasure.py:42:1-16: Instance-only attribute `label` of class `Node` is not visible on the class [no-access] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_type_erasure.py:43:1-16: Instance-only attribute `label` of class `Node` is not visible on the class [missing-attribute] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_type_erasure.py:44:1-11: Instance-only attribute `label` of class `Node` is not visible on the class [no-access] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_type_erasure.py:45:1-11: Instance-only attribute `label` of class `Node` is not visible on the class [missing-attribute] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_type_erasure.py:46:1-15: Instance-only attribute `label` of class `Node` is not visible on the class [missing-attribute] +""" diff --git a/conformance/results/pyrefly/generics_typevartuple_args.toml b/conformance/results/pyrefly/generics_typevartuple_args.toml new file mode 100644 index 000000000..bc1953510 --- /dev/null +++ b/conformance/results/pyrefly/generics_typevartuple_args.toml @@ -0,0 +1,14 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_typevartuple_args.py:33:8-19: Unpacked argument `tuple[Literal[0], Literal['']]` is not assignable to parameter `*args` with type `tuple[*@_, Env]` in function `exec_le` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_typevartuple_args.py:34:8-30: Unpacked argument `tuple[Literal[0], Literal['']]` is not assignable to parameter `*args` with type `tuple[*@_, Env]` in function `exec_le` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_typevartuple_args.py:48:6-17: Unpacked argument `tuple[Literal[1], Literal['2'], Literal[3]]` is not assignable to parameter `*args` with type `tuple[int, ...]` in function `func1` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_typevartuple_args.py:57:6-16: Unpacked argument `tuple[Literal[1], Literal[1], Literal['']]` is not assignable to parameter `*args` with type `tuple[int, *tuple[str, ...], str]` in function `func2` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_typevartuple_args.py:58:6-9: Unpacked argument `tuple[Literal[1]]` is not assignable to parameter `*args` with type `tuple[int, *tuple[str, ...], str]` in function `func2` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_typevartuple_args.py:59:6-10: Unpacked argument `tuple[Literal['']]` is not assignable to parameter `*args` with type `tuple[int, *tuple[str, ...], str]` in function `func2` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_typevartuple_args.py:67:6-9: Unpacked argument `tuple[Literal[1]]` is not assignable to parameter `*args` with type `tuple[int, str]` in function `func3` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_typevartuple_args.py:75:13-19: Argument `tuple[Literal[1], Literal[2]]` is not assignable to parameter `*args` with type `tuple[int]` in function `func4` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_typevartuple_args.py:76:13-19: Argument `tuple[Literal['1']]` is not assignable to parameter `*args` with type `tuple[int]` in function `func4` [bad-argument-type] +""" diff --git a/conformance/results/pyrefly/generics_typevartuple_basic.toml b/conformance/results/pyrefly/generics_typevartuple_basic.toml new file mode 100644 index 000000000..960c490d7 --- /dev/null +++ b/conformance/results/pyrefly/generics_typevartuple_basic.toml @@ -0,0 +1,26 @@ +conformant = "Partial" +notes = """ +TypeVarTuple is pinned too early when calling generic function +""" +conformance_automated = "Fail" +errors_diff = """ +Line 85: Unexpected errors ['Argument `tuple[float]` is not assignable to parameter `arg2` with type `tuple[int]` in function `func2` [bad-argument-type]'] +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_typevartuple_basic.py:42:34-43: Argument `Height` is not assignable to parameter `shape` with type `tuple[Height, Width]` in function `Array.__init__` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_typevartuple_basic.py:43:41-61: Argument `tuple[Batch, Width]` is not assignable to parameter `shape` with type `tuple[Batch, Height, Width]` in function `Array.__init__` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_typevartuple_basic.py:45:5-45: Argument `tuple[Time, Batch, Width, Height]` is not assignable to parameter `shape` with type `tuple[Time, Batch, Height, Width]` in function `Array.__init__` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_typevartuple_basic.py:52:22-27: `TypeVarTuple` must be unpacked [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_typevartuple_basic.py:53:37-42: `TypeVarTuple` must be unpacked [invalid-type-var-tuple] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_typevartuple_basic.py:56:34-39: `TypeVarTuple` must be unpacked [invalid-type-var-tuple] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_typevartuple_basic.py:59:24-29: `TypeVarTuple` must be unpacked [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_typevartuple_basic.py:65:27-41: Unexpected keyword argument `covariant` to TypeVarTuple [invalid-type-var-tuple] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_typevartuple_basic.py:66:27-30: Unexpected positional argument to TypeVarTuple [invalid-type-var-tuple] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_typevartuple_basic.py:67:27-36: Unexpected keyword argument `bound` to TypeVarTuple [invalid-type-var-tuple] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_typevartuple_basic.py:85:13-19: Argument `tuple[float]` is not assignable to parameter `arg2` with type `tuple[int]` in function `func2` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_typevartuple_basic.py:89:13-19: Argument `tuple[Literal['0']]` is not assignable to parameter `arg2` with type `tuple[int]` in function `func2` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_typevartuple_basic.py:90:15-19: Argument `tuple[Literal[0]]` is not assignable to parameter `arg2` with type `tuple[int, int]` in function `func2` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_typevartuple_basic.py:99:17-18: Argument `Array[Width]` is not assignable to parameter `y` with type `Array[Height]` in function `multiply` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_typevartuple_basic.py:100:17-18: Argument `Array[Height, Width]` is not assignable to parameter `y` with type `Array[Height]` in function `multiply` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_typevartuple_basic.py:106:7-13: Type parameters for class may not have more than one TypeVarTuple [invalid-type-var-tuple] +""" diff --git a/conformance/results/pyrefly/generics_typevartuple_callable.toml b/conformance/results/pyrefly/generics_typevartuple_callable.toml new file mode 100644 index 000000000..b97ebfe02 --- /dev/null +++ b/conformance/results/pyrefly/generics_typevartuple_callable.toml @@ -0,0 +1,6 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_typevartuple_callable.py:26:28-35: Argument `tuple[Literal[''], Literal[0]]` is not assignable to parameter `args` with type `tuple[int, str]` in function `Process.__init__` [bad-argument-type] +""" diff --git a/conformance/results/pyrefly/generics_typevartuple_concat.toml b/conformance/results/pyrefly/generics_typevartuple_concat.toml new file mode 100644 index 000000000..69b21a57c --- /dev/null +++ b/conformance/results/pyrefly/generics_typevartuple_concat.toml @@ -0,0 +1,11 @@ +conformant = "Partial" +notes = """ +Fails to handle move_first_element_to_last example +""" +conformance_automated = "Fail" +errors_diff = """ +Line 56: Unexpected errors ['Returned type `tuple[*tuple[object | T, ...], object | T]` is not assignable to declared return type `tuple[*Ts, T]` [bad-return]'] +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_typevartuple_concat.py:56:12-30: Returned type `tuple[*tuple[object | T, ...], object | T]` is not assignable to declared return type `tuple[*Ts, T]` [bad-return] +""" diff --git a/conformance/results/pyrefly/generics_typevartuple_overloads.toml b/conformance/results/pyrefly/generics_typevartuple_overloads.toml new file mode 100644 index 000000000..cdd4d0cd9 --- /dev/null +++ b/conformance/results/pyrefly/generics_typevartuple_overloads.toml @@ -0,0 +1,5 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +""" diff --git a/conformance/results/pyrefly/generics_typevartuple_specialization.toml b/conformance/results/pyrefly/generics_typevartuple_specialization.toml new file mode 100644 index 000000000..308c9009f --- /dev/null +++ b/conformance/results/pyrefly/generics_typevartuple_specialization.toml @@ -0,0 +1,23 @@ +conformant = "Partial" +notes = """ +Sometimes specializes to tuple[Any, ...] instead of empty tuple +""" +conformance_automated = "Fail" +errors_diff = """ +Line 51: Unexpected errors ['assert_type(tuple[int, *tuple[Any, ...]], tuple[int]) failed [assert-type]'] +Line 94: Unexpected errors ['assert_type(tuple[float, *tuple[Any, ...]], tuple[float]) failed [assert-type]'] +Line 153: Unexpected errors ['Unpacked argument cannot be used for type parameter T1 [bad-unpacking]'] +Line 157: Unexpected errors ['assert_type(tuple[Any], tuple[*tuple[int, ...], int]) failed [assert-type]'] +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_typevartuple_specialization.py:51:16-31: assert_type(tuple[int, *tuple[Any, ...]], tuple[int]) failed [assert-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_typevartuple_specialization.py:94:16-33: assert_type(tuple[float, *tuple[Any, ...]], tuple[float]) failed [assert-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_typevartuple_specialization.py:109:1-21: Unpacked argument cannot be used for type parameter T [bad-unpacking] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_typevartuple_specialization.py:110:1-36: Unpacked argument cannot be used for type parameter T [bad-unpacking] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_typevartuple_specialization.py:121:26-29: Only one unbounded type is allowed to be unpacked [bad-unpacking] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_typevartuple_specialization.py:122:26-42: Only one unbounded type is allowed to be unpacked [bad-unpacking] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_typevartuple_specialization.py:127:5-13: Expected 3 type arguments for `TA7`, got 1 [bad-specialization] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_typevartuple_specialization.py:153:8-29: Unpacked argument cannot be used for type parameter T1 [bad-unpacking] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_typevartuple_specialization.py:157:16-49: assert_type(tuple[Any], tuple[*tuple[int, ...], int]) failed [assert-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_typevartuple_specialization.py:163:8-18: Unpacked argument cannot be used for type parameter T [bad-unpacking] +""" diff --git a/conformance/results/pyrefly/generics_typevartuple_unpack.toml b/conformance/results/pyrefly/generics_typevartuple_unpack.toml new file mode 100644 index 000000000..08c72ff17 --- /dev/null +++ b/conformance/results/pyrefly/generics_typevartuple_unpack.toml @@ -0,0 +1,6 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_typevartuple_unpack.py:30:28-29: Argument `Array[Batch]` is not assignable to parameter `x` with type `Array[Batch, *tuple[Any, ...], Channels]` in function `process_batch_channels` [bad-argument-type] +""" diff --git a/conformance/results/pyrefly/generics_upper_bound.toml b/conformance/results/pyrefly/generics_upper_bound.toml new file mode 100644 index 000000000..ca961ff66 --- /dev/null +++ b/conformance/results/pyrefly/generics_upper_bound.toml @@ -0,0 +1,14 @@ +conformant = "Partial" +notes = """ +Instantiation is not validated against bound +""" +conformance_automated = "Fail" +errors_diff = """ +Line 51: Expected 1 errors +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_upper_bound.py:24:38-45: Type variable bounds and constraints must be concrete [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_upper_bound.py:43:12-55: assert_type(list[int], list[int] | set[int]) failed [assert-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_upper_bound.py:43:25-31: Argument `set[int]` is not assignable to parameter `y` with type `list[int]` in function `longer` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_upper_bound.py:56:38-49: TypeVar cannot have both constraints and bound [invalid-type-var] +""" diff --git a/conformance/results/pyrefly/generics_variance.toml b/conformance/results/pyrefly/generics_variance.toml new file mode 100644 index 000000000..fd4f730c9 --- /dev/null +++ b/conformance/results/pyrefly/generics_variance.toml @@ -0,0 +1,19 @@ +conformant = "Unsupported" +conformance_automated = "Fail" +errors_diff = """ +Line 77: Expected 1 errors +Line 81: Expected 1 errors +Line 93: Expected 1 errors +Line 105: Expected 1 errors +Line 113: Expected 1 errors +Line 163: Expected 1 errors +Line 167: Expected 1 errors +Line 191: Expected 1 errors +Lines 125, 126: Expected error (tag 'CoContra_Child2') +Lines 131, 132: Expected error (tag 'CoContra_Child3') +Lines 141, 142: Expected error (tag 'CoContra_Child5') +Lines 195, 196: Expected error (tag 'ContraToContraToContra_WithTA') +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_variance.py:14:36-54: Contradictory variance specifications [invalid-type-var] +""" diff --git a/conformance/results/pyrefly/generics_variance_inference.toml b/conformance/results/pyrefly/generics_variance_inference.toml new file mode 100644 index 000000000..633f40536 --- /dev/null +++ b/conformance/results/pyrefly/generics_variance_inference.toml @@ -0,0 +1,28 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_variance_inference.py:24:33-35: `ClassA[float, int, int]` is not assignable to `ClassA[int, int, int]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_variance_inference.py:25:37-39: `ClassA[float, int, int]` is not assignable to `ClassA[float, float, int]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_variance_inference.py:28:33-35: `ClassA[int, float, float]` is not assignable to `ClassA[int, int, int]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_variance_inference.py:41:35-62: `ShouldBeCovariant1[float]` is not assignable to `ShouldBeCovariant1[int]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_variance_inference.py:49:35-62: `ShouldBeCovariant2[float]` is not assignable to `ShouldBeCovariant2[int]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_variance_inference.py:58:35-62: `ShouldBeCovariant3[float]` is not assignable to `ShouldBeCovariant3[int]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_variance_inference.py:67:34-62: `ShouldBeCovariant4[float]` is not assignable to `ShouldBeCovariant4[int]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_variance_inference.py:80:34-62: `ShouldBeCovariant5[float]` is not assignable to `ShouldBeCovariant5[int]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_variance_inference.py:96:38-64: `ShouldBeInvariant1[int]` is not assignable to `ShouldBeInvariant1[float]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_variance_inference.py:97:36-66: `ShouldBeInvariant1[float]` is not assignable to `ShouldBeInvariant1[int]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_variance_inference.py:111:38-64: `ShouldBeInvariant2[int]` is not assignable to `ShouldBeInvariant2[float]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_variance_inference.py:112:36-66: `ShouldBeInvariant2[float]` is not assignable to `ShouldBeInvariant2[int]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_variance_inference.py:119:43-73: `ShouldBeInvariant3[int, str]` is not assignable to `ShouldBeInvariant3[float, str]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_variance_inference.py:120:41-73: `ShouldBeInvariant3[float, str]` is not assignable to `ShouldBeInvariant3[int, str]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_variance_inference.py:121:43-73: `ShouldBeInvariant3[str, int]` is not assignable to `ShouldBeInvariant3[str, float]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_variance_inference.py:122:41-73: `ShouldBeInvariant3[str, float]` is not assignable to `ShouldBeInvariant3[str, int]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_variance_inference.py:130:38-64: `ShouldBeInvariant4[int]` is not assignable to `ShouldBeInvariant4[float]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_variance_inference.py:138:38-64: `ShouldBeInvariant5[int]` is not assignable to `ShouldBeInvariant5[float]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_variance_inference.py:149:45-75: `ShouldBeContravariant1[int]` is not assignable to `ShouldBeContravariant1[float]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_variance_inference.py:169:31-58: `ShouldBeInvariant6[float]` is not assignable to `ShouldBeInvariant6[int]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_variance_inference.py:170:33-58: `ShouldBeInvariant6[int]` is not assignable to `ShouldBeInvariant6[float]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_variance_inference.py:181:31-58: `ShouldBeCovariant6[float]` is not assignable to `ShouldBeCovariant6[int]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_variance_inference.py:194:37-66: `ShouldBeContravariant2[int]` is not assignable to `ShouldBeContravariant2[float]` [bad-assignment] +""" diff --git a/conformance/results/pyrefly/historical_positional.toml b/conformance/results/pyrefly/historical_positional.toml new file mode 100644 index 000000000..df75cc0f4 --- /dev/null +++ b/conformance/results/pyrefly/historical_positional.toml @@ -0,0 +1,9 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/historical_positional.py:18:4-7: Expected argument `__x` to be positional in function `f1` [unexpected-keyword] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/historical_positional.py:26:16-19: Positional-only parameter `__y` cannot appear after keyword parameters [bad-function-definition] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/historical_positional.py:38:26-29: Positional-only parameter `__y` cannot appear after keyword parameters [bad-function-definition] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/historical_positional.py:43:6-9: Expected argument `__x` to be positional in function `A.m1` [unexpected-keyword] +""" diff --git a/conformance/results/pyrefly/literals_interactions.toml b/conformance/results/pyrefly/literals_interactions.toml new file mode 100644 index 000000000..727d76a9a --- /dev/null +++ b/conformance/results/pyrefly/literals_interactions.toml @@ -0,0 +1,17 @@ +conformant = "Partial" +notes = """ +Two instances parameterized with different literals are not compatible +""" +conformance_automated = "Fail" +errors_diff = """ +Line 71: Unexpected errors ['`@` is not supported between `Matrix[Literal[2], Literal[3]]` and `Matrix[Literal[3], Literal[7]]` [unsupported-operation]'] +Line 72: Unexpected errors ['assert_type(Matrix[Literal[2], int], Matrix[Literal[2], Literal[7]]) failed [assert-type]'] +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/literals_interactions.py:15:5-9: Index 5 out of range for tuple with 3 elements [index-error] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/literals_interactions.py:16:5-9: Index -5 out of range for tuple with 3 elements [index-error] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/literals_interactions.py:17:5-9: Index 4 out of range for tuple with 3 elements [index-error] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/literals_interactions.py:18:5-10: Index -4 out of range for tuple with 3 elements [index-error] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/literals_interactions.py:71:9-14: `@` is not supported between `Matrix[Literal[2], Literal[3]]` and `Matrix[Literal[3], Literal[7]]` [unsupported-operation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/literals_interactions.py:72:16-51: assert_type(Matrix[Literal[2], int], Matrix[Literal[2], Literal[7]]) failed [assert-type] +""" diff --git a/conformance/results/pyrefly/literals_literalstring.toml b/conformance/results/pyrefly/literals_literalstring.toml new file mode 100644 index 000000000..fe8641132 --- /dev/null +++ b/conformance/results/pyrefly/literals_literalstring.toml @@ -0,0 +1,22 @@ +conformant = "Partial" +notes = """ +LiteralString is sometimes converted to str +""" +conformance_automated = "Fail" +errors_diff = """ +Line 120: Expected 1 errors +Line 111: Unexpected errors ["assert_type(str, Literal['hello']) failed [assert-type]"] +Line 116: Unexpected errors ['assert_type(str, LiteralString) failed [assert-type]'] +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/literals_literalstring.py:36:29-42: Invalid type inside literal, `LiteralString` [invalid-literal] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/literals_literalstring.py:37:22-35: Invalid type inside literal, `LiteralString` [invalid-literal] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/literals_literalstring.py:43:23-24: `Literal['two']` is not assignable to `Literal['']` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/literals_literalstring.py:66:25-47: `str` is not assignable to `LiteralString` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/literals_literalstring.py:74:25-26: `Literal[3]` is not assignable to `LiteralString` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/literals_literalstring.py:75:25-32: `Literal[b'test']` is not assignable to `LiteralString` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/literals_literalstring.py:111:16-37: assert_type(str, Literal['hello']) failed [assert-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/literals_literalstring.py:116:16-35: assert_type(str, LiteralString) failed [assert-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/literals_literalstring.py:134:51-52: Argument `str` is not assignable to parameter `value` with type `LiteralString` in function `Container.__init__` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/literals_literalstring.py:171:21-24: `list[LiteralString]` is not assignable to `list[str]` [bad-assignment] +""" diff --git a/conformance/results/pyrefly/literals_parameterizations.toml b/conformance/results/pyrefly/literals_parameterizations.toml new file mode 100644 index 000000000..2a9bce7dc --- /dev/null +++ b/conformance/results/pyrefly/literals_parameterizations.toml @@ -0,0 +1,22 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/literals_parameterizations.py:41:15-20: Invalid literal expression [invalid-literal] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/literals_parameterizations.py:42:15-38: Invalid literal expression [invalid-literal] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/literals_parameterizations.py:43:15-21: Invalid literal expression [invalid-literal] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/literals_parameterizations.py:44:15-17: Invalid literal expression [invalid-literal] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/literals_parameterizations.py:45:15-24: Invalid literal expression [invalid-literal] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/literals_parameterizations.py:46:7-33: `Literal` arguments cannot be parenthesized [invalid-literal] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/literals_parameterizations.py:47:15-35: Invalid literal expression [invalid-literal] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/literals_parameterizations.py:48:15-18: Invalid type inside literal, `int` [invalid-literal] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/literals_parameterizations.py:49:15-23: Expected a type form, got instance of `Literal[3]` [not-a-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/literals_parameterizations.py:50:16-17: Invalid type inside literal, `TypeVar[T]` [invalid-literal] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/literals_parameterizations.py:51:16-20: Invalid literal expression [invalid-literal] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/literals_parameterizations.py:52:16-19: Invalid type inside literal, `Any` [invalid-literal] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/literals_parameterizations.py:53:16-19: Invalid literal expression [invalid-literal] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/literals_parameterizations.py:56:28-33: Invalid literal expression [invalid-literal] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/literals_parameterizations.py:60:4-11: Expected a type argument for `Literal` [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/literals_parameterizations.py:61:12-23: Expected a type form, got instance of `(x: Unknown) -> int` [not-a-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/literals_parameterizations.py:65:32-33: `Literal[Color.RED]` is not assignable to `Literal['Color.RED']` [bad-assignment] +""" diff --git a/conformance/results/pyrefly/literals_semantics.toml b/conformance/results/pyrefly/literals_semantics.toml new file mode 100644 index 000000000..131f03821 --- /dev/null +++ b/conformance/results/pyrefly/literals_semantics.toml @@ -0,0 +1,9 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/literals_semantics.py:10:18-19: `Literal[4]` is not assignable to `Literal[3]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/literals_semantics.py:24:26-27: `Literal[0]` is not assignable to `Literal[False]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/literals_semantics.py:25:22-23: `Literal[False]` is not assignable to `Literal[0]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/literals_semantics.py:33:5-11: Augmented assignment produces a value of type `int`, which is not assignable to `Literal[3, 4, 5]` [bad-assignment] +""" diff --git a/conformance/results/pyrefly/namedtuples_define_class.toml b/conformance/results/pyrefly/namedtuples_define_class.toml new file mode 100644 index 000000000..2d79143f4 --- /dev/null +++ b/conformance/results/pyrefly/namedtuples_define_class.toml @@ -0,0 +1,17 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/namedtuples_define_class.py:32:7-12: Index 3 out of range for tuple with 3 elements [index-error] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/namedtuples_define_class.py:33:7-13: Index -4 out of range for tuple with 3 elements [index-error] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/namedtuples_define_class.py:44:11-14: Missing argument `y` in function `Point.__new__` [missing-argument] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/namedtuples_define_class.py:45:11-16: Missing argument `y` in function `Point.__new__` [missing-argument] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/namedtuples_define_class.py:46:15-17: Argument `Literal['']` is not assignable to parameter `y` with type `int` in function `Point.__new__` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/namedtuples_define_class.py:47:24-25: Argument `Literal[3]` is not assignable to parameter `units` with type `str` in function `Point.__new__` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/namedtuples_define_class.py:48:22-24: Expected 3 positional arguments, got 4 in function `Point.__new__` [bad-argument-count] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/namedtuples_define_class.py:49:23-28: Unexpected keyword argument `other` in function `Point.__new__` [unexpected-keyword] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/namedtuples_define_class.py:59:5-13: NamedTuple field 'latitude' without a default may not follow NamedTuple field with a default [bad-class-definition] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/namedtuples_define_class.py:79:5-6: Cannot override named tuple element `x` [bad-override] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/namedtuples_define_class.py:98:19-22: Argument `float` is not assignable to parameter `value` with type `str` in function `Property.__new__` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/namedtuples_define_class.py:105:7-11: Named tuples do not support multiple inheritance [invalid-inheritance] +""" diff --git a/conformance/results/pyrefly/namedtuples_define_functional.toml b/conformance/results/pyrefly/namedtuples_define_functional.toml new file mode 100644 index 000000000..3b25b4491 --- /dev/null +++ b/conformance/results/pyrefly/namedtuples_define_functional.toml @@ -0,0 +1,19 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/namedtuples_define_functional.py:16:14-19: Missing argument `y` in function `Point1.__new__` [missing-argument] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/namedtuples_define_functional.py:21:14-16: Missing argument `x` in function `Point2.__new__` [missing-argument] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/namedtuples_define_functional.py:21:14-16: Missing argument `y` in function `Point2.__new__` [missing-argument] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/namedtuples_define_functional.py:26:21-22: Expected 2 positional arguments, got 3 in function `Point3.__new__` [bad-argument-count] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/namedtuples_define_functional.py:31:14-22: Missing argument `y` in function `Point4.__new__` [missing-argument] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/namedtuples_define_functional.py:31:18-19: Unexpected keyword argument `z` in function `Point4.__new__` [unexpected-keyword] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/namedtuples_define_functional.py:36:18-21: Argument `Literal['1']` is not assignable to parameter `y` with type `int` in function `Point5.__new__` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/namedtuples_define_functional.py:37:21-22: Expected 2 positional arguments, got 3 in function `Point5.__new__` [bad-argument-count] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/namedtuples_define_functional.py:42:18-21: Argument `Literal['1']` is not assignable to parameter `y` with type `int` in function `Point6.__new__` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/namedtuples_define_functional.py:43:17-20: Argument `float` is not assignable to parameter `x` with type `int` in function `Point6.__new__` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/namedtuples_define_functional.py:52:31-34: Duplicate field `a` [bad-class-definition] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/namedtuples_define_functional.py:53:33-38: `def` is not a valid identifier [bad-class-definition] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/namedtuples_define_functional.py:54:33-38: `def` is not a valid identifier [bad-class-definition] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/namedtuples_define_functional.py:66:4-6: Missing argument `a` in function `NT5.__new__` [missing-argument] +""" diff --git a/conformance/results/pyrefly/namedtuples_type_compat.toml b/conformance/results/pyrefly/namedtuples_type_compat.toml new file mode 100644 index 000000000..1492f4542 --- /dev/null +++ b/conformance/results/pyrefly/namedtuples_type_compat.toml @@ -0,0 +1,7 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/namedtuples_type_compat.py:22:23-24: `Point` is not assignable to `tuple[int, int]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/namedtuples_type_compat.py:23:28-29: `Point` is not assignable to `tuple[int, str, str]` [bad-assignment] +""" diff --git a/conformance/results/pyrefly/namedtuples_usage.toml b/conformance/results/pyrefly/namedtuples_usage.toml new file mode 100644 index 000000000..46a3ae9b2 --- /dev/null +++ b/conformance/results/pyrefly/namedtuples_usage.toml @@ -0,0 +1,13 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/namedtuples_usage.py:34:7-11: Index 3 out of range for tuple with 3 elements [index-error] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/namedtuples_usage.py:35:7-12: Index -4 out of range for tuple with 3 elements [index-error] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/namedtuples_usage.py:40:1-4: Cannot set field `x` [read-only] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/namedtuples_usage.py:41:1-5: Cannot set item in `Point` [unsupported-operation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/namedtuples_usage.py:42:5-8: Cannot delete field `x` [read-only] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/namedtuples_usage.py:43:5-9: Cannot delete item in `Point` [unsupported-operation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/namedtuples_usage.py:52:1-7: Cannot unpack Point (of size 3) into 2 values [bad-unpacking] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/namedtuples_usage.py:53:1-21: Cannot unpack Point (of size 3) into 4 values [bad-unpacking] +""" diff --git a/conformance/results/pyrefly/narrowing_typeguard.toml b/conformance/results/pyrefly/narrowing_typeguard.toml new file mode 100644 index 000000000..3b09d650e --- /dev/null +++ b/conformance/results/pyrefly/narrowing_typeguard.toml @@ -0,0 +1,9 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/narrowing_typeguard.py:102:9-13: Type guard functions must accept at least one positional argument [bad-function-definition] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/narrowing_typeguard.py:107:9-13: Type guard functions must accept at least one positional argument [bad-function-definition] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/narrowing_typeguard.py:128:20-36: Argument `(val: object) -> TypeGuard[int]` is not assignable to parameter `f` with type `(object) -> str` in function `takes_callable_str` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/narrowing_typeguard.py:148:26-42: Argument `(val: object) -> TypeGuard[int]` is not assignable to parameter `f` with type `CallableStrProto` in function `takes_callable_str_proto` [bad-argument-type] +""" diff --git a/conformance/results/pyrefly/narrowing_typeis.toml b/conformance/results/pyrefly/narrowing_typeis.toml new file mode 100644 index 000000000..f4b482bc9 --- /dev/null +++ b/conformance/results/pyrefly/narrowing_typeis.toml @@ -0,0 +1,14 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/narrowing_typeis.py:105:9-13: Type guard functions must accept at least one positional argument [bad-function-definition] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/narrowing_typeis.py:110:9-13: Type guard functions must accept at least one positional argument [bad-function-definition] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/narrowing_typeis.py:132:20-36: Argument `(val: object) -> TypeIs[int]` is not assignable to parameter `f` with type `(object) -> str` in function `takes_callable_str` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/narrowing_typeis.py:152:26-42: Argument `(val: object) -> TypeIs[int]` is not assignable to parameter `f` with type `CallableStrProto` in function `takes_callable_str_proto` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/narrowing_typeis.py:169:17-30: Argument `(val: object) -> TypeIs[int]` is not assignable to parameter `f` with type `(object) -> TypeGuard[int]` in function `takes_typeguard` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/narrowing_typeis.py:170:14-30: Argument `(val: object) -> TypeGuard[int]` is not assignable to parameter `f` with type `(object) -> TypeIs[int]` in function `takes_typeis` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/narrowing_typeis.py:191:18-29: Argument `(val: object) -> TypeIs[bool]` is not assignable to parameter `f` with type `(object) -> TypeIs[int]` in function `takes_int_typeis` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/narrowing_typeis.py:195:5-15: Return type `str` must be assignable to the first argument type `int` [bad-function-definition] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/narrowing_typeis.py:199:5-24: Return type `list[int]` must be assignable to the first argument type `list[object]` [bad-function-definition] +""" diff --git a/conformance/results/pyrefly/overloads_basic.toml b/conformance/results/pyrefly/overloads_basic.toml new file mode 100644 index 000000000..9159cf6bd --- /dev/null +++ b/conformance/results/pyrefly/overloads_basic.toml @@ -0,0 +1,6 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/overloads_basic.py:39:1-6: Cannot index into `Bytes` [index-error] +""" diff --git a/conformance/results/pyrefly/overloads_consistency.toml b/conformance/results/pyrefly/overloads_consistency.toml new file mode 100644 index 000000000..89ee75305 --- /dev/null +++ b/conformance/results/pyrefly/overloads_consistency.toml @@ -0,0 +1,7 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/overloads_consistency.py:25:5-16: Overload return type `str` is not assignable to implementation return type `int` [invalid-overload] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/overloads_consistency.py:41:5-19: Implementation signature `(x: int) -> int | str` does not accept all arguments that overload signature `(x: str) -> str` accepts [invalid-overload] +""" diff --git a/conformance/results/pyrefly/overloads_definitions.toml b/conformance/results/pyrefly/overloads_definitions.toml new file mode 100644 index 000000000..76c89654d --- /dev/null +++ b/conformance/results/pyrefly/overloads_definitions.toml @@ -0,0 +1,24 @@ +conformant = "Partial" +notes = """ +Does not restrict some decorators to implementation +Does not require some decorators that need to appear on every overload +""" +conformance_automated = "Fail" +errors_diff = """ +Lines 71, 73, 78, 81: Expected error (tag 'func5') +Lines 121, 122, 123, 127: Expected error (tag 'invalid_final') +Lines 135, 136, 137, 141, 142: Expected error (tag 'invalid_final_2') +Lines 170, 175, 181, 183: Expected error (tag 'override-final') +Lines 220, 221, 222, 225, 226: Expected error (tag 'override_impl') +Line 49: Unexpected errors ['Overloaded function must have an implementation [invalid-overload]'] +Line 176: Unexpected errors ['`final_method` is declared as final in parent class `Base` [bad-override]'] +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/overloads_definitions.py:16:5-10: Overloaded function needs at least two @overload declarations [invalid-overload] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/overloads_definitions.py:28:5-10: Overloaded function must have an implementation [invalid-overload] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/overloads_definitions.py:49:9-14: Overloaded function must have an implementation [invalid-overload] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/overloads_definitions.py:59:9-21: Overloaded function must have an implementation [invalid-overload] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/overloads_definitions.py:90:9-14: Implementation signature `(cls: type[Self@C], *args: int | str) -> int | str` does not accept all arguments that overload signature `(self: Self@C, x: str, /) -> str` accepts [invalid-overload] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/overloads_definitions.py:176:9-21: `final_method` is declared as final in parent class `Base` [bad-override] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/overloads_definitions.py:191:9-21: Class member `Child.bad_override` is marked as an override, but no parent class has a matching attribute [bad-override] +""" diff --git a/conformance/results/pyrefly/overloads_definitions_stub.toml b/conformance/results/pyrefly/overloads_definitions_stub.toml new file mode 100644 index 000000000..c92e574e1 --- /dev/null +++ b/conformance/results/pyrefly/overloads_definitions_stub.toml @@ -0,0 +1,18 @@ +conformant = "Partial" +notes = """ +Does not restrict some decorators to the first overload +Does not require some decorators that need to appear on every overload +""" +conformance_automated = "Fail" +errors_diff = """ +Lines 32, 33, 37: Expected error (tag 'func5') +Lines 39, 41, 44: Expected error (tag 'func6') +Lines 67, 69, 71, 72, 73: Expected error (tag 'invalid_final') +Lines 80, 82, 84, 85, 86: Expected error (tag 'invalid_final_2') +Lines 143, 146, 147, 149: Expected error (tag 'override_impl') +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/overloads_definitions_stub.pyi:14:5-10: Overloaded function needs at least two @overload declarations [invalid-overload] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/overloads_definitions_stub.pyi:108:9-21: `final_method` is declared as final in parent class `Base` [bad-override] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/overloads_definitions_stub.pyi:122:9-21: Class member `Child.bad_override` is marked as an override, but no parent class has a matching attribute [bad-override] +""" diff --git a/conformance/results/pyrefly/overloads_evaluation.toml b/conformance/results/pyrefly/overloads_evaluation.toml new file mode 100644 index 000000000..227200a26 --- /dev/null +++ b/conformance/results/pyrefly/overloads_evaluation.toml @@ -0,0 +1,42 @@ +conformant = "Partial" +notes = """ +Does not exclude overloads based on arity first +Does not perform argument expansion +""" +conformance_automated = "Fail" +errors_diff = """ +Line 105: Unexpected errors ['No matching overload found for function `example2` [no-matching-overload]'] +Line 106: Unexpected errors ['assert_type(Any, int | str) failed [assert-type]'] +Line 134: Unexpected errors ['No matching overload found for function `expand_bool` [no-matching-overload]'] +Line 135: Unexpected errors ['assert_type(Any, Literal[0, 1]) failed [assert-type]'] +Line 160: Unexpected errors ['No matching overload found for function `expand_enum` [no-matching-overload]'] +Line 161: Unexpected errors ['assert_type(Any, Literal[0, 1]) failed [assert-type]'] +Line 180: Unexpected errors ['No matching overload found for function `expand_type_union` [no-matching-overload]'] +Line 181: Unexpected errors ['assert_type(Any, int | str) failed [assert-type]'] +Line 204: Unexpected errors ['No matching overload found for function `expand_tuple` [no-matching-overload]'] +Line 205: Unexpected errors ['assert_type(Any, int | str) failed [assert-type]'] +Line 234: Unexpected errors ['assert_type(str, int) failed [assert-type]'] +Line 264: Unexpected errors ['assert_type(list[int], Any) failed [assert-type]'] +Line 280: Unexpected errors ['assert_type(list[int], Any) failed [assert-type]'] +Line 345: Unexpected errors ['assert_type(list[int], Any) failed [assert-type]'] +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/overloads_evaluation.py:38:11-13: No matching overload found for function `example1_1` [no-matching-overload] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/overloads_evaluation.py:46:11-17: No matching overload found for function `example1_1` [no-matching-overload] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/overloads_evaluation.py:51:11-14: No matching overload found for function `example1_1` [no-matching-overload] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/overloads_evaluation.py:105:20-29: No matching overload found for function `example2` [no-matching-overload] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/overloads_evaluation.py:106:16-33: assert_type(Any, int | str) failed [assert-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/overloads_evaluation.py:115:13-22: No matching overload found for function `example2` [no-matching-overload] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/overloads_evaluation.py:134:23-26: No matching overload found for function `expand_bool` [no-matching-overload] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/overloads_evaluation.py:135:16-37: assert_type(Any, Literal[0, 1]) failed [assert-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/overloads_evaluation.py:160:23-26: No matching overload found for function `expand_enum` [no-matching-overload] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/overloads_evaluation.py:161:16-37: assert_type(Any, Literal[0, 1]) failed [assert-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/overloads_evaluation.py:180:29-32: No matching overload found for function `expand_type_union` [no-matching-overload] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/overloads_evaluation.py:181:16-33: assert_type(Any, int | str) failed [assert-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/overloads_evaluation.py:204:24-32: No matching overload found for function `expand_tuple` [no-matching-overload] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/overloads_evaluation.py:205:16-33: assert_type(Any, int | str) failed [assert-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/overloads_evaluation.py:234:16-27: assert_type(str, int) failed [assert-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/overloads_evaluation.py:264:16-27: assert_type(list[int], Any) failed [assert-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/overloads_evaluation.py:280:16-34: assert_type(list[int], Any) failed [assert-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/overloads_evaluation.py:345:16-27: assert_type(list[int], Any) failed [assert-type] +""" diff --git a/conformance/results/pyrefly/protocols_class_objects.toml b/conformance/results/pyrefly/protocols_class_objects.toml new file mode 100644 index 000000000..d1ba0e165 --- /dev/null +++ b/conformance/results/pyrefly/protocols_class_objects.toml @@ -0,0 +1,19 @@ +conformant = "Partial" +notes = """ +Does not require concrete classes to be passed to type[Proto] +""" +conformance_automated = "Fail" +errors_diff = """ +Line 29: Expected 1 errors +Line 34: Expected 1 errors +Line 104: Expected 1 errors +Line 106: Expected 1 errors +Line 107: Expected 1 errors +Line 108: Expected 1 errors +Line 26: Unexpected errors ['Cannot instantiate `Proto` because it is a protocol [bad-instantiation]'] +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_class_objects.py:26:15-17: Cannot instantiate `Proto` because it is a protocol [bad-instantiation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_class_objects.py:58:16-25: `type[ConcreteA]` is not assignable to `ProtoA1` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_class_objects.py:74:16-25: `type[ConcreteB]` is not assignable to `ProtoB1` [bad-assignment] +""" diff --git a/conformance/results/pyrefly/protocols_definition.toml b/conformance/results/pyrefly/protocols_definition.toml new file mode 100644 index 000000000..6806f75f3 --- /dev/null +++ b/conformance/results/pyrefly/protocols_definition.toml @@ -0,0 +1,33 @@ +conformant = "Partial" +notes = """ +Allows attributes defined by assignment via self in Protocols +Incorrectly handles some ClassVar examples in Protocol subtyping +""" +conformance_automated = "Fail" +errors_diff = """ +Line 67: Expected 1 errors +Line 116: Expected 1 errors +Line 117: Expected 1 errors +Line 79: Unexpected errors ['`Concrete` is not assignable to `Template` [bad-assignment]'] +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_definition.py:30:11-14: Argument `list[int]` is not assignable to parameter `things` with type `Iterable[SupportsClose]` in function `close_all` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_definition.py:79:17-38: `Concrete` is not assignable to `Template` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_definition.py:114:22-38: `Concrete2_Bad1` is not assignable to `Template2` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_definition.py:115:22-38: `Concrete2_Bad2` is not assignable to `Template2` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_definition.py:156:22-38: `Concrete3_Bad1` is not assignable to `Template3` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_definition.py:157:22-38: `Concrete3_Bad2` is not assignable to `Template3` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_definition.py:158:22-38: `Concrete3_Bad3` is not assignable to `Template3` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_definition.py:159:22-38: `Concrete3_Bad4` is not assignable to `Template3` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_definition.py:160:22-38: `Concrete3_Bad5` is not assignable to `Template3` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_definition.py:218:22-38: `Concrete4_Bad1` is not assignable to `Template4` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_definition.py:219:22-38: `Concrete4_Bad2` is not assignable to `Template4` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_definition.py:285:22-38: `Concrete5_Bad1` is not assignable to `Template5` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_definition.py:286:22-38: `Concrete5_Bad2` is not assignable to `Template5` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_definition.py:287:22-38: `Concrete5_Bad3` is not assignable to `Template5` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_definition.py:288:22-38: `Concrete5_Bad4` is not assignable to `Template5` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_definition.py:289:22-38: `Concrete5_Bad5` is not assignable to `Template5` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_definition.py:339:22-38: `Concrete6_Bad1` is not assignable to `Template6` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_definition.py:340:22-38: `Concrete6_Bad2` is not assignable to `Template6` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_definition.py:341:22-38: `Concrete6_Bad3` is not assignable to `Template6` [bad-assignment] +""" diff --git a/conformance/results/pyrefly/protocols_explicit.toml b/conformance/results/pyrefly/protocols_explicit.toml new file mode 100644 index 000000000..39f6df441 --- /dev/null +++ b/conformance/results/pyrefly/protocols_explicit.toml @@ -0,0 +1,16 @@ +conformant = "Unsupported" +notes = """ +Does not check against abstract class instantiations +""" +conformance_automated = "Fail" +errors_diff = """ +Line 27: Expected 1 errors +Line 60: Expected 1 errors +Line 90: Expected 1 errors +Line 110: Expected 1 errors +Line 135: Expected 1 errors +Line 165: Expected 1 errors +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_explicit.py:56:20-36: `tuple[int, int, str]` is not assignable to attribute `rgb` with type `tuple[int, int, int]` [bad-assignment] +""" diff --git a/conformance/results/pyrefly/protocols_generic.toml b/conformance/results/pyrefly/protocols_generic.toml new file mode 100644 index 000000000..bc8552904 --- /dev/null +++ b/conformance/results/pyrefly/protocols_generic.toml @@ -0,0 +1,20 @@ +conformant = "Partial" +notes = """ +Fails one protocol subtyping example involving @property +""" +conformance_automated = "Fail" +errors_diff = """ +Line 144: Unexpected errors ['`ConcreteHasProperty1` is not assignable to `HasPropertyProto` [bad-assignment]'] +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_generic.py:40:24-35: `Concrete1` is not assignable to `Proto1[int, str]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_generic.py:44:7-13: Class `Proto2` specifies type parameters in both `Generic` and `Protocol` bases [invalid-inheritance] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_generic.py:56:20-29: `Box[float]` is not assignable to `Box[int]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_generic.py:66:25-35: `Sender[int]` is not assignable to `Sender[float]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_generic.py:74:28-36: `AttrProto[int]` is not assignable to `AttrProto[float]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_generic.py:75:26-36: `AttrProto[float]` is not assignable to `AttrProto[int]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_generic.py:144:25-47: `ConcreteHasProperty1` is not assignable to `HasPropertyProto` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_generic.py:145:25-47: `ConcreteHasProperty2` is not assignable to `HasPropertyProto` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_generic.py:146:25-47: `ConcreteHasProperty3` is not assignable to `HasPropertyProto` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_generic.py:147:25-47: `ConcreteHasProperty4` is not assignable to `HasPropertyProto` [bad-assignment] +""" diff --git a/conformance/results/pyrefly/protocols_merging.toml b/conformance/results/pyrefly/protocols_merging.toml new file mode 100644 index 000000000..d1adf6778 --- /dev/null +++ b/conformance/results/pyrefly/protocols_merging.toml @@ -0,0 +1,15 @@ +conformant = "Partial" +notes = """ +Does not check against abstract class instantiations +""" +conformance_automated = "Fail" +errors_diff = """ +Line 82: Expected 1 errors +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_merging.py:52:25-38: `SCConcrete2` is not assignable to `SizedAndClosable1` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_merging.py:53:25-38: `SCConcrete2` is not assignable to `SizedAndClosable2` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_merging.py:54:25-38: `SCConcrete2` is not assignable to `SizedAndClosable3` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_merging.py:67:16-33: If `Protocol` is included as a base class, all other bases must be protocols [invalid-inheritance] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_merging.py:83:24-37: `SCConcrete1` is not assignable to `SizedAndClosable4` [bad-assignment] +""" diff --git a/conformance/results/pyrefly/protocols_modules.toml b/conformance/results/pyrefly/protocols_modules.toml new file mode 100644 index 000000000..1e9062ddd --- /dev/null +++ b/conformance/results/pyrefly/protocols_modules.toml @@ -0,0 +1,14 @@ +conformant = "Partial" +notes = """ +Fails one subtyping example of protocol modules +""" +conformance_automated = "Fail" +errors_diff = """ +Line 25: Unexpected errors ['`Module[_protocols_modules1]` is not assignable to `Options1` [bad-assignment]'] +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_modules.py:25:17-36: `Module[_protocols_modules1]` is not assignable to `Options1` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_modules.py:26:17-36: `Module[_protocols_modules1]` is not assignable to `Options2` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_modules.py:48:18-37: `Module[_protocols_modules2]` is not assignable to `Reporter2` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_modules.py:49:18-37: `Module[_protocols_modules2]` is not assignable to `Reporter3` [bad-assignment] +""" diff --git a/conformance/results/pyrefly/protocols_recursive.toml b/conformance/results/pyrefly/protocols_recursive.toml new file mode 100644 index 000000000..cdd4d0cd9 --- /dev/null +++ b/conformance/results/pyrefly/protocols_recursive.toml @@ -0,0 +1,5 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +""" diff --git a/conformance/results/pyrefly/protocols_runtime_checkable.toml b/conformance/results/pyrefly/protocols_runtime_checkable.toml new file mode 100644 index 000000000..17190f8a8 --- /dev/null +++ b/conformance/results/pyrefly/protocols_runtime_checkable.toml @@ -0,0 +1,15 @@ +conformant = "Partial" +notes = """ +Does not check for unsafe overlap in runtime_checkable protocols +""" +conformance_automated = "Fail" +errors_diff = """ +Line 88: Expected 1 errors +Line 92: Expected 1 errors +Line 96: Expected 1 errors +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_runtime_checkable.py:23:22-28: Protocol `Proto1` is not decorated with @runtime_checkable and cannot be used with isinstance() [invalid-argument] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_runtime_checkable.py:55:22-34: Protocol `DataProtocol` has non-method members and cannot be used with issubclass() [invalid-argument] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_runtime_checkable.py:61:22-53: Protocol `DataProtocol` has non-method members and cannot be used with issubclass() [invalid-argument] +""" diff --git a/conformance/results/pyrefly/protocols_self.toml b/conformance/results/pyrefly/protocols_self.toml new file mode 100644 index 000000000..75b057753 --- /dev/null +++ b/conformance/results/pyrefly/protocols_self.toml @@ -0,0 +1,13 @@ +conformant = "Partial" +notes = """ +Fails some protocol subtyping examples when self is annotated with a type var +""" +conformance_automated = "Fail" +errors_diff = """ +Line 32: Unexpected errors ['`One` is not assignable to variable `c` with type `Copyable` [bad-assignment]'] +Line 33: Unexpected errors ['`Other` is not assignable to variable `c` with type `Copyable` [bad-assignment]'] +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_self.py:32:5-10: `One` is not assignable to variable `c` with type `Copyable` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_self.py:33:5-12: `Other` is not assignable to variable `c` with type `Copyable` [bad-assignment] +""" diff --git a/conformance/results/pyrefly/protocols_subtyping.toml b/conformance/results/pyrefly/protocols_subtyping.toml new file mode 100644 index 000000000..cc40f3a6c --- /dev/null +++ b/conformance/results/pyrefly/protocols_subtyping.toml @@ -0,0 +1,12 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_subtyping.py:16:12-14: Cannot instantiate `Proto1` because it is a protocol [bad-instantiation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_subtyping.py:38:21-23: `Proto2` is not assignable to `Concrete2` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_subtyping.py:55:18-20: `Proto2` is not assignable to `Proto3` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_subtyping.py:79:30-36: `Proto5[int]` is not assignable to `Proto4[int, float]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_subtyping.py:80:25-31: `Proto4[int, int]` is not assignable to `Proto5[float]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_subtyping.py:102:30-32: `Proto6[float, float]` is not assignable to `Proto7[int, float]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_subtyping.py:103:33-35: `Proto6[float, float]` is not assignable to `Proto7[float, object]` [bad-assignment] +""" diff --git a/conformance/results/pyrefly/protocols_variance.toml b/conformance/results/pyrefly/protocols_variance.toml new file mode 100644 index 000000000..a9c170036 --- /dev/null +++ b/conformance/results/pyrefly/protocols_variance.toml @@ -0,0 +1,12 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 21: Expected 1 errors +Line 40: Expected 1 errors +Line 56: Expected 1 errors +Line 61: Expected 1 errors +Line 66: Expected 1 errors +Line 71: Expected 1 errors +Line 104: Expected 1 errors +""" +output = """ +""" diff --git a/conformance/results/pyrefly/qualifiers_annotated.toml b/conformance/results/pyrefly/qualifiers_annotated.toml new file mode 100644 index 000000000..21d1a3571 --- /dev/null +++ b/conformance/results/pyrefly/qualifiers_annotated.toml @@ -0,0 +1,31 @@ +conformant = "Partial" +notes = """ +Allows Annotated in some contexts where it should not be allowed +""" +conformance_automated = "Fail" +errors_diff = """ +Line 76: Expected 1 errors +Line 77: Expected 1 errors +Line 84: Expected 1 errors +Line 85: Expected 1 errors +Line 92: Expected 1 errors +Line 93: Expected 1 errors +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_annotated.py:43:17-27: list literal cannot be used in annotations [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_annotated.py:44:17-30: tuple literal cannot be used in annotations [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_annotated.py:45:17-40: list comprehension cannot be used in annotations [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_annotated.py:46:17-27: dict literal cannot be used in annotations [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_annotated.py:46:19-20: Could not find name `a` [unknown-name] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_annotated.py:46:24-25: Could not find name `b` [unknown-name] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_annotated.py:47:17-32: function call cannot be used in annotations [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_annotated.py:48:17-25: invalid subscript expression cannot be used in annotations [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_annotated.py:49:17-38: if expression cannot be used in annotations [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_annotated.py:50:17-21: Could not find name `var1` [unknown-name] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_annotated.py:51:17-21: bool literal cannot be used in annotations [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_annotated.py:52:18-19: number literal cannot be used in annotations [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_annotated.py:53:18-29: boolean operation cannot be used in annotations [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_annotated.py:54:18-28: f-string cannot be used in annotations [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_annotated.py:64:8-22: `Annotated` needs at least one piece of metadata in addition to the type [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_annotated.py:91:1-10: Expected a callable, got type[Annotated] [not-callable] +""" diff --git a/conformance/results/pyrefly/qualifiers_final_annotation.toml b/conformance/results/pyrefly/qualifiers_final_annotation.toml new file mode 100644 index 000000000..977f4458b --- /dev/null +++ b/conformance/results/pyrefly/qualifiers_final_annotation.toml @@ -0,0 +1,43 @@ +conformant = "Partial" +notes = """ +Final attributes not initialized on the class can be assigned to +""" +conformance_automated = "Fail" +errors_diff = """ +Line 34: Expected 1 errors +Line 38: Expected 1 errors +Line 62: Expected 1 errors +Line 63: Expected 1 errors +Line 107: Expected 1 errors +Line 149: Expected 1 errors +Line 152: Expected 1 errors +Line 155: Expected 1 errors +Line 166: Expected 1 errors +Line 170: Expected 1 errors +Line 131: Unexpected errors ['Expected first item to be a string literal [invalid-argument]', 'Expected first item to be a string literal [invalid-argument]'] +Line 133: Unexpected errors ['Unexpected keyword argument `x` in function `N.__new__` [unexpected-keyword]', 'Unexpected keyword argument `y` in function `N.__new__` [unexpected-keyword]'] +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_final_annotation.py:16:7-12: Expected a type argument for `Final` [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_final_annotation.py:18:7-22: Expected 1 type argument for `Final`, got 2 [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_final_annotation.py:54:9-17: Cannot set field `ID5` [read-only] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_final_annotation.py:65:9-17: Cannot set field `ID7` [read-only] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_final_annotation.py:67:9-17: Cannot set field `ID7` [read-only] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_final_annotation.py:71:8-11: `RATE` is marked final [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_final_annotation.py:81:1-18: Cannot set field `DEFAULT_ID` [read-only] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_final_annotation.py:94:5-17: `BORDER_WIDTH` is declared as final in parent class `ClassC` [bad-override] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_final_annotation.py:108:19-27: `ClassVar` may not be nested inside `Final` [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_final_annotation.py:118:9-19: `Final` is not allowed in this context [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_final_annotation.py:121:14-19: `Final` is only allowed on a class or local variable annotation [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_final_annotation.py:121:14-30: `Final` is not allowed in this context [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_final_annotation.py:131:23-24: Expected first item to be a string literal [invalid-argument] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_final_annotation.py:131:33-34: Expected first item to be a string literal [invalid-argument] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_final_annotation.py:133:3-4: Unexpected keyword argument `x` in function `N.__new__` [unexpected-keyword] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_final_annotation.py:133:8-9: Unexpected keyword argument `y` in function `N.__new__` [unexpected-keyword] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_final_annotation.py:134:3-4: Unexpected keyword argument `a` in function `N.__new__` [unexpected-keyword] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_final_annotation.py:135:3-4: Unexpected keyword argument `x` in function `N.__new__` [unexpected-keyword] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_final_annotation.py:135:9-10: Unexpected keyword argument `y` in function `N.__new__` [unexpected-keyword] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_final_annotation.py:141:11-12: `ID1` is marked final [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_final_annotation.py:145:5-11: Cannot assign to var x because it is marked final [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_final_annotation.py:147:15-16: Assignment target is marked final [bad-assignment] +""" diff --git a/conformance/results/pyrefly/qualifiers_final_decorator.toml b/conformance/results/pyrefly/qualifiers_final_decorator.toml new file mode 100644 index 000000000..58b20a00b --- /dev/null +++ b/conformance/results/pyrefly/qualifiers_final_decorator.toml @@ -0,0 +1,19 @@ +conformant = "Partial" +notes = """ +Does not ban final decorator on overload when implementation exists +""" +conformance_automated = "Fail" +errors_diff = """ +Lines 84, 85, 86: Expected error (tag 'Derived3-2') +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_final_decorator.py:21:16-21: Cannot extend final class `Base1` [invalid-inheritance] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_final_decorator.py:56:9-16: `method1` is declared as final in parent class `Base2` [bad-override] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_final_decorator.py:60:9-16: `method2` is declared as final in parent class `Base2` [bad-override] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_final_decorator.py:64:9-16: `method3` is declared as final in parent class `Base2` [bad-override] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_final_decorator.py:68:9-16: `method4` is declared as final in parent class `Base2` [bad-override] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_final_decorator.py:81:9-15: `method` is declared as final in parent class `Base3` [bad-override] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_final_decorator.py:95:9-15: `method` is declared as final in parent class `Base4` [bad-override] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_final_decorator.py:118:9-15: `method` is declared as final in parent class `Base5_2` [bad-override] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_final_decorator.py:125:1-7: Decorator `@final` can only be used on methods. [invalid-decorator] +""" diff --git a/conformance/results/pyrefly/specialtypes_any.toml b/conformance/results/pyrefly/specialtypes_any.toml new file mode 100644 index 000000000..cdd4d0cd9 --- /dev/null +++ b/conformance/results/pyrefly/specialtypes_any.toml @@ -0,0 +1,5 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +""" diff --git a/conformance/results/pyrefly/specialtypes_never.toml b/conformance/results/pyrefly/specialtypes_never.toml new file mode 100644 index 000000000..c650ba959 --- /dev/null +++ b/conformance/results/pyrefly/specialtypes_never.toml @@ -0,0 +1,14 @@ +conformant = "Partial" +notes = """ +Does not detect invalid return is unreachable +""" +conformance_automated = "Fail" +errors_diff = """ +Line 32: Unexpected errors ["Returned type `Literal['whatever works']` is not assignable to declared return type `int` [bad-return]"] +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/specialtypes_never.py:19:22-30: Function declared to return `NoReturn` but is missing an explicit `return` [bad-return] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/specialtypes_never.py:32:12-28: Returned type `Literal['whatever works']` is not assignable to declared return type `int` [bad-return] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/specialtypes_never.py:86:21-22: `list[Never]` is not assignable to `list[int]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/specialtypes_never.py:105:12-27: Returned type `ClassC[Never]` is not assignable to declared return type `ClassC[U]` [bad-return] +""" diff --git a/conformance/results/pyrefly/specialtypes_none.toml b/conformance/results/pyrefly/specialtypes_none.toml new file mode 100644 index 000000000..269facdf1 --- /dev/null +++ b/conformance/results/pyrefly/specialtypes_none.toml @@ -0,0 +1,8 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/specialtypes_none.py:21:7-17: Argument `type` is not assignable to parameter `val1` with type `None` in function `func1` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/specialtypes_none.py:27:19-23: `None` is not assignable to `Iterable[Unknown]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/specialtypes_none.py:41:7-11: Argument `None` is not assignable to parameter `val1` with type `type[None]` in function `func2` [bad-argument-type] +""" diff --git a/conformance/results/pyrefly/specialtypes_promotions.toml b/conformance/results/pyrefly/specialtypes_promotions.toml new file mode 100644 index 000000000..9106611aa --- /dev/null +++ b/conformance/results/pyrefly/specialtypes_promotions.toml @@ -0,0 +1,6 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/specialtypes_promotions.py:13:5-16: Object of class `float` has no attribute `numerator` [missing-attribute] +""" diff --git a/conformance/results/pyrefly/specialtypes_type.toml b/conformance/results/pyrefly/specialtypes_type.toml new file mode 100644 index 000000000..bfa048c1b --- /dev/null +++ b/conformance/results/pyrefly/specialtypes_type.toml @@ -0,0 +1,32 @@ +conformant = "Partial" +notes = """ +Does not implement all typing rules for type/type[] +""" +conformance_automated = "Fail" +errors_diff = """ +Line 70: Expected 1 errors +Line 84: Unexpected errors ['assert_type(type, type[Any]) failed [assert-type]'] +Line 99: Unexpected errors ['Object of class `type` has no attribute `unknown` [missing-attribute]'] +Line 100: Unexpected errors ['Object of class `type` has no attribute `unknown` [missing-attribute]'] +Line 102: Unexpected errors ['assert_type(Any, tuple[type, ...]) failed [assert-type]'] +Line 106: Unexpected errors ['assert_type(Any, tuple[type, ...]) failed [assert-type]'] +Line 110: Unexpected errors ['assert_type(Any, tuple[type, ...]) failed [assert-type]'] +Line 139: Unexpected errors ['assert_type(type, type[Any]) failed [assert-type]'] +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/specialtypes_type.py:56:7-15: Argument `type[TeamUser]` is not assignable to parameter `user_class` with type `type[BasicUser | ProUser]` in function `func4` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/specialtypes_type.py:76:12-26: Expected 1 type argument for `type`, got 2 [bad-specialization] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/specialtypes_type.py:84:16-30: assert_type(type, type[Any]) failed [assert-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/specialtypes_type.py:99:17-26: Object of class `type` has no attribute `unknown` [missing-attribute] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/specialtypes_type.py:100:17-26: Object of class `type` has no attribute `unknown` [missing-attribute] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/specialtypes_type.py:102:16-45: assert_type(Any, tuple[type, ...]) failed [assert-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/specialtypes_type.py:106:16-45: assert_type(Any, tuple[type, ...]) failed [assert-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/specialtypes_type.py:110:16-45: assert_type(Any, tuple[type, ...]) failed [assert-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/specialtypes_type.py:117:5-14: Class `object` has no class attribute `unknown` [missing-attribute] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/specialtypes_type.py:120:5-14: Class `object` has no class attribute `unknown` [missing-attribute] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/specialtypes_type.py:139:16-30: assert_type(type, type[Any]) failed [assert-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/specialtypes_type.py:143:1-12: TODO: Expr::attr_infer_for_type attribute base undefined for type: TypeAlias[TA1, type[type[Unknown]]] (trying to access unknown) [missing-attribute] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/specialtypes_type.py:144:1-12: TODO: Expr::attr_infer_for_type attribute base undefined for type: TypeAlias[TA2, type[type[Any]]] (trying to access unknown) [missing-attribute] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/specialtypes_type.py:145:1-12: Class `type` has no class attribute `unknown` [missing-attribute] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/specialtypes_type.py:146:1-12: TODO: Expr::attr_infer_for_type attribute base undefined for type: TypeAlias[TA4, type[type[Any]]] (trying to access unknown) [missing-attribute] +""" diff --git a/conformance/results/pyrefly/tuples_type_compat.toml b/conformance/results/pyrefly/tuples_type_compat.toml new file mode 100644 index 000000000..66afbaa76 --- /dev/null +++ b/conformance/results/pyrefly/tuples_type_compat.toml @@ -0,0 +1,29 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/tuples_type_compat.py:15:27-29: `tuple[float, complex]` is not assignable to `tuple[int, int]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/tuples_type_compat.py:29:10-12: `tuple[int, ...]` is not assignable to variable `v2` with type `tuple[int, *tuple[int, ...]]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/tuples_type_compat.py:32:10-12: `tuple[int, *tuple[int, ...]]` is not assignable to variable `v3` with type `tuple[int]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/tuples_type_compat.py:33:10-12: `tuple[int, ...]` is not assignable to variable `v3` with type `tuple[int]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/tuples_type_compat.py:43:22-24: `tuple[int, ...]` is not assignable to `tuple[int]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/tuples_type_compat.py:62:26-35: `tuple[int, ...]` is not assignable to `tuple[int, int]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/tuples_type_compat.py:76:20-37: assert_type(tuple[int], tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]) failed [assert-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/tuples_type_compat.py:81:20-37: assert_type(tuple[int, int] | tuple[str, str], tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]) failed [assert-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/tuples_type_compat.py:86:20-37: assert_type(tuple[int, str, int], tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]) failed [assert-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/tuples_type_compat.py:102:24-41: assert_type(tuple[int], tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]) failed [assert-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/tuples_type_compat.py:107:24-41: assert_type(tuple[int, int] | tuple[str, str], tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]) failed [assert-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/tuples_type_compat.py:112:24-41: assert_type(tuple[int, str, int], tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]) failed [assert-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/tuples_type_compat.py:126:24-53: assert_type(tuple[int | str, int | str], tuple[int | str, str]) failed [assert-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/tuples_type_compat.py:129:24-53: assert_type(tuple[int | str, int | str], tuple[int | str, int]) failed [assert-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/tuples_type_compat.py:157:6-17: `tuple[Literal[1], Literal[''], Literal['']]` is not assignable to variable `t1` with type `tuple[int, str]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/tuples_type_compat.py:162:6-16: `tuple[Literal[1], Literal[1], Literal['']]` is not assignable to variable `t2` with type `tuple[int, *tuple[str, ...]]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/tuples_type_compat.py:163:6-16: `tuple[Literal[1], Literal[''], Literal[1]]` is not assignable to variable `t2` with type `tuple[int, *tuple[str, ...]]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/tuples_type_compat.py:169:6-17: `tuple[Literal[1], Literal[''], Literal['']]` is not assignable to variable `t3` with type `tuple[int, *tuple[str, ...], int]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/tuples_type_compat.py:170:6-22: `tuple[Literal[1], Literal[''], Literal[''], float]` is not assignable to variable `t3` with type `tuple[int, *tuple[str, ...], int]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/tuples_type_compat.py:175:6-16: `tuple[Literal[1], Literal[''], Literal[1]]` is not assignable to variable `t4` with type `tuple[*tuple[str, ...], int]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/tuples_type_compat.py:176:6-19: `tuple[Literal[''], Literal[''], float]` is not assignable to variable `t4` with type `tuple[*tuple[str, ...], int]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/tuples_type_compat.py:181:40-41: `tuple[str, str]` is not assignable to `tuple[str, str, int]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/tuples_type_compat.py:184:50-51: `tuple[str, str]` is not assignable to `tuple[str, str, str, *tuple[str, ...]]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/tuples_type_compat.py:188:50-51: `tuple[str, str]` is not assignable to `tuple[*tuple[str, ...], str, str, str]` [bad-assignment] +""" diff --git a/conformance/results/pyrefly/tuples_type_form.toml b/conformance/results/pyrefly/tuples_type_form.toml new file mode 100644 index 000000000..b61a3f3fd --- /dev/null +++ b/conformance/results/pyrefly/tuples_type_form.toml @@ -0,0 +1,16 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/tuples_type_form.py:12:6-12: `tuple[Literal[1], Literal[2]]` is not assignable to variable `t1` with type `tuple[int]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/tuples_type_form.py:14:6-10: `tuple[Literal[1]]` is not assignable to variable `t2` with type `tuple[int, int]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/tuples_type_form.py:15:6-13: `tuple[Literal[1], Literal['']]` is not assignable to variable `t2` with type `tuple[int, int]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/tuples_type_form.py:25:7-11: `tuple[Literal[1]]` is not assignable to variable `t10` with type `tuple[()]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/tuples_type_form.py:36:7-20: `tuple[Literal[1], Literal[2], Literal[3], Literal['']]` is not assignable to variable `t20` with type `tuple[int, ...]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/tuples_type_form.py:40:22-25: Invalid position for `...` [invalid-argument] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/tuples_type_form.py:41:12-15: Invalid position for `...` [invalid-argument] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/tuples_type_form.py:42:12-15: Invalid position for `...` [invalid-argument] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/tuples_type_form.py:43:17-20: Invalid position for `...` [invalid-argument] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/tuples_type_form.py:44:25-28: `...` cannot be used with an unpacked `TypeVarTuple` or tuple [invalid-argument] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/tuples_type_form.py:45:30-33: Invalid position for `...` [invalid-argument] +""" diff --git a/conformance/results/pyrefly/tuples_unpacked.toml b/conformance/results/pyrefly/tuples_unpacked.toml new file mode 100644 index 000000000..9aed44584 --- /dev/null +++ b/conformance/results/pyrefly/tuples_unpacked.toml @@ -0,0 +1,10 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/tuples_unpacked.py:40:29-45: Only one unbounded type is allowed to be unpacked [bad-unpacking] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/tuples_unpacked.py:41:42-58: Only one unbounded type is allowed to be unpacked [bad-unpacking] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/tuples_unpacked.py:51:33-36: Only one unbounded type is allowed to be unpacked [bad-unpacking] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/tuples_unpacked.py:59:37-60: Only one unbounded type is allowed to be unpacked [bad-unpacking] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/tuples_unpacked.py:61:50-73: Only one unbounded type is allowed to be unpacked [bad-unpacking] +""" diff --git a/conformance/results/pyrefly/typeddicts_alt_syntax.toml b/conformance/results/pyrefly/typeddicts_alt_syntax.toml new file mode 100644 index 000000000..f2007d8e4 --- /dev/null +++ b/conformance/results/pyrefly/typeddicts_alt_syntax.toml @@ -0,0 +1,16 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_alt_syntax.py:23:1-14: Expected valid functional typed dictionary definition [invalid-argument] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_alt_syntax.py:27:45-46: Expected first item to be a string literal [invalid-argument] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_alt_syntax.py:31:27-38: Expected string literal "BadTypedDict3" [invalid-argument] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_alt_syntax.py:35:72-83: Unrecognized argument `other` for typed dictionary definition [invalid-argument] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_alt_syntax.py:41:1-7: Expected valid functional typed dictionary definition [invalid-argument] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_alt_syntax.py:41:30-38: Unrecognized argument `name` for typed dictionary definition [invalid-argument] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_alt_syntax.py:41:40-48: Unrecognized argument `year` for typed dictionary definition [invalid-argument] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_alt_syntax.py:44:11-17: Key `name` is not defined in TypedDict `Movie2` [typed-dict-key-error] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_alt_syntax.py:44:35-41: Key `year` is not defined in TypedDict `Movie2` [typed-dict-key-error] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_alt_syntax.py:45:11-17: Key `name` is not defined in TypedDict `Movie2` [typed-dict-key-error] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_alt_syntax.py:45:35-41: Key `year` is not defined in TypedDict `Movie2` [typed-dict-key-error] +""" diff --git a/conformance/results/pyrefly/typeddicts_class_syntax.toml b/conformance/results/pyrefly/typeddicts_class_syntax.toml new file mode 100644 index 000000000..27ade3f1b --- /dev/null +++ b/conformance/results/pyrefly/typeddicts_class_syntax.toml @@ -0,0 +1,10 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_class_syntax.py:29:9-16: TypedDict item `method1` may not be initialized [bad-class-definition] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_class_syntax.py:34:9-16: TypedDict item `method2` may not be initialized [bad-class-definition] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_class_syntax.py:39:9-16: TypedDict item `method3` may not be initialized [bad-class-definition] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_class_syntax.py:44:7-20: Typed dictionary definitions may not specify a metaclass [invalid-inheritance] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_class_syntax.py:49:7-20: TypedDict does not support keyword argument `other` [bad-typed-dict] +""" diff --git a/conformance/results/pyrefly/typeddicts_extra_items.toml b/conformance/results/pyrefly/typeddicts_extra_items.toml new file mode 100644 index 000000000..f4aa5ce87 --- /dev/null +++ b/conformance/results/pyrefly/typeddicts_extra_items.toml @@ -0,0 +1,56 @@ +conformant = "Partial" +notes = """ +Does not fully support extra_items for typed dicts +""" +conformance_automated = "Fail" +errors_diff = """ +Line 129: Unexpected errors ['TypedDict `MovieEI` does not have key `year` [typed-dict-key-error]'] +Line 144: Unexpected errors ['Unexpected keyword argument `year` in function `unpack_extra` [unexpected-keyword]'] +Line 300: Unexpected errors ['`TypedDict[MovieExtraStr]` is not assignable to `Mapping[str, str]` [bad-assignment]'] +Line 304: Unexpected errors ['`TypedDict[MovieExtraInt]` is not assignable to `Mapping[str, int | str]` [bad-assignment]'] +Line 326: Unexpected errors ['`TypedDict[IntDict]` is not assignable to `dict[str, int]` [bad-assignment]'] +Line 330: Unexpected errors ['`TypedDict[IntDictWithNum]` is not assignable to `dict[str, int]` [bad-assignment]'] +Line 337: Unexpected errors ['Object of class `IntDictWithNum` has no attribute `clear` [missing-attribute]'] +Line 339: Unexpected errors ['assert_type(Any, tuple[str, int]) failed [assert-type]', 'Object of class `IntDictWithNum` has no attribute `popitem` [missing-attribute]'] +Line 343: Unexpected errors ['Cannot delete item in `TypedDict[IntDictWithNum]` [unsupported-operation]'] +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_extra_items.py:15:45-49: `Literal[1982]` is not assignable to TypedDict `extra_items` type `bool` [typed-dict-key-error] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_extra_items.py:22:55-59: `Literal[1982]` is not assignable to TypedDict `extra_items` type `bool` [typed-dict-key-error] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_extra_items.py:39:54-58: `None` is not assignable to TypedDict key `year` with type `int` [typed-dict-key-error] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_extra_items.py:49:7-16: Expected literal True or False for keyword `closed`, got instance of `bool` [bad-typed-dict] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_extra_items.py:67:7-20: Non-closed TypedDict cannot inherit from closed TypedDict `ClosedBase` [bad-typed-dict] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_extra_items.py:73:7-20: Non-closed TypedDict cannot inherit from TypedDict `ExtraItemsBase` with extra items [bad-typed-dict] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_extra_items.py:92:5-8: Cannot extend closed TypedDict `MovieA` with extra item `age` [typed-dict-key-error] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_extra_items.py:95:5-8: Cannot extend closed TypedDict `MovieB` with extra item `age` [typed-dict-key-error] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_extra_items.py:109:7-30: Closed TypedDict cannot inherit from TypedDict `ExtraItemsBase` with non-read-only extra items [bad-typed-dict] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_extra_items.py:114:50-63: `Required` is not allowed in this context [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_extra_items.py:117:57-73: `NotRequired` is not allowed in this context [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_extra_items.py:128:15-21: Key `name` in TypedDict `MovieEI` may not be deleted [delete-error] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_extra_items.py:129:15-21: TypedDict `MovieEI` does not have key `year` [typed-dict-key-error] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_extra_items.py:143:48-52: Unexpected keyword argument `year` in function `unpack_no_extra` [unexpected-keyword] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_extra_items.py:144:45-49: Unexpected keyword argument `year` in function `unpack_extra` [unexpected-keyword] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_extra_items.py:174:7-12: Cannot change the non-read-only extra items type of TypedDict `Parent` [bad-typed-dict] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_extra_items.py:185:5-9: TypedDict `MovieBase2` with non-read-only `extra_items` cannot be extended with required extra item `year` [typed-dict-key-error] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_extra_items.py:188:5-9: `int` is not consistent with `extra_items` type `int | None` of TypedDict `MovieBase2` [typed-dict-key-error] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_extra_items.py:197:5-14: `str` is not assignable to `extra_items` type `int | None` of TypedDict `BookBase` [typed-dict-key-error] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_extra_items.py:215:22-30: `TypedDict[MovieDetails]` is not assignable to `TypedDict[MovieBase2]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_extra_items.py:222:22-30: `TypedDict[MovieWithYear2]` is not assignable to `TypedDict[MovieBase2]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_extra_items.py:242:19-27: `TypedDict[MovieDetails5]` is not assignable to `TypedDict[MovieSI]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_extra_items.py:256:13-22: `TypedDict[MovieExtraStr]` is not assignable to variable `extra_int` with type `TypedDict[MovieExtraInt]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_extra_items.py:257:13-22: `TypedDict[MovieExtraInt]` is not assignable to variable `extra_str` with type `TypedDict[MovieExtraStr]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_extra_items.py:268:14-24: `TypedDict[MovieNotClosed]` is not assignable to variable `extra_int2` with type `TypedDict[MovieExtraInt]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_extra_items.py:278:47-51: Unexpected keyword argument `year` in function `NonClosedMovie.__init__` [unexpected-keyword] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_extra_items.py:285:52-61: Keyword argument `language` with type `Literal['English']` is not assignable to kwargs type `int` in function `ExtraMovie.__init__` [bad-argument-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_extra_items.py:293:44-48: Unexpected keyword argument `year` in function `ClosedMovie.__init__` [unexpected-keyword] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_extra_items.py:300:34-44: `TypedDict[MovieExtraStr]` is not assignable to `Mapping[str, str]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_extra_items.py:303:34-44: `TypedDict[MovieExtraInt]` is not assignable to `Mapping[str, int]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_extra_items.py:304:44-54: `TypedDict[MovieExtraInt]` is not assignable to `Mapping[str, int | str]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_extra_items.py:326:25-26: `TypedDict[IntDict]` is not assignable to `dict[str, int]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_extra_items.py:330:32-53: `TypedDict[IntDictWithNum]` is not assignable to `dict[str, int]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_extra_items.py:337:1-28: Object of class `IntDictWithNum` has no attribute `clear` [missing-attribute] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_extra_items.py:339:12-62: assert_type(Any, tuple[str, int]) failed [assert-type] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_extra_items.py:339:13-42: Object of class `IntDictWithNum` has no attribute `popitem` [missing-attribute] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_extra_items.py:343:9-35: Cannot delete item in `TypedDict[IntDictWithNum]` [unsupported-operation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_extra_items.py:352:25-52: `dict[str, int]` is not assignable to `TypedDict[IntDict]` [bad-assignment] +""" diff --git a/conformance/results/pyrefly/typeddicts_final.toml b/conformance/results/pyrefly/typeddicts_final.toml new file mode 100644 index 000000000..cdd4d0cd9 --- /dev/null +++ b/conformance/results/pyrefly/typeddicts_final.toml @@ -0,0 +1,5 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +""" diff --git a/conformance/results/pyrefly/typeddicts_inheritance.toml b/conformance/results/pyrefly/typeddicts_inheritance.toml new file mode 100644 index 000000000..60a912381 --- /dev/null +++ b/conformance/results/pyrefly/typeddicts_inheritance.toml @@ -0,0 +1,12 @@ +conformant = "Partial" +notes = """ +Does not check against inconsistent multiple inheritance +""" +conformance_automated = "Fail" +errors_diff = """ +Line 65: Expected 1 errors +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_inheritance.py:44:7-19: `NonTypedDict` is not a typed dictionary. Typed dictionary definitions may only extend other typed dictionaries. [invalid-inheritance] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_inheritance.py:55:4-5: Class member `Y1.x` overrides parent class `X1` in an inconsistent manner [bad-override] +""" diff --git a/conformance/results/pyrefly/typeddicts_operations.toml b/conformance/results/pyrefly/typeddicts_operations.toml new file mode 100644 index 000000000..fb103ce94 --- /dev/null +++ b/conformance/results/pyrefly/typeddicts_operations.toml @@ -0,0 +1,17 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_operations.py:22:17-21: `Literal[1982]` is not assignable to TypedDict key `name` with type `str` [typed-dict-key-error] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_operations.py:23:17-19: `Literal['']` is not assignable to TypedDict key `year` with type `int` [typed-dict-key-error] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_operations.py:24:7-14: TypedDict `Movie` does not have key `other` [typed-dict-key-error] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_operations.py:26:13-20: TypedDict `Movie` does not have key `other` [typed-dict-key-error] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_operations.py:28:9-33: Missing required key `year` for TypedDict `Movie` [typed-dict-key-error] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_operations.py:29:42-48: `float` is not assignable to TypedDict key `year` with type `int` [typed-dict-key-error] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_operations.py:32:36-43: Key `other` is not defined in TypedDict `Movie` [typed-dict-key-error] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_operations.py:37:20-52: Missing required key `name` for TypedDict `Movie` [typed-dict-key-error] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_operations.py:37:21-33: Expected string literal key, got `str` [typed-dict-key-error] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_operations.py:47:1-12: Object of class `Movie` has no attribute `clear` [missing-attribute] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_operations.py:49:11-17: Key `name` in TypedDict `Movie` may not be deleted [delete-error] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_operations.py:62:1-21: Object of class `MovieOptional` has no attribute `clear` [missing-attribute] +""" diff --git a/conformance/results/pyrefly/typeddicts_readonly.toml b/conformance/results/pyrefly/typeddicts_readonly.toml new file mode 100644 index 000000000..1f81634cc --- /dev/null +++ b/conformance/results/pyrefly/typeddicts_readonly.toml @@ -0,0 +1,11 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_readonly.py:24:1-14: Key `members` in TypedDict `Band` is read-only [read-only] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_readonly.py:36:1-14: Key `members` in TypedDict `Band2` is read-only [read-only] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_readonly.py:50:1-12: Key `title` in TypedDict `Movie1` is read-only [read-only] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_readonly.py:51:1-11: Key `year` in TypedDict `Movie1` is read-only [read-only] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_readonly.py:60:1-12: Key `title` in TypedDict `Movie2` is read-only [read-only] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_readonly.py:61:1-11: Key `year` in TypedDict `Movie2` is read-only [read-only] +""" diff --git a/conformance/results/pyrefly/typeddicts_readonly_consistency.toml b/conformance/results/pyrefly/typeddicts_readonly_consistency.toml new file mode 100644 index 000000000..6ac703eb9 --- /dev/null +++ b/conformance/results/pyrefly/typeddicts_readonly_consistency.toml @@ -0,0 +1,12 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_readonly_consistency.py:37:14-15: `TypedDict[A1]` is not assignable to `TypedDict[B1]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_readonly_consistency.py:38:14-15: `TypedDict[C1]` is not assignable to `TypedDict[B1]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_readonly_consistency.py:40:14-15: `TypedDict[A1]` is not assignable to `TypedDict[C1]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_readonly_consistency.py:81:14-15: `TypedDict[A2]` is not assignable to `TypedDict[B2]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_readonly_consistency.py:82:14-15: `TypedDict[C2]` is not assignable to `TypedDict[B2]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_readonly_consistency.py:84:14-15: `TypedDict[A2]` is not assignable to `TypedDict[C2]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_readonly_consistency.py:85:14-15: `TypedDict[B2]` is not assignable to `TypedDict[C2]` [bad-assignment] +""" diff --git a/conformance/results/pyrefly/typeddicts_readonly_inheritance.toml b/conformance/results/pyrefly/typeddicts_readonly_inheritance.toml new file mode 100644 index 000000000..5041a6dc4 --- /dev/null +++ b/conformance/results/pyrefly/typeddicts_readonly_inheritance.toml @@ -0,0 +1,20 @@ +conformant = "Partial" +notes = """ +Does not restrictions around overriding for ReadOnly fields +""" +conformance_automated = "Fail" +errors_diff = """ +Line 98: Expected 1 errors +Line 106: Expected 1 errors +Line 119: Expected 1 errors +Line 132: Expected 1 errors +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_readonly_inheritance.py:36:1-11: Key `name` in TypedDict `Album2` is read-only [read-only] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_readonly_inheritance.py:50:5-8: Class member `RecordShop.alt` overrides parent class `AlbumCollection` in an inconsistent manner [bad-override] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_readonly_inheritance.py:65:19-21: Missing required key `name` for TypedDict `RequiredName` [typed-dict-key-error] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_readonly_inheritance.py:82:14-15: `Literal[3]` is not assignable to TypedDict key `ident` with type `str` [typed-dict-key-error] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_readonly_inheritance.py:83:15-16: `Literal[3]` is not assignable to TypedDict key `ident` with type `str` [typed-dict-key-error] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_readonly_inheritance.py:84:5-7: Missing required key `ident` for TypedDict `User` [typed-dict-key-error] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_readonly_inheritance.py:94:5-6: Class member `F3.a` overrides parent class `F1` in an inconsistent manner [bad-override] +""" diff --git a/conformance/results/pyrefly/typeddicts_readonly_kwargs.toml b/conformance/results/pyrefly/typeddicts_readonly_kwargs.toml new file mode 100644 index 000000000..82fa1cd1b --- /dev/null +++ b/conformance/results/pyrefly/typeddicts_readonly_kwargs.toml @@ -0,0 +1,6 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_readonly_kwargs.py:33:5-19: Key `key1` in TypedDict `ReadOnlyArgs` is read-only [read-only] +""" diff --git a/conformance/results/pyrefly/typeddicts_readonly_update.toml b/conformance/results/pyrefly/typeddicts_readonly_update.toml new file mode 100644 index 000000000..06d3b7602 --- /dev/null +++ b/conformance/results/pyrefly/typeddicts_readonly_update.toml @@ -0,0 +1,6 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_readonly_update.py:23:10-14: No matching overload found for function `A.update` [no-matching-overload] +""" diff --git a/conformance/results/pyrefly/typeddicts_required.toml b/conformance/results/pyrefly/typeddicts_required.toml new file mode 100644 index 000000000..4a23823a9 --- /dev/null +++ b/conformance/results/pyrefly/typeddicts_required.toml @@ -0,0 +1,16 @@ +conformant = "Partial" +notes = """ +Does not handle recursive typed dicts in functional syntax +""" +conformance_automated = "Fail" +errors_diff = """ +Line 74: Unexpected errors ["Expected a type form, got instance of `Literal['RecursiveMovie']` [not-a-type]"] +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_required.py:12:5-6: `Required` may only be used for TypedDict members [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_required.py:19:8-19: `NotRequired` is only allowed inside a class body [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_required.py:19:8-24: `NotRequired` is not allowed in this context [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_required.py:62:8-31: Duplicate qualifier `Required` [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_required.py:63:8-34: Cannot combine `Required` and `NotRequired` for a TypedDict field [invalid-annotation] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_required.py:74:75-91: Expected a type form, got instance of `Literal['RecursiveMovie']` [not-a-type] +""" diff --git a/conformance/results/pyrefly/typeddicts_type_consistency.toml b/conformance/results/pyrefly/typeddicts_type_consistency.toml new file mode 100644 index 000000000..9ffdbb836 --- /dev/null +++ b/conformance/results/pyrefly/typeddicts_type_consistency.toml @@ -0,0 +1,14 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_type_consistency.py:21:10-12: `TypedDict[B1]` is not assignable to `TypedDict[A1]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_type_consistency.py:38:10-12: `TypedDict[B2]` is not assignable to `TypedDict[A2]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_type_consistency.py:65:6-8: `TypedDict[A3]` is not assignable to variable `b3` with type `TypedDict[B3]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_type_consistency.py:69:21-24: Key `y` is not defined in TypedDict `A3` [typed-dict-key-error] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_type_consistency.py:76:22-24: `TypedDict[B3]` is not assignable to `dict[str, int]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_type_consistency.py:77:25-27: `TypedDict[B3]` is not assignable to `dict[str, object]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_type_consistency.py:78:22-24: `TypedDict[B3]` is not assignable to `dict[Any, Any]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_type_consistency.py:82:25-27: `TypedDict[B3]` is not assignable to `Mapping[str, int]` [bad-assignment] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_type_consistency.py:126:56-57: `Literal[1]` is not assignable to TypedDict key `inner_key` with type `str` [typed-dict-key-error] +""" diff --git a/conformance/results/pyrefly/typeddicts_usage.toml b/conformance/results/pyrefly/typeddicts_usage.toml new file mode 100644 index 000000000..4688e8eda --- /dev/null +++ b/conformance/results/pyrefly/typeddicts_usage.toml @@ -0,0 +1,11 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_usage.py:23:7-17: TypedDict `Movie` does not have key `director` [typed-dict-key-error] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_usage.py:24:17-23: `Literal['1982']` is not assignable to TypedDict key `year` with type `int` [typed-dict-key-error] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_usage.py:28:17-56: Missing required key `name` for TypedDict `Movie` [typed-dict-key-error] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_usage.py:28:18-25: Key `title` is not defined in TypedDict `Movie` [typed-dict-key-error] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_usage.py:35:22-27: TypedDict `Movie` not allowed as second argument to isinstance() [invalid-argument] +ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_usage.py:40:24-33: `TypedDict` is not allowed in this context [invalid-annotation] +""" diff --git a/conformance/results/pyrefly/version.toml b/conformance/results/pyrefly/version.toml new file mode 100644 index 000000000..7aed889a8 --- /dev/null +++ b/conformance/results/pyrefly/version.toml @@ -0,0 +1 @@ +version = "pyrefly 0.30.0" diff --git a/conformance/results/results.html b/conformance/results/results.html index dc9f244a2..7e0de6781 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -166,8 +166,10 @@

    Python Type System Conformance Test Results

    zuban 0.0.20
    pyrefly 0.30.0
    +
    +
    Type annotations
         annotations_coroutines Pass Pass PassPass
         annotations_forward_refs
    Partial

    Does not report error for a forward reference that is not enclosed in quotes.

    Does not report error for use of quoted type with "|" operator (runtime error).

    Incorrectly generates error for quoted type defined in class scope.

    Pass
    Partial

    Does not report error for a forward reference that is not enclosed in quotes.

    Does not report error for use of quoted type with "|" operator (runtime error).

    Does not reject f-string in quoted type annotation.

    Incorrectly generates error for quoted type defined in class scope.

    Does not generate error for unquoted type defined in class scope.

    Does not treat triple-quoted forward reference annotation as implicitly parenthesized.

    Partial

    Does not report error for a forward reference that is not enclosed in quotes.

    Incorrectly generates error for quoted type defined in class scope.

    Does not ignore newlines in multi-line unions

    Partial

    Types in quotes incorrectly refer to shadowing class member.

    Does not reject some type forms that require quotes.

         annotations_generators
    Partial

    Does not report incompatible Generator type in `yield from` statement.

    Pass
    Partial

    Does not report invalid return type for generator when function implicitly returns None.

    Incorrectly evaluates type of call to async generator.

    Pass
    Partial

    Does not detect that invalid yield is unreachable

         annotations_methods
    Pass*

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

    Pass*

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

    Pass*

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

    PassPass
         annotations_typeexpr Pass Pass Pass PassPass
    +
    Special types in annotations
         specialtypes_any Pass Pass PassPass
         specialtypes_never Pass Pass
    Partial

    Does not treat Never as compatible with all other types.

    Pass
    Partial

    Does not detect invalid return is unreachable

         specialtypes_none Pass Pass Pass PassPass
         specialtypes_promotions Pass Pass
    Partial

    Does not reject use of attribute that is compatible only with float.

    PassPass
         specialtypes_type
    Partial

    Does not treat `type` same as `type[Any]` for assert_type.

    Does not allow access to unknown attributes from object of type `type[Any]`.

    Pass
    Partial

    Does not reject Callable when passed to type[T].

    Does not treat `type` same as `type[Any]` for assert_type.

    Does not allow access to unknown attributes from object of type `type[Any]`.

    Does not reject access to unknown attributes from object of type `Type[object]`.

    Reports type incompatibility between `type` and `Callable[..., Any]`.

    Pass
    Partial

    Does not implement all typing rules for type/type[]

    +
    Generics
         generics_base_class Pass
    Partial

    Does not reject illegal use of Generic.

    Does not allow using generic in assert_type expression.

    Does not detect inconsistent type variable ordering.

    Partial

    Does not detect inconsistent type variable ordering in multi-inheritance.

    Partial

    Does not reject inconsistent ordering of type variables in different base classes.

         generics_basic Pass Pass
    Partial

    False positives in examples using constrained type variables.

    False negative for constraint parameterized by a type variable.

    False negative in custom map example.

    False positive using `iter`.

    False negative for bad type arguments to Generic/Protocol.

    False negative for generic metaclass.

    Pass
    Partial

    Does not reject Type Var definition with only 1 constraint

    Incorrect rejects + between two AnyStr

    Constrained type var resolves to subtype instead of explcitly listed constraint

         generics_defaults Partial Pass
    Unsupported

    Does not support generic defaults.

    Partial

    Does not reject TypeVars with defaults after a TypeVarTuple

    Type parameter defaults are not bound by attribute access

    ParamSpec after TypeVarTuple is not always handled correctly

    Pass*

    Unsolved type var is not always resolved to default (optional)

         generics_defaults_referential Partial Pass Unsupported PassUnsupported
         generics_defaults_specialization Partial Pass
    Unsupported

    Does not support generic defaults.

    PassPass
         generics_paramspec_basic Pass Pass
    Partial

    Does not enforce name consistency for ParamSpec assigned to identifier.

    Incorrectly reports error for legitimate use of ParamSpec in generic type alias.

    Does not reject ParamSpec when used in various invalid locations.

    PassPass
         generics_paramspec_components Pass Pass
    Partial

    Does not report illegal use of "P.args" on normal parameter.

    Does not report error when P.args is specified but P.kwargs is missing.

    Does not report error when P is out of scope and P.args and P.kwargs is used.

    Does not report error when calling callback defined with ParamSpec with incorrect arguments.

    Does not report error when keyword argument is specified between P.args and P.kwargs.

    Does not report error when calling callable and argument is missing for concatenated parameters.

    Pass
    Partial

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

         generics_paramspec_semantics Pass
    Pass*

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

    Pass PassPass
         generics_paramspec_specialization Pass Pass
    Partial

    Reports error for legitimate use of `...` to specialize ParamSpec

    PassPass
         generics_scoping
    Partial

    False negative on generic class nested within generic class with same type variable.

    Pass
    Partial

    False negative on generic class nested within generic function with same type variable.

    False negative on generic class nested within generic class with same type variable.

    False negative on assert_type uses.

    Partial

    False negative on generic class nested within generic class with same type variable.

    Partial

    Does not implement several scoping checks/restrictions for generics

         generics_self_advanced
    Partial

    Does not infer the type of an unannotated `self` parameter to be type `Self`.

    Does not retain `Self` when calling method that returns `Self`.

    Does not infer the type of an unannotated `cls` parameter to be type `type[Self]`.

    Does not retain `Self` when accessing attribute through `type[Self]`.

    Pass
    Partial

    Does not handle use of `Self` within class body correctly.

    False negatives on assert_type uses.

    Pass*

    True positive: Writing to a variable that contains Self (with a class) should error

    Pass*

    Treats attributes not initialized on the class as instance-only

         generics_self_attributes Pass Pass
    Unsupported

    Does not understand `Self` type.

    Pass
    Partial

    Does not reject incorrect direct assignment to attribute w/ Self

         generics_self_basic Pass Pass
    Partial

    Does not handle use of `Self` as a generic type.

    Pass
    Partial

    Return annotation of Self allows returning the concrete instance of the current class.

         generics_self_protocols Pass Pass
    Partial

    Does not reject protocol compatibility due to method `Self` return type.

    Pass
    Partial

    Protocol subtyping does not work with Self in return annotation

         generics_self_usage Pass Pass
    Partial

    Complains in some cases when `self: Self` is used explicitly.

    Does not complain when `Self` is used on a function outside any class definition.

    Does not complain when `self` is annotated explicitly (without `Self`) and `Self` is returned.

    Does not complain on inheritance involving `Self`.

    Does not complain on use of `Self` in static methods.

    Does not complain on use of `Self` in metaclasses.

    Partial

    Does not detect invalid Self when Self is not properly bound

    Partial

    Does not implement some restrictions on where Self can be used

         generics_syntax_compatibility Pass Pass
    Partial

    False negative on mixing legacy and PEP695 syntax.

    Does not detect mixing legacy and PEP695 syntax in methods.

    PassPass
         generics_syntax_declarations Pass Pass
    Partial

    Does not detect incorrect use of legacy style syntax mixed with PEP695 syntax.

    False negatives due to assert_type use.

    PassPass
         generics_syntax_infer_variance
    Unsupported

    Type parameter syntax not yet support.

    Pass
    Partial

    Incorrectly determines that a class cannot be instantiated with __getitem__.

    Incorrectly handles mixing legacy and PEP695 syntax.

    Unsupported

    Type parameter syntax not yet support.

    Pass
         generics_syntax_scoping
    Partial

    Does not following runtime scoping rules for type parameters in all cases.

    Pass
    Partial

    Does not properly handle mixing legacy syntax with PEP695 syntax.

    Partial

    Does not following runtime scoping rules for type parameters in all cases.

    Partial

    Does not implement some scoping restrictions for PEP695 generic syntax

         generics_type_erasure
    Partial

    Infers Node[Never] instead of Node[Any] when argument is not provided.

    False negative on instance attribute access on type(node).

    Pass
    Partial

    Does not erase unspecified type variables to `Any` prior to `assert_type` handling.

    False negatives on instance attribute access on the type.

    Does not infer type of `DefaultDict` with explicit type parameters on constructor.

    False negatives on assert_type uses.

    Pass*

    True positive: Undefined type vars should be inferred as Never not Any (avoiding to introduce Any)

    Pass
         generics_typevartuple_args
    Partial

    Does not enforce that tuples captured by TypeVarTuple are same type.

    Pass
    Partial

    Does not property handle TypeVarTuple.

    Partial

    Does not enforce that tuples captured by TypeVarTuple are same type.

    Pass
         generics_typevartuple_basic
    Partial

    Does not enforce that tuples captured by TypeVarTuple are same length.

    Does not enforce that tuples captured by TypeVarTuple are same type.

    Pass
    Partial

    Does not support TypeVarTuple.

    False negatives due to assert_type.

    Partial

    Does not enforce that tuples captured by TypeVarTuple are same length.

    Does not enforce that tuples captured by TypeVarTuple are same type.

    Partial

    TypeVarTuple is pinned too early when calling generic function

         generics_typevartuple_callable Pass Pass
    Partial

    False negatives due to assert_type.

    PassPass
         generics_typevartuple_concat Pass Pass
    Partial

    False negatives due to assert_type.

    False compatability error message.

    Pass
    Partial

    Fails to handle move_first_element_to_last example

         generics_typevartuple_overloads Pass Pass
    Unsupported

    Does not support star expressions for `Unpack`.

    PassPass
         generics_typevartuple_specialization
    Partial

    Incorrectly specializes generic alias that includes a TypeVar and TypeVarTuple if no type arguments are provided.

    Rejects specialization of generic type alias defined as a tuple containing a TypeVar.

    Pass
    Unsupported

    Does not support star expressions for `Unpack`.

    Pass
    Partial

    Sometimes specializes to tuple[Any, ...] instead of empty tuple

         generics_typevartuple_unpack Pass Pass Pass PassPass
         generics_upper_bound
    Partial

    Does not reject use of type variable within an upper bound.

    Pass
    Partial

    False positives on valid type expression (`list[T]`) in `bound`.

    Does not complain when bound is used alongside type constraints.

    Partial

    Does not reject use of type variable within an upper bound.

    Partial

    Instantiation is not validated against bound

         generics_variance
    Partial

    Does not reject use of class-scoped TypeVar used in a base class when variance is incompatible.

    Pass
    Partial

    Does not reject a TypeVar that is defined as both covariant and contravariant.

    Does not reject use of class-scoped TypeVar used in a base class when variance is incompatible.

    Partial

    Does not reject use of class-scoped TypeVar used in a base class when variance is incompatible.

    Unsupported
         generics_variance_inference Pass Pass
    Partial

    Does not properly handle mixing legacy and PEP695 syntax.

    False negative about a type variable not being present in the function's parameters.

    PassPass
    +
    Type qualifiers
         qualifiers_annotated Pass
    Partial

    Does not reject Annotated with a single parameter.

    Does not reject call of Annotated with no type arguments.

    Pass
    Partial

    Allows Annotated in some contexts where it should not be allowed

         qualifiers_final_annotation
    Partial

    Does not treat use of Final name as if it was replaced by the literal in NamedTuple definition.

    Does not allow conditional assignment of Final instance variable in __init__ method.

    Does not allow redefinition of private class variable that is marked Final in parent class.

    Does not report modification of local Final variable via "for" statement.

    Pass
    Partial

    Does not report Final variable with missing initialization in module scope.

    Does not report error for invalid nesting of Final and ClassVar.

    Does not treat use of Final name as if it was replaced by the literal in NamedTuple definition.

    Does not reject modification of imported variable declared Final.

    Partial

    Does not treat use of Final name as if it was replaced by the literal in NamedTuple definition.

    Does not allow conditional assignment of Final instance variable in __init__ method.

    Partial

    Final attributes not initialized on the class can be assigned to

         qualifiers_final_decorator Pass Pass
    Partial

    Reports error for overloaded method implementation marked @final if its overloads do not.

    Does not report error for overloaded @final method defined in stub file.

    Reports misleading error when overload is marked @final but implementation is not.

    Pass
    Partial

    Does not ban final decorator on overload when implementation exists

    +
    Class type compatibility
         classes_classvar Pass
    Partial

    Does not reject use of TypeVar in ClassVar.

    Does not reject use of ParamSpec in ClassVar.

    Does not reject use of ClassVar as a generic type argument.

    Does not reject use of ClassVar in parameter type annotation.

    Does not reject use of ClassVar in local variable annotation.

    Does not reject use of ClassVar in instance variable annotation.

    Does not reject use of ClassVar in return type annotation.

    Does not reject use of ClassVar in type alias definition.

    Does not infer type from initialization for bare ClassVar.

    PassPass
         classes_override Pass Pass Pass PassPass
    +
    Type aliases
         aliases_explicit Pass
    Partial

    Incorrectly reports error for type alias defined with ParamSpec.

    Incorrectly rejects some valid type aliases when used in annotations.

    Incorrectly evaluates generic type alias with ParamSpec with missing type argument.

    Does not report some illegal annotation forms as invalid type aliases.

    Does not report invalid specialization of generic type aliases.

    Incorrectly rejects import alias of `TypeAlias` when used to define type alias.

    Does not report invalid specialization of already-specialized generic type alias.

    PassPass
         aliases_implicit Pass Pass
    Partial

    Incorrectly reports error for type alias defined with ParamSpec.

    Incorrectly rejects some valid type aliases when used in annotations.

    Incorrectly evaluates generic type alias with ParamSpec with missing type argument.

    Does not report invalid specialization of generic type aliases.

    Does not report error for attempt to instantiate union type alias.

    Does not report invalid specialization of already-specialized generic type alias.

    Pass
    Partial

    Does not reject invalid syntax in implicit type aliases.

         aliases_newtype
    Partial

    `NewType`s are incorrectly considered to be classes.

    Pass
    Partial

    Does not reject use of NewType in `isinstance` call.

    Does not reject use of NewType in class definition statement.

    Does not report inconsistency between name of NewType and assigned identifier name.

    Does not reject use of NewType with generic class with TypeVar.

    Does not reject use of NewType with protocol class.

    Does not reject use of NewType with TypedDict class.

    Does not reject use of NewType with Any.

    PassPass
         aliases_recursive Pass Pass
    Partial

    Does not properly handle some recursive type aliases.

    Does not properly handle specialization of generic recursive type aliases.

    PassUnsupported
         aliases_type_statement
    Partial

    Does not reject type alias defined in function scope.

    Pass
    Partial

    Does not complain when a type alias cannot be used as a base class.

    Does not complain when a type alias cannot be used as a function.

    Does not complain when a type statement definition combines new and old TypeVars.

    Does not complain when a type statement definition uses old TypeVars.

    Does not properly support recursive aliases.

    Pass
    Partial

    Does not reject type alias defined with type statement in base class list

    Does not reject redeclaration of type alias with the same name.

    Does not detect circular definitions.

         aliases_typealiastype
    Partial

    Incorrectly rejects some recursive type aliases using TypeAliasType.

    Incorrectly rejects the use of a class-scoped TypeVar in a TypeAliasType definition.

    Pass
    Unsupported

    Support for TypeAliasType is not implemented.

    Partial

    Incorrectly rejects the use of a class-scoped TypeVar in a TypeAliasType definition.

    Incorrectly allows type_params= to be an arbitrary tuple.

    Unsupported
         aliases_variance Pass Pass Pass PassUnsupported
    +
    Literals
         literals_interactions Pass
    Partial

    Does not detect out-of-bound tuple literal index.

    Does not perform exhaustiveness checks on enums.

    Does not narrow type of `x` with `x in Literal` type guard pattern.

    Does not narrow type of `x` with `x == Literal` type guard pattern.

    Partial

    Does not narrow type of `x` with `x in Literal` type guard pattern.

    Partial

    Two instances parameterized with different literals are not compatible

         literals_literalstring
    Unsupported

    Support for `LiteralString` is not implemented.

    Pass
    Partial

    Incorrectly infers `str` rather than `LiteralString` when literal string `join` is used.

    Unsupported

    Support for `LiteralString` is not implemented.

    Partial

    LiteralString is sometimes converted to str

         literals_parameterizations
    Partial

    Does not reject tuple within Literal.

    Pass
    Partial

    Does not support type aliases in Literal type expression.

    Does not support nested Literal type expression.

    Does not reject tuple in Literal type expression.

    Does not reject "bare" Literal in type expression.

    PassPass
         literals_semantics Pass Pass Pass PassPass
    +
    Protocols
         protocols_class_objects Pass
    Partial

    Does not reject protocol class assigned to type[Proto].

    Incorrectly reports some class objects as incompatible with a protocol.

    Fails to report some class objects as incompatible with a protocol.

    Pass
    Partial

    Does not require concrete classes to be passed to type[Proto]

         protocols_definition
    Partial

    Does not detect protocol mismatch if concrete method is missing annotations.

    Does not detect protocol mismatch if concrete method's parameters are position-only.

    Pass
    Partial

    Does not reject ClassVar in concrete class when attribute in protocol is not ClassVar or vice versa.

    Does not reject read-only property in concrete class when attribute in protocol is mutable.

    Does not reject covariant attribute type when protocol attribute is mutable.

    Does not reject read-only property in concrete class when protocol has settable property.

    Does not reject immutable named tuple attribute in concrete class when protocol attribute is mutable.

    Does not reject immutable frozen dataclass attribute in concrete class when protocol attribute is mutable.

    Partial

    Does not detect protocol mismatch if concrete method is missing annotations.

    Does not detect protocol mismatch if concrete method's parameters are position-only.

    Partial

    Allows attributes defined by assignment via self in Protocols

    Incorrectly handles some ClassVar examples in Protocol subtyping

         protocols_explicit
    Pass*

    Does not report unimplemented attributes for class that explicitly derives from protocol until it is instantiated.

    Pass
    Partial

    Does not report error when calling unimplemented protocol method from derived class.

    Does not report error when method is not implemented in derived class.

    Pass*

    Does not report unimplemented attributes for class that explicitly derives from protocol until it is instantiated.

    Unsupported

    Does not check against abstract class instantiations

         protocols_generic Pass Pass
    Partial

    Does not reject the use of Protocol and Generic together as base classes.

    Does not detect protocol mismatch when method-scoped TypeVar is used in protocol.

    Pass
    Partial

    Fails one protocol subtyping example involving @property

         protocols_merging Pass Pass Pass Pass
    Partial

    Does not check against abstract class instantiations

         protocols_modules Pass Pass
    Unsupported

    Does not perform protocol checks for modules.

    Pass
    Partial

    Fails one subtyping example of protocol modules

         protocols_recursive Pass Pass Pass PassPass
         protocols_runtime_checkable
    Partial

    Does not report unsafe overlap for runtime_checkable protocol.

    Pass
    Unsupported

    Does not reject isinstance or issubclass call for protocol that is not runtime_checkable.

    Does not reject issubclass call for data protocol.

    Does not report unsafe overlap for runtime_checkable protocol.

    Partial

    Does not report unsafe overlap for runtime_checkable protocol.

    Partial

    Does not check for unsafe overlap in runtime_checkable protocols

         protocols_self Pass Pass Pass Pass
    Partial

    Fails some protocol subtyping examples when self is annotated with a type var

         protocols_subtyping Pass Pass Pass PassPass
         protocols_variance Pass Pass
    Unsupported

    Does not detect incorrect TypeVar variance within generic protocols.

    PassUnknown
    +
    Callables
         callables_annotation Pass
    Partial

    Does not evaluate correct type for `*args: int` parameter.

    Does not correctly implement type compatibility rules for "...".

    Does not treat "*args: Any, **kwargs: Any" as "...".

    Partial

    Incorrectly treats "*args: T, **kwargs: T" as "..." when T is specialized to Any.

    Does not treat "*args: Any, **kargs: Any" as "..." when separated by keyword parameter.

    Partial

    Parameter names are lost when resolving ParamSpec

         callables_kwargs
    Partial

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

    Pass Pass Pass
    Partial

    Does not reject overlap between unpacked TypedDict kwarg and named parameters

         callables_protocol Pass Pass
    Partial

    Does not correctly handle callback protocol that declares attributes in all functions.

    Does not report type incompatibility for callback protocol with positional-only parameters.

    Incorrectly reports type compatibility error with callback that has *args and **kwargs.

    Does not report type incompatibility for callback missing a default argument for positional parameter.

    Does not report type incompatibility for callback missing a default argument for keyword parameter.

    PassPass
         callables_subtyping Pass Pass
    Partial

    Rejects standard parameter as incompatible with keyword-only parameter.

    Rejects use of Callable with ParamSpec in TypeAlias definition.

    PassPass
    +
    Constructors
         constructors_call_init Pass
    Partial

    Does not infer type of Self for self parameter of __init__ method.

    Does not report errors during binding to self parameter of __init__ method.

    Does not reject use of class-scoped type variables in annotation of self parameter in __init__ method.

    Incorrectly raises Incompatible overload type errors.

    Incorrectly raises compatibility type errors.

    Partial

    Does not report errors during binding to self parameter of __init__ method.

    Does not reject use of class-scoped type variables in annotation of self parameter in __init__ method.

    Partial

    Does not reject class-scoped type var in self param annotation

         constructors_call_metaclass
    Unupported

    Does not honor metaclass __call__ method when evaluating constructor call.

    Does not skip evaluation of __new__ and __init__ if custom metaclass call returns non-class.

    Pass
    Partial

    Does not evaluate __new__ if metaclass __call__ is defined.

    Unupported

    Does not honor metaclass __call__ method when evaluating constructor call.

    Does not skip evaluation of __new__ and __init__ if custom metaclass call returns non-class.

    Pass
         constructors_call_new
    Partial

    Does not support __new__ return type that is not a subclass of the class being constructed.

    Does not skip evaluation of __init__ based on __new__ return type.

    Does not report errors during binding to cls parameter of __new__ method.

    Pass
    Partial

    Does not support __new__ return type that is not a subclass of the class being constructed.

    Does not report errors during binding to cls parameter of __new__ method.

    Incorrectly raises compatibility type errors.

    Partial

    Does not support __new__ return type that is not a subclass of the class being constructed.

    Does not skip evaluation of __init__ based on __new__ return type.

    Does not report errors during binding to cls parameter of __new__ method.

    Pass
         constructors_call_type
    Partial

    Does not validate call to custom metaclass __call__ method through type[T].

    Pass Pass
    Partial

    Does not validate call to custom metaclass __call__ method through type[T].

    Partial

    Does not check TypeVar type constructor using upper bound's __new__

         constructors_callable
    Partial

    Does not generate a union type for __new__ and __init__ when converting class to callable.

    Does not ignore __init__ based on __new__ return type when converting class to callable.

    Does not support __new__ return type that is different from class being constructed.

    Pass
    Partial

    Does not generate a union type for __new__ and __init__ when converting class to callable.

    Does not ignore __init__ based on __new__ return type when converting class to callable.

    Does not support __new__ return type that is different from class being constructed.

    Does not use annotated type of self in __init__ method to generate return type of callable.

    Incorrectly raises incompatibility type errors.

    Partial

    Does not generate a union type for __new__ and __init__ when converting class to callable.

    Does not ignore __init__ based on __new__ return type when converting class to callable.

    Does not support __new__ return type that is different from class being constructed.

    Struggles with some cases of self types

    Partial

    Some overloaded constructors are not resolved correctly.

    Converting constructor to callable does not preserve class-scoped type params.

    Converting constructor to callable does not substitute Self in __new__

    Converting constructor to callable uses __new__ signature instead of __init__

         constructors_consistency
    Pass*

    Does not report inconsistency between __new__ and __init__ (optional).

    Pass
    Pass*

    Does not report inconsistency between __new__ and __init__ (optional).

    PassPass
    +
    Overloads
         overloads_basic Pass Pass PassPass
         overloads_consistency Pass Pass
    Partial

    Does not apply decorator transforms before checking overload consistency.

    PassPass
         overloads_definitions
    Partial

    Allows @override to be on all overloads and implementation, instead of just implementation.

    Pass
    Partial

    Does not allow an overload with no implementation in a Protocol or an abstract base class.

    Expects @final/@override on all overloads and implementation, instead of implementation only.

    Pass
    Partial

    Does not restrict some decorators to implementation

    Does not require some decorators that need to appear on every overload

         overloads_definitions_stub
    Partial

    Allows @override to appear in a stub file not on the first overload.

    Pass
    Partial

    Expects @final and @override to be present on all overloads, not just first.

    Pass
    Partial

    Does not restrict some decorators to the first overload

    Does not require some decorators that need to appear on every overload

         overloads_evaluation
    Partial

    Does not expand boolean arguments to Literal[True] and Literal[False].

    Does not expand enum arguments to literal variants.

    Does not expand tuple arguments to possible combinations.

    Does not evaluate Any in some cases where overload is ambiguous.

    Evaluates Any in some cases where overload is not ambiguous.

    Partial

    Does not evaluate Any in some cases where overload is ambiguous.

    Partial

    Does not expand boolean arguments to Literal[True] and Literal[False].

    Does not expand enum arguments to literal variants.

    Does not expand type[A | B] to type[A] and type[B].

    Does not expand tuple arguments to possible combinations.

    Does not prefer variadic match to indeterminate-length unpacked argument.

    Does not treat multiple matches due to gradual types as ambiguous.

    Partial

    Does not expand boolean arguments to Literal[True] and Literal[False].

    Does not expand enum arguments to literal variants.

    Does not expand tuple arguments to possible combinations.

    Does not evaluate Any in some cases where overload is ambiguous.

    Evaluates Any in some cases where overload is not ambiguous.

    Partial

    Does not exclude overloads based on arity first

    Does not perform argument expansion

    +
    Exceptions
         exceptions_context_managers Pass
    Partial

    assert_type causes failures.

    Pass
    Partial

    Some error suppressing context managers are not detected

    +
    Dataclasses
         dataclasses_descriptors Pass
    Partial

    Incorrectly generates error when calling constructor of dataclass with descriptor.

    Incorrectly raises incompatibility type errors.

    PassPass
         dataclasses_final
    Partial

    Wrongly requires a Final dataclass field to be initialized at class level.

    Doesn't support Final nested inside ClassVar.

    Pass Pass
    Partial

    Wrongly requires a Final dataclass field to be initialized at class level.

    Doesn't support Final nested inside ClassVar.

    Partial

    Allows assignment to final attributes that are not initialized on the class

         dataclasses_frozen Pass Pass Pass PassPass
         dataclasses_hash
    Partial

    Does not report when dataclass is not compatible with Hashable protocol.

    Pass
    Partial

    Does not report when dataclass is not compatible with Hashable protocol.

    Partial

    Does not report when dataclass is not compatible with Hashable protocol.

    Pass
         dataclasses_inheritance Pass Pass
    Partial

    Does not reject ClassVar that is overridden by instance variable.

    Does not reject instance variable that is overridden by ClassVar.

    PassPass
         dataclasses_kwonly Pass Pass
    Partial

    Rejects legitimate use of dataclass field with `kw_only=True`.

    PassPass
         dataclasses_match_args Pass
    Partial

    Generates __match_args__ when match_args=False.

    Partial

    Adds kw-only fields to __match_args__.

    PassPass
         dataclasses_order Pass Pass Pass PassPass
         dataclasses_postinit Pass Pass
    Partial

    Does not perform validation of `__post_init__` method.

    Incorrectly complains on the assignment of `InitVar` in class bodies.

    PassPass
         dataclasses_slots
    Partial

    Does not reject write to instance variable that is not defined in __slots__.

    Pass
    Partial

    Does not report error when `slots=True` is used with `__slots__` definition.

    Does not reject write to instance variable that is not defined in __slots__.

    Does not reject access to `__slots__` from dataclass instance when `slots=False`.

    Partial

    Does not reject write to instance variable that is not defined in __slots__.

    Partial

    __slots__ is generated but not checked during attribute assignment

         dataclasses_transform_class Pass Pass
    Partial

    Does not support field specifiers.

    Emits "attribute not initialized" error for dataclass field.

    PassPass
         dataclasses_transform_converter
    Unsupported

    Converter parameter not yet supported.

    Pass
    Unsupported

    Converter parameter not yet supported.

    Unsupported

    Converter parameter not yet supported.

    Pass
         dataclasses_transform_field
    Partial

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

    Pass
    Unsupported

    Does not understand dataclass transform field specifiers.

    PassPass
         dataclasses_transform_func
    Partial

    Does not handle `kw_only=False` override when `kw_only_default=True`.

    Does not report error when `order=False` and comparison operators are used.

    Pass
    Partial

    Does not understand @dataclass_transform when it is applied only to overloads of a decorator but not the definition.

    Does not detect non-frozen class inheriting from frozen class.

    Emits "attribute not initialized" error for dataclass field.

    PassPass
         dataclasses_transform_meta Pass Pass
    Partial

    Does not understand custom field specifiers.

    Incorrectly rejects frozen dataclass that inherits from non-frozen.

    Emits "attribute not initialized" error for dataclass field.

    PassPass
         dataclasses_usage
    Pass*

    Does not detect unannotated usage of `dataclasses.field()`.

    Pass
    Partial

    Does not report error when field with no default follows field with default.

    Complains on `assert_type` when used for bound methods vs `Callable`.

    Does not understand `__dataclass_fields__`.

    Incorrectly raises incompatibility type errors.

    PassPass
    +
    Typed dictionaries
         typeddicts_alt_syntax Pass
    Partial

    Does not report when name of TypedDict doesn't match assigned identifier name.

    Does not support keyword-argument form of alternative syntax (deprecated in 3.11).

    Pass*

    Does not support keyword-argument form of alternative syntax (deprecated in 3.11).

    Pass
         typeddicts_class_syntax Pass Pass
    Partial

    Does not reject methods within TypedDict class.

    Does not report when metaclass is provided.

    Does not report when other keyword argument is provided.

    Does not support generic TypedDict class.

    PassPass
         typeddicts_extra_items
    Unsupported

    Not supported.

    Partial

    Does not flag illegal use of `closed=False` when inheriting from a non-open TypedDict.

    Unsupported

    Not supported.

    Unsupported

    Not supported.

    Partial

    Does not fully support extra_items for typed dicts

         typeddicts_final Pass Pass
    Partial

    Does not handle value with literal type as index to TypedDict object.

    PassPass
         typeddicts_inheritance Pass Pass Pass Pass
    Partial

    Does not check against inconsistent multiple inheritance

         typeddicts_operations Pass Pass Pass PassPass
         typeddicts_readonly Pass Pass Pass PassPass
         typeddicts_readonly_consistency Pass Pass Pass PassPass
         typeddicts_readonly_inheritance
    Partial

    Incorrectly rejects non-ReadOnly override of ReadOnly item.

    Incorrectly rejects override of ReadOnly item with another ReadOnly item with narrower type.

    Incorrectly rejects override of NotRequired ReadOnly item with a Required ReadOnly item.

    Pass Unsupported
    Partial

    Incorrectly rejects non-ReadOnly override of ReadOnly item.

    Incorrectly rejects override of ReadOnly item with another ReadOnly item with narrower type.

    Incorrectly rejects override of NotRequired ReadOnly item with a Required ReadOnly item.

    Partial

    Does not restrictions around overriding for ReadOnly fields

         typeddicts_readonly_kwargs Pass Pass Pass PassPass
         typeddicts_readonly_update
    Partial

    Incorrectly allows update of ReadOnly item.

    Incorrectly rejects update involving an item with Never type.

    Pass Pass
    Partial

    Incorrectly allows update of ReadOnly item.

    Pass
         typeddicts_required Pass Pass
    Partial

    Does not reject use of `Required` in function parameter annotation.

    Does not reject nested use of `Required` in type annotation.

    Does not support recursive TypedDict definitions.

    Incorrectly complains about uninitialized attributes on TypedDict definitions.

    Incorrectly generates "attribute not initialized" errors for TypedDict fields.

    Pass
    Partial

    Does not handle recursive typed dicts in functional syntax

         typeddicts_type_consistency Pass Pass
    Partial

    Does not reject assignment of TypedDict with missing key.

    Does not return non-Optional value from `get` method for required key.

    Does not properly handle nested TypedDicts.

    PassPass
         typeddicts_usage Pass Pass
    Pass*

    Does not report errant use of TypedDict in `isinstance` call.

    Does not reject use of TypedDict as TypeVar bound.

    PassPass
    +
    Tuples
         tuples_type_compat Pass
    Partial

    Does not support some unpacked tuple forms.

    Does not report type violation when assigning `tuple[int, ...]` to `tuple[int]`.

    Does not support tuple narrowing based on `len()` type guard (optional).

    Does not correctly evaluate `Sequence[Never]` for `tuple[()]`.

    Pass*

    Does not support tuple narrowing based on `len()` type guard (optional).

    Pass
         tuples_type_form Pass Pass Pass PassPass
         tuples_unpacked
    Partial

    "More than one unpack" error is missing in some cases.

    Pass Pass PassPass
    +
    Named tuples
         namedtuples_define_class Pass
    Partial

    Does not evaluate correct type for indexed named tuple instance with integer.

    Does not evaluate correct type for indexed named tuple instance with slice.

    Does not report out-of-range index access with named tuple instance.

    Does not reject named tuple element with no default value after one with a default.

    Incorrectly rejects assignment of named tuple to a tuple with compatible type.

    Does not reject attempt to use NamedTuple with multiple inheritance.

    Partial

    Does not reject override of named tuple attribute in child class.

    Pass
         namedtuples_define_functional Pass Pass Pass PassPass
         namedtuples_type_compat Pass Pass Pass PassPass
         namedtuples_usage
    Partial

    Does not reject attempt to delete named tuple field by name.

    Pass Partial PassPass
    +
    Enumerations
         enums_behaviors Pass Pass Pass
    Partial

    Iterating an enum class gives Any

         enums_definition Pass Pass Pass PassPass
         enums_expansion
    Partial

    Improperly applies narrowing to Flag subclass.

    Pass Pass
    Partial

    Improperly applies narrowing to Flag subclass.

    Pass
         enums_member_names
    Pass*

    Does not support special-cased handling of member name literal types in some cases (optional).

    Pass
    Pass*

    Does not support special-cased handling of member name literal types (optional).

    PassPass
         enums_member_values
    Partial

    Does not enforce declared type of `_value_`.

    Does not enforce assigned tuple types for enum members (optional).

    Pass Pass
    Partial

    Does not enforce declared type of `_value_`.

    Pass
         enums_members
    Partial

    Does not treat attribute with annotation and no assignment as non-member.

    Does not treat callables as non-members.

    Does not honor `enum.member` as method decorator.

    Does not properly handle aliased enum members.

    Does not support `_ignore_` mechanism (optional).

    Does not treat attributes with private names as non-members.

    Pass*

    Does not support `_ignore_` mechanism (optional).

    Partial

    Does not reject use of annotation with enum member.

    Does not treat callables as non-members.

    Does not treat annotated attributes as non-members.

    Does not honor `enum.nonmember` to define non-member attribute.

    Does not honor `enum.member` as method decorator.

    Does not properly handle aliased enum members.

    Rejects use of `_ignore_`.

    Does not support `_ignore_` mechanism (optional).

    Partial

    Does not honor `enum.member` as method decorator.

    Does not properly handle aliased enum members.

    Does not treat somecallables as non-members.

    Partial

    Enum members that are aliases of other members do not resolved to the aliased member's type

    +
    Type narrowing
         narrowing_typeguard Pass Pass PassPass
         narrowing_typeis Pass Pass Pass PassPass
    +
    Type checker directives
         directives_assert_type Pass Pass PassPass
         directives_cast Pass Pass Pass PassPass
         directives_deprecated Pass Pass
    Unsupported

    Does not support @deprecated.

    UnsupportedUnsupported
         directives_no_type_check
    Partial

    Does not honor `@no_type_check` class decorator (allowed).

    Does not reject invalid call of `@no_type_check` function.

    Pass*

    Does not honor `@no_type_check` class decorator (allowed).

    Pass*

    Does not honor @no_type_check decorator.

    PassPass
         directives_reveal_type Pass Pass Pass PassPass
         directives_type_checking Pass Pass Pass PassPass
         directives_type_ignore
    Partial

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

    Pass Pass
    Partial

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

    Pass
         directives_type_ignore_file1 Pass Pass Pass PassPass
         directives_type_ignore_file2 Pass Pass Pass PassPass
         directives_version_platform
    Pass*

    Does not understand three-element form of sys.version checks.

    Does not understand os.name checks.

    Pass Pass PassPass
    +
    Historical and deprecated features
         historical_positional Pass Pass
    Partial

    Does not reject positional-only parameter after non-positional-only parameter.

    Treats keyword-only parameter as positional-only.

    Applies legacy positional-only rules when PEP 570 syntax is used.

    Pass
    diff --git a/conformance/src/type_checker.py b/conformance/src/type_checker.py index a2663425d..26b61e465 100644 --- a/conformance/src/type_checker.py +++ b/conformance/src/type_checker.py @@ -272,6 +272,7 @@ def parse_errors(self, output: Sequence[str]) -> dict[int, list[str]]: line_to_errors.setdefault(int(lineno), []).append(line) return line_to_errors + class ZubanLSTypeChecker(MypyTypeChecker): @property def name(self) -> str: @@ -335,10 +336,66 @@ def parse_errors(self, output: Sequence[str]) -> dict[int, list[str]]: return line_to_errors +class PyreflyTypeChecker(TypeChecker): + @property + def name(self) -> str: + return "pyrefly" + + def install(self) -> bool: + try: + # Uninstall any existing version if present. + run( + [sys.executable, "-m", "pip", "uninstall", "pyrefly", "-y"], + check=True, + ) + # Install the latest version. + run( + [sys.executable, "-m", "pip", "install", "pyrefly"], + check=True, + ) + return True + except CalledProcessError: + print("Unable to install pyrefly") + return False + + def get_version(self) -> str: + proc = run(["pyrefly", "--version"], stdout=PIPE, text=True) + version = proc.stdout.strip() + return version + + def run_tests(self, test_files: Sequence[str]) -> dict[str, str]: + proc = run(["pyrefly", "check", "--output-format", "min-text", "--no-summary"], stdout=PIPE, text=True, encoding="utf-8") + lines = proc.stdout.split("\n") + + # Add results to a dictionary keyed by the file name. + results_dict: dict[str, str] = {} + for line in lines: + if not line.strip(): + continue + file_name = line.split(":")[0].split(" ")[1].split("conformance/tests/")[-1].strip() + results_dict[file_name] = results_dict.get(file_name, "") + line + "\n" + + return results_dict + + def parse_errors(self, output: Sequence[str]) -> dict[int, list[str]]: + line_to_errors: dict[int, list[str]] = {} + for line in output: + # Ignore multi-line errors + if ".py:" not in line and ".pyi:" not in line: + continue + # Ignore reveal_type errors + if "revealed type: " in line: + continue + assert line.count(":") >= 3, f"Failed to parse line: {line!r}" + _, lineno, _, error_msg = line.split(":", maxsplit=3) + line_to_errors.setdefault(int(lineno), []).append(error_msg.strip()) + return line_to_errors + TYPE_CHECKERS: Sequence[TypeChecker] = ( MypyTypeChecker(), PyrightTypeChecker(), *([] if os.name == "nt" else [PyreTypeChecker()]), ZubanLSTypeChecker(), + PyreflyTypeChecker(), ) From f0decdcb56d0dc9bd2d928cabda7e4462d098b1f Mon Sep 17 00:00:00 2001 From: Eric Traut Date: Sun, 31 Aug 2025 17:20:28 -0700 Subject: [PATCH 135/308] Fixed pyrefly results output (#2081) Added code to change pyrefly diagnostics to be recorded in the results as relative paths rather than absolute. Fixed the summary report so it looks better with five columns. --- .../results/pyrefly/aliases_explicit.toml | 47 ++++++------ .../results/pyrefly/aliases_implicit.toml | 34 ++++----- .../results/pyrefly/aliases_newtype.toml | 29 +++---- .../results/pyrefly/aliases_recursive.toml | 20 ++--- .../pyrefly/aliases_type_statement.toml | 48 ++++++------ .../pyrefly/aliases_typealiastype.toml | 34 ++++----- .../pyrefly/annotations_coroutines.toml | 1 + .../pyrefly/annotations_forward_refs.toml | 38 +++++----- .../pyrefly/annotations_generators.toml | 24 +++--- .../results/pyrefly/annotations_methods.toml | 3 +- .../results/pyrefly/annotations_typeexpr.toml | 31 ++++---- .../results/pyrefly/callables_annotation.toml | 40 +++++----- .../results/pyrefly/callables_kwargs.toml | 38 +++++----- .../results/pyrefly/callables_protocol.toml | 35 ++++----- .../results/pyrefly/callables_subtyping.toml | 65 ++++++++-------- .../results/pyrefly/classes_classvar.toml | 43 ++++++----- .../results/pyrefly/classes_override.toml | 11 +-- .../pyrefly/constructors_call_init.toml | 8 +- .../pyrefly/constructors_call_metaclass.toml | 5 +- .../pyrefly/constructors_call_new.toml | 5 +- .../pyrefly/constructors_call_type.toml | 14 ++-- .../pyrefly/constructors_callable.toml | 38 ++++++---- .../pyrefly/constructors_consistency.toml | 1 + .../pyrefly/dataclasses_descriptors.toml | 1 + .../results/pyrefly/dataclasses_final.toml | 8 +- .../results/pyrefly/dataclasses_frozen.toml | 9 ++- .../results/pyrefly/dataclasses_hash.toml | 5 +- .../pyrefly/dataclasses_inheritance.toml | 5 +- .../results/pyrefly/dataclasses_kwonly.toml | 7 +- .../pyrefly/dataclasses_match_args.toml | 3 +- .../results/pyrefly/dataclasses_order.toml | 3 +- .../results/pyrefly/dataclasses_postinit.toml | 9 ++- .../results/pyrefly/dataclasses_slots.toml | 6 +- .../pyrefly/dataclasses_transform_class.toml | 17 +++-- .../dataclasses_transform_converter.toml | 23 +++--- .../pyrefly/dataclasses_transform_field.toml | 5 +- .../pyrefly/dataclasses_transform_func.toml | 15 ++-- .../pyrefly/dataclasses_transform_meta.toml | 17 +++-- .../results/pyrefly/dataclasses_usage.toml | 23 +++--- .../pyrefly/directives_assert_type.toml | 13 ++-- .../results/pyrefly/directives_cast.toml | 9 ++- .../pyrefly/directives_deprecated.toml | 2 +- .../pyrefly/directives_no_type_check.toml | 11 +-- .../pyrefly/directives_reveal_type.toml | 9 ++- .../pyrefly/directives_type_checking.toml | 1 + .../pyrefly/directives_type_ignore.toml | 1 + .../pyrefly/directives_type_ignore_file1.toml | 1 + .../pyrefly/directives_type_ignore_file2.toml | 3 +- .../pyrefly/directives_version_platform.toml | 5 +- .../results/pyrefly/enums_behaviors.toml | 8 +- .../results/pyrefly/enums_definition.toml | 1 + .../results/pyrefly/enums_expansion.toml | 3 +- .../results/pyrefly/enums_member_names.toml | 3 +- .../results/pyrefly/enums_member_values.toml | 19 ++--- .../results/pyrefly/enums_members.toml | 41 +++++----- .../pyrefly/exceptions_context_managers.toml | 4 +- .../results/pyrefly/generics_base_class.toml | 12 +-- .../results/pyrefly/generics_basic.toml | 36 ++++----- .../results/pyrefly/generics_defaults.toml | 18 ++--- .../generics_defaults_referential.toml | 20 ++--- .../generics_defaults_specialization.toml | 5 +- .../pyrefly/generics_paramspec_basic.toml | 19 ++--- .../generics_paramspec_components.toml | 38 +++++----- .../pyrefly/generics_paramspec_semantics.toml | 23 +++--- .../generics_paramspec_specialization.toml | 11 +-- .../results/pyrefly/generics_scoping.toml | 4 +- .../pyrefly/generics_self_advanced.toml | 8 +- .../pyrefly/generics_self_attributes.toml | 2 +- .../results/pyrefly/generics_self_basic.toml | 2 +- .../pyrefly/generics_self_protocols.toml | 6 +- .../results/pyrefly/generics_self_usage.toml | 2 +- .../generics_syntax_compatibility.toml | 9 ++- .../pyrefly/generics_syntax_declarations.toml | 21 ++--- .../generics_syntax_infer_variance.toml | 37 ++++----- .../pyrefly/generics_syntax_scoping.toml | 16 ++-- .../pyrefly/generics_type_erasure.toml | 15 ++-- .../pyrefly/generics_typevartuple_args.toml | 19 ++--- .../pyrefly/generics_typevartuple_basic.toml | 32 ++++---- .../generics_typevartuple_callable.toml | 3 +- .../pyrefly/generics_typevartuple_concat.toml | 2 +- .../generics_typevartuple_overloads.toml | 1 + .../generics_typevartuple_specialization.toml | 20 ++--- .../pyrefly/generics_typevartuple_unpack.toml | 3 +- .../results/pyrefly/generics_upper_bound.toml | 8 +- .../results/pyrefly/generics_variance.toml | 2 +- .../pyrefly/generics_variance_inference.toml | 47 ++++++------ .../pyrefly/historical_positional.toml | 9 ++- .../pyrefly/literals_interactions.toml | 12 +-- .../pyrefly/literals_literalstring.toml | 20 ++--- .../pyrefly/literals_parameterizations.toml | 35 ++++----- .../results/pyrefly/literals_semantics.toml | 9 ++- .../pyrefly/namedtuples_define_class.toml | 25 +++--- .../namedtuples_define_functional.toml | 29 +++---- .../pyrefly/namedtuples_type_compat.toml | 5 +- .../results/pyrefly/namedtuples_usage.toml | 17 +++-- .../results/pyrefly/narrowing_typeguard.toml | 9 ++- .../results/pyrefly/narrowing_typeis.toml | 19 ++--- .../results/pyrefly/overloads_basic.toml | 3 +- .../pyrefly/overloads_consistency.toml | 5 +- .../pyrefly/overloads_definitions.toml | 14 ++-- .../pyrefly/overloads_definitions_stub.toml | 6 +- .../results/pyrefly/overloads_evaluation.toml | 36 ++++----- .../pyrefly/protocols_class_objects.toml | 6 +- .../results/pyrefly/protocols_definition.toml | 38 +++++----- .../results/pyrefly/protocols_explicit.toml | 2 +- .../results/pyrefly/protocols_generic.toml | 20 ++--- .../results/pyrefly/protocols_merging.toml | 10 +-- .../results/pyrefly/protocols_modules.toml | 8 +- .../results/pyrefly/protocols_recursive.toml | 1 + .../pyrefly/protocols_runtime_checkable.toml | 6 +- .../results/pyrefly/protocols_self.toml | 4 +- .../results/pyrefly/protocols_subtyping.toml | 15 ++-- .../results/pyrefly/qualifiers_annotated.toml | 32 ++++---- .../pyrefly/qualifiers_final_annotation.toml | 44 +++++------ .../pyrefly/qualifiers_final_decorator.toml | 18 ++--- .../results/pyrefly/specialtypes_any.toml | 1 + .../results/pyrefly/specialtypes_never.toml | 8 +- .../results/pyrefly/specialtypes_none.toml | 7 +- .../pyrefly/specialtypes_promotions.toml | 3 +- .../results/pyrefly/specialtypes_type.toml | 30 ++++---- .../results/pyrefly/tuples_type_compat.toml | 49 ++++++------ .../results/pyrefly/tuples_type_form.toml | 23 +++--- .../results/pyrefly/tuples_unpacked.toml | 11 +-- .../pyrefly/typeddicts_alt_syntax.toml | 23 +++--- .../pyrefly/typeddicts_class_syntax.toml | 11 +-- .../pyrefly/typeddicts_extra_items.toml | 76 +++++++++---------- .../results/pyrefly/typeddicts_final.toml | 1 + .../pyrefly/typeddicts_inheritance.toml | 4 +- .../pyrefly/typeddicts_operations.toml | 25 +++--- .../results/pyrefly/typeddicts_readonly.toml | 13 ++-- .../typeddicts_readonly_consistency.toml | 15 ++-- .../typeddicts_readonly_inheritance.toml | 14 ++-- .../pyrefly/typeddicts_readonly_kwargs.toml | 3 +- .../pyrefly/typeddicts_readonly_update.toml | 3 +- .../results/pyrefly/typeddicts_required.toml | 12 +-- .../pyrefly/typeddicts_type_consistency.toml | 19 ++--- .../results/pyrefly/typeddicts_usage.toml | 13 ++-- conformance/results/results.html | 2 +- conformance/src/results_template.html | 2 +- conformance/src/type_checker.py | 26 ++++++- 140 files changed, 1155 insertions(+), 1039 deletions(-) diff --git a/conformance/results/pyrefly/aliases_explicit.toml b/conformance/results/pyrefly/aliases_explicit.toml index bb7b6d777..ced5ae989 100644 --- a/conformance/results/pyrefly/aliases_explicit.toml +++ b/conformance/results/pyrefly/aliases_explicit.toml @@ -1,28 +1,29 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_explicit.py:67:9-28: `TypeAlias[GoodTypeAlias2, type[int | None]]` is not subscriptable [unsupported-operation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_explicit.py:68:9-28: `TypeAlias[GoodTypeAlias3, type[list[int | None]]]` is not subscriptable [unsupported-operation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_explicit.py:69:9-33: Expected 1 type argument for `GoodTypeAlias4`, got 2 [bad-specialization] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_explicit.py:70:9-33: Expected 1 type argument for `GoodTypeAlias8`, got 2 [bad-specialization] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_explicit.py:71:9-33: Expected a valid ParamSpec expression, got `int` [invalid-param-spec] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_explicit.py:79:21-61: function call cannot be used in annotations [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_explicit.py:80:21-31: list literal cannot be used in annotations [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_explicit.py:81:21-34: tuple literal cannot be used in annotations [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_explicit.py:82:21-44: list comprehension cannot be used in annotations [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_explicit.py:83:21-31: dict literal cannot be used in annotations [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_explicit.py:83:23-24: Could not find name `a` [unknown-name] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_explicit.py:83:28-29: Could not find name `b` [unknown-name] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_explicit.py:84:21-36: function call cannot be used in annotations [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_explicit.py:85:21-29: invalid subscript expression cannot be used in annotations [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_explicit.py:86:21-42: if expression cannot be used in annotations [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_explicit.py:87:21-25: Expected `BadTypeAlias9` to be a type alias, got `Literal[3]` [type-alias-error] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_explicit.py:88:22-26: bool literal cannot be used in annotations [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_explicit.py:89:22-23: number literal cannot be used in annotations [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_explicit.py:90:22-33: boolean operation cannot be used in annotations [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_explicit.py:91:22-32: f-string cannot be used in annotations [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_explicit.py:100:5-19: `TypeAlias[ListAlias, type[list[Unknown]]]` is not subscriptable [unsupported-operation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_explicit.py:101:6-20: Expected a callable, got TypeAlias[ListOrSetAlias, type[list[Unknown] | set[Unknown]]] [not-callable] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_explicit.py:102:5-24: `TypeAlias[ListOrSetAlias, type[list[Unknown] | set[Unknown]]]` is not subscriptable [unsupported-operation] +ERROR aliases_explicit.py:67:9-28: `TypeAlias[GoodTypeAlias2, type[int | None]]` is not subscriptable [unsupported-operation] +ERROR aliases_explicit.py:68:9-28: `TypeAlias[GoodTypeAlias3, type[list[int | None]]]` is not subscriptable [unsupported-operation] +ERROR aliases_explicit.py:69:9-33: Expected 1 type argument for `GoodTypeAlias4`, got 2 [bad-specialization] +ERROR aliases_explicit.py:70:9-33: Expected 1 type argument for `GoodTypeAlias8`, got 2 [bad-specialization] +ERROR aliases_explicit.py:71:9-33: Expected a valid ParamSpec expression, got `int` [invalid-param-spec] +ERROR aliases_explicit.py:79:21-61: function call cannot be used in annotations [invalid-annotation] +ERROR aliases_explicit.py:80:21-31: list literal cannot be used in annotations [invalid-annotation] +ERROR aliases_explicit.py:81:21-34: tuple literal cannot be used in annotations [invalid-annotation] +ERROR aliases_explicit.py:82:21-44: list comprehension cannot be used in annotations [invalid-annotation] +ERROR aliases_explicit.py:83:21-31: dict literal cannot be used in annotations [invalid-annotation] +ERROR aliases_explicit.py:83:23-24: Could not find name `a` [unknown-name] +ERROR aliases_explicit.py:83:28-29: Could not find name `b` [unknown-name] +ERROR aliases_explicit.py:84:21-36: function call cannot be used in annotations [invalid-annotation] +ERROR aliases_explicit.py:85:21-29: invalid subscript expression cannot be used in annotations [invalid-annotation] +ERROR aliases_explicit.py:86:21-42: if expression cannot be used in annotations [invalid-annotation] +ERROR aliases_explicit.py:87:21-25: Expected `BadTypeAlias9` to be a type alias, got `Literal[3]` [type-alias-error] +ERROR aliases_explicit.py:88:22-26: bool literal cannot be used in annotations [invalid-annotation] +ERROR aliases_explicit.py:89:22-23: number literal cannot be used in annotations [invalid-annotation] +ERROR aliases_explicit.py:90:22-33: boolean operation cannot be used in annotations [invalid-annotation] +ERROR aliases_explicit.py:91:22-32: f-string cannot be used in annotations [invalid-annotation] +ERROR aliases_explicit.py:100:5-19: `TypeAlias[ListAlias, type[list[Unknown]]]` is not subscriptable [unsupported-operation] +ERROR aliases_explicit.py:101:6-20: Expected a callable, got TypeAlias[ListOrSetAlias, type[list[Unknown] | set[Unknown]]] [not-callable] +ERROR aliases_explicit.py:102:5-24: `TypeAlias[ListOrSetAlias, type[list[Unknown] | set[Unknown]]]` is not subscriptable [unsupported-operation] """ diff --git a/conformance/results/pyrefly/aliases_implicit.toml b/conformance/results/pyrefly/aliases_implicit.toml index 124c1a3b9..ee563bb49 100644 --- a/conformance/results/pyrefly/aliases_implicit.toml +++ b/conformance/results/pyrefly/aliases_implicit.toml @@ -11,21 +11,21 @@ Line 113: Expected 1 errors Line 117: Expected 1 errors """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_implicit.py:76:9-28: `type[int | None]` is not subscriptable [unsupported-operation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_implicit.py:77:9-28: `type[list[int | None]]` is not subscriptable [unsupported-operation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_implicit.py:78:9-33: Expected 1 type argument for `GoodTypeAlias4`, got 2 [bad-specialization] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_implicit.py:79:9-33: Expected 1 type argument for `GoodTypeAlias8`, got 2 [bad-specialization] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_implicit.py:80:9-33: Expected a valid ParamSpec expression, got `int` [invalid-param-spec] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_implicit.py:81:9-29: Type `str` is not assignable to upper bound `float` of type variable `TFloat` [bad-specialization] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_implicit.py:107:9-22: Expected a type form, got instance of `list[type[int] | type[str]]` [not-a-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_implicit.py:108:9-22: Expected a type form, got instance of `tuple[tuple[type[int], type[str]]]` [not-a-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_implicit.py:109:9-22: Expected a type form, got instance of `list[type[int]]` [not-a-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_implicit.py:110:9-22: Expected a type form, got instance of `dict[str, str]` [not-a-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_implicit.py:114:9-22: Expected a type form, got instance of `Literal[3]` [not-a-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_implicit.py:115:10-24: Expected a type form, got instance of `Literal[True]` [not-a-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_implicit.py:116:10-24: Expected a type form, got instance of `Literal[1]` [not-a-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_implicit.py:118:10-24: Expected a type form, got instance of `Literal['int']` [not-a-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_implicit.py:119:10-24: Expected a type form, got instance of `Literal['int | str']` [not-a-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_implicit.py:133:6-20: Expected a callable, got type[list[Unknown] | set[Unknown]] [not-callable] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_implicit.py:135:5-24: `type[list[Unknown] | set[Unknown]]` is not subscriptable [unsupported-operation] +ERROR aliases_implicit.py:76:9-28: `type[int | None]` is not subscriptable [unsupported-operation] +ERROR aliases_implicit.py:77:9-28: `type[list[int | None]]` is not subscriptable [unsupported-operation] +ERROR aliases_implicit.py:78:9-33: Expected 1 type argument for `GoodTypeAlias4`, got 2 [bad-specialization] +ERROR aliases_implicit.py:79:9-33: Expected 1 type argument for `GoodTypeAlias8`, got 2 [bad-specialization] +ERROR aliases_implicit.py:80:9-33: Expected a valid ParamSpec expression, got `int` [invalid-param-spec] +ERROR aliases_implicit.py:81:9-29: Type `str` is not assignable to upper bound `float` of type variable `TFloat` [bad-specialization] +ERROR aliases_implicit.py:107:9-22: Expected a type form, got instance of `list[type[int] | type[str]]` [not-a-type] +ERROR aliases_implicit.py:108:9-22: Expected a type form, got instance of `tuple[tuple[type[int], type[str]]]` [not-a-type] +ERROR aliases_implicit.py:109:9-22: Expected a type form, got instance of `list[type[int]]` [not-a-type] +ERROR aliases_implicit.py:110:9-22: Expected a type form, got instance of `dict[str, str]` [not-a-type] +ERROR aliases_implicit.py:114:9-22: Expected a type form, got instance of `Literal[3]` [not-a-type] +ERROR aliases_implicit.py:115:10-24: Expected a type form, got instance of `Literal[True]` [not-a-type] +ERROR aliases_implicit.py:116:10-24: Expected a type form, got instance of `Literal[1]` [not-a-type] +ERROR aliases_implicit.py:118:10-24: Expected a type form, got instance of `Literal['int']` [not-a-type] +ERROR aliases_implicit.py:119:10-24: Expected a type form, got instance of `Literal['int | str']` [not-a-type] +ERROR aliases_implicit.py:133:6-20: Expected a callable, got type[list[Unknown] | set[Unknown]] [not-callable] +ERROR aliases_implicit.py:135:5-24: `type[list[Unknown] | set[Unknown]]` is not subscriptable [unsupported-operation] """ diff --git a/conformance/results/pyrefly/aliases_newtype.toml b/conformance/results/pyrefly/aliases_newtype.toml index 31a4d5e20..fa14cc80f 100644 --- a/conformance/results/pyrefly/aliases_newtype.toml +++ b/conformance/results/pyrefly/aliases_newtype.toml @@ -1,19 +1,20 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_newtype.py:11:8-14: Argument `Literal['user']` is not assignable to parameter `_x` with type `int` in function `UserId.__new__` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_newtype.py:12:14-16: `Literal[42]` is not assignable to `UserId` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_newtype.py:18:11-17: `type[UserId]` is not assignable to `type` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_newtype.py:23:16-22: NewType `UserId` not allowed in isinstance() [invalid-argument] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_newtype.py:26:21-27: Subclassing a NewType not allowed [invalid-inheritance] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_newtype.py:35:20-29: Expected string literal "GoodName" [invalid-argument] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_newtype.py:41:6-23: Expected 0 type arguments for `GoodNewType1`, got 1 [bad-specialization] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_newtype.py:47:38-47: Second argument to NewType is invalid [invalid-argument] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_newtype.py:50:38-45: Second argument to NewType cannot be an unbound generic [invalid-argument] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_newtype.py:52:38-46: Second argument to NewType cannot be a protocol [invalid-argument] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_newtype.py:54:38-48: Second argument to NewType is invalid [invalid-argument] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_newtype.py:61:38-41: Second argument to NewType is invalid [invalid-argument] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_newtype.py:63:43-46: Expected 2 positional arguments, got 3 in function `typing.NewType.__init__` [bad-argument-count] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_newtype.py:65:38-41: Second argument to NewType is invalid [invalid-argument] +ERROR aliases_newtype.py:11:8-14: Argument `Literal['user']` is not assignable to parameter `_x` with type `int` in function `UserId.__new__` [bad-argument-type] +ERROR aliases_newtype.py:12:14-16: `Literal[42]` is not assignable to `UserId` [bad-assignment] +ERROR aliases_newtype.py:18:11-17: `type[UserId]` is not assignable to `type` [bad-assignment] +ERROR aliases_newtype.py:23:16-22: NewType `UserId` not allowed in isinstance() [invalid-argument] +ERROR aliases_newtype.py:26:21-27: Subclassing a NewType not allowed [invalid-inheritance] +ERROR aliases_newtype.py:35:20-29: Expected string literal "GoodName" [invalid-argument] +ERROR aliases_newtype.py:41:6-23: Expected 0 type arguments for `GoodNewType1`, got 1 [bad-specialization] +ERROR aliases_newtype.py:47:38-47: Second argument to NewType is invalid [invalid-argument] +ERROR aliases_newtype.py:50:38-45: Second argument to NewType cannot be an unbound generic [invalid-argument] +ERROR aliases_newtype.py:52:38-46: Second argument to NewType cannot be a protocol [invalid-argument] +ERROR aliases_newtype.py:54:38-48: Second argument to NewType is invalid [invalid-argument] +ERROR aliases_newtype.py:61:38-41: Second argument to NewType is invalid [invalid-argument] +ERROR aliases_newtype.py:63:43-46: Expected 2 positional arguments, got 3 in function `typing.NewType.__init__` [bad-argument-count] +ERROR aliases_newtype.py:65:38-41: Second argument to NewType is invalid [invalid-argument] """ diff --git a/conformance/results/pyrefly/aliases_recursive.toml b/conformance/results/pyrefly/aliases_recursive.toml index 2d08b464d..e227e2baf 100644 --- a/conformance/results/pyrefly/aliases_recursive.toml +++ b/conformance/results/pyrefly/aliases_recursive.toml @@ -20,14 +20,14 @@ Line 67: Unexpected errors ['`type[list[Unknown]]` is not subscriptable [unsuppo Line 68: Unexpected errors ['`type[list[Unknown]]` is not subscriptable [unsupported-operation]'] """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_recursive.py:30:36-52: Expected a type form, got instance of `Literal['RecursiveTuple']` [not-a-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_recursive.py:42:45-63: Expected a type form, got instance of `Literal['RecursiveMapping']` [not-a-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_recursive.py:58:26-54: Expected a type form, got instance of `_SpecialForm` [not-a-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_recursive.py:59:25-47: `type[list[Unknown]]` is not subscriptable [unsupported-operation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_recursive.py:62:5-27: `type[list[Unknown]]` is not subscriptable [unsupported-operation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_recursive.py:63:5-27: `type[list[Unknown]]` is not subscriptable [unsupported-operation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_recursive.py:65:26-63: Expected a type form, got instance of `_SpecialForm` [not-a-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_recursive.py:67:5-32: `type[list[Unknown]]` is not subscriptable [unsupported-operation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_recursive.py:68:5-34: `type[list[Unknown]]` is not subscriptable [unsupported-operation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_recursive.py:69:5-32: `type[list[Unknown]]` is not subscriptable [unsupported-operation] +ERROR aliases_recursive.py:30:36-52: Expected a type form, got instance of `Literal['RecursiveTuple']` [not-a-type] +ERROR aliases_recursive.py:42:45-63: Expected a type form, got instance of `Literal['RecursiveMapping']` [not-a-type] +ERROR aliases_recursive.py:58:26-54: Expected a type form, got instance of `_SpecialForm` [not-a-type] +ERROR aliases_recursive.py:59:25-47: `type[list[Unknown]]` is not subscriptable [unsupported-operation] +ERROR aliases_recursive.py:62:5-27: `type[list[Unknown]]` is not subscriptable [unsupported-operation] +ERROR aliases_recursive.py:63:5-27: `type[list[Unknown]]` is not subscriptable [unsupported-operation] +ERROR aliases_recursive.py:65:26-63: Expected a type form, got instance of `_SpecialForm` [not-a-type] +ERROR aliases_recursive.py:67:5-32: `type[list[Unknown]]` is not subscriptable [unsupported-operation] +ERROR aliases_recursive.py:68:5-34: `type[list[Unknown]]` is not subscriptable [unsupported-operation] +ERROR aliases_recursive.py:69:5-32: `type[list[Unknown]]` is not subscriptable [unsupported-operation] """ diff --git a/conformance/results/pyrefly/aliases_type_statement.toml b/conformance/results/pyrefly/aliases_type_statement.toml index 3e8999c57..a838d5576 100644 --- a/conformance/results/pyrefly/aliases_type_statement.toml +++ b/conformance/results/pyrefly/aliases_type_statement.toml @@ -13,28 +13,28 @@ Lines 51, 52: Expected error (tag 'TA14') Lines 88, 89: Expected error (tag 'RTA6') """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_type_statement.py:17:1-21: Object of class `TypeAliasType` has no attribute `bit_count` [missing-attribute] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_type_statement.py:19:1-11: Expected a callable, got TypeAlias[GoodAlias1, type[int]] [not-callable] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_type_statement.py:23:7-30: Object of class `TypeAliasType` has no attribute `other_attrib` [missing-attribute] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_type_statement.py:31:22-32: Expected class object, got `TypeAliasType` [invalid-argument] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_type_statement.py:37:22-62: function call cannot be used in annotations [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_type_statement.py:38:22-32: list literal cannot be used in annotations [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_type_statement.py:39:22-35: tuple literal cannot be used in annotations [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_type_statement.py:40:22-45: list comprehension cannot be used in annotations [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_type_statement.py:41:22-32: dict literal cannot be used in annotations [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_type_statement.py:41:24-25: Could not find name `a` [unknown-name] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_type_statement.py:41:29-30: Could not find name `b` [unknown-name] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_type_statement.py:42:22-37: function call cannot be used in annotations [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_type_statement.py:43:22-30: invalid subscript expression cannot be used in annotations [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_type_statement.py:44:22-43: if expression cannot be used in annotations [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_type_statement.py:45:22-26: Expected `BadTypeAlias9` to be a type alias, got `Literal[1]` [type-alias-error] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_type_statement.py:46:23-27: bool literal cannot be used in annotations [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_type_statement.py:47:23-24: number literal cannot be used in annotations [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_type_statement.py:48:23-34: boolean operation cannot be used in annotations [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_type_statement.py:49:23-33: f-string cannot be used in annotations [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_type_statement.py:56:5-30: `type` statement is not allowed in this context [invalid-syntax] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_type_statement.py:62:15-25: Type parameters used in `TA1` but not declared [invalid-type-var] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_type_statement.py:67:12-20: Type parameters used in `TA2` but not declared [invalid-type-var] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_type_statement.py:77:7-41: Type `str` is not assignable to upper bound `int` of type variable `S` [bad-specialization] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_type_statement.py:79:7-41: Type `int` is not assignable to upper bound `str` of type variable `T` [bad-specialization] +ERROR aliases_type_statement.py:17:1-21: Object of class `TypeAliasType` has no attribute `bit_count` [missing-attribute] +ERROR aliases_type_statement.py:19:1-11: Expected a callable, got TypeAlias[GoodAlias1, type[int]] [not-callable] +ERROR aliases_type_statement.py:23:7-30: Object of class `TypeAliasType` has no attribute `other_attrib` [missing-attribute] +ERROR aliases_type_statement.py:31:22-32: Expected class object, got `TypeAliasType` [invalid-argument] +ERROR aliases_type_statement.py:37:22-62: function call cannot be used in annotations [invalid-annotation] +ERROR aliases_type_statement.py:38:22-32: list literal cannot be used in annotations [invalid-annotation] +ERROR aliases_type_statement.py:39:22-35: tuple literal cannot be used in annotations [invalid-annotation] +ERROR aliases_type_statement.py:40:22-45: list comprehension cannot be used in annotations [invalid-annotation] +ERROR aliases_type_statement.py:41:22-32: dict literal cannot be used in annotations [invalid-annotation] +ERROR aliases_type_statement.py:41:24-25: Could not find name `a` [unknown-name] +ERROR aliases_type_statement.py:41:29-30: Could not find name `b` [unknown-name] +ERROR aliases_type_statement.py:42:22-37: function call cannot be used in annotations [invalid-annotation] +ERROR aliases_type_statement.py:43:22-30: invalid subscript expression cannot be used in annotations [invalid-annotation] +ERROR aliases_type_statement.py:44:22-43: if expression cannot be used in annotations [invalid-annotation] +ERROR aliases_type_statement.py:45:22-26: Expected `BadTypeAlias9` to be a type alias, got `Literal[1]` [type-alias-error] +ERROR aliases_type_statement.py:46:23-27: bool literal cannot be used in annotations [invalid-annotation] +ERROR aliases_type_statement.py:47:23-24: number literal cannot be used in annotations [invalid-annotation] +ERROR aliases_type_statement.py:48:23-34: boolean operation cannot be used in annotations [invalid-annotation] +ERROR aliases_type_statement.py:49:23-33: f-string cannot be used in annotations [invalid-annotation] +ERROR aliases_type_statement.py:56:5-30: `type` statement is not allowed in this context [invalid-syntax] +ERROR aliases_type_statement.py:62:15-25: Type parameters used in `TA1` but not declared [invalid-type-var] +ERROR aliases_type_statement.py:67:12-20: Type parameters used in `TA2` but not declared [invalid-type-var] +ERROR aliases_type_statement.py:77:7-41: Type `str` is not assignable to upper bound `int` of type variable `S` [bad-specialization] +ERROR aliases_type_statement.py:79:7-41: Type `int` is not assignable to upper bound `str` of type variable `T` [bad-specialization] """ diff --git a/conformance/results/pyrefly/aliases_typealiastype.toml b/conformance/results/pyrefly/aliases_typealiastype.toml index 1ba0492ec..80989c4cf 100644 --- a/conformance/results/pyrefly/aliases_typealiastype.toml +++ b/conformance/results/pyrefly/aliases_typealiastype.toml @@ -29,21 +29,21 @@ Line 38: Unexpected errors ['Expected a type form, got instance of `GenericAlias Line 39: Unexpected errors ['Expected a type form, got instance of `GenericAlias` [not-a-type]', 'Expected an iterable, got `type[tuple[int, str, int]]` [not-iterable]'] """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_typealiastype.py:17:63-67: Argument `tuple[type[TypeVar[T]]]` is not assignable to parameter `type_params` with type `tuple[ParamSpec | TypeVar | TypeVarTuple, ...]` in function `typing.TypeAliasType.__new__` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_typealiastype.py:18:73-79: Argument `tuple[type[TypeVar[S]], type[TypeVar[T]]]` is not assignable to parameter `type_params` with type `tuple[ParamSpec | TypeVar | TypeVarTuple, ...]` in function `typing.TypeAliasType.__new__` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_typealiastype.py:19:81-85: Argument `tuple[type[TypeVar[T]]]` is not assignable to parameter `type_params` with type `tuple[ParamSpec | TypeVar | TypeVarTuple, ...]` in function `typing.TypeAliasType.__new__` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_typealiastype.py:22:40-64: Expected a type form, got instance of `Literal['GoodAlias5[S, TStr, P]']` [not-a-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_typealiastype.py:23:17-33: Argument `tuple[type[TypeVar[S]], type[TypeVar[TStr]], type[ParamSpec[P]], type[TypeVarTuple[Ts]]]` is not assignable to parameter `type_params` with type `tuple[ParamSpec | TypeVar | TypeVarTuple, ...]` in function `typing.TypeAliasType.__new__` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_typealiastype.py:32:7-30: Object of class `TypeAliasType` has no attribute `other_attrib` [missing-attribute] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_typealiastype.py:35:5-20: Expected a type form, got instance of `GenericAlias` [not-a-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_typealiastype.py:36:5-20: Expected a type form, got instance of `GenericAlias` [not-a-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_typealiastype.py:37:5-40: Expected a type form, got instance of `GenericAlias` [not-a-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_typealiastype.py:38:5-40: Expected a type form, got instance of `GenericAlias` [not-a-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_typealiastype.py:39:5-60: Expected a type form, got instance of `GenericAlias` [not-a-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_typealiastype.py:39:16-59: Expected an iterable, got `type[tuple[int, str, int]]` [not-iterable] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_typealiastype.py:40:5-30: Expected a type form, got instance of `GenericAlias` [not-a-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_typealiastype.py:43:61-65: Argument `tuple[type[TypeVar[T]]]` is not assignable to parameter `type_params` with type `tuple[ParamSpec | TypeVar | TypeVarTuple, ...]` in function `typing.TypeAliasType.__new__` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_typealiastype.py:45:57-65: Argument `tuple[type[TypeVar[S]], type[TypeVar[T]]]` is not assignable to parameter `type_params` with type `tuple[ParamSpec | TypeVar | TypeVarTuple, ...]` in function `typing.TypeAliasType.__new__` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_typealiastype.py:47:74-78: Argument `tuple[type[TypeVar[T]]]` is not assignable to parameter `type_params` with type `tuple[ParamSpec | TypeVar | TypeVarTuple, ...]` in function `typing.TypeAliasType.__new__` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/aliases_typealiastype.py:66:47-57: `BadAlias21` is uninitialized [unbound-name] +ERROR aliases_typealiastype.py:17:63-67: Argument `tuple[type[TypeVar[T]]]` is not assignable to parameter `type_params` with type `tuple[ParamSpec | TypeVar | TypeVarTuple, ...]` in function `typing.TypeAliasType.__new__` [bad-argument-type] +ERROR aliases_typealiastype.py:18:73-79: Argument `tuple[type[TypeVar[S]], type[TypeVar[T]]]` is not assignable to parameter `type_params` with type `tuple[ParamSpec | TypeVar | TypeVarTuple, ...]` in function `typing.TypeAliasType.__new__` [bad-argument-type] +ERROR aliases_typealiastype.py:19:81-85: Argument `tuple[type[TypeVar[T]]]` is not assignable to parameter `type_params` with type `tuple[ParamSpec | TypeVar | TypeVarTuple, ...]` in function `typing.TypeAliasType.__new__` [bad-argument-type] +ERROR aliases_typealiastype.py:22:40-64: Expected a type form, got instance of `Literal['GoodAlias5[S, TStr, P]']` [not-a-type] +ERROR aliases_typealiastype.py:23:17-33: Argument `tuple[type[TypeVar[S]], type[TypeVar[TStr]], type[ParamSpec[P]], type[TypeVarTuple[Ts]]]` is not assignable to parameter `type_params` with type `tuple[ParamSpec | TypeVar | TypeVarTuple, ...]` in function `typing.TypeAliasType.__new__` [bad-argument-type] +ERROR aliases_typealiastype.py:32:7-30: Object of class `TypeAliasType` has no attribute `other_attrib` [missing-attribute] +ERROR aliases_typealiastype.py:35:5-20: Expected a type form, got instance of `GenericAlias` [not-a-type] +ERROR aliases_typealiastype.py:36:5-20: Expected a type form, got instance of `GenericAlias` [not-a-type] +ERROR aliases_typealiastype.py:37:5-40: Expected a type form, got instance of `GenericAlias` [not-a-type] +ERROR aliases_typealiastype.py:38:5-40: Expected a type form, got instance of `GenericAlias` [not-a-type] +ERROR aliases_typealiastype.py:39:5-60: Expected a type form, got instance of `GenericAlias` [not-a-type] +ERROR aliases_typealiastype.py:39:16-59: Expected an iterable, got `type[tuple[int, str, int]]` [not-iterable] +ERROR aliases_typealiastype.py:40:5-30: Expected a type form, got instance of `GenericAlias` [not-a-type] +ERROR aliases_typealiastype.py:43:61-65: Argument `tuple[type[TypeVar[T]]]` is not assignable to parameter `type_params` with type `tuple[ParamSpec | TypeVar | TypeVarTuple, ...]` in function `typing.TypeAliasType.__new__` [bad-argument-type] +ERROR aliases_typealiastype.py:45:57-65: Argument `tuple[type[TypeVar[S]], type[TypeVar[T]]]` is not assignable to parameter `type_params` with type `tuple[ParamSpec | TypeVar | TypeVarTuple, ...]` in function `typing.TypeAliasType.__new__` [bad-argument-type] +ERROR aliases_typealiastype.py:47:74-78: Argument `tuple[type[TypeVar[T]]]` is not assignable to parameter `type_params` with type `tuple[ParamSpec | TypeVar | TypeVarTuple, ...]` in function `typing.TypeAliasType.__new__` [bad-argument-type] +ERROR aliases_typealiastype.py:66:47-57: `BadAlias21` is uninitialized [unbound-name] """ diff --git a/conformance/results/pyrefly/annotations_coroutines.toml b/conformance/results/pyrefly/annotations_coroutines.toml index cdd4d0cd9..be211bd5b 100644 --- a/conformance/results/pyrefly/annotations_coroutines.toml +++ b/conformance/results/pyrefly/annotations_coroutines.toml @@ -1,3 +1,4 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ diff --git a/conformance/results/pyrefly/annotations_forward_refs.toml b/conformance/results/pyrefly/annotations_forward_refs.toml index 59fcdaa3e..f15a1fe41 100644 --- a/conformance/results/pyrefly/annotations_forward_refs.toml +++ b/conformance/results/pyrefly/annotations_forward_refs.toml @@ -14,23 +14,23 @@ Line 87: Unexpected errors ['Expected a type form, got instance of `(self: Self@ Line 96: Unexpected errors ['assert_type(Any, int) failed [assert-type]'] """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_forward_refs.py:41:10-50: function call cannot be used in annotations [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_forward_refs.py:42:10-20: list literal cannot be used in annotations [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_forward_refs.py:43:10-20: tuple literal cannot be used in annotations [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_forward_refs.py:44:10-33: list comprehension cannot be used in annotations [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_forward_refs.py:45:10-12: dict literal cannot be used in annotations [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_forward_refs.py:46:10-26: function call cannot be used in annotations [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_forward_refs.py:47:10-18: invalid subscript expression cannot be used in annotations [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_forward_refs.py:48:10-31: if expression cannot be used in annotations [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_forward_refs.py:49:10-14: Expected a type form, got instance of `Literal[1]` [not-a-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_forward_refs.py:50:11-15: bool literal cannot be used in annotations [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_forward_refs.py:51:11-12: number literal cannot be used in annotations [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_forward_refs.py:52:11-13: unary operation cannot be used in annotations [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_forward_refs.py:53:11-21: boolean operation cannot be used in annotations [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_forward_refs.py:54:11-17: f-string cannot be used in annotations [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_forward_refs.py:55:11-16: Expected a type form, got instance of `Module[types]` [not-a-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_forward_refs.py:80:14-20: Could not find name `ClassF` [unknown-name] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_forward_refs.py:87:9-12: Expected a type form, got instance of `(self: Self@ClassD) -> None` [not-a-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_forward_refs.py:89:8-11: Expected a type form, got instance of `(self: Self@ClassD) -> None` [not-a-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_forward_refs.py:96:12-27: assert_type(Any, int) failed [assert-type] +ERROR annotations_forward_refs.py:41:10-50: function call cannot be used in annotations [invalid-annotation] +ERROR annotations_forward_refs.py:42:10-20: list literal cannot be used in annotations [invalid-annotation] +ERROR annotations_forward_refs.py:43:10-20: tuple literal cannot be used in annotations [invalid-annotation] +ERROR annotations_forward_refs.py:44:10-33: list comprehension cannot be used in annotations [invalid-annotation] +ERROR annotations_forward_refs.py:45:10-12: dict literal cannot be used in annotations [invalid-annotation] +ERROR annotations_forward_refs.py:46:10-26: function call cannot be used in annotations [invalid-annotation] +ERROR annotations_forward_refs.py:47:10-18: invalid subscript expression cannot be used in annotations [invalid-annotation] +ERROR annotations_forward_refs.py:48:10-31: if expression cannot be used in annotations [invalid-annotation] +ERROR annotations_forward_refs.py:49:10-14: Expected a type form, got instance of `Literal[1]` [not-a-type] +ERROR annotations_forward_refs.py:50:11-15: bool literal cannot be used in annotations [invalid-annotation] +ERROR annotations_forward_refs.py:51:11-12: number literal cannot be used in annotations [invalid-annotation] +ERROR annotations_forward_refs.py:52:11-13: unary operation cannot be used in annotations [invalid-annotation] +ERROR annotations_forward_refs.py:53:11-21: boolean operation cannot be used in annotations [invalid-annotation] +ERROR annotations_forward_refs.py:54:11-17: f-string cannot be used in annotations [invalid-annotation] +ERROR annotations_forward_refs.py:55:11-16: Expected a type form, got instance of `Module[types]` [not-a-type] +ERROR annotations_forward_refs.py:80:14-20: Could not find name `ClassF` [unknown-name] +ERROR annotations_forward_refs.py:87:9-12: Expected a type form, got instance of `(self: Self@ClassD) -> None` [not-a-type] +ERROR annotations_forward_refs.py:89:8-11: Expected a type form, got instance of `(self: Self@ClassD) -> None` [not-a-type] +ERROR annotations_forward_refs.py:96:12-27: assert_type(Any, int) failed [assert-type] """ diff --git a/conformance/results/pyrefly/annotations_generators.toml b/conformance/results/pyrefly/annotations_generators.toml index 84f9fd220..5ab1f191e 100644 --- a/conformance/results/pyrefly/annotations_generators.toml +++ b/conformance/results/pyrefly/annotations_generators.toml @@ -7,16 +7,16 @@ errors_diff = """ Line 190: Unexpected errors ['Expected to yield a value of type `int`, but a bare `yield` gives `None` instead [invalid-yield]'] """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_generators.py:51:21-39: Function declared to return `C`, but one or more paths are missing an explicit `return` [bad-return] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_generators.py:54:16-21: Returned type `Literal[False]` is not assignable to declared return type `C` [bad-return] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_generators.py:57:15-16: Type of yielded value `Literal[3]` is not assignable to declared return type `A` [invalid-yield] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_generators.py:66:15-16: Type of yielded value `Literal[3]` is not assignable to declared return type `A` [invalid-yield] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_generators.py:71:12-16: Returned type `Literal[True]` is not assignable to declared return type `None` [bad-return] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_generators.py:75:11-14: Type of yielded value `B` is not assignable to declared return type `A` [invalid-yield] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_generators.py:86:21-24: Generator function should return `Generator` [bad-return] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_generators.py:91:27-30: Async generator function should return `AsyncGenerator` [bad-return] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_generators.py:118:5-29: Cannot yield from a generator of type `Generator[A, None, None]` because it does not match the declared return type `Generator[B, None, Unknown]` [invalid-yield] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_generators.py:119:5-19: Cannot yield from a generator of type `Generator[int, None, None]` because it does not match the declared return type `Generator[B, None, Unknown]` [invalid-yield] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_generators.py:135:5-29: Cannot yield from a generator of type `Generator[None, int, None]` because it does not match the declared return type `Generator[None, str, Unknown]` [invalid-yield] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_generators.py:190:5-10: Expected to yield a value of type `int`, but a bare `yield` gives `None` instead [invalid-yield] +ERROR annotations_generators.py:51:21-39: Function declared to return `C`, but one or more paths are missing an explicit `return` [bad-return] +ERROR annotations_generators.py:54:16-21: Returned type `Literal[False]` is not assignable to declared return type `C` [bad-return] +ERROR annotations_generators.py:57:15-16: Type of yielded value `Literal[3]` is not assignable to declared return type `A` [invalid-yield] +ERROR annotations_generators.py:66:15-16: Type of yielded value `Literal[3]` is not assignable to declared return type `A` [invalid-yield] +ERROR annotations_generators.py:71:12-16: Returned type `Literal[True]` is not assignable to declared return type `None` [bad-return] +ERROR annotations_generators.py:75:11-14: Type of yielded value `B` is not assignable to declared return type `A` [invalid-yield] +ERROR annotations_generators.py:86:21-24: Generator function should return `Generator` [bad-return] +ERROR annotations_generators.py:91:27-30: Async generator function should return `AsyncGenerator` [bad-return] +ERROR annotations_generators.py:118:5-29: Cannot yield from a generator of type `Generator[A, None, None]` because it does not match the declared return type `Generator[B, None, Unknown]` [invalid-yield] +ERROR annotations_generators.py:119:5-19: Cannot yield from a generator of type `Generator[int, None, None]` because it does not match the declared return type `Generator[B, None, Unknown]` [invalid-yield] +ERROR annotations_generators.py:135:5-29: Cannot yield from a generator of type `Generator[None, int, None]` because it does not match the declared return type `Generator[None, str, Unknown]` [invalid-yield] +ERROR annotations_generators.py:190:5-10: Expected to yield a value of type `int`, but a bare `yield` gives `None` instead [invalid-yield] """ diff --git a/conformance/results/pyrefly/annotations_methods.toml b/conformance/results/pyrefly/annotations_methods.toml index e6ff9bd03..06e3f82f9 100644 --- a/conformance/results/pyrefly/annotations_methods.toml +++ b/conformance/results/pyrefly/annotations_methods.toml @@ -1,6 +1,7 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_methods.py:42:12-28: assert_type(B, A) failed [assert-type] +ERROR annotations_methods.py:42:12-28: assert_type(B, A) failed [assert-type] """ diff --git a/conformance/results/pyrefly/annotations_typeexpr.toml b/conformance/results/pyrefly/annotations_typeexpr.toml index c9494e67b..3411fda31 100644 --- a/conformance/results/pyrefly/annotations_typeexpr.toml +++ b/conformance/results/pyrefly/annotations_typeexpr.toml @@ -1,20 +1,21 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_typeexpr.py:88:9-49: function call cannot be used in annotations [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_typeexpr.py:89:9-19: list literal cannot be used in annotations [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_typeexpr.py:90:9-19: tuple literal cannot be used in annotations [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_typeexpr.py:91:9-32: list comprehension cannot be used in annotations [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_typeexpr.py:92:9-11: dict literal cannot be used in annotations [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_typeexpr.py:93:9-24: function call cannot be used in annotations [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_typeexpr.py:94:9-17: invalid subscript expression cannot be used in annotations [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_typeexpr.py:95:9-30: if expression cannot be used in annotations [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_typeexpr.py:96:9-13: Expected a type form, got instance of `Literal[3]` [not-a-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_typeexpr.py:97:10-14: bool literal cannot be used in annotations [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_typeexpr.py:98:10-11: number literal cannot be used in annotations [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_typeexpr.py:99:10-12: unary operation cannot be used in annotations [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_typeexpr.py:100:10-20: boolean operation cannot be used in annotations [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_typeexpr.py:101:10-16: f-string cannot be used in annotations [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/annotations_typeexpr.py:102:10-15: Expected a type form, got instance of `Module[types]` [not-a-type] +ERROR annotations_typeexpr.py:88:9-49: function call cannot be used in annotations [invalid-annotation] +ERROR annotations_typeexpr.py:89:9-19: list literal cannot be used in annotations [invalid-annotation] +ERROR annotations_typeexpr.py:90:9-19: tuple literal cannot be used in annotations [invalid-annotation] +ERROR annotations_typeexpr.py:91:9-32: list comprehension cannot be used in annotations [invalid-annotation] +ERROR annotations_typeexpr.py:92:9-11: dict literal cannot be used in annotations [invalid-annotation] +ERROR annotations_typeexpr.py:93:9-24: function call cannot be used in annotations [invalid-annotation] +ERROR annotations_typeexpr.py:94:9-17: invalid subscript expression cannot be used in annotations [invalid-annotation] +ERROR annotations_typeexpr.py:95:9-30: if expression cannot be used in annotations [invalid-annotation] +ERROR annotations_typeexpr.py:96:9-13: Expected a type form, got instance of `Literal[3]` [not-a-type] +ERROR annotations_typeexpr.py:97:10-14: bool literal cannot be used in annotations [invalid-annotation] +ERROR annotations_typeexpr.py:98:10-11: number literal cannot be used in annotations [invalid-annotation] +ERROR annotations_typeexpr.py:99:10-12: unary operation cannot be used in annotations [invalid-annotation] +ERROR annotations_typeexpr.py:100:10-20: boolean operation cannot be used in annotations [invalid-annotation] +ERROR annotations_typeexpr.py:101:10-16: f-string cannot be used in annotations [invalid-annotation] +ERROR annotations_typeexpr.py:102:10-15: Expected a type form, got instance of `Module[types]` [not-a-type] """ diff --git a/conformance/results/pyrefly/callables_annotation.toml b/conformance/results/pyrefly/callables_annotation.toml index fb0057684..c31b35021 100644 --- a/conformance/results/pyrefly/callables_annotation.toml +++ b/conformance/results/pyrefly/callables_annotation.toml @@ -8,24 +8,24 @@ Line 156: Unexpected errors ['`Proto4[Ellipsis]` is not assignable to `Proto3` [ Line 157: Unexpected errors ['`Proto7` is not assignable to `Proto6` [bad-assignment]'] """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_annotation.py:25:7-10: Expected 1 more positional argument [bad-argument-count] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_annotation.py:26:11-12: Argument `Literal[2]` is not assignable to parameter with type `str` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_annotation.py:27:15-16: Expected 2 positional arguments, got 3 [bad-argument-count] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_annotation.py:29:8-9: Unexpected keyword argument `a` [unexpected-keyword] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_annotation.py:29:8-11: Expected 2 more positional arguments [bad-argument-count] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_annotation.py:29:13-14: Unexpected keyword argument `b` [unexpected-keyword] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_annotation.py:35:8-9: Expected 0 positional arguments, got 1 [bad-argument-count] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_annotation.py:55:5-18: `Callable` requires exactly two arguments but 1 was found [bad-specialization] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_annotation.py:56:14-17: Callable types can only have `ParamSpec` in this position, got `int` [bad-specialization] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_annotation.py:57:18-23: Expected a type form, got instance of `list[type[int]]` [not-a-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_annotation.py:58:5-28: `Callable` requires exactly two arguments but 3 was found [bad-specialization] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_annotation.py:59:15-18: Invalid position for `...` [invalid-argument] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_annotation.py:91:7-15: `() -> str` is not assignable to variable `cb3` with type `(int, ...) -> str` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_annotation.py:93:7-15: `(*, a: int) -> str` is not assignable to variable `cb3` with type `(int, ...) -> str` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_annotation.py:156:20-22: `Proto4[Ellipsis]` is not assignable to `Proto3` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_annotation.py:157:20-22: `Proto7` is not assignable to `Proto6` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_annotation.py:159:25-27: `Proto8` is not assignable to `Proto5[Any]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_annotation.py:172:26-29: `() -> str` is not assignable to `(int, ...) -> str` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_annotation.py:187:48-50: `(int, str) -> str` is not assignable to `(str, ...) -> str` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_annotation.py:189:32-34: `(int, str) -> str` is not assignable to `(str, ...) -> str` [bad-assignment] +ERROR callables_annotation.py:25:7-10: Expected 1 more positional argument [bad-argument-count] +ERROR callables_annotation.py:26:11-12: Argument `Literal[2]` is not assignable to parameter with type `str` [bad-argument-type] +ERROR callables_annotation.py:27:15-16: Expected 2 positional arguments, got 3 [bad-argument-count] +ERROR callables_annotation.py:29:8-9: Unexpected keyword argument `a` [unexpected-keyword] +ERROR callables_annotation.py:29:8-11: Expected 2 more positional arguments [bad-argument-count] +ERROR callables_annotation.py:29:13-14: Unexpected keyword argument `b` [unexpected-keyword] +ERROR callables_annotation.py:35:8-9: Expected 0 positional arguments, got 1 [bad-argument-count] +ERROR callables_annotation.py:55:5-18: `Callable` requires exactly two arguments but 1 was found [bad-specialization] +ERROR callables_annotation.py:56:14-17: Callable types can only have `ParamSpec` in this position, got `int` [bad-specialization] +ERROR callables_annotation.py:57:18-23: Expected a type form, got instance of `list[type[int]]` [not-a-type] +ERROR callables_annotation.py:58:5-28: `Callable` requires exactly two arguments but 3 was found [bad-specialization] +ERROR callables_annotation.py:59:15-18: Invalid position for `...` [invalid-argument] +ERROR callables_annotation.py:91:7-15: `() -> str` is not assignable to variable `cb3` with type `(int, ...) -> str` [bad-assignment] +ERROR callables_annotation.py:93:7-15: `(*, a: int) -> str` is not assignable to variable `cb3` with type `(int, ...) -> str` [bad-assignment] +ERROR callables_annotation.py:156:20-22: `Proto4[Ellipsis]` is not assignable to `Proto3` [bad-assignment] +ERROR callables_annotation.py:157:20-22: `Proto7` is not assignable to `Proto6` [bad-assignment] +ERROR callables_annotation.py:159:25-27: `Proto8` is not assignable to `Proto5[Any]` [bad-assignment] +ERROR callables_annotation.py:172:26-29: `() -> str` is not assignable to `(int, ...) -> str` [bad-assignment] +ERROR callables_annotation.py:187:48-50: `(int, str) -> str` is not assignable to `(str, ...) -> str` [bad-assignment] +ERROR callables_annotation.py:189:32-34: `(int, str) -> str` is not assignable to `(str, ...) -> str` [bad-assignment] """ diff --git a/conformance/results/pyrefly/callables_kwargs.toml b/conformance/results/pyrefly/callables_kwargs.toml index e58b0006e..7e70cf52b 100644 --- a/conformance/results/pyrefly/callables_kwargs.toml +++ b/conformance/results/pyrefly/callables_kwargs.toml @@ -7,23 +7,23 @@ errors_diff = """ Line 111: Expected 1 errors """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_kwargs.py:46:10-12: Missing argument `v1` in function `func1` [missing-argument] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_kwargs.py:46:10-12: Missing argument `v3` in function `func1` [missing-argument] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_kwargs.py:51:32-34: Unexpected keyword argument `v4` in function `func1` [unexpected-keyword] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_kwargs.py:52:11-12: Expected argument `v1` to be passed by name in function `func1` [unexpected-positional-argument] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_kwargs.py:52:11-12: Expected 0 positional arguments, got 3 in function `func1` [bad-argument-count] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_kwargs.py:52:14-16: Expected argument `v3` to be passed by name in function `func1` [unexpected-positional-argument] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_kwargs.py:58:11-20: Unpacked keyword argument `str` is not assignable to parameter `v1` with type `int` in function `func1` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_kwargs.py:61:11-15: Unpacked keyword argument `int | str` is not assignable to parameter `v1` with type `int` in function `func1` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_kwargs.py:61:11-15: Unpacked keyword argument `int | str` is not assignable to parameter `v2` with type `str` in function `func1` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_kwargs.py:61:11-15: Unpacked keyword argument `int | str` is not assignable to parameter `v3` with type `str` in function `func1` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_kwargs.py:63:17-22: Multiple values for argument `v1` in function `func1` [bad-keyword-argument] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_kwargs.py:64:11-12: Argument `Literal[1]` is not assignable to parameter `v3` with type `str` in function `func2` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_kwargs.py:64:14-19: Multiple values for argument `v3` in function `func2` [bad-keyword-argument] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_kwargs.py:65:17-22: Multiple values for argument `v1` in function `func2` [bad-keyword-argument] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_kwargs.py:101:19-24: `(**kwargs: Unpack[TypedDict[TD2]]) -> None` is not assignable to `TDProtocol3` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_kwargs.py:102:19-24: `(**kwargs: Unpack[TypedDict[TD2]]) -> None` is not assignable to `TDProtocol4` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_kwargs.py:103:19-24: `(**kwargs: Unpack[TypedDict[TD2]]) -> None` is not assignable to `TDProtocol5` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_kwargs.py:122:21-30: `Unpack` in **kwargs annotation must be used only with a `TypedDict` [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_kwargs.py:134:19-24: `(*, v1: int, v3: str, v2: str = '') -> None` is not assignable to `TDProtocol6` [bad-assignment] +ERROR callables_kwargs.py:46:10-12: Missing argument `v1` in function `func1` [missing-argument] +ERROR callables_kwargs.py:46:10-12: Missing argument `v3` in function `func1` [missing-argument] +ERROR callables_kwargs.py:51:32-34: Unexpected keyword argument `v4` in function `func1` [unexpected-keyword] +ERROR callables_kwargs.py:52:11-12: Expected argument `v1` to be passed by name in function `func1` [unexpected-positional-argument] +ERROR callables_kwargs.py:52:11-12: Expected 0 positional arguments, got 3 in function `func1` [bad-argument-count] +ERROR callables_kwargs.py:52:14-16: Expected argument `v3` to be passed by name in function `func1` [unexpected-positional-argument] +ERROR callables_kwargs.py:58:11-20: Unpacked keyword argument `str` is not assignable to parameter `v1` with type `int` in function `func1` [bad-argument-type] +ERROR callables_kwargs.py:61:11-15: Unpacked keyword argument `int | str` is not assignable to parameter `v1` with type `int` in function `func1` [bad-argument-type] +ERROR callables_kwargs.py:61:11-15: Unpacked keyword argument `int | str` is not assignable to parameter `v2` with type `str` in function `func1` [bad-argument-type] +ERROR callables_kwargs.py:61:11-15: Unpacked keyword argument `int | str` is not assignable to parameter `v3` with type `str` in function `func1` [bad-argument-type] +ERROR callables_kwargs.py:63:17-22: Multiple values for argument `v1` in function `func1` [bad-keyword-argument] +ERROR callables_kwargs.py:64:11-12: Argument `Literal[1]` is not assignable to parameter `v3` with type `str` in function `func2` [bad-argument-type] +ERROR callables_kwargs.py:64:14-19: Multiple values for argument `v3` in function `func2` [bad-keyword-argument] +ERROR callables_kwargs.py:65:17-22: Multiple values for argument `v1` in function `func2` [bad-keyword-argument] +ERROR callables_kwargs.py:101:19-24: `(**kwargs: Unpack[TypedDict[TD2]]) -> None` is not assignable to `TDProtocol3` [bad-assignment] +ERROR callables_kwargs.py:102:19-24: `(**kwargs: Unpack[TypedDict[TD2]]) -> None` is not assignable to `TDProtocol4` [bad-assignment] +ERROR callables_kwargs.py:103:19-24: `(**kwargs: Unpack[TypedDict[TD2]]) -> None` is not assignable to `TDProtocol5` [bad-assignment] +ERROR callables_kwargs.py:122:21-30: `Unpack` in **kwargs annotation must be used only with a `TypedDict` [invalid-annotation] +ERROR callables_kwargs.py:134:19-24: `(*, v1: int, v3: str, v2: str = '') -> None` is not assignable to `TDProtocol6` [bad-assignment] """ diff --git a/conformance/results/pyrefly/callables_protocol.toml b/conformance/results/pyrefly/callables_protocol.toml index 027e769ea..3bdc990b0 100644 --- a/conformance/results/pyrefly/callables_protocol.toml +++ b/conformance/results/pyrefly/callables_protocol.toml @@ -1,22 +1,23 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_protocol.py:35:7-15: `(*vals: bytes, *, max_items: int | None) -> list[bytes]` is not assignable to variable `cb1` with type `Proto1` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_protocol.py:36:7-15: `(*vals: bytes) -> list[bytes]` is not assignable to variable `cb1` with type `Proto1` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_protocol.py:37:7-15: `(*vals: bytes, *, max_len: str | None) -> list[bytes]` is not assignable to variable `cb1` with type `Proto1` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_protocol.py:67:7-15: `(*a: bytes) -> None` is not assignable to variable `cb2` with type `Proto2` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_protocol.py:68:7-15: `(*a: str, **b: str) -> None` is not assignable to variable `cb2` with type `Proto2` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_protocol.py:69:7-15: `(*a: bytes, **b: bytes) -> None` is not assignable to variable `cb2` with type `Proto2` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_protocol.py:70:7-15: `(**b: str) -> None` is not assignable to variable `cb2` with type `Proto2` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_protocol.py:97:16-24: `(x: int) -> None` is not assignable to `Proto4` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_protocol.py:121:18-26: `(*vals: bytes, *, max_len: int | None = None) -> list[bytes]` is not assignable to `NotProto6` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_protocol.py:169:7-15: `(x: int) -> Any` is not assignable to variable `cb8` with type `Proto8` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_protocol.py:186:33-38: `Literal['str']` is not assignable to attribute `other_attribute` with type `int` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_protocol.py:187:5-18: Object of class `Proto9` has no attribute `xxx` [missing-attribute] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_protocol.py:197:7-32: Object of class `Proto9` has no attribute `other_attribute2` [missing-attribute] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_protocol.py:238:8-17: `(x: int, y: str, /) -> Any` is not assignable to variable `cb11` with type `Proto11` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_protocol.py:260:8-17: `(*args: Any, *, kwarg0: Any) -> None` is not assignable to variable `cb12` with type `Proto12` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_protocol.py:284:27-42: `(path: str) -> str` is not assignable to `Proto13_Default` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_protocol.py:311:27-42: `(*, path: str) -> str` is not assignable to `Proto14_Default` [bad-assignment] +ERROR callables_protocol.py:35:7-15: `(*vals: bytes, *, max_items: int | None) -> list[bytes]` is not assignable to variable `cb1` with type `Proto1` [bad-assignment] +ERROR callables_protocol.py:36:7-15: `(*vals: bytes) -> list[bytes]` is not assignable to variable `cb1` with type `Proto1` [bad-assignment] +ERROR callables_protocol.py:37:7-15: `(*vals: bytes, *, max_len: str | None) -> list[bytes]` is not assignable to variable `cb1` with type `Proto1` [bad-assignment] +ERROR callables_protocol.py:67:7-15: `(*a: bytes) -> None` is not assignable to variable `cb2` with type `Proto2` [bad-assignment] +ERROR callables_protocol.py:68:7-15: `(*a: str, **b: str) -> None` is not assignable to variable `cb2` with type `Proto2` [bad-assignment] +ERROR callables_protocol.py:69:7-15: `(*a: bytes, **b: bytes) -> None` is not assignable to variable `cb2` with type `Proto2` [bad-assignment] +ERROR callables_protocol.py:70:7-15: `(**b: str) -> None` is not assignable to variable `cb2` with type `Proto2` [bad-assignment] +ERROR callables_protocol.py:97:16-24: `(x: int) -> None` is not assignable to `Proto4` [bad-assignment] +ERROR callables_protocol.py:121:18-26: `(*vals: bytes, *, max_len: int | None = None) -> list[bytes]` is not assignable to `NotProto6` [bad-assignment] +ERROR callables_protocol.py:169:7-15: `(x: int) -> Any` is not assignable to variable `cb8` with type `Proto8` [bad-assignment] +ERROR callables_protocol.py:186:33-38: `Literal['str']` is not assignable to attribute `other_attribute` with type `int` [bad-assignment] +ERROR callables_protocol.py:187:5-18: Object of class `Proto9` has no attribute `xxx` [missing-attribute] +ERROR callables_protocol.py:197:7-32: Object of class `Proto9` has no attribute `other_attribute2` [missing-attribute] +ERROR callables_protocol.py:238:8-17: `(x: int, y: str, /) -> Any` is not assignable to variable `cb11` with type `Proto11` [bad-assignment] +ERROR callables_protocol.py:260:8-17: `(*args: Any, *, kwarg0: Any) -> None` is not assignable to variable `cb12` with type `Proto12` [bad-assignment] +ERROR callables_protocol.py:284:27-42: `(path: str) -> str` is not assignable to `Proto13_Default` [bad-assignment] +ERROR callables_protocol.py:311:27-42: `(*, path: str) -> str` is not assignable to `Proto14_Default` [bad-assignment] """ diff --git a/conformance/results/pyrefly/callables_subtyping.toml b/conformance/results/pyrefly/callables_subtyping.toml index e97776ab4..3a332c8c8 100644 --- a/conformance/results/pyrefly/callables_subtyping.toml +++ b/conformance/results/pyrefly/callables_subtyping.toml @@ -1,37 +1,38 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_subtyping.py:26:36-39: `(int) -> int` is not assignable to `(float) -> float` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_subtyping.py:29:32-35: `(float) -> float` is not assignable to `(int) -> int` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_subtyping.py:51:21-29: `PosOnly2` is not assignable to `Standard2` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_subtyping.py:52:21-28: `KwOnly2` is not assignable to `Standard2` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_subtyping.py:55:20-27: `KwOnly2` is not assignable to `PosOnly2` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_subtyping.py:58:19-27: `PosOnly2` is not assignable to `KwOnly2` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_subtyping.py:82:20-27: `NoArgs3` is not assignable to `IntArgs3` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_subtyping.py:85:22-29: `NoArgs3` is not assignable to `FloatArgs3` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_subtyping.py:86:22-30: `IntArgs3` is not assignable to `FloatArgs3` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_subtyping.py:116:20-28: `IntArgs4` is not assignable to `PosOnly4` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_subtyping.py:119:23-31: `StrArgs4` is not assignable to `IntStrArgs4` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_subtyping.py:120:23-31: `IntArgs4` is not assignable to `IntStrArgs4` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_subtyping.py:122:20-28: `IntArgs4` is not assignable to `StrArgs4` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_subtyping.py:124:20-28: `StrArgs4` is not assignable to `IntArgs4` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_subtyping.py:125:22-34: `IntStrArgs4` is not assignable to `Standard4` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_subtyping.py:126:22-30: `StrArgs4` is not assignable to `Standard4` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_subtyping.py:151:22-31: `NoKwargs5` is not assignable to `IntKwargs5` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_subtyping.py:154:24-33: `NoKwargs5` is not assignable to `FloatKwargs5` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_subtyping.py:155:24-34: `IntKwargs5` is not assignable to `FloatKwargs5` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_subtyping.py:187:19-29: `IntKwargs6` is not assignable to `KwOnly6` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_subtyping.py:190:25-35: `StrKwargs6` is not assignable to `IntStrKwargs6` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_subtyping.py:191:25-35: `IntKwargs6` is not assignable to `IntStrKwargs6` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_subtyping.py:193:22-32: `IntKwargs6` is not assignable to `StrKwargs6` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_subtyping.py:195:22-32: `StrKwargs6` is not assignable to `IntKwargs6` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_subtyping.py:196:22-36: `IntStrKwargs6` is not assignable to `Standard6` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_subtyping.py:197:22-32: `StrKwargs6` is not assignable to `Standard6` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_subtyping.py:236:23-37: `NoDefaultArg8` is not assignable to `DefaultArg8` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_subtyping.py:237:23-27: `NoX8` is not assignable to `DefaultArg8` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_subtyping.py:240:25-29: `NoX8` is not assignable to `NoDefaultArg8` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_subtyping.py:243:16-30: `NoDefaultArg8` is not assignable to `NoX8` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_subtyping.py:273:21-31: `Overloaded9` is not assignable to `FloatArg9` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/callables_subtyping.py:297:24-31: `StrArg10` is not assignable to `Overloaded10` [bad-assignment] +ERROR callables_subtyping.py:26:36-39: `(int) -> int` is not assignable to `(float) -> float` [bad-assignment] +ERROR callables_subtyping.py:29:32-35: `(float) -> float` is not assignable to `(int) -> int` [bad-assignment] +ERROR callables_subtyping.py:51:21-29: `PosOnly2` is not assignable to `Standard2` [bad-assignment] +ERROR callables_subtyping.py:52:21-28: `KwOnly2` is not assignable to `Standard2` [bad-assignment] +ERROR callables_subtyping.py:55:20-27: `KwOnly2` is not assignable to `PosOnly2` [bad-assignment] +ERROR callables_subtyping.py:58:19-27: `PosOnly2` is not assignable to `KwOnly2` [bad-assignment] +ERROR callables_subtyping.py:82:20-27: `NoArgs3` is not assignable to `IntArgs3` [bad-assignment] +ERROR callables_subtyping.py:85:22-29: `NoArgs3` is not assignable to `FloatArgs3` [bad-assignment] +ERROR callables_subtyping.py:86:22-30: `IntArgs3` is not assignable to `FloatArgs3` [bad-assignment] +ERROR callables_subtyping.py:116:20-28: `IntArgs4` is not assignable to `PosOnly4` [bad-assignment] +ERROR callables_subtyping.py:119:23-31: `StrArgs4` is not assignable to `IntStrArgs4` [bad-assignment] +ERROR callables_subtyping.py:120:23-31: `IntArgs4` is not assignable to `IntStrArgs4` [bad-assignment] +ERROR callables_subtyping.py:122:20-28: `IntArgs4` is not assignable to `StrArgs4` [bad-assignment] +ERROR callables_subtyping.py:124:20-28: `StrArgs4` is not assignable to `IntArgs4` [bad-assignment] +ERROR callables_subtyping.py:125:22-34: `IntStrArgs4` is not assignable to `Standard4` [bad-assignment] +ERROR callables_subtyping.py:126:22-30: `StrArgs4` is not assignable to `Standard4` [bad-assignment] +ERROR callables_subtyping.py:151:22-31: `NoKwargs5` is not assignable to `IntKwargs5` [bad-assignment] +ERROR callables_subtyping.py:154:24-33: `NoKwargs5` is not assignable to `FloatKwargs5` [bad-assignment] +ERROR callables_subtyping.py:155:24-34: `IntKwargs5` is not assignable to `FloatKwargs5` [bad-assignment] +ERROR callables_subtyping.py:187:19-29: `IntKwargs6` is not assignable to `KwOnly6` [bad-assignment] +ERROR callables_subtyping.py:190:25-35: `StrKwargs6` is not assignable to `IntStrKwargs6` [bad-assignment] +ERROR callables_subtyping.py:191:25-35: `IntKwargs6` is not assignable to `IntStrKwargs6` [bad-assignment] +ERROR callables_subtyping.py:193:22-32: `IntKwargs6` is not assignable to `StrKwargs6` [bad-assignment] +ERROR callables_subtyping.py:195:22-32: `StrKwargs6` is not assignable to `IntKwargs6` [bad-assignment] +ERROR callables_subtyping.py:196:22-36: `IntStrKwargs6` is not assignable to `Standard6` [bad-assignment] +ERROR callables_subtyping.py:197:22-32: `StrKwargs6` is not assignable to `Standard6` [bad-assignment] +ERROR callables_subtyping.py:236:23-37: `NoDefaultArg8` is not assignable to `DefaultArg8` [bad-assignment] +ERROR callables_subtyping.py:237:23-27: `NoX8` is not assignable to `DefaultArg8` [bad-assignment] +ERROR callables_subtyping.py:240:25-29: `NoX8` is not assignable to `NoDefaultArg8` [bad-assignment] +ERROR callables_subtyping.py:243:16-30: `NoDefaultArg8` is not assignable to `NoX8` [bad-assignment] +ERROR callables_subtyping.py:273:21-31: `Overloaded9` is not assignable to `FloatArg9` [bad-assignment] +ERROR callables_subtyping.py:297:24-31: `StrArg10` is not assignable to `Overloaded10` [bad-assignment] """ diff --git a/conformance/results/pyrefly/classes_classvar.toml b/conformance/results/pyrefly/classes_classvar.toml index 923b87ddb..c33207e48 100644 --- a/conformance/results/pyrefly/classes_classvar.toml +++ b/conformance/results/pyrefly/classes_classvar.toml @@ -1,26 +1,27 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/classes_classvar.py:38:11-29: Expected 1 type argument for `ClassVar`, got 2 [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/classes_classvar.py:39:14-15: number literal cannot be used in annotations [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/classes_classvar.py:40:14-17: Could not find name `var` [unknown-name] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/classes_classvar.py:45:20-21: `ClassVar` arguments may not contain any type variables [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/classes_classvar.py:46:20-27: `ClassVar` arguments may not contain any type variables [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/classes_classvar.py:47:20-36: `ClassVar` arguments may not contain any type variables [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/classes_classvar.py:52:33-35: `dict[@_, @_]` is not assignable to `list[str]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/classes_classvar.py:54:17-30: `ClassVar` may not be nested inside `Final` [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/classes_classvar.py:55:17-30: `ClassVar` is not allowed in this context [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/classes_classvar.py:69:26-34: `ClassVar` is only allowed inside a class body [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/classes_classvar.py:69:26-39: `ClassVar` is not allowed in this context [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/classes_classvar.py:70:12-20: `ClassVar` is only allowed inside a class body [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/classes_classvar.py:70:12-25: `ClassVar` is not allowed in this context [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/classes_classvar.py:71:9-16: Cannot set field `xx` [read-only] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/classes_classvar.py:73:26-34: `ClassVar` is only allowed inside a class body [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/classes_classvar.py:73:26-39: `ClassVar` is not allowed in this context [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/classes_classvar.py:77:8-16: `ClassVar` is only allowed inside a class body [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/classes_classvar.py:77:8-21: `ClassVar` is not allowed in this context [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/classes_classvar.py:78:20-33: `ClassVar` is not allowed in this context [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/classes_classvar.py:111:1-19: Cannot set field `stats` [read-only] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/classes_classvar.py:140:13-25: `ProtoAImpl` is not assignable to `ProtoA` [bad-assignment] +ERROR classes_classvar.py:38:11-29: Expected 1 type argument for `ClassVar`, got 2 [invalid-annotation] +ERROR classes_classvar.py:39:14-15: number literal cannot be used in annotations [invalid-annotation] +ERROR classes_classvar.py:40:14-17: Could not find name `var` [unknown-name] +ERROR classes_classvar.py:45:20-21: `ClassVar` arguments may not contain any type variables [invalid-annotation] +ERROR classes_classvar.py:46:20-27: `ClassVar` arguments may not contain any type variables [invalid-annotation] +ERROR classes_classvar.py:47:20-36: `ClassVar` arguments may not contain any type variables [invalid-annotation] +ERROR classes_classvar.py:52:33-35: `dict[@_, @_]` is not assignable to `list[str]` [bad-assignment] +ERROR classes_classvar.py:54:17-30: `ClassVar` may not be nested inside `Final` [invalid-annotation] +ERROR classes_classvar.py:55:17-30: `ClassVar` is not allowed in this context [invalid-annotation] +ERROR classes_classvar.py:69:26-34: `ClassVar` is only allowed inside a class body [invalid-annotation] +ERROR classes_classvar.py:69:26-39: `ClassVar` is not allowed in this context [invalid-annotation] +ERROR classes_classvar.py:70:12-20: `ClassVar` is only allowed inside a class body [invalid-annotation] +ERROR classes_classvar.py:70:12-25: `ClassVar` is not allowed in this context [invalid-annotation] +ERROR classes_classvar.py:71:9-16: Cannot set field `xx` [read-only] +ERROR classes_classvar.py:73:26-34: `ClassVar` is only allowed inside a class body [invalid-annotation] +ERROR classes_classvar.py:73:26-39: `ClassVar` is not allowed in this context [invalid-annotation] +ERROR classes_classvar.py:77:8-16: `ClassVar` is only allowed inside a class body [invalid-annotation] +ERROR classes_classvar.py:77:8-21: `ClassVar` is not allowed in this context [invalid-annotation] +ERROR classes_classvar.py:78:20-33: `ClassVar` is not allowed in this context [invalid-annotation] +ERROR classes_classvar.py:111:1-19: Cannot set field `stats` [read-only] +ERROR classes_classvar.py:140:13-25: `ProtoAImpl` is not assignable to `ProtoA` [bad-assignment] """ diff --git a/conformance/results/pyrefly/classes_override.toml b/conformance/results/pyrefly/classes_override.toml index 9fee418e5..cb376ba0b 100644 --- a/conformance/results/pyrefly/classes_override.toml +++ b/conformance/results/pyrefly/classes_override.toml @@ -1,10 +1,11 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/classes_override.py:53:9-16: Class member `ChildA.method3` is marked as an override, but no parent class has a matching attribute [bad-override] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/classes_override.py:57:9-16: Class member `ChildA.method4` is marked as an override, but no parent class has a matching attribute [bad-override] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/classes_override.py:79:9-23: Class member `ChildA.static_method1` is marked as an override, but no parent class has a matching attribute [bad-override] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/classes_override.py:84:9-22: Class member `ChildA.class_method1` is marked as an override, but no parent class has a matching attribute [bad-override] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/classes_override.py:89:9-18: Class member `ChildA.property1` is marked as an override, but no parent class has a matching attribute [bad-override] +ERROR classes_override.py:53:9-16: Class member `ChildA.method3` is marked as an override, but no parent class has a matching attribute [bad-override] +ERROR classes_override.py:57:9-16: Class member `ChildA.method4` is marked as an override, but no parent class has a matching attribute [bad-override] +ERROR classes_override.py:79:9-23: Class member `ChildA.static_method1` is marked as an override, but no parent class has a matching attribute [bad-override] +ERROR classes_override.py:84:9-22: Class member `ChildA.class_method1` is marked as an override, but no parent class has a matching attribute [bad-override] +ERROR classes_override.py:89:9-18: Class member `ChildA.property1` is marked as an override, but no parent class has a matching attribute [bad-override] """ diff --git a/conformance/results/pyrefly/constructors_call_init.toml b/conformance/results/pyrefly/constructors_call_init.toml index eb8a3f961..01d35f163 100644 --- a/conformance/results/pyrefly/constructors_call_init.toml +++ b/conformance/results/pyrefly/constructors_call_init.toml @@ -7,8 +7,8 @@ errors_diff = """ Line 107: Expected 1 errors """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/constructors_call_init.py:21:13-16: Argument `float` is not assignable to parameter `x` with type `int` in function `Class1.__init__` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/constructors_call_init.py:42:8-20: Argument `Class2[@_]` is not assignable to parameter `x` with type `Class3 | None` in function `Class2.__init__` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/constructors_call_init.py:56:12-14: Argument `Class4[str]` is not assignable to parameter `self` with type `Class4[int]` in function `Class4.__init__` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/constructors_call_init.py:130:9-10: Expected 0 positional arguments, got 1 in function `object.__init__` [bad-argument-count] +ERROR constructors_call_init.py:21:13-16: Argument `float` is not assignable to parameter `x` with type `int` in function `Class1.__init__` [bad-argument-type] +ERROR constructors_call_init.py:42:8-20: Argument `Class2[@_]` is not assignable to parameter `x` with type `Class3 | None` in function `Class2.__init__` [bad-argument-type] +ERROR constructors_call_init.py:56:12-14: Argument `Class4[str]` is not assignable to parameter `self` with type `Class4[int]` in function `Class4.__init__` [bad-argument-type] +ERROR constructors_call_init.py:130:9-10: Expected 0 positional arguments, got 1 in function `object.__init__` [bad-argument-count] """ diff --git a/conformance/results/pyrefly/constructors_call_metaclass.toml b/conformance/results/pyrefly/constructors_call_metaclass.toml index 3489e9c99..44d131a2c 100644 --- a/conformance/results/pyrefly/constructors_call_metaclass.toml +++ b/conformance/results/pyrefly/constructors_call_metaclass.toml @@ -1,7 +1,8 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/constructors_call_metaclass.py:51:7-9: Missing argument `x` in function `Class3.__new__` [missing-argument] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/constructors_call_metaclass.py:65:7-9: Missing argument `x` in function `Class4.__new__` [missing-argument] +ERROR constructors_call_metaclass.py:51:7-9: Missing argument `x` in function `Class3.__new__` [missing-argument] +ERROR constructors_call_metaclass.py:65:7-9: Missing argument `x` in function `Class4.__new__` [missing-argument] """ diff --git a/conformance/results/pyrefly/constructors_call_new.toml b/conformance/results/pyrefly/constructors_call_new.toml index 53092d1e9..690a72138 100644 --- a/conformance/results/pyrefly/constructors_call_new.toml +++ b/conformance/results/pyrefly/constructors_call_new.toml @@ -1,7 +1,8 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/constructors_call_new.py:21:13-16: Argument `float` is not assignable to parameter `x` with type `int` in function `Class1.__new__` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/constructors_call_new.py:145:13-15: Argument `type[Class11[str]]` is not assignable to parameter `cls` with type `type[Class11[int]]` in function `Class11.__new__` [bad-argument-type] +ERROR constructors_call_new.py:21:13-16: Argument `float` is not assignable to parameter `x` with type `int` in function `Class1.__new__` [bad-argument-type] +ERROR constructors_call_new.py:145:13-15: Argument `type[Class11[str]]` is not assignable to parameter `cls` with type `type[Class11[int]]` in function `Class11.__new__` [bad-argument-type] """ diff --git a/conformance/results/pyrefly/constructors_call_type.toml b/conformance/results/pyrefly/constructors_call_type.toml index d5820d3eb..149cd688c 100644 --- a/conformance/results/pyrefly/constructors_call_type.toml +++ b/conformance/results/pyrefly/constructors_call_type.toml @@ -10,11 +10,11 @@ Line 81: Expected 1 errors Line 82: Expected 1 errors """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/constructors_call_type.py:30:8-10: Missing argument `x` in function `Meta1.__call__` [missing-argument] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/constructors_call_type.py:30:8-10: Missing argument `y` in function `Meta1.__call__` [missing-argument] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/constructors_call_type.py:40:8-10: Missing argument `x` in function `Class2.__new__` [missing-argument] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/constructors_call_type.py:40:8-10: Missing argument `y` in function `Class2.__new__` [missing-argument] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/constructors_call_type.py:50:8-10: Missing argument `x` in function `Class3.__init__` [missing-argument] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/constructors_call_type.py:50:8-10: Missing argument `y` in function `Class3.__init__` [missing-argument] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/constructors_call_type.py:59:9-10: Expected 0 positional arguments, got 1 in function `object.__init__` [bad-argument-count] +ERROR constructors_call_type.py:30:8-10: Missing argument `x` in function `Meta1.__call__` [missing-argument] +ERROR constructors_call_type.py:30:8-10: Missing argument `y` in function `Meta1.__call__` [missing-argument] +ERROR constructors_call_type.py:40:8-10: Missing argument `x` in function `Class2.__new__` [missing-argument] +ERROR constructors_call_type.py:40:8-10: Missing argument `y` in function `Class2.__new__` [missing-argument] +ERROR constructors_call_type.py:50:8-10: Missing argument `x` in function `Class3.__init__` [missing-argument] +ERROR constructors_call_type.py:50:8-10: Missing argument `y` in function `Class3.__init__` [missing-argument] +ERROR constructors_call_type.py:59:9-10: Expected 0 positional arguments, got 1 in function `object.__init__` [bad-argument-count] """ diff --git a/conformance/results/pyrefly/constructors_callable.toml b/conformance/results/pyrefly/constructors_callable.toml index 714ec541b..42087455d 100644 --- a/conformance/results/pyrefly/constructors_callable.toml +++ b/conformance/results/pyrefly/constructors_callable.toml @@ -18,18 +18,28 @@ Line 165: Unexpected errors ['assert_type(Class7[Any], Class7[str]) failed [asse Line 183: Unexpected errors ['assert_type(Class8[Any], Class8[str]) failed [assert-type]'] """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/constructors_callable.py:38:3-5: Missing argument `x` [missing-argument] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/constructors_callable.py:39:3-8: Missing argument `x` [missing-argument] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/constructors_callable.py:39:4-5: Unexpected keyword argument `y` [unexpected-keyword] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/constructors_callable.py:51:4-5: Expected 0 positional arguments, got 1 [bad-argument-count] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/constructors_callable.py:62:23-29: Argument `type[Class3]` is not assignable to parameter `cb` with type `(*args: Unknown, **kwargs: Unknown) -> Class3` in function `accepts_callable` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/constructors_callable.py:79:3-5: Missing argument `x` [missing-argument] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/constructors_callable.py:80:3-8: Missing argument `x` [missing-argument] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/constructors_callable.py:80:4-5: Unexpected keyword argument `y` [unexpected-keyword] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/constructors_callable.py:127:4-5: Expected 0 positional arguments, got 1 [bad-argument-count] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/constructors_callable.py:144:8-9: Expected 0 positional arguments, got 1 [bad-argument-count] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/constructors_callable.py:164:12-32: assert_type(Class7[Any], Class7[int]) failed [assert-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/constructors_callable.py:165:12-33: assert_type(Class7[Any], Class7[str]) failed [assert-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/constructors_callable.py:165:16-18: Argument `Literal['']` is not assignable to parameter `x` with type `int` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/constructors_callable.py:183:12-41: assert_type(Class8[Any], Class8[str]) failed [assert-type] + constructors_callable.py:36:12-16: revealed type: (x: int) -> Class1 [reveal-type] +ERROR constructors_callable.py:38:3-5: Missing argument `x` [missing-argument] +ERROR constructors_callable.py:39:3-8: Missing argument `x` [missing-argument] +ERROR constructors_callable.py:39:4-5: Unexpected keyword argument `y` [unexpected-keyword] + constructors_callable.py:49:12-16: revealed type: () -> Class2 [reveal-type] +ERROR constructors_callable.py:51:4-5: Expected 0 positional arguments, got 1 [bad-argument-count] +ERROR constructors_callable.py:62:23-29: Argument `type[Class3]` is not assignable to parameter `cb` with type `(*args: Unknown, **kwargs: Unknown) -> Class3` in function `accepts_callable` [bad-argument-type] + constructors_callable.py:63:12-16: revealed type: (*args: Unknown, **kwargs: Unknown) -> Class3 [reveal-type] + constructors_callable.py:77:12-16: revealed type: (x: int) -> int [reveal-type] +ERROR constructors_callable.py:79:3-5: Missing argument `x` [missing-argument] +ERROR constructors_callable.py:80:3-8: Missing argument `x` [missing-argument] +ERROR constructors_callable.py:80:4-5: Unexpected keyword argument `y` [unexpected-keyword] + constructors_callable.py:97:12-16: revealed type: (*args: Any, **kwargs: Any) -> NoReturn [reveal-type] + constructors_callable.py:125:12-16: revealed type: () -> Class6Proxy [reveal-type] +ERROR constructors_callable.py:127:4-5: Expected 0 positional arguments, got 1 [bad-argument-count] + constructors_callable.py:142:12-20: revealed type: () -> Any [reveal-type] +ERROR constructors_callable.py:144:8-9: Expected 0 positional arguments, got 1 [bad-argument-count] + constructors_callable.py:161:12-163:2: revealed type: (x: int) -> Class7[Unknown] [reveal-type] +ERROR constructors_callable.py:164:12-32: assert_type(Class7[Any], Class7[int]) failed [assert-type] +ERROR constructors_callable.py:165:12-33: assert_type(Class7[Any], Class7[str]) failed [assert-type] +ERROR constructors_callable.py:165:16-18: Argument `Literal['']` is not assignable to parameter `x` with type `int` [bad-argument-type] + constructors_callable.py:182:12-16: revealed type: (x: list[Unknown], y: list[Unknown]) -> Class8[Unknown] [reveal-type] +ERROR constructors_callable.py:183:12-41: assert_type(Class8[Any], Class8[str]) failed [assert-type] + constructors_callable.py:193:12-16: revealed type: (x: list[@_], y: list[@_]) -> Class9 [reveal-type] """ diff --git a/conformance/results/pyrefly/constructors_consistency.toml b/conformance/results/pyrefly/constructors_consistency.toml index cdd4d0cd9..be211bd5b 100644 --- a/conformance/results/pyrefly/constructors_consistency.toml +++ b/conformance/results/pyrefly/constructors_consistency.toml @@ -1,3 +1,4 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ diff --git a/conformance/results/pyrefly/dataclasses_descriptors.toml b/conformance/results/pyrefly/dataclasses_descriptors.toml index cdd4d0cd9..be211bd5b 100644 --- a/conformance/results/pyrefly/dataclasses_descriptors.toml +++ b/conformance/results/pyrefly/dataclasses_descriptors.toml @@ -1,3 +1,4 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ diff --git a/conformance/results/pyrefly/dataclasses_final.toml b/conformance/results/pyrefly/dataclasses_final.toml index e6db899d3..9afd7169e 100644 --- a/conformance/results/pyrefly/dataclasses_final.toml +++ b/conformance/results/pyrefly/dataclasses_final.toml @@ -7,8 +7,8 @@ errors_diff = """ Line 35: Expected 1 errors """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_final.py:27:1-17: Cannot set field `final_classvar` [read-only] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_final.py:36:1-21: Cannot set field `final_with_default` [read-only] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_final.py:37:1-19: Instance-only attribute `final_no_default` of class `D` is not visible on the class [no-access] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_final.py:38:1-21: Cannot set field `final_with_default` [read-only] +ERROR dataclasses_final.py:27:1-17: Cannot set field `final_classvar` [read-only] +ERROR dataclasses_final.py:36:1-21: Cannot set field `final_with_default` [read-only] +ERROR dataclasses_final.py:37:1-19: Instance-only attribute `final_no_default` of class `D` is not visible on the class [no-access] +ERROR dataclasses_final.py:38:1-21: Cannot set field `final_with_default` [read-only] """ diff --git a/conformance/results/pyrefly/dataclasses_frozen.toml b/conformance/results/pyrefly/dataclasses_frozen.toml index b5a6081d7..4fd80f44f 100644 --- a/conformance/results/pyrefly/dataclasses_frozen.toml +++ b/conformance/results/pyrefly/dataclasses_frozen.toml @@ -1,9 +1,10 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_frozen.py:16:1-6: Cannot set field `a` [read-only] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_frozen.py:17:1-6: Cannot set field `b` [read-only] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_frozen.py:23:7-10: Cannot inherit non-frozen dataclass `DC2` from frozen dataclass `DC1` [invalid-inheritance] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_frozen.py:33:7-10: Cannot inherit frozen dataclass `DC4` from non-frozen dataclass `DC3` [invalid-inheritance] +ERROR dataclasses_frozen.py:16:1-6: Cannot set field `a` [read-only] +ERROR dataclasses_frozen.py:17:1-6: Cannot set field `b` [read-only] +ERROR dataclasses_frozen.py:23:7-10: Cannot inherit non-frozen dataclass `DC2` from frozen dataclass `DC1` [invalid-inheritance] +ERROR dataclasses_frozen.py:33:7-10: Cannot inherit frozen dataclass `DC4` from non-frozen dataclass `DC3` [invalid-inheritance] """ diff --git a/conformance/results/pyrefly/dataclasses_hash.toml b/conformance/results/pyrefly/dataclasses_hash.toml index bd8e2906d..2d674772b 100644 --- a/conformance/results/pyrefly/dataclasses_hash.toml +++ b/conformance/results/pyrefly/dataclasses_hash.toml @@ -1,7 +1,8 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_hash.py:15:16-22: `DC1` is not assignable to `Hashable` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_hash.py:32:16-22: `DC3` is not assignable to `Hashable` [bad-assignment] +ERROR dataclasses_hash.py:15:16-22: `DC1` is not assignable to `Hashable` [bad-assignment] +ERROR dataclasses_hash.py:32:16-22: `DC3` is not assignable to `Hashable` [bad-assignment] """ diff --git a/conformance/results/pyrefly/dataclasses_inheritance.toml b/conformance/results/pyrefly/dataclasses_inheritance.toml index 045a85092..0b64d63ad 100644 --- a/conformance/results/pyrefly/dataclasses_inheritance.toml +++ b/conformance/results/pyrefly/dataclasses_inheritance.toml @@ -1,7 +1,8 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_inheritance.py:62:5-6: ClassVar `DC7.x` overrides instance variable of the same name in parent class `DC6` [bad-override] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_inheritance.py:66:5-6: Instance variable `DC7.y` overrides ClassVar of the same name in parent class `DC6` [bad-override] +ERROR dataclasses_inheritance.py:62:5-6: ClassVar `DC7.x` overrides instance variable of the same name in parent class `DC6` [bad-override] +ERROR dataclasses_inheritance.py:66:5-6: Instance variable `DC7.y` overrides ClassVar of the same name in parent class `DC6` [bad-override] """ diff --git a/conformance/results/pyrefly/dataclasses_kwonly.toml b/conformance/results/pyrefly/dataclasses_kwonly.toml index c4d80ab21..aebe69eb9 100644 --- a/conformance/results/pyrefly/dataclasses_kwonly.toml +++ b/conformance/results/pyrefly/dataclasses_kwonly.toml @@ -1,8 +1,9 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_kwonly.py:23:11-12: Expected 1 positional argument, got 2 in function `DC1.__init__` [bad-argument-count] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_kwonly.py:38:11-12: Expected 1 positional argument, got 2 in function `DC2.__init__` [bad-argument-count] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_kwonly.py:53:11-12: Expected 1 positional argument, got 2 in function `DC3.__init__` [bad-argument-count] +ERROR dataclasses_kwonly.py:23:11-12: Expected 1 positional argument, got 2 in function `DC1.__init__` [bad-argument-count] +ERROR dataclasses_kwonly.py:38:11-12: Expected 1 positional argument, got 2 in function `DC2.__init__` [bad-argument-count] +ERROR dataclasses_kwonly.py:53:11-12: Expected 1 positional argument, got 2 in function `DC3.__init__` [bad-argument-count] """ diff --git a/conformance/results/pyrefly/dataclasses_match_args.toml b/conformance/results/pyrefly/dataclasses_match_args.toml index 1d8d664f8..16221354f 100644 --- a/conformance/results/pyrefly/dataclasses_match_args.toml +++ b/conformance/results/pyrefly/dataclasses_match_args.toml @@ -1,6 +1,7 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_match_args.py:42:1-19: Class `DC4` has no class attribute `__match_args__` [missing-attribute] +ERROR dataclasses_match_args.py:42:1-19: Class `DC4` has no class attribute `__match_args__` [missing-attribute] """ diff --git a/conformance/results/pyrefly/dataclasses_order.toml b/conformance/results/pyrefly/dataclasses_order.toml index 589b66f46..65b34aec2 100644 --- a/conformance/results/pyrefly/dataclasses_order.toml +++ b/conformance/results/pyrefly/dataclasses_order.toml @@ -1,6 +1,7 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_order.py:50:4-17: `<` is not supported between `DC1` and `DC2` [unsupported-operation] +ERROR dataclasses_order.py:50:4-17: `<` is not supported between `DC1` and `DC2` [unsupported-operation] """ diff --git a/conformance/results/pyrefly/dataclasses_postinit.toml b/conformance/results/pyrefly/dataclasses_postinit.toml index dbef33c77..7691703f0 100644 --- a/conformance/results/pyrefly/dataclasses_postinit.toml +++ b/conformance/results/pyrefly/dataclasses_postinit.toml @@ -1,9 +1,10 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_postinit.py:19:9-22: `__post_init__` type `BoundMethod[DC1, (self: Self@DC1, x: int, y: int) -> None]` is not assignable to expected type `(x: int, y: str) -> object` generated from the dataclass's `InitVar` fields [bad-function-definition] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_postinit.py:28:7-12: Object of class `DC1` has no attribute `x` [missing-attribute] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_postinit.py:29:7-12: Object of class `DC1` has no attribute `y` [missing-attribute] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_postinit.py:36:9-22: `__post_init__` type `BoundMethod[DC2, (self: Self@DC2, x: int) -> None]` is not assignable to expected type `(x: int, y: str) -> object` generated from the dataclass's `InitVar` fields [bad-function-definition] +ERROR dataclasses_postinit.py:19:9-22: `__post_init__` type `BoundMethod[DC1, (self: Self@DC1, x: int, y: int) -> None]` is not assignable to expected type `(x: int, y: str) -> object` generated from the dataclass's `InitVar` fields [bad-function-definition] +ERROR dataclasses_postinit.py:28:7-12: Object of class `DC1` has no attribute `x` [missing-attribute] +ERROR dataclasses_postinit.py:29:7-12: Object of class `DC1` has no attribute `y` [missing-attribute] +ERROR dataclasses_postinit.py:36:9-22: `__post_init__` type `BoundMethod[DC2, (self: Self@DC2, x: int) -> None]` is not assignable to expected type `(x: int, y: str) -> object` generated from the dataclass's `InitVar` fields [bad-function-definition] """ diff --git a/conformance/results/pyrefly/dataclasses_slots.toml b/conformance/results/pyrefly/dataclasses_slots.toml index b7f8c6a93..5f4adca82 100644 --- a/conformance/results/pyrefly/dataclasses_slots.toml +++ b/conformance/results/pyrefly/dataclasses_slots.toml @@ -8,7 +8,7 @@ Line 25: Expected 1 errors Line 38: Expected 1 errors """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_slots.py:11:7-10: Cannot specify both `slots=True` and `__slots__` [bad-class-definition] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_slots.py:66:1-14: Class `DC6` has no class attribute `__slots__` [missing-attribute] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_slots.py:69:1-17: Object of class `DC6` has no attribute `__slots__` [missing-attribute] +ERROR dataclasses_slots.py:11:7-10: Cannot specify both `slots=True` and `__slots__` [bad-class-definition] +ERROR dataclasses_slots.py:66:1-14: Class `DC6` has no class attribute `__slots__` [missing-attribute] +ERROR dataclasses_slots.py:69:1-17: Object of class `DC6` has no attribute `__slots__` [missing-attribute] """ diff --git a/conformance/results/pyrefly/dataclasses_transform_class.toml b/conformance/results/pyrefly/dataclasses_transform_class.toml index 73f281cd3..31fc9270f 100644 --- a/conformance/results/pyrefly/dataclasses_transform_class.toml +++ b/conformance/results/pyrefly/dataclasses_transform_class.toml @@ -1,13 +1,14 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_transform_class.py:51:7-24: Cannot inherit non-frozen dataclass `Customer1Subclass` from frozen dataclass `Customer1` [invalid-inheritance] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_transform_class.py:63:1-8: Cannot set field `id` [read-only] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_transform_class.py:66:18-19: Expected argument `id` to be passed by name in function `Customer1.__init__` [unexpected-positional-argument] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_transform_class.py:66:21-26: Expected argument `name` to be passed by name in function `Customer1.__init__` [unexpected-positional-argument] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_transform_class.py:72:6-17: `<` is not supported between `Customer1` and `Customer1` [unsupported-operation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_transform_class.py:82:18-19: Expected argument `id` to be passed by name in function `Customer2.__init__` [unexpected-positional-argument] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_transform_class.py:82:18-19: Expected 0 positional arguments, got 2 in function `Customer2.__init__` [bad-argument-count] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_transform_class.py:122:1-8: Cannot set field `id` [read-only] +ERROR dataclasses_transform_class.py:51:7-24: Cannot inherit non-frozen dataclass `Customer1Subclass` from frozen dataclass `Customer1` [invalid-inheritance] +ERROR dataclasses_transform_class.py:63:1-8: Cannot set field `id` [read-only] +ERROR dataclasses_transform_class.py:66:18-19: Expected argument `id` to be passed by name in function `Customer1.__init__` [unexpected-positional-argument] +ERROR dataclasses_transform_class.py:66:21-26: Expected argument `name` to be passed by name in function `Customer1.__init__` [unexpected-positional-argument] +ERROR dataclasses_transform_class.py:72:6-17: `<` is not supported between `Customer1` and `Customer1` [unsupported-operation] +ERROR dataclasses_transform_class.py:82:18-19: Expected argument `id` to be passed by name in function `Customer2.__init__` [unexpected-positional-argument] +ERROR dataclasses_transform_class.py:82:18-19: Expected 0 positional arguments, got 2 in function `Customer2.__init__` [bad-argument-count] +ERROR dataclasses_transform_class.py:122:1-8: Cannot set field `id` [read-only] """ diff --git a/conformance/results/pyrefly/dataclasses_transform_converter.toml b/conformance/results/pyrefly/dataclasses_transform_converter.toml index ce39fc49d..c3b990de3 100644 --- a/conformance/results/pyrefly/dataclasses_transform_converter.toml +++ b/conformance/results/pyrefly/dataclasses_transform_converter.toml @@ -1,16 +1,17 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_transform_converter.py:48:41-55: Argument `() -> int` is not assignable to parameter `converter` with type `(@_) -> int` in function `model_field` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_transform_converter.py:48:41-55: Argument `() -> int` is not assignable to parameter `converter` with type `(@_) -> @_` in function `model_field` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_transform_converter.py:49:41-55: Argument `(*, x: int) -> int` is not assignable to parameter `converter` with type `(@_) -> int` in function `model_field` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_transform_converter.py:49:41-55: Argument `(*, x: int) -> int` is not assignable to parameter `converter` with type `(@_) -> @_` in function `model_field` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_transform_converter.py:107:5-6: Argument `Literal[1]` is not assignable to parameter `field0` with type `str` in function `DC2.__init__` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_transform_converter.py:108:23-24: Argument `Literal[1]` is not assignable to parameter `field3` with type `bytes | str` in function `DC2.__init__` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_transform_converter.py:109:29-31: Argument `complex` is not assignable to parameter `field4` with type `list[str] | str` in function `DC2.__init__` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_transform_converter.py:118:14-15: `Literal[1]` is not assignable to attribute `field0` with type `str` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_transform_converter.py:119:14-15: `Literal[1]` is not assignable to attribute `field3` with type `bytes | str` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_transform_converter.py:130:67-68: Argument `Literal[1]` is not assignable to parameter `default` with type `str | None` in function `model_field` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_transform_converter.py:133:75-78: Argument `type[int]` is not assignable to parameter `default_factory` with type `(() -> str) | None` in function `model_field` [bad-argument-type] +ERROR dataclasses_transform_converter.py:48:41-55: Argument `() -> int` is not assignable to parameter `converter` with type `(@_) -> int` in function `model_field` [bad-argument-type] +ERROR dataclasses_transform_converter.py:48:41-55: Argument `() -> int` is not assignable to parameter `converter` with type `(@_) -> @_` in function `model_field` [bad-argument-type] +ERROR dataclasses_transform_converter.py:49:41-55: Argument `(*, x: int) -> int` is not assignable to parameter `converter` with type `(@_) -> int` in function `model_field` [bad-argument-type] +ERROR dataclasses_transform_converter.py:49:41-55: Argument `(*, x: int) -> int` is not assignable to parameter `converter` with type `(@_) -> @_` in function `model_field` [bad-argument-type] +ERROR dataclasses_transform_converter.py:107:5-6: Argument `Literal[1]` is not assignable to parameter `field0` with type `str` in function `DC2.__init__` [bad-argument-type] +ERROR dataclasses_transform_converter.py:108:23-24: Argument `Literal[1]` is not assignable to parameter `field3` with type `bytes | str` in function `DC2.__init__` [bad-argument-type] +ERROR dataclasses_transform_converter.py:109:29-31: Argument `complex` is not assignable to parameter `field4` with type `list[str] | str` in function `DC2.__init__` [bad-argument-type] +ERROR dataclasses_transform_converter.py:118:14-15: `Literal[1]` is not assignable to attribute `field0` with type `str` [bad-assignment] +ERROR dataclasses_transform_converter.py:119:14-15: `Literal[1]` is not assignable to attribute `field3` with type `bytes | str` [bad-assignment] +ERROR dataclasses_transform_converter.py:130:67-68: Argument `Literal[1]` is not assignable to parameter `default` with type `str | None` in function `model_field` [bad-argument-type] +ERROR dataclasses_transform_converter.py:133:75-78: Argument `type[int]` is not assignable to parameter `default_factory` with type `(() -> str) | None` in function `model_field` [bad-argument-type] """ diff --git a/conformance/results/pyrefly/dataclasses_transform_field.toml b/conformance/results/pyrefly/dataclasses_transform_field.toml index bbfec45a1..df3d09509 100644 --- a/conformance/results/pyrefly/dataclasses_transform_field.toml +++ b/conformance/results/pyrefly/dataclasses_transform_field.toml @@ -1,7 +1,8 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_transform_field.py:64:16-18: Unexpected keyword argument `id` in function `CustomerModel1.__init__` [unexpected-keyword] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_transform_field.py:75:16-17: Expected argument `name` to be passed by name in function `CustomerModel2.__init__` [unexpected-positional-argument] +ERROR dataclasses_transform_field.py:64:16-18: Unexpected keyword argument `id` in function `CustomerModel1.__init__` [unexpected-keyword] +ERROR dataclasses_transform_field.py:75:16-17: Expected argument `name` to be passed by name in function `CustomerModel2.__init__` [unexpected-positional-argument] """ diff --git a/conformance/results/pyrefly/dataclasses_transform_func.toml b/conformance/results/pyrefly/dataclasses_transform_func.toml index a58ceeab7..1d8c11fc8 100644 --- a/conformance/results/pyrefly/dataclasses_transform_func.toml +++ b/conformance/results/pyrefly/dataclasses_transform_func.toml @@ -1,12 +1,13 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_transform_func.py:56:13-14: `Literal[3]` is not assignable to attribute `name` with type `str` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_transform_func.py:60:6-17: `<` is not supported between `Customer1` and `Customer1` [unsupported-operation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_transform_func.py:64:36-42: Unexpected keyword argument `salary` in function `Customer1.__init__` [unexpected-keyword] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_transform_func.py:70:18-19: Expected argument `id` to be passed by name in function `Customer2.__init__` [unexpected-positional-argument] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_transform_func.py:70:21-27: Expected argument `name` to be passed by name in function `Customer2.__init__` [unexpected-positional-argument] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_transform_func.py:89:7-24: Cannot inherit non-frozen dataclass `Customer3Subclass` from frozen dataclass `Customer3` [invalid-inheritance] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_transform_func.py:96:1-8: Cannot set field `id` [read-only] +ERROR dataclasses_transform_func.py:56:13-14: `Literal[3]` is not assignable to attribute `name` with type `str` [bad-assignment] +ERROR dataclasses_transform_func.py:60:6-17: `<` is not supported between `Customer1` and `Customer1` [unsupported-operation] +ERROR dataclasses_transform_func.py:64:36-42: Unexpected keyword argument `salary` in function `Customer1.__init__` [unexpected-keyword] +ERROR dataclasses_transform_func.py:70:18-19: Expected argument `id` to be passed by name in function `Customer2.__init__` [unexpected-positional-argument] +ERROR dataclasses_transform_func.py:70:21-27: Expected argument `name` to be passed by name in function `Customer2.__init__` [unexpected-positional-argument] +ERROR dataclasses_transform_func.py:89:7-24: Cannot inherit non-frozen dataclass `Customer3Subclass` from frozen dataclass `Customer3` [invalid-inheritance] +ERROR dataclasses_transform_func.py:96:1-8: Cannot set field `id` [read-only] """ diff --git a/conformance/results/pyrefly/dataclasses_transform_meta.toml b/conformance/results/pyrefly/dataclasses_transform_meta.toml index 869e74a7c..8af862f41 100644 --- a/conformance/results/pyrefly/dataclasses_transform_meta.toml +++ b/conformance/results/pyrefly/dataclasses_transform_meta.toml @@ -1,13 +1,14 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_transform_meta.py:51:7-24: Cannot inherit non-frozen dataclass `Customer1Subclass` from frozen dataclass `Customer1` [invalid-inheritance] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_transform_meta.py:63:1-8: Cannot set field `id` [read-only] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_transform_meta.py:66:18-19: Expected argument `id` to be passed by name in function `Customer1.__init__` [unexpected-positional-argument] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_transform_meta.py:66:21-26: Expected argument `name` to be passed by name in function `Customer1.__init__` [unexpected-positional-argument] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_transform_meta.py:73:6-17: `<` is not supported between `Customer1` and `Customer1` [unsupported-operation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_transform_meta.py:83:18-19: Expected argument `id` to be passed by name in function `Customer2.__init__` [unexpected-positional-argument] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_transform_meta.py:83:18-19: Expected 0 positional arguments, got 2 in function `Customer2.__init__` [bad-argument-count] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_transform_meta.py:103:1-8: Cannot set field `id` [read-only] +ERROR dataclasses_transform_meta.py:51:7-24: Cannot inherit non-frozen dataclass `Customer1Subclass` from frozen dataclass `Customer1` [invalid-inheritance] +ERROR dataclasses_transform_meta.py:63:1-8: Cannot set field `id` [read-only] +ERROR dataclasses_transform_meta.py:66:18-19: Expected argument `id` to be passed by name in function `Customer1.__init__` [unexpected-positional-argument] +ERROR dataclasses_transform_meta.py:66:21-26: Expected argument `name` to be passed by name in function `Customer1.__init__` [unexpected-positional-argument] +ERROR dataclasses_transform_meta.py:73:6-17: `<` is not supported between `Customer1` and `Customer1` [unsupported-operation] +ERROR dataclasses_transform_meta.py:83:18-19: Expected argument `id` to be passed by name in function `Customer2.__init__` [unexpected-positional-argument] +ERROR dataclasses_transform_meta.py:83:18-19: Expected 0 positional arguments, got 2 in function `Customer2.__init__` [bad-argument-count] +ERROR dataclasses_transform_meta.py:103:1-8: Cannot set field `id` [read-only] """ diff --git a/conformance/results/pyrefly/dataclasses_usage.toml b/conformance/results/pyrefly/dataclasses_usage.toml index 927f4a09d..c8156fc6e 100644 --- a/conformance/results/pyrefly/dataclasses_usage.toml +++ b/conformance/results/pyrefly/dataclasses_usage.toml @@ -1,16 +1,17 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_usage.py:50:19-27: Missing argument `unit_price` in function `InventoryItem.__init__` [missing-argument] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_usage.py:51:28-35: Argument `Literal['price']` is not assignable to parameter `unit_price` with type `float` in function `InventoryItem.__init__` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_usage.py:52:36-37: Expected 3 positional arguments, got 4 in function `InventoryItem.__init__` [bad-argument-count] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_usage.py:61:5-6: Dataclass field `b` without a default may not follow dataclass field with a default [bad-class-definition] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_usage.py:67:5-6: Dataclass field `b` without a default may not follow dataclass field with a default [bad-class-definition] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_usage.py:73:5-6: Dataclass field `b` without a default may not follow dataclass field with a default [bad-class-definition] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_usage.py:83:13-14: Expected 1 positional argument, got 2 in function `DC4.__init__` [bad-argument-count] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_usage.py:88:14-40: `str` is not assignable to `int` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_usage.py:127:8-9: Expected 1 positional argument, got 2 in function `DC7.__init__` [bad-argument-count] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_usage.py:130:4-7: Missing argument `y` in function `DC8.__init__` [missing-argument] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/dataclasses_usage.py:179:6-7: Expected 0 positional arguments, got 1 in function `object.__init__` [bad-argument-count] +ERROR dataclasses_usage.py:50:19-27: Missing argument `unit_price` in function `InventoryItem.__init__` [missing-argument] +ERROR dataclasses_usage.py:51:28-35: Argument `Literal['price']` is not assignable to parameter `unit_price` with type `float` in function `InventoryItem.__init__` [bad-argument-type] +ERROR dataclasses_usage.py:52:36-37: Expected 3 positional arguments, got 4 in function `InventoryItem.__init__` [bad-argument-count] +ERROR dataclasses_usage.py:61:5-6: Dataclass field `b` without a default may not follow dataclass field with a default [bad-class-definition] +ERROR dataclasses_usage.py:67:5-6: Dataclass field `b` without a default may not follow dataclass field with a default [bad-class-definition] +ERROR dataclasses_usage.py:73:5-6: Dataclass field `b` without a default may not follow dataclass field with a default [bad-class-definition] +ERROR dataclasses_usage.py:83:13-14: Expected 1 positional argument, got 2 in function `DC4.__init__` [bad-argument-count] +ERROR dataclasses_usage.py:88:14-40: `str` is not assignable to `int` [bad-assignment] +ERROR dataclasses_usage.py:127:8-9: Expected 1 positional argument, got 2 in function `DC7.__init__` [bad-argument-count] +ERROR dataclasses_usage.py:130:4-7: Missing argument `y` in function `DC8.__init__` [missing-argument] +ERROR dataclasses_usage.py:179:6-7: Expected 0 positional arguments, got 1 in function `object.__init__` [bad-argument-count] """ diff --git a/conformance/results/pyrefly/directives_assert_type.toml b/conformance/results/pyrefly/directives_assert_type.toml index 2f8958910..35e07db7e 100644 --- a/conformance/results/pyrefly/directives_assert_type.toml +++ b/conformance/results/pyrefly/directives_assert_type.toml @@ -1,11 +1,12 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/directives_assert_type.py:27:16-24: assert_type(int | str, int) failed [assert-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/directives_assert_type.py:28:16-24: assert_type(Any, int) failed [assert-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/directives_assert_type.py:29:16-24: assert_type(Literal[4], int) failed [assert-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/directives_assert_type.py:31:16-18: assert_type needs 2 positional arguments, got 0 [bad-argument-count] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/directives_assert_type.py:32:16-25: assert_type(Literal[''], int) failed [assert-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/directives_assert_type.py:33:16-33: assert_type needs 2 positional arguments, got 3 [bad-argument-count] +ERROR directives_assert_type.py:27:16-24: assert_type(int | str, int) failed [assert-type] +ERROR directives_assert_type.py:28:16-24: assert_type(Any, int) failed [assert-type] +ERROR directives_assert_type.py:29:16-24: assert_type(Literal[4], int) failed [assert-type] +ERROR directives_assert_type.py:31:16-18: assert_type needs 2 positional arguments, got 0 [bad-argument-count] +ERROR directives_assert_type.py:32:16-25: assert_type(Literal[''], int) failed [assert-type] +ERROR directives_assert_type.py:33:16-33: assert_type needs 2 positional arguments, got 3 [bad-argument-count] """ diff --git a/conformance/results/pyrefly/directives_cast.toml b/conformance/results/pyrefly/directives_cast.toml index 15b1539c0..e4e745aef 100644 --- a/conformance/results/pyrefly/directives_cast.toml +++ b/conformance/results/pyrefly/directives_cast.toml @@ -1,9 +1,10 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/directives_cast.py:15:12-14: `typing.cast` missing required argument `typ` [missing-argument] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/directives_cast.py:15:12-14: `typing.cast` missing required argument `val` [missing-argument] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/directives_cast.py:16:12-19: First argument to `typing.cast` must be a type [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/directives_cast.py:17:12-25: `typing.cast` expected 2 arguments, got 3 [bad-argument-count] +ERROR directives_cast.py:15:12-14: `typing.cast` missing required argument `typ` [missing-argument] +ERROR directives_cast.py:15:12-14: `typing.cast` missing required argument `val` [missing-argument] +ERROR directives_cast.py:16:12-19: First argument to `typing.cast` must be a type [bad-argument-type] +ERROR directives_cast.py:17:12-25: `typing.cast` expected 2 arguments, got 3 [bad-argument-count] """ diff --git a/conformance/results/pyrefly/directives_deprecated.toml b/conformance/results/pyrefly/directives_deprecated.toml index 2b3718261..74a726540 100644 --- a/conformance/results/pyrefly/directives_deprecated.toml +++ b/conformance/results/pyrefly/directives_deprecated.toml @@ -1,7 +1,6 @@ conformant = "Unsupported" conformance_automated = "Fail" errors_diff = """ -Line 18: Expected 1 errors Line 24: Expected 1 errors Line 25: Expected 1 errors Line 30: Expected 1 errors @@ -15,4 +14,5 @@ Line 69: Expected 1 errors Line 98: Expected 1 errors """ output = """ + directives_deprecated.py:18:44-47: `Ham` is deprecated [deprecated] """ diff --git a/conformance/results/pyrefly/directives_no_type_check.toml b/conformance/results/pyrefly/directives_no_type_check.toml index a7d97bfb9..e3669041a 100644 --- a/conformance/results/pyrefly/directives_no_type_check.toml +++ b/conformance/results/pyrefly/directives_no_type_check.toml @@ -1,10 +1,11 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/directives_no_type_check.py:15:14-16: `Literal['']` is not assignable to `int` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/directives_no_type_check.py:29:7-17: Argument `Literal[b'invalid']` is not assignable to parameter `a` with type `int` in function `func1` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/directives_no_type_check.py:29:19-31: Argument `Literal[b'arguments']` is not assignable to parameter `b` with type `str` in function `func1` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/directives_no_type_check.py:32:6-8: Missing argument `a` in function `func1` [missing-argument] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/directives_no_type_check.py:32:6-8: Missing argument `b` in function `func1` [missing-argument] +ERROR directives_no_type_check.py:15:14-16: `Literal['']` is not assignable to `int` [bad-assignment] +ERROR directives_no_type_check.py:29:7-17: Argument `Literal[b'invalid']` is not assignable to parameter `a` with type `int` in function `func1` [bad-argument-type] +ERROR directives_no_type_check.py:29:19-31: Argument `Literal[b'arguments']` is not assignable to parameter `b` with type `str` in function `func1` [bad-argument-type] +ERROR directives_no_type_check.py:32:6-8: Missing argument `a` in function `func1` [missing-argument] +ERROR directives_no_type_check.py:32:6-8: Missing argument `b` in function `func1` [missing-argument] """ diff --git a/conformance/results/pyrefly/directives_reveal_type.toml b/conformance/results/pyrefly/directives_reveal_type.toml index 3ae85a4fd..2257de40a 100644 --- a/conformance/results/pyrefly/directives_reveal_type.toml +++ b/conformance/results/pyrefly/directives_reveal_type.toml @@ -1,7 +1,12 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/directives_reveal_type.py:19:16-18: reveal_type needs 1 positional argument, got 0 [bad-argument-count] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/directives_reveal_type.py:20:16-22: reveal_type needs 1 positional argument, got 2 [bad-argument-count] + directives_reveal_type.py:14:16-19: revealed type: int | str [reveal-type] + directives_reveal_type.py:15:16-19: revealed type: list[int] [reveal-type] + directives_reveal_type.py:16:16-19: revealed type: Any [reveal-type] + directives_reveal_type.py:17:16-19: revealed type: ForwardReference [reveal-type] +ERROR directives_reveal_type.py:19:16-18: reveal_type needs 1 positional argument, got 0 [bad-argument-count] +ERROR directives_reveal_type.py:20:16-22: reveal_type needs 1 positional argument, got 2 [bad-argument-count] """ diff --git a/conformance/results/pyrefly/directives_type_checking.toml b/conformance/results/pyrefly/directives_type_checking.toml index cdd4d0cd9..be211bd5b 100644 --- a/conformance/results/pyrefly/directives_type_checking.toml +++ b/conformance/results/pyrefly/directives_type_checking.toml @@ -1,3 +1,4 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ diff --git a/conformance/results/pyrefly/directives_type_ignore.toml b/conformance/results/pyrefly/directives_type_ignore.toml index cdd4d0cd9..be211bd5b 100644 --- a/conformance/results/pyrefly/directives_type_ignore.toml +++ b/conformance/results/pyrefly/directives_type_ignore.toml @@ -1,3 +1,4 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ diff --git a/conformance/results/pyrefly/directives_type_ignore_file1.toml b/conformance/results/pyrefly/directives_type_ignore_file1.toml index cdd4d0cd9..be211bd5b 100644 --- a/conformance/results/pyrefly/directives_type_ignore_file1.toml +++ b/conformance/results/pyrefly/directives_type_ignore_file1.toml @@ -1,3 +1,4 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ diff --git a/conformance/results/pyrefly/directives_type_ignore_file2.toml b/conformance/results/pyrefly/directives_type_ignore_file2.toml index 294d88e9e..ae2a41fdc 100644 --- a/conformance/results/pyrefly/directives_type_ignore_file2.toml +++ b/conformance/results/pyrefly/directives_type_ignore_file2.toml @@ -1,6 +1,7 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/directives_type_ignore_file2.py:14:10-12: `Literal['']` is not assignable to `int` [bad-assignment] +ERROR directives_type_ignore_file2.py:14:10-12: `Literal['']` is not assignable to `int` [bad-assignment] """ diff --git a/conformance/results/pyrefly/directives_version_platform.toml b/conformance/results/pyrefly/directives_version_platform.toml index 6d176aaaa..9ef3c26b0 100644 --- a/conformance/results/pyrefly/directives_version_platform.toml +++ b/conformance/results/pyrefly/directives_version_platform.toml @@ -1,7 +1,8 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/directives_version_platform.py:40:17-19: `Literal['']` is not assignable to `int` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/directives_version_platform.py:45:17-19: `Literal['']` is not assignable to `int` [bad-assignment] +ERROR directives_version_platform.py:40:17-19: `Literal['']` is not assignable to `int` [bad-assignment] +ERROR directives_version_platform.py:45:17-19: `Literal['']` is not assignable to `int` [bad-assignment] """ diff --git a/conformance/results/pyrefly/enums_behaviors.toml b/conformance/results/pyrefly/enums_behaviors.toml index 70e74c9d3..40b63a7e1 100644 --- a/conformance/results/pyrefly/enums_behaviors.toml +++ b/conformance/results/pyrefly/enums_behaviors.toml @@ -7,8 +7,8 @@ errors_diff = """ Line 20: Unexpected errors ['assert_type(Any, Color) failed [assert-type]'] """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/enums_behaviors.py:20:16-30: assert_type(Any, Color) failed [assert-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/enums_behaviors.py:27:12-33: assert_type(Literal[Color.RED], Color) failed [assert-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/enums_behaviors.py:32:12-43: assert_type(Color, Literal[Color.BLUE]) failed [assert-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/enums_behaviors.py:44:21-26: Cannot extend final class `Shape` [invalid-inheritance] +ERROR enums_behaviors.py:20:16-30: assert_type(Any, Color) failed [assert-type] +ERROR enums_behaviors.py:27:12-33: assert_type(Literal[Color.RED], Color) failed [assert-type] +ERROR enums_behaviors.py:32:12-43: assert_type(Color, Literal[Color.BLUE]) failed [assert-type] +ERROR enums_behaviors.py:44:21-26: Cannot extend final class `Shape` [invalid-inheritance] """ diff --git a/conformance/results/pyrefly/enums_definition.toml b/conformance/results/pyrefly/enums_definition.toml index cdd4d0cd9..be211bd5b 100644 --- a/conformance/results/pyrefly/enums_definition.toml +++ b/conformance/results/pyrefly/enums_definition.toml @@ -1,3 +1,4 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ diff --git a/conformance/results/pyrefly/enums_expansion.toml b/conformance/results/pyrefly/enums_expansion.toml index a05e64357..bbf9ce7ce 100644 --- a/conformance/results/pyrefly/enums_expansion.toml +++ b/conformance/results/pyrefly/enums_expansion.toml @@ -1,6 +1,7 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/enums_expansion.py:53:20-51: assert_type(CustomFlags, Literal[CustomFlags.FLAG3]) failed [assert-type] +ERROR enums_expansion.py:53:20-51: assert_type(CustomFlags, Literal[CustomFlags.FLAG3]) failed [assert-type] """ diff --git a/conformance/results/pyrefly/enums_member_names.toml b/conformance/results/pyrefly/enums_member_names.toml index 9650f2d3c..f0f464fe6 100644 --- a/conformance/results/pyrefly/enums_member_names.toml +++ b/conformance/results/pyrefly/enums_member_names.toml @@ -1,6 +1,7 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/enums_member_names.py:30:16-65: assert_type(str, Literal['BLUE', 'GREEN', 'RED']) failed [assert-type] +ERROR enums_member_names.py:30:16-65: assert_type(str, Literal['BLUE', 'GREEN', 'RED']) failed [assert-type] """ diff --git a/conformance/results/pyrefly/enums_member_values.toml b/conformance/results/pyrefly/enums_member_values.toml index ef8220628..103ac0050 100644 --- a/conformance/results/pyrefly/enums_member_values.toml +++ b/conformance/results/pyrefly/enums_member_values.toml @@ -1,14 +1,15 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/enums_member_values.py:21:12-43: assert_type(int, Literal[1]) failed [assert-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/enums_member_values.py:22:12-41: assert_type(int, Literal[1]) failed [assert-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/enums_member_values.py:26:16-50: assert_type(int, Literal[1, 3]) failed [assert-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/enums_member_values.py:30:16-51: assert_type(int, Literal[1, 2, 3]) failed [assert-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/enums_member_values.py:54:12-46: assert_type(tuple[Literal[1], float, float], Literal[1]) failed [assert-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/enums_member_values.py:68:12-42: assert_type(auto, Literal[1]) failed [assert-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/enums_member_values.py:78:5-10: Enum member `GREEN` has type `str`, must match the `_value_` attribute annotation of `int` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/enums_member_values.py:85:24-29: `int` is not assignable to attribute `_value_` with type `str` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/enums_member_values.py:96:12-41: assert_type(Ellipsis, int) failed [assert-type] +ERROR enums_member_values.py:21:12-43: assert_type(int, Literal[1]) failed [assert-type] +ERROR enums_member_values.py:22:12-41: assert_type(int, Literal[1]) failed [assert-type] +ERROR enums_member_values.py:26:16-50: assert_type(int, Literal[1, 3]) failed [assert-type] +ERROR enums_member_values.py:30:16-51: assert_type(int, Literal[1, 2, 3]) failed [assert-type] +ERROR enums_member_values.py:54:12-46: assert_type(tuple[Literal[1], float, float], Literal[1]) failed [assert-type] +ERROR enums_member_values.py:68:12-42: assert_type(auto, Literal[1]) failed [assert-type] +ERROR enums_member_values.py:78:5-10: Enum member `GREEN` has type `str`, must match the `_value_` attribute annotation of `int` [bad-assignment] +ERROR enums_member_values.py:85:24-29: `int` is not assignable to attribute `_value_` with type `str` [bad-assignment] +ERROR enums_member_values.py:96:12-41: assert_type(Ellipsis, int) failed [assert-type] """ diff --git a/conformance/results/pyrefly/enums_members.toml b/conformance/results/pyrefly/enums_members.toml index 9e9397d03..5e14c87e0 100644 --- a/conformance/results/pyrefly/enums_members.toml +++ b/conformance/results/pyrefly/enums_members.toml @@ -9,24 +9,25 @@ Line 28: Unexpected errors ['assert_type(Any, str) failed [assert-type]', 'Insta Line 100: Unexpected errors ['assert_type(Literal[TrafficLight.AMBER], Literal[TrafficLight.YELLOW]) failed [assert-type]'] """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/enums_members.py:27:12-28: assert_type(Any, str) failed [assert-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/enums_members.py:27:13-22: Instance-only attribute `genus` of class `Pet` is not visible on the class [missing-attribute] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/enums_members.py:28:12-30: assert_type(Any, str) failed [assert-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/enums_members.py:28:13-24: Instance-only attribute `species` of class `Pet` is not visible on the class [missing-attribute] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/enums_members.py:50:5-8: Enum member `DOG` may not be annotated directly. Instead, annotate the `_value_` attribute. [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/enums_members.py:82:12-53: assert_type((x: Any) -> str, Any) failed [assert-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/enums_members.py:82:37-51: `Pet4.converter` is not a valid enum member [invalid-literal] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/enums_members.py:83:12-53: assert_type((x: int) -> int, Any) failed [assert-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/enums_members.py:83:37-51: `Pet4.transform` is not a valid enum member [invalid-literal] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/enums_members.py:84:12-49: assert_type((self: Self) -> str, Any) failed [assert-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/enums_members.py:84:35-47: `Pet4.species` is not a valid enum member [invalid-literal] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/enums_members.py:85:12-45: assert_type((self: Self) -> None, Any) failed [assert-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/enums_members.py:85:33-43: `Pet4.speak` is not a valid enum member [invalid-literal] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/enums_members.py:100:12-62: assert_type(Literal[TrafficLight.AMBER], Literal[TrafficLight.YELLOW]) failed [assert-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/enums_members.py:116:12-43: assert_type(nonmember[int], Any) failed [assert-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/enums_members.py:116:32-41: `Example.b` is not a valid enum member [invalid-literal] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/enums_members.py:129:20-57: assert_type(int, Any) failed [assert-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/enums_members.py:129:43-55: `Example2.__B` is not a valid enum member [invalid-literal] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/enums_members.py:146:12-27: assert_type(Literal[Pet5.DOG], int) failed [assert-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/enums_members.py:147:12-28: assert_type(Literal[Pet5.FISH], int) failed [assert-type] +ERROR enums_members.py:27:12-28: assert_type(Any, str) failed [assert-type] +ERROR enums_members.py:27:13-22: Instance-only attribute `genus` of class `Pet` is not visible on the class [missing-attribute] +ERROR enums_members.py:28:12-30: assert_type(Any, str) failed [assert-type] +ERROR enums_members.py:28:13-24: Instance-only attribute `species` of class `Pet` is not visible on the class [missing-attribute] +ERROR enums_members.py:50:5-8: Enum member `DOG` may not be annotated directly. Instead, annotate the `_value_` attribute. [invalid-annotation] +ERROR enums_members.py:82:12-53: assert_type((x: Any) -> str, Any) failed [assert-type] +ERROR enums_members.py:82:37-51: `Pet4.converter` is not a valid enum member [invalid-literal] +ERROR enums_members.py:83:12-53: assert_type((x: int) -> int, Any) failed [assert-type] +ERROR enums_members.py:83:37-51: `Pet4.transform` is not a valid enum member [invalid-literal] +ERROR enums_members.py:84:12-49: assert_type((self: Self) -> str, Any) failed [assert-type] +ERROR enums_members.py:84:35-47: `Pet4.species` is not a valid enum member [invalid-literal] +ERROR enums_members.py:85:12-45: assert_type((self: Self) -> None, Any) failed [assert-type] +ERROR enums_members.py:85:33-43: `Pet4.speak` is not a valid enum member [invalid-literal] +ERROR enums_members.py:100:12-62: assert_type(Literal[TrafficLight.AMBER], Literal[TrafficLight.YELLOW]) failed [assert-type] +ERROR enums_members.py:116:12-43: assert_type(nonmember[int], Any) failed [assert-type] +ERROR enums_members.py:116:32-41: `Example.b` is not a valid enum member [invalid-literal] + enums_members.py:128:20-34: revealed type: int [reveal-type] +ERROR enums_members.py:129:20-57: assert_type(int, Any) failed [assert-type] +ERROR enums_members.py:129:43-55: `Example2.__B` is not a valid enum member [invalid-literal] +ERROR enums_members.py:146:12-27: assert_type(Literal[Pet5.DOG], int) failed [assert-type] +ERROR enums_members.py:147:12-28: assert_type(Literal[Pet5.FISH], int) failed [assert-type] """ diff --git a/conformance/results/pyrefly/exceptions_context_managers.toml b/conformance/results/pyrefly/exceptions_context_managers.toml index 8a98cd1f6..d9b225e74 100644 --- a/conformance/results/pyrefly/exceptions_context_managers.toml +++ b/conformance/results/pyrefly/exceptions_context_managers.toml @@ -8,6 +8,6 @@ Line 50: Unexpected errors ['assert_type(str, int | str) failed [assert-type]'] Line 57: Unexpected errors ['assert_type(str, int | str) failed [assert-type]'] """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/exceptions_context_managers.py:50:16-30: assert_type(str, int | str) failed [assert-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/exceptions_context_managers.py:57:16-30: assert_type(str, int | str) failed [assert-type] +ERROR exceptions_context_managers.py:50:16-30: assert_type(str, int | str) failed [assert-type] +ERROR exceptions_context_managers.py:57:16-30: assert_type(str, int | str) failed [assert-type] """ diff --git a/conformance/results/pyrefly/generics_base_class.toml b/conformance/results/pyrefly/generics_base_class.toml index bcae642c5..3c9ace88d 100644 --- a/conformance/results/pyrefly/generics_base_class.toml +++ b/conformance/results/pyrefly/generics_base_class.toml @@ -7,10 +7,10 @@ errors_diff = """ Line 98: Expected 1 errors """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_base_class.py:26:26-27: Argument `SymbolTable` is not assignable to parameter `x` with type `dict[str, list[object]]` in function `takes_dict_incorrect` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_base_class.py:29:14-24: `Generic` is not allowed in this context [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_base_class.py:30:8-15: Expected a type argument for `Generic` [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_base_class.py:49:22-42: Expected 1 type argument for `LinkedList`, got 2 [bad-specialization] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_base_class.py:61:18-34: Expected 1 type argument for `MyDict`, got 2 [bad-specialization] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_base_class.py:68:28-29: Duplicated type parameter declaration `T` [invalid-inheritance] +ERROR generics_base_class.py:26:26-27: Argument `SymbolTable` is not assignable to parameter `x` with type `dict[str, list[object]]` in function `takes_dict_incorrect` [bad-argument-type] +ERROR generics_base_class.py:29:14-24: `Generic` is not allowed in this context [invalid-annotation] +ERROR generics_base_class.py:30:8-15: Expected a type argument for `Generic` [invalid-annotation] +ERROR generics_base_class.py:49:22-42: Expected 1 type argument for `LinkedList`, got 2 [bad-specialization] +ERROR generics_base_class.py:61:18-34: Expected 1 type argument for `MyDict`, got 2 [bad-specialization] +ERROR generics_base_class.py:68:28-29: Duplicated type parameter declaration `T` [invalid-inheritance] """ diff --git a/conformance/results/pyrefly/generics_basic.toml b/conformance/results/pyrefly/generics_basic.toml index 331dd0f2e..209981f5d 100644 --- a/conformance/results/pyrefly/generics_basic.toml +++ b/conformance/results/pyrefly/generics_basic.toml @@ -12,22 +12,22 @@ Line 67: Unexpected errors ['assert_type(MyStr, str) failed [assert-type]'] Line 68: Unexpected errors ['assert_type(MyStr, str) failed [assert-type]', 'Argument `str` is not assignable to parameter `y` with type `MyStr` in function `concat` [bad-argument-type]'] """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_basic.py:34:12-17: `+` is not supported between `AnyStr` and `AnyStr` [unsupported-operation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_basic.py:34:12-17: `+` is not supported between `AnyStr` and `AnyStr` [unsupported-operation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_basic.py:34:12-17: Returned type `bytes | Unknown` is not assignable to declared return type `AnyStr` [bad-return] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_basic.py:40:15-16: Argument `bytes` is not assignable to parameter `y` with type `str` in function `concat` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_basic.py:41:15-16: Argument `str` is not assignable to parameter `y` with type `bytes` in function `concat` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_basic.py:55:53-60: Type variable bounds and constraints must be concrete [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_basic.py:67:16-35: assert_type(MyStr, str) failed [assert-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_basic.py:68:16-35: assert_type(MyStr, str) failed [assert-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_basic.py:68:27-28: Argument `str` is not assignable to parameter `y` with type `MyStr` in function `concat` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_basic.py:69:15-16: Argument `bytes` is not assignable to parameter `y` with type `MyStr` in function `concat` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_basic.py:121:24-25: Duplicated type parameter declaration `T` [invalid-inheritance] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_basic.py:157:8-9: Cannot index into `MyMap1[str, int]` [index-error] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_basic.py:158:8-9: Cannot index into `MyMap2[int, str]` [index-error] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_basic.py:162:7-11: Expected a type variable, got `int` [invalid-type-var] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_basic.py:163:7-11: Expected a type variable, got `int` [invalid-type-var] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_basic.py:171:7-11: Class `Bad3` uses type variables not specified in `Generic` or `Protocol` base [invalid-type-var] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_basic.py:172:7-11: Class `Bad4` uses type variables not specified in `Generic` or `Protocol` base [invalid-type-var] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_basic.py:208:7-26: Metaclass may not be an unbound generic [invalid-inheritance] +ERROR generics_basic.py:34:12-17: `+` is not supported between `AnyStr` and `AnyStr` [unsupported-operation] +ERROR generics_basic.py:34:12-17: `+` is not supported between `AnyStr` and `AnyStr` [unsupported-operation] +ERROR generics_basic.py:34:12-17: Returned type `bytes | Unknown` is not assignable to declared return type `AnyStr` [bad-return] +ERROR generics_basic.py:40:15-16: Argument `bytes` is not assignable to parameter `y` with type `str` in function `concat` [bad-argument-type] +ERROR generics_basic.py:41:15-16: Argument `str` is not assignable to parameter `y` with type `bytes` in function `concat` [bad-argument-type] +ERROR generics_basic.py:55:53-60: Type variable bounds and constraints must be concrete [invalid-annotation] +ERROR generics_basic.py:67:16-35: assert_type(MyStr, str) failed [assert-type] +ERROR generics_basic.py:68:16-35: assert_type(MyStr, str) failed [assert-type] +ERROR generics_basic.py:68:27-28: Argument `str` is not assignable to parameter `y` with type `MyStr` in function `concat` [bad-argument-type] +ERROR generics_basic.py:69:15-16: Argument `bytes` is not assignable to parameter `y` with type `MyStr` in function `concat` [bad-argument-type] +ERROR generics_basic.py:121:24-25: Duplicated type parameter declaration `T` [invalid-inheritance] +ERROR generics_basic.py:157:8-9: Cannot index into `MyMap1[str, int]` [index-error] +ERROR generics_basic.py:158:8-9: Cannot index into `MyMap2[int, str]` [index-error] +ERROR generics_basic.py:162:7-11: Expected a type variable, got `int` [invalid-type-var] +ERROR generics_basic.py:163:7-11: Expected a type variable, got `int` [invalid-type-var] +ERROR generics_basic.py:171:7-11: Class `Bad3` uses type variables not specified in `Generic` or `Protocol` base [invalid-type-var] +ERROR generics_basic.py:172:7-11: Class `Bad4` uses type variables not specified in `Generic` or `Protocol` base [invalid-type-var] +ERROR generics_basic.py:208:7-26: Metaclass may not be an unbound generic [invalid-inheritance] """ diff --git a/conformance/results/pyrefly/generics_defaults.toml b/conformance/results/pyrefly/generics_defaults.toml index c8cf6291e..4b3618525 100644 --- a/conformance/results/pyrefly/generics_defaults.toml +++ b/conformance/results/pyrefly/generics_defaults.toml @@ -9,13 +9,13 @@ Line 169: Unexpected errors ['assert_type([DefaultIntT](Foo7[DefaultIntT]) -> Fo Line 170: Unexpected errors ['assert_type(Any, int) failed [assert-type]', 'Instance-only attribute `attr` of class `Foo7` is not visible on the class [missing-attribute]'] """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_defaults.py:24:7-31: Type parameter `T` without a default cannot follow type parameter `DefaultStrT` with a default [invalid-type-var] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_defaults.py:50:1-20: Expected 5 type arguments for `AllTheDefaults`, got 1 [bad-specialization] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_defaults.py:107:51-54: Expected default `int` of `Invalid1` to be assignable to the upper bound of `str` [invalid-type-var] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_defaults.py:114:52-55: Expected default `int` of `Invalid2` to be one of the following constraints: `float`, `str` [invalid-type-var] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_defaults.py:130:12-27: assert_type(Any, int) failed [assert-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_defaults.py:141:7-11: TypeVar `T5` with a default cannot follow TypeVarTuple `Ts` [invalid-type-var] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_defaults.py:169:12-57: assert_type([DefaultIntT](Foo7[DefaultIntT]) -> Foo7[DefaultIntT], (Foo7[int]) -> Foo7[int]) failed [assert-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_defaults.py:170:12-28: assert_type(Any, int) failed [assert-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_defaults.py:170:13-22: Instance-only attribute `attr` of class `Foo7` is not visible on the class [missing-attribute] +ERROR generics_defaults.py:24:7-31: Type parameter `T` without a default cannot follow type parameter `DefaultStrT` with a default [invalid-type-var] +ERROR generics_defaults.py:50:1-20: Expected 5 type arguments for `AllTheDefaults`, got 1 [bad-specialization] +ERROR generics_defaults.py:107:51-54: Expected default `int` of `Invalid1` to be assignable to the upper bound of `str` [invalid-type-var] +ERROR generics_defaults.py:114:52-55: Expected default `int` of `Invalid2` to be one of the following constraints: `float`, `str` [invalid-type-var] +ERROR generics_defaults.py:130:12-27: assert_type(Any, int) failed [assert-type] +ERROR generics_defaults.py:141:7-11: TypeVar `T5` with a default cannot follow TypeVarTuple `Ts` [invalid-type-var] +ERROR generics_defaults.py:169:12-57: assert_type([DefaultIntT](Foo7[DefaultIntT]) -> Foo7[DefaultIntT], (Foo7[int]) -> Foo7[int]) failed [assert-type] +ERROR generics_defaults.py:170:12-28: assert_type(Any, int) failed [assert-type] +ERROR generics_defaults.py:170:13-22: Instance-only attribute `attr` of class `Foo7` is not visible on the class [missing-attribute] """ diff --git a/conformance/results/pyrefly/generics_defaults_referential.toml b/conformance/results/pyrefly/generics_defaults_referential.toml index c57630b20..1d60cb5c7 100644 --- a/conformance/results/pyrefly/generics_defaults_referential.toml +++ b/conformance/results/pyrefly/generics_defaults_referential.toml @@ -6,14 +6,14 @@ Line 67: Unexpected errors ['Expected default `TypeVar[X1]` of `AlsoOk1` to be a Line 77: Unexpected errors ['Expected default `TypeVar[Y2]` of `AlsoOk2` to be one of the following constraints: `int`, `str`, `bool` [invalid-type-var]'] """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_defaults_referential.py:36:13-15: Argument `Literal['']` is not assignable to parameter `b` with type `int` in function `Foo.__init__` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_defaults_referential.py:37:10-12: Argument `Literal['']` is not assignable to parameter `a` with type `int` in function `Foo.__init__` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_defaults_referential.py:53:7-13: Default of type parameter `Start2T` refers to out-of-scope type parameter `StopT` [invalid-type-var] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_defaults_referential.py:60:11-15: Default of type parameter `S2` refers to out-of-scope type parameter `S1` [invalid-type-var] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_defaults_referential.py:66:30-32: Expected default `TypeVar[X1]` of `Ok1` to be assignable to the upper bound of `float` [invalid-type-var] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_defaults_referential.py:67:38-40: Expected default `TypeVar[X1]` of `AlsoOk1` to be assignable to the upper bound of `int` [invalid-type-var] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_defaults_referential.py:68:40-42: Expected default `TypeVar[X1]` of `Invalid1` to be assignable to the upper bound of `str` [invalid-type-var] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_defaults_referential.py:74:52-54: Expected default `TypeVar[Y1]` of `Invalid2` to be one of the following constraints: `float`, `str` [invalid-type-var] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_defaults_referential.py:77:54-56: Expected default `TypeVar[Y2]` of `AlsoOk2` to be one of the following constraints: `int`, `str`, `bool` [invalid-type-var] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_defaults_referential.py:78:63-65: Expected default `TypeVar[Y2]` of `AlsoInvalid2` to be one of the following constraints: `bool`, `complex` [invalid-type-var] +ERROR generics_defaults_referential.py:36:13-15: Argument `Literal['']` is not assignable to parameter `b` with type `int` in function `Foo.__init__` [bad-argument-type] +ERROR generics_defaults_referential.py:37:10-12: Argument `Literal['']` is not assignable to parameter `a` with type `int` in function `Foo.__init__` [bad-argument-type] +ERROR generics_defaults_referential.py:53:7-13: Default of type parameter `Start2T` refers to out-of-scope type parameter `StopT` [invalid-type-var] +ERROR generics_defaults_referential.py:60:11-15: Default of type parameter `S2` refers to out-of-scope type parameter `S1` [invalid-type-var] +ERROR generics_defaults_referential.py:66:30-32: Expected default `TypeVar[X1]` of `Ok1` to be assignable to the upper bound of `float` [invalid-type-var] +ERROR generics_defaults_referential.py:67:38-40: Expected default `TypeVar[X1]` of `AlsoOk1` to be assignable to the upper bound of `int` [invalid-type-var] +ERROR generics_defaults_referential.py:68:40-42: Expected default `TypeVar[X1]` of `Invalid1` to be assignable to the upper bound of `str` [invalid-type-var] +ERROR generics_defaults_referential.py:74:52-54: Expected default `TypeVar[Y1]` of `Invalid2` to be one of the following constraints: `float`, `str` [invalid-type-var] +ERROR generics_defaults_referential.py:77:54-56: Expected default `TypeVar[Y2]` of `AlsoOk2` to be one of the following constraints: `int`, `str`, `bool` [invalid-type-var] +ERROR generics_defaults_referential.py:78:63-65: Expected default `TypeVar[Y2]` of `AlsoInvalid2` to be one of the following constraints: `bool`, `complex` [invalid-type-var] """ diff --git a/conformance/results/pyrefly/generics_defaults_specialization.toml b/conformance/results/pyrefly/generics_defaults_specialization.toml index d89049e1b..009497adb 100644 --- a/conformance/results/pyrefly/generics_defaults_specialization.toml +++ b/conformance/results/pyrefly/generics_defaults_specialization.toml @@ -1,7 +1,8 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_defaults_specialization.py:30:1-19: Expected 1 type argument for `MyAlias`, got 2 [bad-specialization] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_defaults_specialization.py:55:1-9: Expected 0 type arguments for `Foo`, got 1 [bad-specialization] +ERROR generics_defaults_specialization.py:30:1-19: Expected 1 type argument for `MyAlias`, got 2 [bad-specialization] +ERROR generics_defaults_specialization.py:55:1-9: Expected 0 type arguments for `Foo`, got 1 [bad-specialization] """ diff --git a/conformance/results/pyrefly/generics_paramspec_basic.toml b/conformance/results/pyrefly/generics_paramspec_basic.toml index 99912409b..5529454da 100644 --- a/conformance/results/pyrefly/generics_paramspec_basic.toml +++ b/conformance/results/pyrefly/generics_paramspec_basic.toml @@ -1,14 +1,15 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_basic.py:10:13-31: ParamSpec must be assigned to a variable named `NotIt` [invalid-param-spec] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_basic.py:15:18-19: `ParamSpec[P]` is not allowed in this context [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_basic.py:23:14-15: `ParamSpec` is not allowed in this context [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_basic.py:23:20-21: `ParamSpec` is not allowed in this context [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_basic.py:27:14-33: `Concatenate[int, P]` is not allowed in this context [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_basic.py:31:14-21: `ParamSpec` cannot be used for type parameter [invalid-param-spec] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_basic.py:35:35-36: `ParamSpec` is not allowed in this context [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_basic.py:39:18-19: `ParamSpec` is not allowed in this context [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_basic.py:39:31-32: `ParamSpec` is not allowed in this context [invalid-annotation] +ERROR generics_paramspec_basic.py:10:13-31: ParamSpec must be assigned to a variable named `NotIt` [invalid-param-spec] +ERROR generics_paramspec_basic.py:15:18-19: `ParamSpec[P]` is not allowed in this context [invalid-annotation] +ERROR generics_paramspec_basic.py:23:14-15: `ParamSpec` is not allowed in this context [invalid-annotation] +ERROR generics_paramspec_basic.py:23:20-21: `ParamSpec` is not allowed in this context [invalid-annotation] +ERROR generics_paramspec_basic.py:27:14-33: `Concatenate[int, P]` is not allowed in this context [invalid-annotation] +ERROR generics_paramspec_basic.py:31:14-21: `ParamSpec` cannot be used for type parameter [invalid-param-spec] +ERROR generics_paramspec_basic.py:35:35-36: `ParamSpec` is not allowed in this context [invalid-annotation] +ERROR generics_paramspec_basic.py:39:18-19: `ParamSpec` is not allowed in this context [invalid-annotation] +ERROR generics_paramspec_basic.py:39:31-32: `ParamSpec` is not allowed in this context [invalid-annotation] """ diff --git a/conformance/results/pyrefly/generics_paramspec_components.toml b/conformance/results/pyrefly/generics_paramspec_components.toml index 4c0782458..1dbe5ff1e 100644 --- a/conformance/results/pyrefly/generics_paramspec_components.toml +++ b/conformance/results/pyrefly/generics_paramspec_components.toml @@ -7,23 +7,23 @@ errors_diff = """ Line 30: Expected 1 errors """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_components.py:17:25-33: `ParamSpec` **kwargs is only allowed in a **kwargs annotation [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_components.py:17:45-51: `ParamSpec` *args is only allowed in an *args annotation [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_components.py:20:23-29: `ParamSpec` *args is only allowed in an *args annotation [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_components.py:23:5-24:13: `ParamSpec` *args and **kwargs must be used together [invalid-param-spec] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_components.py:23:46-52: `ParamSpec` *args is only allowed in an *args annotation [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_components.py:26:5-27:13: `ParamSpec` *args and **kwargs must be used together [invalid-param-spec] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_components.py:35:18-24: `ParamSpec` *args is only allowed in an *args annotation [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_components.py:36:20-28: `ParamSpec` **kwargs is only allowed in a **kwargs annotation [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_components.py:38:5-39:13: `ParamSpec` *args and **kwargs must be used together [invalid-param-spec] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_components.py:41:5-42:13: `ParamSpec` *args and **kwargs must be used together [invalid-param-spec] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_components.py:49:10-27: Expected *-unpacked P.args and **-unpacked P.kwargs [invalid-param-spec] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_components.py:51:11-12: Expected 0 positional arguments, got 1 [bad-argument-count] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_components.py:60:28-34: Keyword-only parameter `s` may not appear after ParamSpec args parameter [bad-function-definition] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_components.py:70:10-30: Expected *-unpacked P.args and **-unpacked P.kwargs [invalid-param-spec] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_components.py:72:10-27: Expected 1 more positional argument [bad-argument-count] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_components.py:83:13-14: Unexpected keyword argument `x` in function `foo` [unexpected-keyword] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_components.py:83:13-16: Expected 1 more positional argument in function `foo` [bad-argument-count] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_components.py:98:20-23: Argument `Literal['A']` is not assignable to parameter `a` with type `int` in function `twice` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_components.py:98:25-26: Argument `Literal[1]` is not assignable to parameter `b` with type `str` in function `twice` [bad-argument-type] +ERROR generics_paramspec_components.py:17:25-33: `ParamSpec` **kwargs is only allowed in a **kwargs annotation [invalid-annotation] +ERROR generics_paramspec_components.py:17:45-51: `ParamSpec` *args is only allowed in an *args annotation [invalid-annotation] +ERROR generics_paramspec_components.py:20:23-29: `ParamSpec` *args is only allowed in an *args annotation [invalid-annotation] +ERROR generics_paramspec_components.py:23:5-24:13: `ParamSpec` *args and **kwargs must be used together [invalid-param-spec] +ERROR generics_paramspec_components.py:23:46-52: `ParamSpec` *args is only allowed in an *args annotation [invalid-annotation] +ERROR generics_paramspec_components.py:26:5-27:13: `ParamSpec` *args and **kwargs must be used together [invalid-param-spec] +ERROR generics_paramspec_components.py:35:18-24: `ParamSpec` *args is only allowed in an *args annotation [invalid-annotation] +ERROR generics_paramspec_components.py:36:20-28: `ParamSpec` **kwargs is only allowed in a **kwargs annotation [invalid-annotation] +ERROR generics_paramspec_components.py:38:5-39:13: `ParamSpec` *args and **kwargs must be used together [invalid-param-spec] +ERROR generics_paramspec_components.py:41:5-42:13: `ParamSpec` *args and **kwargs must be used together [invalid-param-spec] +ERROR generics_paramspec_components.py:49:10-27: Expected *-unpacked P.args and **-unpacked P.kwargs [invalid-param-spec] +ERROR generics_paramspec_components.py:51:11-12: Expected 0 positional arguments, got 1 [bad-argument-count] +ERROR generics_paramspec_components.py:60:28-34: Keyword-only parameter `s` may not appear after ParamSpec args parameter [bad-function-definition] +ERROR generics_paramspec_components.py:70:10-30: Expected *-unpacked P.args and **-unpacked P.kwargs [invalid-param-spec] +ERROR generics_paramspec_components.py:72:10-27: Expected 1 more positional argument [bad-argument-count] +ERROR generics_paramspec_components.py:83:13-14: Unexpected keyword argument `x` in function `foo` [unexpected-keyword] +ERROR generics_paramspec_components.py:83:13-16: Expected 1 more positional argument in function `foo` [bad-argument-count] +ERROR generics_paramspec_components.py:98:20-23: Argument `Literal['A']` is not assignable to parameter `a` with type `int` in function `twice` [bad-argument-type] +ERROR generics_paramspec_components.py:98:25-26: Argument `Literal[1]` is not assignable to parameter `b` with type `str` in function `twice` [bad-argument-type] """ diff --git a/conformance/results/pyrefly/generics_paramspec_semantics.toml b/conformance/results/pyrefly/generics_paramspec_semantics.toml index 024db6d84..a62bb475d 100644 --- a/conformance/results/pyrefly/generics_paramspec_semantics.toml +++ b/conformance/results/pyrefly/generics_paramspec_semantics.toml @@ -1,16 +1,17 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_semantics.py:26:4-5: Expected argument `a` to be positional [unexpected-keyword] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_semantics.py:26:11-12: Expected argument `b` to be positional [unexpected-keyword] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_semantics.py:27:9-12: Argument `Literal['A']` is not assignable to parameter `b` with type `bool` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_semantics.py:46:17-20: Argument `(y: int, x: str) -> int` is not assignable to parameter `y` with type `(x: int, y: str) -> int` in function `func1` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_semantics.py:61:23-37: Argument `(*, y: int) -> int` is not assignable to parameter `y` with type `(*, x: int) -> int` in function `func1` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_semantics.py:98:4-5: Argument `Literal[1]` is not assignable to parameter with type `str` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_semantics.py:108:4-5: Argument `Literal[1]` is not assignable to parameter `*args` with type `bool` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_semantics.py:120:4-5: Argument `Literal[1]` is not assignable to parameter with type `str` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_semantics.py:127:1-19: Argument `(x: str) -> int` is not assignable to parameter `x` with type `(int, ParamSpec(@_)) -> int` in function `expects_int_first` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_semantics.py:132:1-19: Argument `(*, x: int) -> int` is not assignable to parameter `x` with type `(int, ParamSpec(@_)) -> int` in function `expects_int_first` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_semantics.py:137:1-19: Argument `(**kwargs: int) -> int` is not assignable to parameter `x` with type `(int, ParamSpec(@_)) -> int` in function `expects_int_first` [bad-argument-type] +ERROR generics_paramspec_semantics.py:26:4-5: Expected argument `a` to be positional [unexpected-keyword] +ERROR generics_paramspec_semantics.py:26:11-12: Expected argument `b` to be positional [unexpected-keyword] +ERROR generics_paramspec_semantics.py:27:9-12: Argument `Literal['A']` is not assignable to parameter `b` with type `bool` [bad-argument-type] +ERROR generics_paramspec_semantics.py:46:17-20: Argument `(y: int, x: str) -> int` is not assignable to parameter `y` with type `(x: int, y: str) -> int` in function `func1` [bad-argument-type] +ERROR generics_paramspec_semantics.py:61:23-37: Argument `(*, y: int) -> int` is not assignable to parameter `y` with type `(*, x: int) -> int` in function `func1` [bad-argument-type] +ERROR generics_paramspec_semantics.py:98:4-5: Argument `Literal[1]` is not assignable to parameter with type `str` [bad-argument-type] +ERROR generics_paramspec_semantics.py:108:4-5: Argument `Literal[1]` is not assignable to parameter `*args` with type `bool` [bad-argument-type] +ERROR generics_paramspec_semantics.py:120:4-5: Argument `Literal[1]` is not assignable to parameter with type `str` [bad-argument-type] +ERROR generics_paramspec_semantics.py:127:1-19: Argument `(x: str) -> int` is not assignable to parameter `x` with type `(int, ParamSpec(@_)) -> int` in function `expects_int_first` [bad-argument-type] +ERROR generics_paramspec_semantics.py:132:1-19: Argument `(*, x: int) -> int` is not assignable to parameter `x` with type `(int, ParamSpec(@_)) -> int` in function `expects_int_first` [bad-argument-type] +ERROR generics_paramspec_semantics.py:137:1-19: Argument `(**kwargs: int) -> int` is not assignable to parameter `x` with type `(int, ParamSpec(@_)) -> int` in function `expects_int_first` [bad-argument-type] """ diff --git a/conformance/results/pyrefly/generics_paramspec_specialization.toml b/conformance/results/pyrefly/generics_paramspec_specialization.toml index 88c54566c..a835b8d19 100644 --- a/conformance/results/pyrefly/generics_paramspec_specialization.toml +++ b/conformance/results/pyrefly/generics_paramspec_specialization.toml @@ -1,10 +1,11 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_specialization.py:44:15-31: Expected a valid ParamSpec expression, got `int` [invalid-param-spec] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_specialization.py:54:9-11: Argument `Literal['']` is not assignable to parameter with type `int` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_specialization.py:55:16-18: Argument `Literal['']` is not assignable to parameter with type `bool` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_specialization.py:60:9-11: Argument `Literal['']` is not assignable to parameter with type `int` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_paramspec_specialization.py:61:16-18: Argument `Literal['']` is not assignable to parameter with type `bool` [bad-argument-type] +ERROR generics_paramspec_specialization.py:44:15-31: Expected a valid ParamSpec expression, got `int` [invalid-param-spec] +ERROR generics_paramspec_specialization.py:54:9-11: Argument `Literal['']` is not assignable to parameter with type `int` [bad-argument-type] +ERROR generics_paramspec_specialization.py:55:16-18: Argument `Literal['']` is not assignable to parameter with type `bool` [bad-argument-type] +ERROR generics_paramspec_specialization.py:60:9-11: Argument `Literal['']` is not assignable to parameter with type `int` [bad-argument-type] +ERROR generics_paramspec_specialization.py:61:16-18: Argument `Literal['']` is not assignable to parameter with type `bool` [bad-argument-type] """ diff --git a/conformance/results/pyrefly/generics_scoping.toml b/conformance/results/pyrefly/generics_scoping.toml index e4c192fa1..f73633f3c 100644 --- a/conformance/results/pyrefly/generics_scoping.toml +++ b/conformance/results/pyrefly/generics_scoping.toml @@ -14,6 +14,6 @@ Line 95: Expected 1 errors Line 96: Expected 1 errors """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_scoping.py:29:10-13: Argument `Literal['a']` is not assignable to parameter `x` with type `int` in function `MyClass.meth_2` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_scoping.py:65:11-20: Redundant type parameter declaration [invalid-type-var] +ERROR generics_scoping.py:29:10-13: Argument `Literal['a']` is not assignable to parameter `x` with type `int` in function `MyClass.meth_2` [bad-argument-type] +ERROR generics_scoping.py:65:11-20: Redundant type parameter declaration [invalid-type-var] """ diff --git a/conformance/results/pyrefly/generics_self_advanced.toml b/conformance/results/pyrefly/generics_self_advanced.toml index 381cfcaa3..f671925ce 100644 --- a/conformance/results/pyrefly/generics_self_advanced.toml +++ b/conformance/results/pyrefly/generics_self_advanced.toml @@ -8,8 +8,8 @@ Line 43: Unexpected errors ['assert_type(Any, list[Self]) failed [assert-type]', Line 44: Unexpected errors ['assert_type(Any, Self) failed [assert-type]', 'Instance-only attribute `a` of class `ChildB` is not visible on the class [missing-attribute]'] """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_self_advanced.py:43:20-39: assert_type(Any, list[Self]) failed [assert-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_self_advanced.py:43:21-26: Instance-only attribute `a` of class `ChildB` is not visible on the class [missing-attribute] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_self_advanced.py:44:20-36: assert_type(Any, Self) failed [assert-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_self_advanced.py:44:21-26: Instance-only attribute `a` of class `ChildB` is not visible on the class [missing-attribute] +ERROR generics_self_advanced.py:43:20-39: assert_type(Any, list[Self]) failed [assert-type] +ERROR generics_self_advanced.py:43:21-26: Instance-only attribute `a` of class `ChildB` is not visible on the class [missing-attribute] +ERROR generics_self_advanced.py:44:20-36: assert_type(Any, Self) failed [assert-type] +ERROR generics_self_advanced.py:44:21-26: Instance-only attribute `a` of class `ChildB` is not visible on the class [missing-attribute] """ diff --git a/conformance/results/pyrefly/generics_self_attributes.toml b/conformance/results/pyrefly/generics_self_attributes.toml index ef6159750..e93cf3661 100644 --- a/conformance/results/pyrefly/generics_self_attributes.toml +++ b/conformance/results/pyrefly/generics_self_attributes.toml @@ -7,5 +7,5 @@ errors_diff = """ Line 32: Expected 1 errors """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_self_attributes.py:26:38-62: Argument `LinkedList[int]` is not assignable to parameter `next` with type `OrdinalLinkedList | None` in function `OrdinalLinkedList.__init__` [bad-argument-type] +ERROR generics_self_attributes.py:26:38-62: Argument `LinkedList[int]` is not assignable to parameter `next` with type `OrdinalLinkedList | None` in function `OrdinalLinkedList.__init__` [bad-argument-type] """ diff --git a/conformance/results/pyrefly/generics_self_basic.toml b/conformance/results/pyrefly/generics_self_basic.toml index 5f0cfdd19..0e72344d0 100644 --- a/conformance/results/pyrefly/generics_self_basic.toml +++ b/conformance/results/pyrefly/generics_self_basic.toml @@ -8,5 +8,5 @@ Line 20: Expected 1 errors Line 33: Expected 1 errors """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_self_basic.py:67:26-35: `type[Self@Container]` is not subscriptable [unsupported-operation] +ERROR generics_self_basic.py:67:26-35: `type[Self@Container]` is not subscriptable [unsupported-operation] """ diff --git a/conformance/results/pyrefly/generics_self_protocols.toml b/conformance/results/pyrefly/generics_self_protocols.toml index 5b4c54c56..41968988b 100644 --- a/conformance/results/pyrefly/generics_self_protocols.toml +++ b/conformance/results/pyrefly/generics_self_protocols.toml @@ -7,7 +7,7 @@ errors_diff = """ Line 58: Unexpected errors ['Argument `ReturnConcreteShape` is not assignable to parameter `shape` with type `ShapeProtocol` in function `accepts_shape` [bad-argument-type]'] """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_self_protocols.py:58:19-40: Argument `ReturnConcreteShape` is not assignable to parameter `shape` with type `ShapeProtocol` in function `accepts_shape` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_self_protocols.py:61:19-34: Argument `BadReturnType` is not assignable to parameter `shape` with type `ShapeProtocol` in function `accepts_shape` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_self_protocols.py:64:19-41: Argument `ReturnDifferentClass` is not assignable to parameter `shape` with type `ShapeProtocol` in function `accepts_shape` [bad-argument-type] +ERROR generics_self_protocols.py:58:19-40: Argument `ReturnConcreteShape` is not assignable to parameter `shape` with type `ShapeProtocol` in function `accepts_shape` [bad-argument-type] +ERROR generics_self_protocols.py:61:19-34: Argument `BadReturnType` is not assignable to parameter `shape` with type `ShapeProtocol` in function `accepts_shape` [bad-argument-type] +ERROR generics_self_protocols.py:64:19-41: Argument `ReturnDifferentClass` is not assignable to parameter `shape` with type `ShapeProtocol` in function `accepts_shape` [bad-argument-type] """ diff --git a/conformance/results/pyrefly/generics_self_usage.toml b/conformance/results/pyrefly/generics_self_usage.toml index 5394826c8..44c8b5605 100644 --- a/conformance/results/pyrefly/generics_self_usage.toml +++ b/conformance/results/pyrefly/generics_self_usage.toml @@ -16,5 +16,5 @@ Line 121: Expected 1 errors Line 125: Expected 1 errors """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_self_usage.py:103:12-16: Invalid base class: `Self` [invalid-inheritance] +ERROR generics_self_usage.py:103:12-16: Invalid base class: `Self` [invalid-inheritance] """ diff --git a/conformance/results/pyrefly/generics_syntax_compatibility.toml b/conformance/results/pyrefly/generics_syntax_compatibility.toml index 8a9785fcf..1ed01bdef 100644 --- a/conformance/results/pyrefly/generics_syntax_compatibility.toml +++ b/conformance/results/pyrefly/generics_syntax_compatibility.toml @@ -1,9 +1,10 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_syntax_compatibility.py:14:7-13: Class `ClassA` uses type variables not specified in `Generic` or `Protocol` base [invalid-type-var] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_syntax_compatibility.py:14:22-23: Type parameter K is not included in the type parameter list [invalid-type-var] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_syntax_compatibility.py:26:35-36: Type parameter K is not included in the type parameter list [invalid-type-var] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_syntax_compatibility.py:26:45-46: Type parameter K is not included in the type parameter list [invalid-type-var] +ERROR generics_syntax_compatibility.py:14:7-13: Class `ClassA` uses type variables not specified in `Generic` or `Protocol` base [invalid-type-var] +ERROR generics_syntax_compatibility.py:14:22-23: Type parameter K is not included in the type parameter list [invalid-type-var] +ERROR generics_syntax_compatibility.py:26:35-36: Type parameter K is not included in the type parameter list [invalid-type-var] +ERROR generics_syntax_compatibility.py:26:45-46: Type parameter K is not included in the type parameter list [invalid-type-var] """ diff --git a/conformance/results/pyrefly/generics_syntax_declarations.toml b/conformance/results/pyrefly/generics_syntax_declarations.toml index bce6e15af..d5b472029 100644 --- a/conformance/results/pyrefly/generics_syntax_declarations.toml +++ b/conformance/results/pyrefly/generics_syntax_declarations.toml @@ -1,15 +1,16 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_syntax_declarations.py:17:7-13: Redundant type parameter declaration [invalid-type-var] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_syntax_declarations.py:25:7-13: Redundant type parameter declaration [invalid-type-var] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_syntax_declarations.py:32:9-21: Object of class `str` has no attribute `is_integer` [missing-attribute] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_syntax_declarations.py:44:21-33: Type variable bounds and constraints must be concrete [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_syntax_declarations.py:48:17-27: Expected a type form, got instance of `list[type[int] | type[str]]` [not-a-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_syntax_declarations.py:60:17-19: Expected at least 2 constraints in TypeVar `T`, got 0 [invalid-type-var] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_syntax_declarations.py:64:17-23: Expected at least 2 constraints in TypeVar `T`, got 1 [invalid-type-var] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_syntax_declarations.py:71:17-19: Expected a type form, got instance of `tuple[type[bytes], type[str]]` [not-a-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_syntax_declarations.py:75:18-19: Expected a type form, got instance of `Literal[3]` [not-a-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_syntax_declarations.py:79:23-24: Could not find name `S` [unknown-name] +ERROR generics_syntax_declarations.py:17:7-13: Redundant type parameter declaration [invalid-type-var] +ERROR generics_syntax_declarations.py:25:7-13: Redundant type parameter declaration [invalid-type-var] +ERROR generics_syntax_declarations.py:32:9-21: Object of class `str` has no attribute `is_integer` [missing-attribute] +ERROR generics_syntax_declarations.py:44:21-33: Type variable bounds and constraints must be concrete [invalid-annotation] +ERROR generics_syntax_declarations.py:48:17-27: Expected a type form, got instance of `list[type[int] | type[str]]` [not-a-type] +ERROR generics_syntax_declarations.py:60:17-19: Expected at least 2 constraints in TypeVar `T`, got 0 [invalid-type-var] +ERROR generics_syntax_declarations.py:64:17-23: Expected at least 2 constraints in TypeVar `T`, got 1 [invalid-type-var] +ERROR generics_syntax_declarations.py:71:17-19: Expected a type form, got instance of `tuple[type[bytes], type[str]]` [not-a-type] +ERROR generics_syntax_declarations.py:75:18-19: Expected a type form, got instance of `Literal[3]` [not-a-type] +ERROR generics_syntax_declarations.py:79:23-24: Could not find name `S` [unknown-name] """ diff --git a/conformance/results/pyrefly/generics_syntax_infer_variance.toml b/conformance/results/pyrefly/generics_syntax_infer_variance.toml index a1328db4b..eec9124da 100644 --- a/conformance/results/pyrefly/generics_syntax_infer_variance.toml +++ b/conformance/results/pyrefly/generics_syntax_infer_variance.toml @@ -1,23 +1,24 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_syntax_infer_variance.py:15:36-55: Contradictory variance specifications [invalid-type-var] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_syntax_infer_variance.py:17:40-59: Contradictory variance specifications [invalid-type-var] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_syntax_infer_variance.py:29:35-62: `ShouldBeCovariant1[float]` is not assignable to `ShouldBeCovariant1[int]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_syntax_infer_variance.py:37:35-62: `ShouldBeCovariant2[float]` is not assignable to `ShouldBeCovariant2[int]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_syntax_infer_variance.py:46:35-62: `ShouldBeCovariant3[float]` is not assignable to `ShouldBeCovariant3[int]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_syntax_infer_variance.py:75:34-64: `ShouldBeCovariant5[float]` is not assignable to `ShouldBeCovariant5[int]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_syntax_infer_variance.py:86:34-64: `ShouldBeCovariant6[float]` is not assignable to `ShouldBeCovariant6[int]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_syntax_infer_variance.py:102:38-64: `ShouldBeInvariant1[int]` is not assignable to `ShouldBeInvariant1[float]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_syntax_infer_variance.py:103:36-66: `ShouldBeInvariant1[float]` is not assignable to `ShouldBeInvariant1[int]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_syntax_infer_variance.py:117:38-64: `ShouldBeInvariant2[int]` is not assignable to `ShouldBeInvariant2[float]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_syntax_infer_variance.py:118:36-66: `ShouldBeInvariant2[float]` is not assignable to `ShouldBeInvariant2[int]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_syntax_infer_variance.py:125:43-73: `ShouldBeInvariant3[int, str]` is not assignable to `ShouldBeInvariant3[float, str]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_syntax_infer_variance.py:126:41-73: `ShouldBeInvariant3[float, str]` is not assignable to `ShouldBeInvariant3[int, str]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_syntax_infer_variance.py:127:43-73: `ShouldBeInvariant3[str, int]` is not assignable to `ShouldBeInvariant3[str, float]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_syntax_infer_variance.py:128:41-73: `ShouldBeInvariant3[str, float]` is not assignable to `ShouldBeInvariant3[str, int]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_syntax_infer_variance.py:136:38-64: `ShouldBeInvariant4[int]` is not assignable to `ShouldBeInvariant4[float]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_syntax_infer_variance.py:144:38-64: `ShouldBeInvariant5[int]` is not assignable to `ShouldBeInvariant5[float]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_syntax_infer_variance.py:155:45-75: `ShouldBeContravariant1[int]` is not assignable to `ShouldBeContravariant1[float]` [bad-assignment] +ERROR generics_syntax_infer_variance.py:15:36-55: Contradictory variance specifications [invalid-type-var] +ERROR generics_syntax_infer_variance.py:17:40-59: Contradictory variance specifications [invalid-type-var] +ERROR generics_syntax_infer_variance.py:29:35-62: `ShouldBeCovariant1[float]` is not assignable to `ShouldBeCovariant1[int]` [bad-assignment] +ERROR generics_syntax_infer_variance.py:37:35-62: `ShouldBeCovariant2[float]` is not assignable to `ShouldBeCovariant2[int]` [bad-assignment] +ERROR generics_syntax_infer_variance.py:46:35-62: `ShouldBeCovariant3[float]` is not assignable to `ShouldBeCovariant3[int]` [bad-assignment] +ERROR generics_syntax_infer_variance.py:75:34-64: `ShouldBeCovariant5[float]` is not assignable to `ShouldBeCovariant5[int]` [bad-assignment] +ERROR generics_syntax_infer_variance.py:86:34-64: `ShouldBeCovariant6[float]` is not assignable to `ShouldBeCovariant6[int]` [bad-assignment] +ERROR generics_syntax_infer_variance.py:102:38-64: `ShouldBeInvariant1[int]` is not assignable to `ShouldBeInvariant1[float]` [bad-assignment] +ERROR generics_syntax_infer_variance.py:103:36-66: `ShouldBeInvariant1[float]` is not assignable to `ShouldBeInvariant1[int]` [bad-assignment] +ERROR generics_syntax_infer_variance.py:117:38-64: `ShouldBeInvariant2[int]` is not assignable to `ShouldBeInvariant2[float]` [bad-assignment] +ERROR generics_syntax_infer_variance.py:118:36-66: `ShouldBeInvariant2[float]` is not assignable to `ShouldBeInvariant2[int]` [bad-assignment] +ERROR generics_syntax_infer_variance.py:125:43-73: `ShouldBeInvariant3[int, str]` is not assignable to `ShouldBeInvariant3[float, str]` [bad-assignment] +ERROR generics_syntax_infer_variance.py:126:41-73: `ShouldBeInvariant3[float, str]` is not assignable to `ShouldBeInvariant3[int, str]` [bad-assignment] +ERROR generics_syntax_infer_variance.py:127:43-73: `ShouldBeInvariant3[str, int]` is not assignable to `ShouldBeInvariant3[str, float]` [bad-assignment] +ERROR generics_syntax_infer_variance.py:128:41-73: `ShouldBeInvariant3[str, float]` is not assignable to `ShouldBeInvariant3[str, int]` [bad-assignment] +ERROR generics_syntax_infer_variance.py:136:38-64: `ShouldBeInvariant4[int]` is not assignable to `ShouldBeInvariant4[float]` [bad-assignment] +ERROR generics_syntax_infer_variance.py:144:38-64: `ShouldBeInvariant5[int]` is not assignable to `ShouldBeInvariant5[float]` [bad-assignment] +ERROR generics_syntax_infer_variance.py:155:45-75: `ShouldBeContravariant1[int]` is not assignable to `ShouldBeContravariant1[float]` [bad-assignment] """ diff --git a/conformance/results/pyrefly/generics_syntax_scoping.toml b/conformance/results/pyrefly/generics_syntax_scoping.toml index 213931876..c0270e159 100644 --- a/conformance/results/pyrefly/generics_syntax_scoping.toml +++ b/conformance/results/pyrefly/generics_syntax_scoping.toml @@ -12,12 +12,12 @@ Line 67: Unexpected errors ['assert_type(Any, int) failed [assert-type]'] Line 116: Unexpected errors ['assert_type(type[T], TypeVar) failed [assert-type]'] """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_syntax_scoping.py:14:20-31: Type variable bounds and constraints must be concrete [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_syntax_scoping.py:18:26-27: Expected a type form, got instance of `int` [not-a-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_syntax_scoping.py:35:7-8: `T` is uninitialized [unbound-name] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_syntax_scoping.py:44:17-18: `T` is uninitialized [unbound-name] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_syntax_scoping.py:44:17-18: Expected a type form, got instance of `int` [not-a-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_syntax_scoping.py:66:20-21: Found `S`, but it was not the global scope [unknown-name] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_syntax_scoping.py:67:24-32: assert_type(Any, int) failed [assert-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_syntax_scoping.py:116:24-36: assert_type(type[T], TypeVar) failed [assert-type] +ERROR generics_syntax_scoping.py:14:20-31: Type variable bounds and constraints must be concrete [invalid-annotation] +ERROR generics_syntax_scoping.py:18:26-27: Expected a type form, got instance of `int` [not-a-type] +ERROR generics_syntax_scoping.py:35:7-8: `T` is uninitialized [unbound-name] +ERROR generics_syntax_scoping.py:44:17-18: `T` is uninitialized [unbound-name] +ERROR generics_syntax_scoping.py:44:17-18: Expected a type form, got instance of `int` [not-a-type] +ERROR generics_syntax_scoping.py:66:20-21: Found `S`, but it was not the global scope [unknown-name] +ERROR generics_syntax_scoping.py:67:24-32: assert_type(Any, int) failed [assert-type] +ERROR generics_syntax_scoping.py:116:24-36: assert_type(type[T], TypeVar) failed [assert-type] """ diff --git a/conformance/results/pyrefly/generics_type_erasure.toml b/conformance/results/pyrefly/generics_type_erasure.toml index 8b46cceaf..dbbeeacb5 100644 --- a/conformance/results/pyrefly/generics_type_erasure.toml +++ b/conformance/results/pyrefly/generics_type_erasure.toml @@ -1,12 +1,13 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_type_erasure.py:38:16-18: Argument `Literal['']` is not assignable to parameter `label` with type `int | None` in function `Node.__init__` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_type_erasure.py:40:16-17: Argument `Literal[0]` is not assignable to parameter `label` with type `str | None` in function `Node.__init__` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_type_erasure.py:42:1-16: Instance-only attribute `label` of class `Node` is not visible on the class [no-access] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_type_erasure.py:43:1-16: Instance-only attribute `label` of class `Node` is not visible on the class [missing-attribute] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_type_erasure.py:44:1-11: Instance-only attribute `label` of class `Node` is not visible on the class [no-access] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_type_erasure.py:45:1-11: Instance-only attribute `label` of class `Node` is not visible on the class [missing-attribute] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_type_erasure.py:46:1-15: Instance-only attribute `label` of class `Node` is not visible on the class [missing-attribute] +ERROR generics_type_erasure.py:38:16-18: Argument `Literal['']` is not assignable to parameter `label` with type `int | None` in function `Node.__init__` [bad-argument-type] +ERROR generics_type_erasure.py:40:16-17: Argument `Literal[0]` is not assignable to parameter `label` with type `str | None` in function `Node.__init__` [bad-argument-type] +ERROR generics_type_erasure.py:42:1-16: Instance-only attribute `label` of class `Node` is not visible on the class [no-access] +ERROR generics_type_erasure.py:43:1-16: Instance-only attribute `label` of class `Node` is not visible on the class [missing-attribute] +ERROR generics_type_erasure.py:44:1-11: Instance-only attribute `label` of class `Node` is not visible on the class [no-access] +ERROR generics_type_erasure.py:45:1-11: Instance-only attribute `label` of class `Node` is not visible on the class [missing-attribute] +ERROR generics_type_erasure.py:46:1-15: Instance-only attribute `label` of class `Node` is not visible on the class [missing-attribute] """ diff --git a/conformance/results/pyrefly/generics_typevartuple_args.toml b/conformance/results/pyrefly/generics_typevartuple_args.toml index bc1953510..6656023bc 100644 --- a/conformance/results/pyrefly/generics_typevartuple_args.toml +++ b/conformance/results/pyrefly/generics_typevartuple_args.toml @@ -1,14 +1,15 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_typevartuple_args.py:33:8-19: Unpacked argument `tuple[Literal[0], Literal['']]` is not assignable to parameter `*args` with type `tuple[*@_, Env]` in function `exec_le` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_typevartuple_args.py:34:8-30: Unpacked argument `tuple[Literal[0], Literal['']]` is not assignable to parameter `*args` with type `tuple[*@_, Env]` in function `exec_le` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_typevartuple_args.py:48:6-17: Unpacked argument `tuple[Literal[1], Literal['2'], Literal[3]]` is not assignable to parameter `*args` with type `tuple[int, ...]` in function `func1` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_typevartuple_args.py:57:6-16: Unpacked argument `tuple[Literal[1], Literal[1], Literal['']]` is not assignable to parameter `*args` with type `tuple[int, *tuple[str, ...], str]` in function `func2` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_typevartuple_args.py:58:6-9: Unpacked argument `tuple[Literal[1]]` is not assignable to parameter `*args` with type `tuple[int, *tuple[str, ...], str]` in function `func2` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_typevartuple_args.py:59:6-10: Unpacked argument `tuple[Literal['']]` is not assignable to parameter `*args` with type `tuple[int, *tuple[str, ...], str]` in function `func2` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_typevartuple_args.py:67:6-9: Unpacked argument `tuple[Literal[1]]` is not assignable to parameter `*args` with type `tuple[int, str]` in function `func3` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_typevartuple_args.py:75:13-19: Argument `tuple[Literal[1], Literal[2]]` is not assignable to parameter `*args` with type `tuple[int]` in function `func4` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_typevartuple_args.py:76:13-19: Argument `tuple[Literal['1']]` is not assignable to parameter `*args` with type `tuple[int]` in function `func4` [bad-argument-type] +ERROR generics_typevartuple_args.py:33:8-19: Unpacked argument `tuple[Literal[0], Literal['']]` is not assignable to parameter `*args` with type `tuple[*@_, Env]` in function `exec_le` [bad-argument-type] +ERROR generics_typevartuple_args.py:34:8-30: Unpacked argument `tuple[Literal[0], Literal['']]` is not assignable to parameter `*args` with type `tuple[*@_, Env]` in function `exec_le` [bad-argument-type] +ERROR generics_typevartuple_args.py:48:6-17: Unpacked argument `tuple[Literal[1], Literal['2'], Literal[3]]` is not assignable to parameter `*args` with type `tuple[int, ...]` in function `func1` [bad-argument-type] +ERROR generics_typevartuple_args.py:57:6-16: Unpacked argument `tuple[Literal[1], Literal[1], Literal['']]` is not assignable to parameter `*args` with type `tuple[int, *tuple[str, ...], str]` in function `func2` [bad-argument-type] +ERROR generics_typevartuple_args.py:58:6-9: Unpacked argument `tuple[Literal[1]]` is not assignable to parameter `*args` with type `tuple[int, *tuple[str, ...], str]` in function `func2` [bad-argument-type] +ERROR generics_typevartuple_args.py:59:6-10: Unpacked argument `tuple[Literal['']]` is not assignable to parameter `*args` with type `tuple[int, *tuple[str, ...], str]` in function `func2` [bad-argument-type] +ERROR generics_typevartuple_args.py:67:6-9: Unpacked argument `tuple[Literal[1]]` is not assignable to parameter `*args` with type `tuple[int, str]` in function `func3` [bad-argument-type] +ERROR generics_typevartuple_args.py:75:13-19: Argument `tuple[Literal[1], Literal[2]]` is not assignable to parameter `*args` with type `tuple[int]` in function `func4` [bad-argument-type] +ERROR generics_typevartuple_args.py:76:13-19: Argument `tuple[Literal['1']]` is not assignable to parameter `*args` with type `tuple[int]` in function `func4` [bad-argument-type] """ diff --git a/conformance/results/pyrefly/generics_typevartuple_basic.toml b/conformance/results/pyrefly/generics_typevartuple_basic.toml index 960c490d7..84d1f31a0 100644 --- a/conformance/results/pyrefly/generics_typevartuple_basic.toml +++ b/conformance/results/pyrefly/generics_typevartuple_basic.toml @@ -7,20 +7,20 @@ errors_diff = """ Line 85: Unexpected errors ['Argument `tuple[float]` is not assignable to parameter `arg2` with type `tuple[int]` in function `func2` [bad-argument-type]'] """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_typevartuple_basic.py:42:34-43: Argument `Height` is not assignable to parameter `shape` with type `tuple[Height, Width]` in function `Array.__init__` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_typevartuple_basic.py:43:41-61: Argument `tuple[Batch, Width]` is not assignable to parameter `shape` with type `tuple[Batch, Height, Width]` in function `Array.__init__` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_typevartuple_basic.py:45:5-45: Argument `tuple[Time, Batch, Width, Height]` is not assignable to parameter `shape` with type `tuple[Time, Batch, Height, Width]` in function `Array.__init__` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_typevartuple_basic.py:52:22-27: `TypeVarTuple` must be unpacked [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_typevartuple_basic.py:53:37-42: `TypeVarTuple` must be unpacked [invalid-type-var-tuple] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_typevartuple_basic.py:56:34-39: `TypeVarTuple` must be unpacked [invalid-type-var-tuple] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_typevartuple_basic.py:59:24-29: `TypeVarTuple` must be unpacked [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_typevartuple_basic.py:65:27-41: Unexpected keyword argument `covariant` to TypeVarTuple [invalid-type-var-tuple] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_typevartuple_basic.py:66:27-30: Unexpected positional argument to TypeVarTuple [invalid-type-var-tuple] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_typevartuple_basic.py:67:27-36: Unexpected keyword argument `bound` to TypeVarTuple [invalid-type-var-tuple] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_typevartuple_basic.py:85:13-19: Argument `tuple[float]` is not assignable to parameter `arg2` with type `tuple[int]` in function `func2` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_typevartuple_basic.py:89:13-19: Argument `tuple[Literal['0']]` is not assignable to parameter `arg2` with type `tuple[int]` in function `func2` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_typevartuple_basic.py:90:15-19: Argument `tuple[Literal[0]]` is not assignable to parameter `arg2` with type `tuple[int, int]` in function `func2` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_typevartuple_basic.py:99:17-18: Argument `Array[Width]` is not assignable to parameter `y` with type `Array[Height]` in function `multiply` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_typevartuple_basic.py:100:17-18: Argument `Array[Height, Width]` is not assignable to parameter `y` with type `Array[Height]` in function `multiply` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_typevartuple_basic.py:106:7-13: Type parameters for class may not have more than one TypeVarTuple [invalid-type-var-tuple] +ERROR generics_typevartuple_basic.py:42:34-43: Argument `Height` is not assignable to parameter `shape` with type `tuple[Height, Width]` in function `Array.__init__` [bad-argument-type] +ERROR generics_typevartuple_basic.py:43:41-61: Argument `tuple[Batch, Width]` is not assignable to parameter `shape` with type `tuple[Batch, Height, Width]` in function `Array.__init__` [bad-argument-type] +ERROR generics_typevartuple_basic.py:45:5-45: Argument `tuple[Time, Batch, Width, Height]` is not assignable to parameter `shape` with type `tuple[Time, Batch, Height, Width]` in function `Array.__init__` [bad-argument-type] +ERROR generics_typevartuple_basic.py:52:22-27: `TypeVarTuple` must be unpacked [invalid-annotation] +ERROR generics_typevartuple_basic.py:53:37-42: `TypeVarTuple` must be unpacked [invalid-type-var-tuple] +ERROR generics_typevartuple_basic.py:56:34-39: `TypeVarTuple` must be unpacked [invalid-type-var-tuple] +ERROR generics_typevartuple_basic.py:59:24-29: `TypeVarTuple` must be unpacked [invalid-annotation] +ERROR generics_typevartuple_basic.py:65:27-41: Unexpected keyword argument `covariant` to TypeVarTuple [invalid-type-var-tuple] +ERROR generics_typevartuple_basic.py:66:27-30: Unexpected positional argument to TypeVarTuple [invalid-type-var-tuple] +ERROR generics_typevartuple_basic.py:67:27-36: Unexpected keyword argument `bound` to TypeVarTuple [invalid-type-var-tuple] +ERROR generics_typevartuple_basic.py:85:13-19: Argument `tuple[float]` is not assignable to parameter `arg2` with type `tuple[int]` in function `func2` [bad-argument-type] +ERROR generics_typevartuple_basic.py:89:13-19: Argument `tuple[Literal['0']]` is not assignable to parameter `arg2` with type `tuple[int]` in function `func2` [bad-argument-type] +ERROR generics_typevartuple_basic.py:90:15-19: Argument `tuple[Literal[0]]` is not assignable to parameter `arg2` with type `tuple[int, int]` in function `func2` [bad-argument-type] +ERROR generics_typevartuple_basic.py:99:17-18: Argument `Array[Width]` is not assignable to parameter `y` with type `Array[Height]` in function `multiply` [bad-argument-type] +ERROR generics_typevartuple_basic.py:100:17-18: Argument `Array[Height, Width]` is not assignable to parameter `y` with type `Array[Height]` in function `multiply` [bad-argument-type] +ERROR generics_typevartuple_basic.py:106:7-13: Type parameters for class may not have more than one TypeVarTuple [invalid-type-var-tuple] """ diff --git a/conformance/results/pyrefly/generics_typevartuple_callable.toml b/conformance/results/pyrefly/generics_typevartuple_callable.toml index b97ebfe02..4c3a32c03 100644 --- a/conformance/results/pyrefly/generics_typevartuple_callable.toml +++ b/conformance/results/pyrefly/generics_typevartuple_callable.toml @@ -1,6 +1,7 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_typevartuple_callable.py:26:28-35: Argument `tuple[Literal[''], Literal[0]]` is not assignable to parameter `args` with type `tuple[int, str]` in function `Process.__init__` [bad-argument-type] +ERROR generics_typevartuple_callable.py:26:28-35: Argument `tuple[Literal[''], Literal[0]]` is not assignable to parameter `args` with type `tuple[int, str]` in function `Process.__init__` [bad-argument-type] """ diff --git a/conformance/results/pyrefly/generics_typevartuple_concat.toml b/conformance/results/pyrefly/generics_typevartuple_concat.toml index 69b21a57c..042e0a2ea 100644 --- a/conformance/results/pyrefly/generics_typevartuple_concat.toml +++ b/conformance/results/pyrefly/generics_typevartuple_concat.toml @@ -7,5 +7,5 @@ errors_diff = """ Line 56: Unexpected errors ['Returned type `tuple[*tuple[object | T, ...], object | T]` is not assignable to declared return type `tuple[*Ts, T]` [bad-return]'] """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_typevartuple_concat.py:56:12-30: Returned type `tuple[*tuple[object | T, ...], object | T]` is not assignable to declared return type `tuple[*Ts, T]` [bad-return] +ERROR generics_typevartuple_concat.py:56:12-30: Returned type `tuple[*tuple[object | T, ...], object | T]` is not assignable to declared return type `tuple[*Ts, T]` [bad-return] """ diff --git a/conformance/results/pyrefly/generics_typevartuple_overloads.toml b/conformance/results/pyrefly/generics_typevartuple_overloads.toml index cdd4d0cd9..be211bd5b 100644 --- a/conformance/results/pyrefly/generics_typevartuple_overloads.toml +++ b/conformance/results/pyrefly/generics_typevartuple_overloads.toml @@ -1,3 +1,4 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ diff --git a/conformance/results/pyrefly/generics_typevartuple_specialization.toml b/conformance/results/pyrefly/generics_typevartuple_specialization.toml index 308c9009f..885ec1d88 100644 --- a/conformance/results/pyrefly/generics_typevartuple_specialization.toml +++ b/conformance/results/pyrefly/generics_typevartuple_specialization.toml @@ -10,14 +10,14 @@ Line 153: Unexpected errors ['Unpacked argument cannot be used for type paramete Line 157: Unexpected errors ['assert_type(tuple[Any], tuple[*tuple[int, ...], int]) failed [assert-type]'] """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_typevartuple_specialization.py:51:16-31: assert_type(tuple[int, *tuple[Any, ...]], tuple[int]) failed [assert-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_typevartuple_specialization.py:94:16-33: assert_type(tuple[float, *tuple[Any, ...]], tuple[float]) failed [assert-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_typevartuple_specialization.py:109:1-21: Unpacked argument cannot be used for type parameter T [bad-unpacking] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_typevartuple_specialization.py:110:1-36: Unpacked argument cannot be used for type parameter T [bad-unpacking] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_typevartuple_specialization.py:121:26-29: Only one unbounded type is allowed to be unpacked [bad-unpacking] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_typevartuple_specialization.py:122:26-42: Only one unbounded type is allowed to be unpacked [bad-unpacking] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_typevartuple_specialization.py:127:5-13: Expected 3 type arguments for `TA7`, got 1 [bad-specialization] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_typevartuple_specialization.py:153:8-29: Unpacked argument cannot be used for type parameter T1 [bad-unpacking] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_typevartuple_specialization.py:157:16-49: assert_type(tuple[Any], tuple[*tuple[int, ...], int]) failed [assert-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_typevartuple_specialization.py:163:8-18: Unpacked argument cannot be used for type parameter T [bad-unpacking] +ERROR generics_typevartuple_specialization.py:51:16-31: assert_type(tuple[int, *tuple[Any, ...]], tuple[int]) failed [assert-type] +ERROR generics_typevartuple_specialization.py:94:16-33: assert_type(tuple[float, *tuple[Any, ...]], tuple[float]) failed [assert-type] +ERROR generics_typevartuple_specialization.py:109:1-21: Unpacked argument cannot be used for type parameter T [bad-unpacking] +ERROR generics_typevartuple_specialization.py:110:1-36: Unpacked argument cannot be used for type parameter T [bad-unpacking] +ERROR generics_typevartuple_specialization.py:121:26-29: Only one unbounded type is allowed to be unpacked [bad-unpacking] +ERROR generics_typevartuple_specialization.py:122:26-42: Only one unbounded type is allowed to be unpacked [bad-unpacking] +ERROR generics_typevartuple_specialization.py:127:5-13: Expected 3 type arguments for `TA7`, got 1 [bad-specialization] +ERROR generics_typevartuple_specialization.py:153:8-29: Unpacked argument cannot be used for type parameter T1 [bad-unpacking] +ERROR generics_typevartuple_specialization.py:157:16-49: assert_type(tuple[Any], tuple[*tuple[int, ...], int]) failed [assert-type] +ERROR generics_typevartuple_specialization.py:163:8-18: Unpacked argument cannot be used for type parameter T [bad-unpacking] """ diff --git a/conformance/results/pyrefly/generics_typevartuple_unpack.toml b/conformance/results/pyrefly/generics_typevartuple_unpack.toml index 08c72ff17..300385ff4 100644 --- a/conformance/results/pyrefly/generics_typevartuple_unpack.toml +++ b/conformance/results/pyrefly/generics_typevartuple_unpack.toml @@ -1,6 +1,7 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_typevartuple_unpack.py:30:28-29: Argument `Array[Batch]` is not assignable to parameter `x` with type `Array[Batch, *tuple[Any, ...], Channels]` in function `process_batch_channels` [bad-argument-type] +ERROR generics_typevartuple_unpack.py:30:28-29: Argument `Array[Batch]` is not assignable to parameter `x` with type `Array[Batch, *tuple[Any, ...], Channels]` in function `process_batch_channels` [bad-argument-type] """ diff --git a/conformance/results/pyrefly/generics_upper_bound.toml b/conformance/results/pyrefly/generics_upper_bound.toml index ca961ff66..d2778f5c1 100644 --- a/conformance/results/pyrefly/generics_upper_bound.toml +++ b/conformance/results/pyrefly/generics_upper_bound.toml @@ -7,8 +7,8 @@ errors_diff = """ Line 51: Expected 1 errors """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_upper_bound.py:24:38-45: Type variable bounds and constraints must be concrete [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_upper_bound.py:43:12-55: assert_type(list[int], list[int] | set[int]) failed [assert-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_upper_bound.py:43:25-31: Argument `set[int]` is not assignable to parameter `y` with type `list[int]` in function `longer` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_upper_bound.py:56:38-49: TypeVar cannot have both constraints and bound [invalid-type-var] +ERROR generics_upper_bound.py:24:38-45: Type variable bounds and constraints must be concrete [invalid-annotation] +ERROR generics_upper_bound.py:43:12-55: assert_type(list[int], list[int] | set[int]) failed [assert-type] +ERROR generics_upper_bound.py:43:25-31: Argument `set[int]` is not assignable to parameter `y` with type `list[int]` in function `longer` [bad-argument-type] +ERROR generics_upper_bound.py:56:38-49: TypeVar cannot have both constraints and bound [invalid-type-var] """ diff --git a/conformance/results/pyrefly/generics_variance.toml b/conformance/results/pyrefly/generics_variance.toml index fd4f730c9..e1eb80eef 100644 --- a/conformance/results/pyrefly/generics_variance.toml +++ b/conformance/results/pyrefly/generics_variance.toml @@ -15,5 +15,5 @@ Lines 141, 142: Expected error (tag 'CoContra_Child5') Lines 195, 196: Expected error (tag 'ContraToContraToContra_WithTA') """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_variance.py:14:36-54: Contradictory variance specifications [invalid-type-var] +ERROR generics_variance.py:14:36-54: Contradictory variance specifications [invalid-type-var] """ diff --git a/conformance/results/pyrefly/generics_variance_inference.toml b/conformance/results/pyrefly/generics_variance_inference.toml index 633f40536..8035068c3 100644 --- a/conformance/results/pyrefly/generics_variance_inference.toml +++ b/conformance/results/pyrefly/generics_variance_inference.toml @@ -1,28 +1,29 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_variance_inference.py:24:33-35: `ClassA[float, int, int]` is not assignable to `ClassA[int, int, int]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_variance_inference.py:25:37-39: `ClassA[float, int, int]` is not assignable to `ClassA[float, float, int]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_variance_inference.py:28:33-35: `ClassA[int, float, float]` is not assignable to `ClassA[int, int, int]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_variance_inference.py:41:35-62: `ShouldBeCovariant1[float]` is not assignable to `ShouldBeCovariant1[int]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_variance_inference.py:49:35-62: `ShouldBeCovariant2[float]` is not assignable to `ShouldBeCovariant2[int]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_variance_inference.py:58:35-62: `ShouldBeCovariant3[float]` is not assignable to `ShouldBeCovariant3[int]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_variance_inference.py:67:34-62: `ShouldBeCovariant4[float]` is not assignable to `ShouldBeCovariant4[int]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_variance_inference.py:80:34-62: `ShouldBeCovariant5[float]` is not assignable to `ShouldBeCovariant5[int]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_variance_inference.py:96:38-64: `ShouldBeInvariant1[int]` is not assignable to `ShouldBeInvariant1[float]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_variance_inference.py:97:36-66: `ShouldBeInvariant1[float]` is not assignable to `ShouldBeInvariant1[int]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_variance_inference.py:111:38-64: `ShouldBeInvariant2[int]` is not assignable to `ShouldBeInvariant2[float]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_variance_inference.py:112:36-66: `ShouldBeInvariant2[float]` is not assignable to `ShouldBeInvariant2[int]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_variance_inference.py:119:43-73: `ShouldBeInvariant3[int, str]` is not assignable to `ShouldBeInvariant3[float, str]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_variance_inference.py:120:41-73: `ShouldBeInvariant3[float, str]` is not assignable to `ShouldBeInvariant3[int, str]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_variance_inference.py:121:43-73: `ShouldBeInvariant3[str, int]` is not assignable to `ShouldBeInvariant3[str, float]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_variance_inference.py:122:41-73: `ShouldBeInvariant3[str, float]` is not assignable to `ShouldBeInvariant3[str, int]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_variance_inference.py:130:38-64: `ShouldBeInvariant4[int]` is not assignable to `ShouldBeInvariant4[float]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_variance_inference.py:138:38-64: `ShouldBeInvariant5[int]` is not assignable to `ShouldBeInvariant5[float]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_variance_inference.py:149:45-75: `ShouldBeContravariant1[int]` is not assignable to `ShouldBeContravariant1[float]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_variance_inference.py:169:31-58: `ShouldBeInvariant6[float]` is not assignable to `ShouldBeInvariant6[int]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_variance_inference.py:170:33-58: `ShouldBeInvariant6[int]` is not assignable to `ShouldBeInvariant6[float]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_variance_inference.py:181:31-58: `ShouldBeCovariant6[float]` is not assignable to `ShouldBeCovariant6[int]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/generics_variance_inference.py:194:37-66: `ShouldBeContravariant2[int]` is not assignable to `ShouldBeContravariant2[float]` [bad-assignment] +ERROR generics_variance_inference.py:24:33-35: `ClassA[float, int, int]` is not assignable to `ClassA[int, int, int]` [bad-assignment] +ERROR generics_variance_inference.py:25:37-39: `ClassA[float, int, int]` is not assignable to `ClassA[float, float, int]` [bad-assignment] +ERROR generics_variance_inference.py:28:33-35: `ClassA[int, float, float]` is not assignable to `ClassA[int, int, int]` [bad-assignment] +ERROR generics_variance_inference.py:41:35-62: `ShouldBeCovariant1[float]` is not assignable to `ShouldBeCovariant1[int]` [bad-assignment] +ERROR generics_variance_inference.py:49:35-62: `ShouldBeCovariant2[float]` is not assignable to `ShouldBeCovariant2[int]` [bad-assignment] +ERROR generics_variance_inference.py:58:35-62: `ShouldBeCovariant3[float]` is not assignable to `ShouldBeCovariant3[int]` [bad-assignment] +ERROR generics_variance_inference.py:67:34-62: `ShouldBeCovariant4[float]` is not assignable to `ShouldBeCovariant4[int]` [bad-assignment] +ERROR generics_variance_inference.py:80:34-62: `ShouldBeCovariant5[float]` is not assignable to `ShouldBeCovariant5[int]` [bad-assignment] +ERROR generics_variance_inference.py:96:38-64: `ShouldBeInvariant1[int]` is not assignable to `ShouldBeInvariant1[float]` [bad-assignment] +ERROR generics_variance_inference.py:97:36-66: `ShouldBeInvariant1[float]` is not assignable to `ShouldBeInvariant1[int]` [bad-assignment] +ERROR generics_variance_inference.py:111:38-64: `ShouldBeInvariant2[int]` is not assignable to `ShouldBeInvariant2[float]` [bad-assignment] +ERROR generics_variance_inference.py:112:36-66: `ShouldBeInvariant2[float]` is not assignable to `ShouldBeInvariant2[int]` [bad-assignment] +ERROR generics_variance_inference.py:119:43-73: `ShouldBeInvariant3[int, str]` is not assignable to `ShouldBeInvariant3[float, str]` [bad-assignment] +ERROR generics_variance_inference.py:120:41-73: `ShouldBeInvariant3[float, str]` is not assignable to `ShouldBeInvariant3[int, str]` [bad-assignment] +ERROR generics_variance_inference.py:121:43-73: `ShouldBeInvariant3[str, int]` is not assignable to `ShouldBeInvariant3[str, float]` [bad-assignment] +ERROR generics_variance_inference.py:122:41-73: `ShouldBeInvariant3[str, float]` is not assignable to `ShouldBeInvariant3[str, int]` [bad-assignment] +ERROR generics_variance_inference.py:130:38-64: `ShouldBeInvariant4[int]` is not assignable to `ShouldBeInvariant4[float]` [bad-assignment] +ERROR generics_variance_inference.py:138:38-64: `ShouldBeInvariant5[int]` is not assignable to `ShouldBeInvariant5[float]` [bad-assignment] +ERROR generics_variance_inference.py:149:45-75: `ShouldBeContravariant1[int]` is not assignable to `ShouldBeContravariant1[float]` [bad-assignment] +ERROR generics_variance_inference.py:169:31-58: `ShouldBeInvariant6[float]` is not assignable to `ShouldBeInvariant6[int]` [bad-assignment] +ERROR generics_variance_inference.py:170:33-58: `ShouldBeInvariant6[int]` is not assignable to `ShouldBeInvariant6[float]` [bad-assignment] +ERROR generics_variance_inference.py:181:31-58: `ShouldBeCovariant6[float]` is not assignable to `ShouldBeCovariant6[int]` [bad-assignment] +ERROR generics_variance_inference.py:194:37-66: `ShouldBeContravariant2[int]` is not assignable to `ShouldBeContravariant2[float]` [bad-assignment] """ diff --git a/conformance/results/pyrefly/historical_positional.toml b/conformance/results/pyrefly/historical_positional.toml index df75cc0f4..f896feb2d 100644 --- a/conformance/results/pyrefly/historical_positional.toml +++ b/conformance/results/pyrefly/historical_positional.toml @@ -1,9 +1,10 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/historical_positional.py:18:4-7: Expected argument `__x` to be positional in function `f1` [unexpected-keyword] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/historical_positional.py:26:16-19: Positional-only parameter `__y` cannot appear after keyword parameters [bad-function-definition] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/historical_positional.py:38:26-29: Positional-only parameter `__y` cannot appear after keyword parameters [bad-function-definition] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/historical_positional.py:43:6-9: Expected argument `__x` to be positional in function `A.m1` [unexpected-keyword] +ERROR historical_positional.py:18:4-7: Expected argument `__x` to be positional in function `f1` [unexpected-keyword] +ERROR historical_positional.py:26:16-19: Positional-only parameter `__y` cannot appear after keyword parameters [bad-function-definition] +ERROR historical_positional.py:38:26-29: Positional-only parameter `__y` cannot appear after keyword parameters [bad-function-definition] +ERROR historical_positional.py:43:6-9: Expected argument `__x` to be positional in function `A.m1` [unexpected-keyword] """ diff --git a/conformance/results/pyrefly/literals_interactions.toml b/conformance/results/pyrefly/literals_interactions.toml index 727d76a9a..cc0646c6e 100644 --- a/conformance/results/pyrefly/literals_interactions.toml +++ b/conformance/results/pyrefly/literals_interactions.toml @@ -8,10 +8,10 @@ Line 71: Unexpected errors ['`@` is not supported between `Matrix[Literal[2], Li Line 72: Unexpected errors ['assert_type(Matrix[Literal[2], int], Matrix[Literal[2], Literal[7]]) failed [assert-type]'] """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/literals_interactions.py:15:5-9: Index 5 out of range for tuple with 3 elements [index-error] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/literals_interactions.py:16:5-9: Index -5 out of range for tuple with 3 elements [index-error] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/literals_interactions.py:17:5-9: Index 4 out of range for tuple with 3 elements [index-error] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/literals_interactions.py:18:5-10: Index -4 out of range for tuple with 3 elements [index-error] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/literals_interactions.py:71:9-14: `@` is not supported between `Matrix[Literal[2], Literal[3]]` and `Matrix[Literal[3], Literal[7]]` [unsupported-operation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/literals_interactions.py:72:16-51: assert_type(Matrix[Literal[2], int], Matrix[Literal[2], Literal[7]]) failed [assert-type] +ERROR literals_interactions.py:15:5-9: Index 5 out of range for tuple with 3 elements [index-error] +ERROR literals_interactions.py:16:5-9: Index -5 out of range for tuple with 3 elements [index-error] +ERROR literals_interactions.py:17:5-9: Index 4 out of range for tuple with 3 elements [index-error] +ERROR literals_interactions.py:18:5-10: Index -4 out of range for tuple with 3 elements [index-error] +ERROR literals_interactions.py:71:9-14: `@` is not supported between `Matrix[Literal[2], Literal[3]]` and `Matrix[Literal[3], Literal[7]]` [unsupported-operation] +ERROR literals_interactions.py:72:16-51: assert_type(Matrix[Literal[2], int], Matrix[Literal[2], Literal[7]]) failed [assert-type] """ diff --git a/conformance/results/pyrefly/literals_literalstring.toml b/conformance/results/pyrefly/literals_literalstring.toml index fe8641132..1e52195ae 100644 --- a/conformance/results/pyrefly/literals_literalstring.toml +++ b/conformance/results/pyrefly/literals_literalstring.toml @@ -9,14 +9,14 @@ Line 111: Unexpected errors ["assert_type(str, Literal['hello']) failed [assert- Line 116: Unexpected errors ['assert_type(str, LiteralString) failed [assert-type]'] """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/literals_literalstring.py:36:29-42: Invalid type inside literal, `LiteralString` [invalid-literal] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/literals_literalstring.py:37:22-35: Invalid type inside literal, `LiteralString` [invalid-literal] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/literals_literalstring.py:43:23-24: `Literal['two']` is not assignable to `Literal['']` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/literals_literalstring.py:66:25-47: `str` is not assignable to `LiteralString` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/literals_literalstring.py:74:25-26: `Literal[3]` is not assignable to `LiteralString` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/literals_literalstring.py:75:25-32: `Literal[b'test']` is not assignable to `LiteralString` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/literals_literalstring.py:111:16-37: assert_type(str, Literal['hello']) failed [assert-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/literals_literalstring.py:116:16-35: assert_type(str, LiteralString) failed [assert-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/literals_literalstring.py:134:51-52: Argument `str` is not assignable to parameter `value` with type `LiteralString` in function `Container.__init__` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/literals_literalstring.py:171:21-24: `list[LiteralString]` is not assignable to `list[str]` [bad-assignment] +ERROR literals_literalstring.py:36:29-42: Invalid type inside literal, `LiteralString` [invalid-literal] +ERROR literals_literalstring.py:37:22-35: Invalid type inside literal, `LiteralString` [invalid-literal] +ERROR literals_literalstring.py:43:23-24: `Literal['two']` is not assignable to `Literal['']` [bad-assignment] +ERROR literals_literalstring.py:66:25-47: `str` is not assignable to `LiteralString` [bad-assignment] +ERROR literals_literalstring.py:74:25-26: `Literal[3]` is not assignable to `LiteralString` [bad-assignment] +ERROR literals_literalstring.py:75:25-32: `Literal[b'test']` is not assignable to `LiteralString` [bad-assignment] +ERROR literals_literalstring.py:111:16-37: assert_type(str, Literal['hello']) failed [assert-type] +ERROR literals_literalstring.py:116:16-35: assert_type(str, LiteralString) failed [assert-type] +ERROR literals_literalstring.py:134:51-52: Argument `str` is not assignable to parameter `value` with type `LiteralString` in function `Container.__init__` [bad-argument-type] +ERROR literals_literalstring.py:171:21-24: `list[LiteralString]` is not assignable to `list[str]` [bad-assignment] """ diff --git a/conformance/results/pyrefly/literals_parameterizations.toml b/conformance/results/pyrefly/literals_parameterizations.toml index 2a9bce7dc..e31da9df2 100644 --- a/conformance/results/pyrefly/literals_parameterizations.toml +++ b/conformance/results/pyrefly/literals_parameterizations.toml @@ -1,22 +1,23 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/literals_parameterizations.py:41:15-20: Invalid literal expression [invalid-literal] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/literals_parameterizations.py:42:15-38: Invalid literal expression [invalid-literal] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/literals_parameterizations.py:43:15-21: Invalid literal expression [invalid-literal] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/literals_parameterizations.py:44:15-17: Invalid literal expression [invalid-literal] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/literals_parameterizations.py:45:15-24: Invalid literal expression [invalid-literal] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/literals_parameterizations.py:46:7-33: `Literal` arguments cannot be parenthesized [invalid-literal] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/literals_parameterizations.py:47:15-35: Invalid literal expression [invalid-literal] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/literals_parameterizations.py:48:15-18: Invalid type inside literal, `int` [invalid-literal] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/literals_parameterizations.py:49:15-23: Expected a type form, got instance of `Literal[3]` [not-a-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/literals_parameterizations.py:50:16-17: Invalid type inside literal, `TypeVar[T]` [invalid-literal] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/literals_parameterizations.py:51:16-20: Invalid literal expression [invalid-literal] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/literals_parameterizations.py:52:16-19: Invalid type inside literal, `Any` [invalid-literal] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/literals_parameterizations.py:53:16-19: Invalid literal expression [invalid-literal] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/literals_parameterizations.py:56:28-33: Invalid literal expression [invalid-literal] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/literals_parameterizations.py:60:4-11: Expected a type argument for `Literal` [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/literals_parameterizations.py:61:12-23: Expected a type form, got instance of `(x: Unknown) -> int` [not-a-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/literals_parameterizations.py:65:32-33: `Literal[Color.RED]` is not assignable to `Literal['Color.RED']` [bad-assignment] +ERROR literals_parameterizations.py:41:15-20: Invalid literal expression [invalid-literal] +ERROR literals_parameterizations.py:42:15-38: Invalid literal expression [invalid-literal] +ERROR literals_parameterizations.py:43:15-21: Invalid literal expression [invalid-literal] +ERROR literals_parameterizations.py:44:15-17: Invalid literal expression [invalid-literal] +ERROR literals_parameterizations.py:45:15-24: Invalid literal expression [invalid-literal] +ERROR literals_parameterizations.py:46:7-33: `Literal` arguments cannot be parenthesized [invalid-literal] +ERROR literals_parameterizations.py:47:15-35: Invalid literal expression [invalid-literal] +ERROR literals_parameterizations.py:48:15-18: Invalid type inside literal, `int` [invalid-literal] +ERROR literals_parameterizations.py:49:15-23: Expected a type form, got instance of `Literal[3]` [not-a-type] +ERROR literals_parameterizations.py:50:16-17: Invalid type inside literal, `TypeVar[T]` [invalid-literal] +ERROR literals_parameterizations.py:51:16-20: Invalid literal expression [invalid-literal] +ERROR literals_parameterizations.py:52:16-19: Invalid type inside literal, `Any` [invalid-literal] +ERROR literals_parameterizations.py:53:16-19: Invalid literal expression [invalid-literal] +ERROR literals_parameterizations.py:56:28-33: Invalid literal expression [invalid-literal] +ERROR literals_parameterizations.py:60:4-11: Expected a type argument for `Literal` [invalid-annotation] +ERROR literals_parameterizations.py:61:12-23: Expected a type form, got instance of `(x: Unknown) -> int` [not-a-type] +ERROR literals_parameterizations.py:65:32-33: `Literal[Color.RED]` is not assignable to `Literal['Color.RED']` [bad-assignment] """ diff --git a/conformance/results/pyrefly/literals_semantics.toml b/conformance/results/pyrefly/literals_semantics.toml index 131f03821..4fdd8dfe2 100644 --- a/conformance/results/pyrefly/literals_semantics.toml +++ b/conformance/results/pyrefly/literals_semantics.toml @@ -1,9 +1,10 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/literals_semantics.py:10:18-19: `Literal[4]` is not assignable to `Literal[3]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/literals_semantics.py:24:26-27: `Literal[0]` is not assignable to `Literal[False]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/literals_semantics.py:25:22-23: `Literal[False]` is not assignable to `Literal[0]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/literals_semantics.py:33:5-11: Augmented assignment produces a value of type `int`, which is not assignable to `Literal[3, 4, 5]` [bad-assignment] +ERROR literals_semantics.py:10:18-19: `Literal[4]` is not assignable to `Literal[3]` [bad-assignment] +ERROR literals_semantics.py:24:26-27: `Literal[0]` is not assignable to `Literal[False]` [bad-assignment] +ERROR literals_semantics.py:25:22-23: `Literal[False]` is not assignable to `Literal[0]` [bad-assignment] +ERROR literals_semantics.py:33:5-11: Augmented assignment produces a value of type `int`, which is not assignable to `Literal[3, 4, 5]` [bad-assignment] """ diff --git a/conformance/results/pyrefly/namedtuples_define_class.toml b/conformance/results/pyrefly/namedtuples_define_class.toml index 2d79143f4..fd191957f 100644 --- a/conformance/results/pyrefly/namedtuples_define_class.toml +++ b/conformance/results/pyrefly/namedtuples_define_class.toml @@ -1,17 +1,18 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/namedtuples_define_class.py:32:7-12: Index 3 out of range for tuple with 3 elements [index-error] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/namedtuples_define_class.py:33:7-13: Index -4 out of range for tuple with 3 elements [index-error] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/namedtuples_define_class.py:44:11-14: Missing argument `y` in function `Point.__new__` [missing-argument] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/namedtuples_define_class.py:45:11-16: Missing argument `y` in function `Point.__new__` [missing-argument] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/namedtuples_define_class.py:46:15-17: Argument `Literal['']` is not assignable to parameter `y` with type `int` in function `Point.__new__` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/namedtuples_define_class.py:47:24-25: Argument `Literal[3]` is not assignable to parameter `units` with type `str` in function `Point.__new__` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/namedtuples_define_class.py:48:22-24: Expected 3 positional arguments, got 4 in function `Point.__new__` [bad-argument-count] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/namedtuples_define_class.py:49:23-28: Unexpected keyword argument `other` in function `Point.__new__` [unexpected-keyword] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/namedtuples_define_class.py:59:5-13: NamedTuple field 'latitude' without a default may not follow NamedTuple field with a default [bad-class-definition] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/namedtuples_define_class.py:79:5-6: Cannot override named tuple element `x` [bad-override] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/namedtuples_define_class.py:98:19-22: Argument `float` is not assignable to parameter `value` with type `str` in function `Property.__new__` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/namedtuples_define_class.py:105:7-11: Named tuples do not support multiple inheritance [invalid-inheritance] +ERROR namedtuples_define_class.py:32:7-12: Index 3 out of range for tuple with 3 elements [index-error] +ERROR namedtuples_define_class.py:33:7-13: Index -4 out of range for tuple with 3 elements [index-error] +ERROR namedtuples_define_class.py:44:11-14: Missing argument `y` in function `Point.__new__` [missing-argument] +ERROR namedtuples_define_class.py:45:11-16: Missing argument `y` in function `Point.__new__` [missing-argument] +ERROR namedtuples_define_class.py:46:15-17: Argument `Literal['']` is not assignable to parameter `y` with type `int` in function `Point.__new__` [bad-argument-type] +ERROR namedtuples_define_class.py:47:24-25: Argument `Literal[3]` is not assignable to parameter `units` with type `str` in function `Point.__new__` [bad-argument-type] +ERROR namedtuples_define_class.py:48:22-24: Expected 3 positional arguments, got 4 in function `Point.__new__` [bad-argument-count] +ERROR namedtuples_define_class.py:49:23-28: Unexpected keyword argument `other` in function `Point.__new__` [unexpected-keyword] +ERROR namedtuples_define_class.py:59:5-13: NamedTuple field 'latitude' without a default may not follow NamedTuple field with a default [bad-class-definition] +ERROR namedtuples_define_class.py:79:5-6: Cannot override named tuple element `x` [bad-override] +ERROR namedtuples_define_class.py:98:19-22: Argument `float` is not assignable to parameter `value` with type `str` in function `Property.__new__` [bad-argument-type] +ERROR namedtuples_define_class.py:105:7-11: Named tuples do not support multiple inheritance [invalid-inheritance] """ diff --git a/conformance/results/pyrefly/namedtuples_define_functional.toml b/conformance/results/pyrefly/namedtuples_define_functional.toml index 3b25b4491..35a386907 100644 --- a/conformance/results/pyrefly/namedtuples_define_functional.toml +++ b/conformance/results/pyrefly/namedtuples_define_functional.toml @@ -1,19 +1,20 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/namedtuples_define_functional.py:16:14-19: Missing argument `y` in function `Point1.__new__` [missing-argument] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/namedtuples_define_functional.py:21:14-16: Missing argument `x` in function `Point2.__new__` [missing-argument] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/namedtuples_define_functional.py:21:14-16: Missing argument `y` in function `Point2.__new__` [missing-argument] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/namedtuples_define_functional.py:26:21-22: Expected 2 positional arguments, got 3 in function `Point3.__new__` [bad-argument-count] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/namedtuples_define_functional.py:31:14-22: Missing argument `y` in function `Point4.__new__` [missing-argument] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/namedtuples_define_functional.py:31:18-19: Unexpected keyword argument `z` in function `Point4.__new__` [unexpected-keyword] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/namedtuples_define_functional.py:36:18-21: Argument `Literal['1']` is not assignable to parameter `y` with type `int` in function `Point5.__new__` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/namedtuples_define_functional.py:37:21-22: Expected 2 positional arguments, got 3 in function `Point5.__new__` [bad-argument-count] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/namedtuples_define_functional.py:42:18-21: Argument `Literal['1']` is not assignable to parameter `y` with type `int` in function `Point6.__new__` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/namedtuples_define_functional.py:43:17-20: Argument `float` is not assignable to parameter `x` with type `int` in function `Point6.__new__` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/namedtuples_define_functional.py:52:31-34: Duplicate field `a` [bad-class-definition] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/namedtuples_define_functional.py:53:33-38: `def` is not a valid identifier [bad-class-definition] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/namedtuples_define_functional.py:54:33-38: `def` is not a valid identifier [bad-class-definition] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/namedtuples_define_functional.py:66:4-6: Missing argument `a` in function `NT5.__new__` [missing-argument] +ERROR namedtuples_define_functional.py:16:14-19: Missing argument `y` in function `Point1.__new__` [missing-argument] +ERROR namedtuples_define_functional.py:21:14-16: Missing argument `x` in function `Point2.__new__` [missing-argument] +ERROR namedtuples_define_functional.py:21:14-16: Missing argument `y` in function `Point2.__new__` [missing-argument] +ERROR namedtuples_define_functional.py:26:21-22: Expected 2 positional arguments, got 3 in function `Point3.__new__` [bad-argument-count] +ERROR namedtuples_define_functional.py:31:14-22: Missing argument `y` in function `Point4.__new__` [missing-argument] +ERROR namedtuples_define_functional.py:31:18-19: Unexpected keyword argument `z` in function `Point4.__new__` [unexpected-keyword] +ERROR namedtuples_define_functional.py:36:18-21: Argument `Literal['1']` is not assignable to parameter `y` with type `int` in function `Point5.__new__` [bad-argument-type] +ERROR namedtuples_define_functional.py:37:21-22: Expected 2 positional arguments, got 3 in function `Point5.__new__` [bad-argument-count] +ERROR namedtuples_define_functional.py:42:18-21: Argument `Literal['1']` is not assignable to parameter `y` with type `int` in function `Point6.__new__` [bad-argument-type] +ERROR namedtuples_define_functional.py:43:17-20: Argument `float` is not assignable to parameter `x` with type `int` in function `Point6.__new__` [bad-argument-type] +ERROR namedtuples_define_functional.py:52:31-34: Duplicate field `a` [bad-class-definition] +ERROR namedtuples_define_functional.py:53:33-38: `def` is not a valid identifier [bad-class-definition] +ERROR namedtuples_define_functional.py:54:33-38: `def` is not a valid identifier [bad-class-definition] +ERROR namedtuples_define_functional.py:66:4-6: Missing argument `a` in function `NT5.__new__` [missing-argument] """ diff --git a/conformance/results/pyrefly/namedtuples_type_compat.toml b/conformance/results/pyrefly/namedtuples_type_compat.toml index 1492f4542..83282a96f 100644 --- a/conformance/results/pyrefly/namedtuples_type_compat.toml +++ b/conformance/results/pyrefly/namedtuples_type_compat.toml @@ -1,7 +1,8 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/namedtuples_type_compat.py:22:23-24: `Point` is not assignable to `tuple[int, int]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/namedtuples_type_compat.py:23:28-29: `Point` is not assignable to `tuple[int, str, str]` [bad-assignment] +ERROR namedtuples_type_compat.py:22:23-24: `Point` is not assignable to `tuple[int, int]` [bad-assignment] +ERROR namedtuples_type_compat.py:23:28-29: `Point` is not assignable to `tuple[int, str, str]` [bad-assignment] """ diff --git a/conformance/results/pyrefly/namedtuples_usage.toml b/conformance/results/pyrefly/namedtuples_usage.toml index 46a3ae9b2..fe89094a7 100644 --- a/conformance/results/pyrefly/namedtuples_usage.toml +++ b/conformance/results/pyrefly/namedtuples_usage.toml @@ -1,13 +1,14 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/namedtuples_usage.py:34:7-11: Index 3 out of range for tuple with 3 elements [index-error] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/namedtuples_usage.py:35:7-12: Index -4 out of range for tuple with 3 elements [index-error] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/namedtuples_usage.py:40:1-4: Cannot set field `x` [read-only] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/namedtuples_usage.py:41:1-5: Cannot set item in `Point` [unsupported-operation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/namedtuples_usage.py:42:5-8: Cannot delete field `x` [read-only] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/namedtuples_usage.py:43:5-9: Cannot delete item in `Point` [unsupported-operation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/namedtuples_usage.py:52:1-7: Cannot unpack Point (of size 3) into 2 values [bad-unpacking] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/namedtuples_usage.py:53:1-21: Cannot unpack Point (of size 3) into 4 values [bad-unpacking] +ERROR namedtuples_usage.py:34:7-11: Index 3 out of range for tuple with 3 elements [index-error] +ERROR namedtuples_usage.py:35:7-12: Index -4 out of range for tuple with 3 elements [index-error] +ERROR namedtuples_usage.py:40:1-4: Cannot set field `x` [read-only] +ERROR namedtuples_usage.py:41:1-5: Cannot set item in `Point` [unsupported-operation] +ERROR namedtuples_usage.py:42:5-8: Cannot delete field `x` [read-only] +ERROR namedtuples_usage.py:43:5-9: Cannot delete item in `Point` [unsupported-operation] +ERROR namedtuples_usage.py:52:1-7: Cannot unpack Point (of size 3) into 2 values [bad-unpacking] +ERROR namedtuples_usage.py:53:1-21: Cannot unpack Point (of size 3) into 4 values [bad-unpacking] """ diff --git a/conformance/results/pyrefly/narrowing_typeguard.toml b/conformance/results/pyrefly/narrowing_typeguard.toml index 3b09d650e..be07b9006 100644 --- a/conformance/results/pyrefly/narrowing_typeguard.toml +++ b/conformance/results/pyrefly/narrowing_typeguard.toml @@ -1,9 +1,10 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/narrowing_typeguard.py:102:9-13: Type guard functions must accept at least one positional argument [bad-function-definition] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/narrowing_typeguard.py:107:9-13: Type guard functions must accept at least one positional argument [bad-function-definition] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/narrowing_typeguard.py:128:20-36: Argument `(val: object) -> TypeGuard[int]` is not assignable to parameter `f` with type `(object) -> str` in function `takes_callable_str` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/narrowing_typeguard.py:148:26-42: Argument `(val: object) -> TypeGuard[int]` is not assignable to parameter `f` with type `CallableStrProto` in function `takes_callable_str_proto` [bad-argument-type] +ERROR narrowing_typeguard.py:102:9-13: Type guard functions must accept at least one positional argument [bad-function-definition] +ERROR narrowing_typeguard.py:107:9-13: Type guard functions must accept at least one positional argument [bad-function-definition] +ERROR narrowing_typeguard.py:128:20-36: Argument `(val: object) -> TypeGuard[int]` is not assignable to parameter `f` with type `(object) -> str` in function `takes_callable_str` [bad-argument-type] +ERROR narrowing_typeguard.py:148:26-42: Argument `(val: object) -> TypeGuard[int]` is not assignable to parameter `f` with type `CallableStrProto` in function `takes_callable_str_proto` [bad-argument-type] """ diff --git a/conformance/results/pyrefly/narrowing_typeis.toml b/conformance/results/pyrefly/narrowing_typeis.toml index f4b482bc9..8ebf9e4af 100644 --- a/conformance/results/pyrefly/narrowing_typeis.toml +++ b/conformance/results/pyrefly/narrowing_typeis.toml @@ -1,14 +1,15 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/narrowing_typeis.py:105:9-13: Type guard functions must accept at least one positional argument [bad-function-definition] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/narrowing_typeis.py:110:9-13: Type guard functions must accept at least one positional argument [bad-function-definition] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/narrowing_typeis.py:132:20-36: Argument `(val: object) -> TypeIs[int]` is not assignable to parameter `f` with type `(object) -> str` in function `takes_callable_str` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/narrowing_typeis.py:152:26-42: Argument `(val: object) -> TypeIs[int]` is not assignable to parameter `f` with type `CallableStrProto` in function `takes_callable_str_proto` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/narrowing_typeis.py:169:17-30: Argument `(val: object) -> TypeIs[int]` is not assignable to parameter `f` with type `(object) -> TypeGuard[int]` in function `takes_typeguard` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/narrowing_typeis.py:170:14-30: Argument `(val: object) -> TypeGuard[int]` is not assignable to parameter `f` with type `(object) -> TypeIs[int]` in function `takes_typeis` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/narrowing_typeis.py:191:18-29: Argument `(val: object) -> TypeIs[bool]` is not assignable to parameter `f` with type `(object) -> TypeIs[int]` in function `takes_int_typeis` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/narrowing_typeis.py:195:5-15: Return type `str` must be assignable to the first argument type `int` [bad-function-definition] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/narrowing_typeis.py:199:5-24: Return type `list[int]` must be assignable to the first argument type `list[object]` [bad-function-definition] +ERROR narrowing_typeis.py:105:9-13: Type guard functions must accept at least one positional argument [bad-function-definition] +ERROR narrowing_typeis.py:110:9-13: Type guard functions must accept at least one positional argument [bad-function-definition] +ERROR narrowing_typeis.py:132:20-36: Argument `(val: object) -> TypeIs[int]` is not assignable to parameter `f` with type `(object) -> str` in function `takes_callable_str` [bad-argument-type] +ERROR narrowing_typeis.py:152:26-42: Argument `(val: object) -> TypeIs[int]` is not assignable to parameter `f` with type `CallableStrProto` in function `takes_callable_str_proto` [bad-argument-type] +ERROR narrowing_typeis.py:169:17-30: Argument `(val: object) -> TypeIs[int]` is not assignable to parameter `f` with type `(object) -> TypeGuard[int]` in function `takes_typeguard` [bad-argument-type] +ERROR narrowing_typeis.py:170:14-30: Argument `(val: object) -> TypeGuard[int]` is not assignable to parameter `f` with type `(object) -> TypeIs[int]` in function `takes_typeis` [bad-argument-type] +ERROR narrowing_typeis.py:191:18-29: Argument `(val: object) -> TypeIs[bool]` is not assignable to parameter `f` with type `(object) -> TypeIs[int]` in function `takes_int_typeis` [bad-argument-type] +ERROR narrowing_typeis.py:195:5-15: Return type `str` must be assignable to the first argument type `int` [bad-function-definition] +ERROR narrowing_typeis.py:199:5-24: Return type `list[int]` must be assignable to the first argument type `list[object]` [bad-function-definition] """ diff --git a/conformance/results/pyrefly/overloads_basic.toml b/conformance/results/pyrefly/overloads_basic.toml index 9159cf6bd..315a20e45 100644 --- a/conformance/results/pyrefly/overloads_basic.toml +++ b/conformance/results/pyrefly/overloads_basic.toml @@ -1,6 +1,7 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/overloads_basic.py:39:1-6: Cannot index into `Bytes` [index-error] +ERROR overloads_basic.py:39:1-6: Cannot index into `Bytes` [index-error] """ diff --git a/conformance/results/pyrefly/overloads_consistency.toml b/conformance/results/pyrefly/overloads_consistency.toml index 89ee75305..c7e562825 100644 --- a/conformance/results/pyrefly/overloads_consistency.toml +++ b/conformance/results/pyrefly/overloads_consistency.toml @@ -1,7 +1,8 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/overloads_consistency.py:25:5-16: Overload return type `str` is not assignable to implementation return type `int` [invalid-overload] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/overloads_consistency.py:41:5-19: Implementation signature `(x: int) -> int | str` does not accept all arguments that overload signature `(x: str) -> str` accepts [invalid-overload] +ERROR overloads_consistency.py:25:5-16: Overload return type `str` is not assignable to implementation return type `int` [invalid-overload] +ERROR overloads_consistency.py:41:5-19: Implementation signature `(x: int) -> int | str` does not accept all arguments that overload signature `(x: str) -> str` accepts [invalid-overload] """ diff --git a/conformance/results/pyrefly/overloads_definitions.toml b/conformance/results/pyrefly/overloads_definitions.toml index 76c89654d..ab58e4fba 100644 --- a/conformance/results/pyrefly/overloads_definitions.toml +++ b/conformance/results/pyrefly/overloads_definitions.toml @@ -14,11 +14,11 @@ Line 49: Unexpected errors ['Overloaded function must have an implementation [in Line 176: Unexpected errors ['`final_method` is declared as final in parent class `Base` [bad-override]'] """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/overloads_definitions.py:16:5-10: Overloaded function needs at least two @overload declarations [invalid-overload] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/overloads_definitions.py:28:5-10: Overloaded function must have an implementation [invalid-overload] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/overloads_definitions.py:49:9-14: Overloaded function must have an implementation [invalid-overload] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/overloads_definitions.py:59:9-21: Overloaded function must have an implementation [invalid-overload] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/overloads_definitions.py:90:9-14: Implementation signature `(cls: type[Self@C], *args: int | str) -> int | str` does not accept all arguments that overload signature `(self: Self@C, x: str, /) -> str` accepts [invalid-overload] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/overloads_definitions.py:176:9-21: `final_method` is declared as final in parent class `Base` [bad-override] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/overloads_definitions.py:191:9-21: Class member `Child.bad_override` is marked as an override, but no parent class has a matching attribute [bad-override] +ERROR overloads_definitions.py:16:5-10: Overloaded function needs at least two @overload declarations [invalid-overload] +ERROR overloads_definitions.py:28:5-10: Overloaded function must have an implementation [invalid-overload] +ERROR overloads_definitions.py:49:9-14: Overloaded function must have an implementation [invalid-overload] +ERROR overloads_definitions.py:59:9-21: Overloaded function must have an implementation [invalid-overload] +ERROR overloads_definitions.py:90:9-14: Implementation signature `(cls: type[Self@C], *args: int | str) -> int | str` does not accept all arguments that overload signature `(self: Self@C, x: str, /) -> str` accepts [invalid-overload] +ERROR overloads_definitions.py:176:9-21: `final_method` is declared as final in parent class `Base` [bad-override] +ERROR overloads_definitions.py:191:9-21: Class member `Child.bad_override` is marked as an override, but no parent class has a matching attribute [bad-override] """ diff --git a/conformance/results/pyrefly/overloads_definitions_stub.toml b/conformance/results/pyrefly/overloads_definitions_stub.toml index c92e574e1..18ba0b318 100644 --- a/conformance/results/pyrefly/overloads_definitions_stub.toml +++ b/conformance/results/pyrefly/overloads_definitions_stub.toml @@ -12,7 +12,7 @@ Lines 80, 82, 84, 85, 86: Expected error (tag 'invalid_final_2') Lines 143, 146, 147, 149: Expected error (tag 'override_impl') """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/overloads_definitions_stub.pyi:14:5-10: Overloaded function needs at least two @overload declarations [invalid-overload] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/overloads_definitions_stub.pyi:108:9-21: `final_method` is declared as final in parent class `Base` [bad-override] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/overloads_definitions_stub.pyi:122:9-21: Class member `Child.bad_override` is marked as an override, but no parent class has a matching attribute [bad-override] +ERROR overloads_definitions_stub.pyi:14:5-10: Overloaded function needs at least two @overload declarations [invalid-overload] +ERROR overloads_definitions_stub.pyi:108:9-21: `final_method` is declared as final in parent class `Base` [bad-override] +ERROR overloads_definitions_stub.pyi:122:9-21: Class member `Child.bad_override` is marked as an override, but no parent class has a matching attribute [bad-override] """ diff --git a/conformance/results/pyrefly/overloads_evaluation.toml b/conformance/results/pyrefly/overloads_evaluation.toml index 227200a26..70360bd2e 100644 --- a/conformance/results/pyrefly/overloads_evaluation.toml +++ b/conformance/results/pyrefly/overloads_evaluation.toml @@ -21,22 +21,22 @@ Line 280: Unexpected errors ['assert_type(list[int], Any) failed [assert-type]'] Line 345: Unexpected errors ['assert_type(list[int], Any) failed [assert-type]'] """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/overloads_evaluation.py:38:11-13: No matching overload found for function `example1_1` [no-matching-overload] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/overloads_evaluation.py:46:11-17: No matching overload found for function `example1_1` [no-matching-overload] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/overloads_evaluation.py:51:11-14: No matching overload found for function `example1_1` [no-matching-overload] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/overloads_evaluation.py:105:20-29: No matching overload found for function `example2` [no-matching-overload] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/overloads_evaluation.py:106:16-33: assert_type(Any, int | str) failed [assert-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/overloads_evaluation.py:115:13-22: No matching overload found for function `example2` [no-matching-overload] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/overloads_evaluation.py:134:23-26: No matching overload found for function `expand_bool` [no-matching-overload] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/overloads_evaluation.py:135:16-37: assert_type(Any, Literal[0, 1]) failed [assert-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/overloads_evaluation.py:160:23-26: No matching overload found for function `expand_enum` [no-matching-overload] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/overloads_evaluation.py:161:16-37: assert_type(Any, Literal[0, 1]) failed [assert-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/overloads_evaluation.py:180:29-32: No matching overload found for function `expand_type_union` [no-matching-overload] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/overloads_evaluation.py:181:16-33: assert_type(Any, int | str) failed [assert-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/overloads_evaluation.py:204:24-32: No matching overload found for function `expand_tuple` [no-matching-overload] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/overloads_evaluation.py:205:16-33: assert_type(Any, int | str) failed [assert-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/overloads_evaluation.py:234:16-27: assert_type(str, int) failed [assert-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/overloads_evaluation.py:264:16-27: assert_type(list[int], Any) failed [assert-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/overloads_evaluation.py:280:16-34: assert_type(list[int], Any) failed [assert-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/overloads_evaluation.py:345:16-27: assert_type(list[int], Any) failed [assert-type] +ERROR overloads_evaluation.py:38:11-13: No matching overload found for function `example1_1` [no-matching-overload] +ERROR overloads_evaluation.py:46:11-17: No matching overload found for function `example1_1` [no-matching-overload] +ERROR overloads_evaluation.py:51:11-14: No matching overload found for function `example1_1` [no-matching-overload] +ERROR overloads_evaluation.py:105:20-29: No matching overload found for function `example2` [no-matching-overload] +ERROR overloads_evaluation.py:106:16-33: assert_type(Any, int | str) failed [assert-type] +ERROR overloads_evaluation.py:115:13-22: No matching overload found for function `example2` [no-matching-overload] +ERROR overloads_evaluation.py:134:23-26: No matching overload found for function `expand_bool` [no-matching-overload] +ERROR overloads_evaluation.py:135:16-37: assert_type(Any, Literal[0, 1]) failed [assert-type] +ERROR overloads_evaluation.py:160:23-26: No matching overload found for function `expand_enum` [no-matching-overload] +ERROR overloads_evaluation.py:161:16-37: assert_type(Any, Literal[0, 1]) failed [assert-type] +ERROR overloads_evaluation.py:180:29-32: No matching overload found for function `expand_type_union` [no-matching-overload] +ERROR overloads_evaluation.py:181:16-33: assert_type(Any, int | str) failed [assert-type] +ERROR overloads_evaluation.py:204:24-32: No matching overload found for function `expand_tuple` [no-matching-overload] +ERROR overloads_evaluation.py:205:16-33: assert_type(Any, int | str) failed [assert-type] +ERROR overloads_evaluation.py:234:16-27: assert_type(str, int) failed [assert-type] +ERROR overloads_evaluation.py:264:16-27: assert_type(list[int], Any) failed [assert-type] +ERROR overloads_evaluation.py:280:16-34: assert_type(list[int], Any) failed [assert-type] +ERROR overloads_evaluation.py:345:16-27: assert_type(list[int], Any) failed [assert-type] """ diff --git a/conformance/results/pyrefly/protocols_class_objects.toml b/conformance/results/pyrefly/protocols_class_objects.toml index d1ba0e165..68cdca5cd 100644 --- a/conformance/results/pyrefly/protocols_class_objects.toml +++ b/conformance/results/pyrefly/protocols_class_objects.toml @@ -13,7 +13,7 @@ Line 108: Expected 1 errors Line 26: Unexpected errors ['Cannot instantiate `Proto` because it is a protocol [bad-instantiation]'] """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_class_objects.py:26:15-17: Cannot instantiate `Proto` because it is a protocol [bad-instantiation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_class_objects.py:58:16-25: `type[ConcreteA]` is not assignable to `ProtoA1` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_class_objects.py:74:16-25: `type[ConcreteB]` is not assignable to `ProtoB1` [bad-assignment] +ERROR protocols_class_objects.py:26:15-17: Cannot instantiate `Proto` because it is a protocol [bad-instantiation] +ERROR protocols_class_objects.py:58:16-25: `type[ConcreteA]` is not assignable to `ProtoA1` [bad-assignment] +ERROR protocols_class_objects.py:74:16-25: `type[ConcreteB]` is not assignable to `ProtoB1` [bad-assignment] """ diff --git a/conformance/results/pyrefly/protocols_definition.toml b/conformance/results/pyrefly/protocols_definition.toml index 6806f75f3..294fd1c60 100644 --- a/conformance/results/pyrefly/protocols_definition.toml +++ b/conformance/results/pyrefly/protocols_definition.toml @@ -11,23 +11,23 @@ Line 117: Expected 1 errors Line 79: Unexpected errors ['`Concrete` is not assignable to `Template` [bad-assignment]'] """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_definition.py:30:11-14: Argument `list[int]` is not assignable to parameter `things` with type `Iterable[SupportsClose]` in function `close_all` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_definition.py:79:17-38: `Concrete` is not assignable to `Template` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_definition.py:114:22-38: `Concrete2_Bad1` is not assignable to `Template2` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_definition.py:115:22-38: `Concrete2_Bad2` is not assignable to `Template2` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_definition.py:156:22-38: `Concrete3_Bad1` is not assignable to `Template3` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_definition.py:157:22-38: `Concrete3_Bad2` is not assignable to `Template3` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_definition.py:158:22-38: `Concrete3_Bad3` is not assignable to `Template3` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_definition.py:159:22-38: `Concrete3_Bad4` is not assignable to `Template3` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_definition.py:160:22-38: `Concrete3_Bad5` is not assignable to `Template3` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_definition.py:218:22-38: `Concrete4_Bad1` is not assignable to `Template4` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_definition.py:219:22-38: `Concrete4_Bad2` is not assignable to `Template4` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_definition.py:285:22-38: `Concrete5_Bad1` is not assignable to `Template5` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_definition.py:286:22-38: `Concrete5_Bad2` is not assignable to `Template5` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_definition.py:287:22-38: `Concrete5_Bad3` is not assignable to `Template5` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_definition.py:288:22-38: `Concrete5_Bad4` is not assignable to `Template5` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_definition.py:289:22-38: `Concrete5_Bad5` is not assignable to `Template5` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_definition.py:339:22-38: `Concrete6_Bad1` is not assignable to `Template6` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_definition.py:340:22-38: `Concrete6_Bad2` is not assignable to `Template6` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_definition.py:341:22-38: `Concrete6_Bad3` is not assignable to `Template6` [bad-assignment] +ERROR protocols_definition.py:30:11-14: Argument `list[int]` is not assignable to parameter `things` with type `Iterable[SupportsClose]` in function `close_all` [bad-argument-type] +ERROR protocols_definition.py:79:17-38: `Concrete` is not assignable to `Template` [bad-assignment] +ERROR protocols_definition.py:114:22-38: `Concrete2_Bad1` is not assignable to `Template2` [bad-assignment] +ERROR protocols_definition.py:115:22-38: `Concrete2_Bad2` is not assignable to `Template2` [bad-assignment] +ERROR protocols_definition.py:156:22-38: `Concrete3_Bad1` is not assignable to `Template3` [bad-assignment] +ERROR protocols_definition.py:157:22-38: `Concrete3_Bad2` is not assignable to `Template3` [bad-assignment] +ERROR protocols_definition.py:158:22-38: `Concrete3_Bad3` is not assignable to `Template3` [bad-assignment] +ERROR protocols_definition.py:159:22-38: `Concrete3_Bad4` is not assignable to `Template3` [bad-assignment] +ERROR protocols_definition.py:160:22-38: `Concrete3_Bad5` is not assignable to `Template3` [bad-assignment] +ERROR protocols_definition.py:218:22-38: `Concrete4_Bad1` is not assignable to `Template4` [bad-assignment] +ERROR protocols_definition.py:219:22-38: `Concrete4_Bad2` is not assignable to `Template4` [bad-assignment] +ERROR protocols_definition.py:285:22-38: `Concrete5_Bad1` is not assignable to `Template5` [bad-assignment] +ERROR protocols_definition.py:286:22-38: `Concrete5_Bad2` is not assignable to `Template5` [bad-assignment] +ERROR protocols_definition.py:287:22-38: `Concrete5_Bad3` is not assignable to `Template5` [bad-assignment] +ERROR protocols_definition.py:288:22-38: `Concrete5_Bad4` is not assignable to `Template5` [bad-assignment] +ERROR protocols_definition.py:289:22-38: `Concrete5_Bad5` is not assignable to `Template5` [bad-assignment] +ERROR protocols_definition.py:339:22-38: `Concrete6_Bad1` is not assignable to `Template6` [bad-assignment] +ERROR protocols_definition.py:340:22-38: `Concrete6_Bad2` is not assignable to `Template6` [bad-assignment] +ERROR protocols_definition.py:341:22-38: `Concrete6_Bad3` is not assignable to `Template6` [bad-assignment] """ diff --git a/conformance/results/pyrefly/protocols_explicit.toml b/conformance/results/pyrefly/protocols_explicit.toml index 39f6df441..5e1815915 100644 --- a/conformance/results/pyrefly/protocols_explicit.toml +++ b/conformance/results/pyrefly/protocols_explicit.toml @@ -12,5 +12,5 @@ Line 135: Expected 1 errors Line 165: Expected 1 errors """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_explicit.py:56:20-36: `tuple[int, int, str]` is not assignable to attribute `rgb` with type `tuple[int, int, int]` [bad-assignment] +ERROR protocols_explicit.py:56:20-36: `tuple[int, int, str]` is not assignable to attribute `rgb` with type `tuple[int, int, int]` [bad-assignment] """ diff --git a/conformance/results/pyrefly/protocols_generic.toml b/conformance/results/pyrefly/protocols_generic.toml index bc8552904..908c30134 100644 --- a/conformance/results/pyrefly/protocols_generic.toml +++ b/conformance/results/pyrefly/protocols_generic.toml @@ -7,14 +7,14 @@ errors_diff = """ Line 144: Unexpected errors ['`ConcreteHasProperty1` is not assignable to `HasPropertyProto` [bad-assignment]'] """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_generic.py:40:24-35: `Concrete1` is not assignable to `Proto1[int, str]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_generic.py:44:7-13: Class `Proto2` specifies type parameters in both `Generic` and `Protocol` bases [invalid-inheritance] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_generic.py:56:20-29: `Box[float]` is not assignable to `Box[int]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_generic.py:66:25-35: `Sender[int]` is not assignable to `Sender[float]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_generic.py:74:28-36: `AttrProto[int]` is not assignable to `AttrProto[float]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_generic.py:75:26-36: `AttrProto[float]` is not assignable to `AttrProto[int]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_generic.py:144:25-47: `ConcreteHasProperty1` is not assignable to `HasPropertyProto` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_generic.py:145:25-47: `ConcreteHasProperty2` is not assignable to `HasPropertyProto` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_generic.py:146:25-47: `ConcreteHasProperty3` is not assignable to `HasPropertyProto` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_generic.py:147:25-47: `ConcreteHasProperty4` is not assignable to `HasPropertyProto` [bad-assignment] +ERROR protocols_generic.py:40:24-35: `Concrete1` is not assignable to `Proto1[int, str]` [bad-assignment] +ERROR protocols_generic.py:44:7-13: Class `Proto2` specifies type parameters in both `Generic` and `Protocol` bases [invalid-inheritance] +ERROR protocols_generic.py:56:20-29: `Box[float]` is not assignable to `Box[int]` [bad-assignment] +ERROR protocols_generic.py:66:25-35: `Sender[int]` is not assignable to `Sender[float]` [bad-assignment] +ERROR protocols_generic.py:74:28-36: `AttrProto[int]` is not assignable to `AttrProto[float]` [bad-assignment] +ERROR protocols_generic.py:75:26-36: `AttrProto[float]` is not assignable to `AttrProto[int]` [bad-assignment] +ERROR protocols_generic.py:144:25-47: `ConcreteHasProperty1` is not assignable to `HasPropertyProto` [bad-assignment] +ERROR protocols_generic.py:145:25-47: `ConcreteHasProperty2` is not assignable to `HasPropertyProto` [bad-assignment] +ERROR protocols_generic.py:146:25-47: `ConcreteHasProperty3` is not assignable to `HasPropertyProto` [bad-assignment] +ERROR protocols_generic.py:147:25-47: `ConcreteHasProperty4` is not assignable to `HasPropertyProto` [bad-assignment] """ diff --git a/conformance/results/pyrefly/protocols_merging.toml b/conformance/results/pyrefly/protocols_merging.toml index d1adf6778..d24c0828f 100644 --- a/conformance/results/pyrefly/protocols_merging.toml +++ b/conformance/results/pyrefly/protocols_merging.toml @@ -7,9 +7,9 @@ errors_diff = """ Line 82: Expected 1 errors """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_merging.py:52:25-38: `SCConcrete2` is not assignable to `SizedAndClosable1` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_merging.py:53:25-38: `SCConcrete2` is not assignable to `SizedAndClosable2` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_merging.py:54:25-38: `SCConcrete2` is not assignable to `SizedAndClosable3` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_merging.py:67:16-33: If `Protocol` is included as a base class, all other bases must be protocols [invalid-inheritance] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_merging.py:83:24-37: `SCConcrete1` is not assignable to `SizedAndClosable4` [bad-assignment] +ERROR protocols_merging.py:52:25-38: `SCConcrete2` is not assignable to `SizedAndClosable1` [bad-assignment] +ERROR protocols_merging.py:53:25-38: `SCConcrete2` is not assignable to `SizedAndClosable2` [bad-assignment] +ERROR protocols_merging.py:54:25-38: `SCConcrete2` is not assignable to `SizedAndClosable3` [bad-assignment] +ERROR protocols_merging.py:67:16-33: If `Protocol` is included as a base class, all other bases must be protocols [invalid-inheritance] +ERROR protocols_merging.py:83:24-37: `SCConcrete1` is not assignable to `SizedAndClosable4` [bad-assignment] """ diff --git a/conformance/results/pyrefly/protocols_modules.toml b/conformance/results/pyrefly/protocols_modules.toml index 1e9062ddd..88eae7936 100644 --- a/conformance/results/pyrefly/protocols_modules.toml +++ b/conformance/results/pyrefly/protocols_modules.toml @@ -7,8 +7,8 @@ errors_diff = """ Line 25: Unexpected errors ['`Module[_protocols_modules1]` is not assignable to `Options1` [bad-assignment]'] """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_modules.py:25:17-36: `Module[_protocols_modules1]` is not assignable to `Options1` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_modules.py:26:17-36: `Module[_protocols_modules1]` is not assignable to `Options2` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_modules.py:48:18-37: `Module[_protocols_modules2]` is not assignable to `Reporter2` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_modules.py:49:18-37: `Module[_protocols_modules2]` is not assignable to `Reporter3` [bad-assignment] +ERROR protocols_modules.py:25:17-36: `Module[_protocols_modules1]` is not assignable to `Options1` [bad-assignment] +ERROR protocols_modules.py:26:17-36: `Module[_protocols_modules1]` is not assignable to `Options2` [bad-assignment] +ERROR protocols_modules.py:48:18-37: `Module[_protocols_modules2]` is not assignable to `Reporter2` [bad-assignment] +ERROR protocols_modules.py:49:18-37: `Module[_protocols_modules2]` is not assignable to `Reporter3` [bad-assignment] """ diff --git a/conformance/results/pyrefly/protocols_recursive.toml b/conformance/results/pyrefly/protocols_recursive.toml index cdd4d0cd9..be211bd5b 100644 --- a/conformance/results/pyrefly/protocols_recursive.toml +++ b/conformance/results/pyrefly/protocols_recursive.toml @@ -1,3 +1,4 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ diff --git a/conformance/results/pyrefly/protocols_runtime_checkable.toml b/conformance/results/pyrefly/protocols_runtime_checkable.toml index 17190f8a8..2566b2a45 100644 --- a/conformance/results/pyrefly/protocols_runtime_checkable.toml +++ b/conformance/results/pyrefly/protocols_runtime_checkable.toml @@ -9,7 +9,7 @@ Line 92: Expected 1 errors Line 96: Expected 1 errors """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_runtime_checkable.py:23:22-28: Protocol `Proto1` is not decorated with @runtime_checkable and cannot be used with isinstance() [invalid-argument] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_runtime_checkable.py:55:22-34: Protocol `DataProtocol` has non-method members and cannot be used with issubclass() [invalid-argument] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_runtime_checkable.py:61:22-53: Protocol `DataProtocol` has non-method members and cannot be used with issubclass() [invalid-argument] +ERROR protocols_runtime_checkable.py:23:22-28: Protocol `Proto1` is not decorated with @runtime_checkable and cannot be used with isinstance() [invalid-argument] +ERROR protocols_runtime_checkable.py:55:22-34: Protocol `DataProtocol` has non-method members and cannot be used with issubclass() [invalid-argument] +ERROR protocols_runtime_checkable.py:61:22-53: Protocol `DataProtocol` has non-method members and cannot be used with issubclass() [invalid-argument] """ diff --git a/conformance/results/pyrefly/protocols_self.toml b/conformance/results/pyrefly/protocols_self.toml index 75b057753..df568b19f 100644 --- a/conformance/results/pyrefly/protocols_self.toml +++ b/conformance/results/pyrefly/protocols_self.toml @@ -8,6 +8,6 @@ Line 32: Unexpected errors ['`One` is not assignable to variable `c` with type ` Line 33: Unexpected errors ['`Other` is not assignable to variable `c` with type `Copyable` [bad-assignment]'] """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_self.py:32:5-10: `One` is not assignable to variable `c` with type `Copyable` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_self.py:33:5-12: `Other` is not assignable to variable `c` with type `Copyable` [bad-assignment] +ERROR protocols_self.py:32:5-10: `One` is not assignable to variable `c` with type `Copyable` [bad-assignment] +ERROR protocols_self.py:33:5-12: `Other` is not assignable to variable `c` with type `Copyable` [bad-assignment] """ diff --git a/conformance/results/pyrefly/protocols_subtyping.toml b/conformance/results/pyrefly/protocols_subtyping.toml index cc40f3a6c..ab7a89280 100644 --- a/conformance/results/pyrefly/protocols_subtyping.toml +++ b/conformance/results/pyrefly/protocols_subtyping.toml @@ -1,12 +1,13 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_subtyping.py:16:12-14: Cannot instantiate `Proto1` because it is a protocol [bad-instantiation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_subtyping.py:38:21-23: `Proto2` is not assignable to `Concrete2` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_subtyping.py:55:18-20: `Proto2` is not assignable to `Proto3` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_subtyping.py:79:30-36: `Proto5[int]` is not assignable to `Proto4[int, float]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_subtyping.py:80:25-31: `Proto4[int, int]` is not assignable to `Proto5[float]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_subtyping.py:102:30-32: `Proto6[float, float]` is not assignable to `Proto7[int, float]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/protocols_subtyping.py:103:33-35: `Proto6[float, float]` is not assignable to `Proto7[float, object]` [bad-assignment] +ERROR protocols_subtyping.py:16:12-14: Cannot instantiate `Proto1` because it is a protocol [bad-instantiation] +ERROR protocols_subtyping.py:38:21-23: `Proto2` is not assignable to `Concrete2` [bad-assignment] +ERROR protocols_subtyping.py:55:18-20: `Proto2` is not assignable to `Proto3` [bad-assignment] +ERROR protocols_subtyping.py:79:30-36: `Proto5[int]` is not assignable to `Proto4[int, float]` [bad-assignment] +ERROR protocols_subtyping.py:80:25-31: `Proto4[int, int]` is not assignable to `Proto5[float]` [bad-assignment] +ERROR protocols_subtyping.py:102:30-32: `Proto6[float, float]` is not assignable to `Proto7[int, float]` [bad-assignment] +ERROR protocols_subtyping.py:103:33-35: `Proto6[float, float]` is not assignable to `Proto7[float, object]` [bad-assignment] """ diff --git a/conformance/results/pyrefly/qualifiers_annotated.toml b/conformance/results/pyrefly/qualifiers_annotated.toml index 21d1a3571..9915217f2 100644 --- a/conformance/results/pyrefly/qualifiers_annotated.toml +++ b/conformance/results/pyrefly/qualifiers_annotated.toml @@ -12,20 +12,20 @@ Line 92: Expected 1 errors Line 93: Expected 1 errors """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_annotated.py:43:17-27: list literal cannot be used in annotations [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_annotated.py:44:17-30: tuple literal cannot be used in annotations [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_annotated.py:45:17-40: list comprehension cannot be used in annotations [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_annotated.py:46:17-27: dict literal cannot be used in annotations [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_annotated.py:46:19-20: Could not find name `a` [unknown-name] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_annotated.py:46:24-25: Could not find name `b` [unknown-name] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_annotated.py:47:17-32: function call cannot be used in annotations [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_annotated.py:48:17-25: invalid subscript expression cannot be used in annotations [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_annotated.py:49:17-38: if expression cannot be used in annotations [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_annotated.py:50:17-21: Could not find name `var1` [unknown-name] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_annotated.py:51:17-21: bool literal cannot be used in annotations [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_annotated.py:52:18-19: number literal cannot be used in annotations [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_annotated.py:53:18-29: boolean operation cannot be used in annotations [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_annotated.py:54:18-28: f-string cannot be used in annotations [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_annotated.py:64:8-22: `Annotated` needs at least one piece of metadata in addition to the type [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_annotated.py:91:1-10: Expected a callable, got type[Annotated] [not-callable] +ERROR qualifiers_annotated.py:43:17-27: list literal cannot be used in annotations [invalid-annotation] +ERROR qualifiers_annotated.py:44:17-30: tuple literal cannot be used in annotations [invalid-annotation] +ERROR qualifiers_annotated.py:45:17-40: list comprehension cannot be used in annotations [invalid-annotation] +ERROR qualifiers_annotated.py:46:17-27: dict literal cannot be used in annotations [invalid-annotation] +ERROR qualifiers_annotated.py:46:19-20: Could not find name `a` [unknown-name] +ERROR qualifiers_annotated.py:46:24-25: Could not find name `b` [unknown-name] +ERROR qualifiers_annotated.py:47:17-32: function call cannot be used in annotations [invalid-annotation] +ERROR qualifiers_annotated.py:48:17-25: invalid subscript expression cannot be used in annotations [invalid-annotation] +ERROR qualifiers_annotated.py:49:17-38: if expression cannot be used in annotations [invalid-annotation] +ERROR qualifiers_annotated.py:50:17-21: Could not find name `var1` [unknown-name] +ERROR qualifiers_annotated.py:51:17-21: bool literal cannot be used in annotations [invalid-annotation] +ERROR qualifiers_annotated.py:52:18-19: number literal cannot be used in annotations [invalid-annotation] +ERROR qualifiers_annotated.py:53:18-29: boolean operation cannot be used in annotations [invalid-annotation] +ERROR qualifiers_annotated.py:54:18-28: f-string cannot be used in annotations [invalid-annotation] +ERROR qualifiers_annotated.py:64:8-22: `Annotated` needs at least one piece of metadata in addition to the type [invalid-annotation] +ERROR qualifiers_annotated.py:91:1-10: Expected a callable, got type[Annotated] [not-callable] """ diff --git a/conformance/results/pyrefly/qualifiers_final_annotation.toml b/conformance/results/pyrefly/qualifiers_final_annotation.toml index 977f4458b..0054bf89f 100644 --- a/conformance/results/pyrefly/qualifiers_final_annotation.toml +++ b/conformance/results/pyrefly/qualifiers_final_annotation.toml @@ -18,26 +18,26 @@ Line 131: Unexpected errors ['Expected first item to be a string literal [invali Line 133: Unexpected errors ['Unexpected keyword argument `x` in function `N.__new__` [unexpected-keyword]', 'Unexpected keyword argument `y` in function `N.__new__` [unexpected-keyword]'] """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_final_annotation.py:16:7-12: Expected a type argument for `Final` [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_final_annotation.py:18:7-22: Expected 1 type argument for `Final`, got 2 [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_final_annotation.py:54:9-17: Cannot set field `ID5` [read-only] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_final_annotation.py:65:9-17: Cannot set field `ID7` [read-only] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_final_annotation.py:67:9-17: Cannot set field `ID7` [read-only] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_final_annotation.py:71:8-11: `RATE` is marked final [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_final_annotation.py:81:1-18: Cannot set field `DEFAULT_ID` [read-only] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_final_annotation.py:94:5-17: `BORDER_WIDTH` is declared as final in parent class `ClassC` [bad-override] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_final_annotation.py:108:19-27: `ClassVar` may not be nested inside `Final` [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_final_annotation.py:118:9-19: `Final` is not allowed in this context [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_final_annotation.py:121:14-19: `Final` is only allowed on a class or local variable annotation [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_final_annotation.py:121:14-30: `Final` is not allowed in this context [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_final_annotation.py:131:23-24: Expected first item to be a string literal [invalid-argument] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_final_annotation.py:131:33-34: Expected first item to be a string literal [invalid-argument] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_final_annotation.py:133:3-4: Unexpected keyword argument `x` in function `N.__new__` [unexpected-keyword] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_final_annotation.py:133:8-9: Unexpected keyword argument `y` in function `N.__new__` [unexpected-keyword] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_final_annotation.py:134:3-4: Unexpected keyword argument `a` in function `N.__new__` [unexpected-keyword] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_final_annotation.py:135:3-4: Unexpected keyword argument `x` in function `N.__new__` [unexpected-keyword] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_final_annotation.py:135:9-10: Unexpected keyword argument `y` in function `N.__new__` [unexpected-keyword] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_final_annotation.py:141:11-12: `ID1` is marked final [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_final_annotation.py:145:5-11: Cannot assign to var x because it is marked final [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_final_annotation.py:147:15-16: Assignment target is marked final [bad-assignment] +ERROR qualifiers_final_annotation.py:16:7-12: Expected a type argument for `Final` [invalid-annotation] +ERROR qualifiers_final_annotation.py:18:7-22: Expected 1 type argument for `Final`, got 2 [invalid-annotation] +ERROR qualifiers_final_annotation.py:54:9-17: Cannot set field `ID5` [read-only] +ERROR qualifiers_final_annotation.py:65:9-17: Cannot set field `ID7` [read-only] +ERROR qualifiers_final_annotation.py:67:9-17: Cannot set field `ID7` [read-only] +ERROR qualifiers_final_annotation.py:71:8-11: `RATE` is marked final [bad-assignment] +ERROR qualifiers_final_annotation.py:81:1-18: Cannot set field `DEFAULT_ID` [read-only] +ERROR qualifiers_final_annotation.py:94:5-17: `BORDER_WIDTH` is declared as final in parent class `ClassC` [bad-override] +ERROR qualifiers_final_annotation.py:108:19-27: `ClassVar` may not be nested inside `Final` [invalid-annotation] +ERROR qualifiers_final_annotation.py:118:9-19: `Final` is not allowed in this context [invalid-annotation] +ERROR qualifiers_final_annotation.py:121:14-19: `Final` is only allowed on a class or local variable annotation [invalid-annotation] +ERROR qualifiers_final_annotation.py:121:14-30: `Final` is not allowed in this context [invalid-annotation] +ERROR qualifiers_final_annotation.py:131:23-24: Expected first item to be a string literal [invalid-argument] +ERROR qualifiers_final_annotation.py:131:33-34: Expected first item to be a string literal [invalid-argument] +ERROR qualifiers_final_annotation.py:133:3-4: Unexpected keyword argument `x` in function `N.__new__` [unexpected-keyword] +ERROR qualifiers_final_annotation.py:133:8-9: Unexpected keyword argument `y` in function `N.__new__` [unexpected-keyword] +ERROR qualifiers_final_annotation.py:134:3-4: Unexpected keyword argument `a` in function `N.__new__` [unexpected-keyword] +ERROR qualifiers_final_annotation.py:135:3-4: Unexpected keyword argument `x` in function `N.__new__` [unexpected-keyword] +ERROR qualifiers_final_annotation.py:135:9-10: Unexpected keyword argument `y` in function `N.__new__` [unexpected-keyword] +ERROR qualifiers_final_annotation.py:141:11-12: `ID1` is marked final [bad-assignment] +ERROR qualifiers_final_annotation.py:145:5-11: Cannot assign to var x because it is marked final [bad-assignment] +ERROR qualifiers_final_annotation.py:147:15-16: Assignment target is marked final [bad-assignment] """ diff --git a/conformance/results/pyrefly/qualifiers_final_decorator.toml b/conformance/results/pyrefly/qualifiers_final_decorator.toml index 58b20a00b..e4d7d3abb 100644 --- a/conformance/results/pyrefly/qualifiers_final_decorator.toml +++ b/conformance/results/pyrefly/qualifiers_final_decorator.toml @@ -7,13 +7,13 @@ errors_diff = """ Lines 84, 85, 86: Expected error (tag 'Derived3-2') """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_final_decorator.py:21:16-21: Cannot extend final class `Base1` [invalid-inheritance] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_final_decorator.py:56:9-16: `method1` is declared as final in parent class `Base2` [bad-override] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_final_decorator.py:60:9-16: `method2` is declared as final in parent class `Base2` [bad-override] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_final_decorator.py:64:9-16: `method3` is declared as final in parent class `Base2` [bad-override] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_final_decorator.py:68:9-16: `method4` is declared as final in parent class `Base2` [bad-override] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_final_decorator.py:81:9-15: `method` is declared as final in parent class `Base3` [bad-override] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_final_decorator.py:95:9-15: `method` is declared as final in parent class `Base4` [bad-override] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_final_decorator.py:118:9-15: `method` is declared as final in parent class `Base5_2` [bad-override] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/qualifiers_final_decorator.py:125:1-7: Decorator `@final` can only be used on methods. [invalid-decorator] +ERROR qualifiers_final_decorator.py:21:16-21: Cannot extend final class `Base1` [invalid-inheritance] +ERROR qualifiers_final_decorator.py:56:9-16: `method1` is declared as final in parent class `Base2` [bad-override] +ERROR qualifiers_final_decorator.py:60:9-16: `method2` is declared as final in parent class `Base2` [bad-override] +ERROR qualifiers_final_decorator.py:64:9-16: `method3` is declared as final in parent class `Base2` [bad-override] +ERROR qualifiers_final_decorator.py:68:9-16: `method4` is declared as final in parent class `Base2` [bad-override] +ERROR qualifiers_final_decorator.py:81:9-15: `method` is declared as final in parent class `Base3` [bad-override] +ERROR qualifiers_final_decorator.py:95:9-15: `method` is declared as final in parent class `Base4` [bad-override] +ERROR qualifiers_final_decorator.py:118:9-15: `method` is declared as final in parent class `Base5_2` [bad-override] +ERROR qualifiers_final_decorator.py:125:1-7: Decorator `@final` can only be used on methods. [invalid-decorator] """ diff --git a/conformance/results/pyrefly/specialtypes_any.toml b/conformance/results/pyrefly/specialtypes_any.toml index cdd4d0cd9..be211bd5b 100644 --- a/conformance/results/pyrefly/specialtypes_any.toml +++ b/conformance/results/pyrefly/specialtypes_any.toml @@ -1,3 +1,4 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ diff --git a/conformance/results/pyrefly/specialtypes_never.toml b/conformance/results/pyrefly/specialtypes_never.toml index c650ba959..ea293f7e1 100644 --- a/conformance/results/pyrefly/specialtypes_never.toml +++ b/conformance/results/pyrefly/specialtypes_never.toml @@ -7,8 +7,8 @@ errors_diff = """ Line 32: Unexpected errors ["Returned type `Literal['whatever works']` is not assignable to declared return type `int` [bad-return]"] """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/specialtypes_never.py:19:22-30: Function declared to return `NoReturn` but is missing an explicit `return` [bad-return] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/specialtypes_never.py:32:12-28: Returned type `Literal['whatever works']` is not assignable to declared return type `int` [bad-return] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/specialtypes_never.py:86:21-22: `list[Never]` is not assignable to `list[int]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/specialtypes_never.py:105:12-27: Returned type `ClassC[Never]` is not assignable to declared return type `ClassC[U]` [bad-return] +ERROR specialtypes_never.py:19:22-30: Function declared to return `NoReturn` but is missing an explicit `return` [bad-return] +ERROR specialtypes_never.py:32:12-28: Returned type `Literal['whatever works']` is not assignable to declared return type `int` [bad-return] +ERROR specialtypes_never.py:86:21-22: `list[Never]` is not assignable to `list[int]` [bad-assignment] +ERROR specialtypes_never.py:105:12-27: Returned type `ClassC[Never]` is not assignable to declared return type `ClassC[U]` [bad-return] """ diff --git a/conformance/results/pyrefly/specialtypes_none.toml b/conformance/results/pyrefly/specialtypes_none.toml index 269facdf1..fcd2fb564 100644 --- a/conformance/results/pyrefly/specialtypes_none.toml +++ b/conformance/results/pyrefly/specialtypes_none.toml @@ -1,8 +1,9 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/specialtypes_none.py:21:7-17: Argument `type` is not assignable to parameter `val1` with type `None` in function `func1` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/specialtypes_none.py:27:19-23: `None` is not assignable to `Iterable[Unknown]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/specialtypes_none.py:41:7-11: Argument `None` is not assignable to parameter `val1` with type `type[None]` in function `func2` [bad-argument-type] +ERROR specialtypes_none.py:21:7-17: Argument `type` is not assignable to parameter `val1` with type `None` in function `func1` [bad-argument-type] +ERROR specialtypes_none.py:27:19-23: `None` is not assignable to `Iterable[Unknown]` [bad-assignment] +ERROR specialtypes_none.py:41:7-11: Argument `None` is not assignable to parameter `val1` with type `type[None]` in function `func2` [bad-argument-type] """ diff --git a/conformance/results/pyrefly/specialtypes_promotions.toml b/conformance/results/pyrefly/specialtypes_promotions.toml index 9106611aa..6b038e892 100644 --- a/conformance/results/pyrefly/specialtypes_promotions.toml +++ b/conformance/results/pyrefly/specialtypes_promotions.toml @@ -1,6 +1,7 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/specialtypes_promotions.py:13:5-16: Object of class `float` has no attribute `numerator` [missing-attribute] +ERROR specialtypes_promotions.py:13:5-16: Object of class `float` has no attribute `numerator` [missing-attribute] """ diff --git a/conformance/results/pyrefly/specialtypes_type.toml b/conformance/results/pyrefly/specialtypes_type.toml index bfa048c1b..0a811b35d 100644 --- a/conformance/results/pyrefly/specialtypes_type.toml +++ b/conformance/results/pyrefly/specialtypes_type.toml @@ -14,19 +14,19 @@ Line 110: Unexpected errors ['assert_type(Any, tuple[type, ...]) failed [assert- Line 139: Unexpected errors ['assert_type(type, type[Any]) failed [assert-type]'] """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/specialtypes_type.py:56:7-15: Argument `type[TeamUser]` is not assignable to parameter `user_class` with type `type[BasicUser | ProUser]` in function `func4` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/specialtypes_type.py:76:12-26: Expected 1 type argument for `type`, got 2 [bad-specialization] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/specialtypes_type.py:84:16-30: assert_type(type, type[Any]) failed [assert-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/specialtypes_type.py:99:17-26: Object of class `type` has no attribute `unknown` [missing-attribute] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/specialtypes_type.py:100:17-26: Object of class `type` has no attribute `unknown` [missing-attribute] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/specialtypes_type.py:102:16-45: assert_type(Any, tuple[type, ...]) failed [assert-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/specialtypes_type.py:106:16-45: assert_type(Any, tuple[type, ...]) failed [assert-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/specialtypes_type.py:110:16-45: assert_type(Any, tuple[type, ...]) failed [assert-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/specialtypes_type.py:117:5-14: Class `object` has no class attribute `unknown` [missing-attribute] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/specialtypes_type.py:120:5-14: Class `object` has no class attribute `unknown` [missing-attribute] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/specialtypes_type.py:139:16-30: assert_type(type, type[Any]) failed [assert-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/specialtypes_type.py:143:1-12: TODO: Expr::attr_infer_for_type attribute base undefined for type: TypeAlias[TA1, type[type[Unknown]]] (trying to access unknown) [missing-attribute] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/specialtypes_type.py:144:1-12: TODO: Expr::attr_infer_for_type attribute base undefined for type: TypeAlias[TA2, type[type[Any]]] (trying to access unknown) [missing-attribute] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/specialtypes_type.py:145:1-12: Class `type` has no class attribute `unknown` [missing-attribute] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/specialtypes_type.py:146:1-12: TODO: Expr::attr_infer_for_type attribute base undefined for type: TypeAlias[TA4, type[type[Any]]] (trying to access unknown) [missing-attribute] +ERROR specialtypes_type.py:56:7-15: Argument `type[TeamUser]` is not assignable to parameter `user_class` with type `type[BasicUser | ProUser]` in function `func4` [bad-argument-type] +ERROR specialtypes_type.py:76:12-26: Expected 1 type argument for `type`, got 2 [bad-specialization] +ERROR specialtypes_type.py:84:16-30: assert_type(type, type[Any]) failed [assert-type] +ERROR specialtypes_type.py:99:17-26: Object of class `type` has no attribute `unknown` [missing-attribute] +ERROR specialtypes_type.py:100:17-26: Object of class `type` has no attribute `unknown` [missing-attribute] +ERROR specialtypes_type.py:102:16-45: assert_type(Any, tuple[type, ...]) failed [assert-type] +ERROR specialtypes_type.py:106:16-45: assert_type(Any, tuple[type, ...]) failed [assert-type] +ERROR specialtypes_type.py:110:16-45: assert_type(Any, tuple[type, ...]) failed [assert-type] +ERROR specialtypes_type.py:117:5-14: Class `object` has no class attribute `unknown` [missing-attribute] +ERROR specialtypes_type.py:120:5-14: Class `object` has no class attribute `unknown` [missing-attribute] +ERROR specialtypes_type.py:139:16-30: assert_type(type, type[Any]) failed [assert-type] +ERROR specialtypes_type.py:143:1-12: TODO: Expr::attr_infer_for_type attribute base undefined for type: TypeAlias[TA1, type[type[Unknown]]] (trying to access unknown) [missing-attribute] +ERROR specialtypes_type.py:144:1-12: TODO: Expr::attr_infer_for_type attribute base undefined for type: TypeAlias[TA2, type[type[Any]]] (trying to access unknown) [missing-attribute] +ERROR specialtypes_type.py:145:1-12: Class `type` has no class attribute `unknown` [missing-attribute] +ERROR specialtypes_type.py:146:1-12: TODO: Expr::attr_infer_for_type attribute base undefined for type: TypeAlias[TA4, type[type[Any]]] (trying to access unknown) [missing-attribute] """ diff --git a/conformance/results/pyrefly/tuples_type_compat.toml b/conformance/results/pyrefly/tuples_type_compat.toml index 66afbaa76..c85896b78 100644 --- a/conformance/results/pyrefly/tuples_type_compat.toml +++ b/conformance/results/pyrefly/tuples_type_compat.toml @@ -1,29 +1,30 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/tuples_type_compat.py:15:27-29: `tuple[float, complex]` is not assignable to `tuple[int, int]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/tuples_type_compat.py:29:10-12: `tuple[int, ...]` is not assignable to variable `v2` with type `tuple[int, *tuple[int, ...]]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/tuples_type_compat.py:32:10-12: `tuple[int, *tuple[int, ...]]` is not assignable to variable `v3` with type `tuple[int]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/tuples_type_compat.py:33:10-12: `tuple[int, ...]` is not assignable to variable `v3` with type `tuple[int]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/tuples_type_compat.py:43:22-24: `tuple[int, ...]` is not assignable to `tuple[int]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/tuples_type_compat.py:62:26-35: `tuple[int, ...]` is not assignable to `tuple[int, int]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/tuples_type_compat.py:76:20-37: assert_type(tuple[int], tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]) failed [assert-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/tuples_type_compat.py:81:20-37: assert_type(tuple[int, int] | tuple[str, str], tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]) failed [assert-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/tuples_type_compat.py:86:20-37: assert_type(tuple[int, str, int], tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]) failed [assert-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/tuples_type_compat.py:102:24-41: assert_type(tuple[int], tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]) failed [assert-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/tuples_type_compat.py:107:24-41: assert_type(tuple[int, int] | tuple[str, str], tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]) failed [assert-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/tuples_type_compat.py:112:24-41: assert_type(tuple[int, str, int], tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]) failed [assert-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/tuples_type_compat.py:126:24-53: assert_type(tuple[int | str, int | str], tuple[int | str, str]) failed [assert-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/tuples_type_compat.py:129:24-53: assert_type(tuple[int | str, int | str], tuple[int | str, int]) failed [assert-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/tuples_type_compat.py:157:6-17: `tuple[Literal[1], Literal[''], Literal['']]` is not assignable to variable `t1` with type `tuple[int, str]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/tuples_type_compat.py:162:6-16: `tuple[Literal[1], Literal[1], Literal['']]` is not assignable to variable `t2` with type `tuple[int, *tuple[str, ...]]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/tuples_type_compat.py:163:6-16: `tuple[Literal[1], Literal[''], Literal[1]]` is not assignable to variable `t2` with type `tuple[int, *tuple[str, ...]]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/tuples_type_compat.py:169:6-17: `tuple[Literal[1], Literal[''], Literal['']]` is not assignable to variable `t3` with type `tuple[int, *tuple[str, ...], int]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/tuples_type_compat.py:170:6-22: `tuple[Literal[1], Literal[''], Literal[''], float]` is not assignable to variable `t3` with type `tuple[int, *tuple[str, ...], int]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/tuples_type_compat.py:175:6-16: `tuple[Literal[1], Literal[''], Literal[1]]` is not assignable to variable `t4` with type `tuple[*tuple[str, ...], int]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/tuples_type_compat.py:176:6-19: `tuple[Literal[''], Literal[''], float]` is not assignable to variable `t4` with type `tuple[*tuple[str, ...], int]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/tuples_type_compat.py:181:40-41: `tuple[str, str]` is not assignable to `tuple[str, str, int]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/tuples_type_compat.py:184:50-51: `tuple[str, str]` is not assignable to `tuple[str, str, str, *tuple[str, ...]]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/tuples_type_compat.py:188:50-51: `tuple[str, str]` is not assignable to `tuple[*tuple[str, ...], str, str, str]` [bad-assignment] +ERROR tuples_type_compat.py:15:27-29: `tuple[float, complex]` is not assignable to `tuple[int, int]` [bad-assignment] +ERROR tuples_type_compat.py:29:10-12: `tuple[int, ...]` is not assignable to variable `v2` with type `tuple[int, *tuple[int, ...]]` [bad-assignment] +ERROR tuples_type_compat.py:32:10-12: `tuple[int, *tuple[int, ...]]` is not assignable to variable `v3` with type `tuple[int]` [bad-assignment] +ERROR tuples_type_compat.py:33:10-12: `tuple[int, ...]` is not assignable to variable `v3` with type `tuple[int]` [bad-assignment] +ERROR tuples_type_compat.py:43:22-24: `tuple[int, ...]` is not assignable to `tuple[int]` [bad-assignment] +ERROR tuples_type_compat.py:62:26-35: `tuple[int, ...]` is not assignable to `tuple[int, int]` [bad-assignment] +ERROR tuples_type_compat.py:76:20-37: assert_type(tuple[int], tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]) failed [assert-type] +ERROR tuples_type_compat.py:81:20-37: assert_type(tuple[int, int] | tuple[str, str], tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]) failed [assert-type] +ERROR tuples_type_compat.py:86:20-37: assert_type(tuple[int, str, int], tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]) failed [assert-type] +ERROR tuples_type_compat.py:102:24-41: assert_type(tuple[int], tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]) failed [assert-type] +ERROR tuples_type_compat.py:107:24-41: assert_type(tuple[int, int] | tuple[str, str], tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]) failed [assert-type] +ERROR tuples_type_compat.py:112:24-41: assert_type(tuple[int, str, int], tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]) failed [assert-type] +ERROR tuples_type_compat.py:126:24-53: assert_type(tuple[int | str, int | str], tuple[int | str, str]) failed [assert-type] +ERROR tuples_type_compat.py:129:24-53: assert_type(tuple[int | str, int | str], tuple[int | str, int]) failed [assert-type] +ERROR tuples_type_compat.py:157:6-17: `tuple[Literal[1], Literal[''], Literal['']]` is not assignable to variable `t1` with type `tuple[int, str]` [bad-assignment] +ERROR tuples_type_compat.py:162:6-16: `tuple[Literal[1], Literal[1], Literal['']]` is not assignable to variable `t2` with type `tuple[int, *tuple[str, ...]]` [bad-assignment] +ERROR tuples_type_compat.py:163:6-16: `tuple[Literal[1], Literal[''], Literal[1]]` is not assignable to variable `t2` with type `tuple[int, *tuple[str, ...]]` [bad-assignment] +ERROR tuples_type_compat.py:169:6-17: `tuple[Literal[1], Literal[''], Literal['']]` is not assignable to variable `t3` with type `tuple[int, *tuple[str, ...], int]` [bad-assignment] +ERROR tuples_type_compat.py:170:6-22: `tuple[Literal[1], Literal[''], Literal[''], float]` is not assignable to variable `t3` with type `tuple[int, *tuple[str, ...], int]` [bad-assignment] +ERROR tuples_type_compat.py:175:6-16: `tuple[Literal[1], Literal[''], Literal[1]]` is not assignable to variable `t4` with type `tuple[*tuple[str, ...], int]` [bad-assignment] +ERROR tuples_type_compat.py:176:6-19: `tuple[Literal[''], Literal[''], float]` is not assignable to variable `t4` with type `tuple[*tuple[str, ...], int]` [bad-assignment] +ERROR tuples_type_compat.py:181:40-41: `tuple[str, str]` is not assignable to `tuple[str, str, int]` [bad-assignment] +ERROR tuples_type_compat.py:184:50-51: `tuple[str, str]` is not assignable to `tuple[str, str, str, *tuple[str, ...]]` [bad-assignment] +ERROR tuples_type_compat.py:188:50-51: `tuple[str, str]` is not assignable to `tuple[*tuple[str, ...], str, str, str]` [bad-assignment] """ diff --git a/conformance/results/pyrefly/tuples_type_form.toml b/conformance/results/pyrefly/tuples_type_form.toml index b61a3f3fd..7a9c92c85 100644 --- a/conformance/results/pyrefly/tuples_type_form.toml +++ b/conformance/results/pyrefly/tuples_type_form.toml @@ -1,16 +1,17 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/tuples_type_form.py:12:6-12: `tuple[Literal[1], Literal[2]]` is not assignable to variable `t1` with type `tuple[int]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/tuples_type_form.py:14:6-10: `tuple[Literal[1]]` is not assignable to variable `t2` with type `tuple[int, int]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/tuples_type_form.py:15:6-13: `tuple[Literal[1], Literal['']]` is not assignable to variable `t2` with type `tuple[int, int]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/tuples_type_form.py:25:7-11: `tuple[Literal[1]]` is not assignable to variable `t10` with type `tuple[()]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/tuples_type_form.py:36:7-20: `tuple[Literal[1], Literal[2], Literal[3], Literal['']]` is not assignable to variable `t20` with type `tuple[int, ...]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/tuples_type_form.py:40:22-25: Invalid position for `...` [invalid-argument] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/tuples_type_form.py:41:12-15: Invalid position for `...` [invalid-argument] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/tuples_type_form.py:42:12-15: Invalid position for `...` [invalid-argument] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/tuples_type_form.py:43:17-20: Invalid position for `...` [invalid-argument] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/tuples_type_form.py:44:25-28: `...` cannot be used with an unpacked `TypeVarTuple` or tuple [invalid-argument] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/tuples_type_form.py:45:30-33: Invalid position for `...` [invalid-argument] +ERROR tuples_type_form.py:12:6-12: `tuple[Literal[1], Literal[2]]` is not assignable to variable `t1` with type `tuple[int]` [bad-assignment] +ERROR tuples_type_form.py:14:6-10: `tuple[Literal[1]]` is not assignable to variable `t2` with type `tuple[int, int]` [bad-assignment] +ERROR tuples_type_form.py:15:6-13: `tuple[Literal[1], Literal['']]` is not assignable to variable `t2` with type `tuple[int, int]` [bad-assignment] +ERROR tuples_type_form.py:25:7-11: `tuple[Literal[1]]` is not assignable to variable `t10` with type `tuple[()]` [bad-assignment] +ERROR tuples_type_form.py:36:7-20: `tuple[Literal[1], Literal[2], Literal[3], Literal['']]` is not assignable to variable `t20` with type `tuple[int, ...]` [bad-assignment] +ERROR tuples_type_form.py:40:22-25: Invalid position for `...` [invalid-argument] +ERROR tuples_type_form.py:41:12-15: Invalid position for `...` [invalid-argument] +ERROR tuples_type_form.py:42:12-15: Invalid position for `...` [invalid-argument] +ERROR tuples_type_form.py:43:17-20: Invalid position for `...` [invalid-argument] +ERROR tuples_type_form.py:44:25-28: `...` cannot be used with an unpacked `TypeVarTuple` or tuple [invalid-argument] +ERROR tuples_type_form.py:45:30-33: Invalid position for `...` [invalid-argument] """ diff --git a/conformance/results/pyrefly/tuples_unpacked.toml b/conformance/results/pyrefly/tuples_unpacked.toml index 9aed44584..8792b4535 100644 --- a/conformance/results/pyrefly/tuples_unpacked.toml +++ b/conformance/results/pyrefly/tuples_unpacked.toml @@ -1,10 +1,11 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/tuples_unpacked.py:40:29-45: Only one unbounded type is allowed to be unpacked [bad-unpacking] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/tuples_unpacked.py:41:42-58: Only one unbounded type is allowed to be unpacked [bad-unpacking] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/tuples_unpacked.py:51:33-36: Only one unbounded type is allowed to be unpacked [bad-unpacking] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/tuples_unpacked.py:59:37-60: Only one unbounded type is allowed to be unpacked [bad-unpacking] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/tuples_unpacked.py:61:50-73: Only one unbounded type is allowed to be unpacked [bad-unpacking] +ERROR tuples_unpacked.py:40:29-45: Only one unbounded type is allowed to be unpacked [bad-unpacking] +ERROR tuples_unpacked.py:41:42-58: Only one unbounded type is allowed to be unpacked [bad-unpacking] +ERROR tuples_unpacked.py:51:33-36: Only one unbounded type is allowed to be unpacked [bad-unpacking] +ERROR tuples_unpacked.py:59:37-60: Only one unbounded type is allowed to be unpacked [bad-unpacking] +ERROR tuples_unpacked.py:61:50-73: Only one unbounded type is allowed to be unpacked [bad-unpacking] """ diff --git a/conformance/results/pyrefly/typeddicts_alt_syntax.toml b/conformance/results/pyrefly/typeddicts_alt_syntax.toml index f2007d8e4..82ee6fb6f 100644 --- a/conformance/results/pyrefly/typeddicts_alt_syntax.toml +++ b/conformance/results/pyrefly/typeddicts_alt_syntax.toml @@ -1,16 +1,17 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_alt_syntax.py:23:1-14: Expected valid functional typed dictionary definition [invalid-argument] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_alt_syntax.py:27:45-46: Expected first item to be a string literal [invalid-argument] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_alt_syntax.py:31:27-38: Expected string literal "BadTypedDict3" [invalid-argument] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_alt_syntax.py:35:72-83: Unrecognized argument `other` for typed dictionary definition [invalid-argument] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_alt_syntax.py:41:1-7: Expected valid functional typed dictionary definition [invalid-argument] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_alt_syntax.py:41:30-38: Unrecognized argument `name` for typed dictionary definition [invalid-argument] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_alt_syntax.py:41:40-48: Unrecognized argument `year` for typed dictionary definition [invalid-argument] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_alt_syntax.py:44:11-17: Key `name` is not defined in TypedDict `Movie2` [typed-dict-key-error] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_alt_syntax.py:44:35-41: Key `year` is not defined in TypedDict `Movie2` [typed-dict-key-error] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_alt_syntax.py:45:11-17: Key `name` is not defined in TypedDict `Movie2` [typed-dict-key-error] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_alt_syntax.py:45:35-41: Key `year` is not defined in TypedDict `Movie2` [typed-dict-key-error] +ERROR typeddicts_alt_syntax.py:23:1-14: Expected valid functional typed dictionary definition [invalid-argument] +ERROR typeddicts_alt_syntax.py:27:45-46: Expected first item to be a string literal [invalid-argument] +ERROR typeddicts_alt_syntax.py:31:27-38: Expected string literal "BadTypedDict3" [invalid-argument] +ERROR typeddicts_alt_syntax.py:35:72-83: Unrecognized argument `other` for typed dictionary definition [invalid-argument] +ERROR typeddicts_alt_syntax.py:41:1-7: Expected valid functional typed dictionary definition [invalid-argument] +ERROR typeddicts_alt_syntax.py:41:30-38: Unrecognized argument `name` for typed dictionary definition [invalid-argument] +ERROR typeddicts_alt_syntax.py:41:40-48: Unrecognized argument `year` for typed dictionary definition [invalid-argument] +ERROR typeddicts_alt_syntax.py:44:11-17: Key `name` is not defined in TypedDict `Movie2` [typed-dict-key-error] +ERROR typeddicts_alt_syntax.py:44:35-41: Key `year` is not defined in TypedDict `Movie2` [typed-dict-key-error] +ERROR typeddicts_alt_syntax.py:45:11-17: Key `name` is not defined in TypedDict `Movie2` [typed-dict-key-error] +ERROR typeddicts_alt_syntax.py:45:35-41: Key `year` is not defined in TypedDict `Movie2` [typed-dict-key-error] """ diff --git a/conformance/results/pyrefly/typeddicts_class_syntax.toml b/conformance/results/pyrefly/typeddicts_class_syntax.toml index 27ade3f1b..c620b1026 100644 --- a/conformance/results/pyrefly/typeddicts_class_syntax.toml +++ b/conformance/results/pyrefly/typeddicts_class_syntax.toml @@ -1,10 +1,11 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_class_syntax.py:29:9-16: TypedDict item `method1` may not be initialized [bad-class-definition] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_class_syntax.py:34:9-16: TypedDict item `method2` may not be initialized [bad-class-definition] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_class_syntax.py:39:9-16: TypedDict item `method3` may not be initialized [bad-class-definition] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_class_syntax.py:44:7-20: Typed dictionary definitions may not specify a metaclass [invalid-inheritance] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_class_syntax.py:49:7-20: TypedDict does not support keyword argument `other` [bad-typed-dict] +ERROR typeddicts_class_syntax.py:29:9-16: TypedDict item `method1` may not be initialized [bad-class-definition] +ERROR typeddicts_class_syntax.py:34:9-16: TypedDict item `method2` may not be initialized [bad-class-definition] +ERROR typeddicts_class_syntax.py:39:9-16: TypedDict item `method3` may not be initialized [bad-class-definition] +ERROR typeddicts_class_syntax.py:44:7-20: Typed dictionary definitions may not specify a metaclass [invalid-inheritance] +ERROR typeddicts_class_syntax.py:49:7-20: TypedDict does not support keyword argument `other` [bad-typed-dict] """ diff --git a/conformance/results/pyrefly/typeddicts_extra_items.toml b/conformance/results/pyrefly/typeddicts_extra_items.toml index f4aa5ce87..341dd6c96 100644 --- a/conformance/results/pyrefly/typeddicts_extra_items.toml +++ b/conformance/results/pyrefly/typeddicts_extra_items.toml @@ -15,42 +15,42 @@ Line 339: Unexpected errors ['assert_type(Any, tuple[str, int]) failed [assert-t Line 343: Unexpected errors ['Cannot delete item in `TypedDict[IntDictWithNum]` [unsupported-operation]'] """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_extra_items.py:15:45-49: `Literal[1982]` is not assignable to TypedDict `extra_items` type `bool` [typed-dict-key-error] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_extra_items.py:22:55-59: `Literal[1982]` is not assignable to TypedDict `extra_items` type `bool` [typed-dict-key-error] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_extra_items.py:39:54-58: `None` is not assignable to TypedDict key `year` with type `int` [typed-dict-key-error] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_extra_items.py:49:7-16: Expected literal True or False for keyword `closed`, got instance of `bool` [bad-typed-dict] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_extra_items.py:67:7-20: Non-closed TypedDict cannot inherit from closed TypedDict `ClosedBase` [bad-typed-dict] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_extra_items.py:73:7-20: Non-closed TypedDict cannot inherit from TypedDict `ExtraItemsBase` with extra items [bad-typed-dict] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_extra_items.py:92:5-8: Cannot extend closed TypedDict `MovieA` with extra item `age` [typed-dict-key-error] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_extra_items.py:95:5-8: Cannot extend closed TypedDict `MovieB` with extra item `age` [typed-dict-key-error] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_extra_items.py:109:7-30: Closed TypedDict cannot inherit from TypedDict `ExtraItemsBase` with non-read-only extra items [bad-typed-dict] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_extra_items.py:114:50-63: `Required` is not allowed in this context [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_extra_items.py:117:57-73: `NotRequired` is not allowed in this context [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_extra_items.py:128:15-21: Key `name` in TypedDict `MovieEI` may not be deleted [delete-error] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_extra_items.py:129:15-21: TypedDict `MovieEI` does not have key `year` [typed-dict-key-error] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_extra_items.py:143:48-52: Unexpected keyword argument `year` in function `unpack_no_extra` [unexpected-keyword] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_extra_items.py:144:45-49: Unexpected keyword argument `year` in function `unpack_extra` [unexpected-keyword] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_extra_items.py:174:7-12: Cannot change the non-read-only extra items type of TypedDict `Parent` [bad-typed-dict] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_extra_items.py:185:5-9: TypedDict `MovieBase2` with non-read-only `extra_items` cannot be extended with required extra item `year` [typed-dict-key-error] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_extra_items.py:188:5-9: `int` is not consistent with `extra_items` type `int | None` of TypedDict `MovieBase2` [typed-dict-key-error] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_extra_items.py:197:5-14: `str` is not assignable to `extra_items` type `int | None` of TypedDict `BookBase` [typed-dict-key-error] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_extra_items.py:215:22-30: `TypedDict[MovieDetails]` is not assignable to `TypedDict[MovieBase2]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_extra_items.py:222:22-30: `TypedDict[MovieWithYear2]` is not assignable to `TypedDict[MovieBase2]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_extra_items.py:242:19-27: `TypedDict[MovieDetails5]` is not assignable to `TypedDict[MovieSI]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_extra_items.py:256:13-22: `TypedDict[MovieExtraStr]` is not assignable to variable `extra_int` with type `TypedDict[MovieExtraInt]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_extra_items.py:257:13-22: `TypedDict[MovieExtraInt]` is not assignable to variable `extra_str` with type `TypedDict[MovieExtraStr]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_extra_items.py:268:14-24: `TypedDict[MovieNotClosed]` is not assignable to variable `extra_int2` with type `TypedDict[MovieExtraInt]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_extra_items.py:278:47-51: Unexpected keyword argument `year` in function `NonClosedMovie.__init__` [unexpected-keyword] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_extra_items.py:285:52-61: Keyword argument `language` with type `Literal['English']` is not assignable to kwargs type `int` in function `ExtraMovie.__init__` [bad-argument-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_extra_items.py:293:44-48: Unexpected keyword argument `year` in function `ClosedMovie.__init__` [unexpected-keyword] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_extra_items.py:300:34-44: `TypedDict[MovieExtraStr]` is not assignable to `Mapping[str, str]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_extra_items.py:303:34-44: `TypedDict[MovieExtraInt]` is not assignable to `Mapping[str, int]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_extra_items.py:304:44-54: `TypedDict[MovieExtraInt]` is not assignable to `Mapping[str, int | str]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_extra_items.py:326:25-26: `TypedDict[IntDict]` is not assignable to `dict[str, int]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_extra_items.py:330:32-53: `TypedDict[IntDictWithNum]` is not assignable to `dict[str, int]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_extra_items.py:337:1-28: Object of class `IntDictWithNum` has no attribute `clear` [missing-attribute] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_extra_items.py:339:12-62: assert_type(Any, tuple[str, int]) failed [assert-type] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_extra_items.py:339:13-42: Object of class `IntDictWithNum` has no attribute `popitem` [missing-attribute] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_extra_items.py:343:9-35: Cannot delete item in `TypedDict[IntDictWithNum]` [unsupported-operation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_extra_items.py:352:25-52: `dict[str, int]` is not assignable to `TypedDict[IntDict]` [bad-assignment] +ERROR typeddicts_extra_items.py:15:45-49: `Literal[1982]` is not assignable to TypedDict `extra_items` type `bool` [typed-dict-key-error] +ERROR typeddicts_extra_items.py:22:55-59: `Literal[1982]` is not assignable to TypedDict `extra_items` type `bool` [typed-dict-key-error] +ERROR typeddicts_extra_items.py:39:54-58: `None` is not assignable to TypedDict key `year` with type `int` [typed-dict-key-error] +ERROR typeddicts_extra_items.py:49:7-16: Expected literal True or False for keyword `closed`, got instance of `bool` [bad-typed-dict] +ERROR typeddicts_extra_items.py:67:7-20: Non-closed TypedDict cannot inherit from closed TypedDict `ClosedBase` [bad-typed-dict] +ERROR typeddicts_extra_items.py:73:7-20: Non-closed TypedDict cannot inherit from TypedDict `ExtraItemsBase` with extra items [bad-typed-dict] +ERROR typeddicts_extra_items.py:92:5-8: Cannot extend closed TypedDict `MovieA` with extra item `age` [typed-dict-key-error] +ERROR typeddicts_extra_items.py:95:5-8: Cannot extend closed TypedDict `MovieB` with extra item `age` [typed-dict-key-error] +ERROR typeddicts_extra_items.py:109:7-30: Closed TypedDict cannot inherit from TypedDict `ExtraItemsBase` with non-read-only extra items [bad-typed-dict] +ERROR typeddicts_extra_items.py:114:50-63: `Required` is not allowed in this context [invalid-annotation] +ERROR typeddicts_extra_items.py:117:57-73: `NotRequired` is not allowed in this context [invalid-annotation] +ERROR typeddicts_extra_items.py:128:15-21: Key `name` in TypedDict `MovieEI` may not be deleted [delete-error] +ERROR typeddicts_extra_items.py:129:15-21: TypedDict `MovieEI` does not have key `year` [typed-dict-key-error] +ERROR typeddicts_extra_items.py:143:48-52: Unexpected keyword argument `year` in function `unpack_no_extra` [unexpected-keyword] +ERROR typeddicts_extra_items.py:144:45-49: Unexpected keyword argument `year` in function `unpack_extra` [unexpected-keyword] +ERROR typeddicts_extra_items.py:174:7-12: Cannot change the non-read-only extra items type of TypedDict `Parent` [bad-typed-dict] +ERROR typeddicts_extra_items.py:185:5-9: TypedDict `MovieBase2` with non-read-only `extra_items` cannot be extended with required extra item `year` [typed-dict-key-error] +ERROR typeddicts_extra_items.py:188:5-9: `int` is not consistent with `extra_items` type `int | None` of TypedDict `MovieBase2` [typed-dict-key-error] +ERROR typeddicts_extra_items.py:197:5-14: `str` is not assignable to `extra_items` type `int | None` of TypedDict `BookBase` [typed-dict-key-error] +ERROR typeddicts_extra_items.py:215:22-30: `TypedDict[MovieDetails]` is not assignable to `TypedDict[MovieBase2]` [bad-assignment] +ERROR typeddicts_extra_items.py:222:22-30: `TypedDict[MovieWithYear2]` is not assignable to `TypedDict[MovieBase2]` [bad-assignment] +ERROR typeddicts_extra_items.py:242:19-27: `TypedDict[MovieDetails5]` is not assignable to `TypedDict[MovieSI]` [bad-assignment] +ERROR typeddicts_extra_items.py:256:13-22: `TypedDict[MovieExtraStr]` is not assignable to variable `extra_int` with type `TypedDict[MovieExtraInt]` [bad-assignment] +ERROR typeddicts_extra_items.py:257:13-22: `TypedDict[MovieExtraInt]` is not assignable to variable `extra_str` with type `TypedDict[MovieExtraStr]` [bad-assignment] +ERROR typeddicts_extra_items.py:268:14-24: `TypedDict[MovieNotClosed]` is not assignable to variable `extra_int2` with type `TypedDict[MovieExtraInt]` [bad-assignment] +ERROR typeddicts_extra_items.py:278:47-51: Unexpected keyword argument `year` in function `NonClosedMovie.__init__` [unexpected-keyword] +ERROR typeddicts_extra_items.py:285:52-61: Keyword argument `language` with type `Literal['English']` is not assignable to kwargs type `int` in function `ExtraMovie.__init__` [bad-argument-type] +ERROR typeddicts_extra_items.py:293:44-48: Unexpected keyword argument `year` in function `ClosedMovie.__init__` [unexpected-keyword] +ERROR typeddicts_extra_items.py:300:34-44: `TypedDict[MovieExtraStr]` is not assignable to `Mapping[str, str]` [bad-assignment] +ERROR typeddicts_extra_items.py:303:34-44: `TypedDict[MovieExtraInt]` is not assignable to `Mapping[str, int]` [bad-assignment] +ERROR typeddicts_extra_items.py:304:44-54: `TypedDict[MovieExtraInt]` is not assignable to `Mapping[str, int | str]` [bad-assignment] +ERROR typeddicts_extra_items.py:326:25-26: `TypedDict[IntDict]` is not assignable to `dict[str, int]` [bad-assignment] +ERROR typeddicts_extra_items.py:330:32-53: `TypedDict[IntDictWithNum]` is not assignable to `dict[str, int]` [bad-assignment] +ERROR typeddicts_extra_items.py:337:1-28: Object of class `IntDictWithNum` has no attribute `clear` [missing-attribute] +ERROR typeddicts_extra_items.py:339:12-62: assert_type(Any, tuple[str, int]) failed [assert-type] +ERROR typeddicts_extra_items.py:339:13-42: Object of class `IntDictWithNum` has no attribute `popitem` [missing-attribute] +ERROR typeddicts_extra_items.py:343:9-35: Cannot delete item in `TypedDict[IntDictWithNum]` [unsupported-operation] +ERROR typeddicts_extra_items.py:352:25-52: `dict[str, int]` is not assignable to `TypedDict[IntDict]` [bad-assignment] """ diff --git a/conformance/results/pyrefly/typeddicts_final.toml b/conformance/results/pyrefly/typeddicts_final.toml index cdd4d0cd9..be211bd5b 100644 --- a/conformance/results/pyrefly/typeddicts_final.toml +++ b/conformance/results/pyrefly/typeddicts_final.toml @@ -1,3 +1,4 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ diff --git a/conformance/results/pyrefly/typeddicts_inheritance.toml b/conformance/results/pyrefly/typeddicts_inheritance.toml index 60a912381..1e3dd7270 100644 --- a/conformance/results/pyrefly/typeddicts_inheritance.toml +++ b/conformance/results/pyrefly/typeddicts_inheritance.toml @@ -7,6 +7,6 @@ errors_diff = """ Line 65: Expected 1 errors """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_inheritance.py:44:7-19: `NonTypedDict` is not a typed dictionary. Typed dictionary definitions may only extend other typed dictionaries. [invalid-inheritance] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_inheritance.py:55:4-5: Class member `Y1.x` overrides parent class `X1` in an inconsistent manner [bad-override] +ERROR typeddicts_inheritance.py:44:7-19: `NonTypedDict` is not a typed dictionary. Typed dictionary definitions may only extend other typed dictionaries. [invalid-inheritance] +ERROR typeddicts_inheritance.py:55:4-5: Class member `Y1.x` overrides parent class `X1` in an inconsistent manner [bad-override] """ diff --git a/conformance/results/pyrefly/typeddicts_operations.toml b/conformance/results/pyrefly/typeddicts_operations.toml index fb103ce94..a145cff04 100644 --- a/conformance/results/pyrefly/typeddicts_operations.toml +++ b/conformance/results/pyrefly/typeddicts_operations.toml @@ -1,17 +1,18 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_operations.py:22:17-21: `Literal[1982]` is not assignable to TypedDict key `name` with type `str` [typed-dict-key-error] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_operations.py:23:17-19: `Literal['']` is not assignable to TypedDict key `year` with type `int` [typed-dict-key-error] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_operations.py:24:7-14: TypedDict `Movie` does not have key `other` [typed-dict-key-error] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_operations.py:26:13-20: TypedDict `Movie` does not have key `other` [typed-dict-key-error] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_operations.py:28:9-33: Missing required key `year` for TypedDict `Movie` [typed-dict-key-error] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_operations.py:29:42-48: `float` is not assignable to TypedDict key `year` with type `int` [typed-dict-key-error] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_operations.py:32:36-43: Key `other` is not defined in TypedDict `Movie` [typed-dict-key-error] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_operations.py:37:20-52: Missing required key `name` for TypedDict `Movie` [typed-dict-key-error] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_operations.py:37:21-33: Expected string literal key, got `str` [typed-dict-key-error] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_operations.py:47:1-12: Object of class `Movie` has no attribute `clear` [missing-attribute] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_operations.py:49:11-17: Key `name` in TypedDict `Movie` may not be deleted [delete-error] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_operations.py:62:1-21: Object of class `MovieOptional` has no attribute `clear` [missing-attribute] +ERROR typeddicts_operations.py:22:17-21: `Literal[1982]` is not assignable to TypedDict key `name` with type `str` [typed-dict-key-error] +ERROR typeddicts_operations.py:23:17-19: `Literal['']` is not assignable to TypedDict key `year` with type `int` [typed-dict-key-error] +ERROR typeddicts_operations.py:24:7-14: TypedDict `Movie` does not have key `other` [typed-dict-key-error] +ERROR typeddicts_operations.py:26:13-20: TypedDict `Movie` does not have key `other` [typed-dict-key-error] +ERROR typeddicts_operations.py:28:9-33: Missing required key `year` for TypedDict `Movie` [typed-dict-key-error] +ERROR typeddicts_operations.py:29:42-48: `float` is not assignable to TypedDict key `year` with type `int` [typed-dict-key-error] +ERROR typeddicts_operations.py:32:36-43: Key `other` is not defined in TypedDict `Movie` [typed-dict-key-error] +ERROR typeddicts_operations.py:37:20-52: Missing required key `name` for TypedDict `Movie` [typed-dict-key-error] +ERROR typeddicts_operations.py:37:21-33: Expected string literal key, got `str` [typed-dict-key-error] +ERROR typeddicts_operations.py:47:1-12: Object of class `Movie` has no attribute `clear` [missing-attribute] +ERROR typeddicts_operations.py:49:11-17: Key `name` in TypedDict `Movie` may not be deleted [delete-error] +ERROR typeddicts_operations.py:62:1-21: Object of class `MovieOptional` has no attribute `clear` [missing-attribute] """ diff --git a/conformance/results/pyrefly/typeddicts_readonly.toml b/conformance/results/pyrefly/typeddicts_readonly.toml index 1f81634cc..8b0f34d7a 100644 --- a/conformance/results/pyrefly/typeddicts_readonly.toml +++ b/conformance/results/pyrefly/typeddicts_readonly.toml @@ -1,11 +1,12 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_readonly.py:24:1-14: Key `members` in TypedDict `Band` is read-only [read-only] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_readonly.py:36:1-14: Key `members` in TypedDict `Band2` is read-only [read-only] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_readonly.py:50:1-12: Key `title` in TypedDict `Movie1` is read-only [read-only] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_readonly.py:51:1-11: Key `year` in TypedDict `Movie1` is read-only [read-only] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_readonly.py:60:1-12: Key `title` in TypedDict `Movie2` is read-only [read-only] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_readonly.py:61:1-11: Key `year` in TypedDict `Movie2` is read-only [read-only] +ERROR typeddicts_readonly.py:24:1-14: Key `members` in TypedDict `Band` is read-only [read-only] +ERROR typeddicts_readonly.py:36:1-14: Key `members` in TypedDict `Band2` is read-only [read-only] +ERROR typeddicts_readonly.py:50:1-12: Key `title` in TypedDict `Movie1` is read-only [read-only] +ERROR typeddicts_readonly.py:51:1-11: Key `year` in TypedDict `Movie1` is read-only [read-only] +ERROR typeddicts_readonly.py:60:1-12: Key `title` in TypedDict `Movie2` is read-only [read-only] +ERROR typeddicts_readonly.py:61:1-11: Key `year` in TypedDict `Movie2` is read-only [read-only] """ diff --git a/conformance/results/pyrefly/typeddicts_readonly_consistency.toml b/conformance/results/pyrefly/typeddicts_readonly_consistency.toml index 6ac703eb9..90edd6dee 100644 --- a/conformance/results/pyrefly/typeddicts_readonly_consistency.toml +++ b/conformance/results/pyrefly/typeddicts_readonly_consistency.toml @@ -1,12 +1,13 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_readonly_consistency.py:37:14-15: `TypedDict[A1]` is not assignable to `TypedDict[B1]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_readonly_consistency.py:38:14-15: `TypedDict[C1]` is not assignable to `TypedDict[B1]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_readonly_consistency.py:40:14-15: `TypedDict[A1]` is not assignable to `TypedDict[C1]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_readonly_consistency.py:81:14-15: `TypedDict[A2]` is not assignable to `TypedDict[B2]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_readonly_consistency.py:82:14-15: `TypedDict[C2]` is not assignable to `TypedDict[B2]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_readonly_consistency.py:84:14-15: `TypedDict[A2]` is not assignable to `TypedDict[C2]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_readonly_consistency.py:85:14-15: `TypedDict[B2]` is not assignable to `TypedDict[C2]` [bad-assignment] +ERROR typeddicts_readonly_consistency.py:37:14-15: `TypedDict[A1]` is not assignable to `TypedDict[B1]` [bad-assignment] +ERROR typeddicts_readonly_consistency.py:38:14-15: `TypedDict[C1]` is not assignable to `TypedDict[B1]` [bad-assignment] +ERROR typeddicts_readonly_consistency.py:40:14-15: `TypedDict[A1]` is not assignable to `TypedDict[C1]` [bad-assignment] +ERROR typeddicts_readonly_consistency.py:81:14-15: `TypedDict[A2]` is not assignable to `TypedDict[B2]` [bad-assignment] +ERROR typeddicts_readonly_consistency.py:82:14-15: `TypedDict[C2]` is not assignable to `TypedDict[B2]` [bad-assignment] +ERROR typeddicts_readonly_consistency.py:84:14-15: `TypedDict[A2]` is not assignable to `TypedDict[C2]` [bad-assignment] +ERROR typeddicts_readonly_consistency.py:85:14-15: `TypedDict[B2]` is not assignable to `TypedDict[C2]` [bad-assignment] """ diff --git a/conformance/results/pyrefly/typeddicts_readonly_inheritance.toml b/conformance/results/pyrefly/typeddicts_readonly_inheritance.toml index 5041a6dc4..1c90b6692 100644 --- a/conformance/results/pyrefly/typeddicts_readonly_inheritance.toml +++ b/conformance/results/pyrefly/typeddicts_readonly_inheritance.toml @@ -10,11 +10,11 @@ Line 119: Expected 1 errors Line 132: Expected 1 errors """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_readonly_inheritance.py:36:1-11: Key `name` in TypedDict `Album2` is read-only [read-only] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_readonly_inheritance.py:50:5-8: Class member `RecordShop.alt` overrides parent class `AlbumCollection` in an inconsistent manner [bad-override] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_readonly_inheritance.py:65:19-21: Missing required key `name` for TypedDict `RequiredName` [typed-dict-key-error] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_readonly_inheritance.py:82:14-15: `Literal[3]` is not assignable to TypedDict key `ident` with type `str` [typed-dict-key-error] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_readonly_inheritance.py:83:15-16: `Literal[3]` is not assignable to TypedDict key `ident` with type `str` [typed-dict-key-error] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_readonly_inheritance.py:84:5-7: Missing required key `ident` for TypedDict `User` [typed-dict-key-error] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_readonly_inheritance.py:94:5-6: Class member `F3.a` overrides parent class `F1` in an inconsistent manner [bad-override] +ERROR typeddicts_readonly_inheritance.py:36:1-11: Key `name` in TypedDict `Album2` is read-only [read-only] +ERROR typeddicts_readonly_inheritance.py:50:5-8: Class member `RecordShop.alt` overrides parent class `AlbumCollection` in an inconsistent manner [bad-override] +ERROR typeddicts_readonly_inheritance.py:65:19-21: Missing required key `name` for TypedDict `RequiredName` [typed-dict-key-error] +ERROR typeddicts_readonly_inheritance.py:82:14-15: `Literal[3]` is not assignable to TypedDict key `ident` with type `str` [typed-dict-key-error] +ERROR typeddicts_readonly_inheritance.py:83:15-16: `Literal[3]` is not assignable to TypedDict key `ident` with type `str` [typed-dict-key-error] +ERROR typeddicts_readonly_inheritance.py:84:5-7: Missing required key `ident` for TypedDict `User` [typed-dict-key-error] +ERROR typeddicts_readonly_inheritance.py:94:5-6: Class member `F3.a` overrides parent class `F1` in an inconsistent manner [bad-override] """ diff --git a/conformance/results/pyrefly/typeddicts_readonly_kwargs.toml b/conformance/results/pyrefly/typeddicts_readonly_kwargs.toml index 82fa1cd1b..7d4318302 100644 --- a/conformance/results/pyrefly/typeddicts_readonly_kwargs.toml +++ b/conformance/results/pyrefly/typeddicts_readonly_kwargs.toml @@ -1,6 +1,7 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_readonly_kwargs.py:33:5-19: Key `key1` in TypedDict `ReadOnlyArgs` is read-only [read-only] +ERROR typeddicts_readonly_kwargs.py:33:5-19: Key `key1` in TypedDict `ReadOnlyArgs` is read-only [read-only] """ diff --git a/conformance/results/pyrefly/typeddicts_readonly_update.toml b/conformance/results/pyrefly/typeddicts_readonly_update.toml index 06d3b7602..662d236e1 100644 --- a/conformance/results/pyrefly/typeddicts_readonly_update.toml +++ b/conformance/results/pyrefly/typeddicts_readonly_update.toml @@ -1,6 +1,7 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_readonly_update.py:23:10-14: No matching overload found for function `A.update` [no-matching-overload] +ERROR typeddicts_readonly_update.py:23:10-14: No matching overload found for function `A.update` [no-matching-overload] """ diff --git a/conformance/results/pyrefly/typeddicts_required.toml b/conformance/results/pyrefly/typeddicts_required.toml index 4a23823a9..cd9d0280d 100644 --- a/conformance/results/pyrefly/typeddicts_required.toml +++ b/conformance/results/pyrefly/typeddicts_required.toml @@ -7,10 +7,10 @@ errors_diff = """ Line 74: Unexpected errors ["Expected a type form, got instance of `Literal['RecursiveMovie']` [not-a-type]"] """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_required.py:12:5-6: `Required` may only be used for TypedDict members [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_required.py:19:8-19: `NotRequired` is only allowed inside a class body [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_required.py:19:8-24: `NotRequired` is not allowed in this context [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_required.py:62:8-31: Duplicate qualifier `Required` [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_required.py:63:8-34: Cannot combine `Required` and `NotRequired` for a TypedDict field [invalid-annotation] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_required.py:74:75-91: Expected a type form, got instance of `Literal['RecursiveMovie']` [not-a-type] +ERROR typeddicts_required.py:12:5-6: `Required` may only be used for TypedDict members [invalid-annotation] +ERROR typeddicts_required.py:19:8-19: `NotRequired` is only allowed inside a class body [invalid-annotation] +ERROR typeddicts_required.py:19:8-24: `NotRequired` is not allowed in this context [invalid-annotation] +ERROR typeddicts_required.py:62:8-31: Duplicate qualifier `Required` [invalid-annotation] +ERROR typeddicts_required.py:63:8-34: Cannot combine `Required` and `NotRequired` for a TypedDict field [invalid-annotation] +ERROR typeddicts_required.py:74:75-91: Expected a type form, got instance of `Literal['RecursiveMovie']` [not-a-type] """ diff --git a/conformance/results/pyrefly/typeddicts_type_consistency.toml b/conformance/results/pyrefly/typeddicts_type_consistency.toml index 9ffdbb836..c7812752f 100644 --- a/conformance/results/pyrefly/typeddicts_type_consistency.toml +++ b/conformance/results/pyrefly/typeddicts_type_consistency.toml @@ -1,14 +1,15 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_type_consistency.py:21:10-12: `TypedDict[B1]` is not assignable to `TypedDict[A1]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_type_consistency.py:38:10-12: `TypedDict[B2]` is not assignable to `TypedDict[A2]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_type_consistency.py:65:6-8: `TypedDict[A3]` is not assignable to variable `b3` with type `TypedDict[B3]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_type_consistency.py:69:21-24: Key `y` is not defined in TypedDict `A3` [typed-dict-key-error] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_type_consistency.py:76:22-24: `TypedDict[B3]` is not assignable to `dict[str, int]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_type_consistency.py:77:25-27: `TypedDict[B3]` is not assignable to `dict[str, object]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_type_consistency.py:78:22-24: `TypedDict[B3]` is not assignable to `dict[Any, Any]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_type_consistency.py:82:25-27: `TypedDict[B3]` is not assignable to `Mapping[str, int]` [bad-assignment] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_type_consistency.py:126:56-57: `Literal[1]` is not assignable to TypedDict key `inner_key` with type `str` [typed-dict-key-error] +ERROR typeddicts_type_consistency.py:21:10-12: `TypedDict[B1]` is not assignable to `TypedDict[A1]` [bad-assignment] +ERROR typeddicts_type_consistency.py:38:10-12: `TypedDict[B2]` is not assignable to `TypedDict[A2]` [bad-assignment] +ERROR typeddicts_type_consistency.py:65:6-8: `TypedDict[A3]` is not assignable to variable `b3` with type `TypedDict[B3]` [bad-assignment] +ERROR typeddicts_type_consistency.py:69:21-24: Key `y` is not defined in TypedDict `A3` [typed-dict-key-error] +ERROR typeddicts_type_consistency.py:76:22-24: `TypedDict[B3]` is not assignable to `dict[str, int]` [bad-assignment] +ERROR typeddicts_type_consistency.py:77:25-27: `TypedDict[B3]` is not assignable to `dict[str, object]` [bad-assignment] +ERROR typeddicts_type_consistency.py:78:22-24: `TypedDict[B3]` is not assignable to `dict[Any, Any]` [bad-assignment] +ERROR typeddicts_type_consistency.py:82:25-27: `TypedDict[B3]` is not assignable to `Mapping[str, int]` [bad-assignment] +ERROR typeddicts_type_consistency.py:126:56-57: `Literal[1]` is not assignable to TypedDict key `inner_key` with type `str` [typed-dict-key-error] """ diff --git a/conformance/results/pyrefly/typeddicts_usage.toml b/conformance/results/pyrefly/typeddicts_usage.toml index 4688e8eda..45500cede 100644 --- a/conformance/results/pyrefly/typeddicts_usage.toml +++ b/conformance/results/pyrefly/typeddicts_usage.toml @@ -1,11 +1,12 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_usage.py:23:7-17: TypedDict `Movie` does not have key `director` [typed-dict-key-error] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_usage.py:24:17-23: `Literal['1982']` is not assignable to TypedDict key `year` with type `int` [typed-dict-key-error] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_usage.py:28:17-56: Missing required key `name` for TypedDict `Movie` [typed-dict-key-error] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_usage.py:28:18-25: Key `title` is not defined in TypedDict `Movie` [typed-dict-key-error] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_usage.py:35:22-27: TypedDict `Movie` not allowed as second argument to isinstance() [invalid-argument] -ERROR /Users/dannyyang/Documents/Documents/GitHub/typing/conformance/tests/typeddicts_usage.py:40:24-33: `TypedDict` is not allowed in this context [invalid-annotation] +ERROR typeddicts_usage.py:23:7-17: TypedDict `Movie` does not have key `director` [typed-dict-key-error] +ERROR typeddicts_usage.py:24:17-23: `Literal['1982']` is not assignable to TypedDict key `year` with type `int` [typed-dict-key-error] +ERROR typeddicts_usage.py:28:17-56: Missing required key `name` for TypedDict `Movie` [typed-dict-key-error] +ERROR typeddicts_usage.py:28:18-25: Key `title` is not defined in TypedDict `Movie` [typed-dict-key-error] +ERROR typeddicts_usage.py:35:22-27: TypedDict `Movie` not allowed as second argument to isinstance() [invalid-argument] +ERROR typeddicts_usage.py:40:24-33: `TypedDict` is not allowed in this context [invalid-annotation] """ diff --git a/conformance/results/results.html b/conformance/results/results.html index 7e0de6781..5805ee71b 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -77,7 +77,7 @@ } .col2 { - width: 18%; + width: 14%; cursor: pointer; text-align: center; } diff --git a/conformance/src/results_template.html b/conformance/src/results_template.html index 2e9b95f35..cd548256c 100644 --- a/conformance/src/results_template.html +++ b/conformance/src/results_template.html @@ -77,7 +77,7 @@ } .col2 { - width: 18%; + width: 14%; cursor: pointer; text-align: center; } diff --git a/conformance/src/type_checker.py b/conformance/src/type_checker.py index 26b61e465..6bd69f9e1 100644 --- a/conformance/src/type_checker.py +++ b/conformance/src/type_checker.py @@ -364,7 +364,12 @@ def get_version(self) -> str: return version def run_tests(self, test_files: Sequence[str]) -> dict[str, str]: - proc = run(["pyrefly", "check", "--output-format", "min-text", "--no-summary"], stdout=PIPE, text=True, encoding="utf-8") + proc = run( + ["pyrefly", "check", "--output-format", "min-text", "--no-summary"], + stdout=PIPE, + text=True, + encoding="utf-8", + ) lines = proc.stdout.split("\n") # Add results to a dictionary keyed by the file name. @@ -372,8 +377,23 @@ def run_tests(self, test_files: Sequence[str]) -> dict[str, str]: for line in lines: if not line.strip(): continue - file_name = line.split(":")[0].split(" ")[1].split("conformance/tests/")[-1].strip() - results_dict[file_name] = results_dict.get(file_name, "") + line + "\n" + # Extract the absolute path reported by pyrefly and convert it to a + # stable relative path (filename only) so results are consistent. + # Example input line: + # "ERROR /abs/.../conformance/tests/foo.py:12:3-5: message [code]" + # We replace the absolute path with just "foo.py". + try: + abs_path = line.split(":", 1)[0].split(" ", 1)[1].strip() + except IndexError: + # If parsing fails, fall back to original line and grouping. + abs_path = "" + file_name = Path(abs_path).name if abs_path else line.split(":")[0] + + # Replace only the first occurrence to avoid touching the message text. + display_line = line.replace(abs_path, file_name, 1) if abs_path else line + results_dict[file_name] = ( + results_dict.get(file_name, "") + display_line + "\n" + ) return results_dict From edba79d85398775867e7f68231d94b3a202fc0c7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 2 Sep 2025 08:06:55 +0200 Subject: [PATCH 136/308] Bump actions/checkout from 4 to 5 in the actions group (#2082) Bumps the actions group with 1 update: [actions/checkout](https://github.com/actions/checkout). Updates `actions/checkout` from 4 to 5 - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/build-docs.yml | 2 +- .github/workflows/ci.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index c8e166a4f..bf21d242f 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Set up Python uses: actions/setup-python@v5 with: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 41ffb78a8..8b36a5875 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Set up Python 3 uses: actions/setup-python@v5 with: From 2702b016f8b990235f385db36ba8e1efb5d0d201 Mon Sep 17 00:00:00 2001 From: Eric Traut Date: Sun, 28 Sep 2025 22:41:06 -0700 Subject: [PATCH 137/308] Updated the typing spec to use modern (PEP 695) generics syntax (#2089) * Updated the typing spec to use modern (PEP 695) generics syntax * Update docs/spec/generics.rst Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com> * Update docs/spec/annotations.rst Co-authored-by: Alex Waygood * Update docs/spec/annotations.rst Co-authored-by: Alex Waygood * Incorporated code review feedback * Incorporated Jelle's review feedback * Addressed code review feedback from Jelle --------- Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com> Co-authored-by: Alex Waygood --- docs/spec/aliases.rst | 15 +-- docs/spec/annotations.rst | 6 +- docs/spec/class-compat.rst | 7 +- docs/spec/constructors.rst | 8 +- docs/spec/dataclasses.rst | 10 +- docs/spec/generics.rst | 243 ++++++++++++++++-------------------- docs/spec/literal.rst | 36 +++--- docs/spec/narrowing.rst | 8 +- docs/spec/overload.rst | 43 +++---- docs/spec/protocol.rst | 33 +++-- docs/spec/qualifiers.rst | 7 +- docs/spec/special-types.rst | 3 +- 12 files changed, 179 insertions(+), 240 deletions(-) diff --git a/docs/spec/aliases.rst b/docs/spec/aliases.rst index a965eca41..cc5e70b55 100644 --- a/docs/spec/aliases.rst +++ b/docs/spec/aliases.rst @@ -34,29 +34,24 @@ Type aliases may be as complex as type hints in annotations -- anything that is acceptable as a type hint is acceptable in a type alias:: - from typing import TypeVar from collections.abc import Iterable - T = TypeVar('T', bound=float) - Vector = Iterable[tuple[T, T]] + type Vector[T: float] = Iterable[tuple[T, T]] - def inproduct(v: Vector[T]) -> T: + def inproduct[T: float](v: Vector[T]) -> T: return sum(x*y for x, y in v) - def dilate(v: Vector[T], scale: T) -> Vector[T]: + def dilate[T: float](v: Vector[T], scale: T) -> Vector[T]: return ((x * scale, y * scale) for x, y in v) vec: Vector[float] = [] This is equivalent to:: - from typing import TypeVar from collections.abc import Iterable - T = TypeVar('T', bound=float) - - def inproduct(v: Iterable[tuple[T, T]]) -> T: + def inproduct[T: float](v: Iterable[tuple[T, T]]) -> T: return sum(x*y for x, y in v) - def dilate(v: Iterable[tuple[T, T]], scale: T) -> Iterable[tuple[T, T]]: + def dilate[T: float](v: Iterable[tuple[T, T]], scale: T) -> Iterable[tuple[T, T]]: return ((x * scale, y * scale) for x, y in v) vec: Iterable[tuple[float, float]] = [] diff --git a/docs/spec/annotations.rst b/docs/spec/annotations.rst index 7f8f599e2..efcdb7871 100644 --- a/docs/spec/annotations.rst +++ b/docs/spec/annotations.rst @@ -366,9 +366,8 @@ In addition, the first argument in an instance method can be annotated with a type variable. In this case the return type may use the same type variable, thus making that method a generic function. For example:: - T = TypeVar('T', bound='Copyable') class Copyable: - def copy(self: T) -> T: + def copy[T: Copyable](self: T) -> T: # return a copy of self class C(Copyable): ... @@ -378,10 +377,9 @@ type variable, thus making that method a generic function. For example:: The same applies to class methods using ``type[]`` in an annotation of the first argument:: - T = TypeVar('T', bound='C') class C: @classmethod - def factory(cls: type[T]) -> T: + def factory[T: C](cls: type[T]) -> T: # make a new instance of cls class D(C): ... diff --git a/docs/spec/class-compat.rst b/docs/spec/class-compat.rst index 2984c5a3c..fe7df968e 100644 --- a/docs/spec/class-compat.rst +++ b/docs/spec/class-compat.rst @@ -101,11 +101,8 @@ For example, annotating the discussed class:: As a matter of convenience (and convention), instance variables can be annotated in ``__init__`` or other methods, rather than in the class:: - from typing import Generic, TypeVar - T = TypeVar('T') - - class Box(Generic[T]): - def __init__(self, content): + class Box[T]: + def __init__(self, content: T): self.content: T = content ``ClassVar`` cannot be used as a qualifier for a :ref:`TypedDict ` diff --git a/docs/spec/constructors.rst b/docs/spec/constructors.rst index b8591ba12..c95ecc488 100644 --- a/docs/spec/constructors.rst +++ b/docs/spec/constructors.rst @@ -318,16 +318,14 @@ these method evaluations, they should take on their default values. :: - T1 = TypeVar("T1") - T2 = TypeVar("T2") - T3 = TypeVar("T3", default=str) + from typing import Any, Self, assert_type - class MyClass1(Generic[T1, T2]): + class MyClass1[T1, T2]: def __new__(cls, x: T1) -> Self: ... assert_type(MyClass1(1), MyClass1[int, Any]) - class MyClass2(Generic[T1, T3]): + class MyClass2[T1, T3 = str]: def __new__(cls, x: T1) -> Self: ... assert_type(MyClass2(1), MyClass2[int, str]) diff --git a/docs/spec/dataclasses.rst b/docs/spec/dataclasses.rst index 92d53d227..77a775745 100644 --- a/docs/spec/dataclasses.rst +++ b/docs/spec/dataclasses.rst @@ -72,12 +72,10 @@ Decorator function example .. code-block:: python - _T = TypeVar("_T") - # The ``create_model`` decorator is defined by a library. # This could be in a type stub or inline. @typing.dataclass_transform() - def create_model(cls: Type[_T]) -> Type[_T]: + def create_model[T](cls: type[T]) -> type[T]: cls.__init__ = ... cls.__eq__ = ... cls.__ne__ = ... @@ -148,7 +146,9 @@ customization of default behaviors: .. code-block:: python - _T = TypeVar("_T") + class _IdentityCallable(Protocol): + def __call__[T](self, arg: T, /) -> T: + ... def dataclass_transform( *, @@ -158,7 +158,7 @@ customization of default behaviors: frozen_default: bool = False, field_specifiers: tuple[type | Callable[..., Any], ...] = (), **kwargs: Any, - ) -> Callable[[_T], _T]: ... + ) -> _IdentityCallable: ... * ``eq_default`` indicates whether the ``eq`` parameter is assumed to be True or False if it is omitted by the caller. If not specified, diff --git a/docs/spec/generics.rst b/docs/spec/generics.rst index 4f4150c44..ff1396a26 100644 --- a/docs/spec/generics.rst +++ b/docs/spec/generics.rst @@ -245,8 +245,9 @@ Generic metaclasses are not supported. Scoping rules for type variables -------------------------------- -Type variables follow normal name resolution rules. -However, there are some special cases in the static typechecking context: +When using the generic class syntax introduced in Python 3.12, the location of +its declaration defines its scope. When using the older syntax, the scoping +rules are more subtle and complex: * A type variable used in a generic function could be inferred to represent different types in the same code block. Example:: @@ -344,13 +345,9 @@ Instantiating generic classes and type erasure ---------------------------------------------- User-defined generic classes can be instantiated. Suppose we write -a ``Node`` class inheriting from ``Generic[T]``:: +a ``Node`` class:: - from typing import TypeVar, Generic - - T = TypeVar('T') - - class Node(Generic[T]): + class Node[T]: ... To create ``Node`` instances you call ``Node()`` just as for a regular @@ -362,12 +359,8 @@ corresponding argument value is passed, the type of the corresponding argument(s) is substituted. Otherwise, the default value for the type parameter (or ``Any``, if no default is provided) is assumed. Example:: - from typing import TypeVar, Generic - - T = TypeVar('T') - - class Node(Generic[T]): - x: T # Instance attribute (see below) + class Node[T]: + x: T # Instance attribute (see below) def __init__(self, label: T | None = None) -> None: ... @@ -665,8 +658,18 @@ ParamSpec Declaration """""""""""" -A parameter specification variable is defined in a similar manner to how a -normal type variable is defined with ``typing.TypeVar``. +In Python 3.12 and newer, a parameter specification variable can be introduced +inline by prefixing its name with ``**`` inside a type parameter list +(for a function, class, or type alias). + +.. code-block:: + + def decorator[**P](func: Callable[P, int]) -> Callable[P, str]: ... + + class CallbackWrapper[T, **P]: + callback: Callable[P, T] + +Prior to 3.12, the ``ParamSpec`` constructor can be used. .. code-block:: @@ -702,62 +705,54 @@ parameter specification variable (``Callable[Concatenate[int, P], int]``\ ). parameter_specification_variable "]" -where ``parameter_specification_variable`` is a ``typing.ParamSpec`` variable, -declared in the manner as defined above, and ``concatenate`` is -``typing.Concatenate``. +where ``parameter_specification_variable`` is introduced either inline (using +``**`` in a type parameter list) or via ``typing.ParamSpec`` as shown above, +and ``concatenate`` is ``typing.Concatenate``. As before, ``parameters_expression``\ s by themselves are not acceptable in places where a type is expected .. code-block:: - def foo(x: P) -> P: ... # Rejected - def foo(x: Concatenate[int, P]) -> int: ... # Rejected - def foo(x: list[P]) -> None: ... # Rejected - def foo(x: Callable[[int, str], P]) -> None: ... # Rejected + def foo[**P](x: P) -> P: ... # Rejected + def foo[**P](x: Concatenate[int, P]) -> int: ... # Rejected + def foo[**P](x: list[P]) -> None: ... # Rejected + def foo[**P](x: Callable[[int, str], P]) -> None: ... # Rejected User-Defined Generic Classes """""""""""""""""""""""""""" -Just as defining a class as inheriting from ``Generic[T]`` makes a class generic -for a single parameter (when ``T`` is a ``TypeVar``\ ), defining a class as -inheriting from ``Generic[P]`` makes a class generic on -``parameters_expression``\ s (when ``P`` is a ``ParamSpec``). +Just as defining a class with ``class C[T]: ...`` makes that class generic over +the type parameter ``T``, adding ``**P`` makes it generic over a parameter +specification. .. code-block:: - T = TypeVar("T") - P_2 = ParamSpec("P_2") - - class X(Generic[T, P]): - f: Callable[P, int] - x: T + from collections.abc import Callable + from typing import Concatenate - def f(x: X[int, P_2]) -> str: ... # Accepted - def f(x: X[int, Concatenate[int, P_2]]) -> str: ... # Accepted - def f(x: X[int, [int, bool]]) -> str: ... # Accepted - def f(x: X[int, ...]) -> str: ... # Accepted - def f(x: X[int, int]) -> str: ... # Rejected + class X[T, **P]: + f: Callable[P, int] + x: T -Or, equivalently, using the built-in syntax for generics in Python 3.12 -and higher:: - - class X[T, **P]: - f: Callable[P, int] - x: T + def accept_params[**P](x: X[int, P]) -> str: ... # Accepted + def accept_concatenate[**P](x: X[int, Concatenate[int, P]]) -> str: ... # Accepted + def accept_concrete(x: X[int, [int, bool]]) -> str: ... # Accepted + def accept_unspecified(x: X[int, ...]) -> str: ... # Accepted + def reject_bad(x: X[int, int]) -> str: ... # Rejected By the rules defined above, spelling a concrete instance of a class generic with respect to only a single ``ParamSpec`` would require unsightly double -brackets. For aesthetic purposes we allow these to be omitted. +brackets. For aesthetic purposes we allow these to be omitted. .. code-block:: - class Z(Generic[P]): - f: Callable[P, int] + class Z[**P]: + f: Callable[P, int] - def f(x: Z[[int, str, bool]]) -> str: ... # Accepted - def f(x: Z[int, str, bool]) -> str: ... # Equivalent + def accept_list(x: Z[[int, str, bool]]) -> str: ... # Accepted + def accept_flat(x: Z[int, str, bool]) -> str: ... # Equivalent # Both Z[[int, str, bool]] and Z[int, str, bool] express this: class Z_instantiated: @@ -772,7 +767,7 @@ evaluating ones with ``TypeVar``\ s. .. code-block:: - def changes_return_type_to_str(x: Callable[P, int]) -> Callable[P, str]: ... + def changes_return_type_to_str[**P](x: Callable[P, int]) -> Callable[P, str]: ... def returns_int(a: str, b: bool) -> int: ... @@ -795,9 +790,7 @@ but is not obligated to do so. .. code-block:: - P = ParamSpec("P") - - def foo(x: Callable[P, int], y: Callable[P, int]) -> Callable[P, bool]: ... + def foo[**P](x: Callable[P, int], y: Callable[P, int]) -> Callable[P, bool]: ... def x_y(x: int, y: str) -> int: ... def y_x(y: int, x: str) -> int: ... @@ -820,9 +813,7 @@ evaluated in the same way. .. code-block:: - U = TypeVar("U") - - class Y(Generic[U, P]): + class Y[U, **P]: f: Callable[P, str] prop: U @@ -844,15 +835,15 @@ transform a finite number of parameters of a callable. def bar(x: int, *args: bool) -> int: ... - def add(x: Callable[P, int]) -> Callable[Concatenate[str, P], bool]: ... + def add[**P](x: Callable[P, int]) -> Callable[Concatenate[str, P], bool]: ... add(bar) # Should return (a: str, /, x: int, *args: bool) -> bool - def remove(x: Callable[Concatenate[int, P], int]) -> Callable[P, bool]: ... + def remove[**P](x: Callable[Concatenate[int, P], int]) -> Callable[P, bool]: ... remove(bar) # Should return (*args: bool) -> bool - def transform( + def transform[**P]( x: Callable[Concatenate[int, P], int] ) -> Callable[Concatenate[str, P], bool]: ... @@ -865,7 +856,7 @@ their first position with a ``X`` can satisfy .. code-block:: - def expects_int_first(x: Callable[Concatenate[int, P], int]) -> None: ... + def expects_int_first[**P](x: Callable[Concatenate[int, P], int]) -> None: ... @expects_int_first # Rejected def one(x: str) -> int: ... @@ -907,7 +898,7 @@ These "properties" can only be used as the annotated types for .. code-block:: - def puts_p_into_scope(f: Callable[P, int]) -> None: + def p_in_scope[**P](f: Callable[P, int]) -> None: def inner(*args: P.args, **kwargs: P.kwargs) -> None: # Accepted pass @@ -918,7 +909,7 @@ These "properties" can only be used as the annotated types for def misplaced(x: P.args) -> None: # Rejected pass - def out_of_scope(*args: P.args, **kwargs: P.kwargs) -> None: # Rejected + def p_not_in_scope(*args: P.args, **kwargs: P.kwargs) -> None: # Rejected pass @@ -931,7 +922,7 @@ together, so that our usage is valid for all possible partitions. .. code-block:: - def puts_p_into_scope(f: Callable[P, int]) -> None: + def p_in_scope[**P](f: Callable[P, int]) -> None: stored_args: P.args # Rejected @@ -971,7 +962,7 @@ parameter preserving decorators. .. code-block:: - def decorator(f: Callable[P, int]) -> Callable[P, None]: + def decorator[**P](f: Callable[P, int]) -> Callable[P, None]: def foo(*args: P.args, **kwargs: P.kwargs) -> None: @@ -996,7 +987,7 @@ To extend this to include ``Concatenate``, we declare the following properties: .. code-block:: - def add(f: Callable[P, int]) -> Callable[Concatenate[str, P], None]: + def add[**P](f: Callable[P, int]) -> Callable[Concatenate[str, P], None]: def foo(s: str, *args: P.args, **kwargs: P.kwargs) -> None: # Accepted pass @@ -1007,7 +998,7 @@ To extend this to include ``Concatenate``, we declare the following properties: return foo # Accepted - def remove(f: Callable[Concatenate[int, P], int]) -> Callable[P, None]: + def remove[**P](f: Callable[Concatenate[int, P], int]) -> Callable[P, None]: def foo(*args: P.args, **kwargs: P.kwargs) -> None: f(1, *args, **kwargs) # Accepted @@ -1024,7 +1015,7 @@ these parameters can not be addressed via a named argument: .. code-block:: - def outer(f: Callable[P, None]) -> Callable[P, None]: + def outer[**P](f: Callable[P, None]) -> Callable[P, None]: def foo(x: int, *args: P.args, **kwargs: P.kwargs) -> None: f(*args, **kwargs) @@ -1061,7 +1052,7 @@ of that ``ParamSpec``. That allows us to spell things like this: .. code-block:: - def twice(f: Callable[P, int], *args: P.args, **kwargs: P.kwargs) -> int: + def twice[**P](f: Callable[P, int], *args: P.args, **kwargs: P.kwargs) -> int: return f(*args, **kwargs) + f(*args, **kwargs) The type of ``twice`` in the above example is @@ -1101,27 +1092,27 @@ In the same way that a normal type variable is a stand-in for a single type such as ``int``, a type variable *tuple* is a stand-in for a *tuple* type such as ``tuple[int, str]``. -Type variable tuples are created and used with: +In Python 3.12 and newer, type variable tuples can be introduced inline by prefixing +their name with ``*`` inside a type parameter list. :: - from typing import TypeVarTuple + class Array[*Ts]: + ... - Ts = TypeVarTuple('Ts') + def pack[*Ts](*values: *Ts) -> tuple[*Ts]: + ... - class Array(Generic[*Ts]): - ... +Prior to 3.12, the ``TypeVarTuple`` constructor can be used. - def foo(*args: *Ts): - ... +:: -Or when using the built-in syntax for generics in Python 3.12 and higher:: + from typing import TypeVarTuple - class Array[*Ts]: - ... + Ts = TypeVarTuple('Ts') - def foo[*Ts](*args: *Ts): - ... + class Array(Generic[*Ts]): + ... Using Type Variable Tuples in Generic Classes """"""""""""""""""""""""""""""""""""""""""""" @@ -1131,9 +1122,9 @@ Type variable tuples behave like a number of individual type variables packed in :: - Shape = TypeVarTuple('Shape') + from typing import NewType - class Array(Generic[*Shape]): ... + class Array[*Shape]: ... Height = NewType('Height', int) Width = NewType('Width', int) @@ -1143,9 +1134,9 @@ The ``Shape`` type variable tuple here behaves like ``tuple[T1, T2]``, where ``T1`` and ``T2`` are type variables. To use these type variables as type parameters of ``Array``, we must *unpack* the type variable tuple using the star operator: ``*Shape``. The signature of ``Array`` then behaves -as if we had simply written ``class Array(Generic[T1, T2]): ...``. +as if we had simply written ``class Array[T1, T2]: ...``. -In contrast to ``Generic[T1, T2]``, however, ``Generic[*Shape]`` allows +In contrast to ``class Array[T1, T2]``, however, ``class Array[*Shape]`` allows us to parameterize the class with an *arbitrary* number of type parameters. That is, in addition to being able to define rank-2 arrays such as ``Array[Height, Width]``, we could also define rank-3 arrays, rank-4 arrays, @@ -1167,7 +1158,7 @@ signatures and variable annotations: :: - class Array(Generic[*Shape]): + class Array[*Shape]: def __init__(self, shape: tuple[*Shape]): self._shape: tuple[*Shape] = shape @@ -1251,7 +1242,7 @@ Only a single type variable tuple may appear in a type parameter list: :: - class Array(Generic[*Ts1, *Ts2]): ... # Error + class Array[*Ts1, *Ts2]: ... # Error The reason is that multiple type variable tuples make it ambiguous which parameters get bound to which type variable tuple: :: @@ -1266,13 +1257,12 @@ prefixed and/or suffixed: :: - Shape = TypeVarTuple('Shape') Batch = NewType('Batch', int) Channels = NewType('Channels', int) - def add_batch_axis(x: Array[*Shape]) -> Array[Batch, *Shape]: ... - def del_batch_axis(x: Array[Batch, *Shape]) -> Array[*Shape]: ... - def add_batch_channels( + def add_batch_axis[*Shape](x: Array[*Shape]) -> Array[Batch, *Shape]: ... + def del_batch_axis[*Shape](x: Array[Batch, *Shape]) -> Array[*Shape]: ... + def add_batch_channels[*Shape]( x: Array[*Shape] ) -> Array[Batch, *Shape, Channels]: ... @@ -1286,10 +1276,7 @@ Normal ``TypeVar`` instances can also be prefixed and/or suffixed: :: - T = TypeVar('T') - Ts = TypeVarTuple('Ts') - - def prefix_tuple( + def prefix_tuple[T, *Ts]( x: T, y: tuple[*Ts] ) -> tuple[T, *Ts]: ... @@ -1560,8 +1547,8 @@ a similar way to regular type variables: :: - IntTuple = tuple[int, *Ts] - NamedArray = tuple[str, Array[*Ts]] + type IntTuple[*Ts] = tuple[int, *Ts] + type NamedArray[*Ts] = tuple[str, Array[*Ts]] IntTuple[float, bool] # Equivalent to tuple[int, float, bool] NamedArray[Height] # Equivalent to tuple[str, Array[Height]] @@ -1574,15 +1561,14 @@ or datatype: :: - Shape = TypeVarTuple('Shape') - DType = TypeVar('DType') - class Array(Generic[DType, *Shape]): + class Array[DType, *Shape]: + ... # E.g. Float32Array[Height, Width, Channels] - Float32Array = Array[np.float32, *Shape] + type Float32Array[*Shape] = Array[np.float32, *Shape] # E.g. Array1D[np.uint8] - Array1D = Array[DType, Any] + type Array1D[DType] = Array[DType, Any] If an explicitly empty type parameter list is given, the type variable tuple in the alias is set empty: @@ -1612,8 +1598,7 @@ Normal ``TypeVar`` instances can also be used in such aliases: :: - T = TypeVar('T') - Foo = tuple[T, *Ts] + type Foo[T, *Ts] = tuple[T, *Ts] # T bound to str, Ts to tuple[int] Foo[str, int] @@ -1639,11 +1624,8 @@ First, type arguments to generic aliases can be variadic. For example, a :: - Ts1 = TypeVarTuple('Ts1') - Ts2 = TypeVarTuple('Ts2') - - IntTuple = tuple[int, *Ts1] - IntFloatTuple = IntTuple[float, *Ts2] # Valid + type IntTuple[*Ts1] = tuple[int, *Ts1] + type IntFloatTuple[*Ts2] = IntTuple[float, *Ts2] # Valid Here, ``*Ts1`` in the ``IntTuple`` alias is bound to ``tuple[float, *Ts2]``, resulting in an alias ``IntFloatTuple`` equivalent to @@ -1669,9 +1651,7 @@ themselves variadic. For example: :: - T = TypeVar('T') - - IntTuple = tuple[int, T] + type IntTuple[T] = tuple[int, T] IntTuple[str] # Valid IntTuple[*Ts] # NOT valid @@ -1792,11 +1772,9 @@ true of ``TypeVarTuple``\s in the argument list: :: - Ts1 = TypeVarTuple('Ts1') - Ts2 = TypeVarTuple('Ts2') - - Camelot = tuple[T, *Ts1] - Camelot[*Ts2] # NOT valid + type Camelot[T, *Ts] = tuple[T, *Ts] + Camelot[int, *tuple[str, ...]] # Valid + Camelot[*tuple[str, ...]] # NOT valid This is not possible because, unlike in the case of an unpacked arbitrary-length tuple, there is no way to 'peer inside' the ``TypeVarTuple`` to see what its @@ -1811,12 +1789,11 @@ overloads can be used with individual ``TypeVar`` instances in place of the type :: - Shape = TypeVarTuple('Shape') Axis1 = TypeVar('Axis1') Axis2 = TypeVar('Axis2') Axis3 = TypeVar('Axis3') - class Array(Generic[*Shape]): + class Array[*Shape]: @overload def transpose( @@ -1907,13 +1884,11 @@ literal "``...``" or another in-scope ``ParamSpec`` (see `Scoping Rules`_). :: - DefaultP = ParamSpec("DefaultP", default=[str, int]) - - class Foo(Generic[DefaultP]): ... + class Foo[**P = [str, int]]: ... - reveal_type(Foo) # type is type[Foo[DefaultP = [str, int]]] - reveal_type(Foo()) # type is Foo[[str, int]] - reveal_type(Foo[[bool, bool]]()) # type is Foo[[bool, bool]] + reveal_type(Foo) # type is type[Foo[str, int]] + reveal_type(Foo()) # type is Foo[str, int] + reveal_type(Foo[[bool, bool]]()) # type is Foo[bool, bool] ``TypeVarTuple`` Defaults ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1924,11 +1899,9 @@ types or an unpacked, in-scope ``TypeVarTuple`` (see `Scoping Rules`_). :: - DefaultTs = TypeVarTuple("DefaultTs", default=Unpack[tuple[str, int]]) + class Foo[*Ts = *tuple[str, int]]: ... - class Foo(Generic[*DefaultTs]): ... - - reveal_type(Foo) # type is type[Foo[DefaultTs = *tuple[str, int]]] + reveal_type(Foo) # type is type[Foo[str, int]] reveal_type(Foo()) # type is Foo[str, int] reveal_type(Foo[int, bool]()) # type is Foo[int, bool] @@ -2135,10 +2108,7 @@ should be bound to the ``TypeVarTuple`` or the defaulted ``TypeVar``. :: - Ts = TypeVarTuple("Ts") - T = TypeVar("T", default=bool) - - class Foo(Generic[*Ts, T]): ... # Type checker error + class Foo[*Ts, T = bool]: ... # Type checker error # Could be reasonably interpreted as either Ts = (int, str, float), T = bool # or Ts = (int, str), T = float @@ -2150,13 +2120,10 @@ for the ``ParamSpec`` and one for the ``TypeVarTuple``. :: - Ts = TypeVarTuple("Ts") - P = ParamSpec("P", default=[float, bool]) - - class Foo(Generic[*Ts, P]): ... # Valid + class Foo[*Ts = *tuple[int, str], **P = [float, bool]]: ... # Valid - Foo[int, str] # Ts = (int, str), P = [float, bool] - Foo[int, str, [bytes]] # Ts = (int, str), P = [bytes] + Foo[int, str] # Ts = (int, str), P = [float, bool] + Foo[int, str, [bytes]] # Ts = (int, str), P = [bytes] Binding rules """"""""""""" diff --git a/docs/spec/literal.rst b/docs/spec/literal.rst index 1e820a63f..7b0015ca3 100644 --- a/docs/spec/literal.rst +++ b/docs/spec/literal.rst @@ -397,14 +397,10 @@ Literal types are types, and can be used anywhere a type is expected. For example, it is legal to parameterize generic functions or classes using Literal types:: - A = TypeVar('A', bound=int) - B = TypeVar('B', bound=int) - C = TypeVar('C', bound=int) - # A simplified definition for Matrix[row, column] - class Matrix(Generic[A, B]): + class Matrix[A: int, B: int]: def __add__(self, other: Matrix[A, B]) -> Matrix[A, B]: ... - def __matmul__(self, other: Matrix[B, C]) -> Matrix[A, C]: ... + def __matmul__[C: int](self, other: Matrix[B, C]) -> Matrix[A, C]: ... def transpose(self) -> Matrix[B, A]: ... foo: Matrix[Literal[2], Literal[3]] = Matrix(...) @@ -413,11 +409,14 @@ classes using Literal types:: baz = foo @ bar reveal_type(baz) # Revealed type is 'Matrix[Literal[2], Literal[7]]' -Similarly, it is legal to construct TypeVars with value restrictions +Similarly, it is legal to use type variables with value restrictions or bounds involving Literal types:: - T = TypeVar('T', Literal["a"], Literal["b"], Literal["c"]) - S = TypeVar('S', bound=Literal["foo"]) + def takes_letter[T: (Literal["a"], Literal["b"], Literal["c"])](value: T) -> T: + return value + + def takes_foo[S: Literal["foo"]](value: S) -> S: + return value ...although it is unclear when it would ever be useful to construct a TypeVar with a Literal upper bound. For example, the ``S`` TypeVar in @@ -562,7 +561,8 @@ Valid locations for ``LiteralString`` type_argument: List[LiteralString] - T = TypeVar("T", bound=LiteralString) + def enforce_literal[T: LiteralString](value: T) -> T: + return value It cannot be nested within unions of ``Literal`` types: @@ -733,18 +733,16 @@ Conditional statements and expressions work as expected: return result # OK -Interaction with TypeVars and Generics -"""""""""""""""""""""""""""""""""""""" +Interaction with Type Variables and Generics +"""""""""""""""""""""""""""""""""""""""""""" -TypeVars can be bound to ``LiteralString``: +Type variables can use ``LiteralString`` as an upper bound: :: - from typing import Literal, LiteralString, TypeVar - - TLiteral = TypeVar("TLiteral", bound=LiteralString) + from typing import Literal, LiteralString - def literal_identity(s: TLiteral) -> TLiteral: + def literal_identity[T: LiteralString](s: T) -> T: return s hello: Literal["hello"] = "hello" @@ -757,14 +755,14 @@ TypeVars can be bound to ``LiteralString``: s_error: str literal_identity(s_error) - # Error: Expected TLiteral (bound to LiteralString), got str. + # Error: Expected T (bound to LiteralString), got str. ``LiteralString`` can be used as a type argument for generic classes: :: - class Container(Generic[T]): + class Container[T]: def __init__(self, value: T) -> None: self.value = value diff --git a/docs/spec/narrowing.rst b/docs/spec/narrowing.rst index 27094e94c..6199aa092 100644 --- a/docs/spec/narrowing.rst +++ b/docs/spec/narrowing.rst @@ -34,9 +34,7 @@ User-defined type guards can be generic functions, as shown in this example: :: - _T = TypeVar("_T") - - def is_two_element_tuple(val: Tuple[_T, ...]) -> TypeGuard[tuple[_T, _T]]: + def is_two_element_tuple[T](val: tuple[T, ...]) -> TypeGuard[tuple[T, T]]: return len(val) == 2 def func(names: tuple[str, ...]): @@ -65,9 +63,7 @@ than one argument: return allow_empty return all(isinstance(x, str) for x in val) - _T = TypeVar("_T") - - def is_set_of(val: set[Any], type: type[_T]) -> TypeGuard[Set[_T]]: + def is_set_of[T](val: set[Any], type: type[T]) -> TypeGuard[set[T]]: return all(isinstance(x, type) for x in val) diff --git a/docs/spec/overload.rst b/docs/spec/overload.rst index 52982c54a..7d9ef1bc1 100644 --- a/docs/spec/overload.rst +++ b/docs/spec/overload.rst @@ -40,28 +40,29 @@ Another example where ``@overload`` comes in handy is the type of the builtin ``map()`` function, which takes a different number of arguments depending on the type of the callable:: - from typing import TypeVar, overload + from typing import overload from collections.abc import Callable, Iterable, Iterator - T1 = TypeVar('T1') - T2 = TypeVar('T2') - S = TypeVar('S') - @overload - def map(func: Callable[[T1], S], iter1: Iterable[T1]) -> Iterator[S]: ... + def map[T1, S](func: Callable[[T1], S], iter1: Iterable[T1]) -> Iterator[S]: ... @overload - def map(func: Callable[[T1, T2], S], - iter1: Iterable[T1], iter2: Iterable[T2]) -> Iterator[S]: ... + def map[T1, T2, S]( + func: Callable[[T1, T2], S], + iter1: Iterable[T1], + iter2: Iterable[T2], + ) -> Iterator[S]: ... # ... and we could add more items to support more than two iterables Note that we could also easily add items to support ``map(None, ...)``:: @overload - def map(func: None, iter1: Iterable[T1]) -> Iterable[T1]: ... + def map[T1](func: None, iter1: Iterable[T1]) -> Iterable[T1]: ... @overload - def map(func: None, - iter1: Iterable[T1], - iter2: Iterable[T2]) -> Iterable[tuple[T1, T2]]: ... + def map[T1, T2]( + func: None, + iter1: Iterable[T1], + iter2: Iterable[T2], + ) -> Iterable[tuple[T1, T2]]: ... Uses of the ``@overload`` decorator as shown above are suitable for stub files. In regular modules, a series of ``@overload``-decorated @@ -91,11 +92,7 @@ A constrained ``TypeVar`` type can sometimes be used instead of using the ``@overload`` decorator. For example, the definitions of ``concat1`` and ``concat2`` in this stub file are equivalent:: - from typing import TypeVar - - AnyStr = TypeVar('AnyStr', str, bytes) - - def concat1(x: AnyStr, y: AnyStr) -> AnyStr: ... + def concat1[S: (str, bytes)](x: S, y: S) -> S: ... @overload def concat2(x: str, y: str) -> str: ... @@ -107,13 +104,13 @@ be represented precisely using type variables. We recommend that ``@overload`` is only used in cases where a type variable is not sufficient. -Another important difference between type variables such as ``AnyStr`` -and using ``@overload`` is that the prior can also be used to define -constraints for generic class type parameters. For example, the type -parameter of the generic class ``typing.IO`` is constrained (only -``IO[str]``, ``IO[bytes]`` and ``IO[Any]`` are valid):: +Another important difference between type variables and an ``@overload`` +is that the former can also be used to define constraints for generic +class type parameters. For example, the type parameter of the generic +class ``typing.IO`` is constrained (only ``IO[str]``, ``IO[bytes]`` +and ``IO[Any]`` are valid):: - class IO(Generic[AnyStr]): ... + class IO[S: (str, bytes)]: ... Invalid overload definitions diff --git a/docs/spec/protocol.rst b/docs/spec/protocol.rst index 39e7a82a6..2803da0a6 100644 --- a/docs/spec/protocol.rst +++ b/docs/spec/protocol.rst @@ -266,15 +266,15 @@ Generic protocols are important. For example, ``SupportsAbs``, ``Iterable`` and ``Iterator`` are generic protocols. They are defined similar to normal non-protocol generic types:: - class Iterable(Protocol[T]): + class Iterable[T](Protocol): @abstractmethod def __iter__(self) -> Iterator[T]: ... -``Protocol[T, S, ...]`` is allowed as a shorthand for -``Protocol, Generic[T, S, ...]``. It is an error to combine -``Protocol[T, S, ...]`` with ``Generic[T, S, ...]``, or with the new syntax for -generic classes in Python 3.12 and above:: +The older (pre-3.12) syntax ``Protocol[T, S, ...]`` remains available as a +shorthand for ``Protocol, Generic[T, S, ...]``. It is an error to combine the +shorthand with ``Generic[T, S, ...]`` or to mix it with the new +``class Iterable[T]`` form:: class Iterable(Protocol[T], Generic[T]): # INVALID ... @@ -282,9 +282,10 @@ generic classes in Python 3.12 and above:: class Iterable[T](Protocol[T]): # INVALID ... -User-defined generic protocols support explicitly declared variance. -Type checkers will warn if the inferred variance is different from -the declared variance. Examples:: +When using the generics syntax introduced in Python 3.12, the variance of +type variables is inferred. When using the pre-3.12 generics syntax, variance +must be specified (unless ``infer_variance=True`` is used). Type checkers will +warn if the declared variance does not match the protocol definition. Examples:: T = TypeVar('T') T_co = TypeVar('T_co', covariant=True) @@ -362,17 +363,15 @@ Self-types in protocols The self-types in protocols follow the :ref:`rules for other methods `. For example:: - C = TypeVar('C', bound='Copyable') class Copyable(Protocol): - def copy(self: C) -> C: + def copy[C: Copyable](self: C) -> C: class One: def copy(self) -> 'One': ... - T = TypeVar('T', bound='Other') class Other: - def copy(self: T) -> T: + def copy[T: Other](self: T) -> T: ... c: Copyable @@ -407,8 +406,7 @@ corresponding protocols are *not imported*:: # file lib.py from collections.abc import Sized - T = TypeVar('T', contravariant=True) - class ListLike(Sized, Protocol[T]): + class ListLike[T](Sized, Protocol): def append(self, x: T) -> None: pass @@ -535,13 +533,12 @@ illusion that a distinct type is provided:: In contrast, type aliases are fully supported, including generic type aliases:: - from typing import TypeVar from collections.abc import Reversible, Iterable, Sized - T = TypeVar('T') - class SizedIterable(Iterable[T], Sized, Protocol): + class SizedIterable[T](Iterable[T], Sized, Protocol): pass - CompatReversible = Reversible[T] | SizedIterable[T] + + type CompatReversible[T] = Reversible[T] | SizedIterable[T] Modules as implementations of protocols diff --git a/docs/spec/qualifiers.rst b/docs/spec/qualifiers.rst index d6105c7b2..6814692e0 100644 --- a/docs/spec/qualifiers.rst +++ b/docs/spec/qualifiers.rst @@ -292,11 +292,8 @@ Here are the specific details of the syntax: * ``Annotated`` can be used in definition of nested and generic aliases, but only if it wraps a :term:`type expression`:: - T = TypeVar("T") - Vec = Annotated[list[tuple[T, T]], MaxLen(10)] - V = Vec[int] - - V == Annotated[list[tuple[int, int]], MaxLen(10)] + type Vec[T] = Annotated[list[tuple[T, T]], MaxLen(10)] + type V = Vec[int] # Annotated[list[tuple[int, int]], MaxLen(10)] * As with most :term:`special forms `, ``Annotated`` is not assignable to ``type`` or ``type[T]``:: diff --git a/docs/spec/special-types.rst b/docs/spec/special-types.rst index ce6f336bc..dbec130c4 100644 --- a/docs/spec/special-types.rst +++ b/docs/spec/special-types.rst @@ -152,8 +152,7 @@ would be:: However using ``type[]`` and a type variable with an upper bound we can do much better:: - U = TypeVar('U', bound=User) - def new_user(user_class: type[U]) -> U: + def new_user[U: User](user_class: type[U]) -> U: ... Now when we call ``new_user()`` with a specific subclass of ``User`` a From 663d608bf3ca611af32dfd69f33e2a6ea97a8ecb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Oct 2025 19:07:06 +0200 Subject: [PATCH 138/308] Bump actions/setup-python from 5 to 6 in the actions group (#2091) --- .github/workflows/build-docs.yml | 2 +- .github/workflows/ci.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index bf21d242f..f52bb3404 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -15,7 +15,7 @@ jobs: steps: - uses: actions/checkout@v5 - name: Set up Python - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: 3.9 - name: Install dependencies diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8b36a5875..588675f71 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ jobs: steps: - uses: actions/checkout@v5 - name: Set up Python 3 - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: 3 cache: "pip" From e7ad24c88011a0ebbf7e1cc92bdecdb083366cb6 Mon Sep 17 00:00:00 2001 From: David Peter Date: Wed, 8 Oct 2025 20:54:11 +0200 Subject: [PATCH 139/308] Remove tests with invalid syntax (Python 3.14) (#2093) --- .../results/mypy/qualifiers_annotated.toml | 48 +++++++++--------- .../results/pyre/qualifiers_annotated.toml | 48 +++++++++--------- .../results/pyrefly/qualifiers_annotated.toml | 44 ++++++++-------- .../results/pyright/qualifiers_annotated.toml | 50 +++++++++---------- .../results/zuban/qualifiers_annotated.toml | 38 +++++++------- conformance/src/type_checker.py | 2 +- conformance/tests/qualifiers_annotated.py | 5 -- 7 files changed, 115 insertions(+), 120 deletions(-) diff --git a/conformance/results/mypy/qualifiers_annotated.toml b/conformance/results/mypy/qualifiers_annotated.toml index c21e2043d..6fba939f9 100644 --- a/conformance/results/mypy/qualifiers_annotated.toml +++ b/conformance/results/mypy/qualifiers_annotated.toml @@ -7,33 +7,33 @@ Does not reject type[T] compatibility for type alias defined with Annotated. Does not reject call of type alias defined with Annotated. """ output = """ -qualifiers_annotated.py:43: error: Bracketed expression "[...]" is not valid as a type [valid-type] -qualifiers_annotated.py:44: error: Syntax error in type annotation [syntax] -qualifiers_annotated.py:44: note: Suggestion: Is there a spurious trailing comma? -qualifiers_annotated.py:45: error: Invalid type comment or annotation [valid-type] -qualifiers_annotated.py:46: error: Inline TypedDict is experimental, must be enabled with --enable-incomplete-feature=InlineTypedDict [misc] -qualifiers_annotated.py:46: error: Name "b" is not defined [name-defined] -qualifiers_annotated.py:47: error: Invalid type comment or annotation [valid-type] +qualifiers_annotated.py:38: error: Bracketed expression "[...]" is not valid as a type [valid-type] +qualifiers_annotated.py:39: error: Syntax error in type annotation [syntax] +qualifiers_annotated.py:39: note: Suggestion: Is there a spurious trailing comma? +qualifiers_annotated.py:40: error: Invalid type comment or annotation [valid-type] +qualifiers_annotated.py:41: error: Inline TypedDict is experimental, must be enabled with --enable-incomplete-feature=InlineTypedDict [misc] +qualifiers_annotated.py:41: error: Name "b" is not defined [name-defined] +qualifiers_annotated.py:42: error: Invalid type comment or annotation [valid-type] +qualifiers_annotated.py:43: error: Invalid type comment or annotation [valid-type] +qualifiers_annotated.py:44: error: Invalid type comment or annotation [valid-type] +qualifiers_annotated.py:45: error: Name "var1" is not defined [name-defined] +qualifiers_annotated.py:46: error: Invalid type: try using Literal[True] instead? [valid-type] +qualifiers_annotated.py:47: error: Invalid type: try using Literal[1] instead? [valid-type] qualifiers_annotated.py:48: error: Invalid type comment or annotation [valid-type] qualifiers_annotated.py:49: error: Invalid type comment or annotation [valid-type] -qualifiers_annotated.py:50: error: Name "var1" is not defined [name-defined] -qualifiers_annotated.py:51: error: Invalid type: try using Literal[True] instead? [valid-type] -qualifiers_annotated.py:52: error: Invalid type: try using Literal[1] instead? [valid-type] -qualifiers_annotated.py:53: error: Invalid type comment or annotation [valid-type] -qualifiers_annotated.py:54: error: Invalid type comment or annotation [valid-type] -qualifiers_annotated.py:64: error: Annotated[...] must have exactly one type argument and at least one annotation [valid-type] -qualifiers_annotated.py:76: error: Incompatible types in assignment (expression has type "", variable has type "type[Any]") [assignment] -qualifiers_annotated.py:84: error: Argument 1 to "func4" has incompatible type ""; expected "type[Never]" [arg-type] -qualifiers_annotated.py:91: error: "" not callable [operator] -qualifiers_annotated.py:92: error: "" not callable [operator] -qualifiers_annotated.py:98: error: Invalid type: ClassVar nested inside other type [valid-type] -qualifiers_annotated.py:100: error: Final can be only used as an outermost qualifier in a variable annotation [valid-type] +qualifiers_annotated.py:59: error: Annotated[...] must have exactly one type argument and at least one annotation [valid-type] +qualifiers_annotated.py:71: error: Incompatible types in assignment (expression has type "", variable has type "type[Any]") [assignment] +qualifiers_annotated.py:79: error: Argument 1 to "func4" has incompatible type ""; expected "type[Never]" [arg-type] +qualifiers_annotated.py:86: error: "" not callable [operator] +qualifiers_annotated.py:87: error: "" not callable [operator] +qualifiers_annotated.py:93: error: Invalid type: ClassVar nested inside other type [valid-type] +qualifiers_annotated.py:95: error: Final can be only used as an outermost qualifier in a variable annotation [valid-type] """ conformance_automated = "Fail" errors_diff = """ -Line 77: Expected 1 errors -Line 85: Expected 1 errors -Line 93: Expected 1 errors -Line 98: Unexpected errors ['qualifiers_annotated.py:98: error: Invalid type: ClassVar nested inside other type [valid-type]'] -Line 100: Unexpected errors ['qualifiers_annotated.py:100: error: Final can be only used as an outermost qualifier in a variable annotation [valid-type]'] +Line 72: Expected 1 errors +Line 80: Expected 1 errors +Line 88: Expected 1 errors +Line 93: Unexpected errors ['qualifiers_annotated.py:93: error: Invalid type: ClassVar nested inside other type [valid-type]'] +Line 95: Unexpected errors ['qualifiers_annotated.py:95: error: Final can be only used as an outermost qualifier in a variable annotation [valid-type]'] """ diff --git a/conformance/results/pyre/qualifiers_annotated.toml b/conformance/results/pyre/qualifiers_annotated.toml index c92e8f39c..160686638 100644 --- a/conformance/results/pyre/qualifiers_annotated.toml +++ b/conformance/results/pyre/qualifiers_annotated.toml @@ -4,31 +4,31 @@ Does not reject Annotated with a single parameter. Does not reject call of Annotated with no type arguments. """ output = """ -qualifiers_annotated.py:43:6 Undefined or invalid type [11]: Annotation `` is not defined as a type. -qualifiers_annotated.py:44:6 Invalid type [31]: Expression `typing.Annotated[(((int, str)), "")]` is not a valid type. -qualifiers_annotated.py:45:6 Invalid type [31]: Expression `typing.Annotated[(comprehension(int for generators(generator(i in range(1) if ))), "")]` is not a valid type. -qualifiers_annotated.py:46:6 Invalid type [31]: Expression `typing.Annotated[({ "a":"b" }, "")]` is not a valid type. -qualifiers_annotated.py:47:6 Invalid type [31]: Expression `typing.Annotated[(lambda () (int)(), "")]` is not a valid type. -qualifiers_annotated.py:48:6 Invalid type [31]: Expression `typing.Annotated[([int][0], "")]` is not a valid type. -qualifiers_annotated.py:49:6 Invalid type [31]: Expression `typing.Annotated[(int if 1 < 3 else str, "")]` is not a valid type. -qualifiers_annotated.py:50:16 Unbound name [10]: Name `var1` is used but not defined in the current scope. -qualifiers_annotated.py:51:6 Invalid type [31]: Expression `typing.Annotated[(True, "")]` is not a valid type. -qualifiers_annotated.py:52:7 Invalid type [31]: Expression `typing.Annotated[(1, "")]` is not a valid type. -qualifiers_annotated.py:53:7 Invalid type [31]: Expression `typing.Annotated[(list or set, "")]` is not a valid type. -qualifiers_annotated.py:54:7 Invalid type [31]: Expression `typing.Annotated[(f"{"int"}", "")]` is not a valid type. -qualifiers_annotated.py:64:7 Invalid type parameters [24]: Generic type `Annotated` expects at least 2 type parameters, received 1. -qualifiers_annotated.py:77:0 Incompatible variable type [9]: not_type2 is declared to have type `Type[typing.Any]` but is used as type `TypeAlias`. -qualifiers_annotated.py:85:6 Incompatible parameter type [6]: In call `func4`, for 1st positional argument, expected `Type[Variable[T]]` but got `TypeAlias`. -qualifiers_annotated.py:91:0 Invalid class instantiation [45]: `Annotated` cannot be instantiated. -qualifiers_annotated.py:93:0 Call error [29]: `TypeAlias` is not a function. -qualifiers_annotated.py:105:4 Undefined attribute [16]: `typing.Type` has no attribute `a`. -qualifiers_annotated.py:106:4 Undefined attribute [16]: `typing.Type` has no attribute `b`. +qualifiers_annotated.py:38:6 Undefined or invalid type [11]: Annotation `` is not defined as a type. +qualifiers_annotated.py:39:6 Invalid type [31]: Expression `typing.Annotated[(((int, str)), "")]` is not a valid type. +qualifiers_annotated.py:40:6 Invalid type [31]: Expression `typing.Annotated[(comprehension(int for generators(generator(i in range(1) if ))), "")]` is not a valid type. +qualifiers_annotated.py:41:6 Invalid type [31]: Expression `typing.Annotated[({ "a":"b" }, "")]` is not a valid type. +qualifiers_annotated.py:42:6 Invalid type [31]: Expression `typing.Annotated[(lambda () (int)(), "")]` is not a valid type. +qualifiers_annotated.py:43:6 Invalid type [31]: Expression `typing.Annotated[([int][0], "")]` is not a valid type. +qualifiers_annotated.py:44:6 Invalid type [31]: Expression `typing.Annotated[(int if 1 < 3 else str, "")]` is not a valid type. +qualifiers_annotated.py:45:16 Unbound name [10]: Name `var1` is used but not defined in the current scope. +qualifiers_annotated.py:46:6 Invalid type [31]: Expression `typing.Annotated[(True, "")]` is not a valid type. +qualifiers_annotated.py:47:7 Invalid type [31]: Expression `typing.Annotated[(1, "")]` is not a valid type. +qualifiers_annotated.py:48:7 Invalid type [31]: Expression `typing.Annotated[(list or set, "")]` is not a valid type. +qualifiers_annotated.py:49:7 Invalid type [31]: Expression `typing.Annotated[(f"{"int"}", "")]` is not a valid type. +qualifiers_annotated.py:59:7 Invalid type parameters [24]: Generic type `Annotated` expects at least 2 type parameters, received 1. +qualifiers_annotated.py:72:0 Incompatible variable type [9]: not_type2 is declared to have type `Type[typing.Any]` but is used as type `TypeAlias`. +qualifiers_annotated.py:80:6 Incompatible parameter type [6]: In call `func4`, for 1st positional argument, expected `Type[Variable[T]]` but got `TypeAlias`. +qualifiers_annotated.py:86:0 Invalid class instantiation [45]: `Annotated` cannot be instantiated. +qualifiers_annotated.py:88:0 Call error [29]: `TypeAlias` is not a function. +qualifiers_annotated.py:100:4 Undefined attribute [16]: `typing.Type` has no attribute `a`. +qualifiers_annotated.py:101:4 Undefined attribute [16]: `typing.Type` has no attribute `b`. """ conformance_automated = "Fail" errors_diff = """ -Line 76: Expected 1 errors -Line 84: Expected 1 errors -Line 92: Expected 1 errors -Line 105: Unexpected errors ['qualifiers_annotated.py:105:4 Undefined attribute [16]: `typing.Type` has no attribute `a`.'] -Line 106: Unexpected errors ['qualifiers_annotated.py:106:4 Undefined attribute [16]: `typing.Type` has no attribute `b`.'] +Line 71: Expected 1 errors +Line 79: Expected 1 errors +Line 87: Expected 1 errors +Line 100: Unexpected errors ['qualifiers_annotated.py:100:4 Undefined attribute [16]: `typing.Type` has no attribute `a`.'] +Line 101: Unexpected errors ['qualifiers_annotated.py:101:4 Undefined attribute [16]: `typing.Type` has no attribute `b`.'] """ diff --git a/conformance/results/pyrefly/qualifiers_annotated.toml b/conformance/results/pyrefly/qualifiers_annotated.toml index 9915217f2..6b383cda3 100644 --- a/conformance/results/pyrefly/qualifiers_annotated.toml +++ b/conformance/results/pyrefly/qualifiers_annotated.toml @@ -4,28 +4,28 @@ Allows Annotated in some contexts where it should not be allowed """ conformance_automated = "Fail" errors_diff = """ -Line 76: Expected 1 errors -Line 77: Expected 1 errors -Line 84: Expected 1 errors -Line 85: Expected 1 errors -Line 92: Expected 1 errors -Line 93: Expected 1 errors +Line 71: Expected 1 errors +Line 72: Expected 1 errors +Line 79: Expected 1 errors +Line 80: Expected 1 errors +Line 87: Expected 1 errors +Line 88: Expected 1 errors """ output = """ -ERROR qualifiers_annotated.py:43:17-27: list literal cannot be used in annotations [invalid-annotation] -ERROR qualifiers_annotated.py:44:17-30: tuple literal cannot be used in annotations [invalid-annotation] -ERROR qualifiers_annotated.py:45:17-40: list comprehension cannot be used in annotations [invalid-annotation] -ERROR qualifiers_annotated.py:46:17-27: dict literal cannot be used in annotations [invalid-annotation] -ERROR qualifiers_annotated.py:46:19-20: Could not find name `a` [unknown-name] -ERROR qualifiers_annotated.py:46:24-25: Could not find name `b` [unknown-name] -ERROR qualifiers_annotated.py:47:17-32: function call cannot be used in annotations [invalid-annotation] -ERROR qualifiers_annotated.py:48:17-25: invalid subscript expression cannot be used in annotations [invalid-annotation] -ERROR qualifiers_annotated.py:49:17-38: if expression cannot be used in annotations [invalid-annotation] -ERROR qualifiers_annotated.py:50:17-21: Could not find name `var1` [unknown-name] -ERROR qualifiers_annotated.py:51:17-21: bool literal cannot be used in annotations [invalid-annotation] -ERROR qualifiers_annotated.py:52:18-19: number literal cannot be used in annotations [invalid-annotation] -ERROR qualifiers_annotated.py:53:18-29: boolean operation cannot be used in annotations [invalid-annotation] -ERROR qualifiers_annotated.py:54:18-28: f-string cannot be used in annotations [invalid-annotation] -ERROR qualifiers_annotated.py:64:8-22: `Annotated` needs at least one piece of metadata in addition to the type [invalid-annotation] -ERROR qualifiers_annotated.py:91:1-10: Expected a callable, got type[Annotated] [not-callable] +ERROR qualifiers_annotated.py:38:17-27: list literal cannot be used in annotations [invalid-annotation] +ERROR qualifiers_annotated.py:39:17-30: tuple literal cannot be used in annotations [invalid-annotation] +ERROR qualifiers_annotated.py:40:17-40: list comprehension cannot be used in annotations [invalid-annotation] +ERROR qualifiers_annotated.py:41:17-27: dict literal cannot be used in annotations [invalid-annotation] +ERROR qualifiers_annotated.py:41:19-20: Could not find name `a` [unknown-name] +ERROR qualifiers_annotated.py:41:24-25: Could not find name `b` [unknown-name] +ERROR qualifiers_annotated.py:42:17-32: function call cannot be used in annotations [invalid-annotation] +ERROR qualifiers_annotated.py:43:17-25: invalid subscript expression cannot be used in annotations [invalid-annotation] +ERROR qualifiers_annotated.py:44:17-38: if expression cannot be used in annotations [invalid-annotation] +ERROR qualifiers_annotated.py:45:17-21: Could not find name `var1` [unknown-name] +ERROR qualifiers_annotated.py:46:17-21: bool literal cannot be used in annotations [invalid-annotation] +ERROR qualifiers_annotated.py:47:18-19: number literal cannot be used in annotations [invalid-annotation] +ERROR qualifiers_annotated.py:48:18-29: boolean operation cannot be used in annotations [invalid-annotation] +ERROR qualifiers_annotated.py:49:18-28: f-string cannot be used in annotations [invalid-annotation] +ERROR qualifiers_annotated.py:59:8-22: `Annotated` needs at least one piece of metadata in addition to the type [invalid-annotation] +ERROR qualifiers_annotated.py:86:1-10: Expected a callable, got `type[Annotated]` [not-callable] """ diff --git a/conformance/results/pyright/qualifiers_annotated.toml b/conformance/results/pyright/qualifiers_annotated.toml index c7f60d828..0e49034de 100644 --- a/conformance/results/pyright/qualifiers_annotated.toml +++ b/conformance/results/pyright/qualifiers_annotated.toml @@ -1,36 +1,36 @@ conformant = "Pass" output = """ -qualifiers_annotated.py:43:17 - error: List expression not allowed for this type argument (reportInvalidTypeForm) -qualifiers_annotated.py:44:17 - error: Expected class but received "tuple[tuple[type[int], type[str]]]" (reportGeneralTypeIssues) -qualifiers_annotated.py:45:17 - error: List expression not allowed for this type argument (reportInvalidTypeForm) -qualifiers_annotated.py:45:18 - error: Expected class but received "Generator[type[int], None, None]" (reportGeneralTypeIssues) -qualifiers_annotated.py:46:17 - error: Expected class but received "dict[str, Unknown]" (reportGeneralTypeIssues) -qualifiers_annotated.py:46:17 - error: Dictionary expression not allowed in type expression (reportInvalidTypeForm) -qualifiers_annotated.py:46:24 - error: "b" is not defined (reportUndefinedVariable) -qualifiers_annotated.py:47:17 - error: Call expression not allowed in type expression (reportInvalidTypeForm) -qualifiers_annotated.py:48:17 - error: List expression not allowed in type expression +qualifiers_annotated.py:38:17 - error: List expression not allowed for this type argument (reportInvalidTypeForm) +qualifiers_annotated.py:39:17 - error: Expected class but received "tuple[tuple[type[int], type[str]]]" (reportGeneralTypeIssues) +qualifiers_annotated.py:40:17 - error: List expression not allowed for this type argument (reportInvalidTypeForm) +qualifiers_annotated.py:40:18 - error: Expected class but received "Generator[type[int], None, None]" (reportGeneralTypeIssues) +qualifiers_annotated.py:41:17 - error: Expected class but received "dict[str, Unknown]" (reportGeneralTypeIssues) +qualifiers_annotated.py:41:17 - error: Dictionary expression not allowed in type expression (reportInvalidTypeForm) +qualifiers_annotated.py:41:24 - error: "b" is not defined (reportUndefinedVariable) +qualifiers_annotated.py:42:17 - error: Call expression not allowed in type expression (reportInvalidTypeForm) +qualifiers_annotated.py:43:17 - error: List expression not allowed in type expression   Use list[T] to indicate a list type or T1 | T2 to indicate a union type (reportInvalidTypeForm) -qualifiers_annotated.py:48:17 - error: Expected class but received "list[type[int]]" (reportGeneralTypeIssues) -qualifiers_annotated.py:48:23 - error: Expected class but received "Literal[0]" (reportGeneralTypeIssues) -qualifiers_annotated.py:49:17 - error: Ternary expression not allowed in type expression (reportInvalidTypeForm) -qualifiers_annotated.py:50:17 - error: "var1" is not defined (reportUndefinedVariable) -qualifiers_annotated.py:51:17 - error: Expected class but received "Literal[True]" (reportGeneralTypeIssues) -qualifiers_annotated.py:52:18 - error: Expected class but received "Literal[1]" (reportGeneralTypeIssues) -qualifiers_annotated.py:53:18 - error: Binary operator not allowed in type expression (reportInvalidTypeForm) -qualifiers_annotated.py:54:18 - error: Type expressions cannot use format string literals (f-strings) (reportGeneralTypeIssues) -qualifiers_annotated.py:64:8 - error: Expected one type argument and one or more annotations for "Annotated" (reportInvalidTypeForm) -qualifiers_annotated.py:76:24 - error: Type "Annotated" is not assignable to declared type "type[Any]" +qualifiers_annotated.py:43:17 - error: Expected class but received "list[type[int]]" (reportGeneralTypeIssues) +qualifiers_annotated.py:43:23 - error: Expected class but received "Literal[0]" (reportGeneralTypeIssues) +qualifiers_annotated.py:44:17 - error: Ternary expression not allowed in type expression (reportInvalidTypeForm) +qualifiers_annotated.py:45:17 - error: "var1" is not defined (reportUndefinedVariable) +qualifiers_annotated.py:46:17 - error: Expected class but received "Literal[True]" (reportGeneralTypeIssues) +qualifiers_annotated.py:47:18 - error: Expected class but received "Literal[1]" (reportGeneralTypeIssues) +qualifiers_annotated.py:48:18 - error: Binary operator not allowed in type expression (reportInvalidTypeForm) +qualifiers_annotated.py:49:18 - error: Type expressions cannot use format string literals (f-strings) (reportGeneralTypeIssues) +qualifiers_annotated.py:59:8 - error: Expected one type argument and one or more annotations for "Annotated" (reportInvalidTypeForm) +qualifiers_annotated.py:71:24 - error: Type "Annotated" is not assignable to declared type "type[Any]"   "Annotated" is not assignable to "type[Any]" (reportAssignmentType) -qualifiers_annotated.py:77:24 - error: Type "SmallInt" is not assignable to declared type "type[Any]" +qualifiers_annotated.py:72:24 - error: Type "SmallInt" is not assignable to declared type "type[Any]"   "Annotated" is not assignable to "type[Any]" (reportAssignmentType) -qualifiers_annotated.py:84:7 - error: Argument of type "Annotated" cannot be assigned to parameter "x" of type "type[T@func4]" in function "func4" +qualifiers_annotated.py:79:7 - error: Argument of type "Annotated" cannot be assigned to parameter "x" of type "type[T@func4]" in function "func4"   Type "Annotated" is not assignable to type "type[T@func4]" (reportArgumentType) -qualifiers_annotated.py:85:7 - error: Argument of type "SmallInt" cannot be assigned to parameter "x" of type "type[T@func4]" in function "func4" +qualifiers_annotated.py:80:7 - error: Argument of type "SmallInt" cannot be assigned to parameter "x" of type "type[T@func4]" in function "func4"   Type "Annotated" is not assignable to type "type[T@func4]" (reportArgumentType) -qualifiers_annotated.py:91:1 - error: "Annotated" cannot be instantiated (reportCallIssue) -qualifiers_annotated.py:92:1 - error: Object of type "Annotated" is not callable +qualifiers_annotated.py:86:1 - error: "Annotated" cannot be instantiated (reportCallIssue) +qualifiers_annotated.py:87:1 - error: Object of type "Annotated" is not callable   Attribute "__call__" is unknown (reportCallIssue) -qualifiers_annotated.py:93:1 - error: Object of type "Annotated" is not callable (reportCallIssue) +qualifiers_annotated.py:88:1 - error: Object of type "Annotated" is not callable (reportCallIssue) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/zuban/qualifiers_annotated.toml b/conformance/results/zuban/qualifiers_annotated.toml index 76e441230..03e563a7a 100644 --- a/conformance/results/zuban/qualifiers_annotated.toml +++ b/conformance/results/zuban/qualifiers_annotated.toml @@ -2,26 +2,26 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -qualifiers_annotated.py:43: error: Bracketed expression "[...]" is not valid as a type [valid-type] -qualifiers_annotated.py:43: note: Did you mean "List[...]"? -qualifiers_annotated.py:44: error: Syntax error in type annotation [valid-type] -qualifiers_annotated.py:44: note: Suggestion: Is there a spurious trailing comma? -qualifiers_annotated.py:45: error: Invalid type comment or annotation [valid-type] +qualifiers_annotated.py:38: error: Bracketed expression "[...]" is not valid as a type [valid-type] +qualifiers_annotated.py:38: note: Did you mean "List[...]"? +qualifiers_annotated.py:39: error: Syntax error in type annotation [valid-type] +qualifiers_annotated.py:39: note: Suggestion: Is there a spurious trailing comma? +qualifiers_annotated.py:40: error: Invalid type comment or annotation [valid-type] +qualifiers_annotated.py:41: error: Invalid type comment or annotation [valid-type] +qualifiers_annotated.py:42: error: Invalid type comment or annotation [valid-type] +qualifiers_annotated.py:43: error: Invalid type comment or annotation [valid-type] +qualifiers_annotated.py:44: error: Invalid type comment or annotation [valid-type] +qualifiers_annotated.py:45: error: Name "var1" is not defined [name-defined] qualifiers_annotated.py:46: error: Invalid type comment or annotation [valid-type] -qualifiers_annotated.py:47: error: Invalid type comment or annotation [valid-type] +qualifiers_annotated.py:47: error: Invalid type: try using Literal[1] instead? [valid-type] qualifiers_annotated.py:48: error: Invalid type comment or annotation [valid-type] qualifiers_annotated.py:49: error: Invalid type comment or annotation [valid-type] -qualifiers_annotated.py:50: error: Name "var1" is not defined [name-defined] -qualifiers_annotated.py:51: error: Invalid type comment or annotation [valid-type] -qualifiers_annotated.py:52: error: Invalid type: try using Literal[1] instead? [valid-type] -qualifiers_annotated.py:53: error: Invalid type comment or annotation [valid-type] -qualifiers_annotated.py:54: error: Invalid type comment or annotation [valid-type] -qualifiers_annotated.py:64: error: Annotated[...] must have exactly one type argument and at least one annotation [valid-type] -qualifiers_annotated.py:76: error: Incompatible types in assignment (expression has type "_SpecialForm", variable has type "Type[Any]") [assignment] -qualifiers_annotated.py:77: error: Incompatible types in assignment (expression has type "_SpecialForm", variable has type "Type[Any]") [assignment] -qualifiers_annotated.py:84: error: Argument 1 to "func4" has incompatible type "_SpecialForm"; expected "Type[Never]" [arg-type] -qualifiers_annotated.py:85: error: Argument 1 to "func4" has incompatible type "_SpecialForm"; expected "Type[Never]" [arg-type] -qualifiers_annotated.py:91: error: "_SpecialForm" not callable [operator] -qualifiers_annotated.py:92: error: "_SpecialForm" not callable [operator] -qualifiers_annotated.py:93: error: "" not callable [operator] +qualifiers_annotated.py:59: error: Annotated[...] must have exactly one type argument and at least one annotation [valid-type] +qualifiers_annotated.py:71: error: Incompatible types in assignment (expression has type "_SpecialForm", variable has type "type[Any]") [assignment] +qualifiers_annotated.py:72: error: Incompatible types in assignment (expression has type "_SpecialForm", variable has type "type[Any]") [assignment] +qualifiers_annotated.py:79: error: Argument 1 to "func4" has incompatible type "_SpecialForm"; expected "type[Never]" [arg-type] +qualifiers_annotated.py:80: error: Argument 1 to "func4" has incompatible type "_SpecialForm"; expected "type[Never]" [arg-type] +qualifiers_annotated.py:86: error: "_SpecialForm" not callable [operator] +qualifiers_annotated.py:87: error: "_SpecialForm" not callable [operator] +qualifiers_annotated.py:88: error: "" not callable [operator] """ diff --git a/conformance/src/type_checker.py b/conformance/src/type_checker.py index 6bd69f9e1..64c689966 100644 --- a/conformance/src/type_checker.py +++ b/conformance/src/type_checker.py @@ -365,7 +365,7 @@ def get_version(self) -> str: def run_tests(self, test_files: Sequence[str]) -> dict[str, str]: proc = run( - ["pyrefly", "check", "--output-format", "min-text", "--no-summary"], + ["pyrefly", "check", "--output-format", "min-text", "--summary=none"], stdout=PIPE, text=True, encoding="utf-8", diff --git a/conformance/tests/qualifiers_annotated.py b/conformance/tests/qualifiers_annotated.py index ebbab4ad2..1b2b61a73 100644 --- a/conformance/tests/qualifiers_annotated.py +++ b/conformance/tests/qualifiers_annotated.py @@ -33,11 +33,6 @@ Good6: Annotated[Callable[..., int], ""] Good7: Annotated["int | str", ""] Good8: Annotated[list["int | str"], ""] -Good9: Annotated[Literal[3, 4, 5, None], x := 3] - - -async def func3() -> None: - Good10: Annotated[str, await func3()] Bad1: Annotated[[int, str], ""] # E: invalid type expression From 2f008ed5c01afa9fb044cf5e18c7dbcbe41842fb Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Thu, 9 Oct 2025 17:04:20 +0000 Subject: [PATCH 140/308] Zuban Update (#2085) * Make it possible to run only a specific type checker * In some cases a test around Never could mark too many statements after it as unreachable * Upgrade test results --- conformance/results/results.html | 14 +- .../results/zuban/callables_kwargs.toml | 2 + .../zuban/constructors_call_metaclass.toml | 17 +- .../results/zuban/constructors_callable.toml | 6 +- .../dataclasses_transform_converter.toml | 44 +---- .../results/zuban/directives_deprecated.toml | 27 ++- conformance/results/zuban/enums_members.toml | 4 - .../zuban/generics_syntax_infer_variance.toml | 80 +++------ .../zuban/generics_syntax_scoping.toml | 6 +- .../results/zuban/literals_literalstring.toml | 24 +-- .../results/zuban/literals_semantics.toml | 2 +- .../results/zuban/tuples_type_compat.toml | 8 +- .../results/zuban/typeddicts_alt_syntax.toml | 2 +- .../zuban/typeddicts_class_syntax.toml | 4 +- .../results/zuban/typeddicts_extra_items.toml | 156 +++--------------- conformance/results/zuban/version.toml | 2 +- conformance/src/main.py | 2 + conformance/src/options.py | 7 + .../tests/constructors_call_metaclass.py | 5 +- 19 files changed, 110 insertions(+), 302 deletions(-) diff --git a/conformance/results/results.html b/conformance/results/results.html index 5805ee71b..35401d356 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -164,7 +164,7 @@

    Python Type System Conformance Test Results

    pyre 0.9.25
    zuban 0.0.20
    +
    zuban 0.0.24
    pyrefly 0.30.0
    Unsupported

    Type parameter syntax not yet support.

    Pass
    Partial

    Incorrectly determines that a class cannot be instantiated with __getitem__.

    Incorrectly handles mixing legacy and PEP695 syntax.

    Unsupported

    Type parameter syntax not yet support.

    Partial

    Final is handled a bit different (questionable if this is an issue)

    Pass
         generics_syntax_scoping
    Unsupported

    Support for `LiteralString` is not implemented.

    Pass
    Partial

    Incorrectly infers `str` rather than `LiteralString` when literal string `join` is used.

    Unsupported

    Support for `LiteralString` is not implemented.

    Pass
    Partial

    LiteralString is sometimes converted to str

         literals_parameterizations
    Unupported

    Does not honor metaclass __call__ method when evaluating constructor call.

    Does not skip evaluation of __new__ and __init__ if custom metaclass call returns non-class.

    Pass
    Partial

    Does not evaluate __new__ if metaclass __call__ is defined.

    Unupported

    Does not honor metaclass __call__ method when evaluating constructor call.

    Does not skip evaluation of __new__ and __init__ if custom metaclass call returns non-class.

    Pass Pass
         constructors_call_new
    Unsupported

    Converter parameter not yet supported.

    Pass
    Unsupported

    Converter parameter not yet supported.

    Unsupported

    Converter parameter not yet supported.

    Partial

    Converters are fully supported, failed to match generic overloads against other generics

    Pass
         dataclasses_transform_field
    Unsupported

    Not supported.

    Partial

    Does not flag illegal use of `closed=False` when inheriting from a non-open TypedDict.

    Unsupported

    Not supported.

    Unsupported

    Not supported.

    Pass
    Partial

    Does not fully support extra_items for typed dicts

         typeddicts_final Pass Pass
    Unsupported

    Does not support @deprecated.

    UnsupportedPass Unsupported
         directives_no_type_check
    - - - - + @@ -312,7 +312,7 @@

    Python Type System Conformance Test Results

    - + @@ -322,7 +322,7 @@

    Python Type System Conformance Test Results

    - + @@ -330,7 +330,7 @@

    Python Type System Conformance Test Results

    - + @@ -344,7 +344,7 @@

    Python Type System Conformance Test Results

    - + @@ -385,7 +385,7 @@

    Python Type System Conformance Test Results

    - + @@ -442,7 +442,7 @@

    Python Type System Conformance Test Results

    - + @@ -480,7 +480,7 @@

    Python Type System Conformance Test Results

    - + - + @@ -603,7 +603,7 @@

    Python Type System Conformance Test Results

    - + @@ -611,14 +611,14 @@

    Python Type System Conformance Test Results

    - + - + @@ -646,7 +646,7 @@

    Python Type System Conformance Test Results

    - + @@ -660,7 +660,7 @@

    Python Type System Conformance Test Results

    - + - + @@ -767,7 +767,7 @@

    Python Type System Conformance Test Results

    - + @@ -833,7 +833,7 @@

    Python Type System Conformance Test Results

    - + @@ -920,10 +920,10 @@

    Python Type System Conformance Test Results

    - + - + @@ -1032,7 +1032,7 @@

    Python Type System Conformance Test Results

    - + @@ -1053,7 +1053,7 @@

    Python Type System Conformance Test Results

    - + @@ -1065,7 +1065,7 @@

    Python Type System Conformance Test Results

    - + diff --git a/conformance/results/zuban/generics_defaults.toml b/conformance/results/zuban/generics_defaults.toml index 63d7f7d88..978478b80 100644 --- a/conformance/results/zuban/generics_defaults.toml +++ b/conformance/results/zuban/generics_defaults.toml @@ -6,18 +6,17 @@ ParamSpec after TypeVarTuple is not always handled correctly """ conformance_automated = "Fail" errors_diff = """ -Line 141: Expected 1 errors -Line 154: Unexpected errors ['generics_defaults.py:154: error: Expression is of type "Type[Foo6[int, [*Any, **Any]]]", not "Type[Foo6[int, str, [float, bool]]]" [misc]', 'generics_defaults.py:154: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [misc]'] -Line 169: Unexpected errors ['generics_defaults.py:169: error: Expression is of type "Callable[[Self], Self]", not "Callable[[Foo7[int]], Foo7[int]]" [misc]'] -Line 170: Unexpected errors ['generics_defaults.py:170: error: Access to generic instance variables via class is ambiguous [misc]'] +Line 142: Expected 1 errors +Line 155: Unexpected errors ['generics_defaults.py:155: error: Expression is of type "Type[Foo6[int, [*Any, **Any]]]", not "Type[Foo6[int, str, [float, bool]]]" [misc]', 'generics_defaults.py:155: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [misc]'] +Line 170: Unexpected errors ['generics_defaults.py:170: error: Expression is of type "Callable[[Self], Self]", not "Callable[[Foo7[int]], Foo7[int]]" [misc]'] """ output = """ generics_defaults.py:24: error: "T" cannot appear after "DefaultStrT" in type parameter list because it has no default type [misc] generics_defaults.py:50: error: "AllTheDefaults" expects between 2 and 5 type arguments, but 1 given [type-arg] generics_defaults.py:107: error: TypeVar default must be a subtype of the bound type [misc] generics_defaults.py:114: error: TypeVar default must be one of the constraint types [misc] -generics_defaults.py:154: error: Expression is of type "Type[Foo6[int, [*Any, **Any]]]", not "Type[Foo6[int, str, [float, bool]]]" [misc] -generics_defaults.py:154: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [misc] -generics_defaults.py:169: error: Expression is of type "Callable[[Self], Self]", not "Callable[[Foo7[int]], Foo7[int]]" [misc] -generics_defaults.py:170: error: Access to generic instance variables via class is ambiguous [misc] +generics_defaults.py:131: error: Expression is of type "int", not "Any" [misc] +generics_defaults.py:155: error: Expression is of type "Type[Foo6[int, [*Any, **Any]]]", not "Type[Foo6[int, str, [float, bool]]]" [misc] +generics_defaults.py:155: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [misc] +generics_defaults.py:170: error: Expression is of type "Callable[[Self], Self]", not "Callable[[Foo7[int]], Foo7[int]]" [misc] """ diff --git a/conformance/results/zuban/generics_self_advanced.toml b/conformance/results/zuban/generics_self_advanced.toml index 16e410b4f..a6a7caadb 100644 --- a/conformance/results/zuban/generics_self_advanced.toml +++ b/conformance/results/zuban/generics_self_advanced.toml @@ -1,6 +1,6 @@ -conformant = "Pass" +conformant = "Partial" notes = """ -True positive: Writing to a variable that contains Self (with a class) should error +Doesn't allow accessing `Self` in a classmethod """ conformance_automated = "Fail" errors_diff = """ diff --git a/conformance/results/zuban/generics_syntax_infer_variance.toml b/conformance/results/zuban/generics_syntax_infer_variance.toml index f6f762210..796dcd31a 100644 --- a/conformance/results/zuban/generics_syntax_infer_variance.toml +++ b/conformance/results/zuban/generics_syntax_infer_variance.toml @@ -4,28 +4,30 @@ Final is handled a bit different (questionable if this is an issue) """ conformance_automated = "Fail" errors_diff = """ -Line 79: Unexpected errors ['generics_syntax_infer_variance.py:79: error: Final name declared in class body cannot depend on type variables [misc]'] -Line 85: Unexpected errors ['generics_syntax_infer_variance.py:85: error: Incompatible types in assignment (expression has type "ShouldBeCovariant6[int]", variable has type "ShouldBeCovariant6[float]") [assignment]'] +Line 89: Unexpected errors ['generics_syntax_infer_variance.py:89: error: Final name declared in class body cannot depend on type variables [misc]'] +Line 95: Unexpected errors ['generics_syntax_infer_variance.py:95: error: Incompatible types in assignment (expression has type "ShouldBeCovariant6[int]", variable has type "ShouldBeCovariant6[float]") [assignment]'] """ output = """ generics_syntax_infer_variance.py:15: error: Cannot use covariant with infer_variance [misc] generics_syntax_infer_variance.py:17: error: Cannot use contravariant with infer_variance [misc] generics_syntax_infer_variance.py:29: error: Incompatible types in assignment (expression has type "ShouldBeCovariant1[float]", variable has type "ShouldBeCovariant1[int]") [assignment] -generics_syntax_infer_variance.py:37: error: Incompatible types in assignment (expression has type "ShouldBeCovariant2[float]", variable has type "ShouldBeCovariant2[int]") [assignment] -generics_syntax_infer_variance.py:46: error: Incompatible types in assignment (expression has type "ShouldBeCovariant3[float]", variable has type "ShouldBeCovariant3[int]") [assignment] -generics_syntax_infer_variance.py:75: error: Incompatible types in assignment (expression has type "ShouldBeCovariant5[float]", variable has type "ShouldBeCovariant5[int]") [assignment] -generics_syntax_infer_variance.py:79: error: Final name declared in class body cannot depend on type variables [misc] -generics_syntax_infer_variance.py:85: error: Incompatible types in assignment (expression has type "ShouldBeCovariant6[int]", variable has type "ShouldBeCovariant6[float]") [assignment] -generics_syntax_infer_variance.py:86: error: Incompatible types in assignment (expression has type "ShouldBeCovariant6[float]", variable has type "ShouldBeCovariant6[int]") [assignment] -generics_syntax_infer_variance.py:102: error: Incompatible types in assignment (expression has type "ShouldBeInvariant1[int]", variable has type "ShouldBeInvariant1[float]") [assignment] -generics_syntax_infer_variance.py:103: error: Incompatible types in assignment (expression has type "ShouldBeInvariant1[float]", variable has type "ShouldBeInvariant1[int]") [assignment] -generics_syntax_infer_variance.py:117: error: Incompatible types in assignment (expression has type "ShouldBeInvariant2[int]", variable has type "ShouldBeInvariant2[float]") [assignment] -generics_syntax_infer_variance.py:118: error: Incompatible types in assignment (expression has type "ShouldBeInvariant2[float]", variable has type "ShouldBeInvariant2[int]") [assignment] -generics_syntax_infer_variance.py:125: error: Incompatible types in assignment (expression has type "ShouldBeInvariant3[int, str]", variable has type "ShouldBeInvariant3[float, str]") [assignment] -generics_syntax_infer_variance.py:126: error: Incompatible types in assignment (expression has type "ShouldBeInvariant3[float, str]", variable has type "ShouldBeInvariant3[int, str]") [assignment] -generics_syntax_infer_variance.py:127: error: Incompatible types in assignment (expression has type "ShouldBeInvariant3[str, int]", variable has type "ShouldBeInvariant3[str, float]") [assignment] -generics_syntax_infer_variance.py:128: error: Incompatible types in assignment (expression has type "ShouldBeInvariant3[str, float]", variable has type "ShouldBeInvariant3[str, int]") [assignment] -generics_syntax_infer_variance.py:136: error: Incompatible types in assignment (expression has type "ShouldBeInvariant4[int]", variable has type "ShouldBeInvariant4[float]") [assignment] -generics_syntax_infer_variance.py:144: error: Incompatible types in assignment (expression has type "ShouldBeInvariant5[int]", variable has type "ShouldBeInvariant5[float]") [assignment] -generics_syntax_infer_variance.py:155: error: Incompatible types in assignment (expression has type "ShouldBeContravariant1[int]", variable has type "ShouldBeContravariant1[float]") [assignment] +generics_syntax_infer_variance.py:39: note: If the method is meant to be abstract, use @abc.abstractmethod +generics_syntax_infer_variance.py:42: note: If the method is meant to be abstract, use @abc.abstractmethod +generics_syntax_infer_variance.py:47: error: Incompatible types in assignment (expression has type "ShouldBeCovariant2[float]", variable has type "ShouldBeCovariant2[int]") [assignment] +generics_syntax_infer_variance.py:56: error: Incompatible types in assignment (expression has type "ShouldBeCovariant3[float]", variable has type "ShouldBeCovariant3[int]") [assignment] +generics_syntax_infer_variance.py:85: error: Incompatible types in assignment (expression has type "ShouldBeCovariant5[float]", variable has type "ShouldBeCovariant5[int]") [assignment] +generics_syntax_infer_variance.py:89: error: Final name declared in class body cannot depend on type variables [misc] +generics_syntax_infer_variance.py:95: error: Incompatible types in assignment (expression has type "ShouldBeCovariant6[int]", variable has type "ShouldBeCovariant6[float]") [assignment] +generics_syntax_infer_variance.py:96: error: Incompatible types in assignment (expression has type "ShouldBeCovariant6[float]", variable has type "ShouldBeCovariant6[int]") [assignment] +generics_syntax_infer_variance.py:112: error: Incompatible types in assignment (expression has type "ShouldBeInvariant1[int]", variable has type "ShouldBeInvariant1[float]") [assignment] +generics_syntax_infer_variance.py:113: error: Incompatible types in assignment (expression has type "ShouldBeInvariant1[float]", variable has type "ShouldBeInvariant1[int]") [assignment] +generics_syntax_infer_variance.py:127: error: Incompatible types in assignment (expression has type "ShouldBeInvariant2[int]", variable has type "ShouldBeInvariant2[float]") [assignment] +generics_syntax_infer_variance.py:128: error: Incompatible types in assignment (expression has type "ShouldBeInvariant2[float]", variable has type "ShouldBeInvariant2[int]") [assignment] +generics_syntax_infer_variance.py:135: error: Incompatible types in assignment (expression has type "ShouldBeInvariant3[int, str]", variable has type "ShouldBeInvariant3[float, str]") [assignment] +generics_syntax_infer_variance.py:136: error: Incompatible types in assignment (expression has type "ShouldBeInvariant3[float, str]", variable has type "ShouldBeInvariant3[int, str]") [assignment] +generics_syntax_infer_variance.py:137: error: Incompatible types in assignment (expression has type "ShouldBeInvariant3[str, int]", variable has type "ShouldBeInvariant3[str, float]") [assignment] +generics_syntax_infer_variance.py:138: error: Incompatible types in assignment (expression has type "ShouldBeInvariant3[str, float]", variable has type "ShouldBeInvariant3[str, int]") [assignment] +generics_syntax_infer_variance.py:146: error: Incompatible types in assignment (expression has type "ShouldBeInvariant4[int]", variable has type "ShouldBeInvariant4[float]") [assignment] +generics_syntax_infer_variance.py:154: error: Incompatible types in assignment (expression has type "ShouldBeInvariant5[int]", variable has type "ShouldBeInvariant5[float]") [assignment] +generics_syntax_infer_variance.py:165: error: Incompatible types in assignment (expression has type "ShouldBeContravariant1[int]", variable has type "ShouldBeContravariant1[float]") [assignment] """ diff --git a/conformance/results/zuban/generics_type_erasure.toml b/conformance/results/zuban/generics_type_erasure.toml index 403b62d09..ae8e9d615 100644 --- a/conformance/results/zuban/generics_type_erasure.toml +++ b/conformance/results/zuban/generics_type_erasure.toml @@ -1,6 +1,6 @@ -conformant = "Pass" +conformant = "Partial" notes = """ -True positive: Undefined type vars should be inferred as Never not Any (avoiding to introduce Any) +Infers Node[Never] instead of Node[Any] when argument is not provided. """ conformance_automated = "Fail" errors_diff = """ diff --git a/conformance/results/zuban/protocols_explicit.toml b/conformance/results/zuban/protocols_explicit.toml index 4a0f7c2a4..259623c10 100644 --- a/conformance/results/zuban/protocols_explicit.toml +++ b/conformance/results/zuban/protocols_explicit.toml @@ -1,16 +1,11 @@ -conformant = "Pass" -conformance_automated = "Fail" -notes = """ -Does not report unimplemented attributes for class that explicitly derives from protocol until it is instantiated. -""" +conformance_automated = "Pass" errors_diff = """ -Line 90: Expected 1 errors -Line 110: Expected 1 errors """ output = """ protocols_explicit.py:27: error: Call to abstract method "draw" of "PColor" with trivial body via super() is unsafe [safe-super] protocols_explicit.py:56: error: Incompatible types in assignment (expression has type "tuple[int, int, str]", variable has type "tuple[int, int, int]") [assignment] protocols_explicit.py:60: error: Cannot instantiate abstract class "Point" with abstract attributes "intensity" and "transparency" [abstract] -protocols_explicit.py:135: error: Cannot instantiate abstract class "Concrete5" with abstract attribute "method1" [abstract] -protocols_explicit.py:165: error: Cannot instantiate abstract class "Concrete7A" with abstract attribute "method1" [abstract] +protocols_explicit.py:89: error: Cannot instantiate abstract class "Concrete1" with abstract attribute "cm1" [abstract] +protocols_explicit.py:134: error: Cannot instantiate abstract class "Concrete5" with abstract attribute "method1" [abstract] +protocols_explicit.py:164: error: Cannot instantiate abstract class "Concrete7A" with abstract attribute "method1" [abstract] """ diff --git a/conformance/results/zuban/qualifiers_annotated.toml b/conformance/results/zuban/qualifiers_annotated.toml index 03e563a7a..1074d8db7 100644 --- a/conformance/results/zuban/qualifiers_annotated.toml +++ b/conformance/results/zuban/qualifiers_annotated.toml @@ -17,10 +17,10 @@ qualifiers_annotated.py:47: error: Invalid type: try using Literal[1] instead? qualifiers_annotated.py:48: error: Invalid type comment or annotation [valid-type] qualifiers_annotated.py:49: error: Invalid type comment or annotation [valid-type] qualifiers_annotated.py:59: error: Annotated[...] must have exactly one type argument and at least one annotation [valid-type] -qualifiers_annotated.py:71: error: Incompatible types in assignment (expression has type "_SpecialForm", variable has type "type[Any]") [assignment] -qualifiers_annotated.py:72: error: Incompatible types in assignment (expression has type "_SpecialForm", variable has type "type[Any]") [assignment] -qualifiers_annotated.py:79: error: Argument 1 to "func4" has incompatible type "_SpecialForm"; expected "type[Never]" [arg-type] -qualifiers_annotated.py:80: error: Argument 1 to "func4" has incompatible type "_SpecialForm"; expected "type[Never]" [arg-type] +qualifiers_annotated.py:71: error: Incompatible types in assignment (expression has type "_SpecialForm", variable has type "Type[Any]") [assignment] +qualifiers_annotated.py:72: error: Incompatible types in assignment (expression has type "_SpecialForm", variable has type "Type[Any]") [assignment] +qualifiers_annotated.py:79: error: Argument 1 to "func4" has incompatible type "_SpecialForm"; expected "Type[Never]" [arg-type] +qualifiers_annotated.py:80: error: Argument 1 to "func4" has incompatible type "_SpecialForm"; expected "Type[Never]" [arg-type] qualifiers_annotated.py:86: error: "_SpecialForm" not callable [operator] qualifiers_annotated.py:87: error: "_SpecialForm" not callable [operator] qualifiers_annotated.py:88: error: "" not callable [operator] diff --git a/conformance/results/zuban/typeddicts_required.toml b/conformance/results/zuban/typeddicts_required.toml index 71d502073..c83d715f6 100644 --- a/conformance/results/zuban/typeddicts_required.toml +++ b/conformance/results/zuban/typeddicts_required.toml @@ -3,7 +3,7 @@ errors_diff = """ """ output = """ typeddicts_required.py:12: error: Required[] can be only used in a TypedDict definition [valid-type] -typeddicts_required.py:19: error: NotRequired[] can be only used in a TypedDict definition [valid-type] -typeddicts_required.py:62: error: "Required[]" type cannot be nested [misc] -typeddicts_required.py:63: error: "NotRequired[]" type cannot be nested [misc] +typeddicts_required.py:16: error: NotRequired[] can be only used in a TypedDict definition [valid-type] +typeddicts_required.py:59: error: "Required[]" type cannot be nested [misc] +typeddicts_required.py:60: error: "NotRequired[]" type cannot be nested [misc] """ diff --git a/conformance/src/unexpected_fails.py b/conformance/src/unexpected_fails.py index 96ccf3770..0e8453b19 100644 --- a/conformance/src/unexpected_fails.py +++ b/conformance/src/unexpected_fails.py @@ -21,8 +21,11 @@ except Exception as e: raise Exception(f"Error decoding {file}") from e try: - previous_pass = info["conformant"] == "Pass" new_pass = info["conformance_automated"] == "Pass" + if new_pass and "conformant" not in info: + previous_pass = True + else: + previous_pass = info["conformant"] == "Pass" except KeyError as e: raise Exception(f"Missing key in {file}") from e if previous_pass != new_pass: diff --git a/conformance/tests/enums_members.py b/conformance/tests/enums_members.py index 0dd8e5509..3a623d27e 100644 --- a/conformance/tests/enums_members.py +++ b/conformance/tests/enums_members.py @@ -16,8 +16,8 @@ class Pet(Enum): # E?: Uninitialized attributes (pyre) genus: str # Non-member attribute species: str # Non-member attribute - CAT = 1 # Member attribute - DOG = 2 # Member attribute + CAT = "felis", "catus" # Member attribute + DOG = "canis", "lupus" # Member attribute def __init__(self, genus: str, species: str) -> None: self.genus = genus diff --git a/conformance/tests/generics_defaults.py b/conformance/tests/generics_defaults.py index 7ac1f8ed3..241606c97 100644 --- a/conformance/tests/generics_defaults.py +++ b/conformance/tests/generics_defaults.py @@ -127,7 +127,8 @@ class Class_TypeVarTuple(Generic[*DefaultTs]): ... def func1(x: int | set[T4]) -> T4: ... -assert_type(func1(0), int) +assert_type(func1(0), int) # E[optional-default-use] +assert_type(func1(0), Any) # E[optional-default-use] # > A ``TypeVar`` that immediately follows a ``TypeVarTuple`` is not allowed @@ -167,4 +168,4 @@ def meth(self, /) -> Self: assert_type(Foo7.meth, Callable[[Foo7[int]], Foo7[int]]) -assert_type(Foo7.attr, int) +assert_type(Foo7().attr, int) diff --git a/conformance/tests/generics_syntax_infer_variance.py b/conformance/tests/generics_syntax_infer_variance.py index 62d14ccb5..50d42616e 100644 --- a/conformance/tests/generics_syntax_infer_variance.py +++ b/conformance/tests/generics_syntax_infer_variance.py @@ -4,7 +4,7 @@ # Specification: https://peps.python.org/pep-0695/#auto-variance-for-typevar -from typing import Final, Generic, Iterator, Sequence, TypeVar +from typing import Final, Generic, Iterator, overload, Sequence, TypeVar from dataclasses import dataclass @@ -30,7 +30,17 @@ def __iter__(self) -> Iterator[T]: class ShouldBeCovariant2(Sequence[T]): - pass + @overload + def __getitem__(self, index: int) -> T: + ... + @overload + def __getitem__(self, index: slice) -> Sequence[T]: + ... + def __getitem__(self, index: int | slice) -> T | Sequence[T]: + ... + + def __len__(self) -> int: + ... vco2_1: ShouldBeCovariant2[float] = ShouldBeCovariant2[int]() # OK diff --git a/conformance/tests/overloads_definitions.py b/conformance/tests/overloads_definitions.py index 8870cd3e6..f223203c9 100644 --- a/conformance/tests/overloads_definitions.py +++ b/conformance/tests/overloads_definitions.py @@ -173,7 +173,7 @@ class Child(Base): # E[override-final] # questions of override LSP compatibility and focus only on the override): @overload # E[override-final] - def final_method(self, x: int) -> int: ... + def final_method(self, x: int) -> int: ... # E[override-final] @overload def final_method(self, x: str) -> str: ... diff --git a/conformance/tests/protocols_explicit.py b/conformance/tests/protocols_explicit.py index 1e2763a61..70fd56445 100644 --- a/conformance/tests/protocols_explicit.py +++ b/conformance/tests/protocols_explicit.py @@ -82,7 +82,6 @@ class Proto3(Proto2, Protocol): class Concrete1(Proto1): def __init__(self): - self.cm1 = 1 self.im1 = 1 self.im3 = 3 @@ -107,7 +106,7 @@ def __init__(self): self.cm11 = 11 -c3 = Concrete3() # E: cannot instantiate abstract class +c3 = Concrete3() class Concrete4(Proto1, Proto3): diff --git a/conformance/tests/pyrefly.toml b/conformance/tests/pyrefly.toml new file mode 100644 index 000000000..c9c44e591 --- /dev/null +++ b/conformance/tests/pyrefly.toml @@ -0,0 +1 @@ +# Empty configuration file to make sure pyrefly treats this directory as the project root. diff --git a/conformance/tests/typeddicts_required.py b/conformance/tests/typeddicts_required.py index e38e6df86..d4cef0142 100644 --- a/conformance/tests/typeddicts_required.py +++ b/conformance/tests/typeddicts_required.py @@ -11,9 +11,6 @@ class NotTypedDict: x: Required[int] # E: Required not allowed in this context - def __init__(self, x: int) -> None: - self.x = x - def func1( x: NotRequired[int], # E: NotRequired not allowed in this context From 94c46d728007c81a66d9d9c44c793f542dd8c59b Mon Sep 17 00:00:00 2001 From: leostimpfle <31652181+leostimpfle@users.noreply.github.com> Date: Sat, 11 Oct 2025 13:15:35 +0200 Subject: [PATCH 144/308] Use built-in generic aliases, use shorthand for unions (#2098) --- docs/guides/libraries.rst | 66 +++++++++++++++++++-------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/docs/guides/libraries.rst b/docs/guides/libraries.rst index d5edb1378..d2a14027f 100644 --- a/docs/guides/libraries.rst +++ b/docs/guides/libraries.rst @@ -232,15 +232,15 @@ is obvious from the context: assigned only once and is either annotated with ``Final`` or is named in all-caps. A constant that is not assigned a simple literal value requires explicit annotations, preferably with a ``Final`` annotation - (e.g. ``WOODWINDS: Final[List[str]] = ['Oboe', 'Bassoon']``). + (e.g. ``WOODWINDS: Final[list[str]] = ['Oboe', 'Bassoon']``). - Enum values within an Enum class do not require annotations because they take on the type of the Enum class. - Type aliases do not require annotations. A type alias is a symbol that is defined at a module level with a single assignment where the assigned value is an instantiable type, as opposed to a class instance - (e.g. ``Foo = Callable[[Literal["a", "b"]], Union[int, str]]`` or - ``Bar = Optional[MyGenericClass[int]]``). + (e.g. ``Foo = Callable[[Literal["a", "b"]], int | str]`` or + ``Bar = MyGenericClass[int] | None``). - The “self” parameter in an instance method and the “cls” parameter in a class method do not require an explicit annotation. - The return type for an ``__init__`` method does not need to be @@ -262,21 +262,21 @@ Examples of known and unknown types a = [3, 4, 5] # Variable with known type - a: List[int] = [3, 4, 5] + a: list[int] = [3, 4, 5] # Type alias with partially unknown type (because type # arguments are missing for list and dict) - DictOrList = Union[list, dict] + DictOrList = list | dict # Type alias with known type - DictOrList = Union[List[Any], Dict[str, Any]] + DictOrList = list[Any] | dict[str, Any] # Generic type alias with known type _T = TypeVar("_T") - DictOrList = Union[List[_T], Dict[str, _T]] + DictOrList = list[_T] | dict[str, _T] # Function with known type - def func(a: Optional[int], b: Dict[str, float] = {}) -> None: + def func(a: int | None, b: dict[str, float] = {}) -> None: pass # Function with partially unknown type (because type annotations @@ -291,7 +291,7 @@ Examples of known and unknown types # Function with partially unknown type (because return type # annotation is missing) - def func(a: int, b: Dict[str, float]): + def func(a: int, b: dict[str, float]): pass # Decorator with partially unknown type (because type annotations @@ -366,7 +366,7 @@ Wide vs. Narrow Types In type theory, when comparing two types that are related to each other, the “wider” type is the one that is more general, and the “narrower” type is more specific. For example, ``Sequence[str]`` is a wider type -than ``List[str]`` because all ``List`` objects are also ``Sequence`` +than ``list[str]`` because all ``list`` objects are also ``Sequence`` objects, but the converse is not true. A subclass is narrower than a class it derives from. A union of types is wider than the individual types that comprise the union. @@ -375,7 +375,7 @@ In general, a function input parameter should be annotated with the widest possible type supported by the implementation. For example, if the implementation requires the caller to provide an iterable collection of strings, the parameter should be annotated as ``Iterable[str]``, not -as ``List[str]``. The latter type is narrower than necessary, so if a +as ``list[str]``. The latter type is narrower than necessary, so if a user attempts to pass a tuple of strings (which is supported by the implementation), a type checker will complain about a type incompatibility. @@ -383,13 +383,13 @@ incompatibility. As a specific application of the “use the widest type possible” rule, libraries should generally use immutable forms of container types instead of mutable forms (unless the function needs to modify the -container). Use ``Sequence`` rather than ``List``, ``Mapping`` rather -than ``Dict``, etc. Immutable containers allow for more flexibility +container). Use ``Sequence`` rather than ``list``, ``Mapping`` rather +than ``dict``, etc. Immutable containers allow for more flexibility because their type parameters are covariant rather than invariant. A -parameter that is typed as ``Sequence[Union[str, int]]`` can accept a -``List[int]``, ``Sequence[str]``, and a ``Sequence[int]``. But a -parameter typed as ``List[Union[str, int]]`` is much more restrictive -and accepts only a ``List[Union[str, int]]``. +parameter that is typed as ``Sequence[str | int]`` can accept a +``list[int]``, ``Sequence[str]``, and a ``Sequence[int]``. But a +parameter typed as ``list[str | int]`` is much more restrictive +and accepts only a ``list[str | int]``. Overloads --------- @@ -409,7 +409,7 @@ specified only by name, use the keyword-only separator (``*``). .. code:: python - def create_user(age: int, *, dob: Optional[date] = None): + def create_user(age: int, *, dob: date | None = None): ... .. _annotating-decorators: @@ -455,14 +455,14 @@ from creating decorators that mutate function signatures in this manner. Aliasing Decorators ------------------- -When writing a library with a couple of decorator factories +When writing a library with a couple of decorator factories (i.e. functions returning decorators, like ``complex_decorator`` from the -:ref:`annotating-decorators` section) it may be tempting to create a shortcut -for a decorator. +:ref:`annotating-decorators` section) it may be tempting to create a shortcut +for a decorator. Different type checkers handle :data:`TypeAlias ` involving :class:`Callable ` in a -different manner, so the most portable and easy way to create a shortcut +different manner, so the most portable and easy way to create a shortcut is to define a callable :class:`Protocol ` as described in the :ref:`callback-protocols` section of the Typing Specification. @@ -471,7 +471,7 @@ There is already a :class:`Protocol ` called `_typeshed `_: .. code:: python - + from typing import TYPE_CHECKING if TYPE_CHECKING: @@ -485,17 +485,17 @@ There is already a :class:`Protocol ` called """ ... -For non-trivial decorators with custom logic, it is still possible +For non-trivial decorators with custom logic, it is still possible to define a custom protocol using :class:`ParamSpec ` and :data:`Concatenate ` mechanisms: .. code:: python class Client: ... - + P = ParamSpec("P") R = TypeVar("R") - + class PClientInjector(Protocol): def __call__(self, _: Callable[Concatenate[Client, P], R], /) -> Callable[P, R]: ... @@ -505,7 +505,7 @@ and :data:`Concatenate ` mechanisms: Decorator factory is invoked with arguments like this: @inject_client("testing") def my_function(client: Client, value: int): ... - + my_function then takes only value """ @@ -534,16 +534,16 @@ annotation. .. code:: python # Simple type alias - FamilyPet = Union[Cat, Dog, GoldFish] + FamilyPet = Cat | Dog | GoldFish # Generic type alias - ListOrTuple = Union[List[_T], Tuple[_T, ...]] + ListOrTuple = list[_T] | tuple[_T, ...] # Recursive type alias - TreeNode = Union[LeafNode, List["TreeNode"]] + TreeNode = LeafNode | list["TreeNode"] # Explicit type alias using PEP 613 syntax - StrOrInt: TypeAlias = Union[str, int] + StrOrInt: TypeAlias = str | int Abstract Classes and Methods ---------------------------- @@ -609,14 +609,14 @@ type annotation would be redundant. # All-caps constant with explicit type COLOR_FORMAT_RGB: Literal["rgb"] = "rgb" - LATEST_VERSION: Tuple[int, int] = (4, 5) + LATEST_VERSION: tuple[int, int] = (4, 5) # Final variable with inferred type ColorFormatRgb: Final = "rgb" # Final variable with explicit type ColorFormatRgb: Final[Literal["rgb"]] = "rgb" - LATEST_VERSION: Final[Tuple[int, int]] = (4, 5) + LATEST_VERSION: Final[tuple[int, int]] = (4, 5) Typed Dictionaries, Data Classes, and Named Tuples -------------------------------------------------- From b63414cc8e2055a7fab5d94cac92844d5fca1ebe Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Sat, 11 Oct 2025 14:33:43 +0000 Subject: [PATCH 145/308] Latest results for all type checkers (#2097) Also allowed multiple errors in one case for tests/overloads_definitions.py --- .../results/mypy/annotations_forward_refs.toml | 3 --- .../results/pyre/annotations_forward_refs.toml | 3 --- .../pyrefly/annotations_forward_refs.toml | 3 --- conformance/results/results.html | 2 +- conformance/results/zuban/aliases_newtype.toml | 2 +- .../results/zuban/aliases_type_statement.toml | 2 +- .../results/zuban/annotations_forward_refs.toml | 13 +++++-------- .../results/zuban/annotations_generators.toml | 2 +- .../results/zuban/dataclasses_match_args.toml | 2 +- conformance/results/zuban/dataclasses_slots.toml | 2 +- .../zuban/dataclasses_transform_converter.toml | 2 +- conformance/results/zuban/dataclasses_usage.toml | 2 +- conformance/results/zuban/enums_expansion.toml | 1 - .../results/zuban/generics_base_class.toml | 4 ++-- conformance/results/zuban/generics_basic.toml | 2 +- conformance/results/zuban/generics_defaults.toml | 4 ++-- .../results/zuban/generics_syntax_scoping.toml | 6 +++--- .../results/zuban/overloads_definitions.toml | 1 + .../results/zuban/protocols_class_objects.toml | 16 ++++++++-------- .../results/zuban/qualifiers_annotated.toml | 8 ++++---- conformance/results/zuban/specialtypes_none.toml | 4 ++-- conformance/results/zuban/specialtypes_type.toml | 8 ++++---- .../results/zuban/tuples_type_compat.toml | 10 +++++----- conformance/results/zuban/version.toml | 2 +- conformance/tests/overloads_definitions.py | 10 +++++----- 25 files changed, 51 insertions(+), 63 deletions(-) diff --git a/conformance/results/mypy/annotations_forward_refs.toml b/conformance/results/mypy/annotations_forward_refs.toml index bee7ebbd0..13f39be87 100644 --- a/conformance/results/mypy/annotations_forward_refs.toml +++ b/conformance/results/mypy/annotations_forward_refs.toml @@ -31,11 +31,8 @@ annotations_forward_refs.py:96: error: Expression is of type int?, not "int" [a """ conformance_automated = "Fail" errors_diff = """ -Line 22: Expected 1 errors -Line 23: Expected 1 errors Line 24: Expected 1 errors Line 25: Expected 1 errors -Line 66: Expected 1 errors Line 87: Unexpected errors ['annotations_forward_refs.py:87: error: Function "annotations_forward_refs.ClassD.int" is not valid as a type [valid-type]'] Line 96: Unexpected errors ['annotations_forward_refs.py:96: error: Expression is of type int?, not "int" [assert-type]'] """ diff --git a/conformance/results/pyre/annotations_forward_refs.toml b/conformance/results/pyre/annotations_forward_refs.toml index 6dd78f971..047537bca 100644 --- a/conformance/results/pyre/annotations_forward_refs.toml +++ b/conformance/results/pyre/annotations_forward_refs.toml @@ -29,12 +29,9 @@ annotations_forward_refs.py:103:7 Undefined or invalid type [11]: Annotation ` """ conformance_automated = "Fail" errors_diff = """ -Line 22: Expected 1 errors -Line 23: Expected 1 errors Line 24: Expected 1 errors Line 25: Expected 1 errors Line 54: Expected 1 errors -Line 66: Expected 1 errors Line 89: Expected 1 errors Line 87: Unexpected errors ['annotations_forward_refs.py:87:7 Undefined or invalid type [11]: Annotation `ClassD.int` is not defined as a type.'] Line 96: Unexpected errors ['annotations_forward_refs.py:96:0 Assert type [70]: Expected `int` but got `unknown`.'] diff --git a/conformance/results/pyrefly/annotations_forward_refs.toml b/conformance/results/pyrefly/annotations_forward_refs.toml index f15a1fe41..fc48f82b7 100644 --- a/conformance/results/pyrefly/annotations_forward_refs.toml +++ b/conformance/results/pyrefly/annotations_forward_refs.toml @@ -5,11 +5,8 @@ Does not reject some type forms that require quotes. """ conformance_automated = "Fail" errors_diff = """ -Line 22: Expected 1 errors -Line 23: Expected 1 errors Line 24: Expected 1 errors Line 25: Expected 1 errors -Line 66: Expected 1 errors Line 87: Unexpected errors ['Expected a type form, got instance of `(self: Self@ClassD) -> None` [not-a-type]'] Line 96: Unexpected errors ['assert_type(Any, int) failed [assert-type]'] """ diff --git a/conformance/results/results.html b/conformance/results/results.html index 68b02c4ad..7a6576212 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -164,7 +164,7 @@

    Python Type System Conformance Test Results

    - diff --git a/conformance/results/zuban/aliases_newtype.toml b/conformance/results/zuban/aliases_newtype.toml index ed7a88d52..4bd918e54 100644 --- a/conformance/results/zuban/aliases_newtype.toml +++ b/conformance/results/zuban/aliases_newtype.toml @@ -4,7 +4,7 @@ errors_diff = """ output = """ aliases_newtype.py:11: error: Argument 1 to "UserId" has incompatible type "str"; expected "int" [arg-type] aliases_newtype.py:12: error: Incompatible types in assignment (expression has type "int", variable has type "UserId") [assignment] -aliases_newtype.py:18: error: Incompatible types in assignment (expression has type "Type[UserId]", variable has type "Type[Any]") [assignment] +aliases_newtype.py:18: error: Incompatible types in assignment (expression has type "type[UserId]", variable has type "type[Any]") [assignment] aliases_newtype.py:23: error: Cannot use isinstance() with NewType type [misc] aliases_newtype.py:26: error: Cannot subclass "NewType" [misc] aliases_newtype.py:35: error: String argument 1 "BadName" to NewType(...) does not match variable name "GoodName" [misc] diff --git a/conformance/results/zuban/aliases_type_statement.toml b/conformance/results/zuban/aliases_type_statement.toml index 85111674f..b82e24b75 100644 --- a/conformance/results/zuban/aliases_type_statement.toml +++ b/conformance/results/zuban/aliases_type_statement.toml @@ -6,7 +6,7 @@ aliases_type_statement.py:17: error: "TypeAliasType" has no attribute "bit_count aliases_type_statement.py:19: error: "TypeAliasType" not callable [operator] aliases_type_statement.py:23: error: "TypeAliasType" has no attribute "other_attrib" [attr-defined] aliases_type_statement.py:26: error: Type alias defined using "type" statement not valid as base class [misc] -aliases_type_statement.py:31: error: Argument 2 to "isinstance" has incompatible type "TypeAliasType"; expected "Type[Any] | UnionType | tuple[_ClassInfo, ...]" [arg-type] +aliases_type_statement.py:31: error: Argument 2 to "isinstance" has incompatible type "TypeAliasType"; expected "type[Any] | UnionType | tuple[_ClassInfo, ...]" [arg-type] aliases_type_statement.py:37: error: Invalid type alias: expression is not a valid type [valid-type] aliases_type_statement.py:38: error: Bracketed expression "[...]" is not valid as a type [valid-type] aliases_type_statement.py:38: note: Did you mean "List[...]"? diff --git a/conformance/results/zuban/annotations_forward_refs.toml b/conformance/results/zuban/annotations_forward_refs.toml index eda32687b..5ca6e3aee 100644 --- a/conformance/results/zuban/annotations_forward_refs.toml +++ b/conformance/results/zuban/annotations_forward_refs.toml @@ -6,17 +6,14 @@ Does not ignore newlines in multi-line unions """ conformance_automated = "Fail" errors_diff = """ -Line 22: Expected 1 errors -Line 23: Expected 1 errors Line 24: Expected 1 errors Line 25: Expected 1 errors -Line 66: Expected 1 errors Line 82: Unexpected errors ['annotations_forward_refs.py:82: error: Name "str" is not defined [name-defined]'] Line 87: Unexpected errors ['annotations_forward_refs.py:87: error: Function "annotations_forward_refs.ClassD.int" is not valid as a type [valid-type]'] Line 95: Unexpected errors ['annotations_forward_refs.py:95: error: Expression is of type "Any", not "str" [misc]'] Line 96: Unexpected errors ['annotations_forward_refs.py:96: error: Expression is of type "Any", not "int" [misc]'] -Line 104: Unexpected errors ['annotations_forward_refs.py:104: error: invalid syntax [syntax]'] -Line 105: Unexpected errors ['annotations_forward_refs.py:105: error: invalid syntax [syntax]', 'annotations_forward_refs.py:105: error: invalid syntax [syntax]'] +Line 104: Unexpected errors ['annotations_forward_refs.py:104: error: Invalid syntax [syntax]'] +Line 105: Unexpected errors ['annotations_forward_refs.py:105: error: Invalid syntax [syntax]', 'annotations_forward_refs.py:105: error: Invalid syntax [syntax]'] """ output = """ annotations_forward_refs.py:41: error: Invalid type comment or annotation [valid-type] @@ -46,7 +43,7 @@ annotations_forward_refs.py:89: error: Function "annotations_forward_refs.ClassD annotations_forward_refs.py:89: note: Perhaps you need "Callable[...]" or a callback protocol? annotations_forward_refs.py:95: error: Expression is of type "Any", not "str" [misc] annotations_forward_refs.py:96: error: Expression is of type "Any", not "int" [misc] -annotations_forward_refs.py:104: error: invalid syntax [syntax] -annotations_forward_refs.py:105: error: invalid syntax [syntax] -annotations_forward_refs.py:105: error: invalid syntax [syntax] +annotations_forward_refs.py:104: error: Invalid syntax [syntax] +annotations_forward_refs.py:105: error: Invalid syntax [syntax] +annotations_forward_refs.py:105: error: Invalid syntax [syntax] """ diff --git a/conformance/results/zuban/annotations_generators.toml b/conformance/results/zuban/annotations_generators.toml index 21bd62604..8243e130d 100644 --- a/conformance/results/zuban/annotations_generators.toml +++ b/conformance/results/zuban/annotations_generators.toml @@ -2,7 +2,7 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -annotations_generators.py:51: error: Missing return statement [return] +annotations_generators.py:51: error: Incompatible return value type (implicitly returns "None", expected "C") [return-value] annotations_generators.py:54: error: Incompatible return value type (got "bool", expected "C") [return-value] annotations_generators.py:57: error: Incompatible types in "yield" (actual type "int", expected type "A") [misc] annotations_generators.py:66: error: Incompatible types in "yield" (actual type "int", expected type "A") [misc] diff --git a/conformance/results/zuban/dataclasses_match_args.toml b/conformance/results/zuban/dataclasses_match_args.toml index 9a707d050..1309854f5 100644 --- a/conformance/results/zuban/dataclasses_match_args.toml +++ b/conformance/results/zuban/dataclasses_match_args.toml @@ -3,5 +3,5 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -dataclasses_match_args.py:42: error: "Type[DC4]" has no attribute "__match_args__" [attr-defined] +dataclasses_match_args.py:42: error: "type[DC4]" has no attribute "__match_args__" [attr-defined] """ diff --git a/conformance/results/zuban/dataclasses_slots.toml b/conformance/results/zuban/dataclasses_slots.toml index 9d9413f96..ecf43ca21 100644 --- a/conformance/results/zuban/dataclasses_slots.toml +++ b/conformance/results/zuban/dataclasses_slots.toml @@ -9,6 +9,6 @@ Line 25: Expected 1 errors output = """ dataclasses_slots.py:11: error: "DC1" both defines "__slots__" and is used with "slots=True" [misc] dataclasses_slots.py:38: error: Trying to assign name "y" that is not in "__slots__" of type "dataclasses_slots.DC3" [misc] -dataclasses_slots.py:66: error: "Type[DC6]" has no attribute "__slots__" [attr-defined] +dataclasses_slots.py:66: error: "type[DC6]" has no attribute "__slots__" [attr-defined] dataclasses_slots.py:69: error: "DC6" has no attribute "__slots__" [attr-defined] """ diff --git a/conformance/results/zuban/dataclasses_transform_converter.toml b/conformance/results/zuban/dataclasses_transform_converter.toml index 182ab6211..fc295f946 100644 --- a/conformance/results/zuban/dataclasses_transform_converter.toml +++ b/conformance/results/zuban/dataclasses_transform_converter.toml @@ -16,5 +16,5 @@ dataclasses_transform_converter.py:109: error: Argument 5 to "DC2" has incompati dataclasses_transform_converter.py:118: error: Incompatible types in assignment of a dataclass converter (expression has type "int", expected type "str") [assignment] dataclasses_transform_converter.py:119: error: Incompatible types in assignment of a dataclass converter (expression has type "int", expected type "str | bytes") [assignment] dataclasses_transform_converter.py:130: error: Argument "default" to "model_field" has incompatible type "int"; expected "str | None" [arg-type] -dataclasses_transform_converter.py:133: error: Argument "default_factory" to "model_field" has incompatible type "Type[int]"; expected "Callable[[], str] | None" [arg-type] +dataclasses_transform_converter.py:133: error: Argument "default_factory" to "model_field" has incompatible type "type[int]"; expected "Callable[[], str] | None" [arg-type] """ diff --git a/conformance/results/zuban/dataclasses_usage.toml b/conformance/results/zuban/dataclasses_usage.toml index 42fae5899..197dc1715 100644 --- a/conformance/results/zuban/dataclasses_usage.toml +++ b/conformance/results/zuban/dataclasses_usage.toml @@ -9,7 +9,7 @@ dataclasses_usage.py:61: error: Attributes without a default cannot follow attri dataclasses_usage.py:67: error: Attributes without a default cannot follow attributes with one [misc] dataclasses_usage.py:73: error: Attributes without a default cannot follow attributes with one [misc] dataclasses_usage.py:83: error: Too many arguments for "DC4" [call-arg] -dataclasses_usage.py:88: error: Argument "default_factory" to "field" has incompatible type "Type[str]"; expected "Callable[[], int]" [arg-type] +dataclasses_usage.py:88: error: Argument "default_factory" to "field" has incompatible type "type[str]"; expected "Callable[[], int]" [arg-type] dataclasses_usage.py:127: error: Too many arguments for "DC7" [call-arg] dataclasses_usage.py:130: error: Missing positional argument "y" in call to "DC8" [call-arg] dataclasses_usage.py:179: error: Too many arguments for "DC13" [call-arg] diff --git a/conformance/results/zuban/enums_expansion.toml b/conformance/results/zuban/enums_expansion.toml index 44138b03f..699dbd1c4 100644 --- a/conformance/results/zuban/enums_expansion.toml +++ b/conformance/results/zuban/enums_expansion.toml @@ -8,6 +8,5 @@ Line 53: Expected 1 errors Line 52: Unexpected errors ['enums_expansion.py:52: error: Expression is of type "Literal[CustomFlags.FLAG3]", not "CustomFlags" [misc]'] """ output = """ -enums_expansion.py:35: error: Expression is of type "Color", not "Never" [misc] enums_expansion.py:52: error: Expression is of type "Literal[CustomFlags.FLAG3]", not "CustomFlags" [misc] """ diff --git a/conformance/results/zuban/generics_base_class.toml b/conformance/results/zuban/generics_base_class.toml index 81a4e00e3..c8166fd86 100644 --- a/conformance/results/zuban/generics_base_class.toml +++ b/conformance/results/zuban/generics_base_class.toml @@ -5,13 +5,13 @@ Does not detect inconsistent type variable ordering in multi-inheritance. conformance_automated = "Fail" errors_diff = """ Line 98: Expected 1 errors -Line 38: Unexpected errors ['generics_base_class.py:38: error: Can only assign concrete classes to a variable of type "Type[Iterable]" [misc]'] +Line 38: Unexpected errors ['generics_base_class.py:38: error: Can only assign concrete classes to a variable of type "type[Iterable]" [misc]'] """ output = """ generics_base_class.py:26: error: Argument 1 to "takes_dict_incorrect" has incompatible type "SymbolTable"; expected "dict[str, list[object]]" [arg-type] generics_base_class.py:29: error: Invalid type [valid-type] generics_base_class.py:30: error: Invalid type [valid-type] -generics_base_class.py:38: error: Can only assign concrete classes to a variable of type "Type[Iterable]" [misc] +generics_base_class.py:38: error: Can only assign concrete classes to a variable of type "type[Iterable]" [misc] generics_base_class.py:49: error: "LinkedList" expects 1 type argument, but 2 given [type-arg] generics_base_class.py:61: error: "MyDict" expects 1 type argument, but 2 given [type-arg] generics_base_class.py:68: error: Duplicate type variables in Generic[...] or Protocol[...] [misc] diff --git a/conformance/results/zuban/generics_basic.toml b/conformance/results/zuban/generics_basic.toml index 707f3c78f..1b2260e44 100644 --- a/conformance/results/zuban/generics_basic.toml +++ b/conformance/results/zuban/generics_basic.toml @@ -14,5 +14,5 @@ generics_basic.py:162: error: Free type variable expected in Generic[...] [misc generics_basic.py:163: error: Free type variable expected in Protocol[...] [misc] generics_basic.py:171: error: If Generic[...] or Protocol[...] is present it should list all type variables [misc] generics_basic.py:172: error: If Generic[...] or Protocol[...] is present it should list all type variables [misc] -generics_basic.py:208: error: Invalid metaclass "GenericMeta[T]" [misc] +generics_basic.py:208: error: Invalid metaclass "GenericMeta[T]" [metaclass] """ diff --git a/conformance/results/zuban/generics_defaults.toml b/conformance/results/zuban/generics_defaults.toml index 978478b80..c40a48dcd 100644 --- a/conformance/results/zuban/generics_defaults.toml +++ b/conformance/results/zuban/generics_defaults.toml @@ -7,7 +7,7 @@ ParamSpec after TypeVarTuple is not always handled correctly conformance_automated = "Fail" errors_diff = """ Line 142: Expected 1 errors -Line 155: Unexpected errors ['generics_defaults.py:155: error: Expression is of type "Type[Foo6[int, [*Any, **Any]]]", not "Type[Foo6[int, str, [float, bool]]]" [misc]', 'generics_defaults.py:155: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [misc]'] +Line 155: Unexpected errors ['generics_defaults.py:155: error: Expression is of type "type[Foo6[int, [*Any, **Any]]]", not "type[Foo6[int, str, [float, bool]]]" [misc]', 'generics_defaults.py:155: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [misc]'] Line 170: Unexpected errors ['generics_defaults.py:170: error: Expression is of type "Callable[[Self], Self]", not "Callable[[Foo7[int]], Foo7[int]]" [misc]'] """ output = """ @@ -16,7 +16,7 @@ generics_defaults.py:50: error: "AllTheDefaults" expects between 2 and 5 type ar generics_defaults.py:107: error: TypeVar default must be a subtype of the bound type [misc] generics_defaults.py:114: error: TypeVar default must be one of the constraint types [misc] generics_defaults.py:131: error: Expression is of type "int", not "Any" [misc] -generics_defaults.py:155: error: Expression is of type "Type[Foo6[int, [*Any, **Any]]]", not "Type[Foo6[int, str, [float, bool]]]" [misc] +generics_defaults.py:155: error: Expression is of type "type[Foo6[int, [*Any, **Any]]]", not "type[Foo6[int, str, [float, bool]]]" [misc] generics_defaults.py:155: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [misc] generics_defaults.py:170: error: Expression is of type "Callable[[Self], Self]", not "Callable[[Foo7[int]], Foo7[int]]" [misc] """ diff --git a/conformance/results/zuban/generics_syntax_scoping.toml b/conformance/results/zuban/generics_syntax_scoping.toml index 7f32a0ca8..6f4596518 100644 --- a/conformance/results/zuban/generics_syntax_scoping.toml +++ b/conformance/results/zuban/generics_syntax_scoping.toml @@ -7,7 +7,7 @@ errors_diff = """ Line 31: Unexpected errors ['generics_syntax_scoping.py:31: error: Type variable "generics_syntax_scoping.T" is unbound [misc]'] Line 56: Unexpected errors ['generics_syntax_scoping.py:56: error: Name "S" already defined on line 55 [no-redef]'] Line 62: Unexpected errors ['generics_syntax_scoping.py:62: error: Expression is of type "TypeVar", not "str" [misc]'] -Line 88: Unexpected errors ['generics_syntax_scoping.py:88: error: Argument 1 has incompatible type "Type[ClassE]"; expected "Callable[Never, Never]" [arg-type]'] +Line 88: Unexpected errors ['generics_syntax_scoping.py:88: error: Argument 1 has incompatible type "type[ClassE]"; expected "Callable[Never, Never]" [arg-type]'] Line 90: Unexpected errors ['generics_syntax_scoping.py:90: error: Name "T" already defined on line 89 [no-redef]'] Line 106: Unexpected errors ['generics_syntax_scoping.py:106: error: Name "T" already defined on line 105 [no-redef]'] Line 108: Unexpected errors ['generics_syntax_scoping.py:108: error: Expression is of type "TypeVar", not "int" [misc]'] @@ -24,13 +24,13 @@ generics_syntax_scoping.py:31: error: Type variable "generics_syntax_scoping.T" generics_syntax_scoping.py:31: note: (Hint: Use "Generic[T]" or "Protocol[T]" base class to bind "T" inside a class) generics_syntax_scoping.py:31: note: (Hint: Use "T" in function signature to bind "T" inside a function) generics_syntax_scoping.py:35: error: Name "T" is used before definition [used-before-def] -generics_syntax_scoping.py:44: error: Argument 1 has incompatible type "Type[ClassD]"; expected "Callable[Never, Never]" [arg-type] +generics_syntax_scoping.py:44: error: Argument 1 has incompatible type "type[ClassD]"; expected "Callable[Never, Never]" [arg-type] generics_syntax_scoping.py:44: error: Name "T" is used before definition [used-before-def] generics_syntax_scoping.py:44: error: Variable "generics_syntax_scoping.T" is not valid as a type [valid-type] generics_syntax_scoping.py:44: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases generics_syntax_scoping.py:56: error: Name "S" already defined on line 55 [no-redef] generics_syntax_scoping.py:62: error: Expression is of type "TypeVar", not "str" [misc] -generics_syntax_scoping.py:88: error: Argument 1 has incompatible type "Type[ClassE]"; expected "Callable[Never, Never]" [arg-type] +generics_syntax_scoping.py:88: error: Argument 1 has incompatible type "type[ClassE]"; expected "Callable[Never, Never]" [arg-type] generics_syntax_scoping.py:90: error: Name "T" already defined on line 89 [no-redef] generics_syntax_scoping.py:92: error: "T" already defined as a type parameter [misc] generics_syntax_scoping.py:95: error: "T" already defined as a type parameter [misc] diff --git a/conformance/results/zuban/overloads_definitions.toml b/conformance/results/zuban/overloads_definitions.toml index af18910fa..c24ff027b 100644 --- a/conformance/results/zuban/overloads_definitions.toml +++ b/conformance/results/zuban/overloads_definitions.toml @@ -7,6 +7,7 @@ overloads_definitions.py:28: error: An overloaded function outside a stub file m overloads_definitions.py:59: error: An overloaded function outside a stub file must have an implementation [no-overload-impl] overloads_definitions.py:71: error: Overload does not consistently use the "@staticmethod" decorator on all function signatures. [misc] overloads_definitions.py:84: error: Overload does not consistently use the "@classmethod" decorator on all function signatures. [misc] +overloads_definitions.py:93: error: Overloaded function implementation does not accept all possible arguments of signature 2 [misc] overloads_definitions.py:122: error: @final should be applied only to overload implementation [misc] overloads_definitions.py:136: error: @final should be applied only to overload implementation [misc] overloads_definitions.py:141: error: @final should be applied only to overload implementation [misc] diff --git a/conformance/results/zuban/protocols_class_objects.toml b/conformance/results/zuban/protocols_class_objects.toml index f02bb9de5..04681647c 100644 --- a/conformance/results/zuban/protocols_class_objects.toml +++ b/conformance/results/zuban/protocols_class_objects.toml @@ -2,24 +2,24 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -protocols_class_objects.py:29: error: Only concrete class can be given where "Type[Proto]" is expected [misc] -protocols_class_objects.py:34: error: Can only assign concrete classes to a variable of type "Type[Proto]" [misc] -protocols_class_objects.py:58: error: Incompatible types in assignment (expression has type "Type[ConcreteA]", variable has type "ProtoA1") [assignment] +protocols_class_objects.py:29: error: Only concrete class can be given where "type[Proto]" is expected [misc] +protocols_class_objects.py:34: error: Can only assign concrete classes to a variable of type "type[Proto]" [misc] +protocols_class_objects.py:58: error: Incompatible types in assignment (expression has type "type[ConcreteA]", variable has type "ProtoA1") [assignment] protocols_class_objects.py:58: note: Following member(s) of "ConcreteA" have conflicts: protocols_class_objects.py:58: note: Expected: protocols_class_objects.py:58: note: def method1(x: int) -> int protocols_class_objects.py:58: note: Got: protocols_class_objects.py:58: note: def method1(self: ConcreteA, x: int) -> int -protocols_class_objects.py:74: error: Incompatible types in assignment (expression has type "Type[ConcreteB]", variable has type "ProtoB1") [assignment] +protocols_class_objects.py:74: error: Incompatible types in assignment (expression has type "type[ConcreteB]", variable has type "ProtoB1") [assignment] protocols_class_objects.py:74: note: Following member(s) of "ConcreteB" have conflicts: protocols_class_objects.py:74: note: prop1: expected "int", got "property" -protocols_class_objects.py:104: error: Incompatible types in assignment (expression has type "Type[ConcreteC1]", variable has type "ProtoC1") [assignment] +protocols_class_objects.py:104: error: Incompatible types in assignment (expression has type "type[ConcreteC1]", variable has type "ProtoC1") [assignment] protocols_class_objects.py:104: note: ClassVar protocol member ProtoC1.attr1 can never be matched by a class object -protocols_class_objects.py:106: error: Incompatible types in assignment (expression has type "Type[ConcreteC2]", variable has type "ProtoC1") [assignment] +protocols_class_objects.py:106: error: Incompatible types in assignment (expression has type "type[ConcreteC2]", variable has type "ProtoC1") [assignment] protocols_class_objects.py:106: note: Protocol member ProtoC1.attr1 expected class variable, got instance variable protocols_class_objects.py:106: note: Only class variables allowed for class object access on protocols, attr1 is an instance variable of "ConcreteC2" -protocols_class_objects.py:107: error: Incompatible types in assignment (expression has type "Type[ConcreteC2]", variable has type "ProtoC2") [assignment] +protocols_class_objects.py:107: error: Incompatible types in assignment (expression has type "type[ConcreteC2]", variable has type "ProtoC2") [assignment] protocols_class_objects.py:107: note: Only class variables allowed for class object access on protocols, attr1 is an instance variable of "ConcreteC2" -protocols_class_objects.py:108: error: Incompatible types in assignment (expression has type "Type[ConcreteC3]", variable has type "ProtoC1") [assignment] +protocols_class_objects.py:108: error: Incompatible types in assignment (expression has type "type[ConcreteC3]", variable has type "ProtoC1") [assignment] protocols_class_objects.py:108: note: ClassVar protocol member ProtoC1.attr1 can never be matched by a class object """ diff --git a/conformance/results/zuban/qualifiers_annotated.toml b/conformance/results/zuban/qualifiers_annotated.toml index 1074d8db7..03e563a7a 100644 --- a/conformance/results/zuban/qualifiers_annotated.toml +++ b/conformance/results/zuban/qualifiers_annotated.toml @@ -17,10 +17,10 @@ qualifiers_annotated.py:47: error: Invalid type: try using Literal[1] instead? qualifiers_annotated.py:48: error: Invalid type comment or annotation [valid-type] qualifiers_annotated.py:49: error: Invalid type comment or annotation [valid-type] qualifiers_annotated.py:59: error: Annotated[...] must have exactly one type argument and at least one annotation [valid-type] -qualifiers_annotated.py:71: error: Incompatible types in assignment (expression has type "_SpecialForm", variable has type "Type[Any]") [assignment] -qualifiers_annotated.py:72: error: Incompatible types in assignment (expression has type "_SpecialForm", variable has type "Type[Any]") [assignment] -qualifiers_annotated.py:79: error: Argument 1 to "func4" has incompatible type "_SpecialForm"; expected "Type[Never]" [arg-type] -qualifiers_annotated.py:80: error: Argument 1 to "func4" has incompatible type "_SpecialForm"; expected "Type[Never]" [arg-type] +qualifiers_annotated.py:71: error: Incompatible types in assignment (expression has type "_SpecialForm", variable has type "type[Any]") [assignment] +qualifiers_annotated.py:72: error: Incompatible types in assignment (expression has type "_SpecialForm", variable has type "type[Any]") [assignment] +qualifiers_annotated.py:79: error: Argument 1 to "func4" has incompatible type "_SpecialForm"; expected "type[Never]" [arg-type] +qualifiers_annotated.py:80: error: Argument 1 to "func4" has incompatible type "_SpecialForm"; expected "type[Never]" [arg-type] qualifiers_annotated.py:86: error: "_SpecialForm" not callable [operator] qualifiers_annotated.py:87: error: "_SpecialForm" not callable [operator] qualifiers_annotated.py:88: error: "" not callable [operator] diff --git a/conformance/results/zuban/specialtypes_none.toml b/conformance/results/zuban/specialtypes_none.toml index 4cc99a4a7..c7f0e4b42 100644 --- a/conformance/results/zuban/specialtypes_none.toml +++ b/conformance/results/zuban/specialtypes_none.toml @@ -2,7 +2,7 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -specialtypes_none.py:21: error: Argument 1 to "func1" has incompatible type "Type[None]"; expected "None" [arg-type] +specialtypes_none.py:21: error: Argument 1 to "func1" has incompatible type "type[None]"; expected "None" [arg-type] specialtypes_none.py:27: error: Incompatible types in assignment (expression has type "None", variable has type "Iterable[Any]") [assignment] -specialtypes_none.py:41: error: Argument 1 to "func2" has incompatible type "None"; expected "Type[None]" [arg-type] +specialtypes_none.py:41: error: Argument 1 to "func2" has incompatible type "None"; expected "type[None]" [arg-type] """ diff --git a/conformance/results/zuban/specialtypes_type.toml b/conformance/results/zuban/specialtypes_type.toml index 31f3a8488..838e866ac 100644 --- a/conformance/results/zuban/specialtypes_type.toml +++ b/conformance/results/zuban/specialtypes_type.toml @@ -2,11 +2,11 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -specialtypes_type.py:56: error: Argument 1 to "func4" has incompatible type "Type[TeamUser]"; expected "Type[BasicUser | ProUser]" [arg-type] -specialtypes_type.py:70: error: Argument 1 to "func5" has incompatible type "_SpecialForm"; expected "Type[Never]" [arg-type] +specialtypes_type.py:56: error: Argument 1 to "func4" has incompatible type "type[TeamUser]"; expected "type[BasicUser | ProUser]" [arg-type] +specialtypes_type.py:70: error: Argument 1 to "func5" has incompatible type "_SpecialForm"; expected "type[Never]" [arg-type] specialtypes_type.py:76: error: Invalid type comment or annotation [valid-type] -specialtypes_type.py:117: error: "Type[object]" has no attribute "unknown" [attr-defined] -specialtypes_type.py:120: error: "Type[object]" has no attribute "unknown" [attr-defined] +specialtypes_type.py:117: error: "type[object]" has no attribute "unknown" [attr-defined] +specialtypes_type.py:120: error: "type[object]" has no attribute "unknown" [attr-defined] specialtypes_type.py:143: error: "_SpecialForm" has no attribute "unknown" [attr-defined] specialtypes_type.py:144: error: "_SpecialForm" has no attribute "unknown" [attr-defined] specialtypes_type.py:145: error: "_SpecialForm" has no attribute "unknown" [attr-defined] diff --git a/conformance/results/zuban/tuples_type_compat.toml b/conformance/results/zuban/tuples_type_compat.toml index b6ac1afb8..73d4e185c 100644 --- a/conformance/results/zuban/tuples_type_compat.toml +++ b/conformance/results/zuban/tuples_type_compat.toml @@ -2,8 +2,9 @@ conformant = "Pass" notes = """ Does not support tuple narrowing based on `len()` type guard (optional). """ -conformance_automated = "Pass" +conformance_automated = "Fail" errors_diff = """ +Lines 111, 112: Expected error (tag 'func6_3') """ output = """ tuples_type_compat.py:15: error: Incompatible types in assignment (expression has type "tuple[float, complex]", variable has type "tuple[int, int]") [assignment] @@ -15,10 +16,9 @@ tuples_type_compat.py:62: error: Incompatible types in assignment (expression ha tuples_type_compat.py:76: error: Expression is of type "tuple[int]", not "tuple[int] | tuple[str, str] | tuple[int, Unpack[Tuple[str, ...]], int]" [misc] tuples_type_compat.py:81: error: Expression is of type "tuple[str, str] | tuple[int, int]", not "tuple[int] | tuple[str, str] | tuple[int, Unpack[Tuple[str, ...]], int]" [misc] tuples_type_compat.py:86: error: Expression is of type "tuple[int, str, int]", not "tuple[int] | tuple[str, str] | tuple[int, Unpack[Tuple[str, ...]], int]" [misc] -tuples_type_compat.py:101: error: Expression is of type "tuple[int] | tuple[str, str] | tuple[int, Unpack[Tuple[str, ...]], int]", not "tuple[int]" [misc] -tuples_type_compat.py:106: error: Expression is of type "tuple[int] | tuple[str, str] | tuple[int, Unpack[Tuple[str, ...]], int]", not "tuple[str, str] | tuple[int, int]" [misc] -tuples_type_compat.py:111: error: Expression is of type "tuple[int] | tuple[str, str] | tuple[int, Unpack[Tuple[str, ...]], int]", not "tuple[int, str, int]" [misc] -tuples_type_compat.py:126: error: Expression is of type "tuple[int | str, int | str]", not "tuple[int | str, str]" [misc] +tuples_type_compat.py:102: error: Expression is of type "tuple[int]", not "tuple[int] | tuple[str, str] | tuple[int, Unpack[Tuple[str, ...]], int]" [misc] +tuples_type_compat.py:107: error: Expression is of type "tuple[str, str] | tuple[int, int]", not "tuple[int] | tuple[str, str] | tuple[int, Unpack[Tuple[str, ...]], int]" [misc] +tuples_type_compat.py:127: error: Expression is of type "tuple[int | str, str]", not "tuple[int | str, int | str]" [misc] tuples_type_compat.py:129: error: Expression is of type "tuple[int | str, int | str]", not "tuple[int | str, int]" [misc] tuples_type_compat.py:157: error: Incompatible types in assignment (expression has type "tuple[int, str, str]", variable has type "tuple[int, str]") [assignment] tuples_type_compat.py:162: error: Incompatible types in assignment (expression has type "tuple[int, int, str]", variable has type "tuple[int, Unpack[Tuple[str, ...]]]") [assignment] diff --git a/conformance/results/zuban/version.toml b/conformance/results/zuban/version.toml index 88a02908d..2ffe43faa 100644 --- a/conformance/results/zuban/version.toml +++ b/conformance/results/zuban/version.toml @@ -1 +1 @@ -version = "zuban 0.0.24" +version = "zuban 0.1.0" diff --git a/conformance/tests/overloads_definitions.py b/conformance/tests/overloads_definitions.py index f223203c9..24ee5daa9 100644 --- a/conformance/tests/overloads_definitions.py +++ b/conformance/tests/overloads_definitions.py @@ -81,17 +81,17 @@ def func5(x: str, /) -> str: # E[func5] def func5(*args: object) -> int | str: # E[func5] return 1 - @overload # E[func6] + @overload # E[func6+] @classmethod - def func6(cls, x: int, /) -> int: # E[func6] + def func6(cls, x: int, /) -> int: # E[func6+] ... @overload - def func6(self, x: str, /) -> str: # E[func6] + def func6(self, x: str, /) -> str: # E[func6+] ... - @classmethod - def func6(cls, *args: int | str) -> int | str: # E[func6] + @classmethod # E[func6+] + def func6(cls, *args: int | str) -> int | str: # E[func6+] return 1 From 0fc5f85dee6d945ed51a14f5ba365b770e5e9f9e Mon Sep 17 00:00:00 2001 From: Rebecca Chen Date: Mon, 13 Oct 2025 16:33:54 -0700 Subject: [PATCH 146/308] Remove pyre from the conformance test suite (#2100) Remove pyre. --- conformance/.gitignore | 2 - conformance/README.md | 3 +- conformance/requirements.txt | 1 - .../results/pyre/aliases_explicit.toml | 52 ----- .../results/pyre/aliases_implicit.toml | 50 ----- conformance/results/pyre/aliases_newtype.toml | 29 --- .../results/pyre/aliases_recursive.toml | 38 ---- .../results/pyre/aliases_type_statement.toml | 50 ----- .../results/pyre/aliases_typealiastype.toml | 40 ---- .../results/pyre/aliases_variance.toml | 10 - .../results/pyre/annotations_coroutines.toml | 6 - .../pyre/annotations_forward_refs.toml | 39 ---- .../results/pyre/annotations_generators.toml | 26 --- .../results/pyre/annotations_methods.toml | 10 - .../results/pyre/annotations_typeexpr.toml | 21 -- .../results/pyre/callables_annotation.toml | 53 ----- .../results/pyre/callables_kwargs.toml | 22 --- .../results/pyre/callables_protocol.toml | 32 --- .../results/pyre/callables_subtyping.toml | 53 ----- .../results/pyre/classes_classvar.toml | 37 ---- .../results/pyre/classes_override.toml | 14 -- .../results/pyre/constructors_call_init.toml | 28 --- .../pyre/constructors_call_metaclass.toml | 13 -- .../results/pyre/constructors_call_new.toml | 31 --- .../results/pyre/constructors_call_type.toml | 14 -- .../results/pyre/constructors_callable.toml | 60 ------ .../pyre/constructors_consistency.toml | 9 - .../results/pyre/dataclasses_descriptors.toml | 20 -- .../results/pyre/dataclasses_final.toml | 11 -- .../results/pyre/dataclasses_frozen.toml | 10 - .../results/pyre/dataclasses_hash.toml | 11 -- .../results/pyre/dataclasses_inheritance.toml | 12 -- .../results/pyre/dataclasses_kwonly.toml | 14 -- .../results/pyre/dataclasses_match_args.toml | 12 -- .../results/pyre/dataclasses_order.toml | 7 - .../results/pyre/dataclasses_postinit.toml | 28 --- .../results/pyre/dataclasses_slots.toml | 16 -- .../pyre/dataclasses_transform_class.toml | 22 --- .../pyre/dataclasses_transform_converter.toml | 48 ----- .../pyre/dataclasses_transform_field.toml | 19 -- .../pyre/dataclasses_transform_func.toml | 41 ---- .../pyre/dataclasses_transform_meta.toml | 21 -- .../results/pyre/dataclasses_usage.toml | 33 ---- .../results/pyre/directives_assert_type.toml | 14 -- conformance/results/pyre/directives_cast.toml | 9 - .../results/pyre/directives_deprecated.toml | 21 -- .../pyre/directives_no_type_check.toml | 15 -- .../results/pyre/directives_reveal_type.toml | 14 -- .../pyre/directives_type_checking.toml | 6 - .../results/pyre/directives_type_ignore.toml | 6 - .../pyre/directives_type_ignore_file1.toml | 8 - .../pyre/directives_type_ignore_file2.toml | 7 - .../pyre/directives_version_platform.toml | 10 - conformance/results/pyre/enums_behaviors.toml | 11 -- .../results/pyre/enums_definition.toml | 17 -- conformance/results/pyre/enums_expansion.toml | 11 -- .../results/pyre/enums_member_names.toml | 13 -- .../results/pyre/enums_member_values.toml | 17 -- conformance/results/pyre/enums_members.toml | 28 --- .../pyre/exceptions_context_managers.toml | 13 -- .../results/pyre/generics_base_class.toml | 18 -- conformance/results/pyre/generics_basic.toml | 30 --- .../results/pyre/generics_defaults.toml | 112 ----------- .../pyre/generics_defaults_referential.toml | 61 ------ .../generics_defaults_specialization.toml | 45 ----- .../pyre/generics_paramspec_basic.toml | 25 --- .../pyre/generics_paramspec_components.toml | 32 --- .../pyre/generics_paramspec_semantics.toml | 16 -- .../generics_paramspec_specialization.toml | 18 -- .../results/pyre/generics_scoping.toml | 29 --- .../results/pyre/generics_self_advanced.toml | 24 --- .../pyre/generics_self_attributes.toml | 15 -- .../results/pyre/generics_self_basic.toml | 19 -- .../results/pyre/generics_self_protocols.toml | 11 -- .../results/pyre/generics_self_usage.toml | 28 --- .../pyre/generics_syntax_compatibility.toml | 14 -- .../pyre/generics_syntax_declarations.toml | 20 -- .../pyre/generics_syntax_infer_variance.toml | 30 --- .../results/pyre/generics_syntax_scoping.toml | 20 -- .../results/pyre/generics_type_erasure.toml | 29 --- .../pyre/generics_typevartuple_args.toml | 25 --- .../pyre/generics_typevartuple_basic.toml | 33 ---- .../pyre/generics_typevartuple_callable.toml | 12 -- .../pyre/generics_typevartuple_concat.toml | 14 -- .../pyre/generics_typevartuple_overloads.toml | 13 -- .../generics_typevartuple_specialization.toml | 35 ---- .../pyre/generics_typevartuple_unpack.toml | 9 - .../results/pyre/generics_upper_bound.toml | 14 -- .../results/pyre/generics_variance.toml | 23 --- .../pyre/generics_variance_inference.toml | 55 ------ .../results/pyre/historical_positional.toml | 12 -- .../results/pyre/literals_interactions.toml | 18 -- .../results/pyre/literals_literalstring.toml | 21 -- .../pyre/literals_parameterizations.toml | 35 ---- .../results/pyre/literals_semantics.toml | 10 - .../pyre/namedtuples_define_class.toml | 17 -- .../pyre/namedtuples_define_functional.toml | 19 -- .../results/pyre/namedtuples_type_compat.toml | 10 - .../results/pyre/namedtuples_usage.toml | 13 -- .../results/pyre/narrowing_typeguard.toml | 12 -- .../results/pyre/narrowing_typeis.toml | 15 -- conformance/results/pyre/overloads_basic.toml | 7 - .../results/pyre/overloads_consistency.toml | 18 -- .../results/pyre/overloads_definitions.toml | 30 --- .../pyre/overloads_definitions_stub.toml | 25 --- .../results/pyre/overloads_evaluation.toml | 47 ----- .../results/pyre/protocols_class_objects.toml | 21 -- .../results/pyre/protocols_definition.toml | 35 ---- .../results/pyre/protocols_explicit.toml | 18 -- .../results/pyre/protocols_generic.toml | 19 -- .../results/pyre/protocols_merging.toml | 14 -- .../results/pyre/protocols_modules.toml | 12 -- .../results/pyre/protocols_recursive.toml | 6 - .../pyre/protocols_runtime_checkable.toml | 17 -- conformance/results/pyre/protocols_self.toml | 6 - .../results/pyre/protocols_subtyping.toml | 13 -- .../results/pyre/protocols_variance.toml | 18 -- .../results/pyre/qualifiers_annotated.toml | 34 ---- .../pyre/qualifiers_final_annotation.toml | 40 ---- .../pyre/qualifiers_final_decorator.toml | 24 --- .../results/pyre/specialtypes_any.toml | 8 - .../results/pyre/specialtypes_never.toml | 22 --- .../results/pyre/specialtypes_none.toml | 9 - .../results/pyre/specialtypes_promotions.toml | 10 - .../results/pyre/specialtypes_type.toml | 42 ---- .../results/pyre/tuples_type_compat.toml | 46 ----- .../results/pyre/tuples_type_form.toml | 17 -- conformance/results/pyre/tuples_unpacked.toml | 13 -- .../results/pyre/typeddicts_alt_syntax.toml | 17 -- .../results/pyre/typeddicts_class_syntax.toml | 17 -- .../results/pyre/typeddicts_extra_items.toml | 143 -------------- .../results/pyre/typeddicts_final.toml | 11 -- .../results/pyre/typeddicts_inheritance.toml | 11 -- .../results/pyre/typeddicts_operations.toml | 19 -- .../results/pyre/typeddicts_readonly.toml | 12 -- .../pyre/typeddicts_readonly_consistency.toml | 13 -- .../pyre/typeddicts_readonly_inheritance.toml | 27 --- .../pyre/typeddicts_readonly_kwargs.toml | 7 - .../pyre/typeddicts_readonly_update.toml | 7 - .../results/pyre/typeddicts_required.toml | 17 -- .../pyre/typeddicts_type_consistency.toml | 24 --- .../results/pyre/typeddicts_usage.toml | 15 -- conformance/results/pyre/version.toml | 2 - .../pyrefly/directives_deprecated.toml | 4 +- .../results/pyrefly/enums_member_values.toml | 2 +- .../pyrefly/overloads_definitions.toml | 9 +- .../results/pyrefly/overloads_evaluation.toml | 15 +- .../pyrefly/typeddicts_inheritance.toml | 8 +- conformance/results/pyrefly/version.toml | 2 +- conformance/results/results.html | 187 +++--------------- conformance/src/type_checker.py | 71 ------- conformance/tests/enums_members.py | 2 +- docs/index.rst | 6 +- 153 files changed, 35 insertions(+), 3483 deletions(-) delete mode 100644 conformance/results/pyre/aliases_explicit.toml delete mode 100644 conformance/results/pyre/aliases_implicit.toml delete mode 100644 conformance/results/pyre/aliases_newtype.toml delete mode 100644 conformance/results/pyre/aliases_recursive.toml delete mode 100644 conformance/results/pyre/aliases_type_statement.toml delete mode 100644 conformance/results/pyre/aliases_typealiastype.toml delete mode 100644 conformance/results/pyre/aliases_variance.toml delete mode 100644 conformance/results/pyre/annotations_coroutines.toml delete mode 100644 conformance/results/pyre/annotations_forward_refs.toml delete mode 100644 conformance/results/pyre/annotations_generators.toml delete mode 100644 conformance/results/pyre/annotations_methods.toml delete mode 100644 conformance/results/pyre/annotations_typeexpr.toml delete mode 100644 conformance/results/pyre/callables_annotation.toml delete mode 100644 conformance/results/pyre/callables_kwargs.toml delete mode 100644 conformance/results/pyre/callables_protocol.toml delete mode 100644 conformance/results/pyre/callables_subtyping.toml delete mode 100644 conformance/results/pyre/classes_classvar.toml delete mode 100644 conformance/results/pyre/classes_override.toml delete mode 100644 conformance/results/pyre/constructors_call_init.toml delete mode 100644 conformance/results/pyre/constructors_call_metaclass.toml delete mode 100644 conformance/results/pyre/constructors_call_new.toml delete mode 100644 conformance/results/pyre/constructors_call_type.toml delete mode 100644 conformance/results/pyre/constructors_callable.toml delete mode 100644 conformance/results/pyre/constructors_consistency.toml delete mode 100644 conformance/results/pyre/dataclasses_descriptors.toml delete mode 100644 conformance/results/pyre/dataclasses_final.toml delete mode 100644 conformance/results/pyre/dataclasses_frozen.toml delete mode 100644 conformance/results/pyre/dataclasses_hash.toml delete mode 100644 conformance/results/pyre/dataclasses_inheritance.toml delete mode 100644 conformance/results/pyre/dataclasses_kwonly.toml delete mode 100644 conformance/results/pyre/dataclasses_match_args.toml delete mode 100644 conformance/results/pyre/dataclasses_order.toml delete mode 100644 conformance/results/pyre/dataclasses_postinit.toml delete mode 100644 conformance/results/pyre/dataclasses_slots.toml delete mode 100644 conformance/results/pyre/dataclasses_transform_class.toml delete mode 100644 conformance/results/pyre/dataclasses_transform_converter.toml delete mode 100644 conformance/results/pyre/dataclasses_transform_field.toml delete mode 100644 conformance/results/pyre/dataclasses_transform_func.toml delete mode 100644 conformance/results/pyre/dataclasses_transform_meta.toml delete mode 100644 conformance/results/pyre/dataclasses_usage.toml delete mode 100644 conformance/results/pyre/directives_assert_type.toml delete mode 100644 conformance/results/pyre/directives_cast.toml delete mode 100644 conformance/results/pyre/directives_deprecated.toml delete mode 100644 conformance/results/pyre/directives_no_type_check.toml delete mode 100644 conformance/results/pyre/directives_reveal_type.toml delete mode 100644 conformance/results/pyre/directives_type_checking.toml delete mode 100644 conformance/results/pyre/directives_type_ignore.toml delete mode 100644 conformance/results/pyre/directives_type_ignore_file1.toml delete mode 100644 conformance/results/pyre/directives_type_ignore_file2.toml delete mode 100644 conformance/results/pyre/directives_version_platform.toml delete mode 100644 conformance/results/pyre/enums_behaviors.toml delete mode 100644 conformance/results/pyre/enums_definition.toml delete mode 100644 conformance/results/pyre/enums_expansion.toml delete mode 100644 conformance/results/pyre/enums_member_names.toml delete mode 100644 conformance/results/pyre/enums_member_values.toml delete mode 100644 conformance/results/pyre/enums_members.toml delete mode 100644 conformance/results/pyre/exceptions_context_managers.toml delete mode 100644 conformance/results/pyre/generics_base_class.toml delete mode 100644 conformance/results/pyre/generics_basic.toml delete mode 100644 conformance/results/pyre/generics_defaults.toml delete mode 100644 conformance/results/pyre/generics_defaults_referential.toml delete mode 100644 conformance/results/pyre/generics_defaults_specialization.toml delete mode 100644 conformance/results/pyre/generics_paramspec_basic.toml delete mode 100644 conformance/results/pyre/generics_paramspec_components.toml delete mode 100644 conformance/results/pyre/generics_paramspec_semantics.toml delete mode 100644 conformance/results/pyre/generics_paramspec_specialization.toml delete mode 100644 conformance/results/pyre/generics_scoping.toml delete mode 100644 conformance/results/pyre/generics_self_advanced.toml delete mode 100644 conformance/results/pyre/generics_self_attributes.toml delete mode 100644 conformance/results/pyre/generics_self_basic.toml delete mode 100644 conformance/results/pyre/generics_self_protocols.toml delete mode 100644 conformance/results/pyre/generics_self_usage.toml delete mode 100644 conformance/results/pyre/generics_syntax_compatibility.toml delete mode 100644 conformance/results/pyre/generics_syntax_declarations.toml delete mode 100644 conformance/results/pyre/generics_syntax_infer_variance.toml delete mode 100644 conformance/results/pyre/generics_syntax_scoping.toml delete mode 100644 conformance/results/pyre/generics_type_erasure.toml delete mode 100644 conformance/results/pyre/generics_typevartuple_args.toml delete mode 100644 conformance/results/pyre/generics_typevartuple_basic.toml delete mode 100644 conformance/results/pyre/generics_typevartuple_callable.toml delete mode 100644 conformance/results/pyre/generics_typevartuple_concat.toml delete mode 100644 conformance/results/pyre/generics_typevartuple_overloads.toml delete mode 100644 conformance/results/pyre/generics_typevartuple_specialization.toml delete mode 100644 conformance/results/pyre/generics_typevartuple_unpack.toml delete mode 100644 conformance/results/pyre/generics_upper_bound.toml delete mode 100644 conformance/results/pyre/generics_variance.toml delete mode 100644 conformance/results/pyre/generics_variance_inference.toml delete mode 100644 conformance/results/pyre/historical_positional.toml delete mode 100644 conformance/results/pyre/literals_interactions.toml delete mode 100644 conformance/results/pyre/literals_literalstring.toml delete mode 100644 conformance/results/pyre/literals_parameterizations.toml delete mode 100644 conformance/results/pyre/literals_semantics.toml delete mode 100644 conformance/results/pyre/namedtuples_define_class.toml delete mode 100644 conformance/results/pyre/namedtuples_define_functional.toml delete mode 100644 conformance/results/pyre/namedtuples_type_compat.toml delete mode 100644 conformance/results/pyre/namedtuples_usage.toml delete mode 100644 conformance/results/pyre/narrowing_typeguard.toml delete mode 100644 conformance/results/pyre/narrowing_typeis.toml delete mode 100644 conformance/results/pyre/overloads_basic.toml delete mode 100644 conformance/results/pyre/overloads_consistency.toml delete mode 100644 conformance/results/pyre/overloads_definitions.toml delete mode 100644 conformance/results/pyre/overloads_definitions_stub.toml delete mode 100644 conformance/results/pyre/overloads_evaluation.toml delete mode 100644 conformance/results/pyre/protocols_class_objects.toml delete mode 100644 conformance/results/pyre/protocols_definition.toml delete mode 100644 conformance/results/pyre/protocols_explicit.toml delete mode 100644 conformance/results/pyre/protocols_generic.toml delete mode 100644 conformance/results/pyre/protocols_merging.toml delete mode 100644 conformance/results/pyre/protocols_modules.toml delete mode 100644 conformance/results/pyre/protocols_recursive.toml delete mode 100644 conformance/results/pyre/protocols_runtime_checkable.toml delete mode 100644 conformance/results/pyre/protocols_self.toml delete mode 100644 conformance/results/pyre/protocols_subtyping.toml delete mode 100644 conformance/results/pyre/protocols_variance.toml delete mode 100644 conformance/results/pyre/qualifiers_annotated.toml delete mode 100644 conformance/results/pyre/qualifiers_final_annotation.toml delete mode 100644 conformance/results/pyre/qualifiers_final_decorator.toml delete mode 100644 conformance/results/pyre/specialtypes_any.toml delete mode 100644 conformance/results/pyre/specialtypes_never.toml delete mode 100644 conformance/results/pyre/specialtypes_none.toml delete mode 100644 conformance/results/pyre/specialtypes_promotions.toml delete mode 100644 conformance/results/pyre/specialtypes_type.toml delete mode 100644 conformance/results/pyre/tuples_type_compat.toml delete mode 100644 conformance/results/pyre/tuples_type_form.toml delete mode 100644 conformance/results/pyre/tuples_unpacked.toml delete mode 100644 conformance/results/pyre/typeddicts_alt_syntax.toml delete mode 100644 conformance/results/pyre/typeddicts_class_syntax.toml delete mode 100644 conformance/results/pyre/typeddicts_extra_items.toml delete mode 100644 conformance/results/pyre/typeddicts_final.toml delete mode 100644 conformance/results/pyre/typeddicts_inheritance.toml delete mode 100644 conformance/results/pyre/typeddicts_operations.toml delete mode 100644 conformance/results/pyre/typeddicts_readonly.toml delete mode 100644 conformance/results/pyre/typeddicts_readonly_consistency.toml delete mode 100644 conformance/results/pyre/typeddicts_readonly_inheritance.toml delete mode 100644 conformance/results/pyre/typeddicts_readonly_kwargs.toml delete mode 100644 conformance/results/pyre/typeddicts_readonly_update.toml delete mode 100644 conformance/results/pyre/typeddicts_required.toml delete mode 100644 conformance/results/pyre/typeddicts_type_consistency.toml delete mode 100644 conformance/results/pyre/typeddicts_usage.toml delete mode 100644 conformance/results/pyre/version.toml diff --git a/conformance/.gitignore b/conformance/.gitignore index 5eae7a458..6a000697b 100644 --- a/conformance/.gitignore +++ b/conformance/.gitignore @@ -32,8 +32,6 @@ MANIFEST # Tools .mypy_cache -.pyre_configuration -.pyre .coverage htmlcov diff --git a/conformance/README.md b/conformance/README.md index a5a45b7e6..e0302c806 100644 --- a/conformance/README.md +++ b/conformance/README.md @@ -75,13 +75,12 @@ To run the conformance test suite: * Switch to the `src` subdirectory and run `python main.py`. Note that some type checkers may not run on some platforms. If a type checker fails to install, tests will be skipped for that type checker. -Currently, the only unsupported type checker is Pyre on Windows. ## Reporting Conformance Results Different type checkers report errors in different ways (with different wording in error messages and different line numbers or character ranges for errors). This variation makes it difficult to fully automate test validation given that tests will want to check for both false positive and false negative type errors. Some level of manual inspection will therefore be needed to determine whether a type checker is fully conformant with all tests in any given test file. This "scoring" process is required only when the output of a test changes — e.g. when a new version of that type checker is released and the tests are rerun. We assume that the output of a type checker will be the same from one run to the next unless/until a new version is released that fixes or introduces a bug. In this case, the output will need to be manually inspected and the conformance results re-scored for those tests whose output has changed. -Conformance results are reported and summarized for each supported type checker. Currently, results are reported for mypy, pyre, and pyright. It is the goal and desire to add additional type checkers over time. +Conformance results are reported and summarized for each supported type checker. Currently, results are reported for mypy, pyrefly, pyright, and zuban. It is the goal and desire to add additional type checkers over time. ## Adding a New Test Case diff --git a/conformance/requirements.txt b/conformance/requirements.txt index cf7ee5852..eac56a058 100644 --- a/conformance/requirements.txt +++ b/conformance/requirements.txt @@ -3,6 +3,5 @@ tomlkit pyright mypy pip -pyre-check; platform_system != "Windows" zuban pyrefly diff --git a/conformance/results/pyre/aliases_explicit.toml b/conformance/results/pyre/aliases_explicit.toml deleted file mode 100644 index 1ed27f715..000000000 --- a/conformance/results/pyre/aliases_explicit.toml +++ /dev/null @@ -1,52 +0,0 @@ -conformant = "Partial" -notes = """ -Incorrectly reports error for type alias defined with ParamSpec. -Incorrectly rejects some valid type aliases when used in annotations. -Incorrectly evaluates generic type alias with ParamSpec with missing type argument. -Does not report some illegal annotation forms as invalid type aliases. -Does not report invalid specialization of generic type aliases. -Incorrectly rejects import alias of `TypeAlias` when used to define type alias. -Does not report invalid specialization of already-specialized generic type alias. -""" -output = """ -aliases_explicit.py:23:0 Incompatible variable type [9]: GoodTypeAlias9 is declared to have type `TA` but is used as type `Type[typing.Callable[..., Variable[$synthetic_attribute_resolution_variable]]]`. -aliases_explicit.py:23:30 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[typing.Any, Type[Variable[$synthetic_attribute_resolution_variable]]]` but got `Tuple[object, TypeVar]`. -aliases_explicit.py:26:0 Incompatible variable type [9]: GoodTypeAlias12 is declared to have type `TA` but is used as type `Type[typing.Callable[..., Variable[$synthetic_attribute_resolution_variable]]]`. -aliases_explicit.py:26:31 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[typing.Any, Type[Variable[$synthetic_attribute_resolution_variable]]]` but got `Tuple[ParamSpec, None]`. -aliases_explicit.py:41:8 Undefined or invalid type [11]: Annotation `GoodTypeAlias9` is not defined as a type. -aliases_explicit.py:44:9 Undefined or invalid type [11]: Annotation `GoodTypeAlias12` is not defined as a type. -aliases_explicit.py:57:4 Assert type [70]: Expected `typing.Callable[[int, str, str], None]` but got `unknown`. -aliases_explicit.py:60:4 Assert type [70]: Expected `typing.Callable[..., None]` but got `unknown`. -aliases_explicit.py:80:0 Incompatible variable type [9]: BadTypeAlias2 is declared to have type `TA` but is used as type `List[Type[Union[int, str]]]`. -aliases_explicit.py:81:0 Incompatible variable type [9]: BadTypeAlias3 is declared to have type `TA` but is used as type `Tuple[Tuple[Type[int], Type[str]]]`. -aliases_explicit.py:82:0 Incompatible variable type [9]: BadTypeAlias4 is declared to have type `TA` but is used as type `List[Type[int]]`. -aliases_explicit.py:83:0 Incompatible variable type [9]: BadTypeAlias5 is declared to have type `TA` but is used as type `Dict[str, str]`. -aliases_explicit.py:84:0 Incompatible variable type [9]: BadTypeAlias6 is declared to have type `TA` but is used as type `Type[int]`. -aliases_explicit.py:85:0 Incompatible variable type [9]: BadTypeAlias7 is declared to have type `TA` but is used as type `Type[int]`. -aliases_explicit.py:86:0 Incompatible variable type [9]: BadTypeAlias8 is declared to have type `TA` but is used as type `Type[Union[int, str]]`. -aliases_explicit.py:87:0 Incompatible variable type [9]: BadTypeAlias9 is declared to have type `TA` but is used as type `int`. -aliases_explicit.py:88:0 Incompatible variable type [9]: BadTypeAlias10 is declared to have type `TA` but is used as type `bool`. -aliases_explicit.py:89:0 Incompatible variable type [9]: BadTypeAlias11 is declared to have type `TA` but is used as type `int`. -aliases_explicit.py:90:0 Incompatible variable type [9]: BadTypeAlias12 is declared to have type `TA` but is used as type `Type[Union[list, set]]`. -aliases_explicit.py:91:0 Incompatible variable type [9]: BadTypeAlias13 is declared to have type `TA` but is used as type `str`. -aliases_explicit.py:97:16 Call error [29]: `TA` is not a function. -aliases_explicit.py:101:5 Call error [29]: `TA` is not a function. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 67: Expected 1 errors -Line 68: Expected 1 errors -Line 69: Expected 1 errors -Line 70: Expected 1 errors -Line 71: Expected 1 errors -Line 79: Expected 1 errors -Line 100: Expected 1 errors -Line 102: Expected 1 errors -Line 23: Unexpected errors ['aliases_explicit.py:23:0 Incompatible variable type [9]: GoodTypeAlias9 is declared to have type `TA` but is used as type `Type[typing.Callable[..., Variable[$synthetic_attribute_resolution_variable]]]`.', 'aliases_explicit.py:23:30 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[typing.Any, Type[Variable[$synthetic_attribute_resolution_variable]]]` but got `Tuple[object, TypeVar]`.'] -Line 26: Unexpected errors ['aliases_explicit.py:26:0 Incompatible variable type [9]: GoodTypeAlias12 is declared to have type `TA` but is used as type `Type[typing.Callable[..., Variable[$synthetic_attribute_resolution_variable]]]`.', 'aliases_explicit.py:26:31 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[typing.Any, Type[Variable[$synthetic_attribute_resolution_variable]]]` but got `Tuple[ParamSpec, None]`.'] -Line 41: Unexpected errors ['aliases_explicit.py:41:8 Undefined or invalid type [11]: Annotation `GoodTypeAlias9` is not defined as a type.'] -Line 44: Unexpected errors ['aliases_explicit.py:44:9 Undefined or invalid type [11]: Annotation `GoodTypeAlias12` is not defined as a type.'] -Line 57: Unexpected errors ['aliases_explicit.py:57:4 Assert type [70]: Expected `typing.Callable[[int, str, str], None]` but got `unknown`.'] -Line 60: Unexpected errors ['aliases_explicit.py:60:4 Assert type [70]: Expected `typing.Callable[..., None]` but got `unknown`.'] -Line 97: Unexpected errors ['aliases_explicit.py:97:16 Call error [29]: `TA` is not a function.'] -""" diff --git a/conformance/results/pyre/aliases_implicit.toml b/conformance/results/pyre/aliases_implicit.toml deleted file mode 100644 index 322c29325..000000000 --- a/conformance/results/pyre/aliases_implicit.toml +++ /dev/null @@ -1,50 +0,0 @@ -conformant = "Partial" -notes = """ -Incorrectly reports error for type alias defined with ParamSpec. -Incorrectly rejects some valid type aliases when used in annotations. -Incorrectly evaluates generic type alias with ParamSpec with missing type argument. -Does not report invalid specialization of generic type aliases. -Does not report error for attempt to instantiate union type alias. -Does not report invalid specialization of already-specialized generic type alias. -""" -output = """ -aliases_implicit.py:38:26 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[typing.Any, Type[Variable[$synthetic_attribute_resolution_variable]]]` but got `Tuple[object, TypeVar]`. -aliases_implicit.py:42:27 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[typing.Any, Type[Variable[$synthetic_attribute_resolution_variable]]]` but got `Tuple[ParamSpec, None]`. -aliases_implicit.py:54:8 Undefined or invalid type [11]: Annotation `GoodTypeAlias9` is not defined as a type. -aliases_implicit.py:58:9 Undefined or invalid type [11]: Annotation `GoodTypeAlias13` is not defined as a type. -aliases_implicit.py:68:4 Assert type [70]: Expected `typing.Callable[[int, str, str], None]` but got `unknown`. -aliases_implicit.py:72:4 Assert type [70]: Expected `typing.Callable[..., None]` but got `unknown`. -aliases_implicit.py:106:8 Undefined or invalid type [11]: Annotation `BadTypeAlias1` is not defined as a type. -aliases_implicit.py:107:8 Undefined or invalid type [11]: Annotation `BadTypeAlias2` is not defined as a type. -aliases_implicit.py:108:8 Undefined or invalid type [11]: Annotation `BadTypeAlias3` is not defined as a type. -aliases_implicit.py:109:8 Undefined or invalid type [11]: Annotation `BadTypeAlias4` is not defined as a type. -aliases_implicit.py:110:8 Undefined or invalid type [11]: Annotation `BadTypeAlias5` is not defined as a type. -aliases_implicit.py:111:8 Undefined or invalid type [11]: Annotation `BadTypeAlias6` is not defined as a type. -aliases_implicit.py:112:8 Undefined or invalid type [11]: Annotation `BadTypeAlias7` is not defined as a type. -aliases_implicit.py:113:8 Undefined or invalid type [11]: Annotation `BadTypeAlias8` is not defined as a type. -aliases_implicit.py:114:8 Undefined or invalid type [11]: Annotation `BadTypeAlias9` is not defined as a type. -aliases_implicit.py:115:9 Undefined or invalid type [11]: Annotation `BadTypeAlias10` is not defined as a type. -aliases_implicit.py:116:9 Undefined or invalid type [11]: Annotation `BadTypeAlias11` is not defined as a type. -aliases_implicit.py:117:9 Undefined or invalid type [11]: Annotation `BadTypeAlias12` is not defined as a type. -aliases_implicit.py:118:9 Undefined or invalid type [11]: Annotation `BadTypeAlias13` is not defined as a type. -aliases_implicit.py:119:9 Undefined or invalid type [11]: Annotation `BadTypeAlias14` is not defined as a type. -aliases_implicit.py:131:0 Assert type [70]: Expected `List[int]` but got `typing.Any`. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 76: Expected 1 errors -Line 77: Expected 1 errors -Line 78: Expected 1 errors -Line 79: Expected 1 errors -Line 80: Expected 1 errors -Line 81: Expected 1 errors -Line 133: Expected 1 errors -Line 135: Expected 1 errors -Line 38: Unexpected errors ['aliases_implicit.py:38:26 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[typing.Any, Type[Variable[$synthetic_attribute_resolution_variable]]]` but got `Tuple[object, TypeVar]`.'] -Line 42: Unexpected errors ['aliases_implicit.py:42:27 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[typing.Any, Type[Variable[$synthetic_attribute_resolution_variable]]]` but got `Tuple[ParamSpec, None]`.'] -Line 54: Unexpected errors ['aliases_implicit.py:54:8 Undefined or invalid type [11]: Annotation `GoodTypeAlias9` is not defined as a type.'] -Line 58: Unexpected errors ['aliases_implicit.py:58:9 Undefined or invalid type [11]: Annotation `GoodTypeAlias13` is not defined as a type.'] -Line 68: Unexpected errors ['aliases_implicit.py:68:4 Assert type [70]: Expected `typing.Callable[[int, str, str], None]` but got `unknown`.'] -Line 72: Unexpected errors ['aliases_implicit.py:72:4 Assert type [70]: Expected `typing.Callable[..., None]` but got `unknown`.'] -Line 131: Unexpected errors ['aliases_implicit.py:131:0 Assert type [70]: Expected `List[int]` but got `typing.Any`.'] -""" diff --git a/conformance/results/pyre/aliases_newtype.toml b/conformance/results/pyre/aliases_newtype.toml deleted file mode 100644 index 9dada2304..000000000 --- a/conformance/results/pyre/aliases_newtype.toml +++ /dev/null @@ -1,29 +0,0 @@ -conformant = "Partial" -notes = """ -Does not reject use of NewType in `isinstance` call. -Does not reject use of NewType in class definition statement. -Does not report inconsistency between name of NewType and assigned identifier name. -Does not reject use of NewType with generic class with TypeVar. -Does not reject use of NewType with protocol class. -Does not reject use of NewType with TypedDict class. -Does not reject use of NewType with Any. -""" -output = """ -aliases_newtype.py:11:7 Incompatible parameter type [6]: In call `UserId.__init__`, for 1st positional argument, expected `int` but got `str`. -aliases_newtype.py:12:0 Incompatible variable type [9]: u1 is declared to have type `UserId` but is used as type `int`. -aliases_newtype.py:41:5 Invalid type parameters [24]: Non-generic type `GoodNewType1` cannot take parameters. -aliases_newtype.py:47:37 Invalid inheritance [39]: `typing.Union[int, str]` is not a valid parent class. -aliases_newtype.py:54:37 Invalid inheritance [39]: `typing_extensions.Literal[7]` is not a valid parent class. -aliases_newtype.py:63:14 Too many arguments [19]: Call `NewType.__init__` expects 2 positional arguments, 3 were provided. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 18: Expected 1 errors -Line 23: Expected 1 errors -Line 26: Expected 1 errors -Line 35: Expected 1 errors -Line 50: Expected 1 errors -Line 52: Expected 1 errors -Line 61: Expected 1 errors -Line 65: Expected 1 errors -""" diff --git a/conformance/results/pyre/aliases_recursive.toml b/conformance/results/pyre/aliases_recursive.toml deleted file mode 100644 index 69aeafb12..000000000 --- a/conformance/results/pyre/aliases_recursive.toml +++ /dev/null @@ -1,38 +0,0 @@ -conformant = "Partial" -notes = """ -Does not properly handle some recursive type aliases. -Does not properly handle specialization of generic recursive type aliases. -""" -output = """ -aliases_recursive.py:19:0 Incompatible variable type [9]: j4 is declared to have type `aliases_recursive.Json (resolves to Union[None, Dict[str, Json], List[Json], float, int, str])` but is used as type `Dict[str, complex]`. -aliases_recursive.py:20:0 Incompatible variable type [9]: j5 is declared to have type `aliases_recursive.Json (resolves to Union[None, Dict[str, Json], List[Json], float, int, str])` but is used as type `List[complex]`. -aliases_recursive.py:30:29 Undefined attribute [16]: `tuple` has no attribute `__getitem__`. -aliases_recursive.py:33:4 Undefined or invalid type [11]: Annotation `RecursiveTuple` is not defined as a type. -aliases_recursive.py:42:39 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[Type[Variable[_KT]], Type[Variable[_VT_co]]]` but got `Tuple[Type[str], str]`. -aliases_recursive.py:44:4 Undefined or invalid type [11]: Annotation `RecursiveMapping` is not defined as a type. -aliases_recursive.py:58:20 Undefined attribute [16]: `list` has no attribute `__getitem__`. -aliases_recursive.py:61:4 Undefined or invalid type [11]: Annotation `SpecializedTypeAlias1` is not defined as a type. -aliases_recursive.py:62:4 Undefined or invalid type [11]: Annotation `GenericTypeAlias1` is not defined as a type. -aliases_recursive.py:67:4 Undefined or invalid type [11]: Annotation `GenericTypeAlias2` is not defined as a type. -aliases_recursive.py:72:0 Incompatible variable type [9]: RecursiveUnion is declared to have type `TypeAlias` but is used as type `Type[typing.Any]`. -aliases_recursive.py:75:0 Incompatible variable type [9]: MutualReference1 is declared to have type `TypeAlias` but is used as type `Type[typing.Any]`. -aliases_recursive.py:75:62 Incompatible variable type [9]: MutualReference2 is declared to have type `TypeAlias` but is used as type `Type[typing.Any]`. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 38: Expected 1 errors -Line 39: Expected 1 errors -Line 50: Expected 1 errors -Line 51: Expected 1 errors -Line 52: Expected 1 errors -Line 63: Expected 1 errors -Line 69: Expected 1 errors -Line 30: Unexpected errors ['aliases_recursive.py:30:29 Undefined attribute [16]: `tuple` has no attribute `__getitem__`.'] -Line 33: Unexpected errors ['aliases_recursive.py:33:4 Undefined or invalid type [11]: Annotation `RecursiveTuple` is not defined as a type.'] -Line 42: Unexpected errors ['aliases_recursive.py:42:39 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[Type[Variable[_KT]], Type[Variable[_VT_co]]]` but got `Tuple[Type[str], str]`.'] -Line 44: Unexpected errors ['aliases_recursive.py:44:4 Undefined or invalid type [11]: Annotation `RecursiveMapping` is not defined as a type.'] -Line 58: Unexpected errors ['aliases_recursive.py:58:20 Undefined attribute [16]: `list` has no attribute `__getitem__`.'] -Line 61: Unexpected errors ['aliases_recursive.py:61:4 Undefined or invalid type [11]: Annotation `SpecializedTypeAlias1` is not defined as a type.'] -Line 62: Unexpected errors ['aliases_recursive.py:62:4 Undefined or invalid type [11]: Annotation `GenericTypeAlias1` is not defined as a type.'] -Line 67: Unexpected errors ['aliases_recursive.py:67:4 Undefined or invalid type [11]: Annotation `GenericTypeAlias2` is not defined as a type.'] -""" diff --git a/conformance/results/pyre/aliases_type_statement.toml b/conformance/results/pyre/aliases_type_statement.toml deleted file mode 100644 index e3ce7deb4..000000000 --- a/conformance/results/pyre/aliases_type_statement.toml +++ /dev/null @@ -1,50 +0,0 @@ -conformant = "Partial" -notes = """ -Does not complain when a type alias cannot be used as a base class. -Does not complain when a type alias cannot be used as a function. -Does not complain when a type statement definition combines new and old TypeVars. -Does not complain when a type statement definition uses old TypeVars. -Does not properly support recursive aliases. -""" -output = """ -aliases_type_statement.py:37:0 Invalid type [31]: Expression `eval("".join(map(chr, [105, 110, 116])))` is not a valid type. -aliases_type_statement.py:38:0 Invalid type [31]: Expression `[int, str]` is not a valid type. -aliases_type_statement.py:39:0 Invalid type [31]: Expression `((int, str))` is not a valid type. -aliases_type_statement.py:40:0 Invalid type [31]: Expression `comprehension(int for generators(generator(i in range(1) if )))` is not a valid type. -aliases_type_statement.py:41:0 Invalid type [31]: Expression `{ "a":"b" }` is not a valid type. -aliases_type_statement.py:42:0 Invalid type [31]: Expression `lambda () (int)()` is not a valid type. -aliases_type_statement.py:43:0 Invalid type [31]: Expression `[int][0]` is not a valid type. -aliases_type_statement.py:44:0 Invalid type [31]: Expression `int if 1 < 3 else str` is not a valid type. -aliases_type_statement.py:45:0 Undefined or invalid type [11]: Annotation `var1` is not defined as a type. -aliases_type_statement.py:46:0 Invalid type [31]: Expression `True` is not a valid type. -aliases_type_statement.py:47:0 Invalid type [31]: Expression `1` is not a valid type. -aliases_type_statement.py:48:0 Invalid type [31]: Expression `list or set` is not a valid type. -aliases_type_statement.py:49:0 Invalid type [31]: Expression `f"{"int"}"` is not a valid type. -aliases_type_statement.py:72:0 Incompatible variable type [9]: r1_1 is declared to have type `aliases_type_statement.RecursiveTypeAlias1 (resolves to Union[List[aliases_type_statement.RecursiveTypeAlias1 (resolves to Union[List[RecursiveTypeAlias1], T])], T])` but is used as type `int`. -aliases_type_statement.py:73:0 Incompatible variable type [9]: r1_2 is declared to have type `aliases_type_statement.RecursiveTypeAlias1 (resolves to Union[List[aliases_type_statement.RecursiveTypeAlias1 (resolves to Union[List[RecursiveTypeAlias1], T])], T])` but is used as type `List[Union[List[int], int]]`. -aliases_type_statement.py:77:6 Invalid type [31]: Expression `RecursiveTypeAlias2[(str, str, ...)]` is not a valid type. -aliases_type_statement.py:78:6 Invalid type [31]: Expression `RecursiveTypeAlias2[(int, str, ...)]` is not a valid type. -aliases_type_statement.py:79:6 Invalid type [31]: Expression `RecursiveTypeAlias2[(int, int, ...)]` is not a valid type. -aliases_type_statement.py:80:6 Invalid type [31]: Expression `RecursiveTypeAlias2[(int, str, [int, str])]` is not a valid type. -aliases_type_statement.py:82:0 Undefined or invalid type [11]: Annotation `RecursiveTypeAlias3` is not defined as a type. -aliases_type_statement.py:84:0 Invalid type parameters [24]: Non-generic type `RecursiveTypeAlias4` cannot take parameters. -aliases_type_statement.py:84:0 Undefined or invalid type [11]: Annotation `RecursiveTypeAlias4` is not defined as a type. -aliases_type_statement.py:88:0 Undefined or invalid type [11]: Annotation `RecursiveTypeAlias7` is not defined as a type. -aliases_type_statement.py:89:0 Undefined or invalid type [11]: Annotation `RecursiveTypeAlias6` is not defined as a type. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 17: Expected 1 errors -Line 19: Expected 1 errors -Line 23: Expected 1 errors -Line 26: Expected 1 errors -Line 31: Expected 1 errors -Line 56: Expected 1 errors -Line 62: Expected 1 errors -Line 67: Expected 1 errors -Lines 51, 52: Expected error (tag 'TA14') -Line 72: Unexpected errors ['aliases_type_statement.py:72:0 Incompatible variable type [9]: r1_1 is declared to have type `aliases_type_statement.RecursiveTypeAlias1 (resolves to Union[List[aliases_type_statement.RecursiveTypeAlias1 (resolves to Union[List[RecursiveTypeAlias1], T])], T])` but is used as type `int`.'] -Line 73: Unexpected errors ['aliases_type_statement.py:73:0 Incompatible variable type [9]: r1_2 is declared to have type `aliases_type_statement.RecursiveTypeAlias1 (resolves to Union[List[aliases_type_statement.RecursiveTypeAlias1 (resolves to Union[List[RecursiveTypeAlias1], T])], T])` but is used as type `List[Union[List[int], int]]`.'] -Line 78: Unexpected errors ['aliases_type_statement.py:78:6 Invalid type [31]: Expression `RecursiveTypeAlias2[(int, str, ...)]` is not a valid type.'] -Line 80: Unexpected errors ['aliases_type_statement.py:80:6 Invalid type [31]: Expression `RecursiveTypeAlias2[(int, str, [int, str])]` is not a valid type.'] -""" diff --git a/conformance/results/pyre/aliases_typealiastype.toml b/conformance/results/pyre/aliases_typealiastype.toml deleted file mode 100644 index ed9e9178e..000000000 --- a/conformance/results/pyre/aliases_typealiastype.toml +++ /dev/null @@ -1,40 +0,0 @@ -conformant = "Unsupported" -notes = """ -Support for TypeAliasType is not implemented. -""" -output = """ -aliases_typealiastype.py:17:41 Undefined attribute [16]: `list` has no attribute `__getitem__`. -aliases_typealiastype.py:22:13 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[typing.Any, Type[Variable[$synthetic_attribute_resolution_variable]]]` but got `Tuple[ParamSpec, TypeVar]`. -aliases_typealiastype.py:22:67 Undefined attribute [16]: `tuple` has no attribute `__getitem__`. -aliases_typealiastype.py:32:6 Undefined attribute [16]: `TypeAliasType` has no attribute `other_attrib`. -aliases_typealiastype.py:35:4 Undefined or invalid type [11]: Annotation `GoodAlias4` is not defined as a type. -aliases_typealiastype.py:37:4 Undefined or invalid type [11]: Annotation `GoodAlias5` is not defined as a type. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 40: Expected 1 errors -Line 43: Expected 1 errors -Line 44: Expected 1 errors -Line 45: Expected 1 errors -Line 46: Expected 1 errors -Line 47: Expected 1 errors -Line 48: Expected 1 errors -Line 52: Expected 1 errors -Line 53: Expected 1 errors -Line 54: Expected 1 errors -Line 55: Expected 1 errors -Line 56: Expected 1 errors -Line 57: Expected 1 errors -Line 58: Expected 1 errors -Line 59: Expected 1 errors -Line 60: Expected 1 errors -Line 61: Expected 1 errors -Line 62: Expected 1 errors -Line 63: Expected 1 errors -Line 64: Expected 1 errors -Line 66: Expected 1 errors -Line 17: Unexpected errors ['aliases_typealiastype.py:17:41 Undefined attribute [16]: `list` has no attribute `__getitem__`.'] -Line 22: Unexpected errors ['aliases_typealiastype.py:22:13 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[typing.Any, Type[Variable[$synthetic_attribute_resolution_variable]]]` but got `Tuple[ParamSpec, TypeVar]`.', 'aliases_typealiastype.py:22:67 Undefined attribute [16]: `tuple` has no attribute `__getitem__`.'] -Line 35: Unexpected errors ['aliases_typealiastype.py:35:4 Undefined or invalid type [11]: Annotation `GoodAlias4` is not defined as a type.'] -Line 37: Unexpected errors ['aliases_typealiastype.py:37:4 Undefined or invalid type [11]: Annotation `GoodAlias5` is not defined as a type.'] -""" diff --git a/conformance/results/pyre/aliases_variance.toml b/conformance/results/pyre/aliases_variance.toml deleted file mode 100644 index a5492b60e..000000000 --- a/conformance/results/pyre/aliases_variance.toml +++ /dev/null @@ -1,10 +0,0 @@ -conformant = "Pass" -output = """ -aliases_variance.py:24:0 Invalid type variance [46]: The type variable `Variable[T_co](covariant)` is incompatible with parent class type variable `Variable[T](invariant)` because subclasses cannot use more permissive type variables than their superclasses. -aliases_variance.py:28:0 Invalid type variance [46]: The type variable `Variable[T_co](covariant)` is incompatible with parent class type variable `Variable[T](invariant)` because subclasses cannot use more permissive type variables than their superclasses. -aliases_variance.py:32:0 Invalid type variance [46]: The type variable `Variable[T_co](covariant)` is incompatible with parent class type variable `Variable[T](invariant)` because subclasses cannot use more permissive type variables than their superclasses. -aliases_variance.py:44:0 Invalid type variance [46]: The type variable `Variable[T_contra](contravariant)` is incompatible with parent class type variable `Variable[T](invariant)` because subclasses cannot use more permissive type variables than their superclasses. -""" -conformance_automated = "Pass" -errors_diff = """ -""" diff --git a/conformance/results/pyre/annotations_coroutines.toml b/conformance/results/pyre/annotations_coroutines.toml deleted file mode 100644 index 5e485e856..000000000 --- a/conformance/results/pyre/annotations_coroutines.toml +++ /dev/null @@ -1,6 +0,0 @@ -conformant = "Pass" -output = """ -""" -conformance_automated = "Pass" -errors_diff = """ -""" diff --git a/conformance/results/pyre/annotations_forward_refs.toml b/conformance/results/pyre/annotations_forward_refs.toml deleted file mode 100644 index 047537bca..000000000 --- a/conformance/results/pyre/annotations_forward_refs.toml +++ /dev/null @@ -1,39 +0,0 @@ -conformant = "Partial" -notes = """ -Does not report error for a forward reference that is not enclosed in quotes. -Does not report error for use of quoted type with "|" operator (runtime error). -Does not reject f-string in quoted type annotation. -Incorrectly generates error for quoted type defined in class scope. -Does not generate error for unquoted type defined in class scope. -Does not treat triple-quoted forward reference annotation as implicitly parenthesized. -""" -output = """ -annotations_forward_refs.py:41:8 Invalid type [31]: Expression `eval("".join(map(chr, [105, 110, 116])))` is not a valid type. -annotations_forward_refs.py:42:8 Invalid type [31]: Expression `"[int, str]"` is not a valid type. -annotations_forward_refs.py:43:8 Invalid type [31]: Expression `"(int, str)"` is not a valid type. -annotations_forward_refs.py:44:8 Undefined or invalid type [11]: Annotation `comprehension(int for generators(generator($target$i in range(1) if )))` is not defined as a type. -annotations_forward_refs.py:45:8 Invalid type [31]: Expression `"{ }"` is not a valid type. -annotations_forward_refs.py:46:8 Invalid type [31]: Expression `lambda () (int)()` is not a valid type. -annotations_forward_refs.py:47:8 Invalid type [31]: Expression `[int][0]` is not a valid type. -annotations_forward_refs.py:48:8 Invalid type [31]: Expression `"int if 1 < 3 else str"` is not a valid type. -annotations_forward_refs.py:49:8 Undefined or invalid type [11]: Annotation `var1` is not defined as a type. -annotations_forward_refs.py:50:9 Invalid type [31]: Expression `"True"` is not a valid type. -annotations_forward_refs.py:51:9 Invalid type [31]: Expression `"1"` is not a valid type. -annotations_forward_refs.py:52:9 Invalid type [31]: Expression `"-1"` is not a valid type. -annotations_forward_refs.py:53:9 Invalid type [31]: Expression `"int or str"` is not a valid type. -annotations_forward_refs.py:55:9 Undefined or invalid type [11]: Annotation `types` is not defined as a type. -annotations_forward_refs.py:80:12 Undefined or invalid type [11]: Annotation `ClassF` is not defined as a type. -annotations_forward_refs.py:87:7 Undefined or invalid type [11]: Annotation `ClassD.int` is not defined as a type. -annotations_forward_refs.py:96:0 Assert type [70]: Expected `int` but got `unknown`. -annotations_forward_refs.py:103:7 Undefined or invalid type [11]: Annotation ` -""" -conformance_automated = "Fail" -errors_diff = """ -Line 24: Expected 1 errors -Line 25: Expected 1 errors -Line 54: Expected 1 errors -Line 89: Expected 1 errors -Line 87: Unexpected errors ['annotations_forward_refs.py:87:7 Undefined or invalid type [11]: Annotation `ClassD.int` is not defined as a type.'] -Line 96: Unexpected errors ['annotations_forward_refs.py:96:0 Assert type [70]: Expected `int` but got `unknown`.'] -Line 103: Unexpected errors ['annotations_forward_refs.py:103:7 Undefined or invalid type [11]: Annotation `'] -""" diff --git a/conformance/results/pyre/annotations_generators.toml b/conformance/results/pyre/annotations_generators.toml deleted file mode 100644 index 865d139d2..000000000 --- a/conformance/results/pyre/annotations_generators.toml +++ /dev/null @@ -1,26 +0,0 @@ -conformant = "Partial" -notes = """ -Does not report invalid return type for generator when function implicitly returns None. -Incorrectly evaluates type of call to async generator. -""" -output = """ -annotations_generators.py:54:8 Incompatible return type [7]: Expected `Generator[A, B, C]` but got `Generator[typing.Any, typing.Any, bool]`. -annotations_generators.py:57:8 Incompatible return type [7]: Expected `Generator[A, B, C]` but got `Generator[int, typing.Any, typing.Any]`. -annotations_generators.py:66:8 Incompatible return type [7]: Expected `Generator[A, int, typing.Any]` but got `Generator[int, typing.Any, typing.Any]`. -annotations_generators.py:75:4 Incompatible return type [7]: Expected `Iterator[A]` but got `Generator[B, typing.Any, typing.Any]`. -annotations_generators.py:87:4 Incompatible return type [7]: Expected `int` but got `Generator[None, typing.Any, typing.Any]`. -annotations_generators.py:88:4 Incompatible return type [7]: Expected `int` but got `Generator[typing.Any, typing.Any, int]`. -annotations_generators.py:91:0 Incompatible async generator return type [57]: Expected return annotation to be AsyncGenerator or a superclass but got `int`. -annotations_generators.py:92:4 Incompatible return type [7]: Expected `int` but got `AsyncGenerator[None, typing.Any]`. -annotations_generators.py:118:4 Incompatible return type [7]: Expected `Iterator[B]` but got `Generator[A, None, typing.Any]`. -annotations_generators.py:119:4 Incompatible return type [7]: Expected `Iterator[B]` but got `Generator[int, None, typing.Any]`. -annotations_generators.py:135:4 Incompatible return type [7]: Expected `Generator[None, str, None]` but got `Generator[None, int, typing.Any]`. -annotations_generators.py:185:0 Incompatible variable type [9]: v1 is declared to have type `typing.Callable[[], Coroutine[typing.Any, typing.Any, AsyncIterator[int]]]` but is used as type `typing.Callable(generator29)[[], AsyncIterator[int]]`. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 51: Expected 1 errors -Line 86: Expected 1 errors -Line 88: Unexpected errors ['annotations_generators.py:88:4 Incompatible return type [7]: Expected `int` but got `Generator[typing.Any, typing.Any, int]`.'] -Line 185: Unexpected errors ['annotations_generators.py:185:0 Incompatible variable type [9]: v1 is declared to have type `typing.Callable[[], Coroutine[typing.Any, typing.Any, AsyncIterator[int]]]` but is used as type `typing.Callable(generator29)[[], AsyncIterator[int]]`.'] -""" diff --git a/conformance/results/pyre/annotations_methods.toml b/conformance/results/pyre/annotations_methods.toml deleted file mode 100644 index 4c131204e..000000000 --- a/conformance/results/pyre/annotations_methods.toml +++ /dev/null @@ -1,10 +0,0 @@ -conformant = "Pass" -notes = """ -Type evaluation differs from other type checkers because of ambiguity in the spec related to method bindings. -""" -output = """ -annotations_methods.py:42:0 Assert type [70]: Expected `A` but got `B`. -""" -conformance_automated = "Pass" -errors_diff = """ -""" diff --git a/conformance/results/pyre/annotations_typeexpr.toml b/conformance/results/pyre/annotations_typeexpr.toml deleted file mode 100644 index 457e5a3d2..000000000 --- a/conformance/results/pyre/annotations_typeexpr.toml +++ /dev/null @@ -1,21 +0,0 @@ -conformant = "Pass" -output = """ -annotations_typeexpr.py:88:8 Invalid type [31]: Expression `eval("".join(map(chr, [105, 110, 116])))` is not a valid type. -annotations_typeexpr.py:89:8 Invalid type [31]: Expression `[int, str]` is not a valid type. -annotations_typeexpr.py:90:8 Invalid type [31]: Expression `(int, str)` is not a valid type. -annotations_typeexpr.py:91:8 Invalid type [31]: Expression `comprehension(int for generators(generator(i in range(1) if )))` is not a valid type. -annotations_typeexpr.py:92:8 Invalid type [31]: Expression `{ }` is not a valid type. -annotations_typeexpr.py:93:8 Invalid type [31]: Expression `lambda () (int)()` is not a valid type. -annotations_typeexpr.py:94:8 Invalid type [31]: Expression `[int][0]` is not a valid type. -annotations_typeexpr.py:95:8 Invalid type [31]: Expression `int if 1 < 3 else str` is not a valid type. -annotations_typeexpr.py:96:8 Undefined or invalid type [11]: Annotation `var1` is not defined as a type. -annotations_typeexpr.py:97:9 Invalid type [31]: Expression `True` is not a valid type. -annotations_typeexpr.py:98:9 Invalid type [31]: Expression `1` is not a valid type. -annotations_typeexpr.py:99:9 Invalid type [31]: Expression `-1` is not a valid type. -annotations_typeexpr.py:100:9 Invalid type [31]: Expression `int or str` is not a valid type. -annotations_typeexpr.py:101:9 Invalid type [31]: Expression `"int"` is not a valid type. -annotations_typeexpr.py:102:9 Undefined or invalid type [11]: Annotation `types` is not defined as a type. -""" -conformance_automated = "Pass" -errors_diff = """ -""" diff --git a/conformance/results/pyre/callables_annotation.toml b/conformance/results/pyre/callables_annotation.toml deleted file mode 100644 index 2d155ba04..000000000 --- a/conformance/results/pyre/callables_annotation.toml +++ /dev/null @@ -1,53 +0,0 @@ -conformant = "Partial" -notes = """ -Does not evaluate correct type for `*args: int` parameter. -Does not correctly implement type compatibility rules for "...". -Does not treat "*args: Any, **kwargs: Any" as "...". -""" -output = """ -callables_annotation.py:25:4 Missing argument [20]: PositionalOnly call expects argument in position 1. -callables_annotation.py:26:10 Incompatible parameter type [6]: In anonymous call, for 2nd positional argument, expected `str` but got `int`. -callables_annotation.py:27:4 Too many arguments [19]: PositionalOnly call expects 2 positional arguments, 3 were provided. -callables_annotation.py:29:4 Unexpected keyword [28]: Unexpected keyword argument `a` to anonymous call. -callables_annotation.py:35:4 Too many arguments [19]: PositionalOnly call expects 0 positional arguments, 1 was provided. -callables_annotation.py:55:4 Invalid type [31]: Expression `typing.Callable[int]` is not a valid type. -callables_annotation.py:56:4 Invalid type [31]: Expression `typing.Callable[(int, int)]` is not a valid type. -callables_annotation.py:57:4 Invalid type [31]: Expression `typing.Callable[([], [int])]` is not a valid type. -callables_annotation.py:58:4 Invalid type [31]: Expression `typing.Callable[(int, int, int)]` is not a valid type. -callables_annotation.py:59:4 Invalid type [31]: Expression `typing.Callable[([...], int)]` is not a valid type. -callables_annotation.py:89:5 Invalid type [31]: Expression `typing.Callable[(typing.Concatenate[(int, ...)], str)]` is not a valid type. -callables_annotation.py:145:8 Invalid type [31]: Expression `typing.Callable[(typing.Concatenate[(int, ...)], None)]` is not a valid type. -callables_annotation.py:151:9 Invalid type [31]: Expression `typing.Callable[(typing.Concatenate[(int, ...)], None)]` is not a valid type. -callables_annotation.py:155:4 Incompatible variable type [9]: ok9 is declared to have type `Proto4[[...]]` but is used as type `Proto3`. -callables_annotation.py:156:4 Incompatible variable type [9]: ok10 is declared to have type `Proto3` but is used as type `Proto4[[...]]`. -callables_annotation.py:157:4 Incompatible variable type [9]: ok11 is declared to have type `Proto6` but is used as type `Proto7`. -callables_annotation.py:159:4 Incompatible variable type [9]: err1 is declared to have type `Proto5[typing.Any]` but is used as type `Proto8`. -callables_annotation.py:166:0 Incompatible variable type [9]: Callback1 is declared to have type `TypeAlias` but is used as type `Type[typing.Callable[..., str]]`. -callables_annotation.py:167:0 Incompatible variable type [9]: Callback2 is declared to have type `TypeAlias` but is used as type `Type[typing.Callable[..., str]]`. -callables_annotation.py:171:8 Undefined or invalid type [11]: Annotation `Callback1` is not defined as a type. -callables_annotation.py:172:8 Undefined or invalid type [11]: Annotation `Callback2` is not defined as a type. -callables_annotation.py:181:0 Incompatible variable type [9]: CallbackWithInt is declared to have type `TypeAlias` but is used as type `Type[typing.Callable[..., str]]`. -callables_annotation.py:182:0 Incompatible variable type [9]: CallbackWithStr is declared to have type `TypeAlias` but is used as type `Type[typing.Callable[..., str]]`. -callables_annotation.py:186:8 Invalid type [31]: Expression `typing.Callable[(typing.Concatenate[(int, ...)], str)]` is not a valid type. -callables_annotation.py:187:8 Invalid type [31]: Expression `typing.Callable[(typing.Concatenate[(str, ...)], str)]` is not a valid type. -callables_annotation.py:188:8 Undefined or invalid type [11]: Annotation `CallbackWithInt` is not defined as a type. -callables_annotation.py:189:8 Undefined or invalid type [11]: Annotation `CallbackWithStr` is not defined as a type. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 91: Expected 1 errors -Line 93: Expected 1 errors -Line 89: Unexpected errors ['callables_annotation.py:89:5 Invalid type [31]: Expression `typing.Callable[(typing.Concatenate[(int, ...)], str)]` is not a valid type.'] -Line 145: Unexpected errors ['callables_annotation.py:145:8 Invalid type [31]: Expression `typing.Callable[(typing.Concatenate[(int, ...)], None)]` is not a valid type.'] -Line 151: Unexpected errors ['callables_annotation.py:151:9 Invalid type [31]: Expression `typing.Callable[(typing.Concatenate[(int, ...)], None)]` is not a valid type.'] -Line 155: Unexpected errors ['callables_annotation.py:155:4 Incompatible variable type [9]: ok9 is declared to have type `Proto4[[...]]` but is used as type `Proto3`.'] -Line 156: Unexpected errors ['callables_annotation.py:156:4 Incompatible variable type [9]: ok10 is declared to have type `Proto3` but is used as type `Proto4[[...]]`.'] -Line 157: Unexpected errors ['callables_annotation.py:157:4 Incompatible variable type [9]: ok11 is declared to have type `Proto6` but is used as type `Proto7`.'] -Line 166: Unexpected errors ['callables_annotation.py:166:0 Incompatible variable type [9]: Callback1 is declared to have type `TypeAlias` but is used as type `Type[typing.Callable[..., str]]`.'] -Line 167: Unexpected errors ['callables_annotation.py:167:0 Incompatible variable type [9]: Callback2 is declared to have type `TypeAlias` but is used as type `Type[typing.Callable[..., str]]`.'] -Line 171: Unexpected errors ['callables_annotation.py:171:8 Undefined or invalid type [11]: Annotation `Callback1` is not defined as a type.'] -Line 181: Unexpected errors ['callables_annotation.py:181:0 Incompatible variable type [9]: CallbackWithInt is declared to have type `TypeAlias` but is used as type `Type[typing.Callable[..., str]]`.'] -Line 182: Unexpected errors ['callables_annotation.py:182:0 Incompatible variable type [9]: CallbackWithStr is declared to have type `TypeAlias` but is used as type `Type[typing.Callable[..., str]]`.'] -Line 186: Unexpected errors ['callables_annotation.py:186:8 Invalid type [31]: Expression `typing.Callable[(typing.Concatenate[(int, ...)], str)]` is not a valid type.'] -Line 188: Unexpected errors ['callables_annotation.py:188:8 Undefined or invalid type [11]: Annotation `CallbackWithInt` is not defined as a type.'] -""" diff --git a/conformance/results/pyre/callables_kwargs.toml b/conformance/results/pyre/callables_kwargs.toml deleted file mode 100644 index a325fe97c..000000000 --- a/conformance/results/pyre/callables_kwargs.toml +++ /dev/null @@ -1,22 +0,0 @@ -conformant = "Pass" -notes = """ -""" -output = """ -callables_kwargs.py:46:4 Missing argument [20]: Call `func1` expects argument `v3`. -callables_kwargs.py:51:4 Unexpected keyword [28]: Unexpected keyword argument `v4` to call `func1`. -callables_kwargs.py:52:4 Too many arguments [19]: Call `func1` expects 0 positional arguments, 3 were provided. -callables_kwargs.py:58:12 Incompatible parameter type [6]: In call `func1`, for 1st positional argument, expected `TD2` but got `Dict[str, str]`. -callables_kwargs.py:61:12 Incompatible parameter type [6]: In call `func1`, for 1st positional argument, expected `TD2` but got `Dict[str, Union[int, str]]`. -callables_kwargs.py:63:4 Unexpected keyword [28]: Unexpected keyword argument `v1` to call `func1`. -callables_kwargs.py:64:4 Unexpected keyword [28]: Unexpected keyword argument `v3` to call `func2`. -callables_kwargs.py:65:4 Unexpected keyword [28]: Unexpected keyword argument `v1` to call `func2`. -callables_kwargs.py:101:0 Incompatible variable type [9]: v3 is declared to have type `TDProtocol3` but is used as type `typing.Callable(func1)[[Keywords(Unpack[TD2])], None]`. -callables_kwargs.py:102:0 Incompatible variable type [9]: v4 is declared to have type `TDProtocol4` but is used as type `typing.Callable(func1)[[Keywords(Unpack[TD2])], None]`. -callables_kwargs.py:103:0 Incompatible variable type [9]: v5 is declared to have type `TDProtocol5` but is used as type `typing.Callable(func1)[[Keywords(Unpack[TD2])], None]`. -callables_kwargs.py:111:21 Duplicate parameter [65]: Duplicate parameter name `v1`. -callables_kwargs.py:122:12 Invalid type [31]: `Unpack` in kwargs may only be used with typed dictionaries. `Variable[T (bound to TD2)]` is not a typed dictionary. -callables_kwargs.py:134:0 Incompatible variable type [9]: v7 is declared to have type `TDProtocol6` but is used as type `typing.Callable(func7)[[KeywordOnly(v1, int), KeywordOnly(v3, str), KeywordOnly(v2, str, default)], None]`. -""" -conformance_automated = "Pass" -errors_diff = """ -""" diff --git a/conformance/results/pyre/callables_protocol.toml b/conformance/results/pyre/callables_protocol.toml deleted file mode 100644 index a20e7472f..000000000 --- a/conformance/results/pyre/callables_protocol.toml +++ /dev/null @@ -1,32 +0,0 @@ -conformant = "Partial" -notes = """ -Does not correctly handle callback protocol that declares attributes in all functions. -Does not report type incompatibility for callback protocol with positional-only parameters. -Incorrectly reports type compatibility error with callback that has *args and **kwargs. -Does not report type incompatibility for callback missing a default argument for positional parameter. -Does not report type incompatibility for callback missing a default argument for keyword parameter. -""" -output = """ -callables_protocol.py:35:0 Incompatible variable type [9]: cb1 is declared to have type `Proto1` but is used as type `typing.Callable(cb1_bad1)[[Variable(bytes), KeywordOnly(max_items, Optional[int])], List[bytes]]`. -callables_protocol.py:36:0 Incompatible variable type [9]: cb1 is declared to have type `Proto1` but is used as type `typing.Callable(cb1_bad2)[[Variable(bytes)], List[bytes]]`. -callables_protocol.py:37:0 Incompatible variable type [9]: cb1 is declared to have type `Proto1` but is used as type `typing.Callable(cb1_bad3)[[Variable(bytes), KeywordOnly(max_len, Optional[str])], List[bytes]]`. -callables_protocol.py:67:0 Incompatible variable type [9]: cb2 is declared to have type `Proto2` but is used as type `typing.Callable(cb2_bad1)[[Variable(bytes)], typing.Any]`. -callables_protocol.py:68:0 Incompatible variable type [9]: cb2 is declared to have type `Proto2` but is used as type `typing.Callable(cb2_bad2)[[Variable(str), Keywords(str)], typing.Any]`. -callables_protocol.py:69:0 Incompatible variable type [9]: cb2 is declared to have type `Proto2` but is used as type `typing.Callable(cb2_bad3)[[Variable(bytes), Keywords(bytes)], typing.Any]`. -callables_protocol.py:70:0 Incompatible variable type [9]: cb2 is declared to have type `Proto2` but is used as type `typing.Callable(cb2_bad4)[[Keywords(str)], typing.Any]`. -callables_protocol.py:97:0 Incompatible variable type [9]: var4 is declared to have type `Proto4` but is used as type `typing.Callable(cb4_bad1)[[Named(x, int)], None]`. -callables_protocol.py:121:0 Incompatible variable type [9]: cb6 is declared to have type `NotProto6` but is used as type `typing.Callable(cb6_bad1)[[Variable(bytes), KeywordOnly(max_len, Optional[int], default)], List[bytes]]`. -callables_protocol.py:169:0 Incompatible variable type [9]: cb8 is declared to have type `Proto8` but is used as type `typing.Callable(cb8_bad1)[[Named(x, int)], typing.Any]`. -callables_protocol.py:186:4 Incompatible attribute type [8]: Attribute `other_attribute` declared in class `Proto9` has type `int` but is used as type `str`. -callables_protocol.py:187:4 Undefined attribute [16]: `Proto9` has no attribute `xxx`. -callables_protocol.py:197:6 Undefined attribute [16]: `Proto9` has no attribute `other_attribute2`. -callables_protocol.py:216:0 Incompatible variable type [9]: cb10 is declared to have type `Proto10` but is used as type `typing.Callable(cb10_good)[[], None]`. -callables_protocol.py:260:0 Incompatible variable type [9]: cb12 is declared to have type `Proto12` but is used as type `typing.Callable(cb12_bad1)[[Variable(typing.Any), KeywordOnly(kwarg0, typing.Any)], None]`. -callables_protocol.py:284:0 Incompatible variable type [9]: cb13_2 is declared to have type `Proto13_Default` but is used as type `typing.Callable(cb13_no_default)[[Named(path, str)], str]`. -callables_protocol.py:311:0 Incompatible variable type [9]: cb14_2 is declared to have type `Proto14_Default` but is used as type `typing.Callable(cb14_no_default)[[KeywordOnly(path, str)], str]`. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 238: Expected 1 errors -Line 216: Unexpected errors ['callables_protocol.py:216:0 Incompatible variable type [9]: cb10 is declared to have type `Proto10` but is used as type `typing.Callable(cb10_good)[[], None]`.'] -""" diff --git a/conformance/results/pyre/callables_subtyping.toml b/conformance/results/pyre/callables_subtyping.toml deleted file mode 100644 index 64b9b65f9..000000000 --- a/conformance/results/pyre/callables_subtyping.toml +++ /dev/null @@ -1,53 +0,0 @@ -conformant = "Partial" -notes = """ -Rejects standard parameter as incompatible with keyword-only parameter. -Rejects use of Callable with ParamSpec in TypeAlias definition. -""" -errors_diff = """ -Line 196: Expected 1 errors -Line 57: Unexpected errors ['callables_subtyping.py:57:4 Incompatible variable type [9]: f5 is declared to have type `KwOnly2` but is used as type `Standard2`.'] -Line 208: Unexpected errors ['callables_subtyping.py:208:0 Incompatible variable type [9]: TypeAliasWithP is declared to have type `TypeAlias` but is used as type `Type[typing.Callable[..., Variable[$synthetic_attribute_resolution_variable]]]`.', 'callables_subtyping.py:208:37 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[typing.Any, Type[Variable[$synthetic_attribute_resolution_variable]]]` but got `Tuple[ParamSpec, None]`.'] -Line 211: Unexpected errors ['callables_subtyping.py:211:39 Undefined or invalid type [11]: Annotation `TypeAliasWithP` is not defined as a type.'] -Line 253: Unexpected errors ['callables_subtyping.py:253:4 Missing overload implementation [42]: Overloaded function `Overloaded9.__call__` must have an implementation.'] -Line 282: Unexpected errors ['callables_subtyping.py:282:4 Missing overload implementation [42]: Overloaded function `Overloaded10.__call__` must have an implementation.'] -""" -output = """ -callables_subtyping.py:26:4 Incompatible variable type [9]: f6 is declared to have type `typing.Callable[[float], float]` but is used as type `typing.Callable[[int], int]`. -callables_subtyping.py:29:4 Incompatible variable type [9]: f8 is declared to have type `typing.Callable[[int], int]` but is used as type `typing.Callable[[float], float]`. -callables_subtyping.py:51:4 Incompatible variable type [9]: f1 is declared to have type `Standard2` but is used as type `PosOnly2`. -callables_subtyping.py:52:4 Incompatible variable type [9]: f2 is declared to have type `Standard2` but is used as type `KwOnly2`. -callables_subtyping.py:55:4 Incompatible variable type [9]: f4 is declared to have type `PosOnly2` but is used as type `KwOnly2`. -callables_subtyping.py:57:4 Incompatible variable type [9]: f5 is declared to have type `KwOnly2` but is used as type `Standard2`. -callables_subtyping.py:58:4 Incompatible variable type [9]: f6 is declared to have type `KwOnly2` but is used as type `PosOnly2`. -callables_subtyping.py:82:4 Incompatible variable type [9]: f3 is declared to have type `IntArgs3` but is used as type `NoArgs3`. -callables_subtyping.py:85:4 Incompatible variable type [9]: f5 is declared to have type `FloatArgs3` but is used as type `NoArgs3`. -callables_subtyping.py:86:4 Incompatible variable type [9]: f6 is declared to have type `FloatArgs3` but is used as type `IntArgs3`. -callables_subtyping.py:116:4 Incompatible variable type [9]: f1 is declared to have type `PosOnly4` but is used as type `IntArgs4`. -callables_subtyping.py:119:4 Incompatible variable type [9]: f4 is declared to have type `IntStrArgs4` but is used as type `StrArgs4`. -callables_subtyping.py:120:4 Incompatible variable type [9]: f5 is declared to have type `IntStrArgs4` but is used as type `IntArgs4`. -callables_subtyping.py:122:4 Incompatible variable type [9]: f7 is declared to have type `StrArgs4` but is used as type `IntArgs4`. -callables_subtyping.py:124:4 Incompatible variable type [9]: f9 is declared to have type `IntArgs4` but is used as type `StrArgs4`. -callables_subtyping.py:125:4 Incompatible variable type [9]: f10 is declared to have type `Standard4` but is used as type `IntStrArgs4`. -callables_subtyping.py:126:4 Incompatible variable type [9]: f11 is declared to have type `Standard4` but is used as type `StrArgs4`. -callables_subtyping.py:151:4 Incompatible variable type [9]: f3 is declared to have type `IntKwargs5` but is used as type `NoKwargs5`. -callables_subtyping.py:154:4 Incompatible variable type [9]: f5 is declared to have type `FloatKwargs5` but is used as type `NoKwargs5`. -callables_subtyping.py:155:4 Incompatible variable type [9]: f6 is declared to have type `FloatKwargs5` but is used as type `IntKwargs5`. -callables_subtyping.py:187:4 Incompatible variable type [9]: f1 is declared to have type `KwOnly6` but is used as type `IntKwargs6`. -callables_subtyping.py:190:4 Incompatible variable type [9]: f4 is declared to have type `IntStrKwargs6` but is used as type `StrKwargs6`. -callables_subtyping.py:191:4 Incompatible variable type [9]: f5 is declared to have type `IntStrKwargs6` but is used as type `IntKwargs6`. -callables_subtyping.py:193:4 Incompatible variable type [9]: f7 is declared to have type `StrKwargs6` but is used as type `IntKwargs6`. -callables_subtyping.py:195:4 Incompatible variable type [9]: f9 is declared to have type `IntKwargs6` but is used as type `StrKwargs6`. -callables_subtyping.py:197:4 Incompatible variable type [9]: f11 is declared to have type `Standard6` but is used as type `StrKwargs6`. -callables_subtyping.py:208:0 Incompatible variable type [9]: TypeAliasWithP is declared to have type `TypeAlias` but is used as type `Type[typing.Callable[..., Variable[$synthetic_attribute_resolution_variable]]]`. -callables_subtyping.py:208:37 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[typing.Any, Type[Variable[$synthetic_attribute_resolution_variable]]]` but got `Tuple[ParamSpec, None]`. -callables_subtyping.py:211:39 Undefined or invalid type [11]: Annotation `TypeAliasWithP` is not defined as a type. -callables_subtyping.py:236:4 Incompatible variable type [9]: f1 is declared to have type `DefaultArg8` but is used as type `NoDefaultArg8`. -callables_subtyping.py:237:4 Incompatible variable type [9]: f2 is declared to have type `DefaultArg8` but is used as type `NoX8`. -callables_subtyping.py:240:4 Incompatible variable type [9]: f4 is declared to have type `NoDefaultArg8` but is used as type `NoX8`. -callables_subtyping.py:243:4 Incompatible variable type [9]: f6 is declared to have type `NoX8` but is used as type `NoDefaultArg8`. -callables_subtyping.py:253:4 Missing overload implementation [42]: Overloaded function `Overloaded9.__call__` must have an implementation. -callables_subtyping.py:273:4 Incompatible variable type [9]: f3 is declared to have type `FloatArg9` but is used as type `Overloaded9`. -callables_subtyping.py:282:4 Missing overload implementation [42]: Overloaded function `Overloaded10.__call__` must have an implementation. -callables_subtyping.py:297:4 Incompatible variable type [9]: f2 is declared to have type `Overloaded10` but is used as type `StrArg10`. -""" -conformance_automated = "Fail" diff --git a/conformance/results/pyre/classes_classvar.toml b/conformance/results/pyre/classes_classvar.toml deleted file mode 100644 index 1f3bb297f..000000000 --- a/conformance/results/pyre/classes_classvar.toml +++ /dev/null @@ -1,37 +0,0 @@ -conformant = "Partial" -notes = """ -Does not reject use of TypeVar in ClassVar. -Does not reject use of ParamSpec in ClassVar. -Does not reject use of ClassVar as a generic type argument. -Does not reject use of ClassVar in parameter type annotation. -Does not reject use of ClassVar in local variable annotation. -Does not reject use of ClassVar in instance variable annotation. -Does not reject use of ClassVar in return type annotation. -Does not reject use of ClassVar in type alias definition. -Does not infer type from initialization for bare ClassVar. -""" -output = """ -classes_classvar.py:38:10 Invalid type parameters [24]: Generic type `CV` expects 1 type parameter, received 2. -classes_classvar.py:39:10 Invalid type [31]: Expression `typing.ClassVar[3]` is not a valid type. -classes_classvar.py:40:13 Unbound name [10]: Name `var` is used but not defined in the current scope. -classes_classvar.py:52:4 Incompatible attribute type [8]: Attribute `bad8` declared in class `ClassA` has type `List[str]` but is used as type `Dict[Variable[_KT], Variable[_VT]]`. -classes_classvar.py:66:4 Uninitialized attribute [13]: Attribute `good5` is declared in class `ClassA` to have type `typing.Any` but is never initialized. -classes_classvar.py:71:8 Undefined attribute [16]: `ClassA` has no attribute `xx`. -classes_classvar.py:74:8 Incompatible return type [7]: Expected `CV[int]` but got `int`. -classes_classvar.py:111:0 Invalid assignment [41]: Assigning to class variable through instance, did you mean to assign to `Starship.stats` instead? -classes_classvar.py:140:0 Incompatible variable type [9]: a is declared to have type `ProtoA` but is used as type `ProtoAImpl`. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 45: Expected 1 errors -Line 46: Expected 1 errors -Line 47: Expected 1 errors -Line 54: Expected 1 errors -Line 55: Expected 1 errors -Line 69: Expected 1 errors -Line 70: Expected 1 errors -Line 73: Expected 1 errors -Line 77: Expected 1 errors -Line 78: Expected 1 errors -Line 74: Unexpected errors ['classes_classvar.py:74:8 Incompatible return type [7]: Expected `CV[int]` but got `int`.'] -""" diff --git a/conformance/results/pyre/classes_override.toml b/conformance/results/pyre/classes_override.toml deleted file mode 100644 index bb4595083..000000000 --- a/conformance/results/pyre/classes_override.toml +++ /dev/null @@ -1,14 +0,0 @@ -conformant = "Pass" -notes = """ -""" -output = """ -classes_override.py:53:4 Invalid override [40]: `classes_override.ChildA.method3` is decorated with @override, but no method of the same name exists in superclasses of `ChildA`. -classes_override.py:65:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s). -classes_override.py:65:4 Invalid override [40]: `classes_override.ChildA.method4` is decorated with @override, but no method of the same name exists in superclasses of `ChildA`. -classes_override.py:79:4 Invalid override [40]: `classes_override.ChildA.static_method1` is decorated with @override, but no method of the same name exists in superclasses of `ChildA`. -classes_override.py:84:4 Invalid override [40]: `classes_override.ChildA.class_method1` is decorated with @override, but no method of the same name exists in superclasses of `ChildA`. -classes_override.py:89:4 Invalid override [40]: `classes_override.ChildA.property1` is decorated with @override, but no method of the same name exists in superclasses of `ChildA`. -""" -conformance_automated = "Pass" -errors_diff = """ -""" diff --git a/conformance/results/pyre/constructors_call_init.toml b/conformance/results/pyre/constructors_call_init.toml deleted file mode 100644 index 0db6964ff..000000000 --- a/conformance/results/pyre/constructors_call_init.toml +++ /dev/null @@ -1,28 +0,0 @@ -conformant = "Partial" -notes = """ -Does not infer type of Self for self parameter of __init__ method. -Does not report errors during binding to self parameter of __init__ method. -Does not reject use of class-scoped type variables in annotation of self parameter in __init__ method. -Incorrectly raises Incompatible overload type errors. -Incorrectly raises compatibility type errors. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 42: Expected 1 errors -Line 56: Expected 1 errors -Line 107: Expected 1 errors -Line 24: Unexpected errors ['constructors_call_init.py:24:0 Assert type [70]: Expected `Class1[int]` but got `Class1[typing_extensions.Literal[1]]`.'] -Line 61: Unexpected errors ['constructors_call_init.py:61:4 Incompatible overload [43]: The implementation of `Class5.__init__` does not accept all possible arguments of overload defined on line `61`.'] -Line 63: Unexpected errors ['constructors_call_init.py:63:4 Incompatible overload [43]: The implementation of `Class5.__init__` does not accept all possible arguments of overload defined on line `63`.'] -Line 91: Unexpected errors ["constructors_call_init.py:91:0 Assert type [70]: Expected `Class6[int, str]` but got `Class6[typing_extensions.Literal[0], typing_extensions.Literal['']]`."] -Line 99: Unexpected errors ["constructors_call_init.py:99:0 Assert type [70]: Expected `Class7[str, int]` but got `Class7[typing_extensions.Literal[''], typing_extensions.Literal[0]]`."] -""" -output = """ -constructors_call_init.py:21:12 Incompatible parameter type [6]: In call `Class1.__init__`, for 1st positional argument, expected `int` but got `float`. -constructors_call_init.py:24:0 Assert type [70]: Expected `Class1[int]` but got `Class1[typing_extensions.Literal[1]]`. -constructors_call_init.py:61:4 Incompatible overload [43]: The implementation of `Class5.__init__` does not accept all possible arguments of overload defined on line `61`. -constructors_call_init.py:63:4 Incompatible overload [43]: The implementation of `Class5.__init__` does not accept all possible arguments of overload defined on line `63`. -constructors_call_init.py:91:0 Assert type [70]: Expected `Class6[int, str]` but got `Class6[typing_extensions.Literal[0], typing_extensions.Literal['']]`. -constructors_call_init.py:99:0 Assert type [70]: Expected `Class7[str, int]` but got `Class7[typing_extensions.Literal[''], typing_extensions.Literal[0]]`. -constructors_call_init.py:130:0 Too many arguments [19]: Call `object.__init__` expects 0 positional arguments, 1 was provided. -""" diff --git a/conformance/results/pyre/constructors_call_metaclass.toml b/conformance/results/pyre/constructors_call_metaclass.toml deleted file mode 100644 index 2eb021bba..000000000 --- a/conformance/results/pyre/constructors_call_metaclass.toml +++ /dev/null @@ -1,13 +0,0 @@ -conformant = "Partial" -notes = """ -Does not evaluate __new__ if metaclass __call__ is defined. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 54: Expected 1 errors -Line 68: Expected 1 errors -Line 69: Unexpected errors ['constructors_call_metaclass.py:69:0 Assert type [70]: Expected `Class4` but got `typing.Any`.'] -""" -output = """ -constructors_call_metaclass.py:69:0 Assert type [70]: Expected `Class4` but got `typing.Any`. -""" diff --git a/conformance/results/pyre/constructors_call_new.toml b/conformance/results/pyre/constructors_call_new.toml deleted file mode 100644 index f0be57944..000000000 --- a/conformance/results/pyre/constructors_call_new.toml +++ /dev/null @@ -1,31 +0,0 @@ -conformant = "Partial" -notes = """ -Does not support __new__ return type that is not a subclass of the class being constructed. -Does not report errors during binding to cls parameter of __new__ method. -Incorrectly raises compatibility type errors. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 145: Expected 1 errors -Line 23: Unexpected errors ['constructors_call_new.py:23:0 Assert type [70]: Expected `Class1[int]` but got `Class1[typing_extensions.Literal[1]]`.'] -Line 35: Unexpected errors ['constructors_call_new.py:35:0 Assert type [70]: Expected `Class2[int]` but got `Class2[typing_extensions.Literal[1]]`.'] -Line 36: Unexpected errors ["constructors_call_new.py:36:0 Assert type [70]: Expected `Class2[str]` but got `Class2[typing_extensions.Literal['']]`."] -Line 49: Unexpected errors ['constructors_call_new.py:49:0 Assert type [70]: Expected `int` but got `Class3`.', 'constructors_call_new.py:49:12 Missing argument [20]: Call `Class3.__init__` expects argument `x`.'] -Line 64: Unexpected errors ['constructors_call_new.py:64:0 Assert type [70]: Expected `typing.Any` but got `Class4`.', 'constructors_call_new.py:64:12 Missing argument [20]: Call `Class4.__init__` expects argument `x`.'] -Line 76: Unexpected errors ['constructors_call_new.py:76:4 Assert type [70]: Expected `NoReturn` but got `Class5`.', 'constructors_call_new.py:76:16 Missing argument [20]: Call `Class5.__init__` expects argument `x`.'] -Line 89: Unexpected errors ['constructors_call_new.py:89:0 Assert type [70]: Expected `Union[Class6, int]` but got `Class6`.', 'constructors_call_new.py:89:12 Missing argument [20]: Call `Class6.__init__` expects argument `x`.'] -""" -output = """ -constructors_call_new.py:21:12 Incompatible parameter type [6]: In call `Class1.__new__`, for 1st positional argument, expected `int` but got `float`. -constructors_call_new.py:23:0 Assert type [70]: Expected `Class1[int]` but got `Class1[typing_extensions.Literal[1]]`. -constructors_call_new.py:35:0 Assert type [70]: Expected `Class2[int]` but got `Class2[typing_extensions.Literal[1]]`. -constructors_call_new.py:36:0 Assert type [70]: Expected `Class2[str]` but got `Class2[typing_extensions.Literal['']]`. -constructors_call_new.py:49:0 Assert type [70]: Expected `int` but got `Class3`. -constructors_call_new.py:49:12 Missing argument [20]: Call `Class3.__init__` expects argument `x`. -constructors_call_new.py:64:0 Assert type [70]: Expected `typing.Any` but got `Class4`. -constructors_call_new.py:64:12 Missing argument [20]: Call `Class4.__init__` expects argument `x`. -constructors_call_new.py:76:4 Assert type [70]: Expected `NoReturn` but got `Class5`. -constructors_call_new.py:76:16 Missing argument [20]: Call `Class5.__init__` expects argument `x`. -constructors_call_new.py:89:0 Assert type [70]: Expected `Union[Class6, int]` but got `Class6`. -constructors_call_new.py:89:12 Missing argument [20]: Call `Class6.__init__` expects argument `x`. -""" diff --git a/conformance/results/pyre/constructors_call_type.toml b/conformance/results/pyre/constructors_call_type.toml deleted file mode 100644 index b78a1daf4..000000000 --- a/conformance/results/pyre/constructors_call_type.toml +++ /dev/null @@ -1,14 +0,0 @@ -conformant = "Pass" -errors_diff = """ -""" -output = """ -constructors_call_type.py:30:4 Missing argument [20]: Call `Meta1.__call__` expects argument `x`. -constructors_call_type.py:40:4 Missing argument [20]: Call `Class2.__new__` expects argument `x`. -constructors_call_type.py:50:4 Missing argument [20]: Call `Class3.__init__` expects argument `x`. -constructors_call_type.py:59:4 Too many arguments [19]: Call `object.__init__` expects 0 positional arguments, 1 was provided. -constructors_call_type.py:64:4 Too many arguments [19]: Call `object.__init__` expects 0 positional arguments, 1 was provided. -constructors_call_type.py:72:4 Missing argument [20]: Call `Meta1.__call__` expects argument `x`. -constructors_call_type.py:81:4 Missing argument [20]: Call `Class2.__new__` expects argument `y`. -constructors_call_type.py:82:11 Incompatible parameter type [6]: In call `Class2.__new__`, for 2nd positional argument, expected `str` but got `int`. -""" -conformance_automated = "Pass" diff --git a/conformance/results/pyre/constructors_callable.toml b/conformance/results/pyre/constructors_callable.toml deleted file mode 100644 index 0f3650ea0..000000000 --- a/conformance/results/pyre/constructors_callable.toml +++ /dev/null @@ -1,60 +0,0 @@ -conformant = "Partial" -notes = """ -Does not generate a union type for __new__ and __init__ when converting class to callable. -Does not ignore __init__ based on __new__ return type when converting class to callable. -Does not support __new__ return type that is different from class being constructed. -Does not use annotated type of self in __init__ method to generate return type of callable. -Incorrectly raises incompatibility type errors. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 127: Expected 1 errors -Line 144: Expected 1 errors -Line 184: Expected 1 errors -Line 195: Expected 1 errors -Line 78: Unexpected errors ['constructors_callable.py:78:0 Assert type [70]: Expected `int` but got `Class4`.'] -Line 126: Unexpected errors ['constructors_callable.py:126:0 Assert type [70]: Expected `Class6Proxy` but got `Class6`.', 'constructors_callable.py:126:12 Missing argument [20]: PositionalOnly call expects argument `x`.'] -Line 143: Unexpected errors ['constructors_callable.py:143:0 Assert type [70]: Expected `typing.Any` but got `Class6Any`.', 'constructors_callable.py:143:12 Missing argument [20]: PositionalOnly call expects argument `x`.'] -Line 153: Unexpected errors ['constructors_callable.py:153:4 Incompatible overload [43]: The implementation of `Class7.__init__` does not accept all possible arguments of overload defined on line `153`.'] -Line 155: Unexpected errors ['constructors_callable.py:155:4 Incompatible overload [43]: The implementation of `Class7.__init__` does not accept all possible arguments of overload defined on line `155`.'] -Line 164: Unexpected errors ['constructors_callable.py:164:0 Assert type [70]: Expected `Class7[int]` but got `Class7[typing.Any]`.'] -Line 165: Unexpected errors ['constructors_callable.py:165:0 Assert type [70]: Expected `Class7[str]` but got `Class7[typing.Any]`.', 'constructors_callable.py:165:15 Incompatible parameter type [6]: In anonymous call, for 1st positional argument, expected `int` but got `str`.'] -Line 181: Unexpected errors ['constructors_callable.py:181:22 Incompatible parameter type [6]: In call `accepts_callable`, for 1st positional argument, expected `typing.Callable[constructors_callable.P, Variable[R]]` but got `Type[Class8]`.'] -Line 183: Unexpected errors ['constructors_callable.py:183:0 Assert type [70]: Expected `Class8[str]` but got `typing.Any`.'] -Line 192: Unexpected errors ['constructors_callable.py:192:22 Incompatible parameter type [6]: In call `accepts_callable`, for 1st positional argument, expected `typing.Callable[constructors_callable.P, Variable[R]]` but got `Type[Class9]`.'] -Line 194: Unexpected errors ['constructors_callable.py:194:0 Assert type [70]: Expected `Class9` but got `typing.Any`.'] -""" -output = """ -constructors_callable.py:36:0 Revealed type [-1]: Revealed type for `r1` is `typing.Callable[[Named(x, int)], Class1]`. -constructors_callable.py:38:0 Missing argument [20]: PositionalOnly call expects argument `x`. -constructors_callable.py:39:0 Unexpected keyword [28]: Unexpected keyword argument `y` to anonymous call. -constructors_callable.py:49:0 Revealed type [-1]: Revealed type for `r2` is `typing.Callable[[], Class2]`. -constructors_callable.py:51:0 Too many arguments [19]: PositionalOnly call expects 0 positional arguments, 1 was provided. -constructors_callable.py:63:0 Revealed type [-1]: Revealed type for `r3` is `typing.Callable[[Named(x, int)], Class3]`. -constructors_callable.py:65:0 Missing argument [20]: PositionalOnly call expects argument `x`. -constructors_callable.py:66:0 Unexpected keyword [28]: Unexpected keyword argument `y` to anonymous call. -constructors_callable.py:67:0 Too many arguments [19]: PositionalOnly call expects 1 positional argument, 2 were provided. -constructors_callable.py:77:0 Revealed type [-1]: Revealed type for `r4` is `typing.Callable[[Named(x, int)], Class4]`. -constructors_callable.py:78:0 Assert type [70]: Expected `int` but got `Class4`. -constructors_callable.py:79:0 Missing argument [20]: PositionalOnly call expects argument `x`. -constructors_callable.py:80:0 Unexpected keyword [28]: Unexpected keyword argument `y` to anonymous call. -constructors_callable.py:97:0 Revealed type [-1]: Revealed type for `r5` is `typing.Callable[[Variable(typing.Any), Keywords(typing.Any)], NoReturn]`. -constructors_callable.py:125:0 Revealed type [-1]: Revealed type for `r6` is `typing.Callable[[Named(x, int)], Class6]`. -constructors_callable.py:126:0 Assert type [70]: Expected `Class6Proxy` but got `Class6`. -constructors_callable.py:126:12 Missing argument [20]: PositionalOnly call expects argument `x`. -constructors_callable.py:142:0 Revealed type [-1]: Revealed type for `r6_any` is `typing.Callable[[Named(x, int)], Class6Any]`. -constructors_callable.py:143:0 Assert type [70]: Expected `typing.Any` but got `Class6Any`. -constructors_callable.py:143:12 Missing argument [20]: PositionalOnly call expects argument `x`. -constructors_callable.py:153:4 Incompatible overload [43]: The implementation of `Class7.__init__` does not accept all possible arguments of overload defined on line `153`. -constructors_callable.py:155:4 Incompatible overload [43]: The implementation of `Class7.__init__` does not accept all possible arguments of overload defined on line `155`. -constructors_callable.py:161:0 Revealed type [-1]: Revealed type for `r7` is `typing.Callable[[Named(x, int)], Class7[typing.Any]]`. -constructors_callable.py:164:0 Assert type [70]: Expected `Class7[int]` but got `Class7[typing.Any]`. -constructors_callable.py:165:0 Assert type [70]: Expected `Class7[str]` but got `Class7[typing.Any]`. -constructors_callable.py:165:15 Incompatible parameter type [6]: In anonymous call, for 1st positional argument, expected `int` but got `str`. -constructors_callable.py:181:22 Incompatible parameter type [6]: In call `accepts_callable`, for 1st positional argument, expected `typing.Callable[constructors_callable.P, Variable[R]]` but got `Type[Class8]`. -constructors_callable.py:182:0 Revealed type [-1]: Revealed type for `r8` is `typing.Callable[..., typing.Any]`. -constructors_callable.py:183:0 Assert type [70]: Expected `Class8[str]` but got `typing.Any`. -constructors_callable.py:192:22 Incompatible parameter type [6]: In call `accepts_callable`, for 1st positional argument, expected `typing.Callable[constructors_callable.P, Variable[R]]` but got `Type[Class9]`. -constructors_callable.py:193:0 Revealed type [-1]: Revealed type for `r9` is `typing.Callable[..., typing.Any]`. -constructors_callable.py:194:0 Assert type [70]: Expected `Class9` but got `typing.Any`. -""" diff --git a/conformance/results/pyre/constructors_consistency.toml b/conformance/results/pyre/constructors_consistency.toml deleted file mode 100644 index 654ebaa96..000000000 --- a/conformance/results/pyre/constructors_consistency.toml +++ /dev/null @@ -1,9 +0,0 @@ -conformant = "Pass" -notes = """ -Does not report inconsistency between __new__ and __init__ (optional). -""" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -""" diff --git a/conformance/results/pyre/dataclasses_descriptors.toml b/conformance/results/pyre/dataclasses_descriptors.toml deleted file mode 100644 index 05c108e48..000000000 --- a/conformance/results/pyre/dataclasses_descriptors.toml +++ /dev/null @@ -1,20 +0,0 @@ -conformant = "Partial" -notes = """ -Incorrectly generates error when calling constructor of dataclass with descriptor. -Incorrectly raises incompatibility type errors. -""" -output = """ -dataclasses_descriptors.py:35:10 Incompatible parameter type [6]: In call `DC1.__init__`, for 1st positional argument, expected `Desc1` but got `int`. -dataclasses_descriptors.py:61:0 Assert type [70]: Expected `List[int]` but got `Desc2[int]`. -dataclasses_descriptors.py:62:0 Assert type [70]: Expected `List[str]` but got `Desc2[str]`. -dataclasses_descriptors.py:66:0 Assert type [70]: Expected `int` but got `Desc2[int]`. -dataclasses_descriptors.py:67:0 Assert type [70]: Expected `str` but got `Desc2[str]`. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 35: Unexpected errors ['dataclasses_descriptors.py:35:10 Incompatible parameter type [6]: In call `DC1.__init__`, for 1st positional argument, expected `Desc1` but got `int`.'] -Line 61: Unexpected errors ['dataclasses_descriptors.py:61:0 Assert type [70]: Expected `List[int]` but got `Desc2[int]`.'] -Line 62: Unexpected errors ['dataclasses_descriptors.py:62:0 Assert type [70]: Expected `List[str]` but got `Desc2[str]`.'] -Line 66: Unexpected errors ['dataclasses_descriptors.py:66:0 Assert type [70]: Expected `int` but got `Desc2[int]`.'] -Line 67: Unexpected errors ['dataclasses_descriptors.py:67:0 Assert type [70]: Expected `str` but got `Desc2[str]`.'] -""" diff --git a/conformance/results/pyre/dataclasses_final.toml b/conformance/results/pyre/dataclasses_final.toml deleted file mode 100644 index c579f1329..000000000 --- a/conformance/results/pyre/dataclasses_final.toml +++ /dev/null @@ -1,11 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -dataclasses_final.py:27:0 Invalid assignment [41]: Cannot reassign final attribute `D.final_classvar`. -dataclasses_final.py:35:0 Invalid assignment [41]: Cannot reassign final attribute `d.final_no_default`. -dataclasses_final.py:36:0 Invalid assignment [41]: Cannot reassign final attribute `d.final_with_default`. -dataclasses_final.py:37:0 Invalid assignment [41]: Cannot reassign final attribute `D.final_no_default`. -dataclasses_final.py:38:0 Invalid assignment [41]: Cannot reassign final attribute `D.final_with_default`. -""" diff --git a/conformance/results/pyre/dataclasses_frozen.toml b/conformance/results/pyre/dataclasses_frozen.toml deleted file mode 100644 index 410c163f9..000000000 --- a/conformance/results/pyre/dataclasses_frozen.toml +++ /dev/null @@ -1,10 +0,0 @@ -conformant = "Pass" -output = """ -dataclasses_frozen.py:16:0 Invalid assignment [41]: Cannot reassign final attribute `dc1.a`. -dataclasses_frozen.py:17:0 Invalid assignment [41]: Cannot reassign final attribute `dc1.b`. -dataclasses_frozen.py:23:0 Invalid inheritance [39]: Non-frozen dataclass `DC2` cannot inherit from frozen dataclass `DC1`. -dataclasses_frozen.py:33:0 Invalid inheritance [39]: Frozen dataclass `DC4` cannot inherit from non-frozen dataclass `DC3`. -""" -conformance_automated = "Pass" -errors_diff = """ -""" diff --git a/conformance/results/pyre/dataclasses_hash.toml b/conformance/results/pyre/dataclasses_hash.toml deleted file mode 100644 index 7af6dcbdc..000000000 --- a/conformance/results/pyre/dataclasses_hash.toml +++ /dev/null @@ -1,11 +0,0 @@ -conformant = "Partial" -notes = """ -Does not report when dataclass is not compatible with Hashable protocol. -""" -output = """ -""" -conformance_automated = "Fail" -errors_diff = """ -Line 15: Expected 1 errors -Line 32: Expected 1 errors -""" diff --git a/conformance/results/pyre/dataclasses_inheritance.toml b/conformance/results/pyre/dataclasses_inheritance.toml deleted file mode 100644 index 1afca3581..000000000 --- a/conformance/results/pyre/dataclasses_inheritance.toml +++ /dev/null @@ -1,12 +0,0 @@ -conformant = "Partial" -notes = """ -Does not reject ClassVar that is overridden by instance variable. -Does not reject instance variable that is overridden by ClassVar. -""" -output = """ -""" -conformance_automated = "Fail" -errors_diff = """ -Line 62: Expected 1 errors -Line 66: Expected 1 errors -""" diff --git a/conformance/results/pyre/dataclasses_kwonly.toml b/conformance/results/pyre/dataclasses_kwonly.toml deleted file mode 100644 index 9e66c08f0..000000000 --- a/conformance/results/pyre/dataclasses_kwonly.toml +++ /dev/null @@ -1,14 +0,0 @@ -conformant = "Partial" -notes = """ -Rejects legitimate use of dataclass field with `kw_only=True`. -""" -output = """ -dataclasses_kwonly.py:23:0 Too many arguments [19]: Call `DC1.__init__` expects 1 positional argument, 2 were provided. -dataclasses_kwonly.py:38:0 Too many arguments [19]: Call `DC2.__init__` expects 1 positional argument, 2 were provided. -dataclasses_kwonly.py:53:0 Too many arguments [19]: Call `DC3.__init__` expects 1 positional argument, 2 were provided. -dataclasses_kwonly.py:61:0 Unexpected keyword [28]: Unexpected keyword argument `b` to call `DC4.__init__`. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 61: Unexpected errors ['dataclasses_kwonly.py:61:0 Unexpected keyword [28]: Unexpected keyword argument `b` to call `DC4.__init__`.'] -""" diff --git a/conformance/results/pyre/dataclasses_match_args.toml b/conformance/results/pyre/dataclasses_match_args.toml deleted file mode 100644 index d7bd79617..000000000 --- a/conformance/results/pyre/dataclasses_match_args.toml +++ /dev/null @@ -1,12 +0,0 @@ -conformant = "Partial" -notes = """ -Adds kw-only fields to __match_args__. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 18: Unexpected errors ["dataclasses_match_args.py:18:0 Assert type [70]: Expected `Tuple[typing_extensions.Literal['x']]` but got `Tuple[typing_extensions.Literal['x'], typing_extensions.Literal['*'], typing_extensions.Literal['y']]`."] -""" -output = """ -dataclasses_match_args.py:18:0 Assert type [70]: Expected `Tuple[typing_extensions.Literal['x']]` but got `Tuple[typing_extensions.Literal['x'], typing_extensions.Literal['*'], typing_extensions.Literal['y']]`. -dataclasses_match_args.py:42:0 Undefined attribute [16]: `DC4` has no attribute `__match_args__`. -""" diff --git a/conformance/results/pyre/dataclasses_order.toml b/conformance/results/pyre/dataclasses_order.toml deleted file mode 100644 index 0452db28b..000000000 --- a/conformance/results/pyre/dataclasses_order.toml +++ /dev/null @@ -1,7 +0,0 @@ -conformant = "Pass" -output = """ -dataclasses_order.py:50:3 Unsupported operand [58]: `<` is not supported for operand types `DC1` and `DC2`. -""" -conformance_automated = "Pass" -errors_diff = """ -""" diff --git a/conformance/results/pyre/dataclasses_postinit.toml b/conformance/results/pyre/dataclasses_postinit.toml deleted file mode 100644 index 311994866..000000000 --- a/conformance/results/pyre/dataclasses_postinit.toml +++ /dev/null @@ -1,28 +0,0 @@ -conformant = "Partial" -notes = """ -Does not perform validation of `__post_init__` method. -Incorrectly complains on the assignment of `InitVar` in class bodies. -""" -output = """ -dataclasses_postinit.py:15:4 Undefined attribute [16]: `typing.Type` has no attribute `x`. -dataclasses_postinit.py:17:4 Undefined attribute [16]: `typing.Type` has no attribute `y`. -dataclasses_postinit.py:28:6 Undefined attribute [16]: `DC1` has no attribute `x`. -dataclasses_postinit.py:29:6 Undefined attribute [16]: `DC1` has no attribute `y`. -dataclasses_postinit.py:33:4 Undefined attribute [16]: `typing.Type` has no attribute `x`. -dataclasses_postinit.py:34:4 Undefined attribute [16]: `typing.Type` has no attribute `y`. -dataclasses_postinit.py:42:4 Undefined attribute [16]: `typing.Type` has no attribute `_name`. -dataclasses_postinit.py:51:4 Undefined attribute [16]: `typing.Type` has no attribute `_age`. -dataclasses_postinit.py:54:4 Inconsistent override [14]: `dataclasses_postinit.DC4.__post_init__` overrides method defined in `DC3` inconsistently. Could not find parameter `_age` in overridden signature. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 19: Expected 1 errors -Line 36: Expected 1 errors -Line 15: Unexpected errors ['dataclasses_postinit.py:15:4 Undefined attribute [16]: `typing.Type` has no attribute `x`.'] -Line 17: Unexpected errors ['dataclasses_postinit.py:17:4 Undefined attribute [16]: `typing.Type` has no attribute `y`.'] -Line 33: Unexpected errors ['dataclasses_postinit.py:33:4 Undefined attribute [16]: `typing.Type` has no attribute `x`.'] -Line 34: Unexpected errors ['dataclasses_postinit.py:34:4 Undefined attribute [16]: `typing.Type` has no attribute `y`.'] -Line 42: Unexpected errors ['dataclasses_postinit.py:42:4 Undefined attribute [16]: `typing.Type` has no attribute `_name`.'] -Line 51: Unexpected errors ['dataclasses_postinit.py:51:4 Undefined attribute [16]: `typing.Type` has no attribute `_age`.'] -Line 54: Unexpected errors ['dataclasses_postinit.py:54:4 Inconsistent override [14]: `dataclasses_postinit.DC4.__post_init__` overrides method defined in `DC3` inconsistently. Could not find parameter `_age` in overridden signature.'] -""" diff --git a/conformance/results/pyre/dataclasses_slots.toml b/conformance/results/pyre/dataclasses_slots.toml deleted file mode 100644 index ca83a885b..000000000 --- a/conformance/results/pyre/dataclasses_slots.toml +++ /dev/null @@ -1,16 +0,0 @@ -conformant = "Partial" -notes = """ -Does not report error when `slots=True` is used with `__slots__` definition. -Does not reject write to instance variable that is not defined in __slots__. -Does not reject access to `__slots__` from dataclass instance when `slots=False`. -""" -output = """ -dataclasses_slots.py:66:0 Undefined attribute [16]: `DC6` has no attribute `__slots__`. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 25: Expected 1 errors -Line 38: Expected 1 errors -Line 69: Expected 1 errors -Lines 10, 11: Expected error (tag 'DC1') -""" diff --git a/conformance/results/pyre/dataclasses_transform_class.toml b/conformance/results/pyre/dataclasses_transform_class.toml deleted file mode 100644 index bdb113d36..000000000 --- a/conformance/results/pyre/dataclasses_transform_class.toml +++ /dev/null @@ -1,22 +0,0 @@ -conformant = "Partial" -notes = """ -Does not support field specifiers. -Emits "attribute not initialized" error for dataclass field. -""" -output = """ -dataclasses_transform_class.py:51:0 Invalid inheritance [39]: Non-frozen dataclass `Customer1Subclass` cannot inherit from frozen dataclass `Customer1`. -dataclasses_transform_class.py:60:7 Unexpected keyword [28]: Unexpected keyword argument `other_name` to call `Customer1.__init__`. -dataclasses_transform_class.py:63:0 Invalid assignment [41]: Cannot reassign final attribute `c1_1.id`. -dataclasses_transform_class.py:66:7 Too many arguments [19]: Call `Customer1.__init__` expects 0 positional arguments, 2 were provided. -dataclasses_transform_class.py:72:5 Unsupported operand [58]: `<` is not supported for operand types `Customer1` and `Customer1`. -dataclasses_transform_class.py:82:7 Too many arguments [19]: Call `Customer2.__init__` expects 0 positional arguments, 2 were provided. -dataclasses_transform_class.py:90:4 Uninitialized attribute [13]: Attribute `not_a_field` is declared in class `GenericModelBase` to have type `Variable[T]` but is never initialized. -dataclasses_transform_class.py:111:4 Uninitialized attribute [13]: Attribute `not_a_field` is declared in class `ModelBaseFrozen` to have type `str` but is never initialized. -dataclasses_transform_class.py:122:0 Invalid assignment [41]: Cannot reassign final attribute `c3_1.id`. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 60: Unexpected errors ['dataclasses_transform_class.py:60:7 Unexpected keyword [28]: Unexpected keyword argument `other_name` to call `Customer1.__init__`.'] -Line 90: Unexpected errors ['dataclasses_transform_class.py:90:4 Uninitialized attribute [13]: Attribute `not_a_field` is declared in class `GenericModelBase` to have type `Variable[T]` but is never initialized.'] -Line 111: Unexpected errors ['dataclasses_transform_class.py:111:4 Uninitialized attribute [13]: Attribute `not_a_field` is declared in class `ModelBaseFrozen` to have type `str` but is never initialized.'] -""" diff --git a/conformance/results/pyre/dataclasses_transform_converter.toml b/conformance/results/pyre/dataclasses_transform_converter.toml deleted file mode 100644 index 810debaef..000000000 --- a/conformance/results/pyre/dataclasses_transform_converter.toml +++ /dev/null @@ -1,48 +0,0 @@ -conformant = "Unsupported" -notes = """ -Converter parameter not yet supported. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 118: Expected 1 errors -Line 112: Unexpected errors ['dataclasses_transform_converter.py:112:10 Incompatible parameter type [6]: In call `DC2.__init__`, for 1st positional argument, expected `int` but got `str`.', 'dataclasses_transform_converter.py:112:16 Incompatible parameter type [6]: In call `DC2.__init__`, for 2nd positional argument, expected `int` but got `str`.', 'dataclasses_transform_converter.py:112:22 Incompatible parameter type [6]: In call `DC2.__init__`, for 3rd positional argument, expected `int` but got `str`.', 'dataclasses_transform_converter.py:112:28 Incompatible parameter type [6]: In call `DC2.__init__`, for 4th positional argument, expected `ConverterClass` but got `bytes`.', 'dataclasses_transform_converter.py:112:35 Incompatible parameter type [6]: In call `DC2.__init__`, for 5th positional argument, expected `int` but got `List[Variable[_T]]`.'] -Line 114: Unexpected errors ['dataclasses_transform_converter.py:114:0 Incompatible attribute type [8]: Attribute `field0` declared in class `DC2` has type `int` but is used as type `str`.'] -Line 115: Unexpected errors ['dataclasses_transform_converter.py:115:0 Incompatible attribute type [8]: Attribute `field3` declared in class `DC2` has type `ConverterClass` but is used as type `str`.'] -Line 116: Unexpected errors ['dataclasses_transform_converter.py:116:0 Incompatible attribute type [8]: Attribute `field3` declared in class `DC2` has type `ConverterClass` but is used as type `bytes`.'] -Line 121: Unexpected errors ['dataclasses_transform_converter.py:121:10 Incompatible parameter type [6]: In call `DC2.__init__`, for 1st positional argument, expected `int` but got `str`.', 'dataclasses_transform_converter.py:121:16 Incompatible parameter type [6]: In call `DC2.__init__`, for 2nd positional argument, expected `int` but got `str`.', 'dataclasses_transform_converter.py:121:22 Incompatible parameter type [6]: In call `DC2.__init__`, for 3rd positional argument, expected `int` but got `str`.', 'dataclasses_transform_converter.py:121:28 Incompatible parameter type [6]: In call `DC2.__init__`, for 4th positional argument, expected `ConverterClass` but got `str`.', 'dataclasses_transform_converter.py:121:34 Incompatible parameter type [6]: In call `DC2.__init__`, for 5th positional argument, expected `int` but got `str`.', 'dataclasses_transform_converter.py:121:39 Incompatible parameter type [6]: In call `DC2.__init__`, for 6th positional argument, expected `Dict[str, str]` but got `Tuple[Tuple[str, str], Tuple[str, str]]`.'] -""" -output = """ -dataclasses_transform_converter.py:48:30 Incompatible parameter type [6]: In call `model_field`, for argument `converter`, expected `typing.Callable[[Variable[S]], Variable[T]]` but got `typing.Callable(bad_converter1)[[], int]`. -dataclasses_transform_converter.py:49:30 Incompatible parameter type [6]: In call `model_field`, for argument `converter`, expected `typing.Callable[[Variable[S]], Variable[T]]` but got `typing.Callable(bad_converter2)[[KeywordOnly(x, int)], int]`. -dataclasses_transform_converter.py:107:7 Incompatible parameter type [6]: In call `DC2.__init__`, for 2nd positional argument, expected `int` but got `str`. -dataclasses_transform_converter.py:107:13 Incompatible parameter type [6]: In call `DC2.__init__`, for 3rd positional argument, expected `int` but got `str`. -dataclasses_transform_converter.py:107:19 Incompatible parameter type [6]: In call `DC2.__init__`, for 4th positional argument, expected `ConverterClass` but got `bytes`. -dataclasses_transform_converter.py:107:26 Incompatible parameter type [6]: In call `DC2.__init__`, for 5th positional argument, expected `int` but got `List[Variable[_T]]`. -dataclasses_transform_converter.py:108:4 Incompatible parameter type [6]: In call `DC2.__init__`, for 1st positional argument, expected `int` but got `str`. -dataclasses_transform_converter.py:108:10 Incompatible parameter type [6]: In call `DC2.__init__`, for 2nd positional argument, expected `int` but got `str`. -dataclasses_transform_converter.py:108:16 Incompatible parameter type [6]: In call `DC2.__init__`, for 3rd positional argument, expected `int` but got `str`. -dataclasses_transform_converter.py:108:22 Incompatible parameter type [6]: In call `DC2.__init__`, for 4th positional argument, expected `ConverterClass` but got `int`. -dataclasses_transform_converter.py:108:25 Incompatible parameter type [6]: In call `DC2.__init__`, for 5th positional argument, expected `int` but got `List[Variable[_T]]`. -dataclasses_transform_converter.py:109:4 Incompatible parameter type [6]: In call `DC2.__init__`, for 1st positional argument, expected `int` but got `str`. -dataclasses_transform_converter.py:109:10 Incompatible parameter type [6]: In call `DC2.__init__`, for 2nd positional argument, expected `int` but got `str`. -dataclasses_transform_converter.py:109:16 Incompatible parameter type [6]: In call `DC2.__init__`, for 3rd positional argument, expected `int` but got `str`. -dataclasses_transform_converter.py:109:22 Incompatible parameter type [6]: In call `DC2.__init__`, for 4th positional argument, expected `ConverterClass` but got `str`. -dataclasses_transform_converter.py:109:28 Incompatible parameter type [6]: In call `DC2.__init__`, for 5th positional argument, expected `int` but got `complex`. -dataclasses_transform_converter.py:112:10 Incompatible parameter type [6]: In call `DC2.__init__`, for 1st positional argument, expected `int` but got `str`. -dataclasses_transform_converter.py:112:16 Incompatible parameter type [6]: In call `DC2.__init__`, for 2nd positional argument, expected `int` but got `str`. -dataclasses_transform_converter.py:112:22 Incompatible parameter type [6]: In call `DC2.__init__`, for 3rd positional argument, expected `int` but got `str`. -dataclasses_transform_converter.py:112:28 Incompatible parameter type [6]: In call `DC2.__init__`, for 4th positional argument, expected `ConverterClass` but got `bytes`. -dataclasses_transform_converter.py:112:35 Incompatible parameter type [6]: In call `DC2.__init__`, for 5th positional argument, expected `int` but got `List[Variable[_T]]`. -dataclasses_transform_converter.py:114:0 Incompatible attribute type [8]: Attribute `field0` declared in class `DC2` has type `int` but is used as type `str`. -dataclasses_transform_converter.py:115:0 Incompatible attribute type [8]: Attribute `field3` declared in class `DC2` has type `ConverterClass` but is used as type `str`. -dataclasses_transform_converter.py:116:0 Incompatible attribute type [8]: Attribute `field3` declared in class `DC2` has type `ConverterClass` but is used as type `bytes`. -dataclasses_transform_converter.py:119:0 Incompatible attribute type [8]: Attribute `field3` declared in class `DC2` has type `ConverterClass` but is used as type `int`. -dataclasses_transform_converter.py:121:10 Incompatible parameter type [6]: In call `DC2.__init__`, for 1st positional argument, expected `int` but got `str`. -dataclasses_transform_converter.py:121:16 Incompatible parameter type [6]: In call `DC2.__init__`, for 2nd positional argument, expected `int` but got `str`. -dataclasses_transform_converter.py:121:22 Incompatible parameter type [6]: In call `DC2.__init__`, for 3rd positional argument, expected `int` but got `str`. -dataclasses_transform_converter.py:121:28 Incompatible parameter type [6]: In call `DC2.__init__`, for 4th positional argument, expected `ConverterClass` but got `str`. -dataclasses_transform_converter.py:121:34 Incompatible parameter type [6]: In call `DC2.__init__`, for 5th positional argument, expected `int` but got `str`. -dataclasses_transform_converter.py:121:39 Incompatible parameter type [6]: In call `DC2.__init__`, for 6th positional argument, expected `Dict[str, str]` but got `Tuple[Tuple[str, str], Tuple[str, str]]`. -dataclasses_transform_converter.py:130:58 Incompatible parameter type [6]: In call `model_field`, for argument `default`, expected `Optional[Variable[S]]` but got `int`. -dataclasses_transform_converter.py:133:58 Incompatible parameter type [6]: In call `model_field`, for argument `default_factory`, expected `Optional[typing.Callable[[], Variable[S]]]` but got `Type[int]`. -""" diff --git a/conformance/results/pyre/dataclasses_transform_field.toml b/conformance/results/pyre/dataclasses_transform_field.toml deleted file mode 100644 index b17502676..000000000 --- a/conformance/results/pyre/dataclasses_transform_field.toml +++ /dev/null @@ -1,19 +0,0 @@ -conformant = "Unsupported" -notes = """ -Does not understand dataclass transform field specifiers. -""" -output = """ -dataclasses_transform_field.py:49:42 Invalid type variable [34]: The type variable `Variable[T]` isn't present in the function's parameters. -dataclasses_transform_field.py:59:0 Missing argument [20]: Call `CustomerModel1.__init__` expects argument `id`. -dataclasses_transform_field.py:60:0 Missing argument [20]: Call `CustomerModel1.__init__` expects argument `id`. -dataclasses_transform_field.py:75:0 Too many arguments [19]: Call `CustomerModel2.__init__` expects 0 positional arguments, 1 was provided. -dataclasses_transform_field.py:77:0 Missing argument [20]: Call `CustomerModel2.__init__` expects argument `id`. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 64: Expected 1 errors -Line 49: Unexpected errors ["dataclasses_transform_field.py:49:42 Invalid type variable [34]: The type variable `Variable[T]` isn't present in the function's parameters."] -Line 59: Unexpected errors ['dataclasses_transform_field.py:59:0 Missing argument [20]: Call `CustomerModel1.__init__` expects argument `id`.'] -Line 60: Unexpected errors ['dataclasses_transform_field.py:60:0 Missing argument [20]: Call `CustomerModel1.__init__` expects argument `id`.'] -Line 77: Unexpected errors ['dataclasses_transform_field.py:77:0 Missing argument [20]: Call `CustomerModel2.__init__` expects argument `id`.'] -""" diff --git a/conformance/results/pyre/dataclasses_transform_func.toml b/conformance/results/pyre/dataclasses_transform_func.toml deleted file mode 100644 index 0d764047b..000000000 --- a/conformance/results/pyre/dataclasses_transform_func.toml +++ /dev/null @@ -1,41 +0,0 @@ -conformant = "Partial" -notes = """ -Does not understand @dataclass_transform when it is applied only to overloads of a decorator but not the definition. -Does not detect non-frozen class inheriting from frozen class. -Emits "attribute not initialized" error for dataclass field. -""" -output = """ -dataclasses_transform_func.py:19:0 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s). -dataclasses_transform_func.py:24:5 Invalid type variable [34]: The type variable `Variable[T]` isn't present in the function's parameters. -dataclasses_transform_func.py:34:4 Uninitialized attribute [13]: Attribute `id` is declared in class `Customer1` to have type `int` but is never initialized. -dataclasses_transform_func.py:35:4 Uninitialized attribute [13]: Attribute `name` is declared in class `Customer1` to have type `str` but is never initialized. -dataclasses_transform_func.py:40:4 Uninitialized attribute [13]: Attribute `id` is declared in class `Customer2` to have type `int` but is never initialized. -dataclasses_transform_func.py:41:4 Uninitialized attribute [13]: Attribute `name` is declared in class `Customer2` to have type `str` but is never initialized. -dataclasses_transform_func.py:46:4 Uninitialized attribute [13]: Attribute `salary` is declared in class `Customer2Subclass` to have type `float` but is never initialized. -dataclasses_transform_func.py:49:7 Unexpected keyword [28]: Unexpected keyword argument `id` to call `object.__init__`. -dataclasses_transform_func.py:52:7 Too many arguments [19]: Call `object.__init__` expects 0 positional arguments, 2 were provided. -dataclasses_transform_func.py:56:0 Incompatible attribute type [8]: Attribute `name` declared in class `Customer1` has type `str` but is used as type `int`. -dataclasses_transform_func.py:60:5 Unsupported operand [58]: `<` is not supported for operand types `Customer1` and `Customer1`. -dataclasses_transform_func.py:64:7 Unexpected keyword [28]: Unexpected keyword argument `id` to call `object.__init__`. -dataclasses_transform_func.py:66:7 Unexpected keyword [28]: Unexpected keyword argument `id` to call `object.__init__`. -dataclasses_transform_func.py:70:7 Too many arguments [19]: Call `object.__init__` expects 0 positional arguments, 2 were provided. -dataclasses_transform_func.py:72:5 Unsupported operand [58]: `<` is not supported for operand types `Customer2` and `Customer2`. -dataclasses_transform_func.py:90:4 Uninitialized attribute [13]: Attribute `age` is declared in class `Customer3Subclass` to have type `int` but is never initialized. -dataclasses_transform_func.py:96:0 Invalid assignment [41]: Cannot reassign final attribute `c3_1.id`. -""" -conformance_automated = "Fail" -errors_diff = """ -Lines 88, 89: Expected error (tag 'Customer3Subclass') -Line 19: Unexpected errors ['dataclasses_transform_func.py:19:0 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).'] -Line 24: Unexpected errors ["dataclasses_transform_func.py:24:5 Invalid type variable [34]: The type variable `Variable[T]` isn't present in the function's parameters."] -Line 34: Unexpected errors ['dataclasses_transform_func.py:34:4 Uninitialized attribute [13]: Attribute `id` is declared in class `Customer1` to have type `int` but is never initialized.'] -Line 35: Unexpected errors ['dataclasses_transform_func.py:35:4 Uninitialized attribute [13]: Attribute `name` is declared in class `Customer1` to have type `str` but is never initialized.'] -Line 40: Unexpected errors ['dataclasses_transform_func.py:40:4 Uninitialized attribute [13]: Attribute `id` is declared in class `Customer2` to have type `int` but is never initialized.'] -Line 41: Unexpected errors ['dataclasses_transform_func.py:41:4 Uninitialized attribute [13]: Attribute `name` is declared in class `Customer2` to have type `str` but is never initialized.'] -Line 46: Unexpected errors ['dataclasses_transform_func.py:46:4 Uninitialized attribute [13]: Attribute `salary` is declared in class `Customer2Subclass` to have type `float` but is never initialized.'] -Line 49: Unexpected errors ['dataclasses_transform_func.py:49:7 Unexpected keyword [28]: Unexpected keyword argument `id` to call `object.__init__`.'] -Line 52: Unexpected errors ['dataclasses_transform_func.py:52:7 Too many arguments [19]: Call `object.__init__` expects 0 positional arguments, 2 were provided.'] -Line 66: Unexpected errors ['dataclasses_transform_func.py:66:7 Unexpected keyword [28]: Unexpected keyword argument `id` to call `object.__init__`.'] -Line 72: Unexpected errors ['dataclasses_transform_func.py:72:5 Unsupported operand [58]: `<` is not supported for operand types `Customer2` and `Customer2`.'] -Line 90: Unexpected errors ['dataclasses_transform_func.py:90:4 Uninitialized attribute [13]: Attribute `age` is declared in class `Customer3Subclass` to have type `int` but is never initialized.'] -""" diff --git a/conformance/results/pyre/dataclasses_transform_meta.toml b/conformance/results/pyre/dataclasses_transform_meta.toml deleted file mode 100644 index ffcce3b41..000000000 --- a/conformance/results/pyre/dataclasses_transform_meta.toml +++ /dev/null @@ -1,21 +0,0 @@ -conformant = "Partial" -notes = """ -Does not understand custom field specifiers. -Incorrectly rejects frozen dataclass that inherits from non-frozen. -Emits "attribute not initialized" error for dataclass field. -""" -output = """ -dataclasses_transform_meta.py:43:0 Invalid inheritance [39]: Frozen dataclass `Customer1` cannot inherit from non-frozen dataclass `ModelBase`. -dataclasses_transform_meta.py:51:0 Invalid inheritance [39]: Non-frozen dataclass `Customer1Subclass` cannot inherit from frozen dataclass `Customer1`. -dataclasses_transform_meta.py:60:7 Unexpected keyword [28]: Unexpected keyword argument `other_name` to call `Customer1.__init__`. -dataclasses_transform_meta.py:63:0 Invalid assignment [41]: Cannot reassign final attribute `c1_1.id`. -dataclasses_transform_meta.py:66:7 Too many arguments [19]: Call `Customer1.__init__` expects 0 positional arguments, 2 were provided. -dataclasses_transform_meta.py:73:5 Unsupported operand [58]: `<` is not supported for operand types `Customer1` and `Customer1`. -dataclasses_transform_meta.py:83:7 Too many arguments [19]: Call `Customer2.__init__` expects 0 positional arguments, 2 were provided. -dataclasses_transform_meta.py:103:0 Invalid assignment [41]: Cannot reassign final attribute `c3_1.id`. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 43: Unexpected errors ['dataclasses_transform_meta.py:43:0 Invalid inheritance [39]: Frozen dataclass `Customer1` cannot inherit from non-frozen dataclass `ModelBase`.'] -Line 60: Unexpected errors ['dataclasses_transform_meta.py:60:7 Unexpected keyword [28]: Unexpected keyword argument `other_name` to call `Customer1.__init__`.'] -""" diff --git a/conformance/results/pyre/dataclasses_usage.toml b/conformance/results/pyre/dataclasses_usage.toml deleted file mode 100644 index f0a0ea0d5..000000000 --- a/conformance/results/pyre/dataclasses_usage.toml +++ /dev/null @@ -1,33 +0,0 @@ -conformant = "Partial" -notes = """ -Does not report error when field with no default follows field with default. -Complains on `assert_type` when used for bound methods vs `Callable`. -Does not understand `__dataclass_fields__`. -Incorrectly raises incompatibility type errors. -""" -output = """ -dataclasses_usage.py:50:5 Missing argument [20]: Call `InventoryItem.__init__` expects argument `unit_price`. -dataclasses_usage.py:51:27 Incompatible parameter type [6]: In call `InventoryItem.__init__`, for 2nd positional argument, expected `float` but got `str`. -dataclasses_usage.py:52:5 Too many arguments [19]: Call `InventoryItem.__init__` expects 3 positional arguments, 4 were provided. -dataclasses_usage.py:72:4 Undefined attribute [16]: `typing.Type` has no attribute `a`. -dataclasses_usage.py:83:5 Too many arguments [19]: Call `DC4.__init__` expects 1 positional argument, 2 were provided. -dataclasses_usage.py:88:4 Incompatible attribute type [8]: Attribute `a` declared in class `DC5` has type `int` but is used as type `str`. -dataclasses_usage.py:127:0 Too many arguments [19]: Call `DC7.__init__` expects 1 positional argument, 2 were provided. -dataclasses_usage.py:130:0 Missing argument [20]: Call `DC8.__init__` expects argument `y`. -dataclasses_usage.py:173:4 Uninitialized attribute [13]: Attribute `x` is declared in class `DC13` to have type `int` but is never initialized. -dataclasses_usage.py:174:4 Uninitialized attribute [13]: Attribute `x_squared` is declared in class `DC13` to have type `int` but is never initialized. -dataclasses_usage.py:179:0 Too many arguments [19]: Call `object.__init__` expects 0 positional arguments, 1 was provided. -dataclasses_usage.py:205:0 Incompatible variable type [9]: v7 is declared to have type `DataclassProto` but is used as type `DC15`. -dataclasses_usage.py:213:0 Assert type [70]: Expected `DC16[int]` but got `DC16[typing_extensions.Literal[1]]`. -""" -conformance_automated = "Fail" -errors_diff = """ -Lines 58, 61: Expected error (tag 'DC1') -Lines 64, 67: Expected error (tag 'DC2') -Lines 70, 73: Expected error (tag 'DC3') -Line 72: Unexpected errors ['dataclasses_usage.py:72:4 Undefined attribute [16]: `typing.Type` has no attribute `a`.'] -Line 173: Unexpected errors ['dataclasses_usage.py:173:4 Uninitialized attribute [13]: Attribute `x` is declared in class `DC13` to have type `int` but is never initialized.'] -Line 174: Unexpected errors ['dataclasses_usage.py:174:4 Uninitialized attribute [13]: Attribute `x_squared` is declared in class `DC13` to have type `int` but is never initialized.'] -Line 205: Unexpected errors ['dataclasses_usage.py:205:0 Incompatible variable type [9]: v7 is declared to have type `DataclassProto` but is used as type `DC15`.'] -Line 213: Unexpected errors ['dataclasses_usage.py:213:0 Assert type [70]: Expected `DC16[int]` but got `DC16[typing_extensions.Literal[1]]`.'] -""" diff --git a/conformance/results/pyre/directives_assert_type.toml b/conformance/results/pyre/directives_assert_type.toml deleted file mode 100644 index 7c81101d7..000000000 --- a/conformance/results/pyre/directives_assert_type.toml +++ /dev/null @@ -1,14 +0,0 @@ -conformant = "Pass" -notes = """ -""" -output = """ -directives_assert_type.py:27:4 Assert type [70]: Expected `int` but got `Union[int, str]`. -directives_assert_type.py:28:4 Assert type [70]: Expected `int` but got `typing.Any`. -directives_assert_type.py:29:4 Assert type [70]: Expected `int` but got `typing_extensions.Literal[4]`. -directives_assert_type.py:31:4 Missing argument [20]: Call `assert_type` expects argument in position 0. -directives_assert_type.py:32:4 Assert type [70]: Expected `int` but got `typing_extensions.Literal['']`. -directives_assert_type.py:33:4 Too many arguments [19]: Call `assert_type` expects 2 positional arguments, 3 were provided. -""" -conformance_automated = "Pass" -errors_diff = """ -""" diff --git a/conformance/results/pyre/directives_cast.toml b/conformance/results/pyre/directives_cast.toml deleted file mode 100644 index 8046276e2..000000000 --- a/conformance/results/pyre/directives_cast.toml +++ /dev/null @@ -1,9 +0,0 @@ -conformant = "Pass" -output = """ -directives_cast.py:15:7 Missing argument [20]: Call `cast` expects argument `typ`. -directives_cast.py:16:12 Invalid type [31]: Expression `1` is not a valid type. -directives_cast.py:17:7 Too many arguments [19]: Call `cast` expects 2 positional arguments, 3 were provided. -""" -conformance_automated = "Pass" -errors_diff = """ -""" diff --git a/conformance/results/pyre/directives_deprecated.toml b/conformance/results/pyre/directives_deprecated.toml deleted file mode 100644 index 2442ee8f9..000000000 --- a/conformance/results/pyre/directives_deprecated.toml +++ /dev/null @@ -1,21 +0,0 @@ -conformant = "Unsupported" -notes = """ -Does not support @deprecated. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 18: Expected 1 errors -Line 24: Expected 1 errors -Line 25: Expected 1 errors -Line 30: Expected 1 errors -Line 41: Expected 1 errors -Line 42: Expected 1 errors -Line 44: Expected 1 errors -Line 47: Expected 1 errors -Line 48: Expected 1 errors -Line 58: Expected 1 errors -Line 69: Expected 1 errors -Line 98: Expected 1 errors -""" -output = """ -""" diff --git a/conformance/results/pyre/directives_no_type_check.toml b/conformance/results/pyre/directives_no_type_check.toml deleted file mode 100644 index f08913eaf..000000000 --- a/conformance/results/pyre/directives_no_type_check.toml +++ /dev/null @@ -1,15 +0,0 @@ -conformant = "Pass" -notes = """ -Does not honor @no_type_check decorator. -""" -output = """ -directives_no_type_check.py:15:4 Incompatible attribute type [8]: Attribute `x` declared in class `ClassA` has type `int` but is used as type `str`. -directives_no_type_check.py:25:12 Unsupported operand [58]: `+` is not supported for operand types `int` and `str`. -directives_no_type_check.py:26:4 Incompatible return type [7]: Expected `None` but got `int`. -directives_no_type_check.py:29:6 Incompatible parameter type [6]: In call `func1`, for 1st positional argument, expected `int` but got `bytes`. -directives_no_type_check.py:29:18 Incompatible parameter type [6]: In call `func1`, for 2nd positional argument, expected `str` but got `bytes`. -directives_no_type_check.py:32:0 Missing argument [20]: Call `func1` expects argument `a`. -""" -conformance_automated = "Pass" -errors_diff = """ -""" diff --git a/conformance/results/pyre/directives_reveal_type.toml b/conformance/results/pyre/directives_reveal_type.toml deleted file mode 100644 index 64a213ec3..000000000 --- a/conformance/results/pyre/directives_reveal_type.toml +++ /dev/null @@ -1,14 +0,0 @@ -conformant = "Pass" -notes = """ -""" -output = """ -directives_reveal_type.py:14:4 Revealed type [-1]: Revealed type for `a` is `typing.Union[int, str]`. -directives_reveal_type.py:15:4 Revealed type [-1]: Revealed type for `b` is `typing.List[int]`. -directives_reveal_type.py:16:4 Revealed type [-1]: Revealed type for `c` is `typing.Any`. -directives_reveal_type.py:17:4 Revealed type [-1]: Revealed type for `d` is `ForwardReference`. -directives_reveal_type.py:19:4 Missing argument [20]: Call `reveal_type` expects argument in position 0. -directives_reveal_type.py:20:4 Too many arguments [19]: Call `reveal_type` expects 1 positional argument, 2 were provided. -""" -conformance_automated = "Pass" -errors_diff = """ -""" diff --git a/conformance/results/pyre/directives_type_checking.toml b/conformance/results/pyre/directives_type_checking.toml deleted file mode 100644 index 5e485e856..000000000 --- a/conformance/results/pyre/directives_type_checking.toml +++ /dev/null @@ -1,6 +0,0 @@ -conformant = "Pass" -output = """ -""" -conformance_automated = "Pass" -errors_diff = """ -""" diff --git a/conformance/results/pyre/directives_type_ignore.toml b/conformance/results/pyre/directives_type_ignore.toml deleted file mode 100644 index 5e485e856..000000000 --- a/conformance/results/pyre/directives_type_ignore.toml +++ /dev/null @@ -1,6 +0,0 @@ -conformant = "Pass" -output = """ -""" -conformance_automated = "Pass" -errors_diff = """ -""" diff --git a/conformance/results/pyre/directives_type_ignore_file1.toml b/conformance/results/pyre/directives_type_ignore_file1.toml deleted file mode 100644 index 07cd73b25..000000000 --- a/conformance/results/pyre/directives_type_ignore_file1.toml +++ /dev/null @@ -1,8 +0,0 @@ -conformant = "Pass" -notes = """ -""" -output = """ -""" -conformance_automated = "Pass" -errors_diff = """ -""" diff --git a/conformance/results/pyre/directives_type_ignore_file2.toml b/conformance/results/pyre/directives_type_ignore_file2.toml deleted file mode 100644 index 7e43e7dcf..000000000 --- a/conformance/results/pyre/directives_type_ignore_file2.toml +++ /dev/null @@ -1,7 +0,0 @@ -conformant = "Pass" -output = """ -directives_type_ignore_file2.py:14:0 Incompatible variable type [9]: x is declared to have type `int` but is used as type `str`. -""" -conformance_automated = "Pass" -errors_diff = """ -""" diff --git a/conformance/results/pyre/directives_version_platform.toml b/conformance/results/pyre/directives_version_platform.toml deleted file mode 100644 index 01d4e4b4f..000000000 --- a/conformance/results/pyre/directives_version_platform.toml +++ /dev/null @@ -1,10 +0,0 @@ -conformant = "Pass" -notes = """ -""" -output = """ -directives_version_platform.py:40:4 Incompatible variable type [9]: val7 is declared to have type `int` but is used as type `str`. -directives_version_platform.py:45:4 Incompatible variable type [9]: val8 is declared to have type `int` but is used as type `str`. -""" -conformance_automated = "Pass" -errors_diff = """ -""" diff --git a/conformance/results/pyre/enums_behaviors.toml b/conformance/results/pyre/enums_behaviors.toml deleted file mode 100644 index d1c240fc8..000000000 --- a/conformance/results/pyre/enums_behaviors.toml +++ /dev/null @@ -1,11 +0,0 @@ -conformant = "Pass" -notes = """ -""" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -enums_behaviors.py:28:0 Assert type [70]: Expected `typing_extensions.Literal[Color.RED]` but got `Color`. -enums_behaviors.py:32:0 Assert type [70]: Expected `typing_extensions.Literal[Color.BLUE]` but got `Color`. -enums_behaviors.py:44:0 Invalid inheritance [39]: Cannot inherit from final enum `Shape`. Enums with defined members cannot be extended. -""" diff --git a/conformance/results/pyre/enums_definition.toml b/conformance/results/pyre/enums_definition.toml deleted file mode 100644 index 7e80103fa..000000000 --- a/conformance/results/pyre/enums_definition.toml +++ /dev/null @@ -1,17 +0,0 @@ -conformant = "Pass" -notes = """ -""" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -enums_definition.py:24:9 Too many arguments [19]: Call `Enum.__new__` expects 1 positional argument, 4 were provided. -enums_definition.py:27:9 Too many arguments [19]: Call `Enum.__new__` expects 1 positional argument, 2 were provided. -enums_definition.py:28:9 Too many arguments [19]: Call `Enum.__new__` expects 1 positional argument, 2 were provided. -enums_definition.py:31:9 Too many arguments [19]: Call `Enum.__new__` expects 1 positional argument, 2 were provided. -enums_definition.py:33:12 Undefined attribute [16]: `Enum` has no attribute `RED`. -enums_definition.py:38:0 Assert type [70]: Expected `typing_extensions.Literal[Color7.RED]` but got `unknown`. -enums_definition.py:38:12 Undefined attribute [16]: `Color7` has no attribute `RED`. -enums_definition.py:39:0 Assert type [70]: Expected `typing_extensions.Literal[Color8.RED]` but got `unknown`. -enums_definition.py:39:12 Undefined attribute [16]: `Color8` has no attribute `RED`. -""" diff --git a/conformance/results/pyre/enums_expansion.toml b/conformance/results/pyre/enums_expansion.toml deleted file mode 100644 index 340065e03..000000000 --- a/conformance/results/pyre/enums_expansion.toml +++ /dev/null @@ -1,11 +0,0 @@ -conformant = "Pass" -notes = """ -""" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -enums_expansion.py:25:8 Assert type [70]: Expected `typing_extensions.Literal[Color.GREEN]` but got `Color`. -enums_expansion.py:35:12 Assert type [70]: Expected `Never` but got `Color`. -enums_expansion.py:53:8 Assert type [70]: Expected `typing_extensions.Literal[CustomFlags.FLAG3]` but got `CustomFlags`. -""" diff --git a/conformance/results/pyre/enums_member_names.toml b/conformance/results/pyre/enums_member_names.toml deleted file mode 100644 index 263b2fab7..000000000 --- a/conformance/results/pyre/enums_member_names.toml +++ /dev/null @@ -1,13 +0,0 @@ -conformant = "Pass" -notes = """ -Does not support special-cased handling of member name literal types (optional). -""" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -enums_member_names.py:21:0 Assert type [70]: Expected `typing_extensions.Literal['RED']` but got `str`. -enums_member_names.py:22:0 Assert type [70]: Expected `typing_extensions.Literal['RED']` but got `str`. -enums_member_names.py:26:4 Assert type [70]: Expected `Union[typing_extensions.Literal['BLUE'], typing_extensions.Literal['RED']]` but got `str`. -enums_member_names.py:30:4 Assert type [70]: Expected `Union[typing_extensions.Literal['BLUE'], typing_extensions.Literal['GREEN'], typing_extensions.Literal['RED']]` but got `str`. -""" diff --git a/conformance/results/pyre/enums_member_values.toml b/conformance/results/pyre/enums_member_values.toml deleted file mode 100644 index e14ce8a6e..000000000 --- a/conformance/results/pyre/enums_member_values.toml +++ /dev/null @@ -1,17 +0,0 @@ -conformant = "Pass" -notes = """ -""" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -enums_member_values.py:21:0 Assert type [70]: Expected `typing_extensions.Literal[1]` but got `typing.Any`. -enums_member_values.py:22:0 Assert type [70]: Expected `typing_extensions.Literal[1]` but got `typing.Any`. -enums_member_values.py:26:4 Assert type [70]: Expected `Union[typing_extensions.Literal[1], typing_extensions.Literal[3]]` but got `typing.Any`. -enums_member_values.py:30:4 Assert type [70]: Expected `Union[typing_extensions.Literal[1], typing_extensions.Literal[2], typing_extensions.Literal[3]]` but got `typing.Any`. -enums_member_values.py:54:0 Assert type [70]: Expected `typing_extensions.Literal[1]` but got `typing.Any`. -enums_member_values.py:68:0 Assert type [70]: Expected `typing_extensions.Literal[1]` but got `typing.Any`. -enums_member_values.py:78:4 Incompatible attribute type [8]: Attribute `GREEN` declared in class `Color3` has type `int` but is used as type `str`. -enums_member_values.py:85:8 Incompatible attribute type [8]: Attribute `_value_` declared in class `Planet2` has type `str` but is used as type `int`. -enums_member_values.py:96:0 Assert type [70]: Expected `int` but got `typing.Any`. -""" diff --git a/conformance/results/pyre/enums_members.toml b/conformance/results/pyre/enums_members.toml deleted file mode 100644 index 91220359c..000000000 --- a/conformance/results/pyre/enums_members.toml +++ /dev/null @@ -1,28 +0,0 @@ -conformant = "Partial" -notes = """ -Does not reject use of annotation with enum member. -Does not treat callables as non-members. -Does not treat annotated attributes as non-members. -Does not honor `enum.nonmember` to define non-member attribute. -Does not honor `enum.member` as method decorator. -Does not properly handle aliased enum members. -Rejects use of `_ignore_`. -Does not support `_ignore_` mechanism (optional). -""" -conformance_automated = "Fail" -errors_diff = """ -Line 82: Expected 1 errors -Line 83: Expected 1 errors -Line 116: Expected 1 errors -Line 129: Expected 1 errors -Line 100: Unexpected errors ['enums_members.py:100:0 Assert type [70]: Expected `typing_extensions.Literal[TrafficLight.YELLOW]` but got `typing_extensions.Literal[TrafficLight.AMBER]`.'] -""" -output = """ -enums_members.py:50:4 Illegal annotation target [35]: Target `enums_members.Pet3.DOG` cannot be annotated as it is an enum member. Enum value types can be specified by annotating the `_value_` attribute. -enums_members.py:84:0 Assert type [70]: Expected `typing_extensions.Literal[Pet4.species]` but got `str`. -enums_members.py:85:0 Assert type [70]: Expected `typing_extensions.Literal[Pet4.speak]` but got `typing.Callable(Pet4.speak)[[Named(self, Pet4)], None]`. -enums_members.py:100:0 Assert type [70]: Expected `typing_extensions.Literal[TrafficLight.YELLOW]` but got `typing_extensions.Literal[TrafficLight.AMBER]`. -enums_members.py:128:8 Revealed type [-1]: Revealed type for `enums_members.Example2._Example2__B` is `typing_extensions.Literal[Example2._Example2__B]` (final). -enums_members.py:146:0 Assert type [70]: Expected `int` but got `typing_extensions.Literal[Pet5.DOG]`. -enums_members.py:147:0 Assert type [70]: Expected `int` but got `typing_extensions.Literal[Pet5.FISH]`. -""" diff --git a/conformance/results/pyre/exceptions_context_managers.toml b/conformance/results/pyre/exceptions_context_managers.toml deleted file mode 100644 index 507ba6241..000000000 --- a/conformance/results/pyre/exceptions_context_managers.toml +++ /dev/null @@ -1,13 +0,0 @@ -conformant = "Partial" -notes = """ -assert_type causes failures. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 50: Unexpected errors ['exceptions_context_managers.py:50:4 Assert type [70]: Expected `Union[int, str]` but got `str`.'] -Line 57: Unexpected errors ['exceptions_context_managers.py:57:4 Assert type [70]: Expected `Union[int, str]` but got `str`.'] -""" -output = """ -exceptions_context_managers.py:50:4 Assert type [70]: Expected `Union[int, str]` but got `str`. -exceptions_context_managers.py:57:4 Assert type [70]: Expected `Union[int, str]` but got `str`. -""" diff --git a/conformance/results/pyre/generics_base_class.toml b/conformance/results/pyre/generics_base_class.toml deleted file mode 100644 index 3cac3f43f..000000000 --- a/conformance/results/pyre/generics_base_class.toml +++ /dev/null @@ -1,18 +0,0 @@ -conformant = "Partial" -notes = """ -Does not reject illegal use of Generic. -Does not allow using generic in assert_type expression. -Does not detect inconsistent type variable ordering. -""" -output = """ -generics_base_class.py:26:25 Incompatible parameter type [6]: In call `takes_dict_incorrect`, for 1st positional argument, expected `Dict[str, List[object]]` but got `SymbolTable`. -generics_base_class.py:49:21 Invalid type parameters [24]: Generic type `LinkedList` expects 1 type parameter, received 2. -generics_base_class.py:61:17 Invalid type parameters [24]: Generic type `MyDict` expects 1 type parameter, received 2. -generics_base_class.py:68:0 Duplicate type variables [59]: Duplicate type variable `T` in Generic[...]. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 29: Expected 1 errors -Line 30: Expected 1 errors -Line 98: Expected 1 errors -""" diff --git a/conformance/results/pyre/generics_basic.toml b/conformance/results/pyre/generics_basic.toml deleted file mode 100644 index 2aab00599..000000000 --- a/conformance/results/pyre/generics_basic.toml +++ /dev/null @@ -1,30 +0,0 @@ -conformant = "Partial" -notes = """ -False positives in examples using constrained type variables. -False negative for constraint parameterized by a type variable. -False negative in custom map example. -False positive using `iter`. -False negative for bad type arguments to Generic/Protocol. -False negative for generic metaclass. -""" -output = """ -generics_basic.py:34:4 Incompatible return type [7]: Expected `Variable[AnyStr <: [str, bytes]]` but got `str`. -generics_basic.py:34:15 Incompatible parameter type [6]: In call `str.__add__`, for 1st positional argument, expected `str` but got `Variable[AnyStr <: [str, bytes]]`. -generics_basic.py:40:14 Incompatible parameter type [6]: In call `concat`, for 2nd positional argument, expected `Variable[AnyStr <: [str, bytes]]` but got `bytes`. -generics_basic.py:41:14 Incompatible parameter type [6]: In call `concat`, for 2nd positional argument, expected `Variable[AnyStr <: [str, bytes]]` but got `str`. -generics_basic.py:49:0 Invalid type [31]: TypeVar can't have a single explicit constraint. Did you mean `bound=str`? -generics_basic.py:69:14 Incompatible parameter type [6]: In call `concat`, for 2nd positional argument, expected `Variable[AnyStr <: [str, bytes]]` but got `bytes`. -generics_basic.py:121:0 Duplicate type variables [59]: Duplicate type variable `T` in Generic[...]. -generics_basic.py:157:7 Incompatible parameter type [6]: In call `typing.Mapping.__getitem__`, for 1st positional argument, expected `str` but got `int`. -generics_basic.py:158:7 Incompatible parameter type [6]: In call `typing.Mapping.__getitem__`, for 1st positional argument, expected `str` but got `int`. -generics_basic.py:171:11 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Variable[T_co]`. To reference the type variable, you can modify the class to inherit from `typing.Generic[T_co]`. -generics_basic.py:172:11 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Variable[T_co]`. To reference the type variable, you can modify the class to inherit from `typing.Generic[T_co]`. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 55: Expected 1 errors -Line 162: Expected 1 errors -Line 163: Expected 1 errors -Line 208: Expected 1 errors -Line 34: Unexpected errors ['generics_basic.py:34:4 Incompatible return type [7]: Expected `Variable[AnyStr <: [str, bytes]]` but got `str`.', 'generics_basic.py:34:15 Incompatible parameter type [6]: In call `str.__add__`, for 1st positional argument, expected `str` but got `Variable[AnyStr <: [str, bytes]]`.'] -""" diff --git a/conformance/results/pyre/generics_defaults.toml b/conformance/results/pyre/generics_defaults.toml deleted file mode 100644 index b758eed33..000000000 --- a/conformance/results/pyre/generics_defaults.toml +++ /dev/null @@ -1,112 +0,0 @@ -conformant = "Unsupported" -notes = """ -Does not support generic defaults. -""" -output = """ -generics_defaults.py:24:31 Undefined or invalid type [11]: Annotation `DefaultStrT` is not defined as a type. -generics_defaults.py:24:31 Undefined or invalid type [11]: Annotation `T` is not defined as a type. -generics_defaults.py:27:20 Undefined or invalid type [11]: Annotation `DefaultIntT` is not defined as a type. -generics_defaults.py:30:0 Assert type [70]: Expected `Type[NoNonDefaults[]]` but got `Type[NoNonDefaults]`. -generics_defaults.py:30:27 Invalid type parameters [24]: Non-generic type `NoNonDefaults` cannot take parameters. -generics_defaults.py:31:0 Assert type [70]: Expected `Type[NoNonDefaults[]]` but got `typing.Any`. -generics_defaults.py:31:12 Undefined attribute [16]: `NoNonDefaults` has no attribute `__getitem__`. -generics_defaults.py:31:32 Invalid type parameters [24]: Non-generic type `NoNonDefaults` cannot take parameters. -generics_defaults.py:32:0 Assert type [70]: Expected `Type[NoNonDefaults[]]` but got `typing.Any`. -generics_defaults.py:32:37 Invalid type parameters [24]: Non-generic type `NoNonDefaults` cannot take parameters. -generics_defaults.py:35:17 Undefined or invalid type [11]: Annotation `DefaultBoolT` is not defined as a type. -generics_defaults.py:38:0 Assert type [70]: Expected `Type[OneDefault[]]` but got `typing.Any`. -generics_defaults.py:38:12 Undefined attribute [16]: `OneDefault` has no attribute `__getitem__`. -generics_defaults.py:38:31 Invalid type parameters [24]: Non-generic type `OneDefault` cannot take parameters. -generics_defaults.py:39:0 Assert type [70]: Expected `OneDefault[]` but got `typing.Any`. -generics_defaults.py:39:33 Invalid type parameters [24]: Non-generic type `OneDefault` cannot take parameters. -generics_defaults.py:42:21 Undefined or invalid type [11]: Annotation `T1` is not defined as a type. -generics_defaults.py:42:21 Undefined or invalid type [11]: Annotation `T2` is not defined as a type. -generics_defaults.py:45:0 Assert type [70]: Expected `Type[AllTheDefaults[]]` but got `Type[AllTheDefaults]`. -generics_defaults.py:45:28 Invalid type parameters [24]: Non-generic type `AllTheDefaults` cannot take parameters. -generics_defaults.py:46:0 Assert type [70]: Expected `Type[AllTheDefaults[]]` but got `typing.Any`. -generics_defaults.py:47:4 Undefined attribute [16]: `AllTheDefaults` has no attribute `__getitem__`. -generics_defaults.py:47:34 Invalid type parameters [24]: Non-generic type `AllTheDefaults` cannot take parameters. -generics_defaults.py:52:0 Assert type [70]: Expected `Type[AllTheDefaults[]]` but got `typing.Any`. -generics_defaults.py:53:34 Invalid type parameters [24]: Non-generic type `AllTheDefaults` cannot take parameters. -generics_defaults.py:55:0 Assert type [70]: Expected `Type[AllTheDefaults[]]` but got `typing.Any`. -generics_defaults.py:57:4 Invalid type parameters [24]: Non-generic type `AllTheDefaults` cannot take parameters. -generics_defaults.py:59:0 Assert type [70]: Expected `Type[AllTheDefaults[]]` but got `typing.Any`. -generics_defaults.py:61:4 Invalid type parameters [24]: Non-generic type `AllTheDefaults` cannot take parameters. -generics_defaults.py:63:0 Assert type [70]: Expected `Type[AllTheDefaults[]]` but got `typing.Any`. -generics_defaults.py:65:4 Invalid type parameters [24]: Non-generic type `AllTheDefaults` cannot take parameters. -generics_defaults.py:76:22 Undefined or invalid type [11]: Annotation `DefaultP` is not defined as a type. -generics_defaults.py:79:0 Assert type [70]: Expected `Type[Class_ParamSpec[]]` but got `Type[Class_ParamSpec]`. -generics_defaults.py:79:29 Invalid type parameters [24]: Non-generic type `Class_ParamSpec` cannot take parameters. -generics_defaults.py:80:0 Assert type [70]: Expected `Class_ParamSpec[]` but got `Class_ParamSpec`. -generics_defaults.py:80:31 Invalid type parameters [24]: Non-generic type `Class_ParamSpec` cannot take parameters. -generics_defaults.py:81:0 Assert type [70]: Expected `Class_ParamSpec[]` but got `typing.Any`. -generics_defaults.py:81:12 Undefined attribute [16]: `Class_ParamSpec` has no attribute `__getitem__`. -generics_defaults.py:81:45 Invalid type parameters [24]: Non-generic type `Class_ParamSpec` cannot take parameters. -generics_defaults.py:91:25 Undefined or invalid type [11]: Annotation `DefaultTs` is not defined as a type. -generics_defaults.py:94:0 Assert type [70]: Expected `Type[Class_TypeVarTuple[]]` but got `Type[Class_TypeVarTuple]`. -generics_defaults.py:94:32 Invalid type parameters [24]: Non-generic type `Class_TypeVarTuple` cannot take parameters. -generics_defaults.py:95:0 Assert type [70]: Expected `Class_TypeVarTuple[]` but got `Class_TypeVarTuple`. -generics_defaults.py:95:34 Invalid type parameters [24]: Non-generic type `Class_TypeVarTuple` cannot take parameters. -generics_defaults.py:96:0 Assert type [70]: Expected `Class_TypeVarTuple[]` but got `typing.Any`. -generics_defaults.py:96:12 Undefined attribute [16]: `Class_TypeVarTuple` has no attribute `__getitem__`. -generics_defaults.py:96:45 Invalid type parameters [24]: Non-generic type `Class_TypeVarTuple` cannot take parameters. -generics_defaults.py:99:67 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T]]` but got `TypeVarTuple`. -generics_defaults.py:127:13 Undefined or invalid type [11]: Annotation `T4` is not defined as a type. -generics_defaults.py:130:0 Assert type [70]: Expected `int` but got `unknown`. -generics_defaults.py:131:0 Assert type [70]: Expected `typing.Any` but got `unknown`. -generics_defaults.py:142:11 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Ts`. -generics_defaults.py:142:11 Undefined or invalid type [11]: Annotation `T5` is not defined as a type. -generics_defaults.py:152:11 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Ts`. -generics_defaults.py:152:11 Undefined or invalid type [11]: Annotation `P` is not defined as a type. -generics_defaults.py:155:0 Assert type [70]: Expected `Type[Foo6[]]` but got `typing.Any`. -generics_defaults.py:155:12 Undefined attribute [16]: `Foo6` has no attribute `__getitem__`. -generics_defaults.py:155:28 Invalid type parameters [24]: Non-generic type `Foo6` cannot take parameters. -generics_defaults.py:156:0 Assert type [70]: Expected `Type[Foo6[]]` but got `typing.Any`. -generics_defaults.py:156:37 Invalid type parameters [24]: Non-generic type `Foo6` cannot take parameters. -generics_defaults.py:170:0 Assert type [70]: Expected `typing.Callable[[Foo7[]], Foo7[]]` but got `typing.Callable(Foo7.meth)[[Variable[_Self_generics_defaults_Foo7__ (bound to Foo7)]], Variable[_Self_generics_defaults_Foo7__ (bound to Foo7)]]`. -generics_defaults.py:170:23 Invalid type parameters [24]: Non-generic type `Foo7` cannot take parameters. -generics_defaults.py:171:0 Assert type [70]: Expected `int` but got `unknown`. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 50: Expected 1 errors -Line 107: Expected 1 errors -Line 114: Expected 1 errors -Lines 130, 131: Expected exactly one error (tag 'optional-default-use') -Line 27: Unexpected errors ['generics_defaults.py:27:20 Undefined or invalid type [11]: Annotation `DefaultIntT` is not defined as a type.'] -Line 30: Unexpected errors ['generics_defaults.py:30:0 Assert type [70]: Expected `Type[NoNonDefaults[]]` but got `Type[NoNonDefaults]`.', 'generics_defaults.py:30:27 Invalid type parameters [24]: Non-generic type `NoNonDefaults` cannot take parameters.'] -Line 31: Unexpected errors ['generics_defaults.py:31:0 Assert type [70]: Expected `Type[NoNonDefaults[]]` but got `typing.Any`.', 'generics_defaults.py:31:12 Undefined attribute [16]: `NoNonDefaults` has no attribute `__getitem__`.', 'generics_defaults.py:31:32 Invalid type parameters [24]: Non-generic type `NoNonDefaults` cannot take parameters.'] -Line 32: Unexpected errors ['generics_defaults.py:32:0 Assert type [70]: Expected `Type[NoNonDefaults[]]` but got `typing.Any`.', 'generics_defaults.py:32:37 Invalid type parameters [24]: Non-generic type `NoNonDefaults` cannot take parameters.'] -Line 35: Unexpected errors ['generics_defaults.py:35:17 Undefined or invalid type [11]: Annotation `DefaultBoolT` is not defined as a type.'] -Line 38: Unexpected errors ['generics_defaults.py:38:0 Assert type [70]: Expected `Type[OneDefault[]]` but got `typing.Any`.', 'generics_defaults.py:38:12 Undefined attribute [16]: `OneDefault` has no attribute `__getitem__`.', 'generics_defaults.py:38:31 Invalid type parameters [24]: Non-generic type `OneDefault` cannot take parameters.'] -Line 39: Unexpected errors ['generics_defaults.py:39:0 Assert type [70]: Expected `OneDefault[]` but got `typing.Any`.', 'generics_defaults.py:39:33 Invalid type parameters [24]: Non-generic type `OneDefault` cannot take parameters.'] -Line 42: Unexpected errors ['generics_defaults.py:42:21 Undefined or invalid type [11]: Annotation `T1` is not defined as a type.', 'generics_defaults.py:42:21 Undefined or invalid type [11]: Annotation `T2` is not defined as a type.'] -Line 45: Unexpected errors ['generics_defaults.py:45:0 Assert type [70]: Expected `Type[AllTheDefaults[]]` but got `Type[AllTheDefaults]`.', 'generics_defaults.py:45:28 Invalid type parameters [24]: Non-generic type `AllTheDefaults` cannot take parameters.'] -Line 46: Unexpected errors ['generics_defaults.py:46:0 Assert type [70]: Expected `Type[AllTheDefaults[]]` but got `typing.Any`.'] -Line 47: Unexpected errors ['generics_defaults.py:47:4 Undefined attribute [16]: `AllTheDefaults` has no attribute `__getitem__`.', 'generics_defaults.py:47:34 Invalid type parameters [24]: Non-generic type `AllTheDefaults` cannot take parameters.'] -Line 52: Unexpected errors ['generics_defaults.py:52:0 Assert type [70]: Expected `Type[AllTheDefaults[]]` but got `typing.Any`.'] -Line 53: Unexpected errors ['generics_defaults.py:53:34 Invalid type parameters [24]: Non-generic type `AllTheDefaults` cannot take parameters.'] -Line 55: Unexpected errors ['generics_defaults.py:55:0 Assert type [70]: Expected `Type[AllTheDefaults[]]` but got `typing.Any`.'] -Line 57: Unexpected errors ['generics_defaults.py:57:4 Invalid type parameters [24]: Non-generic type `AllTheDefaults` cannot take parameters.'] -Line 59: Unexpected errors ['generics_defaults.py:59:0 Assert type [70]: Expected `Type[AllTheDefaults[]]` but got `typing.Any`.'] -Line 61: Unexpected errors ['generics_defaults.py:61:4 Invalid type parameters [24]: Non-generic type `AllTheDefaults` cannot take parameters.'] -Line 63: Unexpected errors ['generics_defaults.py:63:0 Assert type [70]: Expected `Type[AllTheDefaults[]]` but got `typing.Any`.'] -Line 65: Unexpected errors ['generics_defaults.py:65:4 Invalid type parameters [24]: Non-generic type `AllTheDefaults` cannot take parameters.'] -Line 76: Unexpected errors ['generics_defaults.py:76:22 Undefined or invalid type [11]: Annotation `DefaultP` is not defined as a type.'] -Line 79: Unexpected errors ['generics_defaults.py:79:0 Assert type [70]: Expected `Type[Class_ParamSpec[]]` but got `Type[Class_ParamSpec]`.', 'generics_defaults.py:79:29 Invalid type parameters [24]: Non-generic type `Class_ParamSpec` cannot take parameters.'] -Line 80: Unexpected errors ['generics_defaults.py:80:0 Assert type [70]: Expected `Class_ParamSpec[]` but got `Class_ParamSpec`.', 'generics_defaults.py:80:31 Invalid type parameters [24]: Non-generic type `Class_ParamSpec` cannot take parameters.'] -Line 81: Unexpected errors ['generics_defaults.py:81:0 Assert type [70]: Expected `Class_ParamSpec[]` but got `typing.Any`.', 'generics_defaults.py:81:12 Undefined attribute [16]: `Class_ParamSpec` has no attribute `__getitem__`.', 'generics_defaults.py:81:45 Invalid type parameters [24]: Non-generic type `Class_ParamSpec` cannot take parameters.'] -Line 91: Unexpected errors ['generics_defaults.py:91:25 Undefined or invalid type [11]: Annotation `DefaultTs` is not defined as a type.'] -Line 94: Unexpected errors ['generics_defaults.py:94:0 Assert type [70]: Expected `Type[Class_TypeVarTuple[]]` but got `Type[Class_TypeVarTuple]`.', 'generics_defaults.py:94:32 Invalid type parameters [24]: Non-generic type `Class_TypeVarTuple` cannot take parameters.'] -Line 95: Unexpected errors ['generics_defaults.py:95:0 Assert type [70]: Expected `Class_TypeVarTuple[]` but got `Class_TypeVarTuple`.', 'generics_defaults.py:95:34 Invalid type parameters [24]: Non-generic type `Class_TypeVarTuple` cannot take parameters.'] -Line 96: Unexpected errors ['generics_defaults.py:96:0 Assert type [70]: Expected `Class_TypeVarTuple[]` but got `typing.Any`.', 'generics_defaults.py:96:12 Undefined attribute [16]: `Class_TypeVarTuple` has no attribute `__getitem__`.', 'generics_defaults.py:96:45 Invalid type parameters [24]: Non-generic type `Class_TypeVarTuple` cannot take parameters.'] -Line 99: Unexpected errors ['generics_defaults.py:99:67 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T]]` but got `TypeVarTuple`.'] -Line 127: Unexpected errors ['generics_defaults.py:127:13 Undefined or invalid type [11]: Annotation `T4` is not defined as a type.'] -Line 130: Unexpected errors ['generics_defaults.py:130:0 Assert type [70]: Expected `int` but got `unknown`.'] -Line 131: Unexpected errors ['generics_defaults.py:131:0 Assert type [70]: Expected `typing.Any` but got `unknown`.'] -Line 152: Unexpected errors ["generics_defaults.py:152:11 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Ts`.", 'generics_defaults.py:152:11 Undefined or invalid type [11]: Annotation `P` is not defined as a type.'] -Line 155: Unexpected errors ['generics_defaults.py:155:0 Assert type [70]: Expected `Type[Foo6[]]` but got `typing.Any`.', 'generics_defaults.py:155:12 Undefined attribute [16]: `Foo6` has no attribute `__getitem__`.', 'generics_defaults.py:155:28 Invalid type parameters [24]: Non-generic type `Foo6` cannot take parameters.'] -Line 156: Unexpected errors ['generics_defaults.py:156:0 Assert type [70]: Expected `Type[Foo6[]]` but got `typing.Any`.', 'generics_defaults.py:156:37 Invalid type parameters [24]: Non-generic type `Foo6` cannot take parameters.'] -Line 170: Unexpected errors ['generics_defaults.py:170:0 Assert type [70]: Expected `typing.Callable[[Foo7[]], Foo7[]]` but got `typing.Callable(Foo7.meth)[[Variable[_Self_generics_defaults_Foo7__ (bound to Foo7)]], Variable[_Self_generics_defaults_Foo7__ (bound to Foo7)]]`.', 'generics_defaults.py:170:23 Invalid type parameters [24]: Non-generic type `Foo7` cannot take parameters.'] -Line 171: Unexpected errors ['generics_defaults.py:171:0 Assert type [70]: Expected `int` but got `unknown`.'] -""" diff --git a/conformance/results/pyre/generics_defaults_referential.toml b/conformance/results/pyre/generics_defaults_referential.toml deleted file mode 100644 index d7759bb41..000000000 --- a/conformance/results/pyre/generics_defaults_referential.toml +++ /dev/null @@ -1,61 +0,0 @@ -conformant = "Unsupported" -output = """ -generics_defaults_referential.py:20:12 Undefined or invalid type [11]: Annotation `StartT` is not defined as a type. -generics_defaults_referential.py:20:12 Undefined or invalid type [11]: Annotation `StepT` is not defined as a type. -generics_defaults_referential.py:20:12 Undefined or invalid type [11]: Annotation `StopT` is not defined as a type. -generics_defaults_referential.py:23:0 Assert type [70]: Expected `Type[slice[]]` but got `Type[slice]`. -generics_defaults_referential.py:23:19 Invalid type parameters [24]: Non-generic type `slice` cannot take parameters. -generics_defaults_referential.py:24:0 Assert type [70]: Expected `slice[]` but got `slice`. -generics_defaults_referential.py:24:21 Invalid type parameters [24]: Non-generic type `slice` cannot take parameters. -generics_defaults_referential.py:25:0 Assert type [70]: Expected `slice[]` but got `typing.Any`. -generics_defaults_referential.py:25:12 Undefined attribute [16]: `slice` has no attribute `__getitem__`. -generics_defaults_referential.py:25:26 Invalid type parameters [24]: Non-generic type `slice` cannot take parameters. -generics_defaults_referential.py:26:0 Assert type [70]: Expected `slice[]` but got `typing.Any`. -generics_defaults_referential.py:26:41 Invalid type parameters [24]: Non-generic type `slice` cannot take parameters. -generics_defaults_referential.py:31:10 Undefined or invalid type [11]: Annotation `DefaultStrT` is not defined as a type. -generics_defaults_referential.py:31:10 Undefined or invalid type [11]: Annotation `T2` is not defined as a type. -generics_defaults_referential.py:35:0 Assert type [70]: Expected `Foo[]` but got `Foo`. -generics_defaults_referential.py:35:24 Invalid type parameters [24]: Non-generic type `Foo` cannot take parameters. -generics_defaults_referential.py:36:0 Undefined attribute [16]: `Foo` has no attribute `__getitem__`. -generics_defaults_referential.py:46:11 Undefined or invalid type [11]: Annotation `S1` is not defined as a type. -generics_defaults_referential.py:46:11 Undefined or invalid type [11]: Annotation `S2` is not defined as a type. -generics_defaults_referential.py:53:13 Undefined or invalid type [11]: Annotation `Start2T` is not defined as a type. -generics_defaults_referential.py:53:13 Undefined or invalid type [11]: Annotation `Stop2T` is not defined as a type. -generics_defaults_referential.py:87:47 Undefined attribute [16]: `list` has no attribute `__getitem__`. -generics_defaults_referential.py:90:10 Undefined or invalid type [11]: Annotation `ListDefaultT` is not defined as a type. -generics_defaults_referential.py:90:10 Undefined or invalid type [11]: Annotation `Z1` is not defined as a type. -generics_defaults_referential.py:94:0 Assert type [70]: Expected `Type[Bar[]]` but got `Type[Bar]`. -generics_defaults_referential.py:94:17 Invalid type parameters [24]: Non-generic type `Bar` cannot take parameters. -generics_defaults_referential.py:95:0 Assert type [70]: Expected `Type[Bar[]]` but got `typing.Any`. -generics_defaults_referential.py:95:12 Undefined attribute [16]: `Bar` has no attribute `__getitem__`. -generics_defaults_referential.py:95:22 Invalid type parameters [24]: Non-generic type `Bar` cannot take parameters. -generics_defaults_referential.py:96:0 Assert type [70]: Expected `Bar[]` but got `typing.Any`. -generics_defaults_referential.py:96:29 Invalid type parameters [24]: Non-generic type `Bar` cannot take parameters. -generics_defaults_referential.py:97:0 Assert type [70]: Expected `Bar[]` but got `typing.Any`. -generics_defaults_referential.py:97:40 Invalid type parameters [24]: Non-generic type `Bar` cannot take parameters. -generics_defaults_referential.py:98:0 Assert type [70]: Expected `Bar[]` but got `typing.Any`. -generics_defaults_referential.py:98:34 Invalid type parameters [24]: Non-generic type `Bar` cannot take parameters. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 37: Expected 1 errors -Line 60: Expected 1 errors -Line 68: Expected 1 errors -Line 74: Expected 1 errors -Line 78: Expected 1 errors -Line 20: Unexpected errors ['generics_defaults_referential.py:20:12 Undefined or invalid type [11]: Annotation `StartT` is not defined as a type.', 'generics_defaults_referential.py:20:12 Undefined or invalid type [11]: Annotation `StepT` is not defined as a type.', 'generics_defaults_referential.py:20:12 Undefined or invalid type [11]: Annotation `StopT` is not defined as a type.'] -Line 23: Unexpected errors ['generics_defaults_referential.py:23:0 Assert type [70]: Expected `Type[slice[]]` but got `Type[slice]`.', 'generics_defaults_referential.py:23:19 Invalid type parameters [24]: Non-generic type `slice` cannot take parameters.'] -Line 24: Unexpected errors ['generics_defaults_referential.py:24:0 Assert type [70]: Expected `slice[]` but got `slice`.', 'generics_defaults_referential.py:24:21 Invalid type parameters [24]: Non-generic type `slice` cannot take parameters.'] -Line 25: Unexpected errors ['generics_defaults_referential.py:25:0 Assert type [70]: Expected `slice[]` but got `typing.Any`.', 'generics_defaults_referential.py:25:12 Undefined attribute [16]: `slice` has no attribute `__getitem__`.', 'generics_defaults_referential.py:25:26 Invalid type parameters [24]: Non-generic type `slice` cannot take parameters.'] -Line 26: Unexpected errors ['generics_defaults_referential.py:26:0 Assert type [70]: Expected `slice[]` but got `typing.Any`.', 'generics_defaults_referential.py:26:41 Invalid type parameters [24]: Non-generic type `slice` cannot take parameters.'] -Line 31: Unexpected errors ['generics_defaults_referential.py:31:10 Undefined or invalid type [11]: Annotation `DefaultStrT` is not defined as a type.', 'generics_defaults_referential.py:31:10 Undefined or invalid type [11]: Annotation `T2` is not defined as a type.'] -Line 35: Unexpected errors ['generics_defaults_referential.py:35:0 Assert type [70]: Expected `Foo[]` but got `Foo`.', 'generics_defaults_referential.py:35:24 Invalid type parameters [24]: Non-generic type `Foo` cannot take parameters.'] -Line 46: Unexpected errors ['generics_defaults_referential.py:46:11 Undefined or invalid type [11]: Annotation `S1` is not defined as a type.', 'generics_defaults_referential.py:46:11 Undefined or invalid type [11]: Annotation `S2` is not defined as a type.'] -Line 87: Unexpected errors ['generics_defaults_referential.py:87:47 Undefined attribute [16]: `list` has no attribute `__getitem__`.'] -Line 90: Unexpected errors ['generics_defaults_referential.py:90:10 Undefined or invalid type [11]: Annotation `ListDefaultT` is not defined as a type.', 'generics_defaults_referential.py:90:10 Undefined or invalid type [11]: Annotation `Z1` is not defined as a type.'] -Line 94: Unexpected errors ['generics_defaults_referential.py:94:0 Assert type [70]: Expected `Type[Bar[]]` but got `Type[Bar]`.', 'generics_defaults_referential.py:94:17 Invalid type parameters [24]: Non-generic type `Bar` cannot take parameters.'] -Line 95: Unexpected errors ['generics_defaults_referential.py:95:0 Assert type [70]: Expected `Type[Bar[]]` but got `typing.Any`.', 'generics_defaults_referential.py:95:12 Undefined attribute [16]: `Bar` has no attribute `__getitem__`.', 'generics_defaults_referential.py:95:22 Invalid type parameters [24]: Non-generic type `Bar` cannot take parameters.'] -Line 96: Unexpected errors ['generics_defaults_referential.py:96:0 Assert type [70]: Expected `Bar[]` but got `typing.Any`.', 'generics_defaults_referential.py:96:29 Invalid type parameters [24]: Non-generic type `Bar` cannot take parameters.'] -Line 97: Unexpected errors ['generics_defaults_referential.py:97:0 Assert type [70]: Expected `Bar[]` but got `typing.Any`.', 'generics_defaults_referential.py:97:40 Invalid type parameters [24]: Non-generic type `Bar` cannot take parameters.'] -Line 98: Unexpected errors ['generics_defaults_referential.py:98:0 Assert type [70]: Expected `Bar[]` but got `typing.Any`.', 'generics_defaults_referential.py:98:34 Invalid type parameters [24]: Non-generic type `Bar` cannot take parameters.'] -""" diff --git a/conformance/results/pyre/generics_defaults_specialization.toml b/conformance/results/pyre/generics_defaults_specialization.toml deleted file mode 100644 index 91acb349f..000000000 --- a/conformance/results/pyre/generics_defaults_specialization.toml +++ /dev/null @@ -1,45 +0,0 @@ -conformant = "Unsupported" -notes = """ -Does not support generic defaults. -""" -output = """ -generics_defaults_specialization.py:19:30 Undefined or invalid type [11]: Annotation `T1` is not defined as a type. -generics_defaults_specialization.py:19:30 Undefined or invalid type [11]: Annotation `T2` is not defined as a type. -generics_defaults_specialization.py:22:21 Undefined attribute [16]: `SomethingWithNoDefaults` has no attribute `__getitem__`. -generics_defaults_specialization.py:25:14 Undefined or invalid type [11]: Annotation `MyAlias` is not defined as a type. -generics_defaults_specialization.py:26:4 Assert type [70]: Expected `SomethingWithNoDefaults[]` but got `unknown`. -generics_defaults_specialization.py:26:20 Invalid type parameters [24]: Non-generic type `SomethingWithNoDefaults` cannot take parameters. -generics_defaults_specialization.py:27:4 Assert type [70]: Expected `SomethingWithNoDefaults[]` but got `unknown`. -generics_defaults_specialization.py:27:20 Invalid type parameters [24]: Non-generic type `SomethingWithNoDefaults` cannot take parameters. -generics_defaults_specialization.py:30:0 Undefined attribute [16]: `TypeAlias` has no attribute `__getitem__`. -generics_defaults_specialization.py:38:17 Undefined or invalid type [11]: Annotation `DefaultStrT` is not defined as a type. -generics_defaults_specialization.py:45:0 Assert type [70]: Expected `Type[Bar[]]` but got `Type[Bar]`. -generics_defaults_specialization.py:45:17 Invalid type parameters [24]: Non-generic type `Bar` cannot take parameters. -generics_defaults_specialization.py:46:0 Assert type [70]: Expected `Bar[]` but got `Bar`. -generics_defaults_specialization.py:46:19 Invalid type parameters [24]: Non-generic type `Bar` cannot take parameters. -generics_defaults_specialization.py:47:0 Assert type [70]: Expected `Bar[]` but got `typing.Any`. -generics_defaults_specialization.py:47:12 Undefined attribute [16]: `Bar` has no attribute `__getitem__`. -generics_defaults_specialization.py:47:25 Invalid type parameters [24]: Non-generic type `Bar` cannot take parameters. -generics_defaults_specialization.py:50:10 Invalid type parameters [24]: Non-generic type `SubclassMe` cannot take parameters. -generics_defaults_specialization.py:53:0 Assert type [70]: Expected `str` but got `unknown`. -generics_defaults_specialization.py:55:0 Undefined attribute [16]: `Foo` has no attribute `__getitem__`. -generics_defaults_specialization.py:58:10 Undefined or invalid type [11]: Annotation `DefaultIntT` is not defined as a type. -generics_defaults_specialization.py:65:0 Incompatible variable type [9]: v1 is declared to have type `Baz[]` but is used as type `Spam`. -generics_defaults_specialization.py:65:4 Invalid type parameters [24]: Non-generic type `Baz` cannot take parameters. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 19: Unexpected errors ['generics_defaults_specialization.py:19:30 Undefined or invalid type [11]: Annotation `T1` is not defined as a type.', 'generics_defaults_specialization.py:19:30 Undefined or invalid type [11]: Annotation `T2` is not defined as a type.'] -Line 22: Unexpected errors ['generics_defaults_specialization.py:22:21 Undefined attribute [16]: `SomethingWithNoDefaults` has no attribute `__getitem__`.'] -Line 25: Unexpected errors ['generics_defaults_specialization.py:25:14 Undefined or invalid type [11]: Annotation `MyAlias` is not defined as a type.'] -Line 26: Unexpected errors ['generics_defaults_specialization.py:26:4 Assert type [70]: Expected `SomethingWithNoDefaults[]` but got `unknown`.', 'generics_defaults_specialization.py:26:20 Invalid type parameters [24]: Non-generic type `SomethingWithNoDefaults` cannot take parameters.'] -Line 27: Unexpected errors ['generics_defaults_specialization.py:27:4 Assert type [70]: Expected `SomethingWithNoDefaults[]` but got `unknown`.', 'generics_defaults_specialization.py:27:20 Invalid type parameters [24]: Non-generic type `SomethingWithNoDefaults` cannot take parameters.'] -Line 38: Unexpected errors ['generics_defaults_specialization.py:38:17 Undefined or invalid type [11]: Annotation `DefaultStrT` is not defined as a type.'] -Line 45: Unexpected errors ['generics_defaults_specialization.py:45:0 Assert type [70]: Expected `Type[Bar[]]` but got `Type[Bar]`.', 'generics_defaults_specialization.py:45:17 Invalid type parameters [24]: Non-generic type `Bar` cannot take parameters.'] -Line 46: Unexpected errors ['generics_defaults_specialization.py:46:0 Assert type [70]: Expected `Bar[]` but got `Bar`.', 'generics_defaults_specialization.py:46:19 Invalid type parameters [24]: Non-generic type `Bar` cannot take parameters.'] -Line 47: Unexpected errors ['generics_defaults_specialization.py:47:0 Assert type [70]: Expected `Bar[]` but got `typing.Any`.', 'generics_defaults_specialization.py:47:12 Undefined attribute [16]: `Bar` has no attribute `__getitem__`.', 'generics_defaults_specialization.py:47:25 Invalid type parameters [24]: Non-generic type `Bar` cannot take parameters.'] -Line 50: Unexpected errors ['generics_defaults_specialization.py:50:10 Invalid type parameters [24]: Non-generic type `SubclassMe` cannot take parameters.'] -Line 53: Unexpected errors ['generics_defaults_specialization.py:53:0 Assert type [70]: Expected `str` but got `unknown`.'] -Line 58: Unexpected errors ['generics_defaults_specialization.py:58:10 Undefined or invalid type [11]: Annotation `DefaultIntT` is not defined as a type.'] -Line 65: Unexpected errors ['generics_defaults_specialization.py:65:0 Incompatible variable type [9]: v1 is declared to have type `Baz[]` but is used as type `Spam`.', 'generics_defaults_specialization.py:65:4 Invalid type parameters [24]: Non-generic type `Baz` cannot take parameters.'] -""" diff --git a/conformance/results/pyre/generics_paramspec_basic.toml b/conformance/results/pyre/generics_paramspec_basic.toml deleted file mode 100644 index 74f97773a..000000000 --- a/conformance/results/pyre/generics_paramspec_basic.toml +++ /dev/null @@ -1,25 +0,0 @@ -conformant = "Partial" -notes = """ -Does not enforce name consistency for ParamSpec assigned to identifier. -Incorrectly reports error for legitimate use of ParamSpec in generic type alias. -Does not reject ParamSpec when used in various invalid locations. -""" -output = """ -generics_paramspec_basic.py:15:0 Undefined or invalid type [11]: Annotation `P` is not defined as a type. -generics_paramspec_basic.py:17:0 Incompatible variable type [9]: TA2 is declared to have type `TypeAlias` but is used as type `Type[typing.Callable[..., Variable[$synthetic_attribute_resolution_variable]]]`. -generics_paramspec_basic.py:17:26 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[typing.Any, Type[Variable[$synthetic_attribute_resolution_variable]]]` but got `Tuple[ParamSpec, None]`. -generics_paramspec_basic.py:18:0 Incompatible variable type [9]: TA3 is declared to have type `TypeAlias` but is used as type `Type[typing.Callable[..., Variable[$synthetic_attribute_resolution_variable]]]`. -generics_paramspec_basic.py:18:26 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[typing.Any, Type[Variable[$synthetic_attribute_resolution_variable]]]` but got `Tuple[object, None]`. -generics_paramspec_basic.py:27:13 Invalid type variable [34]: The type variable `P` isn't present in the function's parameters. -generics_paramspec_basic.py:27:13 Undefined or invalid type [11]: Annotation `Concatenate` is not defined as a type. -generics_paramspec_basic.py:31:13 Invalid type parameters [24]: Single type parameter `Variable[_T]` expected, but a callable parameters `generics_paramspec_basic.P` was given for generic type list. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 10: Expected 1 errors -Line 23: Expected 1 errors -Line 35: Expected 1 errors -Line 39: Expected 1 errors -Line 17: Unexpected errors ['generics_paramspec_basic.py:17:0 Incompatible variable type [9]: TA2 is declared to have type `TypeAlias` but is used as type `Type[typing.Callable[..., Variable[$synthetic_attribute_resolution_variable]]]`.', 'generics_paramspec_basic.py:17:26 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[typing.Any, Type[Variable[$synthetic_attribute_resolution_variable]]]` but got `Tuple[ParamSpec, None]`.'] -Line 18: Unexpected errors ['generics_paramspec_basic.py:18:0 Incompatible variable type [9]: TA3 is declared to have type `TypeAlias` but is used as type `Type[typing.Callable[..., Variable[$synthetic_attribute_resolution_variable]]]`.', 'generics_paramspec_basic.py:18:26 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[typing.Any, Type[Variable[$synthetic_attribute_resolution_variable]]]` but got `Tuple[object, None]`.'] -""" diff --git a/conformance/results/pyre/generics_paramspec_components.toml b/conformance/results/pyre/generics_paramspec_components.toml deleted file mode 100644 index 76e8a8c2d..000000000 --- a/conformance/results/pyre/generics_paramspec_components.toml +++ /dev/null @@ -1,32 +0,0 @@ -conformant = "Partial" -notes = """ -Does not report illegal use of "P.args" on normal parameter. -Does not report error when P.args is specified but P.kwargs is missing. -Does not report error when P is out of scope and P.args and P.kwargs is used. -Does not report error when calling callback defined with ParamSpec with incorrect arguments. -Does not report error when keyword argument is specified between P.args and P.kwargs. -Does not report error when calling callable and argument is missing for concatenated parameters. -""" -output = """ -generics_paramspec_components.py:17:24 Undefined or invalid type [11]: Annotation `P.kwargs` is not defined as a type. -generics_paramspec_components.py:17:44 Undefined or invalid type [11]: Annotation `P.args` is not defined as a type. -generics_paramspec_components.py:49:8 Call error [29]: `typing.Callable[generics_paramspec_components.P, int]` cannot be safely called because the types and kinds of its parameters depend on a type variable. -generics_paramspec_components.py:70:8 Call error [29]: `typing.Callable[typing.Concatenate[int, generics_paramspec_components.P], int]` cannot be safely called because the types and kinds of its parameters depend on a type variable. -generics_paramspec_components.py:72:8 Missing argument [20]: PositionalOnly call expects argument in position 0. -generics_paramspec_components.py:83:8 Unexpected keyword [28]: Unexpected keyword argument `x` to call `outer.foo`. -generics_paramspec_components.py:98:19 Incompatible parameter type [6]: In call `twice`, for 2nd positional argument, expected `int` but got `str`. -generics_paramspec_components.py:98:24 Incompatible parameter type [6]: In call `twice`, for 3rd positional argument, expected `str` but got `int`. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 20: Expected 1 errors -Line 23: Expected 1 errors -Line 26: Expected 1 errors -Line 30: Expected 1 errors -Line 35: Expected 1 errors -Line 36: Expected 1 errors -Line 38: Expected 1 errors -Line 41: Expected 1 errors -Line 51: Expected 1 errors -Line 60: Expected 1 errors -""" diff --git a/conformance/results/pyre/generics_paramspec_semantics.toml b/conformance/results/pyre/generics_paramspec_semantics.toml deleted file mode 100644 index 851212188..000000000 --- a/conformance/results/pyre/generics_paramspec_semantics.toml +++ /dev/null @@ -1,16 +0,0 @@ -conformant = "Pass" -output = """ -generics_paramspec_semantics.py:26:0 Unexpected keyword [28]: Unexpected keyword argument `a` to anonymous call. -generics_paramspec_semantics.py:27:8 Incompatible parameter type [6]: In anonymous call, for 2nd positional argument, expected `bool` but got `str`. -generics_paramspec_semantics.py:46:16 Incompatible parameter type [6]: In call `func1`, for 2nd positional argument, expected `typing.Callable[generics_paramspec_semantics.P, int]` but got `typing.Callable(y_x)[[Named(y, int), Named(x, str)], int]`. -generics_paramspec_semantics.py:61:22 Incompatible parameter type [6]: In call `func1`, for 2nd positional argument, expected `typing.Callable[generics_paramspec_semantics.P, int]` but got `typing.Callable(keyword_only_y)[[KeywordOnly(y, int)], int]`. -generics_paramspec_semantics.py:98:3 Incompatible parameter type [6]: In anonymous call, for 1st positional argument, expected `str` but got `int`. -generics_paramspec_semantics.py:108:3 Incompatible parameter type [6]: In anonymous call, for 1st positional argument, expected `bool` but got `int`. -generics_paramspec_semantics.py:120:3 Incompatible parameter type [6]: In anonymous call, for 1st positional argument, expected `str` but got `int`. -generics_paramspec_semantics.py:127:1 Invalid decoration [56]: Pyre doesn't yet support decorators with ParamSpec applied to generic functions. Consider using a context manager instead of a decorator, if possible. -generics_paramspec_semantics.py:132:1 Invalid decoration [56]: Pyre doesn't yet support decorators with ParamSpec applied to generic functions. Consider using a context manager instead of a decorator, if possible. -generics_paramspec_semantics.py:137:1 Invalid decoration [56]: Pyre doesn't yet support decorators with ParamSpec applied to generic functions. Consider using a context manager instead of a decorator, if possible. -""" -conformance_automated = "Pass" -errors_diff = """ -""" diff --git a/conformance/results/pyre/generics_paramspec_specialization.toml b/conformance/results/pyre/generics_paramspec_specialization.toml deleted file mode 100644 index d4da441aa..000000000 --- a/conformance/results/pyre/generics_paramspec_specialization.toml +++ /dev/null @@ -1,18 +0,0 @@ -conformant = "Partial" -notes = """ -Reports error for legitimate use of `...` to specialize ParamSpec -""" -output = """ -generics_paramspec_specialization.py:44:14 Invalid type parameters [24]: Callable parameters expected for parameter specification `P1`, but a single type `int` was given for generic type ClassA. -generics_paramspec_specialization.py:53:4 Too many arguments [19]: PositionalOnly call expects 2 positional arguments, 3 were provided. -generics_paramspec_specialization.py:54:4 Too many arguments [19]: PositionalOnly call expects 2 positional arguments, 3 were provided. -generics_paramspec_specialization.py:55:4 Too many arguments [19]: PositionalOnly call expects 2 positional arguments, 3 were provided. -generics_paramspec_specialization.py:59:4 Too many arguments [19]: PositionalOnly call expects 2 positional arguments, 3 were provided. -generics_paramspec_specialization.py:60:4 Too many arguments [19]: PositionalOnly call expects 2 positional arguments, 3 were provided. -generics_paramspec_specialization.py:61:4 Too many arguments [19]: PositionalOnly call expects 2 positional arguments, 3 were provided. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 53: Unexpected errors ['generics_paramspec_specialization.py:53:4 Too many arguments [19]: PositionalOnly call expects 2 positional arguments, 3 were provided.'] -Line 59: Unexpected errors ['generics_paramspec_specialization.py:59:4 Too many arguments [19]: PositionalOnly call expects 2 positional arguments, 3 were provided.'] -""" diff --git a/conformance/results/pyre/generics_scoping.toml b/conformance/results/pyre/generics_scoping.toml deleted file mode 100644 index e91ac08ba..000000000 --- a/conformance/results/pyre/generics_scoping.toml +++ /dev/null @@ -1,29 +0,0 @@ -conformant = "Partial" -notes = """ -False negative on generic class nested within generic function with same type variable. -False negative on generic class nested within generic class with same type variable. -False negative on assert_type uses. -""" -output = """ -generics_scoping.py:14:0 Assert type [70]: Expected `int` but got `typing_extensions.Literal[1]`. -generics_scoping.py:15:0 Assert type [70]: Expected `str` but got `typing_extensions.Literal['a']`. -generics_scoping.py:29:9 Incompatible parameter type [6]: In call `MyClass.meth_2`, for 1st positional argument, expected `int` but got `str`. -generics_scoping.py:42:0 Assert type [70]: Expected `str` but got `typing_extensions.Literal['abc']`. -generics_scoping.py:43:0 Assert type [70]: Expected `bytes` but got `typing_extensions.Literal[b'abc']`. -generics_scoping.py:50:7 Invalid type variable [34]: The type variable `Variable[S]` isn't present in the function's parameters. -generics_scoping.py:54:13 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Variable[S]`. To reference the type variable, you can modify the class to inherit from `typing.Generic[S]`. -generics_scoping.py:78:11 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Variable[T]`. To reference the type variable, you can modify the class to inherit from `typing.Generic[T]`. -generics_scoping.py:87:4 Incompatible attribute type [8]: Attribute `alias` declared in class `Outer` has type `TypeAlias` but is used as type `Type[List[Variable[T]]]`. -generics_scoping.py:94:13 Invalid type variable [34]: The type variable `Variable[T]` can only be used to annotate generic classes or functions. -generics_scoping.py:95:13 Invalid type variable [34]: The type variable `Variable[T]` can only be used to annotate generic classes or functions. -generics_scoping.py:96:0 Undefined attribute [16]: `list` has no attribute `__getitem__`. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 65: Expected 1 errors -Line 75: Expected 1 errors -Line 14: Unexpected errors ['generics_scoping.py:14:0 Assert type [70]: Expected `int` but got `typing_extensions.Literal[1]`.'] -Line 15: Unexpected errors ["generics_scoping.py:15:0 Assert type [70]: Expected `str` but got `typing_extensions.Literal['a']`."] -Line 42: Unexpected errors ["generics_scoping.py:42:0 Assert type [70]: Expected `str` but got `typing_extensions.Literal['abc']`."] -Line 43: Unexpected errors ["generics_scoping.py:43:0 Assert type [70]: Expected `bytes` but got `typing_extensions.Literal[b'abc']`."] -""" diff --git a/conformance/results/pyre/generics_self_advanced.toml b/conformance/results/pyre/generics_self_advanced.toml deleted file mode 100644 index f298efb4c..000000000 --- a/conformance/results/pyre/generics_self_advanced.toml +++ /dev/null @@ -1,24 +0,0 @@ -conformant = "Partial" -notes = """ -Does not handle use of `Self` within class body correctly. -False negatives on assert_type uses. -""" -output = """ -generics_self_advanced.py:25:7 Undefined or invalid type [11]: Annotation `Self` is not defined as a type. -generics_self_advanced.py:35:8 Assert type [70]: Expected `unknown` but got `ChildB`. -generics_self_advanced.py:37:8 Assert type [70]: Expected `unknown` but got `typing.Any`. -generics_self_advanced.py:38:8 Assert type [70]: Expected `unknown` but got `ChildB`. -generics_self_advanced.py:42:8 Assert type [70]: Expected `unknown` but got `Type[ChildB]`. -generics_self_advanced.py:44:8 Assert type [70]: Expected `unknown` but got `typing.Any`. -generics_self_advanced.py:45:8 Assert type [70]: Expected `unknown` but got `ChildB`. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 25: Unexpected errors ['generics_self_advanced.py:25:7 Undefined or invalid type [11]: Annotation `Self` is not defined as a type.'] -Line 35: Unexpected errors ['generics_self_advanced.py:35:8 Assert type [70]: Expected `unknown` but got `ChildB`.'] -Line 37: Unexpected errors ['generics_self_advanced.py:37:8 Assert type [70]: Expected `unknown` but got `typing.Any`.'] -Line 38: Unexpected errors ['generics_self_advanced.py:38:8 Assert type [70]: Expected `unknown` but got `ChildB`.'] -Line 42: Unexpected errors ['generics_self_advanced.py:42:8 Assert type [70]: Expected `unknown` but got `Type[ChildB]`.'] -Line 44: Unexpected errors ['generics_self_advanced.py:44:8 Assert type [70]: Expected `unknown` but got `typing.Any`.'] -Line 45: Unexpected errors ['generics_self_advanced.py:45:8 Assert type [70]: Expected `unknown` but got `ChildB`.'] -""" diff --git a/conformance/results/pyre/generics_self_attributes.toml b/conformance/results/pyre/generics_self_attributes.toml deleted file mode 100644 index 557fadbf7..000000000 --- a/conformance/results/pyre/generics_self_attributes.toml +++ /dev/null @@ -1,15 +0,0 @@ -conformant = "Unsupported" -notes = """ -Does not understand `Self` type. -""" -output = """ -generics_self_attributes.py:16:10 Undefined or invalid type [11]: Annotation `Self` is not defined as a type. -generics_self_attributes.py:26:5 Unexpected keyword [28]: Unexpected keyword argument `next` to call `OrdinalLinkedList.__init__`. -generics_self_attributes.py:29:14 Unexpected keyword [28]: Unexpected keyword argument `next` to call `OrdinalLinkedList.__init__`. -generics_self_attributes.py:32:14 Unexpected keyword [28]: Unexpected keyword argument `next` to call `LinkedList.__init__`. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 16: Unexpected errors ['generics_self_attributes.py:16:10 Undefined or invalid type [11]: Annotation `Self` is not defined as a type.'] -Line 29: Unexpected errors ['generics_self_attributes.py:29:14 Unexpected keyword [28]: Unexpected keyword argument `next` to call `OrdinalLinkedList.__init__`.'] -""" diff --git a/conformance/results/pyre/generics_self_basic.toml b/conformance/results/pyre/generics_self_basic.toml deleted file mode 100644 index db088609e..000000000 --- a/conformance/results/pyre/generics_self_basic.toml +++ /dev/null @@ -1,19 +0,0 @@ -conformant = "Partial" -notes = """ -Does not handle use of `Self` as a generic type. -""" -output = """ -generics_self_basic.py:14:8 Assert type [70]: Expected `unknown` but got `Variable[_Self_generics_self_basic_Shape__ (bound to Shape)]`. -generics_self_basic.py:14:26 Undefined or invalid type [11]: Annotation `Self` is not defined as a type. -generics_self_basic.py:20:8 Incompatible return type [7]: Expected `Variable[_Self_generics_self_basic_Shape__ (bound to Shape)]` but got `Shape`. -generics_self_basic.py:27:8 Assert type [70]: Expected `unknown` but got `Type[Variable[_Self_generics_self_basic_Shape__ (bound to Shape)]]`. -generics_self_basic.py:33:8 Incompatible return type [7]: Expected `Variable[_Self_generics_self_basic_Shape__ (bound to Shape)]` but got `Shape`. -generics_self_basic.py:40:8 Assert type [70]: Expected `unknown` but got `Variable[_Self_generics_self_basic_Shape__ (bound to Shape)]`. -generics_self_basic.py:67:25 Invalid type parameters [24]: Non-generic type `_Self_generics_self_basic_Container__` cannot take parameters. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 14: Unexpected errors ['generics_self_basic.py:14:8 Assert type [70]: Expected `unknown` but got `Variable[_Self_generics_self_basic_Shape__ (bound to Shape)]`.', 'generics_self_basic.py:14:26 Undefined or invalid type [11]: Annotation `Self` is not defined as a type.'] -Line 27: Unexpected errors ['generics_self_basic.py:27:8 Assert type [70]: Expected `unknown` but got `Type[Variable[_Self_generics_self_basic_Shape__ (bound to Shape)]]`.'] -Line 40: Unexpected errors ['generics_self_basic.py:40:8 Assert type [70]: Expected `unknown` but got `Variable[_Self_generics_self_basic_Shape__ (bound to Shape)]`.'] -""" diff --git a/conformance/results/pyre/generics_self_protocols.toml b/conformance/results/pyre/generics_self_protocols.toml deleted file mode 100644 index 309def8b8..000000000 --- a/conformance/results/pyre/generics_self_protocols.toml +++ /dev/null @@ -1,11 +0,0 @@ -conformant = "Partial" -notes = """ -Does not reject protocol compatibility due to method `Self` return type. -""" -output = """ -generics_self_protocols.py:61:18 Incompatible parameter type [6]: In call `accepts_shape`, for 1st positional argument, expected `ShapeProtocol` but got `BadReturnType`. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 64: Expected 1 errors -""" diff --git a/conformance/results/pyre/generics_self_usage.toml b/conformance/results/pyre/generics_self_usage.toml deleted file mode 100644 index 8907b5e76..000000000 --- a/conformance/results/pyre/generics_self_usage.toml +++ /dev/null @@ -1,28 +0,0 @@ -conformant = "Partial" -notes = """ -Complains in some cases when `self: Self` is used explicitly. -Does not complain when `Self` is used on a function outside any class definition. -Does not complain when `self` is annotated explicitly (without `Self`) and `Self` is returned. -Does not complain on inheritance involving `Self`. -Does not complain on use of `Self` in static methods. -Does not complain on use of `Self` in metaclasses. -""" -output = """ -generics_self_usage.py:20:34 Undefined or invalid type [11]: Annotation `Self` is not defined as a type. -generics_self_usage.py:86:8 Incompatible return type [7]: Expected `Variable[_Self_generics_self_usage_Foo3__ (bound to Foo3)]` but got `Foo3`. -generics_self_usage.py:106:23 Undefined attribute [16]: `tuple` has no attribute `__getitem__`. -generics_self_usage.py:106:29 Undefined attribute [16]: Module `typing` has no attribute `Self`. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 73: Expected 1 errors -Line 76: Expected 1 errors -Line 82: Expected 1 errors -Line 101: Expected 1 errors -Line 103: Expected 1 errors -Line 111: Expected 1 errors -Line 116: Expected 1 errors -Line 121: Expected 1 errors -Line 125: Expected 1 errors -Line 20: Unexpected errors ['generics_self_usage.py:20:34 Undefined or invalid type [11]: Annotation `Self` is not defined as a type.'] -""" diff --git a/conformance/results/pyre/generics_syntax_compatibility.toml b/conformance/results/pyre/generics_syntax_compatibility.toml deleted file mode 100644 index 71877e3ce..000000000 --- a/conformance/results/pyre/generics_syntax_compatibility.toml +++ /dev/null @@ -1,14 +0,0 @@ -conformant = "Partial" -notes = """ -False negative on mixing legacy and PEP695 syntax. -Does not detect mixing legacy and PEP695 syntax in methods. -""" -output = """ -generics_syntax_compatibility.py:14:16 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Variable[K]`. To reference the type variable, you can modify the class to inherit from `typing.Generic[K]`. -generics_syntax_compatibility.py:18:19 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Variable[K]`. To reference the type variable, you can modify the class to inherit from `typing.Generic[K]`. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 26: Expected 1 errors -Line 18: Unexpected errors ["generics_syntax_compatibility.py:18:19 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Variable[K]`. To reference the type variable, you can modify the class to inherit from `typing.Generic[K]`."] -""" diff --git a/conformance/results/pyre/generics_syntax_declarations.toml b/conformance/results/pyre/generics_syntax_declarations.toml deleted file mode 100644 index a97c785e4..000000000 --- a/conformance/results/pyre/generics_syntax_declarations.toml +++ /dev/null @@ -1,20 +0,0 @@ -conformant = "Partial" -notes = """ -Does not detect incorrect use of legacy style syntax mixed with PEP695 syntax. -False negatives due to assert_type use. -""" -output = """ -generics_syntax_declarations.py:32:8 Undefined attribute [16]: `Variable[T (bound to str)]` has no attribute `is_integer`. -generics_syntax_declarations.py:44:20 Invalid bound [75]: `dict[(str, V)]` is not valid bound. -generics_syntax_declarations.py:48:16 Invalid bound [75]: `[str, int]` is not valid bound. -generics_syntax_declarations.py:60:16 Invalid bound [75]: `()` is not valid bound. -generics_syntax_declarations.py:64:16 Invalid bound [75]: `(str)` is not valid bound. -generics_syntax_declarations.py:71:16 Invalid bound [75]: `$local_generics_syntax_declarations$t1` is not valid bound. -generics_syntax_declarations.py:75:16 Invalid bound [75]: `(3, bytes)` is not valid bound. -generics_syntax_declarations.py:79:16 Invalid bound [75]: `(list[S], str)` is not valid bound. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 17: Expected 1 errors -Line 25: Expected 1 errors -""" diff --git a/conformance/results/pyre/generics_syntax_infer_variance.toml b/conformance/results/pyre/generics_syntax_infer_variance.toml deleted file mode 100644 index 6339780b7..000000000 --- a/conformance/results/pyre/generics_syntax_infer_variance.toml +++ /dev/null @@ -1,30 +0,0 @@ -conformant = "Partial" -notes = """ -Incorrectly determines that a class cannot be instantiated with __getitem__. -Incorrectly handles mixing legacy and PEP695 syntax. -""" -output = """ -generics_syntax_infer_variance.py:15:0 Invalid variance definition [77]: Cannot use infer_variance with predefined variance. -generics_syntax_infer_variance.py:17:0 Invalid variance definition [77]: Cannot use infer_variance with predefined variance. -generics_syntax_infer_variance.py:29:0 Incompatible variable type [9]: vco1_2 is declared to have type `ShouldBeCovariant1[int]` but is used as type `ShouldBeCovariant1[float]`. -generics_syntax_infer_variance.py:47:0 Incompatible variable type [9]: vco2_2 is declared to have type `ShouldBeCovariant2[int]` but is used as type `ShouldBeCovariant2[float]`. -generics_syntax_infer_variance.py:56:0 Incompatible variable type [9]: vco3_2 is declared to have type `ShouldBeCovariant3[int]` but is used as type `ShouldBeCovariant3[float]`. -generics_syntax_infer_variance.py:85:0 Incompatible variable type [9]: vo5_2 is declared to have type `ShouldBeCovariant5[int]` but is used as type `ShouldBeCovariant5[float]`. -generics_syntax_infer_variance.py:96:0 Incompatible variable type [9]: vo6_2 is declared to have type `ShouldBeCovariant6[int]` but is used as type `ShouldBeCovariant6[float]`. -generics_syntax_infer_variance.py:112:0 Incompatible variable type [9]: vinv1_1 is declared to have type `ShouldBeInvariant1[float]` but is used as type `ShouldBeInvariant1[int]`. -generics_syntax_infer_variance.py:113:0 Incompatible variable type [9]: vinv1_2 is declared to have type `ShouldBeInvariant1[int]` but is used as type `ShouldBeInvariant1[float]`. -generics_syntax_infer_variance.py:127:0 Incompatible variable type [9]: vinv2_1 is declared to have type `ShouldBeInvariant2[float]` but is used as type `ShouldBeInvariant2[int]`. -generics_syntax_infer_variance.py:128:0 Incompatible variable type [9]: vinv2_2 is declared to have type `ShouldBeInvariant2[int]` but is used as type `ShouldBeInvariant2[float]`. -generics_syntax_infer_variance.py:135:0 Incompatible variable type [9]: vinv3_1 is declared to have type `ShouldBeInvariant3[float, str]` but is used as type `ShouldBeInvariant3[int, str]`. -generics_syntax_infer_variance.py:136:0 Incompatible variable type [9]: vinv3_2 is declared to have type `ShouldBeInvariant3[int, str]` but is used as type `ShouldBeInvariant3[float, str]`. -generics_syntax_infer_variance.py:137:0 Incompatible variable type [9]: vinv3_3 is declared to have type `ShouldBeInvariant3[str, float]` but is used as type `ShouldBeInvariant3[str, int]`. -generics_syntax_infer_variance.py:138:0 Incompatible variable type [9]: vinv3_4 is declared to have type `ShouldBeInvariant3[str, int]` but is used as type `ShouldBeInvariant3[str, float]`. -generics_syntax_infer_variance.py:143:7 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Variable[T]`. To reference the type variable, you can modify the class to inherit from `typing.Generic[T]`. -generics_syntax_infer_variance.py:165:0 Incompatible variable type [9]: vcontra1_1 is declared to have type `ShouldBeContravariant1[float]` but is used as type `ShouldBeContravariant1[int]`. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 146: Expected 1 errors -Line 154: Expected 1 errors -Line 143: Unexpected errors ["generics_syntax_infer_variance.py:143:7 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Variable[T]`. To reference the type variable, you can modify the class to inherit from `typing.Generic[T]`."] -""" diff --git a/conformance/results/pyre/generics_syntax_scoping.toml b/conformance/results/pyre/generics_syntax_scoping.toml deleted file mode 100644 index 4ac894c8c..000000000 --- a/conformance/results/pyre/generics_syntax_scoping.toml +++ /dev/null @@ -1,20 +0,0 @@ -conformant = "Partial" -notes = """ -Does not properly handle mixing legacy syntax with PEP695 syntax. -""" -output = """ -generics_syntax_scoping.py:14:19 Invalid bound [75]: `typing.Sequence[$local_generics_syntax_scoping$S]` is not valid bound. -generics_syntax_scoping.py:18:16 Invalid bound [75]: `typing.Sequence[$local_generics_syntax_scoping$T]` is not valid bound. -generics_syntax_scoping.py:27:38 Undefined or invalid type [11]: Annotation `T` is not defined as a type. -generics_syntax_scoping.py:31:41 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[T]]` but got `int`. -generics_syntax_scoping.py:98:28 Undefined or invalid type [11]: Annotation `ClassE.T` is not defined as a type. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 35: Expected 1 errors -Line 44: Expected 1 errors -Line 92: Expected 1 errors -Line 95: Expected 1 errors -Line 27: Unexpected errors ['generics_syntax_scoping.py:27:38 Undefined or invalid type [11]: Annotation `T` is not defined as a type.'] -Line 31: Unexpected errors ['generics_syntax_scoping.py:31:41 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[T]]` but got `int`.'] -""" diff --git a/conformance/results/pyre/generics_type_erasure.toml b/conformance/results/pyre/generics_type_erasure.toml deleted file mode 100644 index af4f56c41..000000000 --- a/conformance/results/pyre/generics_type_erasure.toml +++ /dev/null @@ -1,29 +0,0 @@ -conformant = "Partial" -notes = """ -Does not erase unspecified type variables to `Any` prior to `assert_type` handling. -False negatives on instance attribute access on the type. -Does not infer type of `DefaultDict` with explicit type parameters on constructor. -False negatives on assert_type uses. -""" -output = """ -generics_type_erasure.py:17:0 Assert type [70]: Expected `Node[str]` but got `Node[typing_extensions.Literal['']]`. -generics_type_erasure.py:18:0 Assert type [70]: Expected `Node[int]` but got `Node[typing_extensions.Literal[0]]`. -generics_type_erasure.py:19:0 Assert type [70]: Expected `Node[typing.Any]` but got `Node[Variable[T]]`. -generics_type_erasure.py:21:0 Assert type [70]: Expected `int` but got `typing_extensions.Literal[0]`. -generics_type_erasure.py:38:15 Incompatible parameter type [6]: In call `Node.__init__`, for 1st positional argument, expected `Optional[int]` but got `str`. -generics_type_erasure.py:40:15 Incompatible parameter type [6]: In call `Node.__init__`, for 1st positional argument, expected `Optional[str]` but got `int`. -generics_type_erasure.py:56:0 Assert type [70]: Expected `bytes` but got `typing.Any`. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 42: Expected 1 errors -Line 43: Expected 1 errors -Line 44: Expected 1 errors -Line 45: Expected 1 errors -Line 46: Expected 1 errors -Line 17: Unexpected errors ["generics_type_erasure.py:17:0 Assert type [70]: Expected `Node[str]` but got `Node[typing_extensions.Literal['']]`."] -Line 18: Unexpected errors ['generics_type_erasure.py:18:0 Assert type [70]: Expected `Node[int]` but got `Node[typing_extensions.Literal[0]]`.'] -Line 19: Unexpected errors ['generics_type_erasure.py:19:0 Assert type [70]: Expected `Node[typing.Any]` but got `Node[Variable[T]]`.'] -Line 21: Unexpected errors ['generics_type_erasure.py:21:0 Assert type [70]: Expected `int` but got `typing_extensions.Literal[0]`.'] -Line 56: Unexpected errors ['generics_type_erasure.py:56:0 Assert type [70]: Expected `bytes` but got `typing.Any`.'] -""" diff --git a/conformance/results/pyre/generics_typevartuple_args.toml b/conformance/results/pyre/generics_typevartuple_args.toml deleted file mode 100644 index 7f48df0cd..000000000 --- a/conformance/results/pyre/generics_typevartuple_args.toml +++ /dev/null @@ -1,25 +0,0 @@ -conformant = "Partial" -notes = """ -Does not property handle TypeVarTuple. -""" -output = """ -generics_typevartuple_args.py:20:0 Assert type [70]: Expected `Tuple[int, str]` but got `Tuple[typing_extensions.Literal[1], typing_extensions.Literal['a']]`. -generics_typevartuple_args.py:32:0 Assert type [70]: Expected `Tuple[int, str]` but got `Tuple[typing_extensions.Literal[0], typing_extensions.Literal['']]`. -generics_typevartuple_args.py:33:0 Invalid argument [32]: Argument types `typing_extensions.Literal[0], typing_extensions.Literal['']` are not compatible with expected variadic elements `*generics_typevartuple_args.Ts, generics_typevartuple_args.Env`. -generics_typevartuple_args.py:34:0 Invalid argument [32]: Argument types `typing_extensions.Literal[0], typing_extensions.Literal['']` are not compatible with expected variadic elements `*generics_typevartuple_args.Ts, generics_typevartuple_args.Env`. -generics_typevartuple_args.py:48:9 Incompatible parameter type [6]: In call `func1`, for 2nd positional argument, expected `int` but got `str`. -generics_typevartuple_args.py:57:0 Invalid argument [32]: Argument types `typing_extensions.Literal[1], typing_extensions.Literal[1], typing_extensions.Literal['']` are not compatible with expected variadic elements `int, *Tuple[str, ...], str`. -generics_typevartuple_args.py:58:0 Invalid argument [32]: Argument types `typing_extensions.Literal[1]` are not compatible with expected variadic elements `int, *Tuple[str, ...], str`. -generics_typevartuple_args.py:59:0 Invalid argument [32]: Argument types `typing_extensions.Literal['']` are not compatible with expected variadic elements `int, *Tuple[str, ...], str`. -generics_typevartuple_args.py:66:6 Incompatible parameter type [6]: In call `func3`, for 1st positional argument, expected `Unpack[Tuple[int, str]]` but got `int`. -generics_typevartuple_args.py:66:9 Incompatible parameter type [6]: In call `func3`, for 2nd positional argument, expected `Unpack[Tuple[int, str]]` but got `str`. -generics_typevartuple_args.py:67:6 Incompatible parameter type [6]: In call `func3`, for 1st positional argument, expected `Unpack[Tuple[int, str]]` but got `int`. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 75: Expected 1 errors -Line 76: Expected 1 errors -Line 20: Unexpected errors ["generics_typevartuple_args.py:20:0 Assert type [70]: Expected `Tuple[int, str]` but got `Tuple[typing_extensions.Literal[1], typing_extensions.Literal['a']]`."] -Line 32: Unexpected errors ["generics_typevartuple_args.py:32:0 Assert type [70]: Expected `Tuple[int, str]` but got `Tuple[typing_extensions.Literal[0], typing_extensions.Literal['']]`."] -Line 66: Unexpected errors ['generics_typevartuple_args.py:66:6 Incompatible parameter type [6]: In call `func3`, for 1st positional argument, expected `Unpack[Tuple[int, str]]` but got `int`.', 'generics_typevartuple_args.py:66:9 Incompatible parameter type [6]: In call `func3`, for 2nd positional argument, expected `Unpack[Tuple[int, str]]` but got `str`.'] -""" diff --git a/conformance/results/pyre/generics_typevartuple_basic.toml b/conformance/results/pyre/generics_typevartuple_basic.toml deleted file mode 100644 index 6b3fded1b..000000000 --- a/conformance/results/pyre/generics_typevartuple_basic.toml +++ /dev/null @@ -1,33 +0,0 @@ -conformant = "Partial" -notes = """ -Does not support TypeVarTuple. -False negatives due to assert_type. -""" -output = """ -generics_typevartuple_basic.py:42:33 Incompatible parameter type [6]: In call `Array.__init__`, for 1st positional argument, expected `typing.Tuple[*generics_typevartuple_basic.Shape]` but got `Height`. -generics_typevartuple_basic.py:43:0 Incompatible variable type [9]: v5 is declared to have type `Array[Batch, Height, Width]` but is used as type `Array[Batch, Width]`. -generics_typevartuple_basic.py:44:0 Incompatible variable type [9]: v6 is declared to have type `Array[Time, Batch, Height, Width]` but is used as type `Array[Time, Batch, Width, Height]`. -generics_typevartuple_basic.py:52:13 Undefined or invalid type [11]: Annotation `Shape` is not defined as a type. -generics_typevartuple_basic.py:54:21 Invalid type variable [34]: The type variable `Shape` isn't present in the function's parameters. -generics_typevartuple_basic.py:65:6 Unexpected keyword [28]: Unexpected keyword argument `covariant` to call `TypeVarTuple.__init__`. -generics_typevartuple_basic.py:66:6 Too many arguments [19]: Call `TypeVarTuple.__init__` expects 1 positional argument, 3 were provided. -generics_typevartuple_basic.py:67:6 Unexpected keyword [28]: Unexpected keyword argument `bound` to call `TypeVarTuple.__init__`. -generics_typevartuple_basic.py:84:0 Assert type [70]: Expected `Tuple[int]` but got `Tuple[typing_extensions.Literal[0]]`. -generics_typevartuple_basic.py:84:24 Incompatible parameter type [6]: In call `func2`, for 2nd positional argument, expected `typing.Tuple[*generics_typevartuple_basic.Ts]` but got `Tuple[int]`. -generics_typevartuple_basic.py:87:12 Incompatible parameter type [6]: In call `func2`, for 2nd positional argument, expected `typing.Tuple[*generics_typevartuple_basic.Ts]` but got `Tuple[int]`. -generics_typevartuple_basic.py:89:12 Incompatible parameter type [6]: In call `func2`, for 2nd positional argument, expected `typing.Tuple[*generics_typevartuple_basic.Ts]` but got `Tuple[str]`. -generics_typevartuple_basic.py:90:14 Incompatible parameter type [6]: In call `func2`, for 2nd positional argument, expected `typing.Tuple[*generics_typevartuple_basic.Ts]` but got `Tuple[int]`. -generics_typevartuple_basic.py:99:16 Incompatible parameter type [6]: In call `multiply`, for 2nd positional argument, expected `Array[*generics_typevartuple_basic.Shape]` but got `Array[Width]`. -generics_typevartuple_basic.py:100:16 Incompatible parameter type [6]: In call `multiply`, for 2nd positional argument, expected `Array[*generics_typevartuple_basic.Shape]` but got `Array[Height, Width]`. -generics_typevartuple_basic.py:106:13 Undefined or invalid type [11]: Annotation `Ts1` is not defined as a type. -generics_typevartuple_basic.py:106:13 Undefined or invalid type [11]: Annotation `Ts2` is not defined as a type. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 53: Expected 1 errors -Line 56: Expected 1 errors -Line 59: Expected 1 errors -Line 54: Unexpected errors ["generics_typevartuple_basic.py:54:21 Invalid type variable [34]: The type variable `Shape` isn't present in the function's parameters."] -Line 84: Unexpected errors ['generics_typevartuple_basic.py:84:0 Assert type [70]: Expected `Tuple[int]` but got `Tuple[typing_extensions.Literal[0]]`.', 'generics_typevartuple_basic.py:84:24 Incompatible parameter type [6]: In call `func2`, for 2nd positional argument, expected `typing.Tuple[*generics_typevartuple_basic.Ts]` but got `Tuple[int]`.'] -Line 87: Unexpected errors ['generics_typevartuple_basic.py:87:12 Incompatible parameter type [6]: In call `func2`, for 2nd positional argument, expected `typing.Tuple[*generics_typevartuple_basic.Ts]` but got `Tuple[int]`.'] -""" diff --git a/conformance/results/pyre/generics_typevartuple_callable.toml b/conformance/results/pyre/generics_typevartuple_callable.toml deleted file mode 100644 index aa0453d99..000000000 --- a/conformance/results/pyre/generics_typevartuple_callable.toml +++ /dev/null @@ -1,12 +0,0 @@ -conformant = "Partial" -notes = """ -False negatives due to assert_type. -""" -output = """ -generics_typevartuple_callable.py:26:8 Incompatible parameter type [6]: In call `Process.__init__`, for argument `target`, expected `typing.Callable[[Variable(*generics_typevartuple_callable.Ts)], None]` but got `typing.Callable(func1)[[Named(arg1, int), Named(arg2, str)], None]`. -generics_typevartuple_callable.py:49:0 Assert type [70]: Expected `Tuple[float, str, complex]` but got `Tuple[float, typing_extensions.Literal[''], complex]`. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 49: Unexpected errors ["generics_typevartuple_callable.py:49:0 Assert type [70]: Expected `Tuple[float, str, complex]` but got `Tuple[float, typing_extensions.Literal[''], complex]`."] -""" diff --git a/conformance/results/pyre/generics_typevartuple_concat.toml b/conformance/results/pyre/generics_typevartuple_concat.toml deleted file mode 100644 index 3754ffc8e..000000000 --- a/conformance/results/pyre/generics_typevartuple_concat.toml +++ /dev/null @@ -1,14 +0,0 @@ -conformant = "Partial" -notes = """ -False negatives due to assert_type. -False compatability error message. -""" -output = """ -generics_typevartuple_concat.py:52:0 Assert type [70]: Expected `Tuple[int, bool, str]` but got `Tuple[typing_extensions.Literal[0], typing_extensions.Literal[True], typing_extensions.Literal['a']]`. -generics_typevartuple_concat.py:56:4 Incompatible return type [7]: Expected `typing.Tuple[*generics_typevartuple_concat.Ts, Variable[T]]` but got `typing.Tuple[*Tuple[object, ...], object]`. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 52: Unexpected errors ["generics_typevartuple_concat.py:52:0 Assert type [70]: Expected `Tuple[int, bool, str]` but got `Tuple[typing_extensions.Literal[0], typing_extensions.Literal[True], typing_extensions.Literal['a']]`."] -Line 56: Unexpected errors ['generics_typevartuple_concat.py:56:4 Incompatible return type [7]: Expected `typing.Tuple[*generics_typevartuple_concat.Ts, Variable[T]]` but got `typing.Tuple[*Tuple[object, ...], object]`.'] -""" diff --git a/conformance/results/pyre/generics_typevartuple_overloads.toml b/conformance/results/pyre/generics_typevartuple_overloads.toml deleted file mode 100644 index 08cb3a92d..000000000 --- a/conformance/results/pyre/generics_typevartuple_overloads.toml +++ /dev/null @@ -1,13 +0,0 @@ -conformant = "Unsupported" -notes = """ -Does not support star expressions for `Unpack`. -""" -output = """ -generics_typevartuple_overloads.py:18:4 Incompatible overload [43]: The implementation of `Array.transpose` does not accept all possible arguments of overload defined on line `18`. -generics_typevartuple_overloads.py:22:4 Incompatible overload [43]: The implementation of `Array.transpose` does not accept all possible arguments of overload defined on line `22`. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 18: Unexpected errors ['generics_typevartuple_overloads.py:18:4 Incompatible overload [43]: The implementation of `Array.transpose` does not accept all possible arguments of overload defined on line `18`.'] -Line 22: Unexpected errors ['generics_typevartuple_overloads.py:22:4 Incompatible overload [43]: The implementation of `Array.transpose` does not accept all possible arguments of overload defined on line `22`.'] -""" diff --git a/conformance/results/pyre/generics_typevartuple_specialization.toml b/conformance/results/pyre/generics_typevartuple_specialization.toml deleted file mode 100644 index 0f155d1be..000000000 --- a/conformance/results/pyre/generics_typevartuple_specialization.toml +++ /dev/null @@ -1,35 +0,0 @@ -conformant = "Unsupported" -notes = """ -Does not support star expressions for `Unpack`. -""" -output = """ -generics_typevartuple_specialization.py:29:21 Incompatible parameter type [6]: In call `takes_any_array1`, for 1st positional argument, expected `Array[]` but got `Array[Height, Width]`. -generics_typevartuple_specialization.py:34:21 Incompatible parameter type [6]: In call `takes_any_array1`, for 1st positional argument, expected `Array[]` but got `Array[Time, Height, Width]`. -generics_typevartuple_specialization.py:121:0 Invalid type [31]: Expression `tuple[(T1, *Ts, T2, *Ts)]` is not a valid type. -generics_typevartuple_specialization.py:122:0 Invalid type [31]: Expression `tuple[(T1, *Ts, T2, *tuple[(int, ...)])]` is not a valid type. -generics_typevartuple_specialization.py:127:4 Invalid type variable [34]: The type variable `Variable[T1]` can only be used to annotate generic classes or functions. -generics_typevartuple_specialization.py:127:4 Invalid type variable [34]: The type variable `Variable[T2]` can only be used to annotate generic classes or functions. -generics_typevartuple_specialization.py:127:4 Invalid type variable [34]: The type variable `Ts` can only be used to annotate generic classes or functions. -generics_typevartuple_specialization.py:136:4 Assert type [70]: Expected `Tuple[Tuple[str], bool, float]` but got `Tuple[Tuple[float], str, bool]`. -generics_typevartuple_specialization.py:137:4 Assert type [70]: Expected `Tuple[Tuple[str, bool], float, int]` but got `Tuple[Tuple[float, int], str, bool]`. -generics_typevartuple_specialization.py:148:4 Assert type [70]: Expected `Tuple[Tuple[], str, bool, float]` but got `Tuple[Tuple[], float, str, bool]`. -generics_typevartuple_specialization.py:149:4 Assert type [70]: Expected `Tuple[Tuple[bool], str, float, int]` but got `Tuple[Tuple[int], float, str, bool]`. -generics_typevartuple_specialization.py:157:4 Assert type [70]: Expected `typing.Tuple[*Tuple[int, ...], int]` but got `typing.Tuple[*Tuple[typing.Any, ...], typing.Any]`. -generics_typevartuple_specialization.py:158:4 Assert type [70]: Expected `typing.Tuple[*Tuple[int, ...], str]` but got `typing.Tuple[*generics_typevartuple_specialization.Ts, Variable[T1]]`. -generics_typevartuple_specialization.py:159:4 Assert type [70]: Expected `typing.Tuple[*Tuple[int, ...], str]` but got `typing.Tuple[*generics_typevartuple_specialization.Ts, Variable[T1]]`. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 109: Expected 1 errors -Line 110: Expected 1 errors -Line 163: Expected 1 errors -Line 29: Unexpected errors ['generics_typevartuple_specialization.py:29:21 Incompatible parameter type [6]: In call `takes_any_array1`, for 1st positional argument, expected `Array[]` but got `Array[Height, Width]`.'] -Line 34: Unexpected errors ['generics_typevartuple_specialization.py:34:21 Incompatible parameter type [6]: In call `takes_any_array1`, for 1st positional argument, expected `Array[]` but got `Array[Time, Height, Width]`.'] -Line 136: Unexpected errors ['generics_typevartuple_specialization.py:136:4 Assert type [70]: Expected `Tuple[Tuple[str], bool, float]` but got `Tuple[Tuple[float], str, bool]`.'] -Line 137: Unexpected errors ['generics_typevartuple_specialization.py:137:4 Assert type [70]: Expected `Tuple[Tuple[str, bool], float, int]` but got `Tuple[Tuple[float, int], str, bool]`.'] -Line 148: Unexpected errors ['generics_typevartuple_specialization.py:148:4 Assert type [70]: Expected `Tuple[Tuple[], str, bool, float]` but got `Tuple[Tuple[], float, str, bool]`.'] -Line 149: Unexpected errors ['generics_typevartuple_specialization.py:149:4 Assert type [70]: Expected `Tuple[Tuple[bool], str, float, int]` but got `Tuple[Tuple[int], float, str, bool]`.'] -Line 157: Unexpected errors ['generics_typevartuple_specialization.py:157:4 Assert type [70]: Expected `typing.Tuple[*Tuple[int, ...], int]` but got `typing.Tuple[*Tuple[typing.Any, ...], typing.Any]`.'] -Line 158: Unexpected errors ['generics_typevartuple_specialization.py:158:4 Assert type [70]: Expected `typing.Tuple[*Tuple[int, ...], str]` but got `typing.Tuple[*generics_typevartuple_specialization.Ts, Variable[T1]]`.'] -Line 159: Unexpected errors ['generics_typevartuple_specialization.py:159:4 Assert type [70]: Expected `typing.Tuple[*Tuple[int, ...], str]` but got `typing.Tuple[*generics_typevartuple_specialization.Ts, Variable[T1]]`.'] -""" diff --git a/conformance/results/pyre/generics_typevartuple_unpack.toml b/conformance/results/pyre/generics_typevartuple_unpack.toml deleted file mode 100644 index e71e46e5b..000000000 --- a/conformance/results/pyre/generics_typevartuple_unpack.toml +++ /dev/null @@ -1,9 +0,0 @@ -conformant = "Pass" -notes = """ -""" -output = """ -generics_typevartuple_unpack.py:30:27 Incompatible parameter type [6]: In call `process_batch_channels`, for 1st positional argument, expected `Array[Batch, *Tuple[typing.Any, ...], Channels]` but got `Array[Batch]`. -""" -conformance_automated = "Pass" -errors_diff = """ -""" diff --git a/conformance/results/pyre/generics_upper_bound.toml b/conformance/results/pyre/generics_upper_bound.toml deleted file mode 100644 index 6c88c4065..000000000 --- a/conformance/results/pyre/generics_upper_bound.toml +++ /dev/null @@ -1,14 +0,0 @@ -conformant = "Partial" -notes = """ -False positives on valid type expression (`list[T]`) in `bound`. -Does not complain when bound is used alongside type constraints. -""" -output = """ -generics_upper_bound.py:51:7 Incompatible parameter type [6]: In call `longer`, for 1st positional argument, expected `Variable[ST (bound to Sized)]` but got `int`. -generics_upper_bound.py:51:10 Incompatible parameter type [6]: In call `longer`, for 2nd positional argument, expected `Variable[ST (bound to Sized)]` but got `int`. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 24: Expected 1 errors -Line 56: Expected 1 errors -""" diff --git a/conformance/results/pyre/generics_variance.toml b/conformance/results/pyre/generics_variance.toml deleted file mode 100644 index ee65464e9..000000000 --- a/conformance/results/pyre/generics_variance.toml +++ /dev/null @@ -1,23 +0,0 @@ -conformant = "Partial" -notes = """ -Does not reject a TypeVar that is defined as both covariant and contravariant. -Does not reject use of class-scoped TypeVar used in a base class when variance is incompatible. -""" -output = """ -generics_variance.py:77:0 Invalid type variance [46]: The type variable `Variable[T_co](covariant)` is incompatible with parent class type variable `Variable[T](invariant)` because subclasses cannot use more permissive type variables than their superclasses. -generics_variance.py:81:0 Invalid type variance [46]: The type variable `Variable[T_contra](contravariant)` is incompatible with parent class type variable `Variable[T](invariant)` because subclasses cannot use more permissive type variables than their superclasses. -generics_variance.py:93:0 Invalid type variance [46]: The type variable `Variable[T_contra](contravariant)` is incompatible with parent class type variable `Variable[T_co](covariant)` because subclasses cannot use more permissive type variables than their superclasses. -generics_variance.py:105:0 Invalid type variance [46]: The type variable `Variable[T_co](covariant)` is incompatible with parent class type variable `Variable[T_contra](contravariant)` because subclasses cannot use more permissive type variables than their superclasses. -generics_variance.py:125:0 Invalid type variance [46]: The type variable `Variable[T_co](covariant)` is incompatible with parent class type variable `Variable[T_contra](contravariant)` because subclasses cannot use more permissive type variables than their superclasses. -generics_variance.py:131:0 Invalid type variance [46]: The type variable `Variable[T_contra](contravariant)` is incompatible with parent class type variable `Variable[T_co](covariant)` because subclasses cannot use more permissive type variables than their superclasses. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 14: Expected 1 errors -Line 113: Expected 1 errors -Line 163: Expected 1 errors -Line 167: Expected 1 errors -Line 191: Expected 1 errors -Lines 141, 142: Expected error (tag 'CoContra_Child5') -Lines 195, 196: Expected error (tag 'ContraToContraToContra_WithTA') -""" diff --git a/conformance/results/pyre/generics_variance_inference.toml b/conformance/results/pyre/generics_variance_inference.toml deleted file mode 100644 index 39a5cb8c4..000000000 --- a/conformance/results/pyre/generics_variance_inference.toml +++ /dev/null @@ -1,55 +0,0 @@ -conformant = "Partial" -notes = """ -Does not properly handle mixing legacy and PEP695 syntax. -False negative about a type variable not being present in the function's parameters. -""" -output = """ -generics_variance_inference.py:24:4 Incompatible variable type [9]: v1 is declared to have type `ClassA[int, int, int]` but is used as type `ClassA[float, int, int]`. -generics_variance_inference.py:25:4 Incompatible variable type [9]: v2 is declared to have type `ClassA[float, float, int]` but is used as type `ClassA[float, int, int]`. -generics_variance_inference.py:28:4 Incompatible variable type [9]: v4 is declared to have type `ClassA[int, int, int]` but is used as type `ClassA[int, float, float]`. -generics_variance_inference.py:33:41 Invalid type variable [34]: The type variable `Variable[T]` isn't present in the function's parameters. -generics_variance_inference.py:36:26 Invalid type variable [34]: The type variable `Variable[T]` isn't present in the function's parameters. -generics_variance_inference.py:48:0 Incompatible variable type [9]: vco2_1 is declared to have type `ShouldBeCovariant2[float]` but is used as type `ShouldBeCovariant2[int]`. -generics_variance_inference.py:49:0 Incompatible variable type [9]: vco2_2 is declared to have type `ShouldBeCovariant2[int]` but is used as type `ShouldBeCovariant2[float]`. -generics_variance_inference.py:53:25 Invalid type variable [34]: The type variable `Variable[T]` isn't present in the function's parameters. -generics_variance_inference.py:63:7 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Variable[T]`. To reference the type variable, you can modify the class to inherit from `typing.Generic[T]`. -generics_variance_inference.py:75:19 Invalid type variable [34]: The type variable `Variable[T]` isn't present in the function's parameters. -generics_variance_inference.py:88:23 Invalid type variable [34]: The type variable `Variable[T]` isn't present in the function's parameters. -generics_variance_inference.py:104:27 Invalid type variable [34]: The type variable `Variable[T]` isn't present in the function's parameters. -generics_variance_inference.py:119:0 Incompatible variable type [9]: vinv3_1 is declared to have type `ShouldBeInvariant3[float, str]` but is used as type `ShouldBeInvariant3[int, str]`. -generics_variance_inference.py:120:0 Incompatible variable type [9]: vinv3_2 is declared to have type `ShouldBeInvariant3[int, str]` but is used as type `ShouldBeInvariant3[float, str]`. -generics_variance_inference.py:121:0 Incompatible variable type [9]: vinv3_3 is declared to have type `ShouldBeInvariant3[str, float]` but is used as type `ShouldBeInvariant3[str, int]`. -generics_variance_inference.py:122:0 Incompatible variable type [9]: vinv3_4 is declared to have type `ShouldBeInvariant3[str, int]` but is used as type `ShouldBeInvariant3[str, float]`. -generics_variance_inference.py:127:7 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Variable[T]`. To reference the type variable, you can modify the class to inherit from `typing.Generic[T]`. -generics_variance_inference.py:169:0 Incompatible variable type [9]: a1 is declared to have type `ShouldBeInvariant6[int]` but is used as type `ShouldBeInvariant6[float]`. -generics_variance_inference.py:170:0 Incompatible variable type [9]: a2 is declared to have type `ShouldBeInvariant6[float]` but is used as type `ShouldBeInvariant6[int]`. -generics_variance_inference.py:181:0 Incompatible variable type [9]: b1 is declared to have type `ShouldBeCovariant6[int]` but is used as type `ShouldBeCovariant6[float]`. -generics_variance_inference.py:182:0 Incompatible variable type [9]: b2 is declared to have type `ShouldBeCovariant6[float]` but is used as type `ShouldBeCovariant6[int]`. -generics_variance_inference.py:193:0 Incompatible variable type [9]: c1 is declared to have type `ShouldBeContravariant2[int]` but is used as type `ShouldBeContravariant2[float]`. -generics_variance_inference.py:194:0 Incompatible variable type [9]: c2 is declared to have type `ShouldBeContravariant2[float]` but is used as type `ShouldBeContravariant2[int]`. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 41: Expected 1 errors -Line 58: Expected 1 errors -Line 67: Expected 1 errors -Line 80: Expected 1 errors -Line 96: Expected 1 errors -Line 97: Expected 1 errors -Line 111: Expected 1 errors -Line 112: Expected 1 errors -Line 130: Expected 1 errors -Line 138: Expected 1 errors -Line 149: Expected 1 errors -Line 33: Unexpected errors ["generics_variance_inference.py:33:41 Invalid type variable [34]: The type variable `Variable[T]` isn't present in the function's parameters."] -Line 36: Unexpected errors ["generics_variance_inference.py:36:26 Invalid type variable [34]: The type variable `Variable[T]` isn't present in the function's parameters."] -Line 48: Unexpected errors ['generics_variance_inference.py:48:0 Incompatible variable type [9]: vco2_1 is declared to have type `ShouldBeCovariant2[float]` but is used as type `ShouldBeCovariant2[int]`.'] -Line 53: Unexpected errors ["generics_variance_inference.py:53:25 Invalid type variable [34]: The type variable `Variable[T]` isn't present in the function's parameters."] -Line 63: Unexpected errors ["generics_variance_inference.py:63:7 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Variable[T]`. To reference the type variable, you can modify the class to inherit from `typing.Generic[T]`."] -Line 75: Unexpected errors ["generics_variance_inference.py:75:19 Invalid type variable [34]: The type variable `Variable[T]` isn't present in the function's parameters."] -Line 88: Unexpected errors ["generics_variance_inference.py:88:23 Invalid type variable [34]: The type variable `Variable[T]` isn't present in the function's parameters."] -Line 104: Unexpected errors ["generics_variance_inference.py:104:27 Invalid type variable [34]: The type variable `Variable[T]` isn't present in the function's parameters."] -Line 127: Unexpected errors ["generics_variance_inference.py:127:7 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Variable[T]`. To reference the type variable, you can modify the class to inherit from `typing.Generic[T]`."] -Line 182: Unexpected errors ['generics_variance_inference.py:182:0 Incompatible variable type [9]: b2 is declared to have type `ShouldBeCovariant6[float]` but is used as type `ShouldBeCovariant6[int]`.'] -Line 193: Unexpected errors ['generics_variance_inference.py:193:0 Incompatible variable type [9]: c1 is declared to have type `ShouldBeContravariant2[int]` but is used as type `ShouldBeContravariant2[float]`.'] -""" diff --git a/conformance/results/pyre/historical_positional.toml b/conformance/results/pyre/historical_positional.toml deleted file mode 100644 index 96a409602..000000000 --- a/conformance/results/pyre/historical_positional.toml +++ /dev/null @@ -1,12 +0,0 @@ -conformant = "Pass" -notes = """ -""" -output = """ -historical_positional.py:18:0 Unexpected keyword [28]: Unexpected keyword argument `__x` to call `f1`. -historical_positional.py:26:15 Invalid positional-only parameter [69]: Positional-only parameters cannot appear after parameters that accept keyword arguments. -historical_positional.py:38:25 Invalid positional-only parameter [69]: Positional-only parameters cannot appear after parameters that accept keyword arguments. -historical_positional.py:43:0 Unexpected keyword [28]: Unexpected keyword argument `__x` to call `A.m1`. -""" -conformance_automated = "Pass" -errors_diff = """ -""" diff --git a/conformance/results/pyre/literals_interactions.toml b/conformance/results/pyre/literals_interactions.toml deleted file mode 100644 index a7af3cc40..000000000 --- a/conformance/results/pyre/literals_interactions.toml +++ /dev/null @@ -1,18 +0,0 @@ -conformant = "Partial" -notes = """ -Does not detect out-of-bound tuple literal index. -Does not perform exhaustiveness checks on enums. -Does not narrow type of `x` with `x in Literal` type guard pattern. -Does not narrow type of `x` with `x == Literal` type guard pattern. -""" -output = """ -literals_interactions.py:15:4 Invalid tuple index [73]: Index 5 is out of bounds for concrete tuple with 3 members. -literals_interactions.py:16:4 Invalid tuple index [73]: Index -5 is out of bounds for concrete tuple with 3 members. -literals_interactions.py:17:4 Invalid tuple index [73]: Index 4 is out of bounds for concrete tuple with 3 members. -literals_interactions.py:18:4 Invalid tuple index [73]: Index -4 is out of bounds for concrete tuple with 3 members. -literals_interactions.py:93:8 Assert type [70]: Expected `str` but got `Union[Status, str]`. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 93: Unexpected errors ['literals_interactions.py:93:8 Assert type [70]: Expected `str` but got `Union[Status, str]`.'] -""" diff --git a/conformance/results/pyre/literals_literalstring.toml b/conformance/results/pyre/literals_literalstring.toml deleted file mode 100644 index 2367ab62f..000000000 --- a/conformance/results/pyre/literals_literalstring.toml +++ /dev/null @@ -1,21 +0,0 @@ -conformant = "Partial" -notes = """ -Incorrectly infers `str` rather than `LiteralString` when literal string `join` is used. -""" -output = """ -literals_literalstring.py:36:11 Invalid type [31]: Expression `LiteralString` is not a literal value. -literals_literalstring.py:36:11 Undefined or invalid type [11]: Annotation `typing` is not defined as a type. -literals_literalstring.py:37:13 Invalid type [31]: Expression `LiteralString` is not a literal value. -literals_literalstring.py:43:4 Incompatible variable type [9]: x2 is declared to have type `typing_extensions.Literal['']` but is used as type `typing_extensions.Literal['two']`. -literals_literalstring.py:52:4 Assert type [70]: Expected `typing_extensions.LiteralString` but got `str`. -literals_literalstring.py:66:4 Incompatible variable type [9]: x1 is declared to have type `typing_extensions.LiteralString` but is used as type `str`. -literals_literalstring.py:74:4 Incompatible variable type [9]: x3 is declared to have type `typing_extensions.LiteralString` but is used as type `typing_extensions.Literal[3]`. -literals_literalstring.py:75:4 Incompatible variable type [9]: x4 is declared to have type `typing_extensions.LiteralString` but is used as type `typing_extensions.Literal[b'test']`. -literals_literalstring.py:120:21 Incompatible parameter type [6]: In call `literal_identity`, for 1st positional argument, expected `Variable[TLiteral (bound to typing_extensions.LiteralString)]` but got `str`. -literals_literalstring.py:134:50 Incompatible parameter type [6]: In call `Container.__init__`, for 1st positional argument, expected `Variable[T (bound to typing_extensions.LiteralString)]` but got `str`. -literals_literalstring.py:171:4 Incompatible variable type [9]: x1 is declared to have type `List[str]` but is used as type `List[typing_extensions.LiteralString]`. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 52: Unexpected errors ['literals_literalstring.py:52:4 Assert type [70]: Expected `typing_extensions.LiteralString` but got `str`.'] -""" diff --git a/conformance/results/pyre/literals_parameterizations.toml b/conformance/results/pyre/literals_parameterizations.toml deleted file mode 100644 index 2dbdfbc53..000000000 --- a/conformance/results/pyre/literals_parameterizations.toml +++ /dev/null @@ -1,35 +0,0 @@ -conformant = "Partial" -notes = """ -Does not support type aliases in Literal type expression. -Does not support nested Literal type expression. -Does not reject tuple in Literal type expression. -Does not reject "bare" Literal in type expression. -""" -output = """ -literals_parameterizations.py:33:0 Invalid type [31]: Expression `AppendMode` is not a literal value. -literals_parameterizations.py:33:0 Invalid type [31]: Expression `ReadOnlyMode` is not a literal value. -literals_parameterizations.py:33:0 Invalid type [31]: Expression `WriteAndTruncateMode` is not a literal value. -literals_parameterizations.py:33:0 Invalid type [31]: Expression `WriteNoTruncateMode` is not a literal value. -literals_parameterizations.py:33:0 Undefined or invalid type [11]: Annotation `` is not defined as a type. -literals_parameterizations.py:41:6 Invalid type [31]: Expression `typing.Literal[3 + 4]` is not a valid type. -literals_parameterizations.py:42:6 Invalid type [31]: Expression `typing.Literal["foo".replace("o", "b")]` is not a valid type. -literals_parameterizations.py:43:6 Invalid type [31]: Expression `typing.Literal[4 + 3.000000j]` is not a valid type. -literals_parameterizations.py:44:6 Invalid type [31]: Expression `typing.Literal[~ 5]` is not a valid type. -literals_parameterizations.py:45:6 Invalid type [31]: Expression `typing.Literal[not False]` is not a valid type. -literals_parameterizations.py:47:6 Invalid type [31]: Expression `typing.Literal[{ "a":"b","c":"d" }]` is not a valid type. -literals_parameterizations.py:48:6 Invalid type [31]: Expression `typing.Literal[int]` is not a valid type. -literals_parameterizations.py:49:6 Invalid type [31]: Expression `variable` is not a literal value. -literals_parameterizations.py:50:7 Invalid type [31]: Expression `T` is not a literal value. -literals_parameterizations.py:51:7 Invalid type [31]: Expression `typing.Literal[3.140000]` is not a valid type. -literals_parameterizations.py:52:7 Invalid type [31]: Expression `Any` is not a literal value. -literals_parameterizations.py:53:7 Invalid type [31]: Expression `typing.Literal[...]` is not a valid type. -literals_parameterizations.py:56:19 Invalid type [31]: Expression `typing.Literal[1 + 2]` is not a valid type. -literals_parameterizations.py:61:3 Invalid type [31]: Expression `my_function` is not a literal value. -literals_parameterizations.py:65:4 Incompatible variable type [9]: x1 is declared to have type `typing_extensions.Literal['Color.RED']` but is used as type `typing_extensions.Literal[Color.RED]`. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 46: Expected 1 errors -Line 60: Expected 1 errors -Line 33: Unexpected errors ['literals_parameterizations.py:33:0 Invalid type [31]: Expression `AppendMode` is not a literal value.', 'literals_parameterizations.py:33:0 Invalid type [31]: Expression `ReadOnlyMode` is not a literal value.', 'literals_parameterizations.py:33:0 Invalid type [31]: Expression `WriteAndTruncateMode` is not a literal value.', 'literals_parameterizations.py:33:0 Invalid type [31]: Expression `WriteNoTruncateMode` is not a literal value.', 'literals_parameterizations.py:33:0 Undefined or invalid type [11]: Annotation `` is not defined as a type.'] -""" diff --git a/conformance/results/pyre/literals_semantics.toml b/conformance/results/pyre/literals_semantics.toml deleted file mode 100644 index b2d2d1513..000000000 --- a/conformance/results/pyre/literals_semantics.toml +++ /dev/null @@ -1,10 +0,0 @@ -conformant = "Pass" -output = """ -literals_semantics.py:10:0 Incompatible variable type [9]: v2 is declared to have type `typing_extensions.Literal[3]` but is used as type `typing_extensions.Literal[4]`. -literals_semantics.py:24:4 Incompatible variable type [9]: x1 is declared to have type `typing_extensions.Literal[False]` but is used as type `typing_extensions.Literal[0]`. -literals_semantics.py:25:4 Incompatible variable type [9]: x2 is declared to have type `typing_extensions.Literal[0]` but is used as type `typing_extensions.Literal[False]`. -literals_semantics.py:33:4 Incompatible variable type [9]: a is declared to have type `Union[typing_extensions.Literal[3], typing_extensions.Literal[4], typing_extensions.Literal[5]]` but is used as type `int`. -""" -conformance_automated = "Pass" -errors_diff = """ -""" diff --git a/conformance/results/pyre/namedtuples_define_class.toml b/conformance/results/pyre/namedtuples_define_class.toml deleted file mode 100644 index e6f039183..000000000 --- a/conformance/results/pyre/namedtuples_define_class.toml +++ /dev/null @@ -1,17 +0,0 @@ -output = """ -namedtuples_define_class.py:32:6 Invalid tuple index [73]: Index 3 is out of bounds for concrete tuple with 3 members. -namedtuples_define_class.py:33:6 Invalid tuple index [73]: Index -4 is out of bounds for concrete tuple with 3 members. -namedtuples_define_class.py:44:5 Missing argument [20]: Call `Point.__init__` expects argument `y`. -namedtuples_define_class.py:45:5 Missing argument [20]: Call `Point.__init__` expects argument `y`. -namedtuples_define_class.py:46:14 Incompatible parameter type [6]: In call `Point.__init__`, for 2nd positional argument, expected `int` but got `str`. -namedtuples_define_class.py:47:17 Incompatible parameter type [6]: In call `Point.__init__`, for argument `units`, expected `str` but got `int`. -namedtuples_define_class.py:48:5 Too many arguments [19]: Call `Point.__init__` expects 3 positional arguments, 4 were provided. -namedtuples_define_class.py:49:6 Unexpected keyword [28]: Unexpected keyword argument `other` to call `Point.__init__`. -namedtuples_define_class.py:59:4 Missing named tuple default [74]: Named tuple field without default value may not be preceded by a field with default value. -namedtuples_define_class.py:79:4 Invalid assignment [41]: Cannot reassign final attribute `x`. -namedtuples_define_class.py:98:18 Incompatible parameter type [6]: In call `Property.__init__`, for 2nd positional argument, expected `str` but got `float`. -namedtuples_define_class.py:105:23 Invalid inheritance [39]: If NamedTuple is included as a base class, the class may not extend anything else besides Generic. -""" -conformance_automated = "Pass" -errors_diff = """ -""" diff --git a/conformance/results/pyre/namedtuples_define_functional.toml b/conformance/results/pyre/namedtuples_define_functional.toml deleted file mode 100644 index dc1324433..000000000 --- a/conformance/results/pyre/namedtuples_define_functional.toml +++ /dev/null @@ -1,19 +0,0 @@ -conformant = "Pass" -notes = """ -""" -output = """ -namedtuples_define_functional.py:16:7 Missing argument [20]: Call `Point1.__init__` expects argument `y`. -namedtuples_define_functional.py:21:7 Missing argument [20]: Call `Point2.__init__` expects argument `x`. -namedtuples_define_functional.py:26:7 Too many arguments [19]: Call `Point3.__init__` expects 2 positional arguments, 3 were provided. -namedtuples_define_functional.py:31:7 Unexpected keyword [28]: Unexpected keyword argument `z` to call `Point4.__init__`. -namedtuples_define_functional.py:36:17 Incompatible parameter type [6]: In call `Point5.__init__`, for 2nd positional argument, expected `int` but got `str`. -namedtuples_define_functional.py:37:7 Too many arguments [19]: Call `Point5.__init__` expects 2 positional arguments, 3 were provided. -namedtuples_define_functional.py:42:17 Incompatible parameter type [6]: In call `Point6.__init__`, for 2nd positional argument, expected `int` but got `str`. -namedtuples_define_functional.py:43:14 Incompatible parameter type [6]: In call `Point6.__init__`, for argument `x`, expected `int` but got `float`. -namedtuples_define_functional.py:52:0 Duplicate parameter [65]: Duplicate parameter name `a`. -namedtuples_define_functional.py:52:0 Duplicate parameter [65]: Duplicate parameter name `a`. -namedtuples_define_functional.py:66:0 Missing argument [20]: Call `NT5.__init__` expects argument `a`. -""" -conformance_automated = "Pass" -errors_diff = """ -""" diff --git a/conformance/results/pyre/namedtuples_type_compat.toml b/conformance/results/pyre/namedtuples_type_compat.toml deleted file mode 100644 index d9c3d790c..000000000 --- a/conformance/results/pyre/namedtuples_type_compat.toml +++ /dev/null @@ -1,10 +0,0 @@ -conformant = "Pass" -notes = """ -""" -output = """ -namedtuples_type_compat.py:22:0 Incompatible variable type [9]: Unable to unpack `Point`, expected a tuple. -namedtuples_type_compat.py:23:0 Incompatible variable type [9]: Unable to unpack `Point`, expected a tuple. -""" -conformance_automated = "Pass" -errors_diff = """ -""" diff --git a/conformance/results/pyre/namedtuples_usage.toml b/conformance/results/pyre/namedtuples_usage.toml deleted file mode 100644 index 9997fdec9..000000000 --- a/conformance/results/pyre/namedtuples_usage.toml +++ /dev/null @@ -1,13 +0,0 @@ -output = """ -namedtuples_usage.py:34:6 Invalid tuple index [73]: Index 3 is out of bounds for concrete tuple with 3 members. -namedtuples_usage.py:35:6 Invalid tuple index [73]: Index -4 is out of bounds for concrete tuple with 3 members. -namedtuples_usage.py:40:0 Invalid assignment [41]: Cannot reassign final attribute `p.x`. -namedtuples_usage.py:41:0 Undefined attribute [16]: `Point` has no attribute `__setitem__`. -namedtuples_usage.py:42:0 Unable to delete tuple member [72]: Tuples are immutable, so their members may not be deleted. -namedtuples_usage.py:43:0 Unable to delete tuple member [72]: Tuples are immutable, so their members may not be deleted. -namedtuples_usage.py:52:0 Unable to unpack [23]: Unable to unpack 3 values, 2 were expected. -namedtuples_usage.py:53:0 Unable to unpack [23]: Unable to unpack 3 values, 4 were expected. -""" -conformance_automated = "Pass" -errors_diff = """ -""" diff --git a/conformance/results/pyre/narrowing_typeguard.toml b/conformance/results/pyre/narrowing_typeguard.toml deleted file mode 100644 index 3f370ecfc..000000000 --- a/conformance/results/pyre/narrowing_typeguard.toml +++ /dev/null @@ -1,12 +0,0 @@ -conformant = "Pass" -notes = """ -""" -output = """ -narrowing_typeguard.py:102:22 Invalid type guard [68]: User-defined type guard functions or methods must have at least one input parameter. -narrowing_typeguard.py:107:21 Invalid type guard [68]: User-defined type guard functions or methods must have at least one input parameter. -narrowing_typeguard.py:128:19 Incompatible parameter type [6]: In call `takes_callable_str`, for 1st positional argument, expected `typing.Callable[[object], str]` but got `typing.Callable(simple_typeguard)[[Named(val, object)], TypeGuard[int]]`. -narrowing_typeguard.py:148:25 Incompatible parameter type [6]: In call `takes_callable_str_proto`, for 1st positional argument, expected `CallableStrProto` but got `typing.Callable(simple_typeguard)[[Named(val, object)], TypeGuard[int]]`. -""" -conformance_automated = "Pass" -errors_diff = """ -""" diff --git a/conformance/results/pyre/narrowing_typeis.toml b/conformance/results/pyre/narrowing_typeis.toml deleted file mode 100644 index f3d989e37..000000000 --- a/conformance/results/pyre/narrowing_typeis.toml +++ /dev/null @@ -1,15 +0,0 @@ -conformant = "Pass" -output = """ -narrowing_typeis.py:105:22 Invalid type guard [68]: User-defined type guard functions or methods must have at least one input parameter. -narrowing_typeis.py:110:21 Invalid type guard [68]: User-defined type guard functions or methods must have at least one input parameter. -narrowing_typeis.py:132:19 Incompatible parameter type [6]: In call `takes_callable_str`, for 1st positional argument, expected `typing.Callable[[object], str]` but got `typing.Callable(simple_typeguard)[[Named(val, object)], TypeIs[int]]`. -narrowing_typeis.py:152:25 Incompatible parameter type [6]: In call `takes_callable_str_proto`, for 1st positional argument, expected `CallableStrProto` but got `typing.Callable(simple_typeguard)[[Named(val, object)], TypeIs[int]]`. -narrowing_typeis.py:169:16 Incompatible parameter type [6]: In call `takes_typeguard`, for 1st positional argument, expected `typing.Callable[[object], TypeGuard[int]]` but got `typing.Callable(is_int_typeis)[[Named(val, object)], TypeIs[int]]`. -narrowing_typeis.py:170:13 Incompatible parameter type [6]: In call `takes_typeis`, for 1st positional argument, expected `typing.Callable[[object], TypeIs[int]]` but got `typing.Callable(is_int_typeguard)[[Named(val, object)], TypeGuard[int]]`. -narrowing_typeis.py:191:17 Incompatible parameter type [6]: In call `takes_int_typeis`, for 1st positional argument, expected `typing.Callable[[object], TypeIs[int]]` but got `typing.Callable(bool_typeis)[[Named(val, object)], TypeIs[bool]]`. -narrowing_typeis.py:195:26 Invalid type guard [68]: The narrowed type str of this type guard is not a subtype of the first positional parameter type int. -narrowing_typeis.py:199:44 Invalid type guard [68]: The narrowed type typing.List[int] of this type guard is not a subtype of the first positional parameter type typing.List[object]. -""" -conformance_automated = "Pass" -errors_diff = """ -""" diff --git a/conformance/results/pyre/overloads_basic.toml b/conformance/results/pyre/overloads_basic.toml deleted file mode 100644 index aebf2dede..000000000 --- a/conformance/results/pyre/overloads_basic.toml +++ /dev/null @@ -1,7 +0,0 @@ -conformant = "Pass" -output = """ -overloads_basic.py:39:2 Incompatible parameter type [6]: In call `Bytes.__getitem__`, for 1st positional argument, expected `int` but got `str`. -""" -conformance_automated = "Pass" -errors_diff = """ -""" diff --git a/conformance/results/pyre/overloads_consistency.toml b/conformance/results/pyre/overloads_consistency.toml deleted file mode 100644 index 5f38b134d..000000000 --- a/conformance/results/pyre/overloads_consistency.toml +++ /dev/null @@ -1,18 +0,0 @@ -conformant = "Partial" -notes = """ -Does not apply decorator transforms before checking overload consistency. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 108: Unexpected errors ['overloads_consistency.py:108:0 Incompatible overload [43]: The return type of overloaded function `decorated` (`None`) is incompatible with the return type of the implementation (`bytes`).', 'overloads_consistency.py:108:0 Incompatible overload [43]: The implementation of `decorated` does not accept all possible arguments of overload defined on line `108`.'] -Line 112: Unexpected errors ['overloads_consistency.py:112:0 Incompatible overload [43]: The return type of overloaded function `decorated` (`str`) is incompatible with the return type of the implementation (`bytes`).', 'overloads_consistency.py:112:0 Incompatible overload [43]: The implementation of `decorated` does not accept all possible arguments of overload defined on line `112`.', 'overloads_consistency.py:112:0 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).'] -""" -output = """ -overloads_consistency.py:25:0 Incompatible overload [43]: The return type of overloaded function `return_type` (`str`) is incompatible with the return type of the implementation (`int`). -overloads_consistency.py:41:0 Incompatible overload [43]: The implementation of `parameter_type` does not accept all possible arguments of overload defined on line `41`. -overloads_consistency.py:108:0 Incompatible overload [43]: The return type of overloaded function `decorated` (`None`) is incompatible with the return type of the implementation (`bytes`). -overloads_consistency.py:108:0 Incompatible overload [43]: The implementation of `decorated` does not accept all possible arguments of overload defined on line `108`. -overloads_consistency.py:112:0 Incompatible overload [43]: The return type of overloaded function `decorated` (`str`) is incompatible with the return type of the implementation (`bytes`). -overloads_consistency.py:112:0 Incompatible overload [43]: The implementation of `decorated` does not accept all possible arguments of overload defined on line `112`. -overloads_consistency.py:112:0 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s). -""" diff --git a/conformance/results/pyre/overloads_definitions.toml b/conformance/results/pyre/overloads_definitions.toml deleted file mode 100644 index ecbcade19..000000000 --- a/conformance/results/pyre/overloads_definitions.toml +++ /dev/null @@ -1,30 +0,0 @@ -conformant = "Partial" -conformance_automated = "Fail" -notes = """ -Does not allow an overload with no implementation in a Protocol or an abstract base class. -Expects @final/@override on all overloads and implementation, instead of implementation only. -""" -errors_diff = """ -Lines 135, 136, 137, 141, 142: Expected error (tag 'invalid_final_2') -Lines 220, 221, 222, 225, 226: Expected error (tag 'override_impl') -Line 40: Unexpected errors ['overloads_definitions.py:40:4 Missing overload implementation [42]: Overloaded function `MyProto.func3` must have an implementation.'] -Line 49: Unexpected errors ['overloads_definitions.py:49:4 Missing overload implementation [42]: Overloaded function `MyAbstractBase.func4` must have an implementation.'] -Line 117: Unexpected errors ['overloads_definitions.py:117:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).'] -Line 215: Unexpected errors ['overloads_definitions.py:215:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).'] -""" -output = """ -overloads_definitions.py:16:0 Incompatible overload [43]: At least two overload signatures must be present. -overloads_definitions.py:28:0 Missing overload implementation [42]: Overloaded function `func2` must have an implementation. -overloads_definitions.py:40:4 Missing overload implementation [42]: Overloaded function `MyProto.func3` must have an implementation. -overloads_definitions.py:49:4 Missing overload implementation [42]: Overloaded function `MyAbstractBase.func4` must have an implementation. -overloads_definitions.py:59:4 Missing overload implementation [42]: Overloaded function `MyAbstractBase.not_abstract` must have an implementation. -overloads_definitions.py:81:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s). -overloads_definitions.py:90:4 Incompatible overload [43]: The implementation of `C.func6` does not accept all possible arguments of overload defined on line `90`. -overloads_definitions.py:90:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s). -overloads_definitions.py:117:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s). -overloads_definitions.py:127:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s). -overloads_definitions.py:181:4 Invalid override [40]: `overloads_definitions.Child.final_method` cannot override final method defined in `Base`. -overloads_definitions.py:198:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s). -overloads_definitions.py:198:4 Invalid override [40]: `overloads_definitions.Child.bad_override` is decorated with @override, but no method of the same name exists in superclasses of `Child`. -overloads_definitions.py:215:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s). -""" diff --git a/conformance/results/pyre/overloads_definitions_stub.toml b/conformance/results/pyre/overloads_definitions_stub.toml deleted file mode 100644 index 7734a4421..000000000 --- a/conformance/results/pyre/overloads_definitions_stub.toml +++ /dev/null @@ -1,25 +0,0 @@ -conformant = "Partial" -notes = """ -Expects @final and @override to be present on all overloads, not just first. -""" -conformance_automated = "Fail" -errors_diff = """ -Lines 67, 69, 71, 72, 73: Expected error (tag 'invalid_final') -Lines 80, 82, 84, 85, 86: Expected error (tag 'invalid_final_2') -Lines 102, 107, 108, 111, 113: Expected error (tag 'override-final') -Line 63: Unexpected errors ['overloads_definitions_stub.pyi:63:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).'] -Line 76: Unexpected errors ['overloads_definitions_stub.pyi:76:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).'] -Line 125: Unexpected errors ['overloads_definitions_stub.pyi:125:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).'] -Line 138: Unexpected errors ['overloads_definitions_stub.pyi:138:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).'] -""" -output = """ -overloads_definitions_stub.pyi:14:0 Incompatible overload [43]: At least two overload signatures must be present. -overloads_definitions_stub.pyi:37:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s). -overloads_definitions_stub.pyi:44:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s). -overloads_definitions_stub.pyi:63:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s). -overloads_definitions_stub.pyi:76:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s). -overloads_definitions_stub.pyi:122:4 Invalid override [40]: `overloads_definitions_stub.Child.bad_override` is decorated with @override, but no method of the same name exists in superclasses of `Child`. -overloads_definitions_stub.pyi:125:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s). -overloads_definitions_stub.pyi:138:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s). -overloads_definitions_stub.pyi:147:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s). -""" diff --git a/conformance/results/pyre/overloads_evaluation.toml b/conformance/results/pyre/overloads_evaluation.toml deleted file mode 100644 index c5ca33786..000000000 --- a/conformance/results/pyre/overloads_evaluation.toml +++ /dev/null @@ -1,47 +0,0 @@ -conformant = "Partial" -notes = """ -Does not expand boolean arguments to Literal[True] and Literal[False]. -Does not expand enum arguments to literal variants. -Does not expand type[A | B] to type[A] and type[B]. -Does not expand tuple arguments to possible combinations. -Does not prefer variadic match to indeterminate-length unpacked argument. -Does not treat multiple matches due to gradual types as ambiguous. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 105: Unexpected errors ['overloads_evaluation.py:105:23 Incompatible parameter type [6]: In call `example2`, for 2nd positional argument, expected `str` but got `Union[int, str]`.'] -Line 106: Unexpected errors ['overloads_evaluation.py:106:4 Assert type [70]: Expected `Union[int, str]` but got `str`.'] -Line 134: Unexpected errors ['overloads_evaluation.py:134:23 Incompatible parameter type [6]: In call `expand_bool`, for 1st positional argument, expected `typing_extensions.Literal[False]` but got `bool`.'] -Line 135: Unexpected errors ['overloads_evaluation.py:135:4 Assert type [70]: Expected `Union[typing_extensions.Literal[0], typing_extensions.Literal[1]]` but got `typing_extensions.Literal[0]`.'] -Line 160: Unexpected errors ['overloads_evaluation.py:160:23 Incompatible parameter type [6]: In call `expand_enum`, for 1st positional argument, expected `typing_extensions.Literal[Color.RED]` but got `Color`.'] -Line 161: Unexpected errors ['overloads_evaluation.py:161:4 Assert type [70]: Expected `Union[typing_extensions.Literal[0], typing_extensions.Literal[1]]` but got `typing_extensions.Literal[0]`.'] -Line 180: Unexpected errors ['overloads_evaluation.py:180:29 Incompatible parameter type [6]: In call `expand_type_union`, for 1st positional argument, expected `Type[int]` but got `Type[Union[int, str]]`.'] -Line 181: Unexpected errors ['overloads_evaluation.py:181:4 Assert type [70]: Expected `Union[int, str]` but got `int`.'] -Line 204: Unexpected errors ['overloads_evaluation.py:204:24 Incompatible parameter type [6]: In call `expand_tuple`, for 1st positional argument, expected `Tuple[int, int]` but got `Tuple[int, Union[int, str]]`.'] -Line 205: Unexpected errors ['overloads_evaluation.py:205:4 Assert type [70]: Expected `Union[int, str]` but got `int`.'] -Line 234: Unexpected errors ['overloads_evaluation.py:234:4 Assert type [70]: Expected `int` but got `str`.'] -Line 264: Unexpected errors ['overloads_evaluation.py:264:4 Assert type [70]: Expected `typing.Any` but got `List[int]`.'] -Line 280: Unexpected errors ['overloads_evaluation.py:280:4 Assert type [70]: Expected `typing.Any` but got `List[int]`.'] -Line 345: Unexpected errors ['overloads_evaluation.py:345:4 Assert type [70]: Expected `typing.Any` but got `List[int]`.'] -""" -output = """ -overloads_evaluation.py:38:0 Missing argument [20]: Call `example1_1` expects argument `x`. -overloads_evaluation.py:46:14 Incompatible parameter type [6]: In call `example1_1`, for 2nd positional argument, expected `str` but got `int`. -overloads_evaluation.py:51:11 Incompatible parameter type [6]: In call `example1_1`, for 1st positional argument, expected `str` but got `int`. -overloads_evaluation.py:105:23 Incompatible parameter type [6]: In call `example2`, for 2nd positional argument, expected `str` but got `Union[int, str]`. -overloads_evaluation.py:106:4 Assert type [70]: Expected `Union[int, str]` but got `str`. -overloads_evaluation.py:115:13 Incompatible parameter type [6]: In call `example2`, for 1st positional argument, expected `int` but got `Union[int, str]`. -overloads_evaluation.py:115:16 Incompatible parameter type [6]: In call `example2`, for 2nd positional argument, expected `str` but got `Union[int, str]`. -overloads_evaluation.py:134:23 Incompatible parameter type [6]: In call `expand_bool`, for 1st positional argument, expected `typing_extensions.Literal[False]` but got `bool`. -overloads_evaluation.py:135:4 Assert type [70]: Expected `Union[typing_extensions.Literal[0], typing_extensions.Literal[1]]` but got `typing_extensions.Literal[0]`. -overloads_evaluation.py:160:23 Incompatible parameter type [6]: In call `expand_enum`, for 1st positional argument, expected `typing_extensions.Literal[Color.RED]` but got `Color`. -overloads_evaluation.py:161:4 Assert type [70]: Expected `Union[typing_extensions.Literal[0], typing_extensions.Literal[1]]` but got `typing_extensions.Literal[0]`. -overloads_evaluation.py:180:29 Incompatible parameter type [6]: In call `expand_type_union`, for 1st positional argument, expected `Type[int]` but got `Type[Union[int, str]]`. -overloads_evaluation.py:181:4 Assert type [70]: Expected `Union[int, str]` but got `int`. -overloads_evaluation.py:204:24 Incompatible parameter type [6]: In call `expand_tuple`, for 1st positional argument, expected `Tuple[int, int]` but got `Tuple[int, Union[int, str]]`. -overloads_evaluation.py:205:4 Assert type [70]: Expected `Union[int, str]` but got `int`. -overloads_evaluation.py:234:4 Assert type [70]: Expected `int` but got `str`. -overloads_evaluation.py:264:4 Assert type [70]: Expected `typing.Any` but got `List[int]`. -overloads_evaluation.py:280:4 Assert type [70]: Expected `typing.Any` but got `List[int]`. -overloads_evaluation.py:345:4 Assert type [70]: Expected `typing.Any` but got `List[int]`. -""" diff --git a/conformance/results/pyre/protocols_class_objects.toml b/conformance/results/pyre/protocols_class_objects.toml deleted file mode 100644 index 9a640450a..000000000 --- a/conformance/results/pyre/protocols_class_objects.toml +++ /dev/null @@ -1,21 +0,0 @@ -conformant = "Partial" -notes = """ -Does not reject protocol class assigned to type[Proto]. -Incorrectly reports some class objects as incompatible with a protocol. -Fails to report some class objects as incompatible with a protocol. -""" -output = """ -protocols_class_objects.py:26:11 Invalid class instantiation [45]: Cannot instantiate abstract class `Proto` with abstract method `meth`. -protocols_class_objects.py:58:0 Incompatible variable type [9]: pa1 is declared to have type `ProtoA1` but is used as type `Type[ConcreteA]`. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 29: Expected 1 errors -Line 34: Expected 1 errors -Line 74: Expected 1 errors -Line 104: Expected 1 errors -Line 106: Expected 1 errors -Line 107: Expected 1 errors -Line 108: Expected 1 errors -Line 26: Unexpected errors ['protocols_class_objects.py:26:11 Invalid class instantiation [45]: Cannot instantiate abstract class `Proto` with abstract method `meth`.'] -""" diff --git a/conformance/results/pyre/protocols_definition.toml b/conformance/results/pyre/protocols_definition.toml deleted file mode 100644 index 102319974..000000000 --- a/conformance/results/pyre/protocols_definition.toml +++ /dev/null @@ -1,35 +0,0 @@ -conformant = "Partial" -notes = """ -Does not reject ClassVar in concrete class when attribute in protocol is not ClassVar or vice versa. -Does not reject read-only property in concrete class when attribute in protocol is mutable. -Does not reject covariant attribute type when protocol attribute is mutable. -Does not reject read-only property in concrete class when protocol has settable property. -Does not reject immutable named tuple attribute in concrete class when protocol attribute is mutable. -Does not reject immutable frozen dataclass attribute in concrete class when protocol attribute is mutable. -""" -output = """ -protocols_definition.py:30:10 Incompatible parameter type [6]: In call `close_all`, for 1st positional argument, expected `Iterable[SupportsClose]` but got `Iterable[int]`. -protocols_definition.py:67:8 Undefined attribute [16]: `Template` has no attribute `temp`. -protocols_definition.py:114:0 Incompatible variable type [9]: v2_bad1 is declared to have type `Template2` but is used as type `Concrete2_Bad1`. -protocols_definition.py:115:0 Incompatible variable type [9]: v2_bad2 is declared to have type `Template2` but is used as type `Concrete2_Bad2`. -protocols_definition.py:156:0 Incompatible variable type [9]: v3_bad1 is declared to have type `Template3` but is used as type `Concrete3_Bad1`. -protocols_definition.py:159:0 Incompatible variable type [9]: v3_bad4 is declared to have type `Template3` but is used as type `Concrete3_Bad4`. -protocols_definition.py:218:0 Incompatible variable type [9]: v4_bad1 is declared to have type `Template4` but is used as type `Concrete4_Bad1`. -protocols_definition.py:219:0 Incompatible variable type [9]: v4_bad2 is declared to have type `Template4` but is used as type `Concrete4_Bad2`. -protocols_definition.py:285:0 Incompatible variable type [9]: v5_bad1 is declared to have type `Template5` but is used as type `Concrete5_Bad1`. -protocols_definition.py:286:0 Incompatible variable type [9]: v5_bad2 is declared to have type `Template5` but is used as type `Concrete5_Bad2`. -protocols_definition.py:287:0 Incompatible variable type [9]: v5_bad3 is declared to have type `Template5` but is used as type `Concrete5_Bad3`. -protocols_definition.py:288:0 Incompatible variable type [9]: v5_bad4 is declared to have type `Template5` but is used as type `Concrete5_Bad4`. -protocols_definition.py:289:0 Incompatible variable type [9]: v5_bad5 is declared to have type `Template5` but is used as type `Concrete5_Bad5`. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 116: Expected 1 errors -Line 117: Expected 1 errors -Line 157: Expected 1 errors -Line 158: Expected 1 errors -Line 160: Expected 1 errors -Line 339: Expected 1 errors -Line 340: Expected 1 errors -Line 341: Expected 1 errors -""" diff --git a/conformance/results/pyre/protocols_explicit.toml b/conformance/results/pyre/protocols_explicit.toml deleted file mode 100644 index 5a36eda0d..000000000 --- a/conformance/results/pyre/protocols_explicit.toml +++ /dev/null @@ -1,18 +0,0 @@ -conformant = "Partial" -notes = """ -Does not report error when calling unimplemented protocol method from derived class. -Does not report error when method is not implemented in derived class. -""" -output = """ -protocols_explicit.py:60:4 Invalid class instantiation [45]: Cannot instantiate abstract class `Point` with abstract method `intensity`. -protocols_explicit.py:83:0 Uninitialized attribute [13]: Attribute `cm1` inherited from protocol `Proto1` in class `Concrete1` to have type `int` but is never initialized. -protocols_explicit.py:164:6 Invalid class instantiation [45]: Cannot instantiate abstract class `Concrete7A` with abstract method `method1`. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 27: Expected 1 errors -Line 56: Expected 1 errors -Line 89: Expected 1 errors -Line 134: Expected 1 errors -Line 83: Unexpected errors ['protocols_explicit.py:83:0 Uninitialized attribute [13]: Attribute `cm1` inherited from protocol `Proto1` in class `Concrete1` to have type `int` but is never initialized.'] -""" diff --git a/conformance/results/pyre/protocols_generic.toml b/conformance/results/pyre/protocols_generic.toml deleted file mode 100644 index dd13ab524..000000000 --- a/conformance/results/pyre/protocols_generic.toml +++ /dev/null @@ -1,19 +0,0 @@ -conformant = "Partial" -notes = """ -Does not reject the use of Protocol and Generic together as base classes. -Does not detect protocol mismatch when method-scoped TypeVar is used in protocol. -""" -output = """ -protocols_generic.py:40:0 Incompatible variable type [9]: p2 is declared to have type `Proto1[int, str]` but is used as type `Concrete1`. -protocols_generic.py:44:29 Invalid inheritance [39]: Subscripted Protocol and Generic may not appear in the same base class list -protocols_generic.py:56:4 Incompatible variable type [9]: v2 is declared to have type `Box[int]` but is used as type `Box[float]`. -protocols_generic.py:66:4 Incompatible variable type [9]: v2 is declared to have type `Sender[float]` but is used as type `Sender[int]`. -protocols_generic.py:74:4 Incompatible variable type [9]: v1 is declared to have type `AttrProto[float]` but is used as type `AttrProto[int]`. -protocols_generic.py:75:4 Incompatible variable type [9]: v2 is declared to have type `AttrProto[int]` but is used as type `AttrProto[float]`. -protocols_generic.py:146:0 Incompatible variable type [9]: hp3 is declared to have type `HasPropertyProto` but is used as type `ConcreteHasProperty3`. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 145: Expected 1 errors -Line 147: Expected 1 errors -""" diff --git a/conformance/results/pyre/protocols_merging.toml b/conformance/results/pyre/protocols_merging.toml deleted file mode 100644 index 05c0cbd4b..000000000 --- a/conformance/results/pyre/protocols_merging.toml +++ /dev/null @@ -1,14 +0,0 @@ -conformant = "Pass" -notes = """ -""" -output = """ -protocols_merging.py:52:0 Incompatible variable type [9]: s6 is declared to have type `SizedAndClosable1` but is used as type `SCConcrete2`. -protocols_merging.py:53:0 Incompatible variable type [9]: s7 is declared to have type `SizedAndClosable2` but is used as type `SCConcrete2`. -protocols_merging.py:54:0 Incompatible variable type [9]: s8 is declared to have type `SizedAndClosable3` but is used as type `SCConcrete2`. -protocols_merging.py:67:15 Invalid inheritance [39]: If Protocol is included as a base class, all other base classes must be protocols or Generic. -protocols_merging.py:82:4 Invalid class instantiation [45]: Cannot instantiate abstract class `SizedAndClosable4` with abstract method `close`. -protocols_merging.py:83:0 Incompatible variable type [9]: y is declared to have type `SizedAndClosable4` but is used as type `SCConcrete1`. -""" -conformance_automated = "Pass" -errors_diff = """ -""" diff --git a/conformance/results/pyre/protocols_modules.toml b/conformance/results/pyre/protocols_modules.toml deleted file mode 100644 index cce8d663c..000000000 --- a/conformance/results/pyre/protocols_modules.toml +++ /dev/null @@ -1,12 +0,0 @@ -conformant = "Unsupported" -notes = """ -Does not perform protocol checks for modules. -""" -output = """ -""" -conformance_automated = "Fail" -errors_diff = """ -Line 26: Expected 1 errors -Line 48: Expected 1 errors -Line 49: Expected 1 errors -""" diff --git a/conformance/results/pyre/protocols_recursive.toml b/conformance/results/pyre/protocols_recursive.toml deleted file mode 100644 index 5e485e856..000000000 --- a/conformance/results/pyre/protocols_recursive.toml +++ /dev/null @@ -1,6 +0,0 @@ -conformant = "Pass" -output = """ -""" -conformance_automated = "Pass" -errors_diff = """ -""" diff --git a/conformance/results/pyre/protocols_runtime_checkable.toml b/conformance/results/pyre/protocols_runtime_checkable.toml deleted file mode 100644 index 7b1d73b0d..000000000 --- a/conformance/results/pyre/protocols_runtime_checkable.toml +++ /dev/null @@ -1,17 +0,0 @@ -conformant = "Unsupported" -notes = """ -Does not reject isinstance or issubclass call for protocol that is not runtime_checkable. -Does not reject issubclass call for data protocol. -Does not report unsafe overlap for runtime_checkable protocol. -""" -output = """ -""" -conformance_automated = "Fail" -errors_diff = """ -Line 23: Expected 1 errors -Line 55: Expected 1 errors -Line 61: Expected 1 errors -Line 88: Expected 1 errors -Line 92: Expected 1 errors -Line 96: Expected 1 errors -""" diff --git a/conformance/results/pyre/protocols_self.toml b/conformance/results/pyre/protocols_self.toml deleted file mode 100644 index 5e485e856..000000000 --- a/conformance/results/pyre/protocols_self.toml +++ /dev/null @@ -1,6 +0,0 @@ -conformant = "Pass" -output = """ -""" -conformance_automated = "Pass" -errors_diff = """ -""" diff --git a/conformance/results/pyre/protocols_subtyping.toml b/conformance/results/pyre/protocols_subtyping.toml deleted file mode 100644 index 1c8c18fcc..000000000 --- a/conformance/results/pyre/protocols_subtyping.toml +++ /dev/null @@ -1,13 +0,0 @@ -conformant = "Pass" -output = """ -protocols_subtyping.py:16:5 Invalid class instantiation [45]: Cannot instantiate protocol `Proto1`. -protocols_subtyping.py:38:4 Incompatible variable type [9]: v2 is declared to have type `Concrete2` but is used as type `Proto2`. -protocols_subtyping.py:55:4 Incompatible variable type [9]: v2 is declared to have type `Proto3` but is used as type `Proto2`. -protocols_subtyping.py:79:4 Incompatible variable type [9]: v3 is declared to have type `Proto4[int, float]` but is used as type `Proto5[int]`. -protocols_subtyping.py:80:4 Incompatible variable type [9]: v4 is declared to have type `Proto5[float]` but is used as type `Proto4[int, int]`. -protocols_subtyping.py:102:4 Incompatible variable type [9]: v4 is declared to have type `Proto7[int, float]` but is used as type `Proto6[float, float]`. -protocols_subtyping.py:103:4 Incompatible variable type [9]: v5 is declared to have type `Proto7[float, object]` but is used as type `Proto6[float, float]`. -""" -conformance_automated = "Pass" -errors_diff = """ -""" diff --git a/conformance/results/pyre/protocols_variance.toml b/conformance/results/pyre/protocols_variance.toml deleted file mode 100644 index 5577f2529..000000000 --- a/conformance/results/pyre/protocols_variance.toml +++ /dev/null @@ -1,18 +0,0 @@ -conformant = "Unsupported" -notes = """ -Does not detect incorrect TypeVar variance within generic protocols. -""" -output = """ -protocols_variance.py:62:17 Invalid type variance [46]: The type variable `Variable[T1_co](covariant)` is covariant and cannot be a parameter type. -protocols_variance.py:72:4 Invalid type variance [46]: The type variable `Variable[T1_contra](contravariant)` is contravariant and cannot be a return type. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 21: Expected 1 errors -Line 40: Expected 1 errors -Line 56: Expected 1 errors -Line 61: Expected 1 errors -Line 66: Expected 1 errors -Line 71: Expected 1 errors -Line 104: Expected 1 errors -""" diff --git a/conformance/results/pyre/qualifiers_annotated.toml b/conformance/results/pyre/qualifiers_annotated.toml deleted file mode 100644 index 160686638..000000000 --- a/conformance/results/pyre/qualifiers_annotated.toml +++ /dev/null @@ -1,34 +0,0 @@ -conformant = "Partial" -notes = """ -Does not reject Annotated with a single parameter. -Does not reject call of Annotated with no type arguments. -""" -output = """ -qualifiers_annotated.py:38:6 Undefined or invalid type [11]: Annotation `` is not defined as a type. -qualifiers_annotated.py:39:6 Invalid type [31]: Expression `typing.Annotated[(((int, str)), "")]` is not a valid type. -qualifiers_annotated.py:40:6 Invalid type [31]: Expression `typing.Annotated[(comprehension(int for generators(generator(i in range(1) if ))), "")]` is not a valid type. -qualifiers_annotated.py:41:6 Invalid type [31]: Expression `typing.Annotated[({ "a":"b" }, "")]` is not a valid type. -qualifiers_annotated.py:42:6 Invalid type [31]: Expression `typing.Annotated[(lambda () (int)(), "")]` is not a valid type. -qualifiers_annotated.py:43:6 Invalid type [31]: Expression `typing.Annotated[([int][0], "")]` is not a valid type. -qualifiers_annotated.py:44:6 Invalid type [31]: Expression `typing.Annotated[(int if 1 < 3 else str, "")]` is not a valid type. -qualifiers_annotated.py:45:16 Unbound name [10]: Name `var1` is used but not defined in the current scope. -qualifiers_annotated.py:46:6 Invalid type [31]: Expression `typing.Annotated[(True, "")]` is not a valid type. -qualifiers_annotated.py:47:7 Invalid type [31]: Expression `typing.Annotated[(1, "")]` is not a valid type. -qualifiers_annotated.py:48:7 Invalid type [31]: Expression `typing.Annotated[(list or set, "")]` is not a valid type. -qualifiers_annotated.py:49:7 Invalid type [31]: Expression `typing.Annotated[(f"{"int"}", "")]` is not a valid type. -qualifiers_annotated.py:59:7 Invalid type parameters [24]: Generic type `Annotated` expects at least 2 type parameters, received 1. -qualifiers_annotated.py:72:0 Incompatible variable type [9]: not_type2 is declared to have type `Type[typing.Any]` but is used as type `TypeAlias`. -qualifiers_annotated.py:80:6 Incompatible parameter type [6]: In call `func4`, for 1st positional argument, expected `Type[Variable[T]]` but got `TypeAlias`. -qualifiers_annotated.py:86:0 Invalid class instantiation [45]: `Annotated` cannot be instantiated. -qualifiers_annotated.py:88:0 Call error [29]: `TypeAlias` is not a function. -qualifiers_annotated.py:100:4 Undefined attribute [16]: `typing.Type` has no attribute `a`. -qualifiers_annotated.py:101:4 Undefined attribute [16]: `typing.Type` has no attribute `b`. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 71: Expected 1 errors -Line 79: Expected 1 errors -Line 87: Expected 1 errors -Line 100: Unexpected errors ['qualifiers_annotated.py:100:4 Undefined attribute [16]: `typing.Type` has no attribute `a`.'] -Line 101: Unexpected errors ['qualifiers_annotated.py:101:4 Undefined attribute [16]: `typing.Type` has no attribute `b`.'] -""" diff --git a/conformance/results/pyre/qualifiers_final_annotation.toml b/conformance/results/pyre/qualifiers_final_annotation.toml deleted file mode 100644 index f9b7dff8d..000000000 --- a/conformance/results/pyre/qualifiers_final_annotation.toml +++ /dev/null @@ -1,40 +0,0 @@ -conformant = "Partial" -notes = """ -Does not report Final variable with missing initialization in module scope. -Does not report error for invalid nesting of Final and ClassVar. -Does not treat use of Final name as if it was replaced by the literal in NamedTuple definition. -Does not reject modification of imported variable declared Final. -""" -output = """ -qualifiers_final_annotation.py:18:6 Invalid type parameters [24]: Generic type `Final` expects 1 type parameter, received 2. -qualifiers_final_annotation.py:34:4 Invalid assignment [41]: Cannot reassign final attribute `ClassA.ID2`. -qualifiers_final_annotation.py:38:4 Uninitialized attribute [13]: Attribute `ID3` is declared in class `ClassA` to have type `int` but is never initialized. -qualifiers_final_annotation.py:54:8 Invalid assignment [41]: Cannot reassign final attribute `self.ID5`. -qualifiers_final_annotation.py:62:8 Undefined attribute [16]: `ClassA` has no attribute `id3`. -qualifiers_final_annotation.py:63:8 Undefined attribute [16]: `ClassA` has no attribute `id4`. -qualifiers_final_annotation.py:65:8 Invalid assignment [41]: Cannot reassign final attribute `self.ID7`. -qualifiers_final_annotation.py:67:8 Invalid assignment [41]: Cannot reassign final attribute `self.ID7`. -qualifiers_final_annotation.py:71:0 Invalid assignment [41]: Cannot reassign final attribute `RATE`. -qualifiers_final_annotation.py:81:0 Invalid assignment [41]: Cannot reassign final attribute `ClassB.DEFAULT_ID`. -qualifiers_final_annotation.py:94:4 Invalid assignment [41]: Cannot reassign final attribute `BORDER_WIDTH`. -qualifiers_final_annotation.py:118:0 Invalid type [31]: Expression `typing.List[Final[int]]` is not a valid type. Final cannot be nested. -qualifiers_final_annotation.py:121:10 Invalid type [31]: Parameter `x` cannot be annotated with Final. -qualifiers_final_annotation.py:133:0 Unexpected keyword [28]: Unexpected keyword argument `x` to call `N.__init__`. -qualifiers_final_annotation.py:134:0 Unexpected keyword [28]: Unexpected keyword argument `a` to call `N.__init__`. -qualifiers_final_annotation.py:135:0 Unexpected keyword [28]: Unexpected keyword argument `x` to call `N.__init__`. -qualifiers_final_annotation.py:141:4 Invalid assignment [41]: Cannot reassign final attribute `ID1`. -qualifiers_final_annotation.py:145:4 Invalid assignment [41]: Cannot reassign final attribute `x`. -qualifiers_final_annotation.py:147:9 Invalid assignment [41]: Cannot reassign final attribute `x`. -qualifiers_final_annotation.py:149:8 Invalid assignment [41]: Cannot reassign final attribute `x`. -qualifiers_final_annotation.py:152:29 Invalid assignment [41]: Cannot reassign final attribute `x`. -qualifiers_final_annotation.py:155:8 Invalid assignment [41]: Cannot reassign final attribute `x`. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 16: Expected 1 errors -Line 107: Expected 1 errors -Line 108: Expected 1 errors -Line 166: Expected 1 errors -Line 170: Expected 1 errors -Line 133: Unexpected errors ['qualifiers_final_annotation.py:133:0 Unexpected keyword [28]: Unexpected keyword argument `x` to call `N.__init__`.'] -""" diff --git a/conformance/results/pyre/qualifiers_final_decorator.toml b/conformance/results/pyre/qualifiers_final_decorator.toml deleted file mode 100644 index 09c5e28b2..000000000 --- a/conformance/results/pyre/qualifiers_final_decorator.toml +++ /dev/null @@ -1,24 +0,0 @@ -conformant = "Partial" -notes = """ -Reports error for overloaded method implementation marked @final if its overloads do not. -Does not report error for overloaded @final method defined in stub file. -Reports misleading error when overload is marked @final but implementation is not. -""" -output = """ -qualifiers_final_decorator.py:21:0 Invalid inheritance [39]: Cannot inherit from final class `Base1`. -qualifiers_final_decorator.py:51:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s). -qualifiers_final_decorator.py:56:4 Invalid override [40]: `qualifiers_final_decorator.Derived2.method1` cannot override final method defined in `Base2`. -qualifiers_final_decorator.py:60:4 Invalid override [40]: `qualifiers_final_decorator.Derived2.method2` cannot override final method defined in `Base2`. -qualifiers_final_decorator.py:64:4 Invalid override [40]: `qualifiers_final_decorator.Derived2.method3` cannot override final method defined in `Base2`. -qualifiers_final_decorator.py:75:4 Invalid override [40]: `qualifiers_final_decorator.Derived2.method4` cannot override final method defined in `Base2`. -qualifiers_final_decorator.py:86:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s). -qualifiers_final_decorator.py:118:4 Inconsistent override [14]: `qualifiers_final_decorator.Derived5.method` overrides method defined in `Base5_2` inconsistently. Could not find parameter `v` in overriding signature. -qualifiers_final_decorator.py:118:4 Invalid override [40]: `qualifiers_final_decorator.Derived5.method` cannot override final method defined in `Base5_2`. -qualifiers_final_decorator.py:126:0 Invalid inheritance [39]: `final` cannot be used with non-method functions. -""" -conformance_automated = "Fail" -errors_diff = """ -Lines 80, 81, 89: Expected error (tag 'Derived3') -Lines 94, 95, 102: Expected error (tag 'Derived4') -Line 51: Unexpected errors ['qualifiers_final_decorator.py:51:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).'] -""" diff --git a/conformance/results/pyre/specialtypes_any.toml b/conformance/results/pyre/specialtypes_any.toml deleted file mode 100644 index 07cd73b25..000000000 --- a/conformance/results/pyre/specialtypes_any.toml +++ /dev/null @@ -1,8 +0,0 @@ -conformant = "Pass" -notes = """ -""" -output = """ -""" -conformance_automated = "Pass" -errors_diff = """ -""" diff --git a/conformance/results/pyre/specialtypes_never.toml b/conformance/results/pyre/specialtypes_never.toml deleted file mode 100644 index 1cdfcc0b6..000000000 --- a/conformance/results/pyre/specialtypes_never.toml +++ /dev/null @@ -1,22 +0,0 @@ -conformant = "Partial" -notes = """ -Does not treat Never as compatible with all other types. -""" -output = """ -specialtypes_never.py:19:21 Incompatible return type [7]: Function declared non-returnable, but got implicit return value of `None`. -specialtypes_never.py:68:4 Incompatible variable type [9]: v1 is declared to have type `int` but is used as type `Never`. -specialtypes_never.py:69:4 Incompatible variable type [9]: v2 is declared to have type `str` but is used as type `Never`. -specialtypes_never.py:70:4 Incompatible variable type [9]: v3 is declared to have type `List[str]` but is used as type `Never`. -specialtypes_never.py:86:4 Incompatible variable type [9]: v3 is declared to have type `List[int]` but is used as type `List[Never]`. -specialtypes_never.py:87:4 Incompatible variable type [9]: v4 is declared to have type `Never` but is used as type `NoReturn`. -specialtypes_never.py:96:4 Incompatible return type [7]: Expected `ClassB[Variable[U]]` but got `ClassB[Never]`. -specialtypes_never.py:105:4 Incompatible return type [7]: Expected `ClassC[Variable[U]]` but got `ClassC[Never]`. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 68: Unexpected errors ['specialtypes_never.py:68:4 Incompatible variable type [9]: v1 is declared to have type `int` but is used as type `Never`.'] -Line 69: Unexpected errors ['specialtypes_never.py:69:4 Incompatible variable type [9]: v2 is declared to have type `str` but is used as type `Never`.'] -Line 70: Unexpected errors ['specialtypes_never.py:70:4 Incompatible variable type [9]: v3 is declared to have type `List[str]` but is used as type `Never`.'] -Line 87: Unexpected errors ['specialtypes_never.py:87:4 Incompatible variable type [9]: v4 is declared to have type `Never` but is used as type `NoReturn`.'] -Line 96: Unexpected errors ['specialtypes_never.py:96:4 Incompatible return type [7]: Expected `ClassB[Variable[U]]` but got `ClassB[Never]`.'] -""" diff --git a/conformance/results/pyre/specialtypes_none.toml b/conformance/results/pyre/specialtypes_none.toml deleted file mode 100644 index a9c3b0913..000000000 --- a/conformance/results/pyre/specialtypes_none.toml +++ /dev/null @@ -1,9 +0,0 @@ -conformant = "Pass" -output = """ -specialtypes_none.py:21:6 Incompatible parameter type [6]: In call `func1`, for 1st positional argument, expected `None` but got `Type[None]`. -specialtypes_none.py:27:0 Incompatible variable type [9]: none2 is declared to have type `Iterable[typing.Any]` but is used as type `None`. -specialtypes_none.py:41:6 Incompatible parameter type [6]: In call `func2`, for 1st positional argument, expected `Type[None]` but got `None`. -""" -conformance_automated = "Pass" -errors_diff = """ -""" diff --git a/conformance/results/pyre/specialtypes_promotions.toml b/conformance/results/pyre/specialtypes_promotions.toml deleted file mode 100644 index fb9055fb6..000000000 --- a/conformance/results/pyre/specialtypes_promotions.toml +++ /dev/null @@ -1,10 +0,0 @@ -conformant = "Partial" -notes = """ -Does not reject use of attribute that is compatible only with float. -""" -output = """ -""" -conformance_automated = "Fail" -errors_diff = """ -Line 13: Expected 1 errors -""" diff --git a/conformance/results/pyre/specialtypes_type.toml b/conformance/results/pyre/specialtypes_type.toml deleted file mode 100644 index a2a0c9c5a..000000000 --- a/conformance/results/pyre/specialtypes_type.toml +++ /dev/null @@ -1,42 +0,0 @@ -conformant = "Partial" -notes = """ -Does not reject Callable when passed to type[T]. -Does not treat `type` same as `type[Any]` for assert_type. -Does not allow access to unknown attributes from object of type `type[Any]`. -Does not reject access to unknown attributes from object of type `Type[object]`. -Reports type incompatibility between `type` and `Callable[..., Any]`. -""" -output = """ -specialtypes_type.py:56:6 Incompatible parameter type [6]: In call `func4`, for 1st positional argument, expected `Type[Union[BasicUser, ProUser]]` but got `Type[TeamUser]`. -specialtypes_type.py:76:11 Invalid type parameters [24]: Generic type `type` expects 1 type parameter, received 2, use `typing.Type[]` to avoid runtime subscripting errors. -specialtypes_type.py:98:4 Assert type [70]: Expected `typing.Tuple[Type[typing.Any], ...]` but got `unknown`. -specialtypes_type.py:99:4 Assert type [70]: Expected `typing.Any` but got `unknown`. -specialtypes_type.py:102:4 Assert type [70]: Expected `typing.Tuple[Type[typing.Any], ...]` but got `unknown`. -specialtypes_type.py:103:4 Assert type [70]: Expected `typing.Any` but got `unknown`. -specialtypes_type.py:106:4 Assert type [70]: Expected `typing.Tuple[Type[typing.Any], ...]` but got `unknown`. -specialtypes_type.py:107:4 Assert type [70]: Expected `typing.Any` but got `unknown`. -specialtypes_type.py:110:4 Assert type [70]: Expected `typing.Tuple[Type[typing.Any], ...]` but got `unknown`. -specialtypes_type.py:111:4 Assert type [70]: Expected `typing.Any` but got `unknown`. -specialtypes_type.py:117:4 Undefined attribute [16]: `object` has no attribute `unknown`. -specialtypes_type.py:143:0 Undefined attribute [16]: `TypeAlias` has no attribute `unknown`. -specialtypes_type.py:165:4 Incompatible variable type [9]: x1 is declared to have type `typing.Callable[..., typing.Any]` but is used as type `Type[typing.Any]`. -specialtypes_type.py:166:4 Incompatible variable type [9]: x2 is declared to have type `typing.Callable[[int, int], int]` but is used as type `Type[typing.Any]`. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 70: Expected 1 errors -Line 120: Expected 1 errors -Line 144: Expected 1 errors -Line 145: Expected 1 errors -Line 146: Expected 1 errors -Line 98: Unexpected errors ['specialtypes_type.py:98:4 Assert type [70]: Expected `typing.Tuple[Type[typing.Any], ...]` but got `unknown`.'] -Line 99: Unexpected errors ['specialtypes_type.py:99:4 Assert type [70]: Expected `typing.Any` but got `unknown`.'] -Line 102: Unexpected errors ['specialtypes_type.py:102:4 Assert type [70]: Expected `typing.Tuple[Type[typing.Any], ...]` but got `unknown`.'] -Line 103: Unexpected errors ['specialtypes_type.py:103:4 Assert type [70]: Expected `typing.Any` but got `unknown`.'] -Line 106: Unexpected errors ['specialtypes_type.py:106:4 Assert type [70]: Expected `typing.Tuple[Type[typing.Any], ...]` but got `unknown`.'] -Line 107: Unexpected errors ['specialtypes_type.py:107:4 Assert type [70]: Expected `typing.Any` but got `unknown`.'] -Line 110: Unexpected errors ['specialtypes_type.py:110:4 Assert type [70]: Expected `typing.Tuple[Type[typing.Any], ...]` but got `unknown`.'] -Line 111: Unexpected errors ['specialtypes_type.py:111:4 Assert type [70]: Expected `typing.Any` but got `unknown`.'] -Line 165: Unexpected errors ['specialtypes_type.py:165:4 Incompatible variable type [9]: x1 is declared to have type `typing.Callable[..., typing.Any]` but is used as type `Type[typing.Any]`.'] -Line 166: Unexpected errors ['specialtypes_type.py:166:4 Incompatible variable type [9]: x2 is declared to have type `typing.Callable[[int, int], int]` but is used as type `Type[typing.Any]`.'] -""" diff --git a/conformance/results/pyre/tuples_type_compat.toml b/conformance/results/pyre/tuples_type_compat.toml deleted file mode 100644 index 7eb2392d0..000000000 --- a/conformance/results/pyre/tuples_type_compat.toml +++ /dev/null @@ -1,46 +0,0 @@ -conformant = "Partial" -notes = """ -Does not support some unpacked tuple forms. -Does not report type violation when assigning `tuple[int, ...]` to `tuple[int]`. -Does not support tuple narrowing based on `len()` type guard (optional). -Does not correctly evaluate `Sequence[Never]` for `tuple[()]`. -""" -output = """ -tuples_type_compat.py:15:4 Incompatible variable type [9]: v2 is declared to have type `Tuple[int, int]` but is used as type `Tuple[float, complex]`. -tuples_type_compat.py:55:21 Undefined or invalid type [11]: Annotation `SomeType` is not defined as a type. -tuples_type_compat.py:73:11 Incompatible parameter type [6]: In call `len`, for 1st positional argument, expected `pyre_extensions.PyreReadOnly[Sized]` but got `Union[Tuple[int], Tuple[str, str], typing.Tuple[int, *Tuple[str, ...], int]]`. -tuples_type_compat.py:75:8 Assert type [70]: Expected `Tuple[int]` but got `Union[Tuple[int], Tuple[str, str], typing.Tuple[int, *Tuple[str, ...], int]]`. -tuples_type_compat.py:78:11 Incompatible parameter type [6]: In call `len`, for 1st positional argument, expected `pyre_extensions.PyreReadOnly[Sized]` but got `Union[Tuple[int], Tuple[str, str], typing.Tuple[int, *Tuple[str, ...], int]]`. -tuples_type_compat.py:80:8 Assert type [70]: Expected `Union[Tuple[int, int], Tuple[str, str]]` but got `Union[Tuple[int], Tuple[str, str], typing.Tuple[int, *Tuple[str, ...], int]]`. -tuples_type_compat.py:83:11 Incompatible parameter type [6]: In call `len`, for 1st positional argument, expected `pyre_extensions.PyreReadOnly[Sized]` but got `Union[Tuple[int], Tuple[str, str], typing.Tuple[int, *Tuple[str, ...], int]]`. -tuples_type_compat.py:85:8 Assert type [70]: Expected `Tuple[int, str, int]` but got `Union[Tuple[int], Tuple[str, str], typing.Tuple[int, *Tuple[str, ...], int]]`. -tuples_type_compat.py:101:12 Assert type [70]: Expected `Tuple[int]` but got `Union[Tuple[int], Tuple[str, str], typing.Tuple[int, *Tuple[str, ...], int]]`. -tuples_type_compat.py:106:12 Assert type [70]: Expected `Union[Tuple[int, int], Tuple[str, str]]` but got `Union[Tuple[int], Tuple[str, str], typing.Tuple[int, *Tuple[str, ...], int]]`. -tuples_type_compat.py:111:12 Assert type [70]: Expected `Tuple[int, str, int]` but got `Union[Tuple[int], Tuple[str, str], typing.Tuple[int, *Tuple[str, ...], int]]`. -tuples_type_compat.py:126:12 Assert type [70]: Expected `Tuple[Union[int, str], str]` but got `Tuple[Union[int, str], Union[int, str]]`. -tuples_type_compat.py:129:12 Assert type [70]: Expected `Tuple[Union[int, str], int]` but got `Tuple[Union[int, str], Union[int, str]]`. -tuples_type_compat.py:153:4 Assert type [70]: Expected `Sequence[Never]` but got `Sequence[Variable[T]]`. -tuples_type_compat.py:157:0 Incompatible variable type [9]: t1 is declared to have type `Tuple[int, str]` but is used as type `Tuple[int, str, str]`. -tuples_type_compat.py:162:0 Incompatible variable type [9]: t2 is declared to have type `typing.Tuple[int, *Tuple[str, ...]]` but is used as type `Tuple[int, int, str]`. -tuples_type_compat.py:163:0 Incompatible variable type [9]: t2 is declared to have type `typing.Tuple[int, *Tuple[str, ...]]` but is used as type `Tuple[int, str, int]`. -tuples_type_compat.py:169:0 Incompatible variable type [9]: t3 is declared to have type `typing.Tuple[int, *Tuple[str, ...], int]` but is used as type `Tuple[int, str, str]`. -tuples_type_compat.py:170:0 Incompatible variable type [9]: t3 is declared to have type `typing.Tuple[int, *Tuple[str, ...], int]` but is used as type `Tuple[int, str, str, float]`. -tuples_type_compat.py:175:0 Incompatible variable type [9]: t4 is declared to have type `typing.Tuple[*Tuple[str, ...], int]` but is used as type `Tuple[int, str, int]`. -tuples_type_compat.py:176:0 Incompatible variable type [9]: t4 is declared to have type `typing.Tuple[*Tuple[str, ...], int]` but is used as type `Tuple[str, str, float]`. -tuples_type_compat.py:181:4 Incompatible variable type [9]: t2 is declared to have type `Tuple[str, str, int]` but is used as type `Tuple[str, str]`. -tuples_type_compat.py:184:4 Incompatible variable type [9]: t5 is declared to have type `typing.Tuple[str, str, str, *Tuple[str, ...]]` but is used as type `Tuple[str, str]`. -tuples_type_compat.py:188:4 Incompatible variable type [9]: t9 is declared to have type `typing.Tuple[*Tuple[str, ...], str, str, str]` but is used as type `Tuple[str, str]`. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 29: Expected 1 errors -Line 32: Expected 1 errors -Line 33: Expected 1 errors -Line 43: Expected 1 errors -Line 62: Expected 1 errors -Line 55: Unexpected errors ['tuples_type_compat.py:55:21 Undefined or invalid type [11]: Annotation `SomeType` is not defined as a type.'] -Line 73: Unexpected errors ['tuples_type_compat.py:73:11 Incompatible parameter type [6]: In call `len`, for 1st positional argument, expected `pyre_extensions.PyreReadOnly[Sized]` but got `Union[Tuple[int], Tuple[str, str], typing.Tuple[int, *Tuple[str, ...], int]]`.'] -Line 78: Unexpected errors ['tuples_type_compat.py:78:11 Incompatible parameter type [6]: In call `len`, for 1st positional argument, expected `pyre_extensions.PyreReadOnly[Sized]` but got `Union[Tuple[int], Tuple[str, str], typing.Tuple[int, *Tuple[str, ...], int]]`.'] -Line 83: Unexpected errors ['tuples_type_compat.py:83:11 Incompatible parameter type [6]: In call `len`, for 1st positional argument, expected `pyre_extensions.PyreReadOnly[Sized]` but got `Union[Tuple[int], Tuple[str, str], typing.Tuple[int, *Tuple[str, ...], int]]`.'] -Line 153: Unexpected errors ['tuples_type_compat.py:153:4 Assert type [70]: Expected `Sequence[Never]` but got `Sequence[Variable[T]]`.'] -""" diff --git a/conformance/results/pyre/tuples_type_form.toml b/conformance/results/pyre/tuples_type_form.toml deleted file mode 100644 index 750fc7954..000000000 --- a/conformance/results/pyre/tuples_type_form.toml +++ /dev/null @@ -1,17 +0,0 @@ -conformant = "Pass" -output = """ -tuples_type_form.py:12:0 Incompatible variable type [9]: t1 is declared to have type `Tuple[int]` but is used as type `Tuple[int, int]`. -tuples_type_form.py:14:0 Incompatible variable type [9]: t2 is declared to have type `Tuple[int, int]` but is used as type `Tuple[int]`. -tuples_type_form.py:15:0 Incompatible variable type [9]: t2 is declared to have type `Tuple[int, int]` but is used as type `Tuple[int, str]`. -tuples_type_form.py:25:0 Incompatible variable type [9]: t10 is declared to have type `Tuple[]` but is used as type `Tuple[int]`. -tuples_type_form.py:36:0 Incompatible variable type [9]: t20 is declared to have type `typing.Tuple[int, ...]` but is used as type `Tuple[int, int, int, str]`. -tuples_type_form.py:40:5 Invalid type [31]: Expression `tuple[(int, int, ...)]` is not a valid type. -tuples_type_form.py:41:5 Invalid type [31]: Expression `tuple[...]` is not a valid type. -tuples_type_form.py:42:5 Invalid type [31]: Expression `tuple[(..., int)]` is not a valid type. -tuples_type_form.py:43:5 Invalid type [31]: Expression `tuple[(int, ..., int)]` is not a valid type. -tuples_type_form.py:44:5 Invalid type [31]: Expression `tuple[(*tuple[str], ...)]` is not a valid type. -tuples_type_form.py:45:5 Invalid type [31]: Expression `tuple[(*tuple[(str, ...)], ...)]` is not a valid type. -""" -conformance_automated = "Pass" -errors_diff = """ -""" diff --git a/conformance/results/pyre/tuples_unpacked.toml b/conformance/results/pyre/tuples_unpacked.toml deleted file mode 100644 index b257b2595..000000000 --- a/conformance/results/pyre/tuples_unpacked.toml +++ /dev/null @@ -1,13 +0,0 @@ -conformant = "Pass" -notes = """ -""" -output = """ -tuples_unpacked.py:40:4 Invalid type [31]: Expression `tuple[(*tuple[(str, ...)], *tuple[(int, ...)])]` is not a valid type. -tuples_unpacked.py:41:4 Invalid type [31]: Expression `tuple[(*tuple[(str, *tuple[(str, ...)])], *tuple[(int, ...)])]` is not a valid type. -tuples_unpacked.py:51:8 Invalid type [31]: Expression `tuple[(*tuple[(str, ...)], *Ts)]` is not a valid type. -tuples_unpacked.py:59:5 Invalid type [31]: Expression `tuple[(typing.Unpack[tuple[(str, ...)]], typing.Unpack[tuple[(int, ...)]])]` is not a valid type. -tuples_unpacked.py:60:5 Invalid type [31]: Expression `tuple[(typing.Unpack[tuple[(str, typing.Unpack[tuple[(str, ...)]])]], typing.Unpack[tuple[(int, ...)]])]` is not a valid type. -""" -conformance_automated = "Pass" -errors_diff = """ -""" diff --git a/conformance/results/pyre/typeddicts_alt_syntax.toml b/conformance/results/pyre/typeddicts_alt_syntax.toml deleted file mode 100644 index 04257f60c..000000000 --- a/conformance/results/pyre/typeddicts_alt_syntax.toml +++ /dev/null @@ -1,17 +0,0 @@ -conformant = "Partial" -notes = """ -Does not report when name of TypedDict doesn't match assigned identifier name. -Does not support keyword-argument form of alternative syntax (deprecated in 3.11). -""" -output = """ -typeddicts_alt_syntax.py:23:16 Call error [29]: `object` is not a function. -typeddicts_alt_syntax.py:41:9 Call error [29]: `object` is not a function. -typeddicts_alt_syntax.py:43:8 Undefined or invalid type [11]: Annotation `Movie2` is not defined as a type. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 27: Expected 1 errors -Line 31: Expected 1 errors -Line 35: Expected 1 errors -Line 43: Unexpected errors ['typeddicts_alt_syntax.py:43:8 Undefined or invalid type [11]: Annotation `Movie2` is not defined as a type.'] -""" diff --git a/conformance/results/pyre/typeddicts_class_syntax.toml b/conformance/results/pyre/typeddicts_class_syntax.toml deleted file mode 100644 index 2dc3e9595..000000000 --- a/conformance/results/pyre/typeddicts_class_syntax.toml +++ /dev/null @@ -1,17 +0,0 @@ -conformant = "Partial" -notes = """ -Does not reject methods within TypedDict class. -Does not report when metaclass is provided. -Does not report when other keyword argument is provided. -Does not support generic TypedDict class. -""" -output = """ -typeddicts_class_syntax.py:49:0 Unexpected keyword [28]: Unexpected keyword argument `other` to call `object.__init_subclass__`. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 29: Expected 1 errors -Line 44: Expected 1 errors -Lines 33, 34: Expected error (tag 'method2') -Lines 38, 39: Expected error (tag 'method3') -""" diff --git a/conformance/results/pyre/typeddicts_extra_items.toml b/conformance/results/pyre/typeddicts_extra_items.toml deleted file mode 100644 index a1f9253c9..000000000 --- a/conformance/results/pyre/typeddicts_extra_items.toml +++ /dev/null @@ -1,143 +0,0 @@ -conformant = "Unsupported" -notes = """ -Not supported. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 215: Expected 1 errors -Line 222: Expected 1 errors -Line 242: Expected 1 errors -Line 256: Expected 1 errors -Line 257: Expected 1 errors -Line 268: Expected 1 errors -Lines 91, 92: Expected error (tag 'MovieC') -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 11: Unexpected errors ['typeddicts_extra_items.py:11:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] -Line 14: Unexpected errors ['typeddicts_extra_items.py:14:11 TypedDict initialization error [55]: TypedDict `Movie` has no field `novel_adaptation`.'] -Line 21: Unexpected errors ['typeddicts_extra_items.py:21:21 TypedDict initialization error [55]: TypedDict `MovieFunctional` has no field `novel_adaptation`.'] -Line 29: Unexpected errors ['typeddicts_extra_items.py:29:4 Assert type [70]: Expected `bool` but got `str`.', 'typeddicts_extra_items.py:29:22 TypedDict accessed with a missing key [27]: TypedDict `Movie` has no key `novel_adaptation`.'] -Line 33: Unexpected errors ['typeddicts_extra_items.py:33:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] -Line 40: Unexpected errors ['typeddicts_extra_items.py:40:20 TypedDict initialization error [55]: TypedDict `InheritedMovie` has no field `other_extra_key`.'] -Line 55: Unexpected errors ['typeddicts_extra_items.py:55:0 Unexpected keyword [28]: Unexpected keyword argument `closed` to call `object.__init_subclass__`.'] -Line 64: Unexpected errors ['typeddicts_extra_items.py:64:0 Unexpected keyword [28]: Unexpected keyword argument `closed` to call `object.__init_subclass__`.'] -Line 70: Unexpected errors ['typeddicts_extra_items.py:70:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] -Line 82: Unexpected errors ['typeddicts_extra_items.py:82:0 Unexpected keyword [28]: Unexpected keyword argument `closed` to call `object.__init_subclass__`.'] -Line 88: Unexpected errors ['typeddicts_extra_items.py:88:0 Unexpected keyword [28]: Unexpected keyword argument `closed` to call `object.__init_subclass__`.'] -Line 100: Unexpected errors ['typeddicts_extra_items.py:100:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] -Line 103: Unexpected errors ['typeddicts_extra_items.py:103:0 Unexpected keyword [28]: Unexpected keyword argument `closed` to call `object.__init_subclass__`.'] -Line 106: Unexpected errors ['typeddicts_extra_items.py:106:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] -Line 124: Unexpected errors ['typeddicts_extra_items.py:124:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] -Line 129: Unexpected errors ['typeddicts_extra_items.py:129:14 TypedDict accessed with a missing key [27]: TypedDict `MovieEI` has no key `year`.'] -Line 137: Unexpected errors ['typeddicts_extra_items.py:137:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] -Line 144: Unexpected errors ['typeddicts_extra_items.py:144:0 Unexpected keyword [28]: Unexpected keyword argument `year` to call `unpack_extra`.'] -Line 149: Unexpected errors ['typeddicts_extra_items.py:149:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] -Line 152: Unexpected errors ['typeddicts_extra_items.py:152:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] -Line 155: Unexpected errors ['typeddicts_extra_items.py:155:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] -Line 165: Unexpected errors ['typeddicts_extra_items.py:165:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] -Line 171: Unexpected errors ['typeddicts_extra_items.py:171:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] -Line 181: Unexpected errors ['typeddicts_extra_items.py:181:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] -Line 193: Unexpected errors ['typeddicts_extra_items.py:193:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] -Line 210: Unexpected errors ['typeddicts_extra_items.py:210:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] -Line 217: Unexpected errors ['typeddicts_extra_items.py:217:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] -Line 228: Unexpected errors ['typeddicts_extra_items.py:228:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] -Line 231: Unexpected errors ['typeddicts_extra_items.py:231:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] -Line 235: Unexpected errors ['typeddicts_extra_items.py:235:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] -Line 248: Unexpected errors ['typeddicts_extra_items.py:248:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] -Line 251: Unexpected errors ['typeddicts_extra_items.py:251:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] -Line 254: Unexpected errors ['typeddicts_extra_items.py:254:27 TypedDict initialization error [55]: TypedDict `MovieExtraInt` has no field `year`.'] -Line 255: Unexpected errors ['typeddicts_extra_items.py:255:27 TypedDict initialization error [55]: TypedDict `MovieExtraStr` has no field `description`.'] -Line 266: Unexpected errors ['typeddicts_extra_items.py:266:28 TypedDict initialization error [55]: TypedDict `MovieExtraInt` has no field `year`.'] -Line 280: Unexpected errors ['typeddicts_extra_items.py:280:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] -Line 284: Unexpected errors ['typeddicts_extra_items.py:284:0 Unexpected keyword [28]: Unexpected keyword argument `year` to call `ExtraMovie.__init__`.'] -Line 289: Unexpected errors ['typeddicts_extra_items.py:289:0 Unexpected keyword [28]: Unexpected keyword argument `closed` to call `object.__init_subclass__`.'] -Line 299: Unexpected errors ['typeddicts_extra_items.py:299:28 TypedDict initialization error [55]: TypedDict `MovieExtraStr` has no field `summary`.'] -Line 300: Unexpected errors ['typeddicts_extra_items.py:300:0 Incompatible variable type [9]: str_mapping is declared to have type `Mapping[str, str]` but is used as type `MovieExtraStr`.'] -Line 302: Unexpected errors ['typeddicts_extra_items.py:302:28 TypedDict initialization error [55]: TypedDict `MovieExtraInt` has no field `year`.'] -Line 304: Unexpected errors ['typeddicts_extra_items.py:304:0 Incompatible variable type [9]: int_str_mapping is declared to have type `Mapping[str, Union[int, str]]` but is used as type `MovieExtraInt`.'] -Line 310: Unexpected errors ['typeddicts_extra_items.py:310:4 Assert type [70]: Expected `List[Tuple[str, Union[int, str]]]` but got `List[Tuple[str, object]]`.'] -Line 311: Unexpected errors ['typeddicts_extra_items.py:311:4 Assert type [70]: Expected `List[Union[int, str]]` but got `List[object]`.'] -Line 319: Unexpected errors ['typeddicts_extra_items.py:319:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] -Line 326: Unexpected errors ['typeddicts_extra_items.py:326:4 Incompatible variable type [9]: v is declared to have type `Dict[str, int]` but is used as type `IntDict`.'] -Line 329: Unexpected errors ['typeddicts_extra_items.py:329:40 TypedDict initialization error [55]: TypedDict `IntDictWithNum` has no field `bar`.'] -Line 330: Unexpected errors ['typeddicts_extra_items.py:330:0 Incompatible variable type [9]: regular_dict is declared to have type `Dict[str, int]` but is used as type `IntDictWithNum`.'] -Line 337: Unexpected errors ['typeddicts_extra_items.py:337:0 Undefined attribute [16]: `IntDictWithNum` has no attribute `clear`.'] -Line 339: Unexpected errors ['typeddicts_extra_items.py:339:0 Assert type [70]: Expected `Tuple[str, int]` but got `typing.Any`.', 'typeddicts_extra_items.py:339:12 Undefined attribute [16]: `IntDictWithNum` has no attribute `popitem`.'] -Line 342: Unexpected errors ["typeddicts_extra_items.py:342:26 TypedDict accessed with a non-literal [26]: TypedDict key must be a string literal. Expected one of ('num')."] -Line 343: Unexpected errors ["typeddicts_extra_items.py:343:30 TypedDict accessed with a non-literal [26]: TypedDict key must be a string literal. Expected one of ('num')."] -""" -output = """ -typeddicts_extra_items.py:11:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. -typeddicts_extra_items.py:14:11 TypedDict initialization error [55]: TypedDict `Movie` has no field `novel_adaptation`. -typeddicts_extra_items.py:15:11 TypedDict initialization error [55]: TypedDict `Movie` has no field `year`. -typeddicts_extra_items.py:21:21 TypedDict initialization error [55]: TypedDict `MovieFunctional` has no field `novel_adaptation`. -typeddicts_extra_items.py:22:21 TypedDict initialization error [55]: TypedDict `MovieFunctional` has no field `year`. -typeddicts_extra_items.py:29:4 Assert type [70]: Expected `bool` but got `str`. -typeddicts_extra_items.py:29:22 TypedDict accessed with a missing key [27]: TypedDict `Movie` has no key `novel_adaptation`. -typeddicts_extra_items.py:33:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. -typeddicts_extra_items.py:39:20 TypedDict initialization error [55]: Expected type `int` for `InheritedMovie` field `year` but got `None`. -typeddicts_extra_items.py:40:20 TypedDict initialization error [55]: TypedDict `InheritedMovie` has no field `other_extra_key`. -typeddicts_extra_items.py:49:0 Unexpected keyword [28]: Unexpected keyword argument `closed` to call `object.__init_subclass__`. -typeddicts_extra_items.py:55:0 Unexpected keyword [28]: Unexpected keyword argument `closed` to call `object.__init_subclass__`. -typeddicts_extra_items.py:64:0 Unexpected keyword [28]: Unexpected keyword argument `closed` to call `object.__init_subclass__`. -typeddicts_extra_items.py:67:0 Unexpected keyword [28]: Unexpected keyword argument `closed` to call `object.__init_subclass__`. -typeddicts_extra_items.py:70:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. -typeddicts_extra_items.py:73:0 Unexpected keyword [28]: Unexpected keyword argument `closed` to call `object.__init_subclass__`. -typeddicts_extra_items.py:82:0 Unexpected keyword [28]: Unexpected keyword argument `closed` to call `object.__init_subclass__`. -typeddicts_extra_items.py:88:0 Unexpected keyword [28]: Unexpected keyword argument `closed` to call `object.__init_subclass__`. -typeddicts_extra_items.py:100:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. -typeddicts_extra_items.py:103:0 Unexpected keyword [28]: Unexpected keyword argument `closed` to call `object.__init_subclass__`. -typeddicts_extra_items.py:106:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. -typeddicts_extra_items.py:109:0 Unexpected keyword [28]: Unexpected keyword argument `closed` to call `object.__init_subclass__`. -typeddicts_extra_items.py:114:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. -typeddicts_extra_items.py:117:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. -typeddicts_extra_items.py:124:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. -typeddicts_extra_items.py:128:4 Invalid TypedDict operation [54]: Cannot delete required field `name` from TypedDict `MovieEI`. -typeddicts_extra_items.py:129:14 TypedDict accessed with a missing key [27]: TypedDict `MovieEI` has no key `year`. -typeddicts_extra_items.py:137:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. -typeddicts_extra_items.py:143:0 Unexpected keyword [28]: Unexpected keyword argument `year` to call `unpack_no_extra`. -typeddicts_extra_items.py:144:0 Unexpected keyword [28]: Unexpected keyword argument `year` to call `unpack_extra`. -typeddicts_extra_items.py:149:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. -typeddicts_extra_items.py:152:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. -typeddicts_extra_items.py:155:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. -typeddicts_extra_items.py:165:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. -typeddicts_extra_items.py:171:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. -typeddicts_extra_items.py:174:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. -typeddicts_extra_items.py:181:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. -typeddicts_extra_items.py:193:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. -typeddicts_extra_items.py:210:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. -typeddicts_extra_items.py:217:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. -typeddicts_extra_items.py:228:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. -typeddicts_extra_items.py:231:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. -typeddicts_extra_items.py:235:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. -typeddicts_extra_items.py:248:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. -typeddicts_extra_items.py:251:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. -typeddicts_extra_items.py:254:27 TypedDict initialization error [55]: TypedDict `MovieExtraInt` has no field `year`. -typeddicts_extra_items.py:255:27 TypedDict initialization error [55]: TypedDict `MovieExtraStr` has no field `description`. -typeddicts_extra_items.py:266:28 TypedDict initialization error [55]: TypedDict `MovieExtraInt` has no field `year`. -typeddicts_extra_items.py:278:0 Unexpected keyword [28]: Unexpected keyword argument `year` to call `NonClosedMovie.__init__`. -typeddicts_extra_items.py:280:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. -typeddicts_extra_items.py:284:0 Unexpected keyword [28]: Unexpected keyword argument `year` to call `ExtraMovie.__init__`. -typeddicts_extra_items.py:285:0 Unexpected keyword [28]: Unexpected keyword argument `language` to call `ExtraMovie.__init__`. -typeddicts_extra_items.py:289:0 Unexpected keyword [28]: Unexpected keyword argument `closed` to call `object.__init_subclass__`. -typeddicts_extra_items.py:293:0 Unexpected keyword [28]: Unexpected keyword argument `year` to call `ClosedMovie.__init__`. -typeddicts_extra_items.py:299:28 TypedDict initialization error [55]: TypedDict `MovieExtraStr` has no field `summary`. -typeddicts_extra_items.py:300:0 Incompatible variable type [9]: str_mapping is declared to have type `Mapping[str, str]` but is used as type `MovieExtraStr`. -typeddicts_extra_items.py:302:28 TypedDict initialization error [55]: TypedDict `MovieExtraInt` has no field `year`. -typeddicts_extra_items.py:303:0 Incompatible variable type [9]: int_mapping is declared to have type `Mapping[str, int]` but is used as type `MovieExtraInt`. -typeddicts_extra_items.py:304:0 Incompatible variable type [9]: int_str_mapping is declared to have type `Mapping[str, Union[int, str]]` but is used as type `MovieExtraInt`. -typeddicts_extra_items.py:310:4 Assert type [70]: Expected `List[Tuple[str, Union[int, str]]]` but got `List[Tuple[str, object]]`. -typeddicts_extra_items.py:311:4 Assert type [70]: Expected `List[Union[int, str]]` but got `List[object]`. -typeddicts_extra_items.py:319:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. -typeddicts_extra_items.py:326:4 Incompatible variable type [9]: v is declared to have type `Dict[str, int]` but is used as type `IntDict`. -typeddicts_extra_items.py:329:40 TypedDict initialization error [55]: TypedDict `IntDictWithNum` has no field `bar`. -typeddicts_extra_items.py:330:0 Incompatible variable type [9]: regular_dict is declared to have type `Dict[str, int]` but is used as type `IntDictWithNum`. -typeddicts_extra_items.py:337:0 Undefined attribute [16]: `IntDictWithNum` has no attribute `clear`. -typeddicts_extra_items.py:339:0 Assert type [70]: Expected `Tuple[str, int]` but got `typing.Any`. -typeddicts_extra_items.py:339:12 Undefined attribute [16]: `IntDictWithNum` has no attribute `popitem`. -typeddicts_extra_items.py:342:26 TypedDict accessed with a non-literal [26]: TypedDict key must be a string literal. Expected one of ('num'). -typeddicts_extra_items.py:343:30 TypedDict accessed with a non-literal [26]: TypedDict key must be a string literal. Expected one of ('num'). -typeddicts_extra_items.py:352:4 Incompatible variable type [9]: int_dict is declared to have type `IntDict` but is used as type `Dict[str, int]`. -""" diff --git a/conformance/results/pyre/typeddicts_final.toml b/conformance/results/pyre/typeddicts_final.toml deleted file mode 100644 index 499949307..000000000 --- a/conformance/results/pyre/typeddicts_final.toml +++ /dev/null @@ -1,11 +0,0 @@ -conformant = "Partial" -notes = """ -Does not handle value with literal type as index to TypedDict object. -""" -output = """ -typeddicts_final.py:26:17 Incompatible parameter type [6]: In call `TypedDictionary.__getitem__`, for 1st positional argument, expected `typing_extensions.Literal['name']` but got `Union[typing_extensions.Literal['name'], typing_extensions.Literal['year']]`. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 26: Unexpected errors ["typeddicts_final.py:26:17 Incompatible parameter type [6]: In call `TypedDictionary.__getitem__`, for 1st positional argument, expected `typing_extensions.Literal['name']` but got `Union[typing_extensions.Literal['name'], typing_extensions.Literal['year']]`."] -""" diff --git a/conformance/results/pyre/typeddicts_inheritance.toml b/conformance/results/pyre/typeddicts_inheritance.toml deleted file mode 100644 index 5ac846afe..000000000 --- a/conformance/results/pyre/typeddicts_inheritance.toml +++ /dev/null @@ -1,11 +0,0 @@ -conformant = "Pass" -notes = """ -""" -output = """ -typeddicts_inheritance.py:44:30 Invalid inheritance [39]: `NonTypedDict` is not a valid parent class for a typed dictionary. Expected a typed dictionary or typing.Generic. -typeddicts_inheritance.py:54:0 Inconsistent override [15]: `x` overrides attribute defined in `X1` inconsistently. Type `int` is not a subtype of the overridden attribute `str`. -typeddicts_inheritance.py:65:0 Invalid inheritance [39]: Field `x` has type `int` in base class `X2` and type `str` in base class `Y2`. -""" -conformance_automated = "Pass" -errors_diff = """ -""" diff --git a/conformance/results/pyre/typeddicts_operations.toml b/conformance/results/pyre/typeddicts_operations.toml deleted file mode 100644 index e8b1cf658..000000000 --- a/conformance/results/pyre/typeddicts_operations.toml +++ /dev/null @@ -1,19 +0,0 @@ -conformant = "Pass" -notes = """ -""" -output = """ -typeddicts_operations.py:22:16 Invalid TypedDict operation [54]: Expected `str` to be assigned to `Movie` field `name` but got `int`. -typeddicts_operations.py:23:16 Invalid TypedDict operation [54]: Expected `int` to be assigned to `Movie` field `year` but got `str`. -typeddicts_operations.py:24:6 TypedDict accessed with a missing key [27]: TypedDict `Movie` has no key `other`. -typeddicts_operations.py:26:12 TypedDict accessed with a missing key [27]: TypedDict `Movie` has no key `other`. -typeddicts_operations.py:28:8 TypedDict initialization error [55]: Missing required field `year` for TypedDict `Movie`. -typeddicts_operations.py:29:8 TypedDict initialization error [55]: Expected type `int` for `Movie` field `year` but got `float`. -typeddicts_operations.py:32:8 TypedDict initialization error [55]: TypedDict `Movie` has no field `other`. -typeddicts_operations.py:37:4 Incompatible variable type [9]: movie is declared to have type `Movie` but is used as type `Dict[str, Union[int, str]]`. -typeddicts_operations.py:47:0 Undefined attribute [16]: `Movie` has no attribute `clear`. -typeddicts_operations.py:49:0 Invalid TypedDict operation [54]: Cannot delete required field `name` from TypedDict `Movie`. -typeddicts_operations.py:62:0 Undefined attribute [16]: `MovieOptional` has no attribute `clear`. -""" -conformance_automated = "Pass" -errors_diff = """ -""" diff --git a/conformance/results/pyre/typeddicts_readonly.toml b/conformance/results/pyre/typeddicts_readonly.toml deleted file mode 100644 index 2af32a98d..000000000 --- a/conformance/results/pyre/typeddicts_readonly.toml +++ /dev/null @@ -1,12 +0,0 @@ -conformant = "Pass" -output = """ -typeddicts_readonly.py:24:16 Invalid TypedDict operation [54]: Cannot write to `Band` read-only field `members`. -typeddicts_readonly.py:36:16 Invalid TypedDict operation [54]: Cannot write to `Band2` read-only field `members`. -typeddicts_readonly.py:50:14 Invalid TypedDict operation [54]: Cannot write to `Movie1` read-only field `title`. -typeddicts_readonly.py:51:13 Invalid TypedDict operation [54]: Cannot write to `Movie1` read-only field `year`. -typeddicts_readonly.py:60:14 Invalid TypedDict operation [54]: Cannot write to `Movie2` read-only field `title`. -typeddicts_readonly.py:61:13 Invalid TypedDict operation [54]: Cannot write to `Movie2` read-only field `year`. -""" -conformance_automated = "Pass" -errors_diff = """ -""" diff --git a/conformance/results/pyre/typeddicts_readonly_consistency.toml b/conformance/results/pyre/typeddicts_readonly_consistency.toml deleted file mode 100644 index 21056412c..000000000 --- a/conformance/results/pyre/typeddicts_readonly_consistency.toml +++ /dev/null @@ -1,13 +0,0 @@ -conformant = "Pass" -output = """ -typeddicts_readonly_consistency.py:37:4 Incompatible variable type [9]: v3 is declared to have type `B1` but is used as type `A1`. -typeddicts_readonly_consistency.py:38:4 Incompatible variable type [9]: v4 is declared to have type `B1` but is used as type `C1`. -typeddicts_readonly_consistency.py:40:4 Incompatible variable type [9]: v5 is declared to have type `C1` but is used as type `A1`. -typeddicts_readonly_consistency.py:81:4 Incompatible variable type [9]: v3 is declared to have type `B2` but is used as type `A2`. -typeddicts_readonly_consistency.py:82:4 Incompatible variable type [9]: v4 is declared to have type `B2` but is used as type `C2`. -typeddicts_readonly_consistency.py:84:4 Incompatible variable type [9]: v5 is declared to have type `C2` but is used as type `A2`. -typeddicts_readonly_consistency.py:85:4 Incompatible variable type [9]: v6 is declared to have type `C2` but is used as type `B2`. -""" -conformance_automated = "Pass" -errors_diff = """ -""" diff --git a/conformance/results/pyre/typeddicts_readonly_inheritance.toml b/conformance/results/pyre/typeddicts_readonly_inheritance.toml deleted file mode 100644 index abf96bda2..000000000 --- a/conformance/results/pyre/typeddicts_readonly_inheritance.toml +++ /dev/null @@ -1,27 +0,0 @@ -conformant = "Unsupported" -output = """ -typeddicts_readonly_inheritance.py:36:13 Invalid TypedDict operation [54]: Cannot write to `Album2` read-only field `name`. -typeddicts_readonly_inheritance.py:47:0 Inconsistent override [15]: `alt` overrides attribute defined in `AlbumCollection` inconsistently. Type `typing.List[str]` is not a subtype of the overridden attribute `typing.List[typing.Union[int, str]]`. -typeddicts_readonly_inheritance.py:65:18 TypedDict initialization error [55]: Missing required field `name` for TypedDict `RequiredName`. -typeddicts_readonly_inheritance.py:82:13 Invalid TypedDict operation [54]: Expected `str` to be assigned to `User` field `ident` but got `int`. -typeddicts_readonly_inheritance.py:83:4 TypedDict initialization error [55]: Expected type `str` for `User` field `ident` but got `int`. -typeddicts_readonly_inheritance.py:84:4 TypedDict initialization error [55]: Missing required field `ident` for TypedDict `User`. -typeddicts_readonly_inheritance.py:93:0 Inconsistent override [15]: `a` overrides attribute defined in `F1` inconsistently. Type `int` is not a subtype of the overridden attribute `int`. -typeddicts_readonly_inheritance.py:97:0 Inconsistent override [15]: `a` overrides attribute defined in `F1` inconsistently. Type `int` is not a subtype of the overridden attribute `int`. -typeddicts_readonly_inheritance.py:105:0 Inconsistent override [15]: `c` overrides attribute defined in `F1` inconsistently. Type `int` is not a subtype of the overridden attribute `int`. -typeddicts_readonly_inheritance.py:119:0 Invalid inheritance [39]: Field `x` has type `int` in base class `TD_A1` and type `float` in base class `TD_A2`. -typeddicts_readonly_inheritance.py:119:0 Invalid inheritance [39]: Field `y` has type `int` in base class `TD_A1` and type `float` in base class `TD_A2`. -typeddicts_readonly_inheritance.py:132:0 Invalid inheritance [39]: `y` is a required field in base class `TD_B1` and a non-required field in base class `TD_B2` (because of `total=False`). -typeddicts_readonly_inheritance.py:132:0 Invalid inheritance [39]: `x` is a required field in base class `TD_B2` and a non-required field in base class `TD_B1` (because of `total=False`). -""" -conformance_automated = "Fail" -errors_diff = """ -Line 50: Expected 1 errors -Line 94: Expected 1 errors -Line 98: Expected 1 errors -Line 106: Expected 1 errors -Line 47: Unexpected errors ['typeddicts_readonly_inheritance.py:47:0 Inconsistent override [15]: `alt` overrides attribute defined in `AlbumCollection` inconsistently. Type `typing.List[str]` is not a subtype of the overridden attribute `typing.List[typing.Union[int, str]]`.'] -Line 93: Unexpected errors ['typeddicts_readonly_inheritance.py:93:0 Inconsistent override [15]: `a` overrides attribute defined in `F1` inconsistently. Type `int` is not a subtype of the overridden attribute `int`.'] -Line 97: Unexpected errors ['typeddicts_readonly_inheritance.py:97:0 Inconsistent override [15]: `a` overrides attribute defined in `F1` inconsistently. Type `int` is not a subtype of the overridden attribute `int`.'] -Line 105: Unexpected errors ['typeddicts_readonly_inheritance.py:105:0 Inconsistent override [15]: `c` overrides attribute defined in `F1` inconsistently. Type `int` is not a subtype of the overridden attribute `int`.'] -""" diff --git a/conformance/results/pyre/typeddicts_readonly_kwargs.toml b/conformance/results/pyre/typeddicts_readonly_kwargs.toml deleted file mode 100644 index 0f1dddfb2..000000000 --- a/conformance/results/pyre/typeddicts_readonly_kwargs.toml +++ /dev/null @@ -1,7 +0,0 @@ -conformant = "Pass" -output = """ -typeddicts_readonly_kwargs.py:33:21 Invalid TypedDict operation [54]: Cannot write to `ReadOnlyArgs` read-only field `key1`. -""" -conformance_automated = "Pass" -errors_diff = """ -""" diff --git a/conformance/results/pyre/typeddicts_readonly_update.toml b/conformance/results/pyre/typeddicts_readonly_update.toml deleted file mode 100644 index 46846324a..000000000 --- a/conformance/results/pyre/typeddicts_readonly_update.toml +++ /dev/null @@ -1,7 +0,0 @@ -conformant = "Pass" -output = """ -typeddicts_readonly_update.py:23:10 Incompatible parameter type [6]: In call `TypedDictionary.update`, for 1st positional argument, cannot update read-only fields of `A`. -""" -conformance_automated = "Pass" -errors_diff = """ -""" diff --git a/conformance/results/pyre/typeddicts_required.toml b/conformance/results/pyre/typeddicts_required.toml deleted file mode 100644 index 923f2b19e..000000000 --- a/conformance/results/pyre/typeddicts_required.toml +++ /dev/null @@ -1,17 +0,0 @@ -conformant = "Partial" -notes = """ -Does not reject use of `Required` in function parameter annotation. -Does not reject nested use of `Required` in type annotation. -Does not support recursive TypedDict definitions. -Incorrectly complains about uninitialized attributes on TypedDict definitions. -Incorrectly generates "attribute not initialized" errors for TypedDict fields. -""" -output = """ -typeddicts_required.py:12:4 Uninitialized attribute [13]: Attribute `x` is declared in class `NotTypedDict` to have type `Required[int]` but is never initialized. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 16: Expected 1 errors -Line 59: Expected 1 errors -Line 60: Expected 1 errors -""" diff --git a/conformance/results/pyre/typeddicts_type_consistency.toml b/conformance/results/pyre/typeddicts_type_consistency.toml deleted file mode 100644 index 124f691f9..000000000 --- a/conformance/results/pyre/typeddicts_type_consistency.toml +++ /dev/null @@ -1,24 +0,0 @@ -conformant = "Partial" -notes = """ -Does not reject assignment of TypedDict with missing key. -Does not return non-Optional value from `get` method for required key. -Does not properly handle nested TypedDicts. -""" -output = """ -typeddicts_type_consistency.py:21:0 Incompatible variable type [9]: a1 is declared to have type `A1` but is used as type `B1`. -typeddicts_type_consistency.py:38:0 Incompatible variable type [9]: a2 is declared to have type `A2` but is used as type `B2`. -typeddicts_type_consistency.py:69:11 TypedDict initialization error [55]: TypedDict `A3` has no field `y`. -typeddicts_type_consistency.py:76:0 Incompatible variable type [9]: d1 is declared to have type `Dict[str, int]` but is used as type `B3`. -typeddicts_type_consistency.py:77:0 Incompatible variable type [9]: d2 is declared to have type `Dict[str, object]` but is used as type `B3`. -typeddicts_type_consistency.py:78:0 Incompatible variable type [9]: d3 is declared to have type `Dict[typing.Any, typing.Any]` but is used as type `B3`. -typeddicts_type_consistency.py:82:0 Incompatible variable type [9]: m1 is declared to have type `Mapping[str, int]` but is used as type `B3`. -typeddicts_type_consistency.py:101:0 Incompatible variable type [9]: name3 is declared to have type `str` but is used as type `Optional[str]`. -typeddicts_type_consistency.py:107:0 Incompatible variable type [9]: age4 is declared to have type `int` but is used as type `Union[str, int]`. -typeddicts_type_consistency.py:126:41 TypedDict initialization error [55]: Expected type `str` for `Inner1` field `inner_key` but got `int`. -typeddicts_type_consistency.py:152:0 Incompatible variable type [9]: o4 is declared to have type `Outer3` but is used as type `Outer2`. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 65: Expected 1 errors -Line 152: Unexpected errors ['typeddicts_type_consistency.py:152:0 Incompatible variable type [9]: o4 is declared to have type `Outer3` but is used as type `Outer2`.'] -""" diff --git a/conformance/results/pyre/typeddicts_usage.toml b/conformance/results/pyre/typeddicts_usage.toml deleted file mode 100644 index 1699d6be3..000000000 --- a/conformance/results/pyre/typeddicts_usage.toml +++ /dev/null @@ -1,15 +0,0 @@ -conformant = "Pass" -notes = """ -Does not report errant use of TypedDict in `isinstance` call. -Does not reject use of TypedDict as TypeVar bound. -""" -output = """ -typeddicts_usage.py:23:6 TypedDict accessed with a missing key [27]: TypedDict `Movie` has no key `director`. -typeddicts_usage.py:24:16 Invalid TypedDict operation [54]: Expected `int` to be assigned to `Movie` field `year` but got `str`. -typeddicts_usage.py:28:16 TypedDict initialization error [55]: Missing required field `name` for TypedDict `Movie`. -typeddicts_usage.py:35:21 TypedDict used in isinstance [71]: TypedDict classes may not be used for instance checks. -typeddicts_usage.py:40:0 Undefined or invalid type [11]: Annotation `TypedDict` is not defined as a type. -""" -conformance_automated = "Pass" -errors_diff = """ -""" diff --git a/conformance/results/pyre/version.toml b/conformance/results/pyre/version.toml deleted file mode 100644 index 9c24e3412..000000000 --- a/conformance/results/pyre/version.toml +++ /dev/null @@ -1,2 +0,0 @@ -version = "pyre 0.9.25" -test_duration = 10.27 diff --git a/conformance/results/pyrefly/directives_deprecated.toml b/conformance/results/pyrefly/directives_deprecated.toml index 2b3718261..913e327b5 100644 --- a/conformance/results/pyrefly/directives_deprecated.toml +++ b/conformance/results/pyrefly/directives_deprecated.toml @@ -5,8 +5,6 @@ Line 18: Expected 1 errors Line 24: Expected 1 errors Line 25: Expected 1 errors Line 30: Expected 1 errors -Line 41: Expected 1 errors -Line 42: Expected 1 errors Line 44: Expected 1 errors Line 47: Expected 1 errors Line 48: Expected 1 errors @@ -15,4 +13,6 @@ Line 69: Expected 1 errors Line 98: Expected 1 errors """ output = """ +ERROR directives_deprecated.py:41:5-13: `+` is not supported between `Spam` and `Literal[1]` [unsupported-operation] +ERROR directives_deprecated.py:42:1-10: `+=` is not supported between `Spam` and `Literal[1]` [unsupported-operation] """ diff --git a/conformance/results/pyrefly/enums_member_values.toml b/conformance/results/pyrefly/enums_member_values.toml index 135c7a1b4..e90c4678c 100644 --- a/conformance/results/pyrefly/enums_member_values.toml +++ b/conformance/results/pyrefly/enums_member_values.toml @@ -8,7 +8,7 @@ ERROR enums_member_values.py:22:12-41: assert_type(int, Literal[1]) failed [asse ERROR enums_member_values.py:26:16-50: assert_type(int, Literal[1, 3]) failed [assert-type] ERROR enums_member_values.py:30:16-51: assert_type(int, Literal[1, 2, 3]) failed [assert-type] ERROR enums_member_values.py:54:12-46: assert_type(Any, Literal[1]) failed [assert-type] -ERROR enums_member_values.py:68:12-42: assert_type(auto, Literal[1]) failed [assert-type] +ERROR enums_member_values.py:68:12-42: assert_type(int, Literal[1]) failed [assert-type] ERROR enums_member_values.py:78:5-10: Enum member `GREEN` has type `str`, must match the `_value_` attribute annotation of `int` [bad-assignment] ERROR enums_member_values.py:85:24-29: `int` is not assignable to attribute `_value_` with type `str` [bad-assignment] """ diff --git a/conformance/results/pyrefly/overloads_definitions.toml b/conformance/results/pyrefly/overloads_definitions.toml index 302bc4a2c..6894d7606 100644 --- a/conformance/results/pyrefly/overloads_definitions.toml +++ b/conformance/results/pyrefly/overloads_definitions.toml @@ -1,16 +1,9 @@ -conformant = "Partial" -notes = """ -Does not restrict some decorators to implementation -Does not require some decorators that need to appear on every overload -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 49: Unexpected errors ['Overloaded function must have an implementation [invalid-overload]'] """ output = """ ERROR overloads_definitions.py:16:5-10: Overloaded function needs at least two @overload declarations [invalid-overload] ERROR overloads_definitions.py:28:5-10: Overloaded function must have an implementation [invalid-overload] -ERROR overloads_definitions.py:49:9-14: Overloaded function must have an implementation [invalid-overload] ERROR overloads_definitions.py:59:9-21: Overloaded function must have an implementation [invalid-overload] ERROR overloads_definitions.py:81:9-14: If `@staticmethod` is present on any overload or the implementation, it should be on every overload and the implementation. [invalid-overload] ERROR overloads_definitions.py:90:9-14: If `@classmethod` is present on any overload or the implementation, it should be on every overload and the implementation. [invalid-overload] diff --git a/conformance/results/pyrefly/overloads_evaluation.toml b/conformance/results/pyrefly/overloads_evaluation.toml index 2d0abc7cd..22aa1792c 100644 --- a/conformance/results/pyrefly/overloads_evaluation.toml +++ b/conformance/results/pyrefly/overloads_evaluation.toml @@ -1,22 +1,9 @@ -conformant = "Partial" -notes = """ -Does not exclude overloads based on arity first -Does not perform argument expansion -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 234: Unexpected errors ['assert_type(str, int) failed [assert-type]'] -Line 264: Unexpected errors ['assert_type(list[int], Any) failed [assert-type]'] -Line 280: Unexpected errors ['assert_type(list[int], Any) failed [assert-type]'] -Line 345: Unexpected errors ['assert_type(list[int], Any) failed [assert-type]'] """ output = """ ERROR overloads_evaluation.py:38:11-13: No matching overload found for function `example1_1` [no-matching-overload] ERROR overloads_evaluation.py:46:11-17: No matching overload found for function `example1_1` [no-matching-overload] ERROR overloads_evaluation.py:51:11-14: No matching overload found for function `example1_1` [no-matching-overload] ERROR overloads_evaluation.py:115:13-22: No matching overload found for function `example2` [no-matching-overload] -ERROR overloads_evaluation.py:234:16-27: assert_type(str, int) failed [assert-type] -ERROR overloads_evaluation.py:264:16-27: assert_type(list[int], Any) failed [assert-type] -ERROR overloads_evaluation.py:280:16-34: assert_type(list[int], Any) failed [assert-type] -ERROR overloads_evaluation.py:345:16-27: assert_type(list[int], Any) failed [assert-type] """ diff --git a/conformance/results/pyrefly/typeddicts_inheritance.toml b/conformance/results/pyrefly/typeddicts_inheritance.toml index 1e3dd7270..0da000466 100644 --- a/conformance/results/pyrefly/typeddicts_inheritance.toml +++ b/conformance/results/pyrefly/typeddicts_inheritance.toml @@ -1,12 +1,8 @@ -conformant = "Partial" -notes = """ -Does not check against inconsistent multiple inheritance -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 65: Expected 1 errors """ output = """ ERROR typeddicts_inheritance.py:44:7-19: `NonTypedDict` is not a typed dictionary. Typed dictionary definitions may only extend other typed dictionaries. [invalid-inheritance] ERROR typeddicts_inheritance.py:55:4-5: Class member `Y1.x` overrides parent class `X1` in an inconsistent manner [bad-override] +ERROR typeddicts_inheritance.py:65:7-11: Field `x` has inconsistent types inherited from multiple base classes [inconsistent-inheritance] """ diff --git a/conformance/results/pyrefly/version.toml b/conformance/results/pyrefly/version.toml index 5542fe39a..b7e819192 100644 --- a/conformance/results/pyrefly/version.toml +++ b/conformance/results/pyrefly/version.toml @@ -1 +1 @@ -version = "pyrefly 0.36.2" +version = "pyrefly 0.37.0" diff --git a/conformance/results/results.html b/conformance/results/results.html index 7a6576212..c632a1172 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -162,14 +162,12 @@

    Python Type System Conformance Test Results

    - - - @@ -177,26 +175,22 @@

    Python Type System Conformance Test Results

    - - - - @@ -205,9 +199,8 @@

    Python Type System Conformance Test Results

    - - @@ -215,12 +208,10 @@

    Python Type System Conformance Test Results

    - - @@ -229,71 +220,61 @@

    Python Type System Conformance Test Results

    - - - - - - - - - - - @@ -302,131 +283,112 @@

    Python Type System Conformance Test Results

    - - - - - - - - - - - - - - - - - - - @@ -435,60 +397,52 @@

    Python Type System Conformance Test Results

    - - - - - - - - - - @@ -497,50 +451,43 @@

    Python Type System Conformance Test Results

    - - - - - - - - @@ -548,30 +495,26 @@

    Python Type System Conformance Test Results

    - - - - - @@ -580,36 +523,31 @@

    Python Type System Conformance Test Results

    - - - - - - @@ -618,12 +556,10 @@

    Python Type System Conformance Test Results

    - - @@ -632,12 +568,10 @@

    Python Type System Conformance Test Results

    - - @@ -646,29 +580,25 @@

    Python Type System Conformance Test Results

    - - - - - @@ -677,68 +607,59 @@

    Python Type System Conformance Test Results

    - - - - - - - - - - - @@ -746,60 +667,52 @@

    Python Type System Conformance Test Results

    - - - - + - - - + - - - - - @@ -808,33 +721,28 @@

    Python Type System Conformance Test Results

    - - - - - @@ -843,92 +751,79 @@

    Python Type System Conformance Test Results

    - - - - - - - - - - - - - - @@ -937,33 +832,28 @@

    Python Type System Conformance Test Results

    - - - - - @@ -972,43 +862,37 @@

    Python Type System Conformance Test Results

    - - - - - - - @@ -1017,22 +901,19 @@

    Python Type System Conformance Test Results

    - - - - @@ -1041,23 +922,20 @@

    Python Type System Conformance Test Results

    - - - - @@ -1065,44 +943,38 @@

    Python Type System Conformance Test Results

    - - - - - - - @@ -1110,16 +982,14 @@

    Python Type System Conformance Test Results

    - - - @@ -1127,26 +997,22 @@

    Python Type System Conformance Test Results

    - - - - @@ -1155,19 +1021,16 @@

    Python Type System Conformance Test Results

    - - - @@ -1176,29 +1039,25 @@

    Python Type System Conformance Test Results

    - - - - - diff --git a/conformance/src/type_checker.py b/conformance/src/type_checker.py index 64c689966..7e6fdaadb 100644 --- a/conformance/src/type_checker.py +++ b/conformance/src/type_checker.py @@ -203,76 +203,6 @@ def parse_errors(self, output: Sequence[str]) -> dict[int, list[str]]: return line_to_errors -class PyreTypeChecker(TypeChecker): - @property - def name(self) -> str: - return "pyre" - - def install(self) -> bool: - try: - # Delete the cache for consistent timings. - shutil.rmtree(".pyre") - except (shutil.Error, OSError): - # Ignore any errors here. - pass - - try: - # Uninstall any existing version if present. - run( - [sys.executable, "-m", "pip", "uninstall", "pyre-check", "-y"], - check=True, - ) - - # Install the latest version. - run( - [sys.executable, "-m", "pip", "install", "pyre-check"], - check=True, - ) - - # Generate a default config file. - pyre_config = '{"site_package_search_strategy": "pep561", "source_directories": ["."]}\n' - with open(".pyre_configuration", "w") as f: - f.write(pyre_config) - - return True - except CalledProcessError: - print("Unable to install pyre") - return False - - def get_version(self) -> str: - proc = run(["pyre", "--version"], stdout=PIPE, text=True) - version = proc.stdout.strip() - version = version.replace("Client version:", "pyre") - return version - - def run_tests(self, test_files: Sequence[str]) -> dict[str, str]: - proc = run(["pyre", "check"], stdout=PIPE, text=True, encoding="utf-8") - lines = proc.stdout.split("\n") - - # Add results to a dictionary keyed by the file name. - results_dict: dict[str, str] = {} - for line in lines: - file_name = line.split(":")[0].strip() - results_dict[file_name] = results_dict.get(file_name, "") + line + "\n" - - return results_dict - - def parse_errors(self, output: Sequence[str]) -> dict[int, list[str]]: - # narrowing_typeguard.py:17:33 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[str], Type[str]]`. - line_to_errors: dict[int, list[str]] = {} - for line in output: - # Ignore multi-line errors - if ".py:" not in line and ".pyi:" not in line: - continue - # Ignore reveal_type errors - if "Revealed type [-1]" in line: - continue - assert line.count(":") >= 2, f"Failed to parse line: {line!r}" - _, lineno, _ = line.split(":", maxsplit=2) - line_to_errors.setdefault(int(lineno), []).append(line) - return line_to_errors - - class ZubanLSTypeChecker(MypyTypeChecker): @property def name(self) -> str: @@ -415,7 +345,6 @@ def parse_errors(self, output: Sequence[str]) -> dict[int, list[str]]: TYPE_CHECKERS: Sequence[TypeChecker] = ( MypyTypeChecker(), PyrightTypeChecker(), - *([] if os.name == "nt" else [PyreTypeChecker()]), ZubanLSTypeChecker(), PyreflyTypeChecker(), ) diff --git a/conformance/tests/enums_members.py b/conformance/tests/enums_members.py index 3a623d27e..6f18c97af 100644 --- a/conformance/tests/enums_members.py +++ b/conformance/tests/enums_members.py @@ -12,7 +12,7 @@ # > attribute -class Pet(Enum): # E?: Uninitialized attributes (pyre) +class Pet(Enum): genus: str # Non-member attribute species: str # Non-member attribute diff --git a/docs/index.rst b/docs/index.rst index 7f59e7b60..95d27748a 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -81,12 +81,10 @@ Type Checkers * `mypy `_, the reference implementation for type checkers. -* `pyre `_, a type checker written in OCaml and - optimized for performance. +* `pyrefly `_, a fast type checker and language + server. * `pyright `_, a type checker that emphasizes speed. -* `pytype `_, a type checker that - checks and infers types for unannotated code. Development Environments ------------------------ From c16b1df6b24969a70a86ab4645f240c04c650e37 Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Tue, 14 Oct 2025 10:39:14 -0700 Subject: [PATCH 147/308] spec: Rewrite TypedDict spec (#2072) * spec: Rewrite TypedDict spec This is an edit of the TypedDict spec for clarity and flow. My goal was to unify the pieces of the spec that derive from the various PEPs into a coherent whole. I removed excessive examples and motivations: the spec should specify, not justify. The length of the spec chapter is reduced by more than half. This change is on top of #2068 (adding PEP 728). The general approach I took is to first define the kinds of TypedDicts that can exist, then explain the syntax for defining TypedDicts, then discuss other aspects of TypedDict types. I introduce some new terminology around PEP 728 to make it easier to talk about the different kinds of TypedDict. TypedDicts are defined to have a property called openness, which can have three states: - Open: all TypedDicts prior to PEP 728 - Closed: no extra keys are allowed (closed=True) - With extra items: extra_items=... from PEP 728 I retained existing text where it made sense but also wrote some from scratch. * Apply suggestions from code review Co-authored-by: Joren Hammudoglu * feedback * Carl feedback * more clarity --------- Co-authored-by: Joren Hammudoglu --- docs/spec/callables.rst | 63 +- docs/spec/concepts.rst | 8 +- docs/spec/glossary.rst | 54 ++ docs/spec/typeddict.rst | 1735 +++++++++++++-------------------------- 4 files changed, 693 insertions(+), 1167 deletions(-) diff --git a/docs/spec/callables.rst b/docs/spec/callables.rst index 56b66bc16..b189c4828 100644 --- a/docs/spec/callables.rst +++ b/docs/spec/callables.rst @@ -180,24 +180,61 @@ generated. For example:: # so **kwargs can contain # a "name" keyword. -Required and non-required keys -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -By default all keys in a ``TypedDict`` are required. This behavior can be -overridden by setting the dictionary's ``total`` parameter as ``False``. -Moreover, :pep:`655` introduced new type qualifiers - ``typing.Required`` and -``typing.NotRequired`` - that enable specifying whether a particular key is -required or not:: - - class Movie(TypedDict): - title: str - year: NotRequired[int] +Required and non-required items +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Items in a TypedDict may be either :term:`required` or :term:`non-required`. When using a ``TypedDict`` to type ``**kwargs`` all of the required and non-required keys should correspond to required and non-required function -keyword parameters. Therefore, if a required key is not supported by the +keyword parameters. Therefore, if a required key is not provided by the caller, then an error must be reported by type checkers. +Read-only items +^^^^^^^^^^^^^^^ + +TypedDict items may also be :term:`read-only`. Marking one or more of the items of a TypedDict +used to type ``**kwargs`` as read-only will have no effect on the type signature of the method. +However, it *will* prevent the item from being modified in the body of the function:: + + class Args(TypedDict): + key1: int + key2: str + + class ReadOnlyArgs(TypedDict): + key1: ReadOnly[int] + key2: ReadOnly[str] + + class Function(Protocol): + def __call__(self, **kwargs: Unpack[Args]) -> None: ... + + def impl(**kwargs: Unpack[ReadOnlyArgs]) -> None: + kwargs["key1"] = 3 # Type check error: key1 is readonly + + fn: Function = impl # Accepted by type checker: function signatures are identical + +Extra items +^^^^^^^^^^^ + +If the TypedDict used for annotating ``**kwargs`` is defined to allow +:term:`extra items`, arbitrary additional keyword arguments of the right +type may be passed to the function:: + + class MovieNoExtra(TypedDict): + name: str + + class MovieExtra(TypedDict, extra_items=int): + name: str + + def f(**kwargs: Unpack[MovieNoExtra]) -> None: ... + def g(**kwargs: Unpack[MovieExtra]) -> None: ... + + # Should be equivalent to: + def f(*, name: str) -> None: ... + def g(*, name: str, **kwargs: int) -> None: ... + + f(name="No Country for Old Men", year=2007) # Not OK. Unrecognized item + g(name="No Country for Old Men", year=2007) # OK + Assignment ^^^^^^^^^^ diff --git a/docs/spec/concepts.rst b/docs/spec/concepts.rst index ee230f231..81fe481fe 100644 --- a/docs/spec/concepts.rst +++ b/docs/spec/concepts.rst @@ -69,7 +69,7 @@ attributes and/or methods. If an object ``v`` is a member of the set of objects denoted by a fully static type ``T``, we can say that ``v`` is a "member of" the type ``T``, or ``v`` -"inhabits" ``T``. +":term:`inhabits `" ``T``. Gradual types ~~~~~~~~~~~~~ @@ -298,9 +298,9 @@ visualize this analogy in the following table: * - ``B`` is :term:`equivalent` to ``A`` - ``B`` is :term:`consistent` with ``A`` -We can also define an **equivalence** relation on gradual types: the gradual -types ``A`` and ``B`` are equivalent (that is, the same gradual type, not -merely consistent with one another) if and only if all materializations of +We can also define an **equivalence** relation on gradual types: the gradual +types ``A`` and ``B`` are equivalent (that is, the same gradual type, not +merely consistent with one another) if and only if all materializations of ``A`` are also materializations of ``B``, and all materializations of ``B`` are also materializations of ``A``. diff --git a/docs/spec/glossary.rst b/docs/spec/glossary.rst index 1acbcc956..340dcbd4a 100644 --- a/docs/spec/glossary.rst +++ b/docs/spec/glossary.rst @@ -27,6 +27,13 @@ This section defines a few terms that may be used elsewhere in the specification ``B``, respectively, such that ``B'`` is a subtype of ``A'``. See :ref:`type-system-concepts`. + closed + A :ref:`TypedDict ` type is closed if it may not contain any + additional :term:`items ` beyond those specified in the TypedDict definition. + A closed TypedDict can be created using the ``closed=True`` argument to + :py:func:`typing.TypedDict`, or equivalently by setting ``extra_items=Never``. + Compare :term:`extra items` and :term:`open`. + consistent Two :term:`fully static types ` are "consistent with" each other if they are :term:`equivalent`. Two gradual types are @@ -52,6 +59,14 @@ This section defines a few terms that may be used elsewhere in the specification also materializations of ``B``, and all materializations of ``B`` are also materializations of ``A``. + extra items + A :ref:`TypedDict ` type with extra items may contain arbitrary + additional key-value pairs beyond those specified in the TypedDict definition, but those + values must be of the type specified by the ``extra_items=`` argument to the definition. + A TypedDict with extra items can be created using the ``extra_items=`` + argument to :py:func:`typing.TypedDict`. Extra items may or may not be + :term:`read-only`. Compare :term:`closed` and :term:`open`. + fully static type A type is "fully static" if it does not contain any :term:`gradual form`. A fully static type represents a set of possible runtime values. Fully @@ -79,11 +94,21 @@ This section defines a few terms that may be used elsewhere in the specification They can be :term:`materialized ` to a more static, or fully static, type. See :ref:`type-system-concepts`. + inhabit + A value is said to inhabit a type if it is a member of the set of values + represented by that type. For example, the value ``42`` inhabits the type + ``int``, and the value ``"hello"`` inhabits the type ``str``. + inline Inline type annotations are annotations that are included in the runtime code using :pep:`526` and :pep:`3107` syntax (the filename ends in ``.py``). + item + In the context of a :ref:`TypedDict `, an item consists of a name + (the dictionary key) and a type (representing the type that values corresponding to the key must have). + Items may be :term:`required` or :term:`non-required`, and may be :term:`read-only` or writable. + materialize A :term:`gradual type` can be materialized to a more static type (possibly a :term:`fully static type`) by replacing :ref:`Any` with any @@ -110,12 +135,41 @@ This section defines a few terms that may be used elsewhere in the specification ``__class__`` is that type, or any of its subclasses, transitively. In contrast, see :term:`structural` types. + non-required + If an :term:`item` in a :ref:`TypedDict ` is non-required, it may or + may not be present on an object of that TypedDict type, but if it is present + it must be of the type specified by the TypedDict definition. + Items can be marked as non-required using the :py:data:`typing.NotRequired` qualifier + or the ``total=False`` argument to :py:func:`typing.TypedDict`. Compare :term:`required`. + + open + A :ref:`TypedDict ` type is open if it may contain arbitrary + additional :term:`items ` beyond those specified in the TypedDict definition. + This is the default behavior for TypedDicts that do not use the ``closed=True`` + or ``extra_items=`` arguments to :py:func:`typing.TypedDict`. + Open TypedDicts behave similarly to TypedDicts with :term:`extra items` of type + ``ReadOnly[object]``, but differ in some behaviors; see the TypedDict specification + chapter for details. + Compare :term:`extra items` and :term:`closed`. + package A directory or directories that namespace Python modules. (Note the distinction between packages and :term:`distributions `. While most distributions are named after the one package they install, some distributions install multiple packages.) + read-only + A read-only :term:`item` in a :ref:`TypedDict ` may not be modified. + Attempts to delete or assign to that item + should be reported as type errors by a type checker. Read-only items are created + using the :py:data:`typing.ReadOnly` qualifier. + + required + If an :term:`item` in a :ref:`TypedDict ` is required, it must be present + in any object of that TypedDict type. Items are + required by default, but items can also be explicitly marked as required using + the :py:data:`typing.Required` qualifier. Compare :term:`non-required`. + special form A special form is an object that has a special meaning within the type system, comparable to a keyword in the language grammar. Examples include ``Any``, diff --git a/docs/spec/typeddict.rst b/docs/spec/typeddict.rst index 153fd0b76..1e0808f64 100644 --- a/docs/spec/typeddict.rst +++ b/docs/spec/typeddict.rst @@ -1,39 +1,54 @@ +.. _`typeddict`: .. _`typed-dictionaries`: Typed dictionaries ================== -.. _`typeddict`: - -TypedDict ---------- - -(Originally specified in :pep:`589`.) - -A TypedDict type represents dictionary objects with a specific set of -string keys, and with specific value types for each valid key. Each -string key can be either required (it must be present) or -non-required (it doesn't need to exist). - -There are two ways of defining TypedDict types. The first uses -a class-based syntax. The second is an alternative -assignment-based syntax that is provided for backwards compatibility, -to allow the feature to be backported to older Python versions. The -rationale is similar to why :pep:`484` supports a comment-based -annotation syntax for Python 2.7: type hinting is particularly useful -for large existing codebases, and these often need to run on older -Python versions. The two syntax options parallel the syntax variants -supported by ``typing.NamedTuple``. Other features include -TypedDict inheritance and totality (specifying whether keys are -required or not). - -This section also provides a sketch of how a type checker is expected to -support type checking operations involving TypedDict objects. Similar to -:pep:`484`, this discussion is left somewhat vague on purpose, to allow -experimentation with a wide variety of different type checking approaches. In -particular, :term:`assignability ` should be :term:`structural`: a -more specific TypedDict type can be assignable to a more general TypedDict -type, without any inheritance relationship between them. +(Originally specified in :pep:`589`, with later additions: ``Required`` +and ``NotRequired`` in :pep:`655`, use with ``Unpack`` in :pep:`692`, +``ReadOnly`` in :pep:`705`, and ``closed=True`` and ``extra_items=`` in :pep:`728`.) + +A TypedDict type represents ``dict`` objects that contain only keys of +type ``str``. There are restrictions on which string keys are valid, and +which values can be associated with each key. Values that :term:`inhabit` a +TypedDict type must be instances of ``dict`` itself, not a subclass. + +TypedDict types can define any number of :term:`items `, which are string +keys associated with values of a specified type. For example, +a TypedDict may contain the item ``a: str``, indicating that the key ``a`` +must map to a value of type ``str``. Items may be either :term:`required`, +meaning they must be present in every instance of the TypedDict type, or +:term:`non-required`, meaning they may be omitted, but if they are present, +they must be of the type specified in the TypedDict definition. By default, +all items in a TypedDict are mutable, but items +may also be marked as :term:`read-only`, indicating that they may not be +modified. + +In addition to explicitly specified items, TypedDicts may allow additional +items. By default, TypedDicts are :term:`open`, meaning they may contain an +unknown set of additional items. They may also be marked as :term:`closed`, +in which case they may not contain any keys beyond those explicitly specified. +As a third option, they may be defined with :term:`extra items` of a specific type. +In this case, there may be any number of additional items present at runtime, but +their values must be of the specified type. Extra items may or may not be +:term:`read-only`. Thus, a TypedDict may be open, closed, or have extra items; +we refer to this property as the *openness* of the TypedDict. For many purposes, +an open TypedDict is equivalent to a TypedDict with read-only extra items of +type ``object``, but certain behaviors differ; for example, the +:ref:`TypedDict constructor ` of open TypedDicts does not +allow unrecognized keys. + +A TypedDict is a :term:`structural` type: independent TypedDict types may be +:term:`assignable` to each other based on their structure, even if they do not +share a common base class. For example, two TypedDict types that contain the same +items are :term:`equivalent`. Nevertheless, TypedDict types may inherit from other +TypedDict types to share common items. TypedDict types may also be generic. + +Syntax +------ + +This section outlines the syntax for creating TypedDict types. There are two +syntaxes: the class-based syntax and the functional syntax. .. _typeddict-class-based-syntax: @@ -41,7 +56,7 @@ Class-based Syntax ^^^^^^^^^^^^^^^^^^ A TypedDict type can be defined using the class definition syntax with -``typing.TypedDict`` as the sole base class:: +``typing.TypedDict`` as a direct or indirect base class:: from typing import TypedDict @@ -52,41 +67,143 @@ A TypedDict type can be defined using the class definition syntax with ``Movie`` is a TypedDict type with two items: ``'name'`` (with type ``str``) and ``'year'`` (with type ``int``). -A type checker should validate that the body of a class-based -TypedDict definition conforms to the following rules: +A TypedDict can also be created through inheritance from one or more +other TypedDict types:: + + class BookBasedMovie(Movie): + based_on: str -* The class body should only contain lines with item definitions of the - form ``key: value_type``, optionally preceded by a docstring. The - syntax for item definitions is identical to attribute annotations, - but there must be no initializer, and the key name actually refers - to the string value of the key instead of an attribute name. +This creates a TypedDict type ``BookBasedMovie`` with three items: +``'name'`` (type ``str``), ``'year'`` (type ``int``), and ``'based_on'`` (type ``str``). +See :ref:`Inheritance ` for more details. -* Type comments cannot be used with the class-based syntax, for - consistency with the class-based ``NamedTuple`` syntax. Instead, - `Alternative Syntax`_ provides an - alternative, assignment-based syntax for backwards compatibility. +A generic TypedDict can be created by inheriting from ``Generic`` with a list +of type parameters:: -* String literal forward references are valid in the value types. + from typing import Generic, TypeVar -* Methods are not allowed, since the runtime type of a TypedDict - object will always be just ``dict`` (it is never a subclass of - ``dict``). + T = TypeVar('T') -* Specifying a metaclass is not allowed. + class Response(TypedDict, Generic[T]): + status: int + payload: T -* TypedDicts may be made generic by adding ``Generic[T]`` among the - bases (or, in Python 3.12 and higher, by using the new - syntax for generic classes). +Or, in Python 3.12 and newer, by using the native syntax for generic classes:: -An empty TypedDict can be created by only including ``pass`` in the -body (if there is a docstring, ``pass`` can be omitted):: + from typing import TypedDict - class EmptyDict(TypedDict): - pass + class Response[T](TypedDict): + status: int + payload: T + +It is invalid to specify a base class other than ``TypedDict``, ``Generic``, +or another TypedDict type in a class-based TypedDict definition. +It is also invalid to specify a custom metaclass. + +A TypedDict definition may also contain the following keyword arguments +in the class definition: + +* ``total``: a boolean literal (``True`` or ``False``) indicating whether + all items are :term:`required` (``True``, the default) or :term:`non-required` + (``False``). This affects only items defined in this class, not in any + base classes, and it does not affect any items that use an explicit + ``Required[]`` or ``NotRequired[]`` qualifier. The value must be exactly + ``True`` or ``False``; other expressions are not allowed. +* ``closed``: a boolean literal (``True`` or ``False``) indicating whether + the TypedDict is :term:`closed` (``True``) or :term:`open` (``False``). + The latter is the default, except when inheriting from another TypedDict that + is not open (see :ref:`typeddict-inheritance`), or when the ``extra_items`` + argument is also used. + As with ``total``, the value must be exactly ``True`` or ``False``. It is an error + to use this argument together with ``extra_items=``. +* ``extra_items``: indicates that the TypedDict has :term:`extra items`. The argument + must be a :term:`annotation expression` specifying the type of the extra items. + The :term:`type qualifier` ``ReadOnly[]`` may be used to indicate that the extra items are + :term:`read-only`. Other type qualifiers are not allowed. If the extra items type + is ``Never``, no extra items are allowed, so this is equivalent to ``closed=True``. + +The body of the class definition defines the :term:`items ` of the TypedDict type. +It may also contain a docstring or ``pass`` statements (primarily to allow the creation of +an empty TypedDict). No other statements are allowed, and type checkers should report an +error if any are present. Type comments are not supported for creating TypedDict items. + +.. _`required-notrequired`: +.. _`required`: +.. _`notrequired`: + +An item definition takes the form of an attribute annotation, ``key: T``. ``key`` is +an identifier and corresponds to the string key of the item, and ``T`` is an +:term:`annotation expression` specifying the type of the item value. This annotation +expression contains a :term:`type expression`, optionally qualified with one of the +:term:`type qualifiers ` ``Required``, ``NotRequired``, or ``ReadOnly``. +These type qualifiers may be nested arbitrarily or wrapped in ``Annotated[]``. It is +an error to use both ``Required`` and ``NotRequired`` in the same item definition. +An item is :term:`read-only` if and only if the ``ReadOnly`` qualifier is used. + +To determine whether an item is :term:`required` or :term:`non-required`, the following +procedure is used: + +* If the ``Required`` qualifier is present, the item is required. +* If the ``NotRequired`` qualifier is present, the item is non-required. +* If the ``total`` argument of the TypedDict definition is ``False``, the item is non-required. +* Else, the item is required. + +It is valid to use ``Required[]`` and ``NotRequired[]`` even for +items where it is redundant, to enable additional explicitness if desired. +Note that the value of ``total`` only affects items defined in the current class body, +not in any base classes. Thus, inheritance can be used to create a TypedDict that mixes +required and non-required items without using ``Required[]`` or ``NotRequired[]``. + +The following example demonstrates some of these rules:: + + from typing import TypedDict, NotRequired, Required, ReadOnly, Annotated + + class Movie(TypedDict): + name: str # required, not read-only + year: int # required, not read-only + director: NotRequired[str] # non-required, not read-only + rating: NotRequired[ReadOnly[float]] # non-required, read-only + invalid: Required[NotRequired[int]] # type checker error: both Required and NotRequired used + + class PartialMovie(TypedDict, total=False): + name: str # non-required, not read-only + year: Required[int] # required, not read-only + score: ReadOnly[float] # non-required, read-only + +.. _typeddict-functional-syntax: + +Functional syntax +^^^^^^^^^^^^^^^^^ + +In addition to the class-based syntax, TypedDict types can be created +using an alternative functional syntax. This syntax allows defining +items with keys that are not valid Python identifiers, and it is compatible +with older Python versions such as 3.5 and 2.7 that don't support the +variable definition syntax introduced in :pep:`526`. On the other hand, this syntax +does not support inheritance. + +The functional syntax resembles the traditional syntax for defining named tuples:: + + from typing import TypedDict + + Movie = TypedDict('Movie', {'name': str, 'year': int}) + +The syntax comprises a call to ``TypedDict()``, the result of which must be immediately +assigned to a variable with the same name as the first argument to ``TypedDict()``. +The call to ``TypedDict()`` must have two positional arguments. The first is a string +literal specifying the name of the TypedDict type. The second is a dictionary specifying +the :term:`items ` of the TypedDict. It must be a dictionary display expression, +not a variable or other expression that evaluates to a dictionary at runtime. +The keys of the dictionary must be string literals and the values must be +:term:`annotation expressions ` following the same rules as +the class-based syntax (i.e., the qualifiers ``Required``, ``NotRequired``, and +``ReadOnly`` are allowed). In addition to the two positional arguments, ``total``, +``closed``, and ``extra_items`` keyword arguments are also supported, with the same +semantics as in the class-based syntax. Using TypedDict Types -^^^^^^^^^^^^^^^^^^^^^ +--------------------- Here is an example of how the type ``Movie`` can be used:: @@ -128,95 +245,239 @@ key, and the ``'name'`` key is missing:: The created TypedDict type object is not a real class object. Here are the only uses of the type a type checker is expected to allow: -* It can be used in type annotations and in any context where an - arbitrary type hint is valid, such as in type aliases and as the - target type of a cast. +* It can be used in :term:`type expressions ` to + represent the TypedDict type. * It can be used as a callable object with keyword arguments - corresponding to the TypedDict items. Non-keyword arguments are not - allowed. Example:: + corresponding to the TypedDict items; see :ref:`typeddict-constructor`. - m = Movie(name='Blade Runner', year=1982) +* It can be used as a base class, but only when defining a derived + TypedDict (see :ref:`above `). - When called, the TypedDict type object returns an ordinary - dictionary object at runtime:: +In particular, TypedDict type objects cannot be used in +``isinstance()`` tests such as ``isinstance(d, Movie)``. This is +consistent with how ``isinstance()`` is not supported for +other type forms such as ``list[str]``. - print(type(m)) # +.. _typeddict-constructor: -* It can be used as a base class, but only when defining a derived - TypedDict. This is discussed in more detail below. +The TypedDict constructor +^^^^^^^^^^^^^^^^^^^^^^^^^ -In particular, TypedDict type objects cannot be used in -``isinstance()`` tests such as ``isinstance(d, Movie)``. The reason is -that there is no existing support for checking types of dictionary -item values, since ``isinstance()`` does not work with many -types, including common ones like ``list[str]``. This would be needed -for cases like this:: +TypedDict types are callable at runtime and can be used as a constructor +to create values that conform to the TypedDict type. The constructor +takes only keyword arguments, corresponding to the items of the TypedDict. +Example:: + + m = Movie(name='Blade Runner', year=1982) + +When called, the TypedDict type object returns an ordinary +dictionary object at runtime:: + + print(type(m)) # + +Every :term:`required` item must be provided as a keyword argument. :term:`Non-required` +items may be omitted. Whether an item is read-only has no effect on the +constructor. + +Closed and open TypedDicts allow no additional items beyond those explicitly +defined, but TypedDicts with extra items allow arbitrary keyword arguments, +which must be of the specified type. Example:: + + from typing import TypedDict, ReadOnly + + class MovieWithExtras(TypedDict, extra_items=ReadOnly[int | str]): + name: str + year: int + + m1 = MovieWithExtras(name='Blade Runner', year=1982) # OK + m2 = MovieWithExtras(name='The Godfather', year=1972, director='Francis Ford Coppola', rating=9) # OK + m3 = MovieWithExtras(name='Inception', year=2010, budget=160.0) # Type check error: budget must be int or str + +Initialization from dictionary literals +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Type checkers should also allow initializing a value of TypedDict type from +a dictionary literal:: - class Strings(TypedDict): - items: list[str] + m: Movie = {'name': 'Blade Runner', 'year': 1982} # OK - print(isinstance({'items': [1]}, Strings)) # Should be False - print(isinstance({'items': ['x']}, Strings)) # Should be True +Or from a call to ``dict()`` with keyword arguments:: -The above use case is not supported. This is consistent with how -``isinstance()`` is not supported for ``list[str]``. + m: Movie = dict(name='Blade Runner', year=1982) # OK + +In these cases, extra keys should not be allowed unless the TypedDict +is defined to allow :term:`extra items`. In this example, the ``director`` key is not defined in +``Movie`` and is expected to generate an error from a type checker:: + + m: Movie = dict( + name='Alien', + year=1979, + director='Ridley Scott') # error: Unexpected key 'director' + +If a TypedDict has extra items, extra keys are allowed, provided their value +matches the extra items type:: + + class ExtraMovie(TypedDict, extra_items=bool): + name: str + + a: ExtraMovie = {"name": "Blade Runner", "novel_adaptation": True} # OK + b: ExtraMovie = { + "name": "Blade Runner", + "year": 1982, # Not OK. 'int' is not assignable to 'bool' + } + +Here, ``extra_items=bool`` specifies that items other than ``'name'`` +have a value type of ``bool`` and are non-required. +.. _typeddict-inheritance: Inheritance -^^^^^^^^^^^ +----------- -It is possible for a TypedDict type to inherit from one or more -TypedDict types using the class-based syntax. In this case the +As discussed under :ref:`typeddict-class-based-syntax`, TypedDict types +can inherit from one or more other TypedDict types. In this case the ``TypedDict`` base class should not be included. Example:: class BookBasedMovie(Movie): based_on: str Now ``BookBasedMovie`` has keys ``name``, ``year``, and ``based_on``. It is -equivalent to this definition, since TypedDict types use :term:`structural` -:term:`assignability `:: +equivalent to this definition, since TypedDict types are :term:`structural` types:: class BookBasedMovie(TypedDict): name: str year: int based_on: str -Here is an example of multiple inheritance:: +Overriding items +^^^^^^^^^^^^^^^^ - class X(TypedDict): - x: int +Under limited circumstances, subclasses may redeclare items defined in a superclass with +a different type or different qualifiers. Redeclaring an item with the same type and qualifiers +is always allowed, although it is redundant. - class Y(TypedDict): - y: str +If an item is mutable in a superclass, it must remain mutable in the subclass. Similarly, +mutable items that are :term:`required` in a superclass must remain required in the subclass, +and mutable :term:`non-required` items in the superclass must remain non-required in the subclass. +However, if the superclass item is :term:`read-only`, a superclass item that is non-required +may be overridden with a required item in the subclass. A read-only item in a superclass +may be redeclared as mutable (that is, without the ``ReadOnly`` qualifier) in a subclass. +These rules are necessary for type safety. - class XYZ(X, Y): - z: bool +If an item is read-only in the superclass, the subclass may redeclare it with a different type +that is :term:`assignable` to the superclass type. Otherwise, changing the type of an item is not allowed. +Example:: -The TypedDict ``XYZ`` has three items: ``x`` (type ``int``), ``y`` -(type ``str``), and ``z`` (type ``bool``). + class X(TypedDict): + x: str + y: ReadOnly[int] + z: int -A TypedDict cannot inherit from both a TypedDict type and a -non-TypedDict base class other than ``Generic``. + class Y(X): + x: int # Type check error: cannot overwrite TypedDict field "x" + y: bool # OK: bool is assignable to int, and a mutable item can override a read-only one + z: bool # Type check error: key is mutable, so subclass type must be consistent with superclass -Additional notes on TypedDict class inheritance: +Openness +^^^^^^^^ -* Changing a field type of a parent TypedDict class in a subclass is not allowed. - Example:: +The openness of a TypedDict (whether it is :term:`open`, :term:`closed`, or has :term:`extra items`) +is inherited from its superclass by default:: - class X(TypedDict): - x: str + class ClosedBase(TypedDict, closed=True): + name: str - class Y(X): - x: int # Type check error: cannot overwrite TypedDict field "x" + class ClosedChild(ClosedBase): # also closed + pass + + class ExtraItemsBase(TypedDict, extra_items=int | None): + name: str + + class ExtraItemsChild(ExtraItemsBase): # also has extra_items=int | None + pass + +However, subclasses may also explicitly use the ``closed`` and ``extra_items`` arguments +to change the openness of the TypedDict, but in some cases this yields a type checker error: + +- If the base class is open, all possible states are allowed in the subclass: it may remain open, + it may be closed (with ``closed=True``), or it may have extra items (with ``extra_items=...``). + +- If the base class is closed, any child classes must also be closed. + +- If the base class has extra items, but they are not read-only, the child class must also allow + the same extra items. + +- If the base class has read-only extra items, the child class may be closed, + or it may redeclare its extra items with a type that is :term:`assignable` to the base class type. + Child classes may also have mutable extra items if the base class has read-only extra items. + +For example:: + + class ExtraItemsRO(TypedDict, extra_items=ReadOnly[int | str]): + name: str + + class ClosedChild(ExtraItemsRO, closed=True): # OK + pass + + # OK, str is assignable to int | str, and mutable extra items can override read-only ones + class NarrowerChild(ExtraItemsRO, extra_items=str): + pass + +When a TypedDict has extra items, this effectively defines the value type of any unnamed +items accepted to the TypedDict and marks them as non-required. Thus, there are some +restrictions on the items that can be added in subclasses. For each item +added in a subclass of a class with extra items of type ``T``, the following rules must be followed: + +- If ``extra_items`` is read-only + + - The item can be either required or non-required + - The item's value type must be :term:`assignable` to ``T`` + +- If ``extra_items`` is not read-only + + - The item must be non-required + - The item's value type must be :term:`consistent` with ``T`` + +For example:: + + class MovieBase(TypedDict, extra_items=int | None): + name: str + + class MovieRequiredYear(MovieBase): # Not OK. Required key 'year' is not known to 'MovieBase' + year: int | None + + class MovieNotRequiredYear(MovieBase): # Not OK. 'int | None' is not consistent with 'int' + year: NotRequired[int] + + class MovieWithYear(MovieBase): # OK + year: NotRequired[int | None] + + class BookBase(TypedDict, extra_items=ReadOnly[int | str]): + title: str + + class Book(BookBase, extra_items=str): # OK + year: int # OK, since extra_items is read-only + +Multiple inheritance +^^^^^^^^^^^^^^^^^^^^ + +TypedDict types may use multiple inheritance to inherit items from multiple +base classes. Here is an example:: - In the example outlined above TypedDict class annotations returns - type ``str`` for key ``x``:: + class X(TypedDict): + x: int + + class Y(TypedDict): + y: str - print(Y.__annotations__) # {'x': } + class XYZ(X, Y): + z: bool +The TypedDict ``XYZ`` has three items: ``x`` (type ``int``), ``y`` +(type ``str``), and ``z`` (type ``bool``). -* Multiple inheritance does not allow conflict types for the same name field:: +Multiple inheritance does not allow conflicting types for the same item:: class X(TypedDict): x: int @@ -227,195 +488,187 @@ Additional notes on TypedDict class inheritance: class XYZ(X, Y): # Type check error: cannot overwrite TypedDict field "x" while merging xyz: bool +.. _typeddict-assignability: -Totality -^^^^^^^^ - -By default, all keys must be present in a TypedDict. It is possible -to override this by specifying *totality*. Here is how to do this -using the class-based syntax:: - - class Movie(TypedDict, total=False): - name: str - year: int +Subtyping and assignability +--------------------------- -This means that a ``Movie`` TypedDict can have any of the keys omitted. Thus -these are valid:: +Because TypedDict types are :term:`structural` types, a TypedDict ``T1`` is :term:`assignable` to another +TypedDict type ``T2`` if the two are structurally compatible, meaning that all operations that +are allowed on ``T2`` are also allowed on ``T1``. For similar reasons, TypedDict types are +generally not assignable to any specialization of ``dict`` or ``Mapping``, other than ``Mapping[str, object]``, +though certain :term:`closed` TypedDicts and TypedDicts with :term:`extra items` may be assignable +to these types. + +The rest of this section discusses the :term:`subtyping ` rules for TypedDict in more detail. +As with any type, the rules for :term:`assignability ` can be derived from the subtyping +rules using the :term:`materialization ` procedure. Generally, this means that where +":term:`equivalent`" is mentioned below, the :term:`consistency ` relation can be used instead +when implementing assignability, and where ":term:`subtyping `" between elements of a +TypedDict is mentioned, assignability can be used instead when implementing assignability between TypedDicts. + +Subtyping between TypedDict types +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - m: Movie = {} - m2: Movie = {'year': 2015} +A TypedDict type ``B`` is a :term:`subtype` of a TypedDict type ``A`` if +and only if all of the conditions below are satisfied. For the purposes of these conditions, +an :term:`open` TypedDict is treated as if it had read-only :term:`extra items` of type ``object``. -A type checker is only expected to support a literal ``False`` or -``True`` as the value of the ``total`` argument. ``True`` is the -default, and makes all items defined in the class body be required. +The conditions are as follows: -The totality flag only applies to items defined in the body of the -TypedDict definition. Inherited items won't be affected, and instead -use totality of the TypedDict type where they were defined. This makes -it possible to have a combination of required and non-required keys in -a single TypedDict type. Alternatively, ``Required`` and ``NotRequired`` -(see below) can be used to mark individual items as required or non-required. +- For each item in ``A``: -.. _typeddict-functional-syntax: + - If it is required in ``A``: -Alternative Syntax -^^^^^^^^^^^^^^^^^^ + - It must also be required in ``B``. + - If it is read-only in ``A``, the item type in ``B`` must be a subtype of the item type in ``A``. + (For :term:`assignability ` between two TypedDicts, the first item must instead + be assignable to the second.) -This section provides an alternative syntax that can be backported to -older Python versions such as 3.5 and 2.7 that don't support the -variable definition syntax introduced in :pep:`526`. It -resembles the traditional syntax for defining named tuples:: + - If it is mutable in ``A``, it must also be mutable in ``B``, and the item type in ``B`` must be + :term:`equivalent` to the item type in ``A``. (It follows that for assignability, the two item types + must be :term:`consistent`.) - Movie = TypedDict('Movie', {'name': str, 'year': int}) + - If it is non-required in ``A``: -It is also possible to specify totality using the alternative syntax:: + - If it is read-only in ``A``: - Movie = TypedDict('Movie', - {'name': str, 'year': int}, - total=False) + - If ``B`` has an item with the same key, its item type must be a subtype of the item type in ``A``. + - Else: -The semantics are equivalent to the class-based syntax. This syntax -doesn't support inheritance, however. The -motivation for this is keeping the backwards compatible syntax as -simple as possible while covering the most common use cases. + - If ``B`` is closed, the check succeeds. + - If ``B`` has extra items, the extra items type must be a subtype of the item type in ``A``. -A type checker is only expected to accept a dictionary display expression -as the second argument to ``TypedDict``. In particular, a variable that -refers to a dictionary object does not need to be supported, to simplify -implementation. + - If it is mutable in ``A``: + - If ``B`` has an item with the same key, it must also be mutable, and its item type must be + :term:`equivalent` to the item type in ``A``. -.. _typeddict-assignability: + - Else: -Assignability -^^^^^^^^^^^^^ + - If ``B`` is closed, the check fails. + - If ``B`` has extra items, the extra items type must not be read-only and must + be :term:`equivalent` to the item type in ``A``. -First, any TypedDict type is :term:`assignable` to ``Mapping[str, object]``. +- If ``A`` is closed, ``B`` must also be closed, and it must not contain any items that are not present in ``A``. +- If ``A`` has read-only extra items, ``B`` must either be closed or also have extra items, and the extra items type in ``B`` + must be a subtype of the extra items type in ``A``. Additionally, for any items in ``B`` that are not present in ``A``, + the item type must be a subtype of the extra items type in ``A``. +- If ``A`` has mutable extra items, ``B`` must also have mutable extra items, and the extra items type in ``B`` + must be :term:`equivalent` to the extra items type in ``A``. Additionally, for any items in ``B`` that are not present in ``A``, + the item type must be :term:`equivalent` to the extra items type in ``A``. -Second, a TypedDict type ``B`` is :term:`assignable` to a TypedDict ``A`` if -and only if both of these conditions are satisfied: +The intuition behind these rules is that any operation that is valid on ``A`` must also be valid and safe on ``B``. +For example, any key access on ``A`` that is guaranteed to succeed (because the item is required) must also succeed on ``B``, +and any mutating operation (such as setting or deleting a key) that is allowed on ``A`` must also be allowed on ``B``. -* For each key in ``A``, ``B`` has the corresponding key and the corresponding - value type in ``B`` is :term:`consistent` with the value type in ``A``. +An example where mutability is relevant:: -* For each required key in ``A``, the corresponding key is required - in ``B``. For each non-required key in ``A``, the corresponding key - is not required in ``B``. + class A(TypedDict): + x: int | None -Discussion: + class B(TypedDict): + x: int -* Value types behave invariantly, since TypedDict objects are mutable. - This is similar to mutable container types such as ``List`` and - ``Dict``. Example where this is relevant:: + def f(a: A) -> None: + a['x'] = None - class A(TypedDict): - x: int | None + b: B = {'x': 0} + f(b) # Type check error: 'B' not assignable to 'A' + b['x'] + 1 # Runtime error: None + 1 - class B(TypedDict): - x: int +.. _typeddict-mapping: - def f(a: A) -> None: - a['x'] = None +Subtyping with ``Mapping`` +^^^^^^^^^^^^^^^^^^^^^^^^^^ - b: B = {'x': 0} - f(b) # Type check error: 'B' not assignable to 'A' - b['x'] + 1 # Runtime error: None + 1 +A TypedDict type is a :term:`subtype` of a type of the form ``Mapping[str, VT]`` +when all value types of the items in the TypedDict +are subtypes of ``VT``. For the purpose of this rule, an :term:`open` TypedDict is considered +to have read-only :term:`extra items` of type ``object``. -* A TypedDict type with a required key is not :term:`assignable` to a TypedDict - type where the same key is a non-required key, since the latter allows keys - to be deleted. Example where this is relevant:: +For example:: - class A(TypedDict, total=False): - x: int + class MovieExtraStr(TypedDict, extra_items=str): + name: str - class B(TypedDict): - x: int + extra_str: MovieExtraStr = {"name": "Blade Runner", "summary": ""} + str_mapping: Mapping[str, str] = extra_str # OK - def f(a: A) -> None: - del a['x'] + class MovieExtraInt(TypedDict, extra_items=int): + name: str - b: B = {'x': 0} - f(b) # Type check error: 'B' not assignable to 'A' - b['x'] + 1 # Runtime KeyError: 'x' + extra_int: MovieExtraInt = {"name": "Blade Runner", "year": 1982} + int_mapping: Mapping[str, int] = extra_int # Not OK. 'int | str' is not assignable with 'int' + int_str_mapping: Mapping[str, int | str] = extra_int # OK -* A TypedDict type ``A`` with no key ``'x'`` is not :term:`assignable` to a - TypedDict type with a non-required key ``'x'``, since at runtime the key - ``'x'`` could be present and have an :term:`inconsistent ` type - (which may not be visible through ``A`` due to :term:`structural` - assignability). Example:: +As a consequence, every TypedDict type is :term:`assignable` to ``Mapping[str, object]``. - class A(TypedDict, total=False): - x: int - y: int +.. _typeddict-dict: - class B(TypedDict, total=False): - x: int +Subtyping with ``dict`` +^^^^^^^^^^^^^^^^^^^^^^^ - class C(TypedDict, total=False): - x: int - y: str +Generally, TypedDict types are not subtypes of any specialization of ``dict[...]`` type, since +dictionary types allow destructive operations, including ``clear()``. They +also allow arbitrary keys to be set, which would compromise type safety. - def f(a: A) -> None: - a['y'] = 1 +However, a TypedDict with :term:`extra items` may be a subtype of ``dict[str, VT]``, +provided certain conditions are met, because it introduces sufficient restrictions +for this subtyping relation to be safe. +A TypedDict type is a subtype of ``dict[str, VT]`` if the following conditions are met: - def g(b: B) -> None: - f(b) # Type check error: 'B' not assignable to 'A' +- The TypedDict type has mutable :term:`extra items` of a type that is :term:`equivalent` to ``VT``. +- All items on the TypedDict satisfy the following conditions: - c: C = {'x': 0, 'y': 'foo'} - g(c) - c['y'] + 'bar' # Runtime error: int + str + - The value type of the item is :term:`equivalent` to ``VT``. + - The item is not read-only. + - The item is not required. -* A TypedDict isn't :term:`assignable` to any ``Dict[...]`` type, since - dictionary types allow destructive operations, including ``clear()``. They - also allow arbitrary keys to be set, which would compromise type safety. - Example:: +For example:: - class A(TypedDict): - x: int + class IntDict(TypedDict, extra_items=int): + pass - class B(A): - y: str + class IntDictWithNum(IntDict): + num: NotRequired[int] - def f(d: Dict[str, int]) -> None: - d['y'] = 0 + def f(x: IntDict) -> None: + v: dict[str, int] = x # OK + v.clear() # OK - def g(a: A) -> None: - f(a) # Type check error: 'A' not assignable to Dict[str, int] + not_required_num_dict: IntDictWithNum = {"num": 1, "bar": 2} + regular_dict: dict[str, int] = not_required_num_dict # OK + f(not_required_num_dict) # OK - b: B = {'x': 0, 'y': 'foo'} - g(b) - b['y'] + 'bar' # Runtime error: int + str +In this case, some methods that are otherwise unavailable on a TypedDict are allowed, +with signatures matching ``dict[str, VT]`` +(e.g.: ``__setitem__(self, key: str, value: VT) -> None``):: -* A TypedDict with all ``int`` values is not :term:`assignable` to - ``Mapping[str, int]``, since there may be additional non-``int`` values not - visible through the type, due to :term:`structural` assignability. These can - be accessed using the ``values()`` and ``items()`` methods in ``Mapping``, - for example. Example:: + not_required_num_dict.clear() # OK - class A(TypedDict): - x: int + reveal_type(not_required_num_dict.popitem()) # OK. Revealed type is 'tuple[str, int]' - class B(TypedDict): - x: int - y: str + def f(not_required_num_dict: IntDictWithNum, key: str): + not_required_num_dict[key] = 42 # OK + del not_required_num_dict[key] # OK - def sum_values(m: Mapping[str, int]) -> int: - n = 0 - for v in m.values(): - n += v # Runtime error - return n +On the other hand, ``dict[str, VT]`` is not assignable to any TypedDict type, +because such a type includes instances of subclasses of ``dict``:: - def f(a: A) -> None: - sum_values(a) # Error: 'A' not assignable to Mapping[str, int] + class CustomDict(dict[str, int]): + pass - b: B = {'x': 0, 'y': 'foo'} - f(b) + def f(might_not_be_a_builtin_dict: dict[str, int]): + int_dict: IntDict = might_not_be_a_builtin_dict # Not OK + not_a_builtin_dict = CustomDict({"num": 1}) + f(not_a_builtin_dict) .. _typeddict-operations: Supported and Unsupported Operations -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +------------------------------------ Type checkers should support restricted forms of most ``dict`` operations on TypedDict objects. The guiding principle is that @@ -429,64 +682,50 @@ the most important type safety violations to prevent: 3. A key that is not defined in the TypedDict type is added. -A key that is not a literal should generally be rejected, since its -value is unknown during type checking, and thus can cause some of the -above violations. (`Use of Final Values and Literal Types`_ -generalizes this to cover final names and literal types.) - -The use of a key that is not known to exist should be reported as an error, -even if this wouldn't necessarily generate a runtime type error. These are -often mistakes, and these may insert values with an invalid type if -:term:`structural` :term:`assignability ` hides the types of -certain items. For example, ``d['x'] = 1`` should generate a type check error -if ``'x'`` is not a valid key for ``d`` (which is assumed to be a TypedDict -type). - -Extra keys included in TypedDict object construction should also be -caught. In this example, the ``director`` key is not defined in -``Movie`` and is expected to generate an error from a type checker:: - - m: Movie = dict( - name='Alien', - year=1979, - director='Ridley Scott') # error: Unexpected key 'director' +4. Read-only items are modified or deleted. -Type checkers should reject the following operations on TypedDict -objects as unsafe, even though they are valid for normal dictionaries: +.. _`readonly`: -* Operations with arbitrary ``str`` keys (instead of string literals - or other expressions with known string values) should generally be - rejected. This involves both destructive operations such as setting - an item and read-only operations such as subscription expressions. - As an exception to the above rule, ``d.get(e)`` and ``e in d`` - should be allowed for TypedDict objects, for an arbitrary expression - ``e`` with type ``str``. The motivation is that these are safe and - can be useful for introspecting TypedDict objects. The static type - of ``d.get(e)`` should be ``object`` if the string value of ``e`` - cannot be determined statically. +Items that are :term:`read-only` may not be mutated (added, modified, or removed):: -* ``clear()`` is not safe since it could remove required keys, some of which - may not be directly visible because of :term:`structural` - :term:`assignability `. ``popitem()`` is similarly unsafe, even - if all known keys are not required (``total=False``). + from typing import ReadOnly -* ``del obj['key']`` should be rejected unless ``'key'`` is a - non-required key. + class Band(TypedDict): + name: str + members: ReadOnly[list[str]] -Type checkers may allow reading an item using ``d['x']`` even if -the key ``'x'`` is not required, instead of requiring the use of -``d.get('x')`` or an explicit ``'x' in d`` check. The rationale is -that tracking the existence of keys is difficult to implement in full -generality, and that disallowing this could require many changes to -existing code. + blur: Band = {"name": "blur", "members": []} + blur["name"] = "Blur" # OK: "name" is not read-only + blur["members"] = ["Damon Albarn"] # Type check error: "members" is read-only + blur["members"].append("Damon Albarn") # OK: list is mutable The exact type checking rules are up to each type checker to decide. In some cases potentially unsafe operations may be accepted if the alternative is to generate false positive errors for idiomatic code. +Sometimes, operations on :term:`closed` TypedDicts or TypedDicts with +:term:`extra items` are safe even if they would be unsafe on +:term:`open` TypedDicts, so type checker behavior may depend on the +openness of the TypedDict. +Allowed keys +^^^^^^^^^^^^ + +Many operations on TypedDict objects involve specifying a dictionary key. +Examples include accessing an item with ``d['key']`` or setting an item with +``d['key'] = value``. + +A key that is not a literal should generally be rejected, since its +value is unknown during type checking, and thus can cause some of the +above violations. This involves both destructive operations such as setting +an item and read-only operations such as subscription expressions. -Use of Final Values and Literal Types -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +The use of a key that is not known to exist should be reported as an error, +even if this wouldn't necessarily generate a runtime type error. These are +often mistakes, and these may insert values with an invalid type if +:term:`structural` :term:`assignability ` hides the types of +certain items. For example, ``d['x'] = 1`` should generate a type check error +if ``'x'`` is not a valid key for ``d`` (which is assumed to be a TypedDict +type), unless ``d`` has mutable :term:`extra items` of a compatible type. Type checkers should allow :ref:`final names ` with string values to be used instead of string literals in operations on @@ -504,317 +743,73 @@ can be used instead of a literal value:: key: Literal['year', 'name']) -> int | str: return movie[key] -Type checkers are only expected to support actual string literals, not -final names or literal types, for specifying keys in a TypedDict type -definition. Also, only a boolean literal can be used to specify -totality in a TypedDict definition. The motivation for this is to -make type declarations self-contained, and to simplify the -implementation of type checkers. +Specific operations +^^^^^^^^^^^^^^^^^^^ +This section discusses some specific operations in more detail. -Backwards Compatibility -^^^^^^^^^^^^^^^^^^^^^^^ - -To retain backwards compatibility, type checkers should not infer a -TypedDict type unless it is sufficiently clear that this is desired by -the programmer. When unsure, an ordinary dictionary type should be -inferred. Otherwise existing code that type checks without errors may -start generating errors once TypedDict support is added to the type -checker, since TypedDict types are more restrictive than dictionary -types. In particular, they aren't subtypes of dictionary types. +* As an exception to the general rule around non-literal keys, ``d.get(e)`` and ``e in d`` + should be allowed for TypedDict objects, for an arbitrary expression + ``e`` with type ``str``. The motivation is that these are safe and + can be useful for introspecting TypedDict objects. The static type + of ``d.get(e)`` should be the union of all possible item types in ``d`` + if the string value of ``e`` cannot be determined statically. + (This simplifies to ``object`` if ``d`` is :term:`open`.) -.. _`required-notrequired`: +* ``clear()`` is not safe on :term:`open` TypedDicts since it could remove required items, some of which + may not be directly visible because of :term:`structural` + :term:`assignability `. However, this method is safe on + :term:`closed` TypedDicts and TypedDicts with :term:`extra items` if + there are no required or read-only items and there cannot be any subclasses with required + or read-only items. -``Required`` and ``NotRequired`` --------------------------------- +* ``popitem()`` is similarly unsafe on many TypedDicts, even + if all known items are :term:`non-required`. -(Originally specified in :pep:`655`.) +* ``del obj['key']`` should be rejected unless ``'key'`` is a + non-required, mutable key. + +* Type checkers may allow reading an item using ``d['x']`` even if + the key ``'x'`` is not required, instead of requiring the use of + ``d.get('x')`` or an explicit ``'x' in d`` check. The rationale is + that tracking the existence of keys is difficult to implement in full + generality, and that disallowing this could require many changes to + existing code. + Similarly, type checkers may allow indexed accesses + with arbitrary str keys when a TypedDict is :term:`closed` or has :term:`extra items`. + For example:: -.. _`required`: + def bar(movie: MovieExtraInt, key: str) -> None: + reveal_type(movie[key]) # Revealed type is 'str | int' -The ``typing.Required`` :term:`type qualifier` is used to indicate that a -variable declared in a TypedDict definition is a required key: +* The return types of the ``items()`` and ``values()`` methods can be determined + from the union of all item types in the TypedDict (which would include ``object`` + for :term:`open` TypedDicts). Therefore, type checkers should infer more precise + types for TypedDicts that are not open:: -:: + from typing import TypedDict - class Movie(TypedDict, total=False): - title: Required[str] - year: int + class MovieExtraInt(TypedDict, extra_items=int): + name: str -.. _`notrequired`: + def foo(movie: MovieExtraInt) -> None: + reveal_type(movie.items()) # Revealed type is 'dict_items[str, str | int]' + reveal_type(movie.values()) # Revealed type is 'dict_values[str, str | int]' -Additionally the ``typing.NotRequired`` :term:`type qualifier` is used to -indicate that a variable declared in a TypedDict definition is a -potentially-missing key: - -:: - - class Movie(TypedDict): # implicitly total=True - title: str - year: NotRequired[int] - -It is an error to use ``Required[]`` or ``NotRequired[]`` in any -location that is not an item of a TypedDict. -Type checkers must enforce this restriction. - -It is valid to use ``Required[]`` and ``NotRequired[]`` even for -items where it is redundant, to enable additional explicitness if desired: - -:: - - class Movie(TypedDict): - title: Required[str] # redundant - year: NotRequired[int] - -It is an error to use both ``Required[]`` and ``NotRequired[]`` at the -same time: - -:: - - class Movie(TypedDict): - title: str - year: NotRequired[Required[int]] # ERROR - -Type checkers must enforce this restriction. -The runtime implementations of ``Required[]`` and ``NotRequired[]`` -may also enforce this restriction. - -The :ref:`alternative functional syntax ` -for TypedDict also supports -``Required[]``, ``NotRequired[]``, and ``ReadOnly[]``: - -:: - - Movie = TypedDict('Movie', {'name': str, 'year': NotRequired[int]}) - - -Interaction with ``total=False`` -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -Any TypedDict declared with ``total=False`` is equivalent -to a TypedDict with an implicit ``total=True`` definition with all of its -keys marked as ``NotRequired[]``. - -Therefore: - -:: - - class _MovieBase(TypedDict): # implicitly total=True - title: str - - class Movie(_MovieBase, total=False): - year: int - - -is equivalent to: - -:: - - class _MovieBase(TypedDict): - title: str - - class Movie(_MovieBase): - year: NotRequired[int] - - -Interaction with ``Annotated[]`` -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -``Required[]`` and ``NotRequired[]`` can be used with ``Annotated[]``, -in any nesting order: - -:: - - class Movie(TypedDict): - title: str - year: NotRequired[Annotated[int, ValueRange(-9999, 9999)]] # ok - -:: - - class Movie(TypedDict): - title: str - year: Annotated[NotRequired[int], ValueRange(-9999, 9999)] # ok - -In particular allowing ``Annotated[]`` to be the outermost annotation -for an item allows better interoperability with non-typing uses of -annotations, which may always want ``Annotated[]`` as the outermost annotation -(`discussion `__). - - -Read-only Items ---------------- - -(Originally specified in :pep:`705`.) - -.. _`readonly`: - -``typing.ReadOnly`` type qualifier -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -The ``typing.ReadOnly`` :term:`type qualifier` is used to indicate that an item declared in a ``TypedDict`` definition may not be mutated (added, modified, or removed):: - - from typing import ReadOnly - - class Band(TypedDict): - name: str - members: ReadOnly[list[str]] - - blur: Band = {"name": "blur", "members": []} - blur["name"] = "Blur" # OK: "name" is not read-only - blur["members"] = ["Damon Albarn"] # Type check error: "members" is read-only - blur["members"].append("Damon Albarn") # OK: list is mutable - - -Interaction with other special types -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -``ReadOnly[]`` can be used with ``Required[]``, ``NotRequired[]`` and ``Annotated[]``, in any nesting order: - -:: - - class Movie(TypedDict): - title: ReadOnly[Required[str]] # OK - year: ReadOnly[NotRequired[Annotated[int, ValueRange(-9999, 9999)]]] # OK - -:: - - class Movie(TypedDict): - title: Required[ReadOnly[str]] # OK - year: Annotated[NotRequired[ReadOnly[int]], ValueRange(-9999, 9999)] # OK - - -Inheritance -^^^^^^^^^^^ - -Subclasses can redeclare read-only items as non-read-only, allowing them to be mutated:: - - class NamedDict(TypedDict): - name: ReadOnly[str] - - class Album(NamedDict): - name: str - year: int - - album: Album = { "name": "Flood", "year": 1990 } - album["year"] = 1973 - album["name"] = "Dark Side Of The Moon" # OK: "name" is not read-only in Album - -If a read-only item is not redeclared, it remains read-only:: - - class Album(NamedDict): - year: int - - album: Album = { "name": "Flood", "year": 1990 } - album["name"] = "Dark Side Of The Moon" # Type check error: "name" is read-only in Album - -Subclasses can narrow value types of read-only items:: - - class AlbumCollection(TypedDict): - albums: ReadOnly[Collection[Album]] - - class RecordShop(AlbumCollection): - name: str - albums: ReadOnly[list[Album]] # OK: "albums" is read-only in AlbumCollection - -Subclasses can require items that are read-only but not required in the superclass:: - - class OptionalName(TypedDict): - name: ReadOnly[NotRequired[str]] - - class RequiredName(OptionalName): - name: ReadOnly[Required[str]] - - d: RequiredName = {} # Type check error: "name" required - -Subclasses can combine these rules:: - - class OptionalIdent(TypedDict): - ident: ReadOnly[NotRequired[str | int]] - - class User(OptionalIdent): - ident: str # Required, mutable, and not an int - -Note that these are just consequences of :term:`structural` typing, but they -are highlighted here as the behavior now differs from the rules specified in -:pep:`589`. - -Assignability -^^^^^^^^^^^^^ - -*This section updates the assignability rules described above that were created -prior to the introduction of ReadOnly* - -A TypedDict type ``B`` is :term:`assignable` to a TypedDict type ``A`` if ``B`` -is :term:`structurally ` assignable to ``A``. This is true if and -only if all of the following are satisfied: - -* For each item in ``A``, ``B`` has the corresponding key, unless the item in - ``A`` is read-only, not required, and of top value type - (``ReadOnly[NotRequired[object]]``). -* For each item in ``A``, if ``B`` has the corresponding key, the corresponding - value type in ``B`` is assignable to the value type in ``A``. -* For each non-read-only item in ``A``, its value type is assignable to the - corresponding value type in ``B``, and the corresponding key is not read-only - in ``B``. -* For each required key in ``A``, the corresponding key is required in ``B``. -* For each non-required key in ``A``, if the item is not read-only in ``A``, - the corresponding key is not required in ``B``. - -Discussion: - -* All non-specified items in a TypedDict implicitly have value type - ``ReadOnly[NotRequired[object]]``. - -* Read-only items behave covariantly, as they cannot be mutated. This is - similar to container types such as ``Sequence``, and different from - non-read-only items, which behave invariantly. Example:: - - class A(TypedDict): - x: ReadOnly[int | None] - - class B(TypedDict): - x: int - - def f(a: A) -> None: - print(a["x"] or 0) - - b: B = {"x": 1} - f(b) # Accepted by type checker - -* A TypedDict type ``A`` with no explicit key ``'x'`` is not :term:`assignable` - to a TypedDict type ``B`` with a non-required key ``'x'``, since at runtime - the key ``'x'`` could be present and have an :term:`inconsistent - ` type (which may not be visible through ``A`` due to - :term:`structural` typing). The only exception to this rule is if the item in - ``B`` is read-only, and the value type is of top type (``object``). For - example:: - - class A(TypedDict): - x: int - - class B(TypedDict): - x: int - y: ReadOnly[NotRequired[object]] - - a: A = { "x": 1 } - b: B = a # Accepted by type checker - -Update method -^^^^^^^^^^^^^ - -In addition to existing type checking rules, type checkers should error if a -TypedDict with a read-only item is updated with another TypedDict that declares -that key:: +* The ``update()`` method should not allow mutating a read-only item. + Therefore, type checkers should error if a + TypedDict with a read-only item is updated with another TypedDict that declares + that item:: class A(TypedDict): x: ReadOnly[int] y: int - a1: A = { "x": 1, "y": 2 } - a2: A = { "x": 3, "y": 4 } + a1: A = {"x": 1, "y": 2} + a2: A = {"x": 3, "y": 4} a1.update(a2) # Type check error: "x" is read-only in A -Unless the declared value is of bottom type (:data:`~typing.Never`):: + Unless the declared value is of bottom type (:data:`~typing.Never`):: class B(TypedDict): x: NotRequired[typing.Never] @@ -823,575 +818,15 @@ Unless the declared value is of bottom type (:data:`~typing.Never`):: def update_a(a: A, b: B) -> None: a.update(b) # Accepted by type checker: "x" cannot be set on b -Note: Nothing will ever match the ``Never`` type, so an item annotated with it must be absent. - -Keyword argument typing -^^^^^^^^^^^^^^^^^^^^^^^ - -As discussed in the section :ref:`unpack-kwargs`, an unpacked ``TypedDict`` can be used to annotate ``**kwargs``. Marking one or more of the items of a ``TypedDict`` used in this way as read-only will have no effect on the type signature of the method. However, it *will* prevent the item from being modified in the body of the function:: - - class Args(TypedDict): - key1: int - key2: str - - class ReadOnlyArgs(TypedDict): - key1: ReadOnly[int] - key2: ReadOnly[str] - - class Function(Protocol): - def __call__(self, **kwargs: Unpack[Args]) -> None: ... - - def impl(**kwargs: Unpack[ReadOnlyArgs]) -> None: - kwargs["key1"] = 3 # Type check error: key1 is readonly - - fn: Function = impl # Accepted by type checker: function signatures are identical - -Extra Items and Closed TypedDicts -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -(Originally specified in :pep:`728`.) - -This section discusses the ``extra_items`` and ``closed`` class parameters. - -If ``extra_items`` is specified, extra items are treated as :ref:`non-required -` -items matching the ``extra_items`` argument, whose keys are allowed when -determining :ref:`supported and unsupported operations -`. - -The ``extra_items`` Class Parameter ------------------------------------ - -By default ``extra_items`` is unset. For a TypedDict type that specifies -``extra_items``, during construction, the value type of each unknown item -is expected to be non-required and assignable to the ``extra_items`` argument. -For example:: - - class Movie(TypedDict, extra_items=bool): - name: str - - a: Movie = {"name": "Blade Runner", "novel_adaptation": True} # OK - b: Movie = { - "name": "Blade Runner", - "year": 1982, # Not OK. 'int' is not assignable to 'bool' - } - -Here, ``extra_items=bool`` specifies that items other than ``'name'`` -have a value type of ``bool`` and are non-required. - -The alternative inline syntax is also supported:: - - Movie = TypedDict("Movie", {"name": str}, extra_items=bool) - -Accessing extra items is allowed. Type checkers must infer their value type from -the ``extra_items`` argument:: - - def f(movie: Movie) -> None: - reveal_type(movie["name"]) # Revealed type is 'str' - reveal_type(movie["novel_adaptation"]) # Revealed type is 'bool' - -``extra_items`` is inherited through subclassing:: - - class MovieBase(TypedDict, extra_items=ReadOnly[int | None]): - name: str - - class Movie(MovieBase): - year: int - - a: Movie = {"name": "Blade Runner", "year": None} # Not OK. 'None' is incompatible with 'int' - b: Movie = { - "name": "Blade Runner", - "year": 1982, - "other_extra_key": None, - } # OK - -Here, ``'year'`` in ``a`` is an extra key defined on ``Movie`` whose value type -is ``int``. ``'other_extra_key'`` in ``b`` is another extra key whose value type -must be assignable to the value of ``extra_items`` defined on ``MovieBase``. - -.. _typed-dict-closed: - -The ``closed`` Class Parameter ------------------------------- - -When neither ``extra_items`` nor ``closed=True`` is specified, ``closed=False`` -is assumed. The TypedDict should allow non-required extra items of value type -``ReadOnly[object]`` during inheritance or assignability checks, to -preserve the default TypedDict behavior. Extra keys included in TypedDict -object construction should still be caught, as mentioned :ref:`above `. - -When ``closed=True`` is set, no extra items are allowed. This is equivalent to -``extra_items=Never``, because there can't be a value type that is assignable to -:class:`~typing.Never`. It is a runtime error to use the ``closed`` and -``extra_items`` parameters in the same TypedDict definition. - -Similar to ``total``, only a literal ``True`` or ``False`` is supported as the -value of the ``closed`` argument. Type checkers should reject any non-literal value. - -Passing ``closed=False`` explicitly requests the default TypedDict behavior, -where arbitrary other keys may be present and subclasses may add arbitrary items. -It is a type checker error to pass ``closed=False`` if a superclass has -``closed=True`` or sets ``extra_items``. - -If ``closed`` is not provided, the behavior is inherited from the superclass. -If the superclass is TypedDict itself or the superclass does not have ``closed=True`` -or the ``extra_items`` parameter, the previous TypedDict behavior is preserved: -arbitrary extra items are allowed. If the superclass has ``closed=True``, the -child class is also closed:: - - class BaseMovie(TypedDict, closed=True): - name: str - - class MovieA(BaseMovie): # OK, still closed - pass - - class MovieB(BaseMovie, closed=True): # OK, but redundant - pass - - class MovieC(BaseMovie, closed=False): # Type checker error - pass - -As a consequence of ``closed=True`` being equivalent to ``extra_items=Never``, -the same rules that apply to ``extra_items=Never`` also apply to -``closed=True``. While they both have the same effect, ``closed=True`` is -preferred over ``extra_items=Never``. - -It is possible to use ``closed=True`` when subclassing if the ``extra_items`` -argument is a read-only type:: - - class Movie(TypedDict, extra_items=ReadOnly[str]): - pass - - class MovieClosed(Movie, closed=True): # OK - pass - - class MovieNever(Movie, extra_items=Never): # OK, but 'closed=True' is preferred - pass - -This will be further discussed in -:ref:`a later section `. - -``closed`` is also supported with the functional syntax:: - - Movie = TypedDict("Movie", {"name": str}, closed=True) - -Interaction with Totality -------------------------- - -It is an error to use ``Required[]`` or ``NotRequired[]`` with ``extra_items``. -``total=False`` and ``total=True`` have no effect on ``extra_items`` itself. - -The extra items are non-required, regardless of the `totality -`__ of the -TypedDict. :ref:`Operations ` -that are available to ``NotRequired`` items should also be available to the -extra items:: - - class Movie(TypedDict, extra_items=int): - name: str - - def f(movie: Movie) -> None: - del movie["name"] # Not OK. The value type of 'name' is 'Required[int]' - del movie["year"] # OK. The value type of 'year' is 'NotRequired[int]' - -Interaction with ``Unpack`` ---------------------------- - -For type checking purposes, ``Unpack[SomeTypedDict]`` with extra items should be -treated as its equivalent in regular parameters, and the existing rules for -function parameters still apply:: - - class MovieNoExtra(TypedDict): - name: str - - class MovieExtra(TypedDict, extra_items=int): - name: str - - def f(**kwargs: Unpack[MovieNoExtra]) -> None: ... - def g(**kwargs: Unpack[MovieExtra]) -> None: ... - - # Should be equivalent to: - def f(*, name: str) -> None: ... - def g(*, name: str, **kwargs: int) -> None: ... - - f(name="No Country for Old Men", year=2007) # Not OK. Unrecognized item - g(name="No Country for Old Men", year=2007) # OK - -Interaction with Read-only Items --------------------------------- - -When the ``extra_items`` argument is annotated with the ``ReadOnly[]`` -:term:`type qualifier`, the extra items on the TypedDict have the -properties of read-only items. This interacts with inheritance rules specified -in :ref:`Read-only Items `. - -Notably, if the TypedDict type specifies ``extra_items`` to be read-only, -subclasses of the TypedDict type may redeclare ``extra_items``. - -Because a non-closed TypedDict type implicitly allows non-required extra items -of value type ``ReadOnly[object]``, its subclass can override the -``extra_items`` argument with more specific types. - -More details are discussed in the later sections. - -Inheritance ------------ - -``extra_items`` is inherited in a similar way as a regular ``key: value_type`` -item. As with the other keys, the `inheritance rules -`__ -and :ref:`Read-only Items ` inheritance rules apply. - -We need to reinterpret these rules to define how ``extra_items`` interacts with -them. - - * Changing a field type of a parent TypedDict class in a subclass is not allowed. - -First, it is not allowed to change the value of ``extra_items`` in a subclass -unless it is declared to be ``ReadOnly`` in the superclass:: - - class Parent(TypedDict, extra_items=int | None): - pass - - class Child(Parent, extra_items=int): # Not OK. Like any other TypedDict item, extra_items's type cannot be changed - pass - -Second, ``extra_items=T`` effectively defines the value type of any unnamed -items accepted to the TypedDict and marks them as non-required. Thus, the above -restriction applies to any additional items defined in a subclass. For each item -added in a subclass, all of the following conditions should apply: - -.. _pep728-inheritance-read-only: - -- If ``extra_items`` is read-only - - - The item can be either required or non-required - - - The item's value type is :term:`assignable` to ``T`` - -- If ``extra_items`` is not read-only - - - The item is non-required - - - The item's value type is :term:`consistent` with ``T`` - -- If ``extra_items`` is not overridden, the subclass inherits it as-is. - -For example:: - - class MovieBase(TypedDict, extra_items=int | None): - name: str - - class MovieRequiredYear(MovieBase): # Not OK. Required key 'year' is not known to 'MovieBase' - year: int | None - - class MovieNotRequiredYear(MovieBase): # Not OK. 'int | None' is not consistent with 'int' - year: NotRequired[int] - - class MovieWithYear(MovieBase): # OK - year: NotRequired[int | None] - - class BookBase(TypedDict, extra_items=ReadOnly[int | str]): - title: str - - class Book(BookBase, extra_items=str): # OK - year: int # OK - -An important side effect of the inheritance rules is that we can define a -TypedDict type that disallows additional items:: - - class MovieClosed(TypedDict, extra_items=Never): - name: str - -Here, passing the value :class:`~typing.Never` to ``extra_items`` specifies that -there can be no other keys in ``MovieFinal`` other than the known ones. -Because of its potential common use, there is a preferred alternative:: - - class MovieClosed(TypedDict, closed=True): - name: str - -where we implicitly assume that ``extra_items=Never``. - -Assignability -------------- - -Let ``S`` be the set of keys of the explicitly defined items on a TypedDict -type. If it specifies ``extra_items=T``, the TypedDict type is considered to -have an infinite set of items that all satisfy the following conditions. - -- If ``extra_items`` is read-only: - - - The key's value type is :term:`assignable` to ``T``. - - - The key is not in ``S``. - -- If ``extra_items`` is not read-only: - - - The key is non-required. - - - The key's value type is :term:`consistent` with ``T``. - - - The key is not in ``S``. - -For type checking purposes, let ``extra_items`` be a non-required pseudo-item -when checking for assignability according to rules defined in the -:ref:`Read-only Items ` section, with a new rule added in bold -text as follows: - - A TypedDict type ``B`` is :term:`assignable` to a TypedDict type - ``A`` if ``B`` is :term:`structurally ` assignable to - ``A``. This is true if and only if all of the following are satisfied: - - * **[If no key with the same name can be found in ``B``, the 'extra_items' - argument is considered the value type of the corresponding key.]** - - * For each item in ``A``, ``B`` has the corresponding key, unless the item in - ``A`` is read-only, not required, and of top value type - (``ReadOnly[NotRequired[object]]``). - - * For each item in ``A``, if ``B`` has the corresponding key, the corresponding - value type in ``B`` is assignable to the value type in ``A``. - - * For each non-read-only item in ``A``, its value type is assignable to the - corresponding value type in ``B``, and the corresponding key is not read-only - in ``B``. - - * For each required key in ``A``, the corresponding key is required in ``B``. - - * For each non-required key in ``A``, if the item is not read-only in ``A``, - the corresponding key is not required in ``B``. - -The following examples illustrate these checks in action. - -``extra_items`` puts various restrictions on additional items for assignability -checks:: - - class Movie(TypedDict, extra_items=int | None): - name: str - - class MovieDetails(TypedDict, extra_items=int | None): - name: str - year: NotRequired[int] - - details: MovieDetails = {"name": "Kill Bill Vol. 1", "year": 2003} - movie: Movie = details # Not OK. While 'int' is assignable to 'int | None', - # 'int | None' is not assignable to 'int' - - class MovieWithYear(TypedDict, extra_items=int | None): - name: str - year: int | None - - details: MovieWithYear = {"name": "Kill Bill Vol. 1", "year": 2003} - movie: Movie = details # Not OK. 'year' is not required in 'Movie', - # but it is required in 'MovieWithYear' - -where ``MovieWithYear`` (B) is not assignable to ``Movie`` (A) -according to this rule: - - * For each non-required key in ``A``, if the item is not read-only in ``A``, - the corresponding key is not required in ``B``. - -When ``extra_items`` is specified to be read-only on a TypedDict type, it is -possible for an item to have a :term:`narrower ` type than the -``extra_items`` argument:: - - class Movie(TypedDict, extra_items=ReadOnly[str | int]): - name: str - - class MovieDetails(TypedDict, extra_items=int): - name: str - year: NotRequired[int] - - details: MovieDetails = {"name": "Kill Bill Vol. 2", "year": 2004} - movie: Movie = details # OK. 'int' is assignable to 'str | int'. - -This behaves the same way as if ``year: ReadOnly[str | int]`` is an item -explicitly defined in ``Movie``. - -``extra_items`` as a pseudo-item follows the same rules that other items have, -so when both TypedDicts types specify ``extra_items``, this check is naturally -enforced:: - - class MovieExtraInt(TypedDict, extra_items=int): - name: str - - class MovieExtraStr(TypedDict, extra_items=str): - name: str - - extra_int: MovieExtraInt = {"name": "No Country for Old Men", "year": 2007} - extra_str: MovieExtraStr = {"name": "No Country for Old Men", "description": ""} - extra_int = extra_str # Not OK. 'str' is not assignable to extra items type 'int' - extra_str = extra_int # Not OK. 'int' is not assignable to extra items type 'str' - -A non-closed TypedDict type implicitly allows non-required extra keys of value -type ``ReadOnly[object]``. Applying the assignability rules between this type -and a closed TypedDict type is allowed:: - - class MovieNotClosed(TypedDict): - name: str - - extra_int: MovieExtraInt = {"name": "No Country for Old Men", "year": 2007} - not_closed: MovieNotClosed = {"name": "No Country for Old Men"} - extra_int = not_closed # Not OK. - # 'extra_items=ReadOnly[object]' implicitly on 'MovieNotClosed' - # is not assignable to with 'extra_items=int' - not_closed = extra_int # OK - -Interaction with Constructors ------------------------------ + Note: Nothing will ever match the ``Never`` type, so an item annotated with it must be absent. -TypedDicts that allow extra items of type ``T`` also allow arbitrary keyword -arguments of this type when constructed by calling the class object:: - - class NonClosedMovie(TypedDict): - name: str - - NonClosedMovie(name="No Country for Old Men") # OK - NonClosedMovie(name="No Country for Old Men", year=2007) # Not OK. Unrecognized item - - class ExtraMovie(TypedDict, extra_items=int): - name: str - - ExtraMovie(name="No Country for Old Men") # OK - ExtraMovie(name="No Country for Old Men", year=2007) # OK - ExtraMovie( - name="No Country for Old Men", - language="English", - ) # Not OK. Wrong type for extra item 'language' - - # This implies 'extra_items=Never', - # so extra keyword arguments would produce an error - class ClosedMovie(TypedDict, closed=True): - name: str - - ClosedMovie(name="No Country for Old Men") # OK - ClosedMovie( - name="No Country for Old Men", - year=2007, - ) # Not OK. Extra items not allowed - -Supported and Unsupported Operations ------------------------------------- - -This statement from :ref:`above ` still holds true. - - Operations with arbitrary str keys (instead of string literals or other - expressions with known string values) should generally be rejected. - -Operations that already apply to ``NotRequired`` items should generally also -apply to extra items, following the same rationale from :ref:`above `: - - The exact type checking rules are up to each type checker to decide. In some - cases potentially unsafe operations may be accepted if the alternative is to - generate false positive errors for idiomatic code. - -Some operations, including indexed accesses and assignments with arbitrary str keys, -may be allowed due to the TypedDict being :term:`assignable` to -``Mapping[str, VT]`` or ``dict[str, VT]``. The two following sections will expand -on that. - -Interaction with Mapping[str, VT] ---------------------------------- - -A TypedDict type is :term:`assignable` to a type of the form ``Mapping[str, VT]`` -when all value types of the items in the TypedDict -are assignable to ``VT``. For the purpose of this rule, a -TypedDict that does not have ``extra_items=`` or ``closed=`` set is considered -to have an item with a value of type ``ReadOnly[object]``. This extends the -general rule for :ref:`TypedDict assignability `. - -For example:: - - class MovieExtraStr(TypedDict, extra_items=str): - name: str - - extra_str: MovieExtraStr = {"name": "Blade Runner", "summary": ""} - str_mapping: Mapping[str, str] = extra_str # OK - - class MovieExtraInt(TypedDict, extra_items=int): - name: str - - extra_int: MovieExtraInt = {"name": "Blade Runner", "year": 1982} - int_mapping: Mapping[str, int] = extra_int # Not OK. 'int | str' is not assignable with 'int' - int_str_mapping: Mapping[str, int | str] = extra_int # OK - -Type checkers should infer the precise signatures of ``values()`` and ``items()`` -on such TypedDict types:: - - def foo(movie: MovieExtraInt) -> None: - reveal_type(movie.items()) # Revealed type is 'dict_items[str, str | int]' - reveal_type(movie.values()) # Revealed type is 'dict_values[str, str | int]' - -By extension of this assignability rule, type checkers may allow indexed accesses -with arbitrary str keys when ``extra_items`` or ``closed=True`` is specified. -For example:: - - def bar(movie: MovieExtraInt, key: str) -> None: - reveal_type(movie[key]) # Revealed type is 'str | int' - -.. _pep728-type-narrowing: - -Defining the type narrowing behavior for TypedDict is out-of-scope for this spec. -This leaves flexibility for a type checker to be more/less restrictive about -indexed accesses with arbitrary str keys. For example, a type checker may opt -for more restriction by requiring an explicit ``'x' in d`` check. - -Interaction with dict[str, VT] ------------------------------- - -Because the presence of ``extra_items`` on a closed TypedDict type -prohibits additional required keys in its :term:`structural` -:term:`subtypes `, we can determine if the TypedDict type and -its structural subtypes will ever have any required key during static analysis. - -The TypedDict type is :term:`assignable` to ``dict[str, VT]`` if all -items on the TypedDict type satisfy the following conditions: - -- The value type of the item is :term:`consistent` with ``VT``. - -- The item is not read-only. - -- The item is not required. - -For example:: - - class IntDict(TypedDict, extra_items=int): - pass - - class IntDictWithNum(IntDict): - num: NotRequired[int] - - def f(x: IntDict) -> None: - v: dict[str, int] = x # OK - v.clear() # OK - - not_required_num_dict: IntDictWithNum = {"num": 1, "bar": 2} - regular_dict: dict[str, int] = not_required_num_dict # OK - f(not_required_num_dict) # OK - -In this case, methods that are previously unavailable on a TypedDict are allowed, -with signatures matching ``dict[str, VT]`` -(e.g.: ``__setitem__(self, key: str, value: VT) -> None``):: - - not_required_num_dict.clear() # OK - - reveal_type(not_required_num_dict.popitem()) # OK. Revealed type is 'tuple[str, int]' - - def f(not_required_num_dict: IntDictWithNum, key: str): - not_required_num_dict[key] = 42 # OK - del not_required_num_dict[key] # OK - -:ref:`Notes on indexed accesses ` from the previous section -still apply. - -``dict[str, VT]`` is not assignable to a TypedDict type, -because such dict can be a subtype of dict:: - - class CustomDict(dict[str, int]): - pass - - def f(might_not_be_a_builtin_dict: dict[str, int]): - int_dict: IntDict = might_not_be_a_builtin_dict # Not OK +Backwards Compatibility +----------------------- - not_a_builtin_dict = CustomDict({"num": 1}) - f(not_a_builtin_dict) +To retain backwards compatibility, type checkers should not infer a +TypedDict type unless it is sufficiently clear that this is desired by +the programmer. When unsure, an ordinary dictionary type should be +inferred. Otherwise existing code that type checks without errors may +start generating errors once TypedDict support is added to the type +checker, since TypedDict types are more restrictive than dictionary +types. In particular, they aren't subtypes of dictionary types. From f90337754903d5083c8adcb69be49589e7f57631 Mon Sep 17 00:00:00 2001 From: Danny Yang Date: Tue, 14 Oct 2025 14:09:14 -0400 Subject: [PATCH 148/308] Clarify namedtuple member rules (#1979) * add field name restrictions to namedtuple spec * add conformance tests for namedtuple spec changes * regenerate results * mark tests as partial * fix conformance_automated * Regenerate results. --------- Co-authored-by: Rebecca Chen --- .../mypy/namedtuples_define_class.toml | 16 ++++++++--- .../mypy/namedtuples_define_functional.toml | 3 ++- .../pyrefly/namedtuples_define_class.toml | 17 +++++++----- .../namedtuples_define_functional.toml | 3 ++- .../pyright/namedtuples_define_class.toml | 10 ++++--- .../namedtuples_define_functional.toml | 11 +++++--- conformance/results/results.html | 4 +-- .../zuban/namedtuples_define_class.toml | 12 ++++++--- .../zuban/namedtuples_define_functional.toml | 3 ++- conformance/tests/namedtuples_define_class.py | 27 +++++++++++++++++++ .../tests/namedtuples_define_functional.py | 25 +++++++++-------- docs/spec/namedtuples.rst | 26 +++++++++++++----- 12 files changed, 113 insertions(+), 44 deletions(-) diff --git a/conformance/results/mypy/namedtuples_define_class.toml b/conformance/results/mypy/namedtuples_define_class.toml index adf590b48..575c5c0c8 100644 --- a/conformance/results/mypy/namedtuples_define_class.toml +++ b/conformance/results/mypy/namedtuples_define_class.toml @@ -11,11 +11,19 @@ namedtuples_define_class.py:46: error: Argument 2 to "Point" has incompatible ty namedtuples_define_class.py:47: error: Argument "units" to "Point" has incompatible type "int"; expected "str" [arg-type] namedtuples_define_class.py:48: error: Too many arguments for "Point" [call-arg] namedtuples_define_class.py:49: error: Unexpected keyword argument "other" for "Point" [call-arg] -namedtuples_define_class.py:59: error: Non-default NamedTuple fields cannot follow default fields [misc] -namedtuples_define_class.py:98: error: Argument 2 to "Property" has incompatible type "float"; expected "str" [arg-type] -namedtuples_define_class.py:105: error: NamedTuple should be a single base [misc] +namedtuples_define_class.py:59: error: Invalid statement in NamedTuple definition; expected "field_name: field_type [= default]" [misc] +namedtuples_define_class.py:65: error: Missing positional argument "units" in call to "Point2" [call-arg] +namedtuples_define_class.py:67: error: Too many values to unpack (2 expected, 3 provided) [misc] +namedtuples_define_class.py:76: error: NamedTuple field name cannot start with an underscore: _y [misc] +namedtuples_define_class.py:86: error: Non-default NamedTuple fields cannot follow default fields [misc] +namedtuples_define_class.py:125: error: Argument 2 to "Property" has incompatible type "float"; expected "str" [arg-type] +namedtuples_define_class.py:132: error: NamedTuple should be a single base [misc] """ conformance_automated = "Fail" errors_diff = """ -Line 79: Expected 1 errors +Line 69: Expected 1 errors +Line 106: Expected 1 errors +Line 59: Unexpected errors ['namedtuples_define_class.py:59: error: Invalid statement in NamedTuple definition; expected "field_name: field_type [= default]" [misc]'] +Line 65: Unexpected errors ['namedtuples_define_class.py:65: error: Missing positional argument "units" in call to "Point2" [call-arg]'] +Line 67: Unexpected errors ['namedtuples_define_class.py:67: error: Too many values to unpack (2 expected, 3 provided) [misc]'] """ diff --git a/conformance/results/mypy/namedtuples_define_functional.toml b/conformance/results/mypy/namedtuples_define_functional.toml index 151e6588b..6356dc8c5 100644 --- a/conformance/results/mypy/namedtuples_define_functional.toml +++ b/conformance/results/mypy/namedtuples_define_functional.toml @@ -11,7 +11,8 @@ namedtuples_define_functional.py:43: error: Argument "x" to "Point6" has incompa namedtuples_define_functional.py:52: error: "namedtuple()" has duplicate field name "a" [misc] namedtuples_define_functional.py:53: error: "namedtuple()" field name "def" is a keyword [misc] namedtuples_define_functional.py:54: error: "namedtuple()" field name "def" is a keyword [misc] -namedtuples_define_functional.py:66: error: Missing positional argument "a" in call to "NT5" [call-arg] +namedtuples_define_functional.py:55: error: "namedtuple()" field name "_d" starts with an underscore [misc] +namedtuples_define_functional.py:69: error: Missing positional argument "a" in call to "NT7" [call-arg] """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyrefly/namedtuples_define_class.toml b/conformance/results/pyrefly/namedtuples_define_class.toml index fd191957f..0d85f64ed 100644 --- a/conformance/results/pyrefly/namedtuples_define_class.toml +++ b/conformance/results/pyrefly/namedtuples_define_class.toml @@ -1,6 +1,10 @@ -conformant = "Pass" -conformance_automated = "Pass" +conformant = "Partial" +notes = """ +Doesn't catch illegal field name starting with underscore +""" +conformance_automated = "Fail" errors_diff = """ +Line 76: Expected 1 errors """ output = """ ERROR namedtuples_define_class.py:32:7-12: Index 3 out of range for tuple with 3 elements [index-error] @@ -11,8 +15,9 @@ ERROR namedtuples_define_class.py:46:15-17: Argument `Literal['']` is not assign ERROR namedtuples_define_class.py:47:24-25: Argument `Literal[3]` is not assignable to parameter `units` with type `str` in function `Point.__new__` [bad-argument-type] ERROR namedtuples_define_class.py:48:22-24: Expected 3 positional arguments, got 4 in function `Point.__new__` [bad-argument-count] ERROR namedtuples_define_class.py:49:23-28: Unexpected keyword argument `other` in function `Point.__new__` [unexpected-keyword] -ERROR namedtuples_define_class.py:59:5-13: NamedTuple field 'latitude' without a default may not follow NamedTuple field with a default [bad-class-definition] -ERROR namedtuples_define_class.py:79:5-6: Cannot override named tuple element `x` [bad-override] -ERROR namedtuples_define_class.py:98:19-22: Argument `float` is not assignable to parameter `value` with type `str` in function `Property.__new__` [bad-argument-type] -ERROR namedtuples_define_class.py:105:7-11: Named tuples do not support multiple inheritance [invalid-inheritance] +ERROR namedtuples_define_class.py:69:20-22: Expected 2 positional arguments, got 3 in function `Point2.__new__` [bad-argument-count] +ERROR namedtuples_define_class.py:86:5-13: NamedTuple field 'latitude' without a default may not follow NamedTuple field with a default [bad-class-definition] +ERROR namedtuples_define_class.py:106:5-6: Cannot override named tuple element `x` [bad-override] +ERROR namedtuples_define_class.py:125:19-22: Argument `float` is not assignable to parameter `value` with type `str` in function `Property.__new__` [bad-argument-type] +ERROR namedtuples_define_class.py:132:7-11: Named tuples do not support multiple inheritance [invalid-inheritance] """ diff --git a/conformance/results/pyrefly/namedtuples_define_functional.toml b/conformance/results/pyrefly/namedtuples_define_functional.toml index 35a386907..40c47f739 100644 --- a/conformance/results/pyrefly/namedtuples_define_functional.toml +++ b/conformance/results/pyrefly/namedtuples_define_functional.toml @@ -16,5 +16,6 @@ ERROR namedtuples_define_functional.py:43:17-20: Argument `float` is not assigna ERROR namedtuples_define_functional.py:52:31-34: Duplicate field `a` [bad-class-definition] ERROR namedtuples_define_functional.py:53:33-38: `def` is not a valid identifier [bad-class-definition] ERROR namedtuples_define_functional.py:54:33-38: `def` is not a valid identifier [bad-class-definition] -ERROR namedtuples_define_functional.py:66:4-6: Missing argument `a` in function `NT5.__new__` [missing-argument] +ERROR namedtuples_define_functional.py:55:33-37: NamedTuple field name may not start with an underscore: `_d` [bad-class-definition] +ERROR namedtuples_define_functional.py:69:4-6: Missing argument `a` in function `NT7.__new__` [missing-argument] """ diff --git a/conformance/results/pyright/namedtuples_define_class.toml b/conformance/results/pyright/namedtuples_define_class.toml index 19f9aadcb..e04b26fce 100644 --- a/conformance/results/pyright/namedtuples_define_class.toml +++ b/conformance/results/pyright/namedtuples_define_class.toml @@ -10,11 +10,13 @@ namedtuples_define_class.py:47:24 - error: Argument of type "Literal[3]" cannot   "Literal[3]" is not assignable to "str" (reportArgumentType) namedtuples_define_class.py:48:22 - error: Expected 3 positional arguments (reportCallIssue) namedtuples_define_class.py:49:23 - error: No parameter named "other" (reportCallIssue) -namedtuples_define_class.py:59:5 - error: Fields without default values cannot appear after fields with default values (reportGeneralTypeIssues) -namedtuples_define_class.py:79:5 - error: Cannot override "x" because parent class "Point" is a named tuple (reportIncompatibleVariableOverride) -namedtuples_define_class.py:98:19 - error: Argument of type "float" cannot be assigned to parameter "value" of type "str" in function "__new__" +namedtuples_define_class.py:69:20 - error: Expected 2 positional arguments (reportCallIssue) +namedtuples_define_class.py:76:5 - error: Named tuple field names cannot start with an underscore (reportGeneralTypeIssues) +namedtuples_define_class.py:86:5 - error: Fields without default values cannot appear after fields with default values (reportGeneralTypeIssues) +namedtuples_define_class.py:106:5 - error: Cannot override "x" because parent class "Point" is a named tuple (reportIncompatibleVariableOverride) +namedtuples_define_class.py:125:19 - error: Argument of type "float" cannot be assigned to parameter "value" of type "str" in function "__new__"   "float" is not assignable to "str" (reportArgumentType) -namedtuples_define_class.py:105:7 - error: Multiple inheritance with NamedTuple is not supported (reportGeneralTypeIssues) +namedtuples_define_class.py:132:7 - error: Multiple inheritance with NamedTuple is not supported (reportGeneralTypeIssues) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/namedtuples_define_functional.toml b/conformance/results/pyright/namedtuples_define_functional.toml index 07c432045..266f4083f 100644 --- a/conformance/results/pyright/namedtuples_define_functional.toml +++ b/conformance/results/pyright/namedtuples_define_functional.toml @@ -1,4 +1,4 @@ -conformant = "Pass" +conformant = "Partial" output = """ namedtuples_define_functional.py:16:8 - error: Argument missing for parameter "y" (reportCallIssue) namedtuples_define_functional.py:21:8 - error: Arguments missing for parameters "x", "y" (reportCallIssue) @@ -15,8 +15,13 @@ namedtuples_define_functional.py:43:17 - error: Argument of type "float" cannot namedtuples_define_functional.py:52:31 - error: Names within a named tuple must be unique (reportGeneralTypeIssues) namedtuples_define_functional.py:53:33 - error: Field names cannot be a keyword (reportGeneralTypeIssues) namedtuples_define_functional.py:54:33 - error: Field names cannot be a keyword (reportGeneralTypeIssues) -namedtuples_define_functional.py:66:1 - error: Argument missing for parameter "a" (reportCallIssue) +namedtuples_define_functional.py:55:33 - error: Named tuple field names cannot start with an underscore (reportGeneralTypeIssues) +namedtuples_define_functional.py:59:33 - error: Named tuple field names cannot start with an underscore (reportGeneralTypeIssues) +namedtuples_define_functional.py:60:13 - error: No parameter named "_1" (reportCallIssue) +namedtuples_define_functional.py:69:1 - error: Argument missing for parameter "a" (reportCallIssue) """ -conformance_automated = "Pass" +conformance_automated = "Fail" errors_diff = """ +Line 59: Unexpected errors ['namedtuples_define_functional.py:59:33 - error: Named tuple field names cannot start with an underscore (reportGeneralTypeIssues)'] +Line 60: Unexpected errors ['namedtuples_define_functional.py:60:13 - error: No parameter named "_1" (reportCallIssue)'] """ diff --git a/conformance/results/results.html b/conformance/results/results.html index c632a1172..79ecbdd8b 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -915,11 +915,11 @@

    Python Type System Conformance Test Results

    - + - + diff --git a/conformance/results/zuban/namedtuples_define_class.toml b/conformance/results/zuban/namedtuples_define_class.toml index 397c708f7..67acdb24b 100644 --- a/conformance/results/zuban/namedtuples_define_class.toml +++ b/conformance/results/zuban/namedtuples_define_class.toml @@ -4,7 +4,8 @@ Does not reject override of named tuple attribute in child class. """ conformance_automated = "Fail" errors_diff = """ -Line 79: Expected 1 errors +Line 106: Expected 1 errors +Line 59: Unexpected errors ['namedtuples_define_class.py:59: error: Invalid statement in NamedTuple definition; expected "field_name: field_type [= default]" [misc]'] """ output = """ namedtuples_define_class.py:32: error: Tuple index out of range [misc] @@ -15,7 +16,10 @@ namedtuples_define_class.py:46: error: Argument 2 to "Point" has incompatible ty namedtuples_define_class.py:47: error: Argument "units" to "Point" has incompatible type "int"; expected "str" [arg-type] namedtuples_define_class.py:48: error: Too many arguments for "Point" [call-arg] namedtuples_define_class.py:49: error: Unexpected keyword argument "other" for "Point" [call-arg] -namedtuples_define_class.py:59: error: Non-default NamedTuple fields cannot follow default fields [misc] -namedtuples_define_class.py:98: error: Argument 2 to "Property" has incompatible type "float"; expected "str" [arg-type] -namedtuples_define_class.py:105: error: NamedTuple should be a single base [misc] +namedtuples_define_class.py:59: error: Invalid statement in NamedTuple definition; expected "field_name: field_type [= default]" [misc] +namedtuples_define_class.py:69: error: Too many arguments for "Point2" [call-arg] +namedtuples_define_class.py:76: error: NamedTuple field name cannot start with an underscore: _y [misc] +namedtuples_define_class.py:86: error: Non-default NamedTuple fields cannot follow default fields [misc] +namedtuples_define_class.py:125: error: Argument 2 to "Property" has incompatible type "float"; expected "str" [arg-type] +namedtuples_define_class.py:132: error: NamedTuple should be a single base [misc] """ diff --git a/conformance/results/zuban/namedtuples_define_functional.toml b/conformance/results/zuban/namedtuples_define_functional.toml index 5a6041664..98ee2d2fd 100644 --- a/conformance/results/zuban/namedtuples_define_functional.toml +++ b/conformance/results/zuban/namedtuples_define_functional.toml @@ -13,5 +13,6 @@ namedtuples_define_functional.py:43: error: Argument "x" to "Point6" has incompa namedtuples_define_functional.py:52: error: "namedtuple()" has duplicate field name "a" [misc] namedtuples_define_functional.py:53: error: "namedtuple()" field name "def" is a keyword [misc] namedtuples_define_functional.py:54: error: "namedtuple()" field name "def" is a keyword [misc] -namedtuples_define_functional.py:66: error: Missing positional argument "a" in call to "NT5" [call-arg] +namedtuples_define_functional.py:55: error: "namedtuple()" field name "_d" starts with an underscore [misc] +namedtuples_define_functional.py:69: error: Missing positional argument "a" in call to "NT7" [call-arg] """ diff --git a/conformance/tests/namedtuples_define_class.py b/conformance/tests/namedtuples_define_class.py index e345a197d..5e6e9c4cc 100644 --- a/conformance/tests/namedtuples_define_class.py +++ b/conformance/tests/namedtuples_define_class.py @@ -49,6 +49,33 @@ class Point(NamedTuple): p10 = Point(1, 2, "", other="") # E +# > Fields must be annotated attributes - methods and un-annotated attributes are not +# > considered fields. + + +class Point2(NamedTuple): + x: int + y: int + units = "meters" # Not a field + + def is_origin(self) -> int: # Not a field + return self.x == 0 and self.y == 0 + + +p11 = Point2(1, 2) +assert_type(p11, Point2) +x, y = p11 + +p12 = Point2(1, 2, "") # E + + +# > Field names may not start with an underscore. + +class Point3(NamedTuple): + x: int + _y: int # E: illegal field name + + # > The runtime implementation of ``NamedTuple`` enforces that fields with default # > values must come after fields without default values. Type checkers should # > likewise enforce this restriction:: diff --git a/conformance/tests/namedtuples_define_functional.py b/conformance/tests/namedtuples_define_functional.py index 432dff735..49f7c1b0c 100644 --- a/conformance/tests/namedtuples_define_functional.py +++ b/conformance/tests/namedtuples_define_functional.py @@ -43,24 +43,27 @@ p6_4 = Point6(x=1.1, y=2) # E -# > At runtime, the ``namedtuple`` function disallows field names that are -# > illegal Python identifiers and either raises an exception or replaces these -# > fields with a parameter name of the form ``_N``. The behavior depends on -# > the value of the ``rename`` argument. Type checkers may replicate this -# > behavior statically. +# > At runtime, the ``namedtuple`` function disallows field names that begin with +# > an underscore or are illegal Python identifiers, and either raises an exception +# > or replaces these fields with a parameter name of the form ``_N``. The behavior +# > depends on the value of the ``rename`` argument. Type checkers may replicate +# > this behavior statically. NT1 = namedtuple("NT1", ["a", "a"]) # E?: duplicate field name NT2 = namedtuple("NT2", ["abc", "def"]) # E?: illegal field name NT3 = namedtuple("NT3", ["abc", "def"], rename=False) # E?: illegal field name +NT4 = namedtuple("NT4", ["abc", "_d"], rename=False) # E?: illegal field name -NT4 = namedtuple("NT4", ["abc", "def"], rename=True) # OK -NT4(abc="", _1="") # OK +NT5 = namedtuple("NT5", ["abc", "def"], rename=True) # OK +NT5(abc="", _1="") # OK +NT6 = namedtuple("NT6", ["abc", "_d"], rename=True) # OK +NT6(abc="", _1="") # OK # > The ``namedtuple`` function also supports a ``defaults`` keyword argument that # > specifies default values for the fields. Type checkers may support this. -NT5 = namedtuple("NT5", "a b c", defaults=(1, 2)) -NT5(1) # OK -NT5(1, 2, 3) # OK -NT5() # E: too few arguments +NT7 = namedtuple("NT7", "a b c", defaults=(1, 2)) +NT7(1) # OK +NT7(1, 2, 3) # OK +NT7() # E: too few arguments diff --git a/docs/spec/namedtuples.rst b/docs/spec/namedtuples.rst index 1ac141365..936d2fa79 100644 --- a/docs/spec/namedtuples.rst +++ b/docs/spec/namedtuples.rst @@ -20,6 +20,14 @@ Type checkers should support the class syntax:: y: int units: str = "meters" +Fields must be annotated attributes - methods and un-annotated attributes are not +considered fields. Field names may not start with an underscore. + + class MyTuple(NamedTuple): + x1 = 1 # Not a field + def x2() -> None: pass # Not a field + _x3: int # Type error: illegal field name + Regardless of whether the class syntax or factory function call is used to define a named tuple, type checkers should synthesize a ``__new__`` method based on the named tuple fields. This mirrors the runtime behavior. In the example @@ -79,17 +87,21 @@ A type checker may support the factory function call in its various forms:: Point5 = NamedTuple('Point5', [('x', int), ('y', int)]) Point6 = NamedTuple('Point6', (('x', int), ('y', int))) -At runtime, the ``namedtuple`` function disallows field names that are -illegal Python identifiers and either raises an exception or replaces these -fields with a parameter name of the form ``_N``. The behavior depends on -the value of the ``rename`` argument. Type checkers may replicate this -behavior statically:: +At runtime, the ``namedtuple`` function disallows field names that begin with +an underscore or are illegal Python identifiers, and either raises an exception +or replaces these fields with a parameter name of the form ``_N``. The behavior +depends on the value of the ``rename`` argument. Type checkers may replicate +this behavior statically:: NT1 = namedtuple("NT1", ["a", "a"]) # Type error (duplicate field name) NT2 = namedtuple("NT2", ["abc", "def"], rename=False) # Type error (illegal field name) + NT3 = namedtuple("NT3", ["abc", "_d"], rename=False) # Type error (illegal field name) + + NT4 = namedtuple("NT4", ["abc", "def"], rename=True) # OK + NT4(abc="", _1="") # OK - NT3 = namedtuple("NT3", ["abc", "def"], rename=True) # OK - NT3(abc="", _1="") # OK + NT5 = namedtuple("NT5", ["abc", "_d"], rename=True) # OK + NT5(abc="", _1="") # OK The ``namedtuple`` function also supports a ``defaults`` keyword argument that specifies default values for the fields. Type checkers may support this:: From 92d4739390717bba0dc07e9f0760f6adb7103759 Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Tue, 14 Oct 2025 11:21:59 -0700 Subject: [PATCH 149/308] Specify that assert_type() uses equivalence (#2011) * Specify that assert_type() uses equivalence * more lenient * updates * pyright is passing * rerun * Regenerate results. --------- Co-authored-by: Rebecca Chen --- .../results/mypy/directives_assert_type.toml | 15 ++++++++------- .../results/pyrefly/directives_assert_type.toml | 11 ++++++----- .../results/pyright/directives_assert_type.toml | 12 +++++++----- .../results/zuban/directives_assert_type.toml | 12 +++++++----- conformance/tests/directives_assert_type.py | 8 ++++++++ docs/spec/directives.rst | 14 +++++++++++++- 6 files changed, 49 insertions(+), 23 deletions(-) diff --git a/conformance/results/mypy/directives_assert_type.toml b/conformance/results/mypy/directives_assert_type.toml index a8feed5ee..61e4a8a27 100644 --- a/conformance/results/mypy/directives_assert_type.toml +++ b/conformance/results/mypy/directives_assert_type.toml @@ -1,13 +1,14 @@ conformant = "Pass" output = """ directives_assert_type.py:27: error: Expression is of type "int | str", not "int" [assert-type] -directives_assert_type.py:28: error: Expression is of type "Any", not "int" [assert-type] -directives_assert_type.py:29: error: Expression is of type "Literal[4]", not "int" [assert-type] -directives_assert_type.py:31: error: "assert_type" expects 2 arguments [misc] -directives_assert_type.py:31: error: Too few arguments for "assert_type" [call-arg] -directives_assert_type.py:32: error: Expression is of type "Literal['']", not "int" [assert-type] -directives_assert_type.py:33: error: "assert_type" expects 2 arguments [misc] -directives_assert_type.py:33: error: Too many arguments for "assert_type" [call-arg] +directives_assert_type.py:28: error: Expression is of type "int | str", not "Any" [assert-type] +directives_assert_type.py:29: error: Expression is of type "Any", not "int" [assert-type] +directives_assert_type.py:30: error: Expression is of type "Literal[4]", not "int" [assert-type] +directives_assert_type.py:32: error: "assert_type" expects 2 arguments [misc] +directives_assert_type.py:32: error: Too few arguments for "assert_type" [call-arg] +directives_assert_type.py:33: error: Expression is of type "Literal['']", not "int" [assert-type] +directives_assert_type.py:34: error: "assert_type" expects 2 arguments [misc] +directives_assert_type.py:34: error: Too many arguments for "assert_type" [call-arg] """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyrefly/directives_assert_type.toml b/conformance/results/pyrefly/directives_assert_type.toml index 35e07db7e..bafeb7409 100644 --- a/conformance/results/pyrefly/directives_assert_type.toml +++ b/conformance/results/pyrefly/directives_assert_type.toml @@ -4,9 +4,10 @@ errors_diff = """ """ output = """ ERROR directives_assert_type.py:27:16-24: assert_type(int | str, int) failed [assert-type] -ERROR directives_assert_type.py:28:16-24: assert_type(Any, int) failed [assert-type] -ERROR directives_assert_type.py:29:16-24: assert_type(Literal[4], int) failed [assert-type] -ERROR directives_assert_type.py:31:16-18: assert_type needs 2 positional arguments, got 0 [bad-argument-count] -ERROR directives_assert_type.py:32:16-25: assert_type(Literal[''], int) failed [assert-type] -ERROR directives_assert_type.py:33:16-33: assert_type needs 2 positional arguments, got 3 [bad-argument-count] +ERROR directives_assert_type.py:28:16-24: assert_type(int | str, Any) failed [assert-type] +ERROR directives_assert_type.py:29:16-24: assert_type(Any, int) failed [assert-type] +ERROR directives_assert_type.py:30:16-24: assert_type(Literal[4], int) failed [assert-type] +ERROR directives_assert_type.py:32:16-18: assert_type needs 2 positional arguments, got 0 [bad-argument-count] +ERROR directives_assert_type.py:33:16-25: assert_type(Literal[''], int) failed [assert-type] +ERROR directives_assert_type.py:34:16-33: assert_type needs 2 positional arguments, got 3 [bad-argument-count] """ diff --git a/conformance/results/pyright/directives_assert_type.toml b/conformance/results/pyright/directives_assert_type.toml index 9c37b0b04..cb868983d 100644 --- a/conformance/results/pyright/directives_assert_type.toml +++ b/conformance/results/pyright/directives_assert_type.toml @@ -1,11 +1,13 @@ conformant = "Pass" output = """ directives_assert_type.py:27:17 - error: "assert_type" mismatch: expected "int" but received "int | str" (reportAssertTypeFailure) -directives_assert_type.py:28:17 - error: "assert_type" mismatch: expected "int" but received "Any" (reportAssertTypeFailure) -directives_assert_type.py:29:17 - error: "assert_type" mismatch: expected "int" but received "Literal[4]" (reportAssertTypeFailure) -directives_assert_type.py:31:5 - error: "assert_type" expects two positional arguments (reportCallIssue) -directives_assert_type.py:32:17 - error: "assert_type" mismatch: expected "int" but received "Literal['']" (reportAssertTypeFailure) -directives_assert_type.py:33:5 - error: "assert_type" expects two positional arguments (reportCallIssue) +directives_assert_type.py:28:17 - error: "assert_type" mismatch: expected "Any" but received "int | str" (reportAssertTypeFailure) +directives_assert_type.py:29:17 - error: "assert_type" mismatch: expected "int" but received "Any" (reportAssertTypeFailure) +directives_assert_type.py:30:17 - error: "assert_type" mismatch: expected "int" but received "Literal[4]" (reportAssertTypeFailure) +directives_assert_type.py:32:5 - error: "assert_type" expects two positional arguments (reportCallIssue) +directives_assert_type.py:33:17 - error: "assert_type" mismatch: expected "int" but received "Literal['']" (reportAssertTypeFailure) +directives_assert_type.py:34:5 - error: "assert_type" expects two positional arguments (reportCallIssue) +directives_assert_type.py:41:17 - error: "assert_type" mismatch: expected "str | Literal['spam']" but received "str" (reportAssertTypeFailure) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/zuban/directives_assert_type.toml b/conformance/results/zuban/directives_assert_type.toml index 15ed60cb4..154dfdeda 100644 --- a/conformance/results/zuban/directives_assert_type.toml +++ b/conformance/results/zuban/directives_assert_type.toml @@ -3,9 +3,11 @@ errors_diff = """ """ output = """ directives_assert_type.py:27: error: Expression is of type "int | str", not "int" [misc] -directives_assert_type.py:28: error: Expression is of type "Any", not "int" [misc] -directives_assert_type.py:29: error: Expression is of type "Literal[4]", not "int" [misc] -directives_assert_type.py:31: error: "assert_type" expects 2 arguments [call-arg] -directives_assert_type.py:32: error: Expression is of type "Literal['']", not "int" [misc] -directives_assert_type.py:33: error: "assert_type" expects 2 arguments [call-arg] +directives_assert_type.py:28: error: Expression is of type "int | str", not "Any" [misc] +directives_assert_type.py:29: error: Expression is of type "Any", not "int" [misc] +directives_assert_type.py:30: error: Expression is of type "Literal[4]", not "int" [misc] +directives_assert_type.py:32: error: "assert_type" expects 2 arguments [call-arg] +directives_assert_type.py:33: error: Expression is of type "Literal['']", not "int" [misc] +directives_assert_type.py:34: error: "assert_type" expects 2 arguments [call-arg] +directives_assert_type.py:41: error: Expression is of type "str", not "str | Literal['spam']" [misc] """ diff --git a/conformance/tests/directives_assert_type.py b/conformance/tests/directives_assert_type.py index b5a337378..900529b12 100644 --- a/conformance/tests/directives_assert_type.py +++ b/conformance/tests/directives_assert_type.py @@ -25,6 +25,7 @@ def func1( assert_type(e, Literal[4]) # OK assert_type(a, int) # E: Type mismatch + assert_type(a, Any) # E: Type mismatch assert_type(c, int) # E: Type mismatch assert_type(e, int) # E: Type mismatch @@ -33,5 +34,12 @@ def func1( assert_type(a, int | str, a) # E: too many arguments +# > If the two types are :term:`equivalent` but syntactically different, +# > the type checker may reject the ``assert_type()`` call:: + +def func2(name: str): + assert_type(name, str | Literal["spam"]) # E?: Equivalent but not identical + + class ForwardReference: pass diff --git a/docs/spec/directives.rst b/docs/spec/directives.rst index 3693af494..6ed7016a7 100644 --- a/docs/spec/directives.rst +++ b/docs/spec/directives.rst @@ -9,7 +9,8 @@ Type checker directives ----------------- The function ``typing.assert_type(val, typ)`` allows users to -ask a static type checker to confirm that *val* has an inferred type of *typ*. +ask a static type checker to confirm that the inferred type of *val* +is :term:`equivalent` to *typ*. When a type checker encounters a call to ``assert_type()``, it should emit an error if the value is not of the specified type:: @@ -18,6 +19,17 @@ should emit an error if the value is not of the specified type:: assert_type(name, str) # OK, inferred type of `name` is `str` assert_type(name, int) # type checker error +If the two types are :term:`equivalent` but syntactically different, +the type checker may reject the ``assert_type()`` call:: + + from typing import assert_type, Literal + + def greet(name: str) -> None: + assert_type(name, str | Literal["spam"]) # type checker may error + +Type checkers should aim to minimize cases where they reject +``assert_type()`` calls that use equivalent types. + The second argument must be a valid :term:`type expression`. .. _`reveal-type`: From b07429d38264f394eb08170f13f5fd698d6c73c2 Mon Sep 17 00:00:00 2001 From: Jean Hominal Date: Wed, 15 Oct 2025 15:21:00 +0200 Subject: [PATCH 150/308] Fix pyrefly URL in index.rst (#2101) --- docs/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.rst b/docs/index.rst index 95d27748a..de18780c9 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -81,7 +81,7 @@ Type Checkers * `mypy `_, the reference implementation for type checkers. -* `pyrefly `_, a fast type checker and language +* `pyrefly `_, a fast type checker and language server. * `pyright `_, a type checker that emphasizes speed. From a9173dcfd95e0bfe67ed4c94b156040991c11f30 Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Wed, 15 Oct 2025 21:58:33 +0100 Subject: [PATCH 151/308] Add ty and Zuban to the list of type checkers that exist (#2102) --- docs/index.rst | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/docs/index.rst b/docs/index.rst index de18780c9..19117d058 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -79,12 +79,11 @@ Typing-related Tools Type Checkers ------------- -* `mypy `_, the reference implementation for type - checkers. -* `pyrefly `_, a fast type checker and language - server. -* `pyright `_, a type checker that - emphasizes speed. +* `mypy `_ +* `pyrefly `_ +* `pyright `_ +* `ty `_ +* `Zuban `_ Development Environments ------------------------ From 5d0e6f83144a4c1f69e5ca4a6d7638b2739b0745 Mon Sep 17 00:00:00 2001 From: Danny Yang Date: Thu, 16 Oct 2025 11:49:59 -0400 Subject: [PATCH 152/308] Fix code block on NamedTuple doc (#2103) Update namedtuples.rst Fix a code block that wasn't being rendered properly --- docs/spec/namedtuples.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/spec/namedtuples.rst b/docs/spec/namedtuples.rst index 936d2fa79..5ccf9d5b2 100644 --- a/docs/spec/namedtuples.rst +++ b/docs/spec/namedtuples.rst @@ -21,7 +21,7 @@ Type checkers should support the class syntax:: units: str = "meters" Fields must be annotated attributes - methods and un-annotated attributes are not -considered fields. Field names may not start with an underscore. +considered fields. Field names may not start with an underscore:: class MyTuple(NamedTuple): x1 = 1 # Not a field From aabc9d8c26efb3f77965438119617eee6d5f7c40 Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Tue, 21 Oct 2025 18:06:09 +0200 Subject: [PATCH 153/308] Update Modernizing document for Python 3.14 (#2106) Document that the future import isn't necessary anymore. --- docs/guides/modernizing.rst | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/docs/guides/modernizing.rst b/docs/guides/modernizing.rst index a4eb3d5ac..05035b7bf 100644 --- a/docs/guides/modernizing.rst +++ b/docs/guides/modernizing.rst @@ -19,7 +19,8 @@ but they are superseded by more modern alternatives, which are recommended to us These newer features are not available in all Python versions, although some features are available as backports from the `typing-extensions `_ -package, or require quoting or using :python:`from __future__ import annotations`. +package, or require quoting or using :python:`from __future__ import annotations` +when running on Python 3.13 or below. Each section states the minimum Python version required to use the feature, whether it is available in typing-extensions, and whether it is available using quoting. @@ -39,16 +40,18 @@ available using quoting. .. note:: - :python:`from __future__ import annotations` is available since Python 3.7. + :python:`from __future__ import annotations` is available since Python 3.7 + and became unnecessary starting with Python 3.14. This only has an effect inside type annotations, while quoting is still - required outside. For example, this example runs on Python 3.7 and up, - although the pipe operator was only introduced in Python 3.10:: + required outside. For example:: from __future__ import annotations from typing_extensions import TypeAlias - def f(x: int | None) -> int | str: ... # the future import is sufficient - Alias: TypeAlias = "int | str" # this requires quoting + def f(x: Foo) -> Foo: ... # the future import is sufficient + Alias: TypeAlias = "Foo" # this forward reference requires quoting + + class Foo: pass .. _modernizing-type-comments: @@ -82,6 +85,9 @@ it's necessary to either use :python:`from __future__ import annotations` class Parrot: ... +When using Python 3.14 and up, quoting forward references is no longer +necessary inside type annotations. + .. _modernizing-typing-text: ``typing.Text`` @@ -354,3 +360,18 @@ behavior, but has other restrictions. See the documentation for Review existing uses of :data:`TypeGuard ` to see if they should be replaced with :data:`TypeIs `. + +``from __future__ import annotations`` +====================================== + +*Available since:* Python 3.14 + +Starting with Python 3.14, behavior similar to using +``from __future__ import annotations`` became the default. When running on +Python 3.14 and up, it's no longer necessary to use the future import to defer +evaluation of annotations. However, quoting is still necessary for types used +outside of annotations and :keyword:`type` statements, for example when using +:data:`TypeAlias `. + +Remove unnecessary uses of ``from __future__ import annotations`` for code +only supporting Python 3.14 and up. From 9f6d8ced7cd1c8d92687a4e9c96d7716452e471e Mon Sep 17 00:00:00 2001 From: Danny Yang Date: Tue, 21 Oct 2025 23:19:59 -0400 Subject: [PATCH 154/308] Update Pyrefly results for v0.38.0 & fix error parsing (#2107) --- .../results/pyrefly/aliases_explicit.toml | 2 +- .../results/pyrefly/aliases_implicit.toml | 2 +- .../pyrefly/aliases_type_statement.toml | 7 ++--- .../pyrefly/aliases_typealiastype.toml | 15 ++++++---- .../pyrefly/constructors_callable.toml | 1 - .../pyrefly/directives_deprecated.toml | 28 +++++++++---------- .../results/pyrefly/generics_basic.toml | 5 ++-- .../results/pyrefly/generics_upper_bound.toml | 2 +- .../pyrefly/literals_interactions.toml | 8 +++--- .../pyrefly/literals_literalstring.toml | 2 +- .../pyrefly/namedtuples_define_class.toml | 13 ++++----- .../results/pyrefly/namedtuples_usage.toml | 4 +-- .../results/pyrefly/overloads_basic.toml | 2 +- .../results/pyrefly/protocols_definition.toml | 3 +- .../results/pyrefly/protocols_explicit.toml | 5 ++-- .../pyrefly/typeddicts_alt_syntax.toml | 8 +++--- .../pyrefly/typeddicts_extra_items.toml | 19 +++++++------ .../pyrefly/typeddicts_operations.toml | 20 ++++++------- .../typeddicts_readonly_inheritance.toml | 8 +++--- .../pyrefly/typeddicts_type_consistency.toml | 4 +-- .../results/pyrefly/typeddicts_usage.toml | 8 +++--- conformance/results/pyrefly/version.toml | 2 +- conformance/results/results.html | 20 ++++++------- conformance/results/zuban/version.toml | 2 +- conformance/src/type_checker.py | 5 ++-- 25 files changed, 97 insertions(+), 98 deletions(-) diff --git a/conformance/results/pyrefly/aliases_explicit.toml b/conformance/results/pyrefly/aliases_explicit.toml index 3eaadf112..6e489a28f 100644 --- a/conformance/results/pyrefly/aliases_explicit.toml +++ b/conformance/results/pyrefly/aliases_explicit.toml @@ -18,7 +18,7 @@ ERROR aliases_explicit.py:83:28-29: Could not find name `b` [unknown-name] ERROR aliases_explicit.py:84:21-36: function call cannot be used in annotations [invalid-annotation] ERROR aliases_explicit.py:85:21-29: invalid subscript expression cannot be used in annotations [invalid-annotation] ERROR aliases_explicit.py:86:21-42: if expression cannot be used in annotations [invalid-annotation] -ERROR aliases_explicit.py:87:21-25: Expected `BadTypeAlias9` to be a type alias, got `Literal[3]` [type-alias-error] +ERROR aliases_explicit.py:87:21-25: Expected `BadTypeAlias9` to be a type alias, got `Literal[3]` [invalid-type-alias] ERROR aliases_explicit.py:88:22-26: bool literal cannot be used in annotations [invalid-annotation] ERROR aliases_explicit.py:89:22-23: number literal cannot be used in annotations [invalid-annotation] ERROR aliases_explicit.py:90:22-33: boolean operation cannot be used in annotations [invalid-annotation] diff --git a/conformance/results/pyrefly/aliases_implicit.toml b/conformance/results/pyrefly/aliases_implicit.toml index 7b1bfb607..033e0c712 100644 --- a/conformance/results/pyrefly/aliases_implicit.toml +++ b/conformance/results/pyrefly/aliases_implicit.toml @@ -16,7 +16,7 @@ ERROR aliases_implicit.py:77:9-28: `type[list[int | None]]` is not subscriptable ERROR aliases_implicit.py:78:9-33: Expected 1 type argument for `GoodTypeAlias4`, got 2 [bad-specialization] ERROR aliases_implicit.py:79:9-33: Expected 1 type argument for `GoodTypeAlias8`, got 2 [bad-specialization] ERROR aliases_implicit.py:80:9-33: Expected a valid ParamSpec expression, got `int` [invalid-param-spec] -ERROR aliases_implicit.py:81:9-29: Type `str` is not assignable to upper bound `float` of type variable `TFloat` [bad-specialization] +ERROR aliases_implicit.py:81:9-29: `str` is not assignable to upper bound `float` of type variable `TFloat` [bad-specialization] ERROR aliases_implicit.py:107:9-22: Expected a type form, got instance of `list[type[int] | type[str]]` [not-a-type] ERROR aliases_implicit.py:108:9-22: Expected a type form, got instance of `tuple[tuple[type[int], type[str]]]` [not-a-type] ERROR aliases_implicit.py:109:9-22: Expected a type form, got instance of `list[type[int]]` [not-a-type] diff --git a/conformance/results/pyrefly/aliases_type_statement.toml b/conformance/results/pyrefly/aliases_type_statement.toml index f887262d2..7d23523e2 100644 --- a/conformance/results/pyrefly/aliases_type_statement.toml +++ b/conformance/results/pyrefly/aliases_type_statement.toml @@ -1,6 +1,5 @@ conformant = "Partial" notes = """ -Does not reject type alias defined with type statement in base class list Does not reject redeclaration of type alias with the same name. Does not detect circular definitions. """ @@ -27,7 +26,7 @@ ERROR aliases_type_statement.py:41:29-30: Could not find name `b` [unknown-name] ERROR aliases_type_statement.py:42:22-37: function call cannot be used in annotations [invalid-annotation] ERROR aliases_type_statement.py:43:22-30: invalid subscript expression cannot be used in annotations [invalid-annotation] ERROR aliases_type_statement.py:44:22-43: if expression cannot be used in annotations [invalid-annotation] -ERROR aliases_type_statement.py:45:22-26: Expected `BadTypeAlias9` to be a type alias, got `Literal[1]` [type-alias-error] +ERROR aliases_type_statement.py:45:22-26: Expected `BadTypeAlias9` to be a type alias, got `Literal[1]` [invalid-type-alias] ERROR aliases_type_statement.py:46:23-27: bool literal cannot be used in annotations [invalid-annotation] ERROR aliases_type_statement.py:47:23-24: number literal cannot be used in annotations [invalid-annotation] ERROR aliases_type_statement.py:48:23-34: boolean operation cannot be used in annotations [invalid-annotation] @@ -35,6 +34,6 @@ ERROR aliases_type_statement.py:49:23-33: f-string cannot be used in annotations ERROR aliases_type_statement.py:56:5-30: `type` statement is not allowed in this context [invalid-syntax] ERROR aliases_type_statement.py:62:15-25: Type parameters used in `TA1` but not declared [invalid-type-var] ERROR aliases_type_statement.py:67:12-20: Type parameters used in `TA2` but not declared [invalid-type-var] -ERROR aliases_type_statement.py:77:7-41: Type `str` is not assignable to upper bound `int` of type variable `S` [bad-specialization] -ERROR aliases_type_statement.py:79:7-41: Type `int` is not assignable to upper bound `str` of type variable `T` [bad-specialization] +ERROR aliases_type_statement.py:77:7-41: `str` is not assignable to upper bound `int` of type variable `S` [bad-specialization] +ERROR aliases_type_statement.py:79:7-41: `int` is not assignable to upper bound `str` of type variable `T` [bad-specialization] """ diff --git a/conformance/results/pyrefly/aliases_typealiastype.toml b/conformance/results/pyrefly/aliases_typealiastype.toml index ddb3a209c..3a09d2cdd 100644 --- a/conformance/results/pyrefly/aliases_typealiastype.toml +++ b/conformance/results/pyrefly/aliases_typealiastype.toml @@ -1,4 +1,7 @@ -conformant = "Unsupported" +conformant = "Partial" +notes = """ +Does not detect circular definitions. +""" conformance_automated = "Fail" errors_diff = """ Line 46: Expected 1 errors @@ -8,10 +11,10 @@ Line 66: Expected 1 errors """ output = """ ERROR aliases_typealiastype.py:32:7-30: Object of class `TypeAliasType` has no attribute `other_attrib` [missing-attribute] -ERROR aliases_typealiastype.py:40:5-30: Type `int` is not assignable to upper bound `str` of type variable `TStr` [bad-specialization] -ERROR aliases_typealiastype.py:43:40-47: Type variable `S` is out of scope for this `TypeAliasType` [type-alias-error] -ERROR aliases_typealiastype.py:44:40-47: Type variable `S` is out of scope for this `TypeAliasType` [type-alias-error] -ERROR aliases_typealiastype.py:45:45-65: Value for argument `type_params` must be a tuple literal [type-alias-error] +ERROR aliases_typealiastype.py:40:5-30: `int` is not assignable to upper bound `str` of type variable `TStr` [bad-specialization] +ERROR aliases_typealiastype.py:43:40-47: Type variable `S` is out of scope for this `TypeAliasType` [invalid-type-alias] +ERROR aliases_typealiastype.py:44:40-47: Type variable `S` is out of scope for this `TypeAliasType` [invalid-type-alias] +ERROR aliases_typealiastype.py:45:45-65: Value for argument `type_params` must be a tuple literal [invalid-type-alias] ERROR aliases_typealiastype.py:52:40-80: function call cannot be used in annotations [invalid-annotation] ERROR aliases_typealiastype.py:53:40-50: list literal cannot be used in annotations [invalid-annotation] ERROR aliases_typealiastype.py:54:42-55: tuple literal cannot be used in annotations [invalid-annotation] @@ -22,7 +25,7 @@ ERROR aliases_typealiastype.py:56:49-50: Could not find name `b` [unknown-name] ERROR aliases_typealiastype.py:57:42-57: function call cannot be used in annotations [invalid-annotation] ERROR aliases_typealiastype.py:58:42-50: invalid subscript expression cannot be used in annotations [invalid-annotation] ERROR aliases_typealiastype.py:59:42-63: if expression cannot be used in annotations [invalid-annotation] -ERROR aliases_typealiastype.py:60:42-46: Expected `BadAlias16` to be a type alias, got `Literal[3]` [type-alias-error] +ERROR aliases_typealiastype.py:60:42-46: Expected `BadAlias16` to be a type alias, got `Literal[3]` [invalid-type-alias] ERROR aliases_typealiastype.py:61:42-46: bool literal cannot be used in annotations [invalid-annotation] ERROR aliases_typealiastype.py:62:42-43: number literal cannot be used in annotations [invalid-annotation] ERROR aliases_typealiastype.py:63:42-53: boolean operation cannot be used in annotations [invalid-annotation] diff --git a/conformance/results/pyrefly/constructors_callable.toml b/conformance/results/pyrefly/constructors_callable.toml index edbb81b14..bbfb662d8 100644 --- a/conformance/results/pyrefly/constructors_callable.toml +++ b/conformance/results/pyrefly/constructors_callable.toml @@ -1,6 +1,5 @@ conformant = "Partial" notes = """ -Some overloaded constructors are not resolved correctly. Converting constructor to callable does not preserve class-scoped type params. Converting constructor to callable does not substitute Self in __new__ Converting constructor to callable uses __new__ signature instead of __init__ diff --git a/conformance/results/pyrefly/directives_deprecated.toml b/conformance/results/pyrefly/directives_deprecated.toml index 913e327b5..9373c54f4 100644 --- a/conformance/results/pyrefly/directives_deprecated.toml +++ b/conformance/results/pyrefly/directives_deprecated.toml @@ -1,18 +1,18 @@ -conformant = "Unsupported" -conformance_automated = "Fail" +conformant = "Pass" +conformance_automated = "Pass" errors_diff = """ -Line 18: Expected 1 errors -Line 24: Expected 1 errors -Line 25: Expected 1 errors -Line 30: Expected 1 errors -Line 44: Expected 1 errors -Line 47: Expected 1 errors -Line 48: Expected 1 errors -Line 58: Expected 1 errors -Line 69: Expected 1 errors -Line 98: Expected 1 errors """ output = """ -ERROR directives_deprecated.py:41:5-13: `+` is not supported between `Spam` and `Literal[1]` [unsupported-operation] -ERROR directives_deprecated.py:42:1-10: `+=` is not supported between `Spam` and `Literal[1]` [unsupported-operation] + WARN directives_deprecated.py:18:44-47: `Ham` is deprecated [deprecated] + WARN directives_deprecated.py:24:1-23: `_directives_deprecated_library.norwegian_blue` is deprecated [deprecated] + WARN directives_deprecated.py:25:5-27: `_directives_deprecated_library.norwegian_blue` is deprecated [deprecated] + WARN directives_deprecated.py:30:12-15: Call to deprecated overload `_directives_deprecated_library.foo` [deprecated] + WARN directives_deprecated.py:41:5-13: `+` is not supported between `Spam` and `Literal[1]` [deprecated] + WARN directives_deprecated.py:42:1-10: `+=` is not supported between `Spam` and `Literal[1]` [deprecated] + WARN directives_deprecated.py:44:1-12: `_directives_deprecated_library.Spam.greasy` is deprecated [deprecated] + WARN directives_deprecated.py:47:1-11: `_directives_deprecated_library.Spam.shape` is deprecated [deprecated] + WARN directives_deprecated.py:48:1-11: `_directives_deprecated_library.Spam.shape` is deprecated [deprecated] + WARN directives_deprecated.py:58:1-10: `Invocable.__call__` is deprecated [deprecated] + WARN directives_deprecated.py:69:1-6: `lorem` is deprecated [deprecated] + WARN directives_deprecated.py:98:5-10: `SupportsFoo1.foo` is deprecated [deprecated] """ diff --git a/conformance/results/pyrefly/generics_basic.toml b/conformance/results/pyrefly/generics_basic.toml index c0b28fb8e..49e3c9dac 100644 --- a/conformance/results/pyrefly/generics_basic.toml +++ b/conformance/results/pyrefly/generics_basic.toml @@ -1,6 +1,5 @@ conformant = "Partial" notes = """ -Does not reject Type Var definition with only 1 constraint Incorrect rejects + between two AnyStr Constrained type var resolves to subtype instead of explcitly listed constraint """ @@ -23,8 +22,8 @@ ERROR generics_basic.py:68:16-35: assert_type(MyStr, str) failed [assert-type] ERROR generics_basic.py:68:27-28: Argument `str` is not assignable to parameter `y` with type `MyStr` in function `concat` [bad-argument-type] ERROR generics_basic.py:69:15-16: Argument `bytes` is not assignable to parameter `y` with type `MyStr` in function `concat` [bad-argument-type] ERROR generics_basic.py:121:24-25: Duplicated type parameter declaration `T` [invalid-inheritance] -ERROR generics_basic.py:157:8-9: Cannot index into `MyMap1[str, int]` [index-error] -ERROR generics_basic.py:158:8-9: Cannot index into `MyMap2[int, str]` [index-error] +ERROR generics_basic.py:157:8-9: Cannot index into `MyMap1[str, int]` [bad-index] +ERROR generics_basic.py:158:8-9: Cannot index into `MyMap2[int, str]` [bad-index] ERROR generics_basic.py:162:7-11: Expected a type variable, got `int` [invalid-type-var] ERROR generics_basic.py:163:7-11: Expected a type variable, got `int` [invalid-type-var] ERROR generics_basic.py:171:7-11: Class `Bad3` uses type variables not specified in `Generic` or `Protocol` base [invalid-type-var] diff --git a/conformance/results/pyrefly/generics_upper_bound.toml b/conformance/results/pyrefly/generics_upper_bound.toml index cfbb661e9..b438675c6 100644 --- a/conformance/results/pyrefly/generics_upper_bound.toml +++ b/conformance/results/pyrefly/generics_upper_bound.toml @@ -5,6 +5,6 @@ output = """ ERROR generics_upper_bound.py:24:38-45: Type variable bounds and constraints must be concrete [invalid-annotation] ERROR generics_upper_bound.py:43:12-55: assert_type(list[int], list[int] | set[int]) failed [assert-type] ERROR generics_upper_bound.py:43:25-31: Argument `set[int]` is not assignable to parameter `y` with type `list[int]` in function `longer` [bad-argument-type] -ERROR generics_upper_bound.py:51:7-13: Type `int` is not assignable to upper bound `Sized` of type variable `ST` [bad-specialization] +ERROR generics_upper_bound.py:51:7-13: `int` is not assignable to upper bound `Sized` of type variable `ST` [bad-specialization] ERROR generics_upper_bound.py:56:38-49: TypeVar cannot have both constraints and bound [invalid-type-var] """ diff --git a/conformance/results/pyrefly/literals_interactions.toml b/conformance/results/pyrefly/literals_interactions.toml index cc0646c6e..4e5d984ea 100644 --- a/conformance/results/pyrefly/literals_interactions.toml +++ b/conformance/results/pyrefly/literals_interactions.toml @@ -8,10 +8,10 @@ Line 71: Unexpected errors ['`@` is not supported between `Matrix[Literal[2], Li Line 72: Unexpected errors ['assert_type(Matrix[Literal[2], int], Matrix[Literal[2], Literal[7]]) failed [assert-type]'] """ output = """ -ERROR literals_interactions.py:15:5-9: Index 5 out of range for tuple with 3 elements [index-error] -ERROR literals_interactions.py:16:5-9: Index -5 out of range for tuple with 3 elements [index-error] -ERROR literals_interactions.py:17:5-9: Index 4 out of range for tuple with 3 elements [index-error] -ERROR literals_interactions.py:18:5-10: Index -4 out of range for tuple with 3 elements [index-error] +ERROR literals_interactions.py:15:5-9: Index 5 out of range for tuple with 3 elements [bad-index] +ERROR literals_interactions.py:16:5-9: Index -5 out of range for tuple with 3 elements [bad-index] +ERROR literals_interactions.py:17:5-9: Index 4 out of range for tuple with 3 elements [bad-index] +ERROR literals_interactions.py:18:5-10: Index -4 out of range for tuple with 3 elements [bad-index] ERROR literals_interactions.py:71:9-14: `@` is not supported between `Matrix[Literal[2], Literal[3]]` and `Matrix[Literal[3], Literal[7]]` [unsupported-operation] ERROR literals_interactions.py:72:16-51: assert_type(Matrix[Literal[2], int], Matrix[Literal[2], Literal[7]]) failed [assert-type] """ diff --git a/conformance/results/pyrefly/literals_literalstring.toml b/conformance/results/pyrefly/literals_literalstring.toml index d9f744fdc..4f01e113c 100644 --- a/conformance/results/pyrefly/literals_literalstring.toml +++ b/conformance/results/pyrefly/literals_literalstring.toml @@ -8,7 +8,7 @@ ERROR literals_literalstring.py:43:23-24: `Literal['two']` is not assignable to ERROR literals_literalstring.py:66:25-47: `str` is not assignable to `LiteralString` [bad-assignment] ERROR literals_literalstring.py:74:25-26: `Literal[3]` is not assignable to `LiteralString` [bad-assignment] ERROR literals_literalstring.py:75:25-32: `Literal[b'test']` is not assignable to `LiteralString` [bad-assignment] -ERROR literals_literalstring.py:120:21-24: Type `str` is not assignable to upper bound `LiteralString` of type variable `TLiteral` [bad-specialization] +ERROR literals_literalstring.py:120:21-24: `str` is not assignable to upper bound `LiteralString` of type variable `TLiteral` [bad-specialization] ERROR literals_literalstring.py:134:51-52: Argument `str` is not assignable to parameter `value` with type `LiteralString` in function `Container.__init__` [bad-argument-type] ERROR literals_literalstring.py:171:21-24: `list[LiteralString]` is not assignable to `list[str]` [bad-assignment] """ diff --git a/conformance/results/pyrefly/namedtuples_define_class.toml b/conformance/results/pyrefly/namedtuples_define_class.toml index 0d85f64ed..0c8456569 100644 --- a/conformance/results/pyrefly/namedtuples_define_class.toml +++ b/conformance/results/pyrefly/namedtuples_define_class.toml @@ -1,14 +1,10 @@ -conformant = "Partial" -notes = """ -Doesn't catch illegal field name starting with underscore -""" -conformance_automated = "Fail" +conformant = "Pass" +conformance_automated = "Pass" errors_diff = """ -Line 76: Expected 1 errors """ output = """ -ERROR namedtuples_define_class.py:32:7-12: Index 3 out of range for tuple with 3 elements [index-error] -ERROR namedtuples_define_class.py:33:7-13: Index -4 out of range for tuple with 3 elements [index-error] +ERROR namedtuples_define_class.py:32:7-12: Index 3 out of range for tuple with 3 elements [bad-index] +ERROR namedtuples_define_class.py:33:7-13: Index -4 out of range for tuple with 3 elements [bad-index] ERROR namedtuples_define_class.py:44:11-14: Missing argument `y` in function `Point.__new__` [missing-argument] ERROR namedtuples_define_class.py:45:11-16: Missing argument `y` in function `Point.__new__` [missing-argument] ERROR namedtuples_define_class.py:46:15-17: Argument `Literal['']` is not assignable to parameter `y` with type `int` in function `Point.__new__` [bad-argument-type] @@ -16,6 +12,7 @@ ERROR namedtuples_define_class.py:47:24-25: Argument `Literal[3]` is not assigna ERROR namedtuples_define_class.py:48:22-24: Expected 3 positional arguments, got 4 in function `Point.__new__` [bad-argument-count] ERROR namedtuples_define_class.py:49:23-28: Unexpected keyword argument `other` in function `Point.__new__` [unexpected-keyword] ERROR namedtuples_define_class.py:69:20-22: Expected 2 positional arguments, got 3 in function `Point2.__new__` [bad-argument-count] +ERROR namedtuples_define_class.py:76:5-7: NamedTuple field name may not start with an underscore: `_y` [bad-class-definition] ERROR namedtuples_define_class.py:86:5-13: NamedTuple field 'latitude' without a default may not follow NamedTuple field with a default [bad-class-definition] ERROR namedtuples_define_class.py:106:5-6: Cannot override named tuple element `x` [bad-override] ERROR namedtuples_define_class.py:125:19-22: Argument `float` is not assignable to parameter `value` with type `str` in function `Property.__new__` [bad-argument-type] diff --git a/conformance/results/pyrefly/namedtuples_usage.toml b/conformance/results/pyrefly/namedtuples_usage.toml index fe89094a7..14f8163d8 100644 --- a/conformance/results/pyrefly/namedtuples_usage.toml +++ b/conformance/results/pyrefly/namedtuples_usage.toml @@ -3,8 +3,8 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR namedtuples_usage.py:34:7-11: Index 3 out of range for tuple with 3 elements [index-error] -ERROR namedtuples_usage.py:35:7-12: Index -4 out of range for tuple with 3 elements [index-error] +ERROR namedtuples_usage.py:34:7-11: Index 3 out of range for tuple with 3 elements [bad-index] +ERROR namedtuples_usage.py:35:7-12: Index -4 out of range for tuple with 3 elements [bad-index] ERROR namedtuples_usage.py:40:1-4: Cannot set field `x` [read-only] ERROR namedtuples_usage.py:41:1-5: Cannot set item in `Point` [unsupported-operation] ERROR namedtuples_usage.py:42:5-8: Cannot delete field `x` [read-only] diff --git a/conformance/results/pyrefly/overloads_basic.toml b/conformance/results/pyrefly/overloads_basic.toml index 315a20e45..9dd079a23 100644 --- a/conformance/results/pyrefly/overloads_basic.toml +++ b/conformance/results/pyrefly/overloads_basic.toml @@ -3,5 +3,5 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR overloads_basic.py:39:1-6: Cannot index into `Bytes` [index-error] +ERROR overloads_basic.py:39:1-6: Cannot index into `Bytes` [bad-index] """ diff --git a/conformance/results/pyrefly/protocols_definition.toml b/conformance/results/pyrefly/protocols_definition.toml index 294fd1c60..d2dd01e6a 100644 --- a/conformance/results/pyrefly/protocols_definition.toml +++ b/conformance/results/pyrefly/protocols_definition.toml @@ -1,17 +1,16 @@ conformant = "Partial" notes = """ -Allows attributes defined by assignment via self in Protocols Incorrectly handles some ClassVar examples in Protocol subtyping """ conformance_automated = "Fail" errors_diff = """ -Line 67: Expected 1 errors Line 116: Expected 1 errors Line 117: Expected 1 errors Line 79: Unexpected errors ['`Concrete` is not assignable to `Template` [bad-assignment]'] """ output = """ ERROR protocols_definition.py:30:11-14: Argument `list[int]` is not assignable to parameter `things` with type `Iterable[SupportsClose]` in function `close_all` [bad-argument-type] +ERROR protocols_definition.py:67:14-18: Instance or class variables within a Protocol class must be explicitly declared within the class body [protocol-implicitly-defined-attribute] ERROR protocols_definition.py:79:17-38: `Concrete` is not assignable to `Template` [bad-assignment] ERROR protocols_definition.py:114:22-38: `Concrete2_Bad1` is not assignable to `Template2` [bad-assignment] ERROR protocols_definition.py:115:22-38: `Concrete2_Bad2` is not assignable to `Template2` [bad-assignment] diff --git a/conformance/results/pyrefly/protocols_explicit.toml b/conformance/results/pyrefly/protocols_explicit.toml index bdb414d48..01f91a267 100644 --- a/conformance/results/pyrefly/protocols_explicit.toml +++ b/conformance/results/pyrefly/protocols_explicit.toml @@ -1,6 +1,7 @@ -conformant = "Unsupported" +conformant = "Partial" notes = """ -Does not check against abstract class instantiations +Does not reject call to super method with no default implementation. +Does not detect stub methods inherited from protocols as abstract. """ conformance_automated = "Fail" errors_diff = """ diff --git a/conformance/results/pyrefly/typeddicts_alt_syntax.toml b/conformance/results/pyrefly/typeddicts_alt_syntax.toml index 82ee6fb6f..6f018049c 100644 --- a/conformance/results/pyrefly/typeddicts_alt_syntax.toml +++ b/conformance/results/pyrefly/typeddicts_alt_syntax.toml @@ -10,8 +10,8 @@ ERROR typeddicts_alt_syntax.py:35:72-83: Unrecognized argument `other` for typed ERROR typeddicts_alt_syntax.py:41:1-7: Expected valid functional typed dictionary definition [invalid-argument] ERROR typeddicts_alt_syntax.py:41:30-38: Unrecognized argument `name` for typed dictionary definition [invalid-argument] ERROR typeddicts_alt_syntax.py:41:40-48: Unrecognized argument `year` for typed dictionary definition [invalid-argument] -ERROR typeddicts_alt_syntax.py:44:11-17: Key `name` is not defined in TypedDict `Movie2` [typed-dict-key-error] -ERROR typeddicts_alt_syntax.py:44:35-41: Key `year` is not defined in TypedDict `Movie2` [typed-dict-key-error] -ERROR typeddicts_alt_syntax.py:45:11-17: Key `name` is not defined in TypedDict `Movie2` [typed-dict-key-error] -ERROR typeddicts_alt_syntax.py:45:35-41: Key `year` is not defined in TypedDict `Movie2` [typed-dict-key-error] +ERROR typeddicts_alt_syntax.py:44:11-17: Key `name` is not defined in TypedDict `Movie2` [bad-typed-dict-key] +ERROR typeddicts_alt_syntax.py:44:35-41: Key `year` is not defined in TypedDict `Movie2` [bad-typed-dict-key] +ERROR typeddicts_alt_syntax.py:45:11-17: Key `name` is not defined in TypedDict `Movie2` [bad-typed-dict-key] +ERROR typeddicts_alt_syntax.py:45:35-41: Key `year` is not defined in TypedDict `Movie2` [bad-typed-dict-key] """ diff --git a/conformance/results/pyrefly/typeddicts_extra_items.toml b/conformance/results/pyrefly/typeddicts_extra_items.toml index 1ae173356..6dd410858 100644 --- a/conformance/results/pyrefly/typeddicts_extra_items.toml +++ b/conformance/results/pyrefly/typeddicts_extra_items.toml @@ -1,24 +1,25 @@ +conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR typeddicts_extra_items.py:15:45-49: `Literal[1982]` is not assignable to TypedDict key with type `bool` [typed-dict-key-error] -ERROR typeddicts_extra_items.py:22:55-59: `Literal[1982]` is not assignable to TypedDict key with type `bool` [typed-dict-key-error] -ERROR typeddicts_extra_items.py:39:54-58: `None` is not assignable to TypedDict key `year` with type `int` [typed-dict-key-error] +ERROR typeddicts_extra_items.py:15:45-49: `Literal[1982]` is not assignable to TypedDict key with type `bool` [bad-typed-dict-key] +ERROR typeddicts_extra_items.py:22:55-59: `Literal[1982]` is not assignable to TypedDict key with type `bool` [bad-typed-dict-key] +ERROR typeddicts_extra_items.py:39:54-58: `None` is not assignable to TypedDict key `year` with type `int` [bad-typed-dict-key] ERROR typeddicts_extra_items.py:49:7-16: Expected literal True or False for keyword `closed`, got instance of `bool` [bad-typed-dict] ERROR typeddicts_extra_items.py:67:7-20: Non-closed TypedDict cannot inherit from closed TypedDict `ClosedBase` [bad-typed-dict] ERROR typeddicts_extra_items.py:73:7-20: Non-closed TypedDict cannot inherit from TypedDict `ExtraItemsBase` with extra items [bad-typed-dict] -ERROR typeddicts_extra_items.py:92:5-8: Cannot extend closed TypedDict `MovieA` with extra item `age` [typed-dict-key-error] -ERROR typeddicts_extra_items.py:95:5-8: Cannot extend closed TypedDict `MovieB` with extra item `age` [typed-dict-key-error] +ERROR typeddicts_extra_items.py:92:5-8: Cannot extend closed TypedDict `MovieA` with extra item `age` [bad-typed-dict-key] +ERROR typeddicts_extra_items.py:95:5-8: Cannot extend closed TypedDict `MovieB` with extra item `age` [bad-typed-dict-key] ERROR typeddicts_extra_items.py:109:7-30: Closed TypedDict cannot inherit from TypedDict `ExtraItemsBase` with non-read-only extra items [bad-typed-dict] ERROR typeddicts_extra_items.py:114:50-63: `Required` is not allowed in this context [invalid-annotation] ERROR typeddicts_extra_items.py:117:57-73: `NotRequired` is not allowed in this context [invalid-annotation] -ERROR typeddicts_extra_items.py:128:15-21: Key `name` in TypedDict `MovieEI` may not be deleted [delete-error] +ERROR typeddicts_extra_items.py:128:15-21: Key `name` in TypedDict `MovieEI` may not be deleted [unsupported-delete] ERROR typeddicts_extra_items.py:143:48-52: Unexpected keyword argument `year` in function `unpack_no_extra` [unexpected-keyword] ERROR typeddicts_extra_items.py:174:7-12: Cannot change the non-read-only extra items type of TypedDict `Parent` [bad-typed-dict] -ERROR typeddicts_extra_items.py:185:5-9: TypedDict `MovieBase2` with non-read-only `extra_items` cannot be extended with required extra item `year` [typed-dict-key-error] -ERROR typeddicts_extra_items.py:188:5-9: `int` is not consistent with `extra_items` type `int | None` of TypedDict `MovieBase2` [typed-dict-key-error] -ERROR typeddicts_extra_items.py:197:5-14: `str` is not assignable to `extra_items` type `int | None` of TypedDict `BookBase` [typed-dict-key-error] +ERROR typeddicts_extra_items.py:185:5-9: TypedDict `MovieBase2` with non-read-only `extra_items` cannot be extended with required extra item `year` [bad-typed-dict-key] +ERROR typeddicts_extra_items.py:188:5-9: `int` is not consistent with `extra_items` type `int | None` of TypedDict `MovieBase2` [bad-typed-dict-key] +ERROR typeddicts_extra_items.py:197:5-14: `str` is not assignable to `extra_items` type `int | None` of TypedDict `BookBase` [bad-typed-dict-key] ERROR typeddicts_extra_items.py:215:22-30: `TypedDict[MovieDetails]` is not assignable to `TypedDict[MovieBase2]` [bad-assignment] ERROR typeddicts_extra_items.py:222:22-30: `TypedDict[MovieWithYear2]` is not assignable to `TypedDict[MovieBase2]` [bad-assignment] ERROR typeddicts_extra_items.py:242:19-27: `TypedDict[MovieDetails5]` is not assignable to `TypedDict[MovieSI]` [bad-assignment] diff --git a/conformance/results/pyrefly/typeddicts_operations.toml b/conformance/results/pyrefly/typeddicts_operations.toml index a145cff04..3c3dafe48 100644 --- a/conformance/results/pyrefly/typeddicts_operations.toml +++ b/conformance/results/pyrefly/typeddicts_operations.toml @@ -3,16 +3,16 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR typeddicts_operations.py:22:17-21: `Literal[1982]` is not assignable to TypedDict key `name` with type `str` [typed-dict-key-error] -ERROR typeddicts_operations.py:23:17-19: `Literal['']` is not assignable to TypedDict key `year` with type `int` [typed-dict-key-error] -ERROR typeddicts_operations.py:24:7-14: TypedDict `Movie` does not have key `other` [typed-dict-key-error] -ERROR typeddicts_operations.py:26:13-20: TypedDict `Movie` does not have key `other` [typed-dict-key-error] -ERROR typeddicts_operations.py:28:9-33: Missing required key `year` for TypedDict `Movie` [typed-dict-key-error] -ERROR typeddicts_operations.py:29:42-48: `float` is not assignable to TypedDict key `year` with type `int` [typed-dict-key-error] -ERROR typeddicts_operations.py:32:36-43: Key `other` is not defined in TypedDict `Movie` [typed-dict-key-error] -ERROR typeddicts_operations.py:37:20-52: Missing required key `name` for TypedDict `Movie` [typed-dict-key-error] -ERROR typeddicts_operations.py:37:21-33: Expected string literal key, got `str` [typed-dict-key-error] +ERROR typeddicts_operations.py:22:17-21: `Literal[1982]` is not assignable to TypedDict key `name` with type `str` [bad-typed-dict-key] +ERROR typeddicts_operations.py:23:17-19: `Literal['']` is not assignable to TypedDict key `year` with type `int` [bad-typed-dict-key] +ERROR typeddicts_operations.py:24:7-14: TypedDict `Movie` does not have key `other` [bad-typed-dict-key] +ERROR typeddicts_operations.py:26:13-20: TypedDict `Movie` does not have key `other` [bad-typed-dict-key] +ERROR typeddicts_operations.py:28:9-33: Missing required key `year` for TypedDict `Movie` [bad-typed-dict-key] +ERROR typeddicts_operations.py:29:42-48: `float` is not assignable to TypedDict key `year` with type `int` [bad-typed-dict-key] +ERROR typeddicts_operations.py:32:36-43: Key `other` is not defined in TypedDict `Movie` [bad-typed-dict-key] +ERROR typeddicts_operations.py:37:20-52: Missing required key `name` for TypedDict `Movie` [bad-typed-dict-key] +ERROR typeddicts_operations.py:37:21-33: Expected string literal key, got `str` [bad-typed-dict-key] ERROR typeddicts_operations.py:47:1-12: Object of class `Movie` has no attribute `clear` [missing-attribute] -ERROR typeddicts_operations.py:49:11-17: Key `name` in TypedDict `Movie` may not be deleted [delete-error] +ERROR typeddicts_operations.py:49:11-17: Key `name` in TypedDict `Movie` may not be deleted [unsupported-delete] ERROR typeddicts_operations.py:62:1-21: Object of class `MovieOptional` has no attribute `clear` [missing-attribute] """ diff --git a/conformance/results/pyrefly/typeddicts_readonly_inheritance.toml b/conformance/results/pyrefly/typeddicts_readonly_inheritance.toml index ad8d736e4..7f87fb46f 100644 --- a/conformance/results/pyrefly/typeddicts_readonly_inheritance.toml +++ b/conformance/results/pyrefly/typeddicts_readonly_inheritance.toml @@ -12,9 +12,9 @@ Line 132: Expected 1 errors output = """ ERROR typeddicts_readonly_inheritance.py:36:4-10: Key `name` in TypedDict `Album2` is read-only [read-only] ERROR typeddicts_readonly_inheritance.py:50:5-8: Class member `RecordShop.alt` overrides parent class `AlbumCollection` in an inconsistent manner [bad-override] -ERROR typeddicts_readonly_inheritance.py:65:19-21: Missing required key `name` for TypedDict `RequiredName` [typed-dict-key-error] -ERROR typeddicts_readonly_inheritance.py:82:14-15: `Literal[3]` is not assignable to TypedDict key `ident` with type `str` [typed-dict-key-error] -ERROR typeddicts_readonly_inheritance.py:83:15-16: `Literal[3]` is not assignable to TypedDict key `ident` with type `str` [typed-dict-key-error] -ERROR typeddicts_readonly_inheritance.py:84:5-7: Missing required key `ident` for TypedDict `User` [typed-dict-key-error] +ERROR typeddicts_readonly_inheritance.py:65:19-21: Missing required key `name` for TypedDict `RequiredName` [bad-typed-dict-key] +ERROR typeddicts_readonly_inheritance.py:82:14-15: `Literal[3]` is not assignable to TypedDict key `ident` with type `str` [bad-typed-dict-key] +ERROR typeddicts_readonly_inheritance.py:83:15-16: `Literal[3]` is not assignable to TypedDict key `ident` with type `str` [bad-typed-dict-key] +ERROR typeddicts_readonly_inheritance.py:84:5-7: Missing required key `ident` for TypedDict `User` [bad-typed-dict-key] ERROR typeddicts_readonly_inheritance.py:94:5-6: Class member `F3.a` overrides parent class `F1` in an inconsistent manner [bad-override] """ diff --git a/conformance/results/pyrefly/typeddicts_type_consistency.toml b/conformance/results/pyrefly/typeddicts_type_consistency.toml index c7812752f..bc1273de8 100644 --- a/conformance/results/pyrefly/typeddicts_type_consistency.toml +++ b/conformance/results/pyrefly/typeddicts_type_consistency.toml @@ -6,10 +6,10 @@ output = """ ERROR typeddicts_type_consistency.py:21:10-12: `TypedDict[B1]` is not assignable to `TypedDict[A1]` [bad-assignment] ERROR typeddicts_type_consistency.py:38:10-12: `TypedDict[B2]` is not assignable to `TypedDict[A2]` [bad-assignment] ERROR typeddicts_type_consistency.py:65:6-8: `TypedDict[A3]` is not assignable to variable `b3` with type `TypedDict[B3]` [bad-assignment] -ERROR typeddicts_type_consistency.py:69:21-24: Key `y` is not defined in TypedDict `A3` [typed-dict-key-error] +ERROR typeddicts_type_consistency.py:69:21-24: Key `y` is not defined in TypedDict `A3` [bad-typed-dict-key] ERROR typeddicts_type_consistency.py:76:22-24: `TypedDict[B3]` is not assignable to `dict[str, int]` [bad-assignment] ERROR typeddicts_type_consistency.py:77:25-27: `TypedDict[B3]` is not assignable to `dict[str, object]` [bad-assignment] ERROR typeddicts_type_consistency.py:78:22-24: `TypedDict[B3]` is not assignable to `dict[Any, Any]` [bad-assignment] ERROR typeddicts_type_consistency.py:82:25-27: `TypedDict[B3]` is not assignable to `Mapping[str, int]` [bad-assignment] -ERROR typeddicts_type_consistency.py:126:56-57: `Literal[1]` is not assignable to TypedDict key `inner_key` with type `str` [typed-dict-key-error] +ERROR typeddicts_type_consistency.py:126:56-57: `Literal[1]` is not assignable to TypedDict key `inner_key` with type `str` [bad-typed-dict-key] """ diff --git a/conformance/results/pyrefly/typeddicts_usage.toml b/conformance/results/pyrefly/typeddicts_usage.toml index 45500cede..6c43741df 100644 --- a/conformance/results/pyrefly/typeddicts_usage.toml +++ b/conformance/results/pyrefly/typeddicts_usage.toml @@ -3,10 +3,10 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR typeddicts_usage.py:23:7-17: TypedDict `Movie` does not have key `director` [typed-dict-key-error] -ERROR typeddicts_usage.py:24:17-23: `Literal['1982']` is not assignable to TypedDict key `year` with type `int` [typed-dict-key-error] -ERROR typeddicts_usage.py:28:17-56: Missing required key `name` for TypedDict `Movie` [typed-dict-key-error] -ERROR typeddicts_usage.py:28:18-25: Key `title` is not defined in TypedDict `Movie` [typed-dict-key-error] +ERROR typeddicts_usage.py:23:7-17: TypedDict `Movie` does not have key `director` [bad-typed-dict-key] +ERROR typeddicts_usage.py:24:17-23: `Literal['1982']` is not assignable to TypedDict key `year` with type `int` [bad-typed-dict-key] +ERROR typeddicts_usage.py:28:17-56: Missing required key `name` for TypedDict `Movie` [bad-typed-dict-key] +ERROR typeddicts_usage.py:28:18-25: Key `title` is not defined in TypedDict `Movie` [bad-typed-dict-key] ERROR typeddicts_usage.py:35:22-27: TypedDict `Movie` not allowed as second argument to isinstance() [invalid-argument] ERROR typeddicts_usage.py:40:24-33: `TypedDict` is not allowed in this context [invalid-annotation] """ diff --git a/conformance/results/pyrefly/version.toml b/conformance/results/pyrefly/version.toml index b7e819192..8327c9e17 100644 --- a/conformance/results/pyrefly/version.toml +++ b/conformance/results/pyrefly/version.toml @@ -1 +1 @@ -version = "pyrefly 0.37.0" +version = "pyrefly 0.38.1" diff --git a/conformance/results/results.html b/conformance/results/results.html index 79ecbdd8b..ee949fd44 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -162,9 +162,9 @@

    Python Type System Conformance Test Results

    - - - + @@ -483,13 +483,13 @@

    Python Type System Conformance Test Results

    - + - + @@ -537,13 +537,13 @@

    Python Type System Conformance Test Results

    - + - + @@ -651,7 +651,7 @@

    Python Type System Conformance Test Results

    - + @@ -915,7 +915,7 @@

    Python Type System Conformance Test Results

    - + @@ -1008,7 +1008,7 @@

    Python Type System Conformance Test Results

    - + diff --git a/conformance/results/zuban/version.toml b/conformance/results/zuban/version.toml index 2ffe43faa..9dae302b6 100644 --- a/conformance/results/zuban/version.toml +++ b/conformance/results/zuban/version.toml @@ -1 +1 @@ -version = "zuban 0.1.0" +version = "zuban 0.1.1" diff --git a/conformance/src/type_checker.py b/conformance/src/type_checker.py index 7e6fdaadb..4307039fd 100644 --- a/conformance/src/type_checker.py +++ b/conformance/src/type_checker.py @@ -307,13 +307,15 @@ def run_tests(self, test_files: Sequence[str]) -> dict[str, str]: for line in lines: if not line.strip(): continue + if line.startswith(" INFO "): + continue # Extract the absolute path reported by pyrefly and convert it to a # stable relative path (filename only) so results are consistent. # Example input line: # "ERROR /abs/.../conformance/tests/foo.py:12:3-5: message [code]" # We replace the absolute path with just "foo.py". try: - abs_path = line.split(":", 1)[0].split(" ", 1)[1].strip() + abs_path = line.split(":", 1)[0].strip().split(" ", 1)[1].strip() except IndexError: # If parsing fails, fall back to original line and grouping. abs_path = "" @@ -324,7 +326,6 @@ def run_tests(self, test_files: Sequence[str]) -> dict[str, str]: results_dict[file_name] = ( results_dict.get(file_name, "") + display_line + "\n" ) - return results_dict def parse_errors(self, output: Sequence[str]) -> dict[int, list[str]]: From 111aece5ff8859e218817e4e865d42fe3b2ea393 Mon Sep 17 00:00:00 2001 From: Carl Meyer Date: Sun, 2 Nov 2025 23:37:06 -0500 Subject: [PATCH 155/308] don't assert type on invalid type expressions (#2111) --- conformance/results/mypy/enums_members.toml | 2 -- conformance/results/pyrefly/enums_members.toml | 12 ++++-------- .../results/pyrefly/overloads_evaluation.toml | 8 ++++---- .../results/pyrefly/protocols_explicit.toml | 4 ++-- .../pyrefly/typeddicts_readonly_inheritance.toml | 8 ++++---- .../pyrefly/typeddicts_readonly_update.toml | 2 +- conformance/results/pyrefly/version.toml | 2 +- conformance/results/pyright/enums_members.toml | 16 ++++++---------- .../pyright/namedtuples_define_functional.toml | 6 +----- conformance/results/pyright/version.toml | 2 +- conformance/results/results.html | 6 +++--- conformance/results/zuban/aliases_recursive.toml | 1 - conformance/results/zuban/version.toml | 2 +- conformance/tests/enums_members.py | 8 ++++---- 14 files changed, 32 insertions(+), 47 deletions(-) diff --git a/conformance/results/mypy/enums_members.toml b/conformance/results/mypy/enums_members.toml index 3678b1239..5acf57b62 100644 --- a/conformance/results/mypy/enums_members.toml +++ b/conformance/results/mypy/enums_members.toml @@ -26,9 +26,7 @@ enums_members.py:35: error: Expression is of type "Literal[Pet2.genus]", not "st enums_members.py:36: error: Expression is of type "Literal[Pet2.species]", not "str" [assert-type] enums_members.py:50: error: Enum members must be left unannotated [misc] enums_members.py:50: note: See https://typing.readthedocs.io/en/latest/spec/enums.html#defining-members -enums_members.py:84: error: Expression is of type "Callable[[Pet4], str]", not "Any" [assert-type] enums_members.py:84: error: Parameter 1 of Literal[...] is invalid [valid-type] -enums_members.py:85: error: Expression is of type "Callable[[Pet4], None]", not "Any" [assert-type] enums_members.py:85: error: Parameter 1 of Literal[...] is invalid [valid-type] enums_members.py:100: error: Expression is of type "Literal[TrafficLight.AMBER]", not "Literal[TrafficLight.YELLOW]" [assert-type] enums_members.py:116: error: Expression is of type "int", not "Literal[Example.b]" [assert-type] diff --git a/conformance/results/pyrefly/enums_members.toml b/conformance/results/pyrefly/enums_members.toml index 7b0090a0d..bbc4fbc70 100644 --- a/conformance/results/pyrefly/enums_members.toml +++ b/conformance/results/pyrefly/enums_members.toml @@ -8,14 +8,10 @@ Line 100: Unexpected errors ['assert_type(Literal[TrafficLight.AMBER], Literal[T """ output = """ ERROR enums_members.py:50:5-8: Enum member `DOG` may not be annotated directly. Instead, annotate the `_value_` attribute. [invalid-annotation] -ERROR enums_members.py:82:12-53: assert_type((x: Any) -> str, Any) failed [assert-type] -ERROR enums_members.py:82:37-51: `Pet4.converter` is not a valid enum member [invalid-literal] -ERROR enums_members.py:83:12-53: assert_type((x: int) -> int, Any) failed [assert-type] -ERROR enums_members.py:83:37-51: `Pet4.transform` is not a valid enum member [invalid-literal] -ERROR enums_members.py:84:12-49: assert_type((self: Pet4) -> str, Any) failed [assert-type] -ERROR enums_members.py:84:35-47: `Pet4.species` is not a valid enum member [invalid-literal] -ERROR enums_members.py:85:12-45: assert_type((self: Pet4) -> None, Any) failed [assert-type] -ERROR enums_members.py:85:33-43: `Pet4.speak` is not a valid enum member [invalid-literal] +ERROR enums_members.py:82:20-34: `Pet4.converter` is not a valid enum member [invalid-literal] +ERROR enums_members.py:83:20-34: `Pet4.transform` is not a valid enum member [invalid-literal] +ERROR enums_members.py:84:18-30: `Pet4.species` is not a valid enum member [invalid-literal] +ERROR enums_members.py:85:16-26: `Pet4.speak` is not a valid enum member [invalid-literal] ERROR enums_members.py:100:12-62: assert_type(Literal[TrafficLight.AMBER], Literal[TrafficLight.YELLOW]) failed [assert-type] ERROR enums_members.py:116:12-43: assert_type(nonmember[int], Any) failed [assert-type] ERROR enums_members.py:116:32-41: `Example.b` is not a valid enum member [invalid-literal] diff --git a/conformance/results/pyrefly/overloads_evaluation.toml b/conformance/results/pyrefly/overloads_evaluation.toml index 22aa1792c..c1431c340 100644 --- a/conformance/results/pyrefly/overloads_evaluation.toml +++ b/conformance/results/pyrefly/overloads_evaluation.toml @@ -2,8 +2,8 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR overloads_evaluation.py:38:11-13: No matching overload found for function `example1_1` [no-matching-overload] -ERROR overloads_evaluation.py:46:11-17: No matching overload found for function `example1_1` [no-matching-overload] -ERROR overloads_evaluation.py:51:11-14: No matching overload found for function `example1_1` [no-matching-overload] -ERROR overloads_evaluation.py:115:13-22: No matching overload found for function `example2` [no-matching-overload] +ERROR overloads_evaluation.py:38:11-13: No matching overload found for function `example1_1` called with arguments: () [no-matching-overload] +ERROR overloads_evaluation.py:46:11-17: No matching overload found for function `example1_1` called with arguments: (Literal[1], Literal[1]) [no-matching-overload] +ERROR overloads_evaluation.py:51:11-14: No matching overload found for function `example1_1` called with arguments: (Literal[1]) [no-matching-overload] +ERROR overloads_evaluation.py:115:13-22: No matching overload found for function `example2` called with arguments: (int | str, int | str, Literal[1]) [no-matching-overload] """ diff --git a/conformance/results/pyrefly/protocols_explicit.toml b/conformance/results/pyrefly/protocols_explicit.toml index 01f91a267..cff8b33c1 100644 --- a/conformance/results/pyrefly/protocols_explicit.toml +++ b/conformance/results/pyrefly/protocols_explicit.toml @@ -7,10 +7,10 @@ conformance_automated = "Fail" errors_diff = """ Line 27: Expected 1 errors Line 89: Expected 1 errors -Line 134: Expected 1 errors """ output = """ ERROR protocols_explicit.py:56:20-36: `tuple[int, int, str]` is not assignable to attribute `rgb` with type `tuple[int, int, int]` [bad-assignment] -ERROR protocols_explicit.py:60:10-20: Cannot instantiate `Point` because the following members are abstract: `intensity` [bad-instantiation] +ERROR protocols_explicit.py:60:10-20: Cannot instantiate `Point` because the following members are abstract: `intensity`, `transparency` [bad-instantiation] +ERROR protocols_explicit.py:134:15-17: Cannot instantiate `Concrete5` because the following members are abstract: `method1` [bad-instantiation] ERROR protocols_explicit.py:164:17-19: Cannot instantiate `Concrete7A` because the following members are abstract: `method1` [bad-instantiation] """ diff --git a/conformance/results/pyrefly/typeddicts_readonly_inheritance.toml b/conformance/results/pyrefly/typeddicts_readonly_inheritance.toml index 7f87fb46f..128660326 100644 --- a/conformance/results/pyrefly/typeddicts_readonly_inheritance.toml +++ b/conformance/results/pyrefly/typeddicts_readonly_inheritance.toml @@ -4,10 +4,7 @@ Does not restrictions around overriding for ReadOnly fields """ conformance_automated = "Fail" errors_diff = """ -Line 98: Expected 1 errors -Line 106: Expected 1 errors Line 119: Expected 1 errors -Line 132: Expected 1 errors """ output = """ ERROR typeddicts_readonly_inheritance.py:36:4-10: Key `name` in TypedDict `Album2` is read-only [read-only] @@ -16,5 +13,8 @@ ERROR typeddicts_readonly_inheritance.py:65:19-21: Missing required key `name` f ERROR typeddicts_readonly_inheritance.py:82:14-15: `Literal[3]` is not assignable to TypedDict key `ident` with type `str` [bad-typed-dict-key] ERROR typeddicts_readonly_inheritance.py:83:15-16: `Literal[3]` is not assignable to TypedDict key `ident` with type `str` [bad-typed-dict-key] ERROR typeddicts_readonly_inheritance.py:84:5-7: Missing required key `ident` for TypedDict `User` [bad-typed-dict-key] -ERROR typeddicts_readonly_inheritance.py:94:5-6: Class member `F3.a` overrides parent class `F1` in an inconsistent manner [bad-override] +ERROR typeddicts_readonly_inheritance.py:94:5-6: TypedDict field `a` in `F3` cannot be marked read-only; parent TypedDict `F1` defines it as mutable [bad-typed-dict-key] +ERROR typeddicts_readonly_inheritance.py:98:5-6: TypedDict field `a` in `F4` must remain required because parent TypedDict `F1` defines it as required [bad-typed-dict-key] +ERROR typeddicts_readonly_inheritance.py:106:5-6: TypedDict field `c` in `F6` cannot be made non-required; parent TypedDict `F1` defines it as required [bad-typed-dict-key] +ERROR typeddicts_readonly_inheritance.py:132:7-11: TypedDict field `x` in `TD_B` cannot be made non-required; parent TypedDict `TD_B2` defines it as required [bad-typed-dict-key] """ diff --git a/conformance/results/pyrefly/typeddicts_readonly_update.toml b/conformance/results/pyrefly/typeddicts_readonly_update.toml index 662d236e1..a56c02f82 100644 --- a/conformance/results/pyrefly/typeddicts_readonly_update.toml +++ b/conformance/results/pyrefly/typeddicts_readonly_update.toml @@ -3,5 +3,5 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR typeddicts_readonly_update.py:23:10-14: No matching overload found for function `A.update` [no-matching-overload] +ERROR typeddicts_readonly_update.py:23:10-14: No matching overload found for function `A.update` called with arguments: (TypedDict[A]) [no-matching-overload] """ diff --git a/conformance/results/pyrefly/version.toml b/conformance/results/pyrefly/version.toml index 8327c9e17..e0f0cc518 100644 --- a/conformance/results/pyrefly/version.toml +++ b/conformance/results/pyrefly/version.toml @@ -1 +1 @@ -version = "pyrefly 0.38.1" +version = "pyrefly 0.39.4" diff --git a/conformance/results/pyright/enums_members.toml b/conformance/results/pyright/enums_members.toml index d09aadcdd..303e0f8c9 100644 --- a/conformance/results/pyright/enums_members.toml +++ b/conformance/results/pyright/enums_members.toml @@ -7,16 +7,12 @@ errors_diff = """ """ output = """ enums_members.py:50:5 - error: Type annotations are not allowed for enum members (reportGeneralTypeIssues) -enums_members.py:82:13 - error: "assert_type" mismatch: expected "Unknown" but received "(x: Unknown) -> str" (reportAssertTypeFailure) -enums_members.py:82:37 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) -enums_members.py:82:42 - error: Variable not allowed in type expression (reportInvalidTypeForm) -enums_members.py:83:13 - error: "assert_type" mismatch: expected "Unknown" but received "(x: int) -> int" (reportAssertTypeFailure) -enums_members.py:83:37 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) -enums_members.py:83:42 - error: Variable not allowed in type expression (reportInvalidTypeForm) -enums_members.py:84:13 - error: "assert_type" mismatch: expected "Unknown" but received "property" (reportAssertTypeFailure) -enums_members.py:84:35 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) -enums_members.py:85:13 - error: "assert_type" mismatch: expected "Unknown" but received "(self: Pet4) -> None" (reportAssertTypeFailure) -enums_members.py:85:33 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) +enums_members.py:82:20 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) +enums_members.py:82:25 - error: Variable not allowed in type expression (reportInvalidTypeForm) +enums_members.py:83:20 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) +enums_members.py:83:25 - error: Variable not allowed in type expression (reportInvalidTypeForm) +enums_members.py:84:18 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) +enums_members.py:85:16 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) enums_members.py:116:13 - error: "assert_type" mismatch: expected "Unknown" but received "int" (reportAssertTypeFailure) enums_members.py:116:32 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) enums_members.py:128:21 - information: Type of "Example2.__B" is "Literal[2]" diff --git a/conformance/results/pyright/namedtuples_define_functional.toml b/conformance/results/pyright/namedtuples_define_functional.toml index 266f4083f..2860b88ac 100644 --- a/conformance/results/pyright/namedtuples_define_functional.toml +++ b/conformance/results/pyright/namedtuples_define_functional.toml @@ -16,12 +16,8 @@ namedtuples_define_functional.py:52:31 - error: Names within a named tuple must namedtuples_define_functional.py:53:33 - error: Field names cannot be a keyword (reportGeneralTypeIssues) namedtuples_define_functional.py:54:33 - error: Field names cannot be a keyword (reportGeneralTypeIssues) namedtuples_define_functional.py:55:33 - error: Named tuple field names cannot start with an underscore (reportGeneralTypeIssues) -namedtuples_define_functional.py:59:33 - error: Named tuple field names cannot start with an underscore (reportGeneralTypeIssues) -namedtuples_define_functional.py:60:13 - error: No parameter named "_1" (reportCallIssue) namedtuples_define_functional.py:69:1 - error: Argument missing for parameter "a" (reportCallIssue) """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 59: Unexpected errors ['namedtuples_define_functional.py:59:33 - error: Named tuple field names cannot start with an underscore (reportGeneralTypeIssues)'] -Line 60: Unexpected errors ['namedtuples_define_functional.py:60:13 - error: No parameter named "_1" (reportCallIssue)'] """ diff --git a/conformance/results/pyright/version.toml b/conformance/results/pyright/version.toml index 739cc3b7f..18c7a6cff 100644 --- a/conformance/results/pyright/version.toml +++ b/conformance/results/pyright/version.toml @@ -1 +1 @@ -version = "pyright 1.1.406" +version = "pyright 1.1.407" diff --git a/conformance/results/results.html b/conformance/results/results.html index ee949fd44..8570f7c65 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -160,11 +160,11 @@

    Python Type System Conformance Test Results

    - - - - - - + @@ -714,7 +714,7 @@

    Python Type System Conformance Test Results

    - + @@ -855,7 +855,7 @@

    Python Type System Conformance Test Results

    - + @@ -873,7 +873,7 @@

    Python Type System Conformance Test Results

    - + @@ -893,7 +893,7 @@

    Python Type System Conformance Test Results

    - + @@ -919,7 +919,7 @@

    Python Type System Conformance Test Results

    - + diff --git a/conformance/results/zuban/tuples_type_compat.toml b/conformance/results/zuban/tuples_type_compat.toml index 73d4e185c..f496d48b0 100644 --- a/conformance/results/zuban/tuples_type_compat.toml +++ b/conformance/results/zuban/tuples_type_compat.toml @@ -1,6 +1,6 @@ -conformant = "Pass" +conformant = "Partial" notes = """ -Does not support tuple narrowing based on `len()` type guard (optional). +Incorrectly marks a match case as unreachable. """ conformance_automated = "Fail" errors_diff = """ diff --git a/conformance/results/zuban/version.toml b/conformance/results/zuban/version.toml index eeff6b710..8938624f8 100644 --- a/conformance/results/zuban/version.toml +++ b/conformance/results/zuban/version.toml @@ -1 +1 @@ -version = "zuban 0.2.1" +version = "zuban 0.2.3" From 77bbb7e7366568501a8b78b36317181fc939d11d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Dec 2025 19:03:34 +0100 Subject: [PATCH 161/308] Bump actions/checkout from 5 to 6 in the actions group (#2122) --- .github/workflows/build-docs.yml | 2 +- .github/workflows/ci.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index f52bb3404..8624fa73a 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - name: Set up Python uses: actions/setup-python@v6 with: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 588675f71..fd5fb80f1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - name: Set up Python 3 uses: actions/setup-python@v6 with: From f6204ef8b39cf4280b64822f86f61e94ac5a5814 Mon Sep 17 00:00:00 2001 From: Shantanu <12621235+hauntsaninja@users.noreply.github.com> Date: Sat, 13 Dec 2025 13:22:47 -0800 Subject: [PATCH 162/308] Update conformance suite results (#2133) --- .../results/mypy/callables_annotation.toml | 10 ++--- .../results/mypy/callables_kwargs.toml | 12 +++--- .../results/mypy/callables_protocol.toml | 42 +++++++++---------- .../mypy/dataclasses_transform_converter.toml | 2 +- .../mypy/generics_paramspec_semantics.toml | 6 +-- .../results/mypy/generics_syntax_scoping.toml | 3 +- .../results/mypy/narrowing_typeguard.toml | 2 +- .../results/mypy/narrowing_typeis.toml | 2 +- .../mypy/typeddicts_type_consistency.toml | 2 - conformance/results/mypy/version.toml | 2 +- .../results/pyrefly/aliases_explicit.toml | 2 +- .../results/pyrefly/aliases_implicit.toml | 2 +- .../results/pyrefly/callables_kwargs.toml | 9 ++-- .../pyrefly/generics_typevartuple_concat.toml | 9 +--- .../pyrefly/literals_interactions.toml | 8 ++-- .../pyrefly/namedtuples_define_class.toml | 4 +- .../results/pyrefly/namedtuples_usage.toml | 4 +- .../pyrefly/protocols_runtime_checkable.toml | 15 ++++--- .../pyrefly/typeddicts_extra_items.toml | 22 +++++----- .../typeddicts_readonly_consistency.toml | 14 +++---- .../pyrefly/typeddicts_readonly_update.toml | 2 +- .../pyrefly/typeddicts_type_consistency.toml | 14 +++---- conformance/results/pyrefly/version.toml | 2 +- conformance/results/results.html | 6 +-- .../results/zuban/tuples_type_compat.toml | 9 ++-- conformance/results/zuban/version.toml | 2 +- 26 files changed, 96 insertions(+), 111 deletions(-) diff --git a/conformance/results/mypy/callables_annotation.toml b/conformance/results/mypy/callables_annotation.toml index c8af71583..11daf6205 100644 --- a/conformance/results/mypy/callables_annotation.toml +++ b/conformance/results/mypy/callables_annotation.toml @@ -17,17 +17,17 @@ callables_annotation.py:57: error: Bracketed expression "[...]" is not valid as callables_annotation.py:57: note: Did you mean "List[...]"? callables_annotation.py:58: error: Please use "Callable[[], ]" or "Callable" [misc] callables_annotation.py:59: error: Unexpected "..." [misc] -callables_annotation.py:91: error: Incompatible types in assignment (expression has type "Callable[[], str]", variable has type "Callable[[int, VarArg(Any), KwArg(Any)], str]") [assignment] -callables_annotation.py:93: error: Incompatible types in assignment (expression has type "Callable[[NamedArg(int, 'a')], str]", variable has type "Callable[[int, VarArg(Any), KwArg(Any)], str]") [assignment] +callables_annotation.py:91: error: Incompatible types in assignment (expression has type "Callable[[], str]", variable has type "def (int, /, *Any, **Any) -> str") [assignment] +callables_annotation.py:93: error: Incompatible types in assignment (expression has type "def test_cb4(*, a: int) -> str", variable has type "def (int, /, *Any, **Any) -> str") [assignment] callables_annotation.py:157: error: Incompatible types in assignment (expression has type "Proto7", variable has type "Proto6") [assignment] callables_annotation.py:157: note: Following member(s) of "Proto7" have conflicts: callables_annotation.py:157: note: Expected: callables_annotation.py:157: note: def __call__(self, int, /, *args: Any, k: str, **kwargs: Any) -> None callables_annotation.py:157: note: Got: callables_annotation.py:157: note: def __call__(self, float, /, b: int, *, k: str, m: str) -> None -callables_annotation.py:172: error: Incompatible types in assignment (expression has type "Callable[[], str]", variable has type "Callable[[int, VarArg(Any), KwArg(Any)], str]") [assignment] -callables_annotation.py:187: error: Incompatible types in assignment (expression has type "Callable[[int, str], str]", variable has type "Callable[[str, VarArg(Any), KwArg(Any)], str]") [assignment] -callables_annotation.py:189: error: Incompatible types in assignment (expression has type "Callable[[int, str], str]", variable has type "Callable[[str, VarArg(Any), KwArg(Any)], str]") [assignment] +callables_annotation.py:172: error: Incompatible types in assignment (expression has type "Callable[[], str]", variable has type "def (int, /, *Any, **Any) -> str") [assignment] +callables_annotation.py:187: error: Incompatible types in assignment (expression has type "Callable[[int, str], str]", variable has type "def (str, /, *Any, **Any) -> str") [assignment] +callables_annotation.py:189: error: Incompatible types in assignment (expression has type "Callable[[int, str], str]", variable has type "def (str, /, *Any, **Any) -> str") [assignment] """ conformance_automated = "Fail" errors_diff = """ diff --git a/conformance/results/mypy/callables_kwargs.toml b/conformance/results/mypy/callables_kwargs.toml index 39eaad11f..f22038601 100644 --- a/conformance/results/mypy/callables_kwargs.toml +++ b/conformance/results/mypy/callables_kwargs.toml @@ -15,12 +15,12 @@ callables_kwargs.py:63: error: "func1" gets multiple values for keyword argument callables_kwargs.py:64: error: "func2" gets multiple values for keyword argument "v3" [misc] callables_kwargs.py:64: error: Argument 1 to "func2" has incompatible type "int"; expected "str" [arg-type] callables_kwargs.py:65: error: "func2" gets multiple values for keyword argument "v1" [misc] -callables_kwargs.py:101: error: Incompatible types in assignment (expression has type "Callable[[KwArg(TD2)], None]", variable has type "TDProtocol3") [assignment] -callables_kwargs.py:101: note: "TDProtocol3.__call__" has type "Callable[[NamedArg(int, 'v1'), NamedArg(int, 'v2'), NamedArg(str, 'v3')], None]" -callables_kwargs.py:102: error: Incompatible types in assignment (expression has type "Callable[[KwArg(TD2)], None]", variable has type "TDProtocol4") [assignment] -callables_kwargs.py:102: note: "TDProtocol4.__call__" has type "Callable[[NamedArg(int, 'v1')], None]" -callables_kwargs.py:103: error: Incompatible types in assignment (expression has type "Callable[[KwArg(TD2)], None]", variable has type "TDProtocol5") [assignment] -callables_kwargs.py:103: note: "TDProtocol5.__call__" has type "Callable[[Arg(int, 'v1'), Arg(str, 'v3')], None]" +callables_kwargs.py:101: error: Incompatible types in assignment (expression has type "def func1(**kwargs: Unpack[TD2]) -> None", variable has type "TDProtocol3") [assignment] +callables_kwargs.py:101: note: "TDProtocol3.__call__" has type "def __call__(self, *, v1: int, v2: int, v3: str) -> None" +callables_kwargs.py:102: error: Incompatible types in assignment (expression has type "def func1(**kwargs: Unpack[TD2]) -> None", variable has type "TDProtocol4") [assignment] +callables_kwargs.py:102: note: "TDProtocol4.__call__" has type "def __call__(self, *, v1: int) -> None" +callables_kwargs.py:103: error: Incompatible types in assignment (expression has type "def func1(**kwargs: Unpack[TD2]) -> None", variable has type "TDProtocol5") [assignment] +callables_kwargs.py:103: note: "TDProtocol5.__call__" has type "def __call__(self, v1: int, v3: str) -> None" callables_kwargs.py:111: error: Overlap between argument names and ** TypedDict items: "v1" [misc] callables_kwargs.py:122: error: Unpack item in ** argument must be a TypedDict [misc] """ diff --git a/conformance/results/mypy/callables_protocol.toml b/conformance/results/mypy/callables_protocol.toml index 0f2f42132..8fc8dcea4 100644 --- a/conformance/results/mypy/callables_protocol.toml +++ b/conformance/results/mypy/callables_protocol.toml @@ -1,36 +1,36 @@ conformant = "Pass" output = """ -callables_protocol.py:35: error: Incompatible types in assignment (expression has type "Callable[[VarArg(bytes), NamedArg(int | None, 'max_items')], list[bytes]]", variable has type "Proto1") [assignment] -callables_protocol.py:35: note: "Proto1.__call__" has type "Callable[[VarArg(bytes), DefaultNamedArg(int | None, 'max_len')], list[bytes]]" -callables_protocol.py:36: error: Incompatible types in assignment (expression has type "Callable[[VarArg(bytes)], list[bytes]]", variable has type "Proto1") [assignment] -callables_protocol.py:36: note: "Proto1.__call__" has type "Callable[[VarArg(bytes), DefaultNamedArg(int | None, 'max_len')], list[bytes]]" -callables_protocol.py:37: error: Incompatible types in assignment (expression has type "Callable[[VarArg(bytes), NamedArg(str | None, 'max_len')], list[bytes]]", variable has type "Proto1") [assignment] -callables_protocol.py:37: note: "Proto1.__call__" has type "Callable[[VarArg(bytes), DefaultNamedArg(int | None, 'max_len')], list[bytes]]" -callables_protocol.py:67: error: Incompatible types in assignment (expression has type "Callable[[VarArg(bytes)], Any]", variable has type "Proto2") [assignment] -callables_protocol.py:67: note: "Proto2.__call__" has type "Callable[[VarArg(bytes), KwArg(str)], None]" -callables_protocol.py:68: error: Incompatible types in assignment (expression has type "Callable[[VarArg(str), KwArg(str)], Any]", variable has type "Proto2") [assignment] -callables_protocol.py:68: note: "Proto2.__call__" has type "Callable[[VarArg(bytes), KwArg(str)], None]" -callables_protocol.py:69: error: Incompatible types in assignment (expression has type "Callable[[VarArg(bytes), KwArg(bytes)], Any]", variable has type "Proto2") [assignment] -callables_protocol.py:69: note: "Proto2.__call__" has type "Callable[[VarArg(bytes), KwArg(str)], None]" -callables_protocol.py:70: error: Incompatible types in assignment (expression has type "Callable[[KwArg(str)], Any]", variable has type "Proto2") [assignment] -callables_protocol.py:70: note: "Proto2.__call__" has type "Callable[[VarArg(bytes), KwArg(str)], None]" +callables_protocol.py:35: error: Incompatible types in assignment (expression has type "def cb1_bad1(*vals: bytes, max_items: int | None) -> list[bytes]", variable has type "Proto1") [assignment] +callables_protocol.py:35: note: "Proto1.__call__" has type "def __call__(self, *vals: bytes, max_len: int | None = ...) -> list[bytes]" +callables_protocol.py:36: error: Incompatible types in assignment (expression has type "def cb1_bad2(*vals: bytes) -> list[bytes]", variable has type "Proto1") [assignment] +callables_protocol.py:36: note: "Proto1.__call__" has type "def __call__(self, *vals: bytes, max_len: int | None = ...) -> list[bytes]" +callables_protocol.py:37: error: Incompatible types in assignment (expression has type "def cb1_bad3(*vals: bytes, max_len: str | None) -> list[bytes]", variable has type "Proto1") [assignment] +callables_protocol.py:37: note: "Proto1.__call__" has type "def __call__(self, *vals: bytes, max_len: int | None = ...) -> list[bytes]" +callables_protocol.py:67: error: Incompatible types in assignment (expression has type "def cb2_bad1(*a: bytes) -> Any", variable has type "Proto2") [assignment] +callables_protocol.py:67: note: "Proto2.__call__" has type "def __call__(self, *vals: bytes, **kwargs: str) -> None" +callables_protocol.py:68: error: Incompatible types in assignment (expression has type "def cb2_bad2(*a: str, **b: str) -> Any", variable has type "Proto2") [assignment] +callables_protocol.py:68: note: "Proto2.__call__" has type "def __call__(self, *vals: bytes, **kwargs: str) -> None" +callables_protocol.py:69: error: Incompatible types in assignment (expression has type "def cb2_bad3(*a: bytes, **b: bytes) -> Any", variable has type "Proto2") [assignment] +callables_protocol.py:69: note: "Proto2.__call__" has type "def __call__(self, *vals: bytes, **kwargs: str) -> None" +callables_protocol.py:70: error: Incompatible types in assignment (expression has type "def cb2_bad4(**b: str) -> Any", variable has type "Proto2") [assignment] +callables_protocol.py:70: note: "Proto2.__call__" has type "def __call__(self, *vals: bytes, **kwargs: str) -> None" callables_protocol.py:97: error: Incompatible types in assignment (expression has type "Callable[[int], None]", variable has type "Proto4") [assignment] callables_protocol.py:97: note: "function" is missing following "Proto4" protocol member: callables_protocol.py:97: note: other_attribute -callables_protocol.py:121: error: Incompatible types in assignment (expression has type "Callable[[VarArg(bytes), DefaultNamedArg(int | None, 'max_len')], list[bytes]]", variable has type "NotProto6") [assignment] +callables_protocol.py:121: error: Incompatible types in assignment (expression has type "def cb6_bad1(*vals: bytes, max_len: int | None = ...) -> list[bytes]", variable has type "NotProto6") [assignment] callables_protocol.py:169: error: Incompatible types in assignment (expression has type "Callable[[int], Any]", variable has type "Proto8") [assignment] callables_protocol.py:169: note: "Proto8.__call__" has type overloaded function callables_protocol.py:186: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] callables_protocol.py:187: error: "Proto9[P, R]" has no attribute "xxx" [attr-defined] callables_protocol.py:197: error: "Proto9[[int], str]" has no attribute "other_attribute2"; maybe "other_attribute"? [attr-defined] callables_protocol.py:238: error: Incompatible types in assignment (expression has type "Callable[[int, str], Any]", variable has type "Proto11") [assignment] -callables_protocol.py:238: note: "Proto11.__call__" has type "Callable[[int, Arg(str, 'y')], Any]" -callables_protocol.py:260: error: Incompatible types in assignment (expression has type "Callable[[VarArg(Any), NamedArg(Any, 'kwarg0')], None]", variable has type "Proto12") [assignment] -callables_protocol.py:260: note: "Proto12.__call__" has type "Callable[[VarArg(Any), NamedArg(Any, 'kwarg0'), NamedArg(Any, 'kwarg1')], None]" +callables_protocol.py:238: note: "Proto11.__call__" has type "def __call__(self, int, /, y: str) -> Any" +callables_protocol.py:260: error: Incompatible types in assignment (expression has type "def cb12_bad1(*args: Any, kwarg0: Any) -> None", variable has type "Proto12") [assignment] +callables_protocol.py:260: note: "Proto12.__call__" has type "def __call__(self, *args: Any, kwarg0: Any, kwarg1: Any) -> None" callables_protocol.py:284: error: Incompatible types in assignment (expression has type "Callable[[str], str]", variable has type "Proto13_Default") [assignment] -callables_protocol.py:284: note: "Proto13_Default.__call__" has type "Callable[[DefaultArg(str, 'path')], str]" -callables_protocol.py:311: error: Incompatible types in assignment (expression has type "Callable[[NamedArg(str, 'path')], str]", variable has type "Proto14_Default") [assignment] -callables_protocol.py:311: note: "Proto14_Default.__call__" has type "Callable[[DefaultNamedArg(str, 'path')], str]" +callables_protocol.py:284: note: "Proto13_Default.__call__" has type "def __call__(self, path: str = ...) -> str" +callables_protocol.py:311: error: Incompatible types in assignment (expression has type "def cb14_no_default(*, path: str) -> str", variable has type "Proto14_Default") [assignment] +callables_protocol.py:311: note: "Proto14_Default.__call__" has type "def __call__(self, *, path: str = ...) -> str" """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/mypy/dataclasses_transform_converter.toml b/conformance/results/mypy/dataclasses_transform_converter.toml index cc316bee1..fc5633e50 100644 --- a/conformance/results/mypy/dataclasses_transform_converter.toml +++ b/conformance/results/mypy/dataclasses_transform_converter.toml @@ -13,7 +13,7 @@ Line 121: Unexpected errors ['dataclasses_transform_converter.py:121: error: Arg """ output = """ dataclasses_transform_converter.py:48: error: Argument "converter" to "model_field" has incompatible type "Callable[[], int]"; expected "Callable[[Never], int]" [arg-type] -dataclasses_transform_converter.py:49: error: Argument "converter" to "model_field" has incompatible type "Callable[[NamedArg(int, 'x')], int]"; expected "Callable[[Never], int]" [arg-type] +dataclasses_transform_converter.py:49: error: Argument "converter" to "model_field" has incompatible type "def bad_converter2(*, x: int) -> int"; expected "Callable[[Never], int]" [arg-type] dataclasses_transform_converter.py:107: error: Argument 2 to "DC2" has incompatible type "str"; expected "int" [arg-type] dataclasses_transform_converter.py:107: error: Argument 3 to "DC2" has incompatible type "str"; expected "int" [arg-type] dataclasses_transform_converter.py:107: error: Argument 4 to "DC2" has incompatible type "bytes"; expected "ConverterClass" [arg-type] diff --git a/conformance/results/mypy/generics_paramspec_semantics.toml b/conformance/results/mypy/generics_paramspec_semantics.toml index eb5b744e6..7dc429c76 100644 --- a/conformance/results/mypy/generics_paramspec_semantics.toml +++ b/conformance/results/mypy/generics_paramspec_semantics.toml @@ -3,14 +3,14 @@ output = """ generics_paramspec_semantics.py:26: error: Unexpected keyword argument "a" [call-arg] generics_paramspec_semantics.py:26: error: Unexpected keyword argument "b" [call-arg] generics_paramspec_semantics.py:27: error: Argument 2 has incompatible type "str"; expected "bool" [arg-type] -generics_paramspec_semantics.py:61: error: Argument 2 to "func1" has incompatible type "Callable[[NamedArg(int, 'y')], int]"; expected "Callable[[NamedArg(int, 'x')], int]" [arg-type] +generics_paramspec_semantics.py:61: error: Argument 2 to "func1" has incompatible type "def keyword_only_y(*, y: int) -> int"; expected "def (*, x: int) -> int" [arg-type] generics_paramspec_semantics.py:98: error: Argument 1 has incompatible type "int"; expected "str" [arg-type] generics_paramspec_semantics.py:108: error: Argument 1 has incompatible type "int"; expected "bool" [arg-type] generics_paramspec_semantics.py:120: error: Argument 1 has incompatible type "int"; expected "str" [arg-type] generics_paramspec_semantics.py:127: error: Argument 1 to "expects_int_first" has incompatible type "Callable[[str], int]"; expected "Callable[[int], int]" [arg-type] generics_paramspec_semantics.py:127: note: This is likely because "one" has named arguments: "x". Consider marking them positional-only -generics_paramspec_semantics.py:132: error: Argument 1 to "expects_int_first" has incompatible type "Callable[[NamedArg(int, 'x')], int]"; expected "Callable[[int, NamedArg(int, 'x')], int]" [arg-type] -generics_paramspec_semantics.py:137: error: Argument 1 to "expects_int_first" has incompatible type "Callable[[KwArg(int)], int]"; expected "Callable[[int, KwArg(int)], int]" [arg-type] +generics_paramspec_semantics.py:132: error: Argument 1 to "expects_int_first" has incompatible type "def two(*, x: int) -> int"; expected "def (int, /, *, x: int) -> int" [arg-type] +generics_paramspec_semantics.py:137: error: Argument 1 to "expects_int_first" has incompatible type "def three(**kwargs: int) -> int"; expected "def (int, /, **kwargs: int) -> int" [arg-type] """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/mypy/generics_syntax_scoping.toml b/conformance/results/mypy/generics_syntax_scoping.toml index 1d6ad3e68..2e249720b 100644 --- a/conformance/results/mypy/generics_syntax_scoping.toml +++ b/conformance/results/mypy/generics_syntax_scoping.toml @@ -3,8 +3,7 @@ notes = """ Does not following runtime scoping rules for type parameters in all cases. """ output = """ -generics_syntax_scoping.py:14: error: Variable "generics_syntax_scoping.S" is not valid as a type [valid-type] -generics_syntax_scoping.py:14: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_scoping.py:14: error: Name "S" is not defined [name-defined] generics_syntax_scoping.py:18: error: Variable "generics_syntax_scoping.T" is not valid as a type [valid-type] generics_syntax_scoping.py:18: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases generics_syntax_scoping.py:35: error: Cannot determine type of "T" [has-type] diff --git a/conformance/results/mypy/narrowing_typeguard.toml b/conformance/results/mypy/narrowing_typeguard.toml index 12cc80af9..4c4f09522 100644 --- a/conformance/results/mypy/narrowing_typeguard.toml +++ b/conformance/results/mypy/narrowing_typeguard.toml @@ -4,7 +4,7 @@ narrowing_typeguard.py:102: error: TypeGuard functions must have a positional ar narrowing_typeguard.py:107: error: TypeGuard functions must have a positional argument [valid-type] narrowing_typeguard.py:128: error: Argument 1 to "takes_callable_str" has incompatible type "Callable[[object], TypeGuard[int]]"; expected "Callable[[object], str]" [arg-type] narrowing_typeguard.py:148: error: Argument 1 to "takes_callable_str_proto" has incompatible type "Callable[[object], TypeGuard[int]]"; expected "CallableStrProto" [arg-type] -narrowing_typeguard.py:148: note: "CallableStrProto.__call__" has type "Callable[[Arg(object, 'val')], str]" +narrowing_typeguard.py:148: note: "CallableStrProto.__call__" has type "def __call__(self, val: object) -> str" """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/mypy/narrowing_typeis.toml b/conformance/results/mypy/narrowing_typeis.toml index b913aa175..5000a5bfc 100644 --- a/conformance/results/mypy/narrowing_typeis.toml +++ b/conformance/results/mypy/narrowing_typeis.toml @@ -4,7 +4,7 @@ narrowing_typeis.py:105: error: "TypeIs" functions must have a positional argume narrowing_typeis.py:110: error: "TypeIs" functions must have a positional argument [valid-type] narrowing_typeis.py:132: error: Argument 1 to "takes_callable_str" has incompatible type "Callable[[object], TypeIs[int]]"; expected "Callable[[object], str]" [arg-type] narrowing_typeis.py:152: error: Argument 1 to "takes_callable_str_proto" has incompatible type "Callable[[object], TypeIs[int]]"; expected "CallableStrProto" [arg-type] -narrowing_typeis.py:152: note: "CallableStrProto.__call__" has type "Callable[[Arg(object, 'val')], str]" +narrowing_typeis.py:152: note: "CallableStrProto.__call__" has type "def __call__(self, val: object) -> str" narrowing_typeis.py:169: error: Argument 1 to "takes_typeguard" has incompatible type "Callable[[object], TypeIs[int]]"; expected "Callable[[object], TypeGuard[int]]" [arg-type] narrowing_typeis.py:170: error: Argument 1 to "takes_typeis" has incompatible type "Callable[[object], TypeGuard[int]]"; expected "Callable[[object], TypeIs[int]]" [arg-type] narrowing_typeis.py:191: error: Argument 1 to "takes_int_typeis" has incompatible type "Callable[[object], TypeIs[bool]]"; expected "Callable[[object], TypeIs[int]]" [arg-type] diff --git a/conformance/results/mypy/typeddicts_type_consistency.toml b/conformance/results/mypy/typeddicts_type_consistency.toml index e0e0ba7f2..3ddab2c9c 100644 --- a/conformance/results/mypy/typeddicts_type_consistency.toml +++ b/conformance/results/mypy/typeddicts_type_consistency.toml @@ -8,8 +8,6 @@ typeddicts_type_consistency.py:76: error: Incompatible types in assignment (expr typeddicts_type_consistency.py:77: error: Incompatible types in assignment (expression has type "B3", variable has type "dict[str, object]") [assignment] typeddicts_type_consistency.py:78: error: Incompatible types in assignment (expression has type "B3", variable has type "dict[Any, Any]") [assignment] typeddicts_type_consistency.py:82: error: Incompatible types in assignment (expression has type "B3", variable has type "Mapping[str, int]") [assignment] -typeddicts_type_consistency.py:101: error: Incompatible types in assignment (expression has type "str | None", variable has type "str") [assignment] -typeddicts_type_consistency.py:107: error: Incompatible types in assignment (expression has type "int | str", variable has type "int") [assignment] typeddicts_type_consistency.py:126: error: Incompatible types (expression has type "int", TypedDict item "inner_key" has type "str") [typeddict-item] """ conformance_automated = "Pass" diff --git a/conformance/results/mypy/version.toml b/conformance/results/mypy/version.toml index 7ce901e6d..e0afe12c0 100644 --- a/conformance/results/mypy/version.toml +++ b/conformance/results/mypy/version.toml @@ -1 +1 @@ -version = "mypy 1.18.2" +version = "mypy 1.19.0" diff --git a/conformance/results/pyrefly/aliases_explicit.toml b/conformance/results/pyrefly/aliases_explicit.toml index 6e489a28f..e6476ef79 100644 --- a/conformance/results/pyrefly/aliases_explicit.toml +++ b/conformance/results/pyrefly/aliases_explicit.toml @@ -4,7 +4,7 @@ errors_diff = """ """ output = """ ERROR aliases_explicit.py:67:9-28: `TypeAlias[GoodTypeAlias2, type[int | None]]` is not subscriptable [unsupported-operation] -ERROR aliases_explicit.py:68:9-28: `TypeAlias[GoodTypeAlias3, type[list[int | None]]]` is not subscriptable [unsupported-operation] +ERROR aliases_explicit.py:68:9-28: `TypeAlias[GoodTypeAlias3, type[list[GoodTypeAlias2]]]` is not subscriptable [unsupported-operation] ERROR aliases_explicit.py:69:9-33: Expected 1 type argument for `GoodTypeAlias4`, got 2 [bad-specialization] ERROR aliases_explicit.py:70:9-33: Expected 1 type argument for `GoodTypeAlias8`, got 2 [bad-specialization] ERROR aliases_explicit.py:71:9-33: Expected a valid ParamSpec expression, got `int` [invalid-param-spec] diff --git a/conformance/results/pyrefly/aliases_implicit.toml b/conformance/results/pyrefly/aliases_implicit.toml index 033e0c712..b8dea415a 100644 --- a/conformance/results/pyrefly/aliases_implicit.toml +++ b/conformance/results/pyrefly/aliases_implicit.toml @@ -12,7 +12,7 @@ Line 117: Expected 1 errors """ output = """ ERROR aliases_implicit.py:76:9-28: `type[int | None]` is not subscriptable [unsupported-operation] -ERROR aliases_implicit.py:77:9-28: `type[list[int | None]]` is not subscriptable [unsupported-operation] +ERROR aliases_implicit.py:77:9-28: `type[list[GoodTypeAlias2]]` is not subscriptable [unsupported-operation] ERROR aliases_implicit.py:78:9-33: Expected 1 type argument for `GoodTypeAlias4`, got 2 [bad-specialization] ERROR aliases_implicit.py:79:9-33: Expected 1 type argument for `GoodTypeAlias8`, got 2 [bad-specialization] ERROR aliases_implicit.py:80:9-33: Expected a valid ParamSpec expression, got `int` [invalid-param-spec] diff --git a/conformance/results/pyrefly/callables_kwargs.toml b/conformance/results/pyrefly/callables_kwargs.toml index ea7fa4326..92e2be0d9 100644 --- a/conformance/results/pyrefly/callables_kwargs.toml +++ b/conformance/results/pyrefly/callables_kwargs.toml @@ -9,16 +9,13 @@ ERROR callables_kwargs.py:52:11-12: Expected argument `v1` to be passed by name ERROR callables_kwargs.py:52:11-12: Expected 0 positional arguments, got 3 in function `func1` [bad-argument-count] ERROR callables_kwargs.py:52:14-16: Expected argument `v3` to be passed by name in function `func1` [unexpected-positional-argument] ERROR callables_kwargs.py:58:11-20: Unpacked keyword argument `str` is not assignable to parameter `v1` with type `int` in function `func1` [bad-argument-type] -ERROR callables_kwargs.py:61:11-15: Unpacked keyword argument `int | str` is not assignable to parameter `v1` with type `int` in function `func1` [bad-argument-type] -ERROR callables_kwargs.py:61:11-15: Unpacked keyword argument `int | str` is not assignable to parameter `v2` with type `str` in function `func1` [bad-argument-type] -ERROR callables_kwargs.py:61:11-15: Unpacked keyword argument `int | str` is not assignable to parameter `v3` with type `str` in function `func1` [bad-argument-type] ERROR callables_kwargs.py:63:17-22: Multiple values for argument `v1` in function `func1` [bad-keyword-argument] ERROR callables_kwargs.py:64:11-12: Argument `Literal[1]` is not assignable to parameter `v3` with type `str` in function `func2` [bad-argument-type] ERROR callables_kwargs.py:64:14-19: Multiple values for argument `v3` in function `func2` [bad-keyword-argument] ERROR callables_kwargs.py:65:17-22: Multiple values for argument `v1` in function `func2` [bad-keyword-argument] -ERROR callables_kwargs.py:101:19-24: `(**kwargs: Unpack[TypedDict[TD2]]) -> None` is not assignable to `TDProtocol3` [bad-assignment] -ERROR callables_kwargs.py:102:19-24: `(**kwargs: Unpack[TypedDict[TD2]]) -> None` is not assignable to `TDProtocol4` [bad-assignment] -ERROR callables_kwargs.py:103:19-24: `(**kwargs: Unpack[TypedDict[TD2]]) -> None` is not assignable to `TDProtocol5` [bad-assignment] +ERROR callables_kwargs.py:101:19-24: `(**kwargs: Unpack[TD2]) -> None` is not assignable to `TDProtocol3` [bad-assignment] +ERROR callables_kwargs.py:102:19-24: `(**kwargs: Unpack[TD2]) -> None` is not assignable to `TDProtocol4` [bad-assignment] +ERROR callables_kwargs.py:103:19-24: `(**kwargs: Unpack[TD2]) -> None` is not assignable to `TDProtocol5` [bad-assignment] ERROR callables_kwargs.py:111:20-41: TypedDict key 'v1' in **kwargs overlaps with parameter 'v1' [bad-function-definition] ERROR callables_kwargs.py:122:21-30: `Unpack` in **kwargs annotation must be used only with a `TypedDict` [invalid-annotation] ERROR callables_kwargs.py:134:19-24: `(*, v1: int, v3: str, v2: str = '') -> None` is not assignable to `TDProtocol6` [bad-assignment] diff --git a/conformance/results/pyrefly/generics_typevartuple_concat.toml b/conformance/results/pyrefly/generics_typevartuple_concat.toml index f9ba600ba..be211bd5b 100644 --- a/conformance/results/pyrefly/generics_typevartuple_concat.toml +++ b/conformance/results/pyrefly/generics_typevartuple_concat.toml @@ -1,11 +1,6 @@ -conformant = "Partial" -notes = """ -Fails to handle move_first_element_to_last example -""" -conformance_automated = "Fail" +conformant = "Pass" +conformance_automated = "Pass" errors_diff = """ -Line 56: Unexpected errors ['Returned type `tuple[*tuple[T | ElementOf[Ts], ...], T | ElementOf[Ts]]` is not assignable to declared return type `tuple[*Ts, T]` [bad-return]'] """ output = """ -ERROR generics_typevartuple_concat.py:56:12-30: Returned type `tuple[*tuple[T | ElementOf[Ts], ...], T | ElementOf[Ts]]` is not assignable to declared return type `tuple[*Ts, T]` [bad-return] """ diff --git a/conformance/results/pyrefly/literals_interactions.toml b/conformance/results/pyrefly/literals_interactions.toml index 4e5d984ea..6dc3d75c6 100644 --- a/conformance/results/pyrefly/literals_interactions.toml +++ b/conformance/results/pyrefly/literals_interactions.toml @@ -8,10 +8,10 @@ Line 71: Unexpected errors ['`@` is not supported between `Matrix[Literal[2], Li Line 72: Unexpected errors ['assert_type(Matrix[Literal[2], int], Matrix[Literal[2], Literal[7]]) failed [assert-type]'] """ output = """ -ERROR literals_interactions.py:15:5-9: Index 5 out of range for tuple with 3 elements [bad-index] -ERROR literals_interactions.py:16:5-9: Index -5 out of range for tuple with 3 elements [bad-index] -ERROR literals_interactions.py:17:5-9: Index 4 out of range for tuple with 3 elements [bad-index] -ERROR literals_interactions.py:18:5-10: Index -4 out of range for tuple with 3 elements [bad-index] +ERROR literals_interactions.py:15:7-8: Index 5 out of range for tuple with 3 elements [bad-index] +ERROR literals_interactions.py:16:7-8: Index -5 out of range for tuple with 3 elements [bad-index] +ERROR literals_interactions.py:17:7-8: Index 4 out of range for tuple with 3 elements [bad-index] +ERROR literals_interactions.py:18:7-9: Index -4 out of range for tuple with 3 elements [bad-index] ERROR literals_interactions.py:71:9-14: `@` is not supported between `Matrix[Literal[2], Literal[3]]` and `Matrix[Literal[3], Literal[7]]` [unsupported-operation] ERROR literals_interactions.py:72:16-51: assert_type(Matrix[Literal[2], int], Matrix[Literal[2], Literal[7]]) failed [assert-type] """ diff --git a/conformance/results/pyrefly/namedtuples_define_class.toml b/conformance/results/pyrefly/namedtuples_define_class.toml index 0c8456569..706bce8fe 100644 --- a/conformance/results/pyrefly/namedtuples_define_class.toml +++ b/conformance/results/pyrefly/namedtuples_define_class.toml @@ -3,8 +3,8 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR namedtuples_define_class.py:32:7-12: Index 3 out of range for tuple with 3 elements [bad-index] -ERROR namedtuples_define_class.py:33:7-13: Index -4 out of range for tuple with 3 elements [bad-index] +ERROR namedtuples_define_class.py:32:10-11: Index 3 out of range for tuple with 3 elements [bad-index] +ERROR namedtuples_define_class.py:33:10-12: Index -4 out of range for tuple with 3 elements [bad-index] ERROR namedtuples_define_class.py:44:11-14: Missing argument `y` in function `Point.__new__` [missing-argument] ERROR namedtuples_define_class.py:45:11-16: Missing argument `y` in function `Point.__new__` [missing-argument] ERROR namedtuples_define_class.py:46:15-17: Argument `Literal['']` is not assignable to parameter `y` with type `int` in function `Point.__new__` [bad-argument-type] diff --git a/conformance/results/pyrefly/namedtuples_usage.toml b/conformance/results/pyrefly/namedtuples_usage.toml index 14f8163d8..fb3a165ad 100644 --- a/conformance/results/pyrefly/namedtuples_usage.toml +++ b/conformance/results/pyrefly/namedtuples_usage.toml @@ -3,8 +3,8 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR namedtuples_usage.py:34:7-11: Index 3 out of range for tuple with 3 elements [bad-index] -ERROR namedtuples_usage.py:35:7-12: Index -4 out of range for tuple with 3 elements [bad-index] +ERROR namedtuples_usage.py:34:9-10: Index 3 out of range for tuple with 3 elements [bad-index] +ERROR namedtuples_usage.py:35:9-11: Index -4 out of range for tuple with 3 elements [bad-index] ERROR namedtuples_usage.py:40:1-4: Cannot set field `x` [read-only] ERROR namedtuples_usage.py:41:1-5: Cannot set item in `Point` [unsupported-operation] ERROR namedtuples_usage.py:42:5-8: Cannot delete field `x` [read-only] diff --git a/conformance/results/pyrefly/protocols_runtime_checkable.toml b/conformance/results/pyrefly/protocols_runtime_checkable.toml index 2566b2a45..eeee93851 100644 --- a/conformance/results/pyrefly/protocols_runtime_checkable.toml +++ b/conformance/results/pyrefly/protocols_runtime_checkable.toml @@ -1,15 +1,14 @@ -conformant = "Partial" -notes = """ -Does not check for unsafe overlap in runtime_checkable protocols -""" -conformance_automated = "Fail" +conformant = "Pass" +conformance_automated = "Pass" errors_diff = """ -Line 88: Expected 1 errors -Line 92: Expected 1 errors -Line 96: Expected 1 errors """ output = """ ERROR protocols_runtime_checkable.py:23:22-28: Protocol `Proto1` is not decorated with @runtime_checkable and cannot be used with isinstance() [invalid-argument] ERROR protocols_runtime_checkable.py:55:22-34: Protocol `DataProtocol` has non-method members and cannot be used with issubclass() [invalid-argument] ERROR protocols_runtime_checkable.py:61:22-53: Protocol `DataProtocol` has non-method members and cannot be used with issubclass() [invalid-argument] +ERROR protocols_runtime_checkable.py:88:33-39: Runtime checkable protocol `Proto3` has an unsafe overlap with type `Concrete3A` [invalid-argument] +ERROR protocols_runtime_checkable.py:92:23-48: Runtime checkable protocol `Proto3` has an unsafe overlap with type `Concrete3B` [invalid-argument] +ERROR protocols_runtime_checkable.py:92:23-48: Runtime checkable protocol `NonDataProtocol` has an unsafe overlap with type `Concrete3B` [invalid-argument] +ERROR protocols_runtime_checkable.py:96:31-56: Runtime checkable protocol `Proto3` has an unsafe overlap with type `Concrete3A` [invalid-argument] +ERROR protocols_runtime_checkable.py:96:31-56: Runtime checkable protocol `NonDataProtocol` has an unsafe overlap with type `Concrete3A` [invalid-argument] """ diff --git a/conformance/results/pyrefly/typeddicts_extra_items.toml b/conformance/results/pyrefly/typeddicts_extra_items.toml index 6dd410858..1f75ab69a 100644 --- a/conformance/results/pyrefly/typeddicts_extra_items.toml +++ b/conformance/results/pyrefly/typeddicts_extra_items.toml @@ -20,15 +20,15 @@ ERROR typeddicts_extra_items.py:174:7-12: Cannot change the non-read-only extra ERROR typeddicts_extra_items.py:185:5-9: TypedDict `MovieBase2` with non-read-only `extra_items` cannot be extended with required extra item `year` [bad-typed-dict-key] ERROR typeddicts_extra_items.py:188:5-9: `int` is not consistent with `extra_items` type `int | None` of TypedDict `MovieBase2` [bad-typed-dict-key] ERROR typeddicts_extra_items.py:197:5-14: `str` is not assignable to `extra_items` type `int | None` of TypedDict `BookBase` [bad-typed-dict-key] -ERROR typeddicts_extra_items.py:215:22-30: `TypedDict[MovieDetails]` is not assignable to `TypedDict[MovieBase2]` [bad-assignment] -ERROR typeddicts_extra_items.py:222:22-30: `TypedDict[MovieWithYear2]` is not assignable to `TypedDict[MovieBase2]` [bad-assignment] -ERROR typeddicts_extra_items.py:242:19-27: `TypedDict[MovieDetails5]` is not assignable to `TypedDict[MovieSI]` [bad-assignment] -ERROR typeddicts_extra_items.py:256:13-22: `TypedDict[MovieExtraStr]` is not assignable to variable `extra_int` with type `TypedDict[MovieExtraInt]` [bad-assignment] -ERROR typeddicts_extra_items.py:257:13-22: `TypedDict[MovieExtraInt]` is not assignable to variable `extra_str` with type `TypedDict[MovieExtraStr]` [bad-assignment] -ERROR typeddicts_extra_items.py:268:14-24: `TypedDict[MovieNotClosed]` is not assignable to variable `extra_int2` with type `TypedDict[MovieExtraInt]` [bad-assignment] -ERROR typeddicts_extra_items.py:278:47-51: Unexpected keyword argument `year` in function `NonClosedMovie.__init__` [unexpected-keyword] -ERROR typeddicts_extra_items.py:285:52-61: Keyword argument `language` with type `Literal['English']` is not assignable to kwargs type `int` in function `ExtraMovie.__init__` [bad-argument-type] -ERROR typeddicts_extra_items.py:293:44-48: Unexpected keyword argument `year` in function `ClosedMovie.__init__` [unexpected-keyword] -ERROR typeddicts_extra_items.py:303:34-44: `TypedDict[MovieExtraInt]` is not assignable to `Mapping[str, int]` [bad-assignment] -ERROR typeddicts_extra_items.py:352:25-52: `dict[str, int]` is not assignable to `TypedDict[IntDict]` [bad-assignment] +ERROR typeddicts_extra_items.py:215:22-30: `MovieDetails` is not assignable to `MovieBase2` [bad-assignment] +ERROR typeddicts_extra_items.py:222:22-30: `MovieWithYear2` is not assignable to `MovieBase2` [bad-assignment] +ERROR typeddicts_extra_items.py:242:19-27: `MovieDetails5` is not assignable to `MovieSI` [bad-assignment] +ERROR typeddicts_extra_items.py:256:13-22: `MovieExtraStr` is not assignable to variable `extra_int` with type `MovieExtraInt` [bad-assignment] +ERROR typeddicts_extra_items.py:257:13-22: `MovieExtraInt` is not assignable to variable `extra_str` with type `MovieExtraStr` [bad-assignment] +ERROR typeddicts_extra_items.py:268:14-24: `MovieNotClosed` is not assignable to variable `extra_int2` with type `MovieExtraInt` [bad-assignment] +ERROR typeddicts_extra_items.py:278:15-57: No matching overload found for function `NonClosedMovie.__init__` called with arguments: (name=Literal['No Country for Old Men'], year=Literal[2007]) [no-matching-overload] +ERROR typeddicts_extra_items.py:285:11-62: No matching overload found for function `ExtraMovie.__init__` called with arguments: (name=Literal['No Country for Old Men'], language=Literal['English']) [no-matching-overload] +ERROR typeddicts_extra_items.py:293:12-54: No matching overload found for function `ClosedMovie.__init__` called with arguments: (name=Literal['No Country for Old Men'], year=Literal[2007]) [no-matching-overload] +ERROR typeddicts_extra_items.py:303:34-44: `MovieExtraInt` is not assignable to `Mapping[str, int]` [bad-assignment] +ERROR typeddicts_extra_items.py:352:25-52: `dict[str, int]` is not assignable to `IntDict` [bad-assignment] """ diff --git a/conformance/results/pyrefly/typeddicts_readonly_consistency.toml b/conformance/results/pyrefly/typeddicts_readonly_consistency.toml index 90edd6dee..9f8e01d85 100644 --- a/conformance/results/pyrefly/typeddicts_readonly_consistency.toml +++ b/conformance/results/pyrefly/typeddicts_readonly_consistency.toml @@ -3,11 +3,11 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR typeddicts_readonly_consistency.py:37:14-15: `TypedDict[A1]` is not assignable to `TypedDict[B1]` [bad-assignment] -ERROR typeddicts_readonly_consistency.py:38:14-15: `TypedDict[C1]` is not assignable to `TypedDict[B1]` [bad-assignment] -ERROR typeddicts_readonly_consistency.py:40:14-15: `TypedDict[A1]` is not assignable to `TypedDict[C1]` [bad-assignment] -ERROR typeddicts_readonly_consistency.py:81:14-15: `TypedDict[A2]` is not assignable to `TypedDict[B2]` [bad-assignment] -ERROR typeddicts_readonly_consistency.py:82:14-15: `TypedDict[C2]` is not assignable to `TypedDict[B2]` [bad-assignment] -ERROR typeddicts_readonly_consistency.py:84:14-15: `TypedDict[A2]` is not assignable to `TypedDict[C2]` [bad-assignment] -ERROR typeddicts_readonly_consistency.py:85:14-15: `TypedDict[B2]` is not assignable to `TypedDict[C2]` [bad-assignment] +ERROR typeddicts_readonly_consistency.py:37:14-15: `A1` is not assignable to `B1` [bad-assignment] +ERROR typeddicts_readonly_consistency.py:38:14-15: `C1` is not assignable to `B1` [bad-assignment] +ERROR typeddicts_readonly_consistency.py:40:14-15: `A1` is not assignable to `C1` [bad-assignment] +ERROR typeddicts_readonly_consistency.py:81:14-15: `A2` is not assignable to `B2` [bad-assignment] +ERROR typeddicts_readonly_consistency.py:82:14-15: `C2` is not assignable to `B2` [bad-assignment] +ERROR typeddicts_readonly_consistency.py:84:14-15: `A2` is not assignable to `C2` [bad-assignment] +ERROR typeddicts_readonly_consistency.py:85:14-15: `B2` is not assignable to `C2` [bad-assignment] """ diff --git a/conformance/results/pyrefly/typeddicts_readonly_update.toml b/conformance/results/pyrefly/typeddicts_readonly_update.toml index a56c02f82..44bc14874 100644 --- a/conformance/results/pyrefly/typeddicts_readonly_update.toml +++ b/conformance/results/pyrefly/typeddicts_readonly_update.toml @@ -3,5 +3,5 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR typeddicts_readonly_update.py:23:10-14: No matching overload found for function `A.update` called with arguments: (TypedDict[A]) [no-matching-overload] +ERROR typeddicts_readonly_update.py:23:10-14: No matching overload found for function `A.update` called with arguments: (A) [no-matching-overload] """ diff --git a/conformance/results/pyrefly/typeddicts_type_consistency.toml b/conformance/results/pyrefly/typeddicts_type_consistency.toml index bc1273de8..3003ae792 100644 --- a/conformance/results/pyrefly/typeddicts_type_consistency.toml +++ b/conformance/results/pyrefly/typeddicts_type_consistency.toml @@ -3,13 +3,13 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR typeddicts_type_consistency.py:21:10-12: `TypedDict[B1]` is not assignable to `TypedDict[A1]` [bad-assignment] -ERROR typeddicts_type_consistency.py:38:10-12: `TypedDict[B2]` is not assignable to `TypedDict[A2]` [bad-assignment] -ERROR typeddicts_type_consistency.py:65:6-8: `TypedDict[A3]` is not assignable to variable `b3` with type `TypedDict[B3]` [bad-assignment] +ERROR typeddicts_type_consistency.py:21:10-12: `B1` is not assignable to `A1` [bad-assignment] +ERROR typeddicts_type_consistency.py:38:10-12: `B2` is not assignable to `A2` [bad-assignment] +ERROR typeddicts_type_consistency.py:65:6-8: `A3` is not assignable to variable `b3` with type `B3` [bad-assignment] ERROR typeddicts_type_consistency.py:69:21-24: Key `y` is not defined in TypedDict `A3` [bad-typed-dict-key] -ERROR typeddicts_type_consistency.py:76:22-24: `TypedDict[B3]` is not assignable to `dict[str, int]` [bad-assignment] -ERROR typeddicts_type_consistency.py:77:25-27: `TypedDict[B3]` is not assignable to `dict[str, object]` [bad-assignment] -ERROR typeddicts_type_consistency.py:78:22-24: `TypedDict[B3]` is not assignable to `dict[Any, Any]` [bad-assignment] -ERROR typeddicts_type_consistency.py:82:25-27: `TypedDict[B3]` is not assignable to `Mapping[str, int]` [bad-assignment] +ERROR typeddicts_type_consistency.py:76:22-24: `B3` is not assignable to `dict[str, int]` [bad-assignment] +ERROR typeddicts_type_consistency.py:77:25-27: `B3` is not assignable to `dict[str, object]` [bad-assignment] +ERROR typeddicts_type_consistency.py:78:22-24: `B3` is not assignable to `dict[Any, Any]` [bad-assignment] +ERROR typeddicts_type_consistency.py:82:25-27: `B3` is not assignable to `Mapping[str, int]` [bad-assignment] ERROR typeddicts_type_consistency.py:126:56-57: `Literal[1]` is not assignable to TypedDict key `inner_key` with type `str` [bad-typed-dict-key] """ diff --git a/conformance/results/pyrefly/version.toml b/conformance/results/pyrefly/version.toml index 13ffc21b7..4dfd1faaa 100644 --- a/conformance/results/pyrefly/version.toml +++ b/conformance/results/pyrefly/version.toml @@ -1 +1 @@ -version = "pyrefly 0.43.1" +version = "pyrefly 0.45.2" diff --git a/conformance/results/results.html b/conformance/results/results.html index c5de23a64..22ac1d68c 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -158,13 +158,13 @@

    Python Type System Conformance Test Results

     
    mypy 1.17.1
    +
    mypy 1.18.2
    pyright 1.1.404
    +
    pyright 1.1.406
    pyre 0.9.25
    zuban 0.0.24
    pyrefly 0.30.0
    +
    pyrefly 0.36.2
    @@ -267,7 +267,7 @@

    Python Type System Conformance Test Results

    Pass
    Unsupported

    Does not support generic defaults.

    Partial

    Does not reject TypeVars with defaults after a TypeVarTuple

    Type parameter defaults are not bound by attribute access

    ParamSpec after TypeVarTuple is not always handled correctly

    Pass*

    Unsolved type var is not always resolved to default (optional)

    Partial

    Defaults are not bound by attribute access

         generics_defaults_referential Partial Pass
         generics_scoping
    Partial

    False negative on generic class nested within generic class with same type variable.

    Pass Pass
    Partial

    False negative on generic class nested within generic function with same type variable.

    False negative on generic class nested within generic class with same type variable.

    False negative on assert_type uses.

    Partial

    False negative on generic class nested within generic class with same type variable.

    Partial

    Does not infer the type of an unannotated `self` parameter to be type `Self`.

    Does not retain `Self` when calling method that returns `Self`.

    Does not infer the type of an unannotated `cls` parameter to be type `type[Self]`.

    Does not retain `Self` when accessing attribute through `type[Self]`.

    Pass
    Partial

    Does not handle use of `Self` within class body correctly.

    False negatives on assert_type uses.

    Pass*

    True positive: Writing to a variable that contains Self (with a class) should error

    Partial

    Doesn't allow accessing `Self` in a classmethod

    Pass*

    Treats attributes not initialized on the class as instance-only

         generics_self_attributes Pass
    Unsupported

    Does not understand `Self` type.

    Pass
    Partial

    Does not reject incorrect direct assignment to attribute w/ Self

    Pass
         generics_self_basic Pass Pass
    Partial

    Does not reject protocol compatibility due to method `Self` return type.

    Pass
    Partial

    Protocol subtyping does not work with Self in return annotation

    Pass
         generics_self_usage Pass
    Partial

    Infers Node[Never] instead of Node[Any] when argument is not provided.

    False negative on instance attribute access on type(node).

    Pass
    Partial

    Does not erase unspecified type variables to `Any` prior to `assert_type` handling.

    False negatives on instance attribute access on the type.

    Does not infer type of `DefaultDict` with explicit type parameters on constructor.

    False negatives on assert_type uses.

    Pass*

    True positive: Undefined type vars should be inferred as Never not Any (avoiding to introduce Any)

    Partial

    Infers Node[Never] instead of Node[Any] when argument is not provided.

    Pass
         generics_typevartuple_args Pass
    Partial

    False positives on valid type expression (`list[T]`) in `bound`.

    Does not complain when bound is used alongside type constraints.

    Partial

    Does not reject use of type variable within an upper bound.

    Partial

    Instantiation is not validated against bound

    Pass
         generics_variance
    Partial

    Does not reject use of class-scoped TypeVar used in a base class when variance is incompatible.

    Pass
    Partial

    Reports error for overloaded method implementation marked @final if its overloads do not.

    Does not report error for overloaded @final method defined in stub file.

    Reports misleading error when overload is marked @final but implementation is not.

    Pass
    Partial

    Does not ban final decorator on overload when implementation exists

    Pass
    Class type compatibility @@ -566,7 +566,7 @@

    Python Type System Conformance Test Results

    Pass
    Partial

    Incorrectly infers `str` rather than `LiteralString` when literal string `join` is used.

    Pass
    Partial

    LiteralString is sometimes converted to str

    Pass
         literals_parameterizations
    Partial

    Does not reject tuple within Literal.

    Pass*

    Does not report unimplemented attributes for class that explicitly derives from protocol until it is instantiated.

    Pass
    Partial

    Does not report error when calling unimplemented protocol method from derived class.

    Does not report error when method is not implemented in derived class.

    Pass*

    Does not report unimplemented attributes for class that explicitly derives from protocol until it is instantiated.

    Pass
    Unsupported

    Does not check against abstract class instantiations

         protocols_generic Pass
    Partial

    Does not reject the use of Protocol and Generic together as base classes.

    Does not detect protocol mismatch when method-scoped TypeVar is used in protocol.

    Pass
    Partial

    Fails one protocol subtyping example involving @property

    Pass
         protocols_merging Pass Pass Pass Pass
    Partial

    Does not check against abstract class instantiations

    Pass
         protocols_modules Pass Pass Pass Pass
    Partial

    Fails some protocol subtyping examples when self is annotated with a type var

    Pass
         protocols_subtyping Pass Pass
    Unsupported

    Does not detect incorrect TypeVar variance within generic protocols.

    PassUnknownUnsupported
    Callables @@ -677,7 +677,7 @@

    Python Type System Conformance Test Results

    Pass Pass Pass
    Partial

    Does not reject overlap between unpacked TypedDict kwarg and named parameters

    Pass
         callables_protocol Pass Pass
    Partial

    Expects @final and @override to be present on all overloads, not just first.

    Pass
    Partial

    Does not restrict some decorators to the first overload

    Does not require some decorators that need to appear on every overload

    Pass
         overloads_evaluation
    Partial

    Does not expand boolean arguments to Literal[True] and Literal[False].

    Does not expand enum arguments to literal variants.

    Does not expand tuple arguments to possible combinations.

    Does not evaluate Any in some cases where overload is ambiguous.

    Evaluates Any in some cases where overload is not ambiguous.

         dataclasses_match_args Pass
    Partial

    Generates __match_args__ when match_args=False.

    Pass
    Partial

    Adds kw-only fields to __match_args__.

    Pass Pass
         typeddicts_extra_items
    Unsupported

    Not supported.

    Partial

    Does not flag illegal use of `closed=False` when inheriting from a non-open TypedDict.

    Pass
    Unsupported

    Not supported.

    Pass
    Partial

    Does not fully support extra_items for typed dicts

    Pass
         typeddicts_final Pass
         namedtuples_define_class
    Partial

    Does not reject override of named tuple attribute in child class.

    Pass
    Partial

    Does not evaluate correct type for indexed named tuple instance with integer.

    Does not evaluate correct type for indexed named tuple instance with slice.

    Does not report out-of-range index access with named tuple instance.

    Does not reject named tuple element with no default value after one with a default.

    Incorrectly rejects assignment of named tuple to a tuple with compatible type.

    Does not reject attempt to use NamedTuple with multiple inheritance.

    Pass
    Partial

    Does not reject override of named tuple attribute in child class.

    Pass
         namedtuples_usage
    Partial

    Does not reject attempt to delete named tuple field by name.

    PassPartialPass Pass Pass
    Pass Pass Pass
    Partial

    Iterating an enum class gives Any

    Pass
         enums_definition Pass
    pyre 0.9.25
    zuban 0.0.24
    +
    zuban 0.1.0
    pyrefly 0.36.2
    pyright 1.1.406
    pyre 0.9.25
    -
    zuban 0.1.0
    pyrefly 0.36.2
    +
    pyrefly 0.37.0
    +
    Type annotations
         annotations_coroutines Pass Pass PassPass
         annotations_forward_refs
    Partial

    Does not report error for a forward reference that is not enclosed in quotes.

    Does not report error for use of quoted type with "|" operator (runtime error).

    Incorrectly generates error for quoted type defined in class scope.

    Pass
    Partial

    Does not report error for a forward reference that is not enclosed in quotes.

    Does not report error for use of quoted type with "|" operator (runtime error).

    Does not reject f-string in quoted type annotation.

    Incorrectly generates error for quoted type defined in class scope.

    Does not generate error for unquoted type defined in class scope.

    Does not treat triple-quoted forward reference annotation as implicitly parenthesized.

    Partial

    Does not report error for a forward reference that is not enclosed in quotes.

    Incorrectly generates error for quoted type defined in class scope.

    Does not ignore newlines in multi-line unions

    Partial

    Types in quotes incorrectly refer to shadowing class member.

    Does not reject some type forms that require quotes.

         annotations_generators
    Partial

    Does not report incompatible Generator type in `yield from` statement.

    Pass
    Partial

    Does not report invalid return type for generator when function implicitly returns None.

    Incorrectly evaluates type of call to async generator.

    Pass
    Partial

    Does not detect that invalid yield is unreachable

         annotations_methods
    Pass*

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

    Pass*

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

    Pass*

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

    Pass Pass
    Pass Pass PassPass
    +
    Special types in annotations
         specialtypes_any Pass Pass PassPass
         specialtypes_never Pass Pass
    Partial

    Does not treat Never as compatible with all other types.

    Pass
    Partial

    Does not detect invalid return is unreachable

    Pass Pass PassPass
         specialtypes_promotions Pass Pass
    Partial

    Does not reject use of attribute that is compatible only with float.

    Pass Pass
         specialtypes_type
    Partial

    Does not treat `type` same as `type[Any]` for assert_type.

    Does not allow access to unknown attributes from object of type `type[Any]`.

    Pass
    Partial

    Does not reject Callable when passed to type[T].

    Does not treat `type` same as `type[Any]` for assert_type.

    Does not allow access to unknown attributes from object of type `type[Any]`.

    Does not reject access to unknown attributes from object of type `Type[object]`.

    Reports type incompatibility between `type` and `Callable[..., Any]`.

    Pass
    Partial

    Does not implement all typing rules for type/type[]

    +
    Generics
         generics_base_class
    Partial

    Does not detect inconsistent type variable ordering.

    Pass
    Partial

    Does not reject illegal use of Generic.

    Does not allow using generic in assert_type expression.

    Does not detect inconsistent type variable ordering.

    Partial

    Does not detect inconsistent type variable ordering in multi-inheritance.

    Partial

    Does not reject inconsistent ordering of type variables in different base classes.

         generics_basic Pass Pass
    Partial

    False positives in examples using constrained type variables.

    False negative for constraint parameterized by a type variable.

    False negative in custom map example.

    False positive using `iter`.

    False negative for bad type arguments to Generic/Protocol.

    False negative for generic metaclass.

    Pass
    Partial

    Does not reject Type Var definition with only 1 constraint

    Incorrect rejects + between two AnyStr

    Constrained type var resolves to subtype instead of explcitly listed constraint

         generics_defaults Partial Pass
    Unsupported

    Does not support generic defaults.

    Partial

    Does not reject TypeVars with defaults after a TypeVarTuple

    Type parameter defaults are not bound by attribute access

    ParamSpec after TypeVarTuple is not always handled correctly

    Partial

    Defaults are not bound by attribute access

         generics_defaults_referential Partial PassUnsupported Pass Unsupported
         generics_defaults_specialization Partial Pass
    Unsupported

    Does not support generic defaults.

    Pass Pass
         generics_paramspec_basic Pass Pass
    Partial

    Does not enforce name consistency for ParamSpec assigned to identifier.

    Incorrectly reports error for legitimate use of ParamSpec in generic type alias.

    Does not reject ParamSpec when used in various invalid locations.

    Pass Pass
         generics_paramspec_components Pass Pass
    Partial

    Does not report illegal use of "P.args" on normal parameter.

    Does not report error when P.args is specified but P.kwargs is missing.

    Does not report error when P is out of scope and P.args and P.kwargs is used.

    Does not report error when calling callback defined with ParamSpec with incorrect arguments.

    Does not report error when keyword argument is specified between P.args and P.kwargs.

    Does not report error when calling callable and argument is missing for concatenated parameters.

    Pass
    Partial

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

    Pass*

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

    Pass PassPass
         generics_paramspec_specialization Pass Pass
    Partial

    Reports error for legitimate use of `...` to specialize ParamSpec

    Pass Pass
         generics_scoping Pass Pass
    Partial

    False negative on generic class nested within generic function with same type variable.

    False negative on generic class nested within generic class with same type variable.

    False negative on assert_type uses.

    Partial

    False negative on generic class nested within generic class with same type variable.

    Partial

    Does not implement several scoping checks/restrictions for generics

         generics_self_advanced
    Partial

    Does not infer the type of an unannotated `self` parameter to be type `Self`.

    Does not retain `Self` when calling method that returns `Self`.

    Does not infer the type of an unannotated `cls` parameter to be type `type[Self]`.

    Does not retain `Self` when accessing attribute through `type[Self]`.

    Pass
    Partial

    Does not handle use of `Self` within class body correctly.

    False negatives on assert_type uses.

    Partial

    Doesn't allow accessing `Self` in a classmethod

    Pass*

    Treats attributes not initialized on the class as instance-only

         generics_self_attributes Pass Pass
    Unsupported

    Does not understand `Self` type.

    Pass Pass
         generics_self_basic Pass Pass
    Partial

    Does not handle use of `Self` as a generic type.

    Pass
    Partial

    Return annotation of Self allows returning the concrete instance of the current class.

         generics_self_protocols Pass Pass
    Partial

    Does not reject protocol compatibility due to method `Self` return type.

    Pass Pass
         generics_self_usage Pass Pass
    Partial

    Complains in some cases when `self: Self` is used explicitly.

    Does not complain when `Self` is used on a function outside any class definition.

    Does not complain when `self` is annotated explicitly (without `Self`) and `Self` is returned.

    Does not complain on inheritance involving `Self`.

    Does not complain on use of `Self` in static methods.

    Does not complain on use of `Self` in metaclasses.

    Partial

    Does not detect invalid Self when Self is not properly bound

    Partial

    Does not implement some restrictions on where Self can be used

         generics_syntax_compatibility Pass Pass
    Partial

    False negative on mixing legacy and PEP695 syntax.

    Does not detect mixing legacy and PEP695 syntax in methods.

    Pass Pass
         generics_syntax_declarations Pass Pass
    Partial

    Does not detect incorrect use of legacy style syntax mixed with PEP695 syntax.

    False negatives due to assert_type use.

    Pass Pass
         generics_syntax_infer_variance
    Unsupported

    Type parameter syntax not yet support.

    Pass
    Partial

    Incorrectly determines that a class cannot be instantiated with __getitem__.

    Incorrectly handles mixing legacy and PEP695 syntax.

    Partial

    Final is handled a bit different (questionable if this is an issue)

    Pass
         generics_syntax_scoping
    Partial

    Does not following runtime scoping rules for type parameters in all cases.

    Pass
    Partial

    Does not properly handle mixing legacy syntax with PEP695 syntax.

    Partial

    Does not following runtime scoping rules for type parameters in all cases.

    Partial

    Does not implement some scoping restrictions for PEP695 generic syntax

         generics_type_erasure
    Partial

    Infers Node[Never] instead of Node[Any] when argument is not provided.

    False negative on instance attribute access on type(node).

    Pass
    Partial

    Does not erase unspecified type variables to `Any` prior to `assert_type` handling.

    False negatives on instance attribute access on the type.

    Does not infer type of `DefaultDict` with explicit type parameters on constructor.

    False negatives on assert_type uses.

    Partial

    Infers Node[Never] instead of Node[Any] when argument is not provided.

    Pass
         generics_typevartuple_args
    Partial

    Does not enforce that tuples captured by TypeVarTuple are same type.

    Pass
    Partial

    Does not property handle TypeVarTuple.

    Partial

    Does not enforce that tuples captured by TypeVarTuple are same type.

    Pass
         generics_typevartuple_basic
    Partial

    Does not enforce that tuples captured by TypeVarTuple are same length.

    Does not enforce that tuples captured by TypeVarTuple are same type.

    Pass
    Partial

    Does not support TypeVarTuple.

    False negatives due to assert_type.

    Partial

    Does not enforce that tuples captured by TypeVarTuple are same length.

    Does not enforce that tuples captured by TypeVarTuple are same type.

    Partial

    TypeVarTuple is pinned too early when calling generic function

         generics_typevartuple_callable Pass Pass
    Partial

    False negatives due to assert_type.

    Pass Pass
         generics_typevartuple_concat Pass Pass
    Partial

    False negatives due to assert_type.

    False compatability error message.

    Pass
    Partial

    Fails to handle move_first_element_to_last example

         generics_typevartuple_overloads Pass Pass
    Unsupported

    Does not support star expressions for `Unpack`.

    Pass Pass
         generics_typevartuple_specialization
    Partial

    Incorrectly specializes generic alias that includes a TypeVar and TypeVarTuple if no type arguments are provided.

    Rejects specialization of generic type alias defined as a tuple containing a TypeVar.

    Pass
    Unsupported

    Does not support star expressions for `Unpack`.

    Pass
    Partial

    Sometimes specializes to tuple[Any, ...] instead of empty tuple

    Pass Pass PassPass
         generics_upper_bound
    Partial

    Does not reject use of type variable within an upper bound.

    Pass
    Partial

    False positives on valid type expression (`list[T]`) in `bound`.

    Does not complain when bound is used alongside type constraints.

    Partial

    Does not reject use of type variable within an upper bound.

    Pass
         generics_variance
    Partial

    Does not reject use of class-scoped TypeVar used in a base class when variance is incompatible.

    Pass
    Partial

    Does not reject a TypeVar that is defined as both covariant and contravariant.

    Does not reject use of class-scoped TypeVar used in a base class when variance is incompatible.

    Partial

    Does not reject use of class-scoped TypeVar used in a base class when variance is incompatible.

    Unsupported
         generics_variance_inference Pass Pass
    Partial

    Does not properly handle mixing legacy and PEP695 syntax.

    False negative about a type variable not being present in the function's parameters.

    Pass Pass
    +
    Type qualifiers
         qualifiers_annotated
    Partial

    Does not allow ClassVar to be nested within Annotated.

    Does not allow Final to be nested within Annotated.

    Does not allow Required and NotRequired to be nested within Annotated.

    Does not reject type[T] compatibility for type alias defined with Annotated.

    Does not reject call of type alias defined with Annotated.

    Pass
    Partial

    Does not reject Annotated with a single parameter.

    Does not reject call of Annotated with no type arguments.

    Pass
    Partial

    Allows Annotated in some contexts where it should not be allowed

         qualifiers_final_annotation
    Partial

    Does not treat use of Final name as if it was replaced by the literal in NamedTuple definition.

    Does not allow conditional assignment of Final instance variable in __init__ method.

    Does not allow redefinition of private class variable that is marked Final in parent class.

    Does not report modification of local Final variable via "for" statement.

    Pass
    Partial

    Does not report Final variable with missing initialization in module scope.

    Does not report error for invalid nesting of Final and ClassVar.

    Does not treat use of Final name as if it was replaced by the literal in NamedTuple definition.

    Does not reject modification of imported variable declared Final.

    Partial

    Does not treat use of Final name as if it was replaced by the literal in NamedTuple definition.

    Does not allow conditional assignment of Final instance variable in __init__ method.

    Partial

    Final attributes not initialized on the class can be assigned to

         qualifiers_final_decorator Pass Pass
    Partial

    Reports error for overloaded method implementation marked @final if its overloads do not.

    Does not report error for overloaded @final method defined in stub file.

    Reports misleading error when overload is marked @final but implementation is not.

    Pass Pass
    +
    Class type compatibility
         classes_classvar
    Partial

    Internal error if TypeVarTuple is used in ClassVar.

    Does not reject use of ParamSpec in ClassVar.

    Rejects ClassVar nested in Annotated.

    Does not reject use of ClassVar in TypeAlias definition.

    Pass
    Partial

    Does not reject use of TypeVar in ClassVar.

    Does not reject use of ParamSpec in ClassVar.

    Does not reject use of ClassVar as a generic type argument.

    Does not reject use of ClassVar in parameter type annotation.

    Does not reject use of ClassVar in local variable annotation.

    Does not reject use of ClassVar in instance variable annotation.

    Does not reject use of ClassVar in return type annotation.

    Does not reject use of ClassVar in type alias definition.

    Does not infer type from initialization for bare ClassVar.

    Pass Pass
    Pass Pass PassPass
    +
    Type aliases
         aliases_explicit
    Partial

    Does not reject specialization of type alias that has already been implicitly specialized.

    Pass
    Partial

    Incorrectly reports error for type alias defined with ParamSpec.

    Incorrectly rejects some valid type aliases when used in annotations.

    Incorrectly evaluates generic type alias with ParamSpec with missing type argument.

    Does not report some illegal annotation forms as invalid type aliases.

    Does not report invalid specialization of generic type aliases.

    Incorrectly rejects import alias of `TypeAlias` when used to define type alias.

    Does not report invalid specialization of already-specialized generic type alias.

    Pass Pass
         aliases_implicit Pass Pass
    Partial

    Incorrectly reports error for type alias defined with ParamSpec.

    Incorrectly rejects some valid type aliases when used in annotations.

    Incorrectly evaluates generic type alias with ParamSpec with missing type argument.

    Does not report invalid specialization of generic type aliases.

    Does not report error for attempt to instantiate union type alias.

    Does not report invalid specialization of already-specialized generic type alias.

    Pass
    Partial

    Does not reject invalid syntax in implicit type aliases.

         aliases_newtype
    Partial

    `NewType`s are incorrectly considered to be classes.

    Pass
    Partial

    Does not reject use of NewType in `isinstance` call.

    Does not reject use of NewType in class definition statement.

    Does not report inconsistency between name of NewType and assigned identifier name.

    Does not reject use of NewType with generic class with TypeVar.

    Does not reject use of NewType with protocol class.

    Does not reject use of NewType with TypedDict class.

    Does not reject use of NewType with Any.

    Pass Pass
         aliases_recursive Pass Pass
    Partial

    Does not properly handle some recursive type aliases.

    Does not properly handle specialization of generic recursive type aliases.

    Pass Unsupported
         aliases_type_statement
    Partial

    Does not reject type alias defined in function scope.

    Pass
    Partial

    Does not complain when a type alias cannot be used as a base class.

    Does not complain when a type alias cannot be used as a function.

    Does not complain when a type statement definition combines new and old TypeVars.

    Does not complain when a type statement definition uses old TypeVars.

    Does not properly support recursive aliases.

    Pass
    Partial

    Does not reject type alias defined with type statement in base class list

    Does not reject redeclaration of type alias with the same name.

    Does not detect circular definitions.

         aliases_typealiastype
    Partial

    Incorrectly rejects some recursive type aliases using TypeAliasType.

    Incorrectly rejects the use of a class-scoped TypeVar in a TypeAliasType definition.

    Pass
    Unsupported

    Support for TypeAliasType is not implemented.

    Partial

    Incorrectly rejects the use of a class-scoped TypeVar in a TypeAliasType definition.

    Incorrectly allows type_params= to be an arbitrary tuple.

    Unsupported
    Pass Pass PassPass Unsupported
    +
    Literals
         literals_interactions
    Partial

    Does not narrow type of `x` with `x in Literal` type guard pattern.

    Pass
    Partial

    Does not detect out-of-bound tuple literal index.

    Does not perform exhaustiveness checks on enums.

    Does not narrow type of `x` with `x in Literal` type guard pattern.

    Does not narrow type of `x` with `x == Literal` type guard pattern.

    Partial

    Does not narrow type of `x` with `x in Literal` type guard pattern.

    Partial

    Two instances parameterized with different literals are not compatible

         literals_literalstring
    Unsupported

    Support for `LiteralString` is not implemented.

    Pass
    Partial

    Incorrectly infers `str` rather than `LiteralString` when literal string `join` is used.

    Pass Pass
         literals_parameterizations
    Partial

    Does not reject tuple within Literal.

    Pass
    Partial

    Does not support type aliases in Literal type expression.

    Does not support nested Literal type expression.

    Does not reject tuple in Literal type expression.

    Does not reject "bare" Literal in type expression.

    Pass Pass
    Pass Pass PassPass
    +
    Protocols
         protocols_class_objects Pass Pass
    Partial

    Does not reject protocol class assigned to type[Proto].

    Incorrectly reports some class objects as incompatible with a protocol.

    Fails to report some class objects as incompatible with a protocol.

    Pass
    Partial

    Does not require concrete classes to be passed to type[Proto]

         protocols_definition
    Partial

    Does not detect protocol mismatch if concrete method is missing annotations.

    Does not detect protocol mismatch if concrete method's parameters are position-only.

    Pass
    Partial

    Does not reject ClassVar in concrete class when attribute in protocol is not ClassVar or vice versa.

    Does not reject read-only property in concrete class when attribute in protocol is mutable.

    Does not reject covariant attribute type when protocol attribute is mutable.

    Does not reject read-only property in concrete class when protocol has settable property.

    Does not reject immutable named tuple attribute in concrete class when protocol attribute is mutable.

    Does not reject immutable frozen dataclass attribute in concrete class when protocol attribute is mutable.

    Partial

    Does not detect protocol mismatch if concrete method is missing annotations.

    Does not detect protocol mismatch if concrete method's parameters are position-only.

    Partial

    Allows attributes defined by assignment via self in Protocols

    Incorrectly handles some ClassVar examples in Protocol subtyping

         protocols_explicit
    Pass*

    Does not report unimplemented attributes for class that explicitly derives from protocol until it is instantiated.

    Pass
    Partial

    Does not report error when calling unimplemented protocol method from derived class.

    Does not report error when method is not implemented in derived class.

    Pass
    Unsupported

    Does not check against abstract class instantiations

         protocols_generic Pass Pass
    Partial

    Does not reject the use of Protocol and Generic together as base classes.

    Does not detect protocol mismatch when method-scoped TypeVar is used in protocol.

    Pass Pass
    Pass Pass PassPass
         protocols_modules Pass Pass
    Unsupported

    Does not perform protocol checks for modules.

    Pass
    Partial

    Fails one subtyping example of protocol modules

    Pass Pass PassPass
         protocols_runtime_checkable
    Partial

    Does not report unsafe overlap for runtime_checkable protocol.

    Pass
    Unsupported

    Does not reject isinstance or issubclass call for protocol that is not runtime_checkable.

    Does not reject issubclass call for data protocol.

    Does not report unsafe overlap for runtime_checkable protocol.

    Partial

    Does not report unsafe overlap for runtime_checkable protocol.

    Partial

    Does not check for unsafe overlap in runtime_checkable protocols

    Pass Pass PassPass
         protocols_subtyping Pass Pass Pass PassPass
         protocols_variance Pass Pass
    Unsupported

    Does not detect incorrect TypeVar variance within generic protocols.

    Pass Unsupported
    +
    Callables
         callables_annotation
    Partial

    Incorrectly treats "*args: T, **kwargs: T" as "..." when T is specialized to Any.

    Does not treat "*args: Any, **kargs: Any" as "..." when separated by keyword parameter.

    Pass
    Partial

    Does not evaluate correct type for `*args: int` parameter.

    Does not correctly implement type compatibility rules for "...".

    Does not treat "*args: Any, **kwargs: Any" as "...".

    Partial

    Incorrectly treats "*args: T, **kwargs: T" as "..." when T is specialized to Any.

    Does not treat "*args: Any, **kargs: Any" as "..." when separated by keyword parameter.

    Partial

    Parameter names are lost when resolving ParamSpec

    Pass Pass PassPass
         callables_protocol Pass Pass
    Partial

    Does not correctly handle callback protocol that declares attributes in all functions.

    Does not report type incompatibility for callback protocol with positional-only parameters.

    Incorrectly reports type compatibility error with callback that has *args and **kwargs.

    Does not report type incompatibility for callback missing a default argument for positional parameter.

    Does not report type incompatibility for callback missing a default argument for keyword parameter.

    Pass Pass
         callables_subtyping Pass Pass
    Partial

    Rejects standard parameter as incompatible with keyword-only parameter.

    Rejects use of Callable with ParamSpec in TypeAlias definition.

    Pass Pass
    +
    Constructors
         constructors_call_init
    Partial

    Does not report errors during binding to self parameter of __init__ method.

    Does not reject use of class-scoped type variables in annotation of self parameter in __init__ method.

    Pass
    Partial

    Does not infer type of Self for self parameter of __init__ method.

    Does not report errors during binding to self parameter of __init__ method.

    Does not reject use of class-scoped type variables in annotation of self parameter in __init__ method.

    Incorrectly raises Incompatible overload type errors.

    Incorrectly raises compatibility type errors.

    Partial

    Does not report errors during binding to self parameter of __init__ method.

    Does not reject use of class-scoped type variables in annotation of self parameter in __init__ method.

    Partial

    Does not reject class-scoped type var in self param annotation

         constructors_call_metaclass
    Unupported

    Does not honor metaclass __call__ method when evaluating constructor call.

    Does not skip evaluation of __new__ and __init__ if custom metaclass call returns non-class.

    Pass
    Partial

    Does not evaluate __new__ if metaclass __call__ is defined.

    Pass Pass
         constructors_call_new
    Partial

    Does not support __new__ return type that is not a subclass of the class being constructed.

    Does not skip evaluation of __init__ based on __new__ return type.

    Does not report errors during binding to cls parameter of __new__ method.

    Pass
    Partial

    Does not support __new__ return type that is not a subclass of the class being constructed.

    Does not report errors during binding to cls parameter of __new__ method.

    Incorrectly raises compatibility type errors.

    Partial

    Does not support __new__ return type that is not a subclass of the class being constructed.

    Does not skip evaluation of __init__ based on __new__ return type.

    Does not report errors during binding to cls parameter of __new__ method.

    Pass
         constructors_call_type
    Partial

    Does not validate call to custom metaclass __call__ method through type[T].

    PassPass
    Partial

    Does not validate call to custom metaclass __call__ method through type[T].

    Partial

    Does not check TypeVar type constructor using upper bound's __new__

         constructors_callable
    Partial

    Does not generate a union type for __new__ and __init__ when converting class to callable.

    Does not ignore __init__ based on __new__ return type when converting class to callable.

    Does not support __new__ return type that is different from class being constructed.

    Pass
    Partial

    Does not generate a union type for __new__ and __init__ when converting class to callable.

    Does not ignore __init__ based on __new__ return type when converting class to callable.

    Does not support __new__ return type that is different from class being constructed.

    Does not use annotated type of self in __init__ method to generate return type of callable.

    Incorrectly raises incompatibility type errors.

    Partial

    Does not generate a union type for __new__ and __init__ when converting class to callable.

    Does not ignore __init__ based on __new__ return type when converting class to callable.

    Does not support __new__ return type that is different from class being constructed.

    Struggles with some cases of self types

    Partial

    Some overloaded constructors are not resolved correctly.

    Converting constructor to callable does not preserve class-scoped type params.

    Converting constructor to callable does not substitute Self in __new__

    Converting constructor to callable uses __new__ signature instead of __init__

         constructors_consistency
    Pass*

    Does not report inconsistency between __new__ and __init__ (optional).

    Pass
    Pass*

    Does not report inconsistency between __new__ and __init__ (optional).

    Pass Pass
    +
    Overloads
         overloads_basic Pass Pass PassPass
         overloads_consistency Pass Pass
    Partial

    Does not apply decorator transforms before checking overload consistency.

    Pass Pass
         overloads_definitions
    Partial

    Allows @override to be on all overloads and implementation, instead of just implementation.

    Pass
    Partial

    Does not allow an overload with no implementation in a Protocol or an abstract base class.

    Expects @final/@override on all overloads and implementation, instead of implementation only.

    Pass
    Partial

    Does not restrict some decorators to implementation

    Does not require some decorators that need to appear on every overload

    Pass
         overloads_definitions_stub
    Partial

    Allows @override to appear in a stub file not on the first overload.

    Pass
    Partial

    Expects @final and @override to be present on all overloads, not just first.

    Pass Pass
         overloads_evaluation
    Partial

    Does not expand boolean arguments to Literal[True] and Literal[False].

    Does not expand enum arguments to literal variants.

    Does not expand tuple arguments to possible combinations.

    Does not evaluate Any in some cases where overload is ambiguous.

    Evaluates Any in some cases where overload is not ambiguous.

    Partial

    Does not evaluate Any in some cases where overload is ambiguous.

    Partial

    Does not expand boolean arguments to Literal[True] and Literal[False].

    Does not expand enum arguments to literal variants.

    Does not expand type[A | B] to type[A] and type[B].

    Does not expand tuple arguments to possible combinations.

    Does not prefer variadic match to indeterminate-length unpacked argument.

    Does not treat multiple matches due to gradual types as ambiguous.

    Partial

    Does not expand boolean arguments to Literal[True] and Literal[False].

    Does not expand enum arguments to literal variants.

    Does not expand tuple arguments to possible combinations.

    Does not evaluate Any in some cases where overload is ambiguous.

    Evaluates Any in some cases where overload is not ambiguous.

    Partial

    Does not exclude overloads based on arity first

    Does not perform argument expansion

    Pass
    +
    Exceptions
         exceptions_context_managers Pass Pass
    Partial

    assert_type causes failures.

    Pass
    Partial

    Some error suppressing context managers are not detected

    +
    Dataclasses
         dataclasses_descriptors
    Partial

    Does not correctly evaluate type of descriptor access.

    Pass
    Partial

    Incorrectly generates error when calling constructor of dataclass with descriptor.

    Incorrectly raises incompatibility type errors.

    Pass Pass
         dataclasses_final
    Partial

    Wrongly requires a Final dataclass field to be initialized at class level.

    Doesn't support Final nested inside ClassVar.

    PassPass
    Partial

    Wrongly requires a Final dataclass field to be initialized at class level.

    Doesn't support Final nested inside ClassVar.

    Partial

    Allows assignment to final attributes that are not initialized on the class

    Pass Pass PassPass
         dataclasses_hash
    Partial

    Does not report when dataclass is not compatible with Hashable protocol.

    Pass
    Partial

    Does not report when dataclass is not compatible with Hashable protocol.

    Partial

    Does not report when dataclass is not compatible with Hashable protocol.

    Pass
         dataclasses_inheritance Pass Pass
    Partial

    Does not reject ClassVar that is overridden by instance variable.

    Does not reject instance variable that is overridden by ClassVar.

    Pass Pass
         dataclasses_kwonly Pass Pass
    Partial

    Rejects legitimate use of dataclass field with `kw_only=True`.

    Pass Pass
         dataclasses_match_args Pass Pass
    Partial

    Adds kw-only fields to __match_args__.

    Pass Pass
    Pass Pass PassPass
         dataclasses_postinit Pass Pass
    Partial

    Does not perform validation of `__post_init__` method.

    Incorrectly complains on the assignment of `InitVar` in class bodies.

    Pass Pass
         dataclasses_slots
    Partial

    Does not reject write to instance variable that is not defined in __slots__.

    Pass
    Partial

    Does not report error when `slots=True` is used with `__slots__` definition.

    Does not reject write to instance variable that is not defined in __slots__.

    Does not reject access to `__slots__` from dataclass instance when `slots=False`.

    Partial

    Does not reject write to instance variable that is not defined in __slots__.

    Partial

    __slots__ is generated but not checked during attribute assignment

         dataclasses_transform_class Pass Pass
    Partial

    Does not support field specifiers.

    Emits "attribute not initialized" error for dataclass field.

    Pass Pass
         dataclasses_transform_converter
    Unsupported

    Converter parameter not yet supported.

    Pass
    Unsupported

    Converter parameter not yet supported.

    Partial

    Converters are fully supported, failed to match generic overloads against other generics

    Pass
         dataclasses_transform_field
    Partial

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

    Pass
    Unsupported

    Does not understand dataclass transform field specifiers.

    Pass Pass
         dataclasses_transform_func
    Partial

    Does not handle `kw_only=False` override when `kw_only_default=True`.

    Does not report error when `order=False` and comparison operators are used.

    Pass
    Partial

    Does not understand @dataclass_transform when it is applied only to overloads of a decorator but not the definition.

    Does not detect non-frozen class inheriting from frozen class.

    Emits "attribute not initialized" error for dataclass field.

    Pass Pass
         dataclasses_transform_meta Pass Pass
    Partial

    Does not understand custom field specifiers.

    Incorrectly rejects frozen dataclass that inherits from non-frozen.

    Emits "attribute not initialized" error for dataclass field.

    Pass Pass
         dataclasses_usage
    Pass*

    Does not detect unannotated usage of `dataclasses.field()`.

    Pass
    Partial

    Does not report error when field with no default follows field with default.

    Complains on `assert_type` when used for bound methods vs `Callable`.

    Does not understand `__dataclass_fields__`.

    Incorrectly raises incompatibility type errors.

    Pass Pass
    +
    Typed dictionaries
         typeddicts_alt_syntax
    Pass*

    Does not support keyword-argument form of alternative syntax (deprecated in 3.11).

    Pass
    Partial

    Does not report when name of TypedDict doesn't match assigned identifier name.

    Does not support keyword-argument form of alternative syntax (deprecated in 3.11).

    Pass*

    Does not support keyword-argument form of alternative syntax (deprecated in 3.11).

    Pass
         typeddicts_class_syntax Pass Pass
    Partial

    Does not reject methods within TypedDict class.

    Does not report when metaclass is provided.

    Does not report when other keyword argument is provided.

    Does not support generic TypedDict class.

    Pass Pass
         typeddicts_extra_items
    Unsupported

    Not supported.

    Pass
    Unsupported

    Not supported.

    Pass Pass
         typeddicts_final Pass Pass
    Partial

    Does not handle value with literal type as index to TypedDict object.

    Pass Pass
    Pass Pass Pass
    Partial

    Does not check against inconsistent multiple inheritance

         typeddicts_operations Pass Pass Pass PassPass
         typeddicts_readonly Pass Pass Pass PassPass
         typeddicts_readonly_consistency Pass Pass Pass PassPass
         typeddicts_readonly_inheritance
    Partial

    Incorrectly rejects non-ReadOnly override of ReadOnly item.

    Incorrectly rejects override of ReadOnly item with another ReadOnly item with narrower type.

    Incorrectly rejects override of NotRequired ReadOnly item with a Required ReadOnly item.

    PassUnsupported
    Partial

    Incorrectly rejects non-ReadOnly override of ReadOnly item.

    Incorrectly rejects override of ReadOnly item with another ReadOnly item with narrower type.

    Incorrectly rejects override of NotRequired ReadOnly item with a Required ReadOnly item.

    Partial

    Does not restrictions around overriding for ReadOnly fields

    Pass Pass PassPass
         typeddicts_readonly_update
    Partial

    Incorrectly allows update of ReadOnly item.

    Incorrectly rejects update involving an item with Never type.

    PassPass
    Partial

    Incorrectly allows update of ReadOnly item.

    Pass
         typeddicts_required Pass Pass
    Partial

    Does not reject use of `Required` in function parameter annotation.

    Does not reject nested use of `Required` in type annotation.

    Does not support recursive TypedDict definitions.

    Incorrectly complains about uninitialized attributes on TypedDict definitions.

    Incorrectly generates "attribute not initialized" errors for TypedDict fields.

    Pass
    Partial

    Does not handle recursive typed dicts in functional syntax

         typeddicts_type_consistency Pass Pass
    Partial

    Does not reject assignment of TypedDict with missing key.

    Does not return non-Optional value from `get` method for required key.

    Does not properly handle nested TypedDicts.

    Pass Pass
         typeddicts_usage Pass Pass
    Pass*

    Does not report errant use of TypedDict in `isinstance` call.

    Does not reject use of TypedDict as TypeVar bound.

    Pass Pass
    +
    Tuples
         tuples_type_compat
    Partial

    Does not support tuple narrowing based on `len()` type guard (optional).

    Pass
    Partial

    Does not support some unpacked tuple forms.

    Does not report type violation when assigning `tuple[int, ...]` to `tuple[int]`.

    Does not support tuple narrowing based on `len()` type guard (optional).

    Does not correctly evaluate `Sequence[Never]` for `tuple[()]`.

    Pass*

    Does not support tuple narrowing based on `len()` type guard (optional).

    Pass
    Pass Pass PassPass
         tuples_unpacked
    Partial

    "More than one unpack" error is missing in some cases.

    Pass Pass PassPass
    +
    Named tuples
         namedtuples_define_class
    Partial

    Does not reject override of named tuple attribute in child class.

    PassPass
    Partial

    Does not reject override of named tuple attribute in child class.

    Pass
    Pass Pass PassPass
         namedtuples_type_compat Pass Pass Pass PassPass
         namedtuples_usage
    Partial

    Does not reject attempt to delete named tuple field by name.

    Pass Pass PassPass
    +
    Enumerations
         enums_behaviors Pass Pass PassPass
         enums_definition Pass Pass Pass PassPass
         enums_expansion
    Partial

    Improperly applies narrowing to Flag subclass.

    PassPass
    Partial

    Improperly applies narrowing to Flag subclass.

    Pass
         enums_member_names
    Pass*

    Does not support special-cased handling of member name literal types in some cases (optional).

    Pass
    Pass*

    Does not support special-cased handling of member name literal types (optional).

    Pass Pass
         enums_member_values
    Partial

    Does not enforce declared type of `_value_`.

    Does not enforce assigned tuple types for enum members (optional).

    PassPass
    Partial

    Does not enforce declared type of `_value_`.

    Pass
         enums_members
    Partial

    Does not treat attribute with annotation and no assignment as non-member.

    Does not treat callables as non-members.

    Does not honor `enum.member` as method decorator.

    Does not properly handle aliased enum members.

    Does not support `_ignore_` mechanism (optional).

    Does not treat attributes with private names as non-members.

    Pass*

    Does not support `_ignore_` mechanism (optional).

    Partial

    Does not reject use of annotation with enum member.

    Does not treat callables as non-members.

    Does not treat annotated attributes as non-members.

    Does not honor `enum.nonmember` to define non-member attribute.

    Does not honor `enum.member` as method decorator.

    Does not properly handle aliased enum members.

    Rejects use of `_ignore_`.

    Does not support `_ignore_` mechanism (optional).

    Partial

    Does not honor `enum.member` as method decorator.

    Does not properly handle aliased enum members.

    Does not treat somecallables as non-members.

    Partial

    Enum members that are aliases of other members do not resolved to the aliased member's type

    +
    Type narrowing
         narrowing_typeguard Pass Pass PassPass
         narrowing_typeis Pass Pass Pass PassPass
    +
    Type checker directives
         directives_assert_type Pass Pass PassPass
         directives_cast Pass Pass Pass PassPass
         directives_deprecated Pass Pass
    Unsupported

    Does not support @deprecated.

    Pass Unsupported
         directives_no_type_check
    Partial

    Does not honor `@no_type_check` class decorator (allowed).

    Does not reject invalid call of `@no_type_check` function.

    Pass*

    Does not honor `@no_type_check` class decorator (allowed).

    Pass*

    Does not honor @no_type_check decorator.

    Pass Pass
    Pass Pass PassPass
         directives_type_checking Pass Pass Pass PassPass
         directives_type_ignore
    Partial

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

    PassPass
    Partial

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

    Pass
    Pass Pass PassPass
         directives_type_ignore_file2 Pass Pass Pass PassPass
         directives_version_platform
    Pass*

    Does not understand three-element form of sys.version checks.

    Does not understand os.name checks.

    Pass Pass PassPass
    +
    Historical and deprecated features
         historical_positional
    Partial

    Does not reject positional-only parameter after non-positional-only parameter.

    Treats keyword-only parameter as positional-only.

    Applies legacy positional-only rules when PEP 570 syntax is used.

    PassPass
    Partial

    Does not reject positional-only parameter after non-positional-only parameter.

    Treats keyword-only parameter as positional-only.

    Applies legacy positional-only rules when PEP 570 syntax is used.

    Pass
    Partial

    Does not reject override of named tuple attribute in child class.

    Pass
    Partial

    Does not reject override of named tuple attribute in child class.

    Pass
    Partial

    Doesn't catch illegal field name starting with underscore

         namedtuples_define_functional PassPassPartial Pass Pass
    pyright 1.1.406
    zuban 0.1.0
    +
    zuban 0.1.1
    pyrefly 0.37.0
    +
    pyrefly 0.38.1
    @@ -246,7 +246,7 @@

    Python Type System Conformance Test Results

    Pass Pass Pass
    Partial

    Does not reject Type Var definition with only 1 constraint

    Incorrect rejects + between two AnyStr

    Constrained type var resolves to subtype instead of explcitly listed constraint

    Partial

    Incorrect rejects + between two AnyStr

    Constrained type var resolves to subtype instead of explcitly listed constraint

         generics_defaults Partial
    Partial

    Does not reject type alias defined in function scope.

    Pass Pass
    Partial

    Does not reject type alias defined with type statement in base class list

    Does not reject redeclaration of type alias with the same name.

    Does not detect circular definitions.

    Partial

    Does not reject redeclaration of type alias with the same name.

    Does not detect circular definitions.

         aliases_typealiastype
    Partial

    Incorrectly rejects some recursive type aliases using TypeAliasType.

    Incorrectly rejects the use of a class-scoped TypeVar in a TypeAliasType definition.

    Pass
    Partial

    Incorrectly rejects the use of a class-scoped TypeVar in a TypeAliasType definition.

    Incorrectly allows type_params= to be an arbitrary tuple.

    Unsupported
    Partial

    Does not detect circular definitions.

         aliases_variance Pass
    Partial

    Does not detect protocol mismatch if concrete method is missing annotations.

    Does not detect protocol mismatch if concrete method's parameters are position-only.

    Pass
    Partial

    Does not detect protocol mismatch if concrete method is missing annotations.

    Does not detect protocol mismatch if concrete method's parameters are position-only.

    Partial

    Allows attributes defined by assignment via self in Protocols

    Incorrectly handles some ClassVar examples in Protocol subtyping

    Partial

    Incorrectly handles some ClassVar examples in Protocol subtyping

         protocols_explicit
    Pass*

    Does not report unimplemented attributes for class that explicitly derives from protocol until it is instantiated.

    Pass Pass
    Unsupported

    Does not check against abstract class instantiations

    Partial

    Does not reject call to super method with no default implementation.

    Does not detect stub methods inherited from protocols as abstract.

         protocols_generic Pass
    Partial

    Does not generate a union type for __new__ and __init__ when converting class to callable.

    Does not ignore __init__ based on __new__ return type when converting class to callable.

    Does not support __new__ return type that is different from class being constructed.

    Pass
    Partial

    Does not generate a union type for __new__ and __init__ when converting class to callable.

    Does not ignore __init__ based on __new__ return type when converting class to callable.

    Does not support __new__ return type that is different from class being constructed.

    Struggles with some cases of self types

    Partial

    Some overloaded constructors are not resolved correctly.

    Converting constructor to callable does not preserve class-scoped type params.

    Converting constructor to callable does not substitute Self in __new__

    Converting constructor to callable uses __new__ signature instead of __init__

    Partial

    Converting constructor to callable does not preserve class-scoped type params.

    Converting constructor to callable does not substitute Self in __new__

    Converting constructor to callable uses __new__ signature instead of __init__

         constructors_consistency
    Pass*

    Does not report inconsistency between __new__ and __init__ (optional).

    Partial

    Does not reject override of named tuple attribute in child class.

    Pass
    Partial

    Does not reject override of named tuple attribute in child class.

    Partial

    Doesn't catch illegal field name starting with underscore

    Pass
         namedtuples_define_functional Pass Pass Pass PassUnsupportedPass
         directives_no_type_check
    Partial

    Does not honor `@no_type_check` class decorator (allowed).

    Does not reject invalid call of `@no_type_check` function.

     
    mypy 1.18.2
    pyright 1.1.406
    +
    pyright 1.1.407
    zuban 0.1.1
    +
    zuban 0.2.1
    pyrefly 0.38.1
    +
    pyrefly 0.39.4
    diff --git a/conformance/results/zuban/aliases_recursive.toml b/conformance/results/zuban/aliases_recursive.toml index 151d0978d..e58e7affa 100644 --- a/conformance/results/zuban/aliases_recursive.toml +++ b/conformance/results/zuban/aliases_recursive.toml @@ -5,7 +5,6 @@ output = """ aliases_recursive.py:19: error: Dict entry 1 has incompatible type "str": "complex"; expected "str": "None | int | str | float | list[Json] | dict[str, Json]" [dict-item] aliases_recursive.py:20: error: List item 1 has incompatible type "complex"; expected "None | int | str | float | list[Json] | dict[str, Json]" [list-item] aliases_recursive.py:38: error: Incompatible types in assignment (expression has type "tuple[int, tuple[str, int], tuple[int, tuple[int, list[int]]]]", variable has type "str | int | tuple[RecursiveTuple, ...]") [assignment] -aliases_recursive.py:39: error: Name "t6" already defined on line 38 [no-redef] aliases_recursive.py:39: error: Incompatible types in assignment (expression has type "tuple[int, list[int]]", variable has type "str | int | tuple[RecursiveTuple, ...]") [assignment] aliases_recursive.py:50: error: Dict entry 0 has incompatible type "str": "list[int]"; expected "str": "str | int | Mapping[str, str | int | Mapping[str, RecursiveMapping]]" [dict-item] aliases_recursive.py:51: error: Dict entry 2 has incompatible type "str": "list[int]"; expected "str": "str | int | Mapping[str, str | int | Mapping[str, RecursiveMapping]]" [dict-item] diff --git a/conformance/results/zuban/version.toml b/conformance/results/zuban/version.toml index 9dae302b6..eeff6b710 100644 --- a/conformance/results/zuban/version.toml +++ b/conformance/results/zuban/version.toml @@ -1 +1 @@ -version = "zuban 0.1.1" +version = "zuban 0.2.1" diff --git a/conformance/tests/enums_members.py b/conformance/tests/enums_members.py index 6f18c97af..b7ccedd58 100644 --- a/conformance/tests/enums_members.py +++ b/conformance/tests/enums_members.py @@ -79,10 +79,10 @@ class Nested: ... # Non-member nested class assert_type(Pet4.CAT, Literal[Pet4.CAT]) assert_type(Pet4.DOG, Literal[Pet4.DOG]) -assert_type(Pet4.converter, Literal[Pet4.converter]) # E -assert_type(Pet4.transform, Literal[Pet4.transform]) # E -assert_type(Pet4.species, Literal[Pet4.species]) # E -assert_type(Pet4.speak, Literal[Pet4.speak]) # E +converter: Literal[Pet4.converter] # E +transform: Literal[Pet4.transform] # E +species: Literal[Pet4.species] # E +speak: Literal[Pet4.speak] # E # > An attribute that is assigned the value of another member of the same From 89c74e36407cee4bb855de83c19d740ffb782a95 Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Sun, 2 Nov 2025 23:03:14 -0800 Subject: [PATCH 156/308] Add two missing places where type expressions occur (#2110) This missed some newer syntactic locations that are type expressions. --- docs/spec/annotations.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/spec/annotations.rst b/docs/spec/annotations.rst index efcdb7871..9ef5bfe57 100644 --- a/docs/spec/annotations.rst +++ b/docs/spec/annotations.rst @@ -75,12 +75,16 @@ places. Specifically, type expressions are used in the following locations: * The second argument to :ref:`assert_type() ` * The bounds and constraints of a ``TypeVar`` (whether created through the old syntax or the native syntax in Python 3.12) +* The default of a ``TypeVar``, ``ParamSpec``, or ``TypeVarTuple`` (whether + created through the old syntax or the native syntax in Python 3.12) * The definition of a type alias (whether created through the ``type`` statement, the old assignment syntax, or the ``TypeAliasType`` constructor) * The type arguments of a generic class (which may appear in a base class or in a constructor call) * The definitions of fields in the functional forms for creating :ref:`TypedDict ` and :ref:`NamedTuple ` types +* The value passed to the ``extra_items`` argument in the :ref:`TypedDict ` + constructor * The base type in the definition of a :ref:`NewType ` .. _`annotation-expression`: From 953e24d71aa6ea97f58852046fc355d11b564333 Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Wed, 19 Nov 2025 08:30:04 +0100 Subject: [PATCH 157/308] Best Practices: Split an example (#2114) Split the text and examples for `Any` vs `object` into one for arguments and one for callback return types. This separates these two related, but different suggestions. It should make the examples a bit clearer and less convoluted. --- docs/reference/best_practices.rst | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/docs/reference/best_practices.rst b/docs/reference/best_practices.rst index a6585c07e..ebf58dfc9 100644 --- a/docs/reference/best_practices.rst +++ b/docs/reference/best_practices.rst @@ -52,12 +52,18 @@ with the current type system or using the correct type is unergonomic. If a function accepts every possible object as an argument, for example because it's only passed to ``str()``, use ``object`` instead of ``Any`` as -type annotation. Similarly, if the return value of a callback is ignored, -annotate it with ``object``:: +type annotation:: - def call_cb_if_int(cb: Callable[[int], object], o: object) -> None: + def print_formatted(o: object) -> None: if isinstance(o, int): - cb(o) + o = f"{o:02}" + print(o) + +Similarly, if the return value of a callback is ignored, +annotate it with ``object``, not ``Any`` or ``None``:: + + def call_cb(cb: Callable[[int], object]) -> None: + cb(42) .. _argument-return-practices: From d7bc355a45ccdc72b9ca8fe79bd10e7c0d5df88d Mon Sep 17 00:00:00 2001 From: Fangyi Zhou Date: Mon, 24 Nov 2025 01:32:24 +0000 Subject: [PATCH 158/308] constructors_callable: fix a type hint in comments (#2117) --- conformance/tests/constructors_callable.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conformance/tests/constructors_callable.py b/conformance/tests/constructors_callable.py index 7ad04dcb7..bfd1e405f 100644 --- a/conformance/tests/constructors_callable.py +++ b/conformance/tests/constructors_callable.py @@ -179,7 +179,7 @@ def __new__(cls, x: list[T], y: list[T]) -> Self: r8 = accepts_callable(Class8) -reveal_type(r8) # `def [T] (x: T, y: list[T]) -> Class8[T]` +reveal_type(r8) # `def [T] (x: list[T], y: list[T]) -> Class8[T]` assert_type(r8([""], [""]), Class8[str]) r8([1], [""]) # E From 81214ce74275a5cf86ec3c04e48f78c1ef6a3178 Mon Sep 17 00:00:00 2001 From: Jack O'Connor Date: Wed, 26 Nov 2025 09:32:19 -0800 Subject: [PATCH 159/308] Restore a missing TypedDict subtyping requirement (#2119) This requirement was present in previous version but was dropped in the most recent version. --- docs/spec/typeddict.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/spec/typeddict.rst b/docs/spec/typeddict.rst index 1e0808f64..81b72ea9c 100644 --- a/docs/spec/typeddict.rst +++ b/docs/spec/typeddict.rst @@ -541,7 +541,7 @@ The conditions are as follows: - If it is mutable in ``A``: - - If ``B`` has an item with the same key, it must also be mutable, and its item type must be + - If ``B`` has an item with the same key, it must also be mutable and non-required, and its item type must be :term:`equivalent` to the item type in ``A``. - Else: From 3590634d624dad39a8a550a6e1e5a5238e4ea28c Mon Sep 17 00:00:00 2001 From: Rebecca Chen Date: Fri, 28 Nov 2025 19:12:19 -0800 Subject: [PATCH 160/308] Update conformance results for pyrefly 0.43.1 and zuban 0.2.3. (#2120) Update results for pyrefly 0.43.1 and zuban 0.2.3. --- .../results/pyrefly/dataclasses_final.toml | 10 +++------- .../pyrefly/dataclasses_transform_converter.toml | 2 -- .../results/pyrefly/generics_defaults.toml | 2 +- .../results/pyrefly/generics_syntax_scoping.toml | 12 ++++-------- .../pyrefly/generics_typevartuple_concat.toml | 4 ++-- .../results/pyrefly/protocols_class_objects.toml | 6 ++---- .../results/pyrefly/protocols_explicit.toml | 2 +- .../results/pyrefly/typeddicts_class_syntax.toml | 6 +++--- .../pyrefly/typeddicts_readonly_inheritance.toml | 8 ++------ .../results/pyrefly/typeddicts_required.toml | 8 +------- conformance/results/pyrefly/version.toml | 2 +- .../pyright/namedtuples_define_functional.toml | 1 - conformance/results/results.html | 16 ++++++++-------- .../results/zuban/tuples_type_compat.toml | 4 ++-- conformance/results/zuban/version.toml | 2 +- 15 files changed, 31 insertions(+), 54 deletions(-) diff --git a/conformance/results/pyrefly/dataclasses_final.toml b/conformance/results/pyrefly/dataclasses_final.toml index eed3df1b9..a91f38355 100644 --- a/conformance/results/pyrefly/dataclasses_final.toml +++ b/conformance/results/pyrefly/dataclasses_final.toml @@ -1,14 +1,10 @@ -conformant = "Partial" -notes = """ -Allows assignment to final attributes that are not initialized on the class -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 35: Expected 1 errors -Line 37: Expected 1 errors """ output = """ ERROR dataclasses_final.py:27:1-17: Cannot set field `final_classvar` [read-only] +ERROR dataclasses_final.py:35:1-19: Cannot set field `final_no_default` [read-only] ERROR dataclasses_final.py:36:1-21: Cannot set field `final_with_default` [read-only] +ERROR dataclasses_final.py:37:1-19: Cannot set field `final_no_default` [read-only] ERROR dataclasses_final.py:38:1-21: Cannot set field `final_with_default` [read-only] """ diff --git a/conformance/results/pyrefly/dataclasses_transform_converter.toml b/conformance/results/pyrefly/dataclasses_transform_converter.toml index c3b990de3..eca9d49c6 100644 --- a/conformance/results/pyrefly/dataclasses_transform_converter.toml +++ b/conformance/results/pyrefly/dataclasses_transform_converter.toml @@ -4,9 +4,7 @@ errors_diff = """ """ output = """ ERROR dataclasses_transform_converter.py:48:41-55: Argument `() -> int` is not assignable to parameter `converter` with type `(@_) -> int` in function `model_field` [bad-argument-type] -ERROR dataclasses_transform_converter.py:48:41-55: Argument `() -> int` is not assignable to parameter `converter` with type `(@_) -> @_` in function `model_field` [bad-argument-type] ERROR dataclasses_transform_converter.py:49:41-55: Argument `(*, x: int) -> int` is not assignable to parameter `converter` with type `(@_) -> int` in function `model_field` [bad-argument-type] -ERROR dataclasses_transform_converter.py:49:41-55: Argument `(*, x: int) -> int` is not assignable to parameter `converter` with type `(@_) -> @_` in function `model_field` [bad-argument-type] ERROR dataclasses_transform_converter.py:107:5-6: Argument `Literal[1]` is not assignable to parameter `field0` with type `str` in function `DC2.__init__` [bad-argument-type] ERROR dataclasses_transform_converter.py:108:23-24: Argument `Literal[1]` is not assignable to parameter `field3` with type `bytes | str` in function `DC2.__init__` [bad-argument-type] ERROR dataclasses_transform_converter.py:109:29-31: Argument `complex` is not assignable to parameter `field4` with type `list[str] | str` in function `DC2.__init__` [bad-argument-type] diff --git a/conformance/results/pyrefly/generics_defaults.toml b/conformance/results/pyrefly/generics_defaults.toml index 3216033da..2bef89638 100644 --- a/conformance/results/pyrefly/generics_defaults.toml +++ b/conformance/results/pyrefly/generics_defaults.toml @@ -11,7 +11,7 @@ ERROR generics_defaults.py:24:7-31: Type parameter `T` without a default cannot ERROR generics_defaults.py:50:1-20: Expected 5 type arguments for `AllTheDefaults`, got 1 [bad-specialization] ERROR generics_defaults.py:107:51-54: Expected default `int` of `Invalid1` to be assignable to the upper bound of `str` [invalid-type-var] ERROR generics_defaults.py:114:52-55: Expected default `int` of `Invalid2` to be one of the following constraints: `float`, `str` [invalid-type-var] -ERROR generics_defaults.py:130:12-27: assert_type(Any, int) failed [assert-type] +ERROR generics_defaults.py:131:12-27: assert_type(int, Any) failed [assert-type] ERROR generics_defaults.py:142:7-11: TypeVar `T5` with a default cannot follow TypeVarTuple `Ts` [invalid-type-var] ERROR generics_defaults.py:170:12-57: assert_type([DefaultIntT](Foo7[DefaultIntT]) -> Foo7[DefaultIntT], (Foo7[int]) -> Foo7[int]) failed [assert-type] """ diff --git a/conformance/results/pyrefly/generics_syntax_scoping.toml b/conformance/results/pyrefly/generics_syntax_scoping.toml index f569cc931..3605418a9 100644 --- a/conformance/results/pyrefly/generics_syntax_scoping.toml +++ b/conformance/results/pyrefly/generics_syntax_scoping.toml @@ -1,12 +1,5 @@ -conformant = "Partial" -notes = """ -Does not implement some scoping restrictions for PEP695 generic syntax -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 92: Expected 1 errors -Line 95: Expected 1 errors -Line 98: Expected 1 errors """ output = """ ERROR generics_syntax_scoping.py:14:20-31: Type variable bounds and constraints must be concrete [invalid-annotation] @@ -14,4 +7,7 @@ ERROR generics_syntax_scoping.py:18:26-27: Expected a type form, got instance of ERROR generics_syntax_scoping.py:35:7-8: `T` is uninitialized [unbound-name] ERROR generics_syntax_scoping.py:44:17-18: `T` is uninitialized [unbound-name] ERROR generics_syntax_scoping.py:44:17-18: Expected a type form, got instance of `int` [not-a-type] +ERROR generics_syntax_scoping.py:92:17-18: Type parameter `T` shadows a type parameter of the same name from an enclosing scope [invalid-type-var] +ERROR generics_syntax_scoping.py:95:17-18: Type parameter `T` shadows a type parameter of the same name from an enclosing scope [invalid-type-var] +ERROR generics_syntax_scoping.py:98:17-18: Type parameter `T` shadows a type parameter of the same name from an enclosing scope [invalid-type-var] """ diff --git a/conformance/results/pyrefly/generics_typevartuple_concat.toml b/conformance/results/pyrefly/generics_typevartuple_concat.toml index 042e0a2ea..f9ba600ba 100644 --- a/conformance/results/pyrefly/generics_typevartuple_concat.toml +++ b/conformance/results/pyrefly/generics_typevartuple_concat.toml @@ -4,8 +4,8 @@ Fails to handle move_first_element_to_last example """ conformance_automated = "Fail" errors_diff = """ -Line 56: Unexpected errors ['Returned type `tuple[*tuple[object | T, ...], object | T]` is not assignable to declared return type `tuple[*Ts, T]` [bad-return]'] +Line 56: Unexpected errors ['Returned type `tuple[*tuple[T | ElementOf[Ts], ...], T | ElementOf[Ts]]` is not assignable to declared return type `tuple[*Ts, T]` [bad-return]'] """ output = """ -ERROR generics_typevartuple_concat.py:56:12-30: Returned type `tuple[*tuple[object | T, ...], object | T]` is not assignable to declared return type `tuple[*Ts, T]` [bad-return] +ERROR generics_typevartuple_concat.py:56:12-30: Returned type `tuple[*tuple[T | ElementOf[Ts], ...], T | ElementOf[Ts]]` is not assignable to declared return type `tuple[*Ts, T]` [bad-return] """ diff --git a/conformance/results/pyrefly/protocols_class_objects.toml b/conformance/results/pyrefly/protocols_class_objects.toml index 68cdca5cd..e18c3614d 100644 --- a/conformance/results/pyrefly/protocols_class_objects.toml +++ b/conformance/results/pyrefly/protocols_class_objects.toml @@ -4,16 +4,14 @@ Does not require concrete classes to be passed to type[Proto] """ conformance_automated = "Fail" errors_diff = """ -Line 29: Expected 1 errors -Line 34: Expected 1 errors Line 104: Expected 1 errors Line 106: Expected 1 errors Line 107: Expected 1 errors Line 108: Expected 1 errors -Line 26: Unexpected errors ['Cannot instantiate `Proto` because it is a protocol [bad-instantiation]'] """ output = """ -ERROR protocols_class_objects.py:26:15-17: Cannot instantiate `Proto` because it is a protocol [bad-instantiation] +ERROR protocols_class_objects.py:29:5-10: Argument `type[Proto]` is not assignable to parameter `cls` with type `type[Proto]` in function `fun` [bad-argument-type] +ERROR protocols_class_objects.py:34:7-12: `type[Proto]` is not assignable to variable `var` with type `type[Proto]` [bad-assignment] ERROR protocols_class_objects.py:58:16-25: `type[ConcreteA]` is not assignable to `ProtoA1` [bad-assignment] ERROR protocols_class_objects.py:74:16-25: `type[ConcreteB]` is not assignable to `ProtoB1` [bad-assignment] """ diff --git a/conformance/results/pyrefly/protocols_explicit.toml b/conformance/results/pyrefly/protocols_explicit.toml index cff8b33c1..3986491f8 100644 --- a/conformance/results/pyrefly/protocols_explicit.toml +++ b/conformance/results/pyrefly/protocols_explicit.toml @@ -5,10 +5,10 @@ Does not detect stub methods inherited from protocols as abstract. """ conformance_automated = "Fail" errors_diff = """ -Line 27: Expected 1 errors Line 89: Expected 1 errors """ output = """ +ERROR protocols_explicit.py:27:16-28: Method `draw` inherited from class `PColor` has no implementation and cannot be accessed via `super()` [missing-attribute] ERROR protocols_explicit.py:56:20-36: `tuple[int, int, str]` is not assignable to attribute `rgb` with type `tuple[int, int, int]` [bad-assignment] ERROR protocols_explicit.py:60:10-20: Cannot instantiate `Point` because the following members are abstract: `intensity`, `transparency` [bad-instantiation] ERROR protocols_explicit.py:134:15-17: Cannot instantiate `Concrete5` because the following members are abstract: `method1` [bad-instantiation] diff --git a/conformance/results/pyrefly/typeddicts_class_syntax.toml b/conformance/results/pyrefly/typeddicts_class_syntax.toml index c620b1026..4fec5a418 100644 --- a/conformance/results/pyrefly/typeddicts_class_syntax.toml +++ b/conformance/results/pyrefly/typeddicts_class_syntax.toml @@ -3,9 +3,9 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR typeddicts_class_syntax.py:29:9-16: TypedDict item `method1` may not be initialized [bad-class-definition] -ERROR typeddicts_class_syntax.py:34:9-16: TypedDict item `method2` may not be initialized [bad-class-definition] -ERROR typeddicts_class_syntax.py:39:9-16: TypedDict item `method3` may not be initialized [bad-class-definition] +ERROR typeddicts_class_syntax.py:29:9-16: TypedDict members must be declared in the form `field: Annotation` with no assignment [bad-class-definition] +ERROR typeddicts_class_syntax.py:34:9-16: TypedDict members must be declared in the form `field: Annotation` with no assignment [bad-class-definition] +ERROR typeddicts_class_syntax.py:39:9-16: TypedDict members must be declared in the form `field: Annotation` with no assignment [bad-class-definition] ERROR typeddicts_class_syntax.py:44:7-20: Typed dictionary definitions may not specify a metaclass [invalid-inheritance] ERROR typeddicts_class_syntax.py:49:7-20: TypedDict does not support keyword argument `other` [bad-typed-dict] """ diff --git a/conformance/results/pyrefly/typeddicts_readonly_inheritance.toml b/conformance/results/pyrefly/typeddicts_readonly_inheritance.toml index 128660326..509e76116 100644 --- a/conformance/results/pyrefly/typeddicts_readonly_inheritance.toml +++ b/conformance/results/pyrefly/typeddicts_readonly_inheritance.toml @@ -1,10 +1,5 @@ -conformant = "Partial" -notes = """ -Does not restrictions around overriding for ReadOnly fields -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 119: Expected 1 errors """ output = """ ERROR typeddicts_readonly_inheritance.py:36:4-10: Key `name` in TypedDict `Album2` is read-only [read-only] @@ -16,5 +11,6 @@ ERROR typeddicts_readonly_inheritance.py:84:5-7: Missing required key `ident` fo ERROR typeddicts_readonly_inheritance.py:94:5-6: TypedDict field `a` in `F3` cannot be marked read-only; parent TypedDict `F1` defines it as mutable [bad-typed-dict-key] ERROR typeddicts_readonly_inheritance.py:98:5-6: TypedDict field `a` in `F4` must remain required because parent TypedDict `F1` defines it as required [bad-typed-dict-key] ERROR typeddicts_readonly_inheritance.py:106:5-6: TypedDict field `c` in `F6` cannot be made non-required; parent TypedDict `F1` defines it as required [bad-typed-dict-key] +ERROR typeddicts_readonly_inheritance.py:119:7-11: Field `x` is declared `float` in ancestor `class TD_A2: ... ERROR typeddicts_readonly_inheritance.py:132:7-11: TypedDict field `x` in `TD_B` cannot be made non-required; parent TypedDict `TD_B2` defines it as required [bad-typed-dict-key] """ diff --git a/conformance/results/pyrefly/typeddicts_required.toml b/conformance/results/pyrefly/typeddicts_required.toml index 8af582147..07b5ab762 100644 --- a/conformance/results/pyrefly/typeddicts_required.toml +++ b/conformance/results/pyrefly/typeddicts_required.toml @@ -1,10 +1,5 @@ -conformant = "Partial" -notes = """ -Does not handle recursive typed dicts in functional syntax -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 71: Unexpected errors ["Expected a type form, got instance of `Literal['RecursiveMovie']` [not-a-type]"] """ output = """ ERROR typeddicts_required.py:12:5-6: `Required` may only be used for TypedDict members [invalid-annotation] @@ -12,5 +7,4 @@ ERROR typeddicts_required.py:16:8-19: `NotRequired` is only allowed inside a cla ERROR typeddicts_required.py:16:8-24: `NotRequired` is not allowed in this context [invalid-annotation] ERROR typeddicts_required.py:59:8-31: Duplicate qualifier `Required` [invalid-annotation] ERROR typeddicts_required.py:60:8-34: Cannot combine `Required` and `NotRequired` for a TypedDict field [invalid-annotation] -ERROR typeddicts_required.py:71:75-91: Expected a type form, got instance of `Literal['RecursiveMovie']` [not-a-type] """ diff --git a/conformance/results/pyrefly/version.toml b/conformance/results/pyrefly/version.toml index e0f0cc518..13ffc21b7 100644 --- a/conformance/results/pyrefly/version.toml +++ b/conformance/results/pyrefly/version.toml @@ -1 +1 @@ -version = "pyrefly 0.39.4" +version = "pyrefly 0.43.1" diff --git a/conformance/results/pyright/namedtuples_define_functional.toml b/conformance/results/pyright/namedtuples_define_functional.toml index 2860b88ac..2c9738f7b 100644 --- a/conformance/results/pyright/namedtuples_define_functional.toml +++ b/conformance/results/pyright/namedtuples_define_functional.toml @@ -1,4 +1,3 @@ -conformant = "Partial" output = """ namedtuples_define_functional.py:16:8 - error: Argument missing for parameter "y" (reportCallIssue) namedtuples_define_functional.py:21:8 - error: Arguments missing for parameters "x", "y" (reportCallIssue) diff --git a/conformance/results/results.html b/conformance/results/results.html index 8570f7c65..c5de23a64 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -162,9 +162,9 @@

    Python Type System Conformance Test Results

    pyright 1.1.407
    zuban 0.2.1
    +
    zuban 0.2.3
    pyrefly 0.39.4
    +
    pyrefly 0.43.1
    @@ -348,7 +348,7 @@

    Python Type System Conformance Test Results

    Partial

    Does not following runtime scoping rules for type parameters in all cases.

    Pass
    Partial

    Does not following runtime scoping rules for type parameters in all cases.

    Partial

    Does not implement some scoping restrictions for PEP695 generic syntax

    Pass
         generics_type_erasure
    Partial

    Infers Node[Never] instead of Node[Any] when argument is not provided.

    False negative on instance attribute access on type(node).

    Partial

    Wrongly requires a Final dataclass field to be initialized at class level.

    Doesn't support Final nested inside ClassVar.

    Pass
    Partial

    Wrongly requires a Final dataclass field to be initialized at class level.

    Doesn't support Final nested inside ClassVar.

    Partial

    Allows assignment to final attributes that are not initialized on the class

    Pass
         dataclasses_frozen Pass
    Partial

    Incorrectly rejects non-ReadOnly override of ReadOnly item.

    Incorrectly rejects override of ReadOnly item with another ReadOnly item with narrower type.

    Incorrectly rejects override of NotRequired ReadOnly item with a Required ReadOnly item.

    Pass
    Partial

    Incorrectly rejects non-ReadOnly override of ReadOnly item.

    Incorrectly rejects override of ReadOnly item with another ReadOnly item with narrower type.

    Incorrectly rejects override of NotRequired ReadOnly item with a Required ReadOnly item.

    Partial

    Does not restrictions around overriding for ReadOnly fields

    Pass
         typeddicts_readonly_kwargs Pass Pass Pass Pass
    Partial

    Does not handle recursive typed dicts in functional syntax

    Pass
         typeddicts_type_consistency Pass
         tuples_type_compat
    Partial

    Does not support tuple narrowing based on `len()` type guard (optional).

    Pass
    Pass*

    Does not support tuple narrowing based on `len()` type guard (optional).

    Partial

    Incorrectly marks a match case as unreachable.

    Pass
         tuples_type_form
         namedtuples_define_functional PassPartialPass Pass Pass
    - - - - + @@ -573,7 +573,7 @@

    Python Type System Conformance Test Results

    - + @@ -893,7 +893,7 @@

    Python Type System Conformance Test Results

    - + diff --git a/conformance/results/zuban/constructors_call_new.toml b/conformance/results/zuban/constructors_call_new.toml index 3c94ad4ec..12f5c828b 100644 --- a/conformance/results/zuban/constructors_call_new.toml +++ b/conformance/results/zuban/constructors_call_new.toml @@ -6,7 +6,7 @@ Does not report errors during binding to cls parameter of __new__ method. """ conformance_automated = "Fail" errors_diff = """ -Line 145: Expected 1 errors +Line 148: Expected 1 errors Line 40: Unexpected errors ['constructors_call_new.py:40: error: Incompatible return type for "__new__" (returns "int", but must return a subtype of "Class3") [misc]'] Line 49: Unexpected errors ['constructors_call_new.py:49: error: Expression is of type "Class3", not "int" [misc]', 'constructors_call_new.py:49: error: Missing positional argument "x" in call to "Class3" [call-arg]'] Line 57: Unexpected errors ['constructors_call_new.py:57: error: "__new__" must return a class instance (got "Class4 | Any") [misc]'] diff --git a/conformance/results/zuban/constructors_callable.toml b/conformance/results/zuban/constructors_callable.toml index f5e130aed..51b00c6f9 100644 --- a/conformance/results/zuban/constructors_callable.toml +++ b/conformance/results/zuban/constructors_callable.toml @@ -7,16 +7,16 @@ Struggles with some cases of self types """ conformance_automated = "Fail" errors_diff = """ -Line 127: Expected 1 errors -Line 144: Expected 1 errors -Line 73: Unexpected errors ['constructors_callable.py:73: error: Incompatible return type for "__new__" (returns "int", but must return a subtype of "Class4") [misc]'] -Line 116: Unexpected errors ['constructors_callable.py:116: error: Incompatible return type for "__new__" (returns "Class6Proxy", but must return a subtype of "Class6") [misc]'] -Line 126: Unexpected errors ['constructors_callable.py:126: error: Expression is of type "Class6", not "Class6Proxy" [misc]', 'constructors_callable.py:126: error: Missing positional argument "x" in call [call-arg]'] -Line 143: Unexpected errors ['constructors_callable.py:143: error: Expression is of type "Class6Any", not "Any" [misc]', 'constructors_callable.py:143: error: Missing positional argument "x" in call [call-arg]'] -Line 160: Unexpected errors ['constructors_callable.py:160: error: Need type annotation for "r7" [var-annotated]'] -Line 164: Unexpected errors ['constructors_callable.py:164: error: Expression is of type "Class7[Any]", not "Class7[int]" [misc]'] -Line 165: Unexpected errors ['constructors_callable.py:165: error: Expression is of type "Class7[Any]", not "Class7[str]" [misc]', 'constructors_callable.py:165: error: Argument 1 has incompatible type "str"; expected "int" [arg-type]'] -Line 194: Unexpected errors ['constructors_callable.py:194: error: List item 0 has incompatible type "str"; expected "T" [list-item]', 'constructors_callable.py:194: error: List item 0 has incompatible type "str"; expected "T" [list-item]'] +Line 129: Expected 1 errors +Line 146: Expected 1 errors +Line 74: Unexpected errors ['constructors_callable.py:74: error: Incompatible return type for "__new__" (returns "int", but must return a subtype of "Class4") [misc]'] +Line 118: Unexpected errors ['constructors_callable.py:118: error: Incompatible return type for "__new__" (returns "Class6Proxy", but must return a subtype of "Class6") [misc]'] +Line 128: Unexpected errors ['constructors_callable.py:128: error: Expression is of type "Class6", not "Class6Proxy" [misc]', 'constructors_callable.py:128: error: Missing positional argument "x" in call [call-arg]'] +Line 145: Unexpected errors ['constructors_callable.py:145: error: Expression is of type "Class6Any", not "Any" [misc]', 'constructors_callable.py:145: error: Missing positional argument "x" in call [call-arg]'] +Line 162: Unexpected errors ['constructors_callable.py:162: error: Need type annotation for "r7" [var-annotated]'] +Line 166: Unexpected errors ['constructors_callable.py:166: error: Expression is of type "Class7[Any]", not "Class7[int]" [misc]'] +Line 167: Unexpected errors ['constructors_callable.py:167: error: Expression is of type "Class7[Any]", not "Class7[str]" [misc]', 'constructors_callable.py:167: error: Argument 1 has incompatible type "str"; expected "int" [arg-type]'] +Line 196: Unexpected errors ['constructors_callable.py:196: error: List item 0 has incompatible type "str"; expected "T" [list-item]', 'constructors_callable.py:196: error: List item 0 has incompatible type "str"; expected "T" [list-item]'] """ output = """ constructors_callable.py:36: note: Revealed type is "def (x: builtins.int) -> constructors_callable.Class1" @@ -24,32 +24,32 @@ constructors_callable.py:38: error: Missing positional argument "x" in call [ca constructors_callable.py:39: error: Unexpected keyword argument "y" [call-arg] constructors_callable.py:49: note: Revealed type is "def () -> constructors_callable.Class2" constructors_callable.py:51: error: Too many arguments [call-arg] -constructors_callable.py:63: note: Revealed type is "def (x: builtins.int) -> constructors_callable.Class3" -constructors_callable.py:65: error: Missing positional argument "x" in call [call-arg] -constructors_callable.py:66: error: Unexpected keyword argument "y" [call-arg] -constructors_callable.py:67: error: Too many arguments [call-arg] -constructors_callable.py:73: error: Incompatible return type for "__new__" (returns "int", but must return a subtype of "Class4") [misc] -constructors_callable.py:77: note: Revealed type is "def (x: builtins.int) -> builtins.int" -constructors_callable.py:79: error: Missing positional argument "x" in call [call-arg] -constructors_callable.py:80: error: Unexpected keyword argument "y" [call-arg] -constructors_callable.py:97: note: Revealed type is "def (*args: Any, **kwargs: Any) -> Never" -constructors_callable.py:116: error: Incompatible return type for "__new__" (returns "Class6Proxy", but must return a subtype of "Class6") [misc] -constructors_callable.py:125: note: Revealed type is "def (x: builtins.int) -> constructors_callable.Class6" -constructors_callable.py:126: error: Expression is of type "Class6", not "Class6Proxy" [misc] -constructors_callable.py:126: error: Missing positional argument "x" in call [call-arg] -constructors_callable.py:142: note: Revealed type is "def (x: builtins.int) -> constructors_callable.Class6Any" -constructors_callable.py:143: error: Expression is of type "Class6Any", not "Any" [misc] -constructors_callable.py:143: error: Missing positional argument "x" in call [call-arg] -constructors_callable.py:160: error: Need type annotation for "r7" [var-annotated] -constructors_callable.py:162: note: Revealed type is "def (x: builtins.int) -> constructors_callable.Class7[Any]" -constructors_callable.py:164: error: Expression is of type "Class7[Any]", not "Class7[int]" [misc] -constructors_callable.py:165: error: Expression is of type "Class7[Any]", not "Class7[str]" [misc] -constructors_callable.py:165: error: Argument 1 has incompatible type "str"; expected "int" [arg-type] -constructors_callable.py:182: note: Revealed type is "def [T] (x: builtins.list[T], y: builtins.list[T]) -> constructors_callable.Class8[T]" -constructors_callable.py:184: error: List item 0 has incompatible type "str"; expected "int" [list-item] -constructors_callable.py:193: note: Revealed type is "def (x: builtins.list[T], y: builtins.list[T]) -> constructors_callable.Class9" -constructors_callable.py:194: error: List item 0 has incompatible type "str"; expected "T" [list-item] -constructors_callable.py:194: error: List item 0 has incompatible type "str"; expected "T" [list-item] -constructors_callable.py:195: error: List item 0 has incompatible type "int"; expected "T" [list-item] -constructors_callable.py:195: error: List item 0 has incompatible type "str"; expected "T" [list-item] +constructors_callable.py:64: note: Revealed type is "def (x: builtins.int) -> constructors_callable.Class3" +constructors_callable.py:66: error: Missing positional argument "x" in call [call-arg] +constructors_callable.py:67: error: Unexpected keyword argument "y" [call-arg] +constructors_callable.py:68: error: Too many arguments [call-arg] +constructors_callable.py:74: error: Incompatible return type for "__new__" (returns "int", but must return a subtype of "Class4") [misc] +constructors_callable.py:79: note: Revealed type is "def (x: builtins.int) -> builtins.int" +constructors_callable.py:81: error: Missing positional argument "x" in call [call-arg] +constructors_callable.py:82: error: Unexpected keyword argument "y" [call-arg] +constructors_callable.py:99: note: Revealed type is "def (*args: Any, **kwargs: Any) -> Never" +constructors_callable.py:118: error: Incompatible return type for "__new__" (returns "Class6Proxy", but must return a subtype of "Class6") [misc] +constructors_callable.py:127: note: Revealed type is "def (x: builtins.int) -> constructors_callable.Class6" +constructors_callable.py:128: error: Expression is of type "Class6", not "Class6Proxy" [misc] +constructors_callable.py:128: error: Missing positional argument "x" in call [call-arg] +constructors_callable.py:144: note: Revealed type is "def (x: builtins.int) -> constructors_callable.Class6Any" +constructors_callable.py:145: error: Expression is of type "Class6Any", not "Any" [misc] +constructors_callable.py:145: error: Missing positional argument "x" in call [call-arg] +constructors_callable.py:162: error: Need type annotation for "r7" [var-annotated] +constructors_callable.py:164: note: Revealed type is "def (x: builtins.int) -> constructors_callable.Class7[Any]" +constructors_callable.py:166: error: Expression is of type "Class7[Any]", not "Class7[int]" [misc] +constructors_callable.py:167: error: Expression is of type "Class7[Any]", not "Class7[str]" [misc] +constructors_callable.py:167: error: Argument 1 has incompatible type "str"; expected "int" [arg-type] +constructors_callable.py:184: note: Revealed type is "def [T] (x: builtins.list[T], y: builtins.list[T]) -> constructors_callable.Class8[T]" +constructors_callable.py:186: error: List item 0 has incompatible type "str"; expected "int" [list-item] +constructors_callable.py:195: note: Revealed type is "def (x: builtins.list[T], y: builtins.list[T]) -> constructors_callable.Class9" +constructors_callable.py:196: error: List item 0 has incompatible type "str"; expected "T" [list-item] +constructors_callable.py:196: error: List item 0 has incompatible type "str"; expected "T" [list-item] +constructors_callable.py:197: error: List item 0 has incompatible type "int"; expected "T" [list-item] +constructors_callable.py:197: error: List item 0 has incompatible type "str"; expected "T" [list-item] """ diff --git a/conformance/results/zuban/generics_defaults.toml b/conformance/results/zuban/generics_defaults.toml index c40a48dcd..f0bef676e 100644 --- a/conformance/results/zuban/generics_defaults.toml +++ b/conformance/results/zuban/generics_defaults.toml @@ -6,17 +6,17 @@ ParamSpec after TypeVarTuple is not always handled correctly """ conformance_automated = "Fail" errors_diff = """ -Line 142: Expected 1 errors -Line 155: Unexpected errors ['generics_defaults.py:155: error: Expression is of type "type[Foo6[int, [*Any, **Any]]]", not "type[Foo6[int, str, [float, bool]]]" [misc]', 'generics_defaults.py:155: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [misc]'] -Line 170: Unexpected errors ['generics_defaults.py:170: error: Expression is of type "Callable[[Self], Self]", not "Callable[[Foo7[int]], Foo7[int]]" [misc]'] +Line 143: Expected 1 errors +Line 156: Unexpected errors ['generics_defaults.py:156: error: Expression is of type "type[Foo6[int, [*Any, **Any]]]", not "type[Foo6[int, str, [float, bool]]]" [misc]', 'generics_defaults.py:156: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [misc]'] +Line 171: Unexpected errors ['generics_defaults.py:171: error: Expression is of type "Callable[[Self], Self]", not "Callable[[Foo7[int]], Foo7[int]]" [misc]'] """ output = """ generics_defaults.py:24: error: "T" cannot appear after "DefaultStrT" in type parameter list because it has no default type [misc] generics_defaults.py:50: error: "AllTheDefaults" expects between 2 and 5 type arguments, but 1 given [type-arg] generics_defaults.py:107: error: TypeVar default must be a subtype of the bound type [misc] generics_defaults.py:114: error: TypeVar default must be one of the constraint types [misc] -generics_defaults.py:131: error: Expression is of type "int", not "Any" [misc] -generics_defaults.py:155: error: Expression is of type "type[Foo6[int, [*Any, **Any]]]", not "type[Foo6[int, str, [float, bool]]]" [misc] -generics_defaults.py:155: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [misc] -generics_defaults.py:170: error: Expression is of type "Callable[[Self], Self]", not "Callable[[Foo7[int]], Foo7[int]]" [misc] +generics_defaults.py:132: error: Expression is of type "int", not "Any" [misc] +generics_defaults.py:156: error: Expression is of type "type[Foo6[int, [*Any, **Any]]]", not "type[Foo6[int, str, [float, bool]]]" [misc] +generics_defaults.py:156: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [misc] +generics_defaults.py:171: error: Expression is of type "Callable[[Self], Self]", not "Callable[[Foo7[int]], Foo7[int]]" [misc] """ diff --git a/conformance/results/zuban/generics_self_basic.toml b/conformance/results/zuban/generics_self_basic.toml index 7bb339c7a..428c5a58a 100644 --- a/conformance/results/zuban/generics_self_basic.toml +++ b/conformance/results/zuban/generics_self_basic.toml @@ -4,5 +4,5 @@ errors_diff = """ output = """ generics_self_basic.py:20: error: Incompatible return value type (got "Shape", expected "Self") [return-value] generics_self_basic.py:33: error: Incompatible return value type (got "Shape", expected "Self") [return-value] -generics_self_basic.py:67: error: Self type cannot have type arguments [valid-type] +generics_self_basic.py:68: error: Self type cannot have type arguments [valid-type] """ diff --git a/conformance/results/zuban/generics_self_usage.toml b/conformance/results/zuban/generics_self_usage.toml index eae8958de..ef5859e87 100644 --- a/conformance/results/zuban/generics_self_usage.toml +++ b/conformance/results/zuban/generics_self_usage.toml @@ -4,8 +4,8 @@ Does not detect invalid Self when Self is not properly bound""" conformance_automated = "Fail" errors_diff = """ Line 82: Expected 1 errors -Line 111: Expected 1 errors -Line 116: Expected 1 errors +Line 113: Expected 1 errors +Line 118: Expected 1 errors Line 50: Unexpected errors ['generics_self_usage.py:50: error: Incompatible types in assignment (expression has type "Callable[[CallableAttribute], int]", variable has type "Callable[[Self], int]") [assignment]'] """ output = """ @@ -13,10 +13,10 @@ generics_self_usage.py:50: error: Incompatible types in assignment (expression h generics_self_usage.py:73: error: Self type is only allowed in annotations within class definition [misc] generics_self_usage.py:73: error: Self type is only allowed in annotations within class definition [misc] generics_self_usage.py:76: error: Self type is only allowed in annotations within class definition [misc] -generics_self_usage.py:86: error: Incompatible return value type (got "Foo3", expected "Self") [return-value] -generics_self_usage.py:101: error: Self type is only allowed in annotations within class definition [misc] +generics_self_usage.py:87: error: Incompatible return value type (got "Foo3", expected "Self") [return-value] generics_self_usage.py:103: error: Self type is only allowed in annotations within class definition [misc] -generics_self_usage.py:106: error: Self type cannot be used in type alias target [misc] -generics_self_usage.py:121: error: Self type cannot be used in a metaclass [misc] -generics_self_usage.py:125: error: Self type cannot be used in a metaclass [misc] +generics_self_usage.py:105: error: Self type is only allowed in annotations within class definition [misc] +generics_self_usage.py:108: error: Self type cannot be used in type alias target [misc] +generics_self_usage.py:123: error: Self type cannot be used in a metaclass [misc] +generics_self_usage.py:127: error: Self type cannot be used in a metaclass [misc] """ diff --git a/conformance/results/zuban/generics_syntax_infer_variance.toml b/conformance/results/zuban/generics_syntax_infer_variance.toml index 796dcd31a..e1207f927 100644 --- a/conformance/results/zuban/generics_syntax_infer_variance.toml +++ b/conformance/results/zuban/generics_syntax_infer_variance.toml @@ -11,8 +11,6 @@ output = """ generics_syntax_infer_variance.py:15: error: Cannot use covariant with infer_variance [misc] generics_syntax_infer_variance.py:17: error: Cannot use contravariant with infer_variance [misc] generics_syntax_infer_variance.py:29: error: Incompatible types in assignment (expression has type "ShouldBeCovariant1[float]", variable has type "ShouldBeCovariant1[int]") [assignment] -generics_syntax_infer_variance.py:39: note: If the method is meant to be abstract, use @abc.abstractmethod -generics_syntax_infer_variance.py:42: note: If the method is meant to be abstract, use @abc.abstractmethod generics_syntax_infer_variance.py:47: error: Incompatible types in assignment (expression has type "ShouldBeCovariant2[float]", variable has type "ShouldBeCovariant2[int]") [assignment] generics_syntax_infer_variance.py:56: error: Incompatible types in assignment (expression has type "ShouldBeCovariant3[float]", variable has type "ShouldBeCovariant3[int]") [assignment] generics_syntax_infer_variance.py:85: error: Incompatible types in assignment (expression has type "ShouldBeCovariant5[float]", variable has type "ShouldBeCovariant5[int]") [assignment] diff --git a/conformance/results/zuban/overloads_definitions.toml b/conformance/results/zuban/overloads_definitions.toml index c24ff027b..a4f9c38fb 100644 --- a/conformance/results/zuban/overloads_definitions.toml +++ b/conformance/results/zuban/overloads_definitions.toml @@ -8,11 +8,11 @@ overloads_definitions.py:59: error: An overloaded function outside a stub file m overloads_definitions.py:71: error: Overload does not consistently use the "@staticmethod" decorator on all function signatures. [misc] overloads_definitions.py:84: error: Overload does not consistently use the "@classmethod" decorator on all function signatures. [misc] overloads_definitions.py:93: error: Overloaded function implementation does not accept all possible arguments of signature 2 [misc] -overloads_definitions.py:122: error: @final should be applied only to overload implementation [misc] -overloads_definitions.py:136: error: @final should be applied only to overload implementation [misc] -overloads_definitions.py:141: error: @final should be applied only to overload implementation [misc] -overloads_definitions.py:175: error: Cannot override final attribute "final_method" (previously declared in base class "Base") [misc] -overloads_definitions.py:190: error: Method "bad_override" is marked as an override, but no base method was found with this name [misc] -overloads_definitions.py:221: error: @override should be applied only to overload implementation [misc] -overloads_definitions.py:225: error: @override should be applied only to overload implementation [misc] +overloads_definitions.py:123: error: @final should be applied only to overload implementation [misc] +overloads_definitions.py:138: error: @final should be applied only to overload implementation [misc] +overloads_definitions.py:143: error: @final should be applied only to overload implementation [misc] +overloads_definitions.py:180: error: Cannot override final attribute "final_method" (previously declared in base class "Base") [misc] +overloads_definitions.py:195: error: Method "bad_override" is marked as an override, but no base method was found with this name [misc] +overloads_definitions.py:227: error: @override should be applied only to overload implementation [misc] +overloads_definitions.py:231: error: @override should be applied only to overload implementation [misc] """ diff --git a/conformance/results/zuban/overloads_evaluation.toml b/conformance/results/zuban/overloads_evaluation.toml index 893e0fcba..300c1fff5 100644 --- a/conformance/results/zuban/overloads_evaluation.toml +++ b/conformance/results/zuban/overloads_evaluation.toml @@ -8,16 +8,16 @@ Evaluates Any in some cases where overload is not ambiguous. """ conformance_automated = "Fail" errors_diff = """ -Line 134: Unexpected errors ['overloads_evaluation.py:134: error: No overload variant of "expand_bool" matches argument type "bool" [call-overload]'] -Line 135: Unexpected errors ['overloads_evaluation.py:135: error: Expression is of type "Any", not "Literal[0, 1]" [misc]'] -Line 160: Unexpected errors ['overloads_evaluation.py:160: error: No overload variant of "expand_enum" matches argument type "Color" [call-overload]'] -Line 161: Unexpected errors ['overloads_evaluation.py:161: error: Expression is of type "Any", not "Literal[0, 1]" [misc]'] -Line 204: Unexpected errors ['overloads_evaluation.py:204: error: Argument 1 to "expand_tuple" has incompatible type "tuple[int, int | str]"; expected "tuple[int, int]" [arg-type]'] -Line 205: Unexpected errors ['overloads_evaluation.py:205: error: Expression is of type "int", not "int | str" [misc]'] -Line 261: Unexpected errors ['overloads_evaluation.py:261: error: Expression is of type "list[Any]", not "list[int]" [misc]'] -Line 264: Unexpected errors ['overloads_evaluation.py:264: error: Expression is of type "list[Any]", not "Any" [misc]'] -Line 280: Unexpected errors ['overloads_evaluation.py:280: error: Expression is of type "list[Any]", not "Any" [misc]'] -Line 345: Unexpected errors ['overloads_evaluation.py:345: error: Expression is of type "list[Any]", not "Any" [misc]'] +Line 135: Unexpected errors ['overloads_evaluation.py:135: error: No overload variant of "expand_bool" matches argument type "bool" [call-overload]'] +Line 136: Unexpected errors ['overloads_evaluation.py:136: error: Expression is of type "Any", not "Literal[0, 1]" [misc]'] +Line 161: Unexpected errors ['overloads_evaluation.py:161: error: No overload variant of "expand_enum" matches argument type "Color" [call-overload]'] +Line 162: Unexpected errors ['overloads_evaluation.py:162: error: Expression is of type "Any", not "Literal[0, 1]" [misc]'] +Line 205: Unexpected errors ['overloads_evaluation.py:205: error: Argument 1 to "expand_tuple" has incompatible type "tuple[int, int | str]"; expected "tuple[int, int]" [arg-type]'] +Line 206: Unexpected errors ['overloads_evaluation.py:206: error: Expression is of type "int", not "int | str" [misc]'] +Line 262: Unexpected errors ['overloads_evaluation.py:262: error: Expression is of type "list[Any]", not "list[int]" [misc]'] +Line 265: Unexpected errors ['overloads_evaluation.py:265: error: Expression is of type "list[Any]", not "Any" [misc]'] +Line 281: Unexpected errors ['overloads_evaluation.py:281: error: Expression is of type "list[Any]", not "Any" [misc]'] +Line 347: Unexpected errors ['overloads_evaluation.py:347: error: Expression is of type "list[Any]", not "Any" [misc]'] """ output = """ overloads_evaluation.py:38: error: All overload variants of "example1_1" require at least one argument [call-overload] @@ -32,22 +32,22 @@ overloads_evaluation.py:51: error: No overload variant of "example1_1" matches a overloads_evaluation.py:51: note: Possible overload variants: overloads_evaluation.py:51: note: def example1_1(x: int, y: str) -> int overloads_evaluation.py:51: note: def example1_1(x: str) -> str -overloads_evaluation.py:115: error: Argument 1 to "example2" has incompatible type "int | str"; expected "int" [arg-type] -overloads_evaluation.py:115: error: Argument 2 to "example2" has incompatible type "int | str"; expected "str" [arg-type] -overloads_evaluation.py:134: error: No overload variant of "expand_bool" matches argument type "bool" [call-overload] -overloads_evaluation.py:134: note: Possible overload variants: -overloads_evaluation.py:134: note: def expand_bool(x: Literal[False]) -> Literal[0] -overloads_evaluation.py:134: note: def expand_bool(x: Literal[True]) -> Literal[1] -overloads_evaluation.py:135: error: Expression is of type "Any", not "Literal[0, 1]" [misc] -overloads_evaluation.py:160: error: No overload variant of "expand_enum" matches argument type "Color" [call-overload] -overloads_evaluation.py:160: note: Possible overload variants: -overloads_evaluation.py:160: note: def expand_enum(x: Literal[Color.RED]) -> Literal[0] -overloads_evaluation.py:160: note: def expand_enum(x: Literal[Color.BLUE]) -> Literal[1] -overloads_evaluation.py:161: error: Expression is of type "Any", not "Literal[0, 1]" [misc] -overloads_evaluation.py:204: error: Argument 1 to "expand_tuple" has incompatible type "tuple[int, int | str]"; expected "tuple[int, int]" [arg-type] -overloads_evaluation.py:205: error: Expression is of type "int", not "int | str" [misc] -overloads_evaluation.py:261: error: Expression is of type "list[Any]", not "list[int]" [misc] -overloads_evaluation.py:264: error: Expression is of type "list[Any]", not "Any" [misc] -overloads_evaluation.py:280: error: Expression is of type "list[Any]", not "Any" [misc] -overloads_evaluation.py:345: error: Expression is of type "list[Any]", not "Any" [misc] +overloads_evaluation.py:116: error: Argument 1 to "example2" has incompatible type "int | str"; expected "int" [arg-type] +overloads_evaluation.py:116: error: Argument 2 to "example2" has incompatible type "int | str"; expected "str" [arg-type] +overloads_evaluation.py:135: error: No overload variant of "expand_bool" matches argument type "bool" [call-overload] +overloads_evaluation.py:135: note: Possible overload variants: +overloads_evaluation.py:135: note: def expand_bool(x: Literal[False]) -> Literal[0] +overloads_evaluation.py:135: note: def expand_bool(x: Literal[True]) -> Literal[1] +overloads_evaluation.py:136: error: Expression is of type "Any", not "Literal[0, 1]" [misc] +overloads_evaluation.py:161: error: No overload variant of "expand_enum" matches argument type "Color" [call-overload] +overloads_evaluation.py:161: note: Possible overload variants: +overloads_evaluation.py:161: note: def expand_enum(x: Literal[Color.RED]) -> Literal[0] +overloads_evaluation.py:161: note: def expand_enum(x: Literal[Color.BLUE]) -> Literal[1] +overloads_evaluation.py:162: error: Expression is of type "Any", not "Literal[0, 1]" [misc] +overloads_evaluation.py:205: error: Argument 1 to "expand_tuple" has incompatible type "tuple[int, int | str]"; expected "tuple[int, int]" [arg-type] +overloads_evaluation.py:206: error: Expression is of type "int", not "int | str" [misc] +overloads_evaluation.py:262: error: Expression is of type "list[Any]", not "list[int]" [misc] +overloads_evaluation.py:265: error: Expression is of type "list[Any]", not "Any" [misc] +overloads_evaluation.py:281: error: Expression is of type "list[Any]", not "Any" [misc] +overloads_evaluation.py:347: error: Expression is of type "list[Any]", not "Any" [misc] """ diff --git a/conformance/src/type_checker.py b/conformance/src/type_checker.py index 4307039fd..c373fc4f0 100644 --- a/conformance/src/type_checker.py +++ b/conformance/src/type_checker.py @@ -102,8 +102,6 @@ def run_tests(self, test_files: Sequence[str]) -> dict[str, str]: "-m", "mypy", ".", - "--disable-error-code", - "empty-body", "--enable-error-code", "deprecated", ] diff --git a/conformance/tests/constructors_call_new.py b/conformance/tests/constructors_call_new.py index 889fcec41..48275c331 100644 --- a/conformance/tests/constructors_call_new.py +++ b/conformance/tests/constructors_call_new.py @@ -110,7 +110,8 @@ def __init__(self, x: int): class Class8(Generic[T]): - def __new__(cls, *args, **kwargs) -> "Class8[list[T]]": ... + def __new__(cls, *args, **kwargs) -> "Class8[list[T]]": + raise NotImplementedError assert_type(Class8[int](), Class8[list[int]]) @@ -122,7 +123,8 @@ def __new__(cls, *args, **kwargs) -> "Class8[list[T]]": ... class Class9(Generic[T]): - def __new__(cls, *args, **kwargs) -> Self: ... + def __new__(cls, *args, **kwargs) -> Self: + raise NotImplementedError class Class10(Class9[int]): @@ -137,7 +139,8 @@ class Class10(Class9[int]): class Class11(Generic[T]): - def __new__(cls: "type[Class11[int]]") -> "Class11[int]": ... + def __new__(cls: "type[Class11[int]]") -> "Class11[int]": + raise NotImplementedError Class11() # OK diff --git a/conformance/tests/constructors_callable.py b/conformance/tests/constructors_callable.py index bfd1e405f..c05fee3fb 100644 --- a/conformance/tests/constructors_callable.py +++ b/conformance/tests/constructors_callable.py @@ -54,7 +54,8 @@ class Class2: class Class3: """__new__ and __init__""" - def __new__(cls, *args, **kwargs) -> Self: ... + def __new__(cls, *args, **kwargs) -> Self: + raise NotImplementedError def __init__(self, x: int) -> None: ... @@ -70,7 +71,8 @@ def __init__(self, x: int) -> None: ... class Class4: """__new__ but no __init__""" - def __new__(cls, x: int) -> int: ... + def __new__(cls, x: int) -> int: + raise NotImplementedError r4 = accepts_callable(Class4) diff --git a/conformance/tests/dataclasses_descriptors.py b/conformance/tests/dataclasses_descriptors.py index 37dd1b36a..f2f30a623 100644 --- a/conformance/tests/dataclasses_descriptors.py +++ b/conformance/tests/dataclasses_descriptors.py @@ -21,7 +21,7 @@ def __get__(self, __obj: object, __owner: Any) -> int: ... def __get__(self, __obj: object | None, __owner: Any) -> "int | Desc1": - ... + raise NotImplementedError def __set__(self, __obj: object, __value: int) -> None: ... @@ -48,7 +48,7 @@ def __get__(self, instance: object, owner: Any) -> T: ... def __get__(self, instance: object | None, owner: Any) -> list[T] | T: - ... + raise NotImplementedError @dataclass diff --git a/conformance/tests/dataclasses_transform_converter.py b/conformance/tests/dataclasses_transform_converter.py index 277998c7f..0a54584ea 100644 --- a/conformance/tests/dataclasses_transform_converter.py +++ b/conformance/tests/dataclasses_transform_converter.py @@ -23,7 +23,7 @@ def model_field( default: S | None = None, default_factory: Callable[[], S] | None = None, ) -> T: - ... + raise NotImplementedError @dataclass_transform(field_specifiers=(model_field,)) diff --git a/conformance/tests/dataclasses_transform_field.py b/conformance/tests/dataclasses_transform_field.py index d66bdf9e0..c6ccb8b7d 100644 --- a/conformance/tests/dataclasses_transform_field.py +++ b/conformance/tests/dataclasses_transform_field.py @@ -47,7 +47,7 @@ def field2(*, init: bool = False, kw_only: bool = True) -> Any: @dataclass_transform(kw_only_default=True, field_specifiers=(field1, field2)) def create_model(*, init: bool = True) -> Callable[[type[T]], type[T]]: - ... + raise NotImplementedError @create_model() diff --git a/conformance/tests/dataclasses_transform_func.py b/conformance/tests/dataclasses_transform_func.py index c2eb1f34f..0a7922716 100644 --- a/conformance/tests/dataclasses_transform_func.py +++ b/conformance/tests/dataclasses_transform_func.py @@ -74,7 +74,7 @@ class Customer2Subclass(Customer2): @dataclass_transform(kw_only_default=True, order_default=True, frozen_default=True) def create_model_frozen(cls: T) -> T: - ... + raise NotImplementedError @create_model_frozen diff --git a/conformance/tests/generics_defaults.py b/conformance/tests/generics_defaults.py index 241606c97..e1a4fb04c 100644 --- a/conformance/tests/generics_defaults.py +++ b/conformance/tests/generics_defaults.py @@ -124,7 +124,8 @@ class Class_TypeVarTuple(Generic[*DefaultTs]): ... T4 = TypeVar("T4", default=int) -def func1(x: int | set[T4]) -> T4: ... +def func1(x: int | set[T4]) -> T4: + raise NotImplementedError assert_type(func1(0), int) # E[optional-default-use] diff --git a/conformance/tests/generics_paramspec_basic.py b/conformance/tests/generics_paramspec_basic.py index 01da2db31..7d461c2fb 100644 --- a/conformance/tests/generics_paramspec_basic.py +++ b/conformance/tests/generics_paramspec_basic.py @@ -25,7 +25,7 @@ def func1(x: P) -> P: # E def func2(x: Concatenate[int, P]) -> int: # E - ... + raise NotImplementedError def func3(x: list[P]) -> None: # E diff --git a/conformance/tests/generics_paramspec_semantics.py b/conformance/tests/generics_paramspec_semantics.py index b93066f1f..836d461d0 100644 --- a/conformance/tests/generics_paramspec_semantics.py +++ b/conformance/tests/generics_paramspec_semantics.py @@ -11,11 +11,11 @@ def changes_return_type_to_str(x: Callable[P, int]) -> Callable[P, str]: - ... + raise NotImplementedError def returns_int(a: str, b: bool, /) -> int: - ... + raise NotImplementedError f1 = changes_return_type_to_str(returns_int) @@ -28,15 +28,15 @@ def returns_int(a: str, b: bool, /) -> int: def func1(x: Callable[P, int], y: Callable[P, int]) -> Callable[P, bool]: - ... + raise NotImplementedError def x_y(x: int, y: str) -> int: - ... + raise NotImplementedError def y_x(y: int, x: str) -> int: - ... + raise NotImplementedError f2 = func1(x_y, x_y) @@ -51,11 +51,11 @@ def y_x(y: int, x: str) -> int: def keyword_only_x(*, x: int) -> int: - ... + raise NotImplementedError def keyword_only_y(*, y: int) -> int: - ... + raise NotImplementedError func1(keyword_only_x, keyword_only_y) # E @@ -74,7 +74,7 @@ def __init__(self, f: Callable[P, str], prop: U) -> None: def callback_a(q: int, /) -> str: - ... + raise NotImplementedError def func(x: int) -> None: @@ -85,11 +85,11 @@ def func(x: int) -> None: def bar(x: int, *args: bool) -> int: - ... + raise NotImplementedError def add(x: Callable[P, int]) -> Callable[Concatenate[str, P], bool]: - ... + raise NotImplementedError a1 = add(bar) # Should return (a: str, /, x: int, *args: bool) -> bool @@ -99,7 +99,7 @@ def add(x: Callable[P, int]) -> Callable[Concatenate[str, P], bool]: def remove(x: Callable[Concatenate[int, P], int]) -> Callable[P, bool]: - ... + raise NotImplementedError r1 = remove(bar) # Should return (*args: bool) -> bool @@ -111,7 +111,7 @@ def remove(x: Callable[Concatenate[int, P], int]) -> Callable[P, bool]: def transform( x: Callable[Concatenate[int, P], int] ) -> Callable[Concatenate[str, P], bool]: - ... + raise NotImplementedError t1 = transform(bar) # Should return (a: str, /, *args: bool) -> bool @@ -126,19 +126,19 @@ def expects_int_first(x: Callable[Concatenate[int, P], int]) -> None: @expects_int_first # E def one(x: str) -> int: - ... + raise NotImplementedError @expects_int_first # E def two(*, x: int) -> int: - ... + raise NotImplementedError @expects_int_first # E def three(**kwargs: int) -> int: - ... + raise NotImplementedError @expects_int_first # OK def four(*args: int) -> int: - ... + raise NotImplementedError diff --git a/conformance/tests/generics_self_advanced.py b/conformance/tests/generics_self_advanced.py index ef4f6af70..ab389081f 100644 --- a/conformance/tests/generics_self_advanced.py +++ b/conformance/tests/generics_self_advanced.py @@ -9,7 +9,7 @@ class ParentA: # Test for property that returns Self. @property def prop1(self) -> Self: - ... + raise NotImplementedError class ChildA(ParentA): ... @@ -26,7 +26,7 @@ class ParentB: @classmethod def method1(cls) -> Self: - ... + raise NotImplementedError class ChildB(ParentB): b: int = 0 diff --git a/conformance/tests/generics_self_basic.py b/conformance/tests/generics_self_basic.py index b7da6a38d..d5712383e 100644 --- a/conformance/tests/generics_self_basic.py +++ b/conformance/tests/generics_self_basic.py @@ -61,7 +61,8 @@ class Container(Generic[T]): def __init__(self, value: T) -> None: self.value = value - def set_value(self, value: T) -> Self: ... + def set_value(self, value: T) -> Self: + raise NotImplementedError # This should generate an error because Self isn't subscriptable. def foo(self, other: Self[int]) -> None: # E diff --git a/conformance/tests/generics_self_usage.py b/conformance/tests/generics_self_usage.py index 6990cbd18..99f36a811 100644 --- a/conformance/tests/generics_self_usage.py +++ b/conformance/tests/generics_self_usage.py @@ -79,7 +79,8 @@ def foo(bar: Self) -> Self: ... # E: not within a class class Foo2: # Rejected (Self is treated as unknown). - def has_existing_self_annotation(self: TFoo2) -> Self: ... # E + def has_existing_self_annotation(self: TFoo2) -> Self: # E + raise NotImplementedError class Foo3: def return_concrete_type(self) -> Self: @@ -95,7 +96,8 @@ def child_method(self) -> None: T = TypeVar("T") class Bar(Generic[T]): - def bar(self) -> T: ... + def bar(self) -> T: + raise NotImplementedError # This should generate an error. class Baz(Bar[Self]): ... # E @@ -109,18 +111,18 @@ class Base: @staticmethod # This should generate an error. def make() -> Self: # E - ... + raise NotImplementedError @staticmethod # This should generate an error. def return_parameter(foo: Self) -> Self: # E - ... + raise NotImplementedError class MyMetaclass(type): # This should generate an error. def __new__(cls, *args: Any) -> Self: # E - ... + raise NotImplementedError # This should generate an error. def __mul__(cls, count: int) -> list[Self]: # E - ... + raise NotImplementedError diff --git a/conformance/tests/generics_syntax_compatibility.py b/conformance/tests/generics_syntax_compatibility.py index 506d26d4e..144cbb78c 100644 --- a/conformance/tests/generics_syntax_compatibility.py +++ b/conformance/tests/generics_syntax_compatibility.py @@ -21,7 +21,7 @@ class ClassB[K, V](dict[K, V]): # OK class ClassC[V]: def method1(self, a: V, b: K) -> V | K: # OK - ... + raise NotImplementedError def method2[M](self, a: M, b: K) -> M | K: # E - ... + raise NotImplementedError diff --git a/conformance/tests/generics_syntax_infer_variance.py b/conformance/tests/generics_syntax_infer_variance.py index 50d42616e..e0f50a3b7 100644 --- a/conformance/tests/generics_syntax_infer_variance.py +++ b/conformance/tests/generics_syntax_infer_variance.py @@ -19,10 +19,10 @@ class ShouldBeCovariant1(Generic[T]): def __getitem__(self, index: int) -> T: - ... + raise NotImplementedError def __iter__(self) -> Iterator[T]: - ... + raise NotImplementedError vco1_1: ShouldBeCovariant1[float] = ShouldBeCovariant1[int]() # OK @@ -37,10 +37,10 @@ def __getitem__(self, index: int) -> T: def __getitem__(self, index: slice) -> Sequence[T]: ... def __getitem__(self, index: int | slice) -> T | Sequence[T]: - ... + raise NotImplementedError def __len__(self) -> int: - ... + raise NotImplementedError vco2_1: ShouldBeCovariant2[float] = ShouldBeCovariant2[int]() # OK @@ -49,7 +49,7 @@ def __len__(self) -> int: class ShouldBeCovariant3(Generic[T]): def method1(self) -> "ShouldBeCovariant2[T]": - ... + raise NotImplementedError vco3_1: ShouldBeCovariant3[float] = ShouldBeCovariant3[int]() # OK diff --git a/conformance/tests/generics_syntax_scoping.py b/conformance/tests/generics_syntax_scoping.py index f2f1bc297..2d3f5639f 100644 --- a/conformance/tests/generics_syntax_scoping.py +++ b/conformance/tests/generics_syntax_scoping.py @@ -38,7 +38,7 @@ class ClassC[T](BaseClassC[T], param=Foo[T]): # OK def decorator1[ T, **P, R ](x: type[Foo[T]]) -> Callable[[Callable[P, R]], Callable[P, R]]: - ... + raise NotImplementedError @decorator1(Foo[T]) # E: Runtime error: 'T' is not defined @@ -79,7 +79,7 @@ def method1[T](self, a: Inner[T]) -> Inner[T]: # OK def decorator2[**P, R](x: int) -> Callable[[Callable[P, R]], Callable[P, R]]: - ... + raise NotImplementedError T = int(0) diff --git a/conformance/tests/generics_typevartuple_args.py b/conformance/tests/generics_typevartuple_args.py index fdc0e55a0..114d2ec44 100644 --- a/conformance/tests/generics_typevartuple_args.py +++ b/conformance/tests/generics_typevartuple_args.py @@ -14,7 +14,7 @@ def args_to_tuple(*args: *Ts) -> tuple[*Ts]: - ... + raise NotImplementedError assert_type(args_to_tuple(1, "a"), tuple[int, str]) @@ -25,7 +25,7 @@ class Env: def exec_le(path: str, *args: * tuple[*Ts, Env], env: Env | None = None) -> tuple[*Ts]: - ... + raise NotImplementedError assert_type(exec_le("", Env()), tuple[()]) # OK diff --git a/conformance/tests/generics_typevartuple_basic.py b/conformance/tests/generics_typevartuple_basic.py index daf504fcf..b5512c4ba 100644 --- a/conformance/tests/generics_typevartuple_basic.py +++ b/conformance/tests/generics_typevartuple_basic.py @@ -14,7 +14,7 @@ class Array1(Generic[*Ts]): def func1(*args: *Ts) -> tuple[*Ts]: - ... + raise NotImplementedError Shape = TypeVarTuple("Shape") @@ -73,7 +73,7 @@ def method1(*args: Shape) -> None: # E: not unpacked def func2(arg1: tuple[*Ts], arg2: tuple[*Ts]) -> tuple[*Ts]: - ... + raise NotImplementedError # > We do not allow this; type unions may not appear within the tuple. @@ -91,7 +91,7 @@ def func2(arg1: tuple[*Ts], arg2: tuple[*Ts]) -> tuple[*Ts]: def multiply(x: Array[*Shape], y: Array[*Shape]) -> Array[*Shape]: - ... + raise NotImplementedError def func3(x: Array[Height], y: Array[Width], z: Array[Height, Width]): diff --git a/conformance/tests/generics_typevartuple_callable.py b/conformance/tests/generics_typevartuple_callable.py index 4ece6a97d..f0292505e 100644 --- a/conformance/tests/generics_typevartuple_callable.py +++ b/conformance/tests/generics_typevartuple_callable.py @@ -27,15 +27,15 @@ def func1(arg1: int, arg2: str) -> None: def func2(f: Callable[[int, *Ts, T], tuple[T, *Ts]]) -> tuple[*Ts, T]: - ... + raise NotImplementedError def callback1(a: int, b: str, c: int, d: complex) -> tuple[complex, str, int]: - ... + raise NotImplementedError def callback2(a: int, d: str) -> tuple[str]: - ... + raise NotImplementedError assert_type(func2(callback1), tuple[str, int, complex]) @@ -43,7 +43,7 @@ def callback2(a: int, d: str) -> tuple[str]: def func3(*args: * tuple[int, *Ts, T]) -> tuple[T, *Ts]: - ... + raise NotImplementedError assert_type(func3(1, "", 3j, 3.4), tuple[float, str, complex]) diff --git a/conformance/tests/generics_typevartuple_concat.py b/conformance/tests/generics_typevartuple_concat.py index 3f24821bf..3d2284a88 100644 --- a/conformance/tests/generics_typevartuple_concat.py +++ b/conformance/tests/generics_typevartuple_concat.py @@ -24,15 +24,15 @@ class Array(Generic[*Ts]): def add_batch_axis(x: Array[*Shape]) -> Array[Batch, *Shape]: - ... + raise NotImplementedError def del_batch_axis(x: Array[Batch, *Shape]) -> Array[*Shape]: - ... + raise NotImplementedError def add_batch_channels(x: Array[*Shape]) -> Array[Batch, *Shape, Channels]: - ... + raise NotImplementedError def func1(a: Array[Height, Width]): @@ -45,7 +45,7 @@ def func1(a: Array[Height, Width]): def prefix_tuple(x: T, y: tuple[*Ts]) -> tuple[T, *Ts]: - ... + raise NotImplementedError z = prefix_tuple(x=0, y=(True, "a")) diff --git a/conformance/tests/generics_typevartuple_specialization.py b/conformance/tests/generics_typevartuple_specialization.py index 0f53c85b9..3277e40b8 100644 --- a/conformance/tests/generics_typevartuple_specialization.py +++ b/conformance/tests/generics_typevartuple_specialization.py @@ -128,7 +128,7 @@ def func6(a: VariadicTuple[str, int], b: VariadicTuple[float], c: VariadicTuple) def func7(a: TA7[*Ts, T1, T2]) -> tuple[tuple[*Ts], T1, T2]: - ... + raise NotImplementedError def func8(a: TA7[str, bool], b: TA7[str, bool, float], c: TA7[str, bool, float, int]): @@ -141,7 +141,7 @@ def func8(a: TA7[str, bool], b: TA7[str, bool, float], c: TA7[str, bool, float, def func9(a: TA8[T1, *Ts, T2, T3]) -> tuple[tuple[*Ts], T1, T2, T3]: - ... + raise NotImplementedError def func10(a: TA8[str, bool, float], b: TA8[str, bool, float, int]): diff --git a/conformance/tests/generics_variance.py b/conformance/tests/generics_variance.py index 0b3e732b4..9f2f143ea 100644 --- a/conformance/tests/generics_variance.py +++ b/conformance/tests/generics_variance.py @@ -24,7 +24,7 @@ def __init__(self, items: Iterable[T_co]) -> None: ... def __iter__(self) -> Iterator[T_co]: - ... + raise NotImplementedError class Employee: @@ -55,7 +55,7 @@ def dump_employee(e: E) -> E: # > Variance has no meaning, and should therefore be ignored by type checkers, # > if a type variable is bound to a generic function or type alias. def func(x: list[B_co]) -> B_co: # OK - ... + raise NotImplementedError class Co(Generic[T_co]): diff --git a/conformance/tests/generics_variance_inference.py b/conformance/tests/generics_variance_inference.py index c7e09760b..0a1cd41cd 100644 --- a/conformance/tests/generics_variance_inference.py +++ b/conformance/tests/generics_variance_inference.py @@ -17,7 +17,7 @@ def method1(self, a: T2) -> None: ... def method2(self) -> T3: - ... + raise NotImplementedError def func_a(p1: ClassA[float, int, int], p2: ClassA[int, float, float]): @@ -31,10 +31,10 @@ def func_a(p1: ClassA[float, int, int], p2: ClassA[int, float, float]): class ShouldBeCovariant1[T]: def __getitem__(self, index: int) -> T: - ... + raise NotImplementedError def __iter__(self) -> Iterator[T]: - ... + raise NotImplementedError vco1_1: ShouldBeCovariant1[float] = ShouldBeCovariant1[int]() # OK @@ -51,7 +51,7 @@ class ShouldBeCovariant2[T](ShouldBeCovariant1[T]): class ShouldBeCovariant3[T]: def method1(self) -> "ShouldBeCovariant2[T]": - ... + raise NotImplementedError vco3_1: ShouldBeCovariant3[float] = ShouldBeCovariant3[int]() # OK diff --git a/conformance/tests/literals_interactions.py b/conformance/tests/literals_interactions.py index 5d0a286e3..14488132b 100644 --- a/conformance/tests/literals_interactions.py +++ b/conformance/tests/literals_interactions.py @@ -58,13 +58,13 @@ def open(path: _PathType, mode: Any) -> Any: class Matrix(Generic[A, B]): def __add__(self, other: "Matrix[A, B]") -> "Matrix[A, B]": - ... + raise NotImplementedError def __matmul__(self, other: "Matrix[B, C]") -> "Matrix[A, C]": - ... + raise NotImplementedError def transpose(self) -> "Matrix[B, A]": - ... + raise NotImplementedError def func2(a: Matrix[Literal[2], Literal[3]], b: Matrix[Literal[3], Literal[7]]): diff --git a/conformance/tests/literals_literalstring.py b/conformance/tests/literals_literalstring.py index 25461dd11..99b51cdff 100644 --- a/conformance/tests/literals_literalstring.py +++ b/conformance/tests/literals_literalstring.py @@ -21,7 +21,7 @@ def my_function(literal_string: LiteralString) -> LiteralString: - ... + raise NotImplementedError class Foo: @@ -77,7 +77,7 @@ def func2(a: LiteralString, b: LiteralString): # > Conditional statements and expressions work as expected. def condition1() -> bool: - ... + raise NotImplementedError def return_literal_string() -> LiteralString: diff --git a/conformance/tests/overloads_definitions.py b/conformance/tests/overloads_definitions.py index 24ee5daa9..67a62e61b 100644 --- a/conformance/tests/overloads_definitions.py +++ b/conformance/tests/overloads_definitions.py @@ -114,7 +114,8 @@ def final_method(self, x: int) -> int: ... def final_method(self, x: str) -> str: ... @final - def final_method(self, x: int | str) -> int | str: ... + def final_method(self, x: int | str) -> int | str: + raise NotImplementedError # The @final decorator should not be on one of the overloads: @@ -127,7 +128,8 @@ def invalid_final(self, x: int) -> int: # E[invalid_final] def invalid_final(self, x: str) -> str: # E[invalid_final] ... - def invalid_final(self, x: int | str) -> int | str: ... + def invalid_final(self, x: int | str) -> int | str: + raise NotImplementedError # The @final decorator should not be on multiple overloads and # implementation: @@ -143,7 +145,8 @@ def invalid_final_2(self, x: str) -> str: # E[invalid_final_2+] ... @final - def invalid_final_2(self, x: int | str) -> int | str: ... + def invalid_final_2(self, x: int | str) -> int | str: + raise NotImplementedError # These methods are just here for the @override test below. We use an # overload because mypy doesn't like overriding a non-overloaded method @@ -156,7 +159,8 @@ def good_override(self, x: int) -> int: ... @overload def good_override(self, x: str) -> str: ... - def good_override(self, x: int | str) -> int | str: ... + def good_override(self, x: int | str) -> int | str: + raise NotImplementedError @overload def to_override(self, x: int) -> int: ... @@ -164,7 +168,8 @@ def to_override(self, x: int) -> int: ... @overload def to_override(self, x: str) -> str: ... - def to_override(self, x: int | str) -> int | str: ... + def to_override(self, x: int | str) -> int | str: + raise NotImplementedError class Child(Base): # E[override-final] @@ -181,7 +186,7 @@ def final_method(self, x: str) -> str: ... def final_method( # E[override-final] can't override final method self, x: int | str ) -> int | str: # E[override-final] can't override final method - ... + raise NotImplementedError # This is the right way to mark an overload as @override (decorate # implementation only), so the use of @override should cause an error @@ -196,7 +201,7 @@ def bad_override(self, x: str) -> str: ... @override # E[bad_override] def bad_override(self, x: int | str) -> int | str: # E[bad_override] - ... + raise NotImplementedError # This is also a correctly-decorated overloaded @override, which is # overriding a method that does exist in the base, so there should be no @@ -212,7 +217,8 @@ def good_override(self, x: int) -> int: ... def good_override(self, x: str) -> str: ... @override - def good_override(self, x: int | str) -> int | str: ... + def good_override(self, x: int | str) -> int | str: + raise NotImplementedError # This is the wrong way to use @override with an overloaded method, and # should emit an error: @@ -226,4 +232,5 @@ def to_override(self, x: int) -> int: ... # E[override_impl+] def to_override(self, x: str) -> str: ... # E[override_impl+] @override - def to_override(self, x: int | str) -> int | str: ... + def to_override(self, x: int | str) -> int | str: + raise NotImplementedError diff --git a/conformance/tests/overloads_evaluation.py b/conformance/tests/overloads_evaluation.py index 094b177ed..518b864a5 100644 --- a/conformance/tests/overloads_evaluation.py +++ b/conformance/tests/overloads_evaluation.py @@ -59,7 +59,8 @@ def example1_2(b: Literal[True] = ...) -> int: ... def example1_2(b: bool) -> float: ... -def example1_2(b: bool = True) -> float: ... +def example1_2(b: bool = True) -> float: + raise NotImplementedError def check_example1_2() -> None: @@ -288,7 +289,8 @@ def example6(a: int, b: Any) -> float: ... def example6(a: float, b: T) -> T: ... -def example6(a: float, b: T) -> T: ... +def example6(a: float, b: T) -> T: + raise NotImplementedError def check_example6(a: list[Any], b: Any, c: str) -> None: diff --git a/conformance/tests/protocols_recursive.py b/conformance/tests/protocols_recursive.py index 9b6c9f03a..9461f4a60 100644 --- a/conformance/tests/protocols_recursive.py +++ b/conformance/tests/protocols_recursive.py @@ -74,7 +74,7 @@ def method2(cls: type[ProtoB[object, T]], value: list[T]) -> None: def func1(x: ProtoA[Never, T]) -> T: - ... + raise NotImplementedError v1 = func1(ImplB()) From 48945fa6187f1f61f01bb86d213d5f2a23449acc Mon Sep 17 00:00:00 2001 From: konsti Date: Wed, 7 Jan 2026 22:22:01 +0100 Subject: [PATCH 164/308] Use `pyproject.toml` instead of `setup.py` (#2138) The main motivation for this change is to migrate from the non-standard `setup.py` to the standard PEP 517 `setup.py`. The secondary motivation is to use a build backend that's easier to use and harder to get wrong than setuptools. Modern build backends and much easier to use than setuptools, and will generally include `py.typed` and `.pyi` files automatically. This means we can remove the setuptools-specific documentation. We use `uv_build` for the stubs package example since it works out of the box with it. packaging.python.org has a tab system to show different build backends (https://packaging.python.org/en/latest/guides/writing-pyproject-toml/). Afaik typing.python.org doesn't, so we only show one build backend. Fixes #2121 --------- Co-authored-by: hauntsaninja --- docs/guides/libraries.rst | 67 +++++++-------------------------------- 1 file changed, 12 insertions(+), 55 deletions(-) diff --git a/docs/guides/libraries.rst b/docs/guides/libraries.rst index d2a14027f..a799af62d 100644 --- a/docs/guides/libraries.rst +++ b/docs/guides/libraries.rst @@ -82,26 +82,13 @@ A typical directory structure would look like: .. code-block:: text - setup.py + pyproject.toml my_great_package/ __init__.py stuff.py py.typed -It's important to ensure that the ``py.typed`` marker file is included in the -distributed package. If using ``setuptools``, this can be achieved like so: - -.. code-block:: python - - from setuptools import setup - - setup( - name="my_great_distribution", - version="0.1", - package_data={"my_great_package": ["py.typed"]}, - packages=["my_great_package"], - ) - +Note the py.typed should be located inside the package, along with ``__init__.py``. Type stub files included in the package ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -113,27 +100,13 @@ directory structure would look like: .. code-block:: text - setup.py + pyproject.toml my_great_package/ __init__.py stuff.py stuff.pyi py.typed -If using ``setuptools``, we can ensure the ``.pyi`` and ``py.typed`` files are -included like so: - -.. code-block:: python - - from setuptools import setup - - setup( - name="my_great_distribution", - version="0.1", - package_data={"my_great_package": ["py.typed", "stuff.pyi"]}, - packages=["my_great_package"], - ) - The presence of ``.pyi`` files does not affect the Python interpreter at runtime in any way. However, static type checkers will only look at the ``.pyi`` file and ignore the corresponding ``.py`` file. @@ -150,41 +123,25 @@ For example: .. code-block:: text - setup.py + pyproject.toml my_great_package-stubs/ __init__.pyi stuff.pyi +.. code-block:: toml -.. code-block:: python - - from setuptools import setup - - setup( - name="my_great_package-stubs", - version="0.1", - package_data={"my_great_package-stubs": ["__init__.pyi", "stuff.pyi"]}, - packages=["my_great_package-stubs"] - ) + [project] + name = "my-great-package-stubs" + version = "0.1.0" + requires-python = ">=3.10" + [build-system] + requires = ["uv_build>=0.9.18,<0.10.0"] + build-backend = "uv_build" Users are then able to install the stubs-only package separately to provide types for the original library. -Inclusion in sdist -^^^^^^^^^^^^^^^^^^ - -Note that to ensure inclusion of ``.pyi`` and ``py.typed`` files in an sdist -(.tar.gz archive), you may also need to modify the inclusion rules in your -``MANIFEST.in`` (see the -`packaging guide `__ -for more details on ``MANIFEST.in``). For example: - -.. code-block:: text - - global-include *.pyi - global-include py.typed - .. _type_completeness: How much of my library needs types? From dece44f2922ca390fe314145d09939514a21e76e Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Thu, 8 Jan 2026 03:51:23 +0000 Subject: [PATCH 165/308] Pass most conformance tests for Zuban (#2139) --- .../results/mypy/generics_defaults.toml | 2 - .../results/mypy/specialtypes_never.toml | 8 +- conformance/results/mypy/version.toml | 2 +- .../results/pyrefly/generics_defaults.toml | 8 +- .../results/pyrefly/protocols_explicit.toml | 9 +-- .../pyrefly/protocols_runtime_checkable.toml | 10 +-- .../pyrefly/qualifiers_final_annotation.toml | 4 +- .../results/pyrefly/specialtypes_never.toml | 8 +- conformance/results/pyrefly/version.toml | 2 +- .../results/pyright/specialtypes_never.toml | 4 +- conformance/results/results.html | 78 +++++++++---------- .../results/zuban/aliases_typealiastype.toml | 11 +-- .../zuban/annotations_forward_refs.toml | 11 +-- .../results/zuban/callables_annotation.toml | 21 ++--- .../results/zuban/constructors_call_init.toml | 12 +-- .../results/zuban/constructors_call_new.toml | 28 +------ .../results/zuban/constructors_call_type.toml | 10 +-- .../results/zuban/constructors_callable.toml | 44 ++--------- .../results/zuban/dataclasses_final.toml | 15 +--- .../results/zuban/dataclasses_hash.toml | 10 +-- .../results/zuban/dataclasses_slots.toml | 8 +- .../dataclasses_transform_converter.toml | 8 +- .../results/zuban/enums_expansion.toml | 11 +-- .../results/zuban/enums_member_values.toml | 6 +- conformance/results/zuban/enums_members.toml | 16 +--- .../results/zuban/generics_base_class.toml | 10 +-- .../results/zuban/generics_defaults.toml | 15 +--- .../results/zuban/generics_scoping.toml | 7 +- .../results/zuban/generics_self_usage.toml | 14 ++-- .../zuban/generics_syntax_declarations.toml | 2 +- .../zuban/generics_syntax_infer_variance.toml | 10 +-- .../zuban/generics_syntax_scoping.toml | 29 +------ .../zuban/generics_typevartuple_args.toml | 10 +-- .../zuban/generics_typevartuple_basic.toml | 21 ++--- .../results/zuban/generics_upper_bound.toml | 8 +- .../results/zuban/generics_variance.toml | 18 ++--- .../results/zuban/historical_positional.toml | 14 +--- .../results/zuban/literals_interactions.toml | 10 +-- .../zuban/namedtuples_define_class.toml | 8 +- .../results/zuban/overloads_evaluation.toml | 36 +-------- .../results/zuban/protocols_definition.toml | 28 ++++--- .../zuban/protocols_runtime_checkable.toml | 14 ++-- .../zuban/qualifiers_final_annotation.toml | 16 +--- .../results/zuban/specialtypes_never.toml | 9 ++- .../results/zuban/tuples_type_compat.toml | 1 - .../results/zuban/typeddicts_alt_syntax.toml | 3 - .../typeddicts_readonly_inheritance.toml | 18 +---- .../zuban/typeddicts_readonly_update.toml | 8 +- conformance/results/zuban/version.toml | 2 +- conformance/src/type_checker.py | 3 - conformance/tests/generics_base_class.py | 2 +- conformance/tests/generics_defaults.py | 3 +- conformance/tests/generics_scoping.py | 2 +- conformance/tests/specialtypes_never.py | 1 + 54 files changed, 186 insertions(+), 482 deletions(-) diff --git a/conformance/results/mypy/generics_defaults.toml b/conformance/results/mypy/generics_defaults.toml index 63ba3c8e2..c12fd1602 100644 --- a/conformance/results/mypy/generics_defaults.toml +++ b/conformance/results/mypy/generics_defaults.toml @@ -19,7 +19,6 @@ generics_defaults.py:156: error: Expression is of type "type[Foo6[*tuple[Any, .. generics_defaults.py:156: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [misc] generics_defaults.py:157: error: Expression is of type "type[Foo6[*tuple[Any, ...], Any]]", not "type[Foo6[int, str, [bytes]]]" [assert-type] generics_defaults.py:157: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [misc] -generics_defaults.py:171: error: Expression is of type "Callable[[Self], Self]", not "Callable[[Foo7[int]], Foo7[int]]" [assert-type] """ conformance_automated = "Fail" errors_diff = """ @@ -36,5 +35,4 @@ Line 79: Unexpected errors ['generics_defaults.py:79: error: Expression is of ty Line 94: Unexpected errors ['generics_defaults.py:94: error: Expression is of type "type[Class_TypeVarTuple[*DefaultTs]]", not "type[Class_TypeVarTuple[str, int]]" [assert-type]'] Line 156: Unexpected errors ['generics_defaults.py:156: error: Expression is of type "type[Foo6[*tuple[Any, ...], Any]]", not "type[Foo6[int, str, [float, bool]]]" [assert-type]', 'generics_defaults.py:156: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [misc]'] Line 157: Unexpected errors ['generics_defaults.py:157: error: Expression is of type "type[Foo6[*tuple[Any, ...], Any]]", not "type[Foo6[int, str, [bytes]]]" [assert-type]', 'generics_defaults.py:157: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [misc]'] -Line 171: Unexpected errors ['generics_defaults.py:171: error: Expression is of type "Callable[[Self], Self]", not "Callable[[Foo7[int]], Foo7[int]]" [assert-type]'] """ diff --git a/conformance/results/mypy/specialtypes_never.toml b/conformance/results/mypy/specialtypes_never.toml index 510a86b66..7f54a2c5c 100644 --- a/conformance/results/mypy/specialtypes_never.toml +++ b/conformance/results/mypy/specialtypes_never.toml @@ -1,10 +1,10 @@ conformant = "Pass" output = """ specialtypes_never.py:19: error: Implicit return in function which does not return [misc] -specialtypes_never.py:86: error: Incompatible types in assignment (expression has type "list[Never]", variable has type "list[int]") [assignment] -specialtypes_never.py:86: note: "list" is invariant -- see https://mypy.readthedocs.io/en/stable/common_issues.html#variance -specialtypes_never.py:86: note: Consider using "Sequence" instead, which is covariant -specialtypes_never.py:105: error: Incompatible return value type (got "ClassC[Never]", expected "ClassC[U]") [return-value] +specialtypes_never.py:87: error: Incompatible types in assignment (expression has type "list[Never]", variable has type "list[int]") [assignment] +specialtypes_never.py:87: note: "list" is invariant -- see https://mypy.readthedocs.io/en/stable/common_issues.html#variance +specialtypes_never.py:87: note: Consider using "Sequence" instead, which is covariant +specialtypes_never.py:106: error: Incompatible return value type (got "ClassC[Never]", expected "ClassC[U]") [return-value] """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/mypy/version.toml b/conformance/results/mypy/version.toml index e0afe12c0..6356188e2 100644 --- a/conformance/results/mypy/version.toml +++ b/conformance/results/mypy/version.toml @@ -1 +1 @@ -version = "mypy 1.19.0" +version = "mypy 1.19.1" diff --git a/conformance/results/pyrefly/generics_defaults.toml b/conformance/results/pyrefly/generics_defaults.toml index 8589ad527..efe58237e 100644 --- a/conformance/results/pyrefly/generics_defaults.toml +++ b/conformance/results/pyrefly/generics_defaults.toml @@ -1,10 +1,5 @@ -conformant = "Partial" -notes = """ -Defaults are not bound by attribute access -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 171: Unexpected errors ['assert_type([DefaultIntT](Foo7[DefaultIntT]) -> Foo7[DefaultIntT], (Foo7[int]) -> Foo7[int]) failed [assert-type]'] """ output = """ ERROR generics_defaults.py:24:7-31: Type parameter `T` without a default cannot follow type parameter `DefaultStrT` with a default [invalid-type-var] @@ -13,5 +8,4 @@ ERROR generics_defaults.py:107:51-54: Expected default `int` of `Invalid1` to be ERROR generics_defaults.py:114:52-55: Expected default `int` of `Invalid2` to be one of the following constraints: `float`, `str` [invalid-type-var] ERROR generics_defaults.py:132:12-27: assert_type(int, Any) failed [assert-type] ERROR generics_defaults.py:143:7-11: TypeVar `T5` with a default cannot follow TypeVarTuple `Ts` [invalid-type-var] -ERROR generics_defaults.py:171:12-57: assert_type([DefaultIntT](Foo7[DefaultIntT]) -> Foo7[DefaultIntT], (Foo7[int]) -> Foo7[int]) failed [assert-type] """ diff --git a/conformance/results/pyrefly/protocols_explicit.toml b/conformance/results/pyrefly/protocols_explicit.toml index 3986491f8..e8bdff360 100644 --- a/conformance/results/pyrefly/protocols_explicit.toml +++ b/conformance/results/pyrefly/protocols_explicit.toml @@ -1,16 +1,11 @@ -conformant = "Partial" -notes = """ -Does not reject call to super method with no default implementation. -Does not detect stub methods inherited from protocols as abstract. -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 89: Expected 1 errors """ output = """ ERROR protocols_explicit.py:27:16-28: Method `draw` inherited from class `PColor` has no implementation and cannot be accessed via `super()` [missing-attribute] ERROR protocols_explicit.py:56:20-36: `tuple[int, int, str]` is not assignable to attribute `rgb` with type `tuple[int, int, int]` [bad-assignment] ERROR protocols_explicit.py:60:10-20: Cannot instantiate `Point` because the following members are abstract: `intensity`, `transparency` [bad-instantiation] +ERROR protocols_explicit.py:89:15-17: Cannot instantiate `Concrete1` because the following members are abstract: `cm1` [bad-instantiation] ERROR protocols_explicit.py:134:15-17: Cannot instantiate `Concrete5` because the following members are abstract: `method1` [bad-instantiation] ERROR protocols_explicit.py:164:17-19: Cannot instantiate `Concrete7A` because the following members are abstract: `method1` [bad-instantiation] """ diff --git a/conformance/results/pyrefly/protocols_runtime_checkable.toml b/conformance/results/pyrefly/protocols_runtime_checkable.toml index eeee93851..a17346813 100644 --- a/conformance/results/pyrefly/protocols_runtime_checkable.toml +++ b/conformance/results/pyrefly/protocols_runtime_checkable.toml @@ -6,9 +6,9 @@ output = """ ERROR protocols_runtime_checkable.py:23:22-28: Protocol `Proto1` is not decorated with @runtime_checkable and cannot be used with isinstance() [invalid-argument] ERROR protocols_runtime_checkable.py:55:22-34: Protocol `DataProtocol` has non-method members and cannot be used with issubclass() [invalid-argument] ERROR protocols_runtime_checkable.py:61:22-53: Protocol `DataProtocol` has non-method members and cannot be used with issubclass() [invalid-argument] -ERROR protocols_runtime_checkable.py:88:33-39: Runtime checkable protocol `Proto3` has an unsafe overlap with type `Concrete3A` [invalid-argument] -ERROR protocols_runtime_checkable.py:92:23-48: Runtime checkable protocol `Proto3` has an unsafe overlap with type `Concrete3B` [invalid-argument] -ERROR protocols_runtime_checkable.py:92:23-48: Runtime checkable protocol `NonDataProtocol` has an unsafe overlap with type `Concrete3B` [invalid-argument] -ERROR protocols_runtime_checkable.py:96:31-56: Runtime checkable protocol `Proto3` has an unsafe overlap with type `Concrete3A` [invalid-argument] -ERROR protocols_runtime_checkable.py:96:31-56: Runtime checkable protocol `NonDataProtocol` has an unsafe overlap with type `Concrete3A` [invalid-argument] +ERROR protocols_runtime_checkable.py:88:33-39: Runtime checkable protocol `Proto3` has an unsafe overlap with type `Concrete3A` [unsafe-overlap] +ERROR protocols_runtime_checkable.py:92:23-48: Runtime checkable protocol `Proto3` has an unsafe overlap with type `Concrete3B` [unsafe-overlap] +ERROR protocols_runtime_checkable.py:92:23-48: Runtime checkable protocol `NonDataProtocol` has an unsafe overlap with type `Concrete3B` [unsafe-overlap] +ERROR protocols_runtime_checkable.py:96:31-56: Runtime checkable protocol `Proto3` has an unsafe overlap with type `Concrete3A` [unsafe-overlap] +ERROR protocols_runtime_checkable.py:96:31-56: Runtime checkable protocol `NonDataProtocol` has an unsafe overlap with type `Concrete3A` [unsafe-overlap] """ diff --git a/conformance/results/pyrefly/qualifiers_final_annotation.toml b/conformance/results/pyrefly/qualifiers_final_annotation.toml index 0054bf89f..f3fa124d2 100644 --- a/conformance/results/pyrefly/qualifiers_final_annotation.toml +++ b/conformance/results/pyrefly/qualifiers_final_annotation.toml @@ -6,8 +6,6 @@ conformance_automated = "Fail" errors_diff = """ Line 34: Expected 1 errors Line 38: Expected 1 errors -Line 62: Expected 1 errors -Line 63: Expected 1 errors Line 107: Expected 1 errors Line 149: Expected 1 errors Line 152: Expected 1 errors @@ -21,6 +19,8 @@ output = """ ERROR qualifiers_final_annotation.py:16:7-12: Expected a type argument for `Final` [invalid-annotation] ERROR qualifiers_final_annotation.py:18:7-22: Expected 1 type argument for `Final`, got 2 [invalid-annotation] ERROR qualifiers_final_annotation.py:54:9-17: Cannot set field `ID5` [read-only] +ERROR qualifiers_final_annotation.py:62:9-17: Cannot set field `id3` [read-only] +ERROR qualifiers_final_annotation.py:63:9-17: Cannot set field `id4` [read-only] ERROR qualifiers_final_annotation.py:65:9-17: Cannot set field `ID7` [read-only] ERROR qualifiers_final_annotation.py:67:9-17: Cannot set field `ID7` [read-only] ERROR qualifiers_final_annotation.py:71:8-11: `RATE` is marked final [bad-assignment] diff --git a/conformance/results/pyrefly/specialtypes_never.toml b/conformance/results/pyrefly/specialtypes_never.toml index ea293f7e1..5123b2011 100644 --- a/conformance/results/pyrefly/specialtypes_never.toml +++ b/conformance/results/pyrefly/specialtypes_never.toml @@ -4,11 +4,11 @@ Does not detect invalid return is unreachable """ conformance_automated = "Fail" errors_diff = """ -Line 32: Unexpected errors ["Returned type `Literal['whatever works']` is not assignable to declared return type `int` [bad-return]"] +Line 33: Unexpected errors ["Returned type `Literal['whatever works']` is not assignable to declared return type `int` [bad-return]"] """ output = """ ERROR specialtypes_never.py:19:22-30: Function declared to return `NoReturn` but is missing an explicit `return` [bad-return] -ERROR specialtypes_never.py:32:12-28: Returned type `Literal['whatever works']` is not assignable to declared return type `int` [bad-return] -ERROR specialtypes_never.py:86:21-22: `list[Never]` is not assignable to `list[int]` [bad-assignment] -ERROR specialtypes_never.py:105:12-27: Returned type `ClassC[Never]` is not assignable to declared return type `ClassC[U]` [bad-return] +ERROR specialtypes_never.py:33:12-28: Returned type `Literal['whatever works']` is not assignable to declared return type `int` [bad-return] +ERROR specialtypes_never.py:87:21-22: `list[Never]` is not assignable to `list[int]` [bad-assignment] +ERROR specialtypes_never.py:106:12-27: Returned type `ClassC[Never]` is not assignable to declared return type `ClassC[U]` [bad-return] """ diff --git a/conformance/results/pyrefly/version.toml b/conformance/results/pyrefly/version.toml index 4dfd1faaa..79a0b6cf3 100644 --- a/conformance/results/pyrefly/version.toml +++ b/conformance/results/pyrefly/version.toml @@ -1 +1 @@ -version = "pyrefly 0.45.2" +version = "pyrefly 0.46.1" diff --git a/conformance/results/pyright/specialtypes_never.toml b/conformance/results/pyright/specialtypes_never.toml index d4e0cc4df..250e0ed75 100644 --- a/conformance/results/pyright/specialtypes_never.toml +++ b/conformance/results/pyright/specialtypes_never.toml @@ -1,11 +1,11 @@ conformant = "Pass" output = """ specialtypes_never.py:19:22 - error: Function with declared return type "NoReturn" cannot return "None" (reportReturnType) -specialtypes_never.py:86:21 - error: Type "list[Never]" is not assignable to declared type "list[int]" +specialtypes_never.py:87:21 - error: Type "list[Never]" is not assignable to declared type "list[int]"   "list[Never]" is not assignable to "list[int]"     Type parameter "_T@list" is invariant, but "Never" is not the same as "int"     Consider switching from "list" to "Sequence" which is covariant (reportAssignmentType) -specialtypes_never.py:105:12 - error: Type "ClassC[Never]" is not assignable to return type "ClassC[U@func10]" +specialtypes_never.py:106:12 - error: Type "ClassC[Never]" is not assignable to return type "ClassC[U@func10]"   "ClassC[Never]" is not assignable to "ClassC[U@func10]"     Type parameter "T@ClassC" is invariant, but "Never" is not the same as "U@func10" (reportReturnType) """ diff --git a/conformance/results/results.html b/conformance/results/results.html index ec5fb5514..cc9b4f3ec 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -158,13 +158,13 @@

    Python Type System Conformance Test Results

     
    mypy 1.18.2
    +
    mypy 1.19.0
    pyright 1.1.407
    zuban 0.2.3
    +
    zuban 0.3.0
    pyrefly 0.43.1
    +
    pyrefly 0.45.2
    diff --git a/conformance/results/zuban/tuples_type_compat.toml b/conformance/results/zuban/tuples_type_compat.toml index f496d48b0..d712468bb 100644 --- a/conformance/results/zuban/tuples_type_compat.toml +++ b/conformance/results/zuban/tuples_type_compat.toml @@ -1,10 +1,6 @@ -conformant = "Partial" -notes = """ -Incorrectly marks a match case as unreachable. -""" -conformance_automated = "Fail" +conformant = "Pass" +conformance_automated = "Pass" errors_diff = """ -Lines 111, 112: Expected error (tag 'func6_3') """ output = """ tuples_type_compat.py:15: error: Incompatible types in assignment (expression has type "tuple[float, complex]", variable has type "tuple[int, int]") [assignment] @@ -18,6 +14,7 @@ tuples_type_compat.py:81: error: Expression is of type "tuple[str, str] | tuple[ tuples_type_compat.py:86: error: Expression is of type "tuple[int, str, int]", not "tuple[int] | tuple[str, str] | tuple[int, Unpack[Tuple[str, ...]], int]" [misc] tuples_type_compat.py:102: error: Expression is of type "tuple[int]", not "tuple[int] | tuple[str, str] | tuple[int, Unpack[Tuple[str, ...]], int]" [misc] tuples_type_compat.py:107: error: Expression is of type "tuple[str, str] | tuple[int, int]", not "tuple[int] | tuple[str, str] | tuple[int, Unpack[Tuple[str, ...]], int]" [misc] +tuples_type_compat.py:112: error: Expression is of type "tuple[int, str, int]", not "tuple[int] | tuple[str, str] | tuple[int, Unpack[Tuple[str, ...]], int]" [misc] tuples_type_compat.py:127: error: Expression is of type "tuple[int | str, str]", not "tuple[int | str, int | str]" [misc] tuples_type_compat.py:129: error: Expression is of type "tuple[int | str, int | str]", not "tuple[int | str, int]" [misc] tuples_type_compat.py:157: error: Incompatible types in assignment (expression has type "tuple[int, str, str]", variable has type "tuple[int, str]") [assignment] diff --git a/conformance/results/zuban/version.toml b/conformance/results/zuban/version.toml index 8938624f8..7c3e030de 100644 --- a/conformance/results/zuban/version.toml +++ b/conformance/results/zuban/version.toml @@ -1 +1 @@ -version = "zuban 0.2.3" +version = "zuban 0.3.0" From 211b0cb5470e856f6093f7c3d688295f72f78bb6 Mon Sep 17 00:00:00 2001 From: Shantanu <12621235+hauntsaninja@users.noreply.github.com> Date: Sat, 13 Dec 2025 19:04:07 -0800 Subject: [PATCH 163/308] Update conformance suite to avoid unsound empty bodies (#2134) --- .../results/mypy/constructors_call_new.toml | 2 +- .../results/mypy/constructors_callable.toml | 66 ++++++++-------- .../results/mypy/generics_defaults.toml | 18 ++--- .../results/mypy/generics_self_basic.toml | 2 +- .../results/mypy/generics_self_usage.toml | 20 ++--- .../results/mypy/overloads_definitions.toml | 10 +-- .../results/mypy/overloads_evaluation.toml | 56 +++++++------- .../pyrefly/constructors_call_new.toml | 2 +- .../pyrefly/constructors_callable.toml | 34 ++++----- .../results/pyrefly/generics_defaults.toml | 8 +- .../results/pyrefly/generics_self_basic.toml | 2 +- .../results/pyrefly/generics_self_usage.toml | 16 ++-- .../pyrefly/overloads_definitions.toml | 14 ++-- .../results/pyrefly/overloads_evaluation.toml | 2 +- .../pyright/constructors_call_new.toml | 2 +- .../pyright/constructors_callable.toml | 36 ++++----- .../results/pyright/generics_defaults.toml | 4 +- .../results/pyright/generics_self_basic.toml | 2 +- .../results/pyright/generics_self_usage.toml | 18 ++--- .../pyright/overloads_definitions.toml | 14 ++-- .../results/pyright/overloads_evaluation.toml | 10 +-- conformance/results/results.html | 6 +- .../results/zuban/constructors_call_new.toml | 2 +- .../results/zuban/constructors_callable.toml | 76 +++++++++---------- .../results/zuban/generics_defaults.toml | 14 ++-- .../results/zuban/generics_self_basic.toml | 2 +- .../results/zuban/generics_self_usage.toml | 14 ++-- .../zuban/generics_syntax_infer_variance.toml | 2 - .../results/zuban/overloads_definitions.toml | 14 ++-- .../results/zuban/overloads_evaluation.toml | 56 +++++++------- conformance/src/type_checker.py | 2 - conformance/tests/constructors_call_new.py | 9 ++- conformance/tests/constructors_callable.py | 6 +- conformance/tests/dataclasses_descriptors.py | 4 +- .../tests/dataclasses_transform_converter.py | 2 +- .../tests/dataclasses_transform_field.py | 2 +- .../tests/dataclasses_transform_func.py | 2 +- conformance/tests/generics_defaults.py | 3 +- conformance/tests/generics_paramspec_basic.py | 2 +- .../tests/generics_paramspec_semantics.py | 32 ++++---- conformance/tests/generics_self_advanced.py | 4 +- conformance/tests/generics_self_basic.py | 3 +- conformance/tests/generics_self_usage.py | 14 ++-- .../tests/generics_syntax_compatibility.py | 4 +- .../tests/generics_syntax_infer_variance.py | 10 +-- conformance/tests/generics_syntax_scoping.py | 4 +- .../tests/generics_typevartuple_args.py | 4 +- .../tests/generics_typevartuple_basic.py | 6 +- .../tests/generics_typevartuple_callable.py | 8 +- .../tests/generics_typevartuple_concat.py | 8 +- .../generics_typevartuple_specialization.py | 4 +- conformance/tests/generics_variance.py | 4 +- .../tests/generics_variance_inference.py | 8 +- conformance/tests/literals_interactions.py | 6 +- conformance/tests/literals_literalstring.py | 4 +- conformance/tests/overloads_definitions.py | 25 +++--- conformance/tests/overloads_evaluation.py | 6 +- conformance/tests/protocols_recursive.py | 2 +- 58 files changed, 363 insertions(+), 349 deletions(-) diff --git a/conformance/results/mypy/constructors_call_new.toml b/conformance/results/mypy/constructors_call_new.toml index 64d15f4b6..a325d9e54 100644 --- a/conformance/results/mypy/constructors_call_new.toml +++ b/conformance/results/mypy/constructors_call_new.toml @@ -6,7 +6,7 @@ Does not report errors during binding to cls parameter of __new__ method. """ conformance_automated = "Fail" errors_diff = """ -Line 145: Expected 1 errors +Line 148: Expected 1 errors Line 40: Unexpected errors ['constructors_call_new.py:40: error: Incompatible return type for "__new__" (returns "int", but must return a subtype of "Class3") [misc]'] Line 49: Unexpected errors ['constructors_call_new.py:49: error: Expression is of type "Class3", not "int" [assert-type]', 'constructors_call_new.py:49: error: Missing positional argument "x" in call to "Class3" [call-arg]'] Line 57: Unexpected errors ['constructors_call_new.py:57: error: "__new__" must return a class instance (got "Class4 | Any") [misc]'] diff --git a/conformance/results/mypy/constructors_callable.toml b/conformance/results/mypy/constructors_callable.toml index e492d317a..0a73c46b8 100644 --- a/conformance/results/mypy/constructors_callable.toml +++ b/conformance/results/mypy/constructors_callable.toml @@ -6,15 +6,15 @@ Does not support __new__ return type that is different from class being construc """ conformance_automated = "Fail" errors_diff = """ -Line 127: Expected 1 errors -Line 144: Expected 1 errors -Line 73: Unexpected errors ['constructors_callable.py:73: error: Incompatible return type for "__new__" (returns "int", but must return a subtype of "Class4") [misc]'] -Line 78: Unexpected errors ['constructors_callable.py:78: error: Expression is of type "Class4", not "int" [assert-type]'] -Line 100: Unexpected errors ['constructors_callable.py:100: error: Expression is of type "Class5", not "Never" [assert-type]'] -Line 105: Unexpected errors ['constructors_callable.py:105: error: Expression is of type "Class5", not "Never" [assert-type]'] -Line 116: Unexpected errors ['constructors_callable.py:116: error: Incompatible return type for "__new__" (returns "Class6Proxy", but must return a subtype of "Class6") [misc]'] -Line 126: Unexpected errors ['constructors_callable.py:126: error: Expression is of type "Class6", not "Class6Proxy" [assert-type]', 'constructors_callable.py:126: error: Too few arguments [call-arg]'] -Line 143: Unexpected errors ['constructors_callable.py:143: error: Expression is of type "Class6Any", not "Any" [assert-type]', 'constructors_callable.py:143: error: Too few arguments [call-arg]'] +Line 129: Expected 1 errors +Line 146: Expected 1 errors +Line 74: Unexpected errors ['constructors_callable.py:74: error: Incompatible return type for "__new__" (returns "int", but must return a subtype of "Class4") [misc]'] +Line 80: Unexpected errors ['constructors_callable.py:80: error: Expression is of type "Class4", not "int" [assert-type]'] +Line 102: Unexpected errors ['constructors_callable.py:102: error: Expression is of type "Class5", not "Never" [assert-type]'] +Line 107: Unexpected errors ['constructors_callable.py:107: error: Expression is of type "Class5", not "Never" [assert-type]'] +Line 118: Unexpected errors ['constructors_callable.py:118: error: Incompatible return type for "__new__" (returns "Class6Proxy", but must return a subtype of "Class6") [misc]'] +Line 128: Unexpected errors ['constructors_callable.py:128: error: Expression is of type "Class6", not "Class6Proxy" [assert-type]', 'constructors_callable.py:128: error: Too few arguments [call-arg]'] +Line 145: Unexpected errors ['constructors_callable.py:145: error: Expression is of type "Class6Any", not "Any" [assert-type]', 'constructors_callable.py:145: error: Too few arguments [call-arg]'] """ output = """ constructors_callable.py:36: note: Revealed type is "def (x: builtins.int) -> constructors_callable.Class1" @@ -22,28 +22,28 @@ constructors_callable.py:38: error: Too few arguments [call-arg] constructors_callable.py:39: error: Unexpected keyword argument "y" [call-arg] constructors_callable.py:49: note: Revealed type is "def () -> constructors_callable.Class2" constructors_callable.py:51: error: Too many arguments [call-arg] -constructors_callable.py:63: note: Revealed type is "def (x: builtins.int) -> constructors_callable.Class3" -constructors_callable.py:65: error: Too few arguments [call-arg] -constructors_callable.py:66: error: Unexpected keyword argument "y" [call-arg] -constructors_callable.py:67: error: Too many arguments [call-arg] -constructors_callable.py:73: error: Incompatible return type for "__new__" (returns "int", but must return a subtype of "Class4") [misc] -constructors_callable.py:77: note: Revealed type is "def (x: builtins.int) -> constructors_callable.Class4" -constructors_callable.py:78: error: Expression is of type "Class4", not "int" [assert-type] -constructors_callable.py:79: error: Too few arguments [call-arg] -constructors_callable.py:80: error: Unexpected keyword argument "y" [call-arg] -constructors_callable.py:97: note: Revealed type is "def (*args: Any, **kwargs: Any) -> constructors_callable.Class5" -constructors_callable.py:100: error: Expression is of type "Class5", not "Never" [assert-type] -constructors_callable.py:105: error: Expression is of type "Class5", not "Never" [assert-type] -constructors_callable.py:116: error: Incompatible return type for "__new__" (returns "Class6Proxy", but must return a subtype of "Class6") [misc] -constructors_callable.py:125: note: Revealed type is "def (x: builtins.int) -> constructors_callable.Class6" -constructors_callable.py:126: error: Expression is of type "Class6", not "Class6Proxy" [assert-type] -constructors_callable.py:126: error: Too few arguments [call-arg] -constructors_callable.py:142: note: Revealed type is "def (x: builtins.int) -> constructors_callable.Class6Any" -constructors_callable.py:143: error: Expression is of type "Class6Any", not "Any" [assert-type] -constructors_callable.py:143: error: Too few arguments [call-arg] -constructors_callable.py:162: note: Revealed type is "Overload(def (x: builtins.int) -> constructors_callable.Class7[builtins.int], def (x: builtins.str) -> constructors_callable.Class7[builtins.str])" -constructors_callable.py:182: note: Revealed type is "def [T] (x: builtins.list[T`1], y: builtins.list[T`1]) -> constructors_callable.Class8[T`1]" -constructors_callable.py:184: error: Cannot infer function type argument [misc] -constructors_callable.py:193: note: Revealed type is "def [T] (x: builtins.list[T`-1], y: builtins.list[T`-1]) -> constructors_callable.Class9" -constructors_callable.py:195: error: Cannot infer function type argument [misc] +constructors_callable.py:64: note: Revealed type is "def (x: builtins.int) -> constructors_callable.Class3" +constructors_callable.py:66: error: Too few arguments [call-arg] +constructors_callable.py:67: error: Unexpected keyword argument "y" [call-arg] +constructors_callable.py:68: error: Too many arguments [call-arg] +constructors_callable.py:74: error: Incompatible return type for "__new__" (returns "int", but must return a subtype of "Class4") [misc] +constructors_callable.py:79: note: Revealed type is "def (x: builtins.int) -> constructors_callable.Class4" +constructors_callable.py:80: error: Expression is of type "Class4", not "int" [assert-type] +constructors_callable.py:81: error: Too few arguments [call-arg] +constructors_callable.py:82: error: Unexpected keyword argument "y" [call-arg] +constructors_callable.py:99: note: Revealed type is "def (*args: Any, **kwargs: Any) -> constructors_callable.Class5" +constructors_callable.py:102: error: Expression is of type "Class5", not "Never" [assert-type] +constructors_callable.py:107: error: Expression is of type "Class5", not "Never" [assert-type] +constructors_callable.py:118: error: Incompatible return type for "__new__" (returns "Class6Proxy", but must return a subtype of "Class6") [misc] +constructors_callable.py:127: note: Revealed type is "def (x: builtins.int) -> constructors_callable.Class6" +constructors_callable.py:128: error: Expression is of type "Class6", not "Class6Proxy" [assert-type] +constructors_callable.py:128: error: Too few arguments [call-arg] +constructors_callable.py:144: note: Revealed type is "def (x: builtins.int) -> constructors_callable.Class6Any" +constructors_callable.py:145: error: Expression is of type "Class6Any", not "Any" [assert-type] +constructors_callable.py:145: error: Too few arguments [call-arg] +constructors_callable.py:164: note: Revealed type is "Overload(def (x: builtins.int) -> constructors_callable.Class7[builtins.int], def (x: builtins.str) -> constructors_callable.Class7[builtins.str])" +constructors_callable.py:184: note: Revealed type is "def [T] (x: builtins.list[T`1], y: builtins.list[T`1]) -> constructors_callable.Class8[T`1]" +constructors_callable.py:186: error: Cannot infer function type argument [misc] +constructors_callable.py:195: note: Revealed type is "def [T] (x: builtins.list[T`-1], y: builtins.list[T`-1]) -> constructors_callable.Class9" +constructors_callable.py:197: error: Cannot infer function type argument [misc] """ diff --git a/conformance/results/mypy/generics_defaults.toml b/conformance/results/mypy/generics_defaults.toml index ba432041c..63ba3c8e2 100644 --- a/conformance/results/mypy/generics_defaults.toml +++ b/conformance/results/mypy/generics_defaults.toml @@ -14,16 +14,16 @@ generics_defaults.py:79: error: Expression is of type "type[Class_ParamSpec[Defa generics_defaults.py:94: error: Expression is of type "type[Class_TypeVarTuple[*DefaultTs]]", not "type[Class_TypeVarTuple[str, int]]" [assert-type] generics_defaults.py:107: error: TypeVar default must be a subtype of the bound type [misc] generics_defaults.py:114: error: TypeVar default must be one of the constraint types [misc] -generics_defaults.py:131: error: Expression is of type "int", not "Any" [assert-type] -generics_defaults.py:155: error: Expression is of type "type[Foo6[*tuple[Any, ...], Any]]", not "type[Foo6[int, str, [float, bool]]]" [assert-type] -generics_defaults.py:155: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [misc] -generics_defaults.py:156: error: Expression is of type "type[Foo6[*tuple[Any, ...], Any]]", not "type[Foo6[int, str, [bytes]]]" [assert-type] +generics_defaults.py:132: error: Expression is of type "int", not "Any" [assert-type] +generics_defaults.py:156: error: Expression is of type "type[Foo6[*tuple[Any, ...], Any]]", not "type[Foo6[int, str, [float, bool]]]" [assert-type] generics_defaults.py:156: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [misc] -generics_defaults.py:170: error: Expression is of type "Callable[[Self], Self]", not "Callable[[Foo7[int]], Foo7[int]]" [assert-type] +generics_defaults.py:157: error: Expression is of type "type[Foo6[*tuple[Any, ...], Any]]", not "type[Foo6[int, str, [bytes]]]" [assert-type] +generics_defaults.py:157: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [misc] +generics_defaults.py:171: error: Expression is of type "Callable[[Self], Self]", not "Callable[[Foo7[int]], Foo7[int]]" [assert-type] """ conformance_automated = "Fail" errors_diff = """ -Line 142: Expected 1 errors +Line 143: Expected 1 errors Line 30: Unexpected errors ['generics_defaults.py:30: error: Expression is of type "type[NoNonDefaults[DefaultStrT, DefaultIntT]]", not "type[NoNonDefaults[str, int]]" [assert-type]'] Line 31: Unexpected errors ['generics_defaults.py:31: error: Expression is of type "type[NoNonDefaults[str, DefaultIntT]]", not "type[NoNonDefaults[str, int]]" [assert-type]'] Line 38: Unexpected errors ['generics_defaults.py:38: error: Expression is of type "type[OneDefault[float, DefaultBoolT]]", not "type[OneDefault[float, bool]]" [assert-type]'] @@ -34,7 +34,7 @@ Line 55: Unexpected errors ['generics_defaults.py:55: error: Expression is of ty Line 59: Unexpected errors ['generics_defaults.py:59: error: Expression is of type "type[AllTheDefaults[int, complex, str, int, DefaultBoolT]]", not "type[AllTheDefaults[int, complex, str, int, bool]]" [assert-type]'] Line 79: Unexpected errors ['generics_defaults.py:79: error: Expression is of type "type[Class_ParamSpec[DefaultP]]", not "type[Class_ParamSpec[[str, int]]]" [assert-type]'] Line 94: Unexpected errors ['generics_defaults.py:94: error: Expression is of type "type[Class_TypeVarTuple[*DefaultTs]]", not "type[Class_TypeVarTuple[str, int]]" [assert-type]'] -Line 155: Unexpected errors ['generics_defaults.py:155: error: Expression is of type "type[Foo6[*tuple[Any, ...], Any]]", not "type[Foo6[int, str, [float, bool]]]" [assert-type]', 'generics_defaults.py:155: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [misc]'] -Line 156: Unexpected errors ['generics_defaults.py:156: error: Expression is of type "type[Foo6[*tuple[Any, ...], Any]]", not "type[Foo6[int, str, [bytes]]]" [assert-type]', 'generics_defaults.py:156: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [misc]'] -Line 170: Unexpected errors ['generics_defaults.py:170: error: Expression is of type "Callable[[Self], Self]", not "Callable[[Foo7[int]], Foo7[int]]" [assert-type]'] +Line 156: Unexpected errors ['generics_defaults.py:156: error: Expression is of type "type[Foo6[*tuple[Any, ...], Any]]", not "type[Foo6[int, str, [float, bool]]]" [assert-type]', 'generics_defaults.py:156: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [misc]'] +Line 157: Unexpected errors ['generics_defaults.py:157: error: Expression is of type "type[Foo6[*tuple[Any, ...], Any]]", not "type[Foo6[int, str, [bytes]]]" [assert-type]', 'generics_defaults.py:157: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [misc]'] +Line 171: Unexpected errors ['generics_defaults.py:171: error: Expression is of type "Callable[[Self], Self]", not "Callable[[Foo7[int]], Foo7[int]]" [assert-type]'] """ diff --git a/conformance/results/mypy/generics_self_basic.toml b/conformance/results/mypy/generics_self_basic.toml index c902871c3..2502d0de1 100644 --- a/conformance/results/mypy/generics_self_basic.toml +++ b/conformance/results/mypy/generics_self_basic.toml @@ -2,7 +2,7 @@ conformant = "Pass" output = """ generics_self_basic.py:20: error: Incompatible return value type (got "Shape", expected "Self") [return-value] generics_self_basic.py:33: error: Incompatible return value type (got "Shape", expected "Self") [return-value] -generics_self_basic.py:67: error: Self type cannot have type arguments [misc] +generics_self_basic.py:68: error: Self type cannot have type arguments [misc] """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/mypy/generics_self_usage.toml b/conformance/results/mypy/generics_self_usage.toml index 32b70b844..b13852536 100644 --- a/conformance/results/mypy/generics_self_usage.toml +++ b/conformance/results/mypy/generics_self_usage.toml @@ -5,17 +5,17 @@ generics_self_usage.py:76: error: Self type is only allowed in annotations withi generics_self_usage.py:82: error: Method cannot have explicit self annotation and Self type [misc] generics_self_usage.py:82: error: A function returning TypeVar should receive at least one argument containing the same TypeVar [type-var] generics_self_usage.py:82: note: Consider using the upper bound "Foo2" instead -generics_self_usage.py:86: error: Incompatible return value type (got "Foo3", expected "Self") [return-value] -generics_self_usage.py:101: error: Self type is only allowed in annotations within class definition [misc] +generics_self_usage.py:87: error: Incompatible return value type (got "Foo3", expected "Self") [return-value] generics_self_usage.py:103: error: Self type is only allowed in annotations within class definition [misc] -generics_self_usage.py:106: error: Self type is only allowed in annotations within class definition [misc] -generics_self_usage.py:106: error: Self type cannot be used in type alias target [misc] -generics_self_usage.py:111: error: Static methods cannot use Self type [misc] -generics_self_usage.py:111: error: A function returning TypeVar should receive at least one argument containing the same TypeVar [type-var] -generics_self_usage.py:111: note: Consider using the upper bound "Base" instead -generics_self_usage.py:116: error: Static methods cannot use Self type [misc] -generics_self_usage.py:121: error: Self type cannot be used in a metaclass [misc] -generics_self_usage.py:125: error: Self type cannot be used in a metaclass [misc] +generics_self_usage.py:105: error: Self type is only allowed in annotations within class definition [misc] +generics_self_usage.py:108: error: Self type is only allowed in annotations within class definition [misc] +generics_self_usage.py:108: error: Self type cannot be used in type alias target [misc] +generics_self_usage.py:113: error: Static methods cannot use Self type [misc] +generics_self_usage.py:113: error: A function returning TypeVar should receive at least one argument containing the same TypeVar [type-var] +generics_self_usage.py:113: note: Consider using the upper bound "Base" instead +generics_self_usage.py:118: error: Static methods cannot use Self type [misc] +generics_self_usage.py:123: error: Self type cannot be used in a metaclass [misc] +generics_self_usage.py:127: error: Self type cannot be used in a metaclass [misc] """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/mypy/overloads_definitions.toml b/conformance/results/mypy/overloads_definitions.toml index 82730d4f1..80b29a62f 100644 --- a/conformance/results/mypy/overloads_definitions.toml +++ b/conformance/results/mypy/overloads_definitions.toml @@ -4,7 +4,7 @@ notes = """ Allows @override to be on all overloads and implementation, instead of just implementation. """ errors_diff = """ -Lines 220, 221, 222, 225, 226: Expected error (tag 'override_impl') +Lines 226, 227, 228, 231, 232: Expected error (tag 'override_impl') """ output = """ overloads_definitions.py:15: error: Single overload definition, multiple required [misc] @@ -12,8 +12,8 @@ overloads_definitions.py:27: error: An overloaded function outside a stub file m overloads_definitions.py:58: error: An overloaded function outside a stub file must have an implementation [no-overload-impl] overloads_definitions.py:71: error: Overload does not consistently use the "@staticmethod" decorator on all function signatures. [misc] overloads_definitions.py:84: error: Overload does not consistently use the "@classmethod" decorator on all function signatures. [misc] -overloads_definitions.py:121: error: @final should be applied only to overload implementation [misc] -overloads_definitions.py:135: error: @final should be applied only to overload implementation [misc] -overloads_definitions.py:175: error: Cannot override final attribute "final_method" (previously declared in base class "Base") [misc] -overloads_definitions.py:190: error: Method "bad_override" is marked as an override, but no base method was found with this name [misc] +overloads_definitions.py:122: error: @final should be applied only to overload implementation [misc] +overloads_definitions.py:137: error: @final should be applied only to overload implementation [misc] +overloads_definitions.py:180: error: Cannot override final attribute "final_method" (previously declared in base class "Base") [misc] +overloads_definitions.py:195: error: Method "bad_override" is marked as an override, but no base method was found with this name [misc] """ diff --git a/conformance/results/mypy/overloads_evaluation.toml b/conformance/results/mypy/overloads_evaluation.toml index 91b04235c..4ddeaca2d 100644 --- a/conformance/results/mypy/overloads_evaluation.toml +++ b/conformance/results/mypy/overloads_evaluation.toml @@ -8,16 +8,16 @@ Evaluates Any in some cases where overload is not ambiguous. """ conformance_automated = "Fail" errors_diff = """ -Line 134: Unexpected errors ['overloads_evaluation.py:134: error: No overload variant of "expand_bool" matches argument type "bool" [call-overload]'] -Line 135: Unexpected errors ['overloads_evaluation.py:135: error: Expression is of type "Any", not "Literal[0, 1]" [assert-type]'] -Line 160: Unexpected errors ['overloads_evaluation.py:160: error: No overload variant of "expand_enum" matches argument type "Color" [call-overload]'] -Line 161: Unexpected errors ['overloads_evaluation.py:161: error: Expression is of type "Any", not "Literal[0, 1]" [assert-type]'] -Line 204: Unexpected errors ['overloads_evaluation.py:204: error: Argument 1 to "expand_tuple" has incompatible type "tuple[int, int | str]"; expected "tuple[int, int]" [arg-type]'] -Line 205: Unexpected errors ['overloads_evaluation.py:205: error: Expression is of type "int", not "int | str" [assert-type]'] -Line 264: Unexpected errors ['overloads_evaluation.py:264: error: Expression is of type "list[Any]", not "Any" [assert-type]'] -Line 280: Unexpected errors ['overloads_evaluation.py:280: error: Expression is of type "list[Any]", not "Any" [assert-type]'] -Line 301: Unexpected errors ['overloads_evaluation.py:301: error: Expression is of type "Any", not "float" [assert-type]'] -Line 345: Unexpected errors ['overloads_evaluation.py:345: error: Expression is of type "list[Any]", not "Any" [assert-type]'] +Line 135: Unexpected errors ['overloads_evaluation.py:135: error: No overload variant of "expand_bool" matches argument type "bool" [call-overload]'] +Line 136: Unexpected errors ['overloads_evaluation.py:136: error: Expression is of type "Any", not "Literal[0, 1]" [assert-type]'] +Line 161: Unexpected errors ['overloads_evaluation.py:161: error: No overload variant of "expand_enum" matches argument type "Color" [call-overload]'] +Line 162: Unexpected errors ['overloads_evaluation.py:162: error: Expression is of type "Any", not "Literal[0, 1]" [assert-type]'] +Line 205: Unexpected errors ['overloads_evaluation.py:205: error: Argument 1 to "expand_tuple" has incompatible type "tuple[int, int | str]"; expected "tuple[int, int]" [arg-type]'] +Line 206: Unexpected errors ['overloads_evaluation.py:206: error: Expression is of type "int", not "int | str" [assert-type]'] +Line 265: Unexpected errors ['overloads_evaluation.py:265: error: Expression is of type "list[Any]", not "Any" [assert-type]'] +Line 281: Unexpected errors ['overloads_evaluation.py:281: error: Expression is of type "list[Any]", not "Any" [assert-type]'] +Line 303: Unexpected errors ['overloads_evaluation.py:303: error: Expression is of type "Any", not "float" [assert-type]'] +Line 347: Unexpected errors ['overloads_evaluation.py:347: error: Expression is of type "list[Any]", not "Any" [assert-type]'] """ output = """ overloads_evaluation.py:38: error: All overload variants of "example1_1" require at least one argument [call-overload] @@ -32,22 +32,22 @@ overloads_evaluation.py:51: error: No overload variant of "example1_1" matches a overloads_evaluation.py:51: note: Possible overload variants: overloads_evaluation.py:51: note: def example1_1(x: int, y: str) -> int overloads_evaluation.py:51: note: def example1_1(x: str) -> str -overloads_evaluation.py:115: error: Argument 1 to "example2" has incompatible type "int | str"; expected "int" [arg-type] -overloads_evaluation.py:115: error: Argument 2 to "example2" has incompatible type "int | str"; expected "str" [arg-type] -overloads_evaluation.py:134: error: No overload variant of "expand_bool" matches argument type "bool" [call-overload] -overloads_evaluation.py:134: note: Possible overload variants: -overloads_evaluation.py:134: note: def expand_bool(x: Literal[False]) -> Literal[0] -overloads_evaluation.py:134: note: def expand_bool(x: Literal[True]) -> Literal[1] -overloads_evaluation.py:135: error: Expression is of type "Any", not "Literal[0, 1]" [assert-type] -overloads_evaluation.py:160: error: No overload variant of "expand_enum" matches argument type "Color" [call-overload] -overloads_evaluation.py:160: note: Possible overload variants: -overloads_evaluation.py:160: note: def expand_enum(x: Literal[Color.RED]) -> Literal[0] -overloads_evaluation.py:160: note: def expand_enum(x: Literal[Color.BLUE]) -> Literal[1] -overloads_evaluation.py:161: error: Expression is of type "Any", not "Literal[0, 1]" [assert-type] -overloads_evaluation.py:204: error: Argument 1 to "expand_tuple" has incompatible type "tuple[int, int | str]"; expected "tuple[int, int]" [arg-type] -overloads_evaluation.py:205: error: Expression is of type "int", not "int | str" [assert-type] -overloads_evaluation.py:264: error: Expression is of type "list[Any]", not "Any" [assert-type] -overloads_evaluation.py:280: error: Expression is of type "list[Any]", not "Any" [assert-type] -overloads_evaluation.py:301: error: Expression is of type "Any", not "float" [assert-type] -overloads_evaluation.py:345: error: Expression is of type "list[Any]", not "Any" [assert-type] +overloads_evaluation.py:116: error: Argument 1 to "example2" has incompatible type "int | str"; expected "int" [arg-type] +overloads_evaluation.py:116: error: Argument 2 to "example2" has incompatible type "int | str"; expected "str" [arg-type] +overloads_evaluation.py:135: error: No overload variant of "expand_bool" matches argument type "bool" [call-overload] +overloads_evaluation.py:135: note: Possible overload variants: +overloads_evaluation.py:135: note: def expand_bool(x: Literal[False]) -> Literal[0] +overloads_evaluation.py:135: note: def expand_bool(x: Literal[True]) -> Literal[1] +overloads_evaluation.py:136: error: Expression is of type "Any", not "Literal[0, 1]" [assert-type] +overloads_evaluation.py:161: error: No overload variant of "expand_enum" matches argument type "Color" [call-overload] +overloads_evaluation.py:161: note: Possible overload variants: +overloads_evaluation.py:161: note: def expand_enum(x: Literal[Color.RED]) -> Literal[0] +overloads_evaluation.py:161: note: def expand_enum(x: Literal[Color.BLUE]) -> Literal[1] +overloads_evaluation.py:162: error: Expression is of type "Any", not "Literal[0, 1]" [assert-type] +overloads_evaluation.py:205: error: Argument 1 to "expand_tuple" has incompatible type "tuple[int, int | str]"; expected "tuple[int, int]" [arg-type] +overloads_evaluation.py:206: error: Expression is of type "int", not "int | str" [assert-type] +overloads_evaluation.py:265: error: Expression is of type "list[Any]", not "Any" [assert-type] +overloads_evaluation.py:281: error: Expression is of type "list[Any]", not "Any" [assert-type] +overloads_evaluation.py:303: error: Expression is of type "Any", not "float" [assert-type] +overloads_evaluation.py:347: error: Expression is of type "list[Any]", not "Any" [assert-type] """ diff --git a/conformance/results/pyrefly/constructors_call_new.toml b/conformance/results/pyrefly/constructors_call_new.toml index 690a72138..edef6e5e5 100644 --- a/conformance/results/pyrefly/constructors_call_new.toml +++ b/conformance/results/pyrefly/constructors_call_new.toml @@ -4,5 +4,5 @@ errors_diff = """ """ output = """ ERROR constructors_call_new.py:21:13-16: Argument `float` is not assignable to parameter `x` with type `int` in function `Class1.__new__` [bad-argument-type] -ERROR constructors_call_new.py:145:13-15: Argument `type[Class11[str]]` is not assignable to parameter `cls` with type `type[Class11[int]]` in function `Class11.__new__` [bad-argument-type] +ERROR constructors_call_new.py:148:13-15: Argument `type[Class11[str]]` is not assignable to parameter `cls` with type `type[Class11[int]]` in function `Class11.__new__` [bad-argument-type] """ diff --git a/conformance/results/pyrefly/constructors_callable.toml b/conformance/results/pyrefly/constructors_callable.toml index bbfb662d8..d3200470d 100644 --- a/conformance/results/pyrefly/constructors_callable.toml +++ b/conformance/results/pyrefly/constructors_callable.toml @@ -6,29 +6,29 @@ Converting constructor to callable uses __new__ signature instead of __init__ """ conformance_automated = "Fail" errors_diff = """ -Line 65: Expected 1 errors Line 66: Expected 1 errors Line 67: Expected 1 errors -Line 184: Expected 1 errors -Line 195: Expected 1 errors -Line 62: Unexpected errors ['Argument `type[Class3]` is not assignable to parameter `cb` with type `(*args: Unknown, **kwargs: Unknown) -> Class3` in function `accepts_callable` [bad-argument-type]'] -Line 164: Unexpected errors ['assert_type(Class7[Any], Class7[int]) failed [assert-type]'] -Line 165: Unexpected errors ['assert_type(Class7[Any], Class7[str]) failed [assert-type]', "Argument `Literal['']` is not assignable to parameter `x` with type `int` [bad-argument-type]"] -Line 183: Unexpected errors ['assert_type(Class8[Any], Class8[str]) failed [assert-type]'] +Line 68: Expected 1 errors +Line 186: Expected 1 errors +Line 197: Expected 1 errors +Line 63: Unexpected errors ['Argument `type[Class3]` is not assignable to parameter `cb` with type `(*args: Unknown, **kwargs: Unknown) -> Class3` in function `accepts_callable` [bad-argument-type]'] +Line 166: Unexpected errors ['assert_type(Class7[Any], Class7[int]) failed [assert-type]'] +Line 167: Unexpected errors ['assert_type(Class7[Any], Class7[str]) failed [assert-type]', "Argument `Literal['']` is not assignable to parameter `x` with type `int` [bad-argument-type]"] +Line 185: Unexpected errors ['assert_type(Class8[Any], Class8[str]) failed [assert-type]'] """ output = """ ERROR constructors_callable.py:38:3-5: Missing argument `x` [missing-argument] ERROR constructors_callable.py:39:3-8: Missing argument `x` [missing-argument] ERROR constructors_callable.py:39:4-5: Unexpected keyword argument `y` [unexpected-keyword] ERROR constructors_callable.py:51:4-5: Expected 0 positional arguments, got 1 [bad-argument-count] -ERROR constructors_callable.py:62:23-29: Argument `type[Class3]` is not assignable to parameter `cb` with type `(*args: Unknown, **kwargs: Unknown) -> Class3` in function `accepts_callable` [bad-argument-type] -ERROR constructors_callable.py:79:3-5: Missing argument `x` [missing-argument] -ERROR constructors_callable.py:80:3-8: Missing argument `x` [missing-argument] -ERROR constructors_callable.py:80:4-5: Unexpected keyword argument `y` [unexpected-keyword] -ERROR constructors_callable.py:127:4-5: Expected 0 positional arguments, got 1 [bad-argument-count] -ERROR constructors_callable.py:144:8-9: Expected 0 positional arguments, got 1 [bad-argument-count] -ERROR constructors_callable.py:164:12-32: assert_type(Class7[Any], Class7[int]) failed [assert-type] -ERROR constructors_callable.py:165:12-33: assert_type(Class7[Any], Class7[str]) failed [assert-type] -ERROR constructors_callable.py:165:16-18: Argument `Literal['']` is not assignable to parameter `x` with type `int` [bad-argument-type] -ERROR constructors_callable.py:183:12-41: assert_type(Class8[Any], Class8[str]) failed [assert-type] +ERROR constructors_callable.py:63:23-29: Argument `type[Class3]` is not assignable to parameter `cb` with type `(*args: Unknown, **kwargs: Unknown) -> Class3` in function `accepts_callable` [bad-argument-type] +ERROR constructors_callable.py:81:3-5: Missing argument `x` [missing-argument] +ERROR constructors_callable.py:82:3-8: Missing argument `x` [missing-argument] +ERROR constructors_callable.py:82:4-5: Unexpected keyword argument `y` [unexpected-keyword] +ERROR constructors_callable.py:129:4-5: Expected 0 positional arguments, got 1 [bad-argument-count] +ERROR constructors_callable.py:146:8-9: Expected 0 positional arguments, got 1 [bad-argument-count] +ERROR constructors_callable.py:166:12-32: assert_type(Class7[Any], Class7[int]) failed [assert-type] +ERROR constructors_callable.py:167:12-33: assert_type(Class7[Any], Class7[str]) failed [assert-type] +ERROR constructors_callable.py:167:16-18: Argument `Literal['']` is not assignable to parameter `x` with type `int` [bad-argument-type] +ERROR constructors_callable.py:185:12-41: assert_type(Class8[Any], Class8[str]) failed [assert-type] """ diff --git a/conformance/results/pyrefly/generics_defaults.toml b/conformance/results/pyrefly/generics_defaults.toml index 2bef89638..8589ad527 100644 --- a/conformance/results/pyrefly/generics_defaults.toml +++ b/conformance/results/pyrefly/generics_defaults.toml @@ -4,14 +4,14 @@ Defaults are not bound by attribute access """ conformance_automated = "Fail" errors_diff = """ -Line 170: Unexpected errors ['assert_type([DefaultIntT](Foo7[DefaultIntT]) -> Foo7[DefaultIntT], (Foo7[int]) -> Foo7[int]) failed [assert-type]'] +Line 171: Unexpected errors ['assert_type([DefaultIntT](Foo7[DefaultIntT]) -> Foo7[DefaultIntT], (Foo7[int]) -> Foo7[int]) failed [assert-type]'] """ output = """ ERROR generics_defaults.py:24:7-31: Type parameter `T` without a default cannot follow type parameter `DefaultStrT` with a default [invalid-type-var] ERROR generics_defaults.py:50:1-20: Expected 5 type arguments for `AllTheDefaults`, got 1 [bad-specialization] ERROR generics_defaults.py:107:51-54: Expected default `int` of `Invalid1` to be assignable to the upper bound of `str` [invalid-type-var] ERROR generics_defaults.py:114:52-55: Expected default `int` of `Invalid2` to be one of the following constraints: `float`, `str` [invalid-type-var] -ERROR generics_defaults.py:131:12-27: assert_type(int, Any) failed [assert-type] -ERROR generics_defaults.py:142:7-11: TypeVar `T5` with a default cannot follow TypeVarTuple `Ts` [invalid-type-var] -ERROR generics_defaults.py:170:12-57: assert_type([DefaultIntT](Foo7[DefaultIntT]) -> Foo7[DefaultIntT], (Foo7[int]) -> Foo7[int]) failed [assert-type] +ERROR generics_defaults.py:132:12-27: assert_type(int, Any) failed [assert-type] +ERROR generics_defaults.py:143:7-11: TypeVar `T5` with a default cannot follow TypeVarTuple `Ts` [invalid-type-var] +ERROR generics_defaults.py:171:12-57: assert_type([DefaultIntT](Foo7[DefaultIntT]) -> Foo7[DefaultIntT], (Foo7[int]) -> Foo7[int]) failed [assert-type] """ diff --git a/conformance/results/pyrefly/generics_self_basic.toml b/conformance/results/pyrefly/generics_self_basic.toml index 0e72344d0..7f9b03ea6 100644 --- a/conformance/results/pyrefly/generics_self_basic.toml +++ b/conformance/results/pyrefly/generics_self_basic.toml @@ -8,5 +8,5 @@ Line 20: Expected 1 errors Line 33: Expected 1 errors """ output = """ -ERROR generics_self_basic.py:67:26-35: `type[Self@Container]` is not subscriptable [unsupported-operation] +ERROR generics_self_basic.py:68:26-35: `type[Self@Container]` is not subscriptable [unsupported-operation] """ diff --git a/conformance/results/pyrefly/generics_self_usage.toml b/conformance/results/pyrefly/generics_self_usage.toml index 44c8b5605..fc359e784 100644 --- a/conformance/results/pyrefly/generics_self_usage.toml +++ b/conformance/results/pyrefly/generics_self_usage.toml @@ -7,14 +7,14 @@ errors_diff = """ Line 73: Expected 1 errors Line 76: Expected 1 errors Line 82: Expected 1 errors -Line 86: Expected 1 errors -Line 101: Expected 1 errors -Line 106: Expected 1 errors -Line 111: Expected 1 errors -Line 116: Expected 1 errors -Line 121: Expected 1 errors -Line 125: Expected 1 errors +Line 87: Expected 1 errors +Line 103: Expected 1 errors +Line 108: Expected 1 errors +Line 113: Expected 1 errors +Line 118: Expected 1 errors +Line 123: Expected 1 errors +Line 127: Expected 1 errors """ output = """ -ERROR generics_self_usage.py:103:12-16: Invalid base class: `Self` [invalid-inheritance] +ERROR generics_self_usage.py:105:12-16: Invalid base class: `Self` [invalid-inheritance] """ diff --git a/conformance/results/pyrefly/overloads_definitions.toml b/conformance/results/pyrefly/overloads_definitions.toml index 6894d7606..4c793b5c4 100644 --- a/conformance/results/pyrefly/overloads_definitions.toml +++ b/conformance/results/pyrefly/overloads_definitions.toml @@ -8,11 +8,11 @@ ERROR overloads_definitions.py:59:9-21: Overloaded function must have an impleme ERROR overloads_definitions.py:81:9-14: If `@staticmethod` is present on any overload or the implementation, it should be on every overload and the implementation. [invalid-overload] ERROR overloads_definitions.py:90:9-14: If `@classmethod` is present on any overload or the implementation, it should be on every overload and the implementation. [invalid-overload] ERROR overloads_definitions.py:90:9-14: Implementation signature `(cls: type[Self@C], *args: int | str) -> int | str` does not accept all arguments that overload signature `(self: Self@C, x: str, /) -> str` accepts [inconsistent-overload] -ERROR overloads_definitions.py:123:9-22: `@final` should only be applied to the implementation of an overloaded function. [invalid-overload] -ERROR overloads_definitions.py:137:9-24: `@final` should only be applied to the implementation of an overloaded function. [invalid-overload] -ERROR overloads_definitions.py:142:9-24: `@final` should only be applied to the implementation of an overloaded function. [invalid-overload] -ERROR overloads_definitions.py:176:9-21: `final_method` is declared as final in parent class `Base` [bad-override] -ERROR overloads_definitions.py:191:9-21: Class member `Child.bad_override` is marked as an override, but no parent class has a matching attribute [bad-override] -ERROR overloads_definitions.py:222:9-20: `@override` should only be applied to the implementation of an overloaded function. [invalid-overload] -ERROR overloads_definitions.py:226:9-20: `@override` should only be applied to the implementation of an overloaded function. [invalid-overload] +ERROR overloads_definitions.py:124:9-22: `@final` should only be applied to the implementation of an overloaded function. [invalid-overload] +ERROR overloads_definitions.py:139:9-24: `@final` should only be applied to the implementation of an overloaded function. [invalid-overload] +ERROR overloads_definitions.py:144:9-24: `@final` should only be applied to the implementation of an overloaded function. [invalid-overload] +ERROR overloads_definitions.py:181:9-21: `final_method` is declared as final in parent class `Base` [bad-override] +ERROR overloads_definitions.py:196:9-21: Class member `Child.bad_override` is marked as an override, but no parent class has a matching attribute [bad-override] +ERROR overloads_definitions.py:228:9-20: `@override` should only be applied to the implementation of an overloaded function. [invalid-overload] +ERROR overloads_definitions.py:232:9-20: `@override` should only be applied to the implementation of an overloaded function. [invalid-overload] """ diff --git a/conformance/results/pyrefly/overloads_evaluation.toml b/conformance/results/pyrefly/overloads_evaluation.toml index c1431c340..46549b266 100644 --- a/conformance/results/pyrefly/overloads_evaluation.toml +++ b/conformance/results/pyrefly/overloads_evaluation.toml @@ -5,5 +5,5 @@ output = """ ERROR overloads_evaluation.py:38:11-13: No matching overload found for function `example1_1` called with arguments: () [no-matching-overload] ERROR overloads_evaluation.py:46:11-17: No matching overload found for function `example1_1` called with arguments: (Literal[1], Literal[1]) [no-matching-overload] ERROR overloads_evaluation.py:51:11-14: No matching overload found for function `example1_1` called with arguments: (Literal[1]) [no-matching-overload] -ERROR overloads_evaluation.py:115:13-22: No matching overload found for function `example2` called with arguments: (int | str, int | str, Literal[1]) [no-matching-overload] +ERROR overloads_evaluation.py:116:13-22: No matching overload found for function `example2` called with arguments: (int | str, int | str, Literal[1]) [no-matching-overload] """ diff --git a/conformance/results/pyright/constructors_call_new.toml b/conformance/results/pyright/constructors_call_new.toml index 1585d37d1..e2387d4fc 100644 --- a/conformance/results/pyright/constructors_call_new.toml +++ b/conformance/results/pyright/constructors_call_new.toml @@ -4,7 +4,7 @@ errors_diff = """ output = """ constructors_call_new.py:21:13 - error: Argument of type "float" cannot be assigned to parameter "x" of type "int" in function "__new__"   "float" is not assignable to "int" (reportArgumentType) -constructors_call_new.py:145:1 - error: +constructors_call_new.py:148:1 - error:   Could not bind method "__new__" because "type[Class11[str]]" is not assignable to parameter "cls"     "type[Class11[str]]" is not assignable to "type[Class11[int]]"     Type "type[Class11[str]]" is not assignable to type "type[Class11[int]]" diff --git a/conformance/results/pyright/constructors_callable.toml b/conformance/results/pyright/constructors_callable.toml index 708e4555b..4a9c41d59 100644 --- a/conformance/results/pyright/constructors_callable.toml +++ b/conformance/results/pyright/constructors_callable.toml @@ -9,25 +9,25 @@ constructors_callable.py:39:1 - error: Argument missing for parameter "x" (repor constructors_callable.py:39:4 - error: No parameter named "y" (reportCallIssue) constructors_callable.py:49:13 - information: Type of "r2" is "() -> Class2" constructors_callable.py:51:4 - error: Expected 0 positional arguments (reportCallIssue) -constructors_callable.py:63:13 - information: Type of "r3" is "(x: int) -> Class3" -constructors_callable.py:65:1 - error: Argument missing for parameter "x" (reportCallIssue) +constructors_callable.py:64:13 - information: Type of "r3" is "(x: int) -> Class3" constructors_callable.py:66:1 - error: Argument missing for parameter "x" (reportCallIssue) -constructors_callable.py:66:4 - error: No parameter named "y" (reportCallIssue) -constructors_callable.py:67:7 - error: Expected 1 positional argument (reportCallIssue) -constructors_callable.py:77:13 - information: Type of "r4" is "(x: int) -> int" -constructors_callable.py:79:1 - error: Argument missing for parameter "x" (reportCallIssue) -constructors_callable.py:80:1 - error: Argument missing for parameter "x" (reportCallIssue) -constructors_callable.py:80:4 - error: No parameter named "y" (reportCallIssue) -constructors_callable.py:97:13 - information: Type of "r5" is "(...) -> NoReturn" -constructors_callable.py:125:13 - information: Type of "r6" is "() -> Class6Proxy" -constructors_callable.py:127:4 - error: Expected 0 positional arguments (reportCallIssue) -constructors_callable.py:142:13 - information: Type of "r6_any" is "() -> Any" -constructors_callable.py:144:8 - error: Expected 0 positional arguments (reportCallIssue) -constructors_callable.py:162:5 - information: Type of "r7" is "Overload[(x: int) -> Class7[int], (x: str) -> Class7[str]]" -constructors_callable.py:182:13 - information: Type of "r8" is "(x: list[T@Class8], y: list[T@Class8]) -> Class8[T@Class8]" -constructors_callable.py:184:10 - error: Argument of type "list[str]" cannot be assigned to parameter "y" of type "list[T@Class8]" +constructors_callable.py:67:1 - error: Argument missing for parameter "x" (reportCallIssue) +constructors_callable.py:67:4 - error: No parameter named "y" (reportCallIssue) +constructors_callable.py:68:7 - error: Expected 1 positional argument (reportCallIssue) +constructors_callable.py:79:13 - information: Type of "r4" is "(x: int) -> int" +constructors_callable.py:81:1 - error: Argument missing for parameter "x" (reportCallIssue) +constructors_callable.py:82:1 - error: Argument missing for parameter "x" (reportCallIssue) +constructors_callable.py:82:4 - error: No parameter named "y" (reportCallIssue) +constructors_callable.py:99:13 - information: Type of "r5" is "(...) -> NoReturn" +constructors_callable.py:127:13 - information: Type of "r6" is "() -> Class6Proxy" +constructors_callable.py:129:4 - error: Expected 0 positional arguments (reportCallIssue) +constructors_callable.py:144:13 - information: Type of "r6_any" is "() -> Any" +constructors_callable.py:146:8 - error: Expected 0 positional arguments (reportCallIssue) +constructors_callable.py:164:5 - information: Type of "r7" is "Overload[(x: int) -> Class7[int], (x: str) -> Class7[str]]" +constructors_callable.py:184:13 - information: Type of "r8" is "(x: list[T@Class8], y: list[T@Class8]) -> Class8[T@Class8]" +constructors_callable.py:186:10 - error: Argument of type "list[str]" cannot be assigned to parameter "y" of type "list[T@Class8]"   "Literal['']" is not assignable to "int" (reportArgumentType) -constructors_callable.py:193:13 - information: Type of "r9" is "(x: list[T@__init__], y: list[T@__init__]) -> Class9" -constructors_callable.py:195:10 - error: Argument of type "list[str]" cannot be assigned to parameter "y" of type "list[T@__init__]" +constructors_callable.py:195:13 - information: Type of "r9" is "(x: list[T@__init__], y: list[T@__init__]) -> Class9" +constructors_callable.py:197:10 - error: Argument of type "list[str]" cannot be assigned to parameter "y" of type "list[T@__init__]"   "Literal['']" is not assignable to "int" (reportArgumentType) """ diff --git a/conformance/results/pyright/generics_defaults.toml b/conformance/results/pyright/generics_defaults.toml index 55f1dd651..35fdac0ce 100644 --- a/conformance/results/pyright/generics_defaults.toml +++ b/conformance/results/pyright/generics_defaults.toml @@ -4,8 +4,8 @@ generics_defaults.py:24:7 - error: "T" cannot appear after "DefaultStrT" in type generics_defaults.py:50:16 - error: Too few type arguments provided for "AllTheDefaults"; expected 2 but received 1 (reportInvalidTypeArguments) generics_defaults.py:107:51 - error: TypeVar default type must be a subtype of the bound type (reportGeneralTypeIssues) generics_defaults.py:114:52 - error: TypeVar default type must be one of the constrained types (reportGeneralTypeIssues) -generics_defaults.py:131:13 - error: "assert_type" mismatch: expected "Any" but received "int" (reportAssertTypeFailure) -generics_defaults.py:142:7 - error: TypeVar "T5" has a default value and cannot follow TypeVarTuple "Ts" (reportGeneralTypeIssues) +generics_defaults.py:132:13 - error: "assert_type" mismatch: expected "Any" but received "int" (reportAssertTypeFailure) +generics_defaults.py:143:7 - error: TypeVar "T5" has a default value and cannot follow TypeVarTuple "Ts" (reportGeneralTypeIssues) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/generics_self_basic.toml b/conformance/results/pyright/generics_self_basic.toml index 6ce2caef1..6b1dc6c56 100644 --- a/conformance/results/pyright/generics_self_basic.toml +++ b/conformance/results/pyright/generics_self_basic.toml @@ -4,7 +4,7 @@ generics_self_basic.py:20:16 - error: Type "Shape" is not assignable to return t   Type "Shape" is not assignable to type "Self@Shape" (reportReturnType) generics_self_basic.py:33:16 - error: Type "Shape" is not assignable to return type "Self@Shape"   Type "Shape" is not assignable to type "Self@Shape" (reportReturnType) -generics_self_basic.py:67:31 - error: Expected no type arguments for class "Self" (reportInvalidTypeArguments) +generics_self_basic.py:68:31 - error: Expected no type arguments for class "Self" (reportInvalidTypeArguments) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/generics_self_usage.toml b/conformance/results/pyright/generics_self_usage.toml index 95f5ac1a0..b3b609619 100644 --- a/conformance/results/pyright/generics_self_usage.toml +++ b/conformance/results/pyright/generics_self_usage.toml @@ -6,16 +6,16 @@ generics_self_usage.py:76:6 - error: "Self" is not valid in this context (report generics_self_usage.py:82:44 - warning: TypeVar "TFoo2" appears only once in generic function signature   Use "Foo2" instead (reportInvalidTypeVarUse) generics_self_usage.py:82:54 - error: "Self" cannot be used in a function with a `self` or `cls` parameter that has a type annotation other than "Self" (reportGeneralTypeIssues) -generics_self_usage.py:86:16 - error: Type "Foo3" is not assignable to return type "Self@Foo3" +generics_self_usage.py:87:16 - error: Type "Foo3" is not assignable to return type "Self@Foo3"   Type "Foo3" is not assignable to type "Self@Foo3" (reportReturnType) -generics_self_usage.py:101:15 - error: "Self" is not valid in this context (reportGeneralTypeIssues) -generics_self_usage.py:103:12 - error: "Self" is not valid in this context (reportGeneralTypeIssues) -generics_self_usage.py:106:30 - error: "Self" is not valid in this context (reportGeneralTypeIssues) -generics_self_usage.py:111:19 - error: "Self" is not valid in this context (reportGeneralTypeIssues) -generics_self_usage.py:116:31 - error: "Self" is not valid in this context (reportGeneralTypeIssues) -generics_self_usage.py:116:40 - error: "Self" is not valid in this context (reportGeneralTypeIssues) -generics_self_usage.py:121:37 - error: "Self" cannot be used within a metaclass (a subclass of "type") (reportGeneralTypeIssues) -generics_self_usage.py:125:42 - error: "Self" cannot be used within a metaclass (a subclass of "type") (reportGeneralTypeIssues) +generics_self_usage.py:103:15 - error: "Self" is not valid in this context (reportGeneralTypeIssues) +generics_self_usage.py:105:12 - error: "Self" is not valid in this context (reportGeneralTypeIssues) +generics_self_usage.py:108:30 - error: "Self" is not valid in this context (reportGeneralTypeIssues) +generics_self_usage.py:113:19 - error: "Self" is not valid in this context (reportGeneralTypeIssues) +generics_self_usage.py:118:31 - error: "Self" is not valid in this context (reportGeneralTypeIssues) +generics_self_usage.py:118:40 - error: "Self" is not valid in this context (reportGeneralTypeIssues) +generics_self_usage.py:123:37 - error: "Self" cannot be used within a metaclass (a subclass of "type") (reportGeneralTypeIssues) +generics_self_usage.py:127:42 - error: "Self" cannot be used within a metaclass (a subclass of "type") (reportGeneralTypeIssues) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/overloads_definitions.toml b/conformance/results/pyright/overloads_definitions.toml index f7b17e782..e6118e2a3 100644 --- a/conformance/results/pyright/overloads_definitions.toml +++ b/conformance/results/pyright/overloads_definitions.toml @@ -8,11 +8,11 @@ overloads_definitions.py:28:5 - error: "func2" is marked as overload, but no imp overloads_definitions.py:59:9 - error: "not_abstract" is marked as overload, but no implementation is provided (reportNoOverloadImplementation) overloads_definitions.py:73:9 - error: Overloads for "func5" use @staticmethod inconsistently (reportInconsistentOverload) overloads_definitions.py:86:9 - error: Overloads for "func6" use @classmethod inconsistently (reportInconsistentOverload) -overloads_definitions.py:123:9 - error: @final decorator should be applied only to the implementation (reportInconsistentOverload) -overloads_definitions.py:137:9 - error: @final decorator should be applied only to the implementation (reportInconsistentOverload) -overloads_definitions.py:142:9 - error: @final decorator should be applied only to the implementation (reportInconsistentOverload) -overloads_definitions.py:181:9 - error: Method "final_method" cannot override final method defined in class "Base" (reportIncompatibleMethodOverride) -overloads_definitions.py:198:9 - error: Method "bad_override" is marked as override, but no base method of same name is present (reportGeneralTypeIssues) -overloads_definitions.py:222:9 - error: @override decorator should be applied only to the implementation (reportInconsistentOverload) -overloads_definitions.py:226:9 - error: @override decorator should be applied only to the implementation (reportInconsistentOverload) +overloads_definitions.py:124:9 - error: @final decorator should be applied only to the implementation (reportInconsistentOverload) +overloads_definitions.py:139:9 - error: @final decorator should be applied only to the implementation (reportInconsistentOverload) +overloads_definitions.py:144:9 - error: @final decorator should be applied only to the implementation (reportInconsistentOverload) +overloads_definitions.py:186:9 - error: Method "final_method" cannot override final method defined in class "Base" (reportIncompatibleMethodOverride) +overloads_definitions.py:203:9 - error: Method "bad_override" is marked as override, but no base method of same name is present (reportGeneralTypeIssues) +overloads_definitions.py:228:9 - error: @override decorator should be applied only to the implementation (reportInconsistentOverload) +overloads_definitions.py:232:9 - error: @override decorator should be applied only to the implementation (reportInconsistentOverload) """ diff --git a/conformance/results/pyright/overloads_evaluation.toml b/conformance/results/pyright/overloads_evaluation.toml index 7f7e0dce0..7b41dc4e1 100644 --- a/conformance/results/pyright/overloads_evaluation.toml +++ b/conformance/results/pyright/overloads_evaluation.toml @@ -4,7 +4,7 @@ Does not evaluate Any in some cases where overload is ambiguous. """ conformance_automated = "Fail" errors_diff = """ -Line 280: Unexpected errors ['overloads_evaluation.py:280:17 - error: "assert_type" mismatch: expected "Any" but received "list[int]" (reportAssertTypeFailure)'] +Line 281: Unexpected errors ['overloads_evaluation.py:281:17 - error: "assert_type" mismatch: expected "Any" but received "list[int]" (reportAssertTypeFailure)'] """ output = """ overloads_evaluation.py:38:1 - error: No overloads for "example1_1" match the provided arguments @@ -13,12 +13,12 @@ overloads_evaluation.py:46:15 - error: Argument of type "Literal[1]" cannot be a   "Literal[1]" is not assignable to "str" (reportArgumentType) overloads_evaluation.py:51:12 - error: Argument of type "Literal[1]" cannot be assigned to parameter "x" of type "str" in function "example1_1"   "Literal[1]" is not assignable to "str" (reportArgumentType) -overloads_evaluation.py:115:5 - error: No overloads for "example2" match the provided arguments (reportCallIssue) -overloads_evaluation.py:115:14 - error: Argument of type "int | str" cannot be assigned to parameter "x" of type "int" in function "example2" +overloads_evaluation.py:116:5 - error: No overloads for "example2" match the provided arguments (reportCallIssue) +overloads_evaluation.py:116:14 - error: Argument of type "int | str" cannot be assigned to parameter "x" of type "int" in function "example2"   Type "int | str" is not assignable to type "int"     "str" is not assignable to "int" (reportArgumentType) -overloads_evaluation.py:115:17 - error: Argument of type "int | str" cannot be assigned to parameter "y" of type "int" in function "example2" +overloads_evaluation.py:116:17 - error: Argument of type "int | str" cannot be assigned to parameter "y" of type "int" in function "example2"   Type "int | str" is not assignable to type "int"     "str" is not assignable to "int" (reportArgumentType) -overloads_evaluation.py:280:17 - error: "assert_type" mismatch: expected "Any" but received "list[int]" (reportAssertTypeFailure) +overloads_evaluation.py:281:17 - error: "assert_type" mismatch: expected "Any" but received "list[int]" (reportAssertTypeFailure) """ diff --git a/conformance/results/results.html b/conformance/results/results.html index 22ac1d68c..ec5fb5514 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -378,7 +378,7 @@

    Python Type System Conformance Test Results

    Pass Pass Pass
    Partial

    Fails to handle move_first_element_to_last example

    Pass
         generics_typevartuple_overloads Pass
    Partial

    Does not report unsafe overlap for runtime_checkable protocol.

    Pass
    Partial

    Does not report unsafe overlap for runtime_checkable protocol.

    Partial

    Does not check for unsafe overlap in runtime_checkable protocols

    Pass
         protocols_self Pass
         tuples_type_compat
    Partial

    Does not support tuple narrowing based on `len()` type guard (optional).

    Pass
    Partial

    Incorrectly marks a match case as unreachable.

    Pass Pass
         tuples_type_form
    - - - - + @@ -239,7 +239,7 @@

    Python Type System Conformance Test Results

    - + @@ -251,8 +251,8 @@

    Python Type System Conformance Test Results

    - - + + @@ -293,7 +293,7 @@

    Python Type System Conformance Test Results

    - + @@ -323,7 +323,7 @@

    Python Type System Conformance Test Results

    - + @@ -341,13 +341,13 @@

    Python Type System Conformance Test Results

    - + - + @@ -359,13 +359,13 @@

    Python Type System Conformance Test Results

    - + - + @@ -401,13 +401,13 @@

    Python Type System Conformance Test Results

    - + - + @@ -428,7 +428,7 @@

    Python Type System Conformance Test Results

    - + @@ -488,7 +488,7 @@

    Python Type System Conformance Test Results

    - + @@ -503,7 +503,7 @@

    Python Type System Conformance Test Results

    - + @@ -536,14 +536,14 @@

    Python Type System Conformance Test Results

    - + - + @@ -572,7 +572,7 @@

    Python Type System Conformance Test Results

    - + @@ -599,7 +599,7 @@

    Python Type System Conformance Test Results

    - + @@ -626,7 +626,7 @@

    Python Type System Conformance Test Results

    - + @@ -638,19 +638,19 @@

    Python Type System Conformance Test Results

    - + - + - + @@ -689,7 +689,7 @@

    Python Type System Conformance Test Results

    - + - + @@ -725,7 +725,7 @@

    Python Type System Conformance Test Results

    - + @@ -761,7 +761,7 @@

    Python Type System Conformance Test Results

    - + @@ -773,7 +773,7 @@

    Python Type System Conformance Test Results

    - + @@ -806,7 +806,7 @@

    Python Type System Conformance Test Results

    - + @@ -854,7 +854,7 @@

    Python Type System Conformance Test Results

    - + @@ -866,7 +866,7 @@

    Python Type System Conformance Test Results

    - + @@ -914,7 +914,7 @@

    Python Type System Conformance Test Results

    - + @@ -953,7 +953,7 @@

    Python Type System Conformance Test Results

    - + @@ -965,13 +965,13 @@

    Python Type System Conformance Test Results

    - + - + - +
     
    mypy 1.19.0
    +
    mypy 1.19.1
    pyright 1.1.407
    zuban 0.3.0
    +
    zuban 0.4.1
    pyrefly 0.45.2
    +
    pyrefly 0.46.1
    @@ -179,7 +179,7 @@

    Python Type System Conformance Test Results

         annotations_forward_refs
    Partial

    Does not report error for a forward reference that is not enclosed in quotes.

    Does not report error for use of quoted type with "|" operator (runtime error).

    Incorrectly generates error for quoted type defined in class scope.

    Pass
    Partial

    Does not report error for a forward reference that is not enclosed in quotes.

    Incorrectly generates error for quoted type defined in class scope.

    Does not ignore newlines in multi-line unions

    Partial

    Incorrectly generates error for quoted type defined in class scope.

    Partial

    Types in quotes incorrectly refer to shadowing class member.

    Does not reject some type forms that require quotes.

         annotations_generators
         generics_base_class
    Partial

    Does not detect inconsistent type variable ordering.

    Pass
    Partial

    Does not detect inconsistent type variable ordering in multi-inheritance.

    Pass
    Partial

    Does not reject inconsistent ordering of type variables in different base classes.

         generics_basic
         generics_defaults Partial Pass
    Partial

    Does not reject TypeVars with defaults after a TypeVarTuple

    Type parameter defaults are not bound by attribute access

    ParamSpec after TypeVarTuple is not always handled correctly

    Partial

    Defaults are not bound by attribute access

    PassPass
         generics_defaults_referential Partial
         generics_scoping Pass Pass
    Partial

    False negative on generic class nested within generic class with same type variable.

    Pass
    Partial

    Does not implement several scoping checks/restrictions for generics

         generics_self_advanced
         generics_self_usage Pass Pass
    Partial

    Does not detect invalid Self when Self is not properly bound

    Pass
    Partial

    Does not implement some restrictions on where Self can be used

         generics_syntax_compatibility
         generics_syntax_infer_variance
    Unsupported

    Type parameter syntax not yet support.

    Pass
    Partial

    Final is handled a bit different (questionable if this is an issue)

    Pass Pass
         generics_syntax_scoping
    Partial

    Does not following runtime scoping rules for type parameters in all cases.

    Pass
    Partial

    Does not following runtime scoping rules for type parameters in all cases.

    Pass Pass
         generics_type_erasure
         generics_typevartuple_args
    Partial

    Does not enforce that tuples captured by TypeVarTuple are same type.

    Pass
    Partial

    Does not enforce that tuples captured by TypeVarTuple are same type.

    Pass Pass
         generics_typevartuple_basic
    Partial

    Does not enforce that tuples captured by TypeVarTuple are same length.

    Does not enforce that tuples captured by TypeVarTuple are same type.

    Pass
    Partial

    Does not enforce that tuples captured by TypeVarTuple are same length.

    Does not enforce that tuples captured by TypeVarTuple are same type.

    Pass
    Partial

    TypeVarTuple is pinned too early when calling generic function

         generics_typevartuple_callable
         generics_upper_bound
    Partial

    Does not reject use of type variable within an upper bound.

    Pass
    Partial

    Does not reject use of type variable within an upper bound.

    Pass Pass
         generics_variance
    Partial

    Does not reject use of class-scoped TypeVar used in a base class when variance is incompatible.

    Pass
    Partial

    Does not reject use of class-scoped TypeVar used in a base class when variance is incompatible.

    Pass Unsupported
         generics_variance_inference
         qualifiers_final_annotation
    Partial

    Does not treat use of Final name as if it was replaced by the literal in NamedTuple definition.

    Does not allow conditional assignment of Final instance variable in __init__ method.

    Does not allow redefinition of private class variable that is marked Final in parent class.

    Does not report modification of local Final variable via "for" statement.

    Pass
    Partial

    Does not treat use of Final name as if it was replaced by the literal in NamedTuple definition.

    Does not allow conditional assignment of Final instance variable in __init__ method.

    Pass
    Partial

    Final attributes not initialized on the class can be assigned to

         qualifiers_final_decorator
         aliases_typealiastype
    Partial

    Incorrectly rejects some recursive type aliases using TypeAliasType.

    Incorrectly rejects the use of a class-scoped TypeVar in a TypeAliasType definition.

    Pass
    Partial

    Incorrectly rejects the use of a class-scoped TypeVar in a TypeAliasType definition.

    Incorrectly allows type_params= to be an arbitrary tuple.

    Pass
    Partial

    Does not detect circular definitions.

         aliases_variance
         literals_interactions
    Partial

    Does not narrow type of `x` with `x in Literal` type guard pattern.

    Pass
    Partial

    Does not narrow type of `x` with `x in Literal` type guard pattern.

    Pass
    Partial

    Two instances parameterized with different literals are not compatible

         literals_literalstring
         protocols_definition
    Partial

    Does not detect protocol mismatch if concrete method is missing annotations.

    Does not detect protocol mismatch if concrete method's parameters are position-only.

    Pass
    Partial

    Does not detect protocol mismatch if concrete method is missing annotations.

    Does not detect protocol mismatch if concrete method's parameters are position-only.

    Pass
    Partial

    Incorrectly handles some ClassVar examples in Protocol subtyping

         protocols_explicit
    Pass*

    Does not report unimplemented attributes for class that explicitly derives from protocol until it is instantiated.

    Pass Pass
    Partial

    Does not reject call to super method with no default implementation.

    Does not detect stub methods inherited from protocols as abstract.

    Pass
         protocols_generic Pass
         protocols_runtime_checkable
    Partial

    Does not report unsafe overlap for runtime_checkable protocol.

    Pass
    Partial

    Does not report unsafe overlap for runtime_checkable protocol.

    Pass Pass
         protocols_self
         callables_annotation
    Partial

    Incorrectly treats "*args: T, **kwargs: T" as "..." when T is specialized to Any.

    Does not treat "*args: Any, **kargs: Any" as "..." when separated by keyword parameter.

    Pass
    Partial

    Incorrectly treats "*args: T, **kwargs: T" as "..." when T is specialized to Any.

    Does not treat "*args: Any, **kargs: Any" as "..." when separated by keyword parameter.

    Pass
    Partial

    Parameter names are lost when resolving ParamSpec

         callables_kwargs
         constructors_call_init
    Partial

    Does not report errors during binding to self parameter of __init__ method.

    Does not reject use of class-scoped type variables in annotation of self parameter in __init__ method.

    Pass
    Partial

    Does not report errors during binding to self parameter of __init__ method.

    Does not reject use of class-scoped type variables in annotation of self parameter in __init__ method.

    Pass
    Partial

    Does not reject class-scoped type var in self param annotation

         constructors_call_metaclass
         constructors_call_new
    Partial

    Does not support __new__ return type that is not a subclass of the class being constructed.

    Does not skip evaluation of __init__ based on __new__ return type.

    Does not report errors during binding to cls parameter of __new__ method.

    Pass
    Partial

    Does not support __new__ return type that is not a subclass of the class being constructed.

    Does not skip evaluation of __init__ based on __new__ return type.

    Does not report errors during binding to cls parameter of __new__ method.

    Pass Pass
         constructors_call_type
    Partial

    Does not validate call to custom metaclass __call__ method through type[T].

    Pass
    Partial

    Does not validate call to custom metaclass __call__ method through type[T].

    Pass
    Partial

    Does not check TypeVar type constructor using upper bound's __new__

         constructors_callable
    Partial

    Does not generate a union type for __new__ and __init__ when converting class to callable.

    Does not ignore __init__ based on __new__ return type when converting class to callable.

    Does not support __new__ return type that is different from class being constructed.

    Pass
    Partial

    Does not generate a union type for __new__ and __init__ when converting class to callable.

    Does not ignore __init__ based on __new__ return type when converting class to callable.

    Does not support __new__ return type that is different from class being constructed.

    Struggles with some cases of self types

    Pass
    Partial

    Converting constructor to callable does not preserve class-scoped type params.

    Converting constructor to callable does not substitute Self in __new__

    Converting constructor to callable uses __new__ signature instead of __init__

         constructors_consistency
         overloads_evaluation
    Partial

    Does not expand boolean arguments to Literal[True] and Literal[False].

    Does not expand enum arguments to literal variants.

    Does not expand tuple arguments to possible combinations.

    Does not evaluate Any in some cases where overload is ambiguous.

    Evaluates Any in some cases where overload is not ambiguous.

    Partial

    Does not evaluate Any in some cases where overload is ambiguous.

    Partial

    Does not expand boolean arguments to Literal[True] and Literal[False].

    Does not expand enum arguments to literal variants.

    Does not expand tuple arguments to possible combinations.

    Does not evaluate Any in some cases where overload is ambiguous.

    Evaluates Any in some cases where overload is not ambiguous.

    Pass Pass
    @@ -713,7 +713,7 @@

    Python Type System Conformance Test Results

         dataclasses_final
    Partial

    Wrongly requires a Final dataclass field to be initialized at class level.

    Doesn't support Final nested inside ClassVar.

    Pass
    Partial

    Wrongly requires a Final dataclass field to be initialized at class level.

    Doesn't support Final nested inside ClassVar.

    Pass Pass
         dataclasses_frozen
         dataclasses_hash
    Partial

    Does not report when dataclass is not compatible with Hashable protocol.

    Pass
    Partial

    Does not report when dataclass is not compatible with Hashable protocol.

    Pass Pass
         dataclasses_inheritance
         dataclasses_slots
    Partial

    Does not reject write to instance variable that is not defined in __slots__.

    Pass
    Partial

    Does not reject write to instance variable that is not defined in __slots__.

    Pass
    Partial

    __slots__ is generated but not checked during attribute assignment

         dataclasses_transform_class
         dataclasses_transform_converter
    Unsupported

    Converter parameter not yet supported.

    Pass
    Partial

    Converters are fully supported, failed to match generic overloads against other generics

    Pass Pass
         dataclasses_transform_field
         typeddicts_alt_syntax
    Pass*

    Does not support keyword-argument form of alternative syntax (deprecated in 3.11).

    Pass
    Pass*

    Does not support keyword-argument form of alternative syntax (deprecated in 3.11).

    Pass Pass
         typeddicts_class_syntax
         typeddicts_readonly_inheritance
    Partial

    Incorrectly rejects non-ReadOnly override of ReadOnly item.

    Incorrectly rejects override of ReadOnly item with another ReadOnly item with narrower type.

    Incorrectly rejects override of NotRequired ReadOnly item with a Required ReadOnly item.

    Pass
    Partial

    Incorrectly rejects non-ReadOnly override of ReadOnly item.

    Incorrectly rejects override of ReadOnly item with another ReadOnly item with narrower type.

    Incorrectly rejects override of NotRequired ReadOnly item with a Required ReadOnly item.

    Pass Pass
         typeddicts_readonly_kwargs
         typeddicts_readonly_update
    Partial

    Incorrectly allows update of ReadOnly item.

    Incorrectly rejects update involving an item with Never type.

    Pass
    Partial

    Incorrectly allows update of ReadOnly item.

    Pass Pass
         typeddicts_required
         namedtuples_define_class
    Partial

    Does not reject override of named tuple attribute in child class.

    Pass
    Partial

    Does not reject override of named tuple attribute in child class.

    Pass Pass
         namedtuples_define_functional
         enums_expansion
    Partial

    Improperly applies narrowing to Flag subclass.

    Pass
    Partial

    Improperly applies narrowing to Flag subclass.

    Pass Pass
         enums_member_names
         enums_member_values
    Partial

    Does not enforce declared type of `_value_`.

    Does not enforce assigned tuple types for enum members (optional).

    Pass
    Partial

    Does not enforce declared type of `_value_`.

    Pass Pass
         enums_members
    Partial

    Does not treat attribute with annotation and no assignment as non-member.

    Does not treat callables as non-members.

    Does not honor `enum.member` as method decorator.

    Does not properly handle aliased enum members.

    Does not support `_ignore_` mechanism (optional).

    Does not treat attributes with private names as non-members.

    Pass*

    Does not support `_ignore_` mechanism (optional).

    Partial

    Does not honor `enum.member` as method decorator.

    Does not properly handle aliased enum members.

    Does not treat somecallables as non-members.

    Pass
    Partial

    Enum members that are aliases of other members do not resolved to the aliased member's type

    @@ -1058,7 +1058,7 @@

    Python Type System Conformance Test Results

         historical_positional
    Partial

    Does not reject positional-only parameter after non-positional-only parameter.

    Treats keyword-only parameter as positional-only.

    Applies legacy positional-only rules when PEP 570 syntax is used.

    Pass
    Partial

    Does not reject positional-only parameter after non-positional-only parameter.

    Treats keyword-only parameter as positional-only.

    Applies legacy positional-only rules when PEP 570 syntax is used.

    Pass Pass
    diff --git a/conformance/results/zuban/aliases_typealiastype.toml b/conformance/results/zuban/aliases_typealiastype.toml index 88fb5f8a5..082a9f47b 100644 --- a/conformance/results/zuban/aliases_typealiastype.toml +++ b/conformance/results/zuban/aliases_typealiastype.toml @@ -1,19 +1,12 @@ -conformant = "Partial" -notes = """ -Incorrectly rejects the use of a class-scoped TypeVar in a TypeAliasType definition. -Incorrectly allows type_params= to be an arbitrary tuple. -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 45: Expected 1 errors -Line 27: Unexpected errors ['aliases_typealiastype.py:27: error: Can\\'t use bound type variable "T" to define generic alias [misc]'] """ output = """ -aliases_typealiastype.py:27: error: Can't use bound type variable "T" to define generic alias [misc] aliases_typealiastype.py:32: error: "TypeAliasType" has no attribute "other_attrib" [attr-defined] aliases_typealiastype.py:40: error: Type argument "int" of "GoodAlias5" must be a subtype of "str" [type-var] aliases_typealiastype.py:43: error: All type parameters should be declared ("S" not declared) [misc] aliases_typealiastype.py:44: error: All type parameters should be declared ("S" not declared) [misc] +aliases_typealiastype.py:45: error: Tuple literal expected as the type_params argument to TypeAliasType [misc] aliases_typealiastype.py:46: error: Invalid recursive alias: a union item of itself [misc] aliases_typealiastype.py:47: error: Invalid recursive alias: a union item of itself [misc] aliases_typealiastype.py:48: error: Variable "aliases_typealiastype.BadAlias7" is not valid as a type [valid-type] diff --git a/conformance/results/zuban/annotations_forward_refs.toml b/conformance/results/zuban/annotations_forward_refs.toml index 5ca6e3aee..544569aad 100644 --- a/conformance/results/zuban/annotations_forward_refs.toml +++ b/conformance/results/zuban/annotations_forward_refs.toml @@ -1,21 +1,17 @@ conformant = "Partial" notes = """ -Does not report error for a forward reference that is not enclosed in quotes. Incorrectly generates error for quoted type defined in class scope. -Does not ignore newlines in multi-line unions """ conformance_automated = "Fail" errors_diff = """ -Line 24: Expected 1 errors -Line 25: Expected 1 errors Line 82: Unexpected errors ['annotations_forward_refs.py:82: error: Name "str" is not defined [name-defined]'] Line 87: Unexpected errors ['annotations_forward_refs.py:87: error: Function "annotations_forward_refs.ClassD.int" is not valid as a type [valid-type]'] Line 95: Unexpected errors ['annotations_forward_refs.py:95: error: Expression is of type "Any", not "str" [misc]'] Line 96: Unexpected errors ['annotations_forward_refs.py:96: error: Expression is of type "Any", not "int" [misc]'] -Line 104: Unexpected errors ['annotations_forward_refs.py:104: error: Invalid syntax [syntax]'] -Line 105: Unexpected errors ['annotations_forward_refs.py:105: error: Invalid syntax [syntax]', 'annotations_forward_refs.py:105: error: Invalid syntax [syntax]'] """ output = """ +annotations_forward_refs.py:24: error: Forward reference unions cause runtime errors, consider wrapping the whole annotation with a string [misc] +annotations_forward_refs.py:25: error: Forward reference unions cause runtime errors, consider wrapping the whole annotation with a string [misc] annotations_forward_refs.py:41: error: Invalid type comment or annotation [valid-type] annotations_forward_refs.py:42: error: Bracketed expression "[...]" is not valid as a type [valid-type] annotations_forward_refs.py:42: note: Did you mean "List[...]"? @@ -43,7 +39,4 @@ annotations_forward_refs.py:89: error: Function "annotations_forward_refs.ClassD annotations_forward_refs.py:89: note: Perhaps you need "Callable[...]" or a callback protocol? annotations_forward_refs.py:95: error: Expression is of type "Any", not "str" [misc] annotations_forward_refs.py:96: error: Expression is of type "Any", not "int" [misc] -annotations_forward_refs.py:104: error: Invalid syntax [syntax] -annotations_forward_refs.py:105: error: Invalid syntax [syntax] -annotations_forward_refs.py:105: error: Invalid syntax [syntax] """ diff --git a/conformance/results/zuban/callables_annotation.toml b/conformance/results/zuban/callables_annotation.toml index c365d70fe..01f74e7ed 100644 --- a/conformance/results/zuban/callables_annotation.toml +++ b/conformance/results/zuban/callables_annotation.toml @@ -1,12 +1,5 @@ -conformant = "Partial" -notes = """ -Incorrectly treats "*args: T, **kwargs: T" as "..." when T is specialized to Any. -Does not treat "*args: Any, **kargs: Any" as "..." when separated by keyword parameter. -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 159: Expected 1 errors -Line 157: Unexpected errors ['callables_annotation.py:157: error: Incompatible types in assignment (expression has type "Proto7", variable has type "Proto6") [assignment]'] """ output = """ callables_annotation.py:25: error: Too few arguments [call-arg] @@ -24,12 +17,12 @@ callables_annotation.py:58: error: Please use "Callable[[], None -callables_annotation.py:157: note: Got: -callables_annotation.py:157: note: def __call__(self, float, /, b: int, *, k: str, m: str) -> None +callables_annotation.py:159: error: Incompatible types in assignment (expression has type "Proto8", variable has type "Proto5[Any]") [assignment] +callables_annotation.py:159: note: Following member(s) of "Proto8" have conflicts: +callables_annotation.py:159: note: Expected: +callables_annotation.py:159: note: def __call__(self, *args: Any, **kwargs: Any) -> None +callables_annotation.py:159: note: Got: +callables_annotation.py:159: note: def __call__(self) -> None callables_annotation.py:172: error: Incompatible types in assignment (expression has type "Callable[[], str]", variable has type "Callable[[int, VarArg(Any), KwArg(Any)], str]") [assignment] callables_annotation.py:187: error: Incompatible types in assignment (expression has type "Callable[[int, str], str]", variable has type "Callable[[str, VarArg(Any), KwArg(Any)], str]") [assignment] callables_annotation.py:189: error: Incompatible types in assignment (expression has type "Callable[[int, str], str]", variable has type "Callable[[str, VarArg(Any), KwArg(Any)], str]") [assignment] diff --git a/conformance/results/zuban/constructors_call_init.toml b/conformance/results/zuban/constructors_call_init.toml index e488f058e..a642bef3e 100644 --- a/conformance/results/zuban/constructors_call_init.toml +++ b/conformance/results/zuban/constructors_call_init.toml @@ -1,15 +1,11 @@ -conformant = "Partial" -notes = """ -Does not report errors during binding to self parameter of __init__ method. -Does not reject use of class-scoped type variables in annotation of self parameter in __init__ method. -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 56: Expected 1 errors -Line 107: Expected 1 errors """ output = """ constructors_call_init.py:21: error: Argument 1 to "Class1" has incompatible type "float"; expected "int" [arg-type] constructors_call_init.py:42: error: Argument 1 to "Class3" has incompatible type "Class2[Never]"; expected "Self | None" [arg-type] +constructors_call_init.py:56: error: Invalid self type in __init__ [call-arg] +constructors_call_init.py:107: error: The type of self "T1" has type vars in non standard potisions for class "Class8" [misc] +constructors_call_init.py:107: error: The type of self "T2" has type vars in non standard potisions for class "Class8" [misc] constructors_call_init.py:130: error: Too many arguments for "Class11" [call-arg] """ diff --git a/conformance/results/zuban/constructors_call_new.toml b/conformance/results/zuban/constructors_call_new.toml index 12f5c828b..c3407c9ad 100644 --- a/conformance/results/zuban/constructors_call_new.toml +++ b/conformance/results/zuban/constructors_call_new.toml @@ -1,31 +1,7 @@ -conformant = "Partial" -notes = """ -Does not support __new__ return type that is not a subclass of the class being constructed. -Does not skip evaluation of __init__ based on __new__ return type. -Does not report errors during binding to cls parameter of __new__ method. -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 148: Expected 1 errors -Line 40: Unexpected errors ['constructors_call_new.py:40: error: Incompatible return type for "__new__" (returns "int", but must return a subtype of "Class3") [misc]'] -Line 49: Unexpected errors ['constructors_call_new.py:49: error: Expression is of type "Class3", not "int" [misc]', 'constructors_call_new.py:49: error: Missing positional argument "x" in call to "Class3" [call-arg]'] -Line 57: Unexpected errors ['constructors_call_new.py:57: error: "__new__" must return a class instance (got "Class4 | Any") [misc]'] -Line 64: Unexpected errors ['constructors_call_new.py:64: error: Expression is of type "Class4", not "Class4 | Any" [misc]', 'constructors_call_new.py:64: error: Missing positional argument "x" in call to "Class4" [call-arg]'] -Line 76: Unexpected errors ['constructors_call_new.py:76: error: Expression is of type "Class5", not "Never" [misc]', 'constructors_call_new.py:76: error: Missing positional argument "x" in call to "Class5" [call-arg]'] -Line 82: Unexpected errors ['constructors_call_new.py:82: error: "__new__" must return a class instance (got "int | Class6") [misc]'] -Line 89: Unexpected errors ['constructors_call_new.py:89: error: Expression is of type "Class6", not "int | Class6" [misc]', 'constructors_call_new.py:89: error: Missing positional argument "x" in call to "Class6" [call-arg]'] """ output = """ constructors_call_new.py:21: error: Argument 1 to "Class1" has incompatible type "float"; expected "int" [arg-type] -constructors_call_new.py:40: error: Incompatible return type for "__new__" (returns "int", but must return a subtype of "Class3") [misc] -constructors_call_new.py:49: error: Expression is of type "Class3", not "int" [misc] -constructors_call_new.py:49: error: Missing positional argument "x" in call to "Class3" [call-arg] -constructors_call_new.py:57: error: "__new__" must return a class instance (got "Class4 | Any") [misc] -constructors_call_new.py:64: error: Expression is of type "Class4", not "Class4 | Any" [misc] -constructors_call_new.py:64: error: Missing positional argument "x" in call to "Class4" [call-arg] -constructors_call_new.py:76: error: Expression is of type "Class5", not "Never" [misc] -constructors_call_new.py:76: error: Missing positional argument "x" in call to "Class5" [call-arg] -constructors_call_new.py:82: error: "__new__" must return a class instance (got "int | Class6") [misc] -constructors_call_new.py:89: error: Expression is of type "Class6", not "int | Class6" [misc] -constructors_call_new.py:89: error: Missing positional argument "x" in call to "Class6" [call-arg] +constructors_call_new.py:148: error: Invalid self argument "type[Class11[str]]" to attribute function "__new__" with type "type[Class11[int]]" [misc] """ diff --git a/conformance/results/zuban/constructors_call_type.toml b/conformance/results/zuban/constructors_call_type.toml index 7ba573760..45cc8aeb0 100644 --- a/conformance/results/zuban/constructors_call_type.toml +++ b/conformance/results/zuban/constructors_call_type.toml @@ -1,17 +1,13 @@ -conformant = "Partial" -notes = """ -Does not validate call to custom metaclass __call__ method through type[T]. -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 30: Expected 1 errors -Line 72: Expected 1 errors """ output = """ +constructors_call_type.py:30: error: Missing positional arguments "x", "y" in call to "Class1" [call-arg] constructors_call_type.py:40: error: Missing positional arguments "x", "y" in call to "Class2" [call-arg] constructors_call_type.py:50: error: Missing positional arguments "x", "y" in call to "Class3" [call-arg] constructors_call_type.py:59: error: Too many arguments for "Class4" [call-arg] constructors_call_type.py:64: error: Too many arguments for "object" [call-arg] +constructors_call_type.py:72: error: Missing positional arguments "x", "y" in call to "Class1" [call-arg] constructors_call_type.py:81: error: Missing positional argument "y" in call to "Class2" [call-arg] constructors_call_type.py:82: error: Argument 2 to "Class2" has incompatible type "int"; expected "str" [arg-type] """ diff --git a/conformance/results/zuban/constructors_callable.toml b/conformance/results/zuban/constructors_callable.toml index 51b00c6f9..a59ffe662 100644 --- a/conformance/results/zuban/constructors_callable.toml +++ b/conformance/results/zuban/constructors_callable.toml @@ -1,22 +1,5 @@ -conformant = "Partial" -notes = """ -Does not generate a union type for __new__ and __init__ when converting class to callable. -Does not ignore __init__ based on __new__ return type when converting class to callable. -Does not support __new__ return type that is different from class being constructed. -Struggles with some cases of self types -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 129: Expected 1 errors -Line 146: Expected 1 errors -Line 74: Unexpected errors ['constructors_callable.py:74: error: Incompatible return type for "__new__" (returns "int", but must return a subtype of "Class4") [misc]'] -Line 118: Unexpected errors ['constructors_callable.py:118: error: Incompatible return type for "__new__" (returns "Class6Proxy", but must return a subtype of "Class6") [misc]'] -Line 128: Unexpected errors ['constructors_callable.py:128: error: Expression is of type "Class6", not "Class6Proxy" [misc]', 'constructors_callable.py:128: error: Missing positional argument "x" in call [call-arg]'] -Line 145: Unexpected errors ['constructors_callable.py:145: error: Expression is of type "Class6Any", not "Any" [misc]', 'constructors_callable.py:145: error: Missing positional argument "x" in call [call-arg]'] -Line 162: Unexpected errors ['constructors_callable.py:162: error: Need type annotation for "r7" [var-annotated]'] -Line 166: Unexpected errors ['constructors_callable.py:166: error: Expression is of type "Class7[Any]", not "Class7[int]" [misc]'] -Line 167: Unexpected errors ['constructors_callable.py:167: error: Expression is of type "Class7[Any]", not "Class7[str]" [misc]', 'constructors_callable.py:167: error: Argument 1 has incompatible type "str"; expected "int" [arg-type]'] -Line 196: Unexpected errors ['constructors_callable.py:196: error: List item 0 has incompatible type "str"; expected "T" [list-item]', 'constructors_callable.py:196: error: List item 0 has incompatible type "str"; expected "T" [list-item]'] """ output = """ constructors_callable.py:36: note: Revealed type is "def (x: builtins.int) -> constructors_callable.Class1" @@ -28,28 +11,17 @@ constructors_callable.py:64: note: Revealed type is "def (x: builtins.int) -> co constructors_callable.py:66: error: Missing positional argument "x" in call [call-arg] constructors_callable.py:67: error: Unexpected keyword argument "y" [call-arg] constructors_callable.py:68: error: Too many arguments [call-arg] -constructors_callable.py:74: error: Incompatible return type for "__new__" (returns "int", but must return a subtype of "Class4") [misc] constructors_callable.py:79: note: Revealed type is "def (x: builtins.int) -> builtins.int" constructors_callable.py:81: error: Missing positional argument "x" in call [call-arg] constructors_callable.py:82: error: Unexpected keyword argument "y" [call-arg] constructors_callable.py:99: note: Revealed type is "def (*args: Any, **kwargs: Any) -> Never" -constructors_callable.py:118: error: Incompatible return type for "__new__" (returns "Class6Proxy", but must return a subtype of "Class6") [misc] -constructors_callable.py:127: note: Revealed type is "def (x: builtins.int) -> constructors_callable.Class6" -constructors_callable.py:128: error: Expression is of type "Class6", not "Class6Proxy" [misc] -constructors_callable.py:128: error: Missing positional argument "x" in call [call-arg] -constructors_callable.py:144: note: Revealed type is "def (x: builtins.int) -> constructors_callable.Class6Any" -constructors_callable.py:145: error: Expression is of type "Class6Any", not "Any" [misc] -constructors_callable.py:145: error: Missing positional argument "x" in call [call-arg] -constructors_callable.py:162: error: Need type annotation for "r7" [var-annotated] -constructors_callable.py:164: note: Revealed type is "def (x: builtins.int) -> constructors_callable.Class7[Any]" -constructors_callable.py:166: error: Expression is of type "Class7[Any]", not "Class7[int]" [misc] -constructors_callable.py:167: error: Expression is of type "Class7[Any]", not "Class7[str]" [misc] -constructors_callable.py:167: error: Argument 1 has incompatible type "str"; expected "int" [arg-type] +constructors_callable.py:127: note: Revealed type is "def () -> constructors_callable.Class6Proxy" +constructors_callable.py:129: error: Too many arguments [call-arg] +constructors_callable.py:144: note: Revealed type is "def () -> Any" +constructors_callable.py:146: error: Too many arguments [call-arg] +constructors_callable.py:164: note: Revealed type is "Overload(def (x: builtins.int) -> constructors_callable.Class7[builtins.int], def (x: builtins.str) -> constructors_callable.Class7[builtins.str])" constructors_callable.py:184: note: Revealed type is "def [T] (x: builtins.list[T], y: builtins.list[T]) -> constructors_callable.Class8[T]" constructors_callable.py:186: error: List item 0 has incompatible type "str"; expected "int" [list-item] -constructors_callable.py:195: note: Revealed type is "def (x: builtins.list[T], y: builtins.list[T]) -> constructors_callable.Class9" -constructors_callable.py:196: error: List item 0 has incompatible type "str"; expected "T" [list-item] -constructors_callable.py:196: error: List item 0 has incompatible type "str"; expected "T" [list-item] -constructors_callable.py:197: error: List item 0 has incompatible type "int"; expected "T" [list-item] -constructors_callable.py:197: error: List item 0 has incompatible type "str"; expected "T" [list-item] +constructors_callable.py:195: note: Revealed type is "def [T] (x: builtins.list[T], y: builtins.list[T]) -> constructors_callable.Class9" +constructors_callable.py:197: error: List item 0 has incompatible type "str"; expected "int" [list-item] """ diff --git a/conformance/results/zuban/dataclasses_final.toml b/conformance/results/zuban/dataclasses_final.toml index bbe33fd0d..b59d3cac0 100644 --- a/conformance/results/zuban/dataclasses_final.toml +++ b/conformance/results/zuban/dataclasses_final.toml @@ -1,19 +1,8 @@ -conformant = "Partial" -notes = """ -Wrongly requires a Final dataclass field to be initialized at class level. -Doesn't support Final nested inside ClassVar. -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 27: Expected 1 errors -Line 16: Unexpected errors ['dataclasses_final.py:16: error: Final name must be initialized with a value [misc]'] -Line 18: Unexpected errors ['dataclasses_final.py:18: error: Final can be only used as an outermost qualifier in a variable annotation [misc]'] -Line 24: Unexpected errors ['dataclasses_final.py:24: error: Expression is of type "Any", not "int" [misc]'] """ output = """ -dataclasses_final.py:16: error: Final name must be initialized with a value [misc] -dataclasses_final.py:18: error: Final can be only used as an outermost qualifier in a variable annotation [misc] -dataclasses_final.py:24: error: Expression is of type "Any", not "int" [misc] +dataclasses_final.py:27: error: Cannot assign to final attribute "final_classvar" [misc] dataclasses_final.py:35: error: Cannot assign to final attribute "final_no_default" [misc] dataclasses_final.py:36: error: Cannot assign to final attribute "final_with_default" [misc] dataclasses_final.py:37: error: Cannot assign to final attribute "final_no_default" [misc] diff --git a/conformance/results/zuban/dataclasses_hash.toml b/conformance/results/zuban/dataclasses_hash.toml index 1e0314518..210b7f0bd 100644 --- a/conformance/results/zuban/dataclasses_hash.toml +++ b/conformance/results/zuban/dataclasses_hash.toml @@ -1,11 +1,7 @@ -conformant = "Partial" -notes = """ -Does not report when dataclass is not compatible with Hashable protocol. -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 15: Expected 1 errors -Line 32: Expected 1 errors """ output = """ +dataclasses_hash.py:15: error: Incompatible types in assignment (expression has type "DC1", variable has type "Hashable") [assignment] +dataclasses_hash.py:32: error: Incompatible types in assignment (expression has type "DC3", variable has type "Hashable") [assignment] """ diff --git a/conformance/results/zuban/dataclasses_slots.toml b/conformance/results/zuban/dataclasses_slots.toml index ecf43ca21..6090819e6 100644 --- a/conformance/results/zuban/dataclasses_slots.toml +++ b/conformance/results/zuban/dataclasses_slots.toml @@ -1,13 +1,9 @@ -conformant = "Partial" -notes = """ -Does not reject write to instance variable that is not defined in __slots__. -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 25: Expected 1 errors """ output = """ dataclasses_slots.py:11: error: "DC1" both defines "__slots__" and is used with "slots=True" [misc] +dataclasses_slots.py:25: error: Trying to assign name "y" that is not in "__slots__" of type "dataclasses_slots.DC2" [misc] dataclasses_slots.py:38: error: Trying to assign name "y" that is not in "__slots__" of type "dataclasses_slots.DC3" [misc] dataclasses_slots.py:66: error: "type[DC6]" has no attribute "__slots__" [attr-defined] dataclasses_slots.py:69: error: "DC6" has no attribute "__slots__" [attr-defined] diff --git a/conformance/results/zuban/dataclasses_transform_converter.toml b/conformance/results/zuban/dataclasses_transform_converter.toml index fc295f946..0b0764c98 100644 --- a/conformance/results/zuban/dataclasses_transform_converter.toml +++ b/conformance/results/zuban/dataclasses_transform_converter.toml @@ -1,15 +1,9 @@ -conformant = "Partial" -notes = """ -Converters are fully supported, failed to match generic overloads against other generics -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 104: Unexpected errors ['dataclasses_transform_converter.py:104: error: Incompatible callable argument with type vars [arg-type]'] """ output = """ dataclasses_transform_converter.py:48: error: Argument "converter" to "model_field" has incompatible type "Callable[[], int]"; expected "Callable[[Never], int]" [arg-type] dataclasses_transform_converter.py:49: error: Argument "converter" to "model_field" has incompatible type "Callable[[NamedArg(int, 'x')], int]"; expected "Callable[[Never], int]" [arg-type] -dataclasses_transform_converter.py:104: error: Incompatible callable argument with type vars [arg-type] dataclasses_transform_converter.py:107: error: Argument 1 to "DC2" has incompatible type "int"; expected "str" [arg-type] dataclasses_transform_converter.py:108: error: Argument 4 to "DC2" has incompatible type "int"; expected "str | bytes" [arg-type] dataclasses_transform_converter.py:109: error: Argument 5 to "DC2" has incompatible type "complex"; expected "str | list[str]" [arg-type] diff --git a/conformance/results/zuban/enums_expansion.toml b/conformance/results/zuban/enums_expansion.toml index 699dbd1c4..787ef8ef0 100644 --- a/conformance/results/zuban/enums_expansion.toml +++ b/conformance/results/zuban/enums_expansion.toml @@ -1,12 +1,7 @@ -conformant = "Partial" -notes = """ -Improperly applies narrowing to Flag subclass. -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 53: Expected 1 errors -Line 52: Unexpected errors ['enums_expansion.py:52: error: Expression is of type "Literal[CustomFlags.FLAG3]", not "CustomFlags" [misc]'] """ output = """ -enums_expansion.py:52: error: Expression is of type "Literal[CustomFlags.FLAG3]", not "CustomFlags" [misc] +enums_expansion.py:35: error: Statement is unreachable [unreachable] +enums_expansion.py:53: error: Expression is of type "CustomFlags", not "Literal[CustomFlags.FLAG3]" [misc] """ diff --git a/conformance/results/zuban/enums_member_values.toml b/conformance/results/zuban/enums_member_values.toml index 95ead33c4..9705e064b 100644 --- a/conformance/results/zuban/enums_member_values.toml +++ b/conformance/results/zuban/enums_member_values.toml @@ -1,14 +1,12 @@ -conformant = "Partial" notes = """ -Does not enforce declared type of `_value_`. """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 78: Expected 1 errors """ output = """ enums_member_values.py:54: error: Expression is of type "tuple[Literal[1], float, float]", not "Literal[1]" [misc] enums_member_values.py:68: error: Expression is of type "int", not "Literal[1]" [misc] +enums_member_values.py:78: error: Enum value type "str" does not match the type "int" of "_value_" [misc] enums_member_values.py:85: error: Incompatible types in assignment (expression has type "int", variable has type "str") [assignment] enums_member_values.py:96: error: Expression is of type "EllipsisType", not "int" [misc] """ diff --git a/conformance/results/zuban/enums_members.toml b/conformance/results/zuban/enums_members.toml index 0a625e68a..f73b24d79 100644 --- a/conformance/results/zuban/enums_members.toml +++ b/conformance/results/zuban/enums_members.toml @@ -1,24 +1,16 @@ -conformant = "Partial" notes = """ -Does not honor `enum.member` as method decorator. -Does not properly handle aliased enum members. -Does not treat somecallables as non-members. """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 82: Expected 1 errors -Line 83: Expected 1 errors -Line 116: Expected 1 errors -Line 100: Unexpected errors ['enums_members.py:100: error: Expression is of type "Literal[TrafficLight.AMBER]", not "Literal[TrafficLight.YELLOW]" [misc]'] -Line 117: Unexpected errors ['enums_members.py:117: error: Parameter 1 of Literal[...] is invalid [valid-type]'] """ output = """ enums_members.py:50: error: Enum members must be left unannotated [misc] enums_members.py:50: note: See https://typing.readthedocs.io/en/latest/spec/enums.html#defining-members +enums_members.py:82: error: Parameter 1 of Literal[...] is invalid [valid-type] +enums_members.py:83: error: Parameter 1 of Literal[...] is invalid [valid-type] enums_members.py:84: error: Parameter 1 of Literal[...] is invalid [valid-type] enums_members.py:85: error: Parameter 1 of Literal[...] is invalid [valid-type] -enums_members.py:100: error: Expression is of type "Literal[TrafficLight.AMBER]", not "Literal[TrafficLight.YELLOW]" [misc] -enums_members.py:117: error: Parameter 1 of Literal[...] is invalid [valid-type] +enums_members.py:116: error: Parameter 1 of Literal[...] is invalid [valid-type] enums_members.py:128: note: Revealed type is "builtins.int" enums_members.py:129: error: Parameter 1 of Literal[...] is invalid [valid-type] enums_members.py:146: error: Expression is of type "Literal[Pet5.DOG]", not "int" [misc] diff --git a/conformance/results/zuban/generics_base_class.toml b/conformance/results/zuban/generics_base_class.toml index c8166fd86..c6f007321 100644 --- a/conformance/results/zuban/generics_base_class.toml +++ b/conformance/results/zuban/generics_base_class.toml @@ -1,18 +1,12 @@ -conformant = "Partial" -notes = """ -Does not detect inconsistent type variable ordering in multi-inheritance. -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 98: Expected 1 errors -Line 38: Unexpected errors ['generics_base_class.py:38: error: Can only assign concrete classes to a variable of type "type[Iterable]" [misc]'] """ output = """ generics_base_class.py:26: error: Argument 1 to "takes_dict_incorrect" has incompatible type "SymbolTable"; expected "dict[str, list[object]]" [arg-type] generics_base_class.py:29: error: Invalid type [valid-type] generics_base_class.py:30: error: Invalid type [valid-type] -generics_base_class.py:38: error: Can only assign concrete classes to a variable of type "type[Iterable]" [misc] generics_base_class.py:49: error: "LinkedList" expects 1 type argument, but 2 given [type-arg] generics_base_class.py:61: error: "MyDict" expects 1 type argument, but 2 given [type-arg] generics_base_class.py:68: error: Duplicate type variables in Generic[...] or Protocol[...] [misc] +generics_base_class.py:98: error: Cannot determine consistent method resolution order (MRO) for "BadChild" [misc] """ diff --git a/conformance/results/zuban/generics_defaults.toml b/conformance/results/zuban/generics_defaults.toml index f0bef676e..1eb17cae2 100644 --- a/conformance/results/zuban/generics_defaults.toml +++ b/conformance/results/zuban/generics_defaults.toml @@ -1,14 +1,5 @@ -conformant = "Partial" -notes = """ -Does not reject TypeVars with defaults after a TypeVarTuple -Type parameter defaults are not bound by attribute access -ParamSpec after TypeVarTuple is not always handled correctly -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 143: Expected 1 errors -Line 156: Unexpected errors ['generics_defaults.py:156: error: Expression is of type "type[Foo6[int, [*Any, **Any]]]", not "type[Foo6[int, str, [float, bool]]]" [misc]', 'generics_defaults.py:156: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [misc]'] -Line 171: Unexpected errors ['generics_defaults.py:171: error: Expression is of type "Callable[[Self], Self]", not "Callable[[Foo7[int]], Foo7[int]]" [misc]'] """ output = """ generics_defaults.py:24: error: "T" cannot appear after "DefaultStrT" in type parameter list because it has no default type [misc] @@ -16,7 +7,5 @@ generics_defaults.py:50: error: "AllTheDefaults" expects between 2 and 5 type ar generics_defaults.py:107: error: TypeVar default must be a subtype of the bound type [misc] generics_defaults.py:114: error: TypeVar default must be one of the constraint types [misc] generics_defaults.py:132: error: Expression is of type "int", not "Any" [misc] -generics_defaults.py:156: error: Expression is of type "type[Foo6[int, [*Any, **Any]]]", not "type[Foo6[int, str, [float, bool]]]" [misc] -generics_defaults.py:156: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [misc] -generics_defaults.py:171: error: Expression is of type "Callable[[Self], Self]", not "Callable[[Foo7[int]], Foo7[int]]" [misc] +generics_defaults.py:143: error: TypeVar defaults are ambiguous after a TypeVarTuple [misc] """ diff --git a/conformance/results/zuban/generics_scoping.toml b/conformance/results/zuban/generics_scoping.toml index 19c63482e..92f6073df 100644 --- a/conformance/results/zuban/generics_scoping.toml +++ b/conformance/results/zuban/generics_scoping.toml @@ -1,10 +1,5 @@ -conformant = "Partial" -notes = """ -False negative on generic class nested within generic class with same type variable. -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 80: Unexpected errors ['generics_scoping.py:80: error: Type variable "T" is bound by an outer class [misc]'] """ output = """ generics_scoping.py:29: error: Argument 1 to "meth_2" of "MyClass" has incompatible type "str"; expected "int" [arg-type] diff --git a/conformance/results/zuban/generics_self_usage.toml b/conformance/results/zuban/generics_self_usage.toml index ef5859e87..7e6d56776 100644 --- a/conformance/results/zuban/generics_self_usage.toml +++ b/conformance/results/zuban/generics_self_usage.toml @@ -1,22 +1,18 @@ -conformant = "Partial" -notes = """ -Does not detect invalid Self when Self is not properly bound""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 82: Expected 1 errors -Line 113: Expected 1 errors -Line 118: Expected 1 errors -Line 50: Unexpected errors ['generics_self_usage.py:50: error: Incompatible types in assignment (expression has type "Callable[[CallableAttribute], int]", variable has type "Callable[[Self], int]") [assignment]'] """ output = """ -generics_self_usage.py:50: error: Incompatible types in assignment (expression has type "Callable[[CallableAttribute], int]", variable has type "Callable[[Self], int]") [assignment] generics_self_usage.py:73: error: Self type is only allowed in annotations within class definition [misc] generics_self_usage.py:73: error: Self type is only allowed in annotations within class definition [misc] generics_self_usage.py:76: error: Self type is only allowed in annotations within class definition [misc] +generics_self_usage.py:82: error: Self argument missing for a non-static method (or an invalid type for self) [misc] generics_self_usage.py:87: error: Incompatible return value type (got "Foo3", expected "Self") [return-value] generics_self_usage.py:103: error: Self type is only allowed in annotations within class definition [misc] generics_self_usage.py:105: error: Self type is only allowed in annotations within class definition [misc] generics_self_usage.py:108: error: Self type cannot be used in type alias target [misc] +generics_self_usage.py:113: error: Static methods cannot use Self type [misc] +generics_self_usage.py:118: error: Static methods cannot use Self type [misc] +generics_self_usage.py:118: error: Static methods cannot use Self type [misc] generics_self_usage.py:123: error: Self type cannot be used in a metaclass [misc] generics_self_usage.py:127: error: Self type cannot be used in a metaclass [misc] """ diff --git a/conformance/results/zuban/generics_syntax_declarations.toml b/conformance/results/zuban/generics_syntax_declarations.toml index 90b4c1512..f4cb79a84 100644 --- a/conformance/results/zuban/generics_syntax_declarations.toml +++ b/conformance/results/zuban/generics_syntax_declarations.toml @@ -5,7 +5,7 @@ output = """ generics_syntax_declarations.py:17: error: Generic[...] base class is redundant [misc] generics_syntax_declarations.py:25: error: No arguments expected for "Protocol" base class [misc] generics_syntax_declarations.py:32: error: "T" has no attribute "is_integer" [attr-defined] -generics_syntax_declarations.py:44: error: "V" may not be used, because it's defined in an outer class [misc] +generics_syntax_declarations.py:44: error: TypeVar bound must not contain type variables [misc] generics_syntax_declarations.py:48: error: Bracketed expression "[...]" is not valid as a type [valid-type] generics_syntax_declarations.py:48: note: Did you mean "List[...]"? generics_syntax_declarations.py:60: error: Type variable must have at least two constrained types [misc] diff --git a/conformance/results/zuban/generics_syntax_infer_variance.toml b/conformance/results/zuban/generics_syntax_infer_variance.toml index e1207f927..36d8e5ac7 100644 --- a/conformance/results/zuban/generics_syntax_infer_variance.toml +++ b/conformance/results/zuban/generics_syntax_infer_variance.toml @@ -1,11 +1,5 @@ -conformant = "Partial" -notes = """ -Final is handled a bit different (questionable if this is an issue) -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 89: Unexpected errors ['generics_syntax_infer_variance.py:89: error: Final name declared in class body cannot depend on type variables [misc]'] -Line 95: Unexpected errors ['generics_syntax_infer_variance.py:95: error: Incompatible types in assignment (expression has type "ShouldBeCovariant6[int]", variable has type "ShouldBeCovariant6[float]") [assignment]'] """ output = """ generics_syntax_infer_variance.py:15: error: Cannot use covariant with infer_variance [misc] @@ -14,8 +8,6 @@ generics_syntax_infer_variance.py:29: error: Incompatible types in assignment (e generics_syntax_infer_variance.py:47: error: Incompatible types in assignment (expression has type "ShouldBeCovariant2[float]", variable has type "ShouldBeCovariant2[int]") [assignment] generics_syntax_infer_variance.py:56: error: Incompatible types in assignment (expression has type "ShouldBeCovariant3[float]", variable has type "ShouldBeCovariant3[int]") [assignment] generics_syntax_infer_variance.py:85: error: Incompatible types in assignment (expression has type "ShouldBeCovariant5[float]", variable has type "ShouldBeCovariant5[int]") [assignment] -generics_syntax_infer_variance.py:89: error: Final name declared in class body cannot depend on type variables [misc] -generics_syntax_infer_variance.py:95: error: Incompatible types in assignment (expression has type "ShouldBeCovariant6[int]", variable has type "ShouldBeCovariant6[float]") [assignment] generics_syntax_infer_variance.py:96: error: Incompatible types in assignment (expression has type "ShouldBeCovariant6[float]", variable has type "ShouldBeCovariant6[int]") [assignment] generics_syntax_infer_variance.py:112: error: Incompatible types in assignment (expression has type "ShouldBeInvariant1[int]", variable has type "ShouldBeInvariant1[float]") [assignment] generics_syntax_infer_variance.py:113: error: Incompatible types in assignment (expression has type "ShouldBeInvariant1[float]", variable has type "ShouldBeInvariant1[int]") [assignment] diff --git a/conformance/results/zuban/generics_syntax_scoping.toml b/conformance/results/zuban/generics_syntax_scoping.toml index 6f4596518..f2fdbd44b 100644 --- a/conformance/results/zuban/generics_syntax_scoping.toml +++ b/conformance/results/zuban/generics_syntax_scoping.toml @@ -1,43 +1,16 @@ -conformant = "Partial" -notes = """ -Does not following runtime scoping rules for type parameters in all cases. -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 31: Unexpected errors ['generics_syntax_scoping.py:31: error: Type variable "generics_syntax_scoping.T" is unbound [misc]'] -Line 56: Unexpected errors ['generics_syntax_scoping.py:56: error: Name "S" already defined on line 55 [no-redef]'] -Line 62: Unexpected errors ['generics_syntax_scoping.py:62: error: Expression is of type "TypeVar", not "str" [misc]'] -Line 88: Unexpected errors ['generics_syntax_scoping.py:88: error: Argument 1 has incompatible type "type[ClassE]"; expected "Callable[Never, Never]" [arg-type]'] -Line 90: Unexpected errors ['generics_syntax_scoping.py:90: error: Name "T" already defined on line 89 [no-redef]'] -Line 106: Unexpected errors ['generics_syntax_scoping.py:106: error: Name "T" already defined on line 105 [no-redef]'] -Line 108: Unexpected errors ['generics_syntax_scoping.py:108: error: Expression is of type "TypeVar", not "int" [misc]'] -Line 116: Unexpected errors ['generics_syntax_scoping.py:116: error: Expression is of type "int", not "TypeVar" [misc]'] -Line 121: Unexpected errors ['generics_syntax_scoping.py:121: error: Expression is of type "TypeVar", not "complex" [misc]'] -Line 124: Unexpected errors ['generics_syntax_scoping.py:124: error: Expression is of type "TypeVar", not "complex" [misc]'] """ output = """ generics_syntax_scoping.py:14: error: Variable "generics_syntax_scoping.S" is not valid as a type [valid-type] generics_syntax_scoping.py:14: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases generics_syntax_scoping.py:18: error: Variable "generics_syntax_scoping.T" is not valid as a type [valid-type] generics_syntax_scoping.py:18: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_scoping.py:31: error: Type variable "generics_syntax_scoping.T" is unbound [misc] -generics_syntax_scoping.py:31: note: (Hint: Use "Generic[T]" or "Protocol[T]" base class to bind "T" inside a class) -generics_syntax_scoping.py:31: note: (Hint: Use "T" in function signature to bind "T" inside a function) generics_syntax_scoping.py:35: error: Name "T" is used before definition [used-before-def] -generics_syntax_scoping.py:44: error: Argument 1 has incompatible type "type[ClassD]"; expected "Callable[Never, Never]" [arg-type] generics_syntax_scoping.py:44: error: Name "T" is used before definition [used-before-def] generics_syntax_scoping.py:44: error: Variable "generics_syntax_scoping.T" is not valid as a type [valid-type] generics_syntax_scoping.py:44: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_scoping.py:56: error: Name "S" already defined on line 55 [no-redef] -generics_syntax_scoping.py:62: error: Expression is of type "TypeVar", not "str" [misc] -generics_syntax_scoping.py:88: error: Argument 1 has incompatible type "type[ClassE]"; expected "Callable[Never, Never]" [arg-type] -generics_syntax_scoping.py:90: error: Name "T" already defined on line 89 [no-redef] generics_syntax_scoping.py:92: error: "T" already defined as a type parameter [misc] generics_syntax_scoping.py:95: error: "T" already defined as a type parameter [misc] generics_syntax_scoping.py:98: error: "T" already defined as a type parameter [misc] -generics_syntax_scoping.py:106: error: Name "T" already defined on line 105 [no-redef] -generics_syntax_scoping.py:108: error: Expression is of type "TypeVar", not "int" [misc] -generics_syntax_scoping.py:116: error: Expression is of type "int", not "TypeVar" [misc] -generics_syntax_scoping.py:121: error: Expression is of type "TypeVar", not "complex" [misc] -generics_syntax_scoping.py:124: error: Expression is of type "TypeVar", not "complex" [misc] """ diff --git a/conformance/results/zuban/generics_typevartuple_args.toml b/conformance/results/zuban/generics_typevartuple_args.toml index e3d4632d5..f2d5d1ccf 100644 --- a/conformance/results/zuban/generics_typevartuple_args.toml +++ b/conformance/results/zuban/generics_typevartuple_args.toml @@ -1,11 +1,5 @@ -conformant = "Partial" -notes = """ -Does not enforce that tuples captured by TypeVarTuple are same type. -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 75: Expected 1 errors -Line 76: Expected 1 errors """ output = """ generics_typevartuple_args.py:33: error: Argument 3 to "exec_le" has incompatible type "str"; expected "Env" [arg-type] @@ -16,4 +10,6 @@ generics_typevartuple_args.py:58: error: Too few arguments for "func2" [call-ar generics_typevartuple_args.py:59: error: Too few arguments for "func2" [call-arg] generics_typevartuple_args.py:59: error: Argument 1 to "func2" has incompatible type "str"; expected "int" [arg-type] generics_typevartuple_args.py:67: error: Too few arguments for "func3" [call-arg] +generics_typevartuple_args.py:75: error: Argument 2 to "func4" has incompatible type "tuple[Literal[1], int]"; expected "tuple[int]" [arg-type] +generics_typevartuple_args.py:76: error: Argument 2 to "func4" has incompatible type "tuple[Literal['1']]"; expected "tuple[int]" [arg-type] """ diff --git a/conformance/results/zuban/generics_typevartuple_basic.toml b/conformance/results/zuban/generics_typevartuple_basic.toml index 50dd49ad2..7cea1a8b1 100644 --- a/conformance/results/zuban/generics_typevartuple_basic.toml +++ b/conformance/results/zuban/generics_typevartuple_basic.toml @@ -1,17 +1,5 @@ -conformant = "Partial" -notes = """ -Does not enforce that tuples captured by TypeVarTuple are same length. -Does not enforce that tuples captured by TypeVarTuple are same type. -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 89: Expected 1 errors -Line 90: Expected 1 errors -Line 99: Expected 1 errors -Line 100: Expected 1 errors -Line 54: Unexpected errors ['generics_typevartuple_basic.py:54: error: Incompatible types in assignment (expression has type "tuple[Any]", variable has type "tuple[Unpack[Shape]]") [assignment]'] -Line 57: Unexpected errors ['generics_typevartuple_basic.py:57: error: Incompatible return value type (got "tuple[Unpack[Shape]]", expected "tuple[Any]") [return-value]'] -Line 84: Unexpected errors ['generics_typevartuple_basic.py:84: error: Expression is of type "tuple[Literal[0, 1]]", not "tuple[int]" [misc]'] """ output = """ generics_typevartuple_basic.py:42: error: Argument 1 to "Array" has incompatible type "Height"; expected "tuple[Height, Width]" [arg-type] @@ -19,13 +7,14 @@ generics_typevartuple_basic.py:43: error: Argument 1 to "Array" has incompatible generics_typevartuple_basic.py:45: error: Argument 1 to "Array" has incompatible type "tuple[Time, Batch, Width, Height]"; expected "tuple[Time, Batch, Height, Width]" [arg-type] generics_typevartuple_basic.py:52: error: Free type variable expected in Generic[...] [misc] generics_typevartuple_basic.py:53: error: TypeVarTuple "Shape" is only valid with an unpack [valid-type] -generics_typevartuple_basic.py:54: error: Incompatible types in assignment (expression has type "tuple[Any]", variable has type "tuple[Unpack[Shape]]") [assignment] generics_typevartuple_basic.py:56: error: TypeVarTuple "Shape" is only valid with an unpack [valid-type] -generics_typevartuple_basic.py:57: error: Incompatible return value type (got "tuple[Unpack[Shape]]", expected "tuple[Any]") [return-value] generics_typevartuple_basic.py:59: error: TypeVarTuple "Shape" is only valid with an unpack [valid-type] generics_typevartuple_basic.py:65: error: Unexpected keyword argument "covariant" for "TypeVarTuple" [call-arg] generics_typevartuple_basic.py:66: error: Too many positional arguments for "TypeVarTuple" [call-arg] generics_typevartuple_basic.py:67: error: Unexpected keyword argument "bound" for "TypeVarTuple" [call-arg] -generics_typevartuple_basic.py:84: error: Expression is of type "tuple[Literal[0, 1]]", not "tuple[int]" [misc] +generics_typevartuple_basic.py:89: error: Argument 2 to "func2" has incompatible type "tuple[Literal['0']]"; expected "tuple[int]" [arg-type] +generics_typevartuple_basic.py:90: error: Argument 2 to "func2" has incompatible type "tuple[Literal[0]]"; expected "tuple[int, int]" [arg-type] +generics_typevartuple_basic.py:99: error: Argument 2 to "multiply" has incompatible type "Array[Width]"; expected "Array[Height]" [arg-type] +generics_typevartuple_basic.py:100: error: Argument 2 to "multiply" has incompatible type "Array[Height, Width]"; expected "Array[Height]" [arg-type] generics_typevartuple_basic.py:106: error: Can only use one type var tuple in a class def [misc] """ diff --git a/conformance/results/zuban/generics_upper_bound.toml b/conformance/results/zuban/generics_upper_bound.toml index c1b62c749..4dffa2252 100644 --- a/conformance/results/zuban/generics_upper_bound.toml +++ b/conformance/results/zuban/generics_upper_bound.toml @@ -1,12 +1,8 @@ -conformant = "Partial" -notes = """ -Does not reject use of type variable within an upper bound. -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 24: Expected 1 errors """ output = """ +generics_upper_bound.py:24: error: TypeVar bound must not contain type variables [misc] generics_upper_bound.py:51: error: Value of type variable "ST" of "longer" cannot be "int" [type-var] generics_upper_bound.py:51: error: Value of type variable "ST" of "longer" cannot be "int" [type-var] generics_upper_bound.py:56: error: TypeVar cannot have both values and an upper bound [misc] diff --git a/conformance/results/zuban/generics_variance.toml b/conformance/results/zuban/generics_variance.toml index b051fcdbb..02c8a1f9c 100644 --- a/conformance/results/zuban/generics_variance.toml +++ b/conformance/results/zuban/generics_variance.toml @@ -1,15 +1,5 @@ -conformant = "Partial" -notes = """ -Does not reject use of class-scoped TypeVar used in a base class when variance is incompatible. -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 113: Expected 1 errors -Line 163: Expected 1 errors -Line 167: Expected 1 errors -Line 191: Expected 1 errors -Lines 141, 142: Expected error (tag 'CoContra_Child5') -Lines 195, 196: Expected error (tag 'ContraToContraToContra_WithTA') """ output = """ generics_variance.py:14: error: TypeVar cannot be both covariant and contravariant [misc] @@ -17,6 +7,12 @@ generics_variance.py:77: error: Variance of TypeVar "T_co" incompatible with var generics_variance.py:81: error: Variance of TypeVar "T_contra" incompatible with variance in parent type [type-var] generics_variance.py:93: error: Variance of TypeVar "T_contra" incompatible with variance in parent type [type-var] generics_variance.py:105: error: Variance of TypeVar "T_co" incompatible with variance in parent type [type-var] +generics_variance.py:113: error: Variance of TypeVar "T_co" incompatible with variance in parent type [type-var] generics_variance.py:126: error: Variance of TypeVar "T_co" incompatible with variance in parent type [type-var] generics_variance.py:132: error: Variance of TypeVar "T_contra" incompatible with variance in parent type [type-var] +generics_variance.py:142: error: Variance of TypeVar "T_co" incompatible with variance in parent type [type-var] +generics_variance.py:163: error: Variance of TypeVar "T_contra" incompatible with variance in parent type [type-var] +generics_variance.py:167: error: Variance of TypeVar "T_co" incompatible with variance in parent type [type-var] +generics_variance.py:191: error: Variance of TypeVar "T_contra" incompatible with variance in parent type [type-var] +generics_variance.py:196: error: Variance of TypeVar "T_co" incompatible with variance in parent type [type-var] """ diff --git a/conformance/results/zuban/historical_positional.toml b/conformance/results/zuban/historical_positional.toml index 5d5888464..78a8b6aa0 100644 --- a/conformance/results/zuban/historical_positional.toml +++ b/conformance/results/zuban/historical_positional.toml @@ -1,17 +1,9 @@ -conformant = "Partial" -notes = """ -Does not reject positional-only parameter after non-positional-only parameter. -Treats keyword-only parameter as positional-only. -Applies legacy positional-only rules when PEP 570 syntax is used. -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 26: Expected 1 errors -Line 38: Expected 1 errors -Line 53: Unexpected errors ['historical_positional.py:53: error: Unexpected keyword argument "__y" for "f4" [call-arg]'] """ output = """ historical_positional.py:18: error: Unexpected keyword argument "__x" for "f1" [call-arg] +historical_positional.py:26: error: A positional only param starting with two underscores is not allowed after a positional or keyword param [misc] +historical_positional.py:38: error: A positional only param starting with two underscores is not allowed after a positional or keyword param [misc] historical_positional.py:43: error: Unexpected keyword argument "__x" for "m1" of "A" [call-arg] -historical_positional.py:53: error: Unexpected keyword argument "__y" for "f4" [call-arg] """ diff --git a/conformance/results/zuban/literals_interactions.toml b/conformance/results/zuban/literals_interactions.toml index 40c6f282b..242baa2f2 100644 --- a/conformance/results/zuban/literals_interactions.toml +++ b/conformance/results/zuban/literals_interactions.toml @@ -1,17 +1,9 @@ -conformant = "Partial" -notes = """ -Does not narrow type of `x` with `x in Literal` type guard pattern. -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 106: Unexpected errors ['literals_interactions.py:106: error: Argument 1 to "expects_bad_status" has incompatible type "str"; expected "Literal[\\'MALFORMED\\', \\'ABORTED\\']" [arg-type]'] -Line 109: Unexpected errors ['literals_interactions.py:109: error: Argument 1 to "expects_pending_status" has incompatible type "str"; expected "Literal[\\'PENDING\\']" [arg-type]'] """ output = """ literals_interactions.py:15: error: Tuple index out of range [misc] literals_interactions.py:16: error: Tuple index out of range [misc] literals_interactions.py:17: error: Tuple index out of range [misc] literals_interactions.py:18: error: Tuple index out of range [misc] -literals_interactions.py:106: error: Argument 1 to "expects_bad_status" has incompatible type "str"; expected "Literal['MALFORMED', 'ABORTED']" [arg-type] -literals_interactions.py:109: error: Argument 1 to "expects_pending_status" has incompatible type "str"; expected "Literal['PENDING']" [arg-type] """ diff --git a/conformance/results/zuban/namedtuples_define_class.toml b/conformance/results/zuban/namedtuples_define_class.toml index 67acdb24b..e2e3edeb4 100644 --- a/conformance/results/zuban/namedtuples_define_class.toml +++ b/conformance/results/zuban/namedtuples_define_class.toml @@ -1,11 +1,7 @@ -conformant = "Partial" notes = """ -Does not reject override of named tuple attribute in child class. """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 106: Expected 1 errors -Line 59: Unexpected errors ['namedtuples_define_class.py:59: error: Invalid statement in NamedTuple definition; expected "field_name: field_type [= default]" [misc]'] """ output = """ namedtuples_define_class.py:32: error: Tuple index out of range [misc] @@ -16,10 +12,10 @@ namedtuples_define_class.py:46: error: Argument 2 to "Point" has incompatible ty namedtuples_define_class.py:47: error: Argument "units" to "Point" has incompatible type "int"; expected "str" [arg-type] namedtuples_define_class.py:48: error: Too many arguments for "Point" [call-arg] namedtuples_define_class.py:49: error: Unexpected keyword argument "other" for "Point" [call-arg] -namedtuples_define_class.py:59: error: Invalid statement in NamedTuple definition; expected "field_name: field_type [= default]" [misc] namedtuples_define_class.py:69: error: Too many arguments for "Point2" [call-arg] namedtuples_define_class.py:76: error: NamedTuple field name cannot start with an underscore: _y [misc] namedtuples_define_class.py:86: error: Non-default NamedTuple fields cannot follow default fields [misc] +namedtuples_define_class.py:106: error: NamedTuple attributes cannot be overridden in subclasses [misc] namedtuples_define_class.py:125: error: Argument 2 to "Property" has incompatible type "float"; expected "str" [arg-type] namedtuples_define_class.py:132: error: NamedTuple should be a single base [misc] """ diff --git a/conformance/results/zuban/overloads_evaluation.toml b/conformance/results/zuban/overloads_evaluation.toml index 300c1fff5..0e3b48cf8 100644 --- a/conformance/results/zuban/overloads_evaluation.toml +++ b/conformance/results/zuban/overloads_evaluation.toml @@ -1,23 +1,5 @@ -conformant = "Partial" -notes = """ -Does not expand boolean arguments to Literal[True] and Literal[False]. -Does not expand enum arguments to literal variants. -Does not expand tuple arguments to possible combinations. -Does not evaluate Any in some cases where overload is ambiguous. -Evaluates Any in some cases where overload is not ambiguous. -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 135: Unexpected errors ['overloads_evaluation.py:135: error: No overload variant of "expand_bool" matches argument type "bool" [call-overload]'] -Line 136: Unexpected errors ['overloads_evaluation.py:136: error: Expression is of type "Any", not "Literal[0, 1]" [misc]'] -Line 161: Unexpected errors ['overloads_evaluation.py:161: error: No overload variant of "expand_enum" matches argument type "Color" [call-overload]'] -Line 162: Unexpected errors ['overloads_evaluation.py:162: error: Expression is of type "Any", not "Literal[0, 1]" [misc]'] -Line 205: Unexpected errors ['overloads_evaluation.py:205: error: Argument 1 to "expand_tuple" has incompatible type "tuple[int, int | str]"; expected "tuple[int, int]" [arg-type]'] -Line 206: Unexpected errors ['overloads_evaluation.py:206: error: Expression is of type "int", not "int | str" [misc]'] -Line 262: Unexpected errors ['overloads_evaluation.py:262: error: Expression is of type "list[Any]", not "list[int]" [misc]'] -Line 265: Unexpected errors ['overloads_evaluation.py:265: error: Expression is of type "list[Any]", not "Any" [misc]'] -Line 281: Unexpected errors ['overloads_evaluation.py:281: error: Expression is of type "list[Any]", not "Any" [misc]'] -Line 347: Unexpected errors ['overloads_evaluation.py:347: error: Expression is of type "list[Any]", not "Any" [misc]'] """ output = """ overloads_evaluation.py:38: error: All overload variants of "example1_1" require at least one argument [call-overload] @@ -34,20 +16,4 @@ overloads_evaluation.py:51: note: def example1_1(x: int, y: str) -> int overloads_evaluation.py:51: note: def example1_1(x: str) -> str overloads_evaluation.py:116: error: Argument 1 to "example2" has incompatible type "int | str"; expected "int" [arg-type] overloads_evaluation.py:116: error: Argument 2 to "example2" has incompatible type "int | str"; expected "str" [arg-type] -overloads_evaluation.py:135: error: No overload variant of "expand_bool" matches argument type "bool" [call-overload] -overloads_evaluation.py:135: note: Possible overload variants: -overloads_evaluation.py:135: note: def expand_bool(x: Literal[False]) -> Literal[0] -overloads_evaluation.py:135: note: def expand_bool(x: Literal[True]) -> Literal[1] -overloads_evaluation.py:136: error: Expression is of type "Any", not "Literal[0, 1]" [misc] -overloads_evaluation.py:161: error: No overload variant of "expand_enum" matches argument type "Color" [call-overload] -overloads_evaluation.py:161: note: Possible overload variants: -overloads_evaluation.py:161: note: def expand_enum(x: Literal[Color.RED]) -> Literal[0] -overloads_evaluation.py:161: note: def expand_enum(x: Literal[Color.BLUE]) -> Literal[1] -overloads_evaluation.py:162: error: Expression is of type "Any", not "Literal[0, 1]" [misc] -overloads_evaluation.py:205: error: Argument 1 to "expand_tuple" has incompatible type "tuple[int, int | str]"; expected "tuple[int, int]" [arg-type] -overloads_evaluation.py:206: error: Expression is of type "int", not "int | str" [misc] -overloads_evaluation.py:262: error: Expression is of type "list[Any]", not "list[int]" [misc] -overloads_evaluation.py:265: error: Expression is of type "list[Any]", not "Any" [misc] -overloads_evaluation.py:281: error: Expression is of type "list[Any]", not "Any" [misc] -overloads_evaluation.py:347: error: Expression is of type "list[Any]", not "Any" [misc] """ diff --git a/conformance/results/zuban/protocols_definition.toml b/conformance/results/zuban/protocols_definition.toml index b4ca17e49..a0316e0ea 100644 --- a/conformance/results/zuban/protocols_definition.toml +++ b/conformance/results/zuban/protocols_definition.toml @@ -1,13 +1,5 @@ -conformant = "Partial" -notes = """ -Does not detect protocol mismatch if concrete method is missing annotations. -Does not detect protocol mismatch if concrete method's parameters are position-only. -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 285: Expected 1 errors -Line 286: Expected 1 errors -Line 288: Expected 1 errors """ output = """ protocols_definition.py:30: error: List item 0 has incompatible type "int"; expected "SupportsClose" [list-item] @@ -39,12 +31,30 @@ protocols_definition.py:218: error: Incompatible types in assignment (expression protocols_definition.py:218: note: Following member(s) of "Concrete4_Bad1" have conflicts: protocols_definition.py:218: note: val1: expected "Sequence[float]", got "Callable[[], Sequence[int]]" protocols_definition.py:219: error: Incompatible types in assignment (expression has type "Concrete4_Bad2", variable has type "Template4") [assignment] +protocols_definition.py:285: error: Incompatible types in assignment (expression has type "Concrete5_Bad1", variable has type "Template5") [assignment] +protocols_definition.py:285: note: Following member(s) of "Concrete5_Bad1" have conflicts: +protocols_definition.py:285: note: Expected: +protocols_definition.py:285: note: def method1(self, a: int, b: int) -> float +protocols_definition.py:285: note: Got: +protocols_definition.py:285: note: def method1(self, a: Any, c: Any) -> int +protocols_definition.py:286: error: Incompatible types in assignment (expression has type "Concrete5_Bad2", variable has type "Template5") [assignment] +protocols_definition.py:286: note: Following member(s) of "Concrete5_Bad2" have conflicts: +protocols_definition.py:286: note: Expected: +protocols_definition.py:286: note: def method1(self, a: int, b: int) -> float +protocols_definition.py:286: note: Got: +protocols_definition.py:286: note: def method1(self, a: int, c: int) -> int protocols_definition.py:287: error: Incompatible types in assignment (expression has type "Concrete5_Bad3", variable has type "Template5") [assignment] protocols_definition.py:287: note: Following member(s) of "Concrete5_Bad3" have conflicts: protocols_definition.py:287: note: Expected: protocols_definition.py:287: note: def method1(self, a: int, b: int) -> float protocols_definition.py:287: note: Got: protocols_definition.py:287: note: def method1(self, *, a: int, b: int) -> float +protocols_definition.py:288: error: Incompatible types in assignment (expression has type "Concrete5_Bad4", variable has type "Template5") [assignment] +protocols_definition.py:288: note: Following member(s) of "Concrete5_Bad4" have conflicts: +protocols_definition.py:288: note: Expected: +protocols_definition.py:288: note: def method1(self, a: int, b: int) -> float +protocols_definition.py:288: note: Got: +protocols_definition.py:288: note: def method1(self, int, int, /) -> float protocols_definition.py:289: error: Incompatible types in assignment (expression has type "Concrete5_Bad5", variable has type "Template5") [assignment] protocols_definition.py:289: note: Following member(s) of "Concrete5_Bad5" have conflicts: protocols_definition.py:289: note: Expected: diff --git a/conformance/results/zuban/protocols_runtime_checkable.toml b/conformance/results/zuban/protocols_runtime_checkable.toml index aec23be68..faa978c8e 100644 --- a/conformance/results/zuban/protocols_runtime_checkable.toml +++ b/conformance/results/zuban/protocols_runtime_checkable.toml @@ -1,12 +1,5 @@ -conformant = "Partial" -notes = """ -Does not report unsafe overlap for runtime_checkable protocol. -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 88: Expected 1 errors -Line 92: Expected 1 errors -Line 96: Expected 1 errors """ output = """ protocols_runtime_checkable.py:23: error: Only @runtime_checkable protocols can be used with instance and class checks [misc] @@ -14,4 +7,9 @@ protocols_runtime_checkable.py:55: error: Only protocols that don't have non-met protocols_runtime_checkable.py:55: note: Protocol "DataProtocol" has non-method member(s): name protocols_runtime_checkable.py:61: error: Only protocols that don't have non-method members can be used with issubclass() [misc] protocols_runtime_checkable.py:61: note: Protocol "DataProtocol" has non-method member(s): name +protocols_runtime_checkable.py:88: error: Subclass of "Concrete3A" and "Proto3" cannot exist: would have incompatible method signatures [unreachable] +protocols_runtime_checkable.py:92: error: Subclass of "Concrete3B" and "Proto3" cannot exist: would have incompatible method signatures [unreachable] +protocols_runtime_checkable.py:92: error: Subclass of "Concrete3B" and "NonDataProtocol" cannot exist: would have incompatible method signatures [unreachable] +protocols_runtime_checkable.py:96: error: Subclass of "Concrete3A" and "Proto3" cannot exist: would have incompatible method signatures [unreachable] +protocols_runtime_checkable.py:96: error: Subclass of "Concrete3A" and "NonDataProtocol" cannot exist: would have incompatible method signatures [unreachable] """ diff --git a/conformance/results/zuban/qualifiers_final_annotation.toml b/conformance/results/zuban/qualifiers_final_annotation.toml index 98d471086..32a15ea44 100644 --- a/conformance/results/zuban/qualifiers_final_annotation.toml +++ b/conformance/results/zuban/qualifiers_final_annotation.toml @@ -1,14 +1,5 @@ -conformant = "Partial" -notes = """ -Does not treat use of Final name as if it was replaced by the literal in NamedTuple definition. -Does not allow conditional assignment of Final instance variable in __init__ method. -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 134: Expected 1 errors -Line 135: Expected 1 errors -Line 59: Unexpected errors ['qualifiers_final_annotation.py:59: error: Cannot assign to final attribute "ID6" [misc]'] -Line 131: Unexpected errors ['qualifiers_final_annotation.py:131: error: Invalid "NamedTuple()" field name [misc]'] """ output = """ qualifiers_final_annotation.py:16: error: Type in Final[...] can only be omitted if there is an initializer [misc] @@ -16,7 +7,6 @@ qualifiers_final_annotation.py:18: error: Final[...] takes at most one type argu qualifiers_final_annotation.py:34: error: Type in Final[...] can only be omitted if there is an initializer [misc] qualifiers_final_annotation.py:38: error: Final name must be initialized with a value [misc] qualifiers_final_annotation.py:54: error: Cannot assign to final attribute "ID5" [misc] -qualifiers_final_annotation.py:59: error: Cannot assign to final attribute "ID6" [misc] qualifiers_final_annotation.py:62: error: Can only declare a final attribute in class body or __init__ [misc] qualifiers_final_annotation.py:63: error: Can only declare a final attribute in class body or __init__ [misc] qualifiers_final_annotation.py:65: error: Cannot assign to final attribute "ID7" [misc] @@ -28,7 +18,9 @@ qualifiers_final_annotation.py:107: error: Final can be only used as an outermos qualifiers_final_annotation.py:108: error: Invalid Type: ClassVar nested inside other type [misc] qualifiers_final_annotation.py:118: error: Final can be only used as an outermost qualifier in a variable annotation [misc] qualifiers_final_annotation.py:121: error: Final can be only used as an outermost qualifier in a variable annotation [misc] -qualifiers_final_annotation.py:131: error: Invalid "NamedTuple()" field name [misc] +qualifiers_final_annotation.py:134: error: Unexpected keyword argument "a" for "N" [call-arg] +qualifiers_final_annotation.py:135: error: Argument "x" to "N" has incompatible type "str"; expected "int" [arg-type] +qualifiers_final_annotation.py:135: error: Argument "y" to "N" has incompatible type "str"; expected "int" [arg-type] qualifiers_final_annotation.py:141: error: Cannot assign to final name "ID1" [misc] qualifiers_final_annotation.py:145: error: Cannot assign to final name "x" [misc] qualifiers_final_annotation.py:147: error: Cannot assign to final name "x" [misc] diff --git a/conformance/results/zuban/specialtypes_never.toml b/conformance/results/zuban/specialtypes_never.toml index 5face3bbf..efd39676b 100644 --- a/conformance/results/zuban/specialtypes_never.toml +++ b/conformance/results/zuban/specialtypes_never.toml @@ -3,8 +3,9 @@ errors_diff = """ """ output = """ specialtypes_never.py:19: error: Implicit return in function which does not return [misc] -specialtypes_never.py:86: error: Incompatible types in assignment (expression has type "list[Never]", variable has type "list[int]") [assignment] -specialtypes_never.py:86: note: "List" is invariant -- see https://mypy.readthedocs.io/en/stable/common_issues.html#variance -specialtypes_never.py:86: note: Consider using "Sequence" instead, which is covariant -specialtypes_never.py:105: error: Incompatible return value type (got "ClassC[Never]", expected "ClassC[U]") [return-value] +specialtypes_never.py:32: error: Statement is unreachable [unreachable] +specialtypes_never.py:87: error: Incompatible types in assignment (expression has type "list[Never]", variable has type "list[int]") [assignment] +specialtypes_never.py:87: note: "List" is invariant -- see https://mypy.readthedocs.io/en/stable/common_issues.html#variance +specialtypes_never.py:87: note: Consider using "Sequence" instead, which is covariant +specialtypes_never.py:106: error: Incompatible return value type (got "ClassC[Never]", expected "ClassC[U]") [return-value] """ diff --git a/conformance/results/zuban/tuples_type_compat.toml b/conformance/results/zuban/tuples_type_compat.toml index d712468bb..a32b872d5 100644 --- a/conformance/results/zuban/tuples_type_compat.toml +++ b/conformance/results/zuban/tuples_type_compat.toml @@ -1,4 +1,3 @@ -conformant = "Pass" conformance_automated = "Pass" errors_diff = """ """ diff --git a/conformance/results/zuban/typeddicts_alt_syntax.toml b/conformance/results/zuban/typeddicts_alt_syntax.toml index afb3f8a67..a9440e734 100644 --- a/conformance/results/zuban/typeddicts_alt_syntax.toml +++ b/conformance/results/zuban/typeddicts_alt_syntax.toml @@ -1,7 +1,4 @@ conformance_automated = "Pass" -notes = """ -Does not support keyword-argument form of alternative syntax (deprecated in 3.11). -""" errors_diff = """ """ output = """ diff --git a/conformance/results/zuban/typeddicts_readonly_inheritance.toml b/conformance/results/zuban/typeddicts_readonly_inheritance.toml index 1cc7d5751..d40209993 100644 --- a/conformance/results/zuban/typeddicts_readonly_inheritance.toml +++ b/conformance/results/zuban/typeddicts_readonly_inheritance.toml @@ -1,31 +1,15 @@ -conformant = "Partial" -notes = """ -Incorrectly rejects non-ReadOnly override of ReadOnly item. -Incorrectly rejects override of ReadOnly item with another ReadOnly item with narrower type. -Incorrectly rejects override of NotRequired ReadOnly item with a Required ReadOnly item. -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 19: Unexpected errors ['typeddicts_readonly_inheritance.py:19: error: Overwriting TypedDict field "name" while extending [misc]'] -Line 49: Unexpected errors ['typeddicts_readonly_inheritance.py:49: error: Overwriting TypedDict field "albums" while extending [misc]'] -Line 62: Unexpected errors ['typeddicts_readonly_inheritance.py:62: error: Overwriting TypedDict field "name" while extending [misc]'] -Line 76: Unexpected errors ['typeddicts_readonly_inheritance.py:76: error: Overwriting TypedDict field "ident" while extending [misc]'] -Line 102: Unexpected errors ['typeddicts_readonly_inheritance.py:102: error: Overwriting TypedDict field "b" while extending [misc]'] """ output = """ -typeddicts_readonly_inheritance.py:19: error: Overwriting TypedDict field "name" while extending [misc] typeddicts_readonly_inheritance.py:36: error: ReadOnly TypedDict key "name" TypedDict is mutated [typeddict-readonly-mutated] -typeddicts_readonly_inheritance.py:49: error: Overwriting TypedDict field "albums" while extending [misc] typeddicts_readonly_inheritance.py:50: error: Overwriting TypedDict field "alt" while extending [misc] -typeddicts_readonly_inheritance.py:62: error: Overwriting TypedDict field "name" while extending [misc] typeddicts_readonly_inheritance.py:65: error: Missing key "name" for TypedDict "RequiredName" [typeddict-item] -typeddicts_readonly_inheritance.py:76: error: Overwriting TypedDict field "ident" while extending [misc] typeddicts_readonly_inheritance.py:82: error: Value of "ident" has incompatible type "int"; expected "str" [typeddict-item] typeddicts_readonly_inheritance.py:83: error: Incompatible types (expression has type "int", TypedDict item "ident" has type "str") [typeddict-item] typeddicts_readonly_inheritance.py:84: error: Missing key "ident" for TypedDict "User" [typeddict-item] typeddicts_readonly_inheritance.py:94: error: Overwriting TypedDict field "a" while extending [misc] typeddicts_readonly_inheritance.py:98: error: Overwriting TypedDict field "a" while extending [misc] -typeddicts_readonly_inheritance.py:102: error: Overwriting TypedDict field "b" while extending [misc] typeddicts_readonly_inheritance.py:106: error: Overwriting TypedDict field "c" while extending [misc] typeddicts_readonly_inheritance.py:119: error: Overwriting TypedDict field "x" while merging [misc] typeddicts_readonly_inheritance.py:119: error: Overwriting TypedDict field "y" while merging [misc] diff --git a/conformance/results/zuban/typeddicts_readonly_update.toml b/conformance/results/zuban/typeddicts_readonly_update.toml index 54c32eb20..c5069c3d5 100644 --- a/conformance/results/zuban/typeddicts_readonly_update.toml +++ b/conformance/results/zuban/typeddicts_readonly_update.toml @@ -1,10 +1,6 @@ -conformant = "Partial" -notes = """ -Incorrectly allows update of ReadOnly item. -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 23: Expected 1 errors """ output = """ +typeddicts_readonly_update.py:23: error: TypedDict member "x" is read-only [misc] """ diff --git a/conformance/results/zuban/version.toml b/conformance/results/zuban/version.toml index 7c3e030de..b9b7c1b8d 100644 --- a/conformance/results/zuban/version.toml +++ b/conformance/results/zuban/version.toml @@ -1 +1 @@ -version = "zuban 0.3.0" +version = "zuban 0.4.1" diff --git a/conformance/src/type_checker.py b/conformance/src/type_checker.py index c373fc4f0..7406a8ac0 100644 --- a/conformance/src/type_checker.py +++ b/conformance/src/type_checker.py @@ -233,11 +233,8 @@ def run_tests(self, test_files: Sequence[str]) -> dict[str, str]: "zuban", "check", ".", - "--disable-error-code", - "empty-body", "--enable-error-code", "deprecated", - "--no-warn-unreachable", ] proc = run(command, stdout=PIPE, text=True, encoding="utf-8") lines = proc.stdout.split("\n") diff --git a/conformance/tests/generics_base_class.py b/conformance/tests/generics_base_class.py index 61de59455..f58162108 100644 --- a/conformance/tests/generics_base_class.py +++ b/conformance/tests/generics_base_class.py @@ -1,6 +1,6 @@ # Specification: https://typing.readthedocs.io/en/latest/spec/generics.html#arbitrary-generic-types-as-base-classes -from typing import Generic, TypeVar, Iterable, assert_type +from typing import Generic, TypeVar, assert_type T = TypeVar("T") diff --git a/conformance/tests/generics_defaults.py b/conformance/tests/generics_defaults.py index e1a4fb04c..49fbd6cd8 100644 --- a/conformance/tests/generics_defaults.py +++ b/conformance/tests/generics_defaults.py @@ -168,5 +168,6 @@ def meth(self, /) -> Self: attr: DefaultIntT -assert_type(Foo7.meth, Callable[[Foo7[int]], Foo7[int]]) +foo7 = Foo7() +assert_type(Foo7.meth(foo7), Foo7[int]) assert_type(Foo7().attr, int) diff --git a/conformance/tests/generics_scoping.py b/conformance/tests/generics_scoping.py index 9b6ec7d18..442e1a8d1 100644 --- a/conformance/tests/generics_scoping.py +++ b/conformance/tests/generics_scoping.py @@ -77,7 +77,7 @@ class Bad(Iterable[T]): # E class AlsoBad: x: list[T] # E - def __init__(self, x: list[T]) -> None: + def __init__(self, x: list[T]) -> None: # E? self.x = x class Inner(Iterable[S]): # OK diff --git a/conformance/tests/specialtypes_never.py b/conformance/tests/specialtypes_never.py index 41b624e38..6d8adb92d 100644 --- a/conformance/tests/specialtypes_never.py +++ b/conformance/tests/specialtypes_never.py @@ -29,6 +29,7 @@ def func2(x: int) -> int: if x > 0: return x stop() + ... # E?: This statement can be marked unreachable return "whatever works" # No type error From 20096eeba502b1bf955fcf62b389adbaa63fc61b Mon Sep 17 00:00:00 2001 From: Shantanu <12621235+hauntsaninja@users.noreply.github.com> Date: Wed, 21 Jan 2026 16:19:22 -0800 Subject: [PATCH 166/308] Add disclaimer to conformance results (#2155) --- conformance/results/results.html | 16 +++++++++++++++- conformance/src/results_template.html | 16 +++++++++++++++- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/conformance/results/results.html b/conformance/results/results.html index cc9b4f3ec..407f5de05 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -21,7 +21,7 @@ background-color: #333; color: #fff; text-align: center; - padding: 8px; + padding: 10px 16px 12px; } table { @@ -148,6 +148,15 @@ .hover-text { position: relative; } + + .disclaimer { + margin: 6px auto 0; + max-width: 720px; + font-size: 12px; + line-height: 1.4; + font-weight: normal; + color: #d6d6d6; + } @@ -155,6 +164,11 @@

    Python Type System Conformance Test Results

    +

    + While spec conformance is important for the ecosystem, we don't recommend using it + as the primary basis for choosing a type checker. It is not representative + of many of the things users typically care about. +

    diff --git a/conformance/src/results_template.html b/conformance/src/results_template.html index cd548256c..214f778ed 100644 --- a/conformance/src/results_template.html +++ b/conformance/src/results_template.html @@ -21,7 +21,7 @@ background-color: #333; color: #fff; text-align: center; - padding: 8px; + padding: 10px 16px 12px; } table { @@ -148,6 +148,15 @@ .hover-text { position: relative; } + + .disclaimer { + margin: 6px auto 0; + max-width: 720px; + font-size: 12px; + line-height: 1.4; + font-weight: normal; + color: #d6d6d6; + } @@ -155,6 +164,11 @@

    Python Type System Conformance Test Results

    +

    + While spec conformance is important for the ecosystem, we don't recommend using it + as the primary basis for choosing a type checker. It is not representative + of many of the things users typically care about. +

    {{summary}} -
    - + selector.addEventListener("change", (event) => { + localStorage.setItem("color-scheme", event.target.value); + }); - + selector.value = localStorage.getItem("color-scheme") ?? "auto"; + + + \ No newline at end of file diff --git a/conformance/results/ty/annotations_forward_refs.toml b/conformance/results/ty/annotations_forward_refs.toml index 5944683d0..d176548df 100644 --- a/conformance/results/ty/annotations_forward_refs.toml +++ b/conformance/results/ty/annotations_forward_refs.toml @@ -1,7 +1,7 @@ conformance_automated = "Fail" conformant = "Partial" notes = """ -Resolves references in type annotations as referring to end-of-scope types (https://discuss.python.org/t/annotation-string-references-in-class-scope-in-conformance-tests/105439, https://github.com/python/typing/pull/2144) +Resolves references in type annotations as referring to end-of-scope types (, ) """ errors_diff = """ Line 87: Unexpected errors ['annotations_forward_refs.py:87:9: error[invalid-type-form] Function `int` is not valid in a type expression'] diff --git a/conformance/results/ty/generics_scoping.toml b/conformance/results/ty/generics_scoping.toml index b37df7322..330fcd0a8 100644 --- a/conformance/results/ty/generics_scoping.toml +++ b/conformance/results/ty/generics_scoping.toml @@ -2,7 +2,7 @@ conformance_automated = "Fail" conformant = "Partial" notes = """ Does not reject `list[T]()` in the global scope, where `T` is an unbound type variable. -Does nto reject `alias: TypeAlias = list[T]` in the body scope of a class generic over a type variable `T`. +Does not reject `alias: TypeAlias = list[T]` in the body scope of a class generic over a type variable `T`. """ errors_diff = """ Line 98: Expected 1 errors diff --git a/conformance/results/ty/generics_typevartuple_args.toml b/conformance/results/ty/generics_typevartuple_args.toml index 7de7af540..826f3333d 100644 --- a/conformance/results/ty/generics_typevartuple_args.toml +++ b/conformance/results/ty/generics_typevartuple_args.toml @@ -1,7 +1,7 @@ conformance_automated = "Fail" conformant = "Partial" notes = """ -Supports PEP-646 unpacked tuples but not TypeVarTuple. +Supports PEP-646 unpacked tuples but not `TypeVarTuple`. """ errors_diff = """ Line 33: Expected 1 errors diff --git a/conformance/results/zuban/enums_member_values.toml b/conformance/results/zuban/enums_member_values.toml index 9705e064b..0e71e68fa 100644 --- a/conformance/results/zuban/enums_member_values.toml +++ b/conformance/results/zuban/enums_member_values.toml @@ -1,5 +1,3 @@ -notes = """ -""" conformance_automated = "Pass" errors_diff = """ """ diff --git a/conformance/results/zuban/enums_members.toml b/conformance/results/zuban/enums_members.toml index 5176996e0..532bcb874 100644 --- a/conformance/results/zuban/enums_members.toml +++ b/conformance/results/zuban/enums_members.toml @@ -1,5 +1,3 @@ -notes = """ -""" conformance_automated = "Pass" errors_diff = """ """ diff --git a/conformance/src/main.py b/conformance/src/main.py index 005b3bd98..63f82ea72 100644 --- a/conformance/src/main.py +++ b/conformance/src/main.py @@ -2,14 +2,14 @@ Type system conformance test for static type checkers. """ -import os -from pathlib import Path +import contextlib import re import sys +import tomllib +from pathlib import Path from time import time from typing import Sequence -import tomli import tomlkit from options import parse_options @@ -182,11 +182,11 @@ def update_output_for_test( # Read the existing results file if present. try: with open(results_file, "rb") as f: - existing_results = tomli.load(f) + existing_results = tomllib.load(f) except FileNotFoundError: should_write = True existing_results = {} - except tomli.TOMLDecodeError: + except tomllib.TOMLDecodeError: print(f"Error decoding {results_file}") existing_results = {} @@ -244,10 +244,10 @@ def update_type_checker_info(type_checker: TypeChecker, root_dir: Path): # Read the existing version file if present. try: with open(version_file, "rb") as f: - existing_info = tomli.load(f) + existing_info = tomllib.load(f) except FileNotFoundError: existing_info = {} - except tomli.TOMLDecodeError: + except tomllib.TOMLDecodeError: print(f"Error decoding {version_file}") existing_info = {} @@ -275,16 +275,16 @@ def main(): test_cases = get_test_cases(test_groups, tests_dir) # Switch to the tests directory. - os.chdir(tests_dir) - - # Run each test case with each type checker. - for type_checker in TYPE_CHECKERS: - if options.only_run and options.only_run != type_checker.name: - continue - if not type_checker.install(): - print(f"Skipping tests for {type_checker.name}") - else: - run_tests(root_dir, type_checker, test_cases, verbose=options.verbose) + with contextlib.chdir(tests_dir): + + # Run each test case with each type checker. + for type_checker in TYPE_CHECKERS: + if options.only_run and options.only_run != type_checker.name: + continue + if not type_checker.install(): + print(f"Skipping tests for {type_checker.name}") + else: + run_tests(root_dir, type_checker, test_cases, verbose=options.verbose) # Generate a summary report. generate_summary(root_dir) diff --git a/conformance/src/reporting.py b/conformance/src/reporting.py index cff2dc465..63e2fd1f7 100644 --- a/conformance/src/reporting.py +++ b/conformance/src/reporting.py @@ -2,121 +2,226 @@ Generates a summary of the type checker conformant tests. """ +import itertools +import operator +import tomllib +from collections.abc import Sequence +from dataclasses import dataclass, field +from decimal import Decimal from pathlib import Path -import tomli +import jinja2 +import markdown +import markupsafe from test_groups import get_test_cases, get_test_groups -from type_checker import TYPE_CHECKERS +from type_checker import TYPE_CHECKERS, TypeChecker + + +@dataclass(frozen=True, kw_only=True, slots=True) +class TestResult: + type_checker: str + conformance: str + notes: list[markupsafe.Markup] = field(default_factory=list) + + +@dataclass(frozen=True, kw_only=True, slots=True) +class TestCase: + name: str + results: list[TestResult] = field(default_factory=list) + + +@dataclass(frozen=True, kw_only=True, slots=True) +class TestStat: + type_checker: str + total: int + passed: Decimal + + @property + def percentage(self) -> str: + return f"{self.passed / self.total:.1%}" + + +@dataclass(frozen=True, kw_only=True, slots=True) +class TestGroup: + slug: str + name: str + href: str + paths: list[Path] = field(default_factory=list) + cases: list[TestCase] = field(default_factory=list) + stats: list[TestStat] = field(default_factory=list) def generate_summary(root_dir: Path): print("Generating summary report") - template_file = root_dir / "src" / "results_template.html" - with open(template_file, "r") as f: - template = f.read() - summary = template.replace("{{summary}}", generate_summary_html(root_dir)) + env = jinja2.Environment( + loader=jinja2.FileSystemLoader(root_dir.joinpath("src/templates")), + autoescape=jinja2.select_autoescape(), + ) + env.filters["conformance_class"] = _conformance_class + + template = env.get_template("base.html") + + type_checkers = sorted(TYPE_CHECKERS, key=operator.attrgetter("name")) - results_file = root_dir / "results" / "results.html" + groups = _get_groups(root_dir, type_checkers) + totals = _get_totals(groups) + versions = _get_versions(root_dir, type_checkers) - with open(results_file, "w") as f: - f.write(summary) + results = template.render(groups=groups, totals=totals, versions=versions) + root_dir.joinpath("results", "results.html").write_text(results) -def generate_summary_html(root_dir: Path) -> str: - column_count = len(TYPE_CHECKERS) + 1 + +def _conformance_class(value: str) -> str: + if value == "Pass": + return "conformant" + if value == "Partial": + return "partially-conformant" + return "not-conformant" + + +def _get_groups( + root_dir: Path, + type_checkers: Sequence[TypeChecker], +) -> list[TestGroup]: test_groups = get_test_groups(root_dir) test_cases = get_test_cases(test_groups, root_dir / "tests") - summary_html = ['
     
    '] - summary_html.append('') + groups = [] + + for test_group_slug, test_group in test_groups.items(): + paths = sorted( + [ + case + for case in test_cases + if case.name.startswith(f"{test_group_slug}_") + ], + key=operator.attrgetter("name"), + ) + + # Skip if there are no test cases in the group. + if not paths: + continue + + group = TestGroup( + slug=test_group_slug, + name=test_group.name, + href=test_group.href, + paths=paths, + ) + groups.append(group) + + for path in group.paths: + case = TestCase(name=path.stem) + group.cases.append(case) + + for type_checker in type_checkers: + result_path = ( + root_dir / "results" / type_checker.name / f"{case.name}.toml" + ) + try: + with result_path.open("rb") as f: + data = tomllib.load(f) + except FileNotFoundError: + data = {} + + conformance = data.get("conformant") + if not conformance: + # Try to look up the automated test results and use that if the test passes. + automated = data.get("conformance_automated") + conformance = "Pass" if automated == "Pass" else "Unknown" + + notes = [ + markupsafe.Markup( + markdown.markdown(note, output_format="html") + .removeprefix("

    ") + .removesuffix("

    ") + ) + for note in data.get("notes", "").strip().splitlines() + ] + + result = TestResult( + type_checker=type_checker.name, + conformance=conformance, + notes=notes, + ) + case.results.append(result) + + for n, type_checker in enumerate(type_checkers): + passed = Decimal("0.0") + + for case in group.cases: + match case.results[n].conformance: + case "Pass": + passed += Decimal("1.0") + case "Partial": + # For partial support, give half a mark :) + passed += Decimal("0.5") + + stat = TestStat( + type_checker=type_checker.name, + total=len(group.paths), + passed=_remove_exponent(passed), + ) + group.stats.append(stat) - for type_checker in TYPE_CHECKERS: - # Load the version file for the type checker. - version_file = root_dir / "results" / type_checker.name / "version.toml" + return groups - try: - with open(version_file, "rb") as f: - existing_info = tomli.load(f) - except FileNotFoundError: - existing_info = {} - except tomli.TOMLDecodeError: - print(f"Error decoding {version_file}") - existing_info = {} - version = existing_info["version"] or "Unknown version" +def _get_totals(groups: list[TestGroup]) -> list[TestStat]: + totals = [] - summary_html.append(f"") + # As we already sort by type checker above, we can sort and group by here and maintain the + # correct order for the totals output. + ordered = sorted( + [stat for group in groups for stat in group.stats], + key=operator.attrgetter("type_checker"), + ) - summary_html.append("") + for type_checker, stats_it in itertools.groupby( + ordered, operator.attrgetter("type_checker") + ): + stats = list(stats_it) + total = TestStat( + type_checker=type_checker, + total=sum([stat.total for stat in stats]), + passed=_remove_exponent( + sum([stat.passed for stat in stats], start=Decimal("0")) + ), + ) + totals.append(total) - for test_group_name, test_group in test_groups.items(): - tests_in_group = [ - case for case in test_cases if case.name.startswith(f"{test_group_name}_") - ] + return totals - tests_in_group.sort(key=lambda x: x.name) - # Are there any test cases in this group? - if len(tests_in_group) > 0: - summary_html.append(f'") - - for test_case in tests_in_group: - test_case_name = test_case.stem - - summary_html.append(f'') - - for type_checker in TYPE_CHECKERS: - try: - results_file = ( - root_dir - / "results" - / type_checker.name - / f"{test_case_name}.toml" - ) - with open(results_file, "rb") as f: - results = tomli.load(f) - except FileNotFoundError: - results = {} - - raw_notes = results.get("notes", "").strip() - conformance = results.get("conformant", "Unknown") - if conformance == "Unknown": - # Try to look up the automated test results and use - # that if the test passes - automated = results.get("conformance_automated") - if automated == "Pass": - conformance = "Pass" - notes = "".join( - [f"

    {note}

    " for note in raw_notes.split("\n")] - ) +def _get_versions( + root_dir: Path, + type_checkers: Sequence[TypeChecker], +) -> list[str]: + versions = [] - conformance_class = ( - "conformant" - if conformance == "Pass" - else "partially-conformant" - if conformance == "Partial" - else "not-conformant" - ) + for type_checker in type_checkers: + name = type_checker.name - # Add an asterisk if there are notes to display for a "Pass". - if raw_notes != "" and conformance == "Pass": - conformance = "Pass*" + try: + with root_dir.joinpath("results", name, "version.toml").open("rb") as f: + data = tomllib.load(f) + except (FileNotFoundError, tomllib.TOMLDecodeError): + version = None + else: + version = data.get("version") or None - conformance_cell = f"{conformance}" - if raw_notes != "": - conformance_cell = f'
    {conformance_cell}{notes}
    ' + # If version file cannot be found or has missing/invalid content, fall back to name. + if version is None: + version = f"{type_checker.name} ?.?.?" - summary_html.append(f'') + versions.append(version) - summary_html.append("") + return versions - summary_html.append("
     
    {version}
    ") - summary_html.append("
    ') - summary_html.append( - f'{test_group.name}' - ) - summary_html.append("
         {test_case_name}{conformance_cell}
    \n") - return "\n".join(summary_html) +def _remove_exponent(d: Decimal) -> Decimal: + # See https://docs.python.org/3/library/decimal.html#decimal-faq + return d.quantize(Decimal(1)) if d == d.to_integral() else d.normalize() diff --git a/conformance/src/results_template.html b/conformance/src/results_template.html deleted file mode 100644 index 214f778ed..000000000 --- a/conformance/src/results_template.html +++ /dev/null @@ -1,190 +0,0 @@ - - - - - - - Type System Test Results - - - - -
    -
    -

    Python Type System Conformance Test Results

    -

    - While spec conformance is important for the ecosystem, we don't recommend using it - as the primary basis for choosing a type checker. It is not representative - of many of the things users typically care about. -

    -
    - {{summary}} - -
    - - - diff --git a/conformance/src/templates/base.html b/conformance/src/templates/base.html new file mode 100644 index 000000000..d1f5a3f27 --- /dev/null +++ b/conformance/src/templates/base.html @@ -0,0 +1,102 @@ +{%- set columns = versions|length -%} + + + + + + + + Python Type System Conformance Test Results + + + + +
    +

    Python Type System Conformance Test Results

    +

    + While specification conformance is important for the ecosystem, we don't recommend + using it as the primary basis for choosing a type checker. It is not representative + of many of the things users typically care about. +

    +
    + + +
    +
    +
    + + + + + + + + + {%- for version in versions %} + + {%- endfor %} + + + {%- for group in groups %} + + + + + {%- for case in group.cases %} + + + {%- for result in case.results %} + {%- if result.notes %} + + {%- else %} + + {%- endif %} + {%- endfor %} + + {%- endfor %} + + + {%- for stats in group.stats %} + + {%- endfor %} + + + {%- endfor %} + + + + {%- for stats in totals %} + + {%- endfor %} + + +
    {{ version }}
    + {{ group.name }} +
    {{ case.name }} + {{ result.conformance }} +
      + {%- for note in result.notes %} +
    • {{ note }}
    • + {%- endfor %} +
    +
    {{ result.conformance }}
    {{ stats.passed }} / {{ stats.total }} • {{ stats.percentage }}
    {{ stats.passed }} / {{ stats.total }} • {{ stats.percentage }}
    +
    + + + diff --git a/conformance/src/templates/style.css b/conformance/src/templates/style.css new file mode 100644 index 000000000..e72684ace --- /dev/null +++ b/conformance/src/templates/style.css @@ -0,0 +1,227 @@ +:root { + --dark-main-bg: #333; + --dark-main-fg: #fff; + --dark-muted-fg: #ddd; + --dark-selection-bg: #ec6e4a; + --dark-shadow: #999; + --light-main-bg: #fff; + --light-main-fg: #000; + --light-muted-fg: #666; + --light-selection-bg: #ec6e4a; + --light-shadow: #ccc; + + --conformant: rgb(203, 255, 203); + --partially-conformant: rgb(251, 244, 166); + --not-conformant: rgb(242, 171, 171); + + color-scheme: light dark; + &:has(#color-scheme option[value="light"]:checked) { + color-scheme: light; + } + &:has(#color-scheme option[value="dark"]:checked) { + color-scheme: dark; + } +} + +* { + box-sizing: border-box; +} + +::selection { + background: light-dark(var(--light-selection-bg), var(--dark-selection-bg)); + color: light-dark(var(--dark-main-fg), var(--light-main-fg)); +} + +html { + background: light-dark(var(--light-main-bg), var(--dark-main-bg)); + color: light-dark(var(--light-main-fg), var(--dark-main-fg)); + font-family: "system-ui", "Segoe UI", Helvetica, Arial, sans-serif; + font-size: 0.85rem; +} + +body { + margin: 0; + padding: 0; +} + +header { + background-color: #2b5b84; + box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.03), inset 0 0 20px rgba(0, 0, 0, 0.03); + color: #fff; + padding: 1em; + text-align: center; +} + +main { + padding: 2em; +} + +a { + text-underline-offset: 2px; +} + +code { + background: light-dark(#eee, #666); + border: 1px solid light-dark(#ddd, #888); + border-radius: 3px; + padding: 0 2px; +} + +table { + border-collapse: collapse; + inline-size: 100%; + margin: 0; + padding: 0; +} + +th, +td { + border-color: transparent; + border-style: solid; + border-width: 0 10px; + margin: 0; + padding: 3px; + position: relative; + text-align: start; + + &:not(:first-child) { + text-align: center; + } +} + +thead { + background: light-dark(var(--light-main-bg), var(--dark-main-bg)); + inset-block-start: 0; + position: sticky; + z-index: 3; + & > tr > th { + padding-block: 1em; + } +} + +tbody > tr > th:not([colspan]) { + font-weight: normal; + padding-inline-start: 2em; +} + +tbody > tr.summary { + color: light-dark(var(--light-muted-fg), var(--dark-muted-fg)); +} + +tfoot td { + font-weight: bold; + padding-block-start: 1em; +} + +.col1 { + inline-size: 30%; +} + +.col2 { + inline-size: calc(70% / {{ columns }}); +} + +.conformant { + background-color: var(--conformant); + color: var(--light-main-fg); +} + +.partially-conformant { + background-color: var(--partially-conformant); + color: var(--light-main-fg); +} + +.not-conformant { + background-color: var(--not-conformant); + color: var(--light-main-fg); +} + +tbody > tr:hover { + th:not([colspan]) { + background-color: light-dark(#eee, #444); + border-color: light-dark(#eee, #444); + } + th:not([colspan]) ~ td { + border-color: light-dark(#eee, #444); + } + .conformant { + background-color: hsl(from var(--conformant) h s calc(l - 5)); + } + .partially-conformant { + background-color: hsl(from var(--partially-conformant) h s calc(l - 5)); + } + .not-conformant { + background-color: hsl(from var(--not-conformant) h s calc(l - 5)); + } +} + +.tooltip { + cursor: help; + + /* Add an asterisk if there are notes to display for a "Pass". */ + &.conformant::after { + content: "*"; + position: absolute; + } + + .notes { + background-color: light-dark(var(--light-main-bg), var(--dark-main-bg)); + border-radius: 5px; + box-shadow: 0 0 3px light-dark(var(--light-shadow), var(--dark-shadow)); + color: light-dark(var(--light-main-fg), var(--dark-main-fg)); + cursor: default; + font-size: .8em; + inset-block-start: calc(50% - 5px); + inset-inline-end: 50%; + line-height: 1.6; + list-style-position: inside; + min-inline-size: 500px; + padding: 10px 15px; + position: absolute; + text-align: start; + visibility: hidden; + z-index: 2; + & > li { + padding: 3px 0; + text-indent: 1.3em hanging; + } + } + + &:hover .notes { + visibility: visible; + } +} + +.disclaimer { + color: var(--dark-muted-fg); + font-size: 0.9rem; + font-weight: normal; + line-height: 1.4; + margin: 1rem auto; + max-inline-size: 720px; +} + +form:has(#color-scheme) { + background: inherit; + inset-block-start: 1rem; + inset-inline-end: 1rem; + position: absolute; +} + +#color-scheme { + appearance: none; + background: inherit; + border-color: var(--dark-muted-fg); + border-radius: 5px; + border-style: solid; + border-width: 1px; + color: inherit; + padding: 0.5rem; + &:focus { + border-color: inherit; + outline: none; + } + &:hover { + border-color: inherit; + } +} diff --git a/conformance/src/test_groups.py b/conformance/src/test_groups.py index b974d4016..ae8ab4bfa 100644 --- a/conformance/src/test_groups.py +++ b/conformance/src/test_groups.py @@ -3,13 +3,13 @@ conformance test suite. """ +import tomllib + from dataclasses import dataclass from itertools import chain from pathlib import Path from typing import Mapping, Sequence -import tomli - @dataclass class TestGroup: @@ -22,7 +22,7 @@ def get_test_groups(root_dir: Path) -> Mapping[str, TestGroup]: # group has a name that associated test cases must start with. test_group_file = root_dir / "src" / "test_groups.toml" with open(test_group_file, "rb") as f: - test_groups = tomli.load(f) + test_groups = tomllib.load(f) return { k: TestGroup(v.get("name", "unknown"), v.get("href", "")) diff --git a/conformance/src/type_checker.py b/conformance/src/type_checker.py index c7f28b5c7..d72ff9dbf 100644 --- a/conformance/src/type_checker.py +++ b/conformance/src/type_checker.py @@ -235,7 +235,7 @@ def run_tests(self, test_files: Sequence[str]) -> dict[str, str]: "--config-file=./ty.toml", ] proc = run(command, stdout=PIPE, text=True, encoding="utf-8") - results_dict = {} + results_dict: dict[str, str] = {} for line in proc.stdout.splitlines(): if not line.strip(): continue @@ -339,7 +339,14 @@ def get_version(self) -> str: def run_tests(self, test_files: Sequence[str]) -> dict[str, str]: proc = run( - ["pyrefly", "check", "--output-format", "min-text", "--summary=none", "--min-severity=warn"], + [ + "pyrefly", + "check", + "--output-format", + "min-text", + "--summary=none", + "--min-severity=warn", + ], stdout=PIPE, text=True, encoding="utf-8", diff --git a/conformance/uv.lock b/conformance/uv.lock index ac029a5b1..2aadb047b 100644 --- a/conformance/uv.lock +++ b/conformance/uv.lock @@ -35,6 +35,18 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/8a/db/55a262f3606bebcae07cc14095338471ad7c0bbcaa37707e6f0ee49725b7/importlib_resources-7.1.0-py3-none-any.whl", hash = "sha256:1bd7b48b4088eddb2cd16382150bb515af0bd2c70128194392725f82ad2c96a1", size = 37232, upload-time = "2026-04-12T16:36:08.219Z" }, ] +[[package]] +name = "jinja2" +version = "3.1.6" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "markupsafe" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/df/bf/f7da0350254c0ed7c72f3e33cef02e048281fec7ecec5f032d4aac52226b/jinja2-3.1.6.tar.gz", hash = "sha256:0137fb05990d35f1275a587e9aee6d56da821fc83491a0fb838183be43f66d6d", size = 245115, upload-time = "2025-03-05T20:05:02.478Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/62/a1/3d680cbfd5f4b8f15abc1d571870c5fc3e594bb582bc3b64ea099db13e56/jinja2-3.1.6-py3-none-any.whl", hash = "sha256:85ece4451f492d0c13c5dd7c13a64681a86afae63a5f347908daf103ce6d2f67", size = 134899, upload-time = "2025-03-05T20:05:00.369Z" }, +] + [[package]] name = "librt" version = "0.11.0" @@ -56,6 +68,34 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/59/67/a6739ac96e28b7855808bdb0370e250606104a859750d209e5a0716fe7ab/librt-0.11.0-cp312-cp312-win_arm64.whl", hash = "sha256:2f10cf143e4a9bb0f4f5af568a00df94a2d69ef41c2579584454bb0fe5cc642c", size = 103470, upload-time = "2026-05-10T18:16:10.369Z" }, ] +[[package]] +name = "markdown" +version = "3.10.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/2b/f4/69fa6ed85ae003c2378ffa8f6d2e3234662abd02c10d216c0ba96081a238/markdown-3.10.2.tar.gz", hash = "sha256:994d51325d25ad8aa7ce4ebaec003febcce822c3f8c911e3b17c52f7f589f950", size = 368805, upload-time = "2026-02-09T14:57:26.942Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/de/1f/77fa3081e4f66ca3576c896ae5d31c3002ac6607f9747d2e3aa49227e464/markdown-3.10.2-py3-none-any.whl", hash = "sha256:e91464b71ae3ee7afd3017d9f358ef0baf158fd9a298db92f1d4761133824c36", size = 108180, upload-time = "2026-02-09T14:57:25.787Z" }, +] + +[[package]] +name = "markupsafe" +version = "3.0.3" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/7e/99/7690b6d4034fffd95959cbe0c02de8deb3098cc577c67bb6a24fe5d7caa7/markupsafe-3.0.3.tar.gz", hash = "sha256:722695808f4b6457b320fdc131280796bdceb04ab50fe1795cd540799ebe1698", size = 80313, upload-time = "2025-09-27T18:37:40.426Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/5a/72/147da192e38635ada20e0a2e1a51cf8823d2119ce8883f7053879c2199b5/markupsafe-3.0.3-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:d53197da72cc091b024dd97249dfc7794d6a56530370992a5e1a08983ad9230e", size = 11615, upload-time = "2025-09-27T18:36:30.854Z" }, + { url = "https://files.pythonhosted.org/packages/9a/81/7e4e08678a1f98521201c3079f77db69fb552acd56067661f8c2f534a718/markupsafe-3.0.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:1872df69a4de6aead3491198eaf13810b565bdbeec3ae2dc8780f14458ec73ce", size = 12020, upload-time = "2025-09-27T18:36:31.971Z" }, + { url = "https://files.pythonhosted.org/packages/1e/2c/799f4742efc39633a1b54a92eec4082e4f815314869865d876824c257c1e/markupsafe-3.0.3-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:3a7e8ae81ae39e62a41ec302f972ba6ae23a5c5396c8e60113e9066ef893da0d", size = 24332, upload-time = "2025-09-27T18:36:32.813Z" }, + { url = "https://files.pythonhosted.org/packages/3c/2e/8d0c2ab90a8c1d9a24f0399058ab8519a3279d1bd4289511d74e909f060e/markupsafe-3.0.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d6dd0be5b5b189d31db7cda48b91d7e0a9795f31430b7f271219ab30f1d3ac9d", size = 22947, upload-time = "2025-09-27T18:36:33.86Z" }, + { url = "https://files.pythonhosted.org/packages/2c/54/887f3092a85238093a0b2154bd629c89444f395618842e8b0c41783898ea/markupsafe-3.0.3-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:94c6f0bb423f739146aec64595853541634bde58b2135f27f61c1ffd1cd4d16a", size = 21962, upload-time = "2025-09-27T18:36:35.099Z" }, + { url = "https://files.pythonhosted.org/packages/c9/2f/336b8c7b6f4a4d95e91119dc8521402461b74a485558d8f238a68312f11c/markupsafe-3.0.3-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:be8813b57049a7dc738189df53d69395eba14fb99345e0a5994914a3864c8a4b", size = 23760, upload-time = "2025-09-27T18:36:36.001Z" }, + { url = "https://files.pythonhosted.org/packages/32/43/67935f2b7e4982ffb50a4d169b724d74b62a3964bc1a9a527f5ac4f1ee2b/markupsafe-3.0.3-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:83891d0e9fb81a825d9a6d61e3f07550ca70a076484292a70fde82c4b807286f", size = 21529, upload-time = "2025-09-27T18:36:36.906Z" }, + { url = "https://files.pythonhosted.org/packages/89/e0/4486f11e51bbba8b0c041098859e869e304d1c261e59244baa3d295d47b7/markupsafe-3.0.3-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:77f0643abe7495da77fb436f50f8dab76dbc6e5fd25d39589a0f1fe6548bfa2b", size = 23015, upload-time = "2025-09-27T18:36:37.868Z" }, + { url = "https://files.pythonhosted.org/packages/2f/e1/78ee7a023dac597a5825441ebd17170785a9dab23de95d2c7508ade94e0e/markupsafe-3.0.3-cp312-cp312-win32.whl", hash = "sha256:d88b440e37a16e651bda4c7c2b930eb586fd15ca7406cb39e211fcff3bf3017d", size = 14540, upload-time = "2025-09-27T18:36:38.761Z" }, + { url = "https://files.pythonhosted.org/packages/aa/5b/bec5aa9bbbb2c946ca2733ef9c4ca91c91b6a24580193e891b5f7dbe8e1e/markupsafe-3.0.3-cp312-cp312-win_amd64.whl", hash = "sha256:26a5784ded40c9e318cfc2bdb30fe164bdb8665ded9cd64d500a34fb42067b1c", size = 15105, upload-time = "2025-09-27T18:36:39.701Z" }, + { url = "https://files.pythonhosted.org/packages/e5/f1/216fc1bbfd74011693a4fd837e7026152e89c4bcf3e77b6692fba9923123/markupsafe-3.0.3-cp312-cp312-win_arm64.whl", hash = "sha256:35add3b638a5d900e807944a078b51922212fb3dedb01633a8defc4b01a3c85f", size = 13906, upload-time = "2025-09-27T18:36:40.689Z" }, +] + [[package]] name = "mypy" version = "2.1.0" @@ -151,24 +191,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/d7/33/288b5868fa00846dacf249633719d747893e54aebd196b9968ac1878a5d3/pyright-1.1.410-py3-none-any.whl", hash = "sha256:5e961bed37cacf96b3f7cd7b1da39b350a9239aa2e69138d0e88f728cfaf296c", size = 6082448, upload-time = "2026-06-01T17:35:46.387Z" }, ] -[[package]] -name = "tomli" -version = "2.4.0" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/82/30/31573e9457673ab10aa432461bee537ce6cef177667deca369efb79df071/tomli-2.4.0.tar.gz", hash = "sha256:aa89c3f6c277dd275d8e243ad24f3b5e701491a860d5121f2cdd399fbb31fc9c", size = 17477, upload-time = "2026-01-11T11:22:38.165Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/3c/43/7389a1869f2f26dba52404e1ef13b4784b6b37dac93bac53457e3ff24ca3/tomli-2.4.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:920b1de295e72887bafa3ad9f7a792f811847d57ea6b1215154030cf131f16b1", size = 154894, upload-time = "2026-01-11T11:21:56.07Z" }, - { url = "https://files.pythonhosted.org/packages/e9/05/2f9bf110b5294132b2edf13fe6ca6ae456204f3d749f623307cbb7a946f2/tomli-2.4.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:7d6d9a4aee98fac3eab4952ad1d73aee87359452d1c086b5ceb43ed02ddb16b8", size = 149053, upload-time = "2026-01-11T11:21:57.467Z" }, - { url = "https://files.pythonhosted.org/packages/e8/41/1eda3ca1abc6f6154a8db4d714a4d35c4ad90adc0bcf700657291593fbf3/tomli-2.4.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:36b9d05b51e65b254ea6c2585b59d2c4cb91c8a3d91d0ed0f17591a29aaea54a", size = 243481, upload-time = "2026-01-11T11:21:58.661Z" }, - { url = "https://files.pythonhosted.org/packages/d2/6d/02ff5ab6c8868b41e7d4b987ce2b5f6a51d3335a70aa144edd999e055a01/tomli-2.4.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:1c8a885b370751837c029ef9bc014f27d80840e48bac415f3412e6593bbc18c1", size = 251720, upload-time = "2026-01-11T11:22:00.178Z" }, - { url = "https://files.pythonhosted.org/packages/7b/57/0405c59a909c45d5b6f146107c6d997825aa87568b042042f7a9c0afed34/tomli-2.4.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:8768715ffc41f0008abe25d808c20c3d990f42b6e2e58305d5da280ae7d1fa3b", size = 247014, upload-time = "2026-01-11T11:22:01.238Z" }, - { url = "https://files.pythonhosted.org/packages/2c/0e/2e37568edd944b4165735687cbaf2fe3648129e440c26d02223672ee0630/tomli-2.4.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:7b438885858efd5be02a9a133caf5812b8776ee0c969fea02c45e8e3f296ba51", size = 251820, upload-time = "2026-01-11T11:22:02.727Z" }, - { url = "https://files.pythonhosted.org/packages/5a/1c/ee3b707fdac82aeeb92d1a113f803cf6d0f37bdca0849cb489553e1f417a/tomli-2.4.0-cp312-cp312-win32.whl", hash = "sha256:0408e3de5ec77cc7f81960c362543cbbd91ef883e3138e81b729fc3eea5b9729", size = 97712, upload-time = "2026-01-11T11:22:03.777Z" }, - { url = "https://files.pythonhosted.org/packages/69/13/c07a9177d0b3bab7913299b9278845fc6eaaca14a02667c6be0b0a2270c8/tomli-2.4.0-cp312-cp312-win_amd64.whl", hash = "sha256:685306e2cc7da35be4ee914fd34ab801a6acacb061b6a7abca922aaf9ad368da", size = 108296, upload-time = "2026-01-11T11:22:04.86Z" }, - { url = "https://files.pythonhosted.org/packages/18/27/e267a60bbeeee343bcc279bb9e8fbed0cbe224bc7b2a3dc2975f22809a09/tomli-2.4.0-cp312-cp312-win_arm64.whl", hash = "sha256:5aa48d7c2356055feef06a43611fc401a07337d5b006be13a30f6c58f869e3c3", size = 94553, upload-time = "2026-01-11T11:22:05.854Z" }, - { url = "https://files.pythonhosted.org/packages/23/d1/136eb2cb77520a31e1f64cbae9d33ec6df0d78bdf4160398e86eec8a8754/tomli-2.4.0-py3-none-any.whl", hash = "sha256:1f776e7d669ebceb01dee46484485f43a4048746235e683bcdffacdf1fb4785a", size = 14477, upload-time = "2026-01-11T11:22:37.446Z" }, -] - [[package]] name = "tomlkit" version = "0.14.0" @@ -203,6 +225,15 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/8c/4c/0c1ca628c5da7840e16801caa0bfeed1241e1113d8a5156a34245d4fa927/ty-0.0.50-py3-none-win_arm64.whl", hash = "sha256:96a84d970b59f2eddb92a4af3ba9906f24bda118cf487d923765ccd4ca24627b", size = 11635811, upload-time = "2026-06-17T21:37:07.191Z" }, ] +[[package]] +name = "types-markdown" +version = "3.10.2.20260508" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/24/62/4ca11db82799590117d9b6ef8fcd6515039cff80838304face5440f7d95c/types_markdown-3.10.2.20260508.tar.gz", hash = "sha256:64c405a30decd46cf78443bbcde8331f561f83752cc6d962ff3f5ccaabe26a8e", size = 19818, upload-time = "2026-05-08T04:49:45.095Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/cf/9d/eae7125bcf063ff5f79aadad58f3d37675263941f84e025bf53de1735fe1/types_markdown-3.10.2.20260508-py3-none-any.whl", hash = "sha256:2ee5e462c7b821c27c3d8f75f4da873d3e3c87d24d7f2d741f8f4261e4024a99", size = 25811, upload-time = "2026-05-08T04:49:43.962Z" }, +] + [[package]] name = "typeshed-client" version = "2.11.0" @@ -221,25 +252,29 @@ name = "typing-conformance" version = "0.1.0" source = { virtual = "." } dependencies = [ + { name = "jinja2" }, + { name = "markdown" }, { name = "mypy" }, { name = "pycroscope" }, { name = "pyrefly" }, { name = "pyright" }, - { name = "tomli" }, { name = "tomlkit" }, { name = "ty" }, + { name = "types-markdown" }, { name = "zuban" }, ] [package.metadata] requires-dist = [ + { name = "jinja2" }, + { name = "markdown" }, { name = "mypy" }, { name = "pycroscope" }, { name = "pyrefly" }, { name = "pyright" }, - { name = "tomli" }, { name = "tomlkit" }, { name = "ty" }, + { name = "types-markdown" }, { name = "zuban" }, ] From f6e2e588880a057a939cee76c6c919aebd4db37c Mon Sep 17 00:00:00 2001 From: Ashish Patel Date: Tue, 23 Jun 2026 12:42:43 +0530 Subject: [PATCH 258/308] docs: remove broken LiteralString overloads example (closes #2090) (#2311) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit docs: remove broken LiteralString overloads example The "Interactions with Overloads" section under LiteralString contained an example that does not typecheck in pyright (and other checkers) because the `Literal["foo"]` and `LiteralString` overloads overlap unsafely. The section specified no normative behavior — it was purely illustrative — so the cleanest fix is to remove it. Also drop the `See :ref:\`literalstring-overloads\`` back-reference from the preceding Literal-type note, since the target no longer exists. Fixes: https://github.com/python/typing/issues/2090 --- docs/spec/literal.rst | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/docs/spec/literal.rst b/docs/spec/literal.rst index 7b0015ca3..0eb93c27a 100644 --- a/docs/spec/literal.rst +++ b/docs/spec/literal.rst @@ -309,7 +309,7 @@ Literal types. For example:: **Note:** If the user wants their API to support accepting both literals *and* the original type -- perhaps for legacy purposes -- they should -implement a fallback overload. See :ref:`literalstring-overloads`. +implement a fallback overload. Interactions with other types and features ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -777,28 +777,3 @@ Standard containers like ``List`` work as expected: :: xs: List[LiteralString] = ["foo", "bar", "baz"] - - -.. _literalstring-overloads: - -Interactions with Overloads -""""""""""""""""""""""""""" - -Literal strings and overloads do not need to interact in a special -way: the existing rules work fine. ``LiteralString`` can be used as a -fallback overload where a specific ``Literal["foo"]`` type does not -match: - -:: - - @overload - def foo(x: Literal["foo"]) -> int: ... - @overload - def foo(x: LiteralString) -> bool: ... - @overload - def foo(x: str) -> str: ... - - x1: int = foo("foo") # First overload. - x2: bool = foo("bar") # Second overload. - s: str - x3: str = foo(s) # Third overload. From c94dfceff0af70c6626a1f86bc8f979135ae4652 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Jul 2026 17:56:11 +0100 Subject: [PATCH 259/308] Bump actions/checkout from 6 to 7 in the actions group (#2315) Bumps the actions group with 1 update: [actions/checkout](https://github.com/actions/checkout). Updates `actions/checkout` from 6 to 7 - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v6...v7) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '7' dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/build-docs.yml | 2 +- .github/workflows/ci.yml | 2 +- .github/workflows/conformance.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index 5d7c4b64a..717e71d1c 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v7 - name: Set up Python uses: actions/setup-python@v6 with: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f8f31f7a3..9df37b729 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v7 - uses: actions/setup-python@v6 with: python-version: "3.14" diff --git a/.github/workflows/conformance.yml b/.github/workflows/conformance.yml index be45db465..3f0484de5 100644 --- a/.github/workflows/conformance.yml +++ b/.github/workflows/conformance.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v7 - name: Set up Python 3.12 uses: actions/setup-python@v6 From f05162592e5688026cad9f2995050d87485f70db Mon Sep 17 00:00:00 2001 From: Christian Findlay <16697547+MelbourneDeveloper@users.noreply.github.com> Date: Tue, 7 Jul 2026 01:53:06 +1000 Subject: [PATCH 260/308] Add Basilisk to conformance results (#2316) --- conformance/README.md | 2 +- conformance/pyproject.toml | 1 + .../results/basilisk/aliases_explicit.toml | 27 +++ .../results/basilisk/aliases_implicit.toml | 35 +++ .../results/basilisk/aliases_newtype.toml | 21 ++ .../results/basilisk/aliases_recursive.toml | 18 ++ .../basilisk/aliases_type_statement.toml | 32 +++ .../basilisk/aliases_typealiastype.toml | 29 +++ .../results/basilisk/aliases_variance.toml | 10 + .../basilisk/annotations_coroutines.toml | 6 + .../basilisk/annotations_forward_refs.toml | 25 +++ .../basilisk/annotations_generators.toml | 23 ++ .../results/basilisk/annotations_methods.toml | 6 + .../basilisk/annotations_typeexpr.toml | 22 ++ .../basilisk/callables_annotation.toml | 22 ++ .../results/basilisk/callables_kwargs.toml | 19 ++ .../results/basilisk/callables_protocol.toml | 25 +++ .../results/basilisk/callables_subtyping.toml | 40 ++++ .../results/basilisk/classes_classvar.toml | 29 +++ .../results/basilisk/classes_override.toml | 11 + .../basilisk/constructors_call_init.toml | 12 + .../basilisk/constructors_call_metaclass.toml | 8 + .../basilisk/constructors_call_new.toml | 8 + .../basilisk/constructors_call_type.toml | 14 ++ .../basilisk/constructors_callable.toml | 20 ++ .../basilisk/constructors_consistency.toml | 6 + .../basilisk/dataclasses_descriptors.toml | 6 + .../results/basilisk/dataclasses_final.toml | 11 + .../results/basilisk/dataclasses_frozen.toml | 10 + .../results/basilisk/dataclasses_hash.toml | 10 + .../basilisk/dataclasses_inheritance.toml | 8 + .../results/basilisk/dataclasses_kwonly.toml | 9 + .../basilisk/dataclasses_match_args.toml | 7 + .../results/basilisk/dataclasses_order.toml | 7 + .../basilisk/dataclasses_postinit.toml | 10 + .../results/basilisk/dataclasses_slots.toml | 11 + .../basilisk/dataclasses_transform_class.toml | 12 + .../dataclasses_transform_converter.toml | 15 ++ .../basilisk/dataclasses_transform_field.toml | 8 + .../basilisk/dataclasses_transform_func.toml | 12 + .../basilisk/dataclasses_transform_meta.toml | 12 + .../results/basilisk/dataclasses_usage.toml | 18 ++ .../basilisk/directives_assert_type.toml | 14 ++ .../results/basilisk/directives_cast.toml | 9 + .../basilisk/directives_deprecated.toml | 19 ++ .../basilisk/directives_disjoint_base.toml | 14 ++ .../basilisk/directives_no_type_check.toml | 10 + .../basilisk/directives_reveal_type.toml | 8 + .../basilisk/directives_type_checking.toml | 6 + .../basilisk/directives_type_ignore.toml | 6 + .../directives_type_ignore_file1.toml | 6 + .../directives_type_ignore_file2.toml | 7 + .../basilisk/directives_version_platform.toml | 9 + .../results/basilisk/enums_behaviors.toml | 9 + .../results/basilisk/enums_definition.toml | 7 + .../results/basilisk/enums_expansion.toml | 8 + .../results/basilisk/enums_member_names.toml | 6 + .../results/basilisk/enums_member_values.toml | 8 + .../results/basilisk/enums_members.toml | 13 ++ .../basilisk/exceptions_context_managers.toml | 6 + .../results/basilisk/generics_base_class.toml | 13 ++ .../results/basilisk/generics_basic.toml | 24 ++ .../results/basilisk/generics_defaults.toml | 12 + .../generics_defaults_referential.toml | 15 ++ .../generics_defaults_specialization.toml | 9 + .../basilisk/generics_paramspec_basic.toml | 14 ++ .../generics_paramspec_components.toml | 22 ++ .../generics_paramspec_semantics.toml | 16 ++ .../generics_paramspec_specialization.toml | 11 + .../results/basilisk/generics_scoping.toml | 24 ++ .../basilisk/generics_self_advanced.toml | 6 + .../basilisk/generics_self_attributes.toml | 8 + .../results/basilisk/generics_self_basic.toml | 9 + .../basilisk/generics_self_protocols.toml | 8 + .../results/basilisk/generics_self_usage.toml | 19 ++ .../generics_syntax_compatibility.toml | 8 + .../generics_syntax_declarations.toml | 17 ++ .../generics_syntax_infer_variance.toml | 24 ++ .../basilisk/generics_syntax_scoping.toml | 13 ++ .../basilisk/generics_type_erasure.toml | 13 ++ .../basilisk/generics_typevartuple_args.toml | 14 ++ .../basilisk/generics_typevartuple_basic.toml | 23 ++ .../generics_typevartuple_callable.toml | 7 + .../generics_typevartuple_concat.toml | 6 + .../generics_typevartuple_overloads.toml | 6 + .../generics_typevartuple_specialization.toml | 13 ++ .../generics_typevartuple_unpack.toml | 7 + .../basilisk/generics_upper_bound.toml | 11 + .../results/basilisk/generics_variance.toml | 19 ++ .../basilisk/generics_variance_inference.toml | 29 +++ .../basilisk/historical_positional.toml | 10 + .../basilisk/literals_interactions.toml | 10 + .../basilisk/literals_literalstring.toml | 17 ++ .../basilisk/literals_parameterizations.toml | 27 +++ .../results/basilisk/literals_semantics.toml | 12 + .../basilisk/namedtuples_define_class.toml | 21 ++ .../namedtuples_define_functional.toml | 16 ++ .../basilisk/namedtuples_type_compat.toml | 8 + .../results/basilisk/namedtuples_usage.toml | 14 ++ .../results/basilisk/narrowing_typeguard.toml | 10 + .../results/basilisk/narrowing_typeis.toml | 15 ++ .../results/basilisk/overloads_basic.toml | 7 + .../basilisk/overloads_consistency.toml | 8 + .../basilisk/overloads_definitions.toml | 18 ++ .../basilisk/overloads_definitions_stub.toml | 14 ++ .../basilisk/overloads_evaluation.toml | 10 + .../basilisk/protocols_class_objects.toml | 15 ++ .../basilisk/protocols_definition.toml | 27 +++ .../results/basilisk/protocols_explicit.toml | 13 ++ .../results/basilisk/protocols_generic.toml | 15 ++ .../results/basilisk/protocols_merging.toml | 12 + .../results/basilisk/protocols_modules.toml | 9 + .../results/basilisk/protocols_recursive.toml | 6 + .../basilisk/protocols_runtime_checkable.toml | 15 ++ .../results/basilisk/protocols_self.toml | 6 + .../results/basilisk/protocols_subtyping.toml | 13 ++ .../results/basilisk/protocols_variance.toml | 18 ++ .../basilisk/qualifiers_annotated.toml | 27 +++ .../basilisk/qualifiers_final_annotation.toml | 36 +++ .../basilisk/qualifiers_final_decorator.toml | 16 ++ .../results/basilisk/specialtypes_any.toml | 6 + .../results/basilisk/specialtypes_never.toml | 9 + .../results/basilisk/specialtypes_none.toml | 9 + .../basilisk/specialtypes_promotions.toml | 7 + .../results/basilisk/specialtypes_type.toml | 16 ++ .../results/basilisk/tuples_type_compat.toml | 30 +++ .../results/basilisk/tuples_type_form.toml | 21 ++ .../results/basilisk/tuples_unpacked.toml | 11 + .../basilisk/typeddicts_alt_syntax.toml | 10 + .../basilisk/typeddicts_class_syntax.toml | 12 + .../basilisk/typeddicts_extra_items.toml | 34 +++ .../results/basilisk/typeddicts_final.toml | 6 + .../basilisk/typeddicts_inheritance.toml | 9 + .../basilisk/typeddicts_operations.toml | 17 ++ .../results/basilisk/typeddicts_readonly.toml | 12 + .../typeddicts_readonly_consistency.toml | 13 ++ .../typeddicts_readonly_inheritance.toml | 19 ++ .../basilisk/typeddicts_readonly_kwargs.toml | 7 + .../basilisk/typeddicts_readonly_update.toml | 8 + .../results/basilisk/typeddicts_required.toml | 10 + .../basilisk/typeddicts_type_consistency.toml | 15 ++ .../results/basilisk/typeddicts_usage.toml | 11 + .../results/basilisk/typeforms_typeform.toml | 23 ++ conformance/results/basilisk/version.toml | 1 + conformance/results/results.html | 210 ++++++++++++++++-- conformance/src/type_checker.py | 109 +++++++++ conformance/uv.lock | 14 ++ 147 files changed, 2292 insertions(+), 24 deletions(-) create mode 100644 conformance/results/basilisk/aliases_explicit.toml create mode 100644 conformance/results/basilisk/aliases_implicit.toml create mode 100644 conformance/results/basilisk/aliases_newtype.toml create mode 100644 conformance/results/basilisk/aliases_recursive.toml create mode 100644 conformance/results/basilisk/aliases_type_statement.toml create mode 100644 conformance/results/basilisk/aliases_typealiastype.toml create mode 100644 conformance/results/basilisk/aliases_variance.toml create mode 100644 conformance/results/basilisk/annotations_coroutines.toml create mode 100644 conformance/results/basilisk/annotations_forward_refs.toml create mode 100644 conformance/results/basilisk/annotations_generators.toml create mode 100644 conformance/results/basilisk/annotations_methods.toml create mode 100644 conformance/results/basilisk/annotations_typeexpr.toml create mode 100644 conformance/results/basilisk/callables_annotation.toml create mode 100644 conformance/results/basilisk/callables_kwargs.toml create mode 100644 conformance/results/basilisk/callables_protocol.toml create mode 100644 conformance/results/basilisk/callables_subtyping.toml create mode 100644 conformance/results/basilisk/classes_classvar.toml create mode 100644 conformance/results/basilisk/classes_override.toml create mode 100644 conformance/results/basilisk/constructors_call_init.toml create mode 100644 conformance/results/basilisk/constructors_call_metaclass.toml create mode 100644 conformance/results/basilisk/constructors_call_new.toml create mode 100644 conformance/results/basilisk/constructors_call_type.toml create mode 100644 conformance/results/basilisk/constructors_callable.toml create mode 100644 conformance/results/basilisk/constructors_consistency.toml create mode 100644 conformance/results/basilisk/dataclasses_descriptors.toml create mode 100644 conformance/results/basilisk/dataclasses_final.toml create mode 100644 conformance/results/basilisk/dataclasses_frozen.toml create mode 100644 conformance/results/basilisk/dataclasses_hash.toml create mode 100644 conformance/results/basilisk/dataclasses_inheritance.toml create mode 100644 conformance/results/basilisk/dataclasses_kwonly.toml create mode 100644 conformance/results/basilisk/dataclasses_match_args.toml create mode 100644 conformance/results/basilisk/dataclasses_order.toml create mode 100644 conformance/results/basilisk/dataclasses_postinit.toml create mode 100644 conformance/results/basilisk/dataclasses_slots.toml create mode 100644 conformance/results/basilisk/dataclasses_transform_class.toml create mode 100644 conformance/results/basilisk/dataclasses_transform_converter.toml create mode 100644 conformance/results/basilisk/dataclasses_transform_field.toml create mode 100644 conformance/results/basilisk/dataclasses_transform_func.toml create mode 100644 conformance/results/basilisk/dataclasses_transform_meta.toml create mode 100644 conformance/results/basilisk/dataclasses_usage.toml create mode 100644 conformance/results/basilisk/directives_assert_type.toml create mode 100644 conformance/results/basilisk/directives_cast.toml create mode 100644 conformance/results/basilisk/directives_deprecated.toml create mode 100644 conformance/results/basilisk/directives_disjoint_base.toml create mode 100644 conformance/results/basilisk/directives_no_type_check.toml create mode 100644 conformance/results/basilisk/directives_reveal_type.toml create mode 100644 conformance/results/basilisk/directives_type_checking.toml create mode 100644 conformance/results/basilisk/directives_type_ignore.toml create mode 100644 conformance/results/basilisk/directives_type_ignore_file1.toml create mode 100644 conformance/results/basilisk/directives_type_ignore_file2.toml create mode 100644 conformance/results/basilisk/directives_version_platform.toml create mode 100644 conformance/results/basilisk/enums_behaviors.toml create mode 100644 conformance/results/basilisk/enums_definition.toml create mode 100644 conformance/results/basilisk/enums_expansion.toml create mode 100644 conformance/results/basilisk/enums_member_names.toml create mode 100644 conformance/results/basilisk/enums_member_values.toml create mode 100644 conformance/results/basilisk/enums_members.toml create mode 100644 conformance/results/basilisk/exceptions_context_managers.toml create mode 100644 conformance/results/basilisk/generics_base_class.toml create mode 100644 conformance/results/basilisk/generics_basic.toml create mode 100644 conformance/results/basilisk/generics_defaults.toml create mode 100644 conformance/results/basilisk/generics_defaults_referential.toml create mode 100644 conformance/results/basilisk/generics_defaults_specialization.toml create mode 100644 conformance/results/basilisk/generics_paramspec_basic.toml create mode 100644 conformance/results/basilisk/generics_paramspec_components.toml create mode 100644 conformance/results/basilisk/generics_paramspec_semantics.toml create mode 100644 conformance/results/basilisk/generics_paramspec_specialization.toml create mode 100644 conformance/results/basilisk/generics_scoping.toml create mode 100644 conformance/results/basilisk/generics_self_advanced.toml create mode 100644 conformance/results/basilisk/generics_self_attributes.toml create mode 100644 conformance/results/basilisk/generics_self_basic.toml create mode 100644 conformance/results/basilisk/generics_self_protocols.toml create mode 100644 conformance/results/basilisk/generics_self_usage.toml create mode 100644 conformance/results/basilisk/generics_syntax_compatibility.toml create mode 100644 conformance/results/basilisk/generics_syntax_declarations.toml create mode 100644 conformance/results/basilisk/generics_syntax_infer_variance.toml create mode 100644 conformance/results/basilisk/generics_syntax_scoping.toml create mode 100644 conformance/results/basilisk/generics_type_erasure.toml create mode 100644 conformance/results/basilisk/generics_typevartuple_args.toml create mode 100644 conformance/results/basilisk/generics_typevartuple_basic.toml create mode 100644 conformance/results/basilisk/generics_typevartuple_callable.toml create mode 100644 conformance/results/basilisk/generics_typevartuple_concat.toml create mode 100644 conformance/results/basilisk/generics_typevartuple_overloads.toml create mode 100644 conformance/results/basilisk/generics_typevartuple_specialization.toml create mode 100644 conformance/results/basilisk/generics_typevartuple_unpack.toml create mode 100644 conformance/results/basilisk/generics_upper_bound.toml create mode 100644 conformance/results/basilisk/generics_variance.toml create mode 100644 conformance/results/basilisk/generics_variance_inference.toml create mode 100644 conformance/results/basilisk/historical_positional.toml create mode 100644 conformance/results/basilisk/literals_interactions.toml create mode 100644 conformance/results/basilisk/literals_literalstring.toml create mode 100644 conformance/results/basilisk/literals_parameterizations.toml create mode 100644 conformance/results/basilisk/literals_semantics.toml create mode 100644 conformance/results/basilisk/namedtuples_define_class.toml create mode 100644 conformance/results/basilisk/namedtuples_define_functional.toml create mode 100644 conformance/results/basilisk/namedtuples_type_compat.toml create mode 100644 conformance/results/basilisk/namedtuples_usage.toml create mode 100644 conformance/results/basilisk/narrowing_typeguard.toml create mode 100644 conformance/results/basilisk/narrowing_typeis.toml create mode 100644 conformance/results/basilisk/overloads_basic.toml create mode 100644 conformance/results/basilisk/overloads_consistency.toml create mode 100644 conformance/results/basilisk/overloads_definitions.toml create mode 100644 conformance/results/basilisk/overloads_definitions_stub.toml create mode 100644 conformance/results/basilisk/overloads_evaluation.toml create mode 100644 conformance/results/basilisk/protocols_class_objects.toml create mode 100644 conformance/results/basilisk/protocols_definition.toml create mode 100644 conformance/results/basilisk/protocols_explicit.toml create mode 100644 conformance/results/basilisk/protocols_generic.toml create mode 100644 conformance/results/basilisk/protocols_merging.toml create mode 100644 conformance/results/basilisk/protocols_modules.toml create mode 100644 conformance/results/basilisk/protocols_recursive.toml create mode 100644 conformance/results/basilisk/protocols_runtime_checkable.toml create mode 100644 conformance/results/basilisk/protocols_self.toml create mode 100644 conformance/results/basilisk/protocols_subtyping.toml create mode 100644 conformance/results/basilisk/protocols_variance.toml create mode 100644 conformance/results/basilisk/qualifiers_annotated.toml create mode 100644 conformance/results/basilisk/qualifiers_final_annotation.toml create mode 100644 conformance/results/basilisk/qualifiers_final_decorator.toml create mode 100644 conformance/results/basilisk/specialtypes_any.toml create mode 100644 conformance/results/basilisk/specialtypes_never.toml create mode 100644 conformance/results/basilisk/specialtypes_none.toml create mode 100644 conformance/results/basilisk/specialtypes_promotions.toml create mode 100644 conformance/results/basilisk/specialtypes_type.toml create mode 100644 conformance/results/basilisk/tuples_type_compat.toml create mode 100644 conformance/results/basilisk/tuples_type_form.toml create mode 100644 conformance/results/basilisk/tuples_unpacked.toml create mode 100644 conformance/results/basilisk/typeddicts_alt_syntax.toml create mode 100644 conformance/results/basilisk/typeddicts_class_syntax.toml create mode 100644 conformance/results/basilisk/typeddicts_extra_items.toml create mode 100644 conformance/results/basilisk/typeddicts_final.toml create mode 100644 conformance/results/basilisk/typeddicts_inheritance.toml create mode 100644 conformance/results/basilisk/typeddicts_operations.toml create mode 100644 conformance/results/basilisk/typeddicts_readonly.toml create mode 100644 conformance/results/basilisk/typeddicts_readonly_consistency.toml create mode 100644 conformance/results/basilisk/typeddicts_readonly_inheritance.toml create mode 100644 conformance/results/basilisk/typeddicts_readonly_kwargs.toml create mode 100644 conformance/results/basilisk/typeddicts_readonly_update.toml create mode 100644 conformance/results/basilisk/typeddicts_required.toml create mode 100644 conformance/results/basilisk/typeddicts_type_consistency.toml create mode 100644 conformance/results/basilisk/typeddicts_usage.toml create mode 100644 conformance/results/basilisk/typeforms_typeform.toml create mode 100644 conformance/results/basilisk/version.toml diff --git a/conformance/README.md b/conformance/README.md index 0b60a9490..ce1be0c9a 100644 --- a/conformance/README.md +++ b/conformance/README.md @@ -81,7 +81,7 @@ Note that some type checkers may not run on some platforms. If a type checker fa Different type checkers report errors in different ways (with different wording in error messages and different line numbers or character ranges for errors). This variation makes it difficult to fully automate test validation given that tests will want to check for both false positive and false negative type errors. Some level of manual inspection will therefore be needed to determine whether a type checker is fully conformant with all tests in any given test file. This "scoring" process is required only when the output of a test changes — e.g. when a new version of that type checker is released and the tests are rerun. We assume that the output of a type checker will be the same from one run to the next unless/until a new version is released that fixes or introduces a bug. In this case, the output will need to be manually inspected and the conformance results re-scored for those tests whose output has changed. -[Conformance results](https://htmlpreview.github.io/?https://github.com/python/typing/blob/main/conformance/results/results.html) are reported and summarized for each supported type checker. Currently, results are reported for mypy, pyrefly, pyright, zuban, ty, and pycroscope. It is the goal and desire to add additional type checkers over time. +[Conformance results](https://htmlpreview.github.io/?https://github.com/python/typing/blob/main/conformance/results/results.html) are reported and summarized for each supported type checker. Currently, results are reported for basilisk, mypy, pyrefly, pyright, zuban, ty, and pycroscope. It is the goal and desire to add additional type checkers over time. ## Adding a New Test Case diff --git a/conformance/pyproject.toml b/conformance/pyproject.toml index 17c4adfd2..f72a1fba3 100644 --- a/conformance/pyproject.toml +++ b/conformance/pyproject.toml @@ -3,6 +3,7 @@ name = "typing-conformance" version = "0.1.0" requires-python = "==3.12.*" dependencies = [ + "basilisk-python", "jinja2", "markdown", "mypy", diff --git a/conformance/results/basilisk/aliases_explicit.toml b/conformance/results/basilisk/aliases_explicit.toml new file mode 100644 index 000000000..2f08c6237 --- /dev/null +++ b/conformance/results/basilisk/aliases_explicit.toml @@ -0,0 +1,27 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +aliases_explicit.py:67:9: error: Type alias `GoodTypeAlias2` is not generic and cannot be parameterized [aliases_implicit] +aliases_explicit.py:68:9: error: Type alias `GoodTypeAlias3` is not generic and cannot be parameterized [aliases_implicit] +aliases_explicit.py:69:9: error: Too many type arguments for `GoodTypeAlias4`: expected 1, got 2 [aliases_implicit] +aliases_explicit.py:70:9: error: Too many type arguments for `GoodTypeAlias8`: expected 1, got 2 [aliases_implicit] +aliases_explicit.py:71:9: error: Invalid type argument for `ParamSpec` parameter in `GoodTypeAlias9` [aliases_implicit] +aliases_explicit.py:79:1: error: Invalid type expression as right-hand side of `TypeAlias` for `BadTypeAlias1` [aliases_implicit] +aliases_explicit.py:80:1: error: Invalid type expression as right-hand side of `TypeAlias` for `BadTypeAlias2` [aliases_implicit] +aliases_explicit.py:81:1: error: Invalid type expression as right-hand side of `TypeAlias` for `BadTypeAlias3` [aliases_implicit] +aliases_explicit.py:82:1: error: Invalid type expression as right-hand side of `TypeAlias` for `BadTypeAlias4` [aliases_implicit] +aliases_explicit.py:83:1: error: Invalid type expression as right-hand side of `TypeAlias` for `BadTypeAlias5` [aliases_implicit] +aliases_explicit.py:84:1: error: Invalid type expression as right-hand side of `TypeAlias` for `BadTypeAlias6` [aliases_implicit] +aliases_explicit.py:85:1: error: Invalid type expression as right-hand side of `TypeAlias` for `BadTypeAlias7` [aliases_implicit] +aliases_explicit.py:86:1: error: Invalid type expression as right-hand side of `TypeAlias` for `BadTypeAlias8` [aliases_implicit] +aliases_explicit.py:87:1: error: Invalid type expression as right-hand side of `TypeAlias` for `BadTypeAlias9` [aliases_implicit] +aliases_explicit.py:88:1: error: Invalid type expression as right-hand side of `TypeAlias` for `BadTypeAlias10` [aliases_implicit] +aliases_explicit.py:89:1: error: Invalid type expression as right-hand side of `TypeAlias` for `BadTypeAlias11` [aliases_implicit] +aliases_explicit.py:90:1: error: Invalid type expression as right-hand side of `TypeAlias` for `BadTypeAlias12` [aliases_implicit] +aliases_explicit.py:91:1: error: Invalid type expression as right-hand side of `TypeAlias` for `BadTypeAlias13` [aliases_implicit] +aliases_explicit.py:100:5: error: Type alias `ListAlias` is not generic and cannot be parameterized [aliases_implicit] +aliases_explicit.py:101:6: error: Cannot instantiate union type alias `ListOrSetAlias` [aliases_implicit] +aliases_explicit.py:102:5: error: Type alias `ListOrSetAlias` is not generic and cannot be parameterized [aliases_implicit] +""" diff --git a/conformance/results/basilisk/aliases_implicit.toml b/conformance/results/basilisk/aliases_implicit.toml new file mode 100644 index 000000000..c723e4532 --- /dev/null +++ b/conformance/results/basilisk/aliases_implicit.toml @@ -0,0 +1,35 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +aliases_implicit.py:76:9: error: Type alias `GoodTypeAlias2` is not generic and cannot be parameterized [aliases_implicit] +aliases_implicit.py:77:9: error: Type alias `GoodTypeAlias3` is not generic and cannot be parameterized [aliases_implicit] +aliases_implicit.py:77:9: error: `GoodTypeAlias3` cannot be subscripted; it has no free type parameters [generics_defaults_specialization] +aliases_implicit.py:78:9: error: Too many type arguments for `GoodTypeAlias4`: expected 1, got 2 [aliases_implicit] +aliases_implicit.py:78:9: error: Too many type arguments for `GoodTypeAlias4`; expected at most 1, got 2 [generics_defaults_specialization] +aliases_implicit.py:79:9: error: Too many type arguments for `GoodTypeAlias8`: expected 1, got 2 [aliases_implicit] +aliases_implicit.py:79:9: error: Too many type arguments for `GoodTypeAlias8`; expected at most 1, got 2 [generics_defaults_specialization] +aliases_implicit.py:80:9: error: Invalid type argument for `ParamSpec` parameter in `GoodTypeAlias9` [aliases_implicit] +aliases_implicit.py:81:9: error: Type argument `str` does not satisfy bound `float` of TypeVar `TFloat` in `GoodTypeAlias12` [aliases_implicit] +aliases_implicit.py:106:9: error: Variable `BadTypeAlias1` is not a valid type and cannot be used as an annotation [aliases_implicit] +aliases_implicit.py:107:9: error: Variable `BadTypeAlias2` is not a valid type and cannot be used as an annotation [aliases_implicit] +aliases_implicit.py:108:9: error: Variable `BadTypeAlias3` is not a valid type and cannot be used as an annotation [aliases_implicit] +aliases_implicit.py:109:9: error: Variable `BadTypeAlias4` is not a valid type and cannot be used as an annotation [aliases_implicit] +aliases_implicit.py:110:9: error: Variable `BadTypeAlias5` is not a valid type and cannot be used as an annotation [aliases_implicit] +aliases_implicit.py:111:9: error: Variable `BadTypeAlias6` is not a valid type and cannot be used as an annotation [aliases_implicit] +aliases_implicit.py:112:9: error: Variable `BadTypeAlias7` is not a valid type and cannot be used as an annotation [aliases_implicit] +aliases_implicit.py:113:9: error: Variable `BadTypeAlias8` is not a valid type and cannot be used as an annotation [aliases_implicit] +aliases_implicit.py:114:9: error: Variable `BadTypeAlias9` is not a valid type and cannot be used as an annotation [aliases_implicit] +aliases_implicit.py:115:5: error: Invalid type expression in annotation for parameter `p10` [annotations_forward_refs] +aliases_implicit.py:115:10: error: Variable `BadTypeAlias10` is not a valid type and cannot be used as an annotation [aliases_implicit] +aliases_implicit.py:116:5: error: Invalid type expression in annotation for parameter `p11` [annotations_forward_refs] +aliases_implicit.py:116:10: error: Variable `BadTypeAlias11` is not a valid type and cannot be used as an annotation [aliases_implicit] +aliases_implicit.py:117:10: error: Variable `BadTypeAlias12` is not a valid type and cannot be used as an annotation [aliases_implicit] +aliases_implicit.py:118:5: error: Invalid type expression in annotation for parameter `p13` [annotations_forward_refs] +aliases_implicit.py:118:10: error: Variable `BadTypeAlias13` is not a valid type and cannot be used as an annotation [aliases_implicit] +aliases_implicit.py:119:5: error: Invalid type expression in annotation for parameter `p14` [annotations_forward_refs] +aliases_implicit.py:119:10: error: Variable `BadTypeAlias14` is not a valid type and cannot be used as an annotation [aliases_implicit] +aliases_implicit.py:133:6: error: Cannot instantiate union type alias `ListOrSetAlias` [aliases_implicit] +aliases_implicit.py:135:5: error: Type alias `ListOrSetAlias` is not generic and cannot be parameterized [aliases_implicit] +""" diff --git a/conformance/results/basilisk/aliases_newtype.toml b/conformance/results/basilisk/aliases_newtype.toml new file mode 100644 index 000000000..300529408 --- /dev/null +++ b/conformance/results/basilisk/aliases_newtype.toml @@ -0,0 +1,21 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +aliases_newtype.py:11:1: error: Argument to `UserId` ("user") is not compatible with its base type `int` [aliases_newtype] +aliases_newtype.py:12:1: error: Cannot assign a literal value directly to `UserId`; use `UserId(value)` to create a `UserId` instance [aliases_newtype] +aliases_newtype.py:12:1: error: Type mismatch: `u1` is annotated `UserId` (userid) but assigned int [assignment_compatibility] +aliases_newtype.py:18:1: error: `UserId` is a `NewType`, not an instance of `type`; `NewType()` does not return a class object [aliases_newtype] +aliases_newtype.py:23:1: error: `UserId` is a `NewType` and cannot be used as the second argument to `isinstance`; `NewType` types are not runtime classes [aliases_newtype] +aliases_newtype.py:26:1: error: Class `UserIdDerived` cannot subclass `UserId` which is a `NewType` [aliases_newtype] +aliases_newtype.py:35:12: error: `NewType` name `BadName` does not match the variable name `GoodName` [aliases_newtype] +aliases_newtype.py:41:1: error: Variable `nt1`: `NewType` cannot be used as a generic type [aliases_newtype] +aliases_newtype.py:47:15: error: Invalid base type for `NewType` `BadNewType1`: cannot use a union type as a `NewType` base [aliases_newtype] +aliases_newtype.py:50:15: error: Invalid base type for `NewType` `BadNewType2`: cannot use a TypeVar-parameterized generic as a `NewType` base [aliases_newtype] +aliases_newtype.py:52:15: error: Invalid base type for `NewType` `BadNewType3`: cannot use a Protocol class as a `NewType` base [aliases_newtype] +aliases_newtype.py:54:15: error: Invalid base type for `NewType` `BadNewType4`: cannot use `Literal` as a `NewType` base [aliases_newtype] +aliases_newtype.py:61:15: error: Invalid base type for `NewType` `BadNewType5`: cannot use a `TypedDict` class as a `NewType` base [aliases_newtype] +aliases_newtype.py:63:15: error: `NewType` takes exactly 2 arguments (3 given) for `BadNewType6` [aliases_newtype] +aliases_newtype.py:65:15: error: Invalid base type for `NewType` `BadNewType7`: cannot use `Any` as a `NewType` base [aliases_newtype] +""" diff --git a/conformance/results/basilisk/aliases_recursive.toml b/conformance/results/basilisk/aliases_recursive.toml new file mode 100644 index 000000000..6e740de8e --- /dev/null +++ b/conformance/results/basilisk/aliases_recursive.toml @@ -0,0 +1,18 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +aliases_recursive.py:19:1: error: Type mismatch: `j4` is annotated `Json` (json) but assigned dict[str, int | Unknown] [assignment_compatibility] +aliases_recursive.py:20:1: error: Type mismatch: `j5` is annotated `Json` (json) but assigned list[int | Unknown] [assignment_compatibility] +aliases_recursive.py:38:1: error: Type mismatch: `t6` is annotated `RecursiveTuple` (recursivetuple) but assigned tuple[int, tuple[str, int], tuple[int, tuple[int, list[int]]]] [assignment_compatibility] +aliases_recursive.py:39:1: error: Type mismatch: `t7` is annotated `RecursiveTuple` (recursivetuple) but assigned tuple[int, list[int]] [assignment_compatibility] +aliases_recursive.py:50:1: error: Type mismatch: `m7` is annotated `RecursiveMapping` (recursivemapping) but assigned dict[str, list[int]] [assignment_compatibility] +aliases_recursive.py:51:1: error: Type mismatch: `m8` is annotated `RecursiveMapping` (recursivemapping) but assigned dict[str, str | int | list[int]] [assignment_compatibility] +aliases_recursive.py:52:1: error: Type mismatch: `m9` is annotated `RecursiveMapping` (recursivemapping) but assigned dict[str, str | int | dict[str, str | int | list[int]]] [assignment_compatibility] +aliases_recursive.py:63:1: error: Type mismatch: `g3` is annotated `GenericTypeAlias1[str]` (generictypealias1[str]) but assigned list[str | list[float]] [assignment_compatibility] +aliases_recursive.py:69:1: error: Type mismatch: `g6` is annotated `GenericTypeAlias2[str, int]` (generictypealias2[str, int]) but assigned list[list[int | list[str | int | list[float]]] | str] [assignment_compatibility] +aliases_recursive.py:72:1: error: Type alias `RecursiveUnion` creates a cyclical reference [aliases_recursive] +aliases_recursive.py:75:1: error: Type alias `MutualReference1` creates a cyclical reference [aliases_recursive] +aliases_recursive.py:75:63: error: Type alias `MutualReference2` creates a cyclical reference [aliases_recursive] +""" diff --git a/conformance/results/basilisk/aliases_type_statement.toml b/conformance/results/basilisk/aliases_type_statement.toml new file mode 100644 index 000000000..ceb4f8a15 --- /dev/null +++ b/conformance/results/basilisk/aliases_type_statement.toml @@ -0,0 +1,32 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +aliases_type_statement.py:17:1: error: Cannot access attribute `bit_count` on type alias `GoodAlias1` [generics_syntax_scoping] +aliases_type_statement.py:19:1: error: Cannot call type alias `GoodAlias1`: type aliases are not callable [generics_syntax_scoping] +aliases_type_statement.py:23:7: error: Cannot access attribute `other_attrib` on type alias `GoodAlias1` [generics_syntax_scoping] +aliases_type_statement.py:26:7: error: Cannot use type alias `GoodAlias1` as a base class [generics_syntax_scoping] +aliases_type_statement.py:31:22: error: Cannot use type alias `GoodAlias1` in `isinstance` [generics_syntax_scoping] +aliases_type_statement.py:37:6: error: Invalid type expression in `type BadTypeAlias1` alias [aliases_type_statement] +aliases_type_statement.py:38:6: error: Invalid type expression in `type BadTypeAlias2` alias [aliases_type_statement] +aliases_type_statement.py:39:6: error: Invalid type expression in `type BadTypeAlias3` alias [aliases_type_statement] +aliases_type_statement.py:40:6: error: Invalid type expression in `type BadTypeAlias4` alias [aliases_type_statement] +aliases_type_statement.py:41:6: error: Invalid type expression in `type BadTypeAlias5` alias [aliases_type_statement] +aliases_type_statement.py:42:6: error: Invalid type expression in `type BadTypeAlias6` alias [aliases_type_statement] +aliases_type_statement.py:43:6: error: Invalid type expression in `type BadTypeAlias7` alias [aliases_type_statement] +aliases_type_statement.py:44:6: error: Invalid type expression in `type BadTypeAlias8` alias [aliases_type_statement] +aliases_type_statement.py:45:6: error: Invalid type expression in `type BadTypeAlias9` alias [aliases_type_statement] +aliases_type_statement.py:46:6: error: Invalid type expression in `type BadTypeAlias10` alias [aliases_type_statement] +aliases_type_statement.py:47:6: error: Invalid type expression in `type BadTypeAlias11` alias [aliases_type_statement] +aliases_type_statement.py:48:6: error: Invalid type expression in `type BadTypeAlias12` alias [aliases_type_statement] +aliases_type_statement.py:49:6: error: Invalid type expression in `type BadTypeAlias13` alias [aliases_type_statement] +aliases_type_statement.py:53:6: error: PEP 695 `type` statement uses old-style TypeVar `V` [generics_syntax_scoping] +aliases_type_statement.py:58:6: error: PEP 695 `type` statement uses old-style TypeVar `T1` [generics_syntax_scoping] +aliases_type_statement.py:68:1: error: Type argument `str` is not compatible with type parameter `S` bound `int` in type alias `RecursiveTypeAlias2` [generics_syntax_scoping] +aliases_type_statement.py:70:1: error: Type argument `int` is not compatible with type parameter `T` bound `str` in type alias `RecursiveTypeAlias2` [generics_syntax_scoping] +aliases_type_statement.py:73:6: error: Circular type alias definition: `RecursiveTypeAlias3` references itself [generics_syntax_scoping] +aliases_type_statement.py:75:6: error: Circular type alias definition: `RecursiveTypeAlias4` references itself with different type arguments [generics_syntax_scoping] +aliases_type_statement.py:79:6: error: Circular type alias definition: `RecursiveTypeAlias6` is part of a circular alias chain [generics_syntax_scoping] +aliases_type_statement.py:80:6: error: Circular type alias definition: `RecursiveTypeAlias7` is part of a circular alias chain [generics_syntax_scoping] +""" diff --git a/conformance/results/basilisk/aliases_typealiastype.toml b/conformance/results/basilisk/aliases_typealiastype.toml new file mode 100644 index 000000000..070798156 --- /dev/null +++ b/conformance/results/basilisk/aliases_typealiastype.toml @@ -0,0 +1,29 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +aliases_typealiastype.py:32:7: error: `TypeAliasType` object `GoodAlias1` has no attribute `other_attrib` [aliases_typealiastype] +aliases_typealiastype.py:40:5: error: Incorrect type arguments for `GoodAlias5`: expected 4, got 3 [aliases_typealiastype] +aliases_typealiastype.py:43:13: error: Type variable `S` used in `BadAlias1` is not declared in `type_params` [aliases_typealiastype] +aliases_typealiastype.py:44:13: error: Type variable `S` used in `BadAlias2` is not declared in `type_params` [aliases_typealiastype] +aliases_typealiastype.py:45:57: error: `type_params` for `BadAlias3` must be a literal tuple expression [aliases_typealiastype] +aliases_typealiastype.py:46:13: error: Type alias `BadAlias4` references itself, creating a circular dependency [aliases_typealiastype] +aliases_typealiastype.py:47:13: error: Type alias `BadAlias5` references itself, creating a circular dependency [aliases_typealiastype] +aliases_typealiastype.py:48:13: error: Type alias `BadAlias6` references itself, creating a circular dependency [aliases_typealiastype] +aliases_typealiastype.py:49:13: error: Type alias `BadAlias7` references itself, creating a circular dependency [aliases_typealiastype] +aliases_typealiastype.py:52:40: error: Invalid type expression in `TypeAliasType` for `BadAlias8` [aliases_typealiastype] +aliases_typealiastype.py:53:40: error: Invalid type expression in `TypeAliasType` for `BadAlias9` [aliases_typealiastype] +aliases_typealiastype.py:54:42: error: Invalid type expression in `TypeAliasType` for `BadAlias10` [aliases_typealiastype] +aliases_typealiastype.py:55:42: error: Invalid type expression in `TypeAliasType` for `BadAlias11` [aliases_typealiastype] +aliases_typealiastype.py:56:42: error: Invalid type expression in `TypeAliasType` for `BadAlias12` [aliases_typealiastype] +aliases_typealiastype.py:57:42: error: Invalid type expression in `TypeAliasType` for `BadAlias13` [aliases_typealiastype] +aliases_typealiastype.py:58:42: error: Invalid type expression in `TypeAliasType` for `BadAlias14` [aliases_typealiastype] +aliases_typealiastype.py:59:42: error: Invalid type expression in `TypeAliasType` for `BadAlias15` [aliases_typealiastype] +aliases_typealiastype.py:60:42: error: Invalid type expression in `TypeAliasType` for `BadAlias16` [aliases_typealiastype] +aliases_typealiastype.py:61:42: error: Invalid type expression in `TypeAliasType` for `BadAlias17` [aliases_typealiastype] +aliases_typealiastype.py:62:42: error: Invalid type expression in `TypeAliasType` for `BadAlias18` [aliases_typealiastype] +aliases_typealiastype.py:63:42: error: Invalid type expression in `TypeAliasType` for `BadAlias19` [aliases_typealiastype] +aliases_typealiastype.py:64:42: error: Invalid type expression in `TypeAliasType` for `BadAlias20` [aliases_typealiastype] +aliases_typealiastype.py:66:14: error: Type alias `BadAlias21` references itself, creating a circular dependency [aliases_typealiastype] +""" diff --git a/conformance/results/basilisk/aliases_variance.toml b/conformance/results/basilisk/aliases_variance.toml new file mode 100644 index 000000000..19ef4ea2f --- /dev/null +++ b/conformance/results/basilisk/aliases_variance.toml @@ -0,0 +1,10 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +aliases_variance.py:24:16: error: Variance incompatibility in base class `ClassA`: `T_co` is covariant but the corresponding type parameter is invariant [generics_variance] +aliases_variance.py:28:16: error: Variance incompatibility in base class `A_Alias_1`: `T_co` is covariant but the corresponding type parameter is invariant [generics_variance] +aliases_variance.py:32:16: error: Variance incompatibility in base class `A_Alias_2`: `T_co` is covariant but the corresponding type parameter is invariant [generics_variance] +aliases_variance.py:44:16: error: Variance incompatibility in base class `B_Alias_1`: `T_contra` is contravariant but the corresponding type parameter is invariant [generics_variance] +""" diff --git a/conformance/results/basilisk/annotations_coroutines.toml b/conformance/results/basilisk/annotations_coroutines.toml new file mode 100644 index 000000000..be211bd5b --- /dev/null +++ b/conformance/results/basilisk/annotations_coroutines.toml @@ -0,0 +1,6 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +""" diff --git a/conformance/results/basilisk/annotations_forward_refs.toml b/conformance/results/basilisk/annotations_forward_refs.toml new file mode 100644 index 000000000..aa704ef86 --- /dev/null +++ b/conformance/results/basilisk/annotations_forward_refs.toml @@ -0,0 +1,25 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +annotations_forward_refs.py:24:1: error: Invalid type expression in annotation for `bad3` [annotations_forward_refs] +annotations_forward_refs.py:25:1: error: Invalid type expression in annotation for `bad4` [annotations_forward_refs] +annotations_forward_refs.py:41:5: error: Invalid type expression in annotation for parameter `p1` [annotations_forward_refs] +annotations_forward_refs.py:42:5: error: Invalid type expression in annotation for parameter `p2` [annotations_forward_refs] +annotations_forward_refs.py:43:5: error: Invalid type expression in annotation for parameter `p3` [annotations_forward_refs] +annotations_forward_refs.py:44:5: error: Invalid type expression in annotation for parameter `p4` [annotations_forward_refs] +annotations_forward_refs.py:45:5: error: Invalid type expression in annotation for parameter `p5` [annotations_forward_refs] +annotations_forward_refs.py:46:5: error: Invalid type expression in annotation for parameter `p6` [annotations_forward_refs] +annotations_forward_refs.py:47:5: error: Invalid type expression in annotation for parameter `p7` [annotations_forward_refs] +annotations_forward_refs.py:48:5: error: Invalid type expression in annotation for parameter `p8` [annotations_forward_refs] +annotations_forward_refs.py:49:5: error: Invalid type expression in annotation for parameter `p9` [annotations_forward_refs] +annotations_forward_refs.py:50:5: error: Invalid type expression in annotation for parameter `p10` [annotations_forward_refs] +annotations_forward_refs.py:51:5: error: Invalid type expression in annotation for parameter `p11` [annotations_forward_refs] +annotations_forward_refs.py:52:5: error: Invalid type expression in annotation for parameter `p12` [annotations_forward_refs] +annotations_forward_refs.py:53:5: error: Invalid type expression in annotation for parameter `p13` [annotations_forward_refs] +annotations_forward_refs.py:54:5: error: Invalid type expression in annotation for parameter `p14` [annotations_forward_refs] +annotations_forward_refs.py:55:5: error: Invalid type expression in annotation for parameter `p15` [annotations_forward_refs] +annotations_forward_refs.py:80:5: error: Invalid type expression in annotation for attribute `ClassF` [annotations_forward_refs] +annotations_forward_refs.py:89:5: error: Invalid type expression in annotation for attribute `y` [annotations_forward_refs] +""" diff --git a/conformance/results/basilisk/annotations_generators.toml b/conformance/results/basilisk/annotations_generators.toml new file mode 100644 index 000000000..fad409909 --- /dev/null +++ b/conformance/results/basilisk/annotations_generators.toml @@ -0,0 +1,23 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +annotations_generators.py:51:1: error: Generator function `generator2` is missing a return statement; declared return type is `c` [annotations_generators] +annotations_generators.py:51:1: error: Generator `generator2` is annotated to return `C` but has no valid return path [annotations_generators_2] +annotations_generators.py:54:9: error: Incompatible return type in generator `generator2`: `bool` is not assignable to `c` [annotations_generators] +annotations_generators.py:57:9: error: Incompatible yield type in `generator2`: `int` is not assignable to `a` [annotations_generators] +annotations_generators.py:57:9: error: Incompatible yield type in `generator2`: expected `A`, got `3` [annotations_generators_2] +annotations_generators.py:66:9: error: Incompatible yield type in `generator3`: `int` is not assignable to `a` [annotations_generators] +annotations_generators.py:66:9: error: Incompatible yield type in `generator3`: expected `A`, got `3` [annotations_generators_2] +annotations_generators.py:75:5: error: Incompatible yield type in `generator5`: `b` is not assignable to `a` [annotations_generators] +annotations_generators.py:75:5: error: Incompatible yield type in `generator5`: expected `A`, got `B()` [annotations_generators_2] +annotations_generators.py:86:21: error: Generator function `generator8` has incompatible return type `int` [annotations_generators] +annotations_generators.py:91:27: error: Generator function `generator9` has incompatible return type `int` [annotations_generators] +annotations_generators.py:118:5: error: Incompatible `yield from` in `generator18`: sub-generator yields `a` but `b` is expected [annotations_generators] +annotations_generators.py:118:5: error: Incompatible `yield from` in `generator18`: `generator17` yields `A` but `B` expected [annotations_generators_2] +annotations_generators.py:119:5: error: Incompatible `yield from` in `generator18`: list element type `int` is not assignable to yield type `b` [annotations_generators] +annotations_generators.py:119:5: error: Incompatible `yield from` in `generator18`: list elements are `int` but `B` expected [annotations_generators_2] +annotations_generators.py:135:5: error: Incompatible `yield from` send type in `generator22`: outer sends `str` but sub-generator accepts `int` [annotations_generators] +annotations_generators.py:135:5: error: Incompatible send type in `yield from` in `generator22`: `generator21` expects send type `int` but outer generator sends `str` [annotations_generators_2] +""" diff --git a/conformance/results/basilisk/annotations_methods.toml b/conformance/results/basilisk/annotations_methods.toml new file mode 100644 index 000000000..be211bd5b --- /dev/null +++ b/conformance/results/basilisk/annotations_methods.toml @@ -0,0 +1,6 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +""" diff --git a/conformance/results/basilisk/annotations_typeexpr.toml b/conformance/results/basilisk/annotations_typeexpr.toml new file mode 100644 index 000000000..f4c9ebe2c --- /dev/null +++ b/conformance/results/basilisk/annotations_typeexpr.toml @@ -0,0 +1,22 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +annotations_typeexpr.py:88:5: error: Invalid type expression in annotation for parameter `p1` [annotations_forward_refs] +annotations_typeexpr.py:89:5: error: Invalid type expression in annotation for parameter `p2` [annotations_forward_refs] +annotations_typeexpr.py:90:5: error: Invalid type expression in annotation for parameter `p3` [annotations_forward_refs] +annotations_typeexpr.py:91:5: error: Invalid type expression in annotation for parameter `p4` [annotations_forward_refs] +annotations_typeexpr.py:92:5: error: Invalid type expression in annotation for parameter `p5` [annotations_forward_refs] +annotations_typeexpr.py:93:5: error: Invalid type expression in annotation for parameter `p6` [annotations_forward_refs] +annotations_typeexpr.py:94:5: error: Invalid type expression in annotation for parameter `p7` [annotations_forward_refs] +annotations_typeexpr.py:95:5: error: Invalid type expression in annotation for parameter `p8` [annotations_forward_refs] +annotations_typeexpr.py:96:5: error: Invalid type expression in annotation for parameter `p9` [annotations_forward_refs] +annotations_typeexpr.py:96:9: error: Variable `var1` is not a valid type and cannot be used as an annotation [aliases_implicit] +annotations_typeexpr.py:97:5: error: Invalid type annotation on `p10` — numeric literals are not valid types [annotations_typeexpr] +annotations_typeexpr.py:98:5: error: Invalid type annotation on `p11` — numeric literals are not valid types [annotations_typeexpr] +annotations_typeexpr.py:99:5: error: Invalid type expression in annotation for parameter `p12` [annotations_forward_refs] +annotations_typeexpr.py:100:5: error: Invalid type expression in annotation for parameter `p13` [annotations_forward_refs] +annotations_typeexpr.py:101:5: error: Invalid type expression in annotation for parameter `p14` [annotations_forward_refs] +annotations_typeexpr.py:102:5: error: Invalid type expression in annotation for parameter `p15` [annotations_forward_refs] +""" diff --git a/conformance/results/basilisk/callables_annotation.toml b/conformance/results/basilisk/callables_annotation.toml new file mode 100644 index 000000000..4c7319930 --- /dev/null +++ b/conformance/results/basilisk/callables_annotation.toml @@ -0,0 +1,22 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +callables_annotation.py:25:5: error: Too few arguments for `cb`: expected 2 but got 1 [callables_protocol] +callables_annotation.py:26:11: error: Argument 2 to `cb` has incompatible type `int`; expected `str` [callables_protocol] +callables_annotation.py:27:5: error: Too many arguments for `cb`: expected 2 but got 3 [callables_protocol] +callables_annotation.py:29:5: error: `Callable` parameter `cb` does not accept keyword arguments [callables_protocol] +callables_annotation.py:35:5: error: Too many arguments for `cb`: expected 0 but got 1 [callables_protocol] +callables_annotation.py:55:1: error: Invalid type argument count in annotation `Callable[int]` on `v1`: `callable` takes 2 type arguments but 1 was provided [callables_annotation] +callables_annotation.py:56:1: error: Invalid `Callable` annotation on `v2`: first argument `int` is not a valid parameter specification; expected `[arg_types]`, `...`, a `ParamSpec`, or `Concatenate[...]` [callables_annotation] +callables_annotation.py:57:1: error: Invalid `Callable` annotation on `v3`: return type `[int]` is a list literal; use a plain type instead [callables_annotation] +callables_annotation.py:58:1: error: Invalid type argument count in annotation `Callable[int, int, int]` on `v4`: `callable` takes 2 type arguments but 3 were provided [callables_annotation] +callables_annotation.py:59:1: error: Invalid `Callable` annotation on `v5`: `[...]` is not valid; use bare `...` for an arbitrary parameter list [callables_annotation] +callables_annotation.py:91:1: error: Function `test_cb2` incompatible with `Callable[Concatenate[int, ...], str]`: needs at least 1 positional param(s) but has 0 [callables_protocol_2] +callables_annotation.py:93:1: error: Function `test_cb4` incompatible with `Callable[Concatenate[int, ...], str]`: Concatenate requires positional params [callables_protocol_2] +callables_annotation.py:159:5: error: Type mismatch: `err1` is annotated `Proto5[Any]` (proto5[any]) but assigned proto8 [assignment_compatibility] +callables_annotation.py:172:5: error: Type mismatch: `f2` is annotated `Callback2[...]` (callback2[...]) but assigned Callable[[], str] [assignment_compatibility] +callables_annotation.py:187:5: error: Type mismatch: `f2` is annotated `Callable[Concatenate[str, ...], str]` (Callable[[concatenate[str, ...]], str]) but assigned Callable[[int, str], str] [assignment_compatibility] +callables_annotation.py:189:5: error: Type mismatch: `f4` is annotated `CallbackWithStr[...]` (callbackwithstr[...]) but assigned Callable[[int, str], str] [assignment_compatibility] +""" diff --git a/conformance/results/basilisk/callables_kwargs.toml b/conformance/results/basilisk/callables_kwargs.toml new file mode 100644 index 000000000..73fbb3367 --- /dev/null +++ b/conformance/results/basilisk/callables_kwargs.toml @@ -0,0 +1,19 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +callables_kwargs.py:46:5: error: Call to `func1` missing required keyword arguments from `TD2` [callables_kwargs] +callables_kwargs.py:51:5: error: Keyword `v4` in call to `func1` is not a key of TypedDict `TD2` [callables_kwargs] +callables_kwargs.py:52:5: error: Cannot pass positional arguments to `func1` for Unpack[TD2] kwargs [callables_kwargs] +callables_kwargs.py:58:5: error: Cannot spread `my_dict: dict[str, str]` into `func1` with Unpack[TD2] kwargs [callables_kwargs] +callables_kwargs.py:63:5: error: Keyword `v1` in call to `func1` conflicts with `**td2` [callables_kwargs] +callables_kwargs.py:64:11: error: Argument `v3` of `func2` expects `str` but received an `int` literal [calls_argument_type] +callables_kwargs.py:65:5: error: Keyword `v1` in call to `func2` conflicts with `**td2` [callables_kwargs] +callables_kwargs.py:101:1: error: Function `func1` incompatible with `TDProtocol3`: keyword param `v2` type `str` vs `int` [callables_protocol_2] +callables_kwargs.py:102:1: error: Function `func1` incompatible with `TDProtocol4`: requires keyword `v3` not in protocol [callables_protocol_2] +callables_kwargs.py:103:1: error: Function `func1` incompatible with `TDProtocol5`: missing required params [callables_protocol_2] +callables_kwargs.py:111:1: error: Parameter `v1` overlaps with TypedDict `TD2` key `v1` [callables_kwargs] +callables_kwargs.py:122:1: error: Invalid `**kwargs: Unpack[T]`: `T` is a TypeVar, not a TypedDict [callables_kwargs] +callables_kwargs.py:134:1: error: Function `func7` incompatible with `TDProtocol6`: missing `**kwargs` [callables_protocol_2] +""" diff --git a/conformance/results/basilisk/callables_protocol.toml b/conformance/results/basilisk/callables_protocol.toml new file mode 100644 index 000000000..09950285d --- /dev/null +++ b/conformance/results/basilisk/callables_protocol.toml @@ -0,0 +1,25 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +callables_protocol.py:35:1: error: Function `cb1_bad1` incompatible with `Proto1`: missing keyword param `max_len` [callables_protocol_2] +callables_protocol.py:35:1: error: Function `cb1_bad1` incompatible with `Proto1`: requires keyword `max_items` not in protocol [callables_protocol_2] +callables_protocol.py:36:1: error: Function `cb1_bad2` incompatible with `Proto1`: missing keyword param `max_len` [callables_protocol_2] +callables_protocol.py:37:1: error: Function `cb1_bad3` incompatible with `Proto1`: keyword param `max_len` needs default [callables_protocol_2] +callables_protocol.py:37:1: error: Function `cb1_bad3` incompatible with `Proto1`: keyword param `max_len` type `str | None` vs `int | None` [callables_protocol_2] +callables_protocol.py:67:1: error: Function `cb2_bad1` incompatible with `Proto2`: missing `**kwargs` [callables_protocol_2] +callables_protocol.py:68:1: error: Function `cb2_bad2` incompatible with `Proto2`: *args type `str` vs `bytes` [callables_protocol_2] +callables_protocol.py:69:1: error: Function `cb2_bad3` incompatible with `Proto2`: **kwargs type `bytes` vs `str` [callables_protocol_2] +callables_protocol.py:70:1: error: Function `cb2_bad4` incompatible with `Proto2`: missing `*args` [callables_protocol_2] +callables_protocol.py:97:1: error: Function `cb4_bad1` cannot satisfy protocol `Proto4`: protocol has extra attributes [callables_protocol_2] +callables_protocol.py:121:1: error: Cannot assign function `cb6_bad1` to non-protocol type `NotProto6` [callables_protocol_2] +callables_protocol.py:169:1: error: Function `cb8_bad1` incompatible with `Proto8`: overload param `x` type `str` not accepted by `int` [callables_protocol_2] +callables_protocol.py:186:5: error: Cannot assign `str` to `Proto9.other_attribute` of type `int` [callables_protocol_2] +callables_protocol.py:187:5: error: Protocol `Proto9` has no attribute `xxx` [callables_protocol_2] +callables_protocol.py:197:7: error: Protocol `Proto9` has no attribute `other_attribute2` [callables_protocol_2] +callables_protocol.py:238:1: error: Function `cb11_bad1` incompatible with `Proto11`: param `y` is pos-only but must accept keyword [callables_protocol_2] +callables_protocol.py:260:1: error: Function `cb12_bad1` incompatible with `Proto12`: missing keyword param `kwarg1` [callables_protocol_2] +callables_protocol.py:284:1: error: Function `cb13_no_default` incompatible with `Proto13_Default`: param `path` needs default [callables_protocol_2] +callables_protocol.py:311:1: error: Function `cb14_no_default` incompatible with `Proto14_Default`: keyword param `path` needs default [callables_protocol_2] +""" diff --git a/conformance/results/basilisk/callables_subtyping.toml b/conformance/results/basilisk/callables_subtyping.toml new file mode 100644 index 000000000..60ae16397 --- /dev/null +++ b/conformance/results/basilisk/callables_subtyping.toml @@ -0,0 +1,40 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +callables_subtyping.py:26:5: error: Type mismatch: `f6` is annotated `Callable[[float], float]` (Callable[[float], float]) but assigned Callable[[int], int] [assignment_compatibility] +callables_subtyping.py:26:5: error: Callable subtyping violation: parameter type(s) of `cb3` are not supertypes of `Callable[[float], float]` parameter types (parameters must be contravariant) [callables_subtyping] +callables_subtyping.py:29:5: error: Type mismatch: `f8` is annotated `Callable[[int], int]` (Callable[[int], int]) but assigned Callable[[float], float] [assignment_compatibility] +callables_subtyping.py:29:5: error: Callable subtyping violation: return type `float` is not a subtype of `int` (return types must be covariant) [callables_subtyping] +callables_subtyping.py:51:5: error: Type mismatch: `f1` is annotated `Standard2` (standard2) but assigned posonly2 [assignment_compatibility] +callables_subtyping.py:52:5: error: Type mismatch: `f2` is annotated `Standard2` (standard2) but assigned kwonly2 [assignment_compatibility] +callables_subtyping.py:55:5: error: Type mismatch: `f4` is annotated `PosOnly2` (posonly2) but assigned kwonly2 [assignment_compatibility] +callables_subtyping.py:58:5: error: Type mismatch: `f6` is annotated `KwOnly2` (kwonly2) but assigned posonly2 [assignment_compatibility] +callables_subtyping.py:82:5: error: Type mismatch: `f3` is annotated `IntArgs3` (intargs3) but assigned noargs3 [assignment_compatibility] +callables_subtyping.py:85:5: error: Type mismatch: `f5` is annotated `FloatArgs3` (floatargs3) but assigned noargs3 [assignment_compatibility] +callables_subtyping.py:86:5: error: Type mismatch: `f6` is annotated `FloatArgs3` (floatargs3) but assigned intargs3 [assignment_compatibility] +callables_subtyping.py:116:5: error: Type mismatch: `f1` is annotated `PosOnly4` (posonly4) but assigned intargs4 [assignment_compatibility] +callables_subtyping.py:119:5: error: Type mismatch: `f4` is annotated `IntStrArgs4` (intstrargs4) but assigned strargs4 [assignment_compatibility] +callables_subtyping.py:120:5: error: Type mismatch: `f5` is annotated `IntStrArgs4` (intstrargs4) but assigned intargs4 [assignment_compatibility] +callables_subtyping.py:122:5: error: Type mismatch: `f7` is annotated `StrArgs4` (strargs4) but assigned intargs4 [assignment_compatibility] +callables_subtyping.py:124:5: error: Type mismatch: `f9` is annotated `IntArgs4` (intargs4) but assigned strargs4 [assignment_compatibility] +callables_subtyping.py:125:5: error: Type mismatch: `f10` is annotated `Standard4` (standard4) but assigned intstrargs4 [assignment_compatibility] +callables_subtyping.py:126:5: error: Type mismatch: `f11` is annotated `Standard4` (standard4) but assigned strargs4 [assignment_compatibility] +callables_subtyping.py:151:5: error: Type mismatch: `f3` is annotated `IntKwargs5` (intkwargs5) but assigned nokwargs5 [assignment_compatibility] +callables_subtyping.py:154:5: error: Type mismatch: `f5` is annotated `FloatKwargs5` (floatkwargs5) but assigned nokwargs5 [assignment_compatibility] +callables_subtyping.py:155:5: error: Type mismatch: `f6` is annotated `FloatKwargs5` (floatkwargs5) but assigned intkwargs5 [assignment_compatibility] +callables_subtyping.py:187:5: error: Type mismatch: `f1` is annotated `KwOnly6` (kwonly6) but assigned intkwargs6 [assignment_compatibility] +callables_subtyping.py:190:5: error: Type mismatch: `f4` is annotated `IntStrKwargs6` (intstrkwargs6) but assigned strkwargs6 [assignment_compatibility] +callables_subtyping.py:191:5: error: Type mismatch: `f5` is annotated `IntStrKwargs6` (intstrkwargs6) but assigned intkwargs6 [assignment_compatibility] +callables_subtyping.py:193:5: error: Type mismatch: `f7` is annotated `StrKwargs6` (strkwargs6) but assigned intkwargs6 [assignment_compatibility] +callables_subtyping.py:195:5: error: Type mismatch: `f9` is annotated `IntKwargs6` (intkwargs6) but assigned strkwargs6 [assignment_compatibility] +callables_subtyping.py:196:5: error: Type mismatch: `f10` is annotated `Standard6` (standard6) but assigned intstrkwargs6 [assignment_compatibility] +callables_subtyping.py:197:5: error: Type mismatch: `f11` is annotated `Standard6` (standard6) but assigned strkwargs6 [assignment_compatibility] +callables_subtyping.py:236:5: error: Type mismatch: `f1` is annotated `DefaultArg8` (defaultarg8) but assigned nodefaultarg8 [assignment_compatibility] +callables_subtyping.py:237:5: error: Type mismatch: `f2` is annotated `DefaultArg8` (defaultarg8) but assigned nox8 [assignment_compatibility] +callables_subtyping.py:240:5: error: Type mismatch: `f4` is annotated `NoDefaultArg8` (nodefaultarg8) but assigned nox8 [assignment_compatibility] +callables_subtyping.py:243:5: error: Type mismatch: `f6` is annotated `NoX8` (nox8) but assigned nodefaultarg8 [assignment_compatibility] +callables_subtyping.py:273:5: error: Type mismatch: `f3` is annotated `FloatArg9` (floatarg9) but assigned overloaded9 [assignment_compatibility] +callables_subtyping.py:297:5: error: Type mismatch: `f2` is annotated `Overloaded10` (overloaded10) but assigned strarg10 [assignment_compatibility] +""" diff --git a/conformance/results/basilisk/classes_classvar.toml b/conformance/results/basilisk/classes_classvar.toml new file mode 100644 index 000000000..c35593eac --- /dev/null +++ b/conformance/results/basilisk/classes_classvar.toml @@ -0,0 +1,29 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +classes_classvar.py:38:5: error: `ClassVar` accepts at most one type argument, but `bad1` has 2 [classes_classvar] +classes_classvar.py:39:5: error: Invalid `ClassVar` argument for `bad2`: `3` is not a valid type [classes_classvar] +classes_classvar.py:40:5: error: Invalid `ClassVar` argument for `bad3`: `var` is a runtime variable, not a type [classes_classvar] +classes_classvar.py:45:5: error: `ClassVar` parameter for `bad4` cannot contain TypeVar [classes_classvar] +classes_classvar.py:46:5: error: `ClassVar` parameter for `bad5` cannot contain TypeVar [classes_classvar] +classes_classvar.py:47:5: error: `ClassVar` parameter for `bad6` cannot contain ParamSpec [classes_classvar] +classes_classvar.py:52:5: error: Type mismatch in `ClassVar` attribute `bad8`: annotated as `list[str]` but initialized with a dict literal [classes_classvar] +classes_classvar.py:54:5: error: `ClassVar` cannot be nested inside another type in attribute `bad9` [classes_classvar] +classes_classvar.py:54:5: error: `ClassVar` cannot be used inside `Final` for attribute `bad9` [qualifiers_final_annotation] +classes_classvar.py:55:5: error: `ClassVar` cannot be nested inside another type in attribute `bad10` [classes_classvar] +classes_classvar.py:69:23: error: `ClassVar` is not allowed in parameter annotation for `a` [classes_classvar] +classes_classvar.py:70:9: error: Type mismatch: `x` is annotated `ClassVar[str]` (classvar[str]) but assigned str [assignment_compatibility] +classes_classvar.py:70:9: error: `ClassVar` is not allowed in local variable annotation for `x` [classes_classvar] +classes_classvar.py:71:9: error: `ClassVar` is not allowed in self-attribute annotation for `xx` [classes_classvar] +classes_classvar.py:73:9: error: `ClassVar` is not allowed in the return annotation of `method2` [classes_classvar] +classes_classvar.py:77:1: error: Type mismatch: `bad11` is annotated `ClassVar[int]` (classvar[int]) but assigned int [assignment_compatibility] +classes_classvar.py:77:1: error: `ClassVar` is not allowed in module-level annotation for `bad11` [classes_classvar] +classes_classvar.py:78:1: error: `ClassVar` is not allowed in right-hand side of module-level assignment for `bad12` [classes_classvar] +classes_classvar.py:111:1: error: Cannot assign to `ClassVar` attribute `stats` through an instance of `Starship` [classes_classvar] +classes_classvar.py:140:1: error: Class `ProtoAImpl` is not compatible with protocol `ProtoA`: attribute `x` is required to be a class variable (`ClassVar`) but is declared as an instance variable [classes_classvar] +classes_classvar.py:140:1: error: Class `ProtoAImpl` is not compatible with protocol `ProtoA`: attribute `y` is required to be a class variable (`ClassVar`) but is not defined at class level [classes_classvar] +classes_classvar.py:140:1: error: Class `ProtoAImpl` is not compatible with protocol `ProtoA`: attribute `z` is required to be a class variable (`ClassVar`) but is not defined at class level [classes_classvar] +classes_classvar.py:140:1: error: Class `ProtoAImpl` is incompatible with protocol `ProtoA`: missing instance variable `z` [protocols_definition_2] +""" diff --git a/conformance/results/basilisk/classes_override.toml b/conformance/results/basilisk/classes_override.toml new file mode 100644 index 000000000..d7897143a --- /dev/null +++ b/conformance/results/basilisk/classes_override.toml @@ -0,0 +1,11 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +classes_override.py:53:9: error: Method `method3` in `ChildA` is decorated with `@override` but no matching method exists in any base class [classes_override_3] +classes_override.py:65:9: error: Method `method4` in `ChildA` is decorated with `@override` but no matching method exists in any base class [classes_override_3] +classes_override.py:79:9: error: Method `static_method1` in `ChildA` is decorated with `@override` but no matching method exists in any base class [classes_override_3] +classes_override.py:84:9: error: Method `class_method1` in `ChildA` is decorated with `@override` but no matching method exists in any base class [classes_override_3] +classes_override.py:89:9: error: Method `property1` in `ChildA` is decorated with `@override` but no matching method exists in any base class [classes_override_3] +""" diff --git a/conformance/results/basilisk/constructors_call_init.toml b/conformance/results/basilisk/constructors_call_init.toml new file mode 100644 index 000000000..ad3f4129e --- /dev/null +++ b/conformance/results/basilisk/constructors_call_init.toml @@ -0,0 +1,12 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +constructors_call_init.py:21:1: error: Class1[int].__init__ parameter `x` expects `int` but received a `float` literal [generics_defaults_referential_2] +constructors_call_init.py:21:13: error: Argument type `float` is incompatible with parameter `x` of type `int` in `Class1.__init__` [constructors_call_init] +constructors_call_init.py:42:1: error: `Class2` instance is not compatible with `Self` type of `Class3` in `__init__` [constructors_call_init] +constructors_call_init.py:56:1: error: `Class4[str]()` is incompatible: `__init__` expects `self: Class4[int]` but received `Class4[str]` [constructors_call_init] +constructors_call_init.py:107:5: error: Class-scoped type variables should not be used in the `self` annotation of `__init__` in class `Class8` [constructors_call_init] +constructors_call_init.py:130:1: error: Class `Class11` does not define `__init__` or `__new__` and inherits only from `object`; constructor does not accept arguments [constructors_call_init] +""" diff --git a/conformance/results/basilisk/constructors_call_metaclass.toml b/conformance/results/basilisk/constructors_call_metaclass.toml new file mode 100644 index 000000000..020ad8a5f --- /dev/null +++ b/conformance/results/basilisk/constructors_call_metaclass.toml @@ -0,0 +1,8 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +constructors_call_metaclass.py:54:1: error: Call to `Class3()` is missing 1 required argument for `__new__` (expected 1, got 0) [calls_argument_count] +constructors_call_metaclass.py:68:1: error: Call to `Class4()` is missing 1 required argument for `__new__` (expected 1, got 0) [calls_argument_count] +""" diff --git a/conformance/results/basilisk/constructors_call_new.toml b/conformance/results/basilisk/constructors_call_new.toml new file mode 100644 index 000000000..39fbf567d --- /dev/null +++ b/conformance/results/basilisk/constructors_call_new.toml @@ -0,0 +1,8 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +constructors_call_new.py:21:13: error: Argument type `float` is incompatible with parameter `x` of type `int` in `Class1.__new__` [constructors_call_new] +constructors_call_new.py:148:1: error: `Class11[str]()` is incompatible: `__new__` expects `cls: type[Class11[int]]` but received `type[Class11[str]]` [constructors_call_new] +""" diff --git a/conformance/results/basilisk/constructors_call_type.toml b/conformance/results/basilisk/constructors_call_type.toml new file mode 100644 index 000000000..56a59f0b5 --- /dev/null +++ b/conformance/results/basilisk/constructors_call_type.toml @@ -0,0 +1,14 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +constructors_call_type.py:30:5: error: `Class1` constructor requires at least 2 argument(s) but 0 were provided via `type[Class1]` [constructors_call_type] +constructors_call_type.py:40:5: error: `Class2` constructor requires at least 2 argument(s) but 0 were provided via `type[Class2]` [constructors_call_type] +constructors_call_type.py:50:5: error: `Class3` constructor requires at least 2 argument(s) but 0 were provided via `type[Class3]` [constructors_call_type] +constructors_call_type.py:59:5: error: `Class4` constructor takes no arguments but 1 argument(s) were provided via `type[Class4]` [constructors_call_type] +constructors_call_type.py:64:5: error: Cannot pass arguments to constructor of unbound type variable `T`; its constructor signature is unknown [constructors_call_type] +constructors_call_type.py:72:5: error: `Class1` constructor requires at least 2 argument(s) but 0 were provided via `type[Class1]` [constructors_call_type] +constructors_call_type.py:81:5: error: `Class2` constructor requires at least 2 argument(s) but 1 were provided via `type[Class2]` [constructors_call_type] +constructors_call_type.py:82:12: error: Argument 2 has type `int` but parameter `y` of `Class2` constructor expects `str` [constructors_call_type] +""" diff --git a/conformance/results/basilisk/constructors_callable.toml b/conformance/results/basilisk/constructors_callable.toml new file mode 100644 index 000000000..4a09f2734 --- /dev/null +++ b/conformance/results/basilisk/constructors_callable.toml @@ -0,0 +1,20 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +constructors_callable.py:38:1: error: Call to the constructor-derived callable for `Class1` is missing required argument `x` (expected 1, got 0) [constructors_callable] +constructors_callable.py:39:1: error: Unexpected keyword argument `y` in call to the constructor-derived callable for `Class1` [constructors_callable] +constructors_callable.py:51:1: error: Call to the constructor-derived callable for `Class2` has 1 too many positional argument (expected at most 0, got 1) [constructors_callable] +constructors_callable.py:66:1: error: Call to the constructor-derived callable for `Class3` is missing required argument `x` (expected 1, got 0) [constructors_callable] +constructors_callable.py:67:1: error: Unexpected keyword argument `y` in call to the constructor-derived callable for `Class3` [constructors_callable] +constructors_callable.py:68:1: error: Call to the constructor-derived callable for `Class3` has 1 too many positional argument (expected at most 1, got 2) [constructors_callable] +constructors_callable.py:81:1: error: Call to the constructor-derived callable for `Class4` is missing required argument `x` (expected 1, got 0) [constructors_callable] +constructors_callable.py:82:1: error: Unexpected keyword argument `y` in call to the constructor-derived callable for `Class4` [constructors_callable] +constructors_callable.py:129:1: error: Call to the constructor-derived callable for `Class6` has 1 too many positional argument (expected at most 0, got 1) [constructors_callable] +constructors_callable.py:146:1: error: Call to the constructor-derived callable for `Class6Any` has 1 too many positional argument (expected at most 0, got 1) [constructors_callable] +constructors_callable.py:185:10: error: Argument for the `list[T]` parameter of the constructor-derived callable for `Class8` is a `str` literal — no assignment of type variable `T` makes it valid [constructors_callable] +constructors_callable.py:187:1: error: Inconsistent binding for type variable `T` in call to the constructor-derived callable for `Class8`: `list[int]` vs `list[str]` [constructors_callable] +constructors_callable.py:197:10: error: Argument for the `list[T]` parameter of the constructor-derived callable for `Class9` is a `str` literal — no assignment of type variable `T` makes it valid [constructors_callable] +constructors_callable.py:199:1: error: Inconsistent binding for type variable `T` in call to the constructor-derived callable for `Class9`: `list[int]` vs `list[str]` [constructors_callable] +""" diff --git a/conformance/results/basilisk/constructors_consistency.toml b/conformance/results/basilisk/constructors_consistency.toml new file mode 100644 index 000000000..be211bd5b --- /dev/null +++ b/conformance/results/basilisk/constructors_consistency.toml @@ -0,0 +1,6 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +""" diff --git a/conformance/results/basilisk/dataclasses_descriptors.toml b/conformance/results/basilisk/dataclasses_descriptors.toml new file mode 100644 index 000000000..be211bd5b --- /dev/null +++ b/conformance/results/basilisk/dataclasses_descriptors.toml @@ -0,0 +1,6 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +""" diff --git a/conformance/results/basilisk/dataclasses_final.toml b/conformance/results/basilisk/dataclasses_final.toml new file mode 100644 index 000000000..27f88ef50 --- /dev/null +++ b/conformance/results/basilisk/dataclasses_final.toml @@ -0,0 +1,11 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +dataclasses_final.py:27:1: error: Cannot assign to `D.final_classvar` — it is declared `Final` in `D` [qualifiers_final_annotation_2] +dataclasses_final.py:35:1: error: Cannot assign to `d.final_no_default` — it is declared `Final` in `d` [qualifiers_final_annotation_2] +dataclasses_final.py:36:1: error: Cannot assign to `d.final_with_default` — it is declared `Final` in `d` [qualifiers_final_annotation_2] +dataclasses_final.py:37:1: error: Cannot assign to `D.final_no_default` — it is declared `Final` in `D` [qualifiers_final_annotation_2] +dataclasses_final.py:38:1: error: Cannot assign to `D.final_with_default` — it is declared `Final` in `D` [qualifiers_final_annotation_2] +""" diff --git a/conformance/results/basilisk/dataclasses_frozen.toml b/conformance/results/basilisk/dataclasses_frozen.toml new file mode 100644 index 000000000..4097251e6 --- /dev/null +++ b/conformance/results/basilisk/dataclasses_frozen.toml @@ -0,0 +1,10 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +dataclasses_frozen.py:16:1: error: Cannot assign to attribute `a` of frozen dataclass `DC1` instance `dc1` [dataclasses_frozen] +dataclasses_frozen.py:17:1: error: Cannot assign to attribute `b` of frozen dataclass `DC1` instance `dc1` [dataclasses_frozen] +dataclasses_frozen.py:22:1: error: Non-frozen dataclass `DC2` cannot inherit from frozen dataclass `DC1` [dataclasses_frozen] +dataclasses_frozen.py:32:1: error: Frozen dataclass `DC4` cannot inherit from non-frozen dataclass `DC3` [dataclasses_frozen] +""" diff --git a/conformance/results/basilisk/dataclasses_hash.toml b/conformance/results/basilisk/dataclasses_hash.toml new file mode 100644 index 000000000..e958053e1 --- /dev/null +++ b/conformance/results/basilisk/dataclasses_hash.toml @@ -0,0 +1,10 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +dataclasses_hash.py:17:1: error: Cannot call `.__hash__()` on `DC1` instance: `DC1.__hash__` is `None` [dataclasses_hash] +dataclasses_hash.py:18:1: error: Cannot assign `DC1` instance to `Hashable`-annotated variable `v1`: `DC1` is not hashable [dataclasses_hash] +dataclasses_hash.py:39:1: error: Cannot call `.__hash__()` on `DC3` instance: `DC3.__hash__` is `None` [dataclasses_hash] +dataclasses_hash.py:40:1: error: Cannot assign `DC3` instance to `Hashable`-annotated variable `v3`: `DC3` is not hashable [dataclasses_hash] +""" diff --git a/conformance/results/basilisk/dataclasses_inheritance.toml b/conformance/results/basilisk/dataclasses_inheritance.toml new file mode 100644 index 000000000..58c442b1f --- /dev/null +++ b/conformance/results/basilisk/dataclasses_inheritance.toml @@ -0,0 +1,8 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +dataclasses_inheritance.py:62:5: error: Attribute `x` in `DC7` has type `ClassVar[int]` but base class `DC6` declares it as `int` [classes_override_2] +dataclasses_inheritance.py:66:5: error: Attribute `y` in `DC7` has type `int` but base class `DC6` declares it as `ClassVar[int]` [classes_override_2] +""" diff --git a/conformance/results/basilisk/dataclasses_kwonly.toml b/conformance/results/basilisk/dataclasses_kwonly.toml new file mode 100644 index 000000000..fd01639e2 --- /dev/null +++ b/conformance/results/basilisk/dataclasses_kwonly.toml @@ -0,0 +1,9 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +dataclasses_kwonly.py:23:11: error: Too many positional arguments to `DC1`: 1 argument(s) must be passed as keyword arguments [dataclasses_kwonly] +dataclasses_kwonly.py:38:11: error: Too many positional arguments to `DC2`: 1 argument(s) must be passed as keyword arguments [dataclasses_kwonly] +dataclasses_kwonly.py:53:11: error: Too many positional arguments to `DC3`: 1 argument(s) must be passed as keyword arguments [dataclasses_kwonly] +""" diff --git a/conformance/results/basilisk/dataclasses_match_args.toml b/conformance/results/basilisk/dataclasses_match_args.toml new file mode 100644 index 000000000..5793cef05 --- /dev/null +++ b/conformance/results/basilisk/dataclasses_match_args.toml @@ -0,0 +1,7 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +dataclasses_match_args.py:42:1: error: `DC4.__match_args__` does not exist: `@dataclass(match_args=False)` suppresses `__match_args__` generation [dataclasses_match_args] +""" diff --git a/conformance/results/basilisk/dataclasses_order.toml b/conformance/results/basilisk/dataclasses_order.toml new file mode 100644 index 000000000..681193b84 --- /dev/null +++ b/conformance/results/basilisk/dataclasses_order.toml @@ -0,0 +1,7 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +dataclasses_order.py:50:4: error: Cannot compare `DC1` and `DC2` with ordering operator: `@dataclass(order=True)` comparison methods only accept the same type [dataclasses_order] +""" diff --git a/conformance/results/basilisk/dataclasses_postinit.toml b/conformance/results/basilisk/dataclasses_postinit.toml new file mode 100644 index 000000000..72a599249 --- /dev/null +++ b/conformance/results/basilisk/dataclasses_postinit.toml @@ -0,0 +1,10 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +dataclasses_postinit.py:19:37: error: `__post_init__` parameter `y` has type `int` but `InitVar` field `y` declares inner type `str` [dataclasses_postinit] +dataclasses_postinit.py:28:7: error: Cannot access `InitVar` field `x` on `dc1`: `InitVar` fields are not stored as instance attributes [dataclasses_postinit] +dataclasses_postinit.py:29:7: error: Cannot access `InitVar` field `y` on `dc1`: `InitVar` fields are not stored as instance attributes [dataclasses_postinit] +dataclasses_postinit.py:36:9: error: `__post_init__` in `DC2` has 1 parameter after `self`, but 2 `InitVar` fields declared [dataclasses_postinit] +""" diff --git a/conformance/results/basilisk/dataclasses_slots.toml b/conformance/results/basilisk/dataclasses_slots.toml new file mode 100644 index 000000000..60397ea01 --- /dev/null +++ b/conformance/results/basilisk/dataclasses_slots.toml @@ -0,0 +1,11 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +dataclasses_slots.py:11:7: error: `__slots__` is already defined in `DC1`: cannot also use `@dataclass(slots=True)` [dataclasses_slots] +dataclasses_slots.py:25:9: error: Cannot assign to attribute `y` on `DC2`: `y` is not defined in `__slots__` [dataclasses_slots] +dataclasses_slots.py:38:9: error: Cannot assign to attribute `y` on `DC3`: `y` is not defined in `__slots__` [dataclasses_slots] +dataclasses_slots.py:66:1: error: Cannot access `__slots__` on `DC6`: class does not define `__slots__` [dataclasses_slots] +dataclasses_slots.py:69:1: error: Cannot access `__slots__` on `DC6` instance: class does not define `__slots__` [dataclasses_slots] +""" diff --git a/conformance/results/basilisk/dataclasses_transform_class.toml b/conformance/results/basilisk/dataclasses_transform_class.toml new file mode 100644 index 000000000..381a4f0de --- /dev/null +++ b/conformance/results/basilisk/dataclasses_transform_class.toml @@ -0,0 +1,12 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +dataclasses_transform_class.py:51:7: error: Non-frozen class `Customer1Subclass` cannot inherit from frozen dataclass-transform class `Customer1` [dataclasses_transform_class] +dataclasses_transform_class.py:63:1: error: Cannot assign to attribute `id` of frozen dataclass-transform class `Customer1` instance `c1_1` [dataclasses_transform_class] +dataclasses_transform_class.py:66:8: error: Constructor of `Customer1` only accepts keyword arguments (kw_only=True) [dataclasses_transform_class] +dataclasses_transform_class.py:72:1: error: Comparison operator not supported: `Customer1` does not synthesise ordering methods (order=False by default) [dataclasses_transform_class] +dataclasses_transform_class.py:82:8: error: Constructor of `Customer2` only accepts keyword arguments (kw_only=True) [dataclasses_transform_class] +dataclasses_transform_class.py:122:1: error: Cannot assign to attribute `id` of frozen dataclass-transform class `Customer3` instance `c3_1` [dataclasses_transform_class] +""" diff --git a/conformance/results/basilisk/dataclasses_transform_converter.toml b/conformance/results/basilisk/dataclasses_transform_converter.toml new file mode 100644 index 000000000..f2547ddbf --- /dev/null +++ b/conformance/results/basilisk/dataclasses_transform_converter.toml @@ -0,0 +1,15 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +dataclasses_transform_converter.py:48:31: error: Converter `bad_converter1` must accept at least one positional argument [dataclasses_transform_class] +dataclasses_transform_converter.py:49:31: error: Converter `bad_converter2` must accept at least one positional argument [dataclasses_transform_class] +dataclasses_transform_converter.py:107:5: error: Argument for field `field0` of `DC2` has type `int`, but its converter accepts `str` [dataclasses_transform_class] +dataclasses_transform_converter.py:108:23: error: Argument for field `field3` of `DC2` has type `int`, but its converter accepts `str | bytes` [dataclasses_transform_class] +dataclasses_transform_converter.py:109:29: error: Argument for field `field4` of `DC2` has type `complex`, but its converter accepts `str | list[str]` [dataclasses_transform_class] +dataclasses_transform_converter.py:118:1: error: Cannot assign `int` to field `field0` of `DC2`: its converter accepts `str` [dataclasses_transform_class] +dataclasses_transform_converter.py:119:1: error: Cannot assign `int` to field `field3` of `DC2`: its converter accepts `str | bytes` [dataclasses_transform_class] +dataclasses_transform_converter.py:130:59: error: `default` of type `int` is not assignable to the converter's input type `str` [dataclasses_transform_class] +dataclasses_transform_converter.py:133:59: error: `default_factory` of type `int` is not assignable to the converter's input type `str` [dataclasses_transform_class] +""" diff --git a/conformance/results/basilisk/dataclasses_transform_field.toml b/conformance/results/basilisk/dataclasses_transform_field.toml new file mode 100644 index 000000000..1a77ac4b4 --- /dev/null +++ b/conformance/results/basilisk/dataclasses_transform_field.toml @@ -0,0 +1,8 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +dataclasses_transform_field.py:64:1: error: Unexpected keyword argument `id` for `CustomerModel1`: field `id` is not included in `__init__` [dataclasses_kwonly] +dataclasses_transform_field.py:75:16: error: Too many positional arguments to `CustomerModel2`: 1 argument(s) must be passed as keyword arguments [dataclasses_kwonly] +""" diff --git a/conformance/results/basilisk/dataclasses_transform_func.toml b/conformance/results/basilisk/dataclasses_transform_func.toml new file mode 100644 index 000000000..d52b4c6f9 --- /dev/null +++ b/conformance/results/basilisk/dataclasses_transform_func.toml @@ -0,0 +1,12 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +dataclasses_transform_func.py:56:1: error: Type mismatch: `c1_2.name` is typed `str` but assigned an `int` literal [assignment_compatibility] +dataclasses_transform_func.py:60:1: error: Cannot use ordering operator on `Customer1`: comparison methods are not synthesized (order is not enabled) [dataclasses_order] +dataclasses_transform_func.py:64:36: error: Unknown field `salary` in constructor of dataclass `Customer1` [constructors_call_init] +dataclasses_transform_func.py:70:18: error: Too many positional arguments to `Customer2`: 2 argument(s) must be passed as keyword arguments [dataclasses_kwonly] +dataclasses_transform_func.py:88:1: error: Non-frozen dataclass `Customer3Subclass` cannot inherit from frozen dataclass `Customer3` [dataclasses_frozen] +dataclasses_transform_func.py:96:1: error: Cannot assign to attribute `id` of frozen dataclass `Customer3` instance `c3_1` [dataclasses_frozen] +""" diff --git a/conformance/results/basilisk/dataclasses_transform_meta.toml b/conformance/results/basilisk/dataclasses_transform_meta.toml new file mode 100644 index 000000000..c944a486e --- /dev/null +++ b/conformance/results/basilisk/dataclasses_transform_meta.toml @@ -0,0 +1,12 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +dataclasses_transform_meta.py:51:1: error: Non-frozen class `Customer1Subclass` cannot inherit from frozen dataclass_transform class `Customer1` [dataclasses_transform_meta] +dataclasses_transform_meta.py:63:1: error: Cannot assign to attribute `id` of frozen dataclass_transform class `Customer1` instance `c1_1` [dataclasses_transform_meta] +dataclasses_transform_meta.py:66:8: error: Positional argument(s) passed to `Customer1` whose constructor is keyword-only (dataclass_transform `kw_only_default=True`) [dataclasses_transform_meta] +dataclasses_transform_meta.py:73:6: error: Ordering comparison on `c1_1` instance: class `Customer1` does not synthesize comparison methods (missing `order=True`) [dataclasses_transform_meta] +dataclasses_transform_meta.py:83:8: error: Positional argument(s) passed to `Customer2` whose constructor is keyword-only (dataclass_transform `kw_only_default=True`) [dataclasses_transform_meta] +dataclasses_transform_meta.py:103:1: error: Cannot assign to attribute `id` of frozen dataclass_transform class `Customer3` instance `c3_1` [dataclasses_transform_meta] +""" diff --git a/conformance/results/basilisk/dataclasses_usage.toml b/conformance/results/basilisk/dataclasses_usage.toml new file mode 100644 index 000000000..c3e5f0deb --- /dev/null +++ b/conformance/results/basilisk/dataclasses_usage.toml @@ -0,0 +1,18 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +dataclasses_usage.py:51:6: error: Call to `InventoryItem()` is missing 1 required field argument (expected at least 2, got 1) [calls_argument_count] +dataclasses_usage.py:52:28: error: Argument 2 to `InventoryItem()` has type `str` but field `unit_price` expects `float` [calls_argument_count] +dataclasses_usage.py:53:36: error: Too many positional arguments to `InventoryItem`: 1 argument(s) must be passed as keyword arguments [dataclasses_kwonly] +dataclasses_usage.py:62:5: error: Dataclass field `b` without a default cannot follow a field with a default in `DC1` [dataclasses_inheritance] +dataclasses_usage.py:68:5: error: Dataclass field `b` without a default cannot follow a field with a default in `DC2` [dataclasses_inheritance] +dataclasses_usage.py:74:5: error: Dataclass field `b` without a default cannot follow a field with a default in `DC3` [dataclasses_inheritance] +dataclasses_usage.py:84:13: error: Too many positional arguments to `DC4`: 1 argument(s) must be passed as keyword arguments [dataclasses_kwonly] +dataclasses_usage.py:89:5: error: Field `a` is annotated as `int` but `default_factory=str` produces `str` values [dataclasses_usage] +dataclasses_usage.py:128:8: error: Too many positional arguments to `DC7`: 1 argument(s) must be passed as keyword arguments [dataclasses_kwonly] +dataclasses_usage.py:131:1: error: Call to `DC8()` is missing 1 required argument for `__init__` (expected 2, got 1) [calls_argument_count] +dataclasses_usage.py:180:1: error: Cannot pass arguments to `DC13()`: `@dataclass(init=False)` is set with no explicit `__init__` method defined [calls_argument_count] +dataclasses_usage.py:246:12: error: Too many positional arguments to `DC19`: 1 argument(s) must be passed as keyword arguments [dataclasses_kwonly] +""" diff --git a/conformance/results/basilisk/directives_assert_type.toml b/conformance/results/basilisk/directives_assert_type.toml new file mode 100644 index 000000000..d664115f5 --- /dev/null +++ b/conformance/results/basilisk/directives_assert_type.toml @@ -0,0 +1,14 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +directives_assert_type.py:27:5: error: Type mismatch in `assert_type()`: expression has type `int | str` but expected `int` [directives_assert_type_2] +directives_assert_type.py:28:5: error: Type mismatch in `assert_type()`: expression has type `int | str` but expected `Any` [directives_assert_type_2] +directives_assert_type.py:29:5: error: Type mismatch in `assert_type()`: expression has type `Any` but expected `int` [directives_assert_type_2] +directives_assert_type.py:30:5: error: Type mismatch in `assert_type()`: expression has type `Literal[4]` but expected `int` [directives_assert_type_2] +directives_assert_type.py:32:5: error: `assert_type()` requires exactly 2 arguments (value, type), got 0 [directives_assert_type] +directives_assert_type.py:33:5: error: Type mismatch in `assert_type()`: expression has type `str` but expected `int` [directives_assert_type_2] +directives_assert_type.py:34:5: error: `assert_type()` requires exactly 2 arguments (value, type), got 3 [directives_assert_type] +directives_assert_type.py:41:5: error: Type mismatch in `assert_type()`: expression has type `str` but expected `str | Literal["spam"]` [directives_assert_type_2] +""" diff --git a/conformance/results/basilisk/directives_cast.toml b/conformance/results/basilisk/directives_cast.toml new file mode 100644 index 000000000..da50c394b --- /dev/null +++ b/conformance/results/basilisk/directives_cast.toml @@ -0,0 +1,9 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +directives_cast.py:15:8: error: `cast()` requires exactly 2 arguments (type, value), got 0 [directives_cast] +directives_cast.py:16:13: error: First argument of `cast()` must be a type, not a value literal [directives_cast] +directives_cast.py:17:8: error: `cast()` requires exactly 2 arguments (type, value), got 3 [directives_cast] +""" diff --git a/conformance/results/basilisk/directives_deprecated.toml b/conformance/results/basilisk/directives_deprecated.toml new file mode 100644 index 000000000..edc6584bd --- /dev/null +++ b/conformance/results/basilisk/directives_deprecated.toml @@ -0,0 +1,19 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +directives_deprecated.py:18:1: error: Use of deprecated class `Ham` [directives_deprecated] +directives_deprecated.py:24:1: error: Use of deprecated function `norwegian_blue` [directives_deprecated] +directives_deprecated.py:25:5: error: Use of deprecated function `norwegian_blue` [directives_deprecated] +directives_deprecated.py:30:1: error: Use of deprecated overload `foo` [directives_deprecated] +directives_deprecated.py:34:7: error: Use of deprecated class `Ham` [directives_deprecated] +directives_deprecated.py:41:5: error: Use of deprecated method `Spam.__add__` [directives_deprecated] +directives_deprecated.py:42:1: error: Use of deprecated method `Spam.__add__` [directives_deprecated] +directives_deprecated.py:44:1: error: Use of deprecated property `Spam.greasy` [directives_deprecated] +directives_deprecated.py:47:1: error: Use of deprecated property setter `Spam.shape` [directives_deprecated] +directives_deprecated.py:48:1: error: Use of deprecated property setter `Spam.shape` [directives_deprecated] +directives_deprecated.py:58:1: error: Use of deprecated method `Invocable.__call__` [directives_deprecated] +directives_deprecated.py:69:1: error: Use of deprecated function `lorem` [directives_deprecated] +directives_deprecated.py:98:5: error: Use of deprecated method `foo` [directives_deprecated] +""" diff --git a/conformance/results/basilisk/directives_disjoint_base.toml b/conformance/results/basilisk/directives_disjoint_base.toml new file mode 100644 index 000000000..d4975e800 --- /dev/null +++ b/conformance/results/basilisk/directives_disjoint_base.toml @@ -0,0 +1,14 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +directives_disjoint_base.py:69:7: error: Class has incompatible disjoint bases (Left, Right): no single base is a subclass of all the others [directives_disjoint_base] +directives_disjoint_base.py:73:7: error: Class has incompatible disjoint bases (LeftChild, Right): no single base is a subclass of all the others [directives_disjoint_base] +directives_disjoint_base.py:77:7: error: Class has incompatible disjoint bases (Left, Right): no single base is a subclass of all the others [directives_disjoint_base] +directives_disjoint_base.py:81:7: error: Class has incompatible disjoint bases (Left, Record): no single base is a subclass of all the others [directives_disjoint_base] +directives_disjoint_base.py:105:7: error: Class has incompatible disjoint bases (SlotBase1, SlotBase2): no single base is a subclass of all the others [directives_disjoint_base] +directives_disjoint_base.py:113:2: error: `@disjoint_base` cannot be applied to a function [directives_disjoint_base] +directives_disjoint_base.py:118:2: error: `@disjoint_base` cannot be applied to a TypedDict [directives_disjoint_base] +directives_disjoint_base.py:123:2: error: `@disjoint_base` cannot be applied to a Protocol [directives_disjoint_base] +""" diff --git a/conformance/results/basilisk/directives_no_type_check.toml b/conformance/results/basilisk/directives_no_type_check.toml new file mode 100644 index 000000000..9c5403adf --- /dev/null +++ b/conformance/results/basilisk/directives_no_type_check.toml @@ -0,0 +1,10 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +directives_no_type_check.py:26:5: error: Function `func1` is annotated `-> None` but has a `return` statement with a value [returns_compatibility_2] +directives_no_type_check.py:29:7: error: Argument `a` of `func1` expects `int` but received a `bytes` literal [calls_argument_type] +directives_no_type_check.py:29:19: error: Argument `b` of `func1` expects `str` but received a `bytes` literal [calls_argument_type] +directives_no_type_check.py:32:1: error: Call to `func1` is missing 2 required arguments (expected 2, got 0) [calls_argument_count] +""" diff --git a/conformance/results/basilisk/directives_reveal_type.toml b/conformance/results/basilisk/directives_reveal_type.toml new file mode 100644 index 000000000..462a74842 --- /dev/null +++ b/conformance/results/basilisk/directives_reveal_type.toml @@ -0,0 +1,8 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +directives_reveal_type.py:19:5: error: `reveal_type()` requires exactly 1 argument, got 0 [directives_reveal_type] +directives_reveal_type.py:20:5: error: `reveal_type()` requires exactly 1 argument, got 2 [directives_reveal_type] +""" diff --git a/conformance/results/basilisk/directives_type_checking.toml b/conformance/results/basilisk/directives_type_checking.toml new file mode 100644 index 000000000..be211bd5b --- /dev/null +++ b/conformance/results/basilisk/directives_type_checking.toml @@ -0,0 +1,6 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +""" diff --git a/conformance/results/basilisk/directives_type_ignore.toml b/conformance/results/basilisk/directives_type_ignore.toml new file mode 100644 index 000000000..be211bd5b --- /dev/null +++ b/conformance/results/basilisk/directives_type_ignore.toml @@ -0,0 +1,6 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +""" diff --git a/conformance/results/basilisk/directives_type_ignore_file1.toml b/conformance/results/basilisk/directives_type_ignore_file1.toml new file mode 100644 index 000000000..be211bd5b --- /dev/null +++ b/conformance/results/basilisk/directives_type_ignore_file1.toml @@ -0,0 +1,6 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +""" diff --git a/conformance/results/basilisk/directives_type_ignore_file2.toml b/conformance/results/basilisk/directives_type_ignore_file2.toml new file mode 100644 index 000000000..1cdfbe772 --- /dev/null +++ b/conformance/results/basilisk/directives_type_ignore_file2.toml @@ -0,0 +1,7 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +directives_type_ignore_file2.py:14:1: error: Type mismatch: `x` is annotated `int` (int) but assigned str [assignment_compatibility] +""" diff --git a/conformance/results/basilisk/directives_version_platform.toml b/conformance/results/basilisk/directives_version_platform.toml new file mode 100644 index 000000000..3a6d5df8e --- /dev/null +++ b/conformance/results/basilisk/directives_version_platform.toml @@ -0,0 +1,9 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +directives_version_platform.py:33:19: error: Variable `val3` is only defined in a dead version/platform branch [directives_version_platform] +directives_version_platform.py:50:19: error: Variable `val6` is only defined in a dead version/platform branch [directives_version_platform] +directives_version_platform.py:59:19: error: Variable `val9` is only defined in a dead version/platform branch [directives_version_platform] +""" diff --git a/conformance/results/basilisk/enums_behaviors.toml b/conformance/results/basilisk/enums_behaviors.toml new file mode 100644 index 000000000..99159562b --- /dev/null +++ b/conformance/results/basilisk/enums_behaviors.toml @@ -0,0 +1,9 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +enums_behaviors.py:28:1: error: Redundant `assert_type` with `Literal[Color.RED]` on enum-typed parameter [enums_expansion] +enums_behaviors.py:32:1: error: Redundant `assert_type` with `Literal[Color.BLUE]` on enum-typed parameter [enums_expansion] +enums_behaviors.py:44:7: error: Cannot subclass `Shape` because it has members and is implicitly final [enums_behaviors] +""" diff --git a/conformance/results/basilisk/enums_definition.toml b/conformance/results/basilisk/enums_definition.toml new file mode 100644 index 000000000..f8a2201b1 --- /dev/null +++ b/conformance/results/basilisk/enums_definition.toml @@ -0,0 +1,7 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +enums_definition.py:92:1: error: Enum `Color12` has no member `BLUE` for the target Python version — it is defined only under a version guard that is not satisfied [enums_definition] +""" diff --git a/conformance/results/basilisk/enums_expansion.toml b/conformance/results/basilisk/enums_expansion.toml new file mode 100644 index 000000000..8895a74ec --- /dev/null +++ b/conformance/results/basilisk/enums_expansion.toml @@ -0,0 +1,8 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +enums_expansion.py:25:9: error: Redundant `assert_type` with `Literal[Color.GREEN]` on enum-typed parameter [enums_expansion] +enums_expansion.py:53:9: error: Redundant `assert_type` with `Literal[CustomFlags.FLAG3]` on enum-typed parameter [enums_expansion] +""" diff --git a/conformance/results/basilisk/enums_member_names.toml b/conformance/results/basilisk/enums_member_names.toml new file mode 100644 index 000000000..be211bd5b --- /dev/null +++ b/conformance/results/basilisk/enums_member_names.toml @@ -0,0 +1,6 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +""" diff --git a/conformance/results/basilisk/enums_member_values.toml b/conformance/results/basilisk/enums_member_values.toml new file mode 100644 index 000000000..a3c22f7e0 --- /dev/null +++ b/conformance/results/basilisk/enums_member_values.toml @@ -0,0 +1,8 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +enums_member_values.py:78:13: error: Enum member value has type `str` but `_value_` is declared as `int` in `Color3` [enums_member_values] +enums_member_values.py:85:9: error: `self._value_` is assigned from a parameter of type `int` but `_value_` is declared as `str` in `Planet2` [enums_member_values] +""" diff --git a/conformance/results/basilisk/enums_members.toml b/conformance/results/basilisk/enums_members.toml new file mode 100644 index 000000000..e5cd20d45 --- /dev/null +++ b/conformance/results/basilisk/enums_members.toml @@ -0,0 +1,13 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +enums_members.py:54:5: error: Enum member `DOG` in `Pet3` should not have an explicit type annotation [enums_members] +enums_members.py:86:12: error: `Pet4.converter` is not an enum member and cannot be used in `Literal[Pet4.converter]` [enums_members_2] +enums_members.py:87:12: error: `Pet4.transform` is not an enum member and cannot be used in `Literal[Pet4.transform]` [enums_members_2] +enums_members.py:88:10: error: `Pet4.species` is not an enum member and cannot be used in `Literal[Pet4.species]` [enums_members_2] +enums_members.py:89:8: error: `Pet4.speak` is not an enum member and cannot be used in `Literal[Pet4.speak]` [enums_members_2] +enums_members.py:120:1: error: `Example.b` is not an enum member and cannot be used in `Literal[Example.b]` [enums_members_2] +enums_members.py:133:9: error: `Example2.__B` is not an enum member and cannot be used in `Literal[Example2.__B]` [enums_members_2] +""" diff --git a/conformance/results/basilisk/exceptions_context_managers.toml b/conformance/results/basilisk/exceptions_context_managers.toml new file mode 100644 index 000000000..be211bd5b --- /dev/null +++ b/conformance/results/basilisk/exceptions_context_managers.toml @@ -0,0 +1,6 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +""" diff --git a/conformance/results/basilisk/generics_base_class.toml b/conformance/results/basilisk/generics_base_class.toml new file mode 100644 index 000000000..7b9638250 --- /dev/null +++ b/conformance/results/basilisk/generics_base_class.toml @@ -0,0 +1,13 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +generics_base_class.py:26:5: error: Argument `x` of `takes_dict_incorrect` expects `dict[str, list[object]]` but received `SymbolTable` (subclass of `dict[str, list[Node]]`) -- ` list[Node]` is not assignable to ` list[object]` because `list` is invariant [generics_base_class_3] +generics_base_class.py:29:11: error: Invalid type expression in annotation for parameter `y` [annotations_forward_refs] +generics_base_class.py:30:5: error: Invalid type expression in annotation for local variable `x` [annotations_forward_refs] +generics_base_class.py:49:22: error: Too many type arguments for `LinkedList`; expected at most 1, got 2 [generics_defaults_specialization] +generics_base_class.py:61:18: error: Too many type arguments for `MyDict`; expected at most 1, got 2 [generics_defaults_specialization] +generics_base_class.py:68:28: error: TypeVar `T` appears more than once in `Generic[...]` for `BadClass1` [generics_base_class] +generics_base_class.py:98:7: error: Inconsistent TypeVar ordering for `Grandparent` in base classes of `BadChild` [generics_base_class_2] +""" diff --git a/conformance/results/basilisk/generics_basic.toml b/conformance/results/basilisk/generics_basic.toml new file mode 100644 index 000000000..73a4cf67a --- /dev/null +++ b/conformance/results/basilisk/generics_basic.toml @@ -0,0 +1,24 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +generics_basic.py:40:5: error: Constraint mismatch for TypeVar `AnyStr` in call to `concat`: argument types belong to different constraint groups [generics_basic_3] +generics_basic.py:41:5: error: Constraint mismatch for TypeVar `AnyStr` in call to `concat`: argument types belong to different constraint groups [generics_basic_3] +generics_basic.py:49:18: error: `BadConstraint1` has a single constraint; TypeVar requires 0 or 2+ constraints [generics_basic] +generics_basic.py:55:22: error: `BadConstraint2` has a constraint that is parameterized by a type variable [generics_basic] +generics_basic.py:69:5: error: Constraint mismatch for TypeVar `AnyStr` in call to `concat`: argument types belong to different constraint groups [generics_basic_3] +generics_basic.py:121:24: error: TypeVar `T` appears more than once in `Generic[...]` for `Pair2` [generics_base_class] +generics_basic.py:157:5: error: Invalid subscript key type `int` for `m1` which expects key type `str` [generics_basic_3] +generics_basic.py:158:5: error: Invalid subscript key type `int` for `m2` which expects key type `str` [generics_basic_3] +generics_basic.py:162:20: error: Non-TypeVar argument in `Generic[...]` or `Protocol[...]` for `Bad1` [generics_basic_2] +generics_basic.py:163:21: error: Non-TypeVar argument in `Generic[...]` or `Protocol[...]` for `Bad2` [generics_basic_2] +generics_basic.py:171:7: error: Type parameter`T_co` used in a base class of `Bad3` but not listed in `Generic[...]` or `Protocol[...]` [generics_basic_2] +generics_basic.py:172:7: error: Type parameter`T_co` used in a base class of `Bad4` but not listed in `Generic[...]` or `Protocol[...]` [generics_basic_2] +generics_basic.py:208:1: error: Class `GenericMetaInstance` uses a parameterized generic type as its metaclass [generics_basic_3] +generics_basic.py:223:22: error: Argument `y` of `takes_two_lists` expects `list[T]` but received a scalar literal where `list[T]` is required — no type-variable assignment makes it valid [calls_argument_type] +generics_basic.py:232:5: error: TypeVar `T` is not bound in this scope [generics_variance_inference] +generics_basic.py:240:26: error: Argument `y` of `takes_two_int_lists` expects `list[T_int]` but received a scalar literal where `list[T_int]` is required — no type-variable assignment makes it valid [calls_argument_type] +generics_basic.py:241:26: error: Argument `y` of `takes_two_int_lists` expects `list[T_int]` but received `list[str]` where `list[T_int]` is required — `str` does not satisfy type variable `T_int` [calls_argument_type] +generics_basic.py:251:5: error: TypeVar `T` is not bound in this scope [generics_variance_inference] +""" diff --git a/conformance/results/basilisk/generics_defaults.toml b/conformance/results/basilisk/generics_defaults.toml new file mode 100644 index 000000000..65fad56a4 --- /dev/null +++ b/conformance/results/basilisk/generics_defaults.toml @@ -0,0 +1,12 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +generics_defaults.py:24:53: error: Non-default `TypeVar` `T` follows a default `TypeVar` in `Generic[...]` for `NonDefaultFollowsDefault` [generics_defaults] +generics_defaults.py:66:8: error: Too few type arguments for `AllTheDefaults`; expected at least 2, got 1 [generics_defaults_specialization] +generics_defaults.py:152:12: error: `TypeVar` `Invalid1` has `default=int` which is not a subtype of `bound=str` [generics_defaults_2] +generics_defaults.py:159:12: error: `TypeVar` `Invalid2` has `default=int` which is not one of the constraints (`float`, `str`) [generics_defaults_2] +generics_defaults.py:177:1: error: Type mismatch in `assert_type()`: expression has type `int` but expected `Any` [directives_assert_type_2] +generics_defaults.py:188:25: error: `TypeVar` `T5` with `default=` cannot follow a `TypeVarTuple` in `Generic[...]` for `Foo5` [generics_defaults] +""" diff --git a/conformance/results/basilisk/generics_defaults_referential.toml b/conformance/results/basilisk/generics_defaults_referential.toml new file mode 100644 index 000000000..5322a56eb --- /dev/null +++ b/conformance/results/basilisk/generics_defaults_referential.toml @@ -0,0 +1,15 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +generics_defaults_referential.py:37:5: error: Argument `s` of type `str` is not compatible with parameter `b: int` in `Foo.__init__` (`TypeVar` default propagation) [generics_variance_inference] +generics_defaults_referential.py:38:5: error: Argument `s` of type `str` is not compatible with parameter `a: int` in `Foo.__init__` (`TypeVar` default propagation) [generics_variance_inference] +generics_defaults_referential.py:54:7: error: TypeVar `Start2T` has default `StopT` which is not properly ordered in `Generic[...]` for `slice2` [generics_defaults_referential_2] +generics_defaults_referential.py:61:1: error: TypeVar `S2` has default `S1` which references an outer-scope TypeVar [generics_defaults_referential_2] +generics_defaults_referential.py:69:12: error: `TypeVar` `Invalid1` has `default=X1` but `X1`'s bound `int` is not a subtype of `Invalid1`'s bound `str` [generics_defaults_referential] +generics_defaults_referential.py:69:12: error: TypeVar `Invalid1` has default `X1` with bound `int` which is not a subtype of `Invalid1`'s bound `str` [generics_defaults_referential_2] +generics_defaults_referential.py:75:12: error: TypeVar `Invalid2` has default `Y1` with upper bound `int` which is incompatible with constraints `float, str` [generics_defaults_referential_2] +generics_defaults_referential.py:79:16: error: `TypeVar` `AlsoInvalid2` has `default=Y2` but `Y2`'s constraints {`int`, `str`} are not a subset of `AlsoInvalid2`'s constraints {`bool`, `complex`} [generics_defaults_referential] +generics_defaults_referential.py:79:16: error: TypeVar `AlsoInvalid2`'s constraints `{bool, complex}` are not a superset of default TypeVar `Y2`'s constraints `{int, str}` [generics_defaults_referential_2] +""" diff --git a/conformance/results/basilisk/generics_defaults_specialization.toml b/conformance/results/basilisk/generics_defaults_specialization.toml new file mode 100644 index 000000000..4574e8570 --- /dev/null +++ b/conformance/results/basilisk/generics_defaults_specialization.toml @@ -0,0 +1,9 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +generics_defaults_specialization.py:30:1: error: Too many type arguments for `MyAlias`; expected at most 1, got 2 [generics_defaults_specialization] +generics_defaults_specialization.py:46:1: error: Type mismatch: `x2` is annotated `type[Bar[int]]` but assigned bare `Bar`, whose type parameter `DefaultStrT` defaults to `str` [assignment_compatibility] +generics_defaults_specialization.py:56:1: error: `Foo` cannot be subscripted; it has no free type parameters [generics_defaults_specialization] +""" diff --git a/conformance/results/basilisk/generics_paramspec_basic.toml b/conformance/results/basilisk/generics_paramspec_basic.toml new file mode 100644 index 000000000..14e41e8b7 --- /dev/null +++ b/conformance/results/basilisk/generics_paramspec_basic.toml @@ -0,0 +1,14 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +generics_paramspec_basic.py:10:13: error: Variable name `WrongName` does not match the name string `NotIt` passed to `ParamSpec` [generics_basic] +generics_paramspec_basic.py:15:1: error: `TypeAlias` `TA1` has a `ParamSpec` as its type, which is invalid; `ParamSpec` can only be used in `Callable[P, ReturnType]` [annotations_forward_refs] +generics_paramspec_basic.py:23:11: error: Invalid type expression in annotation for parameter `x` [annotations_forward_refs] +generics_paramspec_basic.py:27:11: error: Invalid type expression in annotation for parameter `x` [annotations_forward_refs] +generics_paramspec_basic.py:31:11: error: Invalid type expression in annotation for parameter `x` [annotations_forward_refs] +generics_paramspec_basic.py:35:11: error: Invalid type expression in annotation for parameter `x` [annotations_forward_refs] +generics_paramspec_basic.py:39:12: error: Invalid type expression in annotation for parameter `args` [annotations_forward_refs] +generics_paramspec_basic.py:39:23: error: Invalid type expression in annotation for parameter `kwargs` [annotations_forward_refs] +""" diff --git a/conformance/results/basilisk/generics_paramspec_components.toml b/conformance/results/basilisk/generics_paramspec_components.toml new file mode 100644 index 000000000..132fab868 --- /dev/null +++ b/conformance/results/basilisk/generics_paramspec_components.toml @@ -0,0 +1,22 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +generics_paramspec_components.py:17:17: error: Invalid ParamSpec usage: `*args` must be annotated `P.args` and `**kwargs` must be annotated `P.kwargs` [callables_protocol] +generics_paramspec_components.py:20:20: error: Invalid ParamSpec usage: ParamSpec components are only valid on `*args` and `**kwargs` [callables_protocol] +generics_paramspec_components.py:23:20: error: Invalid ParamSpec usage: `*args` must be annotated `P.args` and `**kwargs` must be annotated `P.kwargs` [callables_protocol] +generics_paramspec_components.py:26:20: error: Invalid ParamSpec usage: `*args: P.args` requires a matching `**kwargs: P.kwargs` [callables_protocol] +generics_paramspec_components.py:30:17: error: Invalid ParamSpec usage: ParamSpec components used out of scope: no enclosing binding of the ParamSpec through a `Callable` parameter [callables_protocol] +generics_paramspec_components.py:35:5: error: Invalid ParamSpec usage: ParamSpec components are only valid as `*args: P.args` and `**kwargs: P.kwargs` annotations [callables_protocol] +generics_paramspec_components.py:36:5: error: Invalid ParamSpec usage: ParamSpec components are only valid as `*args: P.args` and `**kwargs: P.kwargs` annotations [callables_protocol] +generics_paramspec_components.py:38:18: error: Invalid ParamSpec usage: `*args: P.args` requires a matching `**kwargs: P.kwargs` [callables_protocol] +generics_paramspec_components.py:41:20: error: Invalid ParamSpec usage: `**kwargs: P.kwargs` requires a matching `*args: P.args` [callables_protocol] +generics_paramspec_components.py:49:9: error: Invalid ParamSpec usage: `*` must forward the `P.args` parameter, not `P.kwargs` [callables_protocol] +generics_paramspec_components.py:51:9: error: Invalid ParamSpec usage: expected 0 positional prefix arguments before the forwarded `*args`, found 1 [callables_protocol] +generics_paramspec_components.py:60:12: error: Invalid ParamSpec usage: no keyword-only parameters may appear between `*args: P.args` and `**kwargs: P.kwargs` [callables_protocol] +generics_paramspec_components.py:70:9: error: Invalid ParamSpec usage: expected 1 positional prefix argument before the forwarded `*args`, found 0 [callables_protocol] +generics_paramspec_components.py:72:9: error: Invalid ParamSpec usage: expected 1 positional prefix argument before the forwarded `*args`, found 0 [callables_protocol] +generics_paramspec_components.py:83:9: error: Invalid ParamSpec usage: prefix parameter `x` must be passed positionally before the forwarded `*args` [callables_protocol] +generics_paramspec_components.py:98:1: error: Invalid ParamSpec usage: forwarded argument 1 has type `str`, but `a_int_b_str` expects `int` [callables_protocol] +""" diff --git a/conformance/results/basilisk/generics_paramspec_semantics.toml b/conformance/results/basilisk/generics_paramspec_semantics.toml new file mode 100644 index 000000000..6dd61c21b --- /dev/null +++ b/conformance/results/basilisk/generics_paramspec_semantics.toml @@ -0,0 +1,16 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +generics_paramspec_semantics.py:26:1: error: Invalid call to `f1`: parameter `a` is positional-only and cannot be passed by keyword [callables_protocol] +generics_paramspec_semantics.py:27:1: error: Invalid call to `f1`: argument 2 has type `str`, expected `bool` [callables_protocol] +generics_paramspec_semantics.py:46:6: error: Incompatible ParamSpec argument(s) to `func1`: arguments x_y, y_x must have identical signatures to bind `P` [callables_protocol] +generics_paramspec_semantics.py:61:1: error: Incompatible ParamSpec argument(s) to `func1`: arguments keyword_only_x, keyword_only_y must have identical signatures to bind `P` [callables_protocol] +generics_paramspec_semantics.py:98:1: error: Invalid call to `a1`: argument 1 has type `int`, expected `str` [callables_protocol] +generics_paramspec_semantics.py:108:1: error: Invalid call to `r1`: argument 1 has type `int`, expected `bool` [callables_protocol] +generics_paramspec_semantics.py:120:1: error: Invalid call to `t1`: argument 1 has type `int`, expected `str` [callables_protocol] +generics_paramspec_semantics.py:127:1: error: `one` is not compatible with the `Callable[Concatenate[...], ...]` parameter of decorator `expects_int_first`: leading parameter is `str`, but the Concatenate prefix supplies `int` [callables_protocol] +generics_paramspec_semantics.py:132:1: error: `two` is not compatible with the `Callable[Concatenate[...], ...]` parameter of decorator `expects_int_first`: expected at least 1 leading positional parameter, found 0 [callables_protocol] +generics_paramspec_semantics.py:137:1: error: `three` is not compatible with the `Callable[Concatenate[...], ...]` parameter of decorator `expects_int_first`: expected at least 1 leading positional parameter, found 0 [callables_protocol] +""" diff --git a/conformance/results/basilisk/generics_paramspec_specialization.toml b/conformance/results/basilisk/generics_paramspec_specialization.toml new file mode 100644 index 000000000..fc675cdb1 --- /dev/null +++ b/conformance/results/basilisk/generics_paramspec_specialization.toml @@ -0,0 +1,11 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +generics_paramspec_specialization.py:44:15: error: Type argument `int` is not valid for `ParamSpec` parameter `P1` of `ClassA` [generics_defaults_specialization] +generics_paramspec_specialization.py:54:9: error: Argument 1 to `x.f` has incompatible type `str`; expected `int` [callables_protocol] +generics_paramspec_specialization.py:55:16: error: Argument 3 to `x.f` has incompatible type `str`; expected `bool` [callables_protocol] +generics_paramspec_specialization.py:60:9: error: Argument 1 to `x.f` has incompatible type `str`; expected `int` [callables_protocol] +generics_paramspec_specialization.py:61:16: error: Argument 3 to `x.f` has incompatible type `str`; expected `bool` [callables_protocol] +""" diff --git a/conformance/results/basilisk/generics_scoping.toml b/conformance/results/basilisk/generics_scoping.toml new file mode 100644 index 000000000..222f2b8d9 --- /dev/null +++ b/conformance/results/basilisk/generics_scoping.toml @@ -0,0 +1,24 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +generics_scoping.py:16:1: error: Type mismatch in `assert_type()`: expression has type `int` but expected `Literal[1]` [directives_assert_type_2] +generics_scoping.py:20:1: error: Type mismatch in `assert_type()`: expression has type `str` but expected `Literal["a"]` [directives_assert_type_2] +generics_scoping.py:34:1: error: Argument `'a'` of type `str` is not compatible with parameter `x: int` (TypeVar `T` is bound to `int` for instance `a: MyClass[T=int]`) [generics_variance_inference] +generics_scoping.py:50:1: error: Type mismatch in `assert_type()`: expression has type `str` but expected `Literal["abc"]` [directives_assert_type_2] +generics_scoping.py:54:1: error: Type mismatch in `assert_type()`: expression has type `bytes` but expected `Literal[b"abc"]` [directives_assert_type_2] +generics_scoping.py:61:5: error: TypeVar `S` is not bound in this scope [generics_variance_inference] +generics_scoping.py:61:8: error: Type variable `S` is not bound in function `fun_3` [generics_scoping] +generics_scoping.py:65:5: error: TypeVar `S` is not bound in this scope [generics_variance_inference] +generics_scoping.py:65:14: error: Type variable `S` is not bound in class `Bar` [generics_scoping] +generics_scoping.py:76:5: error: TypeVar `T` from outer scope cannot be used in nested class definition [generics_variance_inference] +generics_scoping.py:86:5: error: TypeVar `T` from outer scope cannot be used in nested class definition [generics_variance_inference] +generics_scoping.py:89:9: error: TypeVar `T` from outer class cannot be used in nested class body [generics_variance_inference] +generics_scoping.py:98:5: error: TypeVar `T` from enclosing class is not accessible in a TypeAlias definition [generics_variance_inference] +generics_scoping.py:98:24: error: Type variable `T` from class `Outer` cannot be used in a TypeAlias definition [generics_scoping] +generics_scoping.py:105:1: error: TypeVar `T` is not bound in this scope [generics_variance_inference] +generics_scoping.py:105:14: error: Type variable `T` is not bound in the current scope [generics_scoping] +generics_scoping.py:106:14: error: Type variable `T` is not bound in the current scope [generics_scoping] +generics_scoping.py:107:1: error: TypeVar `T` is not bound in this scope [generics_variance_inference] +""" diff --git a/conformance/results/basilisk/generics_self_advanced.toml b/conformance/results/basilisk/generics_self_advanced.toml new file mode 100644 index 000000000..be211bd5b --- /dev/null +++ b/conformance/results/basilisk/generics_self_advanced.toml @@ -0,0 +1,6 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +""" diff --git a/conformance/results/basilisk/generics_self_attributes.toml b/conformance/results/basilisk/generics_self_attributes.toml new file mode 100644 index 000000000..76ff9bf5a --- /dev/null +++ b/conformance/results/basilisk/generics_self_attributes.toml @@ -0,0 +1,8 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +generics_self_attributes.py:26:6: error: Argument `next` is typed as `Self` in `LinkedList`, which resolves to `OrdinalLinkedList` here, but got `LinkedList` instance [generics_self_attributes] +generics_self_attributes.py:32:15: error: Cannot assign `LinkedList` to attribute `next`: `Self` resolves to `OrdinalLinkedList` here, not `LinkedList` [generics_self_attributes] +""" diff --git a/conformance/results/basilisk/generics_self_basic.toml b/conformance/results/basilisk/generics_self_basic.toml new file mode 100644 index 000000000..01aa00a8e --- /dev/null +++ b/conformance/results/basilisk/generics_self_basic.toml @@ -0,0 +1,9 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +generics_self_basic.py:20:9: error: Return type `Self` requires returning the current class instance, but `Shape()` is not `Self` — it would be wrong in a subclass [generics_self_basic] +generics_self_basic.py:33:9: error: Return type `Self` requires returning the current class instance, but `Shape()` is not `Self` — it would be wrong in a subclass [generics_self_basic] +generics_self_basic.py:68:26: error: `Self` is not subscriptable — it already captures the full type of the enclosing class [generics_self_basic] +""" diff --git a/conformance/results/basilisk/generics_self_protocols.toml b/conformance/results/basilisk/generics_self_protocols.toml new file mode 100644 index 000000000..9520d8eb3 --- /dev/null +++ b/conformance/results/basilisk/generics_self_protocols.toml @@ -0,0 +1,8 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +generics_self_protocols.py:61:19: error: Class `BadReturnType` is not compatible with protocol `ShapeProtocol`: method `set_scale` returns `int` instead of `Self` [generics_self_protocols] +generics_self_protocols.py:64:19: error: Class `ReturnDifferentClass` is not compatible with protocol `ShapeProtocol`: method `set_scale` returns `ReturnConcreteShape` instead of `Self` [generics_self_protocols] +""" diff --git a/conformance/results/basilisk/generics_self_usage.toml b/conformance/results/basilisk/generics_self_usage.toml new file mode 100644 index 000000000..44abde5ce --- /dev/null +++ b/conformance/results/basilisk/generics_self_usage.toml @@ -0,0 +1,19 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +generics_self_usage.py:73:5: error: `Self` is not valid in a module-level function; return type of `foo` uses `Self` [generics_self_usage] +generics_self_usage.py:73:9: error: `Self` is not valid in a module-level function; parameter `bar` of `foo` uses `Self` [generics_self_usage] +generics_self_usage.py:76:1: error: `Self` is not valid outside a class body; annotation of `bar` uses `Self` [generics_self_usage] +generics_self_usage.py:82:9: error: Return type `Self` is invalid in `has_existing_self_annotation`: the `self` parameter is annotated with TypeVar `TFoo2`, so `Self` has no defined class binding [generics_self_usage] +generics_self_usage.py:87:9: error: Return type `Self` requires returning the current class instance, but `Foo3()` is not `Self` — it would be wrong in a subclass [generics_self_basic] +generics_self_usage.py:103:7: error: `Self` cannot be used as a base class or in base class type arguments for `Baz` [generics_self_usage] +generics_self_usage.py:105:7: error: `Self` cannot be used as a base class or in base class type arguments for `Baz2` [generics_self_usage] +generics_self_usage.py:108:1: error: `Self` cannot appear in a `TypeAlias` definition at module scope; `TupleSelf` uses `Self` [generics_self_usage] +generics_self_usage.py:113:9: error: `Self` is not valid in a static method; return type of `make` uses `Self` [generics_self_usage] +generics_self_usage.py:118:9: error: `Self` is not valid in a static method; return type of `return_parameter` uses `Self` [generics_self_usage] +generics_self_usage.py:118:26: error: `Self` is not valid in a static method; parameter `foo` of `return_parameter` uses `Self` [generics_self_usage] +generics_self_usage.py:123:9: error: `Self` is not valid in a metaclass method; return type of `__new__` uses `Self` [generics_self_usage] +generics_self_usage.py:127:9: error: `Self` is not valid in a metaclass method; return type of `__mul__` uses `Self` [generics_self_usage] +""" diff --git a/conformance/results/basilisk/generics_syntax_compatibility.toml b/conformance/results/basilisk/generics_syntax_compatibility.toml new file mode 100644 index 000000000..084602400 --- /dev/null +++ b/conformance/results/basilisk/generics_syntax_compatibility.toml @@ -0,0 +1,8 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +generics_syntax_compatibility.py:14:7: error: Class `ClassA` uses PEP 695 type parameter syntax but references traditional TypeVar `K` from outer scope [generics_syntax_compatibility] +generics_syntax_compatibility.py:26:9: error: Function `method2` uses PEP 695 type parameter syntax but references traditional TypeVar `K` from outer scope [generics_syntax_compatibility] +""" diff --git a/conformance/results/basilisk/generics_syntax_declarations.toml b/conformance/results/basilisk/generics_syntax_declarations.toml new file mode 100644 index 000000000..484b6cd4f --- /dev/null +++ b/conformance/results/basilisk/generics_syntax_declarations.toml @@ -0,0 +1,17 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +generics_syntax_declarations.py:17:25: error: Non-TypeVar argument in `Generic[...]` or `Protocol[...]` for `ClassA` [generics_basic_2] +generics_syntax_declarations.py:25:29: error: Non-TypeVar argument in `Generic[...]` or `Protocol[...]` for `ClassC` [generics_basic_2] +generics_syntax_declarations.py:25:32: error: Non-TypeVar argument in `Generic[...]` or `Protocol[...]` for `ClassC` [generics_basic_2] +generics_syntax_declarations.py:32:9: error: Attribute `is_integer` is not defined on `str`; parameter `x` is typed as `T` (bound to `str`) [generics_syntax_declarations_2] +generics_syntax_declarations.py:44:21: error: Type parameter `T` in class `ClassD` references a type variable from an outer scope in its bound; this is not allowed [generics_syntax_declarations] +generics_syntax_declarations.py:48:17: error: Type parameter `T` in class `ClassH` has a list literal as its bound; use a tuple for constraints or a single type for an upper bound [generics_syntax_declarations] +generics_syntax_declarations.py:60:17: error: Type parameter `T` in class `ClassK` has an empty constraint tuple; constraint tuples must contain two or more types [generics_syntax_declarations] +generics_syntax_declarations.py:64:17: error: Type parameter `T` in class `ClassL` has a single-element constraint tuple; constraint tuples must contain two or more types [generics_syntax_declarations] +generics_syntax_declarations.py:71:17: error: Type parameter `T` in class `ClassM` uses a non-literal constraint; the constraint must be a literal tuple expression, not a variable [generics_syntax_declarations] +generics_syntax_declarations.py:75:18: error: Type parameter `T` in class `ClassN` has an invalid constraint element; constraint tuple elements must be types, not literal values [generics_syntax_declarations] +generics_syntax_declarations.py:79:18: error: Type parameter `T` in class `ClassO` references a type variable from an outer scope in its bound; this is not allowed [generics_syntax_declarations] +""" diff --git a/conformance/results/basilisk/generics_syntax_infer_variance.toml b/conformance/results/basilisk/generics_syntax_infer_variance.toml new file mode 100644 index 000000000..03e049d4a --- /dev/null +++ b/conformance/results/basilisk/generics_syntax_infer_variance.toml @@ -0,0 +1,24 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +generics_syntax_infer_variance.py:15:6: error: `TypeVar` `S1` cannot use `infer_variance=True` with explicit variance flags [generics_typevartuple_basic] +generics_syntax_infer_variance.py:17:6: error: `TypeVar` `S2` cannot use `infer_variance=True` with explicit variance flags [generics_typevartuple_basic] +generics_syntax_infer_variance.py:29:1: error: Type `ShouldBeCovariant1[float]` is not assignable to `ShouldBeCovariant1[int]` (type parameter is covariant) [generics_variance_inference] +generics_syntax_infer_variance.py:47:1: error: Type `ShouldBeCovariant2[float]` is not assignable to `ShouldBeCovariant2[int]` (type parameter is covariant) [generics_variance_inference] +generics_syntax_infer_variance.py:56:1: error: Type `ShouldBeCovariant3[float]` is not assignable to `ShouldBeCovariant3[int]` (type parameter is covariant) [generics_variance_inference] +generics_syntax_infer_variance.py:85:1: error: Type `ShouldBeCovariant5[float]` is not assignable to `ShouldBeCovariant5[int]` (type parameter is covariant) [generics_variance_inference] +generics_syntax_infer_variance.py:96:1: error: Type `ShouldBeCovariant6[float]` is not assignable to `ShouldBeCovariant6[int]` (type parameter is covariant) [generics_variance_inference] +generics_syntax_infer_variance.py:112:1: error: Type `ShouldBeInvariant1[int]` is not assignable to `ShouldBeInvariant1[float]` (type parameter is invariant) [generics_variance_inference] +generics_syntax_infer_variance.py:113:1: error: Type `ShouldBeInvariant1[float]` is not assignable to `ShouldBeInvariant1[int]` (type parameter is invariant) [generics_variance_inference] +generics_syntax_infer_variance.py:127:1: error: Type `ShouldBeInvariant2[int]` is not assignable to `ShouldBeInvariant2[float]` (type parameter is invariant) [generics_variance_inference] +generics_syntax_infer_variance.py:128:1: error: Type `ShouldBeInvariant2[float]` is not assignable to `ShouldBeInvariant2[int]` (type parameter is invariant) [generics_variance_inference] +generics_syntax_infer_variance.py:135:1: error: Type `ShouldBeInvariant3[int]` is not assignable to `ShouldBeInvariant3[float]` (type parameter is invariant) [generics_variance_inference] +generics_syntax_infer_variance.py:136:1: error: Type `ShouldBeInvariant3[float]` is not assignable to `ShouldBeInvariant3[int]` (type parameter is invariant) [generics_variance_inference] +generics_syntax_infer_variance.py:137:1: error: Type `ShouldBeInvariant3[int]` is not assignable to `ShouldBeInvariant3[float]` (type parameter is invariant) [generics_variance_inference] +generics_syntax_infer_variance.py:138:1: error: Type `ShouldBeInvariant3[float]` is not assignable to `ShouldBeInvariant3[int]` (type parameter is invariant) [generics_variance_inference] +generics_syntax_infer_variance.py:146:1: error: Type `ShouldBeInvariant4[int]` is not assignable to `ShouldBeInvariant4[float]` (type parameter is invariant) [generics_variance_inference] +generics_syntax_infer_variance.py:154:1: error: Type `ShouldBeInvariant5[int]` is not assignable to `ShouldBeInvariant5[float]` (type parameter is invariant) [generics_variance_inference] +generics_syntax_infer_variance.py:165:1: error: Type `ShouldBeContravariant1[int]` is not assignable to `ShouldBeContravariant1[float]` (type parameter is contravariant) [generics_variance_inference] +""" diff --git a/conformance/results/basilisk/generics_syntax_scoping.toml b/conformance/results/basilisk/generics_syntax_scoping.toml new file mode 100644 index 000000000..d04922a2e --- /dev/null +++ b/conformance/results/basilisk/generics_syntax_scoping.toml @@ -0,0 +1,13 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +generics_syntax_scoping.py:14:7: error: PEP 695 type parameter `T` bound references `S` from the same type parameter list [generics_syntax_scoping] +generics_syntax_scoping.py:18:7: error: PEP 695 type parameter `S` bound references `T` from the same type parameter list [generics_syntax_scoping] +generics_syntax_scoping.py:35:7: error: PEP 695 type parameter `T` is not defined at module scope; it is only accessible inside the generic class or function where it is declared [generics_syntax_scoping] +generics_syntax_scoping.py:44:1: error: PEP 695 type parameter `T` is not defined at this point: it belongs to the decorated definition, not the decorator call [generics_syntax_scoping] +generics_syntax_scoping.py:92:9: error: Method type parameter `T` shadows the enclosing class's type parameter of the same name [generics_syntax_scoping] +generics_syntax_scoping.py:95:9: error: Method type parameter `T` shadows the enclosing class's type parameter of the same name [generics_syntax_scoping] +generics_syntax_scoping.py:98:9: error: Method type parameter `T` shadows the enclosing class's type parameter of the same name [generics_syntax_scoping] +""" diff --git a/conformance/results/basilisk/generics_type_erasure.toml b/conformance/results/basilisk/generics_type_erasure.toml new file mode 100644 index 000000000..c5103a372 --- /dev/null +++ b/conformance/results/basilisk/generics_type_erasure.toml @@ -0,0 +1,13 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +generics_type_erasure.py:38:16: error: Argument type `str` is incompatible with parameter `label` of type `int | None` in `Node.__init__` [constructors_call_init] +generics_type_erasure.py:40:16: error: Argument type `int` is incompatible with parameter `label` of type `str | None` in `Node.__init__` [constructors_call_init] +generics_type_erasure.py:42:1: error: Cannot access instance attribute `label` on class object `Node` [generics_type_erasure] +generics_type_erasure.py:43:1: error: Cannot access instance attribute `label` on class object `Node` [generics_type_erasure] +generics_type_erasure.py:44:1: error: Cannot access instance attribute `label` on class object `Node` [generics_type_erasure] +generics_type_erasure.py:45:1: error: Cannot access instance attribute `label` on class object `Node` [generics_type_erasure] +generics_type_erasure.py:46:1: error: Cannot access instance attribute `label` on class object `type(n1)` [generics_type_erasure] +""" diff --git a/conformance/results/basilisk/generics_typevartuple_args.toml b/conformance/results/basilisk/generics_typevartuple_args.toml new file mode 100644 index 000000000..57cee861d --- /dev/null +++ b/conformance/results/basilisk/generics_typevartuple_args.toml @@ -0,0 +1,14 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +generics_typevartuple_args.py:33:5: error: Invalid arguments for `*args` of `exec_le`: `str` is not assignable to `Env` [generics_typevartuple_args] +generics_typevartuple_args.py:34:5: error: Invalid arguments for `*args` of `exec_le`: `str` is not assignable to `Env` [generics_typevartuple_args] +generics_typevartuple_args.py:48:1: error: Invalid arguments for `*args` of `func1`: `str` is not assignable to `int` [generics_typevartuple_args] +generics_typevartuple_args.py:57:1: error: Invalid arguments for `*args` of `func2`: `int` is not assignable to `str` [generics_typevartuple_args] +generics_typevartuple_args.py:58:1: error: Invalid arguments for `*args` of `func2`: expected at least 2 arguments, got 1 [generics_typevartuple_args] +generics_typevartuple_args.py:59:1: error: Invalid arguments for `*args` of `func2`: expected at least 2 arguments, got 1 [generics_typevartuple_args] +generics_typevartuple_args.py:67:1: error: Invalid arguments for `*args` of `func3`: expected exactly 2 arguments, got 1 [generics_typevartuple_args] +generics_typevartuple_args.py:75:1: error: Invalid arguments for `*args` of `func4`: every argument must be a tuple of the same length, but found lengths [1, 2] [generics_typevartuple_args] +""" diff --git a/conformance/results/basilisk/generics_typevartuple_basic.toml b/conformance/results/basilisk/generics_typevartuple_basic.toml new file mode 100644 index 000000000..7768276b5 --- /dev/null +++ b/conformance/results/basilisk/generics_typevartuple_basic.toml @@ -0,0 +1,23 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +generics_typevartuple_basic.py:42:28: error: TypeVarTuple shape mismatch: `Array` is declared with 2 type arguments, but the constructor argument is not a tuple expression [generics_typevartuple_args] +generics_typevartuple_basic.py:43:35: error: TypeVarTuple shape mismatch: `Array` is declared with 3 type arguments, but the constructor argument is a tuple of length 2 [generics_typevartuple_args] +generics_typevartuple_basic.py:44:41: error: TypeVarTuple element order mismatch: `Array` is declared `[Time, Batch, Height, Width]` but the constructor provides `[Time, Batch, Width, Height]` [generics_typevartuple_args] +generics_typevartuple_basic.py:52:22: error: `TypeVarTuple` `Shape` must be unpacked with `*` in generic parameter list [generics_typevartuple_basic_2] +generics_typevartuple_basic.py:53:24: error: `TypeVarTuple` `Shape` must be unpacked with `*` inside `tuple[...]` [generics_typevartuple_basic_2] +generics_typevartuple_basic.py:56:28: error: `TypeVarTuple` `Shape` must be unpacked with `*` inside `tuple[...]` [generics_typevartuple_basic_2] +generics_typevartuple_basic.py:59:18: error: `TypeVarTuple` `Shape` must be unpacked with `*` in annotation for `args` [generics_typevartuple_basic_2] +generics_typevartuple_basic.py:65:7: error: `TypeVarTuple` `Ts1` does not support `covariant` or `contravariant` arguments [generics_typevartuple_basic] +generics_typevartuple_basic.py:65:7: error: Invalid `TypeVarTuple` parameters: `TypeVarTuple` does not support variance specification [generics_typevartuple_basic_3] +generics_typevartuple_basic.py:66:7: error: `TypeVarTuple` `Ts2` does not accept type constraint arguments [generics_typevartuple_basic] +generics_typevartuple_basic.py:66:7: error: Invalid `TypeVarTuple` parameters: `TypeVarTuple` does not support type constraints [generics_typevartuple_basic_3] +generics_typevartuple_basic.py:67:7: error: `TypeVarTuple` `Ts3` does not support a `bound=` argument [generics_typevartuple_basic] +generics_typevartuple_basic.py:67:7: error: Invalid `TypeVarTuple` parameters: `TypeVarTuple` does not support bounds [generics_typevartuple_basic_3] +generics_typevartuple_basic.py:91:1: error: TypeVarTuple binding mismatch: arguments to `func2` must bind the shared TypeVarTuple to the same types [generics_typevartuple_args] +generics_typevartuple_basic.py:100:5: error: TypeVarTuple binding mismatch: arguments to `multiply` must bind the shared TypeVarTuple to the same types [generics_typevartuple_args] +generics_typevartuple_basic.py:101:5: error: TypeVarTuple binding mismatch: arguments to `multiply` must bind the shared TypeVarTuple to the same types [generics_typevartuple_args] +generics_typevartuple_basic.py:107:7: error: Class `Array3` has 2 `TypeVarTuple`s in its generic parameters; only one is allowed [generics_typevartuple_specialization] +""" diff --git a/conformance/results/basilisk/generics_typevartuple_callable.toml b/conformance/results/basilisk/generics_typevartuple_callable.toml new file mode 100644 index 000000000..aa120f34e --- /dev/null +++ b/conformance/results/basilisk/generics_typevartuple_callable.toml @@ -0,0 +1,7 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +generics_typevartuple_callable.py:26:1: error: Tuple element at index 0 has type `str` but `target` expects `int` (inferred via `TypeVarTuple`) [generics_typevartuple_callable] +""" diff --git a/conformance/results/basilisk/generics_typevartuple_concat.toml b/conformance/results/basilisk/generics_typevartuple_concat.toml new file mode 100644 index 000000000..be211bd5b --- /dev/null +++ b/conformance/results/basilisk/generics_typevartuple_concat.toml @@ -0,0 +1,6 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +""" diff --git a/conformance/results/basilisk/generics_typevartuple_overloads.toml b/conformance/results/basilisk/generics_typevartuple_overloads.toml new file mode 100644 index 000000000..be211bd5b --- /dev/null +++ b/conformance/results/basilisk/generics_typevartuple_overloads.toml @@ -0,0 +1,6 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +""" diff --git a/conformance/results/basilisk/generics_typevartuple_specialization.toml b/conformance/results/basilisk/generics_typevartuple_specialization.toml new file mode 100644 index 000000000..6dffa2573 --- /dev/null +++ b/conformance/results/basilisk/generics_typevartuple_specialization.toml @@ -0,0 +1,13 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +generics_typevartuple_specialization.py:109:1: error: Cannot use unpacked `TypeVarTuple` `*Ts` as a type argument to `IntTupleGeneric`, which has no `TypeVarTuple` parameter [generics_typevartuple_specialization_2] +generics_typevartuple_specialization.py:109:1: error: TypeVar `Ts` is not bound in this scope [generics_variance_inference] +generics_typevartuple_specialization.py:110:1: error: Cannot use unpacked tuple `*tuple[...]` as a type argument to `IntTupleGeneric`, which has no `TypeVarTuple` parameter [generics_typevartuple_specialization_2] +generics_typevartuple_specialization.py:121:1: error: Tuple type alias `TA5` has 2 unpack operators; at most one `*` unpack is allowed in a `tuple[...]` type [generics_typevartuple_specialization] +generics_typevartuple_specialization.py:122:1: error: Tuple type alias `TA6` has 2 unpack operators; at most one `*` unpack is allowed in a `tuple[...]` type [generics_typevartuple_specialization] +generics_typevartuple_specialization.py:127:5: error: `TA7` requires at least 2 plain type arguments (one per regular `TypeVar`), but 1 was provided (out of 1 total) [generics_typevartuple_specialization_2] +generics_typevartuple_specialization.py:163:8: error: `TA11` requires at least 1 plain type argument (one per regular `TypeVar`), but 0 were provided (out of 1 total) [generics_typevartuple_specialization_2] +""" diff --git a/conformance/results/basilisk/generics_typevartuple_unpack.toml b/conformance/results/basilisk/generics_typevartuple_unpack.toml new file mode 100644 index 000000000..aede487ca --- /dev/null +++ b/conformance/results/basilisk/generics_typevartuple_unpack.toml @@ -0,0 +1,7 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +generics_typevartuple_unpack.py:30:5: error: `Array[Batch]` has 1 type argument, but `process_batch_channels` requires at least 2 for the `TypeVarTuple` unpack pattern [generics_typevartuple_unpack] +""" diff --git a/conformance/results/basilisk/generics_upper_bound.toml b/conformance/results/basilisk/generics_upper_bound.toml new file mode 100644 index 000000000..402c012c9 --- /dev/null +++ b/conformance/results/basilisk/generics_upper_bound.toml @@ -0,0 +1,11 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +generics_upper_bound.py:24:14: error: `T_Bad1` has a `bound=` that is parameterized by a type variable [generics_basic] +generics_upper_bound.py:44:5: error: Type mismatch in `assert_type()`: expression has type `list[int] | set[int]` but expected `Collection[int]` [directives_assert_type_2] +generics_upper_bound.py:52:1: error: Argument of type `int` does not satisfy `TypeVar` bound `Sized` for `longer` [generics_upper_bound] +generics_upper_bound.py:57:10: error: `T_Bad2` specifies both constraints and `bound=`; these are mutually exclusive [generics_basic] +generics_upper_bound.py:57:10: error: `TypeVar` `T_Bad2` cannot have both type constraints and an upper bound [generics_typevartuple_basic] +""" diff --git a/conformance/results/basilisk/generics_variance.toml b/conformance/results/basilisk/generics_variance.toml new file mode 100644 index 000000000..d49a4175a --- /dev/null +++ b/conformance/results/basilisk/generics_variance.toml @@ -0,0 +1,19 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +generics_variance.py:14:6: error: `TypeVar` `X1` cannot be both covariant and contravariant [generics_typevartuple_basic] +generics_variance.py:77:14: error: Variance incompatibility in base class `Inv`: `T_co` is covariant but the corresponding type parameter is invariant [generics_variance] +generics_variance.py:81:14: error: Variance incompatibility in base class `Inv`: `T_contra` is contravariant but the corresponding type parameter is invariant [generics_variance] +generics_variance.py:93:17: error: Variance incompatibility in base class `Co`: `T_contra` is contravariant but the corresponding type parameter is covariant [generics_variance] +generics_variance.py:105:21: error: Variance incompatibility in base class `Contra`: `T_co` is covariant but the corresponding type parameter is contravariant [generics_variance] +generics_variance.py:113:21: error: Variance incompatibility in base class `Contra`: `T_co` is covariant but the corresponding type parameter is contravariant [generics_variance] +generics_variance.py:126:5: error: Variance incompatibility in base class `CoContra`: `T_co` is covariant but the corresponding type parameter is contravariant [generics_variance] +generics_variance.py:132:5: error: Variance incompatibility in base class `CoContra`: `T_contra` is contravariant but the corresponding type parameter is covariant [generics_variance] +generics_variance.py:142:5: error: Variance incompatibility in base class `CoContra`: `T_co` is covariant but the corresponding type parameter is contravariant [generics_variance] +generics_variance.py:163:26: error: Variance incompatibility in base class `Contra`: `T_contra` is covariant but the corresponding type parameter is contravariant [generics_variance] +generics_variance.py:167:30: error: Variance incompatibility in base class `Contra`: `T_co` is covariant but the corresponding type parameter is contravariant [generics_variance] +generics_variance.py:191:33: error: Variance incompatibility in base class `Contra_TA`: `T_contra` is covariant but the corresponding type parameter is contravariant [generics_variance] +generics_variance.py:196:5: error: Variance incompatibility in base class `Contra_TA`: `T_co` is covariant but the corresponding type parameter is contravariant [generics_variance] +""" diff --git a/conformance/results/basilisk/generics_variance_inference.toml b/conformance/results/basilisk/generics_variance_inference.toml new file mode 100644 index 000000000..f9387d551 --- /dev/null +++ b/conformance/results/basilisk/generics_variance_inference.toml @@ -0,0 +1,29 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +generics_variance_inference.py:24:5: error: Type `ClassA[float]` is not assignable to `ClassA[int]` (type parameter is invariant) [generics_variance_inference] +generics_variance_inference.py:25:5: error: Type `ClassA[int]` is not assignable to `ClassA[float]` (type parameter is contravariant) [generics_variance_inference] +generics_variance_inference.py:28:5: error: Type `ClassA[float]` is not assignable to `ClassA[int]` (type parameter is covariant) [generics_variance_inference] +generics_variance_inference.py:41:1: error: Type `ShouldBeCovariant1[float]` is not assignable to `ShouldBeCovariant1[int]` (type parameter is covariant) [generics_variance_inference] +generics_variance_inference.py:49:1: error: Type `ShouldBeCovariant2[float]` is not assignable to `ShouldBeCovariant2[int]` (type parameter is covariant) [generics_variance_inference] +generics_variance_inference.py:58:1: error: Type `ShouldBeCovariant3[float]` is not assignable to `ShouldBeCovariant3[int]` (type parameter is covariant) [generics_variance_inference] +generics_variance_inference.py:67:1: error: Type `ShouldBeCovariant4[float]` is not assignable to `ShouldBeCovariant4[int]` (type parameter is covariant) [generics_variance_inference] +generics_variance_inference.py:80:1: error: Type `ShouldBeCovariant5[float]` is not assignable to `ShouldBeCovariant5[int]` (type parameter is covariant) [generics_variance_inference] +generics_variance_inference.py:96:1: error: Type `ShouldBeInvariant1[int]` is not assignable to `ShouldBeInvariant1[float]` (type parameter is invariant) [generics_variance_inference] +generics_variance_inference.py:97:1: error: Type `ShouldBeInvariant1[float]` is not assignable to `ShouldBeInvariant1[int]` (type parameter is invariant) [generics_variance_inference] +generics_variance_inference.py:111:1: error: Type `ShouldBeInvariant2[int]` is not assignable to `ShouldBeInvariant2[float]` (type parameter is invariant) [generics_variance_inference] +generics_variance_inference.py:112:1: error: Type `ShouldBeInvariant2[float]` is not assignable to `ShouldBeInvariant2[int]` (type parameter is invariant) [generics_variance_inference] +generics_variance_inference.py:119:1: error: Type `ShouldBeInvariant3[int]` is not assignable to `ShouldBeInvariant3[float]` (type parameter is invariant) [generics_variance_inference] +generics_variance_inference.py:120:1: error: Type `ShouldBeInvariant3[float]` is not assignable to `ShouldBeInvariant3[int]` (type parameter is invariant) [generics_variance_inference] +generics_variance_inference.py:121:1: error: Type `ShouldBeInvariant3[int]` is not assignable to `ShouldBeInvariant3[float]` (type parameter is invariant) [generics_variance_inference] +generics_variance_inference.py:122:1: error: Type `ShouldBeInvariant3[float]` is not assignable to `ShouldBeInvariant3[int]` (type parameter is invariant) [generics_variance_inference] +generics_variance_inference.py:130:1: error: Type `ShouldBeInvariant4[int]` is not assignable to `ShouldBeInvariant4[float]` (type parameter is invariant) [generics_variance_inference] +generics_variance_inference.py:138:1: error: Type `ShouldBeInvariant5[int]` is not assignable to `ShouldBeInvariant5[float]` (type parameter is invariant) [generics_variance_inference] +generics_variance_inference.py:149:1: error: Type `ShouldBeContravariant1[int]` is not assignable to `ShouldBeContravariant1[float]` (type parameter is contravariant) [generics_variance_inference] +generics_variance_inference.py:169:1: error: Type `ShouldBeInvariant6[float]` is not assignable to `ShouldBeInvariant6[int]` (type parameter is invariant) [generics_variance_inference] +generics_variance_inference.py:170:1: error: Type `ShouldBeInvariant6[int]` is not assignable to `ShouldBeInvariant6[float]` (type parameter is invariant) [generics_variance_inference] +generics_variance_inference.py:181:1: error: Type `ShouldBeCovariant6[float]` is not assignable to `ShouldBeCovariant6[int]` (type parameter is covariant) [generics_variance_inference] +generics_variance_inference.py:194:1: error: Type `ShouldBeContravariant2[int]` is not assignable to `ShouldBeContravariant2[float]` (type parameter is contravariant) [generics_variance_inference] +""" diff --git a/conformance/results/basilisk/historical_positional.toml b/conformance/results/basilisk/historical_positional.toml new file mode 100644 index 000000000..abb39b237 --- /dev/null +++ b/conformance/results/basilisk/historical_positional.toml @@ -0,0 +1,10 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +historical_positional.py:18:4: error: `__x` is a positional-only parameter and cannot be passed as a keyword argument [historical_positional] +historical_positional.py:26:16: error: Positional-only parameter `__y` appears after a positional-or-keyword parameter [historical_positional] +historical_positional.py:54:26: error: Positional-only parameter `__y` appears after a positional-or-keyword parameter [historical_positional] +historical_positional.py:59:6: error: `__x` is a positional-only parameter and cannot be passed as a keyword argument [historical_positional] +""" diff --git a/conformance/results/basilisk/literals_interactions.toml b/conformance/results/basilisk/literals_interactions.toml new file mode 100644 index 000000000..5c6a42c74 --- /dev/null +++ b/conformance/results/basilisk/literals_interactions.toml @@ -0,0 +1,10 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +literals_interactions.py:14:5: error: Tuple index 5 is out of range for `tuple` of length 3 [tuples_index_2] +literals_interactions.py:15:5: error: Tuple index -5 is out of range for `tuple` of length 3 [tuples_index_2] +literals_interactions.py:16:5: error: Tuple index 4 is out of range for `tuple` of length 3 [tuples_index_2] +literals_interactions.py:17:5: error: Tuple index -4 is out of range for `tuple` of length 3 [tuples_index_2] +""" diff --git a/conformance/results/basilisk/literals_literalstring.toml b/conformance/results/basilisk/literals_literalstring.toml new file mode 100644 index 000000000..07926280a --- /dev/null +++ b/conformance/results/basilisk/literals_literalstring.toml @@ -0,0 +1,17 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +literals_literalstring.py:36:1: error: Invalid parameterization of `Literal` in annotation for `bad_union` [literals_parameterizations] +literals_literalstring.py:37:1: error: Invalid parameterization of `Literal` in annotation for `bad_nesting` [literals_parameterizations] +literals_literalstring.py:43:1: error: Type mismatch: `x2` is annotated `Literal[""]` but assigned parameter `b` with type `Literal["two"]` [literals_semantics_2] +literals_literalstring.py:43:5: error: Type mismatch: `x2` is annotated `Literal[""]` (Literal[""]) but assigned Literal["two"] [assignment_compatibility] +literals_literalstring.py:43:5: error: Cannot assign `Literal["two"]` to `Literal[""]` — literal values are incompatible [literals_literalstring] +literals_literalstring.py:65:5: error: Cannot assign f-string to `LiteralString` — interpolated variable `non_literal` has type `str`, which is not `LiteralString` [literals_literalstring] +literals_literalstring.py:73:5: error: Type mismatch: `x3` is annotated `LiteralString` (LiteralString) but assigned int [assignment_compatibility] +literals_literalstring.py:74:5: error: Type mismatch: `x4` is annotated `LiteralString` (LiteralString) but assigned bytes [assignment_compatibility] +literals_literalstring.py:119:22: error: Argument `s` has type `str` which is not compatible with TypeVar bound `LiteralString` [generics_upper_bound_2] +literals_literalstring.py:133:5: error: Cannot assign `Container(s)` to `Container[LiteralString]` — argument `s` has type `str`, not `LiteralString` [literals_literalstring] +literals_literalstring.py:171:5: error: Cannot assign `list[LiteralString]` to `list[str]` — `list` is invariant in its type parameter [literals_literalstring] +""" diff --git a/conformance/results/basilisk/literals_parameterizations.toml b/conformance/results/basilisk/literals_parameterizations.toml new file mode 100644 index 000000000..58a33d457 --- /dev/null +++ b/conformance/results/basilisk/literals_parameterizations.toml @@ -0,0 +1,27 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +literals_parameterizations.py:41:1: error: Invalid parameterization of `Literal` in annotation for `bad1` [literals_parameterizations] +literals_parameterizations.py:42:1: error: Invalid parameterization of `Literal` in annotation for `bad2` [literals_parameterizations] +literals_parameterizations.py:43:1: error: Invalid parameterization of `Literal` in annotation for `bad3` [literals_parameterizations] +literals_parameterizations.py:44:1: error: Invalid parameterization of `Literal` in annotation for `bad4` [literals_parameterizations] +literals_parameterizations.py:45:1: error: Invalid parameterization of `Literal` in annotation for `bad5` [literals_parameterizations] +literals_parameterizations.py:46:1: error: Invalid parameterization of `Literal` in annotation for `bad6` [literals_parameterizations] +literals_parameterizations.py:47:1: error: Invalid parameterization of `Literal` in annotation for `bad7` [literals_parameterizations] +literals_parameterizations.py:48:1: error: Invalid parameterization of `Literal` in annotation for `bad8` [literals_parameterizations] +literals_parameterizations.py:49:1: error: Invalid parameterization of `Literal` in annotation for `bad9` [literals_parameterizations] +literals_parameterizations.py:50:1: error: TypeVar `T` is not bound in this scope [generics_variance_inference] +literals_parameterizations.py:50:1: error: Invalid parameterization of `Literal` in annotation for `bad10` [literals_parameterizations] +literals_parameterizations.py:50:8: error: Type variable `T` is not bound in the current scope [generics_scoping] +literals_parameterizations.py:51:1: error: Invalid parameterization of `Literal` in annotation for `bad11` [literals_parameterizations] +literals_parameterizations.py:52:1: error: Invalid parameterization of `Literal` in annotation for `bad12` [literals_parameterizations] +literals_parameterizations.py:53:1: error: Invalid parameterization of `Literal` in annotation for `bad13` [literals_parameterizations] +literals_parameterizations.py:56:17: error: Invalid parameterization of `Literal` for parameter `x` [literals_parameterizations] +literals_parameterizations.py:60:1: error: `Literal` must be parameterized (variable `x` has no arguments) [literals_parameterizations] +literals_parameterizations.py:61:1: error: Invalid parameterization of `Literal` in annotation for `y` [literals_parameterizations] +literals_parameterizations.py:65:1: error: Type mismatch: `x1` is annotated `Literal["Color.RED"]` but assigned parameter `a` with type `Literal[Color.RED]` [literals_semantics_2] +literals_parameterizations.py:65:5: error: Type mismatch: `x1` is annotated `Literal["Color.RED"]` (Literal["color.red"]) but assigned color.red [assignment_compatibility] +literals_parameterizations.py:65:5: error: Variable `x1` is annotated as `Literal["Color.RED"]` (a string literal), but `Color.RED` is an enum member reference, not a string [literals_parameterizations_2] +""" diff --git a/conformance/results/basilisk/literals_semantics.toml b/conformance/results/basilisk/literals_semantics.toml new file mode 100644 index 000000000..2fdf23275 --- /dev/null +++ b/conformance/results/basilisk/literals_semantics.toml @@ -0,0 +1,12 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +literals_semantics.py:10:1: error: Type mismatch: `v2` is annotated `Literal[3]` (Literal[3]) but assigned Literal[4] [assignment_compatibility] +literals_semantics.py:24:1: error: Type mismatch: `x1` is annotated `Literal[False]` but assigned parameter `a` with type `Literal[0]` [literals_semantics_2] +literals_semantics.py:24:5: error: Type mismatch: `x1` is annotated `Literal[False]` (Literal[false]) but assigned Literal[0] [assignment_compatibility] +literals_semantics.py:25:1: error: Type mismatch: `x2` is annotated `Literal[0]` but assigned parameter `b` with type `Literal[False]` [literals_semantics_2] +literals_semantics.py:25:5: error: Type mismatch: `x2` is annotated `Literal[0]` (Literal[0]) but assigned Literal[false] [assignment_compatibility] +literals_semantics.py:33:1: error: Augmented assignment `a += ...` is incompatible with declared type `L[3, 4, 5]` [literals_semantics_2] +""" diff --git a/conformance/results/basilisk/namedtuples_define_class.toml b/conformance/results/basilisk/namedtuples_define_class.toml new file mode 100644 index 000000000..da7b78846 --- /dev/null +++ b/conformance/results/basilisk/namedtuples_define_class.toml @@ -0,0 +1,21 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +namedtuples_define_class.py:33:7: error: NamedTuple index 3 out of range for `p1` with 3 field(s) (valid range: -3..2) [namedtuples_usage] +namedtuples_define_class.py:34:7: error: NamedTuple index -4 out of range for `p1` with 3 field(s) (valid range: -3..2) [namedtuples_usage] +namedtuples_define_class.py:45:6: error: `Point` requires at least 2 arguments, but 1 was given [constructors_call_init] +namedtuples_define_class.py:46:6: error: `Point` requires at least 2 arguments, but 1 was given [constructors_call_init] +namedtuples_define_class.py:47:15: error: Argument 1 to `Point()` has type `str`, expected `int` for field `y` [constructors_call_init] +namedtuples_define_class.py:48:18: error: Keyword argument `units` to `Point()` has type `int`, expected `str` [constructors_call_init] +namedtuples_define_class.py:49:6: error: `Point` accepts at most 3 positional arguments, but 4 were given [constructors_call_init] +namedtuples_define_class.py:50:7: error: `Point` has no field `other` [constructors_call_init] +namedtuples_define_class.py:70:7: error: `Point2` accepts at most 2 positional arguments, but 3 were given [constructors_call_init] +namedtuples_define_class.py:77:5: error: `NamedTuple` field name `_y` must not start with an underscore [namedtuples_define_class] +namedtuples_define_class.py:87:5: error: `NamedTuple` field `latitude` without a default value follows a field with a default value [namedtuples_define_class] +namedtuples_define_class.py:107:5: error: `NamedTuple` subclass `BadPointWithName` redefines field `x` from base class [namedtuples_define_class] +namedtuples_define_class.py:121:1: error: `ConditionalField` accepts at most 2 positional arguments, but 3 were given [constructors_call_init] +namedtuples_define_class.py:140:19: error: Argument 1 to `Property[...]()` has type `float`, expected `str` for field `value` [constructors_call_init] +namedtuples_define_class.py:147:7: error: `NamedTuple` class `Unit` cannot inherit from multiple bases: `object` [namedtuples_define_class] +""" diff --git a/conformance/results/basilisk/namedtuples_define_functional.toml b/conformance/results/basilisk/namedtuples_define_functional.toml new file mode 100644 index 000000000..7eb3470e4 --- /dev/null +++ b/conformance/results/basilisk/namedtuples_define_functional.toml @@ -0,0 +1,16 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +namedtuples_define_functional.py:16:8: error: Call to `Point1()` is missing 1 required argument (expected at least 2, got 1) [calls_argument_count] +namedtuples_define_functional.py:21:8: error: Call to `Point2()` is missing 2 required arguments (expected at least 2, got 0) [calls_argument_count] +namedtuples_define_functional.py:26:8: error: Call to `Point3()` has 1 too many positional argument (expected at most 2, got 3) [calls_argument_count] +namedtuples_define_functional.py:31:8: error: Call to `Point4()` is missing 1 required argument (expected at least 2, got 1) [calls_argument_count] +namedtuples_define_functional.py:31:8: error: Argument `z` is not a field of `Point4`; valid fields are: x, y [namedtuples_define_functional] +namedtuples_define_functional.py:36:8: error: Argument 2 to `Point5()` has type `str` but field `y` expects `int` [namedtuples_define_functional] +namedtuples_define_functional.py:37:8: error: Call to `Point5()` has 1 too many positional argument (expected at most 2, got 3) [calls_argument_count] +namedtuples_define_functional.py:42:8: error: Argument 2 to `Point6()` has type `str` but field `y` expects `int` [namedtuples_define_functional] +namedtuples_define_functional.py:43:8: error: Field `x` of `Point6` expects `int` but received a `float` literal [namedtuples_define_functional] +namedtuples_define_functional.py:69:1: error: Call to `NT7()` is missing 1 required argument (expected at least 1, got 0) [calls_argument_count] +""" diff --git a/conformance/results/basilisk/namedtuples_type_compat.toml b/conformance/results/basilisk/namedtuples_type_compat.toml new file mode 100644 index 000000000..569eedd02 --- /dev/null +++ b/conformance/results/basilisk/namedtuples_type_compat.toml @@ -0,0 +1,8 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +namedtuples_type_compat.py:22:1: error: Incompatible tuple assignment: `p` is a `Point` with 3 field(s), but `tuple[int, int]` expects 2 element(s) [namedtuples_type_compat] +namedtuples_type_compat.py:23:1: error: Incompatible tuple element type at index 1: `Point` field type is `int`, but `tuple[int, str, str]` expects `str` [namedtuples_type_compat] +""" diff --git a/conformance/results/basilisk/namedtuples_usage.toml b/conformance/results/basilisk/namedtuples_usage.toml new file mode 100644 index 000000000..8372fcb08 --- /dev/null +++ b/conformance/results/basilisk/namedtuples_usage.toml @@ -0,0 +1,14 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +namedtuples_usage.py:34:7: error: NamedTuple index 3 out of range for `p` with 3 field(s) (valid range: -3..2) [namedtuples_usage] +namedtuples_usage.py:35:7: error: NamedTuple index -4 out of range for `p` with 3 field(s) (valid range: -3..2) [namedtuples_usage] +namedtuples_usage.py:40:1: error: Cannot assign to attribute `x` on NamedTuple instance `p`: NamedTuple fields are read-only [namedtuples_usage] +namedtuples_usage.py:41:1: error: Cannot assign to element of NamedTuple instance `p`: NamedTuple elements are read-only [namedtuples_usage] +namedtuples_usage.py:42:5: error: Cannot delete attribute `x` on NamedTuple instance `p`: NamedTuple fields are read-only [namedtuples_usage] +namedtuples_usage.py:43:5: error: Cannot delete element of NamedTuple instance `p`: NamedTuple elements are read-only [namedtuples_usage] +namedtuples_usage.py:52:1: error: NamedTuple unpack mismatch: too few values to unpack: `p` has 3 field(s) but only 2 variable(s) provided [namedtuples_usage] +namedtuples_usage.py:53:1: error: NamedTuple unpack mismatch: too many values to unpack: `p` has 3 field(s) but 4 variable(s) provided [namedtuples_usage] +""" diff --git a/conformance/results/basilisk/narrowing_typeguard.toml b/conformance/results/basilisk/narrowing_typeguard.toml new file mode 100644 index 000000000..653e9e59f --- /dev/null +++ b/conformance/results/basilisk/narrowing_typeguard.toml @@ -0,0 +1,10 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +narrowing_typeguard.py:102:23: error: Method `tg_1` returns `TypeGuard` but has no parameter to narrow [narrowing_typeguard] +narrowing_typeguard.py:107:22: error: Method `tg_2` returns `TypeGuard` but has no parameter to narrow [narrowing_typeguard] +narrowing_typeguard.py:128:20: error: Function `simple_typeguard` returns `TypeGuard[int]` (subtype of `bool`), but `takes_callable_str` expects return type `str` [narrowing_typeis] +narrowing_typeguard.py:148:26: error: Function `simple_typeguard` returns `TypeGuard[int]` (subtype of `bool`), but `takes_callable_str_proto` expects return type `str` [narrowing_typeis] +""" diff --git a/conformance/results/basilisk/narrowing_typeis.toml b/conformance/results/basilisk/narrowing_typeis.toml new file mode 100644 index 000000000..c7fd4fd03 --- /dev/null +++ b/conformance/results/basilisk/narrowing_typeis.toml @@ -0,0 +1,15 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +narrowing_typeis.py:110:23: error: Method `tg_1` returns `TypeIs` but has no parameter to narrow [narrowing_typeguard] +narrowing_typeis.py:115:22: error: Method `tg_2` returns `TypeIs` but has no parameter to narrow [narrowing_typeguard] +narrowing_typeis.py:137:20: error: Function `simple_typeguard` returns `TypeIs[int]` (subtype of `bool`), but `takes_callable_str` expects return type `str` [narrowing_typeis] +narrowing_typeis.py:157:26: error: Function `simple_typeguard` returns `TypeIs[int]` (subtype of `bool`), but `takes_callable_str_proto` expects return type `str` [narrowing_typeis] +narrowing_typeis.py:174:17: error: Function `is_int_typeis` returns `TypeIs[int]`, but `takes_typeguard` expects `TypeGuard[int]` [narrowing_typeis] +narrowing_typeis.py:175:14: error: Function `is_int_typeguard` returns `TypeGuard[int]`, but `takes_typeis` expects `TypeIs[int]` [narrowing_typeis] +narrowing_typeis.py:196:18: error: Function `bool_typeis` returns `TypeIs[bool]`, but `takes_int_typeis` expects `TypeIs[int]` [narrowing_typeis] +narrowing_typeis.py:200:27: error: `TypeIs[str]` narrows to a type inconsistent with parameter type `int` [narrowing_typeis_2] +narrowing_typeis.py:204:45: error: `TypeIs[list[int]]` narrows to a type inconsistent with parameter type `list[object]` [narrowing_typeis_2] +""" diff --git a/conformance/results/basilisk/overloads_basic.toml b/conformance/results/basilisk/overloads_basic.toml new file mode 100644 index 000000000..3648144bb --- /dev/null +++ b/conformance/results/basilisk/overloads_basic.toml @@ -0,0 +1,7 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +overloads_basic.py:39:1: error: No matching overload for `b[...]`: argument type `str` does not match any `@overload` signature of `Bytes.__getitem__` [overloads_basic] +""" diff --git a/conformance/results/basilisk/overloads_consistency.toml b/conformance/results/basilisk/overloads_consistency.toml new file mode 100644 index 000000000..1737c96f7 --- /dev/null +++ b/conformance/results/basilisk/overloads_consistency.toml @@ -0,0 +1,8 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +overloads_consistency.py:25:5: error: Overload of `return_type` returns `str`, which is not assignable to the implementation's return type `int` [overloads_consistency_3] +overloads_consistency.py:41:5: error: An overload of `parameter_type` has a parameter type the implementation cannot accept [overloads_consistency_3] +""" diff --git a/conformance/results/basilisk/overloads_definitions.toml b/conformance/results/basilisk/overloads_definitions.toml new file mode 100644 index 000000000..ebd2b9b03 --- /dev/null +++ b/conformance/results/basilisk/overloads_definitions.toml @@ -0,0 +1,18 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +overloads_definitions.py:16:5: error: Function `func1` has only 1 `@overload` signature — at least two are required [overloads_definitions] +overloads_definitions.py:28:5: error: Function `func2` has 2 `@overload` signatures but no implementation [overloads_definitions] +overloads_definitions.py:59:9: error: Function `not_abstract` has 2 `@overload` signatures but no implementation [overloads_definitions] +overloads_definitions.py:81:9: error: Inconsistent `@staticmethod` across overloads of `func5`: it must be on every overload and the implementation, or none [overloads_consistency_2] +overloads_definitions.py:94:9: error: Inconsistent `@classmethod` across overloads of `func6`: it must be on every overload and the implementation, or none [overloads_consistency_2] +overloads_definitions.py:123:6: error: `@final` on an `@overload` signature of `invalid_final`: it should be applied only to the implementation [overloads_consistency_2] +overloads_definitions.py:138:6: error: `@final` on an `@overload` signature of `invalid_final_2`: it should be applied only to the implementation [overloads_consistency_2] +overloads_definitions.py:143:6: error: `@final` on an `@overload` signature of `invalid_final_2`: it should be applied only to the implementation [overloads_consistency_2] +overloads_definitions.py:186:9: error: Method `final_method` in `Child` overrides a `@final` method [qualifiers_final_decorator] +overloads_definitions.py:203:9: error: Method `bad_override` in `Child` is decorated with `@override` but no matching method exists in any base class [classes_override_3] +overloads_definitions.py:227:6: error: `@override` on an `@overload` signature of `to_override`: it should be applied only to the implementation [overloads_consistency_2] +overloads_definitions.py:231:6: error: `@override` on an `@overload` signature of `to_override`: it should be applied only to the implementation [overloads_consistency_2] +""" diff --git a/conformance/results/basilisk/overloads_definitions_stub.toml b/conformance/results/basilisk/overloads_definitions_stub.toml new file mode 100644 index 000000000..391363127 --- /dev/null +++ b/conformance/results/basilisk/overloads_definitions_stub.toml @@ -0,0 +1,14 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +overloads_definitions_stub.pyi:14:5: error: Function `func1` has only 1 `@overload` signature — at least two are required [overloads_definitions] +overloads_definitions_stub.pyi:33:9: error: Inconsistent `@staticmethod` across overloads of `func5`: it must be on every overload and the implementation, or none [overloads_consistency_2] +overloads_definitions_stub.pyi:41:9: error: Inconsistent `@classmethod` across overloads of `func6`: it must be on every overload and the implementation, or none [overloads_consistency_2] +overloads_definitions_stub.pyi:72:6: error: `@final` on a later overload of `invalid_final`: in a stub it must appear only on the first overload [overloads_consistency_2] +overloads_definitions_stub.pyi:85:6: error: `@final` on a later overload of `invalid_final_2`: in a stub it must appear only on the first overload [overloads_consistency_2] +overloads_definitions_stub.pyi:111:9: error: Method `final_method` in `Child` overrides a `@final` method [qualifiers_final_decorator] +overloads_definitions_stub.pyi:122:9: error: Method `bad_override` in `Child` is decorated with `@override` but no matching method exists in any base class [classes_override_3] +overloads_definitions_stub.pyi:146:6: error: `@override` on a later overload of `to_override`: in a stub it must appear only on the first overload [overloads_consistency_2] +""" diff --git a/conformance/results/basilisk/overloads_evaluation.toml b/conformance/results/basilisk/overloads_evaluation.toml new file mode 100644 index 000000000..95343fbd5 --- /dev/null +++ b/conformance/results/basilisk/overloads_evaluation.toml @@ -0,0 +1,10 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +overloads_evaluation.py:38:1: error: Call to `example1_1` is missing 1 required argument (no overload matches — expected at least 1, got 0) [calls_argument_count] +overloads_evaluation.py:46:15: error: Argument `y` of `example1_1` expects `str` but received an `int` literal [calls_argument_type] +overloads_evaluation.py:51:12: error: Argument `x` of `example1_1` expects `str` but received an `int` literal [calls_argument_type] +overloads_evaluation.py:116:5: error: No overload of `example2` matches when argument is `str` [overloads_evaluation] +""" diff --git a/conformance/results/basilisk/protocols_class_objects.toml b/conformance/results/basilisk/protocols_class_objects.toml new file mode 100644 index 000000000..6c9ee8816 --- /dev/null +++ b/conformance/results/basilisk/protocols_class_objects.toml @@ -0,0 +1,15 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +protocols_class_objects.py:29:1: error: Protocol class `Proto` cannot be used where `type[Proto]` is expected; only concrete (non-protocol) subtypes are accepted [protocols_class_objects_2] +protocols_class_objects.py:29:1: error: Cannot instantiate Protocol class `Proto`; Protocols define interfaces, not concrete implementations [protocols_explicit] +protocols_class_objects.py:34:1: error: Protocol class `Proto` cannot be used where `type[Proto]` is expected; only concrete (non-protocol) subtypes are accepted [protocols_class_objects_2] +protocols_class_objects.py:58:1: error: Class `ConcreteA` cannot be used as an instance of protocol `ProtoA1`: class-level access to protocol members is incompatible [protocols_class_objects_2] +protocols_class_objects.py:74:1: error: Class `ConcreteB` cannot be used as an instance of protocol `ProtoB1`: class-level access to protocol members is incompatible [protocols_class_objects_2] +protocols_class_objects.py:104:1: error: Class `ConcreteC1` cannot be used as an instance of protocol `ProtoC1`: class-level access to protocol members is incompatible [protocols_class_objects_2] +protocols_class_objects.py:106:1: error: Class `ConcreteC2` cannot be used as an instance of protocol `ProtoC1`: class-level access to protocol members is incompatible [protocols_class_objects_2] +protocols_class_objects.py:107:1: error: Class `ConcreteC2` cannot be used as an instance of protocol `ProtoC2`: class-level access to protocol members is incompatible [protocols_class_objects_2] +protocols_class_objects.py:108:1: error: Class `ConcreteC3` cannot be used as an instance of protocol `ProtoC1`: class-level access to protocol members is incompatible [protocols_class_objects_2] +""" diff --git a/conformance/results/basilisk/protocols_definition.toml b/conformance/results/basilisk/protocols_definition.toml new file mode 100644 index 000000000..d06412b0f --- /dev/null +++ b/conformance/results/basilisk/protocols_definition.toml @@ -0,0 +1,27 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +protocols_definition.py:30:1: error: Argument is incompatible with parameter `things` of type `Iterable[SupportsClose]`: `int` does not satisfy protocol `SupportsClose` [protocols_definition_2] +protocols_definition.py:67:9: error: Protocol member `temp` is not declared in the Protocol body [protocols_definition] +protocols_definition.py:114:1: error: Class `Concrete2_Bad1` is not compatible with protocol `Template2`: attribute `val1` is required to be a class variable (`ClassVar`) but is not defined at class level [classes_classvar] +protocols_definition.py:115:1: error: Class `Concrete2_Bad2` is not compatible with protocol `Template2`: attribute `val1` is required to be a class variable (`ClassVar`) but is declared as an instance variable [classes_classvar] +protocols_definition.py:116:1: error: Class `Concrete2_Bad3` is not compatible with protocol `Template2`: attribute `val1` is required to be a class variable (`ClassVar`) but is declared as an instance variable [classes_classvar] +protocols_definition.py:117:1: error: Class `Concrete2_Bad4` is not compatible with protocol `Template2`: attribute `val1` is required to be a class variable (`ClassVar`) but is declared as an instance variable [classes_classvar] +protocols_definition.py:156:1: error: Class `Concrete3_Bad1` is incompatible with protocol `Template3`: missing instance variable `val1` [protocols_definition_2] +protocols_definition.py:157:1: error: Class `Concrete3_Bad2` is incompatible with protocol `Template3`: `val1` is required to be a writable instance variable but is declared as a class variable (`ClassVar`) [protocols_definition_2] +protocols_definition.py:158:1: error: Class `Concrete3_Bad3` is incompatible with protocol `Template3`: `val1` is required to be a writable instance variable but is a read-only property [protocols_definition_2] +protocols_definition.py:159:1: error: Class `Concrete3_Bad4` is incompatible with protocol `Template3`: `val1` has type `Sequence[float]` but the protocol requires the writable instance variable to be `Sequence[int]` [protocols_definition_2] +protocols_definition.py:160:1: error: Class `Concrete3_Bad5` is incompatible with protocol `Template3`: `val1` has type `list[int]` but the protocol requires the writable instance variable to be `Sequence[int]` [protocols_definition_2] +protocols_definition.py:218:1: error: Class `Concrete4_Bad1` is incompatible with protocol `Template4`: `val1` is a property in the protocol but a plain method in the implementation [protocols_definition_2] +protocols_definition.py:219:1: error: Class `Concrete4_Bad2` is incompatible with protocol `Template4`: missing method `val1` [protocols_definition_2] +protocols_definition.py:285:1: error: Class `Concrete5_Bad1` is incompatible with protocol `Template5`: method `method1` signature is incompatible — parameter names ["a", "c"] do not match the protocol's ["a", "b"] [protocols_definition_2] +protocols_definition.py:286:1: error: Class `Concrete5_Bad2` is incompatible with protocol `Template5`: method `method1` signature is incompatible — parameter names ["a", "c"] do not match the protocol's ["a", "b"] [protocols_definition_2] +protocols_definition.py:287:1: error: Class `Concrete5_Bad3` is incompatible with protocol `Template5`: method `method1` signature is incompatible — parameter `a` is positional in the protocol but keyword-only in the implementation [protocols_definition_2] +protocols_definition.py:288:1: error: Class `Concrete5_Bad4` is incompatible with protocol `Template5`: method `method1` signature is incompatible — parameter `a` is keyword-accessible in the protocol but positional-only in the implementation [protocols_definition_2] +protocols_definition.py:289:1: error: Class `Concrete5_Bad5` is incompatible with protocol `Template5`: method `method1` signature is incompatible — a static method with a `self` parameter cannot satisfy an instance method [protocols_definition_2] +protocols_definition.py:339:1: error: Class `Concrete6_Bad1` is incompatible with protocol `Template6`: `val1` must be writable but a read-only property cannot satisfy a writable protocol member [protocols_definition_2] +protocols_definition.py:340:1: error: Class `Concrete6_Bad2` is incompatible with protocol `Template6`: `val1` must be writable but named tuple fields are immutable [protocols_definition_2] +protocols_definition.py:341:1: error: Class `Concrete6_Bad3` is incompatible with protocol `Template6`: `val1` must be writable but frozen dataclass fields are immutable [protocols_definition_2] +""" diff --git a/conformance/results/basilisk/protocols_explicit.toml b/conformance/results/basilisk/protocols_explicit.toml new file mode 100644 index 000000000..160cda87c --- /dev/null +++ b/conformance/results/basilisk/protocols_explicit.toml @@ -0,0 +1,13 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +protocols_explicit.py:27:9: error: Method `draw` in `BadColor` calls `super().draw()` but `PColor` declares it as abstract with no default implementation [protocols_explicit_3] +protocols_explicit.py:27:16: error: Cannot call `super().draw()`: the method is abstract with no default implementation [protocols_explicit_2] +protocols_explicit.py:56:1: error: Parameter `blue` has type `str` but element 2 of `rgb` in protocol `RGB` expects `int` [protocols_subtyping] +protocols_explicit.py:60:5: error: Cannot instantiate `Point`; it does not implement all required protocol members [protocols_explicit] +protocols_explicit.py:89:6: error: Cannot instantiate `Concrete1`; it does not implement all required protocol members [protocols_explicit] +protocols_explicit.py:134:6: error: Cannot instantiate `Concrete5`; it does not implement all required protocol members [protocols_explicit] +protocols_explicit.py:164:7: error: Cannot instantiate `Concrete7A`; it does not implement all required protocol members [protocols_explicit] +""" diff --git a/conformance/results/basilisk/protocols_generic.toml b/conformance/results/basilisk/protocols_generic.toml new file mode 100644 index 000000000..8866798dd --- /dev/null +++ b/conformance/results/basilisk/protocols_generic.toml @@ -0,0 +1,15 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +protocols_generic.py:40:1: error: Class `Concrete1` is incompatible with `Proto1[int, str]`: method `method1` return type: expected `int`, found `str` [protocols_generic] +protocols_generic.py:44:7: error: Protocol class `Proto2` combines `Protocol[T]` shorthand with explicit `Generic[T]` base [protocols_generic] +protocols_generic.py:56:5: error: Type `Box[float]` is not assignable to `Box[int]` (type parameter is covariant) [generics_variance_inference] +protocols_generic.py:66:5: error: Type `Sender[int]` is not assignable to `Sender[float]` (type parameter is contravariant) [generics_variance_inference] +protocols_generic.py:74:5: error: Type `AttrProto[int]` is not assignable to `AttrProto[float]` (type parameter is invariant) [generics_variance_inference] +protocols_generic.py:75:5: error: Type `AttrProto[float]` is not assignable to `AttrProto[int]` (type parameter is invariant) [generics_variance_inference] +protocols_generic.py:145:1: error: Class `ConcreteHasProperty2` is incompatible with protocol `HasPropertyProto`: method `m` uses concrete type `int` for TypeVar `T` which is bound to `Self` via protocol's `self: T` annotation [protocols_generic] +protocols_generic.py:146:1: error: Class `ConcreteHasProperty3` is incompatible with protocol `HasPropertyProto`: method `f` must return a self-typed value (TypeVar `T` or `Self`), but returns `int` [protocols_generic] +protocols_generic.py:147:1: error: Class `ConcreteHasProperty4` is incompatible with protocol `HasPropertyProto`: method `m` uses concrete type `str` for TypeVar `T` which is bound to `Self` via protocol's `self: T` annotation [protocols_generic] +""" diff --git a/conformance/results/basilisk/protocols_merging.toml b/conformance/results/basilisk/protocols_merging.toml new file mode 100644 index 000000000..faca560a3 --- /dev/null +++ b/conformance/results/basilisk/protocols_merging.toml @@ -0,0 +1,12 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +protocols_merging.py:52:1: error: Class `SCConcrete2` is incompatible with protocol `SizedAndClosable1`: missing method `__len__` [protocols_definition_2] +protocols_merging.py:53:1: error: Class `SCConcrete2` is incompatible with protocol `SizedAndClosable2`: missing method `__len__` [protocols_definition_2] +protocols_merging.py:54:1: error: Cannot assign `SCConcrete2()` to type `SizedAndClosable3`: `SizedAndClosable3` is not a protocol and does not support structural subtyping [protocols_definition_2] +protocols_merging.py:67:1: error: Non-protocol class `SizedAndClosable3` cannot be a base of protocol `BadProto` [protocols_merging] +protocols_merging.py:82:5: error: Cannot instantiate `SizedAndClosable4`; it does not implement all required protocol members [protocols_explicit] +protocols_merging.py:83:1: error: Cannot assign `SCConcrete1()` to type `SizedAndClosable4`: `SizedAndClosable4` is not a protocol and does not support structural subtyping [protocols_definition_2] +""" diff --git a/conformance/results/basilisk/protocols_modules.toml b/conformance/results/basilisk/protocols_modules.toml new file mode 100644 index 000000000..5de06b240 --- /dev/null +++ b/conformance/results/basilisk/protocols_modules.toml @@ -0,0 +1,9 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +protocols_modules.py:26:1: error: Module `_protocols_modules1` is not compatible with protocol `Options2`: attribute `timeout` has type `int` but protocol expects `str` [protocols_modules] +protocols_modules.py:48:1: error: Module `_protocols_modules2` is not compatible with protocol `Reporter2`: method `on_error` returns `None` but protocol expects `int` [protocols_modules] +protocols_modules.py:49:1: error: Module `_protocols_modules2` is not compatible with protocol `Reporter3`: missing method `not_implemented` required by protocol [protocols_modules] +""" diff --git a/conformance/results/basilisk/protocols_recursive.toml b/conformance/results/basilisk/protocols_recursive.toml new file mode 100644 index 000000000..be211bd5b --- /dev/null +++ b/conformance/results/basilisk/protocols_recursive.toml @@ -0,0 +1,6 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +""" diff --git a/conformance/results/basilisk/protocols_runtime_checkable.toml b/conformance/results/basilisk/protocols_runtime_checkable.toml new file mode 100644 index 000000000..941c0d194 --- /dev/null +++ b/conformance/results/basilisk/protocols_runtime_checkable.toml @@ -0,0 +1,15 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +protocols_runtime_checkable.py:23:8: error: Protocol `Proto1` cannot be used with `isinstance()` because it is not decorated with `@runtime_checkable` [protocols_runtime_checkable] +protocols_runtime_checkable.py:23:22: error: Protocol `Proto1` cannot be used with `isinstance()` because it is not decorated with `@runtime_checkable` [protocols_runtime_checkable_2] +protocols_runtime_checkable.py:55:8: error: `issubclass()` cannot be used with data protocol `DataProtocol` [protocols_runtime_checkable] +protocols_runtime_checkable.py:55:22: error: `issubclass()` cannot be used with data protocol `DataProtocol` [protocols_runtime_checkable_2] +protocols_runtime_checkable.py:61:8: error: `issubclass()` cannot be used with data protocol `DataProtocol` [protocols_runtime_checkable] +protocols_runtime_checkable.py:61:22: error: `issubclass()` cannot be used with data protocol `DataProtocol` [protocols_runtime_checkable_2] +protocols_runtime_checkable.py:88:33: error: Unsafe overlap: `Concrete3A` has members incompatible with protocol `Proto3` in `isinstance()` call [protocols_runtime_checkable_2] +protocols_runtime_checkable.py:91:33: error: Unsafe overlap: `Concrete3B` has members incompatible with protocol `Proto3` in `isinstance()` call [protocols_runtime_checkable_2] +protocols_runtime_checkable.py:94:31: error: Unsafe overlap: `Concrete3A` has members incompatible with protocol `Proto3` in `issubclass()` call [protocols_runtime_checkable_2] +""" diff --git a/conformance/results/basilisk/protocols_self.toml b/conformance/results/basilisk/protocols_self.toml new file mode 100644 index 000000000..be211bd5b --- /dev/null +++ b/conformance/results/basilisk/protocols_self.toml @@ -0,0 +1,6 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +""" diff --git a/conformance/results/basilisk/protocols_subtyping.toml b/conformance/results/basilisk/protocols_subtyping.toml new file mode 100644 index 000000000..b0178ee58 --- /dev/null +++ b/conformance/results/basilisk/protocols_subtyping.toml @@ -0,0 +1,13 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +protocols_subtyping.py:16:6: error: Cannot instantiate Protocol class `Proto1`; Protocols define interfaces, not concrete implementations [protocols_explicit] +protocols_subtyping.py:38:5: error: Type mismatch: `v2` is annotated `Concrete2` (concrete2) but assigned proto2 [assignment_compatibility] +protocols_subtyping.py:55:5: error: Type mismatch: `v2` is annotated `Proto3` (proto3) but assigned proto2 [assignment_compatibility] +protocols_subtyping.py:79:5: error: Type mismatch: `v3` is annotated `Proto4[int, float]` (proto4[int, float]) but assigned proto5[int] [assignment_compatibility] +protocols_subtyping.py:80:5: error: Type mismatch: `v4` is annotated `Proto5[float]` (proto5[float]) but assigned proto4[int, int] [assignment_compatibility] +protocols_subtyping.py:102:5: error: Type mismatch: `v4` is annotated `Proto7[int, float]` (proto7[int, float]) but assigned proto6[float, float] [assignment_compatibility] +protocols_subtyping.py:103:5: error: Type mismatch: `v5` is annotated `Proto7[float, object]` (proto7[float, object]) but assigned proto6[float, float] [assignment_compatibility] +""" diff --git a/conformance/results/basilisk/protocols_variance.toml b/conformance/results/basilisk/protocols_variance.toml new file mode 100644 index 000000000..4e5012d84 --- /dev/null +++ b/conformance/results/basilisk/protocols_variance.toml @@ -0,0 +1,18 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +protocols_variance.py:21:1: error: TypeVar `T1` in protocol `AnotherBox` is only used in output positions and should be covariant [protocols_variance] +protocols_variance.py:21:7: error: TypeVar `T1` in protocol `AnotherBox` should be covariant [protocols_variance_2] +protocols_variance.py:40:1: error: TypeVar `T3` in protocol `Protocol2` is only used in input positions and should be contravariant [protocols_variance] +protocols_variance.py:40:7: error: TypeVar `T3` in protocol `Protocol2` should be contravariant [protocols_variance_2] +protocols_variance.py:56:1: error: TypeVar `T1` in protocol `Protocol4` is only used in input positions and should be contravariant [protocols_variance] +protocols_variance.py:56:7: error: TypeVar `T1` in protocol `Protocol4` should be contravariant [protocols_variance_2] +protocols_variance.py:61:1: error: Covariant TypeVar `T1_co` is used in input position in protocol `Protocol5` [protocols_variance] +protocols_variance.py:66:1: error: TypeVar `T1` in protocol `Protocol6` is only used in output positions and should be covariant [protocols_variance] +protocols_variance.py:66:7: error: TypeVar `T1` in protocol `Protocol6` should be covariant [protocols_variance_2] +protocols_variance.py:71:1: error: Contravariant TypeVar `T1_contra` is used in output position in protocol `Protocol7` [protocols_variance] +protocols_variance.py:104:1: error: TypeVar `T1` in protocol `Protocol12` is only used in output positions and should be covariant [protocols_variance] +protocols_variance.py:104:7: error: TypeVar `T1` in protocol `Protocol12` should be covariant [protocols_variance_2] +""" diff --git a/conformance/results/basilisk/qualifiers_annotated.toml b/conformance/results/basilisk/qualifiers_annotated.toml new file mode 100644 index 000000000..80557eb03 --- /dev/null +++ b/conformance/results/basilisk/qualifiers_annotated.toml @@ -0,0 +1,27 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +qualifiers_annotated.py:38:1: error: Invalid type expression as first argument to `Annotated` for `Bad1` [qualifiers_annotated] +qualifiers_annotated.py:39:1: error: Invalid type expression as first argument to `Annotated` for `Bad2` [qualifiers_annotated] +qualifiers_annotated.py:40:1: error: Invalid type expression as first argument to `Annotated` for `Bad3` [qualifiers_annotated] +qualifiers_annotated.py:41:1: error: Invalid type expression as first argument to `Annotated` for `Bad4` [qualifiers_annotated] +qualifiers_annotated.py:42:1: error: Invalid type expression as first argument to `Annotated` for `Bad5` [qualifiers_annotated] +qualifiers_annotated.py:43:1: error: Invalid type expression as first argument to `Annotated` for `Bad6` [qualifiers_annotated] +qualifiers_annotated.py:44:1: error: Invalid type expression as first argument to `Annotated` for `Bad7` [qualifiers_annotated] +qualifiers_annotated.py:45:1: error: Invalid type expression as first argument to `Annotated` for `Bad8` [qualifiers_annotated] +qualifiers_annotated.py:46:1: error: Invalid type expression as first argument to `Annotated` for `Bad9` [qualifiers_annotated] +qualifiers_annotated.py:47:1: error: Invalid type expression as first argument to `Annotated` for `Bad10` [qualifiers_annotated] +qualifiers_annotated.py:48:1: error: Invalid type expression as first argument to `Annotated` for `Bad11` [qualifiers_annotated] +qualifiers_annotated.py:49:1: error: Invalid type expression as first argument to `Annotated` for `Bad12` [qualifiers_annotated] +qualifiers_annotated.py:59:1: error: `Annotated` requires at least two arguments for `Bad13` [qualifiers_annotated] +qualifiers_annotated.py:59:1: error: `Annotated` requires at least two arguments: a type and metadata [qualifiers_annotated_2] +qualifiers_annotated.py:71:1: error: `Annotated[...]` is not compatible with `type[...]` for `not_type1` [qualifiers_annotated] +qualifiers_annotated.py:72:1: error: Type alias `SmallInt` (an `Annotated[...]` alias) is not compatible with `type[...]` for `not_type2` [qualifiers_annotated] +qualifiers_annotated.py:79:1: error: `Annotated[...]` is not compatible with `type[T]` — `Annotated[str, ""]` cannot be used where a type constructor is expected [qualifiers_annotated] +qualifiers_annotated.py:80:1: error: Type alias `SmallInt` (an `Annotated[...]` alias) is not compatible with `type[T]` [qualifiers_annotated] +qualifiers_annotated.py:86:1: error: `Annotated` is not callable — `Annotated()` must not be called as a function [qualifiers_annotated] +qualifiers_annotated.py:87:1: error: `Annotated` is not callable — `Annotated[int, ""]()` must not be called as a function [qualifiers_annotated] +qualifiers_annotated.py:88:1: error: `SmallInt` is a type alias and cannot be called as a function [qualifiers_annotated] +""" diff --git a/conformance/results/basilisk/qualifiers_final_annotation.toml b/conformance/results/basilisk/qualifiers_final_annotation.toml new file mode 100644 index 000000000..4e1aedbee --- /dev/null +++ b/conformance/results/basilisk/qualifiers_final_annotation.toml @@ -0,0 +1,36 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +qualifiers_final_annotation.py:16:1: error: Bare `Final` annotation for `BAD1` requires an explicit type argument or initializer [qualifiers_final_annotation] +qualifiers_final_annotation.py:18:1: error: Type mismatch: `BAD2` is annotated `Final[str, int]` (str, int) but assigned str [assignment_compatibility] +qualifiers_final_annotation.py:18:1: error: `Final` accepts at most one type argument for `BAD2` [qualifiers_final_annotation] +qualifiers_final_annotation.py:34:5: error: `ID2` is annotated `Final` in the class body but has no initializer and is not unconditionally assigned in `__init__` [qualifiers_final_annotation_2] +qualifiers_final_annotation.py:38:5: error: `ID3` is annotated `Final` in the class body but has no initializer and is not unconditionally assigned in `__init__` [qualifiers_final_annotation_2] +qualifiers_final_annotation.py:54:9: error: Cannot assign to `self.ID5` — it is already initialized as `Final` in the class body [qualifiers_final_annotation_2] +qualifiers_final_annotation.py:62:9: error: `self.id3: Final` annotation is only allowed inside `__init__` [qualifiers_final_annotation_2] +qualifiers_final_annotation.py:63:9: error: `self.id4: Final` annotation is only allowed inside `__init__` [qualifiers_final_annotation_2] +qualifiers_final_annotation.py:65:9: error: Cannot assign to `self.ID7` — it is declared `Final` in the class body [qualifiers_final_annotation_2] +qualifiers_final_annotation.py:67:9: error: Cannot assign to `self.ID7` — it is declared `Final` in the class body [qualifiers_final_annotation_2] +qualifiers_final_annotation.py:71:1: error: Cannot assign to global `RATE` — it is declared `Final` at module level [qualifiers_final_annotation_2] +qualifiers_final_annotation.py:71:1: error: Cannot re-assign `RATE` — it is declared `Final` at module level [qualifiers_final_annotation_2] +qualifiers_final_annotation.py:81:1: error: Cannot assign to `ClassB.DEFAULT_ID` — it is declared `Final` in `ClassB` [qualifiers_final_annotation_2] +qualifiers_final_annotation.py:94:5: error: Cannot override `BORDER_WIDTH` — it is declared `Final` in a base class [qualifiers_final_annotation_2] +qualifiers_final_annotation.py:107:5: error: `Final` cannot be used inside `ClassVar` for attribute `VALUE2` [qualifiers_final_annotation] +qualifiers_final_annotation.py:108:5: error: `ClassVar` cannot be used inside `Final` for attribute `VALUE3` [qualifiers_final_annotation] +qualifiers_final_annotation.py:118:1: error: `Final` cannot be nested inside another type constructor for `x` [qualifiers_final_annotation] +qualifiers_final_annotation.py:121:11: error: `Final` is not allowed in parameter annotation for `x` [qualifiers_final_annotation] +qualifiers_final_annotation.py:134:1: error: Call to `N()` is missing 2 required arguments (expected at least 2, got 0) [calls_argument_count] +qualifiers_final_annotation.py:134:1: error: Argument `a` is not a field of `N`; valid fields are: x, y [namedtuples_define_functional] +qualifiers_final_annotation.py:135:1: error: Field `x` of `N` expects `int` but received a `str` literal [namedtuples_define_functional] +qualifiers_final_annotation.py:135:1: error: Field `y` of `N` expects `int` but received a `str` literal [namedtuples_define_functional] +qualifiers_final_annotation.py:141:5: error: Cannot assign to global `ID1` — it is declared `Final` at module level [qualifiers_final_annotation_2] +qualifiers_final_annotation.py:145:5: error: Cannot modify `x` — it is declared `Final` [qualifiers_final_annotation_2] +qualifiers_final_annotation.py:147:10: error: Cannot modify `x` — it is declared `Final` [qualifiers_final_annotation_2] +qualifiers_final_annotation.py:149:9: error: Cannot modify `x` — it is declared `Final` [qualifiers_final_annotation_2] +qualifiers_final_annotation.py:152:30: error: Cannot modify `x` — it is declared `Final` [qualifiers_final_annotation_2] +qualifiers_final_annotation.py:155:9: error: Cannot modify `x` — it is declared `Final` [qualifiers_final_annotation_2] +qualifiers_final_annotation.py:166:1: error: Cannot re-assign `TEN` — it is declared `Final` in an imported module [qualifiers_final_annotation_2] +qualifiers_final_annotation.py:170:1: error: Cannot re-assign `PI` — it is declared `Final` in an imported module [qualifiers_final_annotation_2] +""" diff --git a/conformance/results/basilisk/qualifiers_final_decorator.toml b/conformance/results/basilisk/qualifiers_final_decorator.toml new file mode 100644 index 000000000..f0473c3a9 --- /dev/null +++ b/conformance/results/basilisk/qualifiers_final_decorator.toml @@ -0,0 +1,16 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +qualifiers_final_decorator.py:21:7: error: Cannot inherit from final class `Base1` [qualifiers_final_decorator] +qualifiers_final_decorator.py:56:9: error: Method `method1` in `Derived2` overrides a `@final` method [qualifiers_final_decorator] +qualifiers_final_decorator.py:60:9: error: Method `method2` in `Derived2` overrides a `@final` method [qualifiers_final_decorator] +qualifiers_final_decorator.py:64:9: error: Method `method3` in `Derived2` overrides a `@final` method [qualifiers_final_decorator] +qualifiers_final_decorator.py:75:9: error: Method `method4` in `Derived2` overrides a `@final` method [qualifiers_final_decorator] +qualifiers_final_decorator.py:85:6: error: `@final` on an `@overload` signature of `method`: it should be applied only to the implementation [overloads_consistency_2] +qualifiers_final_decorator.py:89:9: error: Method `method` in `Derived3` overrides a `@final` method [qualifiers_final_decorator] +qualifiers_final_decorator.py:102:9: error: Method `method` in `Derived4` overrides a `@final` method [qualifiers_final_decorator] +qualifiers_final_decorator.py:118:9: error: Method `method` in `Derived5` overrides a `@final` method [qualifiers_final_decorator] +qualifiers_final_decorator.py:126:5: error: `@final` is not allowed on non-method function `func1` [qualifiers_final_decorator] +""" diff --git a/conformance/results/basilisk/specialtypes_any.toml b/conformance/results/basilisk/specialtypes_any.toml new file mode 100644 index 000000000..be211bd5b --- /dev/null +++ b/conformance/results/basilisk/specialtypes_any.toml @@ -0,0 +1,6 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +""" diff --git a/conformance/results/basilisk/specialtypes_never.toml b/conformance/results/basilisk/specialtypes_never.toml new file mode 100644 index 000000000..862192ce7 --- /dev/null +++ b/conformance/results/basilisk/specialtypes_never.toml @@ -0,0 +1,9 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +specialtypes_never.py:19:5: error: Function `func1` is declared `-> NoReturn` / `-> Never` but may return implicitly [specialtypes_never] +specialtypes_never.py:85:5: error: Cannot assign `list[Never]` to `v3` annotated `list[int]`: `Never` is only compatible with `Never` and `Any` in invariant contexts [specialtypes_never_2] +specialtypes_never.py:104:5: error: Cannot return `ClassC[Never]` from `func10` annotated `-> ClassC[U]`: `Never` is only compatible with `Never` and `Any` in invariant contexts [specialtypes_never_2] +""" diff --git a/conformance/results/basilisk/specialtypes_none.toml b/conformance/results/basilisk/specialtypes_none.toml new file mode 100644 index 000000000..2d42111a1 --- /dev/null +++ b/conformance/results/basilisk/specialtypes_none.toml @@ -0,0 +1,9 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +specialtypes_none.py:21:7: error: Argument `val1` of `func1` expects `None` but received `type(None)` (a class object, not the value `None`) [calls_argument_type] +specialtypes_none.py:27:1: error: Type mismatch: `none2` is annotated `Iterable` (iterable) but assigned None [assignment_compatibility] +specialtypes_none.py:41:7: error: Argument `val1` of `func2` expects `type[None]` but received `None` (a value, not a class object — use `type(None)` or `NoneType`) [calls_argument_type] +""" diff --git a/conformance/results/basilisk/specialtypes_promotions.toml b/conformance/results/basilisk/specialtypes_promotions.toml new file mode 100644 index 000000000..c072e68e2 --- /dev/null +++ b/conformance/results/basilisk/specialtypes_promotions.toml @@ -0,0 +1,7 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +specialtypes_promotions.py:13:5: error: Attribute `numerator` is not defined on `float`; parameter `f` is typed as `float`, not `int` [specialtypes_promotions] +""" diff --git a/conformance/results/basilisk/specialtypes_type.toml b/conformance/results/basilisk/specialtypes_type.toml new file mode 100644 index 000000000..ea759d6f7 --- /dev/null +++ b/conformance/results/basilisk/specialtypes_type.toml @@ -0,0 +1,16 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +specialtypes_type.py:56:7: error: Argument `TeamUser` is not assignable to `type[BasicUser | ProUser]`; `TeamUser` is not one of `BasicUser | ProUser` [specialtypes_type] +specialtypes_type.py:70:7: error: Argument `Callable` is a special typing form, not a class object; `type[T]` requires a real class [specialtypes_type] +specialtypes_type.py:76:1: error: Invalid type argument count in annotation `type[int, str]` on `bad_type1`: `type` takes 1 type argument but 2 were provided [callables_annotation] +specialtypes_type.py:76:12: error: `type` accepts exactly 1 type argument, but 2 were provided [generics_defaults_specialization] +specialtypes_type.py:117:5: error: Attribute `unknown` is not defined on `type[object]`; `type[object]` only exposes attributes of its type argument [specialtypes_type] +specialtypes_type.py:120:5: error: Attribute `unknown` is not defined on `Type[object]`; `Type[object]` only exposes attributes of its type argument [specialtypes_type] +specialtypes_type.py:143:1: error: Attribute `unknown` is not defined on `TA1` (a `TypeAlias` of `type`/`Type`) [specialtypes_type] +specialtypes_type.py:144:1: error: Attribute `unknown` is not defined on `TA2` (a `TypeAlias` of `type`/`Type`) [specialtypes_type] +specialtypes_type.py:145:1: error: Attribute `unknown` is not defined on `TA3` (a `TypeAlias` of `type`/`Type`) [specialtypes_type] +specialtypes_type.py:146:1: error: Attribute `unknown` is not defined on `TA4` (a `TypeAlias` of `type`/`Type`) [specialtypes_type] +""" diff --git a/conformance/results/basilisk/tuples_type_compat.toml b/conformance/results/basilisk/tuples_type_compat.toml new file mode 100644 index 000000000..de23284d0 --- /dev/null +++ b/conformance/results/basilisk/tuples_type_compat.toml @@ -0,0 +1,30 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +tuples_type_compat.py:15:5: error: Type mismatch: `v2` is annotated `tuple[int, int]` (tuple[int, int]) but assigned tuple[float, float] [assignment_compatibility] +tuples_type_compat.py:29:1: error: Tuple type compatibility violation: homogeneous unbounded tuple is not assignable to mixed starred-unpack form [tuples_type_compat] +tuples_type_compat.py:32:1: error: Tuple type compatibility violation: source tuple type may have more elements than the fixed-length target allows [tuples_type_compat] +tuples_type_compat.py:33:1: error: Tuple type compatibility violation: source tuple type may have more elements than the fixed-length target allows [tuples_type_compat] +tuples_type_compat.py:43:5: error: Type mismatch: `v3` is annotated `tuple[int]` (tuple[int]) but assigned tuple[int, ...] [assignment_compatibility] +tuples_type_compat.py:62:5: error: Type mismatch: `d` is annotated `tuple[int, int]` (tuple[int, int]) but assigned tuple[int, ...] [assignment_compatibility] +tuples_type_compat.py:76:9: error: Type alias `Func5Input` (an `Annotated[...]` alias) is not compatible with `type[T]` [qualifiers_annotated] +tuples_type_compat.py:81:9: error: Type alias `Func5Input` (an `Annotated[...]` alias) is not compatible with `type[T]` [qualifiers_annotated] +tuples_type_compat.py:86:9: error: Type alias `Func5Input` (an `Annotated[...]` alias) is not compatible with `type[T]` [qualifiers_annotated] +tuples_type_compat.py:102:13: error: Type alias `Func6Input` (an `Annotated[...]` alias) is not compatible with `type[T]` [qualifiers_annotated] +tuples_type_compat.py:107:13: error: Type alias `Func6Input` (an `Annotated[...]` alias) is not compatible with `type[T]` [qualifiers_annotated] +tuples_type_compat.py:112:13: error: Type alias `Func6Input` (an `Annotated[...]` alias) is not compatible with `type[T]` [qualifiers_annotated] +tuples_type_compat.py:127:13: error: Type alias `Func7Input` (an `Annotated[...]` alias) is not compatible with `type[T]` [qualifiers_annotated] +tuples_type_compat.py:130:13: error: Type alias `Func7Input` (an `Annotated[...]` alias) is not compatible with `type[T]` [qualifiers_annotated] +tuples_type_compat.py:157:1: error: Tuple type compatibility violation: tuple literal length does not match fixed starred-unpack annotation [tuples_type_compat] +tuples_type_compat.py:162:1: error: Tuple type compatibility violation: tuple literal middle element type incompatible with starred-unpack annotation [tuples_type_compat] +tuples_type_compat.py:163:1: error: Tuple type compatibility violation: tuple literal middle element type incompatible with starred-unpack annotation [tuples_type_compat] +tuples_type_compat.py:169:1: error: Tuple type compatibility violation: tuple literal element type incompatible with annotation suffix [tuples_type_compat] +tuples_type_compat.py:170:1: error: Tuple type compatibility violation: tuple literal element type incompatible with annotation suffix [tuples_type_compat] +tuples_type_compat.py:175:1: error: Tuple type compatibility violation: tuple literal middle element type incompatible with starred-unpack annotation [tuples_type_compat] +tuples_type_compat.py:176:1: error: Tuple type compatibility violation: tuple literal element type incompatible with annotation suffix [tuples_type_compat] +tuples_type_compat.py:181:5: error: Type mismatch: `t2` is annotated `tuple[str, str, *tuple[int]]` (tuple[str, str, *tuple[int]]) but assigned tuple[str, str] [assignment_compatibility] +tuples_type_compat.py:184:5: error: Type mismatch: `t5` is annotated `tuple[str, str, str, *tuple[str, ...]]` (tuple[str, str, str, *tuple[str, ...]]) but assigned tuple[str, str] [assignment_compatibility] +tuples_type_compat.py:188:5: error: Type mismatch: `t9` is annotated `tuple[*tuple[str, ...], str, str, str]` (tuple[*tuple[str, ...], str, str, str]) but assigned tuple[str, str] [assignment_compatibility] +""" diff --git a/conformance/results/basilisk/tuples_type_form.toml b/conformance/results/basilisk/tuples_type_form.toml new file mode 100644 index 000000000..27da7adfc --- /dev/null +++ b/conformance/results/basilisk/tuples_type_form.toml @@ -0,0 +1,21 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +tuples_type_form.py:12:1: error: Type mismatch: `t1` is annotated `tuple[int]` but assigned a 2-element tuple (expected 1 element(s)) [assignment_compatibility] +tuples_type_form.py:14:1: error: Type mismatch: `t2` is annotated `tuple[int, int]` but assigned a 1-element tuple (expected 2 element(s)) [assignment_compatibility] +tuples_type_form.py:15:1: error: Type mismatch: `t2` is annotated `tuple[int, int]` but assigned a tuple with element 1 `""` (expected type `int`) [assignment_compatibility] +tuples_type_form.py:25:1: error: Type mismatch: `t10` is annotated `tuple[()]` but assigned a tuple with 1 element(s) (expected empty tuple) [assignment_compatibility] +tuples_type_form.py:36:1: error: Type mismatch: `t20` is annotated `tuple[int, ...]` but assigned a tuple containing `""` (incompatible with `int`) [assignment_compatibility] +tuples_type_form.py:40:6: error: tuple type contains more than one unbounded component [tuples_type_form] +tuples_type_form.py:40:6: error: Invalid tuple type syntax: tuple[T, U, ...] is invalid — can only have one type before the ellipsis [tuples_type_form_2] +tuples_type_form.py:41:6: error: tuple type contains more than one unbounded component [tuples_type_form] +tuples_type_form.py:41:6: error: Invalid tuple type syntax: tuple[...] is invalid — must specify a type before the ellipsis [tuples_type_form_2] +tuples_type_form.py:42:6: error: tuple type contains more than one unbounded component [tuples_type_form] +tuples_type_form.py:42:6: error: Invalid tuple type syntax: ellipsis (...) must appear at the end of the tuple type [tuples_type_form_2] +tuples_type_form.py:43:6: error: tuple type contains more than one unbounded component [tuples_type_form] +tuples_type_form.py:43:6: error: Invalid tuple type syntax: ellipsis (...) must appear at the end of the tuple type [tuples_type_form_2] +tuples_type_form.py:44:6: error: tuple type contains more than one unbounded component [tuples_type_form] +tuples_type_form.py:45:6: error: tuple type contains more than one unbounded component [tuples_type_form] +""" diff --git a/conformance/results/basilisk/tuples_unpacked.toml b/conformance/results/basilisk/tuples_unpacked.toml new file mode 100644 index 000000000..af98169db --- /dev/null +++ b/conformance/results/basilisk/tuples_unpacked.toml @@ -0,0 +1,11 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +tuples_unpacked.py:40:5: error: tuple type contains more than one unbounded component [tuples_type_form] +tuples_unpacked.py:41:5: error: tuple type contains more than one unbounded component [tuples_type_form] +tuples_unpacked.py:51:9: error: tuple type contains more than one unbounded component [tuples_type_form] +tuples_unpacked.py:59:6: error: tuple type contains more than one unbounded component [tuples_type_form] +tuples_unpacked.py:60:6: error: tuple type contains more than one unbounded component [tuples_type_form] +""" diff --git a/conformance/results/basilisk/typeddicts_alt_syntax.toml b/conformance/results/basilisk/typeddicts_alt_syntax.toml new file mode 100644 index 000000000..ae239e20c --- /dev/null +++ b/conformance/results/basilisk/typeddicts_alt_syntax.toml @@ -0,0 +1,10 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +typeddicts_alt_syntax.py:23:17: error: Second argument to `TypedDict("BadTypedDict1", ...)` must be a dict literal [typeddicts_alt_syntax] +typeddicts_alt_syntax.py:27:17: error: All keys in `TypedDict("BadTypedDict2", {...})` must be string literals [typeddicts_alt_syntax] +typeddicts_alt_syntax.py:31:17: error: TypedDict declared name `WrongName` does not match the variable name `BadTypedDict3` [typeddicts_alt_syntax] +typeddicts_alt_syntax.py:35:17: error: Unrecognised keyword `other=` in `TypedDict("BadTypedDict4", ...)` call [typeddicts_alt_syntax] +""" diff --git a/conformance/results/basilisk/typeddicts_class_syntax.toml b/conformance/results/basilisk/typeddicts_class_syntax.toml new file mode 100644 index 000000000..b0ace1e5e --- /dev/null +++ b/conformance/results/basilisk/typeddicts_class_syntax.toml @@ -0,0 +1,12 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +typeddicts_class_syntax.py:30:9: error: Method `method1` is not allowed in TypedDict class `BadTypedDict1` [typeddicts_class_syntax] +typeddicts_class_syntax.py:35:9: error: Method `method2` is not allowed in TypedDict class `BadTypedDict1` [typeddicts_class_syntax] +typeddicts_class_syntax.py:40:9: error: Method `method3` is not allowed in TypedDict class `BadTypedDict1` [typeddicts_class_syntax] +typeddicts_class_syntax.py:45:7: error: TypedDict class `BadTypedDict2` uses unrecognised keyword `metaclass` [typeddicts_class_syntax_2] +typeddicts_class_syntax.py:50:7: error: TypedDict class `BadTypedDict3` uses unrecognised keyword `other` [typeddicts_class_syntax_2] +typeddicts_class_syntax.py:65:1: error: Unrecognized item `z` for `ConditionalField`: extra items are not allowed [typeddicts_extra_items] +""" diff --git a/conformance/results/basilisk/typeddicts_extra_items.toml b/conformance/results/basilisk/typeddicts_extra_items.toml new file mode 100644 index 000000000..b87b5e66c --- /dev/null +++ b/conformance/results/basilisk/typeddicts_extra_items.toml @@ -0,0 +1,34 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +typeddicts_extra_items.py:15:45: error: `int` is not assignable to extra item type `bool` of `Movie` [typeddicts_extra_items] +typeddicts_extra_items.py:22:55: error: `int` is not assignable to extra item type `bool` of `MovieFunctional` [typeddicts_extra_items] +typeddicts_extra_items.py:39:1: error: Value assigned to `TypedDict` `InheritedMovie` field `year` has the wrong type; expected `int` [typeddicts_operations] +typeddicts_extra_items.py:49:1: error: Argument to `closed` must be a literal `True` or `False` [typeddicts_extra_items] +typeddicts_extra_items.py:67:1: error: Cannot set `closed=False` on `IllegalChild1` when a superclass is `closed=True` [typeddicts_extra_items] +typeddicts_extra_items.py:73:1: error: Cannot set `closed=False` on `IllegalChild2` when a superclass sets `extra_items` [typeddicts_extra_items] +typeddicts_extra_items.py:91:1: error: `MovieC` is a closed TypedDict; extra key `age` is not allowed [typeddicts_extra_items] +typeddicts_extra_items.py:94:1: error: `MovieD` is a closed TypedDict; extra key `age` is not allowed [typeddicts_extra_items] +typeddicts_extra_items.py:109:1: error: Cannot set `closed=True` on `IllegalCloseNonReadOnly` when a superclass has non-read-only `extra_items` [typeddicts_extra_items] +typeddicts_extra_items.py:114:1: error: `extra_items` value cannot be `Required[...]` [typeddicts_extra_items] +typeddicts_extra_items.py:117:1: error: `extra_items` value cannot be `NotRequired[...]` [typeddicts_extra_items] +typeddicts_extra_items.py:128:5: error: Cannot delete a key from `TypedDict` `MovieEI` — TypedDicts have a fixed schema [typeddicts_operations] +typeddicts_extra_items.py:143:1: error: Keyword `year` in call to `unpack_no_extra` is not a key of TypedDict `MovieNoExtra` [callables_kwargs] +typeddicts_extra_items.py:174:1: error: Cannot change `extra_items` on `Child` unless it is `ReadOnly` in the superclass [typeddicts_extra_items] +typeddicts_extra_items.py:184:1: error: Required key `year` is not allowed under the inherited `extra_items` of `MovieRequiredYear` [typeddicts_extra_items] +typeddicts_extra_items.py:187:1: error: `int | None` is not consistent with `int` [typeddicts_extra_items] +typeddicts_extra_items.py:196:1: error: `str` is not assignable to `int | None` [typeddicts_extra_items] +typeddicts_extra_items.py:215:22: error: `int` is not consistent with `int | None` [typeddicts_extra_items] +typeddicts_extra_items.py:222:22: error: `year` is required in `MovieWithYear2` but is an extra item in `MovieBase2` [typeddicts_extra_items] +typeddicts_extra_items.py:242:19: error: `list[str]` is not assignable to `str | int` [typeddicts_extra_items] +typeddicts_extra_items.py:256:13: error: `str` is not assignable to extra items type `int` [typeddicts_extra_items] +typeddicts_extra_items.py:257:13: error: `int` is not assignable to extra items type `str` [typeddicts_extra_items] +typeddicts_extra_items.py:268:14: error: `object` is not assignable to extra items type `int` [typeddicts_extra_items] +typeddicts_extra_items.py:278:1: error: Unrecognized item `year` for `NonClosedMovie`: extra items are not allowed [typeddicts_extra_items] +typeddicts_extra_items.py:285:1: error: Wrong type for extra item `language`: `str` is not assignable to `int` [typeddicts_extra_items] +typeddicts_extra_items.py:293:1: error: Unrecognized item `year` for `ClosedMovie`: extra items are not allowed [typeddicts_extra_items] +typeddicts_extra_items.py:303:1: error: TypedDict `MovieExtraInt` is not assignable to `Mapping[str, int]` [typeddicts_operations] +typeddicts_extra_items.py:352:5: error: Type mismatch: `int_dict` is annotated `IntDict` (intdict) but assigned dict[str, int] [assignment_compatibility] +""" diff --git a/conformance/results/basilisk/typeddicts_final.toml b/conformance/results/basilisk/typeddicts_final.toml new file mode 100644 index 000000000..be211bd5b --- /dev/null +++ b/conformance/results/basilisk/typeddicts_final.toml @@ -0,0 +1,6 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +""" diff --git a/conformance/results/basilisk/typeddicts_inheritance.toml b/conformance/results/basilisk/typeddicts_inheritance.toml new file mode 100644 index 000000000..9ca73d439 --- /dev/null +++ b/conformance/results/basilisk/typeddicts_inheritance.toml @@ -0,0 +1,9 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +typeddicts_inheritance.py:44:7: error: TypedDict `BadTypedDict` cannot inherit from non-TypedDict class `NonTypedDict` [typeddicts_inheritance] +typeddicts_inheritance.py:55:4: error: TypedDict `Y1` illegally redeclares field `x` from `X1`: the value type is not compatible with the inherited declaration [typeddicts_inheritance] +typeddicts_inheritance.py:65:7: error: TypedDict `XYZ2` inherits incompatible declarations of field `x` from `X2` and `Y2` [typeddicts_inheritance] +""" diff --git a/conformance/results/basilisk/typeddicts_operations.toml b/conformance/results/basilisk/typeddicts_operations.toml new file mode 100644 index 000000000..1e45a26b4 --- /dev/null +++ b/conformance/results/basilisk/typeddicts_operations.toml @@ -0,0 +1,17 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +typeddicts_operations.py:22:1: error: Value assigned to `TypedDict` `Movie` field `name` has the wrong type; expected `str` [typeddicts_operations] +typeddicts_operations.py:23:1: error: Value assigned to `TypedDict` `Movie` field `year` has the wrong type; expected `int` [typeddicts_operations] +typeddicts_operations.py:24:1: error: `other` is not a valid key for `TypedDict` `Movie` [typeddicts_operations] +typeddicts_operations.py:26:7: error: Key `other` is not a valid key for `TypedDict` `Movie` [typeddicts_operations] +typeddicts_operations.py:28:1: error: missing required key `year` [typeddicts_operations] +typeddicts_operations.py:29:1: error: Value assigned to `TypedDict` `Movie` field `year` has the wrong type; expected `int` [typeddicts_operations] +typeddicts_operations.py:32:1: error: invalid key `other` for `TypedDict` `Movie` [typeddicts_operations] +typeddicts_operations.py:37:5: error: Dict literal for `TypedDict` `Movie` contains a non-literal key; all keys must be string literals [typeddicts_operations] +typeddicts_operations.py:47:1: error: `TypedDict` `Movie` does not support `.clear()` — TypedDicts have a fixed schema [typeddicts_operations] +typeddicts_operations.py:49:1: error: Cannot delete a key from `TypedDict` `Movie` — TypedDicts have a fixed schema [typeddicts_operations] +typeddicts_operations.py:62:1: error: `TypedDict` `MovieOptional` does not support `.clear()` — TypedDicts have a fixed schema [typeddicts_operations] +""" diff --git a/conformance/results/basilisk/typeddicts_readonly.toml b/conformance/results/basilisk/typeddicts_readonly.toml new file mode 100644 index 000000000..f6e262846 --- /dev/null +++ b/conformance/results/basilisk/typeddicts_readonly.toml @@ -0,0 +1,12 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +typeddicts_readonly.py:24:1: error: Cannot assign to read-only field `members` of `TypedDict` `b1` [typeddicts_readonly] +typeddicts_readonly.py:36:1: error: Cannot assign to read-only field `members` of `TypedDict` `b2` [typeddicts_readonly] +typeddicts_readonly.py:50:1: error: Cannot assign to read-only field `title` of `TypedDict` `m1` [typeddicts_readonly] +typeddicts_readonly.py:51:1: error: Cannot assign to read-only field `year` of `TypedDict` `m1` [typeddicts_readonly] +typeddicts_readonly.py:60:1: error: Cannot assign to read-only field `title` of `TypedDict` `m2` [typeddicts_readonly] +typeddicts_readonly.py:61:1: error: Cannot assign to read-only field `year` of `TypedDict` `m2` [typeddicts_readonly] +""" diff --git a/conformance/results/basilisk/typeddicts_readonly_consistency.toml b/conformance/results/basilisk/typeddicts_readonly_consistency.toml new file mode 100644 index 000000000..9b26d9da3 --- /dev/null +++ b/conformance/results/basilisk/typeddicts_readonly_consistency.toml @@ -0,0 +1,13 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +typeddicts_readonly_consistency.py:37:5: error: Type mismatch: `v3` is annotated `B1` (b1) but assigned a1 [assignment_compatibility] +typeddicts_readonly_consistency.py:38:5: error: Type mismatch: `v4` is annotated `B1` (b1) but assigned c1 [assignment_compatibility] +typeddicts_readonly_consistency.py:40:5: error: Type mismatch: `v5` is annotated `C1` (c1) but assigned a1 [assignment_compatibility] +typeddicts_readonly_consistency.py:81:5: error: Type mismatch: `v3` is annotated `B2` (b2) but assigned a2 [assignment_compatibility] +typeddicts_readonly_consistency.py:82:5: error: Type mismatch: `v4` is annotated `B2` (b2) but assigned c2 [assignment_compatibility] +typeddicts_readonly_consistency.py:84:5: error: Type mismatch: `v5` is annotated `C2` (c2) but assigned a2 [assignment_compatibility] +typeddicts_readonly_consistency.py:85:5: error: Type mismatch: `v6` is annotated `C2` (c2) but assigned b2 [assignment_compatibility] +""" diff --git a/conformance/results/basilisk/typeddicts_readonly_inheritance.toml b/conformance/results/basilisk/typeddicts_readonly_inheritance.toml new file mode 100644 index 000000000..3b05a8981 --- /dev/null +++ b/conformance/results/basilisk/typeddicts_readonly_inheritance.toml @@ -0,0 +1,19 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +typeddicts_readonly_inheritance.py:36:1: error: Cannot assign to read-only field `name` of `TypedDict` `a2` [typeddicts_readonly] +typeddicts_readonly_inheritance.py:50:5: error: TypedDict `RecordShop` illegally redeclares field `alt` from `AlbumCollection`: the value type is not compatible with the inherited declaration [typeddicts_inheritance] +typeddicts_readonly_inheritance.py:65:1: error: missing required key `name` [typeddicts_operations] +typeddicts_readonly_inheritance.py:82:1: error: Value assigned to `TypedDict` `User` field `ident` has the wrong type; expected `str` [typeddicts_operations] +typeddicts_readonly_inheritance.py:83:1: error: Value assigned to `TypedDict` `User` field `ident` has the wrong type; expected `str` [typeddicts_operations] +typeddicts_readonly_inheritance.py:84:1: error: missing required key `ident` [typeddicts_operations] +typeddicts_readonly_inheritance.py:94:5: error: TypedDict `F3` illegally redeclares field `a` from `F1`: a writable item may not be redeclared as `ReadOnly` [typeddicts_inheritance] +typeddicts_readonly_inheritance.py:98:5: error: TypedDict `F4` illegally redeclares field `a` from `F1`: a required item may not be redeclared as not-required [typeddicts_inheritance] +typeddicts_readonly_inheritance.py:106:5: error: TypedDict `F6` illegally redeclares field `c` from `F1`: a required item may not be redeclared as not-required [typeddicts_inheritance] +typeddicts_readonly_inheritance.py:119:7: error: TypedDict `TD_A` inherits incompatible declarations of field `x` from `TD_A1` and `TD_A2` [typeddicts_inheritance] +typeddicts_readonly_inheritance.py:119:7: error: TypedDict `TD_A` inherits incompatible declarations of field `y` from `TD_A1` and `TD_A2` [typeddicts_inheritance] +typeddicts_readonly_inheritance.py:132:7: error: TypedDict `TD_B` inherits incompatible declarations of field `x` from `TD_B1` and `TD_B2` [typeddicts_inheritance] +typeddicts_readonly_inheritance.py:132:7: error: TypedDict `TD_B` inherits incompatible declarations of field `y` from `TD_B1` and `TD_B2` [typeddicts_inheritance] +""" diff --git a/conformance/results/basilisk/typeddicts_readonly_kwargs.toml b/conformance/results/basilisk/typeddicts_readonly_kwargs.toml new file mode 100644 index 000000000..f248dc4fd --- /dev/null +++ b/conformance/results/basilisk/typeddicts_readonly_kwargs.toml @@ -0,0 +1,7 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +typeddicts_readonly_kwargs.py:33:5: error: Cannot assign to read-only field `key1` of `TypedDict` `kwargs` [typeddicts_readonly] +""" diff --git a/conformance/results/basilisk/typeddicts_readonly_update.toml b/conformance/results/basilisk/typeddicts_readonly_update.toml new file mode 100644 index 000000000..ed32a25e6 --- /dev/null +++ b/conformance/results/basilisk/typeddicts_readonly_update.toml @@ -0,0 +1,8 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +typeddicts_readonly_update.py:23:1: error: `TypedDict` `A` does not support `.update()` — TypedDicts have a fixed schema [typeddicts_operations] +typeddicts_readonly_update.py:23:1: error: Cannot call `.update()` on `TypedDict` `a1`: it has `ReadOnly` fields [typeddicts_readonly] +""" diff --git a/conformance/results/basilisk/typeddicts_required.toml b/conformance/results/basilisk/typeddicts_required.toml new file mode 100644 index 000000000..0c004abe2 --- /dev/null +++ b/conformance/results/basilisk/typeddicts_required.toml @@ -0,0 +1,10 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +typeddicts_required.py:12:5: error: `Required`/`NotRequired` is not allowed on attribute `x` outside a `TypedDict` [typeddicts_required] +typeddicts_required.py:16:5: error: `Required`/`NotRequired` is not allowed on parameter `x` [typeddicts_required] +typeddicts_required.py:59:5: error: `Required` and `NotRequired` cannot be nested in `a` [typeddicts_required] +typeddicts_required.py:60:5: error: `Required` and `NotRequired` cannot be nested in `b` [typeddicts_required] +""" diff --git a/conformance/results/basilisk/typeddicts_type_consistency.toml b/conformance/results/basilisk/typeddicts_type_consistency.toml new file mode 100644 index 000000000..e68f19101 --- /dev/null +++ b/conformance/results/basilisk/typeddicts_type_consistency.toml @@ -0,0 +1,15 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +typeddicts_type_consistency.py:21:1: error: TypedDict `B1` is not assignable to `A1`: value type for key `x` is `int`, expected `int | None` [typeddicts_operations] +typeddicts_type_consistency.py:38:1: error: TypedDict `B2` is not assignable to `A2`: key `x` is required in source but non-required in target [typeddicts_operations] +typeddicts_type_consistency.py:65:1: error: TypedDict `A3` is not assignable to `B3`: missing key `y` [typeddicts_operations] +typeddicts_type_consistency.py:69:1: error: invalid key `y` for `TypedDict` `A3` [typeddicts_operations] +typeddicts_type_consistency.py:76:1: error: TypedDict `B3` is not assignable to `dict[str, int]` [typeddicts_operations] +typeddicts_type_consistency.py:77:1: error: TypedDict `B3` is not assignable to `dict[str, object]` [typeddicts_operations] +typeddicts_type_consistency.py:78:1: error: TypedDict `B3` is not assignable to `dict[Any, Any]` [typeddicts_operations] +typeddicts_type_consistency.py:82:1: error: TypedDict `B3` is not assignable to `Mapping[str, int]` [typeddicts_operations] +typeddicts_type_consistency.py:126:42: error: Value assigned to `TypedDict` `Inner1` field `inner_key` has the wrong type; expected `str` [typeddicts_operations] +""" diff --git a/conformance/results/basilisk/typeddicts_usage.toml b/conformance/results/basilisk/typeddicts_usage.toml new file mode 100644 index 000000000..01a41cfdb --- /dev/null +++ b/conformance/results/basilisk/typeddicts_usage.toml @@ -0,0 +1,11 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +typeddicts_usage.py:23:1: error: `director` is not a valid key for `TypedDict` `Movie` [typeddicts_operations] +typeddicts_usage.py:24:1: error: Value assigned to `TypedDict` `Movie` field `year` has the wrong type; expected `int` [typeddicts_operations] +typeddicts_usage.py:28:1: error: invalid key `title` for `TypedDict` `Movie`; missing required key `name` [typeddicts_operations] +typeddicts_usage.py:35:4: error: TypedDict type objects cannot be used in `isinstance()` tests [typeddicts_usage] +typeddicts_usage.py:40:5: error: TypedDict type objects cannot be used in `isinstance()` tests [typeddicts_usage] +""" diff --git a/conformance/results/basilisk/typeforms_typeform.toml b/conformance/results/basilisk/typeforms_typeform.toml new file mode 100644 index 000000000..1c5d082c2 --- /dev/null +++ b/conformance/results/basilisk/typeforms_typeform.toml @@ -0,0 +1,23 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +typeforms_typeform.py:23:1: error: Type mismatch: `err1` is annotated `TypeForm[str | None]` (TypeForm[str | None]) but assigned Unknown [assignment_compatibility] +typeforms_typeform.py:24:1: error: Type mismatch: `err2` is annotated `TypeForm[str | None]` (TypeForm[str | None]) but assigned Unknown [assignment_compatibility] +typeforms_typeform.py:59:7: error: Argument `"not a type"` is not a valid type expression for parameter `x` of type `TypeForm` [assignment_compatibility] +typeforms_typeform.py:67:1: error: Type mismatch: `bad1` is annotated `TypeForm` (TypeForm) but assigned Unknown [assignment_compatibility] +typeforms_typeform.py:68:1: error: Type mismatch: `bad2` is annotated `TypeForm` (TypeForm) but assigned tuple[int, int] [assignment_compatibility] +typeforms_typeform.py:69:1: error: Type mismatch: `bad3` is annotated `TypeForm` (TypeForm) but assigned int [assignment_compatibility] +typeforms_typeform.py:70:1: error: Type mismatch: `bad4` is annotated `TypeForm` (TypeForm) but assigned Unknown [assignment_compatibility] +typeforms_typeform.py:71:1: error: Type mismatch: `bad5` is annotated `TypeForm` (TypeForm) but assigned Unknown [assignment_compatibility] +typeforms_typeform.py:71:1: error: `ClassVar` is not allowed in right-hand side of module-level assignment for `bad5` [classes_classvar] +typeforms_typeform.py:72:1: error: Type mismatch: `bad6` is annotated `TypeForm` (TypeForm) but assigned Unknown [assignment_compatibility] +typeforms_typeform.py:73:1: error: Type mismatch: `bad7` is annotated `TypeForm` (TypeForm) but assigned Unknown [assignment_compatibility] +typeforms_typeform.py:74:1: error: Type mismatch: `bad8` is annotated `TypeForm` (TypeForm) but assigned Unknown [assignment_compatibility] +typeforms_typeform.py:75:1: error: Type mismatch: `bad9` is annotated `TypeForm` (TypeForm) but assigned str [assignment_compatibility] +typeforms_typeform.py:86:6: error: Invalid TypeForm argument: `"type(1)"` is not a valid type expression [assignment_compatibility] +typeforms_typeform.py:88:6: error: Invalid TypeForm argument: `type(1)` is not a valid type expression [assignment_compatibility] +typeforms_typeform.py:98:1: error: Type mismatch: `t2` is annotated `TypeForm[str]` (TypeForm[str]) but assigned Unknown [assignment_compatibility] +typeforms_typeform.py:108:1: error: Type mismatch: `t4` is annotated `TypeForm[str]` (TypeForm[str]) but assigned Unknown [assignment_compatibility] +""" diff --git a/conformance/results/basilisk/version.toml b/conformance/results/basilisk/version.toml new file mode 100644 index 000000000..5995fb3b5 --- /dev/null +++ b/conformance/results/basilisk/version.toml @@ -0,0 +1 @@ +version = "basilisk 0.27.0" diff --git a/conformance/results/results.html b/conformance/results/results.html index e220e0455..aa2fa2891 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -127,7 +127,7 @@ } .col2 { - inline-size: calc(70% / 6); + inline-size: calc(70% / 7); } .conformant { @@ -258,11 +258,12 @@

    Python Type System Conformance Test Results

    - + + @@ -273,7 +274,7 @@

    Python Type System Conformance Test Results

    - @@ -285,9 +286,11 @@

    Python Type System Conformance Test Results

    + + + + + + @@ -383,12 +390,13 @@

    Python Type System Conformance Test Results

    - + + @@ -418,7 +427,7 @@

    Python Type System Conformance Test Results

    - @@ -430,10 +439,12 @@

    Python Type System Conformance Test Results

    + + + @@ -463,9 +475,11 @@

    Python Type System Conformance Test Results

    + + + @@ -497,12 +512,13 @@

    Python Type System Conformance Test Results

    - + + + + + + @@ -613,6 +634,7 @@

    Python Type System Conformance Test Results

    + + + + + + @@ -703,6 +730,7 @@

    Python Type System Conformance Test Results

    + @@ -712,6 +740,7 @@

    Python Type System Conformance Test Results

    + @@ -719,6 +748,7 @@

    Python Type System Conformance Test Results

    + + @@ -744,9 +775,11 @@

    Python Type System Conformance Test Results

    + + + + + + + @@ -856,6 +894,7 @@

    Python Type System Conformance Test Results

    + @@ -867,9 +906,11 @@

    Python Type System Conformance Test Results

    + + + + + + + @@ -941,12 +987,13 @@

    Python Type System Conformance Test Results

    - + + + + @@ -1007,12 +1057,13 @@

    Python Type System Conformance Test Results

    - + + + @@ -1049,12 +1102,13 @@

    Python Type System Conformance Test Results

    - + + + + + + + + @@ -1185,12 +1246,13 @@

    Python Type System Conformance Test Results

    - + + + + + @@ -1262,13 +1328,14 @@

    Python Type System Conformance Test Results

    - + + + + + + + + + @@ -1429,6 +1504,7 @@

    Python Type System Conformance Test Results

    + @@ -1436,11 +1512,13 @@

    Python Type System Conformance Test Results

    + + @@ -1451,12 +1529,13 @@

    Python Type System Conformance Test Results

    - + + + @@ -1511,9 +1592,11 @@

    Python Type System Conformance Test Results

    + + @@ -1524,12 +1607,13 @@

    Python Type System Conformance Test Results

    - + + + + + + + @@ -1653,13 +1743,14 @@

    Python Type System Conformance Test Results

    - + + + + + + @@ -1748,7 +1844,7 @@

    Python Type System Conformance Test Results

    - @@ -1756,6 +1852,7 @@

    Python Type System Conformance Test Results

    + + @@ -1778,12 +1876,13 @@

    Python Type System Conformance Test Results

    - + + + + + @@ -1875,6 +1978,7 @@

    Python Type System Conformance Test Results

    + @@ -1884,6 +1988,7 @@

    Python Type System Conformance Test Results

    + @@ -1893,6 +1998,7 @@

    Python Type System Conformance Test Results

    + @@ -1902,9 +2008,11 @@

    Python Type System Conformance Test Results

    + + + + + + + + + @@ -2009,12 +2124,13 @@

    Python Type System Conformance Test Results

    - + + + @@ -2063,6 +2181,7 @@

    Python Type System Conformance Test Results

    + @@ -2072,6 +2191,7 @@

    Python Type System Conformance Test Results

    + @@ -2081,6 +2201,7 @@

    Python Type System Conformance Test Results

    + @@ -2090,6 +2211,7 @@

    Python Type System Conformance Test Results

    + @@ -2099,9 +2221,11 @@

    Python Type System Conformance Test Results

    + + + + + + + + @@ -2184,12 +2314,13 @@

    Python Type System Conformance Test Results

    - + + + + @@ -2238,12 +2372,13 @@

    Python Type System Conformance Test Results

    - + + @@ -2279,9 +2415,11 @@

    Python Type System Conformance Test Results

    + + + @@ -2306,7 +2445,7 @@

    Python Type System Conformance Test Results

    - @@ -2318,10 +2457,12 @@

    Python Type System Conformance Test Results

    + + + + + + + @@ -2417,7 +2563,7 @@

    Python Type System Conformance Test Results

    - @@ -2429,6 +2575,7 @@

    Python Type System Conformance Test Results

    + @@ -2436,6 +2583,7 @@

    Python Type System Conformance Test Results

    + + - @@ -2468,6 +2617,7 @@

    Python Type System Conformance Test Results

    + @@ -2477,6 +2627,7 @@

    Python Type System Conformance Test Results

    + @@ -2484,6 +2635,7 @@

    Python Type System Conformance Test Results

    + + + + @@ -2550,9 +2705,11 @@

    Python Type System Conformance Test Results

    + + + @@ -2582,9 +2740,11 @@

    Python Type System Conformance Test Results

    + + + @@ -2610,12 +2771,13 @@

    Python Type System Conformance Test Results

    - + + @@ -2643,6 +2806,7 @@

    Python Type System Conformance Test Results

    + diff --git a/conformance/src/type_checker.py b/conformance/src/type_checker.py index d72ff9dbf..6fd0ed0f2 100644 --- a/conformance/src/type_checker.py +++ b/conformance/src/type_checker.py @@ -502,6 +502,114 @@ def parse_errors(self, output: Sequence[str]) -> dict[int, list[str]]: return line_to_errors +class BasiliskTypeChecker(TypeChecker): + @property + def name(self) -> str: + return "basilisk" + + def _executable(self) -> str: + # Prefer the pip-installed `basilisk` console script (the wheel puts it on + # PATH — this is how the suite's `uv sync` environment resolves it). A + # BASILISK_BIN override is honoured for source builds / local dev. + override = os.environ.get("BASILISK_BIN") + if override: + return override + return shutil.which("basilisk") or "basilisk" + + def install(self) -> bool: + try: + self.get_version() + return True + except (CalledProcessError, FileNotFoundError): + print( + "Unable to run basilisk. Install it with " + "`pip install basilisk-python` (or point BASILISK_BIN at the " + "binary). See https://www.basilisk-python.dev." + ) + return False + + def get_version(self) -> str: + proc = run( + [self._executable(), "--version"], + check=True, + stdout=PIPE, + text=True, + ) + return proc.stdout.strip() + + def run_tests(self, test_files: Sequence[str]) -> dict[str, str]: + # Basilisk emits a machine-readable JSON array of diagnostics. Each test + # file is a self-contained module, so we check them individually and key + # the flattened text output by file name for the scoring pass. + results_dict: dict[str, str] = {} + for test_file in test_files: + proc = run( + [ + self._executable(), + "check", + test_file, + "--output", + "json", + "--color", + "never", + ], + stdout=PIPE, + stderr=PIPE, + text=True, + encoding="utf-8", + ) + if proc.returncode not in (0, 1): + raise CalledProcessError( + proc.returncode, + "basilisk check", + output=proc.stdout, + stderr=proc.stderr, + ) + if not proc.stdout.strip(): + raise ValueError(f"basilisk produced empty JSON output for {test_file}") + diagnostics = json.loads(proc.stdout) + if not isinstance(diagnostics, list): + raise TypeError(f"basilisk JSON output is not a list for {test_file}") + + def sort_key(diagnostic: dict[str, object]) -> tuple[str, int, int, str, str, str]: + return ( + Path(str(diagnostic.get("path", test_file))).name, + int(diagnostic.get("line", 0) or 0), + int(diagnostic.get("col", 0) or 0), + str(diagnostic.get("severity", "error")), + str(diagnostic.get("code", "")), + str(diagnostic.get("message", "")), + ) + + for diagnostic in sorted(diagnostics, key=sort_key): + file_name = Path(diagnostic.get("path", test_file)).name + line_number = diagnostic.get("line", 0) + col_number = diagnostic.get("col", 0) + severity = str(diagnostic.get("severity", "error")).replace("\n", " ") + message = str(diagnostic.get("message", "")).replace("\n", " ") + code = str(diagnostic.get("code", "")).replace("\n", " ") + line_text = ( + f"{file_name}:{line_number}:{col_number}: " + f"{severity}: {message} [{code}]\n" + ) + results_dict[file_name] = results_dict.get(file_name, "") + line_text + return results_dict + + def parse_errors(self, output: Sequence[str]) -> dict[int, list[str]]: + # aliases_implicit.py:115:5: error: Invalid type expression ... [annotations_forward_refs] + line_to_errors: dict[int, list[str]] = {} + for line in output: + if not line.strip(): + continue + if line.count(":") < 3: + raise AssertionError( + f"Failed to parse Basilisk diagnostic line: {line!r}" + ) + _, lineno, _col, _rest = line.split(":", maxsplit=3) + line_to_errors.setdefault(int(lineno), []).append(line) + return line_to_errors + + TYPE_CHECKERS: Sequence[TypeChecker] = ( MypyTypeChecker(), PyrightTypeChecker(), @@ -509,4 +617,5 @@ def parse_errors(self, output: Sequence[str]) -> dict[int, list[str]]: PyreflyTypeChecker(), PycroscopeTypeChecker(), TyTypeChecker(), + BasiliskTypeChecker(), ) diff --git a/conformance/uv.lock b/conformance/uv.lock index 2aadb047b..81f9b4138 100644 --- a/conformance/uv.lock +++ b/conformance/uv.lock @@ -26,6 +26,18 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/45/19/cc8bd127d28a43da249aa955cfd164cf8fd534e79e42cea96c4854d72fd0/ast_serialize-0.5.0-cp39-abi3-win_arm64.whl", hash = "sha256:92a31c9c20d25a076edaeec76b128a3535d74a24f340b9a8a7e96c9b86dc9642", size = 1081181, upload-time = "2026-05-17T17:48:28.122Z" }, ] +[[package]] +name = "basilisk-python" +version = "0.27.0" +source = { registry = "https://pypi.org/simple" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/e4/b3/f1acc0c0d3400c32aa3d0927d87f8bd4f88ea2742505a4494dd5d664c4ae/basilisk_python-0.27.0-py3-none-macosx_11_0_arm64.whl", hash = "sha256:b0723eaf5bcd9a4df926486b128aef7e945cbd26e008966fef5baa83b6d14659", size = 6042835, upload-time = "2026-07-05T11:49:03.691Z" }, + { url = "https://files.pythonhosted.org/packages/0f/e5/fb3900f0c4f533a4e8f92f7aab293514ed14d82c5748c373db5b3f0b3020/basilisk_python-0.27.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ae79412a9eb8f7e5cf0b4ea9bc639b8529f996103a417f6440f05ba5e6777eb1", size = 6051090, upload-time = "2026-07-05T11:49:05.877Z" }, + { url = "https://files.pythonhosted.org/packages/bc/75/ed45daa20c0981a04f2f7ee5e8591c90dc51d90d3037c1c3f494f3ec44cd/basilisk_python-0.27.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6e250b028cca805a441a44ff89b135fce773d442926401d7f88a31858fcb5bf4", size = 6475075, upload-time = "2026-07-05T11:49:07.656Z" }, + { url = "https://files.pythonhosted.org/packages/e5/2b/3efab5e598502d2fcd4017c452e9aa30a7777e52133bdcc66c7d9cee5ebc/basilisk_python-0.27.0-py3-none-win_amd64.whl", hash = "sha256:2e6eb13a25863a574a2866dcf75a9101cce5c86cf8d538d86cf85b3fae80f916", size = 6404281, upload-time = "2026-07-05T11:49:09.69Z" }, + { url = "https://files.pythonhosted.org/packages/79/2e/17d798481ecd413bcf2bd5d01bc80c7d63dac8dee93cfc486cf381096e2d/basilisk_python-0.27.0-py3-none-win_arm64.whl", hash = "sha256:9b5e731933f231947e6d46845721ec399c8ce5d0f239a91b44c16d5933ac8662", size = 6009719, upload-time = "2026-07-05T11:49:11.333Z" }, +] + [[package]] name = "importlib-resources" version = "7.1.0" @@ -252,6 +264,7 @@ name = "typing-conformance" version = "0.1.0" source = { virtual = "." } dependencies = [ + { name = "basilisk-python" }, { name = "jinja2" }, { name = "markdown" }, { name = "mypy" }, @@ -266,6 +279,7 @@ dependencies = [ [package.metadata] requires-dist = [ + { name = "basilisk-python" }, { name = "jinja2" }, { name = "markdown" }, { name = "mypy" }, From f4f2952f3ac94d7af819c5c71b60a50a100370e0 Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Mon, 6 Jul 2026 19:52:51 -0400 Subject: [PATCH 261/308] Conformance: annotate module protocol globals (#2318) conformance: annotate module protocol globals The module protocol test should exercise structural compatibility without prescribing how type checkers infer unannotated module globals. Give the mutable attributes explicit public types so their protocol compatibility is unambiguous. --- conformance/results/ty/protocols_modules.toml | 2 -- conformance/tests/_protocols_modules1.py | 6 +++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/conformance/results/ty/protocols_modules.toml b/conformance/results/ty/protocols_modules.toml index ff470754f..86ede3609 100644 --- a/conformance/results/ty/protocols_modules.toml +++ b/conformance/results/ty/protocols_modules.toml @@ -4,11 +4,9 @@ notes = """ Never considers a module as satisfying a protocol with a method member due to the fact that the method will never exist on the class `types.ModuleType`, only on a given specific module instance. """ errors_diff = """ -Line 25: Unexpected errors ["protocols_modules.py:25:17: error[invalid-assignment] Object of type `` is not assignable to `Options1`"] Line 47: Unexpected errors ["protocols_modules.py:47:18: error[invalid-assignment] Object of type `` is not assignable to `Reporter1`"] """ output = """ -protocols_modules.py:25:17: error[invalid-assignment] Object of type `` is not assignable to `Options1` protocols_modules.py:26:17: error[invalid-assignment] Object of type `` is not assignable to `Options2` protocols_modules.py:47:18: error[invalid-assignment] Object of type `` is not assignable to `Reporter1` protocols_modules.py:48:18: error[invalid-assignment] Object of type `` is not assignable to `Reporter2` diff --git a/conformance/tests/_protocols_modules1.py b/conformance/tests/_protocols_modules1.py index 14e4bdd57..ed8a55ed2 100644 --- a/conformance/tests/_protocols_modules1.py +++ b/conformance/tests/_protocols_modules1.py @@ -2,6 +2,6 @@ Support file for protocols_modules.py test. """ -timeout = 100 -one_flag = True -other_flag = False +timeout: int = 100 +one_flag: bool = True +other_flag: bool = False From 6ef9f7719ecfff09dad8724ef42b621fd994fb5e Mon Sep 17 00:00:00 2001 From: Randolf Scholz Date: Sat, 11 Jul 2026 17:02:20 +0200 Subject: [PATCH 262/308] Fix `pre-commit` hook `end-of-file-fixer` interfering with CI. (#2320) --- conformance/results/results.html | 3 ++- conformance/src/reporting.py | 1 + conformance/tests/enums_definition.py | 1 - conformance/tests/overloads_basic.py | 1 - conformance/tests/overloads_consistency.py | 1 - docs/spec/callables.rst | 2 +- 6 files changed, 4 insertions(+), 5 deletions(-) diff --git a/conformance/results/results.html b/conformance/results/results.html index aa2fa2891..a236e7b95 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -234,6 +234,7 @@ border-color: inherit; } } + @@ -2827,4 +2828,4 @@

    Python Type System Conformance Test Results

    selector.value = localStorage.getItem("color-scheme") ?? "auto"; - \ No newline at end of file + diff --git a/conformance/src/reporting.py b/conformance/src/reporting.py index 63e2fd1f7..41b5949e5 100644 --- a/conformance/src/reporting.py +++ b/conformance/src/reporting.py @@ -58,6 +58,7 @@ def generate_summary(root_dir: Path): env = jinja2.Environment( loader=jinja2.FileSystemLoader(root_dir.joinpath("src/templates")), autoescape=jinja2.select_autoescape(), + keep_trailing_newline=True, ) env.filters["conformance_class"] = _conformance_class diff --git a/conformance/tests/enums_definition.py b/conformance/tests/enums_definition.py index 480a06510..955618ddf 100644 --- a/conformance/tests/enums_definition.py +++ b/conformance/tests/enums_definition.py @@ -90,4 +90,3 @@ class Color12(Enum): assert_type(Color12.RED, Literal[Color12.RED]) assert_type(Color12.GREEN, Literal[Color12.GREEN]) Color12.BLUE # E - diff --git a/conformance/tests/overloads_basic.py b/conformance/tests/overloads_basic.py index 7aee51d87..51f722dbe 100644 --- a/conformance/tests/overloads_basic.py +++ b/conformance/tests/overloads_basic.py @@ -58,4 +58,3 @@ def map( def map(func: Any, iter1: Any, iter2: Any = ...) -> Any: raise NotImplementedError - diff --git a/conformance/tests/overloads_consistency.py b/conformance/tests/overloads_consistency.py index 58533c125..540e0146a 100644 --- a/conformance/tests/overloads_consistency.py +++ b/conformance/tests/overloads_consistency.py @@ -115,4 +115,3 @@ def decorated(x: str, /) -> str: @_deco_2 def decorated(y: bytes, z: bytes) -> bytes: return b"" - diff --git a/docs/spec/callables.rst b/docs/spec/callables.rst index a4028aae8..f23220400 100644 --- a/docs/spec/callables.rst +++ b/docs/spec/callables.rst @@ -453,7 +453,7 @@ a function within a type expression. The syntax is Parameters specified using ``Callable`` are assumed to be positional-only. The ``Callable`` form provides no way to specify keyword-only parameters, -or default argument values. For these use cases, see the section on +or default argument values. For these use cases, see the section on `Callback protocols`_. Meaning of ``...`` in ``Callable`` From 39164cd2c5b4e2608cb8b5d2fc8af9ae6f0c0fe8 Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Wed, 22 Jul 2026 16:30:29 +0200 Subject: [PATCH 263/308] Recommend Never for return types as well (#2322) --- docs/guides/modernizing.rst | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/docs/guides/modernizing.rst b/docs/guides/modernizing.rst index 05035b7bf..1ce82fc58 100644 --- a/docs/guides/modernizing.rst +++ b/docs/guides/modernizing.rst @@ -249,18 +249,14 @@ return types. For example, replace:: from typing import NoReturn def f(x: int, y: NoReturn) -> None: ... + def g() -> NoReturn: ... with:: from typing import Never # or typing_extensions.Never def f(x: int, y: Never) -> None: ... - -But keep ``NoReturn`` for return types:: - - from typing import NoReturn - - def f(x: int) -> NoReturn: ... + def g() -> Never: ... .. _modernizing-type-aliases: From 3410759355c3018063d3a446102f88621fc43eb5 Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Fri, 31 Jul 2026 13:44:38 -0400 Subject: [PATCH 264/308] Update ty results for v0.0.65 (#2325) --- conformance/results/results.html | 88 ++++++++----------- .../results/ty/aliases_type_statement.toml | 6 +- .../results/ty/aliases_typealiastype.toml | 13 ++- .../results/ty/callables_annotation.toml | 8 +- .../results/ty/constructors_callable.toml | 4 - conformance/results/ty/enums_expansion.toml | 8 +- conformance/results/ty/generics_basic.toml | 6 +- conformance/results/ty/generics_defaults.toml | 25 +++--- .../ty/generics_typevartuple_args.toml | 16 ++-- .../ty/generics_typevartuple_basic.toml | 38 ++++---- .../ty/generics_typevartuple_callable.toml | 15 ++-- .../ty/generics_typevartuple_concat.toml | 5 +- .../generics_typevartuple_specialization.toml | 41 ++------- .../ty/generics_typevartuple_unpack.toml | 5 +- .../results/ty/literals_interactions.toml | 7 -- .../results/ty/literals_literalstring.toml | 1 - .../results/ty/protocols_class_objects.toml | 13 ++- .../results/ty/protocols_definition.toml | 19 ++-- conformance/results/ty/protocols_generic.toml | 8 +- conformance/results/ty/protocols_modules.toml | 8 +- .../results/ty/tuples_type_compat.toml | 10 +-- conformance/results/ty/version.toml | 2 +- conformance/uv.lock | 38 ++++---- 23 files changed, 147 insertions(+), 237 deletions(-) diff --git a/conformance/results/results.html b/conformance/results/results.html index a236e7b95..b29a7ceee 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -269,7 +269,7 @@

    Python Type System Conformance Test Results

    - + @@ -569,7 +569,8 @@

    Python Type System Conformance Test Results

    Partial
    • Does not forbid a TypeVar immediately following a TypeVarTuple in a parameter list from having a default.
    • -
    • Does not support TypeVarTuple.
    • +
    • Does not accept a TypeVarTuple default that unpacks another in-scope TypeVarTuple.
    • +
    • Does not correctly specialize a generic that combines a TypeVarTuple with a defaulted ParamSpec.
    @@ -854,7 +855,7 @@

    Python Type System Conformance Test Results

    @@ -876,7 +877,12 @@

    Python Type System Conformance Test Results

  • Does not correctly solve TypeVarTuple with heterogeneous bounds.
  • - + @@ -886,7 +892,12 @@

    Python Type System Conformance Test Results

    - + @@ -896,7 +907,7 @@

    Python Type System Conformance Test Results

    - + @@ -922,7 +933,7 @@

    Python Type System Conformance Test Results

    - + @@ -932,7 +943,7 @@

    Python Type System Conformance Test Results

    - + @@ -982,7 +993,7 @@

    Python Type System Conformance Test Results

    - + @@ -1189,8 +1200,7 @@

    Python Type System Conformance Test Results

    @@ -1216,10 +1226,7 @@

    Python Type System Conformance Test Results

    @@ -1263,12 +1270,7 @@

    Python Type System Conformance Test Results

    - + @@ -1345,13 +1347,12 @@

    Python Type System Conformance Test Results

    - @@ -1372,10 +1373,8 @@

    Python Type System Conformance Test Results

    @@ -1444,12 +1443,7 @@

    Python Type System Conformance Test Results

    - + @@ -1524,7 +1518,7 @@

    Python Type System Conformance Test Results

    - + @@ -1552,12 +1546,7 @@

    Python Type System Conformance Test Results

    - + @@ -1602,7 +1591,7 @@

    Python Type System Conformance Test Results

    - + @@ -2487,12 +2476,7 @@

    Python Type System Conformance Test Results

    - + @@ -2558,7 +2542,7 @@

    Python Type System Conformance Test Results

    - + @@ -2812,7 +2796,7 @@

    Python Type System Conformance Test Results

    - + diff --git a/conformance/results/ty/aliases_type_statement.toml b/conformance/results/ty/aliases_type_statement.toml index d1175af88..c317800bb 100644 --- a/conformance/results/ty/aliases_type_statement.toml +++ b/conformance/results/ty/aliases_type_statement.toml @@ -1,16 +1,12 @@ conformance_automated = "Fail" conformant = "Partial" notes = """ -Does not reject circular definitions of type aliases. -Does not support `type` statements generic over `TypeVarTuple`s. +Does not reject a generic type alias that recursively specializes itself with different type arguments. """ errors_diff = """ Line 75: Expected 1 errors -Line 10: Unexpected errors ['aliases_type_statement.py:10:52: error[invalid-type-arguments] Too many type arguments: expected 2, got 3', 'aliases_type_statement.py:10:52: error[invalid-type-form] `...` is not allowed in this context in a type alias value'] """ output = """ -aliases_type_statement.py:10:52: error[invalid-type-arguments] Too many type arguments: expected 2, got 3 -aliases_type_statement.py:10:52: error[invalid-type-form] `...` is not allowed in this context in a type alias value aliases_type_statement.py:17:1: error[unresolved-attribute] Object of type `TypeAliasType` has no attribute `bit_count` aliases_type_statement.py:19:1: error[call-non-callable] Object of type `TypeAliasType` is not callable aliases_type_statement.py:23:7: error[unresolved-attribute] Object of type `TypeAliasType` has no attribute `other_attrib` diff --git a/conformance/results/ty/aliases_typealiastype.toml b/conformance/results/ty/aliases_typealiastype.toml index 181178cff..672ec33f6 100644 --- a/conformance/results/ty/aliases_typealiastype.toml +++ b/conformance/results/ty/aliases_typealiastype.toml @@ -1,22 +1,19 @@ conformance_automated = "Fail" conformant = "Partial" notes = """ -Does not reject specializing a type parameter in a generic type alias with a type inconsistent with the parameter's upper bound. -Does not reject declaring a type alias with a type variable that is not in scope. -Does not reject declaring a type alias with a non-literal tuple passed to the `type_params` parameter. -Does not reject cyclically defined type aliases. +Does not reject cyclically defined `TypeAliasType` aliases. """ errors_diff = """ -Line 40: Expected 1 errors -Line 43: Expected 1 errors -Line 44: Expected 1 errors -Line 45: Expected 1 errors Line 46: Expected 1 errors Line 47: Expected 1 errors Line 48: Expected 1 errors """ output = """ aliases_typealiastype.py:32:7: error[unresolved-attribute] Object of type `TypeAliasType` has no attribute `other_attrib` +aliases_typealiastype.py:40:21: error[invalid-type-arguments] Type `int` is not assignable to upper bound `str` of type variable `TStr@GoodAlias5` +aliases_typealiastype.py:43:40: error[invalid-type-alias-type] Type parameter `S` used in the alias value must be included in `type_params` +aliases_typealiastype.py:44:40: error[invalid-type-alias-type] Type parameter `S` used in the alias value must be included in `type_params` +aliases_typealiastype.py:45:57: error[invalid-type-alias-type] The `type_params` argument to `TypeAliasType` must be a tuple literal aliases_typealiastype.py:52:40: error[invalid-type-form] Function calls are not allowed in type expressions aliases_typealiastype.py:53:40: error[invalid-type-form] List literals are not allowed in this context in a type expression aliases_typealiastype.py:54:42: error[invalid-type-form] Tuple literals are not allowed in this context in a type expression diff --git a/conformance/results/ty/callables_annotation.toml b/conformance/results/ty/callables_annotation.toml index d7c3c9107..5f68e9f54 100644 --- a/conformance/results/ty/callables_annotation.toml +++ b/conformance/results/ty/callables_annotation.toml @@ -1,10 +1,5 @@ -conformance_automated = "Fail" -conformant = "Partial" -notes = """ -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`. -""" +conformance_automated = "Pass" errors_diff = """ -Line 159: Expected 1 errors """ output = """ callables_annotation.py:25:5: error[missing-argument] No argument provided for required parameter 2 @@ -23,6 +18,7 @@ callables_annotation.py:58:14: error[invalid-type-form] The first argument to `C 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: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:159:25: error[invalid-assignment] Object of type `Proto8` is not assignable to `Proto5[Any]` 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/constructors_callable.toml b/conformance/results/ty/constructors_callable.toml index e9458193a..7f22bcaae 100644 --- a/conformance/results/ty/constructors_callable.toml +++ b/conformance/results/ty/constructors_callable.toml @@ -38,10 +38,6 @@ constructors_callable.py:166:1: error[type-assertion-failure] Type `Class7[int] constructors_callable.py:167:1: error[type-assertion-failure] Type `Class7[int] | Class7[str]` does not match asserted type `Class7[str]` constructors_callable.py:184:13: info[revealed-type] Revealed type: `[T](x: list[T], y: list[T]) -> Class8[T]` constructors_callable.py:185:10: error[invalid-argument-type] Argument is incorrect: Expected `list[str]`, found `Literal["not a list"]` -constructors_callable.py:187:4: error[invalid-argument-type] Argument is incorrect: Expected `list[int | str]`, found `list[int]` -constructors_callable.py:187:9: error[invalid-argument-type] Argument is incorrect: Expected `list[int | str]`, found `list[str]` constructors_callable.py:196:13: info[revealed-type] Revealed type: `[T](x: list[T], y: list[T]) -> Class9` constructors_callable.py:197:10: error[invalid-argument-type] Argument is incorrect: Expected `list[str]`, found `Literal["not a list"]` -constructors_callable.py:199:4: error[invalid-argument-type] Argument is incorrect: Expected `list[int | str]`, found `list[int]` -constructors_callable.py:199:9: error[invalid-argument-type] Argument is incorrect: Expected `list[int | str]`, found `list[str]` """ diff --git a/conformance/results/ty/enums_expansion.toml b/conformance/results/ty/enums_expansion.toml index 5e5e1f0de..10c65b6cd 100644 --- a/conformance/results/ty/enums_expansion.toml +++ b/conformance/results/ty/enums_expansion.toml @@ -1,10 +1,6 @@ -conformance_automated = "Fail" -conformant = "Partial" -notes = """Does not support `enum.Flag`.""" +conformance_automated = "Pass" errors_diff = """ -Line 53: Expected 1 errors -Line 52: Unexpected errors ['enums_expansion.py:52:9: error[type-assertion-failure] Type `Literal[CustomFlags.FLAG3]` does not match asserted type `CustomFlags`'] """ output = """ -enums_expansion.py:52:9: error[type-assertion-failure] Type `Literal[CustomFlags.FLAG3]` does not match asserted type `CustomFlags` +enums_expansion.py:53:9: error[type-assertion-failure] Type `CustomFlags & ~Literal[CustomFlags.FLAG1] & ~Literal[CustomFlags.FLAG2]` does not match asserted type `Literal[CustomFlags.FLAG3]` """ diff --git a/conformance/results/ty/generics_basic.toml b/conformance/results/ty/generics_basic.toml index ab12bf40e..4b2b392c1 100644 --- a/conformance/results/ty/generics_basic.toml +++ b/conformance/results/ty/generics_basic.toml @@ -20,13 +20,9 @@ generics_basic.py:171:1: error[invalid-generic-class] `Generic` base class must 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:27: error[invalid-metaclass] Generic metaclasses are not supported generics_basic.py:223:22: error[invalid-argument-type] Argument to function `takes_two_lists` is incorrect: Expected `list[int]`, found `Literal["not a list"]` -generics_basic.py:225:17: error[invalid-argument-type] Argument to function `takes_two_lists` is incorrect: Expected `list[int | str]`, found `list[int]` -generics_basic.py:225:22: error[invalid-argument-type] Argument to function `takes_two_lists` is incorrect: Expected `list[int | str]`, found `list[str]` generics_basic.py:232:21: error[invalid-argument-type] Argument to function `takes_two_lists` is incorrect: Expected `list[int | str]`, found `list[int]` generics_basic.py:232:24: error[invalid-argument-type] Argument to function `takes_two_lists` is incorrect: Expected `list[int | str]`, found `list[str]` generics_basic.py:240:26: error[invalid-argument-type] Argument to function `takes_two_int_lists` is incorrect: Expected `list[int]`, found `Literal["not a list"]` -generics_basic.py:241:26: error[invalid-argument-type] Argument to function `takes_two_int_lists` is incorrect: Argument type `str` does not satisfy upper bound `int` of type variable `T_int` -generics_basic.py:241:26: error[invalid-argument-type] Argument to function `takes_two_int_lists` is incorrect: Expected `list[int]`, found `list[str]` -generics_basic.py:244:26: error[invalid-argument-type] Argument to function `takes_two_int_lists` is incorrect: Expected `list[int]`, found `list[bool]` +generics_basic.py:241:26: error[invalid-argument-type] Argument to function `takes_two_int_lists` is incorrect: Argument type `int | str` does not satisfy upper bound `int` of type variable `T_int` generics_basic.py:251:28: error[invalid-argument-type] Argument to function `takes_two_int_lists` is incorrect: Expected `list[int]`, found `list[bool]` """ diff --git a/conformance/results/ty/generics_defaults.toml b/conformance/results/ty/generics_defaults.toml index d8887a2e3..edcfc62c8 100644 --- a/conformance/results/ty/generics_defaults.toml +++ b/conformance/results/ty/generics_defaults.toml @@ -2,29 +2,24 @@ conformance_automated = "Fail" conformant = "Partial" notes = """ Does not forbid a `TypeVar` immediately following a `TypeVarTuple` in a parameter list from having a default. -Does not support `TypeVarTuple`. +Does not accept a `TypeVarTuple` default that unpacks another in-scope `TypeVarTuple`. +Does not correctly specialize a generic that combines a `TypeVarTuple` with a defaulted `ParamSpec`. """ errors_diff = """ Line 188: Expected 1 errors -Line 139: Unexpected errors ['generics_defaults.py:139:5: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[str, int]`'] -Line 140: Unexpected errors ['generics_defaults.py:140:5: error[type-assertion-failure] Type `Class_TypeVarTuple` does not match asserted type `@Todo`'] -Line 200: Unexpected errors ['generics_defaults.py:200:17: error[invalid-type-form] The first argument to `Callable` must be either a list of types, ParamSpec, Concatenate, or `...`'] -Line 204: Unexpected errors ['generics_defaults.py:204:5: error[type-assertion-failure] Type `@Todo` does not match asserted type `tuple[int, str]`'] -Line 205: Unexpected errors ['generics_defaults.py:205:5: error[type-assertion-failure] Type `@Todo` does not match asserted type `(int | float, bool, /) -> None`'] -Line 207: Unexpected errors ['generics_defaults.py:207:5: error[type-assertion-failure] Type `@Todo` does not match asserted type `tuple[int, str]`'] -Line 208: Unexpected errors ['generics_defaults.py:208:5: error[type-assertion-failure] Type `@Todo` does not match asserted type `(bytes, /) -> None`'] +Line 144: Unexpected errors ['generics_defaults.py:144:61: error[invalid-type-form] `Unpack` can only unpack a tuple type or `TypeVarTuple`'] +Line 203: Unexpected errors ['generics_defaults.py:203:28: error[invalid-type-arguments] Type argument for `ParamSpec` must be either a list of types, `ParamSpec`, `Concatenate`, or `...`'] +Line 204: Unexpected errors ['generics_defaults.py:204:5: error[type-assertion-failure] Type `tuple[int]` does not match asserted type `tuple[int, str]`'] +Line 205: Unexpected errors ['generics_defaults.py:205:5: error[type-assertion-failure] Type `(...) -> None` does not match asserted type `(int | float, bool, /) -> None`'] """ output = """ generics_defaults.py:24:40: error[invalid-generic-class] Type parameter `T` without a default cannot follow earlier parameter `DefaultStrT` with a default generics_defaults.py:66:8: error[invalid-type-arguments] No type argument provided for required type variable `T2` of class `AllTheDefaults` -generics_defaults.py:139:5: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[str, int]` -generics_defaults.py:140:5: error[type-assertion-failure] Type `Class_TypeVarTuple` does not match asserted type `@Todo` +generics_defaults.py:144:61: error[invalid-type-form] `Unpack` can only unpack a tuple type or `TypeVarTuple` generics_defaults.py:152:51: error[invalid-type-variable-default] TypeVar default is not assignable to the TypeVar's upper bound generics_defaults.py:159:52: error[invalid-type-variable-default] TypeVar default is inconsistent with the TypeVar's constraints: `int` is not one of the constraints of `Invalid2` generics_defaults.py:177:1: error[type-assertion-failure] Type `int` does not match asserted type `Any` -generics_defaults.py:200:17: error[invalid-type-form] The first argument to `Callable` must be either a list of types, ParamSpec, Concatenate, or `...` -generics_defaults.py:204:5: error[type-assertion-failure] Type `@Todo` does not match asserted type `tuple[int, str]` -generics_defaults.py:205:5: error[type-assertion-failure] Type `@Todo` does not match asserted type `(int | float, bool, /) -> None` -generics_defaults.py:207:5: error[type-assertion-failure] Type `@Todo` does not match asserted type `tuple[int, str]` -generics_defaults.py:208:5: error[type-assertion-failure] Type `@Todo` does not match asserted type `(bytes, /) -> None` +generics_defaults.py:203:28: error[invalid-type-arguments] Type argument for `ParamSpec` must be either a list of types, `ParamSpec`, `Concatenate`, or `...` +generics_defaults.py:204:5: error[type-assertion-failure] Type `tuple[int]` does not match asserted type `tuple[int, str]` +generics_defaults.py:205:5: error[type-assertion-failure] Type `(...) -> None` does not match asserted type `(int | float, bool, /) -> None` """ diff --git a/conformance/results/ty/generics_typevartuple_args.toml b/conformance/results/ty/generics_typevartuple_args.toml index 826f3333d..79dbf1299 100644 --- a/conformance/results/ty/generics_typevartuple_args.toml +++ b/conformance/results/ty/generics_typevartuple_args.toml @@ -1,7 +1,7 @@ conformance_automated = "Fail" conformant = "Partial" notes = """ -Supports PEP-646 unpacked tuples but not `TypeVarTuple`. +Only partially supports `TypeVarTuple` in `*args` annotations. """ errors_diff = """ Line 33: Expected 1 errors @@ -11,13 +11,13 @@ Line 57: Expected 1 errors Line 58: Expected 1 errors Line 59: Expected 1 errors Line 67: Expected 1 errors -Line 75: Expected 1 errors -Line 29: Unexpected errors ['generics_typevartuple_args.py:29:5: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[int, str]`'] -Line 31: Unexpected errors ['generics_typevartuple_args.py:31:5: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[()]`'] -Line 32: Unexpected errors ['generics_typevartuple_args.py:32:5: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[int, str]`'] +Line 29: Unexpected errors ['generics_typevartuple_args.py:29:5: error[type-assertion-failure] Type `tuple[Unknown, ...]` does not match asserted type `tuple[int, str]`'] +Line 31: Unexpected errors ['generics_typevartuple_args.py:31:5: error[type-assertion-failure] Type `tuple[Unknown, ...]` does not match asserted type `tuple[()]`'] +Line 32: Unexpected errors ['generics_typevartuple_args.py:32:5: error[type-assertion-failure] Type `tuple[Unknown, ...]` does not match asserted type `tuple[int, str]`'] """ output = """ -generics_typevartuple_args.py:29:5: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[int, str]` -generics_typevartuple_args.py:31:5: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[()]` -generics_typevartuple_args.py:32:5: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[int, str]` +generics_typevartuple_args.py:29:5: error[type-assertion-failure] Type `tuple[Unknown, ...]` does not match asserted type `tuple[int, str]` +generics_typevartuple_args.py:31:5: error[type-assertion-failure] Type `tuple[Unknown, ...]` does not match asserted type `tuple[()]` +generics_typevartuple_args.py:32:5: error[type-assertion-failure] Type `tuple[Unknown, ...]` does not match asserted type `tuple[int, str]` +generics_typevartuple_args.py:75:13: error[invalid-argument-type] Argument to function `func4` is incorrect: Expected `tuple[Literal[0]]`, found `tuple[Literal[1], Literal[2]]` """ diff --git a/conformance/results/ty/generics_typevartuple_basic.toml b/conformance/results/ty/generics_typevartuple_basic.toml index 02dace065..a449cf6f9 100644 --- a/conformance/results/ty/generics_typevartuple_basic.toml +++ b/conformance/results/ty/generics_typevartuple_basic.toml @@ -1,22 +1,28 @@ conformance_automated = "Fail" -conformant = "Unsupported" +conformant = "Partial" +notes = """ +Incorrectly reports an unbound `TypeVarTuple` for a correctly unpacked annotation within an otherwise invalid generic class. +""" errors_diff = """ -Line 43: Expected 1 errors -Line 53: Expected 1 errors -Line 56: Expected 1 errors -Line 59: Expected 1 errors -Line 91: Expected 1 errors -Line 100: Expected 1 errors -Line 101: Expected 1 errors -Line 107: Expected 1 errors -Lines 44, 45: Expected error (tag 'v6') -Line 85: Unexpected errors ['generics_typevartuple_basic.py:85:5: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[int]`'] +Line 54: Unexpected errors ['generics_typevartuple_basic.py:54:29: error[unbound-type-variable] Type variable `Shape` is not bound to any outer generic context'] """ output = """ -generics_typevartuple_basic.py:42:34: error[invalid-argument-type] Argument to `Array.__init__` is incorrect: Expected `tuple[@Todo(TypeVarTuple), ...]`, found `Height` +generics_typevartuple_basic.py:42:28: error[invalid-assignment] Object of type `Array[Shape@Array]` is not assignable to `Array[Height, Width]` +generics_typevartuple_basic.py:42:34: error[invalid-argument-type] Argument to `Array.__init__` is incorrect: Expected `tuple[Height, Width]`, found `Height` +generics_typevartuple_basic.py:43:35: error[invalid-assignment] Object of type `Array[Shape@Array]` is not assignable to `Array[Batch, Height, Width]` +generics_typevartuple_basic.py:43:41: error[invalid-argument-type] Argument to `Array.__init__` is incorrect: Expected `tuple[Batch, Height, Width]`, found `tuple[Batch, Width]` +generics_typevartuple_basic.py:44:41: error[invalid-assignment] Object of type `Array[Time, Batch, Width, Height]` is not assignable to `Array[Time, Batch, Height, Width]` generics_typevartuple_basic.py:52:14: error[invalid-generic-class] `TypeVarTuple` must be unpacked with `*` or `Unpack[]` when used as an argument to `Generic` -generics_typevartuple_basic.py:65:27: error[unknown-argument] Argument `covariant` does not match any known parameter of constructor `TypeVarTuple.__new__` -generics_typevartuple_basic.py:66:27: error[too-many-positional-arguments] Too many positional arguments to constructor `TypeVarTuple.__new__`: expected 2, got 4 -generics_typevartuple_basic.py:67:27: error[unknown-argument] Argument `bound` does not match any known parameter of constructor `TypeVarTuple.__new__` -generics_typevartuple_basic.py:85:5: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[int]` +generics_typevartuple_basic.py:53:37: error[invalid-type-form] Bare TypeVarTuple `Shape` is not valid in this context in a parameter annotation +generics_typevartuple_basic.py:54:29: error[unbound-type-variable] Type variable `Shape` is not bound to any outer generic context +generics_typevartuple_basic.py:56:34: error[invalid-type-form] Bare TypeVarTuple `Shape` is not valid in this context in a return type annotation +generics_typevartuple_basic.py:59:24: error[invalid-type-form] Bare TypeVarTuple `Shape` is not valid in this context in a parameter annotation +generics_typevartuple_basic.py:65:27: error[invalid-legacy-type-variable] The `covariant` parameter of `typing.TypeVarTuple` was added in Python 3.15 +generics_typevartuple_basic.py:66:7: error[invalid-legacy-type-variable] `TypeVarTuple` can only have one positional argument +generics_typevartuple_basic.py:67:27: error[invalid-legacy-type-variable] The `bound` parameter of `typing.TypeVarTuple` was added in Python 3.15 +generics_typevartuple_basic.py:91:15: error[invalid-argument-type] Argument to function `func2` is incorrect: Expected `tuple[Literal[0], Literal[0]]`, found `tuple[Literal[0]]` +generics_typevartuple_basic.py:100:14: error[invalid-argument-type] Argument to function `multiply` is incorrect: Expected `Array[Height | Width]`, found `Array[Height]` +generics_typevartuple_basic.py:100:17: error[invalid-argument-type] Argument to function `multiply` is incorrect: Expected `Array[Height | Width]`, found `Array[Width]` +generics_typevartuple_basic.py:101:17: error[invalid-argument-type] Argument to function `multiply` is incorrect: Expected `Array[Height]`, found `Array[Height, Width]` +generics_typevartuple_basic.py:107:14: error[invalid-generic-class] Only one `TypeVarTuple` parameter is allowed in a `Generic` subscription """ diff --git a/conformance/results/ty/generics_typevartuple_callable.toml b/conformance/results/ty/generics_typevartuple_callable.toml index 223d59b3a..8e5efea3b 100644 --- a/conformance/results/ty/generics_typevartuple_callable.toml +++ b/conformance/results/ty/generics_typevartuple_callable.toml @@ -1,13 +1,12 @@ conformance_automated = "Fail" -conformant = "Unsupported" +conformant = "Partial" +notes = """ +Does not correctly infer a `TypeVarTuple` that appears between fixed leading and trailing parameters in `*args`. +""" errors_diff = """ -Line 26: Expected 1 errors -Line 41: Unexpected errors ['generics_typevartuple_callable.py:41:1: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[str, int, int | float | complex]`'] -Line 42: Unexpected errors ['generics_typevartuple_callable.py:42:1: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[str]`'] -Line 50: Unexpected errors ['generics_typevartuple_callable.py:50:5: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[int | float | complex, str, int | float]`'] +Line 50: Unexpected errors ['generics_typevartuple_callable.py:50:5: error[type-assertion-failure] Type `tuple[Unknown, *tuple[Unknown, ...]]` does not match asserted type `tuple[int | float | complex, str, int | float]`'] """ output = """ -generics_typevartuple_callable.py:41:1: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[str, int, int | float | complex]` -generics_typevartuple_callable.py:42:1: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[str]` -generics_typevartuple_callable.py:50:5: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[int | float | complex, str, int | float]` +generics_typevartuple_callable.py:26:9: error[invalid-argument-type] Argument to `Process.__init__` is incorrect: Expected `(int | Literal[""], str | Literal[0], /) -> None`, found `def func1(arg1: int, arg2: str) -> None` +generics_typevartuple_callable.py:50:5: error[type-assertion-failure] Type `tuple[Unknown, *tuple[Unknown, ...]]` does not match asserted type `tuple[int | float | complex, str, int | float]` """ diff --git a/conformance/results/ty/generics_typevartuple_concat.toml b/conformance/results/ty/generics_typevartuple_concat.toml index e02443283..cdd4d0cd9 100644 --- a/conformance/results/ty/generics_typevartuple_concat.toml +++ b/conformance/results/ty/generics_typevartuple_concat.toml @@ -1,8 +1,5 @@ -conformance_automated = "Fail" -conformant = "Unsupported" +conformance_automated = "Pass" errors_diff = """ -Line 53: Unexpected errors ['generics_typevartuple_concat.py:53:5: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[int, bool, str]`'] """ output = """ -generics_typevartuple_concat.py:53:5: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[int, bool, str]` """ diff --git a/conformance/results/ty/generics_typevartuple_specialization.toml b/conformance/results/ty/generics_typevartuple_specialization.toml index edae9026f..4da80c277 100644 --- a/conformance/results/ty/generics_typevartuple_specialization.toml +++ b/conformance/results/ty/generics_typevartuple_specialization.toml @@ -1,42 +1,11 @@ -conformance_automated = "Fail" -conformant = "Unsupported" +conformance_automated = "Pass" errors_diff = """ -Line 109: Expected 1 errors -Line 110: Expected 1 errors -Line 127: Expected 1 errors -Line 163: Expected 1 errors -Line 45: Unexpected errors ["generics_typevartuple_specialization.py:45:40: error[not-subscriptable] Cannot subscript non-generic type ``"] -Line 46: Unexpected errors ['generics_typevartuple_specialization.py:46:5: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[int, int | float, bool]`'] -Line 47: Unexpected errors ['generics_typevartuple_specialization.py:47:5: error[type-assertion-failure] Type `Unknown` does not match asserted type `tuple[str, @Todo]`'] -Line 51: Unexpected errors ['generics_typevartuple_specialization.py:51:5: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[int]`'] -Line 93: Unexpected errors ['generics_typevartuple_specialization.py:93:5: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[str, int]`'] -Line 94: Unexpected errors ['generics_typevartuple_specialization.py:94:5: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[int | float]`'] -Line 95: Unexpected errors ['generics_typevartuple_specialization.py:95:5: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[Any, *tuple[Any, ...]]`'] -Line 135: Unexpected errors ['generics_typevartuple_specialization.py:135:5: error[type-assertion-failure] Type `tuple[tuple[@Todo(TypeVarTuple), ...], Unknown, Unknown]` does not match asserted type `tuple[tuple[()], str, bool]`'] -Line 136: Unexpected errors ['generics_typevartuple_specialization.py:136:5: error[type-assertion-failure] Type `tuple[tuple[@Todo(TypeVarTuple), ...], Unknown, Unknown]` does not match asserted type `tuple[tuple[str], bool, int | float]`'] -Line 137: Unexpected errors ['generics_typevartuple_specialization.py:137:5: error[type-assertion-failure] Type `tuple[tuple[@Todo(TypeVarTuple), ...], Unknown, Unknown]` does not match asserted type `tuple[tuple[str, bool], int | float, int]`'] -Line 148: Unexpected errors ['generics_typevartuple_specialization.py:148:5: error[type-assertion-failure] Type `tuple[tuple[@Todo(TypeVarTuple), ...], Unknown, Unknown, Unknown]` does not match asserted type `tuple[tuple[()], str, bool, int | float]`'] -Line 149: Unexpected errors ['generics_typevartuple_specialization.py:149:5: error[type-assertion-failure] Type `tuple[tuple[@Todo(TypeVarTuple), ...], Unknown, Unknown, Unknown]` does not match asserted type `tuple[tuple[bool], str, int | float, int]`'] -Line 157: Unexpected errors ['generics_typevartuple_specialization.py:157:5: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[*tuple[int, ...], int]`'] -Line 158: Unexpected errors ['generics_typevartuple_specialization.py:158:5: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[*tuple[int, ...], str]`'] -Line 159: Unexpected errors ['generics_typevartuple_specialization.py:159:5: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[*tuple[int, ...], str]`'] """ output = """ -generics_typevartuple_specialization.py:45:40: error[not-subscriptable] Cannot subscript non-generic type `` -generics_typevartuple_specialization.py:46:5: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[int, int | float, bool]` -generics_typevartuple_specialization.py:47:5: error[type-assertion-failure] Type `Unknown` does not match asserted type `tuple[str, @Todo]` -generics_typevartuple_specialization.py:51:5: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[int]` -generics_typevartuple_specialization.py:93:5: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[str, int]` -generics_typevartuple_specialization.py:94:5: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[int | float]` -generics_typevartuple_specialization.py:95:5: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[Any, *tuple[Any, ...]]` +generics_typevartuple_specialization.py:109:17: error[invalid-type-form] `*` can only unpack a tuple type or `TypeVarTuple` +generics_typevartuple_specialization.py:110:17: error[invalid-type-form] `Unpack` can only be used with a fixed tuple type in this context generics_typevartuple_specialization.py:121:7: error[invalid-type-form] Multiple unpacked variadic tuples are not allowed in a `tuple` specialization generics_typevartuple_specialization.py:122:7: error[invalid-type-form] Multiple unpacked variadic tuples are not allowed in a `tuple` specialization -generics_typevartuple_specialization.py:135:5: error[type-assertion-failure] Type `tuple[tuple[@Todo(TypeVarTuple), ...], Unknown, Unknown]` does not match asserted type `tuple[tuple[()], str, bool]` -generics_typevartuple_specialization.py:136:5: error[type-assertion-failure] Type `tuple[tuple[@Todo(TypeVarTuple), ...], Unknown, Unknown]` does not match asserted type `tuple[tuple[str], bool, int | float]` -generics_typevartuple_specialization.py:137:5: error[type-assertion-failure] Type `tuple[tuple[@Todo(TypeVarTuple), ...], Unknown, Unknown]` does not match asserted type `tuple[tuple[str, bool], int | float, int]` -generics_typevartuple_specialization.py:148:5: error[type-assertion-failure] Type `tuple[tuple[@Todo(TypeVarTuple), ...], Unknown, Unknown, Unknown]` does not match asserted type `tuple[tuple[()], str, bool, int | float]` -generics_typevartuple_specialization.py:149:5: error[type-assertion-failure] Type `tuple[tuple[@Todo(TypeVarTuple), ...], Unknown, Unknown, Unknown]` does not match asserted type `tuple[tuple[bool], str, int | float, int]` -generics_typevartuple_specialization.py:157:5: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[*tuple[int, ...], int]` -generics_typevartuple_specialization.py:158:5: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[*tuple[int, ...], str]` -generics_typevartuple_specialization.py:159:5: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[*tuple[int, ...], str]` +generics_typevartuple_specialization.py:127:5: error[invalid-type-arguments] No type arguments provided for required type variables `T1`, `T2` +generics_typevartuple_specialization.py:163:13: error[invalid-type-form] A TypeVarTuple cannot be split to provide a fixed type argument """ diff --git a/conformance/results/ty/generics_typevartuple_unpack.toml b/conformance/results/ty/generics_typevartuple_unpack.toml index d22971b51..d0ac4414c 100644 --- a/conformance/results/ty/generics_typevartuple_unpack.toml +++ b/conformance/results/ty/generics_typevartuple_unpack.toml @@ -1,7 +1,6 @@ -conformance_automated = "Fail" -conformant = "Unsupported" +conformance_automated = "Pass" errors_diff = """ -Line 30: Expected 1 errors """ output = """ +generics_typevartuple_unpack.py:30:28: error[invalid-argument-type] Argument to function `process_batch_channels` is incorrect: Expected `Array[*tuple[Batch, *tuple[Any, ...], Channels]]`, found `Array[Batch]` """ diff --git a/conformance/results/ty/literals_interactions.toml b/conformance/results/ty/literals_interactions.toml index a5f280b0a..080adb007 100644 --- a/conformance/results/ty/literals_interactions.toml +++ b/conformance/results/ty/literals_interactions.toml @@ -1,7 +1,4 @@ conformance_automated = "Pass" -notes = """ -Deliberately does not allow `str` to be narrowed to literal string types through equality or containment checks due to the possibility of `str` subclasses that could have unexpected equality semantics. -""" errors_diff = """ """ output = """ @@ -9,8 +6,4 @@ literals_interactions.py:14:5: error[index-out-of-bounds] Index 5 is out of boun literals_interactions.py:15:5: error[index-out-of-bounds] Index -5 is out of bounds for tuple `tuple[int, str, list[bool]]` with length 3 literals_interactions.py:16:5: error[index-out-of-bounds] Index 4 is out of bounds for tuple `tuple[int, str, list[bool]]` with length 3 literals_interactions.py:17:5: error[index-out-of-bounds] Index -4 is out of bounds for tuple `tuple[int, str, list[bool]]` with length 3 -literals_interactions.py:128:28: error[invalid-argument-type] Argument to function `expects_bad_status` is incorrect: Expected `Literal["MALFORMED", "ABORTED"]`, found `str` -literals_interactions.py:130:28: error[invalid-argument-type] Argument to function `expects_bad_status` is incorrect: Expected `Literal["MALFORMED", "ABORTED"]`, found `str & ~Literal["MALFORMED"]` -literals_interactions.py:133:28: error[invalid-argument-type] Argument to function `expects_bad_status` is incorrect: Expected `Literal["MALFORMED", "ABORTED"]`, found `str` -literals_interactions.py:136:32: error[invalid-argument-type] Argument to function `expects_pending_status` is incorrect: Expected `Literal["PENDING"]`, found `str` """ diff --git a/conformance/results/ty/literals_literalstring.toml b/conformance/results/ty/literals_literalstring.toml index 58e4d8719..d4fa5392d 100644 --- a/conformance/results/ty/literals_literalstring.toml +++ b/conformance/results/ty/literals_literalstring.toml @@ -11,6 +11,5 @@ literals_literalstring.py:74:25: error[invalid-assignment] Object of type `Liter literals_literalstring.py:119:22: error[invalid-argument-type] Argument to function `literal_identity` is incorrect: Argument type `str` does not satisfy upper bound `LiteralString` of type variable `TLiteral` literals_literalstring.py:133:41: error[invalid-assignment] Object of type `Container[T@Container]` is not assignable to `Container[LiteralString]` literals_literalstring.py:133:51: error[invalid-argument-type] Argument to `Container.__init__` is incorrect: Argument type `str` does not satisfy upper bound `LiteralString` of type variable `T` -literals_literalstring.py:133:51: error[invalid-argument-type] Argument to `Container.__init__` is incorrect: Expected `LiteralString`, found `str` literals_literalstring.py:171:21: error[invalid-assignment] Object of type `list[LiteralString]` is not assignable to `list[str]` """ diff --git a/conformance/results/ty/protocols_class_objects.toml b/conformance/results/ty/protocols_class_objects.toml index fcc3ec8a1..f1a4d3d1c 100644 --- a/conformance/results/ty/protocols_class_objects.toml +++ b/conformance/results/ty/protocols_class_objects.toml @@ -1,22 +1,19 @@ conformance_automated = "Fail" -conformant = "Unsupported" +conformant = "Partial" notes = """ `type[Proto]` is not yet supported. -`ClassVar` protocol members are not yet supported. -`@property` protocol members are only partially supported. -A class object `C` is only considered to inhabit a protocol type with a method member `f` if `f` exists as an attribute on the metaclass of `C`. +Class objects are not correctly matched against `@property` protocol members. +`ClassVar` protocol members are only partially supported. """ errors_diff = """ Line 29: Expected 1 errors Line 34: Expected 1 errors Line 74: Expected 1 errors -Line 104: Expected 1 errors -Line 106: Expected 1 errors Line 107: Expected 1 errors Line 108: Expected 1 errors -Line 59: Unexpected errors ["protocols_class_objects.py:59:16: error[invalid-assignment] Object of type `` is not assignable to `ProtoA2`"] """ output = """ protocols_class_objects.py:58:16: error[invalid-assignment] Object of type `` is not assignable to `ProtoA1` -protocols_class_objects.py:59:16: error[invalid-assignment] Object of type `` is not assignable to `ProtoA2` +protocols_class_objects.py:104:16: error[invalid-assignment] Object of type `` is not assignable to `ProtoC1` +protocols_class_objects.py:106:16: error[invalid-assignment] Object of type `` is not assignable to `ProtoC1` """ diff --git a/conformance/results/ty/protocols_definition.toml b/conformance/results/ty/protocols_definition.toml index 5f8ae7f3c..e49455622 100644 --- a/conformance/results/ty/protocols_definition.toml +++ b/conformance/results/ty/protocols_definition.toml @@ -1,33 +1,32 @@ conformance_automated = "Fail" conformant = "Partial" notes = """ -Does not reject implicit instance attributes in `Protocol` methods. -Does not support `ClassVar` protocol members. -Incorrectly considers `ClassVar` attributes on concrete classes as satisfying non-`ClassVar` attribute members on protocols. -Only has partial support for `@property` protocol members. +Reports an implicit instance attribute in a `Protocol` method only as a warning. +Incorrectly considers an instance attribute on a concrete class as satisfying a `ClassVar` protocol member. """ errors_diff = """ Line 67: Expected 1 errors Line 117: Expected 1 errors -Line 157: Expected 1 errors -Line 158: Expected 1 errors -Line 218: Expected 1 errors -Line 339: Expected 1 errors -Line 340: Expected 1 errors -Line 341: Expected 1 errors """ output = """ protocols_definition.py:30:11: error[invalid-argument-type] Argument to function `close_all` is incorrect: Expected `Iterable[SupportsClose]`, found `list[int]` +protocols_definition.py:67:9: warning[ambiguous-protocol-member] Cannot assign to an undeclared attribute in a protocol method: `temp` is not declared as a protocol member protocols_definition.py:114:22: error[invalid-assignment] Object of type `Concrete2_Bad1` is not assignable to `Template2` protocols_definition.py:115:22: error[invalid-assignment] Object of type `Concrete2_Bad2` is not assignable to `Template2` protocols_definition.py:116:22: error[invalid-assignment] Object of type `Concrete2_Bad3` is not assignable to `Template2` protocols_definition.py:156:22: error[invalid-assignment] Object of type `Concrete3_Bad1` is not assignable to `Template3` +protocols_definition.py:157:22: error[invalid-assignment] Object of type `Concrete3_Bad2` is not assignable to `Template3` +protocols_definition.py:158:22: error[invalid-assignment] Object of type `Concrete3_Bad3` is not assignable to `Template3` protocols_definition.py:159:22: error[invalid-assignment] Object of type `Concrete3_Bad4` is not assignable to `Template3` protocols_definition.py:160:22: error[invalid-assignment] Object of type `Concrete3_Bad5` is not assignable to `Template3` +protocols_definition.py:218:22: error[invalid-assignment] Object of type `Concrete4_Bad1` is not assignable to `Template4` protocols_definition.py:219:22: error[invalid-assignment] Object of type `Concrete4_Bad2` is not assignable to `Template4` protocols_definition.py:285:22: error[invalid-assignment] Object of type `Concrete5_Bad1` is not assignable to `Template5` protocols_definition.py:286:22: error[invalid-assignment] Object of type `Concrete5_Bad2` is not assignable to `Template5` protocols_definition.py:287:22: error[invalid-assignment] Object of type `Concrete5_Bad3` is not assignable to `Template5` protocols_definition.py:288:22: error[invalid-assignment] Object of type `Concrete5_Bad4` is not assignable to `Template5` protocols_definition.py:289:22: error[invalid-assignment] Object of type `Concrete5_Bad5` is not assignable to `Template5` +protocols_definition.py:339:22: error[invalid-assignment] Object of type `Concrete6_Bad1` is not assignable to `Template6` +protocols_definition.py:340:22: error[invalid-assignment] Object of type `Concrete6_Bad2` is not assignable to `Template6` +protocols_definition.py:341:22: error[invalid-assignment] Object of type `Concrete6_Bad3` is not assignable to `Template6` """ diff --git a/conformance/results/ty/protocols_generic.toml b/conformance/results/ty/protocols_generic.toml index 96e3dbdca..f532306ea 100644 --- a/conformance/results/ty/protocols_generic.toml +++ b/conformance/results/ty/protocols_generic.toml @@ -4,9 +4,7 @@ notes = """ Only partially supports `@property` protocol members. """ errors_diff = """ -Line 145: Expected 1 errors -Line 146: Expected 1 errors -Line 147: Expected 1 errors +Line 144: Unexpected errors ['protocols_generic.py:144:25: error[invalid-assignment] Object of type `ConcreteHasProperty1` is not assignable to `HasPropertyProto`'] """ output = """ protocols_generic.py:40:24: error[invalid-assignment] Object of type `Concrete1` is not assignable to `Proto1[int, str]` @@ -15,4 +13,8 @@ protocols_generic.py:56:20: error[invalid-assignment] Object of type `Box[int | protocols_generic.py:66:25: error[invalid-assignment] Object of type `Sender[int]` is not assignable to `Sender[int | float]` protocols_generic.py:74:28: error[invalid-assignment] Object of type `AttrProto[int]` is not assignable to `AttrProto[int | float]` protocols_generic.py:75:26: error[invalid-assignment] Object of type `AttrProto[int | float]` is not assignable to `AttrProto[int]` +protocols_generic.py:144:25: error[invalid-assignment] Object of type `ConcreteHasProperty1` is not assignable to `HasPropertyProto` +protocols_generic.py:145:25: error[invalid-assignment] Object of type `ConcreteHasProperty2` is not assignable to `HasPropertyProto` +protocols_generic.py:146:25: error[invalid-assignment] Object of type `ConcreteHasProperty3` is not assignable to `HasPropertyProto` +protocols_generic.py:147:25: error[invalid-assignment] Object of type `ConcreteHasProperty4` is not assignable to `HasPropertyProto` """ diff --git a/conformance/results/ty/protocols_modules.toml b/conformance/results/ty/protocols_modules.toml index 86ede3609..1b0a41e46 100644 --- a/conformance/results/ty/protocols_modules.toml +++ b/conformance/results/ty/protocols_modules.toml @@ -1,14 +1,8 @@ -conformance_automated = "Fail" -conformant = "Partial" -notes = """ -Never considers a module as satisfying a protocol with a method member due to the fact that the method will never exist on the class `types.ModuleType`, only on a given specific module instance. -""" +conformance_automated = "Pass" errors_diff = """ -Line 47: Unexpected errors ["protocols_modules.py:47:18: error[invalid-assignment] Object of type `` is not assignable to `Reporter1`"] """ output = """ protocols_modules.py:26:17: error[invalid-assignment] Object of type `` is not assignable to `Options2` -protocols_modules.py:47:18: error[invalid-assignment] Object of type `` is not assignable to `Reporter1` protocols_modules.py:48:18: error[invalid-assignment] Object of type `` is not assignable to `Reporter2` protocols_modules.py:49:18: error[invalid-assignment] Object of type `` is not assignable to `Reporter3` """ diff --git a/conformance/results/ty/tuples_type_compat.toml b/conformance/results/ty/tuples_type_compat.toml index ad7d9370c..2d6b0793e 100644 --- a/conformance/results/ty/tuples_type_compat.toml +++ b/conformance/results/ty/tuples_type_compat.toml @@ -11,11 +11,11 @@ tuples_type_compat.py:62:26: error[invalid-assignment] Object of type `tuple[int tuples_type_compat.py:76:9: error[type-assertion-failure] Type `tuple[int]` does not match asserted type `tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]` tuples_type_compat.py:81:9: error[type-assertion-failure] Type `tuple[str, str] | tuple[int, int]` does not match asserted type `tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]` tuples_type_compat.py:86:9: error[type-assertion-failure] Type `tuple[int, str, int]` does not match asserted type `tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]` -tuples_type_compat.py:101:13: error[type-assertion-failure] Type `tuple[int] | (tuple[int, *tuple[str, ...], int] & )` does not match asserted type `tuple[int]` -tuples_type_compat.py:106:13: error[type-assertion-failure] Type `tuple[str, str] | (tuple[int, *tuple[str, ...], int] & & ~)` does not match asserted type `tuple[str, str] | tuple[int, int]` -tuples_type_compat.py:111:13: error[type-assertion-failure] Type `tuple[int, *tuple[str, ...], int] & & ~ & ~` does not match asserted type `tuple[int, str, int]` -tuples_type_compat.py:126:13: error[type-assertion-failure] Type `tuple[int | str, int | str] & ` does not match asserted type `tuple[int | str, str]` -tuples_type_compat.py:129:13: error[type-assertion-failure] Type `tuple[int | str, int | str] & ~` does not match asserted type `tuple[int | str, int]` +tuples_type_compat.py:102:13: error[type-assertion-failure] Type `tuple[int]` does not match asserted type `tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]` +tuples_type_compat.py:107:13: error[type-assertion-failure] Type `tuple[str, str] | tuple[int, int]` does not match asserted type `tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]` +tuples_type_compat.py:112:13: error[type-assertion-failure] Type `tuple[int, str, int]` does not match asserted type `tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]` +tuples_type_compat.py:127:13: error[type-assertion-failure] Type `tuple[int | str, str]` does not match asserted type `tuple[int | str, int | str]` +tuples_type_compat.py:130:13: error[type-assertion-failure] Type `tuple[int | str, int]` does not match asserted type `tuple[int | str, int | str]` tuples_type_compat.py:157:6: error[invalid-assignment] Object of type `tuple[Literal[1], Literal[""], Literal[""]]` is not assignable to `tuple[int, str]` tuples_type_compat.py:162:6: error[invalid-assignment] Object of type `tuple[Literal[1], Literal[1], Literal[""]]` is not assignable to `tuple[int, *tuple[str, ...]]` tuples_type_compat.py:163:6: error[invalid-assignment] Object of type `tuple[Literal[1], Literal[""], Literal[1]]` is not assignable to `tuple[int, *tuple[str, ...]]` diff --git a/conformance/results/ty/version.toml b/conformance/results/ty/version.toml index 5e4b1bfca..aadb7ee88 100644 --- a/conformance/results/ty/version.toml +++ b/conformance/results/ty/version.toml @@ -1 +1 @@ -version = "ty 0.0.50" +version = "ty 0.0.65" diff --git a/conformance/uv.lock b/conformance/uv.lock index 81f9b4138..4f1e8d2c5 100644 --- a/conformance/uv.lock +++ b/conformance/uv.lock @@ -214,27 +214,27 @@ wheels = [ [[package]] name = "ty" -version = "0.0.50" +version = "0.0.65" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/ea/fa/930ab48010e89fd1ecccc8f588afc9a79d540a1e8a379cf9cb3a41812254/ty-0.0.50.tar.gz", hash = "sha256:74b8c0df3e7d3294110e9862b7f8a3767f0e073dcb6ffa27f69fd63fd876149c", size = 5935862, upload-time = "2026-06-17T21:36:42.04Z" } +sdist = { url = "https://files.pythonhosted.org/packages/d6/54/cf561927e8e9ab5c1892a833b664aa9cd6f051a75f6280c66d8047246bda/ty-0.0.65.tar.gz", hash = "sha256:b7134bffcc00b715fa8291e84d845782ced810a998dc1f7f11d71c85c4046325", size = 6460098, upload-time = "2026-07-29T18:31:03.27Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/4e/81/2161de593e722ba27d04ee394d974604e8041c2246e2f75012d612c9934a/ty-0.0.50-py3-none-linux_armv6l.whl", hash = "sha256:b04a7717c22b9c66e9161e5af608669194cdd099c5ba0c507aeb479e6c1f9176", size = 11917031, upload-time = "2026-06-17T21:37:20.615Z" }, - { url = "https://files.pythonhosted.org/packages/05/95/70c0f1915c91c9ed68b89a8f16741d73ad65628e334e1ae5691972003702/ty-0.0.50-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:cd8204f3a8df8fe68581e0b978124a90a143f35e3e7a7725a6e247b5ce1dcb33", size = 11675310, upload-time = "2026-06-17T21:36:51.627Z" }, - { url = "https://files.pythonhosted.org/packages/c7/6c/d0318ed6f52a6b184f6480137f5d1d3d6032fa81e4bd7eff495ccf4d2977/ty-0.0.50-py3-none-macosx_11_0_arm64.whl", hash = "sha256:d336bbad38a68f16f16f84bb18f67215049b33196050c8ff67503e79619e70d2", size = 11060709, upload-time = "2026-06-17T21:36:47.226Z" }, - { url = "https://files.pythonhosted.org/packages/13/13/aff2242a51d66e4b99b71bb24081cf274b58db2909f82041ebd1f4bb2e35/ty-0.0.50-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c3933810d0360a108c60cd3ea56e6c2eba2f5ecf7ee99d66ff30775d2ae9ed29", size = 11577192, upload-time = "2026-06-17T21:37:13.953Z" }, - { url = "https://files.pythonhosted.org/packages/1a/c0/46ceb4dd1f6a8a89027e5af6bc7171301e545e7d179403c06e4067c24dee/ty-0.0.50-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:88eed477756c7a0280a38de60bcabc64b3c6dcea1ac8b2a41c9210896358f6b9", size = 11693109, upload-time = "2026-06-17T21:37:09.589Z" }, - { url = "https://files.pythonhosted.org/packages/5e/9c/347e3d9959cd39641a54fc74dd4c152863f55c9079b9e16e9b4c35dd5775/ty-0.0.50-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:caa5d1c76f75cb6d3105ec8bf835c0a8fbc0950ccf15e3d1e9c52cb99b0ab2f5", size = 12190755, upload-time = "2026-06-17T21:36:49.193Z" }, - { url = "https://files.pythonhosted.org/packages/85/ca/d8226604f57a8f1ead1973b01f2f8c987a60d0fc09f726cbc9a7ef074dad/ty-0.0.50-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d323f2a663e260923c11434655e95f37e04865b1e1641288a23cbcbca53074ee", size = 12761345, upload-time = "2026-06-17T21:36:55.81Z" }, - { url = "https://files.pythonhosted.org/packages/c4/23/0adcbd4676b30f6b58741ce2c1218c73988fdc8fb8c276005df2fe1817a3/ty-0.0.50-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d61cf42b8517e774354466252b085d83cdd0b51d771a63f99a4f21d5a44afc52", size = 12387850, upload-time = "2026-06-17T21:36:53.611Z" }, - { url = "https://files.pythonhosted.org/packages/c1/43/254fd544e95ec6f2368aab9cc9f7ffdf1329ad95d2c9f62dea22f986bee2/ty-0.0.50-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fbcd0ee844fd551bd946bb9d4fd2baf39a12aa0ad2f9f64db48352a82758abb3", size = 12220520, upload-time = "2026-06-17T21:37:00.127Z" }, - { url = "https://files.pythonhosted.org/packages/51/cd/711e649397e34d14f63d42586aebede0d4006a1a77c8c4c63bf4fb36bcbe/ty-0.0.50-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:8acf55714ec075997edfbf4dfd7ba3241c18c773e96f41398bb6d8008b83751a", size = 12439071, upload-time = "2026-06-17T21:36:57.921Z" }, - { url = "https://files.pythonhosted.org/packages/b5/48/743d3ff46307e904377ac264d6c365ef25fd6e36cbc12c10c73437fef3de/ty-0.0.50-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:8b1e02ff71af62d7a1d9b8bfef98847f5c8bfd5bb8ae6da691cea405eb5a5e98", size = 11532092, upload-time = "2026-06-17T21:37:04.892Z" }, - { url = "https://files.pythonhosted.org/packages/27/b5/5589976874b04a62de124f8f79fc11a45207d27f1c1fd2e7b7ddfa55aeea/ty-0.0.50-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:7781ace006ab6b8bb9a7591dc20d1aaa79549d9d4e8169e5dc5cf8eef0754cd7", size = 11706451, upload-time = "2026-06-17T21:37:02.5Z" }, - { url = "https://files.pythonhosted.org/packages/6c/f4/e15ea290712e61528287a353cb3103b744a092ea0a59039f17a035960717/ty-0.0.50-py3-none-musllinux_1_2_i686.whl", hash = "sha256:e8015a10f4caf07edc9245f178e64ea388bddb9fb8d2d73d2dc1cfe6b9790493", size = 11842752, upload-time = "2026-06-17T21:37:18.12Z" }, - { url = "https://files.pythonhosted.org/packages/f5/35/323b949d29cf6be2a71638498a1c43e4a2b84a1c1d206228cf3415384604/ty-0.0.50-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:87289648401648f455823334f2a8c67bbc341d502033591c8b044e67537e661b", size = 12325834, upload-time = "2026-06-17T21:37:16.124Z" }, - { url = "https://files.pythonhosted.org/packages/cc/0a/5128b055493e41cb37f4f2a24a8ffce657e8c0d01086000c5f234d9b4622/ty-0.0.50-py3-none-win32.whl", hash = "sha256:ca73efc88be2942c1733e88b026f1cea88cafeca0ee63742dd673971d9a96642", size = 11171705, upload-time = "2026-06-17T21:36:45.191Z" }, - { url = "https://files.pythonhosted.org/packages/0b/65/91ffda139aa2b1d5c0fd321c859c5d10b7a912779d426422c4b25bca4362/ty-0.0.50-py3-none-win_amd64.whl", hash = "sha256:229d08c069beb2d896cc5556c3ba0e7f4c1b6d6a885297fabf2e6bcafa382a71", size = 12319493, upload-time = "2026-06-17T21:37:11.738Z" }, - { url = "https://files.pythonhosted.org/packages/8c/4c/0c1ca628c5da7840e16801caa0bfeed1241e1113d8a5156a34245d4fa927/ty-0.0.50-py3-none-win_arm64.whl", hash = "sha256:96a84d970b59f2eddb92a4af3ba9906f24bda118cf487d923765ccd4ca24627b", size = 11635811, upload-time = "2026-06-17T21:37:07.191Z" }, + { url = "https://files.pythonhosted.org/packages/7b/4e/71e2d325d2b53a1afad81624ad076b2ede413213fc4a18cb05b78c568571/ty-0.0.65-py3-none-linux_armv6l.whl", hash = "sha256:dc556c9f05408bef4c4ef02b2cc382e4e5f797b4b20d64410289848f0d76705f", size = 12298466, upload-time = "2026-07-29T18:30:12.744Z" }, + { url = "https://files.pythonhosted.org/packages/57/77/fec8f29647c55794efa430a7f365e44f5ce7ffb6459d9445a87fac569bec/ty-0.0.65-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:29d2e0d34cc0a28a17ef0cf81135c5ebabc3562131f9079138ba5e7bae0f56bd", size = 11942421, upload-time = "2026-07-29T18:30:16.076Z" }, + { url = "https://files.pythonhosted.org/packages/13/09/7f3766aef9dc627e2698cf4e3e59cf53389dcae3812040d33c1aa931230f/ty-0.0.65-py3-none-macosx_11_0_arm64.whl", hash = "sha256:685f49a9312bbf69d5b65bbb66384fed1f927403ea030c217b9289092d7e46c4", size = 11451922, upload-time = "2026-07-29T18:30:19.155Z" }, + { url = "https://files.pythonhosted.org/packages/cb/7b/1a77cd50e0befb50f55b8bf9bd3ed3eddf184bf28c61b56727039e0774fc/ty-0.0.65-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6f564b5ebe78e2f3a8e7b8eacb1292eb88b7c0f3c8630671cfca31abc0709cd9", size = 11994999, upload-time = "2026-07-29T18:30:22.315Z" }, + { url = "https://files.pythonhosted.org/packages/63/7b/feda16f3a4a0a99be27431e0c9598eeeec0db1eb2fec9a15976698209418/ty-0.0.65-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:c983e156fe9e113fb56389e13d327b6b8549fe866de9b269684723a88e9b732d", size = 12090662, upload-time = "2026-07-29T18:30:24.93Z" }, + { url = "https://files.pythonhosted.org/packages/ed/3e/3f69bf9c9307dbdc0771719f65ce5b556e7bdeeaccbdd599d4f57866d801/ty-0.0.65-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e3663b7396e8b1a9954e20e732de7ccb0192bf4118473069b4945920d6923921", size = 12822094, upload-time = "2026-07-29T18:30:28.012Z" }, + { url = "https://files.pythonhosted.org/packages/90/38/8fa791b3bb503ee2b46ad81690cd1bdd54519582df6d805cee57fe143e85/ty-0.0.65-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:306ed01f29d6e108e98feb233dbbf5878a027603b71bd3743b343977933a9f16", size = 13357833, upload-time = "2026-07-29T18:30:31.122Z" }, + { url = "https://files.pythonhosted.org/packages/c1/73/4dda396a201e1dd0ed3594a9b48e559cb41c4bc048c6cd4c4d1b39eb4313/ty-0.0.65-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:28bcfc8898c94f079a9100e684bcf312b6a64ad3a7d4ebb35a4591546030a2cd", size = 12977303, upload-time = "2026-07-29T18:30:33.944Z" }, + { url = "https://files.pythonhosted.org/packages/a5/26/c250c2c569adc53a8591716641388397bcb2a442e4a30b952ae81b50c0e0/ty-0.0.65-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5a75bd0c245c38802a8f488378e74f92feb7dd33db7d63fbdd6fdf82791ba730", size = 12579338, upload-time = "2026-07-29T18:30:37.199Z" }, + { url = "https://files.pythonhosted.org/packages/d3/94/4a5647d44753ca218fc930d7e4d9bf468d0ed4a0ad4b3d57588bc1bbacf7/ty-0.0.65-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:9e5e1bdea9662d2b5312b4e99f319f4e6e2ea427511b5fbc546141b79ec53f76", size = 12957731, upload-time = "2026-07-29T18:30:39.937Z" }, + { url = "https://files.pythonhosted.org/packages/36/b6/1e22fa11a1e0dfb20b1c7f3cbfd8170273aada2a82f9ecd3055275370c44/ty-0.0.65-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:03a88493d4842889f65280ae241e06b399d57eb3c63571054cad21a4c33b3b69", size = 11938625, upload-time = "2026-07-29T18:30:42.603Z" }, + { url = "https://files.pythonhosted.org/packages/5c/0a/fe5f22ef62b193201bc5566762e22049762cd485bfafb5095a7050760054/ty-0.0.65-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:600b8bf6f4940cf7ffb2f43d3716faaf38dcb97cd8617c55771451bc0276408f", size = 12105592, upload-time = "2026-07-29T18:30:45.419Z" }, + { url = "https://files.pythonhosted.org/packages/76/fd/922b3a6e9d697452cdbb4b7e3f636868add5ec652154518a736e4364f3b7/ty-0.0.65-py3-none-musllinux_1_2_i686.whl", hash = "sha256:0c28007bc79d648c1ddaf1e65885d07baec48eb87240da442f608e4107c1b7d8", size = 12387335, upload-time = "2026-07-29T18:30:48.405Z" }, + { url = "https://files.pythonhosted.org/packages/77/22/a1a08ebc84c083db2fb55e3b5cd186db0c067692f4921146f601360231e2/ty-0.0.65-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:c852da96091ad22361e6586b7c7ba98e1334dcd4d8ffb67e47f4fb673de33f77", size = 12682710, upload-time = "2026-07-29T18:30:51.364Z" }, + { url = "https://files.pythonhosted.org/packages/81/14/eaaa410a25bbdea19722109b5422380a0e211b3afcf3071d15953ddbd5db/ty-0.0.65-py3-none-win32.whl", hash = "sha256:cf529d538f1403b14b0511e6ec3cdb95d3d974adabf24cc76cedc533368c3edc", size = 11692341, upload-time = "2026-07-29T18:30:54.35Z" }, + { url = "https://files.pythonhosted.org/packages/bc/0f/6d48f206dce9d7e53fe3b5ea0f0ab5800dd9d2365b2b48f736783436c43f/ty-0.0.65-py3-none-win_amd64.whl", hash = "sha256:234a321e33c7cbbfbd67bfa0b01b685dd9c21f1841781a21e5ca1fa0b25f1d5d", size = 12729355, upload-time = "2026-07-29T18:30:57.275Z" }, + { url = "https://files.pythonhosted.org/packages/96/aa/7446f7725e303cf78e058c893af1f0552b9451895454908706f4c6c3494b/ty-0.0.65-py3-none-win_arm64.whl", hash = "sha256:b9424be1ec56d93ff18609fb1c0a0a2283fe1282cd6d1c7604f97d73b94d61f2", size = 12051375, upload-time = "2026-07-29T18:31:00.579Z" }, ] [[package]] From 60df123ccfe9ae0472b1409ef4a00d51ffc5d972 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 1 Aug 2026 20:30:38 +0100 Subject: [PATCH 265/308] Bump actions/setup-python from 6 to 7 in the actions group (#2328) Bumps the actions group with 1 update: [actions/setup-python](https://github.com/actions/setup-python). Updates `actions/setup-python` from 6 to 7 - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/compare/v6...v7) --- updated-dependencies: - dependency-name: actions/setup-python dependency-version: '7' dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/build-docs.yml | 2 +- .github/workflows/ci.yml | 2 +- .github/workflows/conformance.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index 717e71d1c..7e430797e 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -15,7 +15,7 @@ jobs: steps: - uses: actions/checkout@v7 - name: Set up Python - uses: actions/setup-python@v6 + uses: actions/setup-python@v7 with: python-version: "3.14" - name: Install dependencies diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9df37b729..b7f19bdcd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,7 @@ jobs: steps: - uses: actions/checkout@v7 - - uses: actions/setup-python@v6 + - uses: actions/setup-python@v7 with: python-version: "3.14" cache: "pip" diff --git a/.github/workflows/conformance.yml b/.github/workflows/conformance.yml index 3f0484de5..da948d918 100644 --- a/.github/workflows/conformance.yml +++ b/.github/workflows/conformance.yml @@ -16,7 +16,7 @@ jobs: - uses: actions/checkout@v7 - name: Set up Python 3.12 - uses: actions/setup-python@v6 + uses: actions/setup-python@v7 with: python-version: "3.12" cache: "pip" From a2e6356af2f609a7ab2330895477d0d08181a169 Mon Sep 17 00:00:00 2001 From: Rebecca Chen Date: Mon, 3 Aug 2026 01:04:44 -0700 Subject: [PATCH 266/308] Update typeddicts_class_syntax.py test to use a custom metaclass. (#2327) The TypedDict chapter of the spec says: > It is also invalid to specify a custom metaclass. It looks like most type checkers interpret this to mean that the appearance of `metaclass=...` is illegal in a TypedDict definition. Pyrefly interprets this to mean that a non-`type` metaclass is illegal, so a redundant `metaclass=type` is fine. IMO either interpretation is defensible, but the conformance test currently uses `metaclass=type`, which only accommodates the first. This PR changes the test to use a non-`type` metaclass, which is unambiguously an error. This doesn't actually change pyrefly's conformance results because pyrefly has a bug that causes it to emit a different, nonsensical error on the `metaclass=type` line, which was mistakenly taken as pyrefly passing the test. I'm in the process of fixing that bug, which is how I discovered that pyrefly behaves slightly differently from the other checkers here. --- .../basilisk/typeddicts_class_syntax.toml | 6 +++--- .../results/mypy/typeddicts_class_syntax.toml | 18 +++++++++--------- .../pycroscope/typeddicts_class_syntax.toml | 6 +++--- .../pyrefly/typeddicts_class_syntax.toml | 6 +++--- .../pyright/typeddicts_class_syntax.toml | 14 +++++++------- .../results/ty/typeddicts_class_syntax.toml | 6 +++--- .../results/zuban/typeddicts_class_syntax.toml | 6 +++--- conformance/tests/typeddicts_class_syntax.py | 8 ++++++-- 8 files changed, 37 insertions(+), 33 deletions(-) diff --git a/conformance/results/basilisk/typeddicts_class_syntax.toml b/conformance/results/basilisk/typeddicts_class_syntax.toml index b0ace1e5e..42228d9ae 100644 --- a/conformance/results/basilisk/typeddicts_class_syntax.toml +++ b/conformance/results/basilisk/typeddicts_class_syntax.toml @@ -6,7 +6,7 @@ output = """ typeddicts_class_syntax.py:30:9: error: Method `method1` is not allowed in TypedDict class `BadTypedDict1` [typeddicts_class_syntax] typeddicts_class_syntax.py:35:9: error: Method `method2` is not allowed in TypedDict class `BadTypedDict1` [typeddicts_class_syntax] typeddicts_class_syntax.py:40:9: error: Method `method3` is not allowed in TypedDict class `BadTypedDict1` [typeddicts_class_syntax] -typeddicts_class_syntax.py:45:7: error: TypedDict class `BadTypedDict2` uses unrecognised keyword `metaclass` [typeddicts_class_syntax_2] -typeddicts_class_syntax.py:50:7: error: TypedDict class `BadTypedDict3` uses unrecognised keyword `other` [typeddicts_class_syntax_2] -typeddicts_class_syntax.py:65:1: error: Unrecognized item `z` for `ConditionalField`: extra items are not allowed [typeddicts_extra_items] +typeddicts_class_syntax.py:49:7: error: TypedDict class `BadTypedDict2` uses unrecognised keyword `metaclass` [typeddicts_class_syntax_2] +typeddicts_class_syntax.py:54:7: error: TypedDict class `BadTypedDict3` uses unrecognised keyword `other` [typeddicts_class_syntax_2] +typeddicts_class_syntax.py:69:1: error: Unrecognized item `z` for `ConditionalField`: extra items are not allowed [typeddicts_extra_items] """ diff --git a/conformance/results/mypy/typeddicts_class_syntax.toml b/conformance/results/mypy/typeddicts_class_syntax.toml index a005f5d63..d15df036b 100644 --- a/conformance/results/mypy/typeddicts_class_syntax.toml +++ b/conformance/results/mypy/typeddicts_class_syntax.toml @@ -6,16 +6,16 @@ output = """ typeddicts_class_syntax.py:30: error: Invalid statement in TypedDict definition; expected "field_name: field_type" [misc] typeddicts_class_syntax.py:34: error: Invalid statement in TypedDict definition; expected "field_name: field_type" [misc] typeddicts_class_syntax.py:39: error: Invalid statement in TypedDict definition; expected "field_name: field_type" [misc] -typeddicts_class_syntax.py:45: error: Unexpected keyword argument "metaclass" for "__init_subclass__" of "TypedDict" [call-arg] -typeddicts_class_syntax.py:50: error: Unexpected keyword argument "other" for "__init_subclass__" of "TypedDict" [call-arg] -typeddicts_class_syntax.py:58: error: Invalid statement in TypedDict definition; expected "field_name: field_type" [misc] -typeddicts_class_syntax.py:60: error: Invalid statement in TypedDict definition; expected "field_name: field_type" [misc] -typeddicts_class_syntax.py:64: error: Extra key "y" for TypedDict "ConditionalField" [typeddict-unknown-key] -typeddicts_class_syntax.py:65: error: Extra keys ("y", "z") for TypedDict "ConditionalField" [typeddict-unknown-key] +typeddicts_class_syntax.py:49: error: Unexpected keyword argument "metaclass" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_class_syntax.py:54: error: Unexpected keyword argument "other" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_class_syntax.py:62: error: Invalid statement in TypedDict definition; expected "field_name: field_type" [misc] +typeddicts_class_syntax.py:64: error: Invalid statement in TypedDict definition; expected "field_name: field_type" [misc] +typeddicts_class_syntax.py:68: error: Extra key "y" for TypedDict "ConditionalField" [typeddict-unknown-key] +typeddicts_class_syntax.py:69: error: Extra keys ("y", "z") for TypedDict "ConditionalField" [typeddict-unknown-key] """ conformance_automated = "Fail" errors_diff = """ -Line 58: Unexpected errors ['typeddicts_class_syntax.py:58: error: Invalid statement in TypedDict definition; expected "field_name: field_type" [misc]'] -Line 60: Unexpected errors ['typeddicts_class_syntax.py:60: error: Invalid statement in TypedDict definition; expected "field_name: field_type" [misc]'] -Line 64: Unexpected errors ['typeddicts_class_syntax.py:64: error: Extra key "y" for TypedDict "ConditionalField" [typeddict-unknown-key]'] +Line 62: Unexpected errors ['typeddicts_class_syntax.py:62: error: Invalid statement in TypedDict definition; expected "field_name: field_type" [misc]'] +Line 64: Unexpected errors ['typeddicts_class_syntax.py:64: error: Invalid statement in TypedDict definition; expected "field_name: field_type" [misc]'] +Line 68: Unexpected errors ['typeddicts_class_syntax.py:68: error: Extra key "y" for TypedDict "ConditionalField" [typeddict-unknown-key]'] """ diff --git a/conformance/results/pycroscope/typeddicts_class_syntax.toml b/conformance/results/pycroscope/typeddicts_class_syntax.toml index 9e883248c..049715347 100644 --- a/conformance/results/pycroscope/typeddicts_class_syntax.toml +++ b/conformance/results/pycroscope/typeddicts_class_syntax.toml @@ -5,7 +5,7 @@ output = """ ./typeddicts_class_syntax.py:30:4: Methods are not allowed in TypedDict definitions [invalid_typeddict] ./typeddicts_class_syntax.py:35:4: Methods are not allowed in TypedDict definitions [invalid_typeddict] ./typeddicts_class_syntax.py:40:4: Methods are not allowed in TypedDict definitions [invalid_typeddict] -./typeddicts_class_syntax.py:45:31: TypedDict definitions cannot specify a metaclass [invalid_typeddict] -./typeddicts_class_syntax.py:50:31: Unexpected keyword argument 'other' in TypedDict definition [invalid_typeddict] -./typeddicts_class_syntax.py:65:0: Got an unexpected keyword argument 'z' [incompatible_call] +./typeddicts_class_syntax.py:49:31: TypedDict definitions cannot specify a metaclass [invalid_typeddict] +./typeddicts_class_syntax.py:54:31: Unexpected keyword argument 'other' in TypedDict definition [invalid_typeddict] +./typeddicts_class_syntax.py:69:0: Got an unexpected keyword argument 'z' [incompatible_call] """ diff --git a/conformance/results/pyrefly/typeddicts_class_syntax.toml b/conformance/results/pyrefly/typeddicts_class_syntax.toml index 2917003cf..abea056d9 100644 --- a/conformance/results/pyrefly/typeddicts_class_syntax.toml +++ b/conformance/results/pyrefly/typeddicts_class_syntax.toml @@ -6,7 +6,7 @@ output = """ ERROR typeddicts_class_syntax.py:30:9-16: TypedDict members must be declared in the form `field: Annotation` with no assignment [bad-class-definition] ERROR typeddicts_class_syntax.py:35:9-16: TypedDict members must be declared in the form `field: Annotation` with no assignment [bad-class-definition] ERROR typeddicts_class_syntax.py:40:9-16: TypedDict members must be declared in the form `field: Annotation` with no assignment [bad-class-definition] -ERROR typeddicts_class_syntax.py:45:7-20: Metaclass of `BadTypedDict2` has type `type[Any]` that is not a simple class type [invalid-inheritance] -ERROR typeddicts_class_syntax.py:50:7-20: TypedDict does not support keyword argument `other` [bad-typed-dict] -ERROR typeddicts_class_syntax.py:65:17-32: No matching overload found for function `ConditionalField.__init__` called with arguments: (x=Literal[1], y=Literal[2], z=Literal[3]) [no-matching-overload] +ERROR typeddicts_class_syntax.py:49:7-20: Typed dictionary definitions may not specify a metaclass [invalid-inheritance] +ERROR typeddicts_class_syntax.py:54:7-20: TypedDict does not support keyword argument `other` [bad-typed-dict] +ERROR typeddicts_class_syntax.py:69:17-32: No matching overload found for function `ConditionalField.__init__` called with arguments: (x=Literal[1], y=Literal[2], z=Literal[3]) [no-matching-overload] """ diff --git a/conformance/results/pyright/typeddicts_class_syntax.toml b/conformance/results/pyright/typeddicts_class_syntax.toml index b1c81614c..b8d248caf 100644 --- a/conformance/results/pyright/typeddicts_class_syntax.toml +++ b/conformance/results/pyright/typeddicts_class_syntax.toml @@ -6,15 +6,15 @@ output = """ typeddicts_class_syntax.py:30:5 - error: TypedDict classes can contain only type annotations (reportGeneralTypeIssues) typeddicts_class_syntax.py:34:5 - error: TypedDict classes can contain only type annotations (reportGeneralTypeIssues) typeddicts_class_syntax.py:39:5 - error: TypedDict classes can contain only type annotations (reportGeneralTypeIssues) -typeddicts_class_syntax.py:45:32 - error: TypedDict does not support __init_subclass__ parameter "metaclass" (reportGeneralTypeIssues) -typeddicts_class_syntax.py:50:32 - error: TypedDict does not support __init_subclass__ parameter "other" (reportGeneralTypeIssues) -typeddicts_class_syntax.py:58:5 - error: TypedDict classes can contain only type annotations (reportGeneralTypeIssues) -typeddicts_class_syntax.py:60:5 - error: TypedDict classes can contain only type annotations (reportGeneralTypeIssues) -typeddicts_class_syntax.py:65:1 - error: No overloads for "__init__" match the provided arguments +typeddicts_class_syntax.py:49:32 - error: TypedDict does not support __init_subclass__ parameter "metaclass" (reportGeneralTypeIssues) +typeddicts_class_syntax.py:54:32 - error: TypedDict does not support __init_subclass__ parameter "other" (reportGeneralTypeIssues) +typeddicts_class_syntax.py:62:5 - error: TypedDict classes can contain only type annotations (reportGeneralTypeIssues) +typeddicts_class_syntax.py:64:5 - error: TypedDict classes can contain only type annotations (reportGeneralTypeIssues) +typeddicts_class_syntax.py:69:1 - error: No overloads for "__init__" match the provided arguments   Argument types: (Literal[1], Literal[2], Literal[3]) (reportCallIssue) """ conformance_automated = "Fail" errors_diff = """ -Line 58: Unexpected errors ['typeddicts_class_syntax.py:58:5 - error: TypedDict classes can contain only type annotations (reportGeneralTypeIssues)'] -Line 60: Unexpected errors ['typeddicts_class_syntax.py:60:5 - error: TypedDict classes can contain only type annotations (reportGeneralTypeIssues)'] +Line 62: Unexpected errors ['typeddicts_class_syntax.py:62:5 - error: TypedDict classes can contain only type annotations (reportGeneralTypeIssues)'] +Line 64: Unexpected errors ['typeddicts_class_syntax.py:64:5 - error: TypedDict classes can contain only type annotations (reportGeneralTypeIssues)'] """ diff --git a/conformance/results/ty/typeddicts_class_syntax.toml b/conformance/results/ty/typeddicts_class_syntax.toml index ccf44582f..86d0c210c 100644 --- a/conformance/results/ty/typeddicts_class_syntax.toml +++ b/conformance/results/ty/typeddicts_class_syntax.toml @@ -8,7 +8,7 @@ output = """ typeddicts_class_syntax.py:30:5: error[invalid-typed-dict-statement] TypedDict class cannot have methods typeddicts_class_syntax.py:34:5: error[invalid-typed-dict-statement] TypedDict class cannot have methods typeddicts_class_syntax.py:39:5: error[invalid-typed-dict-statement] TypedDict class cannot have methods -typeddicts_class_syntax.py:45:32: error[invalid-typed-dict-header] Custom metaclasses are not supported in `TypedDict` definitions -typeddicts_class_syntax.py:50:32: error[unknown-argument] Unknown keyword argument `other` in `TypedDict` definition -typeddicts_class_syntax.py:65:28: error[invalid-key] Unknown key "z" for TypedDict `ConditionalField` +typeddicts_class_syntax.py:49:32: error[invalid-typed-dict-header] Custom metaclasses are not supported in `TypedDict` definitions +typeddicts_class_syntax.py:54:32: error[unknown-argument] Unknown keyword argument `other` in `TypedDict` definition +typeddicts_class_syntax.py:69:28: error[invalid-key] Unknown key "z" for TypedDict `ConditionalField` """ diff --git a/conformance/results/zuban/typeddicts_class_syntax.toml b/conformance/results/zuban/typeddicts_class_syntax.toml index 8c8f09a9e..ff31335d0 100644 --- a/conformance/results/zuban/typeddicts_class_syntax.toml +++ b/conformance/results/zuban/typeddicts_class_syntax.toml @@ -5,7 +5,7 @@ output = """ typeddicts_class_syntax.py:30: error: Invalid statement in TypedDict definition; expected "field_name: field_type" [misc] typeddicts_class_syntax.py:34: error: Invalid statement in TypedDict definition; expected "field_name: field_type" [misc] typeddicts_class_syntax.py:39: error: Invalid statement in TypedDict definition; expected "field_name: field_type" [misc] -typeddicts_class_syntax.py:45: error: Unexpected keyword argument "metaclass" for "TypedDict" [call-arg] -typeddicts_class_syntax.py:50: error: Unexpected keyword argument "other" for "TypedDict" [call-arg] -typeddicts_class_syntax.py:65: error: Extra key "z" for TypedDict "ConditionalField" [typeddict-unknown-key] +typeddicts_class_syntax.py:49: error: Unexpected keyword argument "metaclass" for "TypedDict" [call-arg] +typeddicts_class_syntax.py:54: error: Unexpected keyword argument "other" for "TypedDict" [call-arg] +typeddicts_class_syntax.py:69: error: Extra key "z" for TypedDict "ConditionalField" [typeddict-unknown-key] """ diff --git a/conformance/tests/typeddicts_class_syntax.py b/conformance/tests/typeddicts_class_syntax.py index 923bf1552..b2ebf12b6 100644 --- a/conformance/tests/typeddicts_class_syntax.py +++ b/conformance/tests/typeddicts_class_syntax.py @@ -41,8 +41,12 @@ def method3(): # E[method3] pass -# > Specifying a metaclass is not allowed. -class BadTypedDict2(TypedDict, metaclass=type): # E +class CustomMeta(type): + pass + + +# > Specifying a custom metaclass is not allowed. +class BadTypedDict2(TypedDict, metaclass=CustomMeta): # E name: str From 0dc9b5d23b368713af33ac25338eeb08b80f6360 Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Mon, 3 Aug 2026 21:42:32 -0400 Subject: [PATCH 267/308] Update ty results for v0.0.66 (#2329) --- conformance/results/results.html | 29 ++++---------- .../ty/generics_defaults_specialization.toml | 8 +--- .../ty/generics_paramspec_components.toml | 8 +--- .../ty/generics_typevartuple_basic.toml | 8 +--- conformance/results/ty/narrowing_typeis.toml | 6 +-- conformance/results/ty/version.toml | 2 +- conformance/uv.lock | 38 +++++++++---------- 7 files changed, 35 insertions(+), 64 deletions(-) diff --git a/conformance/results/results.html b/conformance/results/results.html index b29a7ceee..1cf9ae0c5 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -269,7 +269,7 @@

    Python Type System Conformance Test Results

    - + @@ -612,12 +612,7 @@

    Python Type System Conformance Test Results

  • Allows incorrect assignment to type[].
  • - + @@ -637,12 +632,7 @@

    Python Type System Conformance Test Results

    - + @@ -877,12 +867,7 @@

    Python Type System Conformance Test Results

  • Does not correctly solve TypeVarTuple with heterogeneous bounds.
  • - + @@ -993,7 +978,7 @@

    Python Type System Conformance Test Results

    - + @@ -2572,7 +2557,7 @@

    Python Type System Conformance Test Results

    @@ -2796,7 +2781,7 @@

    Python Type System Conformance Test Results

    - + diff --git a/conformance/results/ty/generics_defaults_specialization.toml b/conformance/results/ty/generics_defaults_specialization.toml index 062e89daa..0a1b822e0 100644 --- a/conformance/results/ty/generics_defaults_specialization.toml +++ b/conformance/results/ty/generics_defaults_specialization.toml @@ -1,12 +1,8 @@ -conformance_automated = "Fail" -conformant = "Partial" -notes = """ -Does not reject subscription of an already-specialized generic class. -""" +conformance_automated = "Pass" errors_diff = """ -Line 56: Expected 1 errors """ output = """ generics_defaults_specialization.py:30:15: error[invalid-type-arguments] Too many type arguments: expected between 0 and 1, got 2 generics_defaults_specialization.py:46:22: error[invalid-assignment] Object of type `` is not assignable to `type[Bar[int]]` +generics_defaults_specialization.py:56:1: error[not-subscriptable] Cannot specialize non-generic class `Foo` """ diff --git a/conformance/results/ty/generics_paramspec_components.toml b/conformance/results/ty/generics_paramspec_components.toml index 62d774713..ee8fe254b 100644 --- a/conformance/results/ty/generics_paramspec_components.toml +++ b/conformance/results/ty/generics_paramspec_components.toml @@ -1,10 +1,5 @@ -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. -""" +conformance_automated = "Pass" errors_diff = """ -Line 30: 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`? @@ -13,6 +8,7 @@ generics_paramspec_components.py:20:23: error[invalid-paramspec] `P.args` is onl generics_paramspec_components.py:23:46: error[invalid-paramspec] `*args: P.args` must be accompanied by `**kwargs: P.kwargs` generics_paramspec_components.py:23:46: error[invalid-type-form] `P.args` is valid only in `*args` annotation: Did you mean `P.kwargs`? generics_paramspec_components.py:26:46: error[invalid-paramspec] `*args: P.args` must be accompanied by `**kwargs: P.kwargs` +generics_paramspec_components.py:30:25: error[unbound-type-variable] ParamSpec `P` is not in scope generics_paramspec_components.py:35:18: error[invalid-paramspec] `P.args` is only valid for annotating `*args` function parameters generics_paramspec_components.py:36:20: error[invalid-paramspec] `P.kwargs` is only valid for annotating `**kwargs` function parameters generics_paramspec_components.py:38:26: error[invalid-paramspec] `*args: P.args` must be accompanied by `**kwargs: P.kwargs` diff --git a/conformance/results/ty/generics_typevartuple_basic.toml b/conformance/results/ty/generics_typevartuple_basic.toml index a449cf6f9..a619e2137 100644 --- a/conformance/results/ty/generics_typevartuple_basic.toml +++ b/conformance/results/ty/generics_typevartuple_basic.toml @@ -1,10 +1,5 @@ -conformance_automated = "Fail" -conformant = "Partial" -notes = """ -Incorrectly reports an unbound `TypeVarTuple` for a correctly unpacked annotation within an otherwise invalid generic class. -""" +conformance_automated = "Pass" errors_diff = """ -Line 54: Unexpected errors ['generics_typevartuple_basic.py:54:29: error[unbound-type-variable] Type variable `Shape` is not bound to any outer generic context'] """ output = """ generics_typevartuple_basic.py:42:28: error[invalid-assignment] Object of type `Array[Shape@Array]` is not assignable to `Array[Height, Width]` @@ -14,7 +9,6 @@ generics_typevartuple_basic.py:43:41: error[invalid-argument-type] Argument to ` generics_typevartuple_basic.py:44:41: error[invalid-assignment] Object of type `Array[Time, Batch, Width, Height]` is not assignable to `Array[Time, Batch, Height, Width]` generics_typevartuple_basic.py:52:14: error[invalid-generic-class] `TypeVarTuple` must be unpacked with `*` or `Unpack[]` when used as an argument to `Generic` generics_typevartuple_basic.py:53:37: error[invalid-type-form] Bare TypeVarTuple `Shape` is not valid in this context in a parameter annotation -generics_typevartuple_basic.py:54:29: error[unbound-type-variable] Type variable `Shape` is not bound to any outer generic context generics_typevartuple_basic.py:56:34: error[invalid-type-form] Bare TypeVarTuple `Shape` is not valid in this context in a return type annotation generics_typevartuple_basic.py:59:24: error[invalid-type-form] Bare TypeVarTuple `Shape` is not valid in this context in a parameter annotation generics_typevartuple_basic.py:65:27: error[invalid-legacy-type-variable] The `covariant` parameter of `typing.TypeVarTuple` was added in Python 3.15 diff --git a/conformance/results/ty/narrowing_typeis.toml b/conformance/results/ty/narrowing_typeis.toml index 7abfa5ba8..936ee07ac 100644 --- a/conformance/results/ty/narrowing_typeis.toml +++ b/conformance/results/ty/narrowing_typeis.toml @@ -1,13 +1,13 @@ conformance_automated = "Fail" conformant = "Partial" notes = """ -Intersects the pre-existing type with the top materialization of the bracketed type rather than the bracketed type itself. +Does not fully simplify the negative branch of `TypeIs` narrowing for a union of fixed-length tuple types. """ errors_diff = """ -Line 35: Unexpected errors ['narrowing_typeis.py:35:18: error[invalid-assignment] Object of type `object` is not assignable to `int`'] +Line 21: Unexpected errors ['narrowing_typeis.py:21:9: error[type-assertion-failure] Type `(tuple[str, str] & ~tuple[Unknown, Unknown]) | tuple[str, str, str]` does not match asserted type `tuple[str, str, str]`'] """ output = """ -narrowing_typeis.py:35:18: error[invalid-assignment] Object of type `object` is not assignable to `int` +narrowing_typeis.py:21:9: error[type-assertion-failure] Type `(tuple[str, str] & ~tuple[Unknown, Unknown]) | tuple[str, str, str]` does not match asserted type `tuple[str, str, str]` narrowing_typeis.py:110:23: error[invalid-type-guard-definition] `TypeIs` function must have a parameter to narrow narrowing_typeis.py:115:22: error[invalid-type-guard-definition] `TypeIs` function must have a parameter to narrow narrowing_typeis.py:137:20: error[invalid-argument-type] Argument to function `takes_callable_str` is incorrect: Expected `(object, /) -> str`, found `def simple_typeguard(val: object) -> TypeIs[int]` diff --git a/conformance/results/ty/version.toml b/conformance/results/ty/version.toml index aadb7ee88..c0765278e 100644 --- a/conformance/results/ty/version.toml +++ b/conformance/results/ty/version.toml @@ -1 +1 @@ -version = "ty 0.0.65" +version = "ty 0.0.66" diff --git a/conformance/uv.lock b/conformance/uv.lock index 4f1e8d2c5..17097bc05 100644 --- a/conformance/uv.lock +++ b/conformance/uv.lock @@ -214,27 +214,27 @@ wheels = [ [[package]] name = "ty" -version = "0.0.65" +version = "0.0.66" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/d6/54/cf561927e8e9ab5c1892a833b664aa9cd6f051a75f6280c66d8047246bda/ty-0.0.65.tar.gz", hash = "sha256:b7134bffcc00b715fa8291e84d845782ced810a998dc1f7f11d71c85c4046325", size = 6460098, upload-time = "2026-07-29T18:31:03.27Z" } +sdist = { url = "https://files.pythonhosted.org/packages/cd/58/4f6ab2a86589e422a3cf840bcf6114c565e4c39ddf4d0b7cd328af5b52b4/ty-0.0.66.tar.gz", hash = "sha256:24bddd4479ce445b51ac015410dd2d34af1cadd62a77f5b3cb269149ed83f9b5", size = 6520402, upload-time = "2026-08-04T01:09:47.714Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/7b/4e/71e2d325d2b53a1afad81624ad076b2ede413213fc4a18cb05b78c568571/ty-0.0.65-py3-none-linux_armv6l.whl", hash = "sha256:dc556c9f05408bef4c4ef02b2cc382e4e5f797b4b20d64410289848f0d76705f", size = 12298466, upload-time = "2026-07-29T18:30:12.744Z" }, - { url = "https://files.pythonhosted.org/packages/57/77/fec8f29647c55794efa430a7f365e44f5ce7ffb6459d9445a87fac569bec/ty-0.0.65-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:29d2e0d34cc0a28a17ef0cf81135c5ebabc3562131f9079138ba5e7bae0f56bd", size = 11942421, upload-time = "2026-07-29T18:30:16.076Z" }, - { url = "https://files.pythonhosted.org/packages/13/09/7f3766aef9dc627e2698cf4e3e59cf53389dcae3812040d33c1aa931230f/ty-0.0.65-py3-none-macosx_11_0_arm64.whl", hash = "sha256:685f49a9312bbf69d5b65bbb66384fed1f927403ea030c217b9289092d7e46c4", size = 11451922, upload-time = "2026-07-29T18:30:19.155Z" }, - { url = "https://files.pythonhosted.org/packages/cb/7b/1a77cd50e0befb50f55b8bf9bd3ed3eddf184bf28c61b56727039e0774fc/ty-0.0.65-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6f564b5ebe78e2f3a8e7b8eacb1292eb88b7c0f3c8630671cfca31abc0709cd9", size = 11994999, upload-time = "2026-07-29T18:30:22.315Z" }, - { url = "https://files.pythonhosted.org/packages/63/7b/feda16f3a4a0a99be27431e0c9598eeeec0db1eb2fec9a15976698209418/ty-0.0.65-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:c983e156fe9e113fb56389e13d327b6b8549fe866de9b269684723a88e9b732d", size = 12090662, upload-time = "2026-07-29T18:30:24.93Z" }, - { url = "https://files.pythonhosted.org/packages/ed/3e/3f69bf9c9307dbdc0771719f65ce5b556e7bdeeaccbdd599d4f57866d801/ty-0.0.65-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e3663b7396e8b1a9954e20e732de7ccb0192bf4118473069b4945920d6923921", size = 12822094, upload-time = "2026-07-29T18:30:28.012Z" }, - { url = "https://files.pythonhosted.org/packages/90/38/8fa791b3bb503ee2b46ad81690cd1bdd54519582df6d805cee57fe143e85/ty-0.0.65-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:306ed01f29d6e108e98feb233dbbf5878a027603b71bd3743b343977933a9f16", size = 13357833, upload-time = "2026-07-29T18:30:31.122Z" }, - { url = "https://files.pythonhosted.org/packages/c1/73/4dda396a201e1dd0ed3594a9b48e559cb41c4bc048c6cd4c4d1b39eb4313/ty-0.0.65-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:28bcfc8898c94f079a9100e684bcf312b6a64ad3a7d4ebb35a4591546030a2cd", size = 12977303, upload-time = "2026-07-29T18:30:33.944Z" }, - { url = "https://files.pythonhosted.org/packages/a5/26/c250c2c569adc53a8591716641388397bcb2a442e4a30b952ae81b50c0e0/ty-0.0.65-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5a75bd0c245c38802a8f488378e74f92feb7dd33db7d63fbdd6fdf82791ba730", size = 12579338, upload-time = "2026-07-29T18:30:37.199Z" }, - { url = "https://files.pythonhosted.org/packages/d3/94/4a5647d44753ca218fc930d7e4d9bf468d0ed4a0ad4b3d57588bc1bbacf7/ty-0.0.65-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:9e5e1bdea9662d2b5312b4e99f319f4e6e2ea427511b5fbc546141b79ec53f76", size = 12957731, upload-time = "2026-07-29T18:30:39.937Z" }, - { url = "https://files.pythonhosted.org/packages/36/b6/1e22fa11a1e0dfb20b1c7f3cbfd8170273aada2a82f9ecd3055275370c44/ty-0.0.65-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:03a88493d4842889f65280ae241e06b399d57eb3c63571054cad21a4c33b3b69", size = 11938625, upload-time = "2026-07-29T18:30:42.603Z" }, - { url = "https://files.pythonhosted.org/packages/5c/0a/fe5f22ef62b193201bc5566762e22049762cd485bfafb5095a7050760054/ty-0.0.65-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:600b8bf6f4940cf7ffb2f43d3716faaf38dcb97cd8617c55771451bc0276408f", size = 12105592, upload-time = "2026-07-29T18:30:45.419Z" }, - { url = "https://files.pythonhosted.org/packages/76/fd/922b3a6e9d697452cdbb4b7e3f636868add5ec652154518a736e4364f3b7/ty-0.0.65-py3-none-musllinux_1_2_i686.whl", hash = "sha256:0c28007bc79d648c1ddaf1e65885d07baec48eb87240da442f608e4107c1b7d8", size = 12387335, upload-time = "2026-07-29T18:30:48.405Z" }, - { url = "https://files.pythonhosted.org/packages/77/22/a1a08ebc84c083db2fb55e3b5cd186db0c067692f4921146f601360231e2/ty-0.0.65-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:c852da96091ad22361e6586b7c7ba98e1334dcd4d8ffb67e47f4fb673de33f77", size = 12682710, upload-time = "2026-07-29T18:30:51.364Z" }, - { url = "https://files.pythonhosted.org/packages/81/14/eaaa410a25bbdea19722109b5422380a0e211b3afcf3071d15953ddbd5db/ty-0.0.65-py3-none-win32.whl", hash = "sha256:cf529d538f1403b14b0511e6ec3cdb95d3d974adabf24cc76cedc533368c3edc", size = 11692341, upload-time = "2026-07-29T18:30:54.35Z" }, - { url = "https://files.pythonhosted.org/packages/bc/0f/6d48f206dce9d7e53fe3b5ea0f0ab5800dd9d2365b2b48f736783436c43f/ty-0.0.65-py3-none-win_amd64.whl", hash = "sha256:234a321e33c7cbbfbd67bfa0b01b685dd9c21f1841781a21e5ca1fa0b25f1d5d", size = 12729355, upload-time = "2026-07-29T18:30:57.275Z" }, - { url = "https://files.pythonhosted.org/packages/96/aa/7446f7725e303cf78e058c893af1f0552b9451895454908706f4c6c3494b/ty-0.0.65-py3-none-win_arm64.whl", hash = "sha256:b9424be1ec56d93ff18609fb1c0a0a2283fe1282cd6d1c7604f97d73b94d61f2", size = 12051375, upload-time = "2026-07-29T18:31:00.579Z" }, + { url = "https://files.pythonhosted.org/packages/45/4d/bbc28310d6d887ef73e5800f062c4bf54caa35a1b47d70c7b03d0515ecf1/ty-0.0.66-py3-none-linux_armv6l.whl", hash = "sha256:8b46450438b54b732338e4d7a78a7d2f5e1a012a13d77d121aacaca20fb814e2", size = 12409743, upload-time = "2026-08-04T01:09:01.229Z" }, + { url = "https://files.pythonhosted.org/packages/73/4e/c3d2eb2242fa0a2ef445ca2c7009dc9118e5b3dcb8b8a8bec70d58c8e4bc/ty-0.0.66-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:8e4adbe662bc3c62b52b83d46b07f703fdc3c123bb72601606c58be5ea017ed3", size = 12078362, upload-time = "2026-08-04T01:09:04.233Z" }, + { url = "https://files.pythonhosted.org/packages/fa/ba/7a4b5e45d701a8de6b714dacf6ffca91b0411baaceaa781d494037623a18/ty-0.0.66-py3-none-macosx_11_0_arm64.whl", hash = "sha256:776814351735847eb934f9a3cbea21d2278ba14aa0fc099f683da11bc2d5c90a", size = 11583289, upload-time = "2026-08-04T01:09:06.973Z" }, + { url = "https://files.pythonhosted.org/packages/4a/4a/fbb1f71ee2999f981f8c4b3b139231e4bcff4ede0c3b37e858fd1334ed26/ty-0.0.66-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cca1da877f613965b954bfd22d495386e260ec767c5536c8022cca98a260ea5d", size = 12137274, upload-time = "2026-08-04T01:09:09.592Z" }, + { url = "https://files.pythonhosted.org/packages/d5/07/9e0662f6603a5ac171ae6b314396e677ead4b45695fc948efb0a4837051f/ty-0.0.66-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:aa523e777bc36c0fbf8ded5844096f46cbfc3712fe5a003351a94259b7e86cf4", size = 12207047, upload-time = "2026-08-04T01:09:12.533Z" }, + { url = "https://files.pythonhosted.org/packages/bb/cc/12e01bc2ea47fa7bf20fc6cdd3249d6a340be9be4edc52b1d77256245dd0/ty-0.0.66-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3f7993c1f95f80a4e44056e6aaf8e46e608d778db131ae5ce59262ab59358f9a", size = 12919304, upload-time = "2026-08-04T01:09:15.175Z" }, + { url = "https://files.pythonhosted.org/packages/75/88/c6c0d3a8e71c9cdb560cc5c627a4bba6c47b5eec460b2f8c449b57c6d03a/ty-0.0.66-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f9b29354bcbac9f53b6952d8f46789bd81eeb9bdd7a68df7d26e654ca7498c3c", size = 13470963, upload-time = "2026-08-04T01:09:17.849Z" }, + { url = "https://files.pythonhosted.org/packages/27/c2/2f8c18063412ad80e1b3f87afce7bd50982b4a048166607b67f80660a9fb/ty-0.0.66-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:fbf4e5325f7f584d9c346946e7c415b2e3cd3b8f1119d468082a90a6afd020ce", size = 13244773, upload-time = "2026-08-04T01:09:20.59Z" }, + { url = "https://files.pythonhosted.org/packages/ed/f6/fdae2b95831116dffc055ad53a99a8f21437263651047b3ad46def4950a3/ty-0.0.66-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7bd304363764bd723c22fb20b17035c345420fdf66fee856934b158ebde08a91", size = 12751343, upload-time = "2026-08-04T01:09:23.225Z" }, + { url = "https://files.pythonhosted.org/packages/14/1e/7e75f0371d11463a256dc2bee98b0df401e0fa06021e200b8b601d21949d/ty-0.0.66-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:205d8589bd957ea9718d488b731b2fbdd0d1b1cefd37c79f52c0deb7cafddfef", size = 13068057, upload-time = "2026-08-04T01:09:26.052Z" }, + { url = "https://files.pythonhosted.org/packages/b4/84/f20f24518f6f0bea936e2e668ede250b9ce0774624559931599bd1f42772/ty-0.0.66-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:7304a1df54741a2343801354f41d7ad87974acb541ee3e93c26cb6a1a0b863af", size = 12082318, upload-time = "2026-08-04T01:09:28.877Z" }, + { url = "https://files.pythonhosted.org/packages/08/20/70ca0eac2427d4a58a81a3a9426b20e46fb4a5a13aefc9edc2e5172e1243/ty-0.0.66-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:cf2c062863e5da0f588b0b120fec0da2e81c0913ee4cd07b50d77aa60ffd8deb", size = 12228978, upload-time = "2026-08-04T01:09:31.905Z" }, + { url = "https://files.pythonhosted.org/packages/7c/01/5a461ab34456d788248780830aed673c9e0e796f6e9dd92d3dbf02e04d7f/ty-0.0.66-py3-none-musllinux_1_2_i686.whl", hash = "sha256:a58d32c879d86428978332adf21e85009ec269314a23d330c3483c65b57aedc7", size = 12471917, upload-time = "2026-08-04T01:09:34.418Z" }, + { url = "https://files.pythonhosted.org/packages/46/ed/f8eb5eff7c9ee644490c6d2626425935c097acc54871adf659ea70624a2c/ty-0.0.66-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:b2f810fa3516c977630d78dbe9161592b3c27029fa9bb81074366624d9b5e4b6", size = 12858086, upload-time = "2026-08-04T01:09:37.602Z" }, + { url = "https://files.pythonhosted.org/packages/02/7f/8a78361f752274a550a7f6f07f127b246ece7d7fdde31121d22074e46eab/ty-0.0.66-py3-none-win32.whl", hash = "sha256:d28c3df565a387c1c5ea359aa452a46d19163616ef71be819058a424a62f1ae1", size = 11782494, upload-time = "2026-08-04T01:09:40.136Z" }, + { url = "https://files.pythonhosted.org/packages/7d/e2/deed22b823ce309b8410d50414fd15afe9e90aee8b8ca04789ba55c21231/ty-0.0.66-py3-none-win_amd64.whl", hash = "sha256:e3a457f3312c078f24c47d0da6e4f73de34d0a77ed2de22571c066c80b2fd5e7", size = 12893338, upload-time = "2026-08-04T01:09:42.825Z" }, + { url = "https://files.pythonhosted.org/packages/f9/ce/6c828f42ef1ed39f53f57f9c0cdcdf03e23666fa7a29d799042a2c34bcb4/ty-0.0.66-py3-none-win_arm64.whl", hash = "sha256:2f62ae247b9c75674fcc060635f9f00210357da7681de59234d97b50fb9e9e94", size = 12227381, upload-time = "2026-08-04T01:09:45.365Z" }, ] [[package]] From a4906624f170c169cf667f962080c56d5a5ba6ff Mon Sep 17 00:00:00 2001 From: Tobias Alex-Petersen Date: Tue, 4 Aug 2026 11:51:48 +0200 Subject: [PATCH 268/308] Conformance: broaden enum-expansion tests (#2324) * Add conformance test for full literal-union equivalency of enums The spec's Enum Literal Expansion section states that a type checker should treat a complete union of all literal members as equivalent to the enum type. Add test to cover cases failing in some checkers. Also refreshes all three quoted spec passages, which had drifted from the section as rewritten in a6eeccf ("new type system concepts section", Reported in python/typing#2323. * Update conformance results for the new enum expansion test Four checkers accept the full-literal-union equivalency and are unaffected: mypy, pyrefly, pycroscope and ty (mypy and ty remain "Partial" for the pre-existing `Flag` narrowing gap only). Three drop from "Pass" to "Partial": * pyright and zuban reject both the assignment and the `assert_type`. * basilisk rejects only the assignment; it reports the `assert_type` in test1 as redundant, so it does treat the two types as equivalent there. --- .../results/basilisk/enums_expansion.toml | 13 +++++--- conformance/results/mypy/enums_expansion.toml | 6 ++-- .../results/pycroscope/enums_expansion.toml | 2 +- .../results/pyrefly/enums_expansion.toml | 2 +- .../results/pyright/enums_expansion.toml | 16 +++++++-- conformance/results/results.html | 33 ++++++++++++++----- conformance/results/ty/enums_expansion.toml | 2 +- .../results/zuban/enums_expansion.toml | 14 ++++++-- conformance/tests/enums_expansion.py | 18 +++++++--- 9 files changed, 76 insertions(+), 30 deletions(-) diff --git a/conformance/results/basilisk/enums_expansion.toml b/conformance/results/basilisk/enums_expansion.toml index 8895a74ec..e4a77e027 100644 --- a/conformance/results/basilisk/enums_expansion.toml +++ b/conformance/results/basilisk/enums_expansion.toml @@ -1,8 +1,13 @@ -conformant = "Pass" -conformance_automated = "Pass" +conformant = "Partial" +notes = """ +Does not accept an enum-typed value where a complete union of all literal members is declared, although it treats the two as equivalent for `assert_type`. +""" +conformance_automated = "Fail" errors_diff = """ +Line 85: Unexpected errors ['enums_expansion.py:85:5: error: Type mismatch: `x` is annotated `Literal[Answer.Yes, Answer.No]` (answer.yes | answer.no) but assigned answer [assignment_compatibility]'] """ output = """ -enums_expansion.py:25:9: error: Redundant `assert_type` with `Literal[Color.GREEN]` on enum-typed parameter [enums_expansion] -enums_expansion.py:53:9: error: Redundant `assert_type` with `Literal[CustomFlags.FLAG3]` on enum-typed parameter [enums_expansion] +enums_expansion.py:28:9: error: Redundant `assert_type` with `Literal[Color.GREEN]` on enum-typed parameter [enums_expansion] +enums_expansion.py:56:9: error: Redundant `assert_type` with `Literal[CustomFlags.FLAG3]` on enum-typed parameter [enums_expansion] +enums_expansion.py:85:5: error: Type mismatch: `x` is annotated `Literal[Answer.Yes, Answer.No]` (answer.yes | answer.no) but assigned answer [assignment_compatibility] """ diff --git a/conformance/results/mypy/enums_expansion.toml b/conformance/results/mypy/enums_expansion.toml index 8b6a14aa0..b14b1afd2 100644 --- a/conformance/results/mypy/enums_expansion.toml +++ b/conformance/results/mypy/enums_expansion.toml @@ -4,9 +4,9 @@ Improperly applies narrowing to `Flag` subclass. """ conformance_automated = "Fail" errors_diff = """ -Line 53: Expected 1 errors -Line 52: Unexpected errors ['enums_expansion.py:52: error: Expression is of type "Literal[CustomFlags.FLAG3]", not "CustomFlags" [assert-type]'] +Line 56: Expected 1 errors +Line 55: Unexpected errors ['enums_expansion.py:55: error: Expression is of type "Literal[CustomFlags.FLAG3]", not "CustomFlags" [assert-type]'] """ output = """ -enums_expansion.py:52: error: Expression is of type "Literal[CustomFlags.FLAG3]", not "CustomFlags" [assert-type] +enums_expansion.py:55: error: Expression is of type "Literal[CustomFlags.FLAG3]", not "CustomFlags" [assert-type] """ diff --git a/conformance/results/pycroscope/enums_expansion.toml b/conformance/results/pycroscope/enums_expansion.toml index e12a9c12f..529ddb5b1 100644 --- a/conformance/results/pycroscope/enums_expansion.toml +++ b/conformance/results/pycroscope/enums_expansion.toml @@ -2,5 +2,5 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -./enums_expansion.py:53:20: enums_expansion.CustomFlags is not equivalent to Literal[] +./enums_expansion.py:56:20: enums_expansion.CustomFlags is not equivalent to Literal[] """ diff --git a/conformance/results/pyrefly/enums_expansion.toml b/conformance/results/pyrefly/enums_expansion.toml index bbf9ce7ce..7c27606f9 100644 --- a/conformance/results/pyrefly/enums_expansion.toml +++ b/conformance/results/pyrefly/enums_expansion.toml @@ -3,5 +3,5 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR enums_expansion.py:53:20-51: assert_type(CustomFlags, Literal[CustomFlags.FLAG3]) failed [assert-type] +ERROR enums_expansion.py:56:20-51: assert_type(CustomFlags, Literal[CustomFlags.FLAG3]) failed [assert-type] """ diff --git a/conformance/results/pyright/enums_expansion.toml b/conformance/results/pyright/enums_expansion.toml index 2a48dea06..ad3e5573a 100644 --- a/conformance/results/pyright/enums_expansion.toml +++ b/conformance/results/pyright/enums_expansion.toml @@ -1,7 +1,17 @@ -conformant = "Pass" -conformance_automated = "Pass" +conformant = "Partial" +notes = """ +Does not treat a complete union of all literal members as equivalent to the enum type. +""" +conformance_automated = "Fail" errors_diff = """ +Line 85: Unexpected errors ['enums_expansion.py:85:41 - error: Type "Answer" is not assignable to declared type "Literal[Answer.Yes, Answer.No]"'] +Line 86: Unexpected errors ['enums_expansion.py:86:17 - error: "assert_type" mismatch: expected "Literal[Answer.Yes, Answer.No]" but received "Answer" (reportAssertTypeFailure)'] """ output = """ -enums_expansion.py:53:21 - error: "assert_type" mismatch: expected "Literal[CustomFlags.FLAG3]" but received "CustomFlags" (reportAssertTypeFailure) +enums_expansion.py:56:21 - error: "assert_type" mismatch: expected "Literal[CustomFlags.FLAG3]" but received "CustomFlags" (reportAssertTypeFailure) +enums_expansion.py:85:41 - error: Type "Answer" is not assignable to declared type "Literal[Answer.Yes, Answer.No]" +  Type "Answer" is not assignable to type "Literal[Answer.Yes, Answer.No]" +    "Answer" is not assignable to type "Literal[Answer.Yes]" +    "Answer" is not assignable to type "Literal[Answer.No]" (reportAssignmentType) +enums_expansion.py:86:17 - error: "assert_type" mismatch: expected "Literal[Answer.Yes, Answer.No]" but received "Answer" (reportAssertTypeFailure) """ diff --git a/conformance/results/results.html b/conformance/results/results.html index 1cf9ae0c5..f39b8d2ac 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -2451,7 +2451,12 @@

    Python Type System Conformance Test Results

    - + + - - + @@ -2522,13 +2537,13 @@

    Python Type System Conformance Test Results

    - + + - - + @@ -2776,13 +2791,13 @@

    Python Type System Conformance Test Results

    - + - + - +
    basilisk 0.27.0 mypy 2.1.0 pycroscope 0.4.0 pyrefly 1.1.0
    + Type annotations
    Pass Pass PassPass
    annotations_forward_refsPass Partial
      @@ -326,6 +329,7 @@

      Python Type System Conformance Test Results

    annotations_generatorsPass Partial
      @@ -340,6 +344,7 @@

      Python Type System Conformance Test Results

    annotations_methodsPass Pass
      @@ -360,6 +365,7 @@

      Python Type System Conformance Test Results

    annotations_typeexpr PassPass Partial
      @@ -373,6 +379,7 @@

      Python Type System Conformance Test Results

    5 / 5 • 100.0% 4 / 5 • 80.0% 4 / 5 • 80.0% 4.5 / 5 • 90.0%
    + Type forms
    typeforms_typeformPass Partial
      @@ -408,6 +416,7 @@

      Python Type System Conformance Test Results

    1 / 1 • 100.0% 0.5 / 1 • 50.0% 0.5 / 1 • 50.0% 1 / 1 • 100.0%
    + Special types in annotations
    Pass Pass PassPass
    specialtypes_never PassPass Partial
      @@ -454,6 +465,7 @@

      Python Type System Conformance Test Results

    Pass Pass PassPass
    specialtypes_promotions Pass Pass PassPass
    specialtypes_typePass Partial
      @@ -487,6 +501,7 @@

      Python Type System Conformance Test Results

    5 / 5 • 100.0% 4.5 / 5 • 90.0% 4.5 / 5 • 90.0% 5 / 5 • 100.0%
    + Generics
    generics_base_classPass Partial
      @@ -521,6 +537,7 @@

      Python Type System Conformance Test Results

    Pass Pass PassPass Partial
      @@ -531,6 +548,7 @@

      Python Type System Conformance Test Results

    generics_defaultsPass Partial
      @@ -557,6 +575,7 @@

      Python Type System Conformance Test Results

    generics_defaults_referentialPass Partial
      @@ -576,6 +595,7 @@

      Python Type System Conformance Test Results

    generics_defaults_specializationPass Partial
      @@ -606,6 +626,7 @@

      Python Type System Conformance Test Results

    Pass Pass PassPass
    generics_paramspec_components Pass Pass PassPass Partial
      @@ -626,6 +648,7 @@

      Python Type System Conformance Test Results

    Pass Pass PassPass Pass
      @@ -643,11 +666,13 @@

      Python Type System Conformance Test Results

    Pass Pass PassPass
    generics_scoping Pass PassPass Partial
      @@ -666,6 +691,7 @@

      Python Type System Conformance Test Results

    generics_self_advancedPass Partial
      @@ -694,6 +720,7 @@

      Python Type System Conformance Test Results

    Pass Pass PassPass
    generics_self_basic Pass Pass PassPass
    generics_self_protocols Pass Pass PassPass
    generics_self_usage Pass Pass PassPass Partial
      @@ -735,6 +765,7 @@

      Python Type System Conformance Test Results

    Pass Pass PassPass
    generics_syntax_declarations Pass Pass PassPass
    generics_syntax_infer_variancePass Unsupported
      @@ -761,6 +794,7 @@

      Python Type System Conformance Test Results

    generics_syntax_scopingPass Partial
      @@ -780,6 +814,7 @@

      Python Type System Conformance Test Results

    generics_type_erasurePass Partial
      @@ -800,6 +835,7 @@

      Python Type System Conformance Test Results

    generics_typevartuple_argsPass Partial
      @@ -824,6 +860,7 @@

      Python Type System Conformance Test Results

    generics_typevartuple_basicPass Partial
      @@ -847,6 +884,7 @@

      Python Type System Conformance Test Results

    Pass Pass PassPass Unsupported Pass
    Pass Pass PassPass Unsupported Pass
    Pass Pass PassPass
    generics_typevartuple_specializationPass Partial
      @@ -889,11 +930,13 @@

      Python Type System Conformance Test Results

    Pass Pass PassPass Unsupported Pass
    generics_upper_boundPass Partial
      @@ -908,6 +951,7 @@

      Python Type System Conformance Test Results

    generics_variancePass Partial
      @@ -928,9 +972,11 @@

      Python Type System Conformance Test Results

    Pass Pass PassPass
    30 / 30 • 100.0% 23 / 30 • 76.7% 28.5 / 30 • 95.0% 29.5 / 30 • 98.3%
    + Type qualifiers
    qualifiers_annotatedPass Partial
      @@ -971,6 +1018,7 @@

      Python Type System Conformance Test Results

    qualifiers_final_annotationPass Partial
      @@ -994,9 +1042,11 @@

      Python Type System Conformance Test Results

    Pass Pass PassPass
    3 / 3 • 100.0% 2 / 3 • 66.7% 2.5 / 3 • 83.3% 3 / 3 • 100.0%
    + Class type compatibility
    classes_classvarPass Partial
      @@ -1036,9 +1087,11 @@

      Python Type System Conformance Test Results

    Pass Pass PassPass
    2 / 2 • 100.0% 1.5 / 2 • 75.0% 2 / 2 • 100.0% 2 / 2 • 100.0%
    + Type aliases
    aliases_explicitPass Partial
      @@ -1075,6 +1129,7 @@

      Python Type System Conformance Test Results

    aliases_implicit PassPass Partial
      @@ -1095,6 +1150,7 @@

      Python Type System Conformance Test Results

    aliases_newtypePass Partial
      @@ -1113,12 +1169,14 @@

      Python Type System Conformance Test Results

    Pass Pass PassPass Unsupported Pass
    aliases_type_statement PassPass Partial
      @@ -1138,6 +1196,7 @@

      Python Type System Conformance Test Results

    aliases_typealiastypePass Partial
      @@ -1172,9 +1231,11 @@

      Python Type System Conformance Test Results

    Pass Pass PassPass
    7 / 7 • 100.0% 5.5 / 7 • 78.6% 5.5 / 7 • 78.6% 7 / 7 • 100.0%
    + Literals
    literals_interactionsPass Pass
      @@ -1210,6 +1272,7 @@

      Python Type System Conformance Test Results

    literals_literalstringPass Unsupported
      @@ -1224,6 +1287,7 @@

      Python Type System Conformance Test Results

    literals_parameterizationsPass Partial
      @@ -1249,9 +1313,11 @@

      Python Type System Conformance Test Results

    Pass Pass PassPass
    4 / 4 • 100.0% 2.5 / 4 • 62.5% 3.5 / 4 • 87.5% 4 / 4 • 100.0%
    + Protocols
    protocols_class_objects PassPass Partial
      @@ -1290,6 +1357,7 @@

      Python Type System Conformance Test Results

    protocols_definitionPass Partial
      @@ -1313,6 +1381,7 @@

      Python Type System Conformance Test Results

    protocols_explicitPass Pass
      @@ -1334,6 +1403,7 @@

      Python Type System Conformance Test Results

    protocols_generic PassPass Partial
      @@ -1357,6 +1427,7 @@

      Python Type System Conformance Test Results

    Pass Pass PassPass Partial
      @@ -1371,6 +1442,7 @@

      Python Type System Conformance Test Results

    Pass Pass PassPass Partial
      @@ -1385,6 +1457,7 @@

      Python Type System Conformance Test Results

    Pass Pass PassPass Partial
      @@ -1395,6 +1468,7 @@

      Python Type System Conformance Test Results

    protocols_runtime_checkablePass Partial
      @@ -1420,6 +1494,7 @@

      Python Type System Conformance Test Results

    Pass Pass PassPass
    protocols_subtyping Pass Pass PassPass
    protocols_variance Pass Pass PassPass Unsupported Pass
    11 / 11 • 100.0% 10 / 11 • 90.9% 10 / 11 • 90.9% 11 / 11 • 100.0%
    + Callables
    callables_annotationPass Partial
      @@ -1482,6 +1561,7 @@

      Python Type System Conformance Test Results

    callables_kwargsPass Partial
      @@ -1502,6 +1582,7 @@

      Python Type System Conformance Test Results

    Pass Pass PassPass
    callables_subtyping Pass Pass PassPass
    4 / 4 • 100.0% 3 / 4 • 75.0% 4 / 4 • 100.0% 3.5 / 4 • 87.5%
    + Constructors
    constructors_call_initPass Partial
      @@ -1551,6 +1635,7 @@

      Python Type System Conformance Test Results

    constructors_call_metaclassPass Unsupported
      @@ -1566,6 +1651,7 @@

      Python Type System Conformance Test Results

    constructors_call_newPass Partial
      @@ -1582,6 +1668,7 @@

      Python Type System Conformance Test Results

    constructors_call_typePass Partial
      @@ -1601,6 +1688,7 @@

      Python Type System Conformance Test Results

    constructors_callablePass Partial
      @@ -1629,6 +1717,7 @@

      Python Type System Conformance Test Results

    constructors_consistencyPass Pass
      @@ -1643,6 +1732,7 @@

      Python Type System Conformance Test Results

    6 / 6 • 100.0% 3 / 6 • 50.0% 6 / 6 • 100.0% 5.5 / 6 • 91.7%
    + Overloads
    overloads_basic PassPass Partial
      @@ -1679,9 +1770,11 @@

      Python Type System Conformance Test Results

    Pass Pass PassPass
    overloads_definitionsPass Partial
      @@ -1696,6 +1789,7 @@

      Python Type System Conformance Test Results

    overloads_definitions_stubPass Partial
      @@ -1715,6 +1809,7 @@

      Python Type System Conformance Test Results

    overloads_evaluationPass Partial
      @@ -1738,6 +1833,7 @@

      Python Type System Conformance Test Results

    5 / 5 • 100.0% 3.5 / 5 • 70.0% 3.5 / 5 • 70.0% 5 / 5 • 100.0%
    + Exceptions
    exceptions_context_managers Pass PassPass Partial
      @@ -1770,6 +1867,7 @@

      Python Type System Conformance Test Results

    1 / 1 • 100.0% 1 / 1 • 100.0%1 / 1 • 100.0% 0.5 / 1 • 50.0% 1 / 1 • 100.0% 0 / 1 • 0.0%
    + Dataclasses
    dataclasses_descriptorsPass Partial
      @@ -1815,6 +1914,7 @@

      Python Type System Conformance Test Results

    dataclasses_finalPass Partial
      @@ -1836,9 +1936,11 @@

      Python Type System Conformance Test Results

    Pass Pass PassPass
    dataclasses_hashPass Unsupported
      @@ -1866,6 +1968,7 @@

      Python Type System Conformance Test Results

    Pass Pass PassPass
    dataclasses_kwonly Pass Pass PassPass
    dataclasses_match_args Pass Pass PassPass
    dataclasses_order Pass Pass PassPass
    dataclasses_postinit Pass Pass PassPass
    dataclasses_slotsPass Partial
      @@ -1930,9 +2038,11 @@

      Python Type System Conformance Test Results

    Pass Pass PassPass
    dataclasses_transform_converterPass Unsupported
      @@ -1947,6 +2057,7 @@

      Python Type System Conformance Test Results

    dataclasses_transform_fieldPass Partial
      @@ -1961,6 +2072,7 @@

      Python Type System Conformance Test Results

    dataclasses_transform_funcPass Partial
      @@ -1982,9 +2094,11 @@

      Python Type System Conformance Test Results

    Pass Pass PassPass
    dataclasses_usagePass Pass
      @@ -1999,6 +2113,7 @@

      Python Type System Conformance Test Results

    16 / 16 • 100.0% 11.5 / 16 • 71.9% 15.5 / 16 • 96.9% 15.5 / 16 • 96.9%
    + Typed dictionaries
    typeddicts_alt_syntaxPass Pass
      @@ -2029,6 +2145,7 @@

      Python Type System Conformance Test Results

    typeddicts_class_syntaxPass Partial
      @@ -2048,6 +2165,7 @@

      Python Type System Conformance Test Results

    typeddicts_extra_itemsPass Unsupported Pass Pass Pass Pass PassPass
    typeddicts_inheritance Pass Pass PassPass
    typeddicts_operations Pass Pass PassPass
    typeddicts_readonly Pass Pass PassPass
    typeddicts_readonly_consistency Pass Pass PassPass
    typeddicts_readonly_inheritancePass Partial
      @@ -2124,9 +2248,11 @@

      Python Type System Conformance Test Results

    Pass Pass PassPass
    typeddicts_readonly_updatePass Partial
      @@ -2148,10 +2274,12 @@

      Python Type System Conformance Test Results

    Pass Pass PassPass
    typeddicts_type_consistency PassPass Partial
      @@ -2171,9 +2299,11 @@

      Python Type System Conformance Test Results

    Pass Pass PassPass
    14 / 14 • 100.0% 11.5 / 14 • 82.1% 13.5 / 14 • 96.4% 14 / 14 • 100.0%
    + Tuples
    tuples_type_compatPass Partial
      @@ -2211,9 +2342,11 @@

      Python Type System Conformance Test Results

    Pass Pass PassPass
    tuples_unpackedPass Partial
      @@ -2228,6 +2361,7 @@

      Python Type System Conformance Test Results

    3 / 3 • 100.0% 2 / 3 • 66.7% 3 / 3 • 100.0% 3 / 3 • 100.0%
    + Named tuples
    namedtuples_define_classPass Partial
      @@ -2270,6 +2405,7 @@

      Python Type System Conformance Test Results

    Pass Pass PassPass
    namedtuples_type_compat Pass Pass PassPass
    namedtuples_usagePass Partial
      @@ -2296,6 +2434,7 @@

      Python Type System Conformance Test Results

    4 / 4 • 100.0% 3 / 4 • 75.0% 3.5 / 4 • 87.5% 4 / 4 • 100.0%
    + Enumerations
    Pass Pass PassPass
    enums_definition PassPass Partial
      @@ -2335,6 +2476,7 @@

      Python Type System Conformance Test Results

    enums_expansionPass Partial
      @@ -2354,6 +2496,7 @@

      Python Type System Conformance Test Results

    enums_member_namesPass Pass
      @@ -2368,6 +2511,7 @@

      Python Type System Conformance Test Results

    enums_member_valuesPass Partial
      @@ -2383,6 +2527,7 @@

      Python Type System Conformance Test Results

    enums_membersPass Partial
      @@ -2407,6 +2552,7 @@

      Python Type System Conformance Test Results

    6 / 6 • 100.0% 4.5 / 6 • 75.0% 5.5 / 6 • 91.7% 6 / 6 • 100.0%
    + Type narrowing
    Pass Pass PassPass
    narrowing_typeis Pass Pass PassPass Partial
      @@ -2450,13 +2598,14 @@

      Python Type System Conformance Test Results

    2 / 2 • 100.0% 2 / 2 • 100.0% 2 / 2 • 100.0%2 / 2 • 100.0% 1.5 / 2 • 75.0% 2 / 2 • 100.0%
    + Type checker directives
    Pass Pass PassPass
    directives_cast Pass Pass PassPass
    directives_deprecated Pass Pass PassPass Partial
      @@ -2497,6 +2649,7 @@

      Python Type System Conformance Test Results

    directives_disjoint_base PassPass Partial
      @@ -2515,6 +2668,7 @@

      Python Type System Conformance Test Results

    directives_no_type_checkPass Partial
      @@ -2541,6 +2695,7 @@

      Python Type System Conformance Test Results

    Pass Pass PassPass
    directives_type_checking Pass Pass PassPass
    directives_type_ignorePass Partial
      @@ -2573,6 +2730,7 @@

      Python Type System Conformance Test Results

    Pass Pass PassPass
    directives_type_ignore_file2 Pass Pass PassPass
    directives_version_platformPass Pass
      @@ -2600,6 +2760,7 @@

      Python Type System Conformance Test Results

    11 / 11 • 100.0% 10 / 11 • 90.9% 10.5 / 11 • 95.5% 11 / 11 • 100.0%
    + Historical and deprecated features
    historical_positionalPass Partial
      @@ -2632,6 +2794,7 @@

      Python Type System Conformance Test Results

    1 / 1 • 100.0% 0.5 / 1 • 50.0% 1 / 1 • 100.0% 1 / 1 • 100.0%
    141 / 141 • 100.0% 109 / 141 • 77.3% 130 / 141 • 92.2% 138 / 141 • 97.9%pycroscope 0.4.0 pyrefly 1.1.0 pyright 1.1.410ty 0.0.50ty 0.0.65 zuban 0.8.2
    Pass Partial
      -
    • Supports PEP-646 unpacked tuples but not TypeVarTuple.
    • +
    • Only partially supports TypeVarTuple in *args annotations.
    Pass Unsupported + Partial +
      +
    • Incorrectly reports an unbound TypeVarTuple for a correctly unpacked annotation within an otherwise invalid generic class.
    • +
    +
    Pass
    Pass Pass PassUnsupported + Partial +
      +
    • Does not correctly infer a TypeVarTuple that appears between fixed leading and trailing parameters in *args.
    • +
    +
    Pass
    Pass Pass PassUnsupportedPass Pass
    Pass Pass PassUnsupportedPass Pass
    Pass Pass PassUnsupportedPass Pass
    28.5 / 30 • 95.0% 29.5 / 30 • 98.3% 28.5 / 30 • 95.0%21 / 30 • 70.0%25 / 30 • 83.3% 30 / 30 • 100.0%
    Partial
      -
    • Does not reject circular definitions of type aliases.
    • -
    • Does not support type statements generic over TypeVarTuples.
    • +
    • Does not reject a generic type alias that recursively specializes itself with different type arguments.
    Pass Partial
      -
    • Does not reject specializing a type parameter in a generic type alias with a type inconsistent with the parameter's upper bound.
    • -
    • Does not reject declaring a type alias with a type variable that is not in scope.
    • -
    • Does not reject declaring a type alias with a non-literal tuple passed to the type_params parameter.
    • -
    • Does not reject cyclically defined type aliases.
    • +
    • Does not reject cyclically defined TypeAliasType aliases.
    Pass Pass Pass Pass - Pass -
      -
    • Deliberately does not allow str to be narrowed to literal string types through equality or containment checks due to the possibility of str subclasses that could have unexpected equality semantics.
    • -
    -
    Pass Pass
    Pass Pass - Unsupported + + Partial
    • type[Proto] is not yet supported.
    • -
    • ClassVar protocol members are not yet supported.
    • -
    • @property protocol members are only partially supported.
    • -
    • A class object C is only considered to inhabit a protocol type with a method member f if f exists as an attribute on the metaclass of C.
    • +
    • Class objects are not correctly matched against @property protocol members.
    • +
    • ClassVar protocol members are only partially supported.
    Pass Partial
      -
    • Does not reject implicit instance attributes in Protocol methods.
    • -
    • Does not support ClassVar protocol members.
    • -
    • Incorrectly considers ClassVar attributes on concrete classes as satisfying non-ClassVar attribute members on protocols.
    • -
    • Only has partial support for @property protocol members.
    • +
    • Reports an implicit instance attribute in a Protocol method only as a warning.
    • +
    • Incorrectly considers an instance attribute on a concrete class as satisfying a ClassVar protocol member.
    Pass Pass Pass Pass - Partial -
      -
    • Never considers a module as satisfying a protocol with a method member due to the fact that the method will never exist on the class types.ModuleType, only on a given specific module instance.
    • -
    -
    Pass Pass
    10 / 11 • 90.9% 11 / 11 • 100.0% 11 / 11 • 100.0%5 / 11 • 45.5%6 / 11 • 54.5% 11 / 11 • 100.0%
    Pass - 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.
    • -
    -
    Pass Pass
    4 / 4 • 100.0% 3.5 / 4 • 87.5% 4 / 4 • 100.0%3.5 / 4 • 87.5%4 / 4 • 100.0% 4 / 4 • 100.0%
    Pass Pass Pass - Partial -
      -
    • Does not support enum.Flag.
    • -
    -
    Pass Pass
    5.5 / 6 • 91.7% 6 / 6 • 100.0% 6 / 6 • 100.0%5.5 / 6 • 91.7%6 / 6 • 100.0% 6 / 6 • 100.0%
    130 / 141 • 92.2% 138 / 141 • 97.9% 136.5 / 141 • 96.8%116 / 141 • 82.3%122 / 141 • 86.5% 140.5 / 141 • 99.6%
    pycroscope 0.4.0 pyrefly 1.1.0 pyright 1.1.410ty 0.0.65ty 0.0.66 zuban 0.8.2
    - Partial -
      -
    • Does not reject subscription of an already-specialized generic class.
    • -
    -
    Pass Pass
    Pass Pass Pass - 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.
    • -
    -
    Pass Pass
    - Partial -
      -
    • Incorrectly reports an unbound TypeVarTuple for a correctly unpacked annotation within an otherwise invalid generic class.
    • -
    -
    Pass Pass
    28.5 / 30 • 95.0% 29.5 / 30 • 98.3% 28.5 / 30 • 95.0%25 / 30 • 83.3%26.5 / 30 • 88.3% 30 / 30 • 100.0%
    Partial
      -
    • Intersects the pre-existing type with the top materialization of the bracketed type rather than the bracketed type itself.
    • +
    • Does not fully simplify the negative branch of TypeIs narrowing for a union of fixed-length tuple types.
    Pass 130 / 141 • 92.2% 138 / 141 • 97.9% 136.5 / 141 • 96.8%122 / 141 • 86.5%123.5 / 141 • 87.6% 140.5 / 141 • 99.6%
    enums_expansionPass + Partial +
      +
    • Does not accept an enum-typed value where a complete union of all literal members is declared, although it treats the two as equivalent for assert_type.
    • +
    +
    Partial
      @@ -2460,9 +2465,19 @@

      Python Type System Conformance Test Results

    Pass Pass + Partial +
      +
    • Does not treat a complete union of all literal members as equivalent to the enum type.
    • +
    +
    PassPassPass + Partial +
      +
    • Does not treat a complete union of all literal members as equivalent to the enum type.
    • +
    +
    enums_member_names
    6 / 6 • 100.0%5.5 / 6 • 91.7% 4.5 / 6 • 75.0% 5.5 / 6 • 91.7% 6 / 6 • 100.0%5.5 / 6 • 91.7% 6 / 6 • 100.0%6 / 6 • 100.0%6 / 6 • 100.0%5.5 / 6 • 91.7%
    141 / 141 • 100.0%140.5 / 141 • 99.6% 109 / 141 • 77.3% 130 / 141 • 92.2% 138 / 141 • 97.9%136.5 / 141 • 96.8%136 / 141 • 96.5% 123.5 / 141 • 87.6%140.5 / 141 • 99.6%140 / 141 • 99.3%
    diff --git a/conformance/results/ty/enums_expansion.toml b/conformance/results/ty/enums_expansion.toml index 10c65b6cd..0cc979f4e 100644 --- a/conformance/results/ty/enums_expansion.toml +++ b/conformance/results/ty/enums_expansion.toml @@ -2,5 +2,5 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -enums_expansion.py:53:9: error[type-assertion-failure] Type `CustomFlags & ~Literal[CustomFlags.FLAG1] & ~Literal[CustomFlags.FLAG2]` does not match asserted type `Literal[CustomFlags.FLAG3]` +enums_expansion.py:56:9: error[type-assertion-failure] Type `CustomFlags & ~Literal[CustomFlags.FLAG1] & ~Literal[CustomFlags.FLAG2]` does not match asserted type `Literal[CustomFlags.FLAG3]` """ diff --git a/conformance/results/zuban/enums_expansion.toml b/conformance/results/zuban/enums_expansion.toml index 787ef8ef0..99ac1e7f1 100644 --- a/conformance/results/zuban/enums_expansion.toml +++ b/conformance/results/zuban/enums_expansion.toml @@ -1,7 +1,15 @@ -conformance_automated = "Pass" +conformant = "Partial" +notes = """ +Does not treat a complete union of all literal members as equivalent to the enum type. +""" +conformance_automated = "Fail" errors_diff = """ +Line 85: Unexpected errors ['enums_expansion.py:85: error: Incompatible types in assignment (expression has type "Answer", variable has type "Literal[Answer.Yes, Answer.No]") [assignment]'] +Line 86: Unexpected errors ['enums_expansion.py:86: error: Expression is of type "Answer", not "Literal[Answer.Yes, Answer.No]" [misc]'] """ output = """ -enums_expansion.py:35: error: Statement is unreachable [unreachable] -enums_expansion.py:53: error: Expression is of type "CustomFlags", not "Literal[CustomFlags.FLAG3]" [misc] +enums_expansion.py:38: error: Statement is unreachable [unreachable] +enums_expansion.py:56: error: Expression is of type "CustomFlags", not "Literal[CustomFlags.FLAG3]" [misc] +enums_expansion.py:85: error: Incompatible types in assignment (expression has type "Answer", variable has type "Literal[Answer.Yes, Answer.No]") [assignment] +enums_expansion.py:86: error: Expression is of type "Answer", not "Literal[Answer.Yes, Answer.No]" [misc] """ diff --git a/conformance/tests/enums_expansion.py b/conformance/tests/enums_expansion.py index 57f701f10..ae77565dc 100644 --- a/conformance/tests/enums_expansion.py +++ b/conformance/tests/enums_expansion.py @@ -8,8 +8,11 @@ from typing import Literal, Never, assert_type # > From the perspective of the type system, most enum classes are equivalent -# > to the union of the literal members within that enum. Type checkers may -# > therefore expand an enum type +# > to the union of the literal members within that enum. [...] Because of the +# > equivalency between an enum class and the union of literal members within +# > that enum, the two types may be used interchangeably. Type checkers may +# > therefore expand an enum type (that does not derive from enum.Flag) into a +# > union of literal values during type narrowing and exhaustion detection class Color(Enum): @@ -35,8 +38,8 @@ def print_color2(c: Color): assert_type(c, Never) # E? -# > This rule does not apply to classes that derive from enum. Flag because -# > these enums allow flags to be combined in arbitrary ways. +# > (This rule does not apply to classes that derive from enum.Flag because +# > these enums allow flags to be combined in arbitrary ways.) class CustomFlags(Flag): @@ -64,7 +67,7 @@ def test2(f: CustomFlags): # > A type checker should treat a complete union of all literal members as -# > compatible with the enum type. +# > equivalent to the enum type. class Answer(Enum): @@ -76,3 +79,8 @@ def test3(val: object) -> list[Answer]: assert val is Answer.Yes or val is Answer.No x = [val] return x + + +def test4(a: Answer) -> None: + x: Literal[Answer.Yes, Answer.No] = a + assert_type(a, Literal[Answer.Yes, Answer.No]) From c43d32e1f3ebfc99c602e733238067388ab6a64f Mon Sep 17 00:00:00 2001 From: Christian Findlay <16697547+MelbourneDeveloper@users.noreply.github.com> Date: Wed, 5 Aug 2026 22:32:19 +1000 Subject: [PATCH 269/308] Remove Basilisk from conformance results (#2330) --- conformance/README.md | 2 +- conformance/pyproject.toml | 1 - .../results/basilisk/aliases_explicit.toml | 27 --- .../results/basilisk/aliases_implicit.toml | 35 --- .../results/basilisk/aliases_newtype.toml | 21 -- .../results/basilisk/aliases_recursive.toml | 18 -- .../basilisk/aliases_type_statement.toml | 32 --- .../basilisk/aliases_typealiastype.toml | 29 --- .../results/basilisk/aliases_variance.toml | 10 - .../basilisk/annotations_coroutines.toml | 6 - .../basilisk/annotations_forward_refs.toml | 25 -- .../basilisk/annotations_generators.toml | 23 -- .../results/basilisk/annotations_methods.toml | 6 - .../basilisk/annotations_typeexpr.toml | 22 -- .../basilisk/callables_annotation.toml | 22 -- .../results/basilisk/callables_kwargs.toml | 19 -- .../results/basilisk/callables_protocol.toml | 25 -- .../results/basilisk/callables_subtyping.toml | 40 ---- .../results/basilisk/classes_classvar.toml | 29 --- .../results/basilisk/classes_override.toml | 11 - .../basilisk/constructors_call_init.toml | 12 - .../basilisk/constructors_call_metaclass.toml | 8 - .../basilisk/constructors_call_new.toml | 8 - .../basilisk/constructors_call_type.toml | 14 -- .../basilisk/constructors_callable.toml | 20 -- .../basilisk/constructors_consistency.toml | 6 - .../basilisk/dataclasses_descriptors.toml | 6 - .../results/basilisk/dataclasses_final.toml | 11 - .../results/basilisk/dataclasses_frozen.toml | 10 - .../results/basilisk/dataclasses_hash.toml | 10 - .../basilisk/dataclasses_inheritance.toml | 8 - .../results/basilisk/dataclasses_kwonly.toml | 9 - .../basilisk/dataclasses_match_args.toml | 7 - .../results/basilisk/dataclasses_order.toml | 7 - .../basilisk/dataclasses_postinit.toml | 10 - .../results/basilisk/dataclasses_slots.toml | 11 - .../basilisk/dataclasses_transform_class.toml | 12 - .../dataclasses_transform_converter.toml | 15 -- .../basilisk/dataclasses_transform_field.toml | 8 - .../basilisk/dataclasses_transform_func.toml | 12 - .../basilisk/dataclasses_transform_meta.toml | 12 - .../results/basilisk/dataclasses_usage.toml | 18 -- .../basilisk/directives_assert_type.toml | 14 -- .../results/basilisk/directives_cast.toml | 9 - .../basilisk/directives_deprecated.toml | 19 -- .../basilisk/directives_disjoint_base.toml | 14 -- .../basilisk/directives_no_type_check.toml | 10 - .../basilisk/directives_reveal_type.toml | 8 - .../basilisk/directives_type_checking.toml | 6 - .../basilisk/directives_type_ignore.toml | 6 - .../directives_type_ignore_file1.toml | 6 - .../directives_type_ignore_file2.toml | 7 - .../basilisk/directives_version_platform.toml | 9 - .../results/basilisk/enums_behaviors.toml | 9 - .../results/basilisk/enums_definition.toml | 7 - .../results/basilisk/enums_expansion.toml | 13 -- .../results/basilisk/enums_member_names.toml | 6 - .../results/basilisk/enums_member_values.toml | 8 - .../results/basilisk/enums_members.toml | 13 -- .../basilisk/exceptions_context_managers.toml | 6 - .../results/basilisk/generics_base_class.toml | 13 -- .../results/basilisk/generics_basic.toml | 24 -- .../results/basilisk/generics_defaults.toml | 12 - .../generics_defaults_referential.toml | 15 -- .../generics_defaults_specialization.toml | 9 - .../basilisk/generics_paramspec_basic.toml | 14 -- .../generics_paramspec_components.toml | 22 -- .../generics_paramspec_semantics.toml | 16 -- .../generics_paramspec_specialization.toml | 11 - .../results/basilisk/generics_scoping.toml | 24 -- .../basilisk/generics_self_advanced.toml | 6 - .../basilisk/generics_self_attributes.toml | 8 - .../results/basilisk/generics_self_basic.toml | 9 - .../basilisk/generics_self_protocols.toml | 8 - .../results/basilisk/generics_self_usage.toml | 19 -- .../generics_syntax_compatibility.toml | 8 - .../generics_syntax_declarations.toml | 17 -- .../generics_syntax_infer_variance.toml | 24 -- .../basilisk/generics_syntax_scoping.toml | 13 -- .../basilisk/generics_type_erasure.toml | 13 -- .../basilisk/generics_typevartuple_args.toml | 14 -- .../basilisk/generics_typevartuple_basic.toml | 23 -- .../generics_typevartuple_callable.toml | 7 - .../generics_typevartuple_concat.toml | 6 - .../generics_typevartuple_overloads.toml | 6 - .../generics_typevartuple_specialization.toml | 13 -- .../generics_typevartuple_unpack.toml | 7 - .../basilisk/generics_upper_bound.toml | 11 - .../results/basilisk/generics_variance.toml | 19 -- .../basilisk/generics_variance_inference.toml | 29 --- .../basilisk/historical_positional.toml | 10 - .../basilisk/literals_interactions.toml | 10 - .../basilisk/literals_literalstring.toml | 17 -- .../basilisk/literals_parameterizations.toml | 27 --- .../results/basilisk/literals_semantics.toml | 12 - .../basilisk/namedtuples_define_class.toml | 21 -- .../namedtuples_define_functional.toml | 16 -- .../basilisk/namedtuples_type_compat.toml | 8 - .../results/basilisk/namedtuples_usage.toml | 14 -- .../results/basilisk/narrowing_typeguard.toml | 10 - .../results/basilisk/narrowing_typeis.toml | 15 -- .../results/basilisk/overloads_basic.toml | 7 - .../basilisk/overloads_consistency.toml | 8 - .../basilisk/overloads_definitions.toml | 18 -- .../basilisk/overloads_definitions_stub.toml | 14 -- .../basilisk/overloads_evaluation.toml | 10 - .../basilisk/protocols_class_objects.toml | 15 -- .../basilisk/protocols_definition.toml | 27 --- .../results/basilisk/protocols_explicit.toml | 13 -- .../results/basilisk/protocols_generic.toml | 15 -- .../results/basilisk/protocols_merging.toml | 12 - .../results/basilisk/protocols_modules.toml | 9 - .../results/basilisk/protocols_recursive.toml | 6 - .../basilisk/protocols_runtime_checkable.toml | 15 -- .../results/basilisk/protocols_self.toml | 6 - .../results/basilisk/protocols_subtyping.toml | 13 -- .../results/basilisk/protocols_variance.toml | 18 -- .../basilisk/qualifiers_annotated.toml | 27 --- .../basilisk/qualifiers_final_annotation.toml | 36 --- .../basilisk/qualifiers_final_decorator.toml | 16 -- .../results/basilisk/specialtypes_any.toml | 6 - .../results/basilisk/specialtypes_never.toml | 9 - .../results/basilisk/specialtypes_none.toml | 9 - .../basilisk/specialtypes_promotions.toml | 7 - .../results/basilisk/specialtypes_type.toml | 16 -- .../results/basilisk/tuples_type_compat.toml | 30 --- .../results/basilisk/tuples_type_form.toml | 21 -- .../results/basilisk/tuples_unpacked.toml | 11 - .../basilisk/typeddicts_alt_syntax.toml | 10 - .../basilisk/typeddicts_class_syntax.toml | 12 - .../basilisk/typeddicts_extra_items.toml | 34 --- .../results/basilisk/typeddicts_final.toml | 6 - .../basilisk/typeddicts_inheritance.toml | 9 - .../basilisk/typeddicts_operations.toml | 17 -- .../results/basilisk/typeddicts_readonly.toml | 12 - .../typeddicts_readonly_consistency.toml | 13 -- .../typeddicts_readonly_inheritance.toml | 19 -- .../basilisk/typeddicts_readonly_kwargs.toml | 7 - .../basilisk/typeddicts_readonly_update.toml | 8 - .../results/basilisk/typeddicts_required.toml | 10 - .../basilisk/typeddicts_type_consistency.toml | 15 -- .../results/basilisk/typeddicts_usage.toml | 11 - .../results/basilisk/typeforms_typeform.toml | 23 -- conformance/results/basilisk/version.toml | 1 - conformance/results/results.html | 215 ++---------------- conformance/src/type_checker.py | 109 --------- conformance/uv.lock | 14 -- 147 files changed, 24 insertions(+), 2302 deletions(-) delete mode 100644 conformance/results/basilisk/aliases_explicit.toml delete mode 100644 conformance/results/basilisk/aliases_implicit.toml delete mode 100644 conformance/results/basilisk/aliases_newtype.toml delete mode 100644 conformance/results/basilisk/aliases_recursive.toml delete mode 100644 conformance/results/basilisk/aliases_type_statement.toml delete mode 100644 conformance/results/basilisk/aliases_typealiastype.toml delete mode 100644 conformance/results/basilisk/aliases_variance.toml delete mode 100644 conformance/results/basilisk/annotations_coroutines.toml delete mode 100644 conformance/results/basilisk/annotations_forward_refs.toml delete mode 100644 conformance/results/basilisk/annotations_generators.toml delete mode 100644 conformance/results/basilisk/annotations_methods.toml delete mode 100644 conformance/results/basilisk/annotations_typeexpr.toml delete mode 100644 conformance/results/basilisk/callables_annotation.toml delete mode 100644 conformance/results/basilisk/callables_kwargs.toml delete mode 100644 conformance/results/basilisk/callables_protocol.toml delete mode 100644 conformance/results/basilisk/callables_subtyping.toml delete mode 100644 conformance/results/basilisk/classes_classvar.toml delete mode 100644 conformance/results/basilisk/classes_override.toml delete mode 100644 conformance/results/basilisk/constructors_call_init.toml delete mode 100644 conformance/results/basilisk/constructors_call_metaclass.toml delete mode 100644 conformance/results/basilisk/constructors_call_new.toml delete mode 100644 conformance/results/basilisk/constructors_call_type.toml delete mode 100644 conformance/results/basilisk/constructors_callable.toml delete mode 100644 conformance/results/basilisk/constructors_consistency.toml delete mode 100644 conformance/results/basilisk/dataclasses_descriptors.toml delete mode 100644 conformance/results/basilisk/dataclasses_final.toml delete mode 100644 conformance/results/basilisk/dataclasses_frozen.toml delete mode 100644 conformance/results/basilisk/dataclasses_hash.toml delete mode 100644 conformance/results/basilisk/dataclasses_inheritance.toml delete mode 100644 conformance/results/basilisk/dataclasses_kwonly.toml delete mode 100644 conformance/results/basilisk/dataclasses_match_args.toml delete mode 100644 conformance/results/basilisk/dataclasses_order.toml delete mode 100644 conformance/results/basilisk/dataclasses_postinit.toml delete mode 100644 conformance/results/basilisk/dataclasses_slots.toml delete mode 100644 conformance/results/basilisk/dataclasses_transform_class.toml delete mode 100644 conformance/results/basilisk/dataclasses_transform_converter.toml delete mode 100644 conformance/results/basilisk/dataclasses_transform_field.toml delete mode 100644 conformance/results/basilisk/dataclasses_transform_func.toml delete mode 100644 conformance/results/basilisk/dataclasses_transform_meta.toml delete mode 100644 conformance/results/basilisk/dataclasses_usage.toml delete mode 100644 conformance/results/basilisk/directives_assert_type.toml delete mode 100644 conformance/results/basilisk/directives_cast.toml delete mode 100644 conformance/results/basilisk/directives_deprecated.toml delete mode 100644 conformance/results/basilisk/directives_disjoint_base.toml delete mode 100644 conformance/results/basilisk/directives_no_type_check.toml delete mode 100644 conformance/results/basilisk/directives_reveal_type.toml delete mode 100644 conformance/results/basilisk/directives_type_checking.toml delete mode 100644 conformance/results/basilisk/directives_type_ignore.toml delete mode 100644 conformance/results/basilisk/directives_type_ignore_file1.toml delete mode 100644 conformance/results/basilisk/directives_type_ignore_file2.toml delete mode 100644 conformance/results/basilisk/directives_version_platform.toml delete mode 100644 conformance/results/basilisk/enums_behaviors.toml delete mode 100644 conformance/results/basilisk/enums_definition.toml delete mode 100644 conformance/results/basilisk/enums_expansion.toml delete mode 100644 conformance/results/basilisk/enums_member_names.toml delete mode 100644 conformance/results/basilisk/enums_member_values.toml delete mode 100644 conformance/results/basilisk/enums_members.toml delete mode 100644 conformance/results/basilisk/exceptions_context_managers.toml delete mode 100644 conformance/results/basilisk/generics_base_class.toml delete mode 100644 conformance/results/basilisk/generics_basic.toml delete mode 100644 conformance/results/basilisk/generics_defaults.toml delete mode 100644 conformance/results/basilisk/generics_defaults_referential.toml delete mode 100644 conformance/results/basilisk/generics_defaults_specialization.toml delete mode 100644 conformance/results/basilisk/generics_paramspec_basic.toml delete mode 100644 conformance/results/basilisk/generics_paramspec_components.toml delete mode 100644 conformance/results/basilisk/generics_paramspec_semantics.toml delete mode 100644 conformance/results/basilisk/generics_paramspec_specialization.toml delete mode 100644 conformance/results/basilisk/generics_scoping.toml delete mode 100644 conformance/results/basilisk/generics_self_advanced.toml delete mode 100644 conformance/results/basilisk/generics_self_attributes.toml delete mode 100644 conformance/results/basilisk/generics_self_basic.toml delete mode 100644 conformance/results/basilisk/generics_self_protocols.toml delete mode 100644 conformance/results/basilisk/generics_self_usage.toml delete mode 100644 conformance/results/basilisk/generics_syntax_compatibility.toml delete mode 100644 conformance/results/basilisk/generics_syntax_declarations.toml delete mode 100644 conformance/results/basilisk/generics_syntax_infer_variance.toml delete mode 100644 conformance/results/basilisk/generics_syntax_scoping.toml delete mode 100644 conformance/results/basilisk/generics_type_erasure.toml delete mode 100644 conformance/results/basilisk/generics_typevartuple_args.toml delete mode 100644 conformance/results/basilisk/generics_typevartuple_basic.toml delete mode 100644 conformance/results/basilisk/generics_typevartuple_callable.toml delete mode 100644 conformance/results/basilisk/generics_typevartuple_concat.toml delete mode 100644 conformance/results/basilisk/generics_typevartuple_overloads.toml delete mode 100644 conformance/results/basilisk/generics_typevartuple_specialization.toml delete mode 100644 conformance/results/basilisk/generics_typevartuple_unpack.toml delete mode 100644 conformance/results/basilisk/generics_upper_bound.toml delete mode 100644 conformance/results/basilisk/generics_variance.toml delete mode 100644 conformance/results/basilisk/generics_variance_inference.toml delete mode 100644 conformance/results/basilisk/historical_positional.toml delete mode 100644 conformance/results/basilisk/literals_interactions.toml delete mode 100644 conformance/results/basilisk/literals_literalstring.toml delete mode 100644 conformance/results/basilisk/literals_parameterizations.toml delete mode 100644 conformance/results/basilisk/literals_semantics.toml delete mode 100644 conformance/results/basilisk/namedtuples_define_class.toml delete mode 100644 conformance/results/basilisk/namedtuples_define_functional.toml delete mode 100644 conformance/results/basilisk/namedtuples_type_compat.toml delete mode 100644 conformance/results/basilisk/namedtuples_usage.toml delete mode 100644 conformance/results/basilisk/narrowing_typeguard.toml delete mode 100644 conformance/results/basilisk/narrowing_typeis.toml delete mode 100644 conformance/results/basilisk/overloads_basic.toml delete mode 100644 conformance/results/basilisk/overloads_consistency.toml delete mode 100644 conformance/results/basilisk/overloads_definitions.toml delete mode 100644 conformance/results/basilisk/overloads_definitions_stub.toml delete mode 100644 conformance/results/basilisk/overloads_evaluation.toml delete mode 100644 conformance/results/basilisk/protocols_class_objects.toml delete mode 100644 conformance/results/basilisk/protocols_definition.toml delete mode 100644 conformance/results/basilisk/protocols_explicit.toml delete mode 100644 conformance/results/basilisk/protocols_generic.toml delete mode 100644 conformance/results/basilisk/protocols_merging.toml delete mode 100644 conformance/results/basilisk/protocols_modules.toml delete mode 100644 conformance/results/basilisk/protocols_recursive.toml delete mode 100644 conformance/results/basilisk/protocols_runtime_checkable.toml delete mode 100644 conformance/results/basilisk/protocols_self.toml delete mode 100644 conformance/results/basilisk/protocols_subtyping.toml delete mode 100644 conformance/results/basilisk/protocols_variance.toml delete mode 100644 conformance/results/basilisk/qualifiers_annotated.toml delete mode 100644 conformance/results/basilisk/qualifiers_final_annotation.toml delete mode 100644 conformance/results/basilisk/qualifiers_final_decorator.toml delete mode 100644 conformance/results/basilisk/specialtypes_any.toml delete mode 100644 conformance/results/basilisk/specialtypes_never.toml delete mode 100644 conformance/results/basilisk/specialtypes_none.toml delete mode 100644 conformance/results/basilisk/specialtypes_promotions.toml delete mode 100644 conformance/results/basilisk/specialtypes_type.toml delete mode 100644 conformance/results/basilisk/tuples_type_compat.toml delete mode 100644 conformance/results/basilisk/tuples_type_form.toml delete mode 100644 conformance/results/basilisk/tuples_unpacked.toml delete mode 100644 conformance/results/basilisk/typeddicts_alt_syntax.toml delete mode 100644 conformance/results/basilisk/typeddicts_class_syntax.toml delete mode 100644 conformance/results/basilisk/typeddicts_extra_items.toml delete mode 100644 conformance/results/basilisk/typeddicts_final.toml delete mode 100644 conformance/results/basilisk/typeddicts_inheritance.toml delete mode 100644 conformance/results/basilisk/typeddicts_operations.toml delete mode 100644 conformance/results/basilisk/typeddicts_readonly.toml delete mode 100644 conformance/results/basilisk/typeddicts_readonly_consistency.toml delete mode 100644 conformance/results/basilisk/typeddicts_readonly_inheritance.toml delete mode 100644 conformance/results/basilisk/typeddicts_readonly_kwargs.toml delete mode 100644 conformance/results/basilisk/typeddicts_readonly_update.toml delete mode 100644 conformance/results/basilisk/typeddicts_required.toml delete mode 100644 conformance/results/basilisk/typeddicts_type_consistency.toml delete mode 100644 conformance/results/basilisk/typeddicts_usage.toml delete mode 100644 conformance/results/basilisk/typeforms_typeform.toml delete mode 100644 conformance/results/basilisk/version.toml diff --git a/conformance/README.md b/conformance/README.md index ce1be0c9a..0b60a9490 100644 --- a/conformance/README.md +++ b/conformance/README.md @@ -81,7 +81,7 @@ Note that some type checkers may not run on some platforms. If a type checker fa Different type checkers report errors in different ways (with different wording in error messages and different line numbers or character ranges for errors). This variation makes it difficult to fully automate test validation given that tests will want to check for both false positive and false negative type errors. Some level of manual inspection will therefore be needed to determine whether a type checker is fully conformant with all tests in any given test file. This "scoring" process is required only when the output of a test changes — e.g. when a new version of that type checker is released and the tests are rerun. We assume that the output of a type checker will be the same from one run to the next unless/until a new version is released that fixes or introduces a bug. In this case, the output will need to be manually inspected and the conformance results re-scored for those tests whose output has changed. -[Conformance results](https://htmlpreview.github.io/?https://github.com/python/typing/blob/main/conformance/results/results.html) are reported and summarized for each supported type checker. Currently, results are reported for basilisk, mypy, pyrefly, pyright, zuban, ty, and pycroscope. It is the goal and desire to add additional type checkers over time. +[Conformance results](https://htmlpreview.github.io/?https://github.com/python/typing/blob/main/conformance/results/results.html) are reported and summarized for each supported type checker. Currently, results are reported for mypy, pyrefly, pyright, zuban, ty, and pycroscope. It is the goal and desire to add additional type checkers over time. ## Adding a New Test Case diff --git a/conformance/pyproject.toml b/conformance/pyproject.toml index f72a1fba3..17c4adfd2 100644 --- a/conformance/pyproject.toml +++ b/conformance/pyproject.toml @@ -3,7 +3,6 @@ name = "typing-conformance" version = "0.1.0" requires-python = "==3.12.*" dependencies = [ - "basilisk-python", "jinja2", "markdown", "mypy", diff --git a/conformance/results/basilisk/aliases_explicit.toml b/conformance/results/basilisk/aliases_explicit.toml deleted file mode 100644 index 2f08c6237..000000000 --- a/conformance/results/basilisk/aliases_explicit.toml +++ /dev/null @@ -1,27 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -aliases_explicit.py:67:9: error: Type alias `GoodTypeAlias2` is not generic and cannot be parameterized [aliases_implicit] -aliases_explicit.py:68:9: error: Type alias `GoodTypeAlias3` is not generic and cannot be parameterized [aliases_implicit] -aliases_explicit.py:69:9: error: Too many type arguments for `GoodTypeAlias4`: expected 1, got 2 [aliases_implicit] -aliases_explicit.py:70:9: error: Too many type arguments for `GoodTypeAlias8`: expected 1, got 2 [aliases_implicit] -aliases_explicit.py:71:9: error: Invalid type argument for `ParamSpec` parameter in `GoodTypeAlias9` [aliases_implicit] -aliases_explicit.py:79:1: error: Invalid type expression as right-hand side of `TypeAlias` for `BadTypeAlias1` [aliases_implicit] -aliases_explicit.py:80:1: error: Invalid type expression as right-hand side of `TypeAlias` for `BadTypeAlias2` [aliases_implicit] -aliases_explicit.py:81:1: error: Invalid type expression as right-hand side of `TypeAlias` for `BadTypeAlias3` [aliases_implicit] -aliases_explicit.py:82:1: error: Invalid type expression as right-hand side of `TypeAlias` for `BadTypeAlias4` [aliases_implicit] -aliases_explicit.py:83:1: error: Invalid type expression as right-hand side of `TypeAlias` for `BadTypeAlias5` [aliases_implicit] -aliases_explicit.py:84:1: error: Invalid type expression as right-hand side of `TypeAlias` for `BadTypeAlias6` [aliases_implicit] -aliases_explicit.py:85:1: error: Invalid type expression as right-hand side of `TypeAlias` for `BadTypeAlias7` [aliases_implicit] -aliases_explicit.py:86:1: error: Invalid type expression as right-hand side of `TypeAlias` for `BadTypeAlias8` [aliases_implicit] -aliases_explicit.py:87:1: error: Invalid type expression as right-hand side of `TypeAlias` for `BadTypeAlias9` [aliases_implicit] -aliases_explicit.py:88:1: error: Invalid type expression as right-hand side of `TypeAlias` for `BadTypeAlias10` [aliases_implicit] -aliases_explicit.py:89:1: error: Invalid type expression as right-hand side of `TypeAlias` for `BadTypeAlias11` [aliases_implicit] -aliases_explicit.py:90:1: error: Invalid type expression as right-hand side of `TypeAlias` for `BadTypeAlias12` [aliases_implicit] -aliases_explicit.py:91:1: error: Invalid type expression as right-hand side of `TypeAlias` for `BadTypeAlias13` [aliases_implicit] -aliases_explicit.py:100:5: error: Type alias `ListAlias` is not generic and cannot be parameterized [aliases_implicit] -aliases_explicit.py:101:6: error: Cannot instantiate union type alias `ListOrSetAlias` [aliases_implicit] -aliases_explicit.py:102:5: error: Type alias `ListOrSetAlias` is not generic and cannot be parameterized [aliases_implicit] -""" diff --git a/conformance/results/basilisk/aliases_implicit.toml b/conformance/results/basilisk/aliases_implicit.toml deleted file mode 100644 index c723e4532..000000000 --- a/conformance/results/basilisk/aliases_implicit.toml +++ /dev/null @@ -1,35 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -aliases_implicit.py:76:9: error: Type alias `GoodTypeAlias2` is not generic and cannot be parameterized [aliases_implicit] -aliases_implicit.py:77:9: error: Type alias `GoodTypeAlias3` is not generic and cannot be parameterized [aliases_implicit] -aliases_implicit.py:77:9: error: `GoodTypeAlias3` cannot be subscripted; it has no free type parameters [generics_defaults_specialization] -aliases_implicit.py:78:9: error: Too many type arguments for `GoodTypeAlias4`: expected 1, got 2 [aliases_implicit] -aliases_implicit.py:78:9: error: Too many type arguments for `GoodTypeAlias4`; expected at most 1, got 2 [generics_defaults_specialization] -aliases_implicit.py:79:9: error: Too many type arguments for `GoodTypeAlias8`: expected 1, got 2 [aliases_implicit] -aliases_implicit.py:79:9: error: Too many type arguments for `GoodTypeAlias8`; expected at most 1, got 2 [generics_defaults_specialization] -aliases_implicit.py:80:9: error: Invalid type argument for `ParamSpec` parameter in `GoodTypeAlias9` [aliases_implicit] -aliases_implicit.py:81:9: error: Type argument `str` does not satisfy bound `float` of TypeVar `TFloat` in `GoodTypeAlias12` [aliases_implicit] -aliases_implicit.py:106:9: error: Variable `BadTypeAlias1` is not a valid type and cannot be used as an annotation [aliases_implicit] -aliases_implicit.py:107:9: error: Variable `BadTypeAlias2` is not a valid type and cannot be used as an annotation [aliases_implicit] -aliases_implicit.py:108:9: error: Variable `BadTypeAlias3` is not a valid type and cannot be used as an annotation [aliases_implicit] -aliases_implicit.py:109:9: error: Variable `BadTypeAlias4` is not a valid type and cannot be used as an annotation [aliases_implicit] -aliases_implicit.py:110:9: error: Variable `BadTypeAlias5` is not a valid type and cannot be used as an annotation [aliases_implicit] -aliases_implicit.py:111:9: error: Variable `BadTypeAlias6` is not a valid type and cannot be used as an annotation [aliases_implicit] -aliases_implicit.py:112:9: error: Variable `BadTypeAlias7` is not a valid type and cannot be used as an annotation [aliases_implicit] -aliases_implicit.py:113:9: error: Variable `BadTypeAlias8` is not a valid type and cannot be used as an annotation [aliases_implicit] -aliases_implicit.py:114:9: error: Variable `BadTypeAlias9` is not a valid type and cannot be used as an annotation [aliases_implicit] -aliases_implicit.py:115:5: error: Invalid type expression in annotation for parameter `p10` [annotations_forward_refs] -aliases_implicit.py:115:10: error: Variable `BadTypeAlias10` is not a valid type and cannot be used as an annotation [aliases_implicit] -aliases_implicit.py:116:5: error: Invalid type expression in annotation for parameter `p11` [annotations_forward_refs] -aliases_implicit.py:116:10: error: Variable `BadTypeAlias11` is not a valid type and cannot be used as an annotation [aliases_implicit] -aliases_implicit.py:117:10: error: Variable `BadTypeAlias12` is not a valid type and cannot be used as an annotation [aliases_implicit] -aliases_implicit.py:118:5: error: Invalid type expression in annotation for parameter `p13` [annotations_forward_refs] -aliases_implicit.py:118:10: error: Variable `BadTypeAlias13` is not a valid type and cannot be used as an annotation [aliases_implicit] -aliases_implicit.py:119:5: error: Invalid type expression in annotation for parameter `p14` [annotations_forward_refs] -aliases_implicit.py:119:10: error: Variable `BadTypeAlias14` is not a valid type and cannot be used as an annotation [aliases_implicit] -aliases_implicit.py:133:6: error: Cannot instantiate union type alias `ListOrSetAlias` [aliases_implicit] -aliases_implicit.py:135:5: error: Type alias `ListOrSetAlias` is not generic and cannot be parameterized [aliases_implicit] -""" diff --git a/conformance/results/basilisk/aliases_newtype.toml b/conformance/results/basilisk/aliases_newtype.toml deleted file mode 100644 index 300529408..000000000 --- a/conformance/results/basilisk/aliases_newtype.toml +++ /dev/null @@ -1,21 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -aliases_newtype.py:11:1: error: Argument to `UserId` ("user") is not compatible with its base type `int` [aliases_newtype] -aliases_newtype.py:12:1: error: Cannot assign a literal value directly to `UserId`; use `UserId(value)` to create a `UserId` instance [aliases_newtype] -aliases_newtype.py:12:1: error: Type mismatch: `u1` is annotated `UserId` (userid) but assigned int [assignment_compatibility] -aliases_newtype.py:18:1: error: `UserId` is a `NewType`, not an instance of `type`; `NewType()` does not return a class object [aliases_newtype] -aliases_newtype.py:23:1: error: `UserId` is a `NewType` and cannot be used as the second argument to `isinstance`; `NewType` types are not runtime classes [aliases_newtype] -aliases_newtype.py:26:1: error: Class `UserIdDerived` cannot subclass `UserId` which is a `NewType` [aliases_newtype] -aliases_newtype.py:35:12: error: `NewType` name `BadName` does not match the variable name `GoodName` [aliases_newtype] -aliases_newtype.py:41:1: error: Variable `nt1`: `NewType` cannot be used as a generic type [aliases_newtype] -aliases_newtype.py:47:15: error: Invalid base type for `NewType` `BadNewType1`: cannot use a union type as a `NewType` base [aliases_newtype] -aliases_newtype.py:50:15: error: Invalid base type for `NewType` `BadNewType2`: cannot use a TypeVar-parameterized generic as a `NewType` base [aliases_newtype] -aliases_newtype.py:52:15: error: Invalid base type for `NewType` `BadNewType3`: cannot use a Protocol class as a `NewType` base [aliases_newtype] -aliases_newtype.py:54:15: error: Invalid base type for `NewType` `BadNewType4`: cannot use `Literal` as a `NewType` base [aliases_newtype] -aliases_newtype.py:61:15: error: Invalid base type for `NewType` `BadNewType5`: cannot use a `TypedDict` class as a `NewType` base [aliases_newtype] -aliases_newtype.py:63:15: error: `NewType` takes exactly 2 arguments (3 given) for `BadNewType6` [aliases_newtype] -aliases_newtype.py:65:15: error: Invalid base type for `NewType` `BadNewType7`: cannot use `Any` as a `NewType` base [aliases_newtype] -""" diff --git a/conformance/results/basilisk/aliases_recursive.toml b/conformance/results/basilisk/aliases_recursive.toml deleted file mode 100644 index 6e740de8e..000000000 --- a/conformance/results/basilisk/aliases_recursive.toml +++ /dev/null @@ -1,18 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -aliases_recursive.py:19:1: error: Type mismatch: `j4` is annotated `Json` (json) but assigned dict[str, int | Unknown] [assignment_compatibility] -aliases_recursive.py:20:1: error: Type mismatch: `j5` is annotated `Json` (json) but assigned list[int | Unknown] [assignment_compatibility] -aliases_recursive.py:38:1: error: Type mismatch: `t6` is annotated `RecursiveTuple` (recursivetuple) but assigned tuple[int, tuple[str, int], tuple[int, tuple[int, list[int]]]] [assignment_compatibility] -aliases_recursive.py:39:1: error: Type mismatch: `t7` is annotated `RecursiveTuple` (recursivetuple) but assigned tuple[int, list[int]] [assignment_compatibility] -aliases_recursive.py:50:1: error: Type mismatch: `m7` is annotated `RecursiveMapping` (recursivemapping) but assigned dict[str, list[int]] [assignment_compatibility] -aliases_recursive.py:51:1: error: Type mismatch: `m8` is annotated `RecursiveMapping` (recursivemapping) but assigned dict[str, str | int | list[int]] [assignment_compatibility] -aliases_recursive.py:52:1: error: Type mismatch: `m9` is annotated `RecursiveMapping` (recursivemapping) but assigned dict[str, str | int | dict[str, str | int | list[int]]] [assignment_compatibility] -aliases_recursive.py:63:1: error: Type mismatch: `g3` is annotated `GenericTypeAlias1[str]` (generictypealias1[str]) but assigned list[str | list[float]] [assignment_compatibility] -aliases_recursive.py:69:1: error: Type mismatch: `g6` is annotated `GenericTypeAlias2[str, int]` (generictypealias2[str, int]) but assigned list[list[int | list[str | int | list[float]]] | str] [assignment_compatibility] -aliases_recursive.py:72:1: error: Type alias `RecursiveUnion` creates a cyclical reference [aliases_recursive] -aliases_recursive.py:75:1: error: Type alias `MutualReference1` creates a cyclical reference [aliases_recursive] -aliases_recursive.py:75:63: error: Type alias `MutualReference2` creates a cyclical reference [aliases_recursive] -""" diff --git a/conformance/results/basilisk/aliases_type_statement.toml b/conformance/results/basilisk/aliases_type_statement.toml deleted file mode 100644 index ceb4f8a15..000000000 --- a/conformance/results/basilisk/aliases_type_statement.toml +++ /dev/null @@ -1,32 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -aliases_type_statement.py:17:1: error: Cannot access attribute `bit_count` on type alias `GoodAlias1` [generics_syntax_scoping] -aliases_type_statement.py:19:1: error: Cannot call type alias `GoodAlias1`: type aliases are not callable [generics_syntax_scoping] -aliases_type_statement.py:23:7: error: Cannot access attribute `other_attrib` on type alias `GoodAlias1` [generics_syntax_scoping] -aliases_type_statement.py:26:7: error: Cannot use type alias `GoodAlias1` as a base class [generics_syntax_scoping] -aliases_type_statement.py:31:22: error: Cannot use type alias `GoodAlias1` in `isinstance` [generics_syntax_scoping] -aliases_type_statement.py:37:6: error: Invalid type expression in `type BadTypeAlias1` alias [aliases_type_statement] -aliases_type_statement.py:38:6: error: Invalid type expression in `type BadTypeAlias2` alias [aliases_type_statement] -aliases_type_statement.py:39:6: error: Invalid type expression in `type BadTypeAlias3` alias [aliases_type_statement] -aliases_type_statement.py:40:6: error: Invalid type expression in `type BadTypeAlias4` alias [aliases_type_statement] -aliases_type_statement.py:41:6: error: Invalid type expression in `type BadTypeAlias5` alias [aliases_type_statement] -aliases_type_statement.py:42:6: error: Invalid type expression in `type BadTypeAlias6` alias [aliases_type_statement] -aliases_type_statement.py:43:6: error: Invalid type expression in `type BadTypeAlias7` alias [aliases_type_statement] -aliases_type_statement.py:44:6: error: Invalid type expression in `type BadTypeAlias8` alias [aliases_type_statement] -aliases_type_statement.py:45:6: error: Invalid type expression in `type BadTypeAlias9` alias [aliases_type_statement] -aliases_type_statement.py:46:6: error: Invalid type expression in `type BadTypeAlias10` alias [aliases_type_statement] -aliases_type_statement.py:47:6: error: Invalid type expression in `type BadTypeAlias11` alias [aliases_type_statement] -aliases_type_statement.py:48:6: error: Invalid type expression in `type BadTypeAlias12` alias [aliases_type_statement] -aliases_type_statement.py:49:6: error: Invalid type expression in `type BadTypeAlias13` alias [aliases_type_statement] -aliases_type_statement.py:53:6: error: PEP 695 `type` statement uses old-style TypeVar `V` [generics_syntax_scoping] -aliases_type_statement.py:58:6: error: PEP 695 `type` statement uses old-style TypeVar `T1` [generics_syntax_scoping] -aliases_type_statement.py:68:1: error: Type argument `str` is not compatible with type parameter `S` bound `int` in type alias `RecursiveTypeAlias2` [generics_syntax_scoping] -aliases_type_statement.py:70:1: error: Type argument `int` is not compatible with type parameter `T` bound `str` in type alias `RecursiveTypeAlias2` [generics_syntax_scoping] -aliases_type_statement.py:73:6: error: Circular type alias definition: `RecursiveTypeAlias3` references itself [generics_syntax_scoping] -aliases_type_statement.py:75:6: error: Circular type alias definition: `RecursiveTypeAlias4` references itself with different type arguments [generics_syntax_scoping] -aliases_type_statement.py:79:6: error: Circular type alias definition: `RecursiveTypeAlias6` is part of a circular alias chain [generics_syntax_scoping] -aliases_type_statement.py:80:6: error: Circular type alias definition: `RecursiveTypeAlias7` is part of a circular alias chain [generics_syntax_scoping] -""" diff --git a/conformance/results/basilisk/aliases_typealiastype.toml b/conformance/results/basilisk/aliases_typealiastype.toml deleted file mode 100644 index 070798156..000000000 --- a/conformance/results/basilisk/aliases_typealiastype.toml +++ /dev/null @@ -1,29 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -aliases_typealiastype.py:32:7: error: `TypeAliasType` object `GoodAlias1` has no attribute `other_attrib` [aliases_typealiastype] -aliases_typealiastype.py:40:5: error: Incorrect type arguments for `GoodAlias5`: expected 4, got 3 [aliases_typealiastype] -aliases_typealiastype.py:43:13: error: Type variable `S` used in `BadAlias1` is not declared in `type_params` [aliases_typealiastype] -aliases_typealiastype.py:44:13: error: Type variable `S` used in `BadAlias2` is not declared in `type_params` [aliases_typealiastype] -aliases_typealiastype.py:45:57: error: `type_params` for `BadAlias3` must be a literal tuple expression [aliases_typealiastype] -aliases_typealiastype.py:46:13: error: Type alias `BadAlias4` references itself, creating a circular dependency [aliases_typealiastype] -aliases_typealiastype.py:47:13: error: Type alias `BadAlias5` references itself, creating a circular dependency [aliases_typealiastype] -aliases_typealiastype.py:48:13: error: Type alias `BadAlias6` references itself, creating a circular dependency [aliases_typealiastype] -aliases_typealiastype.py:49:13: error: Type alias `BadAlias7` references itself, creating a circular dependency [aliases_typealiastype] -aliases_typealiastype.py:52:40: error: Invalid type expression in `TypeAliasType` for `BadAlias8` [aliases_typealiastype] -aliases_typealiastype.py:53:40: error: Invalid type expression in `TypeAliasType` for `BadAlias9` [aliases_typealiastype] -aliases_typealiastype.py:54:42: error: Invalid type expression in `TypeAliasType` for `BadAlias10` [aliases_typealiastype] -aliases_typealiastype.py:55:42: error: Invalid type expression in `TypeAliasType` for `BadAlias11` [aliases_typealiastype] -aliases_typealiastype.py:56:42: error: Invalid type expression in `TypeAliasType` for `BadAlias12` [aliases_typealiastype] -aliases_typealiastype.py:57:42: error: Invalid type expression in `TypeAliasType` for `BadAlias13` [aliases_typealiastype] -aliases_typealiastype.py:58:42: error: Invalid type expression in `TypeAliasType` for `BadAlias14` [aliases_typealiastype] -aliases_typealiastype.py:59:42: error: Invalid type expression in `TypeAliasType` for `BadAlias15` [aliases_typealiastype] -aliases_typealiastype.py:60:42: error: Invalid type expression in `TypeAliasType` for `BadAlias16` [aliases_typealiastype] -aliases_typealiastype.py:61:42: error: Invalid type expression in `TypeAliasType` for `BadAlias17` [aliases_typealiastype] -aliases_typealiastype.py:62:42: error: Invalid type expression in `TypeAliasType` for `BadAlias18` [aliases_typealiastype] -aliases_typealiastype.py:63:42: error: Invalid type expression in `TypeAliasType` for `BadAlias19` [aliases_typealiastype] -aliases_typealiastype.py:64:42: error: Invalid type expression in `TypeAliasType` for `BadAlias20` [aliases_typealiastype] -aliases_typealiastype.py:66:14: error: Type alias `BadAlias21` references itself, creating a circular dependency [aliases_typealiastype] -""" diff --git a/conformance/results/basilisk/aliases_variance.toml b/conformance/results/basilisk/aliases_variance.toml deleted file mode 100644 index 19ef4ea2f..000000000 --- a/conformance/results/basilisk/aliases_variance.toml +++ /dev/null @@ -1,10 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -aliases_variance.py:24:16: error: Variance incompatibility in base class `ClassA`: `T_co` is covariant but the corresponding type parameter is invariant [generics_variance] -aliases_variance.py:28:16: error: Variance incompatibility in base class `A_Alias_1`: `T_co` is covariant but the corresponding type parameter is invariant [generics_variance] -aliases_variance.py:32:16: error: Variance incompatibility in base class `A_Alias_2`: `T_co` is covariant but the corresponding type parameter is invariant [generics_variance] -aliases_variance.py:44:16: error: Variance incompatibility in base class `B_Alias_1`: `T_contra` is contravariant but the corresponding type parameter is invariant [generics_variance] -""" diff --git a/conformance/results/basilisk/annotations_coroutines.toml b/conformance/results/basilisk/annotations_coroutines.toml deleted file mode 100644 index be211bd5b..000000000 --- a/conformance/results/basilisk/annotations_coroutines.toml +++ /dev/null @@ -1,6 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -""" diff --git a/conformance/results/basilisk/annotations_forward_refs.toml b/conformance/results/basilisk/annotations_forward_refs.toml deleted file mode 100644 index aa704ef86..000000000 --- a/conformance/results/basilisk/annotations_forward_refs.toml +++ /dev/null @@ -1,25 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -annotations_forward_refs.py:24:1: error: Invalid type expression in annotation for `bad3` [annotations_forward_refs] -annotations_forward_refs.py:25:1: error: Invalid type expression in annotation for `bad4` [annotations_forward_refs] -annotations_forward_refs.py:41:5: error: Invalid type expression in annotation for parameter `p1` [annotations_forward_refs] -annotations_forward_refs.py:42:5: error: Invalid type expression in annotation for parameter `p2` [annotations_forward_refs] -annotations_forward_refs.py:43:5: error: Invalid type expression in annotation for parameter `p3` [annotations_forward_refs] -annotations_forward_refs.py:44:5: error: Invalid type expression in annotation for parameter `p4` [annotations_forward_refs] -annotations_forward_refs.py:45:5: error: Invalid type expression in annotation for parameter `p5` [annotations_forward_refs] -annotations_forward_refs.py:46:5: error: Invalid type expression in annotation for parameter `p6` [annotations_forward_refs] -annotations_forward_refs.py:47:5: error: Invalid type expression in annotation for parameter `p7` [annotations_forward_refs] -annotations_forward_refs.py:48:5: error: Invalid type expression in annotation for parameter `p8` [annotations_forward_refs] -annotations_forward_refs.py:49:5: error: Invalid type expression in annotation for parameter `p9` [annotations_forward_refs] -annotations_forward_refs.py:50:5: error: Invalid type expression in annotation for parameter `p10` [annotations_forward_refs] -annotations_forward_refs.py:51:5: error: Invalid type expression in annotation for parameter `p11` [annotations_forward_refs] -annotations_forward_refs.py:52:5: error: Invalid type expression in annotation for parameter `p12` [annotations_forward_refs] -annotations_forward_refs.py:53:5: error: Invalid type expression in annotation for parameter `p13` [annotations_forward_refs] -annotations_forward_refs.py:54:5: error: Invalid type expression in annotation for parameter `p14` [annotations_forward_refs] -annotations_forward_refs.py:55:5: error: Invalid type expression in annotation for parameter `p15` [annotations_forward_refs] -annotations_forward_refs.py:80:5: error: Invalid type expression in annotation for attribute `ClassF` [annotations_forward_refs] -annotations_forward_refs.py:89:5: error: Invalid type expression in annotation for attribute `y` [annotations_forward_refs] -""" diff --git a/conformance/results/basilisk/annotations_generators.toml b/conformance/results/basilisk/annotations_generators.toml deleted file mode 100644 index fad409909..000000000 --- a/conformance/results/basilisk/annotations_generators.toml +++ /dev/null @@ -1,23 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -annotations_generators.py:51:1: error: Generator function `generator2` is missing a return statement; declared return type is `c` [annotations_generators] -annotations_generators.py:51:1: error: Generator `generator2` is annotated to return `C` but has no valid return path [annotations_generators_2] -annotations_generators.py:54:9: error: Incompatible return type in generator `generator2`: `bool` is not assignable to `c` [annotations_generators] -annotations_generators.py:57:9: error: Incompatible yield type in `generator2`: `int` is not assignable to `a` [annotations_generators] -annotations_generators.py:57:9: error: Incompatible yield type in `generator2`: expected `A`, got `3` [annotations_generators_2] -annotations_generators.py:66:9: error: Incompatible yield type in `generator3`: `int` is not assignable to `a` [annotations_generators] -annotations_generators.py:66:9: error: Incompatible yield type in `generator3`: expected `A`, got `3` [annotations_generators_2] -annotations_generators.py:75:5: error: Incompatible yield type in `generator5`: `b` is not assignable to `a` [annotations_generators] -annotations_generators.py:75:5: error: Incompatible yield type in `generator5`: expected `A`, got `B()` [annotations_generators_2] -annotations_generators.py:86:21: error: Generator function `generator8` has incompatible return type `int` [annotations_generators] -annotations_generators.py:91:27: error: Generator function `generator9` has incompatible return type `int` [annotations_generators] -annotations_generators.py:118:5: error: Incompatible `yield from` in `generator18`: sub-generator yields `a` but `b` is expected [annotations_generators] -annotations_generators.py:118:5: error: Incompatible `yield from` in `generator18`: `generator17` yields `A` but `B` expected [annotations_generators_2] -annotations_generators.py:119:5: error: Incompatible `yield from` in `generator18`: list element type `int` is not assignable to yield type `b` [annotations_generators] -annotations_generators.py:119:5: error: Incompatible `yield from` in `generator18`: list elements are `int` but `B` expected [annotations_generators_2] -annotations_generators.py:135:5: error: Incompatible `yield from` send type in `generator22`: outer sends `str` but sub-generator accepts `int` [annotations_generators] -annotations_generators.py:135:5: error: Incompatible send type in `yield from` in `generator22`: `generator21` expects send type `int` but outer generator sends `str` [annotations_generators_2] -""" diff --git a/conformance/results/basilisk/annotations_methods.toml b/conformance/results/basilisk/annotations_methods.toml deleted file mode 100644 index be211bd5b..000000000 --- a/conformance/results/basilisk/annotations_methods.toml +++ /dev/null @@ -1,6 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -""" diff --git a/conformance/results/basilisk/annotations_typeexpr.toml b/conformance/results/basilisk/annotations_typeexpr.toml deleted file mode 100644 index f4c9ebe2c..000000000 --- a/conformance/results/basilisk/annotations_typeexpr.toml +++ /dev/null @@ -1,22 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -annotations_typeexpr.py:88:5: error: Invalid type expression in annotation for parameter `p1` [annotations_forward_refs] -annotations_typeexpr.py:89:5: error: Invalid type expression in annotation for parameter `p2` [annotations_forward_refs] -annotations_typeexpr.py:90:5: error: Invalid type expression in annotation for parameter `p3` [annotations_forward_refs] -annotations_typeexpr.py:91:5: error: Invalid type expression in annotation for parameter `p4` [annotations_forward_refs] -annotations_typeexpr.py:92:5: error: Invalid type expression in annotation for parameter `p5` [annotations_forward_refs] -annotations_typeexpr.py:93:5: error: Invalid type expression in annotation for parameter `p6` [annotations_forward_refs] -annotations_typeexpr.py:94:5: error: Invalid type expression in annotation for parameter `p7` [annotations_forward_refs] -annotations_typeexpr.py:95:5: error: Invalid type expression in annotation for parameter `p8` [annotations_forward_refs] -annotations_typeexpr.py:96:5: error: Invalid type expression in annotation for parameter `p9` [annotations_forward_refs] -annotations_typeexpr.py:96:9: error: Variable `var1` is not a valid type and cannot be used as an annotation [aliases_implicit] -annotations_typeexpr.py:97:5: error: Invalid type annotation on `p10` — numeric literals are not valid types [annotations_typeexpr] -annotations_typeexpr.py:98:5: error: Invalid type annotation on `p11` — numeric literals are not valid types [annotations_typeexpr] -annotations_typeexpr.py:99:5: error: Invalid type expression in annotation for parameter `p12` [annotations_forward_refs] -annotations_typeexpr.py:100:5: error: Invalid type expression in annotation for parameter `p13` [annotations_forward_refs] -annotations_typeexpr.py:101:5: error: Invalid type expression in annotation for parameter `p14` [annotations_forward_refs] -annotations_typeexpr.py:102:5: error: Invalid type expression in annotation for parameter `p15` [annotations_forward_refs] -""" diff --git a/conformance/results/basilisk/callables_annotation.toml b/conformance/results/basilisk/callables_annotation.toml deleted file mode 100644 index 4c7319930..000000000 --- a/conformance/results/basilisk/callables_annotation.toml +++ /dev/null @@ -1,22 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -callables_annotation.py:25:5: error: Too few arguments for `cb`: expected 2 but got 1 [callables_protocol] -callables_annotation.py:26:11: error: Argument 2 to `cb` has incompatible type `int`; expected `str` [callables_protocol] -callables_annotation.py:27:5: error: Too many arguments for `cb`: expected 2 but got 3 [callables_protocol] -callables_annotation.py:29:5: error: `Callable` parameter `cb` does not accept keyword arguments [callables_protocol] -callables_annotation.py:35:5: error: Too many arguments for `cb`: expected 0 but got 1 [callables_protocol] -callables_annotation.py:55:1: error: Invalid type argument count in annotation `Callable[int]` on `v1`: `callable` takes 2 type arguments but 1 was provided [callables_annotation] -callables_annotation.py:56:1: error: Invalid `Callable` annotation on `v2`: first argument `int` is not a valid parameter specification; expected `[arg_types]`, `...`, a `ParamSpec`, or `Concatenate[...]` [callables_annotation] -callables_annotation.py:57:1: error: Invalid `Callable` annotation on `v3`: return type `[int]` is a list literal; use a plain type instead [callables_annotation] -callables_annotation.py:58:1: error: Invalid type argument count in annotation `Callable[int, int, int]` on `v4`: `callable` takes 2 type arguments but 3 were provided [callables_annotation] -callables_annotation.py:59:1: error: Invalid `Callable` annotation on `v5`: `[...]` is not valid; use bare `...` for an arbitrary parameter list [callables_annotation] -callables_annotation.py:91:1: error: Function `test_cb2` incompatible with `Callable[Concatenate[int, ...], str]`: needs at least 1 positional param(s) but has 0 [callables_protocol_2] -callables_annotation.py:93:1: error: Function `test_cb4` incompatible with `Callable[Concatenate[int, ...], str]`: Concatenate requires positional params [callables_protocol_2] -callables_annotation.py:159:5: error: Type mismatch: `err1` is annotated `Proto5[Any]` (proto5[any]) but assigned proto8 [assignment_compatibility] -callables_annotation.py:172:5: error: Type mismatch: `f2` is annotated `Callback2[...]` (callback2[...]) but assigned Callable[[], str] [assignment_compatibility] -callables_annotation.py:187:5: error: Type mismatch: `f2` is annotated `Callable[Concatenate[str, ...], str]` (Callable[[concatenate[str, ...]], str]) but assigned Callable[[int, str], str] [assignment_compatibility] -callables_annotation.py:189:5: error: Type mismatch: `f4` is annotated `CallbackWithStr[...]` (callbackwithstr[...]) but assigned Callable[[int, str], str] [assignment_compatibility] -""" diff --git a/conformance/results/basilisk/callables_kwargs.toml b/conformance/results/basilisk/callables_kwargs.toml deleted file mode 100644 index 73fbb3367..000000000 --- a/conformance/results/basilisk/callables_kwargs.toml +++ /dev/null @@ -1,19 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -callables_kwargs.py:46:5: error: Call to `func1` missing required keyword arguments from `TD2` [callables_kwargs] -callables_kwargs.py:51:5: error: Keyword `v4` in call to `func1` is not a key of TypedDict `TD2` [callables_kwargs] -callables_kwargs.py:52:5: error: Cannot pass positional arguments to `func1` for Unpack[TD2] kwargs [callables_kwargs] -callables_kwargs.py:58:5: error: Cannot spread `my_dict: dict[str, str]` into `func1` with Unpack[TD2] kwargs [callables_kwargs] -callables_kwargs.py:63:5: error: Keyword `v1` in call to `func1` conflicts with `**td2` [callables_kwargs] -callables_kwargs.py:64:11: error: Argument `v3` of `func2` expects `str` but received an `int` literal [calls_argument_type] -callables_kwargs.py:65:5: error: Keyword `v1` in call to `func2` conflicts with `**td2` [callables_kwargs] -callables_kwargs.py:101:1: error: Function `func1` incompatible with `TDProtocol3`: keyword param `v2` type `str` vs `int` [callables_protocol_2] -callables_kwargs.py:102:1: error: Function `func1` incompatible with `TDProtocol4`: requires keyword `v3` not in protocol [callables_protocol_2] -callables_kwargs.py:103:1: error: Function `func1` incompatible with `TDProtocol5`: missing required params [callables_protocol_2] -callables_kwargs.py:111:1: error: Parameter `v1` overlaps with TypedDict `TD2` key `v1` [callables_kwargs] -callables_kwargs.py:122:1: error: Invalid `**kwargs: Unpack[T]`: `T` is a TypeVar, not a TypedDict [callables_kwargs] -callables_kwargs.py:134:1: error: Function `func7` incompatible with `TDProtocol6`: missing `**kwargs` [callables_protocol_2] -""" diff --git a/conformance/results/basilisk/callables_protocol.toml b/conformance/results/basilisk/callables_protocol.toml deleted file mode 100644 index 09950285d..000000000 --- a/conformance/results/basilisk/callables_protocol.toml +++ /dev/null @@ -1,25 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -callables_protocol.py:35:1: error: Function `cb1_bad1` incompatible with `Proto1`: missing keyword param `max_len` [callables_protocol_2] -callables_protocol.py:35:1: error: Function `cb1_bad1` incompatible with `Proto1`: requires keyword `max_items` not in protocol [callables_protocol_2] -callables_protocol.py:36:1: error: Function `cb1_bad2` incompatible with `Proto1`: missing keyword param `max_len` [callables_protocol_2] -callables_protocol.py:37:1: error: Function `cb1_bad3` incompatible with `Proto1`: keyword param `max_len` needs default [callables_protocol_2] -callables_protocol.py:37:1: error: Function `cb1_bad3` incompatible with `Proto1`: keyword param `max_len` type `str | None` vs `int | None` [callables_protocol_2] -callables_protocol.py:67:1: error: Function `cb2_bad1` incompatible with `Proto2`: missing `**kwargs` [callables_protocol_2] -callables_protocol.py:68:1: error: Function `cb2_bad2` incompatible with `Proto2`: *args type `str` vs `bytes` [callables_protocol_2] -callables_protocol.py:69:1: error: Function `cb2_bad3` incompatible with `Proto2`: **kwargs type `bytes` vs `str` [callables_protocol_2] -callables_protocol.py:70:1: error: Function `cb2_bad4` incompatible with `Proto2`: missing `*args` [callables_protocol_2] -callables_protocol.py:97:1: error: Function `cb4_bad1` cannot satisfy protocol `Proto4`: protocol has extra attributes [callables_protocol_2] -callables_protocol.py:121:1: error: Cannot assign function `cb6_bad1` to non-protocol type `NotProto6` [callables_protocol_2] -callables_protocol.py:169:1: error: Function `cb8_bad1` incompatible with `Proto8`: overload param `x` type `str` not accepted by `int` [callables_protocol_2] -callables_protocol.py:186:5: error: Cannot assign `str` to `Proto9.other_attribute` of type `int` [callables_protocol_2] -callables_protocol.py:187:5: error: Protocol `Proto9` has no attribute `xxx` [callables_protocol_2] -callables_protocol.py:197:7: error: Protocol `Proto9` has no attribute `other_attribute2` [callables_protocol_2] -callables_protocol.py:238:1: error: Function `cb11_bad1` incompatible with `Proto11`: param `y` is pos-only but must accept keyword [callables_protocol_2] -callables_protocol.py:260:1: error: Function `cb12_bad1` incompatible with `Proto12`: missing keyword param `kwarg1` [callables_protocol_2] -callables_protocol.py:284:1: error: Function `cb13_no_default` incompatible with `Proto13_Default`: param `path` needs default [callables_protocol_2] -callables_protocol.py:311:1: error: Function `cb14_no_default` incompatible with `Proto14_Default`: keyword param `path` needs default [callables_protocol_2] -""" diff --git a/conformance/results/basilisk/callables_subtyping.toml b/conformance/results/basilisk/callables_subtyping.toml deleted file mode 100644 index 60ae16397..000000000 --- a/conformance/results/basilisk/callables_subtyping.toml +++ /dev/null @@ -1,40 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -callables_subtyping.py:26:5: error: Type mismatch: `f6` is annotated `Callable[[float], float]` (Callable[[float], float]) but assigned Callable[[int], int] [assignment_compatibility] -callables_subtyping.py:26:5: error: Callable subtyping violation: parameter type(s) of `cb3` are not supertypes of `Callable[[float], float]` parameter types (parameters must be contravariant) [callables_subtyping] -callables_subtyping.py:29:5: error: Type mismatch: `f8` is annotated `Callable[[int], int]` (Callable[[int], int]) but assigned Callable[[float], float] [assignment_compatibility] -callables_subtyping.py:29:5: error: Callable subtyping violation: return type `float` is not a subtype of `int` (return types must be covariant) [callables_subtyping] -callables_subtyping.py:51:5: error: Type mismatch: `f1` is annotated `Standard2` (standard2) but assigned posonly2 [assignment_compatibility] -callables_subtyping.py:52:5: error: Type mismatch: `f2` is annotated `Standard2` (standard2) but assigned kwonly2 [assignment_compatibility] -callables_subtyping.py:55:5: error: Type mismatch: `f4` is annotated `PosOnly2` (posonly2) but assigned kwonly2 [assignment_compatibility] -callables_subtyping.py:58:5: error: Type mismatch: `f6` is annotated `KwOnly2` (kwonly2) but assigned posonly2 [assignment_compatibility] -callables_subtyping.py:82:5: error: Type mismatch: `f3` is annotated `IntArgs3` (intargs3) but assigned noargs3 [assignment_compatibility] -callables_subtyping.py:85:5: error: Type mismatch: `f5` is annotated `FloatArgs3` (floatargs3) but assigned noargs3 [assignment_compatibility] -callables_subtyping.py:86:5: error: Type mismatch: `f6` is annotated `FloatArgs3` (floatargs3) but assigned intargs3 [assignment_compatibility] -callables_subtyping.py:116:5: error: Type mismatch: `f1` is annotated `PosOnly4` (posonly4) but assigned intargs4 [assignment_compatibility] -callables_subtyping.py:119:5: error: Type mismatch: `f4` is annotated `IntStrArgs4` (intstrargs4) but assigned strargs4 [assignment_compatibility] -callables_subtyping.py:120:5: error: Type mismatch: `f5` is annotated `IntStrArgs4` (intstrargs4) but assigned intargs4 [assignment_compatibility] -callables_subtyping.py:122:5: error: Type mismatch: `f7` is annotated `StrArgs4` (strargs4) but assigned intargs4 [assignment_compatibility] -callables_subtyping.py:124:5: error: Type mismatch: `f9` is annotated `IntArgs4` (intargs4) but assigned strargs4 [assignment_compatibility] -callables_subtyping.py:125:5: error: Type mismatch: `f10` is annotated `Standard4` (standard4) but assigned intstrargs4 [assignment_compatibility] -callables_subtyping.py:126:5: error: Type mismatch: `f11` is annotated `Standard4` (standard4) but assigned strargs4 [assignment_compatibility] -callables_subtyping.py:151:5: error: Type mismatch: `f3` is annotated `IntKwargs5` (intkwargs5) but assigned nokwargs5 [assignment_compatibility] -callables_subtyping.py:154:5: error: Type mismatch: `f5` is annotated `FloatKwargs5` (floatkwargs5) but assigned nokwargs5 [assignment_compatibility] -callables_subtyping.py:155:5: error: Type mismatch: `f6` is annotated `FloatKwargs5` (floatkwargs5) but assigned intkwargs5 [assignment_compatibility] -callables_subtyping.py:187:5: error: Type mismatch: `f1` is annotated `KwOnly6` (kwonly6) but assigned intkwargs6 [assignment_compatibility] -callables_subtyping.py:190:5: error: Type mismatch: `f4` is annotated `IntStrKwargs6` (intstrkwargs6) but assigned strkwargs6 [assignment_compatibility] -callables_subtyping.py:191:5: error: Type mismatch: `f5` is annotated `IntStrKwargs6` (intstrkwargs6) but assigned intkwargs6 [assignment_compatibility] -callables_subtyping.py:193:5: error: Type mismatch: `f7` is annotated `StrKwargs6` (strkwargs6) but assigned intkwargs6 [assignment_compatibility] -callables_subtyping.py:195:5: error: Type mismatch: `f9` is annotated `IntKwargs6` (intkwargs6) but assigned strkwargs6 [assignment_compatibility] -callables_subtyping.py:196:5: error: Type mismatch: `f10` is annotated `Standard6` (standard6) but assigned intstrkwargs6 [assignment_compatibility] -callables_subtyping.py:197:5: error: Type mismatch: `f11` is annotated `Standard6` (standard6) but assigned strkwargs6 [assignment_compatibility] -callables_subtyping.py:236:5: error: Type mismatch: `f1` is annotated `DefaultArg8` (defaultarg8) but assigned nodefaultarg8 [assignment_compatibility] -callables_subtyping.py:237:5: error: Type mismatch: `f2` is annotated `DefaultArg8` (defaultarg8) but assigned nox8 [assignment_compatibility] -callables_subtyping.py:240:5: error: Type mismatch: `f4` is annotated `NoDefaultArg8` (nodefaultarg8) but assigned nox8 [assignment_compatibility] -callables_subtyping.py:243:5: error: Type mismatch: `f6` is annotated `NoX8` (nox8) but assigned nodefaultarg8 [assignment_compatibility] -callables_subtyping.py:273:5: error: Type mismatch: `f3` is annotated `FloatArg9` (floatarg9) but assigned overloaded9 [assignment_compatibility] -callables_subtyping.py:297:5: error: Type mismatch: `f2` is annotated `Overloaded10` (overloaded10) but assigned strarg10 [assignment_compatibility] -""" diff --git a/conformance/results/basilisk/classes_classvar.toml b/conformance/results/basilisk/classes_classvar.toml deleted file mode 100644 index c35593eac..000000000 --- a/conformance/results/basilisk/classes_classvar.toml +++ /dev/null @@ -1,29 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -classes_classvar.py:38:5: error: `ClassVar` accepts at most one type argument, but `bad1` has 2 [classes_classvar] -classes_classvar.py:39:5: error: Invalid `ClassVar` argument for `bad2`: `3` is not a valid type [classes_classvar] -classes_classvar.py:40:5: error: Invalid `ClassVar` argument for `bad3`: `var` is a runtime variable, not a type [classes_classvar] -classes_classvar.py:45:5: error: `ClassVar` parameter for `bad4` cannot contain TypeVar [classes_classvar] -classes_classvar.py:46:5: error: `ClassVar` parameter for `bad5` cannot contain TypeVar [classes_classvar] -classes_classvar.py:47:5: error: `ClassVar` parameter for `bad6` cannot contain ParamSpec [classes_classvar] -classes_classvar.py:52:5: error: Type mismatch in `ClassVar` attribute `bad8`: annotated as `list[str]` but initialized with a dict literal [classes_classvar] -classes_classvar.py:54:5: error: `ClassVar` cannot be nested inside another type in attribute `bad9` [classes_classvar] -classes_classvar.py:54:5: error: `ClassVar` cannot be used inside `Final` for attribute `bad9` [qualifiers_final_annotation] -classes_classvar.py:55:5: error: `ClassVar` cannot be nested inside another type in attribute `bad10` [classes_classvar] -classes_classvar.py:69:23: error: `ClassVar` is not allowed in parameter annotation for `a` [classes_classvar] -classes_classvar.py:70:9: error: Type mismatch: `x` is annotated `ClassVar[str]` (classvar[str]) but assigned str [assignment_compatibility] -classes_classvar.py:70:9: error: `ClassVar` is not allowed in local variable annotation for `x` [classes_classvar] -classes_classvar.py:71:9: error: `ClassVar` is not allowed in self-attribute annotation for `xx` [classes_classvar] -classes_classvar.py:73:9: error: `ClassVar` is not allowed in the return annotation of `method2` [classes_classvar] -classes_classvar.py:77:1: error: Type mismatch: `bad11` is annotated `ClassVar[int]` (classvar[int]) but assigned int [assignment_compatibility] -classes_classvar.py:77:1: error: `ClassVar` is not allowed in module-level annotation for `bad11` [classes_classvar] -classes_classvar.py:78:1: error: `ClassVar` is not allowed in right-hand side of module-level assignment for `bad12` [classes_classvar] -classes_classvar.py:111:1: error: Cannot assign to `ClassVar` attribute `stats` through an instance of `Starship` [classes_classvar] -classes_classvar.py:140:1: error: Class `ProtoAImpl` is not compatible with protocol `ProtoA`: attribute `x` is required to be a class variable (`ClassVar`) but is declared as an instance variable [classes_classvar] -classes_classvar.py:140:1: error: Class `ProtoAImpl` is not compatible with protocol `ProtoA`: attribute `y` is required to be a class variable (`ClassVar`) but is not defined at class level [classes_classvar] -classes_classvar.py:140:1: error: Class `ProtoAImpl` is not compatible with protocol `ProtoA`: attribute `z` is required to be a class variable (`ClassVar`) but is not defined at class level [classes_classvar] -classes_classvar.py:140:1: error: Class `ProtoAImpl` is incompatible with protocol `ProtoA`: missing instance variable `z` [protocols_definition_2] -""" diff --git a/conformance/results/basilisk/classes_override.toml b/conformance/results/basilisk/classes_override.toml deleted file mode 100644 index d7897143a..000000000 --- a/conformance/results/basilisk/classes_override.toml +++ /dev/null @@ -1,11 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -classes_override.py:53:9: error: Method `method3` in `ChildA` is decorated with `@override` but no matching method exists in any base class [classes_override_3] -classes_override.py:65:9: error: Method `method4` in `ChildA` is decorated with `@override` but no matching method exists in any base class [classes_override_3] -classes_override.py:79:9: error: Method `static_method1` in `ChildA` is decorated with `@override` but no matching method exists in any base class [classes_override_3] -classes_override.py:84:9: error: Method `class_method1` in `ChildA` is decorated with `@override` but no matching method exists in any base class [classes_override_3] -classes_override.py:89:9: error: Method `property1` in `ChildA` is decorated with `@override` but no matching method exists in any base class [classes_override_3] -""" diff --git a/conformance/results/basilisk/constructors_call_init.toml b/conformance/results/basilisk/constructors_call_init.toml deleted file mode 100644 index ad3f4129e..000000000 --- a/conformance/results/basilisk/constructors_call_init.toml +++ /dev/null @@ -1,12 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -constructors_call_init.py:21:1: error: Class1[int].__init__ parameter `x` expects `int` but received a `float` literal [generics_defaults_referential_2] -constructors_call_init.py:21:13: error: Argument type `float` is incompatible with parameter `x` of type `int` in `Class1.__init__` [constructors_call_init] -constructors_call_init.py:42:1: error: `Class2` instance is not compatible with `Self` type of `Class3` in `__init__` [constructors_call_init] -constructors_call_init.py:56:1: error: `Class4[str]()` is incompatible: `__init__` expects `self: Class4[int]` but received `Class4[str]` [constructors_call_init] -constructors_call_init.py:107:5: error: Class-scoped type variables should not be used in the `self` annotation of `__init__` in class `Class8` [constructors_call_init] -constructors_call_init.py:130:1: error: Class `Class11` does not define `__init__` or `__new__` and inherits only from `object`; constructor does not accept arguments [constructors_call_init] -""" diff --git a/conformance/results/basilisk/constructors_call_metaclass.toml b/conformance/results/basilisk/constructors_call_metaclass.toml deleted file mode 100644 index 020ad8a5f..000000000 --- a/conformance/results/basilisk/constructors_call_metaclass.toml +++ /dev/null @@ -1,8 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -constructors_call_metaclass.py:54:1: error: Call to `Class3()` is missing 1 required argument for `__new__` (expected 1, got 0) [calls_argument_count] -constructors_call_metaclass.py:68:1: error: Call to `Class4()` is missing 1 required argument for `__new__` (expected 1, got 0) [calls_argument_count] -""" diff --git a/conformance/results/basilisk/constructors_call_new.toml b/conformance/results/basilisk/constructors_call_new.toml deleted file mode 100644 index 39fbf567d..000000000 --- a/conformance/results/basilisk/constructors_call_new.toml +++ /dev/null @@ -1,8 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -constructors_call_new.py:21:13: error: Argument type `float` is incompatible with parameter `x` of type `int` in `Class1.__new__` [constructors_call_new] -constructors_call_new.py:148:1: error: `Class11[str]()` is incompatible: `__new__` expects `cls: type[Class11[int]]` but received `type[Class11[str]]` [constructors_call_new] -""" diff --git a/conformance/results/basilisk/constructors_call_type.toml b/conformance/results/basilisk/constructors_call_type.toml deleted file mode 100644 index 56a59f0b5..000000000 --- a/conformance/results/basilisk/constructors_call_type.toml +++ /dev/null @@ -1,14 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -constructors_call_type.py:30:5: error: `Class1` constructor requires at least 2 argument(s) but 0 were provided via `type[Class1]` [constructors_call_type] -constructors_call_type.py:40:5: error: `Class2` constructor requires at least 2 argument(s) but 0 were provided via `type[Class2]` [constructors_call_type] -constructors_call_type.py:50:5: error: `Class3` constructor requires at least 2 argument(s) but 0 were provided via `type[Class3]` [constructors_call_type] -constructors_call_type.py:59:5: error: `Class4` constructor takes no arguments but 1 argument(s) were provided via `type[Class4]` [constructors_call_type] -constructors_call_type.py:64:5: error: Cannot pass arguments to constructor of unbound type variable `T`; its constructor signature is unknown [constructors_call_type] -constructors_call_type.py:72:5: error: `Class1` constructor requires at least 2 argument(s) but 0 were provided via `type[Class1]` [constructors_call_type] -constructors_call_type.py:81:5: error: `Class2` constructor requires at least 2 argument(s) but 1 were provided via `type[Class2]` [constructors_call_type] -constructors_call_type.py:82:12: error: Argument 2 has type `int` but parameter `y` of `Class2` constructor expects `str` [constructors_call_type] -""" diff --git a/conformance/results/basilisk/constructors_callable.toml b/conformance/results/basilisk/constructors_callable.toml deleted file mode 100644 index 4a09f2734..000000000 --- a/conformance/results/basilisk/constructors_callable.toml +++ /dev/null @@ -1,20 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -constructors_callable.py:38:1: error: Call to the constructor-derived callable for `Class1` is missing required argument `x` (expected 1, got 0) [constructors_callable] -constructors_callable.py:39:1: error: Unexpected keyword argument `y` in call to the constructor-derived callable for `Class1` [constructors_callable] -constructors_callable.py:51:1: error: Call to the constructor-derived callable for `Class2` has 1 too many positional argument (expected at most 0, got 1) [constructors_callable] -constructors_callable.py:66:1: error: Call to the constructor-derived callable for `Class3` is missing required argument `x` (expected 1, got 0) [constructors_callable] -constructors_callable.py:67:1: error: Unexpected keyword argument `y` in call to the constructor-derived callable for `Class3` [constructors_callable] -constructors_callable.py:68:1: error: Call to the constructor-derived callable for `Class3` has 1 too many positional argument (expected at most 1, got 2) [constructors_callable] -constructors_callable.py:81:1: error: Call to the constructor-derived callable for `Class4` is missing required argument `x` (expected 1, got 0) [constructors_callable] -constructors_callable.py:82:1: error: Unexpected keyword argument `y` in call to the constructor-derived callable for `Class4` [constructors_callable] -constructors_callable.py:129:1: error: Call to the constructor-derived callable for `Class6` has 1 too many positional argument (expected at most 0, got 1) [constructors_callable] -constructors_callable.py:146:1: error: Call to the constructor-derived callable for `Class6Any` has 1 too many positional argument (expected at most 0, got 1) [constructors_callable] -constructors_callable.py:185:10: error: Argument for the `list[T]` parameter of the constructor-derived callable for `Class8` is a `str` literal — no assignment of type variable `T` makes it valid [constructors_callable] -constructors_callable.py:187:1: error: Inconsistent binding for type variable `T` in call to the constructor-derived callable for `Class8`: `list[int]` vs `list[str]` [constructors_callable] -constructors_callable.py:197:10: error: Argument for the `list[T]` parameter of the constructor-derived callable for `Class9` is a `str` literal — no assignment of type variable `T` makes it valid [constructors_callable] -constructors_callable.py:199:1: error: Inconsistent binding for type variable `T` in call to the constructor-derived callable for `Class9`: `list[int]` vs `list[str]` [constructors_callable] -""" diff --git a/conformance/results/basilisk/constructors_consistency.toml b/conformance/results/basilisk/constructors_consistency.toml deleted file mode 100644 index be211bd5b..000000000 --- a/conformance/results/basilisk/constructors_consistency.toml +++ /dev/null @@ -1,6 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -""" diff --git a/conformance/results/basilisk/dataclasses_descriptors.toml b/conformance/results/basilisk/dataclasses_descriptors.toml deleted file mode 100644 index be211bd5b..000000000 --- a/conformance/results/basilisk/dataclasses_descriptors.toml +++ /dev/null @@ -1,6 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -""" diff --git a/conformance/results/basilisk/dataclasses_final.toml b/conformance/results/basilisk/dataclasses_final.toml deleted file mode 100644 index 27f88ef50..000000000 --- a/conformance/results/basilisk/dataclasses_final.toml +++ /dev/null @@ -1,11 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -dataclasses_final.py:27:1: error: Cannot assign to `D.final_classvar` — it is declared `Final` in `D` [qualifiers_final_annotation_2] -dataclasses_final.py:35:1: error: Cannot assign to `d.final_no_default` — it is declared `Final` in `d` [qualifiers_final_annotation_2] -dataclasses_final.py:36:1: error: Cannot assign to `d.final_with_default` — it is declared `Final` in `d` [qualifiers_final_annotation_2] -dataclasses_final.py:37:1: error: Cannot assign to `D.final_no_default` — it is declared `Final` in `D` [qualifiers_final_annotation_2] -dataclasses_final.py:38:1: error: Cannot assign to `D.final_with_default` — it is declared `Final` in `D` [qualifiers_final_annotation_2] -""" diff --git a/conformance/results/basilisk/dataclasses_frozen.toml b/conformance/results/basilisk/dataclasses_frozen.toml deleted file mode 100644 index 4097251e6..000000000 --- a/conformance/results/basilisk/dataclasses_frozen.toml +++ /dev/null @@ -1,10 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -dataclasses_frozen.py:16:1: error: Cannot assign to attribute `a` of frozen dataclass `DC1` instance `dc1` [dataclasses_frozen] -dataclasses_frozen.py:17:1: error: Cannot assign to attribute `b` of frozen dataclass `DC1` instance `dc1` [dataclasses_frozen] -dataclasses_frozen.py:22:1: error: Non-frozen dataclass `DC2` cannot inherit from frozen dataclass `DC1` [dataclasses_frozen] -dataclasses_frozen.py:32:1: error: Frozen dataclass `DC4` cannot inherit from non-frozen dataclass `DC3` [dataclasses_frozen] -""" diff --git a/conformance/results/basilisk/dataclasses_hash.toml b/conformance/results/basilisk/dataclasses_hash.toml deleted file mode 100644 index e958053e1..000000000 --- a/conformance/results/basilisk/dataclasses_hash.toml +++ /dev/null @@ -1,10 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -dataclasses_hash.py:17:1: error: Cannot call `.__hash__()` on `DC1` instance: `DC1.__hash__` is `None` [dataclasses_hash] -dataclasses_hash.py:18:1: error: Cannot assign `DC1` instance to `Hashable`-annotated variable `v1`: `DC1` is not hashable [dataclasses_hash] -dataclasses_hash.py:39:1: error: Cannot call `.__hash__()` on `DC3` instance: `DC3.__hash__` is `None` [dataclasses_hash] -dataclasses_hash.py:40:1: error: Cannot assign `DC3` instance to `Hashable`-annotated variable `v3`: `DC3` is not hashable [dataclasses_hash] -""" diff --git a/conformance/results/basilisk/dataclasses_inheritance.toml b/conformance/results/basilisk/dataclasses_inheritance.toml deleted file mode 100644 index 58c442b1f..000000000 --- a/conformance/results/basilisk/dataclasses_inheritance.toml +++ /dev/null @@ -1,8 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -dataclasses_inheritance.py:62:5: error: Attribute `x` in `DC7` has type `ClassVar[int]` but base class `DC6` declares it as `int` [classes_override_2] -dataclasses_inheritance.py:66:5: error: Attribute `y` in `DC7` has type `int` but base class `DC6` declares it as `ClassVar[int]` [classes_override_2] -""" diff --git a/conformance/results/basilisk/dataclasses_kwonly.toml b/conformance/results/basilisk/dataclasses_kwonly.toml deleted file mode 100644 index fd01639e2..000000000 --- a/conformance/results/basilisk/dataclasses_kwonly.toml +++ /dev/null @@ -1,9 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -dataclasses_kwonly.py:23:11: error: Too many positional arguments to `DC1`: 1 argument(s) must be passed as keyword arguments [dataclasses_kwonly] -dataclasses_kwonly.py:38:11: error: Too many positional arguments to `DC2`: 1 argument(s) must be passed as keyword arguments [dataclasses_kwonly] -dataclasses_kwonly.py:53:11: error: Too many positional arguments to `DC3`: 1 argument(s) must be passed as keyword arguments [dataclasses_kwonly] -""" diff --git a/conformance/results/basilisk/dataclasses_match_args.toml b/conformance/results/basilisk/dataclasses_match_args.toml deleted file mode 100644 index 5793cef05..000000000 --- a/conformance/results/basilisk/dataclasses_match_args.toml +++ /dev/null @@ -1,7 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -dataclasses_match_args.py:42:1: error: `DC4.__match_args__` does not exist: `@dataclass(match_args=False)` suppresses `__match_args__` generation [dataclasses_match_args] -""" diff --git a/conformance/results/basilisk/dataclasses_order.toml b/conformance/results/basilisk/dataclasses_order.toml deleted file mode 100644 index 681193b84..000000000 --- a/conformance/results/basilisk/dataclasses_order.toml +++ /dev/null @@ -1,7 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -dataclasses_order.py:50:4: error: Cannot compare `DC1` and `DC2` with ordering operator: `@dataclass(order=True)` comparison methods only accept the same type [dataclasses_order] -""" diff --git a/conformance/results/basilisk/dataclasses_postinit.toml b/conformance/results/basilisk/dataclasses_postinit.toml deleted file mode 100644 index 72a599249..000000000 --- a/conformance/results/basilisk/dataclasses_postinit.toml +++ /dev/null @@ -1,10 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -dataclasses_postinit.py:19:37: error: `__post_init__` parameter `y` has type `int` but `InitVar` field `y` declares inner type `str` [dataclasses_postinit] -dataclasses_postinit.py:28:7: error: Cannot access `InitVar` field `x` on `dc1`: `InitVar` fields are not stored as instance attributes [dataclasses_postinit] -dataclasses_postinit.py:29:7: error: Cannot access `InitVar` field `y` on `dc1`: `InitVar` fields are not stored as instance attributes [dataclasses_postinit] -dataclasses_postinit.py:36:9: error: `__post_init__` in `DC2` has 1 parameter after `self`, but 2 `InitVar` fields declared [dataclasses_postinit] -""" diff --git a/conformance/results/basilisk/dataclasses_slots.toml b/conformance/results/basilisk/dataclasses_slots.toml deleted file mode 100644 index 60397ea01..000000000 --- a/conformance/results/basilisk/dataclasses_slots.toml +++ /dev/null @@ -1,11 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -dataclasses_slots.py:11:7: error: `__slots__` is already defined in `DC1`: cannot also use `@dataclass(slots=True)` [dataclasses_slots] -dataclasses_slots.py:25:9: error: Cannot assign to attribute `y` on `DC2`: `y` is not defined in `__slots__` [dataclasses_slots] -dataclasses_slots.py:38:9: error: Cannot assign to attribute `y` on `DC3`: `y` is not defined in `__slots__` [dataclasses_slots] -dataclasses_slots.py:66:1: error: Cannot access `__slots__` on `DC6`: class does not define `__slots__` [dataclasses_slots] -dataclasses_slots.py:69:1: error: Cannot access `__slots__` on `DC6` instance: class does not define `__slots__` [dataclasses_slots] -""" diff --git a/conformance/results/basilisk/dataclasses_transform_class.toml b/conformance/results/basilisk/dataclasses_transform_class.toml deleted file mode 100644 index 381a4f0de..000000000 --- a/conformance/results/basilisk/dataclasses_transform_class.toml +++ /dev/null @@ -1,12 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -dataclasses_transform_class.py:51:7: error: Non-frozen class `Customer1Subclass` cannot inherit from frozen dataclass-transform class `Customer1` [dataclasses_transform_class] -dataclasses_transform_class.py:63:1: error: Cannot assign to attribute `id` of frozen dataclass-transform class `Customer1` instance `c1_1` [dataclasses_transform_class] -dataclasses_transform_class.py:66:8: error: Constructor of `Customer1` only accepts keyword arguments (kw_only=True) [dataclasses_transform_class] -dataclasses_transform_class.py:72:1: error: Comparison operator not supported: `Customer1` does not synthesise ordering methods (order=False by default) [dataclasses_transform_class] -dataclasses_transform_class.py:82:8: error: Constructor of `Customer2` only accepts keyword arguments (kw_only=True) [dataclasses_transform_class] -dataclasses_transform_class.py:122:1: error: Cannot assign to attribute `id` of frozen dataclass-transform class `Customer3` instance `c3_1` [dataclasses_transform_class] -""" diff --git a/conformance/results/basilisk/dataclasses_transform_converter.toml b/conformance/results/basilisk/dataclasses_transform_converter.toml deleted file mode 100644 index f2547ddbf..000000000 --- a/conformance/results/basilisk/dataclasses_transform_converter.toml +++ /dev/null @@ -1,15 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -dataclasses_transform_converter.py:48:31: error: Converter `bad_converter1` must accept at least one positional argument [dataclasses_transform_class] -dataclasses_transform_converter.py:49:31: error: Converter `bad_converter2` must accept at least one positional argument [dataclasses_transform_class] -dataclasses_transform_converter.py:107:5: error: Argument for field `field0` of `DC2` has type `int`, but its converter accepts `str` [dataclasses_transform_class] -dataclasses_transform_converter.py:108:23: error: Argument for field `field3` of `DC2` has type `int`, but its converter accepts `str | bytes` [dataclasses_transform_class] -dataclasses_transform_converter.py:109:29: error: Argument for field `field4` of `DC2` has type `complex`, but its converter accepts `str | list[str]` [dataclasses_transform_class] -dataclasses_transform_converter.py:118:1: error: Cannot assign `int` to field `field0` of `DC2`: its converter accepts `str` [dataclasses_transform_class] -dataclasses_transform_converter.py:119:1: error: Cannot assign `int` to field `field3` of `DC2`: its converter accepts `str | bytes` [dataclasses_transform_class] -dataclasses_transform_converter.py:130:59: error: `default` of type `int` is not assignable to the converter's input type `str` [dataclasses_transform_class] -dataclasses_transform_converter.py:133:59: error: `default_factory` of type `int` is not assignable to the converter's input type `str` [dataclasses_transform_class] -""" diff --git a/conformance/results/basilisk/dataclasses_transform_field.toml b/conformance/results/basilisk/dataclasses_transform_field.toml deleted file mode 100644 index 1a77ac4b4..000000000 --- a/conformance/results/basilisk/dataclasses_transform_field.toml +++ /dev/null @@ -1,8 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -dataclasses_transform_field.py:64:1: error: Unexpected keyword argument `id` for `CustomerModel1`: field `id` is not included in `__init__` [dataclasses_kwonly] -dataclasses_transform_field.py:75:16: error: Too many positional arguments to `CustomerModel2`: 1 argument(s) must be passed as keyword arguments [dataclasses_kwonly] -""" diff --git a/conformance/results/basilisk/dataclasses_transform_func.toml b/conformance/results/basilisk/dataclasses_transform_func.toml deleted file mode 100644 index d52b4c6f9..000000000 --- a/conformance/results/basilisk/dataclasses_transform_func.toml +++ /dev/null @@ -1,12 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -dataclasses_transform_func.py:56:1: error: Type mismatch: `c1_2.name` is typed `str` but assigned an `int` literal [assignment_compatibility] -dataclasses_transform_func.py:60:1: error: Cannot use ordering operator on `Customer1`: comparison methods are not synthesized (order is not enabled) [dataclasses_order] -dataclasses_transform_func.py:64:36: error: Unknown field `salary` in constructor of dataclass `Customer1` [constructors_call_init] -dataclasses_transform_func.py:70:18: error: Too many positional arguments to `Customer2`: 2 argument(s) must be passed as keyword arguments [dataclasses_kwonly] -dataclasses_transform_func.py:88:1: error: Non-frozen dataclass `Customer3Subclass` cannot inherit from frozen dataclass `Customer3` [dataclasses_frozen] -dataclasses_transform_func.py:96:1: error: Cannot assign to attribute `id` of frozen dataclass `Customer3` instance `c3_1` [dataclasses_frozen] -""" diff --git a/conformance/results/basilisk/dataclasses_transform_meta.toml b/conformance/results/basilisk/dataclasses_transform_meta.toml deleted file mode 100644 index c944a486e..000000000 --- a/conformance/results/basilisk/dataclasses_transform_meta.toml +++ /dev/null @@ -1,12 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -dataclasses_transform_meta.py:51:1: error: Non-frozen class `Customer1Subclass` cannot inherit from frozen dataclass_transform class `Customer1` [dataclasses_transform_meta] -dataclasses_transform_meta.py:63:1: error: Cannot assign to attribute `id` of frozen dataclass_transform class `Customer1` instance `c1_1` [dataclasses_transform_meta] -dataclasses_transform_meta.py:66:8: error: Positional argument(s) passed to `Customer1` whose constructor is keyword-only (dataclass_transform `kw_only_default=True`) [dataclasses_transform_meta] -dataclasses_transform_meta.py:73:6: error: Ordering comparison on `c1_1` instance: class `Customer1` does not synthesize comparison methods (missing `order=True`) [dataclasses_transform_meta] -dataclasses_transform_meta.py:83:8: error: Positional argument(s) passed to `Customer2` whose constructor is keyword-only (dataclass_transform `kw_only_default=True`) [dataclasses_transform_meta] -dataclasses_transform_meta.py:103:1: error: Cannot assign to attribute `id` of frozen dataclass_transform class `Customer3` instance `c3_1` [dataclasses_transform_meta] -""" diff --git a/conformance/results/basilisk/dataclasses_usage.toml b/conformance/results/basilisk/dataclasses_usage.toml deleted file mode 100644 index c3e5f0deb..000000000 --- a/conformance/results/basilisk/dataclasses_usage.toml +++ /dev/null @@ -1,18 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -dataclasses_usage.py:51:6: error: Call to `InventoryItem()` is missing 1 required field argument (expected at least 2, got 1) [calls_argument_count] -dataclasses_usage.py:52:28: error: Argument 2 to `InventoryItem()` has type `str` but field `unit_price` expects `float` [calls_argument_count] -dataclasses_usage.py:53:36: error: Too many positional arguments to `InventoryItem`: 1 argument(s) must be passed as keyword arguments [dataclasses_kwonly] -dataclasses_usage.py:62:5: error: Dataclass field `b` without a default cannot follow a field with a default in `DC1` [dataclasses_inheritance] -dataclasses_usage.py:68:5: error: Dataclass field `b` without a default cannot follow a field with a default in `DC2` [dataclasses_inheritance] -dataclasses_usage.py:74:5: error: Dataclass field `b` without a default cannot follow a field with a default in `DC3` [dataclasses_inheritance] -dataclasses_usage.py:84:13: error: Too many positional arguments to `DC4`: 1 argument(s) must be passed as keyword arguments [dataclasses_kwonly] -dataclasses_usage.py:89:5: error: Field `a` is annotated as `int` but `default_factory=str` produces `str` values [dataclasses_usage] -dataclasses_usage.py:128:8: error: Too many positional arguments to `DC7`: 1 argument(s) must be passed as keyword arguments [dataclasses_kwonly] -dataclasses_usage.py:131:1: error: Call to `DC8()` is missing 1 required argument for `__init__` (expected 2, got 1) [calls_argument_count] -dataclasses_usage.py:180:1: error: Cannot pass arguments to `DC13()`: `@dataclass(init=False)` is set with no explicit `__init__` method defined [calls_argument_count] -dataclasses_usage.py:246:12: error: Too many positional arguments to `DC19`: 1 argument(s) must be passed as keyword arguments [dataclasses_kwonly] -""" diff --git a/conformance/results/basilisk/directives_assert_type.toml b/conformance/results/basilisk/directives_assert_type.toml deleted file mode 100644 index d664115f5..000000000 --- a/conformance/results/basilisk/directives_assert_type.toml +++ /dev/null @@ -1,14 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -directives_assert_type.py:27:5: error: Type mismatch in `assert_type()`: expression has type `int | str` but expected `int` [directives_assert_type_2] -directives_assert_type.py:28:5: error: Type mismatch in `assert_type()`: expression has type `int | str` but expected `Any` [directives_assert_type_2] -directives_assert_type.py:29:5: error: Type mismatch in `assert_type()`: expression has type `Any` but expected `int` [directives_assert_type_2] -directives_assert_type.py:30:5: error: Type mismatch in `assert_type()`: expression has type `Literal[4]` but expected `int` [directives_assert_type_2] -directives_assert_type.py:32:5: error: `assert_type()` requires exactly 2 arguments (value, type), got 0 [directives_assert_type] -directives_assert_type.py:33:5: error: Type mismatch in `assert_type()`: expression has type `str` but expected `int` [directives_assert_type_2] -directives_assert_type.py:34:5: error: `assert_type()` requires exactly 2 arguments (value, type), got 3 [directives_assert_type] -directives_assert_type.py:41:5: error: Type mismatch in `assert_type()`: expression has type `str` but expected `str | Literal["spam"]` [directives_assert_type_2] -""" diff --git a/conformance/results/basilisk/directives_cast.toml b/conformance/results/basilisk/directives_cast.toml deleted file mode 100644 index da50c394b..000000000 --- a/conformance/results/basilisk/directives_cast.toml +++ /dev/null @@ -1,9 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -directives_cast.py:15:8: error: `cast()` requires exactly 2 arguments (type, value), got 0 [directives_cast] -directives_cast.py:16:13: error: First argument of `cast()` must be a type, not a value literal [directives_cast] -directives_cast.py:17:8: error: `cast()` requires exactly 2 arguments (type, value), got 3 [directives_cast] -""" diff --git a/conformance/results/basilisk/directives_deprecated.toml b/conformance/results/basilisk/directives_deprecated.toml deleted file mode 100644 index edc6584bd..000000000 --- a/conformance/results/basilisk/directives_deprecated.toml +++ /dev/null @@ -1,19 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -directives_deprecated.py:18:1: error: Use of deprecated class `Ham` [directives_deprecated] -directives_deprecated.py:24:1: error: Use of deprecated function `norwegian_blue` [directives_deprecated] -directives_deprecated.py:25:5: error: Use of deprecated function `norwegian_blue` [directives_deprecated] -directives_deprecated.py:30:1: error: Use of deprecated overload `foo` [directives_deprecated] -directives_deprecated.py:34:7: error: Use of deprecated class `Ham` [directives_deprecated] -directives_deprecated.py:41:5: error: Use of deprecated method `Spam.__add__` [directives_deprecated] -directives_deprecated.py:42:1: error: Use of deprecated method `Spam.__add__` [directives_deprecated] -directives_deprecated.py:44:1: error: Use of deprecated property `Spam.greasy` [directives_deprecated] -directives_deprecated.py:47:1: error: Use of deprecated property setter `Spam.shape` [directives_deprecated] -directives_deprecated.py:48:1: error: Use of deprecated property setter `Spam.shape` [directives_deprecated] -directives_deprecated.py:58:1: error: Use of deprecated method `Invocable.__call__` [directives_deprecated] -directives_deprecated.py:69:1: error: Use of deprecated function `lorem` [directives_deprecated] -directives_deprecated.py:98:5: error: Use of deprecated method `foo` [directives_deprecated] -""" diff --git a/conformance/results/basilisk/directives_disjoint_base.toml b/conformance/results/basilisk/directives_disjoint_base.toml deleted file mode 100644 index d4975e800..000000000 --- a/conformance/results/basilisk/directives_disjoint_base.toml +++ /dev/null @@ -1,14 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -directives_disjoint_base.py:69:7: error: Class has incompatible disjoint bases (Left, Right): no single base is a subclass of all the others [directives_disjoint_base] -directives_disjoint_base.py:73:7: error: Class has incompatible disjoint bases (LeftChild, Right): no single base is a subclass of all the others [directives_disjoint_base] -directives_disjoint_base.py:77:7: error: Class has incompatible disjoint bases (Left, Right): no single base is a subclass of all the others [directives_disjoint_base] -directives_disjoint_base.py:81:7: error: Class has incompatible disjoint bases (Left, Record): no single base is a subclass of all the others [directives_disjoint_base] -directives_disjoint_base.py:105:7: error: Class has incompatible disjoint bases (SlotBase1, SlotBase2): no single base is a subclass of all the others [directives_disjoint_base] -directives_disjoint_base.py:113:2: error: `@disjoint_base` cannot be applied to a function [directives_disjoint_base] -directives_disjoint_base.py:118:2: error: `@disjoint_base` cannot be applied to a TypedDict [directives_disjoint_base] -directives_disjoint_base.py:123:2: error: `@disjoint_base` cannot be applied to a Protocol [directives_disjoint_base] -""" diff --git a/conformance/results/basilisk/directives_no_type_check.toml b/conformance/results/basilisk/directives_no_type_check.toml deleted file mode 100644 index 9c5403adf..000000000 --- a/conformance/results/basilisk/directives_no_type_check.toml +++ /dev/null @@ -1,10 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -directives_no_type_check.py:26:5: error: Function `func1` is annotated `-> None` but has a `return` statement with a value [returns_compatibility_2] -directives_no_type_check.py:29:7: error: Argument `a` of `func1` expects `int` but received a `bytes` literal [calls_argument_type] -directives_no_type_check.py:29:19: error: Argument `b` of `func1` expects `str` but received a `bytes` literal [calls_argument_type] -directives_no_type_check.py:32:1: error: Call to `func1` is missing 2 required arguments (expected 2, got 0) [calls_argument_count] -""" diff --git a/conformance/results/basilisk/directives_reveal_type.toml b/conformance/results/basilisk/directives_reveal_type.toml deleted file mode 100644 index 462a74842..000000000 --- a/conformance/results/basilisk/directives_reveal_type.toml +++ /dev/null @@ -1,8 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -directives_reveal_type.py:19:5: error: `reveal_type()` requires exactly 1 argument, got 0 [directives_reveal_type] -directives_reveal_type.py:20:5: error: `reveal_type()` requires exactly 1 argument, got 2 [directives_reveal_type] -""" diff --git a/conformance/results/basilisk/directives_type_checking.toml b/conformance/results/basilisk/directives_type_checking.toml deleted file mode 100644 index be211bd5b..000000000 --- a/conformance/results/basilisk/directives_type_checking.toml +++ /dev/null @@ -1,6 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -""" diff --git a/conformance/results/basilisk/directives_type_ignore.toml b/conformance/results/basilisk/directives_type_ignore.toml deleted file mode 100644 index be211bd5b..000000000 --- a/conformance/results/basilisk/directives_type_ignore.toml +++ /dev/null @@ -1,6 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -""" diff --git a/conformance/results/basilisk/directives_type_ignore_file1.toml b/conformance/results/basilisk/directives_type_ignore_file1.toml deleted file mode 100644 index be211bd5b..000000000 --- a/conformance/results/basilisk/directives_type_ignore_file1.toml +++ /dev/null @@ -1,6 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -""" diff --git a/conformance/results/basilisk/directives_type_ignore_file2.toml b/conformance/results/basilisk/directives_type_ignore_file2.toml deleted file mode 100644 index 1cdfbe772..000000000 --- a/conformance/results/basilisk/directives_type_ignore_file2.toml +++ /dev/null @@ -1,7 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -directives_type_ignore_file2.py:14:1: error: Type mismatch: `x` is annotated `int` (int) but assigned str [assignment_compatibility] -""" diff --git a/conformance/results/basilisk/directives_version_platform.toml b/conformance/results/basilisk/directives_version_platform.toml deleted file mode 100644 index 3a6d5df8e..000000000 --- a/conformance/results/basilisk/directives_version_platform.toml +++ /dev/null @@ -1,9 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -directives_version_platform.py:33:19: error: Variable `val3` is only defined in a dead version/platform branch [directives_version_platform] -directives_version_platform.py:50:19: error: Variable `val6` is only defined in a dead version/platform branch [directives_version_platform] -directives_version_platform.py:59:19: error: Variable `val9` is only defined in a dead version/platform branch [directives_version_platform] -""" diff --git a/conformance/results/basilisk/enums_behaviors.toml b/conformance/results/basilisk/enums_behaviors.toml deleted file mode 100644 index 99159562b..000000000 --- a/conformance/results/basilisk/enums_behaviors.toml +++ /dev/null @@ -1,9 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -enums_behaviors.py:28:1: error: Redundant `assert_type` with `Literal[Color.RED]` on enum-typed parameter [enums_expansion] -enums_behaviors.py:32:1: error: Redundant `assert_type` with `Literal[Color.BLUE]` on enum-typed parameter [enums_expansion] -enums_behaviors.py:44:7: error: Cannot subclass `Shape` because it has members and is implicitly final [enums_behaviors] -""" diff --git a/conformance/results/basilisk/enums_definition.toml b/conformance/results/basilisk/enums_definition.toml deleted file mode 100644 index f8a2201b1..000000000 --- a/conformance/results/basilisk/enums_definition.toml +++ /dev/null @@ -1,7 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -enums_definition.py:92:1: error: Enum `Color12` has no member `BLUE` for the target Python version — it is defined only under a version guard that is not satisfied [enums_definition] -""" diff --git a/conformance/results/basilisk/enums_expansion.toml b/conformance/results/basilisk/enums_expansion.toml deleted file mode 100644 index e4a77e027..000000000 --- a/conformance/results/basilisk/enums_expansion.toml +++ /dev/null @@ -1,13 +0,0 @@ -conformant = "Partial" -notes = """ -Does not accept an enum-typed value where a complete union of all literal members is declared, although it treats the two as equivalent for `assert_type`. -""" -conformance_automated = "Fail" -errors_diff = """ -Line 85: Unexpected errors ['enums_expansion.py:85:5: error: Type mismatch: `x` is annotated `Literal[Answer.Yes, Answer.No]` (answer.yes | answer.no) but assigned answer [assignment_compatibility]'] -""" -output = """ -enums_expansion.py:28:9: error: Redundant `assert_type` with `Literal[Color.GREEN]` on enum-typed parameter [enums_expansion] -enums_expansion.py:56:9: error: Redundant `assert_type` with `Literal[CustomFlags.FLAG3]` on enum-typed parameter [enums_expansion] -enums_expansion.py:85:5: error: Type mismatch: `x` is annotated `Literal[Answer.Yes, Answer.No]` (answer.yes | answer.no) but assigned answer [assignment_compatibility] -""" diff --git a/conformance/results/basilisk/enums_member_names.toml b/conformance/results/basilisk/enums_member_names.toml deleted file mode 100644 index be211bd5b..000000000 --- a/conformance/results/basilisk/enums_member_names.toml +++ /dev/null @@ -1,6 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -""" diff --git a/conformance/results/basilisk/enums_member_values.toml b/conformance/results/basilisk/enums_member_values.toml deleted file mode 100644 index a3c22f7e0..000000000 --- a/conformance/results/basilisk/enums_member_values.toml +++ /dev/null @@ -1,8 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -enums_member_values.py:78:13: error: Enum member value has type `str` but `_value_` is declared as `int` in `Color3` [enums_member_values] -enums_member_values.py:85:9: error: `self._value_` is assigned from a parameter of type `int` but `_value_` is declared as `str` in `Planet2` [enums_member_values] -""" diff --git a/conformance/results/basilisk/enums_members.toml b/conformance/results/basilisk/enums_members.toml deleted file mode 100644 index e5cd20d45..000000000 --- a/conformance/results/basilisk/enums_members.toml +++ /dev/null @@ -1,13 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -enums_members.py:54:5: error: Enum member `DOG` in `Pet3` should not have an explicit type annotation [enums_members] -enums_members.py:86:12: error: `Pet4.converter` is not an enum member and cannot be used in `Literal[Pet4.converter]` [enums_members_2] -enums_members.py:87:12: error: `Pet4.transform` is not an enum member and cannot be used in `Literal[Pet4.transform]` [enums_members_2] -enums_members.py:88:10: error: `Pet4.species` is not an enum member and cannot be used in `Literal[Pet4.species]` [enums_members_2] -enums_members.py:89:8: error: `Pet4.speak` is not an enum member and cannot be used in `Literal[Pet4.speak]` [enums_members_2] -enums_members.py:120:1: error: `Example.b` is not an enum member and cannot be used in `Literal[Example.b]` [enums_members_2] -enums_members.py:133:9: error: `Example2.__B` is not an enum member and cannot be used in `Literal[Example2.__B]` [enums_members_2] -""" diff --git a/conformance/results/basilisk/exceptions_context_managers.toml b/conformance/results/basilisk/exceptions_context_managers.toml deleted file mode 100644 index be211bd5b..000000000 --- a/conformance/results/basilisk/exceptions_context_managers.toml +++ /dev/null @@ -1,6 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -""" diff --git a/conformance/results/basilisk/generics_base_class.toml b/conformance/results/basilisk/generics_base_class.toml deleted file mode 100644 index 7b9638250..000000000 --- a/conformance/results/basilisk/generics_base_class.toml +++ /dev/null @@ -1,13 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -generics_base_class.py:26:5: error: Argument `x` of `takes_dict_incorrect` expects `dict[str, list[object]]` but received `SymbolTable` (subclass of `dict[str, list[Node]]`) -- ` list[Node]` is not assignable to ` list[object]` because `list` is invariant [generics_base_class_3] -generics_base_class.py:29:11: error: Invalid type expression in annotation for parameter `y` [annotations_forward_refs] -generics_base_class.py:30:5: error: Invalid type expression in annotation for local variable `x` [annotations_forward_refs] -generics_base_class.py:49:22: error: Too many type arguments for `LinkedList`; expected at most 1, got 2 [generics_defaults_specialization] -generics_base_class.py:61:18: error: Too many type arguments for `MyDict`; expected at most 1, got 2 [generics_defaults_specialization] -generics_base_class.py:68:28: error: TypeVar `T` appears more than once in `Generic[...]` for `BadClass1` [generics_base_class] -generics_base_class.py:98:7: error: Inconsistent TypeVar ordering for `Grandparent` in base classes of `BadChild` [generics_base_class_2] -""" diff --git a/conformance/results/basilisk/generics_basic.toml b/conformance/results/basilisk/generics_basic.toml deleted file mode 100644 index 73a4cf67a..000000000 --- a/conformance/results/basilisk/generics_basic.toml +++ /dev/null @@ -1,24 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -generics_basic.py:40:5: error: Constraint mismatch for TypeVar `AnyStr` in call to `concat`: argument types belong to different constraint groups [generics_basic_3] -generics_basic.py:41:5: error: Constraint mismatch for TypeVar `AnyStr` in call to `concat`: argument types belong to different constraint groups [generics_basic_3] -generics_basic.py:49:18: error: `BadConstraint1` has a single constraint; TypeVar requires 0 or 2+ constraints [generics_basic] -generics_basic.py:55:22: error: `BadConstraint2` has a constraint that is parameterized by a type variable [generics_basic] -generics_basic.py:69:5: error: Constraint mismatch for TypeVar `AnyStr` in call to `concat`: argument types belong to different constraint groups [generics_basic_3] -generics_basic.py:121:24: error: TypeVar `T` appears more than once in `Generic[...]` for `Pair2` [generics_base_class] -generics_basic.py:157:5: error: Invalid subscript key type `int` for `m1` which expects key type `str` [generics_basic_3] -generics_basic.py:158:5: error: Invalid subscript key type `int` for `m2` which expects key type `str` [generics_basic_3] -generics_basic.py:162:20: error: Non-TypeVar argument in `Generic[...]` or `Protocol[...]` for `Bad1` [generics_basic_2] -generics_basic.py:163:21: error: Non-TypeVar argument in `Generic[...]` or `Protocol[...]` for `Bad2` [generics_basic_2] -generics_basic.py:171:7: error: Type parameter`T_co` used in a base class of `Bad3` but not listed in `Generic[...]` or `Protocol[...]` [generics_basic_2] -generics_basic.py:172:7: error: Type parameter`T_co` used in a base class of `Bad4` but not listed in `Generic[...]` or `Protocol[...]` [generics_basic_2] -generics_basic.py:208:1: error: Class `GenericMetaInstance` uses a parameterized generic type as its metaclass [generics_basic_3] -generics_basic.py:223:22: error: Argument `y` of `takes_two_lists` expects `list[T]` but received a scalar literal where `list[T]` is required — no type-variable assignment makes it valid [calls_argument_type] -generics_basic.py:232:5: error: TypeVar `T` is not bound in this scope [generics_variance_inference] -generics_basic.py:240:26: error: Argument `y` of `takes_two_int_lists` expects `list[T_int]` but received a scalar literal where `list[T_int]` is required — no type-variable assignment makes it valid [calls_argument_type] -generics_basic.py:241:26: error: Argument `y` of `takes_two_int_lists` expects `list[T_int]` but received `list[str]` where `list[T_int]` is required — `str` does not satisfy type variable `T_int` [calls_argument_type] -generics_basic.py:251:5: error: TypeVar `T` is not bound in this scope [generics_variance_inference] -""" diff --git a/conformance/results/basilisk/generics_defaults.toml b/conformance/results/basilisk/generics_defaults.toml deleted file mode 100644 index 65fad56a4..000000000 --- a/conformance/results/basilisk/generics_defaults.toml +++ /dev/null @@ -1,12 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -generics_defaults.py:24:53: error: Non-default `TypeVar` `T` follows a default `TypeVar` in `Generic[...]` for `NonDefaultFollowsDefault` [generics_defaults] -generics_defaults.py:66:8: error: Too few type arguments for `AllTheDefaults`; expected at least 2, got 1 [generics_defaults_specialization] -generics_defaults.py:152:12: error: `TypeVar` `Invalid1` has `default=int` which is not a subtype of `bound=str` [generics_defaults_2] -generics_defaults.py:159:12: error: `TypeVar` `Invalid2` has `default=int` which is not one of the constraints (`float`, `str`) [generics_defaults_2] -generics_defaults.py:177:1: error: Type mismatch in `assert_type()`: expression has type `int` but expected `Any` [directives_assert_type_2] -generics_defaults.py:188:25: error: `TypeVar` `T5` with `default=` cannot follow a `TypeVarTuple` in `Generic[...]` for `Foo5` [generics_defaults] -""" diff --git a/conformance/results/basilisk/generics_defaults_referential.toml b/conformance/results/basilisk/generics_defaults_referential.toml deleted file mode 100644 index 5322a56eb..000000000 --- a/conformance/results/basilisk/generics_defaults_referential.toml +++ /dev/null @@ -1,15 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -generics_defaults_referential.py:37:5: error: Argument `s` of type `str` is not compatible with parameter `b: int` in `Foo.__init__` (`TypeVar` default propagation) [generics_variance_inference] -generics_defaults_referential.py:38:5: error: Argument `s` of type `str` is not compatible with parameter `a: int` in `Foo.__init__` (`TypeVar` default propagation) [generics_variance_inference] -generics_defaults_referential.py:54:7: error: TypeVar `Start2T` has default `StopT` which is not properly ordered in `Generic[...]` for `slice2` [generics_defaults_referential_2] -generics_defaults_referential.py:61:1: error: TypeVar `S2` has default `S1` which references an outer-scope TypeVar [generics_defaults_referential_2] -generics_defaults_referential.py:69:12: error: `TypeVar` `Invalid1` has `default=X1` but `X1`'s bound `int` is not a subtype of `Invalid1`'s bound `str` [generics_defaults_referential] -generics_defaults_referential.py:69:12: error: TypeVar `Invalid1` has default `X1` with bound `int` which is not a subtype of `Invalid1`'s bound `str` [generics_defaults_referential_2] -generics_defaults_referential.py:75:12: error: TypeVar `Invalid2` has default `Y1` with upper bound `int` which is incompatible with constraints `float, str` [generics_defaults_referential_2] -generics_defaults_referential.py:79:16: error: `TypeVar` `AlsoInvalid2` has `default=Y2` but `Y2`'s constraints {`int`, `str`} are not a subset of `AlsoInvalid2`'s constraints {`bool`, `complex`} [generics_defaults_referential] -generics_defaults_referential.py:79:16: error: TypeVar `AlsoInvalid2`'s constraints `{bool, complex}` are not a superset of default TypeVar `Y2`'s constraints `{int, str}` [generics_defaults_referential_2] -""" diff --git a/conformance/results/basilisk/generics_defaults_specialization.toml b/conformance/results/basilisk/generics_defaults_specialization.toml deleted file mode 100644 index 4574e8570..000000000 --- a/conformance/results/basilisk/generics_defaults_specialization.toml +++ /dev/null @@ -1,9 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -generics_defaults_specialization.py:30:1: error: Too many type arguments for `MyAlias`; expected at most 1, got 2 [generics_defaults_specialization] -generics_defaults_specialization.py:46:1: error: Type mismatch: `x2` is annotated `type[Bar[int]]` but assigned bare `Bar`, whose type parameter `DefaultStrT` defaults to `str` [assignment_compatibility] -generics_defaults_specialization.py:56:1: error: `Foo` cannot be subscripted; it has no free type parameters [generics_defaults_specialization] -""" diff --git a/conformance/results/basilisk/generics_paramspec_basic.toml b/conformance/results/basilisk/generics_paramspec_basic.toml deleted file mode 100644 index 14e41e8b7..000000000 --- a/conformance/results/basilisk/generics_paramspec_basic.toml +++ /dev/null @@ -1,14 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -generics_paramspec_basic.py:10:13: error: Variable name `WrongName` does not match the name string `NotIt` passed to `ParamSpec` [generics_basic] -generics_paramspec_basic.py:15:1: error: `TypeAlias` `TA1` has a `ParamSpec` as its type, which is invalid; `ParamSpec` can only be used in `Callable[P, ReturnType]` [annotations_forward_refs] -generics_paramspec_basic.py:23:11: error: Invalid type expression in annotation for parameter `x` [annotations_forward_refs] -generics_paramspec_basic.py:27:11: error: Invalid type expression in annotation for parameter `x` [annotations_forward_refs] -generics_paramspec_basic.py:31:11: error: Invalid type expression in annotation for parameter `x` [annotations_forward_refs] -generics_paramspec_basic.py:35:11: error: Invalid type expression in annotation for parameter `x` [annotations_forward_refs] -generics_paramspec_basic.py:39:12: error: Invalid type expression in annotation for parameter `args` [annotations_forward_refs] -generics_paramspec_basic.py:39:23: error: Invalid type expression in annotation for parameter `kwargs` [annotations_forward_refs] -""" diff --git a/conformance/results/basilisk/generics_paramspec_components.toml b/conformance/results/basilisk/generics_paramspec_components.toml deleted file mode 100644 index 132fab868..000000000 --- a/conformance/results/basilisk/generics_paramspec_components.toml +++ /dev/null @@ -1,22 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -generics_paramspec_components.py:17:17: error: Invalid ParamSpec usage: `*args` must be annotated `P.args` and `**kwargs` must be annotated `P.kwargs` [callables_protocol] -generics_paramspec_components.py:20:20: error: Invalid ParamSpec usage: ParamSpec components are only valid on `*args` and `**kwargs` [callables_protocol] -generics_paramspec_components.py:23:20: error: Invalid ParamSpec usage: `*args` must be annotated `P.args` and `**kwargs` must be annotated `P.kwargs` [callables_protocol] -generics_paramspec_components.py:26:20: error: Invalid ParamSpec usage: `*args: P.args` requires a matching `**kwargs: P.kwargs` [callables_protocol] -generics_paramspec_components.py:30:17: error: Invalid ParamSpec usage: ParamSpec components used out of scope: no enclosing binding of the ParamSpec through a `Callable` parameter [callables_protocol] -generics_paramspec_components.py:35:5: error: Invalid ParamSpec usage: ParamSpec components are only valid as `*args: P.args` and `**kwargs: P.kwargs` annotations [callables_protocol] -generics_paramspec_components.py:36:5: error: Invalid ParamSpec usage: ParamSpec components are only valid as `*args: P.args` and `**kwargs: P.kwargs` annotations [callables_protocol] -generics_paramspec_components.py:38:18: error: Invalid ParamSpec usage: `*args: P.args` requires a matching `**kwargs: P.kwargs` [callables_protocol] -generics_paramspec_components.py:41:20: error: Invalid ParamSpec usage: `**kwargs: P.kwargs` requires a matching `*args: P.args` [callables_protocol] -generics_paramspec_components.py:49:9: error: Invalid ParamSpec usage: `*` must forward the `P.args` parameter, not `P.kwargs` [callables_protocol] -generics_paramspec_components.py:51:9: error: Invalid ParamSpec usage: expected 0 positional prefix arguments before the forwarded `*args`, found 1 [callables_protocol] -generics_paramspec_components.py:60:12: error: Invalid ParamSpec usage: no keyword-only parameters may appear between `*args: P.args` and `**kwargs: P.kwargs` [callables_protocol] -generics_paramspec_components.py:70:9: error: Invalid ParamSpec usage: expected 1 positional prefix argument before the forwarded `*args`, found 0 [callables_protocol] -generics_paramspec_components.py:72:9: error: Invalid ParamSpec usage: expected 1 positional prefix argument before the forwarded `*args`, found 0 [callables_protocol] -generics_paramspec_components.py:83:9: error: Invalid ParamSpec usage: prefix parameter `x` must be passed positionally before the forwarded `*args` [callables_protocol] -generics_paramspec_components.py:98:1: error: Invalid ParamSpec usage: forwarded argument 1 has type `str`, but `a_int_b_str` expects `int` [callables_protocol] -""" diff --git a/conformance/results/basilisk/generics_paramspec_semantics.toml b/conformance/results/basilisk/generics_paramspec_semantics.toml deleted file mode 100644 index 6dd61c21b..000000000 --- a/conformance/results/basilisk/generics_paramspec_semantics.toml +++ /dev/null @@ -1,16 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -generics_paramspec_semantics.py:26:1: error: Invalid call to `f1`: parameter `a` is positional-only and cannot be passed by keyword [callables_protocol] -generics_paramspec_semantics.py:27:1: error: Invalid call to `f1`: argument 2 has type `str`, expected `bool` [callables_protocol] -generics_paramspec_semantics.py:46:6: error: Incompatible ParamSpec argument(s) to `func1`: arguments x_y, y_x must have identical signatures to bind `P` [callables_protocol] -generics_paramspec_semantics.py:61:1: error: Incompatible ParamSpec argument(s) to `func1`: arguments keyword_only_x, keyword_only_y must have identical signatures to bind `P` [callables_protocol] -generics_paramspec_semantics.py:98:1: error: Invalid call to `a1`: argument 1 has type `int`, expected `str` [callables_protocol] -generics_paramspec_semantics.py:108:1: error: Invalid call to `r1`: argument 1 has type `int`, expected `bool` [callables_protocol] -generics_paramspec_semantics.py:120:1: error: Invalid call to `t1`: argument 1 has type `int`, expected `str` [callables_protocol] -generics_paramspec_semantics.py:127:1: error: `one` is not compatible with the `Callable[Concatenate[...], ...]` parameter of decorator `expects_int_first`: leading parameter is `str`, but the Concatenate prefix supplies `int` [callables_protocol] -generics_paramspec_semantics.py:132:1: error: `two` is not compatible with the `Callable[Concatenate[...], ...]` parameter of decorator `expects_int_first`: expected at least 1 leading positional parameter, found 0 [callables_protocol] -generics_paramspec_semantics.py:137:1: error: `three` is not compatible with the `Callable[Concatenate[...], ...]` parameter of decorator `expects_int_first`: expected at least 1 leading positional parameter, found 0 [callables_protocol] -""" diff --git a/conformance/results/basilisk/generics_paramspec_specialization.toml b/conformance/results/basilisk/generics_paramspec_specialization.toml deleted file mode 100644 index fc675cdb1..000000000 --- a/conformance/results/basilisk/generics_paramspec_specialization.toml +++ /dev/null @@ -1,11 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -generics_paramspec_specialization.py:44:15: error: Type argument `int` is not valid for `ParamSpec` parameter `P1` of `ClassA` [generics_defaults_specialization] -generics_paramspec_specialization.py:54:9: error: Argument 1 to `x.f` has incompatible type `str`; expected `int` [callables_protocol] -generics_paramspec_specialization.py:55:16: error: Argument 3 to `x.f` has incompatible type `str`; expected `bool` [callables_protocol] -generics_paramspec_specialization.py:60:9: error: Argument 1 to `x.f` has incompatible type `str`; expected `int` [callables_protocol] -generics_paramspec_specialization.py:61:16: error: Argument 3 to `x.f` has incompatible type `str`; expected `bool` [callables_protocol] -""" diff --git a/conformance/results/basilisk/generics_scoping.toml b/conformance/results/basilisk/generics_scoping.toml deleted file mode 100644 index 222f2b8d9..000000000 --- a/conformance/results/basilisk/generics_scoping.toml +++ /dev/null @@ -1,24 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -generics_scoping.py:16:1: error: Type mismatch in `assert_type()`: expression has type `int` but expected `Literal[1]` [directives_assert_type_2] -generics_scoping.py:20:1: error: Type mismatch in `assert_type()`: expression has type `str` but expected `Literal["a"]` [directives_assert_type_2] -generics_scoping.py:34:1: error: Argument `'a'` of type `str` is not compatible with parameter `x: int` (TypeVar `T` is bound to `int` for instance `a: MyClass[T=int]`) [generics_variance_inference] -generics_scoping.py:50:1: error: Type mismatch in `assert_type()`: expression has type `str` but expected `Literal["abc"]` [directives_assert_type_2] -generics_scoping.py:54:1: error: Type mismatch in `assert_type()`: expression has type `bytes` but expected `Literal[b"abc"]` [directives_assert_type_2] -generics_scoping.py:61:5: error: TypeVar `S` is not bound in this scope [generics_variance_inference] -generics_scoping.py:61:8: error: Type variable `S` is not bound in function `fun_3` [generics_scoping] -generics_scoping.py:65:5: error: TypeVar `S` is not bound in this scope [generics_variance_inference] -generics_scoping.py:65:14: error: Type variable `S` is not bound in class `Bar` [generics_scoping] -generics_scoping.py:76:5: error: TypeVar `T` from outer scope cannot be used in nested class definition [generics_variance_inference] -generics_scoping.py:86:5: error: TypeVar `T` from outer scope cannot be used in nested class definition [generics_variance_inference] -generics_scoping.py:89:9: error: TypeVar `T` from outer class cannot be used in nested class body [generics_variance_inference] -generics_scoping.py:98:5: error: TypeVar `T` from enclosing class is not accessible in a TypeAlias definition [generics_variance_inference] -generics_scoping.py:98:24: error: Type variable `T` from class `Outer` cannot be used in a TypeAlias definition [generics_scoping] -generics_scoping.py:105:1: error: TypeVar `T` is not bound in this scope [generics_variance_inference] -generics_scoping.py:105:14: error: Type variable `T` is not bound in the current scope [generics_scoping] -generics_scoping.py:106:14: error: Type variable `T` is not bound in the current scope [generics_scoping] -generics_scoping.py:107:1: error: TypeVar `T` is not bound in this scope [generics_variance_inference] -""" diff --git a/conformance/results/basilisk/generics_self_advanced.toml b/conformance/results/basilisk/generics_self_advanced.toml deleted file mode 100644 index be211bd5b..000000000 --- a/conformance/results/basilisk/generics_self_advanced.toml +++ /dev/null @@ -1,6 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -""" diff --git a/conformance/results/basilisk/generics_self_attributes.toml b/conformance/results/basilisk/generics_self_attributes.toml deleted file mode 100644 index 76ff9bf5a..000000000 --- a/conformance/results/basilisk/generics_self_attributes.toml +++ /dev/null @@ -1,8 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -generics_self_attributes.py:26:6: error: Argument `next` is typed as `Self` in `LinkedList`, which resolves to `OrdinalLinkedList` here, but got `LinkedList` instance [generics_self_attributes] -generics_self_attributes.py:32:15: error: Cannot assign `LinkedList` to attribute `next`: `Self` resolves to `OrdinalLinkedList` here, not `LinkedList` [generics_self_attributes] -""" diff --git a/conformance/results/basilisk/generics_self_basic.toml b/conformance/results/basilisk/generics_self_basic.toml deleted file mode 100644 index 01aa00a8e..000000000 --- a/conformance/results/basilisk/generics_self_basic.toml +++ /dev/null @@ -1,9 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -generics_self_basic.py:20:9: error: Return type `Self` requires returning the current class instance, but `Shape()` is not `Self` — it would be wrong in a subclass [generics_self_basic] -generics_self_basic.py:33:9: error: Return type `Self` requires returning the current class instance, but `Shape()` is not `Self` — it would be wrong in a subclass [generics_self_basic] -generics_self_basic.py:68:26: error: `Self` is not subscriptable — it already captures the full type of the enclosing class [generics_self_basic] -""" diff --git a/conformance/results/basilisk/generics_self_protocols.toml b/conformance/results/basilisk/generics_self_protocols.toml deleted file mode 100644 index 9520d8eb3..000000000 --- a/conformance/results/basilisk/generics_self_protocols.toml +++ /dev/null @@ -1,8 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -generics_self_protocols.py:61:19: error: Class `BadReturnType` is not compatible with protocol `ShapeProtocol`: method `set_scale` returns `int` instead of `Self` [generics_self_protocols] -generics_self_protocols.py:64:19: error: Class `ReturnDifferentClass` is not compatible with protocol `ShapeProtocol`: method `set_scale` returns `ReturnConcreteShape` instead of `Self` [generics_self_protocols] -""" diff --git a/conformance/results/basilisk/generics_self_usage.toml b/conformance/results/basilisk/generics_self_usage.toml deleted file mode 100644 index 44abde5ce..000000000 --- a/conformance/results/basilisk/generics_self_usage.toml +++ /dev/null @@ -1,19 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -generics_self_usage.py:73:5: error: `Self` is not valid in a module-level function; return type of `foo` uses `Self` [generics_self_usage] -generics_self_usage.py:73:9: error: `Self` is not valid in a module-level function; parameter `bar` of `foo` uses `Self` [generics_self_usage] -generics_self_usage.py:76:1: error: `Self` is not valid outside a class body; annotation of `bar` uses `Self` [generics_self_usage] -generics_self_usage.py:82:9: error: Return type `Self` is invalid in `has_existing_self_annotation`: the `self` parameter is annotated with TypeVar `TFoo2`, so `Self` has no defined class binding [generics_self_usage] -generics_self_usage.py:87:9: error: Return type `Self` requires returning the current class instance, but `Foo3()` is not `Self` — it would be wrong in a subclass [generics_self_basic] -generics_self_usage.py:103:7: error: `Self` cannot be used as a base class or in base class type arguments for `Baz` [generics_self_usage] -generics_self_usage.py:105:7: error: `Self` cannot be used as a base class or in base class type arguments for `Baz2` [generics_self_usage] -generics_self_usage.py:108:1: error: `Self` cannot appear in a `TypeAlias` definition at module scope; `TupleSelf` uses `Self` [generics_self_usage] -generics_self_usage.py:113:9: error: `Self` is not valid in a static method; return type of `make` uses `Self` [generics_self_usage] -generics_self_usage.py:118:9: error: `Self` is not valid in a static method; return type of `return_parameter` uses `Self` [generics_self_usage] -generics_self_usage.py:118:26: error: `Self` is not valid in a static method; parameter `foo` of `return_parameter` uses `Self` [generics_self_usage] -generics_self_usage.py:123:9: error: `Self` is not valid in a metaclass method; return type of `__new__` uses `Self` [generics_self_usage] -generics_self_usage.py:127:9: error: `Self` is not valid in a metaclass method; return type of `__mul__` uses `Self` [generics_self_usage] -""" diff --git a/conformance/results/basilisk/generics_syntax_compatibility.toml b/conformance/results/basilisk/generics_syntax_compatibility.toml deleted file mode 100644 index 084602400..000000000 --- a/conformance/results/basilisk/generics_syntax_compatibility.toml +++ /dev/null @@ -1,8 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -generics_syntax_compatibility.py:14:7: error: Class `ClassA` uses PEP 695 type parameter syntax but references traditional TypeVar `K` from outer scope [generics_syntax_compatibility] -generics_syntax_compatibility.py:26:9: error: Function `method2` uses PEP 695 type parameter syntax but references traditional TypeVar `K` from outer scope [generics_syntax_compatibility] -""" diff --git a/conformance/results/basilisk/generics_syntax_declarations.toml b/conformance/results/basilisk/generics_syntax_declarations.toml deleted file mode 100644 index 484b6cd4f..000000000 --- a/conformance/results/basilisk/generics_syntax_declarations.toml +++ /dev/null @@ -1,17 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -generics_syntax_declarations.py:17:25: error: Non-TypeVar argument in `Generic[...]` or `Protocol[...]` for `ClassA` [generics_basic_2] -generics_syntax_declarations.py:25:29: error: Non-TypeVar argument in `Generic[...]` or `Protocol[...]` for `ClassC` [generics_basic_2] -generics_syntax_declarations.py:25:32: error: Non-TypeVar argument in `Generic[...]` or `Protocol[...]` for `ClassC` [generics_basic_2] -generics_syntax_declarations.py:32:9: error: Attribute `is_integer` is not defined on `str`; parameter `x` is typed as `T` (bound to `str`) [generics_syntax_declarations_2] -generics_syntax_declarations.py:44:21: error: Type parameter `T` in class `ClassD` references a type variable from an outer scope in its bound; this is not allowed [generics_syntax_declarations] -generics_syntax_declarations.py:48:17: error: Type parameter `T` in class `ClassH` has a list literal as its bound; use a tuple for constraints or a single type for an upper bound [generics_syntax_declarations] -generics_syntax_declarations.py:60:17: error: Type parameter `T` in class `ClassK` has an empty constraint tuple; constraint tuples must contain two or more types [generics_syntax_declarations] -generics_syntax_declarations.py:64:17: error: Type parameter `T` in class `ClassL` has a single-element constraint tuple; constraint tuples must contain two or more types [generics_syntax_declarations] -generics_syntax_declarations.py:71:17: error: Type parameter `T` in class `ClassM` uses a non-literal constraint; the constraint must be a literal tuple expression, not a variable [generics_syntax_declarations] -generics_syntax_declarations.py:75:18: error: Type parameter `T` in class `ClassN` has an invalid constraint element; constraint tuple elements must be types, not literal values [generics_syntax_declarations] -generics_syntax_declarations.py:79:18: error: Type parameter `T` in class `ClassO` references a type variable from an outer scope in its bound; this is not allowed [generics_syntax_declarations] -""" diff --git a/conformance/results/basilisk/generics_syntax_infer_variance.toml b/conformance/results/basilisk/generics_syntax_infer_variance.toml deleted file mode 100644 index 03e049d4a..000000000 --- a/conformance/results/basilisk/generics_syntax_infer_variance.toml +++ /dev/null @@ -1,24 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -generics_syntax_infer_variance.py:15:6: error: `TypeVar` `S1` cannot use `infer_variance=True` with explicit variance flags [generics_typevartuple_basic] -generics_syntax_infer_variance.py:17:6: error: `TypeVar` `S2` cannot use `infer_variance=True` with explicit variance flags [generics_typevartuple_basic] -generics_syntax_infer_variance.py:29:1: error: Type `ShouldBeCovariant1[float]` is not assignable to `ShouldBeCovariant1[int]` (type parameter is covariant) [generics_variance_inference] -generics_syntax_infer_variance.py:47:1: error: Type `ShouldBeCovariant2[float]` is not assignable to `ShouldBeCovariant2[int]` (type parameter is covariant) [generics_variance_inference] -generics_syntax_infer_variance.py:56:1: error: Type `ShouldBeCovariant3[float]` is not assignable to `ShouldBeCovariant3[int]` (type parameter is covariant) [generics_variance_inference] -generics_syntax_infer_variance.py:85:1: error: Type `ShouldBeCovariant5[float]` is not assignable to `ShouldBeCovariant5[int]` (type parameter is covariant) [generics_variance_inference] -generics_syntax_infer_variance.py:96:1: error: Type `ShouldBeCovariant6[float]` is not assignable to `ShouldBeCovariant6[int]` (type parameter is covariant) [generics_variance_inference] -generics_syntax_infer_variance.py:112:1: error: Type `ShouldBeInvariant1[int]` is not assignable to `ShouldBeInvariant1[float]` (type parameter is invariant) [generics_variance_inference] -generics_syntax_infer_variance.py:113:1: error: Type `ShouldBeInvariant1[float]` is not assignable to `ShouldBeInvariant1[int]` (type parameter is invariant) [generics_variance_inference] -generics_syntax_infer_variance.py:127:1: error: Type `ShouldBeInvariant2[int]` is not assignable to `ShouldBeInvariant2[float]` (type parameter is invariant) [generics_variance_inference] -generics_syntax_infer_variance.py:128:1: error: Type `ShouldBeInvariant2[float]` is not assignable to `ShouldBeInvariant2[int]` (type parameter is invariant) [generics_variance_inference] -generics_syntax_infer_variance.py:135:1: error: Type `ShouldBeInvariant3[int]` is not assignable to `ShouldBeInvariant3[float]` (type parameter is invariant) [generics_variance_inference] -generics_syntax_infer_variance.py:136:1: error: Type `ShouldBeInvariant3[float]` is not assignable to `ShouldBeInvariant3[int]` (type parameter is invariant) [generics_variance_inference] -generics_syntax_infer_variance.py:137:1: error: Type `ShouldBeInvariant3[int]` is not assignable to `ShouldBeInvariant3[float]` (type parameter is invariant) [generics_variance_inference] -generics_syntax_infer_variance.py:138:1: error: Type `ShouldBeInvariant3[float]` is not assignable to `ShouldBeInvariant3[int]` (type parameter is invariant) [generics_variance_inference] -generics_syntax_infer_variance.py:146:1: error: Type `ShouldBeInvariant4[int]` is not assignable to `ShouldBeInvariant4[float]` (type parameter is invariant) [generics_variance_inference] -generics_syntax_infer_variance.py:154:1: error: Type `ShouldBeInvariant5[int]` is not assignable to `ShouldBeInvariant5[float]` (type parameter is invariant) [generics_variance_inference] -generics_syntax_infer_variance.py:165:1: error: Type `ShouldBeContravariant1[int]` is not assignable to `ShouldBeContravariant1[float]` (type parameter is contravariant) [generics_variance_inference] -""" diff --git a/conformance/results/basilisk/generics_syntax_scoping.toml b/conformance/results/basilisk/generics_syntax_scoping.toml deleted file mode 100644 index d04922a2e..000000000 --- a/conformance/results/basilisk/generics_syntax_scoping.toml +++ /dev/null @@ -1,13 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -generics_syntax_scoping.py:14:7: error: PEP 695 type parameter `T` bound references `S` from the same type parameter list [generics_syntax_scoping] -generics_syntax_scoping.py:18:7: error: PEP 695 type parameter `S` bound references `T` from the same type parameter list [generics_syntax_scoping] -generics_syntax_scoping.py:35:7: error: PEP 695 type parameter `T` is not defined at module scope; it is only accessible inside the generic class or function where it is declared [generics_syntax_scoping] -generics_syntax_scoping.py:44:1: error: PEP 695 type parameter `T` is not defined at this point: it belongs to the decorated definition, not the decorator call [generics_syntax_scoping] -generics_syntax_scoping.py:92:9: error: Method type parameter `T` shadows the enclosing class's type parameter of the same name [generics_syntax_scoping] -generics_syntax_scoping.py:95:9: error: Method type parameter `T` shadows the enclosing class's type parameter of the same name [generics_syntax_scoping] -generics_syntax_scoping.py:98:9: error: Method type parameter `T` shadows the enclosing class's type parameter of the same name [generics_syntax_scoping] -""" diff --git a/conformance/results/basilisk/generics_type_erasure.toml b/conformance/results/basilisk/generics_type_erasure.toml deleted file mode 100644 index c5103a372..000000000 --- a/conformance/results/basilisk/generics_type_erasure.toml +++ /dev/null @@ -1,13 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -generics_type_erasure.py:38:16: error: Argument type `str` is incompatible with parameter `label` of type `int | None` in `Node.__init__` [constructors_call_init] -generics_type_erasure.py:40:16: error: Argument type `int` is incompatible with parameter `label` of type `str | None` in `Node.__init__` [constructors_call_init] -generics_type_erasure.py:42:1: error: Cannot access instance attribute `label` on class object `Node` [generics_type_erasure] -generics_type_erasure.py:43:1: error: Cannot access instance attribute `label` on class object `Node` [generics_type_erasure] -generics_type_erasure.py:44:1: error: Cannot access instance attribute `label` on class object `Node` [generics_type_erasure] -generics_type_erasure.py:45:1: error: Cannot access instance attribute `label` on class object `Node` [generics_type_erasure] -generics_type_erasure.py:46:1: error: Cannot access instance attribute `label` on class object `type(n1)` [generics_type_erasure] -""" diff --git a/conformance/results/basilisk/generics_typevartuple_args.toml b/conformance/results/basilisk/generics_typevartuple_args.toml deleted file mode 100644 index 57cee861d..000000000 --- a/conformance/results/basilisk/generics_typevartuple_args.toml +++ /dev/null @@ -1,14 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -generics_typevartuple_args.py:33:5: error: Invalid arguments for `*args` of `exec_le`: `str` is not assignable to `Env` [generics_typevartuple_args] -generics_typevartuple_args.py:34:5: error: Invalid arguments for `*args` of `exec_le`: `str` is not assignable to `Env` [generics_typevartuple_args] -generics_typevartuple_args.py:48:1: error: Invalid arguments for `*args` of `func1`: `str` is not assignable to `int` [generics_typevartuple_args] -generics_typevartuple_args.py:57:1: error: Invalid arguments for `*args` of `func2`: `int` is not assignable to `str` [generics_typevartuple_args] -generics_typevartuple_args.py:58:1: error: Invalid arguments for `*args` of `func2`: expected at least 2 arguments, got 1 [generics_typevartuple_args] -generics_typevartuple_args.py:59:1: error: Invalid arguments for `*args` of `func2`: expected at least 2 arguments, got 1 [generics_typevartuple_args] -generics_typevartuple_args.py:67:1: error: Invalid arguments for `*args` of `func3`: expected exactly 2 arguments, got 1 [generics_typevartuple_args] -generics_typevartuple_args.py:75:1: error: Invalid arguments for `*args` of `func4`: every argument must be a tuple of the same length, but found lengths [1, 2] [generics_typevartuple_args] -""" diff --git a/conformance/results/basilisk/generics_typevartuple_basic.toml b/conformance/results/basilisk/generics_typevartuple_basic.toml deleted file mode 100644 index 7768276b5..000000000 --- a/conformance/results/basilisk/generics_typevartuple_basic.toml +++ /dev/null @@ -1,23 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -generics_typevartuple_basic.py:42:28: error: TypeVarTuple shape mismatch: `Array` is declared with 2 type arguments, but the constructor argument is not a tuple expression [generics_typevartuple_args] -generics_typevartuple_basic.py:43:35: error: TypeVarTuple shape mismatch: `Array` is declared with 3 type arguments, but the constructor argument is a tuple of length 2 [generics_typevartuple_args] -generics_typevartuple_basic.py:44:41: error: TypeVarTuple element order mismatch: `Array` is declared `[Time, Batch, Height, Width]` but the constructor provides `[Time, Batch, Width, Height]` [generics_typevartuple_args] -generics_typevartuple_basic.py:52:22: error: `TypeVarTuple` `Shape` must be unpacked with `*` in generic parameter list [generics_typevartuple_basic_2] -generics_typevartuple_basic.py:53:24: error: `TypeVarTuple` `Shape` must be unpacked with `*` inside `tuple[...]` [generics_typevartuple_basic_2] -generics_typevartuple_basic.py:56:28: error: `TypeVarTuple` `Shape` must be unpacked with `*` inside `tuple[...]` [generics_typevartuple_basic_2] -generics_typevartuple_basic.py:59:18: error: `TypeVarTuple` `Shape` must be unpacked with `*` in annotation for `args` [generics_typevartuple_basic_2] -generics_typevartuple_basic.py:65:7: error: `TypeVarTuple` `Ts1` does not support `covariant` or `contravariant` arguments [generics_typevartuple_basic] -generics_typevartuple_basic.py:65:7: error: Invalid `TypeVarTuple` parameters: `TypeVarTuple` does not support variance specification [generics_typevartuple_basic_3] -generics_typevartuple_basic.py:66:7: error: `TypeVarTuple` `Ts2` does not accept type constraint arguments [generics_typevartuple_basic] -generics_typevartuple_basic.py:66:7: error: Invalid `TypeVarTuple` parameters: `TypeVarTuple` does not support type constraints [generics_typevartuple_basic_3] -generics_typevartuple_basic.py:67:7: error: `TypeVarTuple` `Ts3` does not support a `bound=` argument [generics_typevartuple_basic] -generics_typevartuple_basic.py:67:7: error: Invalid `TypeVarTuple` parameters: `TypeVarTuple` does not support bounds [generics_typevartuple_basic_3] -generics_typevartuple_basic.py:91:1: error: TypeVarTuple binding mismatch: arguments to `func2` must bind the shared TypeVarTuple to the same types [generics_typevartuple_args] -generics_typevartuple_basic.py:100:5: error: TypeVarTuple binding mismatch: arguments to `multiply` must bind the shared TypeVarTuple to the same types [generics_typevartuple_args] -generics_typevartuple_basic.py:101:5: error: TypeVarTuple binding mismatch: arguments to `multiply` must bind the shared TypeVarTuple to the same types [generics_typevartuple_args] -generics_typevartuple_basic.py:107:7: error: Class `Array3` has 2 `TypeVarTuple`s in its generic parameters; only one is allowed [generics_typevartuple_specialization] -""" diff --git a/conformance/results/basilisk/generics_typevartuple_callable.toml b/conformance/results/basilisk/generics_typevartuple_callable.toml deleted file mode 100644 index aa120f34e..000000000 --- a/conformance/results/basilisk/generics_typevartuple_callable.toml +++ /dev/null @@ -1,7 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -generics_typevartuple_callable.py:26:1: error: Tuple element at index 0 has type `str` but `target` expects `int` (inferred via `TypeVarTuple`) [generics_typevartuple_callable] -""" diff --git a/conformance/results/basilisk/generics_typevartuple_concat.toml b/conformance/results/basilisk/generics_typevartuple_concat.toml deleted file mode 100644 index be211bd5b..000000000 --- a/conformance/results/basilisk/generics_typevartuple_concat.toml +++ /dev/null @@ -1,6 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -""" diff --git a/conformance/results/basilisk/generics_typevartuple_overloads.toml b/conformance/results/basilisk/generics_typevartuple_overloads.toml deleted file mode 100644 index be211bd5b..000000000 --- a/conformance/results/basilisk/generics_typevartuple_overloads.toml +++ /dev/null @@ -1,6 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -""" diff --git a/conformance/results/basilisk/generics_typevartuple_specialization.toml b/conformance/results/basilisk/generics_typevartuple_specialization.toml deleted file mode 100644 index 6dffa2573..000000000 --- a/conformance/results/basilisk/generics_typevartuple_specialization.toml +++ /dev/null @@ -1,13 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -generics_typevartuple_specialization.py:109:1: error: Cannot use unpacked `TypeVarTuple` `*Ts` as a type argument to `IntTupleGeneric`, which has no `TypeVarTuple` parameter [generics_typevartuple_specialization_2] -generics_typevartuple_specialization.py:109:1: error: TypeVar `Ts` is not bound in this scope [generics_variance_inference] -generics_typevartuple_specialization.py:110:1: error: Cannot use unpacked tuple `*tuple[...]` as a type argument to `IntTupleGeneric`, which has no `TypeVarTuple` parameter [generics_typevartuple_specialization_2] -generics_typevartuple_specialization.py:121:1: error: Tuple type alias `TA5` has 2 unpack operators; at most one `*` unpack is allowed in a `tuple[...]` type [generics_typevartuple_specialization] -generics_typevartuple_specialization.py:122:1: error: Tuple type alias `TA6` has 2 unpack operators; at most one `*` unpack is allowed in a `tuple[...]` type [generics_typevartuple_specialization] -generics_typevartuple_specialization.py:127:5: error: `TA7` requires at least 2 plain type arguments (one per regular `TypeVar`), but 1 was provided (out of 1 total) [generics_typevartuple_specialization_2] -generics_typevartuple_specialization.py:163:8: error: `TA11` requires at least 1 plain type argument (one per regular `TypeVar`), but 0 were provided (out of 1 total) [generics_typevartuple_specialization_2] -""" diff --git a/conformance/results/basilisk/generics_typevartuple_unpack.toml b/conformance/results/basilisk/generics_typevartuple_unpack.toml deleted file mode 100644 index aede487ca..000000000 --- a/conformance/results/basilisk/generics_typevartuple_unpack.toml +++ /dev/null @@ -1,7 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -generics_typevartuple_unpack.py:30:5: error: `Array[Batch]` has 1 type argument, but `process_batch_channels` requires at least 2 for the `TypeVarTuple` unpack pattern [generics_typevartuple_unpack] -""" diff --git a/conformance/results/basilisk/generics_upper_bound.toml b/conformance/results/basilisk/generics_upper_bound.toml deleted file mode 100644 index 402c012c9..000000000 --- a/conformance/results/basilisk/generics_upper_bound.toml +++ /dev/null @@ -1,11 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -generics_upper_bound.py:24:14: error: `T_Bad1` has a `bound=` that is parameterized by a type variable [generics_basic] -generics_upper_bound.py:44:5: error: Type mismatch in `assert_type()`: expression has type `list[int] | set[int]` but expected `Collection[int]` [directives_assert_type_2] -generics_upper_bound.py:52:1: error: Argument of type `int` does not satisfy `TypeVar` bound `Sized` for `longer` [generics_upper_bound] -generics_upper_bound.py:57:10: error: `T_Bad2` specifies both constraints and `bound=`; these are mutually exclusive [generics_basic] -generics_upper_bound.py:57:10: error: `TypeVar` `T_Bad2` cannot have both type constraints and an upper bound [generics_typevartuple_basic] -""" diff --git a/conformance/results/basilisk/generics_variance.toml b/conformance/results/basilisk/generics_variance.toml deleted file mode 100644 index d49a4175a..000000000 --- a/conformance/results/basilisk/generics_variance.toml +++ /dev/null @@ -1,19 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -generics_variance.py:14:6: error: `TypeVar` `X1` cannot be both covariant and contravariant [generics_typevartuple_basic] -generics_variance.py:77:14: error: Variance incompatibility in base class `Inv`: `T_co` is covariant but the corresponding type parameter is invariant [generics_variance] -generics_variance.py:81:14: error: Variance incompatibility in base class `Inv`: `T_contra` is contravariant but the corresponding type parameter is invariant [generics_variance] -generics_variance.py:93:17: error: Variance incompatibility in base class `Co`: `T_contra` is contravariant but the corresponding type parameter is covariant [generics_variance] -generics_variance.py:105:21: error: Variance incompatibility in base class `Contra`: `T_co` is covariant but the corresponding type parameter is contravariant [generics_variance] -generics_variance.py:113:21: error: Variance incompatibility in base class `Contra`: `T_co` is covariant but the corresponding type parameter is contravariant [generics_variance] -generics_variance.py:126:5: error: Variance incompatibility in base class `CoContra`: `T_co` is covariant but the corresponding type parameter is contravariant [generics_variance] -generics_variance.py:132:5: error: Variance incompatibility in base class `CoContra`: `T_contra` is contravariant but the corresponding type parameter is covariant [generics_variance] -generics_variance.py:142:5: error: Variance incompatibility in base class `CoContra`: `T_co` is covariant but the corresponding type parameter is contravariant [generics_variance] -generics_variance.py:163:26: error: Variance incompatibility in base class `Contra`: `T_contra` is covariant but the corresponding type parameter is contravariant [generics_variance] -generics_variance.py:167:30: error: Variance incompatibility in base class `Contra`: `T_co` is covariant but the corresponding type parameter is contravariant [generics_variance] -generics_variance.py:191:33: error: Variance incompatibility in base class `Contra_TA`: `T_contra` is covariant but the corresponding type parameter is contravariant [generics_variance] -generics_variance.py:196:5: error: Variance incompatibility in base class `Contra_TA`: `T_co` is covariant but the corresponding type parameter is contravariant [generics_variance] -""" diff --git a/conformance/results/basilisk/generics_variance_inference.toml b/conformance/results/basilisk/generics_variance_inference.toml deleted file mode 100644 index f9387d551..000000000 --- a/conformance/results/basilisk/generics_variance_inference.toml +++ /dev/null @@ -1,29 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -generics_variance_inference.py:24:5: error: Type `ClassA[float]` is not assignable to `ClassA[int]` (type parameter is invariant) [generics_variance_inference] -generics_variance_inference.py:25:5: error: Type `ClassA[int]` is not assignable to `ClassA[float]` (type parameter is contravariant) [generics_variance_inference] -generics_variance_inference.py:28:5: error: Type `ClassA[float]` is not assignable to `ClassA[int]` (type parameter is covariant) [generics_variance_inference] -generics_variance_inference.py:41:1: error: Type `ShouldBeCovariant1[float]` is not assignable to `ShouldBeCovariant1[int]` (type parameter is covariant) [generics_variance_inference] -generics_variance_inference.py:49:1: error: Type `ShouldBeCovariant2[float]` is not assignable to `ShouldBeCovariant2[int]` (type parameter is covariant) [generics_variance_inference] -generics_variance_inference.py:58:1: error: Type `ShouldBeCovariant3[float]` is not assignable to `ShouldBeCovariant3[int]` (type parameter is covariant) [generics_variance_inference] -generics_variance_inference.py:67:1: error: Type `ShouldBeCovariant4[float]` is not assignable to `ShouldBeCovariant4[int]` (type parameter is covariant) [generics_variance_inference] -generics_variance_inference.py:80:1: error: Type `ShouldBeCovariant5[float]` is not assignable to `ShouldBeCovariant5[int]` (type parameter is covariant) [generics_variance_inference] -generics_variance_inference.py:96:1: error: Type `ShouldBeInvariant1[int]` is not assignable to `ShouldBeInvariant1[float]` (type parameter is invariant) [generics_variance_inference] -generics_variance_inference.py:97:1: error: Type `ShouldBeInvariant1[float]` is not assignable to `ShouldBeInvariant1[int]` (type parameter is invariant) [generics_variance_inference] -generics_variance_inference.py:111:1: error: Type `ShouldBeInvariant2[int]` is not assignable to `ShouldBeInvariant2[float]` (type parameter is invariant) [generics_variance_inference] -generics_variance_inference.py:112:1: error: Type `ShouldBeInvariant2[float]` is not assignable to `ShouldBeInvariant2[int]` (type parameter is invariant) [generics_variance_inference] -generics_variance_inference.py:119:1: error: Type `ShouldBeInvariant3[int]` is not assignable to `ShouldBeInvariant3[float]` (type parameter is invariant) [generics_variance_inference] -generics_variance_inference.py:120:1: error: Type `ShouldBeInvariant3[float]` is not assignable to `ShouldBeInvariant3[int]` (type parameter is invariant) [generics_variance_inference] -generics_variance_inference.py:121:1: error: Type `ShouldBeInvariant3[int]` is not assignable to `ShouldBeInvariant3[float]` (type parameter is invariant) [generics_variance_inference] -generics_variance_inference.py:122:1: error: Type `ShouldBeInvariant3[float]` is not assignable to `ShouldBeInvariant3[int]` (type parameter is invariant) [generics_variance_inference] -generics_variance_inference.py:130:1: error: Type `ShouldBeInvariant4[int]` is not assignable to `ShouldBeInvariant4[float]` (type parameter is invariant) [generics_variance_inference] -generics_variance_inference.py:138:1: error: Type `ShouldBeInvariant5[int]` is not assignable to `ShouldBeInvariant5[float]` (type parameter is invariant) [generics_variance_inference] -generics_variance_inference.py:149:1: error: Type `ShouldBeContravariant1[int]` is not assignable to `ShouldBeContravariant1[float]` (type parameter is contravariant) [generics_variance_inference] -generics_variance_inference.py:169:1: error: Type `ShouldBeInvariant6[float]` is not assignable to `ShouldBeInvariant6[int]` (type parameter is invariant) [generics_variance_inference] -generics_variance_inference.py:170:1: error: Type `ShouldBeInvariant6[int]` is not assignable to `ShouldBeInvariant6[float]` (type parameter is invariant) [generics_variance_inference] -generics_variance_inference.py:181:1: error: Type `ShouldBeCovariant6[float]` is not assignable to `ShouldBeCovariant6[int]` (type parameter is covariant) [generics_variance_inference] -generics_variance_inference.py:194:1: error: Type `ShouldBeContravariant2[int]` is not assignable to `ShouldBeContravariant2[float]` (type parameter is contravariant) [generics_variance_inference] -""" diff --git a/conformance/results/basilisk/historical_positional.toml b/conformance/results/basilisk/historical_positional.toml deleted file mode 100644 index abb39b237..000000000 --- a/conformance/results/basilisk/historical_positional.toml +++ /dev/null @@ -1,10 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -historical_positional.py:18:4: error: `__x` is a positional-only parameter and cannot be passed as a keyword argument [historical_positional] -historical_positional.py:26:16: error: Positional-only parameter `__y` appears after a positional-or-keyword parameter [historical_positional] -historical_positional.py:54:26: error: Positional-only parameter `__y` appears after a positional-or-keyword parameter [historical_positional] -historical_positional.py:59:6: error: `__x` is a positional-only parameter and cannot be passed as a keyword argument [historical_positional] -""" diff --git a/conformance/results/basilisk/literals_interactions.toml b/conformance/results/basilisk/literals_interactions.toml deleted file mode 100644 index 5c6a42c74..000000000 --- a/conformance/results/basilisk/literals_interactions.toml +++ /dev/null @@ -1,10 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -literals_interactions.py:14:5: error: Tuple index 5 is out of range for `tuple` of length 3 [tuples_index_2] -literals_interactions.py:15:5: error: Tuple index -5 is out of range for `tuple` of length 3 [tuples_index_2] -literals_interactions.py:16:5: error: Tuple index 4 is out of range for `tuple` of length 3 [tuples_index_2] -literals_interactions.py:17:5: error: Tuple index -4 is out of range for `tuple` of length 3 [tuples_index_2] -""" diff --git a/conformance/results/basilisk/literals_literalstring.toml b/conformance/results/basilisk/literals_literalstring.toml deleted file mode 100644 index 07926280a..000000000 --- a/conformance/results/basilisk/literals_literalstring.toml +++ /dev/null @@ -1,17 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -literals_literalstring.py:36:1: error: Invalid parameterization of `Literal` in annotation for `bad_union` [literals_parameterizations] -literals_literalstring.py:37:1: error: Invalid parameterization of `Literal` in annotation for `bad_nesting` [literals_parameterizations] -literals_literalstring.py:43:1: error: Type mismatch: `x2` is annotated `Literal[""]` but assigned parameter `b` with type `Literal["two"]` [literals_semantics_2] -literals_literalstring.py:43:5: error: Type mismatch: `x2` is annotated `Literal[""]` (Literal[""]) but assigned Literal["two"] [assignment_compatibility] -literals_literalstring.py:43:5: error: Cannot assign `Literal["two"]` to `Literal[""]` — literal values are incompatible [literals_literalstring] -literals_literalstring.py:65:5: error: Cannot assign f-string to `LiteralString` — interpolated variable `non_literal` has type `str`, which is not `LiteralString` [literals_literalstring] -literals_literalstring.py:73:5: error: Type mismatch: `x3` is annotated `LiteralString` (LiteralString) but assigned int [assignment_compatibility] -literals_literalstring.py:74:5: error: Type mismatch: `x4` is annotated `LiteralString` (LiteralString) but assigned bytes [assignment_compatibility] -literals_literalstring.py:119:22: error: Argument `s` has type `str` which is not compatible with TypeVar bound `LiteralString` [generics_upper_bound_2] -literals_literalstring.py:133:5: error: Cannot assign `Container(s)` to `Container[LiteralString]` — argument `s` has type `str`, not `LiteralString` [literals_literalstring] -literals_literalstring.py:171:5: error: Cannot assign `list[LiteralString]` to `list[str]` — `list` is invariant in its type parameter [literals_literalstring] -""" diff --git a/conformance/results/basilisk/literals_parameterizations.toml b/conformance/results/basilisk/literals_parameterizations.toml deleted file mode 100644 index 58a33d457..000000000 --- a/conformance/results/basilisk/literals_parameterizations.toml +++ /dev/null @@ -1,27 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -literals_parameterizations.py:41:1: error: Invalid parameterization of `Literal` in annotation for `bad1` [literals_parameterizations] -literals_parameterizations.py:42:1: error: Invalid parameterization of `Literal` in annotation for `bad2` [literals_parameterizations] -literals_parameterizations.py:43:1: error: Invalid parameterization of `Literal` in annotation for `bad3` [literals_parameterizations] -literals_parameterizations.py:44:1: error: Invalid parameterization of `Literal` in annotation for `bad4` [literals_parameterizations] -literals_parameterizations.py:45:1: error: Invalid parameterization of `Literal` in annotation for `bad5` [literals_parameterizations] -literals_parameterizations.py:46:1: error: Invalid parameterization of `Literal` in annotation for `bad6` [literals_parameterizations] -literals_parameterizations.py:47:1: error: Invalid parameterization of `Literal` in annotation for `bad7` [literals_parameterizations] -literals_parameterizations.py:48:1: error: Invalid parameterization of `Literal` in annotation for `bad8` [literals_parameterizations] -literals_parameterizations.py:49:1: error: Invalid parameterization of `Literal` in annotation for `bad9` [literals_parameterizations] -literals_parameterizations.py:50:1: error: TypeVar `T` is not bound in this scope [generics_variance_inference] -literals_parameterizations.py:50:1: error: Invalid parameterization of `Literal` in annotation for `bad10` [literals_parameterizations] -literals_parameterizations.py:50:8: error: Type variable `T` is not bound in the current scope [generics_scoping] -literals_parameterizations.py:51:1: error: Invalid parameterization of `Literal` in annotation for `bad11` [literals_parameterizations] -literals_parameterizations.py:52:1: error: Invalid parameterization of `Literal` in annotation for `bad12` [literals_parameterizations] -literals_parameterizations.py:53:1: error: Invalid parameterization of `Literal` in annotation for `bad13` [literals_parameterizations] -literals_parameterizations.py:56:17: error: Invalid parameterization of `Literal` for parameter `x` [literals_parameterizations] -literals_parameterizations.py:60:1: error: `Literal` must be parameterized (variable `x` has no arguments) [literals_parameterizations] -literals_parameterizations.py:61:1: error: Invalid parameterization of `Literal` in annotation for `y` [literals_parameterizations] -literals_parameterizations.py:65:1: error: Type mismatch: `x1` is annotated `Literal["Color.RED"]` but assigned parameter `a` with type `Literal[Color.RED]` [literals_semantics_2] -literals_parameterizations.py:65:5: error: Type mismatch: `x1` is annotated `Literal["Color.RED"]` (Literal["color.red"]) but assigned color.red [assignment_compatibility] -literals_parameterizations.py:65:5: error: Variable `x1` is annotated as `Literal["Color.RED"]` (a string literal), but `Color.RED` is an enum member reference, not a string [literals_parameterizations_2] -""" diff --git a/conformance/results/basilisk/literals_semantics.toml b/conformance/results/basilisk/literals_semantics.toml deleted file mode 100644 index 2fdf23275..000000000 --- a/conformance/results/basilisk/literals_semantics.toml +++ /dev/null @@ -1,12 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -literals_semantics.py:10:1: error: Type mismatch: `v2` is annotated `Literal[3]` (Literal[3]) but assigned Literal[4] [assignment_compatibility] -literals_semantics.py:24:1: error: Type mismatch: `x1` is annotated `Literal[False]` but assigned parameter `a` with type `Literal[0]` [literals_semantics_2] -literals_semantics.py:24:5: error: Type mismatch: `x1` is annotated `Literal[False]` (Literal[false]) but assigned Literal[0] [assignment_compatibility] -literals_semantics.py:25:1: error: Type mismatch: `x2` is annotated `Literal[0]` but assigned parameter `b` with type `Literal[False]` [literals_semantics_2] -literals_semantics.py:25:5: error: Type mismatch: `x2` is annotated `Literal[0]` (Literal[0]) but assigned Literal[false] [assignment_compatibility] -literals_semantics.py:33:1: error: Augmented assignment `a += ...` is incompatible with declared type `L[3, 4, 5]` [literals_semantics_2] -""" diff --git a/conformance/results/basilisk/namedtuples_define_class.toml b/conformance/results/basilisk/namedtuples_define_class.toml deleted file mode 100644 index da7b78846..000000000 --- a/conformance/results/basilisk/namedtuples_define_class.toml +++ /dev/null @@ -1,21 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -namedtuples_define_class.py:33:7: error: NamedTuple index 3 out of range for `p1` with 3 field(s) (valid range: -3..2) [namedtuples_usage] -namedtuples_define_class.py:34:7: error: NamedTuple index -4 out of range for `p1` with 3 field(s) (valid range: -3..2) [namedtuples_usage] -namedtuples_define_class.py:45:6: error: `Point` requires at least 2 arguments, but 1 was given [constructors_call_init] -namedtuples_define_class.py:46:6: error: `Point` requires at least 2 arguments, but 1 was given [constructors_call_init] -namedtuples_define_class.py:47:15: error: Argument 1 to `Point()` has type `str`, expected `int` for field `y` [constructors_call_init] -namedtuples_define_class.py:48:18: error: Keyword argument `units` to `Point()` has type `int`, expected `str` [constructors_call_init] -namedtuples_define_class.py:49:6: error: `Point` accepts at most 3 positional arguments, but 4 were given [constructors_call_init] -namedtuples_define_class.py:50:7: error: `Point` has no field `other` [constructors_call_init] -namedtuples_define_class.py:70:7: error: `Point2` accepts at most 2 positional arguments, but 3 were given [constructors_call_init] -namedtuples_define_class.py:77:5: error: `NamedTuple` field name `_y` must not start with an underscore [namedtuples_define_class] -namedtuples_define_class.py:87:5: error: `NamedTuple` field `latitude` without a default value follows a field with a default value [namedtuples_define_class] -namedtuples_define_class.py:107:5: error: `NamedTuple` subclass `BadPointWithName` redefines field `x` from base class [namedtuples_define_class] -namedtuples_define_class.py:121:1: error: `ConditionalField` accepts at most 2 positional arguments, but 3 were given [constructors_call_init] -namedtuples_define_class.py:140:19: error: Argument 1 to `Property[...]()` has type `float`, expected `str` for field `value` [constructors_call_init] -namedtuples_define_class.py:147:7: error: `NamedTuple` class `Unit` cannot inherit from multiple bases: `object` [namedtuples_define_class] -""" diff --git a/conformance/results/basilisk/namedtuples_define_functional.toml b/conformance/results/basilisk/namedtuples_define_functional.toml deleted file mode 100644 index 7eb3470e4..000000000 --- a/conformance/results/basilisk/namedtuples_define_functional.toml +++ /dev/null @@ -1,16 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -namedtuples_define_functional.py:16:8: error: Call to `Point1()` is missing 1 required argument (expected at least 2, got 1) [calls_argument_count] -namedtuples_define_functional.py:21:8: error: Call to `Point2()` is missing 2 required arguments (expected at least 2, got 0) [calls_argument_count] -namedtuples_define_functional.py:26:8: error: Call to `Point3()` has 1 too many positional argument (expected at most 2, got 3) [calls_argument_count] -namedtuples_define_functional.py:31:8: error: Call to `Point4()` is missing 1 required argument (expected at least 2, got 1) [calls_argument_count] -namedtuples_define_functional.py:31:8: error: Argument `z` is not a field of `Point4`; valid fields are: x, y [namedtuples_define_functional] -namedtuples_define_functional.py:36:8: error: Argument 2 to `Point5()` has type `str` but field `y` expects `int` [namedtuples_define_functional] -namedtuples_define_functional.py:37:8: error: Call to `Point5()` has 1 too many positional argument (expected at most 2, got 3) [calls_argument_count] -namedtuples_define_functional.py:42:8: error: Argument 2 to `Point6()` has type `str` but field `y` expects `int` [namedtuples_define_functional] -namedtuples_define_functional.py:43:8: error: Field `x` of `Point6` expects `int` but received a `float` literal [namedtuples_define_functional] -namedtuples_define_functional.py:69:1: error: Call to `NT7()` is missing 1 required argument (expected at least 1, got 0) [calls_argument_count] -""" diff --git a/conformance/results/basilisk/namedtuples_type_compat.toml b/conformance/results/basilisk/namedtuples_type_compat.toml deleted file mode 100644 index 569eedd02..000000000 --- a/conformance/results/basilisk/namedtuples_type_compat.toml +++ /dev/null @@ -1,8 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -namedtuples_type_compat.py:22:1: error: Incompatible tuple assignment: `p` is a `Point` with 3 field(s), but `tuple[int, int]` expects 2 element(s) [namedtuples_type_compat] -namedtuples_type_compat.py:23:1: error: Incompatible tuple element type at index 1: `Point` field type is `int`, but `tuple[int, str, str]` expects `str` [namedtuples_type_compat] -""" diff --git a/conformance/results/basilisk/namedtuples_usage.toml b/conformance/results/basilisk/namedtuples_usage.toml deleted file mode 100644 index 8372fcb08..000000000 --- a/conformance/results/basilisk/namedtuples_usage.toml +++ /dev/null @@ -1,14 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -namedtuples_usage.py:34:7: error: NamedTuple index 3 out of range for `p` with 3 field(s) (valid range: -3..2) [namedtuples_usage] -namedtuples_usage.py:35:7: error: NamedTuple index -4 out of range for `p` with 3 field(s) (valid range: -3..2) [namedtuples_usage] -namedtuples_usage.py:40:1: error: Cannot assign to attribute `x` on NamedTuple instance `p`: NamedTuple fields are read-only [namedtuples_usage] -namedtuples_usage.py:41:1: error: Cannot assign to element of NamedTuple instance `p`: NamedTuple elements are read-only [namedtuples_usage] -namedtuples_usage.py:42:5: error: Cannot delete attribute `x` on NamedTuple instance `p`: NamedTuple fields are read-only [namedtuples_usage] -namedtuples_usage.py:43:5: error: Cannot delete element of NamedTuple instance `p`: NamedTuple elements are read-only [namedtuples_usage] -namedtuples_usage.py:52:1: error: NamedTuple unpack mismatch: too few values to unpack: `p` has 3 field(s) but only 2 variable(s) provided [namedtuples_usage] -namedtuples_usage.py:53:1: error: NamedTuple unpack mismatch: too many values to unpack: `p` has 3 field(s) but 4 variable(s) provided [namedtuples_usage] -""" diff --git a/conformance/results/basilisk/narrowing_typeguard.toml b/conformance/results/basilisk/narrowing_typeguard.toml deleted file mode 100644 index 653e9e59f..000000000 --- a/conformance/results/basilisk/narrowing_typeguard.toml +++ /dev/null @@ -1,10 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -narrowing_typeguard.py:102:23: error: Method `tg_1` returns `TypeGuard` but has no parameter to narrow [narrowing_typeguard] -narrowing_typeguard.py:107:22: error: Method `tg_2` returns `TypeGuard` but has no parameter to narrow [narrowing_typeguard] -narrowing_typeguard.py:128:20: error: Function `simple_typeguard` returns `TypeGuard[int]` (subtype of `bool`), but `takes_callable_str` expects return type `str` [narrowing_typeis] -narrowing_typeguard.py:148:26: error: Function `simple_typeguard` returns `TypeGuard[int]` (subtype of `bool`), but `takes_callable_str_proto` expects return type `str` [narrowing_typeis] -""" diff --git a/conformance/results/basilisk/narrowing_typeis.toml b/conformance/results/basilisk/narrowing_typeis.toml deleted file mode 100644 index c7fd4fd03..000000000 --- a/conformance/results/basilisk/narrowing_typeis.toml +++ /dev/null @@ -1,15 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -narrowing_typeis.py:110:23: error: Method `tg_1` returns `TypeIs` but has no parameter to narrow [narrowing_typeguard] -narrowing_typeis.py:115:22: error: Method `tg_2` returns `TypeIs` but has no parameter to narrow [narrowing_typeguard] -narrowing_typeis.py:137:20: error: Function `simple_typeguard` returns `TypeIs[int]` (subtype of `bool`), but `takes_callable_str` expects return type `str` [narrowing_typeis] -narrowing_typeis.py:157:26: error: Function `simple_typeguard` returns `TypeIs[int]` (subtype of `bool`), but `takes_callable_str_proto` expects return type `str` [narrowing_typeis] -narrowing_typeis.py:174:17: error: Function `is_int_typeis` returns `TypeIs[int]`, but `takes_typeguard` expects `TypeGuard[int]` [narrowing_typeis] -narrowing_typeis.py:175:14: error: Function `is_int_typeguard` returns `TypeGuard[int]`, but `takes_typeis` expects `TypeIs[int]` [narrowing_typeis] -narrowing_typeis.py:196:18: error: Function `bool_typeis` returns `TypeIs[bool]`, but `takes_int_typeis` expects `TypeIs[int]` [narrowing_typeis] -narrowing_typeis.py:200:27: error: `TypeIs[str]` narrows to a type inconsistent with parameter type `int` [narrowing_typeis_2] -narrowing_typeis.py:204:45: error: `TypeIs[list[int]]` narrows to a type inconsistent with parameter type `list[object]` [narrowing_typeis_2] -""" diff --git a/conformance/results/basilisk/overloads_basic.toml b/conformance/results/basilisk/overloads_basic.toml deleted file mode 100644 index 3648144bb..000000000 --- a/conformance/results/basilisk/overloads_basic.toml +++ /dev/null @@ -1,7 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -overloads_basic.py:39:1: error: No matching overload for `b[...]`: argument type `str` does not match any `@overload` signature of `Bytes.__getitem__` [overloads_basic] -""" diff --git a/conformance/results/basilisk/overloads_consistency.toml b/conformance/results/basilisk/overloads_consistency.toml deleted file mode 100644 index 1737c96f7..000000000 --- a/conformance/results/basilisk/overloads_consistency.toml +++ /dev/null @@ -1,8 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -overloads_consistency.py:25:5: error: Overload of `return_type` returns `str`, which is not assignable to the implementation's return type `int` [overloads_consistency_3] -overloads_consistency.py:41:5: error: An overload of `parameter_type` has a parameter type the implementation cannot accept [overloads_consistency_3] -""" diff --git a/conformance/results/basilisk/overloads_definitions.toml b/conformance/results/basilisk/overloads_definitions.toml deleted file mode 100644 index ebd2b9b03..000000000 --- a/conformance/results/basilisk/overloads_definitions.toml +++ /dev/null @@ -1,18 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -overloads_definitions.py:16:5: error: Function `func1` has only 1 `@overload` signature — at least two are required [overloads_definitions] -overloads_definitions.py:28:5: error: Function `func2` has 2 `@overload` signatures but no implementation [overloads_definitions] -overloads_definitions.py:59:9: error: Function `not_abstract` has 2 `@overload` signatures but no implementation [overloads_definitions] -overloads_definitions.py:81:9: error: Inconsistent `@staticmethod` across overloads of `func5`: it must be on every overload and the implementation, or none [overloads_consistency_2] -overloads_definitions.py:94:9: error: Inconsistent `@classmethod` across overloads of `func6`: it must be on every overload and the implementation, or none [overloads_consistency_2] -overloads_definitions.py:123:6: error: `@final` on an `@overload` signature of `invalid_final`: it should be applied only to the implementation [overloads_consistency_2] -overloads_definitions.py:138:6: error: `@final` on an `@overload` signature of `invalid_final_2`: it should be applied only to the implementation [overloads_consistency_2] -overloads_definitions.py:143:6: error: `@final` on an `@overload` signature of `invalid_final_2`: it should be applied only to the implementation [overloads_consistency_2] -overloads_definitions.py:186:9: error: Method `final_method` in `Child` overrides a `@final` method [qualifiers_final_decorator] -overloads_definitions.py:203:9: error: Method `bad_override` in `Child` is decorated with `@override` but no matching method exists in any base class [classes_override_3] -overloads_definitions.py:227:6: error: `@override` on an `@overload` signature of `to_override`: it should be applied only to the implementation [overloads_consistency_2] -overloads_definitions.py:231:6: error: `@override` on an `@overload` signature of `to_override`: it should be applied only to the implementation [overloads_consistency_2] -""" diff --git a/conformance/results/basilisk/overloads_definitions_stub.toml b/conformance/results/basilisk/overloads_definitions_stub.toml deleted file mode 100644 index 391363127..000000000 --- a/conformance/results/basilisk/overloads_definitions_stub.toml +++ /dev/null @@ -1,14 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -overloads_definitions_stub.pyi:14:5: error: Function `func1` has only 1 `@overload` signature — at least two are required [overloads_definitions] -overloads_definitions_stub.pyi:33:9: error: Inconsistent `@staticmethod` across overloads of `func5`: it must be on every overload and the implementation, or none [overloads_consistency_2] -overloads_definitions_stub.pyi:41:9: error: Inconsistent `@classmethod` across overloads of `func6`: it must be on every overload and the implementation, or none [overloads_consistency_2] -overloads_definitions_stub.pyi:72:6: error: `@final` on a later overload of `invalid_final`: in a stub it must appear only on the first overload [overloads_consistency_2] -overloads_definitions_stub.pyi:85:6: error: `@final` on a later overload of `invalid_final_2`: in a stub it must appear only on the first overload [overloads_consistency_2] -overloads_definitions_stub.pyi:111:9: error: Method `final_method` in `Child` overrides a `@final` method [qualifiers_final_decorator] -overloads_definitions_stub.pyi:122:9: error: Method `bad_override` in `Child` is decorated with `@override` but no matching method exists in any base class [classes_override_3] -overloads_definitions_stub.pyi:146:6: error: `@override` on a later overload of `to_override`: in a stub it must appear only on the first overload [overloads_consistency_2] -""" diff --git a/conformance/results/basilisk/overloads_evaluation.toml b/conformance/results/basilisk/overloads_evaluation.toml deleted file mode 100644 index 95343fbd5..000000000 --- a/conformance/results/basilisk/overloads_evaluation.toml +++ /dev/null @@ -1,10 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -overloads_evaluation.py:38:1: error: Call to `example1_1` is missing 1 required argument (no overload matches — expected at least 1, got 0) [calls_argument_count] -overloads_evaluation.py:46:15: error: Argument `y` of `example1_1` expects `str` but received an `int` literal [calls_argument_type] -overloads_evaluation.py:51:12: error: Argument `x` of `example1_1` expects `str` but received an `int` literal [calls_argument_type] -overloads_evaluation.py:116:5: error: No overload of `example2` matches when argument is `str` [overloads_evaluation] -""" diff --git a/conformance/results/basilisk/protocols_class_objects.toml b/conformance/results/basilisk/protocols_class_objects.toml deleted file mode 100644 index 6c9ee8816..000000000 --- a/conformance/results/basilisk/protocols_class_objects.toml +++ /dev/null @@ -1,15 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -protocols_class_objects.py:29:1: error: Protocol class `Proto` cannot be used where `type[Proto]` is expected; only concrete (non-protocol) subtypes are accepted [protocols_class_objects_2] -protocols_class_objects.py:29:1: error: Cannot instantiate Protocol class `Proto`; Protocols define interfaces, not concrete implementations [protocols_explicit] -protocols_class_objects.py:34:1: error: Protocol class `Proto` cannot be used where `type[Proto]` is expected; only concrete (non-protocol) subtypes are accepted [protocols_class_objects_2] -protocols_class_objects.py:58:1: error: Class `ConcreteA` cannot be used as an instance of protocol `ProtoA1`: class-level access to protocol members is incompatible [protocols_class_objects_2] -protocols_class_objects.py:74:1: error: Class `ConcreteB` cannot be used as an instance of protocol `ProtoB1`: class-level access to protocol members is incompatible [protocols_class_objects_2] -protocols_class_objects.py:104:1: error: Class `ConcreteC1` cannot be used as an instance of protocol `ProtoC1`: class-level access to protocol members is incompatible [protocols_class_objects_2] -protocols_class_objects.py:106:1: error: Class `ConcreteC2` cannot be used as an instance of protocol `ProtoC1`: class-level access to protocol members is incompatible [protocols_class_objects_2] -protocols_class_objects.py:107:1: error: Class `ConcreteC2` cannot be used as an instance of protocol `ProtoC2`: class-level access to protocol members is incompatible [protocols_class_objects_2] -protocols_class_objects.py:108:1: error: Class `ConcreteC3` cannot be used as an instance of protocol `ProtoC1`: class-level access to protocol members is incompatible [protocols_class_objects_2] -""" diff --git a/conformance/results/basilisk/protocols_definition.toml b/conformance/results/basilisk/protocols_definition.toml deleted file mode 100644 index d06412b0f..000000000 --- a/conformance/results/basilisk/protocols_definition.toml +++ /dev/null @@ -1,27 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -protocols_definition.py:30:1: error: Argument is incompatible with parameter `things` of type `Iterable[SupportsClose]`: `int` does not satisfy protocol `SupportsClose` [protocols_definition_2] -protocols_definition.py:67:9: error: Protocol member `temp` is not declared in the Protocol body [protocols_definition] -protocols_definition.py:114:1: error: Class `Concrete2_Bad1` is not compatible with protocol `Template2`: attribute `val1` is required to be a class variable (`ClassVar`) but is not defined at class level [classes_classvar] -protocols_definition.py:115:1: error: Class `Concrete2_Bad2` is not compatible with protocol `Template2`: attribute `val1` is required to be a class variable (`ClassVar`) but is declared as an instance variable [classes_classvar] -protocols_definition.py:116:1: error: Class `Concrete2_Bad3` is not compatible with protocol `Template2`: attribute `val1` is required to be a class variable (`ClassVar`) but is declared as an instance variable [classes_classvar] -protocols_definition.py:117:1: error: Class `Concrete2_Bad4` is not compatible with protocol `Template2`: attribute `val1` is required to be a class variable (`ClassVar`) but is declared as an instance variable [classes_classvar] -protocols_definition.py:156:1: error: Class `Concrete3_Bad1` is incompatible with protocol `Template3`: missing instance variable `val1` [protocols_definition_2] -protocols_definition.py:157:1: error: Class `Concrete3_Bad2` is incompatible with protocol `Template3`: `val1` is required to be a writable instance variable but is declared as a class variable (`ClassVar`) [protocols_definition_2] -protocols_definition.py:158:1: error: Class `Concrete3_Bad3` is incompatible with protocol `Template3`: `val1` is required to be a writable instance variable but is a read-only property [protocols_definition_2] -protocols_definition.py:159:1: error: Class `Concrete3_Bad4` is incompatible with protocol `Template3`: `val1` has type `Sequence[float]` but the protocol requires the writable instance variable to be `Sequence[int]` [protocols_definition_2] -protocols_definition.py:160:1: error: Class `Concrete3_Bad5` is incompatible with protocol `Template3`: `val1` has type `list[int]` but the protocol requires the writable instance variable to be `Sequence[int]` [protocols_definition_2] -protocols_definition.py:218:1: error: Class `Concrete4_Bad1` is incompatible with protocol `Template4`: `val1` is a property in the protocol but a plain method in the implementation [protocols_definition_2] -protocols_definition.py:219:1: error: Class `Concrete4_Bad2` is incompatible with protocol `Template4`: missing method `val1` [protocols_definition_2] -protocols_definition.py:285:1: error: Class `Concrete5_Bad1` is incompatible with protocol `Template5`: method `method1` signature is incompatible — parameter names ["a", "c"] do not match the protocol's ["a", "b"] [protocols_definition_2] -protocols_definition.py:286:1: error: Class `Concrete5_Bad2` is incompatible with protocol `Template5`: method `method1` signature is incompatible — parameter names ["a", "c"] do not match the protocol's ["a", "b"] [protocols_definition_2] -protocols_definition.py:287:1: error: Class `Concrete5_Bad3` is incompatible with protocol `Template5`: method `method1` signature is incompatible — parameter `a` is positional in the protocol but keyword-only in the implementation [protocols_definition_2] -protocols_definition.py:288:1: error: Class `Concrete5_Bad4` is incompatible with protocol `Template5`: method `method1` signature is incompatible — parameter `a` is keyword-accessible in the protocol but positional-only in the implementation [protocols_definition_2] -protocols_definition.py:289:1: error: Class `Concrete5_Bad5` is incompatible with protocol `Template5`: method `method1` signature is incompatible — a static method with a `self` parameter cannot satisfy an instance method [protocols_definition_2] -protocols_definition.py:339:1: error: Class `Concrete6_Bad1` is incompatible with protocol `Template6`: `val1` must be writable but a read-only property cannot satisfy a writable protocol member [protocols_definition_2] -protocols_definition.py:340:1: error: Class `Concrete6_Bad2` is incompatible with protocol `Template6`: `val1` must be writable but named tuple fields are immutable [protocols_definition_2] -protocols_definition.py:341:1: error: Class `Concrete6_Bad3` is incompatible with protocol `Template6`: `val1` must be writable but frozen dataclass fields are immutable [protocols_definition_2] -""" diff --git a/conformance/results/basilisk/protocols_explicit.toml b/conformance/results/basilisk/protocols_explicit.toml deleted file mode 100644 index 160cda87c..000000000 --- a/conformance/results/basilisk/protocols_explicit.toml +++ /dev/null @@ -1,13 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -protocols_explicit.py:27:9: error: Method `draw` in `BadColor` calls `super().draw()` but `PColor` declares it as abstract with no default implementation [protocols_explicit_3] -protocols_explicit.py:27:16: error: Cannot call `super().draw()`: the method is abstract with no default implementation [protocols_explicit_2] -protocols_explicit.py:56:1: error: Parameter `blue` has type `str` but element 2 of `rgb` in protocol `RGB` expects `int` [protocols_subtyping] -protocols_explicit.py:60:5: error: Cannot instantiate `Point`; it does not implement all required protocol members [protocols_explicit] -protocols_explicit.py:89:6: error: Cannot instantiate `Concrete1`; it does not implement all required protocol members [protocols_explicit] -protocols_explicit.py:134:6: error: Cannot instantiate `Concrete5`; it does not implement all required protocol members [protocols_explicit] -protocols_explicit.py:164:7: error: Cannot instantiate `Concrete7A`; it does not implement all required protocol members [protocols_explicit] -""" diff --git a/conformance/results/basilisk/protocols_generic.toml b/conformance/results/basilisk/protocols_generic.toml deleted file mode 100644 index 8866798dd..000000000 --- a/conformance/results/basilisk/protocols_generic.toml +++ /dev/null @@ -1,15 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -protocols_generic.py:40:1: error: Class `Concrete1` is incompatible with `Proto1[int, str]`: method `method1` return type: expected `int`, found `str` [protocols_generic] -protocols_generic.py:44:7: error: Protocol class `Proto2` combines `Protocol[T]` shorthand with explicit `Generic[T]` base [protocols_generic] -protocols_generic.py:56:5: error: Type `Box[float]` is not assignable to `Box[int]` (type parameter is covariant) [generics_variance_inference] -protocols_generic.py:66:5: error: Type `Sender[int]` is not assignable to `Sender[float]` (type parameter is contravariant) [generics_variance_inference] -protocols_generic.py:74:5: error: Type `AttrProto[int]` is not assignable to `AttrProto[float]` (type parameter is invariant) [generics_variance_inference] -protocols_generic.py:75:5: error: Type `AttrProto[float]` is not assignable to `AttrProto[int]` (type parameter is invariant) [generics_variance_inference] -protocols_generic.py:145:1: error: Class `ConcreteHasProperty2` is incompatible with protocol `HasPropertyProto`: method `m` uses concrete type `int` for TypeVar `T` which is bound to `Self` via protocol's `self: T` annotation [protocols_generic] -protocols_generic.py:146:1: error: Class `ConcreteHasProperty3` is incompatible with protocol `HasPropertyProto`: method `f` must return a self-typed value (TypeVar `T` or `Self`), but returns `int` [protocols_generic] -protocols_generic.py:147:1: error: Class `ConcreteHasProperty4` is incompatible with protocol `HasPropertyProto`: method `m` uses concrete type `str` for TypeVar `T` which is bound to `Self` via protocol's `self: T` annotation [protocols_generic] -""" diff --git a/conformance/results/basilisk/protocols_merging.toml b/conformance/results/basilisk/protocols_merging.toml deleted file mode 100644 index faca560a3..000000000 --- a/conformance/results/basilisk/protocols_merging.toml +++ /dev/null @@ -1,12 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -protocols_merging.py:52:1: error: Class `SCConcrete2` is incompatible with protocol `SizedAndClosable1`: missing method `__len__` [protocols_definition_2] -protocols_merging.py:53:1: error: Class `SCConcrete2` is incompatible with protocol `SizedAndClosable2`: missing method `__len__` [protocols_definition_2] -protocols_merging.py:54:1: error: Cannot assign `SCConcrete2()` to type `SizedAndClosable3`: `SizedAndClosable3` is not a protocol and does not support structural subtyping [protocols_definition_2] -protocols_merging.py:67:1: error: Non-protocol class `SizedAndClosable3` cannot be a base of protocol `BadProto` [protocols_merging] -protocols_merging.py:82:5: error: Cannot instantiate `SizedAndClosable4`; it does not implement all required protocol members [protocols_explicit] -protocols_merging.py:83:1: error: Cannot assign `SCConcrete1()` to type `SizedAndClosable4`: `SizedAndClosable4` is not a protocol and does not support structural subtyping [protocols_definition_2] -""" diff --git a/conformance/results/basilisk/protocols_modules.toml b/conformance/results/basilisk/protocols_modules.toml deleted file mode 100644 index 5de06b240..000000000 --- a/conformance/results/basilisk/protocols_modules.toml +++ /dev/null @@ -1,9 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -protocols_modules.py:26:1: error: Module `_protocols_modules1` is not compatible with protocol `Options2`: attribute `timeout` has type `int` but protocol expects `str` [protocols_modules] -protocols_modules.py:48:1: error: Module `_protocols_modules2` is not compatible with protocol `Reporter2`: method `on_error` returns `None` but protocol expects `int` [protocols_modules] -protocols_modules.py:49:1: error: Module `_protocols_modules2` is not compatible with protocol `Reporter3`: missing method `not_implemented` required by protocol [protocols_modules] -""" diff --git a/conformance/results/basilisk/protocols_recursive.toml b/conformance/results/basilisk/protocols_recursive.toml deleted file mode 100644 index be211bd5b..000000000 --- a/conformance/results/basilisk/protocols_recursive.toml +++ /dev/null @@ -1,6 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -""" diff --git a/conformance/results/basilisk/protocols_runtime_checkable.toml b/conformance/results/basilisk/protocols_runtime_checkable.toml deleted file mode 100644 index 941c0d194..000000000 --- a/conformance/results/basilisk/protocols_runtime_checkable.toml +++ /dev/null @@ -1,15 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -protocols_runtime_checkable.py:23:8: error: Protocol `Proto1` cannot be used with `isinstance()` because it is not decorated with `@runtime_checkable` [protocols_runtime_checkable] -protocols_runtime_checkable.py:23:22: error: Protocol `Proto1` cannot be used with `isinstance()` because it is not decorated with `@runtime_checkable` [protocols_runtime_checkable_2] -protocols_runtime_checkable.py:55:8: error: `issubclass()` cannot be used with data protocol `DataProtocol` [protocols_runtime_checkable] -protocols_runtime_checkable.py:55:22: error: `issubclass()` cannot be used with data protocol `DataProtocol` [protocols_runtime_checkable_2] -protocols_runtime_checkable.py:61:8: error: `issubclass()` cannot be used with data protocol `DataProtocol` [protocols_runtime_checkable] -protocols_runtime_checkable.py:61:22: error: `issubclass()` cannot be used with data protocol `DataProtocol` [protocols_runtime_checkable_2] -protocols_runtime_checkable.py:88:33: error: Unsafe overlap: `Concrete3A` has members incompatible with protocol `Proto3` in `isinstance()` call [protocols_runtime_checkable_2] -protocols_runtime_checkable.py:91:33: error: Unsafe overlap: `Concrete3B` has members incompatible with protocol `Proto3` in `isinstance()` call [protocols_runtime_checkable_2] -protocols_runtime_checkable.py:94:31: error: Unsafe overlap: `Concrete3A` has members incompatible with protocol `Proto3` in `issubclass()` call [protocols_runtime_checkable_2] -""" diff --git a/conformance/results/basilisk/protocols_self.toml b/conformance/results/basilisk/protocols_self.toml deleted file mode 100644 index be211bd5b..000000000 --- a/conformance/results/basilisk/protocols_self.toml +++ /dev/null @@ -1,6 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -""" diff --git a/conformance/results/basilisk/protocols_subtyping.toml b/conformance/results/basilisk/protocols_subtyping.toml deleted file mode 100644 index b0178ee58..000000000 --- a/conformance/results/basilisk/protocols_subtyping.toml +++ /dev/null @@ -1,13 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -protocols_subtyping.py:16:6: error: Cannot instantiate Protocol class `Proto1`; Protocols define interfaces, not concrete implementations [protocols_explicit] -protocols_subtyping.py:38:5: error: Type mismatch: `v2` is annotated `Concrete2` (concrete2) but assigned proto2 [assignment_compatibility] -protocols_subtyping.py:55:5: error: Type mismatch: `v2` is annotated `Proto3` (proto3) but assigned proto2 [assignment_compatibility] -protocols_subtyping.py:79:5: error: Type mismatch: `v3` is annotated `Proto4[int, float]` (proto4[int, float]) but assigned proto5[int] [assignment_compatibility] -protocols_subtyping.py:80:5: error: Type mismatch: `v4` is annotated `Proto5[float]` (proto5[float]) but assigned proto4[int, int] [assignment_compatibility] -protocols_subtyping.py:102:5: error: Type mismatch: `v4` is annotated `Proto7[int, float]` (proto7[int, float]) but assigned proto6[float, float] [assignment_compatibility] -protocols_subtyping.py:103:5: error: Type mismatch: `v5` is annotated `Proto7[float, object]` (proto7[float, object]) but assigned proto6[float, float] [assignment_compatibility] -""" diff --git a/conformance/results/basilisk/protocols_variance.toml b/conformance/results/basilisk/protocols_variance.toml deleted file mode 100644 index 4e5012d84..000000000 --- a/conformance/results/basilisk/protocols_variance.toml +++ /dev/null @@ -1,18 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -protocols_variance.py:21:1: error: TypeVar `T1` in protocol `AnotherBox` is only used in output positions and should be covariant [protocols_variance] -protocols_variance.py:21:7: error: TypeVar `T1` in protocol `AnotherBox` should be covariant [protocols_variance_2] -protocols_variance.py:40:1: error: TypeVar `T3` in protocol `Protocol2` is only used in input positions and should be contravariant [protocols_variance] -protocols_variance.py:40:7: error: TypeVar `T3` in protocol `Protocol2` should be contravariant [protocols_variance_2] -protocols_variance.py:56:1: error: TypeVar `T1` in protocol `Protocol4` is only used in input positions and should be contravariant [protocols_variance] -protocols_variance.py:56:7: error: TypeVar `T1` in protocol `Protocol4` should be contravariant [protocols_variance_2] -protocols_variance.py:61:1: error: Covariant TypeVar `T1_co` is used in input position in protocol `Protocol5` [protocols_variance] -protocols_variance.py:66:1: error: TypeVar `T1` in protocol `Protocol6` is only used in output positions and should be covariant [protocols_variance] -protocols_variance.py:66:7: error: TypeVar `T1` in protocol `Protocol6` should be covariant [protocols_variance_2] -protocols_variance.py:71:1: error: Contravariant TypeVar `T1_contra` is used in output position in protocol `Protocol7` [protocols_variance] -protocols_variance.py:104:1: error: TypeVar `T1` in protocol `Protocol12` is only used in output positions and should be covariant [protocols_variance] -protocols_variance.py:104:7: error: TypeVar `T1` in protocol `Protocol12` should be covariant [protocols_variance_2] -""" diff --git a/conformance/results/basilisk/qualifiers_annotated.toml b/conformance/results/basilisk/qualifiers_annotated.toml deleted file mode 100644 index 80557eb03..000000000 --- a/conformance/results/basilisk/qualifiers_annotated.toml +++ /dev/null @@ -1,27 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -qualifiers_annotated.py:38:1: error: Invalid type expression as first argument to `Annotated` for `Bad1` [qualifiers_annotated] -qualifiers_annotated.py:39:1: error: Invalid type expression as first argument to `Annotated` for `Bad2` [qualifiers_annotated] -qualifiers_annotated.py:40:1: error: Invalid type expression as first argument to `Annotated` for `Bad3` [qualifiers_annotated] -qualifiers_annotated.py:41:1: error: Invalid type expression as first argument to `Annotated` for `Bad4` [qualifiers_annotated] -qualifiers_annotated.py:42:1: error: Invalid type expression as first argument to `Annotated` for `Bad5` [qualifiers_annotated] -qualifiers_annotated.py:43:1: error: Invalid type expression as first argument to `Annotated` for `Bad6` [qualifiers_annotated] -qualifiers_annotated.py:44:1: error: Invalid type expression as first argument to `Annotated` for `Bad7` [qualifiers_annotated] -qualifiers_annotated.py:45:1: error: Invalid type expression as first argument to `Annotated` for `Bad8` [qualifiers_annotated] -qualifiers_annotated.py:46:1: error: Invalid type expression as first argument to `Annotated` for `Bad9` [qualifiers_annotated] -qualifiers_annotated.py:47:1: error: Invalid type expression as first argument to `Annotated` for `Bad10` [qualifiers_annotated] -qualifiers_annotated.py:48:1: error: Invalid type expression as first argument to `Annotated` for `Bad11` [qualifiers_annotated] -qualifiers_annotated.py:49:1: error: Invalid type expression as first argument to `Annotated` for `Bad12` [qualifiers_annotated] -qualifiers_annotated.py:59:1: error: `Annotated` requires at least two arguments for `Bad13` [qualifiers_annotated] -qualifiers_annotated.py:59:1: error: `Annotated` requires at least two arguments: a type and metadata [qualifiers_annotated_2] -qualifiers_annotated.py:71:1: error: `Annotated[...]` is not compatible with `type[...]` for `not_type1` [qualifiers_annotated] -qualifiers_annotated.py:72:1: error: Type alias `SmallInt` (an `Annotated[...]` alias) is not compatible with `type[...]` for `not_type2` [qualifiers_annotated] -qualifiers_annotated.py:79:1: error: `Annotated[...]` is not compatible with `type[T]` — `Annotated[str, ""]` cannot be used where a type constructor is expected [qualifiers_annotated] -qualifiers_annotated.py:80:1: error: Type alias `SmallInt` (an `Annotated[...]` alias) is not compatible with `type[T]` [qualifiers_annotated] -qualifiers_annotated.py:86:1: error: `Annotated` is not callable — `Annotated()` must not be called as a function [qualifiers_annotated] -qualifiers_annotated.py:87:1: error: `Annotated` is not callable — `Annotated[int, ""]()` must not be called as a function [qualifiers_annotated] -qualifiers_annotated.py:88:1: error: `SmallInt` is a type alias and cannot be called as a function [qualifiers_annotated] -""" diff --git a/conformance/results/basilisk/qualifiers_final_annotation.toml b/conformance/results/basilisk/qualifiers_final_annotation.toml deleted file mode 100644 index 4e1aedbee..000000000 --- a/conformance/results/basilisk/qualifiers_final_annotation.toml +++ /dev/null @@ -1,36 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -qualifiers_final_annotation.py:16:1: error: Bare `Final` annotation for `BAD1` requires an explicit type argument or initializer [qualifiers_final_annotation] -qualifiers_final_annotation.py:18:1: error: Type mismatch: `BAD2` is annotated `Final[str, int]` (str, int) but assigned str [assignment_compatibility] -qualifiers_final_annotation.py:18:1: error: `Final` accepts at most one type argument for `BAD2` [qualifiers_final_annotation] -qualifiers_final_annotation.py:34:5: error: `ID2` is annotated `Final` in the class body but has no initializer and is not unconditionally assigned in `__init__` [qualifiers_final_annotation_2] -qualifiers_final_annotation.py:38:5: error: `ID3` is annotated `Final` in the class body but has no initializer and is not unconditionally assigned in `__init__` [qualifiers_final_annotation_2] -qualifiers_final_annotation.py:54:9: error: Cannot assign to `self.ID5` — it is already initialized as `Final` in the class body [qualifiers_final_annotation_2] -qualifiers_final_annotation.py:62:9: error: `self.id3: Final` annotation is only allowed inside `__init__` [qualifiers_final_annotation_2] -qualifiers_final_annotation.py:63:9: error: `self.id4: Final` annotation is only allowed inside `__init__` [qualifiers_final_annotation_2] -qualifiers_final_annotation.py:65:9: error: Cannot assign to `self.ID7` — it is declared `Final` in the class body [qualifiers_final_annotation_2] -qualifiers_final_annotation.py:67:9: error: Cannot assign to `self.ID7` — it is declared `Final` in the class body [qualifiers_final_annotation_2] -qualifiers_final_annotation.py:71:1: error: Cannot assign to global `RATE` — it is declared `Final` at module level [qualifiers_final_annotation_2] -qualifiers_final_annotation.py:71:1: error: Cannot re-assign `RATE` — it is declared `Final` at module level [qualifiers_final_annotation_2] -qualifiers_final_annotation.py:81:1: error: Cannot assign to `ClassB.DEFAULT_ID` — it is declared `Final` in `ClassB` [qualifiers_final_annotation_2] -qualifiers_final_annotation.py:94:5: error: Cannot override `BORDER_WIDTH` — it is declared `Final` in a base class [qualifiers_final_annotation_2] -qualifiers_final_annotation.py:107:5: error: `Final` cannot be used inside `ClassVar` for attribute `VALUE2` [qualifiers_final_annotation] -qualifiers_final_annotation.py:108:5: error: `ClassVar` cannot be used inside `Final` for attribute `VALUE3` [qualifiers_final_annotation] -qualifiers_final_annotation.py:118:1: error: `Final` cannot be nested inside another type constructor for `x` [qualifiers_final_annotation] -qualifiers_final_annotation.py:121:11: error: `Final` is not allowed in parameter annotation for `x` [qualifiers_final_annotation] -qualifiers_final_annotation.py:134:1: error: Call to `N()` is missing 2 required arguments (expected at least 2, got 0) [calls_argument_count] -qualifiers_final_annotation.py:134:1: error: Argument `a` is not a field of `N`; valid fields are: x, y [namedtuples_define_functional] -qualifiers_final_annotation.py:135:1: error: Field `x` of `N` expects `int` but received a `str` literal [namedtuples_define_functional] -qualifiers_final_annotation.py:135:1: error: Field `y` of `N` expects `int` but received a `str` literal [namedtuples_define_functional] -qualifiers_final_annotation.py:141:5: error: Cannot assign to global `ID1` — it is declared `Final` at module level [qualifiers_final_annotation_2] -qualifiers_final_annotation.py:145:5: error: Cannot modify `x` — it is declared `Final` [qualifiers_final_annotation_2] -qualifiers_final_annotation.py:147:10: error: Cannot modify `x` — it is declared `Final` [qualifiers_final_annotation_2] -qualifiers_final_annotation.py:149:9: error: Cannot modify `x` — it is declared `Final` [qualifiers_final_annotation_2] -qualifiers_final_annotation.py:152:30: error: Cannot modify `x` — it is declared `Final` [qualifiers_final_annotation_2] -qualifiers_final_annotation.py:155:9: error: Cannot modify `x` — it is declared `Final` [qualifiers_final_annotation_2] -qualifiers_final_annotation.py:166:1: error: Cannot re-assign `TEN` — it is declared `Final` in an imported module [qualifiers_final_annotation_2] -qualifiers_final_annotation.py:170:1: error: Cannot re-assign `PI` — it is declared `Final` in an imported module [qualifiers_final_annotation_2] -""" diff --git a/conformance/results/basilisk/qualifiers_final_decorator.toml b/conformance/results/basilisk/qualifiers_final_decorator.toml deleted file mode 100644 index f0473c3a9..000000000 --- a/conformance/results/basilisk/qualifiers_final_decorator.toml +++ /dev/null @@ -1,16 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -qualifiers_final_decorator.py:21:7: error: Cannot inherit from final class `Base1` [qualifiers_final_decorator] -qualifiers_final_decorator.py:56:9: error: Method `method1` in `Derived2` overrides a `@final` method [qualifiers_final_decorator] -qualifiers_final_decorator.py:60:9: error: Method `method2` in `Derived2` overrides a `@final` method [qualifiers_final_decorator] -qualifiers_final_decorator.py:64:9: error: Method `method3` in `Derived2` overrides a `@final` method [qualifiers_final_decorator] -qualifiers_final_decorator.py:75:9: error: Method `method4` in `Derived2` overrides a `@final` method [qualifiers_final_decorator] -qualifiers_final_decorator.py:85:6: error: `@final` on an `@overload` signature of `method`: it should be applied only to the implementation [overloads_consistency_2] -qualifiers_final_decorator.py:89:9: error: Method `method` in `Derived3` overrides a `@final` method [qualifiers_final_decorator] -qualifiers_final_decorator.py:102:9: error: Method `method` in `Derived4` overrides a `@final` method [qualifiers_final_decorator] -qualifiers_final_decorator.py:118:9: error: Method `method` in `Derived5` overrides a `@final` method [qualifiers_final_decorator] -qualifiers_final_decorator.py:126:5: error: `@final` is not allowed on non-method function `func1` [qualifiers_final_decorator] -""" diff --git a/conformance/results/basilisk/specialtypes_any.toml b/conformance/results/basilisk/specialtypes_any.toml deleted file mode 100644 index be211bd5b..000000000 --- a/conformance/results/basilisk/specialtypes_any.toml +++ /dev/null @@ -1,6 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -""" diff --git a/conformance/results/basilisk/specialtypes_never.toml b/conformance/results/basilisk/specialtypes_never.toml deleted file mode 100644 index 862192ce7..000000000 --- a/conformance/results/basilisk/specialtypes_never.toml +++ /dev/null @@ -1,9 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -specialtypes_never.py:19:5: error: Function `func1` is declared `-> NoReturn` / `-> Never` but may return implicitly [specialtypes_never] -specialtypes_never.py:85:5: error: Cannot assign `list[Never]` to `v3` annotated `list[int]`: `Never` is only compatible with `Never` and `Any` in invariant contexts [specialtypes_never_2] -specialtypes_never.py:104:5: error: Cannot return `ClassC[Never]` from `func10` annotated `-> ClassC[U]`: `Never` is only compatible with `Never` and `Any` in invariant contexts [specialtypes_never_2] -""" diff --git a/conformance/results/basilisk/specialtypes_none.toml b/conformance/results/basilisk/specialtypes_none.toml deleted file mode 100644 index 2d42111a1..000000000 --- a/conformance/results/basilisk/specialtypes_none.toml +++ /dev/null @@ -1,9 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -specialtypes_none.py:21:7: error: Argument `val1` of `func1` expects `None` but received `type(None)` (a class object, not the value `None`) [calls_argument_type] -specialtypes_none.py:27:1: error: Type mismatch: `none2` is annotated `Iterable` (iterable) but assigned None [assignment_compatibility] -specialtypes_none.py:41:7: error: Argument `val1` of `func2` expects `type[None]` but received `None` (a value, not a class object — use `type(None)` or `NoneType`) [calls_argument_type] -""" diff --git a/conformance/results/basilisk/specialtypes_promotions.toml b/conformance/results/basilisk/specialtypes_promotions.toml deleted file mode 100644 index c072e68e2..000000000 --- a/conformance/results/basilisk/specialtypes_promotions.toml +++ /dev/null @@ -1,7 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -specialtypes_promotions.py:13:5: error: Attribute `numerator` is not defined on `float`; parameter `f` is typed as `float`, not `int` [specialtypes_promotions] -""" diff --git a/conformance/results/basilisk/specialtypes_type.toml b/conformance/results/basilisk/specialtypes_type.toml deleted file mode 100644 index ea759d6f7..000000000 --- a/conformance/results/basilisk/specialtypes_type.toml +++ /dev/null @@ -1,16 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -specialtypes_type.py:56:7: error: Argument `TeamUser` is not assignable to `type[BasicUser | ProUser]`; `TeamUser` is not one of `BasicUser | ProUser` [specialtypes_type] -specialtypes_type.py:70:7: error: Argument `Callable` is a special typing form, not a class object; `type[T]` requires a real class [specialtypes_type] -specialtypes_type.py:76:1: error: Invalid type argument count in annotation `type[int, str]` on `bad_type1`: `type` takes 1 type argument but 2 were provided [callables_annotation] -specialtypes_type.py:76:12: error: `type` accepts exactly 1 type argument, but 2 were provided [generics_defaults_specialization] -specialtypes_type.py:117:5: error: Attribute `unknown` is not defined on `type[object]`; `type[object]` only exposes attributes of its type argument [specialtypes_type] -specialtypes_type.py:120:5: error: Attribute `unknown` is not defined on `Type[object]`; `Type[object]` only exposes attributes of its type argument [specialtypes_type] -specialtypes_type.py:143:1: error: Attribute `unknown` is not defined on `TA1` (a `TypeAlias` of `type`/`Type`) [specialtypes_type] -specialtypes_type.py:144:1: error: Attribute `unknown` is not defined on `TA2` (a `TypeAlias` of `type`/`Type`) [specialtypes_type] -specialtypes_type.py:145:1: error: Attribute `unknown` is not defined on `TA3` (a `TypeAlias` of `type`/`Type`) [specialtypes_type] -specialtypes_type.py:146:1: error: Attribute `unknown` is not defined on `TA4` (a `TypeAlias` of `type`/`Type`) [specialtypes_type] -""" diff --git a/conformance/results/basilisk/tuples_type_compat.toml b/conformance/results/basilisk/tuples_type_compat.toml deleted file mode 100644 index de23284d0..000000000 --- a/conformance/results/basilisk/tuples_type_compat.toml +++ /dev/null @@ -1,30 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -tuples_type_compat.py:15:5: error: Type mismatch: `v2` is annotated `tuple[int, int]` (tuple[int, int]) but assigned tuple[float, float] [assignment_compatibility] -tuples_type_compat.py:29:1: error: Tuple type compatibility violation: homogeneous unbounded tuple is not assignable to mixed starred-unpack form [tuples_type_compat] -tuples_type_compat.py:32:1: error: Tuple type compatibility violation: source tuple type may have more elements than the fixed-length target allows [tuples_type_compat] -tuples_type_compat.py:33:1: error: Tuple type compatibility violation: source tuple type may have more elements than the fixed-length target allows [tuples_type_compat] -tuples_type_compat.py:43:5: error: Type mismatch: `v3` is annotated `tuple[int]` (tuple[int]) but assigned tuple[int, ...] [assignment_compatibility] -tuples_type_compat.py:62:5: error: Type mismatch: `d` is annotated `tuple[int, int]` (tuple[int, int]) but assigned tuple[int, ...] [assignment_compatibility] -tuples_type_compat.py:76:9: error: Type alias `Func5Input` (an `Annotated[...]` alias) is not compatible with `type[T]` [qualifiers_annotated] -tuples_type_compat.py:81:9: error: Type alias `Func5Input` (an `Annotated[...]` alias) is not compatible with `type[T]` [qualifiers_annotated] -tuples_type_compat.py:86:9: error: Type alias `Func5Input` (an `Annotated[...]` alias) is not compatible with `type[T]` [qualifiers_annotated] -tuples_type_compat.py:102:13: error: Type alias `Func6Input` (an `Annotated[...]` alias) is not compatible with `type[T]` [qualifiers_annotated] -tuples_type_compat.py:107:13: error: Type alias `Func6Input` (an `Annotated[...]` alias) is not compatible with `type[T]` [qualifiers_annotated] -tuples_type_compat.py:112:13: error: Type alias `Func6Input` (an `Annotated[...]` alias) is not compatible with `type[T]` [qualifiers_annotated] -tuples_type_compat.py:127:13: error: Type alias `Func7Input` (an `Annotated[...]` alias) is not compatible with `type[T]` [qualifiers_annotated] -tuples_type_compat.py:130:13: error: Type alias `Func7Input` (an `Annotated[...]` alias) is not compatible with `type[T]` [qualifiers_annotated] -tuples_type_compat.py:157:1: error: Tuple type compatibility violation: tuple literal length does not match fixed starred-unpack annotation [tuples_type_compat] -tuples_type_compat.py:162:1: error: Tuple type compatibility violation: tuple literal middle element type incompatible with starred-unpack annotation [tuples_type_compat] -tuples_type_compat.py:163:1: error: Tuple type compatibility violation: tuple literal middle element type incompatible with starred-unpack annotation [tuples_type_compat] -tuples_type_compat.py:169:1: error: Tuple type compatibility violation: tuple literal element type incompatible with annotation suffix [tuples_type_compat] -tuples_type_compat.py:170:1: error: Tuple type compatibility violation: tuple literal element type incompatible with annotation suffix [tuples_type_compat] -tuples_type_compat.py:175:1: error: Tuple type compatibility violation: tuple literal middle element type incompatible with starred-unpack annotation [tuples_type_compat] -tuples_type_compat.py:176:1: error: Tuple type compatibility violation: tuple literal element type incompatible with annotation suffix [tuples_type_compat] -tuples_type_compat.py:181:5: error: Type mismatch: `t2` is annotated `tuple[str, str, *tuple[int]]` (tuple[str, str, *tuple[int]]) but assigned tuple[str, str] [assignment_compatibility] -tuples_type_compat.py:184:5: error: Type mismatch: `t5` is annotated `tuple[str, str, str, *tuple[str, ...]]` (tuple[str, str, str, *tuple[str, ...]]) but assigned tuple[str, str] [assignment_compatibility] -tuples_type_compat.py:188:5: error: Type mismatch: `t9` is annotated `tuple[*tuple[str, ...], str, str, str]` (tuple[*tuple[str, ...], str, str, str]) but assigned tuple[str, str] [assignment_compatibility] -""" diff --git a/conformance/results/basilisk/tuples_type_form.toml b/conformance/results/basilisk/tuples_type_form.toml deleted file mode 100644 index 27da7adfc..000000000 --- a/conformance/results/basilisk/tuples_type_form.toml +++ /dev/null @@ -1,21 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -tuples_type_form.py:12:1: error: Type mismatch: `t1` is annotated `tuple[int]` but assigned a 2-element tuple (expected 1 element(s)) [assignment_compatibility] -tuples_type_form.py:14:1: error: Type mismatch: `t2` is annotated `tuple[int, int]` but assigned a 1-element tuple (expected 2 element(s)) [assignment_compatibility] -tuples_type_form.py:15:1: error: Type mismatch: `t2` is annotated `tuple[int, int]` but assigned a tuple with element 1 `""` (expected type `int`) [assignment_compatibility] -tuples_type_form.py:25:1: error: Type mismatch: `t10` is annotated `tuple[()]` but assigned a tuple with 1 element(s) (expected empty tuple) [assignment_compatibility] -tuples_type_form.py:36:1: error: Type mismatch: `t20` is annotated `tuple[int, ...]` but assigned a tuple containing `""` (incompatible with `int`) [assignment_compatibility] -tuples_type_form.py:40:6: error: tuple type contains more than one unbounded component [tuples_type_form] -tuples_type_form.py:40:6: error: Invalid tuple type syntax: tuple[T, U, ...] is invalid — can only have one type before the ellipsis [tuples_type_form_2] -tuples_type_form.py:41:6: error: tuple type contains more than one unbounded component [tuples_type_form] -tuples_type_form.py:41:6: error: Invalid tuple type syntax: tuple[...] is invalid — must specify a type before the ellipsis [tuples_type_form_2] -tuples_type_form.py:42:6: error: tuple type contains more than one unbounded component [tuples_type_form] -tuples_type_form.py:42:6: error: Invalid tuple type syntax: ellipsis (...) must appear at the end of the tuple type [tuples_type_form_2] -tuples_type_form.py:43:6: error: tuple type contains more than one unbounded component [tuples_type_form] -tuples_type_form.py:43:6: error: Invalid tuple type syntax: ellipsis (...) must appear at the end of the tuple type [tuples_type_form_2] -tuples_type_form.py:44:6: error: tuple type contains more than one unbounded component [tuples_type_form] -tuples_type_form.py:45:6: error: tuple type contains more than one unbounded component [tuples_type_form] -""" diff --git a/conformance/results/basilisk/tuples_unpacked.toml b/conformance/results/basilisk/tuples_unpacked.toml deleted file mode 100644 index af98169db..000000000 --- a/conformance/results/basilisk/tuples_unpacked.toml +++ /dev/null @@ -1,11 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -tuples_unpacked.py:40:5: error: tuple type contains more than one unbounded component [tuples_type_form] -tuples_unpacked.py:41:5: error: tuple type contains more than one unbounded component [tuples_type_form] -tuples_unpacked.py:51:9: error: tuple type contains more than one unbounded component [tuples_type_form] -tuples_unpacked.py:59:6: error: tuple type contains more than one unbounded component [tuples_type_form] -tuples_unpacked.py:60:6: error: tuple type contains more than one unbounded component [tuples_type_form] -""" diff --git a/conformance/results/basilisk/typeddicts_alt_syntax.toml b/conformance/results/basilisk/typeddicts_alt_syntax.toml deleted file mode 100644 index ae239e20c..000000000 --- a/conformance/results/basilisk/typeddicts_alt_syntax.toml +++ /dev/null @@ -1,10 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -typeddicts_alt_syntax.py:23:17: error: Second argument to `TypedDict("BadTypedDict1", ...)` must be a dict literal [typeddicts_alt_syntax] -typeddicts_alt_syntax.py:27:17: error: All keys in `TypedDict("BadTypedDict2", {...})` must be string literals [typeddicts_alt_syntax] -typeddicts_alt_syntax.py:31:17: error: TypedDict declared name `WrongName` does not match the variable name `BadTypedDict3` [typeddicts_alt_syntax] -typeddicts_alt_syntax.py:35:17: error: Unrecognised keyword `other=` in `TypedDict("BadTypedDict4", ...)` call [typeddicts_alt_syntax] -""" diff --git a/conformance/results/basilisk/typeddicts_class_syntax.toml b/conformance/results/basilisk/typeddicts_class_syntax.toml deleted file mode 100644 index 42228d9ae..000000000 --- a/conformance/results/basilisk/typeddicts_class_syntax.toml +++ /dev/null @@ -1,12 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -typeddicts_class_syntax.py:30:9: error: Method `method1` is not allowed in TypedDict class `BadTypedDict1` [typeddicts_class_syntax] -typeddicts_class_syntax.py:35:9: error: Method `method2` is not allowed in TypedDict class `BadTypedDict1` [typeddicts_class_syntax] -typeddicts_class_syntax.py:40:9: error: Method `method3` is not allowed in TypedDict class `BadTypedDict1` [typeddicts_class_syntax] -typeddicts_class_syntax.py:49:7: error: TypedDict class `BadTypedDict2` uses unrecognised keyword `metaclass` [typeddicts_class_syntax_2] -typeddicts_class_syntax.py:54:7: error: TypedDict class `BadTypedDict3` uses unrecognised keyword `other` [typeddicts_class_syntax_2] -typeddicts_class_syntax.py:69:1: error: Unrecognized item `z` for `ConditionalField`: extra items are not allowed [typeddicts_extra_items] -""" diff --git a/conformance/results/basilisk/typeddicts_extra_items.toml b/conformance/results/basilisk/typeddicts_extra_items.toml deleted file mode 100644 index b87b5e66c..000000000 --- a/conformance/results/basilisk/typeddicts_extra_items.toml +++ /dev/null @@ -1,34 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -typeddicts_extra_items.py:15:45: error: `int` is not assignable to extra item type `bool` of `Movie` [typeddicts_extra_items] -typeddicts_extra_items.py:22:55: error: `int` is not assignable to extra item type `bool` of `MovieFunctional` [typeddicts_extra_items] -typeddicts_extra_items.py:39:1: error: Value assigned to `TypedDict` `InheritedMovie` field `year` has the wrong type; expected `int` [typeddicts_operations] -typeddicts_extra_items.py:49:1: error: Argument to `closed` must be a literal `True` or `False` [typeddicts_extra_items] -typeddicts_extra_items.py:67:1: error: Cannot set `closed=False` on `IllegalChild1` when a superclass is `closed=True` [typeddicts_extra_items] -typeddicts_extra_items.py:73:1: error: Cannot set `closed=False` on `IllegalChild2` when a superclass sets `extra_items` [typeddicts_extra_items] -typeddicts_extra_items.py:91:1: error: `MovieC` is a closed TypedDict; extra key `age` is not allowed [typeddicts_extra_items] -typeddicts_extra_items.py:94:1: error: `MovieD` is a closed TypedDict; extra key `age` is not allowed [typeddicts_extra_items] -typeddicts_extra_items.py:109:1: error: Cannot set `closed=True` on `IllegalCloseNonReadOnly` when a superclass has non-read-only `extra_items` [typeddicts_extra_items] -typeddicts_extra_items.py:114:1: error: `extra_items` value cannot be `Required[...]` [typeddicts_extra_items] -typeddicts_extra_items.py:117:1: error: `extra_items` value cannot be `NotRequired[...]` [typeddicts_extra_items] -typeddicts_extra_items.py:128:5: error: Cannot delete a key from `TypedDict` `MovieEI` — TypedDicts have a fixed schema [typeddicts_operations] -typeddicts_extra_items.py:143:1: error: Keyword `year` in call to `unpack_no_extra` is not a key of TypedDict `MovieNoExtra` [callables_kwargs] -typeddicts_extra_items.py:174:1: error: Cannot change `extra_items` on `Child` unless it is `ReadOnly` in the superclass [typeddicts_extra_items] -typeddicts_extra_items.py:184:1: error: Required key `year` is not allowed under the inherited `extra_items` of `MovieRequiredYear` [typeddicts_extra_items] -typeddicts_extra_items.py:187:1: error: `int | None` is not consistent with `int` [typeddicts_extra_items] -typeddicts_extra_items.py:196:1: error: `str` is not assignable to `int | None` [typeddicts_extra_items] -typeddicts_extra_items.py:215:22: error: `int` is not consistent with `int | None` [typeddicts_extra_items] -typeddicts_extra_items.py:222:22: error: `year` is required in `MovieWithYear2` but is an extra item in `MovieBase2` [typeddicts_extra_items] -typeddicts_extra_items.py:242:19: error: `list[str]` is not assignable to `str | int` [typeddicts_extra_items] -typeddicts_extra_items.py:256:13: error: `str` is not assignable to extra items type `int` [typeddicts_extra_items] -typeddicts_extra_items.py:257:13: error: `int` is not assignable to extra items type `str` [typeddicts_extra_items] -typeddicts_extra_items.py:268:14: error: `object` is not assignable to extra items type `int` [typeddicts_extra_items] -typeddicts_extra_items.py:278:1: error: Unrecognized item `year` for `NonClosedMovie`: extra items are not allowed [typeddicts_extra_items] -typeddicts_extra_items.py:285:1: error: Wrong type for extra item `language`: `str` is not assignable to `int` [typeddicts_extra_items] -typeddicts_extra_items.py:293:1: error: Unrecognized item `year` for `ClosedMovie`: extra items are not allowed [typeddicts_extra_items] -typeddicts_extra_items.py:303:1: error: TypedDict `MovieExtraInt` is not assignable to `Mapping[str, int]` [typeddicts_operations] -typeddicts_extra_items.py:352:5: error: Type mismatch: `int_dict` is annotated `IntDict` (intdict) but assigned dict[str, int] [assignment_compatibility] -""" diff --git a/conformance/results/basilisk/typeddicts_final.toml b/conformance/results/basilisk/typeddicts_final.toml deleted file mode 100644 index be211bd5b..000000000 --- a/conformance/results/basilisk/typeddicts_final.toml +++ /dev/null @@ -1,6 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -""" diff --git a/conformance/results/basilisk/typeddicts_inheritance.toml b/conformance/results/basilisk/typeddicts_inheritance.toml deleted file mode 100644 index 9ca73d439..000000000 --- a/conformance/results/basilisk/typeddicts_inheritance.toml +++ /dev/null @@ -1,9 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -typeddicts_inheritance.py:44:7: error: TypedDict `BadTypedDict` cannot inherit from non-TypedDict class `NonTypedDict` [typeddicts_inheritance] -typeddicts_inheritance.py:55:4: error: TypedDict `Y1` illegally redeclares field `x` from `X1`: the value type is not compatible with the inherited declaration [typeddicts_inheritance] -typeddicts_inheritance.py:65:7: error: TypedDict `XYZ2` inherits incompatible declarations of field `x` from `X2` and `Y2` [typeddicts_inheritance] -""" diff --git a/conformance/results/basilisk/typeddicts_operations.toml b/conformance/results/basilisk/typeddicts_operations.toml deleted file mode 100644 index 1e45a26b4..000000000 --- a/conformance/results/basilisk/typeddicts_operations.toml +++ /dev/null @@ -1,17 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -typeddicts_operations.py:22:1: error: Value assigned to `TypedDict` `Movie` field `name` has the wrong type; expected `str` [typeddicts_operations] -typeddicts_operations.py:23:1: error: Value assigned to `TypedDict` `Movie` field `year` has the wrong type; expected `int` [typeddicts_operations] -typeddicts_operations.py:24:1: error: `other` is not a valid key for `TypedDict` `Movie` [typeddicts_operations] -typeddicts_operations.py:26:7: error: Key `other` is not a valid key for `TypedDict` `Movie` [typeddicts_operations] -typeddicts_operations.py:28:1: error: missing required key `year` [typeddicts_operations] -typeddicts_operations.py:29:1: error: Value assigned to `TypedDict` `Movie` field `year` has the wrong type; expected `int` [typeddicts_operations] -typeddicts_operations.py:32:1: error: invalid key `other` for `TypedDict` `Movie` [typeddicts_operations] -typeddicts_operations.py:37:5: error: Dict literal for `TypedDict` `Movie` contains a non-literal key; all keys must be string literals [typeddicts_operations] -typeddicts_operations.py:47:1: error: `TypedDict` `Movie` does not support `.clear()` — TypedDicts have a fixed schema [typeddicts_operations] -typeddicts_operations.py:49:1: error: Cannot delete a key from `TypedDict` `Movie` — TypedDicts have a fixed schema [typeddicts_operations] -typeddicts_operations.py:62:1: error: `TypedDict` `MovieOptional` does not support `.clear()` — TypedDicts have a fixed schema [typeddicts_operations] -""" diff --git a/conformance/results/basilisk/typeddicts_readonly.toml b/conformance/results/basilisk/typeddicts_readonly.toml deleted file mode 100644 index f6e262846..000000000 --- a/conformance/results/basilisk/typeddicts_readonly.toml +++ /dev/null @@ -1,12 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -typeddicts_readonly.py:24:1: error: Cannot assign to read-only field `members` of `TypedDict` `b1` [typeddicts_readonly] -typeddicts_readonly.py:36:1: error: Cannot assign to read-only field `members` of `TypedDict` `b2` [typeddicts_readonly] -typeddicts_readonly.py:50:1: error: Cannot assign to read-only field `title` of `TypedDict` `m1` [typeddicts_readonly] -typeddicts_readonly.py:51:1: error: Cannot assign to read-only field `year` of `TypedDict` `m1` [typeddicts_readonly] -typeddicts_readonly.py:60:1: error: Cannot assign to read-only field `title` of `TypedDict` `m2` [typeddicts_readonly] -typeddicts_readonly.py:61:1: error: Cannot assign to read-only field `year` of `TypedDict` `m2` [typeddicts_readonly] -""" diff --git a/conformance/results/basilisk/typeddicts_readonly_consistency.toml b/conformance/results/basilisk/typeddicts_readonly_consistency.toml deleted file mode 100644 index 9b26d9da3..000000000 --- a/conformance/results/basilisk/typeddicts_readonly_consistency.toml +++ /dev/null @@ -1,13 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -typeddicts_readonly_consistency.py:37:5: error: Type mismatch: `v3` is annotated `B1` (b1) but assigned a1 [assignment_compatibility] -typeddicts_readonly_consistency.py:38:5: error: Type mismatch: `v4` is annotated `B1` (b1) but assigned c1 [assignment_compatibility] -typeddicts_readonly_consistency.py:40:5: error: Type mismatch: `v5` is annotated `C1` (c1) but assigned a1 [assignment_compatibility] -typeddicts_readonly_consistency.py:81:5: error: Type mismatch: `v3` is annotated `B2` (b2) but assigned a2 [assignment_compatibility] -typeddicts_readonly_consistency.py:82:5: error: Type mismatch: `v4` is annotated `B2` (b2) but assigned c2 [assignment_compatibility] -typeddicts_readonly_consistency.py:84:5: error: Type mismatch: `v5` is annotated `C2` (c2) but assigned a2 [assignment_compatibility] -typeddicts_readonly_consistency.py:85:5: error: Type mismatch: `v6` is annotated `C2` (c2) but assigned b2 [assignment_compatibility] -""" diff --git a/conformance/results/basilisk/typeddicts_readonly_inheritance.toml b/conformance/results/basilisk/typeddicts_readonly_inheritance.toml deleted file mode 100644 index 3b05a8981..000000000 --- a/conformance/results/basilisk/typeddicts_readonly_inheritance.toml +++ /dev/null @@ -1,19 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -typeddicts_readonly_inheritance.py:36:1: error: Cannot assign to read-only field `name` of `TypedDict` `a2` [typeddicts_readonly] -typeddicts_readonly_inheritance.py:50:5: error: TypedDict `RecordShop` illegally redeclares field `alt` from `AlbumCollection`: the value type is not compatible with the inherited declaration [typeddicts_inheritance] -typeddicts_readonly_inheritance.py:65:1: error: missing required key `name` [typeddicts_operations] -typeddicts_readonly_inheritance.py:82:1: error: Value assigned to `TypedDict` `User` field `ident` has the wrong type; expected `str` [typeddicts_operations] -typeddicts_readonly_inheritance.py:83:1: error: Value assigned to `TypedDict` `User` field `ident` has the wrong type; expected `str` [typeddicts_operations] -typeddicts_readonly_inheritance.py:84:1: error: missing required key `ident` [typeddicts_operations] -typeddicts_readonly_inheritance.py:94:5: error: TypedDict `F3` illegally redeclares field `a` from `F1`: a writable item may not be redeclared as `ReadOnly` [typeddicts_inheritance] -typeddicts_readonly_inheritance.py:98:5: error: TypedDict `F4` illegally redeclares field `a` from `F1`: a required item may not be redeclared as not-required [typeddicts_inheritance] -typeddicts_readonly_inheritance.py:106:5: error: TypedDict `F6` illegally redeclares field `c` from `F1`: a required item may not be redeclared as not-required [typeddicts_inheritance] -typeddicts_readonly_inheritance.py:119:7: error: TypedDict `TD_A` inherits incompatible declarations of field `x` from `TD_A1` and `TD_A2` [typeddicts_inheritance] -typeddicts_readonly_inheritance.py:119:7: error: TypedDict `TD_A` inherits incompatible declarations of field `y` from `TD_A1` and `TD_A2` [typeddicts_inheritance] -typeddicts_readonly_inheritance.py:132:7: error: TypedDict `TD_B` inherits incompatible declarations of field `x` from `TD_B1` and `TD_B2` [typeddicts_inheritance] -typeddicts_readonly_inheritance.py:132:7: error: TypedDict `TD_B` inherits incompatible declarations of field `y` from `TD_B1` and `TD_B2` [typeddicts_inheritance] -""" diff --git a/conformance/results/basilisk/typeddicts_readonly_kwargs.toml b/conformance/results/basilisk/typeddicts_readonly_kwargs.toml deleted file mode 100644 index f248dc4fd..000000000 --- a/conformance/results/basilisk/typeddicts_readonly_kwargs.toml +++ /dev/null @@ -1,7 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -typeddicts_readonly_kwargs.py:33:5: error: Cannot assign to read-only field `key1` of `TypedDict` `kwargs` [typeddicts_readonly] -""" diff --git a/conformance/results/basilisk/typeddicts_readonly_update.toml b/conformance/results/basilisk/typeddicts_readonly_update.toml deleted file mode 100644 index ed32a25e6..000000000 --- a/conformance/results/basilisk/typeddicts_readonly_update.toml +++ /dev/null @@ -1,8 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -typeddicts_readonly_update.py:23:1: error: `TypedDict` `A` does not support `.update()` — TypedDicts have a fixed schema [typeddicts_operations] -typeddicts_readonly_update.py:23:1: error: Cannot call `.update()` on `TypedDict` `a1`: it has `ReadOnly` fields [typeddicts_readonly] -""" diff --git a/conformance/results/basilisk/typeddicts_required.toml b/conformance/results/basilisk/typeddicts_required.toml deleted file mode 100644 index 0c004abe2..000000000 --- a/conformance/results/basilisk/typeddicts_required.toml +++ /dev/null @@ -1,10 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -typeddicts_required.py:12:5: error: `Required`/`NotRequired` is not allowed on attribute `x` outside a `TypedDict` [typeddicts_required] -typeddicts_required.py:16:5: error: `Required`/`NotRequired` is not allowed on parameter `x` [typeddicts_required] -typeddicts_required.py:59:5: error: `Required` and `NotRequired` cannot be nested in `a` [typeddicts_required] -typeddicts_required.py:60:5: error: `Required` and `NotRequired` cannot be nested in `b` [typeddicts_required] -""" diff --git a/conformance/results/basilisk/typeddicts_type_consistency.toml b/conformance/results/basilisk/typeddicts_type_consistency.toml deleted file mode 100644 index e68f19101..000000000 --- a/conformance/results/basilisk/typeddicts_type_consistency.toml +++ /dev/null @@ -1,15 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -typeddicts_type_consistency.py:21:1: error: TypedDict `B1` is not assignable to `A1`: value type for key `x` is `int`, expected `int | None` [typeddicts_operations] -typeddicts_type_consistency.py:38:1: error: TypedDict `B2` is not assignable to `A2`: key `x` is required in source but non-required in target [typeddicts_operations] -typeddicts_type_consistency.py:65:1: error: TypedDict `A3` is not assignable to `B3`: missing key `y` [typeddicts_operations] -typeddicts_type_consistency.py:69:1: error: invalid key `y` for `TypedDict` `A3` [typeddicts_operations] -typeddicts_type_consistency.py:76:1: error: TypedDict `B3` is not assignable to `dict[str, int]` [typeddicts_operations] -typeddicts_type_consistency.py:77:1: error: TypedDict `B3` is not assignable to `dict[str, object]` [typeddicts_operations] -typeddicts_type_consistency.py:78:1: error: TypedDict `B3` is not assignable to `dict[Any, Any]` [typeddicts_operations] -typeddicts_type_consistency.py:82:1: error: TypedDict `B3` is not assignable to `Mapping[str, int]` [typeddicts_operations] -typeddicts_type_consistency.py:126:42: error: Value assigned to `TypedDict` `Inner1` field `inner_key` has the wrong type; expected `str` [typeddicts_operations] -""" diff --git a/conformance/results/basilisk/typeddicts_usage.toml b/conformance/results/basilisk/typeddicts_usage.toml deleted file mode 100644 index 01a41cfdb..000000000 --- a/conformance/results/basilisk/typeddicts_usage.toml +++ /dev/null @@ -1,11 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -typeddicts_usage.py:23:1: error: `director` is not a valid key for `TypedDict` `Movie` [typeddicts_operations] -typeddicts_usage.py:24:1: error: Value assigned to `TypedDict` `Movie` field `year` has the wrong type; expected `int` [typeddicts_operations] -typeddicts_usage.py:28:1: error: invalid key `title` for `TypedDict` `Movie`; missing required key `name` [typeddicts_operations] -typeddicts_usage.py:35:4: error: TypedDict type objects cannot be used in `isinstance()` tests [typeddicts_usage] -typeddicts_usage.py:40:5: error: TypedDict type objects cannot be used in `isinstance()` tests [typeddicts_usage] -""" diff --git a/conformance/results/basilisk/typeforms_typeform.toml b/conformance/results/basilisk/typeforms_typeform.toml deleted file mode 100644 index 1c5d082c2..000000000 --- a/conformance/results/basilisk/typeforms_typeform.toml +++ /dev/null @@ -1,23 +0,0 @@ -conformant = "Pass" -conformance_automated = "Pass" -errors_diff = """ -""" -output = """ -typeforms_typeform.py:23:1: error: Type mismatch: `err1` is annotated `TypeForm[str | None]` (TypeForm[str | None]) but assigned Unknown [assignment_compatibility] -typeforms_typeform.py:24:1: error: Type mismatch: `err2` is annotated `TypeForm[str | None]` (TypeForm[str | None]) but assigned Unknown [assignment_compatibility] -typeforms_typeform.py:59:7: error: Argument `"not a type"` is not a valid type expression for parameter `x` of type `TypeForm` [assignment_compatibility] -typeforms_typeform.py:67:1: error: Type mismatch: `bad1` is annotated `TypeForm` (TypeForm) but assigned Unknown [assignment_compatibility] -typeforms_typeform.py:68:1: error: Type mismatch: `bad2` is annotated `TypeForm` (TypeForm) but assigned tuple[int, int] [assignment_compatibility] -typeforms_typeform.py:69:1: error: Type mismatch: `bad3` is annotated `TypeForm` (TypeForm) but assigned int [assignment_compatibility] -typeforms_typeform.py:70:1: error: Type mismatch: `bad4` is annotated `TypeForm` (TypeForm) but assigned Unknown [assignment_compatibility] -typeforms_typeform.py:71:1: error: Type mismatch: `bad5` is annotated `TypeForm` (TypeForm) but assigned Unknown [assignment_compatibility] -typeforms_typeform.py:71:1: error: `ClassVar` is not allowed in right-hand side of module-level assignment for `bad5` [classes_classvar] -typeforms_typeform.py:72:1: error: Type mismatch: `bad6` is annotated `TypeForm` (TypeForm) but assigned Unknown [assignment_compatibility] -typeforms_typeform.py:73:1: error: Type mismatch: `bad7` is annotated `TypeForm` (TypeForm) but assigned Unknown [assignment_compatibility] -typeforms_typeform.py:74:1: error: Type mismatch: `bad8` is annotated `TypeForm` (TypeForm) but assigned Unknown [assignment_compatibility] -typeforms_typeform.py:75:1: error: Type mismatch: `bad9` is annotated `TypeForm` (TypeForm) but assigned str [assignment_compatibility] -typeforms_typeform.py:86:6: error: Invalid TypeForm argument: `"type(1)"` is not a valid type expression [assignment_compatibility] -typeforms_typeform.py:88:6: error: Invalid TypeForm argument: `type(1)` is not a valid type expression [assignment_compatibility] -typeforms_typeform.py:98:1: error: Type mismatch: `t2` is annotated `TypeForm[str]` (TypeForm[str]) but assigned Unknown [assignment_compatibility] -typeforms_typeform.py:108:1: error: Type mismatch: `t4` is annotated `TypeForm[str]` (TypeForm[str]) but assigned Unknown [assignment_compatibility] -""" diff --git a/conformance/results/basilisk/version.toml b/conformance/results/basilisk/version.toml deleted file mode 100644 index 5995fb3b5..000000000 --- a/conformance/results/basilisk/version.toml +++ /dev/null @@ -1 +0,0 @@ -version = "basilisk 0.27.0" diff --git a/conformance/results/results.html b/conformance/results/results.html index f39b8d2ac..4a6ac1a93 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -127,7 +127,7 @@ } .col2 { - inline-size: calc(70% / 7); + inline-size: calc(70% / 6); } .conformant { @@ -259,12 +259,11 @@

    Python Type System Conformance Test Results

    - + - @@ -275,7 +274,7 @@

    Python Type System Conformance Test Results

    - @@ -287,11 +286,9 @@

    Python Type System Conformance Test Results

    - - - - - - @@ -391,13 +384,12 @@

    Python Type System Conformance Test Results

    - - - @@ -428,7 +419,7 @@

    Python Type System Conformance Test Results

    - @@ -440,12 +431,10 @@

    Python Type System Conformance Test Results

    - - - @@ -476,11 +464,9 @@

    Python Type System Conformance Test Results

    - - - @@ -513,13 +498,12 @@

    Python Type System Conformance Test Results

    - - - - - - - @@ -633,14 +612,12 @@

    Python Type System Conformance Test Results

    - - - - - - @@ -722,7 +695,6 @@

    Python Type System Conformance Test Results

    - @@ -732,7 +704,6 @@

    Python Type System Conformance Test Results

    - @@ -740,7 +711,6 @@

    Python Type System Conformance Test Results

    - - @@ -767,11 +736,9 @@

    Python Type System Conformance Test Results

    - - - - - - - - @@ -903,11 +864,9 @@

    Python Type System Conformance Test Results

    - - - - - - - @@ -984,13 +938,12 @@

    Python Type System Conformance Test Results

    - - - - - @@ -1054,13 +1004,12 @@

    Python Type System Conformance Test Results

    - - - - @@ -1099,13 +1046,12 @@

    Python Type System Conformance Test Results

    - - - - - - - - - @@ -1239,13 +1178,12 @@

    Python Type System Conformance Test Results

    - - - - - - @@ -1316,14 +1250,13 @@

    Python Type System Conformance Test Results

    - - - - - - - @@ -1437,7 +1365,6 @@

    Python Type System Conformance Test Results

    - - - @@ -1484,7 +1409,6 @@

    Python Type System Conformance Test Results

    - @@ -1492,13 +1416,11 @@

    Python Type System Conformance Test Results

    - - @@ -1509,13 +1431,12 @@

    Python Type System Conformance Test Results

    - - - - @@ -1567,11 +1486,9 @@

    Python Type System Conformance Test Results

    - - @@ -1582,13 +1499,12 @@

    Python Type System Conformance Test Results

    - - - - - - - - @@ -1718,14 +1628,13 @@

    Python Type System Conformance Test Results

    - - - - - - - @@ -1819,7 +1723,7 @@

    Python Type System Conformance Test Results

    - @@ -1827,7 +1731,6 @@

    Python Type System Conformance Test Results

    - - @@ -1851,13 +1753,12 @@

    Python Type System Conformance Test Results

    - - - - - - @@ -1953,7 +1850,6 @@

    Python Type System Conformance Test Results

    - @@ -1963,7 +1859,6 @@

    Python Type System Conformance Test Results

    - @@ -1973,7 +1868,6 @@

    Python Type System Conformance Test Results

    - @@ -1983,11 +1877,9 @@

    Python Type System Conformance Test Results

    - - - - - - - - - @@ -2099,13 +1984,12 @@

    Python Type System Conformance Test Results

    - - - - @@ -2156,7 +2038,6 @@

    Python Type System Conformance Test Results

    - @@ -2166,7 +2047,6 @@

    Python Type System Conformance Test Results

    - @@ -2176,7 +2056,6 @@

    Python Type System Conformance Test Results

    - @@ -2186,7 +2065,6 @@

    Python Type System Conformance Test Results

    - @@ -2196,11 +2074,9 @@

    Python Type System Conformance Test Results

    - - - - - - - - @@ -2289,13 +2159,12 @@

    Python Type System Conformance Test Results

    - - - - - @@ -2347,13 +2213,12 @@

    Python Type System Conformance Test Results

    - - - @@ -2390,11 +2254,9 @@

    Python Type System Conformance Test Results

    - - - @@ -2420,7 +2281,7 @@

    Python Type System Conformance Test Results

    - @@ -2432,12 +2293,10 @@

    Python Type System Conformance Test Results

    - - - - - - - @@ -2548,7 +2397,7 @@

    Python Type System Conformance Test Results

    - @@ -2560,7 +2409,6 @@

    Python Type System Conformance Test Results

    - @@ -2568,7 +2416,6 @@

    Python Type System Conformance Test Results

    - - - @@ -2602,7 +2448,6 @@

    Python Type System Conformance Test Results

    - @@ -2612,7 +2457,6 @@

    Python Type System Conformance Test Results

    - @@ -2620,7 +2464,6 @@

    Python Type System Conformance Test Results

    - - - - @@ -2690,11 +2530,9 @@

    Python Type System Conformance Test Results

    - - - @@ -2725,11 +2562,9 @@

    Python Type System Conformance Test Results

    - - - @@ -2756,13 +2590,12 @@

    Python Type System Conformance Test Results

    - - - @@ -2791,7 +2623,6 @@

    Python Type System Conformance Test Results

    - diff --git a/conformance/src/type_checker.py b/conformance/src/type_checker.py index 6fd0ed0f2..d72ff9dbf 100644 --- a/conformance/src/type_checker.py +++ b/conformance/src/type_checker.py @@ -502,114 +502,6 @@ def parse_errors(self, output: Sequence[str]) -> dict[int, list[str]]: return line_to_errors -class BasiliskTypeChecker(TypeChecker): - @property - def name(self) -> str: - return "basilisk" - - def _executable(self) -> str: - # Prefer the pip-installed `basilisk` console script (the wheel puts it on - # PATH — this is how the suite's `uv sync` environment resolves it). A - # BASILISK_BIN override is honoured for source builds / local dev. - override = os.environ.get("BASILISK_BIN") - if override: - return override - return shutil.which("basilisk") or "basilisk" - - def install(self) -> bool: - try: - self.get_version() - return True - except (CalledProcessError, FileNotFoundError): - print( - "Unable to run basilisk. Install it with " - "`pip install basilisk-python` (or point BASILISK_BIN at the " - "binary). See https://www.basilisk-python.dev." - ) - return False - - def get_version(self) -> str: - proc = run( - [self._executable(), "--version"], - check=True, - stdout=PIPE, - text=True, - ) - return proc.stdout.strip() - - def run_tests(self, test_files: Sequence[str]) -> dict[str, str]: - # Basilisk emits a machine-readable JSON array of diagnostics. Each test - # file is a self-contained module, so we check them individually and key - # the flattened text output by file name for the scoring pass. - results_dict: dict[str, str] = {} - for test_file in test_files: - proc = run( - [ - self._executable(), - "check", - test_file, - "--output", - "json", - "--color", - "never", - ], - stdout=PIPE, - stderr=PIPE, - text=True, - encoding="utf-8", - ) - if proc.returncode not in (0, 1): - raise CalledProcessError( - proc.returncode, - "basilisk check", - output=proc.stdout, - stderr=proc.stderr, - ) - if not proc.stdout.strip(): - raise ValueError(f"basilisk produced empty JSON output for {test_file}") - diagnostics = json.loads(proc.stdout) - if not isinstance(diagnostics, list): - raise TypeError(f"basilisk JSON output is not a list for {test_file}") - - def sort_key(diagnostic: dict[str, object]) -> tuple[str, int, int, str, str, str]: - return ( - Path(str(diagnostic.get("path", test_file))).name, - int(diagnostic.get("line", 0) or 0), - int(diagnostic.get("col", 0) or 0), - str(diagnostic.get("severity", "error")), - str(diagnostic.get("code", "")), - str(diagnostic.get("message", "")), - ) - - for diagnostic in sorted(diagnostics, key=sort_key): - file_name = Path(diagnostic.get("path", test_file)).name - line_number = diagnostic.get("line", 0) - col_number = diagnostic.get("col", 0) - severity = str(diagnostic.get("severity", "error")).replace("\n", " ") - message = str(diagnostic.get("message", "")).replace("\n", " ") - code = str(diagnostic.get("code", "")).replace("\n", " ") - line_text = ( - f"{file_name}:{line_number}:{col_number}: " - f"{severity}: {message} [{code}]\n" - ) - results_dict[file_name] = results_dict.get(file_name, "") + line_text - return results_dict - - def parse_errors(self, output: Sequence[str]) -> dict[int, list[str]]: - # aliases_implicit.py:115:5: error: Invalid type expression ... [annotations_forward_refs] - line_to_errors: dict[int, list[str]] = {} - for line in output: - if not line.strip(): - continue - if line.count(":") < 3: - raise AssertionError( - f"Failed to parse Basilisk diagnostic line: {line!r}" - ) - _, lineno, _col, _rest = line.split(":", maxsplit=3) - line_to_errors.setdefault(int(lineno), []).append(line) - return line_to_errors - - TYPE_CHECKERS: Sequence[TypeChecker] = ( MypyTypeChecker(), PyrightTypeChecker(), @@ -617,5 +509,4 @@ def parse_errors(self, output: Sequence[str]) -> dict[int, list[str]]: PyreflyTypeChecker(), PycroscopeTypeChecker(), TyTypeChecker(), - BasiliskTypeChecker(), ) diff --git a/conformance/uv.lock b/conformance/uv.lock index 17097bc05..fa0d6818b 100644 --- a/conformance/uv.lock +++ b/conformance/uv.lock @@ -26,18 +26,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/45/19/cc8bd127d28a43da249aa955cfd164cf8fd534e79e42cea96c4854d72fd0/ast_serialize-0.5.0-cp39-abi3-win_arm64.whl", hash = "sha256:92a31c9c20d25a076edaeec76b128a3535d74a24f340b9a8a7e96c9b86dc9642", size = 1081181, upload-time = "2026-05-17T17:48:28.122Z" }, ] -[[package]] -name = "basilisk-python" -version = "0.27.0" -source = { registry = "https://pypi.org/simple" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/e4/b3/f1acc0c0d3400c32aa3d0927d87f8bd4f88ea2742505a4494dd5d664c4ae/basilisk_python-0.27.0-py3-none-macosx_11_0_arm64.whl", hash = "sha256:b0723eaf5bcd9a4df926486b128aef7e945cbd26e008966fef5baa83b6d14659", size = 6042835, upload-time = "2026-07-05T11:49:03.691Z" }, - { url = "https://files.pythonhosted.org/packages/0f/e5/fb3900f0c4f533a4e8f92f7aab293514ed14d82c5748c373db5b3f0b3020/basilisk_python-0.27.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ae79412a9eb8f7e5cf0b4ea9bc639b8529f996103a417f6440f05ba5e6777eb1", size = 6051090, upload-time = "2026-07-05T11:49:05.877Z" }, - { url = "https://files.pythonhosted.org/packages/bc/75/ed45daa20c0981a04f2f7ee5e8591c90dc51d90d3037c1c3f494f3ec44cd/basilisk_python-0.27.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6e250b028cca805a441a44ff89b135fce773d442926401d7f88a31858fcb5bf4", size = 6475075, upload-time = "2026-07-05T11:49:07.656Z" }, - { url = "https://files.pythonhosted.org/packages/e5/2b/3efab5e598502d2fcd4017c452e9aa30a7777e52133bdcc66c7d9cee5ebc/basilisk_python-0.27.0-py3-none-win_amd64.whl", hash = "sha256:2e6eb13a25863a574a2866dcf75a9101cce5c86cf8d538d86cf85b3fae80f916", size = 6404281, upload-time = "2026-07-05T11:49:09.69Z" }, - { url = "https://files.pythonhosted.org/packages/79/2e/17d798481ecd413bcf2bd5d01bc80c7d63dac8dee93cfc486cf381096e2d/basilisk_python-0.27.0-py3-none-win_arm64.whl", hash = "sha256:9b5e731933f231947e6d46845721ec399c8ce5d0f239a91b44c16d5933ac8662", size = 6009719, upload-time = "2026-07-05T11:49:11.333Z" }, -] - [[package]] name = "importlib-resources" version = "7.1.0" @@ -264,7 +252,6 @@ name = "typing-conformance" version = "0.1.0" source = { virtual = "." } dependencies = [ - { name = "basilisk-python" }, { name = "jinja2" }, { name = "markdown" }, { name = "mypy" }, @@ -279,7 +266,6 @@ dependencies = [ [package.metadata] requires-dist = [ - { name = "basilisk-python" }, { name = "jinja2" }, { name = "markdown" }, { name = "mypy" }, From 4f470b0ff13b7625df11e9ef8d8fac3f62c0a0ab Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Wed, 5 Aug 2026 15:05:53 -0400 Subject: [PATCH 270/308] Update ty results for v0.0.67 (#2331) --- conformance/results/results.html | 36 +++++------------- .../results/ty/constructors_call_type.toml | 8 +--- conformance/results/ty/dataclasses_hash.toml | 10 ++--- .../results/ty/generics_self_usage.toml | 8 +--- .../ty/generics_typevartuple_basic.toml | 2 - .../results/ty/literals_literalstring.toml | 1 - .../results/ty/protocols_class_objects.toml | 7 ++-- conformance/results/ty/version.toml | 2 +- conformance/uv.lock | 38 +++++++++---------- 9 files changed, 40 insertions(+), 72 deletions(-) diff --git a/conformance/results/results.html b/conformance/results/results.html index 4a6ac1a93..b557abfc6 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -268,7 +268,7 @@

    Python Type System Conformance Test Results

    - + @@ -711,12 +711,7 @@

    Python Type System Conformance Test Results

    - + @@ -932,7 +927,7 @@

    Python Type System Conformance Test Results

    - + @@ -1268,9 +1263,8 @@

    Python Type System Conformance Test Results

    @@ -1566,12 +1560,7 @@

    Python Type System Conformance Test Results

    - + @@ -1622,7 +1611,7 @@

    Python Type System Conformance Test Results

    - + @@ -1825,12 +1814,7 @@

    Python Type System Conformance Test Results

    - + @@ -1978,7 +1962,7 @@

    Python Type System Conformance Test Results

    - + @@ -2627,7 +2611,7 @@

    Python Type System Conformance Test Results

    - + diff --git a/conformance/results/ty/constructors_call_type.toml b/conformance/results/ty/constructors_call_type.toml index d30d79c97..3d3e7f8b5 100644 --- a/conformance/results/ty/constructors_call_type.toml +++ b/conformance/results/ty/constructors_call_type.toml @@ -1,10 +1,5 @@ -conformance_automated = "Fail" -conformant = "Partial" -notes = """ -Has overly lenient handling of calls to `type[T]` if `T` is a type variable without an upper bound. -""" +conformance_automated = "Pass" errors_diff = """ -Line 64: Expected 1 errors """ output = """ constructors_call_type.py:19:55: warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive @@ -12,6 +7,7 @@ constructors_call_type.py:30:5: error[missing-argument] No arguments provided fo constructors_call_type.py:40:5: error[missing-argument] No arguments provided for required parameters `x`, `y` of constructor `Class2.__new__` constructors_call_type.py:50:5: error[missing-argument] No arguments provided for required parameters `x`, `y` of `Class3.__init__` constructors_call_type.py:59:9: error[too-many-positional-arguments] Too many positional arguments to `object.__init__`: expected 1, got 2 +constructors_call_type.py:64:9: error[too-many-positional-arguments] Too many positional arguments to `type[T]`: expected 0, got 1 constructors_call_type.py:72:5: error[missing-argument] No arguments provided for required parameters `x`, `y` of bound method `Meta1.__call__` constructors_call_type.py:81:5: error[missing-argument] No argument provided for required parameter `y` of constructor `Class2.__new__` constructors_call_type.py:82:12: error[invalid-argument-type] Argument to constructor `Class2.__new__` is incorrect: Expected `str`, found `Literal[2]` diff --git a/conformance/results/ty/dataclasses_hash.toml b/conformance/results/ty/dataclasses_hash.toml index 8c24b29fa..dc083d25b 100644 --- a/conformance/results/ty/dataclasses_hash.toml +++ b/conformance/results/ty/dataclasses_hash.toml @@ -1,13 +1,9 @@ -conformance_automated = "Fail" -conformant = "Partial" -notes = """ -Understands the `Hashable` protocol as equivalent to `object`. -""" +conformance_automated = "Pass" errors_diff = """ -Line 18: Expected 1 errors -Line 40: Expected 1 errors """ output = """ dataclasses_hash.py:17:1: error[call-non-callable] Object of type `None` is not callable +dataclasses_hash.py:18:16: error[invalid-assignment] Object of type `DC1` is not assignable to `Hashable` dataclasses_hash.py:39:1: error[call-non-callable] Object of type `None` is not callable +dataclasses_hash.py:40:16: error[invalid-assignment] Object of type `DC3` is not assignable to `Hashable` """ diff --git a/conformance/results/ty/generics_self_usage.toml b/conformance/results/ty/generics_self_usage.toml index aaa1052e7..a37756092 100644 --- a/conformance/results/ty/generics_self_usage.toml +++ b/conformance/results/ty/generics_self_usage.toml @@ -1,15 +1,11 @@ -conformance_automated = "Fail" -conformant = "Partial" -notes = """ -Does not reject `Self` used in a return annotation when `self` is annotated using another type variable. -""" +conformance_automated = "Pass" errors_diff = """ -Line 82: Expected 1 errors """ output = """ generics_self_usage.py:73:14: error[invalid-type-form] Variable of type `` is not allowed in a parameter annotation generics_self_usage.py:73:23: error[invalid-type-form] Variable of type `` is not allowed in a return type annotation generics_self_usage.py:76:6: error[invalid-type-form] Variable of type `` is not allowed in a type expression +generics_self_usage.py:82:54: error[invalid-type-form] `Self` requires `self: Self` or `cls: type[Self]` for annotated receivers generics_self_usage.py:87:16: error[invalid-return-type] Return type does not match returned value: expected `Self@return_concrete_type`, found `Foo3` 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 `` diff --git a/conformance/results/ty/generics_typevartuple_basic.toml b/conformance/results/ty/generics_typevartuple_basic.toml index a619e2137..7fd82253b 100644 --- a/conformance/results/ty/generics_typevartuple_basic.toml +++ b/conformance/results/ty/generics_typevartuple_basic.toml @@ -2,9 +2,7 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -generics_typevartuple_basic.py:42:28: error[invalid-assignment] Object of type `Array[Shape@Array]` is not assignable to `Array[Height, Width]` generics_typevartuple_basic.py:42:34: error[invalid-argument-type] Argument to `Array.__init__` is incorrect: Expected `tuple[Height, Width]`, found `Height` -generics_typevartuple_basic.py:43:35: error[invalid-assignment] Object of type `Array[Shape@Array]` is not assignable to `Array[Batch, Height, Width]` generics_typevartuple_basic.py:43:41: error[invalid-argument-type] Argument to `Array.__init__` is incorrect: Expected `tuple[Batch, Height, Width]`, found `tuple[Batch, Width]` generics_typevartuple_basic.py:44:41: error[invalid-assignment] Object of type `Array[Time, Batch, Width, Height]` is not assignable to `Array[Time, Batch, Height, Width]` generics_typevartuple_basic.py:52:14: error[invalid-generic-class] `TypeVarTuple` must be unpacked with `*` or `Unpack[]` when used as an argument to `Generic` diff --git a/conformance/results/ty/literals_literalstring.toml b/conformance/results/ty/literals_literalstring.toml index d4fa5392d..b123ed0d0 100644 --- a/conformance/results/ty/literals_literalstring.toml +++ b/conformance/results/ty/literals_literalstring.toml @@ -9,7 +9,6 @@ literals_literalstring.py:65:25: error[invalid-assignment] Object of type `str` literals_literalstring.py:73:25: error[invalid-assignment] Object of type `Literal[3]` is not assignable to `LiteralString` literals_literalstring.py:74:25: error[invalid-assignment] Object of type `Literal[b"test"]` is not assignable to `LiteralString` literals_literalstring.py:119:22: error[invalid-argument-type] Argument to function `literal_identity` is incorrect: Argument type `str` does not satisfy upper bound `LiteralString` of type variable `TLiteral` -literals_literalstring.py:133:41: error[invalid-assignment] Object of type `Container[T@Container]` is not assignable to `Container[LiteralString]` literals_literalstring.py:133:51: error[invalid-argument-type] Argument to `Container.__init__` is incorrect: Argument type `str` does not satisfy upper bound `LiteralString` of type variable `T` literals_literalstring.py:171:21: error[invalid-assignment] Object of type `list[LiteralString]` is not assignable to `list[str]` """ diff --git a/conformance/results/ty/protocols_class_objects.toml b/conformance/results/ty/protocols_class_objects.toml index f1a4d3d1c..5b04906fe 100644 --- a/conformance/results/ty/protocols_class_objects.toml +++ b/conformance/results/ty/protocols_class_objects.toml @@ -1,19 +1,18 @@ conformance_automated = "Fail" conformant = "Partial" notes = """ -`type[Proto]` is not yet supported. -Class objects are not correctly matched against `@property` protocol members. -`ClassVar` protocol members are only partially supported. +Does not reject protocol classes where `type[Proto]` requires a concrete class. +Incorrectly considers instance attributes as satisfying protocol members on class objects. """ errors_diff = """ Line 29: Expected 1 errors Line 34: Expected 1 errors -Line 74: Expected 1 errors Line 107: Expected 1 errors Line 108: Expected 1 errors """ output = """ protocols_class_objects.py:58:16: error[invalid-assignment] Object of type `` is not assignable to `ProtoA1` +protocols_class_objects.py:74:16: error[invalid-assignment] Object of type `` is not assignable to `ProtoB1` protocols_class_objects.py:104:16: error[invalid-assignment] Object of type `` is not assignable to `ProtoC1` protocols_class_objects.py:106:16: error[invalid-assignment] Object of type `` is not assignable to `ProtoC1` """ diff --git a/conformance/results/ty/version.toml b/conformance/results/ty/version.toml index c0765278e..1d686bb73 100644 --- a/conformance/results/ty/version.toml +++ b/conformance/results/ty/version.toml @@ -1 +1 @@ -version = "ty 0.0.66" +version = "ty 0.0.67" diff --git a/conformance/uv.lock b/conformance/uv.lock index fa0d6818b..dd2445b40 100644 --- a/conformance/uv.lock +++ b/conformance/uv.lock @@ -202,27 +202,27 @@ wheels = [ [[package]] name = "ty" -version = "0.0.66" +version = "0.0.67" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/cd/58/4f6ab2a86589e422a3cf840bcf6114c565e4c39ddf4d0b7cd328af5b52b4/ty-0.0.66.tar.gz", hash = "sha256:24bddd4479ce445b51ac015410dd2d34af1cadd62a77f5b3cb269149ed83f9b5", size = 6520402, upload-time = "2026-08-04T01:09:47.714Z" } +sdist = { url = "https://files.pythonhosted.org/packages/d3/aa/e153d47aef36891729ff2a7dd7350d04df73f81ef8117257b518c771956e/ty-0.0.67.tar.gz", hash = "sha256:8926130a1d5a11b228f72bc6a7680cf4f75be99064dfe3ad161fd3b860999603", size = 6550079, upload-time = "2026-08-05T18:43:21.18Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/45/4d/bbc28310d6d887ef73e5800f062c4bf54caa35a1b47d70c7b03d0515ecf1/ty-0.0.66-py3-none-linux_armv6l.whl", hash = "sha256:8b46450438b54b732338e4d7a78a7d2f5e1a012a13d77d121aacaca20fb814e2", size = 12409743, upload-time = "2026-08-04T01:09:01.229Z" }, - { url = "https://files.pythonhosted.org/packages/73/4e/c3d2eb2242fa0a2ef445ca2c7009dc9118e5b3dcb8b8a8bec70d58c8e4bc/ty-0.0.66-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:8e4adbe662bc3c62b52b83d46b07f703fdc3c123bb72601606c58be5ea017ed3", size = 12078362, upload-time = "2026-08-04T01:09:04.233Z" }, - { url = "https://files.pythonhosted.org/packages/fa/ba/7a4b5e45d701a8de6b714dacf6ffca91b0411baaceaa781d494037623a18/ty-0.0.66-py3-none-macosx_11_0_arm64.whl", hash = "sha256:776814351735847eb934f9a3cbea21d2278ba14aa0fc099f683da11bc2d5c90a", size = 11583289, upload-time = "2026-08-04T01:09:06.973Z" }, - { url = "https://files.pythonhosted.org/packages/4a/4a/fbb1f71ee2999f981f8c4b3b139231e4bcff4ede0c3b37e858fd1334ed26/ty-0.0.66-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cca1da877f613965b954bfd22d495386e260ec767c5536c8022cca98a260ea5d", size = 12137274, upload-time = "2026-08-04T01:09:09.592Z" }, - { url = "https://files.pythonhosted.org/packages/d5/07/9e0662f6603a5ac171ae6b314396e677ead4b45695fc948efb0a4837051f/ty-0.0.66-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:aa523e777bc36c0fbf8ded5844096f46cbfc3712fe5a003351a94259b7e86cf4", size = 12207047, upload-time = "2026-08-04T01:09:12.533Z" }, - { url = "https://files.pythonhosted.org/packages/bb/cc/12e01bc2ea47fa7bf20fc6cdd3249d6a340be9be4edc52b1d77256245dd0/ty-0.0.66-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3f7993c1f95f80a4e44056e6aaf8e46e608d778db131ae5ce59262ab59358f9a", size = 12919304, upload-time = "2026-08-04T01:09:15.175Z" }, - { url = "https://files.pythonhosted.org/packages/75/88/c6c0d3a8e71c9cdb560cc5c627a4bba6c47b5eec460b2f8c449b57c6d03a/ty-0.0.66-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f9b29354bcbac9f53b6952d8f46789bd81eeb9bdd7a68df7d26e654ca7498c3c", size = 13470963, upload-time = "2026-08-04T01:09:17.849Z" }, - { url = "https://files.pythonhosted.org/packages/27/c2/2f8c18063412ad80e1b3f87afce7bd50982b4a048166607b67f80660a9fb/ty-0.0.66-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:fbf4e5325f7f584d9c346946e7c415b2e3cd3b8f1119d468082a90a6afd020ce", size = 13244773, upload-time = "2026-08-04T01:09:20.59Z" }, - { url = "https://files.pythonhosted.org/packages/ed/f6/fdae2b95831116dffc055ad53a99a8f21437263651047b3ad46def4950a3/ty-0.0.66-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7bd304363764bd723c22fb20b17035c345420fdf66fee856934b158ebde08a91", size = 12751343, upload-time = "2026-08-04T01:09:23.225Z" }, - { url = "https://files.pythonhosted.org/packages/14/1e/7e75f0371d11463a256dc2bee98b0df401e0fa06021e200b8b601d21949d/ty-0.0.66-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:205d8589bd957ea9718d488b731b2fbdd0d1b1cefd37c79f52c0deb7cafddfef", size = 13068057, upload-time = "2026-08-04T01:09:26.052Z" }, - { url = "https://files.pythonhosted.org/packages/b4/84/f20f24518f6f0bea936e2e668ede250b9ce0774624559931599bd1f42772/ty-0.0.66-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:7304a1df54741a2343801354f41d7ad87974acb541ee3e93c26cb6a1a0b863af", size = 12082318, upload-time = "2026-08-04T01:09:28.877Z" }, - { url = "https://files.pythonhosted.org/packages/08/20/70ca0eac2427d4a58a81a3a9426b20e46fb4a5a13aefc9edc2e5172e1243/ty-0.0.66-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:cf2c062863e5da0f588b0b120fec0da2e81c0913ee4cd07b50d77aa60ffd8deb", size = 12228978, upload-time = "2026-08-04T01:09:31.905Z" }, - { url = "https://files.pythonhosted.org/packages/7c/01/5a461ab34456d788248780830aed673c9e0e796f6e9dd92d3dbf02e04d7f/ty-0.0.66-py3-none-musllinux_1_2_i686.whl", hash = "sha256:a58d32c879d86428978332adf21e85009ec269314a23d330c3483c65b57aedc7", size = 12471917, upload-time = "2026-08-04T01:09:34.418Z" }, - { url = "https://files.pythonhosted.org/packages/46/ed/f8eb5eff7c9ee644490c6d2626425935c097acc54871adf659ea70624a2c/ty-0.0.66-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:b2f810fa3516c977630d78dbe9161592b3c27029fa9bb81074366624d9b5e4b6", size = 12858086, upload-time = "2026-08-04T01:09:37.602Z" }, - { url = "https://files.pythonhosted.org/packages/02/7f/8a78361f752274a550a7f6f07f127b246ece7d7fdde31121d22074e46eab/ty-0.0.66-py3-none-win32.whl", hash = "sha256:d28c3df565a387c1c5ea359aa452a46d19163616ef71be819058a424a62f1ae1", size = 11782494, upload-time = "2026-08-04T01:09:40.136Z" }, - { url = "https://files.pythonhosted.org/packages/7d/e2/deed22b823ce309b8410d50414fd15afe9e90aee8b8ca04789ba55c21231/ty-0.0.66-py3-none-win_amd64.whl", hash = "sha256:e3a457f3312c078f24c47d0da6e4f73de34d0a77ed2de22571c066c80b2fd5e7", size = 12893338, upload-time = "2026-08-04T01:09:42.825Z" }, - { url = "https://files.pythonhosted.org/packages/f9/ce/6c828f42ef1ed39f53f57f9c0cdcdf03e23666fa7a29d799042a2c34bcb4/ty-0.0.66-py3-none-win_arm64.whl", hash = "sha256:2f62ae247b9c75674fcc060635f9f00210357da7681de59234d97b50fb9e9e94", size = 12227381, upload-time = "2026-08-04T01:09:45.365Z" }, + { url = "https://files.pythonhosted.org/packages/fd/0a/992067ee1bdd30994c0dbdb3674e88a9ea7892dd6008a819c73f9985a1b6/ty-0.0.67-py3-none-linux_armv6l.whl", hash = "sha256:5ad41198feb7d3963f954902d3b33c58b5dc27bd21f4d9cde45dd1ae1ba34677", size = 12353546, upload-time = "2026-08-05T18:42:42.137Z" }, + { url = "https://files.pythonhosted.org/packages/a2/8c/def24d99c4a4e1bfc30ce6d69a913a9bf6bfa8a56fe2b1b3d6bce7e75bdd/ty-0.0.67-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:90f8271d66d0a42bd5f3aab01c51acf70dc7111fe8ffe62c9125a2db1a4f8a55", size = 12023201, upload-time = "2026-08-05T18:42:44.944Z" }, + { url = "https://files.pythonhosted.org/packages/99/11/03c2278fb76f764439045760c11ac7bd407bc534c13138ccc21d60e5d883/ty-0.0.67-py3-none-macosx_11_0_arm64.whl", hash = "sha256:df5d5b4496036fffe3f767691867b57bc67fc2155e9608cb4fcb517dfe4f5761", size = 11522878, upload-time = "2026-08-05T18:42:47.192Z" }, + { url = "https://files.pythonhosted.org/packages/03/47/d4d4e334649db69d7467084aedf02f237b852a8ffba4579d0d193a50dda5/ty-0.0.67-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:de4f90d9152051a697d59f354f30eb76c3e9ec608e2a3c33595bbc88f851ad4e", size = 12093398, upload-time = "2026-08-05T18:42:49.331Z" }, + { url = "https://files.pythonhosted.org/packages/db/24/a551f16dfcd89ff4173757f09f3bb6cb9aa10e6f079c604b949a9c19ba41/ty-0.0.67-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:bccc2361d1f628182ca19b1736c947ca082e7db5f07277a43b316241e07b1350", size = 12141027, upload-time = "2026-08-05T18:42:51.528Z" }, + { url = "https://files.pythonhosted.org/packages/c5/87/9e2baa098b94ea0bce4e3e8b106711a500af50be50519b96e90484e4f4b8/ty-0.0.67-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e0d7eee4a9d7694d64085a8ae12b4d9fc7c162b24e3000befe91737a9a61d1dd", size = 12908208, upload-time = "2026-08-05T18:42:53.844Z" }, + { url = "https://files.pythonhosted.org/packages/42/32/e8c0bfc19cc0a6dbf254933c13b857c2c0c800b86158296d3e4ccdb5702c/ty-0.0.67-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f4309acef52659fb5e030962b60fccd44b4f6b9c19c365738bc5d46a3c138b1e", size = 13404183, upload-time = "2026-08-05T18:42:55.988Z" }, + { url = "https://files.pythonhosted.org/packages/a3/ab/c9faa04a075136741b173058dd81a4070dc0bdf7fe162f8278d61e1b0b3d/ty-0.0.67-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:4daffa097226bcdee4852b61bd05311a49a7286b10042c148450cf6761b287c7", size = 13127241, upload-time = "2026-08-05T18:42:58.826Z" }, + { url = "https://files.pythonhosted.org/packages/a7/e5/47a368bdee8fd8376b6055496b5d2d03650d976b94e924b39332c0861396/ty-0.0.67-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:94b579b8ee3836238b96fb186a99904eea0a56685d6e50f7b54fe530050df07d", size = 12685060, upload-time = "2026-08-05T18:43:01.487Z" }, + { url = "https://files.pythonhosted.org/packages/ce/2d/b78102ca16dd05be36defe18f312deba43606c8870638749908de58b6408/ty-0.0.67-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:3b357d66119c4dc11d7508c40df0338857e470b0041515781effc45ca9211294", size = 12959319, upload-time = "2026-08-05T18:43:03.712Z" }, + { url = "https://files.pythonhosted.org/packages/88/e6/35e5a6d887144463d93c1320558fe6027e02c2cd27658999af04abf56120/ty-0.0.67-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:24043b96d25b9b787b715c08ed7c8bc236cb7800a6fd189967092b9712f523c9", size = 12040267, upload-time = "2026-08-05T18:43:05.91Z" }, + { url = "https://files.pythonhosted.org/packages/69/26/2d81626e029e5fa6a9b03e98141dbf52a6e6b814130e5d7227cbb9b74611/ty-0.0.67-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:4384d7427e1abf5165e010b66d2133d38b2707ef8880eb755de25f2e5b69a3f1", size = 12153207, upload-time = "2026-08-05T18:43:08.039Z" }, + { url = "https://files.pythonhosted.org/packages/df/62/cc61afedad6e8f02303cf2867364d5b30f2f223787c58932870c53e99d65/ty-0.0.67-py3-none-musllinux_1_2_i686.whl", hash = "sha256:761a141c6f6833b62bc5d92558b243adfd11b8084e070aa112c9b7ab9ec90e8b", size = 12446021, upload-time = "2026-08-05T18:43:10.207Z" }, + { url = "https://files.pythonhosted.org/packages/25/c4/8bbc1c641018b4003bb9fdc1a93843055dfa8d771b4d08fb6413b7a94a5a/ty-0.0.67-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:fc80a63d0b9eecc667e16e809d20a1c014668e6be8523db1f7714bc1a84e79c4", size = 12797108, upload-time = "2026-08-05T18:43:12.244Z" }, + { url = "https://files.pythonhosted.org/packages/c9/a4/8b181be30a49f6813822d50e7489eb8fe6287db7f2b635d1de97f82bbf94/ty-0.0.67-py3-none-win32.whl", hash = "sha256:9dc697547cc7972079e77d716b6874fbe7c6e7265d360ba372afdf44f0a103ec", size = 11771788, upload-time = "2026-08-05T18:43:14.375Z" }, + { url = "https://files.pythonhosted.org/packages/a6/bc/948eb72740c23c0ab3bb0a3bb07035e25d7950e862fd987651a8a6f21430/ty-0.0.67-py3-none-win_amd64.whl", hash = "sha256:2c4cdc1dffbfab5476bd708adb90018dd3f8bc796b3608fd60162b6e9c85981a", size = 12818447, upload-time = "2026-08-05T18:43:16.607Z" }, + { url = "https://files.pythonhosted.org/packages/5e/0a/8a2002aed7e4cf7278141984b393b5156e7f42c8aefc9ced9d037a3a3cd9/ty-0.0.67-py3-none-win_arm64.whl", hash = "sha256:6251e59bf4c36486204a0ec3aa758f7b65ef6727f1db7b24b8e90db072ac6eff", size = 12146254, upload-time = "2026-08-05T18:43:18.915Z" }, ] [[package]] From 322ab6711f23d4d779739cd1c90a409883e47df5 Mon Sep 17 00:00:00 2001 From: Danny Yang Date: Thu, 6 Aug 2026 22:56:52 -0400 Subject: [PATCH 271/308] Update conformance results for Pyrefly v1.3.0-dev1 (#2333) pyrefly-1.3.0-dev1 --- conformance/pyproject.toml | 2 +- .../results/pyrefly/aliases_recursive.toml | 8 +- .../results/pyrefly/callables_annotation.toml | 9 +- .../pyrefly/constructors_callable.toml | 12 +- .../pyrefly/exceptions_context_managers.toml | 11 +- .../results/pyrefly/generics_scoping.toml | 15 +- .../typeddicts_readonly_inheritance.toml | 2 +- conformance/results/pyrefly/version.toml | 2 +- conformance/results/results.html | 40 +-- conformance/uv.lock | 242 +++++++++--------- 10 files changed, 153 insertions(+), 190 deletions(-) diff --git a/conformance/pyproject.toml b/conformance/pyproject.toml index 17c4adfd2..cc393c951 100644 --- a/conformance/pyproject.toml +++ b/conformance/pyproject.toml @@ -7,7 +7,7 @@ dependencies = [ "markdown", "mypy", "pycroscope", - "pyrefly", + "pyrefly==1.3.0.dev1", "pyright", "tomlkit", "ty", diff --git a/conformance/results/pyrefly/aliases_recursive.toml b/conformance/results/pyrefly/aliases_recursive.toml index e0cb9c870..0cbfc4e60 100644 --- a/conformance/results/pyrefly/aliases_recursive.toml +++ b/conformance/results/pyrefly/aliases_recursive.toml @@ -3,13 +3,13 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR aliases_recursive.py:19:12-29: `dict[str, complex | int]` is not assignable to `dict[str, Json] | float | int | list[Json] | str | None` [bad-assignment] +ERROR aliases_recursive.py:19:26-28: `complex` is not assignable to dict value type `Json` [bad-assignment] ERROR aliases_recursive.py:20:12-19: `list[complex | int]` is not assignable to `dict[str, Json] | float | int | list[Json] | str | None` [bad-assignment] ERROR aliases_recursive.py:38:22-50: `tuple[Literal[1], tuple[Literal['1'], Literal[1]], tuple[Literal[1], tuple[Literal[1], list[int]]]]` is not assignable to `int | str | tuple[RecursiveTuple, ...]` [bad-assignment] ERROR aliases_recursive.py:39:22-30: `tuple[Literal[1], list[int]]` is not assignable to `int | str | tuple[RecursiveTuple, ...]` [bad-assignment] -ERROR aliases_recursive.py:50:24-34: `dict[str, list[int]]` is not assignable to `Mapping[str, RecursiveMapping] | int | str` [bad-assignment] -ERROR aliases_recursive.py:51:24-55: `dict[str, int | list[int] | str]` is not assignable to `Mapping[str, RecursiveMapping] | int | str` [bad-assignment] -ERROR aliases_recursive.py:52:24-83: `dict[str, dict[str, int | list[int] | str] | int | str]` is not assignable to `Mapping[str, RecursiveMapping] | int | str` [bad-assignment] +ERROR aliases_recursive.py:50:30-33: `list[int]` is not assignable to dict value type `RecursiveMapping` [bad-assignment] +ERROR aliases_recursive.py:51:48-54: `list[int]` is not assignable to dict value type `RecursiveMapping` [bad-assignment] +ERROR aliases_recursive.py:52:72-81: `list[int]` is not assignable to dict value type `RecursiveMapping` [bad-assignment] ERROR aliases_recursive.py:63:30-43: `list[list[float] | str]` is not assignable to `list[str | GenericTypeAlias1[str]]` [bad-assignment] ERROR aliases_recursive.py:69:35-64: `list[list[int | list[int | list[float] | str]] | str]` is not assignable to `list[int | str | GenericTypeAlias2[str, int]]` [bad-assignment] ERROR aliases_recursive.py:72:29-57: Found cyclic self-reference in `RecursiveUnion` [invalid-type-alias] diff --git a/conformance/results/pyrefly/callables_annotation.toml b/conformance/results/pyrefly/callables_annotation.toml index 01f1ec75e..dd27d4f3e 100644 --- a/conformance/results/pyrefly/callables_annotation.toml +++ b/conformance/results/pyrefly/callables_annotation.toml @@ -1,10 +1,6 @@ -conformant = "Partial" -notes = """ -Parameter names are lost when resolving `ParamSpec`. -""" -conformance_automated = "Fail" +conformant = "Pass" +conformance_automated = "Pass" errors_diff = """ -Line 159: Expected 1 errors """ output = """ ERROR callables_annotation.py:25:7-10: Expected 1 more positional argument [bad-argument-count] @@ -21,6 +17,7 @@ ERROR callables_annotation.py:58:5-28: Expected 2 arguments for `Callable`, got ERROR callables_annotation.py:59:15-18: Invalid position for `...` [invalid-argument] ERROR callables_annotation.py:91:7-15: `() -> str` is not assignable to variable `cb3` with type `(int, ...) -> str` [bad-assignment] ERROR callables_annotation.py:93:7-15: `(*, a: int) -> str` is not assignable to variable `cb3` with type `(int, ...) -> str` [bad-assignment] +ERROR callables_annotation.py:159:25-27: `Proto8` is not assignable to `Proto5[Any]` [bad-assignment] ERROR callables_annotation.py:172:26-29: `() -> str` is not assignable to `(int, ...) -> str` [bad-assignment] ERROR callables_annotation.py:187:48-50: `(int, str) -> str` is not assignable to `(str, ...) -> str` [bad-assignment] ERROR callables_annotation.py:189:32-34: `(int, str) -> str` is not assignable to `(str, ...) -> str` [bad-assignment] diff --git a/conformance/results/pyrefly/constructors_callable.toml b/conformance/results/pyrefly/constructors_callable.toml index bf88f403d..e89288ee3 100644 --- a/conformance/results/pyrefly/constructors_callable.toml +++ b/conformance/results/pyrefly/constructors_callable.toml @@ -1,10 +1,6 @@ -conformant = "Partial" -notes = """ -Converting constructor to callable does not preserve class-scoped type params. -""" -conformance_automated = "Fail" +conformant = "Pass" +conformance_automated = "Pass" errors_diff = """ -Line 186: Unexpected errors ['assert_type(Class8[Unknown], Class8[str]) failed [assert-type]'] """ output = """ ERROR constructors_callable.py:38:3-5: Missing argument `x` [missing-argument] @@ -20,8 +16,8 @@ ERROR constructors_callable.py:82:3-8: Missing argument `x` [missing-argument] ERROR constructors_callable.py:82:4-5: Unexpected keyword argument `y` [unexpected-keyword] ERROR constructors_callable.py:129:4-5: Expected 0 positional arguments, got 1 [bad-argument-count] ERROR constructors_callable.py:146:8-9: Expected 0 positional arguments, got 1 [bad-argument-count] -ERROR constructors_callable.py:185:10-22: Argument `Literal['not a list']` is not assignable to parameter `y` with type `list[Unknown]` [bad-argument-type] -ERROR constructors_callable.py:186:12-41: assert_type(Class8[Unknown], Class8[str]) failed [assert-type] +ERROR constructors_callable.py:185:10-22: Argument `Literal['not a list']` is not assignable to parameter `y` with type `list[str]` [bad-argument-type] +ERROR constructors_callable.py:187:9-13: Argument `list[str]` is not assignable to parameter `y` with type `list[int]` [bad-argument-type] ERROR constructors_callable.py:197:10-22: Argument `Literal['not a list']` is not assignable to parameter `y` with type `list[str]` [bad-argument-type] ERROR constructors_callable.py:199:9-13: Argument `list[str]` is not assignable to parameter `y` with type `list[int]` [bad-argument-type] """ diff --git a/conformance/results/pyrefly/exceptions_context_managers.toml b/conformance/results/pyrefly/exceptions_context_managers.toml index fe2a3282d..be211bd5b 100644 --- a/conformance/results/pyrefly/exceptions_context_managers.toml +++ b/conformance/results/pyrefly/exceptions_context_managers.toml @@ -1,13 +1,6 @@ -conformant = "Partial" -notes = """ -Some error suppressing context managers are not detected. -""" -conformance_automated = "Fail" +conformant = "Pass" +conformance_automated = "Pass" errors_diff = """ -Line 50: Unexpected errors ['assert_type(str, int | str) failed [assert-type]'] -Line 57: Unexpected errors ['assert_type(str, int | str) failed [assert-type]'] """ output = """ -ERROR exceptions_context_managers.py:50:16-30: assert_type(str, int | str) failed [assert-type] -ERROR exceptions_context_managers.py:57:16-30: assert_type(str, int | str) failed [assert-type] """ diff --git a/conformance/results/pyrefly/generics_scoping.toml b/conformance/results/pyrefly/generics_scoping.toml index 0a4b9c40e..f36ff6a51 100644 --- a/conformance/results/pyrefly/generics_scoping.toml +++ b/conformance/results/pyrefly/generics_scoping.toml @@ -1,13 +1,6 @@ -conformant = "Partial" -notes = """ -Does not implement several scoping checks/restrictions for generics. -""" -conformance_automated = "Fail" +conformant = "Pass" +conformance_automated = "Pass" errors_diff = """ -Line 86: Expected 1 errors -Line 89: Expected 1 errors -Line 98: Expected 1 errors -Line 107: Expected 1 errors """ output = """ ERROR generics_scoping.py:16:12-34: assert_type(int, Literal[1]) failed [assert-type] @@ -18,6 +11,10 @@ ERROR generics_scoping.py:54:12-50: assert_type(bytes, Literal[b'abc']) failed [ ERROR generics_scoping.py:61:8-15: Type variable `S` is not in scope [invalid-type-var] ERROR generics_scoping.py:65:14-21: Type variable `S` is not in scope [invalid-type-var] ERROR generics_scoping.py:76:11-20: Redundant type parameter declaration [invalid-type-var] +ERROR generics_scoping.py:86:15-26: Type variable `T` is not in scope [invalid-type-var] +ERROR generics_scoping.py:89:12-19: Type variable `T` is not in scope [invalid-type-var] +ERROR generics_scoping.py:98:24-31: Type variable `T` is not in scope [invalid-type-var] ERROR generics_scoping.py:105:14-15: Type variable `T` is not in scope [invalid-type-var] ERROR generics_scoping.py:106:14-21: Type variable `T` is not in scope [invalid-type-var] +ERROR generics_scoping.py:107:1-8: Type variable `T` is not in scope [invalid-type-var] """ diff --git a/conformance/results/pyrefly/typeddicts_readonly_inheritance.toml b/conformance/results/pyrefly/typeddicts_readonly_inheritance.toml index 59920b4a0..e2eb106eb 100644 --- a/conformance/results/pyrefly/typeddicts_readonly_inheritance.toml +++ b/conformance/results/pyrefly/typeddicts_readonly_inheritance.toml @@ -12,6 +12,6 @@ ERROR typeddicts_readonly_inheritance.py:84:5-7: Missing required key `ident` fo ERROR typeddicts_readonly_inheritance.py:94:5-6: TypedDict field `a` in `F3` cannot be marked read-only; parent TypedDict `F1` defines it as mutable [bad-typed-dict-key] ERROR typeddicts_readonly_inheritance.py:98:5-6: TypedDict field `a` in `F4` must remain required because parent TypedDict `F1` defines it as required [bad-typed-dict-key] ERROR typeddicts_readonly_inheritance.py:106:5-6: TypedDict field `c` in `F6` cannot be made non-required; parent TypedDict `F1` defines it as required [bad-typed-dict-key] -ERROR typeddicts_readonly_inheritance.py:119:7-11: Field `x` is declared `float` in ancestor `class TD_A2: ... +ERROR typeddicts_readonly_inheritance.py:119:7-11: Field `x` is declared `float` in ancestor `class TD_A2: ... `, which is not assignable to the type `int` implied by multiple inheritance [inconsistent-inheritance] ERROR typeddicts_readonly_inheritance.py:132:7-11: TypedDict field `x` in `TD_B` cannot be made non-required; parent TypedDict `TD_B2` defines it as required [bad-typed-dict-key] """ diff --git a/conformance/results/pyrefly/version.toml b/conformance/results/pyrefly/version.toml index f98b79d14..783ceb1cc 100644 --- a/conformance/results/pyrefly/version.toml +++ b/conformance/results/pyrefly/version.toml @@ -1 +1 @@ -version = "pyrefly 1.1.0" +version = "pyrefly 1.3.0-dev.1" diff --git a/conformance/results/results.html b/conformance/results/results.html index b557abfc6..2c57ab565 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -266,7 +266,7 @@

    Python Type System Conformance Test Results

    - + @@ -640,12 +640,7 @@

    Python Type System Conformance Test Results

    - + - + @@ -1439,12 +1434,7 @@

    Python Type System Conformance Test Results

    - + @@ -1485,7 +1475,7 @@

    Python Type System Conformance Test Results

    - + @@ -1574,12 +1564,7 @@

    Python Type System Conformance Test Results

    - + - + @@ -1720,12 +1705,7 @@

    Python Type System Conformance Test Results

    - + @@ -1734,7 +1714,7 @@

    Python Type System Conformance Test Results

    - + @@ -2609,7 +2589,7 @@

    Python Type System Conformance Test Results

    - + diff --git a/conformance/uv.lock b/conformance/uv.lock index dd2445b40..533989b4c 100644 --- a/conformance/uv.lock +++ b/conformance/uv.lock @@ -1,38 +1,38 @@ version = 1 -revision = 3 +revision = 2 requires-python = "==3.12.*" [[package]] name = "ast-serialize" version = "0.5.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/81/9d/09e27731bd5864a9ce04e3244074e674bb8936bf62b45e0357248717adac/ast_serialize-0.5.0.tar.gz", hash = "sha256:5880091bfe6f4f986f22866375c2e884843e7a0b6343ae41aeea659613d879b6", size = 61157, upload-time = "2026-05-17T17:48:29.429Z" } +sdist = { url = "https://files.pythonhosted.org/packages/81/9d/09e27731bd5864a9ce04e3244074e674bb8936bf62b45e0357248717adac/ast_serialize-0.5.0.tar.gz", hash = "sha256:5880091bfe6f4f986f22866375c2e884843e7a0b6343ae41aeea659613d879b6", size = 61157, upload_time = "2026-05-17T17:48:29.429Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/e0/9e/dc2530acb3a60dc6e46d65abf27d1d9f86721694757906a148d90a6860de/ast_serialize-0.5.0-cp39-abi3-macosx_10_12_x86_64.whl", hash = "sha256:0668aa9459cfa8c9c49ddd2163ebcf43088ba045ef7492af6fe22e0098303101", size = 1191380, upload-time = "2026-05-17T17:48:03.738Z" }, - { url = "https://files.pythonhosted.org/packages/26/0a/bd3d18a582f273d6c843d16bb9e22e9e16365ff7991e92f18f798e9f1224/ast_serialize-0.5.0-cp39-abi3-macosx_11_0_arm64.whl", hash = "sha256:bf683d6363edf2b39eed6b6d4fe22d34b6203867a67e27134d9e2a2680c4bc4a", size = 1183879, upload-time = "2026-05-17T17:48:05.463Z" }, - { url = "https://files.pythonhosted.org/packages/40/ae/1f919100f8620887af58fcc381c61a1f218cdf89c6e155f87b213e61010a/ast_serialize-0.5.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9cc22cf0c9be65e71cf88fda130af60d61eb4a79370ad4cfe7900d48a4aa2211", size = 1244529, upload-time = "2026-05-17T17:48:07.008Z" }, - { url = "https://files.pythonhosted.org/packages/c6/ca/6376559dcce707cdbc1d0d9a13c8d3baaaa501e949ce0ebdc4230cd881aa/ast_serialize-0.5.0-cp39-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:f66173891548c9f2726bf27957b41cabce12fa679dc6da505ddbde4d4b3b31cf", size = 1240560, upload-time = "2026-05-17T17:48:08.46Z" }, - { url = "https://files.pythonhosted.org/packages/35/b2/a620e206b5aeb7efbf2710336df57d457cffbb3991076bbcc1147ef9abd4/ast_serialize-0.5.0-cp39-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e42d729ef2be96a14efbad355093284739e3670ece3e534f82cc8832790911d9", size = 1451172, upload-time = "2026-05-17T17:48:09.922Z" }, - { url = "https://files.pythonhosted.org/packages/fa/e0/4ad5c04c24a40481b2935ce9a0ccdb6023dc8b667167d06ae530cc3512f2/ast_serialize-0.5.0-cp39-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b725026bafa801dbd7310eb13a75f0a2e370e7e51b2cb225f9d21fcfadf919ee", size = 1265072, upload-time = "2026-05-17T17:48:11.469Z" }, - { url = "https://files.pythonhosted.org/packages/b2/71/4d1d479aa56d0101c40e17720c3d6ac2af7269ea0487a80b18e7bfd1a5b7/ast_serialize-0.5.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b54f60c1d78767a53b67eaa663f0dfac3afe606aa07f1301572f588b73d64809", size = 1270488, upload-time = "2026-05-17T17:48:13.575Z" }, - { url = "https://files.pythonhosted.org/packages/6d/4f/0de1bbe06f6edef9fde4ed12ca8e7b3ec7e6e2bd4e672c5af487f7957665/ast_serialize-0.5.0-cp39-abi3-manylinux_2_31_riscv64.whl", hash = "sha256:27d51654fc240a1e87e742d353d98eb45b75f62f129086b3596ab53df2ac2a43", size = 1260702, upload-time = "2026-05-17T17:48:15.141Z" }, - { url = "https://files.pythonhosted.org/packages/75/61/e00872439cfdddcc3c1b6cdaa6e5d904ba8e26a18807c67c4e14409d0ca8/ast_serialize-0.5.0-cp39-abi3-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:2782c36237c46dd1674542f2109740ea5ea485a169bf1431939ada0434e17934", size = 1311182, upload-time = "2026-05-17T17:48:16.779Z" }, - { url = "https://files.pythonhosted.org/packages/76/8e/699a5b955f7926956c95e9e1d74132acad73c2fe7a426f94da89123c20aa/ast_serialize-0.5.0-cp39-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:1943db345233cc7194a470f13afa9c59772c0b123dea0c9414c4d4ca54369759", size = 1421410, upload-time = "2026-05-17T17:48:18.527Z" }, - { url = "https://files.pythonhosted.org/packages/a9/ae/d5b7626874478997adc7a29ab28accf21e596fb590c944290401dfd0b29e/ast_serialize-0.5.0-cp39-abi3-musllinux_1_2_armv7l.whl", hash = "sha256:df1c00022cbbcb064bfaa505aa9c9295362443ce5dacb459d1331d3da353f887", size = 1516587, upload-time = "2026-05-17T17:48:20.133Z" }, - { url = "https://files.pythonhosted.org/packages/0c/ce/b59e02a82d9c4244d64cde502e0b00e83e38816abe19155ceb5437402c7f/ast_serialize-0.5.0-cp39-abi3-musllinux_1_2_i686.whl", hash = "sha256:cae65289fc456fde04af979a2be09302ef5d8ab92ef23e596d6746dc267ada27", size = 1515171, upload-time = "2026-05-17T17:48:21.921Z" }, - { url = "https://files.pythonhosted.org/packages/8b/38/d8d90042747d05aa08d4efcf1c99035a5f670a6bf4c214d31644392afbca/ast_serialize-0.5.0-cp39-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:239a4c354e8d676e9d94631d1d4a64edc6b266f86ff3a5a80aedd344f342c01d", size = 1464668, upload-time = "2026-05-17T17:48:23.544Z" }, - { url = "https://files.pythonhosted.org/packages/dd/51/5b840c4df7334104cecffa28f23904fe81ca89ca223d2450e288de39fd3c/ast_serialize-0.5.0-cp39-abi3-win32.whl", hash = "sha256:143a4ef63285a075871908fda3672dc21864b83a8ec3ee12304aa3e4c5387b9a", size = 1068311, upload-time = "2026-05-17T17:48:25.027Z" }, - { url = "https://files.pythonhosted.org/packages/41/11/ca5672c7d491825bc4cd6702dea106a6b60d928707712ec257c7833ae476/ast_serialize-0.5.0-cp39-abi3-win_amd64.whl", hash = "sha256:cf25572c526add400f26a4750dc6ce0c3bb93fc1f75e7ae0cad4ce4f2cd5c590", size = 1108931, upload-time = "2026-05-17T17:48:26.591Z" }, - { url = "https://files.pythonhosted.org/packages/45/19/cc8bd127d28a43da249aa955cfd164cf8fd534e79e42cea96c4854d72fd0/ast_serialize-0.5.0-cp39-abi3-win_arm64.whl", hash = "sha256:92a31c9c20d25a076edaeec76b128a3535d74a24f340b9a8a7e96c9b86dc9642", size = 1081181, upload-time = "2026-05-17T17:48:28.122Z" }, + { url = "https://files.pythonhosted.org/packages/e0/9e/dc2530acb3a60dc6e46d65abf27d1d9f86721694757906a148d90a6860de/ast_serialize-0.5.0-cp39-abi3-macosx_10_12_x86_64.whl", hash = "sha256:0668aa9459cfa8c9c49ddd2163ebcf43088ba045ef7492af6fe22e0098303101", size = 1191380, upload_time = "2026-05-17T17:48:03.738Z" }, + { url = "https://files.pythonhosted.org/packages/26/0a/bd3d18a582f273d6c843d16bb9e22e9e16365ff7991e92f18f798e9f1224/ast_serialize-0.5.0-cp39-abi3-macosx_11_0_arm64.whl", hash = "sha256:bf683d6363edf2b39eed6b6d4fe22d34b6203867a67e27134d9e2a2680c4bc4a", size = 1183879, upload_time = "2026-05-17T17:48:05.463Z" }, + { url = "https://files.pythonhosted.org/packages/40/ae/1f919100f8620887af58fcc381c61a1f218cdf89c6e155f87b213e61010a/ast_serialize-0.5.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9cc22cf0c9be65e71cf88fda130af60d61eb4a79370ad4cfe7900d48a4aa2211", size = 1244529, upload_time = "2026-05-17T17:48:07.008Z" }, + { url = "https://files.pythonhosted.org/packages/c6/ca/6376559dcce707cdbc1d0d9a13c8d3baaaa501e949ce0ebdc4230cd881aa/ast_serialize-0.5.0-cp39-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:f66173891548c9f2726bf27957b41cabce12fa679dc6da505ddbde4d4b3b31cf", size = 1240560, upload_time = "2026-05-17T17:48:08.46Z" }, + { url = "https://files.pythonhosted.org/packages/35/b2/a620e206b5aeb7efbf2710336df57d457cffbb3991076bbcc1147ef9abd4/ast_serialize-0.5.0-cp39-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e42d729ef2be96a14efbad355093284739e3670ece3e534f82cc8832790911d9", size = 1451172, upload_time = "2026-05-17T17:48:09.922Z" }, + { url = "https://files.pythonhosted.org/packages/fa/e0/4ad5c04c24a40481b2935ce9a0ccdb6023dc8b667167d06ae530cc3512f2/ast_serialize-0.5.0-cp39-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b725026bafa801dbd7310eb13a75f0a2e370e7e51b2cb225f9d21fcfadf919ee", size = 1265072, upload_time = "2026-05-17T17:48:11.469Z" }, + { url = "https://files.pythonhosted.org/packages/b2/71/4d1d479aa56d0101c40e17720c3d6ac2af7269ea0487a80b18e7bfd1a5b7/ast_serialize-0.5.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b54f60c1d78767a53b67eaa663f0dfac3afe606aa07f1301572f588b73d64809", size = 1270488, upload_time = "2026-05-17T17:48:13.575Z" }, + { url = "https://files.pythonhosted.org/packages/6d/4f/0de1bbe06f6edef9fde4ed12ca8e7b3ec7e6e2bd4e672c5af487f7957665/ast_serialize-0.5.0-cp39-abi3-manylinux_2_31_riscv64.whl", hash = "sha256:27d51654fc240a1e87e742d353d98eb45b75f62f129086b3596ab53df2ac2a43", size = 1260702, upload_time = "2026-05-17T17:48:15.141Z" }, + { url = "https://files.pythonhosted.org/packages/75/61/e00872439cfdddcc3c1b6cdaa6e5d904ba8e26a18807c67c4e14409d0ca8/ast_serialize-0.5.0-cp39-abi3-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:2782c36237c46dd1674542f2109740ea5ea485a169bf1431939ada0434e17934", size = 1311182, upload_time = "2026-05-17T17:48:16.779Z" }, + { url = "https://files.pythonhosted.org/packages/76/8e/699a5b955f7926956c95e9e1d74132acad73c2fe7a426f94da89123c20aa/ast_serialize-0.5.0-cp39-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:1943db345233cc7194a470f13afa9c59772c0b123dea0c9414c4d4ca54369759", size = 1421410, upload_time = "2026-05-17T17:48:18.527Z" }, + { url = "https://files.pythonhosted.org/packages/a9/ae/d5b7626874478997adc7a29ab28accf21e596fb590c944290401dfd0b29e/ast_serialize-0.5.0-cp39-abi3-musllinux_1_2_armv7l.whl", hash = "sha256:df1c00022cbbcb064bfaa505aa9c9295362443ce5dacb459d1331d3da353f887", size = 1516587, upload_time = "2026-05-17T17:48:20.133Z" }, + { url = "https://files.pythonhosted.org/packages/0c/ce/b59e02a82d9c4244d64cde502e0b00e83e38816abe19155ceb5437402c7f/ast_serialize-0.5.0-cp39-abi3-musllinux_1_2_i686.whl", hash = "sha256:cae65289fc456fde04af979a2be09302ef5d8ab92ef23e596d6746dc267ada27", size = 1515171, upload_time = "2026-05-17T17:48:21.921Z" }, + { url = "https://files.pythonhosted.org/packages/8b/38/d8d90042747d05aa08d4efcf1c99035a5f670a6bf4c214d31644392afbca/ast_serialize-0.5.0-cp39-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:239a4c354e8d676e9d94631d1d4a64edc6b266f86ff3a5a80aedd344f342c01d", size = 1464668, upload_time = "2026-05-17T17:48:23.544Z" }, + { url = "https://files.pythonhosted.org/packages/dd/51/5b840c4df7334104cecffa28f23904fe81ca89ca223d2450e288de39fd3c/ast_serialize-0.5.0-cp39-abi3-win32.whl", hash = "sha256:143a4ef63285a075871908fda3672dc21864b83a8ec3ee12304aa3e4c5387b9a", size = 1068311, upload_time = "2026-05-17T17:48:25.027Z" }, + { url = "https://files.pythonhosted.org/packages/41/11/ca5672c7d491825bc4cd6702dea106a6b60d928707712ec257c7833ae476/ast_serialize-0.5.0-cp39-abi3-win_amd64.whl", hash = "sha256:cf25572c526add400f26a4750dc6ce0c3bb93fc1f75e7ae0cad4ce4f2cd5c590", size = 1108931, upload_time = "2026-05-17T17:48:26.591Z" }, + { url = "https://files.pythonhosted.org/packages/45/19/cc8bd127d28a43da249aa955cfd164cf8fd534e79e42cea96c4854d72fd0/ast_serialize-0.5.0-cp39-abi3-win_arm64.whl", hash = "sha256:92a31c9c20d25a076edaeec76b128a3535d74a24f340b9a8a7e96c9b86dc9642", size = 1081181, upload_time = "2026-05-17T17:48:28.122Z" }, ] [[package]] name = "importlib-resources" version = "7.1.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/e4/06/b56dfa750b44e86157093bc8fca0ab81dccbf5260510de4eaf1cb69b5b99/importlib_resources-7.1.0.tar.gz", hash = "sha256:0722d4c6212489c530f2a145a34c0a7a3b4721bc96a15fada5930e2a0b760708", size = 44985, upload-time = "2026-04-12T16:36:09.232Z" } +sdist = { url = "https://files.pythonhosted.org/packages/e4/06/b56dfa750b44e86157093bc8fca0ab81dccbf5260510de4eaf1cb69b5b99/importlib_resources-7.1.0.tar.gz", hash = "sha256:0722d4c6212489c530f2a145a34c0a7a3b4721bc96a15fada5930e2a0b760708", size = 44985, upload_time = "2026-04-12T16:36:09.232Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/8a/db/55a262f3606bebcae07cc14095338471ad7c0bbcaa37707e6f0ee49725b7/importlib_resources-7.1.0-py3-none-any.whl", hash = "sha256:1bd7b48b4088eddb2cd16382150bb515af0bd2c70128194392725f82ad2c96a1", size = 37232, upload-time = "2026-04-12T16:36:08.219Z" }, + { url = "https://files.pythonhosted.org/packages/8a/db/55a262f3606bebcae07cc14095338471ad7c0bbcaa37707e6f0ee49725b7/importlib_resources-7.1.0-py3-none-any.whl", hash = "sha256:1bd7b48b4088eddb2cd16382150bb515af0bd2c70128194392725f82ad2c96a1", size = 37232, upload_time = "2026-04-12T16:36:08.219Z" }, ] [[package]] @@ -42,58 +42,58 @@ source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "markupsafe" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/df/bf/f7da0350254c0ed7c72f3e33cef02e048281fec7ecec5f032d4aac52226b/jinja2-3.1.6.tar.gz", hash = "sha256:0137fb05990d35f1275a587e9aee6d56da821fc83491a0fb838183be43f66d6d", size = 245115, upload-time = "2025-03-05T20:05:02.478Z" } +sdist = { url = "https://files.pythonhosted.org/packages/df/bf/f7da0350254c0ed7c72f3e33cef02e048281fec7ecec5f032d4aac52226b/jinja2-3.1.6.tar.gz", hash = "sha256:0137fb05990d35f1275a587e9aee6d56da821fc83491a0fb838183be43f66d6d", size = 245115, upload_time = "2025-03-05T20:05:02.478Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/62/a1/3d680cbfd5f4b8f15abc1d571870c5fc3e594bb582bc3b64ea099db13e56/jinja2-3.1.6-py3-none-any.whl", hash = "sha256:85ece4451f492d0c13c5dd7c13a64681a86afae63a5f347908daf103ce6d2f67", size = 134899, upload-time = "2025-03-05T20:05:00.369Z" }, + { url = "https://files.pythonhosted.org/packages/62/a1/3d680cbfd5f4b8f15abc1d571870c5fc3e594bb582bc3b64ea099db13e56/jinja2-3.1.6-py3-none-any.whl", hash = "sha256:85ece4451f492d0c13c5dd7c13a64681a86afae63a5f347908daf103ce6d2f67", size = 134899, upload_time = "2025-03-05T20:05:00.369Z" }, ] [[package]] name = "librt" version = "0.11.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/40/08/9e7f6b5d2b5bed6ad055cdd5925f192bb403a51280f86b56554d9d0699a2/librt-0.11.0.tar.gz", hash = "sha256:075dc3ef4458a278e0195cbf6ac9d38808d9b906c5a6c7f7f79c3888276a3fb1", size = 200139, upload-time = "2026-05-10T18:17:25.138Z" } +sdist = { url = "https://files.pythonhosted.org/packages/40/08/9e7f6b5d2b5bed6ad055cdd5925f192bb403a51280f86b56554d9d0699a2/librt-0.11.0.tar.gz", hash = "sha256:075dc3ef4458a278e0195cbf6ac9d38808d9b906c5a6c7f7f79c3888276a3fb1", size = 200139, upload_time = "2026-05-10T18:17:25.138Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/8b/d0/07c77e067f0838949b43bd89232c29d72efebb9d2801a9750184eb706b71/librt-0.11.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:b87504f1690a23b9a2cca841191a04f83895d4fc2dd04df91d82b1a04ca2ad46", size = 144147, upload-time = "2026-05-10T18:15:53.227Z" }, - { url = "https://files.pythonhosted.org/packages/7a/24/8493538fa4f62f982686398a5b8f68008138a75086abdea19ade64bf4255/librt-0.11.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:40071fc5fe0ce8daa6de616702314a01e1250711682b0523d6ab8d4525910cb3", size = 143614, upload-time = "2026-05-10T18:15:54.657Z" }, - { url = "https://files.pythonhosted.org/packages/ff/1e/f8bad050810d9171f34a1648ed910e56814c2ba61639f2bd53c6377ae24b/librt-0.11.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:137e79445c896a0ea7b265f52d23954e05b64222ee1af69e2cb34219067cbb67", size = 485538, upload-time = "2026-05-10T18:15:56.117Z" }, - { url = "https://files.pythonhosted.org/packages/c0/fe/3594ebfbaf03084ba4b120c9ba5c3183fd938a48725e9bbe6ff0a5159ad8/librt-0.11.0-cp312-cp312-manylinux2014_i686.manylinux_2_17_i686.manylinux_2_28_i686.whl", hash = "sha256:cca6644054e78746d8d4ef238681f9c34ff8b584fe6b988ecebb8db3b15e622a", size = 479623, upload-time = "2026-05-10T18:15:57.544Z" }, - { url = "https://files.pythonhosted.org/packages/b0/da/5d1876984b3746c85dbd219dbfcb73c85f54ee263fd32e5b2a632ec14571/librt-0.11.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d5b0eea49f5562861ee8d757a32ef7d559c1d35be2aaaa1ec28941d74c9ffc8a", size = 513082, upload-time = "2026-05-10T18:15:58.805Z" }, - { url = "https://files.pythonhosted.org/packages/19/6e/55bdf5d5ca00c3e18430690bf2c953d8d3ffd3c337418173d33dec985dc9/librt-0.11.0-cp312-cp312-manylinux_2_34_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:0d1029d7e1ae1a7e647ed6fb5df8c4ce2dffefb7a9f5fd1376a4554d96dac09f", size = 508105, upload-time = "2026-05-10T18:16:00.2Z" }, - { url = "https://files.pythonhosted.org/packages/07/10/f1f23a7c595ee90ece4d35c851e5d104b1311a887ed1b4ac4c35bbd13da8/librt-0.11.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:bc3ce6b33c5828d9e80592011a5c584cb2ce86edbc4088405f70da47dc1d1b3b", size = 522268, upload-time = "2026-05-10T18:16:01.708Z" }, - { url = "https://files.pythonhosted.org/packages/b6/02/5720f5697a7f54b78b3aefbe20df3a48cedcff1276618c4aa481177942ed/librt-0.11.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:936c5995f3514a42111f20099397d8177c79b4d7e70961e396c6f5a0a3566766", size = 527348, upload-time = "2026-05-10T18:16:03.496Z" }, - { url = "https://files.pythonhosted.org/packages/50/db/b4a47c6f91db4ff76348a0b3dd0cc65e090a078b765a810a62ff9434c3d3/librt-0.11.0-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:9bc0ca6ad9381cbe8e4aa6e5726e4c80c78115a6e9723c599ed1d73e092bc49d", size = 516294, upload-time = "2026-05-10T18:16:05.173Z" }, - { url = "https://files.pythonhosted.org/packages/9e/58/9384b2f4eb1ed1d273d40948a7c5c4b2360213b402ef3be4641c06299f9c/librt-0.11.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:070aa8c26c0a74774317a72df8851facc7f0f012a5b406557ac56992d92e1ec8", size = 553608, upload-time = "2026-05-10T18:16:06.839Z" }, - { url = "https://files.pythonhosted.org/packages/21/7b/5aa8848a7c6a9278c79375146da1812e695754ceec5f005e6043461a7315/librt-0.11.0-cp312-cp312-win32.whl", hash = "sha256:6bf14feb84b05ae945277395451998c89c54d0def4070eb5c08de544930b245a", size = 101879, upload-time = "2026-05-10T18:16:08.103Z" }, - { url = "https://files.pythonhosted.org/packages/37/33/8a745436944947575b584231750a41417de1a38cf6a2e9251d1065651c09/librt-0.11.0-cp312-cp312-win_amd64.whl", hash = "sha256:75672f0bc524ede266287d532d7923dbce94c7514ad07627bac3d0c6d92cc4d9", size = 119831, upload-time = "2026-05-10T18:16:09.174Z" }, - { url = "https://files.pythonhosted.org/packages/59/67/a6739ac96e28b7855808bdb0370e250606104a859750d209e5a0716fe7ab/librt-0.11.0-cp312-cp312-win_arm64.whl", hash = "sha256:2f10cf143e4a9bb0f4f5af568a00df94a2d69ef41c2579584454bb0fe5cc642c", size = 103470, upload-time = "2026-05-10T18:16:10.369Z" }, + { url = "https://files.pythonhosted.org/packages/8b/d0/07c77e067f0838949b43bd89232c29d72efebb9d2801a9750184eb706b71/librt-0.11.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:b87504f1690a23b9a2cca841191a04f83895d4fc2dd04df91d82b1a04ca2ad46", size = 144147, upload_time = "2026-05-10T18:15:53.227Z" }, + { url = "https://files.pythonhosted.org/packages/7a/24/8493538fa4f62f982686398a5b8f68008138a75086abdea19ade64bf4255/librt-0.11.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:40071fc5fe0ce8daa6de616702314a01e1250711682b0523d6ab8d4525910cb3", size = 143614, upload_time = "2026-05-10T18:15:54.657Z" }, + { url = "https://files.pythonhosted.org/packages/ff/1e/f8bad050810d9171f34a1648ed910e56814c2ba61639f2bd53c6377ae24b/librt-0.11.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:137e79445c896a0ea7b265f52d23954e05b64222ee1af69e2cb34219067cbb67", size = 485538, upload_time = "2026-05-10T18:15:56.117Z" }, + { url = "https://files.pythonhosted.org/packages/c0/fe/3594ebfbaf03084ba4b120c9ba5c3183fd938a48725e9bbe6ff0a5159ad8/librt-0.11.0-cp312-cp312-manylinux2014_i686.manylinux_2_17_i686.manylinux_2_28_i686.whl", hash = "sha256:cca6644054e78746d8d4ef238681f9c34ff8b584fe6b988ecebb8db3b15e622a", size = 479623, upload_time = "2026-05-10T18:15:57.544Z" }, + { url = "https://files.pythonhosted.org/packages/b0/da/5d1876984b3746c85dbd219dbfcb73c85f54ee263fd32e5b2a632ec14571/librt-0.11.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d5b0eea49f5562861ee8d757a32ef7d559c1d35be2aaaa1ec28941d74c9ffc8a", size = 513082, upload_time = "2026-05-10T18:15:58.805Z" }, + { url = "https://files.pythonhosted.org/packages/19/6e/55bdf5d5ca00c3e18430690bf2c953d8d3ffd3c337418173d33dec985dc9/librt-0.11.0-cp312-cp312-manylinux_2_34_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:0d1029d7e1ae1a7e647ed6fb5df8c4ce2dffefb7a9f5fd1376a4554d96dac09f", size = 508105, upload_time = "2026-05-10T18:16:00.2Z" }, + { url = "https://files.pythonhosted.org/packages/07/10/f1f23a7c595ee90ece4d35c851e5d104b1311a887ed1b4ac4c35bbd13da8/librt-0.11.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:bc3ce6b33c5828d9e80592011a5c584cb2ce86edbc4088405f70da47dc1d1b3b", size = 522268, upload_time = "2026-05-10T18:16:01.708Z" }, + { url = "https://files.pythonhosted.org/packages/b6/02/5720f5697a7f54b78b3aefbe20df3a48cedcff1276618c4aa481177942ed/librt-0.11.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:936c5995f3514a42111f20099397d8177c79b4d7e70961e396c6f5a0a3566766", size = 527348, upload_time = "2026-05-10T18:16:03.496Z" }, + { url = "https://files.pythonhosted.org/packages/50/db/b4a47c6f91db4ff76348a0b3dd0cc65e090a078b765a810a62ff9434c3d3/librt-0.11.0-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:9bc0ca6ad9381cbe8e4aa6e5726e4c80c78115a6e9723c599ed1d73e092bc49d", size = 516294, upload_time = "2026-05-10T18:16:05.173Z" }, + { url = "https://files.pythonhosted.org/packages/9e/58/9384b2f4eb1ed1d273d40948a7c5c4b2360213b402ef3be4641c06299f9c/librt-0.11.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:070aa8c26c0a74774317a72df8851facc7f0f012a5b406557ac56992d92e1ec8", size = 553608, upload_time = "2026-05-10T18:16:06.839Z" }, + { url = "https://files.pythonhosted.org/packages/21/7b/5aa8848a7c6a9278c79375146da1812e695754ceec5f005e6043461a7315/librt-0.11.0-cp312-cp312-win32.whl", hash = "sha256:6bf14feb84b05ae945277395451998c89c54d0def4070eb5c08de544930b245a", size = 101879, upload_time = "2026-05-10T18:16:08.103Z" }, + { url = "https://files.pythonhosted.org/packages/37/33/8a745436944947575b584231750a41417de1a38cf6a2e9251d1065651c09/librt-0.11.0-cp312-cp312-win_amd64.whl", hash = "sha256:75672f0bc524ede266287d532d7923dbce94c7514ad07627bac3d0c6d92cc4d9", size = 119831, upload_time = "2026-05-10T18:16:09.174Z" }, + { url = "https://files.pythonhosted.org/packages/59/67/a6739ac96e28b7855808bdb0370e250606104a859750d209e5a0716fe7ab/librt-0.11.0-cp312-cp312-win_arm64.whl", hash = "sha256:2f10cf143e4a9bb0f4f5af568a00df94a2d69ef41c2579584454bb0fe5cc642c", size = 103470, upload_time = "2026-05-10T18:16:10.369Z" }, ] [[package]] name = "markdown" version = "3.10.2" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/2b/f4/69fa6ed85ae003c2378ffa8f6d2e3234662abd02c10d216c0ba96081a238/markdown-3.10.2.tar.gz", hash = "sha256:994d51325d25ad8aa7ce4ebaec003febcce822c3f8c911e3b17c52f7f589f950", size = 368805, upload-time = "2026-02-09T14:57:26.942Z" } +sdist = { url = "https://files.pythonhosted.org/packages/2b/f4/69fa6ed85ae003c2378ffa8f6d2e3234662abd02c10d216c0ba96081a238/markdown-3.10.2.tar.gz", hash = "sha256:994d51325d25ad8aa7ce4ebaec003febcce822c3f8c911e3b17c52f7f589f950", size = 368805, upload_time = "2026-02-09T14:57:26.942Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/de/1f/77fa3081e4f66ca3576c896ae5d31c3002ac6607f9747d2e3aa49227e464/markdown-3.10.2-py3-none-any.whl", hash = "sha256:e91464b71ae3ee7afd3017d9f358ef0baf158fd9a298db92f1d4761133824c36", size = 108180, upload-time = "2026-02-09T14:57:25.787Z" }, + { url = "https://files.pythonhosted.org/packages/de/1f/77fa3081e4f66ca3576c896ae5d31c3002ac6607f9747d2e3aa49227e464/markdown-3.10.2-py3-none-any.whl", hash = "sha256:e91464b71ae3ee7afd3017d9f358ef0baf158fd9a298db92f1d4761133824c36", size = 108180, upload_time = "2026-02-09T14:57:25.787Z" }, ] [[package]] name = "markupsafe" version = "3.0.3" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/7e/99/7690b6d4034fffd95959cbe0c02de8deb3098cc577c67bb6a24fe5d7caa7/markupsafe-3.0.3.tar.gz", hash = "sha256:722695808f4b6457b320fdc131280796bdceb04ab50fe1795cd540799ebe1698", size = 80313, upload-time = "2025-09-27T18:37:40.426Z" } +sdist = { url = "https://files.pythonhosted.org/packages/7e/99/7690b6d4034fffd95959cbe0c02de8deb3098cc577c67bb6a24fe5d7caa7/markupsafe-3.0.3.tar.gz", hash = "sha256:722695808f4b6457b320fdc131280796bdceb04ab50fe1795cd540799ebe1698", size = 80313, upload_time = "2025-09-27T18:37:40.426Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/5a/72/147da192e38635ada20e0a2e1a51cf8823d2119ce8883f7053879c2199b5/markupsafe-3.0.3-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:d53197da72cc091b024dd97249dfc7794d6a56530370992a5e1a08983ad9230e", size = 11615, upload-time = "2025-09-27T18:36:30.854Z" }, - { url = "https://files.pythonhosted.org/packages/9a/81/7e4e08678a1f98521201c3079f77db69fb552acd56067661f8c2f534a718/markupsafe-3.0.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:1872df69a4de6aead3491198eaf13810b565bdbeec3ae2dc8780f14458ec73ce", size = 12020, upload-time = "2025-09-27T18:36:31.971Z" }, - { url = "https://files.pythonhosted.org/packages/1e/2c/799f4742efc39633a1b54a92eec4082e4f815314869865d876824c257c1e/markupsafe-3.0.3-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:3a7e8ae81ae39e62a41ec302f972ba6ae23a5c5396c8e60113e9066ef893da0d", size = 24332, upload-time = "2025-09-27T18:36:32.813Z" }, - { url = "https://files.pythonhosted.org/packages/3c/2e/8d0c2ab90a8c1d9a24f0399058ab8519a3279d1bd4289511d74e909f060e/markupsafe-3.0.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d6dd0be5b5b189d31db7cda48b91d7e0a9795f31430b7f271219ab30f1d3ac9d", size = 22947, upload-time = "2025-09-27T18:36:33.86Z" }, - { url = "https://files.pythonhosted.org/packages/2c/54/887f3092a85238093a0b2154bd629c89444f395618842e8b0c41783898ea/markupsafe-3.0.3-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:94c6f0bb423f739146aec64595853541634bde58b2135f27f61c1ffd1cd4d16a", size = 21962, upload-time = "2025-09-27T18:36:35.099Z" }, - { url = "https://files.pythonhosted.org/packages/c9/2f/336b8c7b6f4a4d95e91119dc8521402461b74a485558d8f238a68312f11c/markupsafe-3.0.3-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:be8813b57049a7dc738189df53d69395eba14fb99345e0a5994914a3864c8a4b", size = 23760, upload-time = "2025-09-27T18:36:36.001Z" }, - { url = "https://files.pythonhosted.org/packages/32/43/67935f2b7e4982ffb50a4d169b724d74b62a3964bc1a9a527f5ac4f1ee2b/markupsafe-3.0.3-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:83891d0e9fb81a825d9a6d61e3f07550ca70a076484292a70fde82c4b807286f", size = 21529, upload-time = "2025-09-27T18:36:36.906Z" }, - { url = "https://files.pythonhosted.org/packages/89/e0/4486f11e51bbba8b0c041098859e869e304d1c261e59244baa3d295d47b7/markupsafe-3.0.3-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:77f0643abe7495da77fb436f50f8dab76dbc6e5fd25d39589a0f1fe6548bfa2b", size = 23015, upload-time = "2025-09-27T18:36:37.868Z" }, - { url = "https://files.pythonhosted.org/packages/2f/e1/78ee7a023dac597a5825441ebd17170785a9dab23de95d2c7508ade94e0e/markupsafe-3.0.3-cp312-cp312-win32.whl", hash = "sha256:d88b440e37a16e651bda4c7c2b930eb586fd15ca7406cb39e211fcff3bf3017d", size = 14540, upload-time = "2025-09-27T18:36:38.761Z" }, - { url = "https://files.pythonhosted.org/packages/aa/5b/bec5aa9bbbb2c946ca2733ef9c4ca91c91b6a24580193e891b5f7dbe8e1e/markupsafe-3.0.3-cp312-cp312-win_amd64.whl", hash = "sha256:26a5784ded40c9e318cfc2bdb30fe164bdb8665ded9cd64d500a34fb42067b1c", size = 15105, upload-time = "2025-09-27T18:36:39.701Z" }, - { url = "https://files.pythonhosted.org/packages/e5/f1/216fc1bbfd74011693a4fd837e7026152e89c4bcf3e77b6692fba9923123/markupsafe-3.0.3-cp312-cp312-win_arm64.whl", hash = "sha256:35add3b638a5d900e807944a078b51922212fb3dedb01633a8defc4b01a3c85f", size = 13906, upload-time = "2025-09-27T18:36:40.689Z" }, + { url = "https://files.pythonhosted.org/packages/5a/72/147da192e38635ada20e0a2e1a51cf8823d2119ce8883f7053879c2199b5/markupsafe-3.0.3-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:d53197da72cc091b024dd97249dfc7794d6a56530370992a5e1a08983ad9230e", size = 11615, upload_time = "2025-09-27T18:36:30.854Z" }, + { url = "https://files.pythonhosted.org/packages/9a/81/7e4e08678a1f98521201c3079f77db69fb552acd56067661f8c2f534a718/markupsafe-3.0.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:1872df69a4de6aead3491198eaf13810b565bdbeec3ae2dc8780f14458ec73ce", size = 12020, upload_time = "2025-09-27T18:36:31.971Z" }, + { url = "https://files.pythonhosted.org/packages/1e/2c/799f4742efc39633a1b54a92eec4082e4f815314869865d876824c257c1e/markupsafe-3.0.3-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:3a7e8ae81ae39e62a41ec302f972ba6ae23a5c5396c8e60113e9066ef893da0d", size = 24332, upload_time = "2025-09-27T18:36:32.813Z" }, + { url = "https://files.pythonhosted.org/packages/3c/2e/8d0c2ab90a8c1d9a24f0399058ab8519a3279d1bd4289511d74e909f060e/markupsafe-3.0.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d6dd0be5b5b189d31db7cda48b91d7e0a9795f31430b7f271219ab30f1d3ac9d", size = 22947, upload_time = "2025-09-27T18:36:33.86Z" }, + { url = "https://files.pythonhosted.org/packages/2c/54/887f3092a85238093a0b2154bd629c89444f395618842e8b0c41783898ea/markupsafe-3.0.3-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:94c6f0bb423f739146aec64595853541634bde58b2135f27f61c1ffd1cd4d16a", size = 21962, upload_time = "2025-09-27T18:36:35.099Z" }, + { url = "https://files.pythonhosted.org/packages/c9/2f/336b8c7b6f4a4d95e91119dc8521402461b74a485558d8f238a68312f11c/markupsafe-3.0.3-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:be8813b57049a7dc738189df53d69395eba14fb99345e0a5994914a3864c8a4b", size = 23760, upload_time = "2025-09-27T18:36:36.001Z" }, + { url = "https://files.pythonhosted.org/packages/32/43/67935f2b7e4982ffb50a4d169b724d74b62a3964bc1a9a527f5ac4f1ee2b/markupsafe-3.0.3-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:83891d0e9fb81a825d9a6d61e3f07550ca70a076484292a70fde82c4b807286f", size = 21529, upload_time = "2025-09-27T18:36:36.906Z" }, + { url = "https://files.pythonhosted.org/packages/89/e0/4486f11e51bbba8b0c041098859e869e304d1c261e59244baa3d295d47b7/markupsafe-3.0.3-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:77f0643abe7495da77fb436f50f8dab76dbc6e5fd25d39589a0f1fe6548bfa2b", size = 23015, upload_time = "2025-09-27T18:36:37.868Z" }, + { url = "https://files.pythonhosted.org/packages/2f/e1/78ee7a023dac597a5825441ebd17170785a9dab23de95d2c7508ade94e0e/markupsafe-3.0.3-cp312-cp312-win32.whl", hash = "sha256:d88b440e37a16e651bda4c7c2b930eb586fd15ca7406cb39e211fcff3bf3017d", size = 14540, upload_time = "2025-09-27T18:36:38.761Z" }, + { url = "https://files.pythonhosted.org/packages/aa/5b/bec5aa9bbbb2c946ca2733ef9c4ca91c91b6a24580193e891b5f7dbe8e1e/markupsafe-3.0.3-cp312-cp312-win_amd64.whl", hash = "sha256:26a5784ded40c9e318cfc2bdb30fe164bdb8665ded9cd64d500a34fb42067b1c", size = 15105, upload_time = "2025-09-27T18:36:39.701Z" }, + { url = "https://files.pythonhosted.org/packages/e5/f1/216fc1bbfd74011693a4fd837e7026152e89c4bcf3e77b6692fba9923123/markupsafe-3.0.3-cp312-cp312-win_arm64.whl", hash = "sha256:35add3b638a5d900e807944a078b51922212fb3dedb01633a8defc4b01a3c85f", size = 13906, upload_time = "2025-09-27T18:36:40.689Z" }, ] [[package]] @@ -107,43 +107,43 @@ dependencies = [ { name = "pathspec" }, { name = "typing-extensions" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/82/15/cca9d88503549ed6fedeaa1d448cdddd542ee8a490232d732e278036fbf2/mypy-2.1.0.tar.gz", hash = "sha256:81e76ad12c2d804512e9b13240d1588316531bfba07558286078bfbce9613633", size = 3898359, upload-time = "2026-05-11T18:37:36.237Z" } +sdist = { url = "https://files.pythonhosted.org/packages/82/15/cca9d88503549ed6fedeaa1d448cdddd542ee8a490232d732e278036fbf2/mypy-2.1.0.tar.gz", hash = "sha256:81e76ad12c2d804512e9b13240d1588316531bfba07558286078bfbce9613633", size = 3898359, upload_time = "2026-05-11T18:37:36.237Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/95/b1/55861beb5c339b44f9a2ba92df9e2cb1eeb4ae1eee674cdf7772c797778b/mypy-2.1.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:244358bf1c0da7722230bce60683d52e8e9fd030554926f15b747a84efb5b3af", size = 14874381, upload-time = "2026-05-11T18:37:31.784Z" }, - { url = "https://files.pythonhosted.org/packages/0b/b3/b7f770114b7d0ac92d0f76e8d93c2780844a70488a90e91821927850da86/mypy-2.1.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:4ec7c57657493c7a75534df2751c8ae2cda383c16ecc55d2106c54476b1b16f6", size = 13665501, upload-time = "2026-05-11T18:34:23.063Z" }, - { url = "https://files.pythonhosted.org/packages/b6/f3/8ae2037967e2126689a0c11d99e2b707134a565191e92c60ca2572aec60a/mypy-2.1.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:d8161b6ff4392410023224f0969d17db93e1e154bc3e4ba62598e720723ae211", size = 14045750, upload-time = "2026-05-11T18:31:48.151Z" }, - { url = "https://files.pythonhosted.org/packages/a0/32/615eb5911859e43d054941b0d0a7d06cfa2870eba86529cf385b052b111c/mypy-2.1.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:bf03e12003084a67395184d3eb8cbd6a489dc3655b5664b28c210a9e2403ab0b", size = 15061630, upload-time = "2026-05-11T18:37:06.898Z" }, - { url = "https://files.pythonhosted.org/packages/d4/03/4eafbfff8bfab1b87082741eae6e6a624028c984e6708b73bce2a8570c9d/mypy-2.1.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:20509760fd791c51579d573153407d226385ec1f8bcce55d730b354f3336bc22", size = 15288831, upload-time = "2026-05-11T18:31:18.07Z" }, - { url = "https://files.pythonhosted.org/packages/99/ee/919661478e5891a3c96e549c036e467e64563ab85995b10c53c8358e16a3/mypy-2.1.0-cp312-cp312-win_amd64.whl", hash = "sha256:6753d0c1fdd6b1a23b9e4f283ce80b2153b724adcb2653b20b85a8a28ac6436b", size = 11135228, upload-time = "2026-05-11T18:34:31.23Z" }, - { url = "https://files.pythonhosted.org/packages/24/0a/6a12b9782ca0831a553192f351679f4548abc9d19a7cc93bb7feb02084c7/mypy-2.1.0-cp312-cp312-win_arm64.whl", hash = "sha256:98ebb6589bb3b6d0c6f0c459d53ca55b8091fbc13d277c4041c885392e8195e8", size = 10040684, upload-time = "2026-05-11T18:36:48.199Z" }, - { url = "https://files.pythonhosted.org/packages/0d/2a/13ca1f292f6db1b98ff495ef3467736b331621c5917cad984b7043e7348d/mypy-2.1.0-py3-none-any.whl", hash = "sha256:a663814603a5c563fb87a4f96fb473eeb30d1f5a4885afcf44f9db000a366289", size = 2693302, upload-time = "2026-05-11T18:31:29.246Z" }, + { url = "https://files.pythonhosted.org/packages/95/b1/55861beb5c339b44f9a2ba92df9e2cb1eeb4ae1eee674cdf7772c797778b/mypy-2.1.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:244358bf1c0da7722230bce60683d52e8e9fd030554926f15b747a84efb5b3af", size = 14874381, upload_time = "2026-05-11T18:37:31.784Z" }, + { url = "https://files.pythonhosted.org/packages/0b/b3/b7f770114b7d0ac92d0f76e8d93c2780844a70488a90e91821927850da86/mypy-2.1.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:4ec7c57657493c7a75534df2751c8ae2cda383c16ecc55d2106c54476b1b16f6", size = 13665501, upload_time = "2026-05-11T18:34:23.063Z" }, + { url = "https://files.pythonhosted.org/packages/b6/f3/8ae2037967e2126689a0c11d99e2b707134a565191e92c60ca2572aec60a/mypy-2.1.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:d8161b6ff4392410023224f0969d17db93e1e154bc3e4ba62598e720723ae211", size = 14045750, upload_time = "2026-05-11T18:31:48.151Z" }, + { url = "https://files.pythonhosted.org/packages/a0/32/615eb5911859e43d054941b0d0a7d06cfa2870eba86529cf385b052b111c/mypy-2.1.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:bf03e12003084a67395184d3eb8cbd6a489dc3655b5664b28c210a9e2403ab0b", size = 15061630, upload_time = "2026-05-11T18:37:06.898Z" }, + { url = "https://files.pythonhosted.org/packages/d4/03/4eafbfff8bfab1b87082741eae6e6a624028c984e6708b73bce2a8570c9d/mypy-2.1.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:20509760fd791c51579d573153407d226385ec1f8bcce55d730b354f3336bc22", size = 15288831, upload_time = "2026-05-11T18:31:18.07Z" }, + { url = "https://files.pythonhosted.org/packages/99/ee/919661478e5891a3c96e549c036e467e64563ab85995b10c53c8358e16a3/mypy-2.1.0-cp312-cp312-win_amd64.whl", hash = "sha256:6753d0c1fdd6b1a23b9e4f283ce80b2153b724adcb2653b20b85a8a28ac6436b", size = 11135228, upload_time = "2026-05-11T18:34:31.23Z" }, + { url = "https://files.pythonhosted.org/packages/24/0a/6a12b9782ca0831a553192f351679f4548abc9d19a7cc93bb7feb02084c7/mypy-2.1.0-cp312-cp312-win_arm64.whl", hash = "sha256:98ebb6589bb3b6d0c6f0c459d53ca55b8091fbc13d277c4041c885392e8195e8", size = 10040684, upload_time = "2026-05-11T18:36:48.199Z" }, + { url = "https://files.pythonhosted.org/packages/0d/2a/13ca1f292f6db1b98ff495ef3467736b331621c5917cad984b7043e7348d/mypy-2.1.0-py3-none-any.whl", hash = "sha256:a663814603a5c563fb87a4f96fb473eeb30d1f5a4885afcf44f9db000a366289", size = 2693302, upload_time = "2026-05-11T18:31:29.246Z" }, ] [[package]] name = "mypy-extensions" version = "1.1.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/a2/6e/371856a3fb9d31ca8dac321cda606860fa4548858c0cc45d9d1d4ca2628b/mypy_extensions-1.1.0.tar.gz", hash = "sha256:52e68efc3284861e772bbcd66823fde5ae21fd2fdb51c62a211403730b916558", size = 6343, upload-time = "2025-04-22T14:54:24.164Z" } +sdist = { url = "https://files.pythonhosted.org/packages/a2/6e/371856a3fb9d31ca8dac321cda606860fa4548858c0cc45d9d1d4ca2628b/mypy_extensions-1.1.0.tar.gz", hash = "sha256:52e68efc3284861e772bbcd66823fde5ae21fd2fdb51c62a211403730b916558", size = 6343, upload_time = "2025-04-22T14:54:24.164Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/79/7b/2c79738432f5c924bef5071f933bcc9efd0473bac3b4aa584a6f7c1c8df8/mypy_extensions-1.1.0-py3-none-any.whl", hash = "sha256:1be4cccdb0f2482337c4743e60421de3a356cd97508abadd57d47403e94f5505", size = 4963, upload-time = "2025-04-22T14:54:22.983Z" }, + { url = "https://files.pythonhosted.org/packages/79/7b/2c79738432f5c924bef5071f933bcc9efd0473bac3b4aa584a6f7c1c8df8/mypy_extensions-1.1.0-py3-none-any.whl", hash = "sha256:1be4cccdb0f2482337c4743e60421de3a356cd97508abadd57d47403e94f5505", size = 4963, upload_time = "2025-04-22T14:54:22.983Z" }, ] [[package]] name = "nodeenv" version = "1.10.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/24/bf/d1bda4f6168e0b2e9e5958945e01910052158313224ada5ce1fb2e1113b8/nodeenv-1.10.0.tar.gz", hash = "sha256:996c191ad80897d076bdfba80a41994c2b47c68e224c542b48feba42ba00f8bb", size = 55611, upload-time = "2025-12-20T14:08:54.006Z" } +sdist = { url = "https://files.pythonhosted.org/packages/24/bf/d1bda4f6168e0b2e9e5958945e01910052158313224ada5ce1fb2e1113b8/nodeenv-1.10.0.tar.gz", hash = "sha256:996c191ad80897d076bdfba80a41994c2b47c68e224c542b48feba42ba00f8bb", size = 55611, upload_time = "2025-12-20T14:08:54.006Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/88/b2/d0896bdcdc8d28a7fc5717c305f1a861c26e18c05047949fb371034d98bd/nodeenv-1.10.0-py2.py3-none-any.whl", hash = "sha256:5bb13e3eed2923615535339b3c620e76779af4cb4c6a90deccc9e36b274d3827", size = 23438, upload-time = "2025-12-20T14:08:52.782Z" }, + { url = "https://files.pythonhosted.org/packages/88/b2/d0896bdcdc8d28a7fc5717c305f1a861c26e18c05047949fb371034d98bd/nodeenv-1.10.0-py2.py3-none-any.whl", hash = "sha256:5bb13e3eed2923615535339b3c620e76779af4cb4c6a90deccc9e36b274d3827", size = 23438, upload_time = "2025-12-20T14:08:52.782Z" }, ] [[package]] name = "pathspec" version = "1.0.4" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/fa/36/e27608899f9b8d4dff0617b2d9ab17ca5608956ca44461ac14ac48b44015/pathspec-1.0.4.tar.gz", hash = "sha256:0210e2ae8a21a9137c0d470578cb0e595af87edaa6ebf12ff176f14a02e0e645", size = 131200, upload-time = "2026-01-27T03:59:46.938Z" } +sdist = { url = "https://files.pythonhosted.org/packages/fa/36/e27608899f9b8d4dff0617b2d9ab17ca5608956ca44461ac14ac48b44015/pathspec-1.0.4.tar.gz", hash = "sha256:0210e2ae8a21a9137c0d470578cb0e595af87edaa6ebf12ff176f14a02e0e645", size = 131200, upload_time = "2026-01-27T03:59:46.938Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/ef/3c/2c197d226f9ea224a9ab8d197933f9da0ae0aac5b6e0f884e2b8d9c8e9f7/pathspec-1.0.4-py3-none-any.whl", hash = "sha256:fb6ae2fd4e7c921a165808a552060e722767cfa526f99ca5156ed2ce45a5c723", size = 55206, upload-time = "2026-01-27T03:59:45.137Z" }, + { url = "https://files.pythonhosted.org/packages/ef/3c/2c197d226f9ea224a9ab8d197933f9da0ae0aac5b6e0f884e2b8d9c8e9f7/pathspec-1.0.4-py3-none-any.whl", hash = "sha256:fb6ae2fd4e7c921a165808a552060e722767cfa526f99ca5156ed2ce45a5c723", size = 55206, upload_time = "2026-01-27T03:59:45.137Z" }, ] [[package]] @@ -154,28 +154,28 @@ dependencies = [ { name = "typeshed-client" }, { name = "typing-extensions" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/7c/8e/284fdc4027bf9a7c92f8256ff07006a50456ccd2ce5506d040e6ed2f2f1b/pycroscope-0.4.0.tar.gz", hash = "sha256:14b40e36f6186dd2eff712c8da91d02eb89a263a257472b49f4c59153ff380fb", size = 662901, upload-time = "2026-05-02T14:00:43.775Z" } +sdist = { url = "https://files.pythonhosted.org/packages/7c/8e/284fdc4027bf9a7c92f8256ff07006a50456ccd2ce5506d040e6ed2f2f1b/pycroscope-0.4.0.tar.gz", hash = "sha256:14b40e36f6186dd2eff712c8da91d02eb89a263a257472b49f4c59153ff380fb", size = 662901, upload_time = "2026-05-02T14:00:43.775Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/50/5f/c172c08b69e29d4094e1466b63260d8daf61a3ed3c689de7936f952f1663/pycroscope-0.4.0-py3-none-any.whl", hash = "sha256:cb7440b44ed16ed927995c33867cab22503f4bff7efe504964b81fb967183223", size = 714256, upload-time = "2026-05-02T14:00:41.891Z" }, + { url = "https://files.pythonhosted.org/packages/50/5f/c172c08b69e29d4094e1466b63260d8daf61a3ed3c689de7936f952f1663/pycroscope-0.4.0-py3-none-any.whl", hash = "sha256:cb7440b44ed16ed927995c33867cab22503f4bff7efe504964b81fb967183223", size = 714256, upload_time = "2026-05-02T14:00:41.891Z" }, ] [[package]] name = "pyrefly" -version = "1.1.0" +version = "1.3.0.dev1" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/01/5f/7e35d7c907f49850194d81e7418b7cbb39e46d0bcb3389799dee09977ddb/pyrefly-1.1.0.tar.gz", hash = "sha256:9429da69592b76b12157f4ce432d41db290759c68f1a96ec9a3933763c32575d", size = 5880100, upload-time = "2026-06-17T16:04:08.584Z" } +sdist = { url = "https://files.pythonhosted.org/packages/a5/de/fe8d8567d1d092f5d67bb8bbe0863a44919482a37febc79db8aa88088532/pyrefly-1.3.0.dev1.tar.gz", hash = "sha256:189e0e1d3212ab4ecff1d058f9e095fa9711e5e4c19436f7370ceef05d1788fd", size = 6306791, upload_time = "2026-08-07T01:56:51.009Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/26/9e/fee499666dcaec819a2fcb486423706fc6736db64396d3f1e8b43aac14c0/pyrefly-1.1.0-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:75c5e501e6014a21df6d4cda7e1e1c7feffdec29326d6ca413de5c26373f060a", size = 13627155, upload-time = "2026-06-17T16:03:37.55Z" }, - { url = "https://files.pythonhosted.org/packages/05/04/deff88f79237062371284326a314fe09fbef5d15244b9ed1a02971b3007b/pyrefly-1.1.0-py3-none-macosx_11_0_arm64.whl", hash = "sha256:ce4a34c5efaf8a2783456ed4ebc1d6ce7a2aa9dabe81b60610c166ecc295ca9d", size = 13070279, upload-time = "2026-06-17T16:03:40.58Z" }, - { url = "https://files.pythonhosted.org/packages/c8/7e/a8346acb33df003200efac4e41b996e9c7e984bf354f59b591c49cb5ea56/pyrefly-1.1.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4ca0c458dda0014408df4fff05cfb9a629ebfdd8c1e51c9ae50b4b8f17090648", size = 13447408, upload-time = "2026-06-17T16:03:42.956Z" }, - { url = "https://files.pythonhosted.org/packages/d4/e7/c1e626df1f7f6eea8458db1692a40a314cdccc0e76ab56bf554d9d1e7f7e/pyrefly-1.1.0-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d51626ea993201f9bde799dd170392d72b8b618f9a93505d9886354397b33545", size = 14450067, upload-time = "2026-06-17T16:03:45.298Z" }, - { url = "https://files.pythonhosted.org/packages/ae/8a/62b6575cfbe476ef564996db4bdd2e5883f7ee9d195a244b5dce5b737ea3/pyrefly-1.1.0-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:911a49b6d4c5819b5d63809f731290a5745c31ba7f239c788e3262cce77a732f", size = 14468763, upload-time = "2026-06-17T16:03:48.474Z" }, - { url = "https://files.pythonhosted.org/packages/ee/0c/d2cd6ac5f911ce8ec63af4157675ab1ca1ef2d56e1a7d0bd40da253e63fc/pyrefly-1.1.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d35634efb8dfc5ec87832d5bfac06f15b6d09ca946835cd4077375b855083bf9", size = 13970748, upload-time = "2026-06-17T16:03:51.754Z" }, - { url = "https://files.pythonhosted.org/packages/ca/08/4e3b9750db7c1f44c413c162742d48ff8419b8c7cda5064d9d9e30c908e6/pyrefly-1.1.0-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:12ddafc2f8fcfb39f8e80625af66e638b918be48f0d791314eb0d9d0ffe6741b", size = 13471921, upload-time = "2026-06-17T16:03:54.783Z" }, - { url = "https://files.pythonhosted.org/packages/6b/93/47cd9e325b64264ab709cb5ae1d383d7eb73da5cb8ff27a1c975f7de1407/pyrefly-1.1.0-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:5574aea21b461415691d0172db15b228f154f88c1885d679560ba9eba9a63b04", size = 13992660, upload-time = "2026-06-17T16:03:57.789Z" }, - { url = "https://files.pythonhosted.org/packages/36/1d/49374250c97941bd78ea1629894f9012b1fdc0c5e16da73a8ccd9f6c5363/pyrefly-1.1.0-py3-none-win32.whl", hash = "sha256:e0a634f984d9218a2cf0b0518c113c189f8909d20654dc139783ce6e0738f31e", size = 12607116, upload-time = "2026-06-17T16:04:00.444Z" }, - { url = "https://files.pythonhosted.org/packages/c7/52/7b0f3c34eb98673d097678f903cdb6b97a55b0cedb26cf118c83c6ea818f/pyrefly-1.1.0-py3-none-win_amd64.whl", hash = "sha256:bb4c41404c4e19fb82d68555174737304be08508703c2c53b3012e62bc693901", size = 13506648, upload-time = "2026-06-17T16:04:03.227Z" }, - { url = "https://files.pythonhosted.org/packages/26/9f/25e57347d9d83db464761ee2bd1f789b999a0fc7c004aeb4e8be1fdb5376/pyrefly-1.1.0-py3-none-win_arm64.whl", hash = "sha256:02acde22b08a40a578bd0b9218d93611d2b0cd3153e077b05c4efeabbaca636b", size = 12898072, upload-time = "2026-06-17T16:04:06.16Z" }, + { url = "https://files.pythonhosted.org/packages/ba/6a/ca1ea8084f000ecbf7d6a2a8cde3f2d6f437d0d527f5f0bda0a383fb011f/pyrefly-1.3.0.dev1-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:327e245a54357794954a7788d22dd446b90dcc403d0d82414b0b20b6fa37648c", size = 14210092, upload_time = "2026-08-07T01:56:17.895Z" }, + { url = "https://files.pythonhosted.org/packages/a2/df/0f405798d99900a6809483db0262c820ccccdf13b379789d9280d848b9a0/pyrefly-1.3.0.dev1-py3-none-macosx_11_0_arm64.whl", hash = "sha256:00e5d88265c5e3088ac566dd4cf542a13f93e76f7672b738c1306d5d5cae6123", size = 13639017, upload_time = "2026-08-07T01:56:21.181Z" }, + { url = "https://files.pythonhosted.org/packages/4b/28/a41e1daab805124cdefc46566251555bbe0caf24668a851393971eb5cbd7/pyrefly-1.3.0.dev1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c2dcce81731dcc0dcd199b6b0117ebd3df2ee1fc4910f508cb84aa7615182f28", size = 14084976, upload_time = "2026-08-07T01:56:24.551Z" }, + { url = "https://files.pythonhosted.org/packages/df/9c/985e6ab05ab7927d5f6eb8420958957b707f8fbdcb012001b967286a46cc/pyrefly-1.3.0.dev1-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:56a855f5784978e990effe760e0eaab60b98a0add9bebb79af901d9a8269696d", size = 15230694, upload_time = "2026-08-07T01:56:27.722Z" }, + { url = "https://files.pythonhosted.org/packages/55/73/1368adde6c6f29bd88d5929211291a17c4cf9bddaafd0a3ab330d463ed10/pyrefly-1.3.0.dev1-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a0e36aede58dffab44a67ac0f322e416d0fa4955c80d491fc7e0fe80c1a73a5d", size = 15170348, upload_time = "2026-08-07T01:56:30.86Z" }, + { url = "https://files.pythonhosted.org/packages/2c/28/172a588415c48b2eb2eccabbfb3e21c5c95ddeb1022ca96b5fde75c5f71a/pyrefly-1.3.0.dev1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fdb58f30ec64ae44268baa58fcf01f0fdfba44c3153591c8b76a16a57df44ee4", size = 14582792, upload_time = "2026-08-07T01:56:34.052Z" }, + { url = "https://files.pythonhosted.org/packages/fa/8f/c7211d118a5dfb08e24655ff5c4414fda0b281de64cf83834da9fd1bbcd2/pyrefly-1.3.0.dev1-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:c4e6e3c80416636666d2a9cbca0fd32dbba51e54da4e7a5a6ba3388bfbacf612", size = 14106287, upload_time = "2026-08-07T01:56:37.073Z" }, + { url = "https://files.pythonhosted.org/packages/d5/f4/642addd2e33daf1cc2357150db5c6ab6a81bd378281203552d5e509c6f02/pyrefly-1.3.0.dev1-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:1672be7086ae54d8dfce02eb612894c3ad51c42e03b4769d0e45a9d9e622d4ed", size = 14617068, upload_time = "2026-08-07T01:56:39.913Z" }, + { url = "https://files.pythonhosted.org/packages/3b/17/e4a7c0f6ded01370f3267058f5bb2a10487d200dc5a29058fbff34aa9820/pyrefly-1.3.0.dev1-py3-none-win32.whl", hash = "sha256:7dd496f3642bba6764f3c4c9f189ef021a30fc05261087316e4d6bb9beace65e", size = 13403475, upload_time = "2026-08-07T01:56:42.782Z" }, + { url = "https://files.pythonhosted.org/packages/61/79/2a366f1b65c177e42f67b8540e7372e258d0880eed957859bbf5b1ff7d0e/pyrefly-1.3.0.dev1-py3-none-win_amd64.whl", hash = "sha256:70baea8d7577be7f50a5dbbf5819f5cb335208e97793846e14d80ebd8f90f6c4", size = 14264341, upload_time = "2026-08-07T01:56:45.772Z" }, + { url = "https://files.pythonhosted.org/packages/c8/f9/abe77e5154b1c56d60831aade2d4b6e9e9d2c458860e5fd9fc30a2fc720e/pyrefly-1.3.0.dev1-py3-none-win_arm64.whl", hash = "sha256:d5070fecbe7b22eaf46b1da510fe5ea3c69b17f805dfbc04753d9501ce24f54e", size = 13607012, upload_time = "2026-08-07T01:56:48.638Z" }, ] [[package]] @@ -186,52 +186,52 @@ dependencies = [ { name = "nodeenv" }, { name = "typing-extensions" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/10/53/e4d8ea1391bd4355231be6f91bf239479aa0014260ed3fb5526eeb12a1f2/pyright-1.1.410.tar.gz", hash = "sha256:07a073b8ba6749826773c1269773efa11b93440d9a6aa60419d9a3172d6dc488", size = 4062013, upload-time = "2026-06-01T17:35:48.894Z" } +sdist = { url = "https://files.pythonhosted.org/packages/10/53/e4d8ea1391bd4355231be6f91bf239479aa0014260ed3fb5526eeb12a1f2/pyright-1.1.410.tar.gz", hash = "sha256:07a073b8ba6749826773c1269773efa11b93440d9a6aa60419d9a3172d6dc488", size = 4062013, upload_time = "2026-06-01T17:35:48.894Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/d7/33/288b5868fa00846dacf249633719d747893e54aebd196b9968ac1878a5d3/pyright-1.1.410-py3-none-any.whl", hash = "sha256:5e961bed37cacf96b3f7cd7b1da39b350a9239aa2e69138d0e88f728cfaf296c", size = 6082448, upload-time = "2026-06-01T17:35:46.387Z" }, + { url = "https://files.pythonhosted.org/packages/d7/33/288b5868fa00846dacf249633719d747893e54aebd196b9968ac1878a5d3/pyright-1.1.410-py3-none-any.whl", hash = "sha256:5e961bed37cacf96b3f7cd7b1da39b350a9239aa2e69138d0e88f728cfaf296c", size = 6082448, upload_time = "2026-06-01T17:35:46.387Z" }, ] [[package]] name = "tomlkit" version = "0.14.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/c3/af/14b24e41977adb296d6bd1fb59402cf7d60ce364f90c890bd2ec65c43b5a/tomlkit-0.14.0.tar.gz", hash = "sha256:cf00efca415dbd57575befb1f6634c4f42d2d87dbba376128adb42c121b87064", size = 187167, upload-time = "2026-01-13T01:14:53.304Z" } +sdist = { url = "https://files.pythonhosted.org/packages/c3/af/14b24e41977adb296d6bd1fb59402cf7d60ce364f90c890bd2ec65c43b5a/tomlkit-0.14.0.tar.gz", hash = "sha256:cf00efca415dbd57575befb1f6634c4f42d2d87dbba376128adb42c121b87064", size = 187167, upload_time = "2026-01-13T01:14:53.304Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/b5/11/87d6d29fb5d237229d67973a6c9e06e048f01cf4994dee194ab0ea841814/tomlkit-0.14.0-py3-none-any.whl", hash = "sha256:592064ed85b40fa213469f81ac584f67a4f2992509a7c3ea2d632208623a3680", size = 39310, upload-time = "2026-01-13T01:14:51.965Z" }, + { url = "https://files.pythonhosted.org/packages/b5/11/87d6d29fb5d237229d67973a6c9e06e048f01cf4994dee194ab0ea841814/tomlkit-0.14.0-py3-none-any.whl", hash = "sha256:592064ed85b40fa213469f81ac584f67a4f2992509a7c3ea2d632208623a3680", size = 39310, upload_time = "2026-01-13T01:14:51.965Z" }, ] [[package]] name = "ty" version = "0.0.67" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/d3/aa/e153d47aef36891729ff2a7dd7350d04df73f81ef8117257b518c771956e/ty-0.0.67.tar.gz", hash = "sha256:8926130a1d5a11b228f72bc6a7680cf4f75be99064dfe3ad161fd3b860999603", size = 6550079, upload-time = "2026-08-05T18:43:21.18Z" } +sdist = { url = "https://files.pythonhosted.org/packages/d3/aa/e153d47aef36891729ff2a7dd7350d04df73f81ef8117257b518c771956e/ty-0.0.67.tar.gz", hash = "sha256:8926130a1d5a11b228f72bc6a7680cf4f75be99064dfe3ad161fd3b860999603", size = 6550079, upload_time = "2026-08-05T18:43:21.18Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/fd/0a/992067ee1bdd30994c0dbdb3674e88a9ea7892dd6008a819c73f9985a1b6/ty-0.0.67-py3-none-linux_armv6l.whl", hash = "sha256:5ad41198feb7d3963f954902d3b33c58b5dc27bd21f4d9cde45dd1ae1ba34677", size = 12353546, upload-time = "2026-08-05T18:42:42.137Z" }, - { url = "https://files.pythonhosted.org/packages/a2/8c/def24d99c4a4e1bfc30ce6d69a913a9bf6bfa8a56fe2b1b3d6bce7e75bdd/ty-0.0.67-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:90f8271d66d0a42bd5f3aab01c51acf70dc7111fe8ffe62c9125a2db1a4f8a55", size = 12023201, upload-time = "2026-08-05T18:42:44.944Z" }, - { url = "https://files.pythonhosted.org/packages/99/11/03c2278fb76f764439045760c11ac7bd407bc534c13138ccc21d60e5d883/ty-0.0.67-py3-none-macosx_11_0_arm64.whl", hash = "sha256:df5d5b4496036fffe3f767691867b57bc67fc2155e9608cb4fcb517dfe4f5761", size = 11522878, upload-time = "2026-08-05T18:42:47.192Z" }, - { url = "https://files.pythonhosted.org/packages/03/47/d4d4e334649db69d7467084aedf02f237b852a8ffba4579d0d193a50dda5/ty-0.0.67-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:de4f90d9152051a697d59f354f30eb76c3e9ec608e2a3c33595bbc88f851ad4e", size = 12093398, upload-time = "2026-08-05T18:42:49.331Z" }, - { url = "https://files.pythonhosted.org/packages/db/24/a551f16dfcd89ff4173757f09f3bb6cb9aa10e6f079c604b949a9c19ba41/ty-0.0.67-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:bccc2361d1f628182ca19b1736c947ca082e7db5f07277a43b316241e07b1350", size = 12141027, upload-time = "2026-08-05T18:42:51.528Z" }, - { url = "https://files.pythonhosted.org/packages/c5/87/9e2baa098b94ea0bce4e3e8b106711a500af50be50519b96e90484e4f4b8/ty-0.0.67-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e0d7eee4a9d7694d64085a8ae12b4d9fc7c162b24e3000befe91737a9a61d1dd", size = 12908208, upload-time = "2026-08-05T18:42:53.844Z" }, - { url = "https://files.pythonhosted.org/packages/42/32/e8c0bfc19cc0a6dbf254933c13b857c2c0c800b86158296d3e4ccdb5702c/ty-0.0.67-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f4309acef52659fb5e030962b60fccd44b4f6b9c19c365738bc5d46a3c138b1e", size = 13404183, upload-time = "2026-08-05T18:42:55.988Z" }, - { url = "https://files.pythonhosted.org/packages/a3/ab/c9faa04a075136741b173058dd81a4070dc0bdf7fe162f8278d61e1b0b3d/ty-0.0.67-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:4daffa097226bcdee4852b61bd05311a49a7286b10042c148450cf6761b287c7", size = 13127241, upload-time = "2026-08-05T18:42:58.826Z" }, - { url = "https://files.pythonhosted.org/packages/a7/e5/47a368bdee8fd8376b6055496b5d2d03650d976b94e924b39332c0861396/ty-0.0.67-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:94b579b8ee3836238b96fb186a99904eea0a56685d6e50f7b54fe530050df07d", size = 12685060, upload-time = "2026-08-05T18:43:01.487Z" }, - { url = "https://files.pythonhosted.org/packages/ce/2d/b78102ca16dd05be36defe18f312deba43606c8870638749908de58b6408/ty-0.0.67-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:3b357d66119c4dc11d7508c40df0338857e470b0041515781effc45ca9211294", size = 12959319, upload-time = "2026-08-05T18:43:03.712Z" }, - { url = "https://files.pythonhosted.org/packages/88/e6/35e5a6d887144463d93c1320558fe6027e02c2cd27658999af04abf56120/ty-0.0.67-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:24043b96d25b9b787b715c08ed7c8bc236cb7800a6fd189967092b9712f523c9", size = 12040267, upload-time = "2026-08-05T18:43:05.91Z" }, - { url = "https://files.pythonhosted.org/packages/69/26/2d81626e029e5fa6a9b03e98141dbf52a6e6b814130e5d7227cbb9b74611/ty-0.0.67-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:4384d7427e1abf5165e010b66d2133d38b2707ef8880eb755de25f2e5b69a3f1", size = 12153207, upload-time = "2026-08-05T18:43:08.039Z" }, - { url = "https://files.pythonhosted.org/packages/df/62/cc61afedad6e8f02303cf2867364d5b30f2f223787c58932870c53e99d65/ty-0.0.67-py3-none-musllinux_1_2_i686.whl", hash = "sha256:761a141c6f6833b62bc5d92558b243adfd11b8084e070aa112c9b7ab9ec90e8b", size = 12446021, upload-time = "2026-08-05T18:43:10.207Z" }, - { url = "https://files.pythonhosted.org/packages/25/c4/8bbc1c641018b4003bb9fdc1a93843055dfa8d771b4d08fb6413b7a94a5a/ty-0.0.67-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:fc80a63d0b9eecc667e16e809d20a1c014668e6be8523db1f7714bc1a84e79c4", size = 12797108, upload-time = "2026-08-05T18:43:12.244Z" }, - { url = "https://files.pythonhosted.org/packages/c9/a4/8b181be30a49f6813822d50e7489eb8fe6287db7f2b635d1de97f82bbf94/ty-0.0.67-py3-none-win32.whl", hash = "sha256:9dc697547cc7972079e77d716b6874fbe7c6e7265d360ba372afdf44f0a103ec", size = 11771788, upload-time = "2026-08-05T18:43:14.375Z" }, - { url = "https://files.pythonhosted.org/packages/a6/bc/948eb72740c23c0ab3bb0a3bb07035e25d7950e862fd987651a8a6f21430/ty-0.0.67-py3-none-win_amd64.whl", hash = "sha256:2c4cdc1dffbfab5476bd708adb90018dd3f8bc796b3608fd60162b6e9c85981a", size = 12818447, upload-time = "2026-08-05T18:43:16.607Z" }, - { url = "https://files.pythonhosted.org/packages/5e/0a/8a2002aed7e4cf7278141984b393b5156e7f42c8aefc9ced9d037a3a3cd9/ty-0.0.67-py3-none-win_arm64.whl", hash = "sha256:6251e59bf4c36486204a0ec3aa758f7b65ef6727f1db7b24b8e90db072ac6eff", size = 12146254, upload-time = "2026-08-05T18:43:18.915Z" }, + { url = "https://files.pythonhosted.org/packages/fd/0a/992067ee1bdd30994c0dbdb3674e88a9ea7892dd6008a819c73f9985a1b6/ty-0.0.67-py3-none-linux_armv6l.whl", hash = "sha256:5ad41198feb7d3963f954902d3b33c58b5dc27bd21f4d9cde45dd1ae1ba34677", size = 12353546, upload_time = "2026-08-05T18:42:42.137Z" }, + { url = "https://files.pythonhosted.org/packages/a2/8c/def24d99c4a4e1bfc30ce6d69a913a9bf6bfa8a56fe2b1b3d6bce7e75bdd/ty-0.0.67-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:90f8271d66d0a42bd5f3aab01c51acf70dc7111fe8ffe62c9125a2db1a4f8a55", size = 12023201, upload_time = "2026-08-05T18:42:44.944Z" }, + { url = "https://files.pythonhosted.org/packages/99/11/03c2278fb76f764439045760c11ac7bd407bc534c13138ccc21d60e5d883/ty-0.0.67-py3-none-macosx_11_0_arm64.whl", hash = "sha256:df5d5b4496036fffe3f767691867b57bc67fc2155e9608cb4fcb517dfe4f5761", size = 11522878, upload_time = "2026-08-05T18:42:47.192Z" }, + { url = "https://files.pythonhosted.org/packages/03/47/d4d4e334649db69d7467084aedf02f237b852a8ffba4579d0d193a50dda5/ty-0.0.67-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:de4f90d9152051a697d59f354f30eb76c3e9ec608e2a3c33595bbc88f851ad4e", size = 12093398, upload_time = "2026-08-05T18:42:49.331Z" }, + { url = "https://files.pythonhosted.org/packages/db/24/a551f16dfcd89ff4173757f09f3bb6cb9aa10e6f079c604b949a9c19ba41/ty-0.0.67-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:bccc2361d1f628182ca19b1736c947ca082e7db5f07277a43b316241e07b1350", size = 12141027, upload_time = "2026-08-05T18:42:51.528Z" }, + { url = "https://files.pythonhosted.org/packages/c5/87/9e2baa098b94ea0bce4e3e8b106711a500af50be50519b96e90484e4f4b8/ty-0.0.67-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e0d7eee4a9d7694d64085a8ae12b4d9fc7c162b24e3000befe91737a9a61d1dd", size = 12908208, upload_time = "2026-08-05T18:42:53.844Z" }, + { url = "https://files.pythonhosted.org/packages/42/32/e8c0bfc19cc0a6dbf254933c13b857c2c0c800b86158296d3e4ccdb5702c/ty-0.0.67-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f4309acef52659fb5e030962b60fccd44b4f6b9c19c365738bc5d46a3c138b1e", size = 13404183, upload_time = "2026-08-05T18:42:55.988Z" }, + { url = "https://files.pythonhosted.org/packages/a3/ab/c9faa04a075136741b173058dd81a4070dc0bdf7fe162f8278d61e1b0b3d/ty-0.0.67-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:4daffa097226bcdee4852b61bd05311a49a7286b10042c148450cf6761b287c7", size = 13127241, upload_time = "2026-08-05T18:42:58.826Z" }, + { url = "https://files.pythonhosted.org/packages/a7/e5/47a368bdee8fd8376b6055496b5d2d03650d976b94e924b39332c0861396/ty-0.0.67-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:94b579b8ee3836238b96fb186a99904eea0a56685d6e50f7b54fe530050df07d", size = 12685060, upload_time = "2026-08-05T18:43:01.487Z" }, + { url = "https://files.pythonhosted.org/packages/ce/2d/b78102ca16dd05be36defe18f312deba43606c8870638749908de58b6408/ty-0.0.67-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:3b357d66119c4dc11d7508c40df0338857e470b0041515781effc45ca9211294", size = 12959319, upload_time = "2026-08-05T18:43:03.712Z" }, + { url = "https://files.pythonhosted.org/packages/88/e6/35e5a6d887144463d93c1320558fe6027e02c2cd27658999af04abf56120/ty-0.0.67-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:24043b96d25b9b787b715c08ed7c8bc236cb7800a6fd189967092b9712f523c9", size = 12040267, upload_time = "2026-08-05T18:43:05.91Z" }, + { url = "https://files.pythonhosted.org/packages/69/26/2d81626e029e5fa6a9b03e98141dbf52a6e6b814130e5d7227cbb9b74611/ty-0.0.67-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:4384d7427e1abf5165e010b66d2133d38b2707ef8880eb755de25f2e5b69a3f1", size = 12153207, upload_time = "2026-08-05T18:43:08.039Z" }, + { url = "https://files.pythonhosted.org/packages/df/62/cc61afedad6e8f02303cf2867364d5b30f2f223787c58932870c53e99d65/ty-0.0.67-py3-none-musllinux_1_2_i686.whl", hash = "sha256:761a141c6f6833b62bc5d92558b243adfd11b8084e070aa112c9b7ab9ec90e8b", size = 12446021, upload_time = "2026-08-05T18:43:10.207Z" }, + { url = "https://files.pythonhosted.org/packages/25/c4/8bbc1c641018b4003bb9fdc1a93843055dfa8d771b4d08fb6413b7a94a5a/ty-0.0.67-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:fc80a63d0b9eecc667e16e809d20a1c014668e6be8523db1f7714bc1a84e79c4", size = 12797108, upload_time = "2026-08-05T18:43:12.244Z" }, + { url = "https://files.pythonhosted.org/packages/c9/a4/8b181be30a49f6813822d50e7489eb8fe6287db7f2b635d1de97f82bbf94/ty-0.0.67-py3-none-win32.whl", hash = "sha256:9dc697547cc7972079e77d716b6874fbe7c6e7265d360ba372afdf44f0a103ec", size = 11771788, upload_time = "2026-08-05T18:43:14.375Z" }, + { url = "https://files.pythonhosted.org/packages/a6/bc/948eb72740c23c0ab3bb0a3bb07035e25d7950e862fd987651a8a6f21430/ty-0.0.67-py3-none-win_amd64.whl", hash = "sha256:2c4cdc1dffbfab5476bd708adb90018dd3f8bc796b3608fd60162b6e9c85981a", size = 12818447, upload_time = "2026-08-05T18:43:16.607Z" }, + { url = "https://files.pythonhosted.org/packages/5e/0a/8a2002aed7e4cf7278141984b393b5156e7f42c8aefc9ced9d037a3a3cd9/ty-0.0.67-py3-none-win_arm64.whl", hash = "sha256:6251e59bf4c36486204a0ec3aa758f7b65ef6727f1db7b24b8e90db072ac6eff", size = 12146254, upload_time = "2026-08-05T18:43:18.915Z" }, ] [[package]] name = "types-markdown" version = "3.10.2.20260508" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/24/62/4ca11db82799590117d9b6ef8fcd6515039cff80838304face5440f7d95c/types_markdown-3.10.2.20260508.tar.gz", hash = "sha256:64c405a30decd46cf78443bbcde8331f561f83752cc6d962ff3f5ccaabe26a8e", size = 19818, upload-time = "2026-05-08T04:49:45.095Z" } +sdist = { url = "https://files.pythonhosted.org/packages/24/62/4ca11db82799590117d9b6ef8fcd6515039cff80838304face5440f7d95c/types_markdown-3.10.2.20260508.tar.gz", hash = "sha256:64c405a30decd46cf78443bbcde8331f561f83752cc6d962ff3f5ccaabe26a8e", size = 19818, upload_time = "2026-05-08T04:49:45.095Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/cf/9d/eae7125bcf063ff5f79aadad58f3d37675263941f84e025bf53de1735fe1/types_markdown-3.10.2.20260508-py3-none-any.whl", hash = "sha256:2ee5e462c7b821c27c3d8f75f4da873d3e3c87d24d7f2d741f8f4261e4024a99", size = 25811, upload-time = "2026-05-08T04:49:43.962Z" }, + { url = "https://files.pythonhosted.org/packages/cf/9d/eae7125bcf063ff5f79aadad58f3d37675263941f84e025bf53de1735fe1/types_markdown-3.10.2.20260508-py3-none-any.whl", hash = "sha256:2ee5e462c7b821c27c3d8f75f4da873d3e3c87d24d7f2d741f8f4261e4024a99", size = 25811, upload_time = "2026-05-08T04:49:43.962Z" }, ] [[package]] @@ -242,9 +242,9 @@ dependencies = [ { name = "importlib-resources" }, { name = "typing-extensions" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/85/7d/62fbae352d5fb7ce5ef4d9ca73bf7a9b02b790d2524ab6ef1e0e799a5d1b/typeshed_client-2.11.0.tar.gz", hash = "sha256:0b8f2ab88f611f5e97b70d2a8123942d3d7d5c74cee8ae694db83422f32f9481", size = 522774, upload-time = "2026-05-01T14:51:52.38Z" } +sdist = { url = "https://files.pythonhosted.org/packages/85/7d/62fbae352d5fb7ce5ef4d9ca73bf7a9b02b790d2524ab6ef1e0e799a5d1b/typeshed_client-2.11.0.tar.gz", hash = "sha256:0b8f2ab88f611f5e97b70d2a8123942d3d7d5c74cee8ae694db83422f32f9481", size = 522774, upload_time = "2026-05-01T14:51:52.38Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/4f/22/fa16b462157bd869dfad528f5637506b9430ca63d48fb536ecf4cc78481a/typeshed_client-2.11.0-py3-none-any.whl", hash = "sha256:5745e0990b80b29a286b22d68f81779c5c7adf1cac8969eeafba44b73b486c36", size = 787609, upload-time = "2026-05-01T14:51:51.005Z" }, + { url = "https://files.pythonhosted.org/packages/4f/22/fa16b462157bd869dfad528f5637506b9430ca63d48fb536ecf4cc78481a/typeshed_client-2.11.0-py3-none-any.whl", hash = "sha256:5745e0990b80b29a286b22d68f81779c5c7adf1cac8969eeafba44b73b486c36", size = 787609, upload_time = "2026-05-01T14:51:51.005Z" }, ] [[package]] @@ -270,7 +270,7 @@ requires-dist = [ { name = "markdown" }, { name = "mypy" }, { name = "pycroscope" }, - { name = "pyrefly" }, + { name = "pyrefly", specifier = "==1.3.0.dev1" }, { name = "pyright" }, { name = "tomlkit" }, { name = "ty" }, @@ -282,9 +282,9 @@ requires-dist = [ name = "typing-extensions" version = "4.15.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/72/94/1a15dd82efb362ac84269196e94cf00f187f7ed21c242792a923cdb1c61f/typing_extensions-4.15.0.tar.gz", hash = "sha256:0cea48d173cc12fa28ecabc3b837ea3cf6f38c6d1136f85cbaaf598984861466", size = 109391, upload-time = "2025-08-25T13:49:26.313Z" } +sdist = { url = "https://files.pythonhosted.org/packages/72/94/1a15dd82efb362ac84269196e94cf00f187f7ed21c242792a923cdb1c61f/typing_extensions-4.15.0.tar.gz", hash = "sha256:0cea48d173cc12fa28ecabc3b837ea3cf6f38c6d1136f85cbaaf598984861466", size = 109391, upload_time = "2025-08-25T13:49:26.313Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/18/67/36e9267722cc04a6b9f15c7f3441c2363321a3ea07da7ae0c0707beb2a9c/typing_extensions-4.15.0-py3-none-any.whl", hash = "sha256:f0fa19c6845758ab08074a0cfa8b7aecb71c999ca73d62883bc25cc018c4e548", size = 44614, upload-time = "2025-08-25T13:49:24.86Z" }, + { url = "https://files.pythonhosted.org/packages/18/67/36e9267722cc04a6b9f15c7f3441c2363321a3ea07da7ae0c0707beb2a9c/typing_extensions-4.15.0-py3-none-any.whl", hash = "sha256:f0fa19c6845758ab08074a0cfa8b7aecb71c999ca73d62883bc25cc018c4e548", size = 44614, upload_time = "2025-08-25T13:49:24.86Z" }, ] [[package]] @@ -292,16 +292,16 @@ name = "zuban" version = "0.8.2" source = { registry = "https://pypi.org/simple" } wheels = [ - { url = "https://files.pythonhosted.org/packages/95/d8/9a24dc2c22250fc416bff06c4ac4664c73ef7ec558b8d23049f493af73b5/zuban-0.8.2-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:07d3a498c514cb51ec881987b0e841043ea466674a9b3bed8411890bacb4d0e3", size = 11486917, upload-time = "2026-06-08T23:29:02.829Z" }, - { url = "https://files.pythonhosted.org/packages/23/62/3636a5474a9f9361ca83030cb82fefb4b1ff7771c75ab957c9025a3a7a97/zuban-0.8.2-py3-none-macosx_11_0_arm64.whl", hash = "sha256:64ed57aea375c74671d81e4d4655328a47b2157c7827e2c50cc90f80b29e8417", size = 11205360, upload-time = "2026-06-08T23:29:05.612Z" }, - { url = "https://files.pythonhosted.org/packages/49/41/0650f89e1f2ea0e865dd5e23614e6f3a205153032f0a9e970c5f4da885d1/zuban-0.8.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8bc47f343a939407ff881b0e9f0da36c7a3a509b3e6ca237512aadf30d02053b", size = 28385720, upload-time = "2026-06-08T23:29:08.177Z" }, - { url = "https://files.pythonhosted.org/packages/d7/52/58ecbdbf9668fd81c85f69b94609a5a813a94a18d9ce73ee1548cf85d98d/zuban-0.8.2-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:26ede2418f48affde0e9092108ec0be344b1323d7e87d11ecac8e5e89d383d7e", size = 28603725, upload-time = "2026-06-08T23:29:11.778Z" }, - { url = "https://files.pythonhosted.org/packages/96/ad/efc2e98a4492d010459161e03f98952227744c8f5ae8ebcc13ca88d50ad6/zuban-0.8.2-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b83e0cc35cccb2f60b50d8c6658ca3ac332914ad58d8e3d3d5886a13f761771b", size = 29769216, upload-time = "2026-06-08T23:29:14.865Z" }, - { url = "https://files.pythonhosted.org/packages/f7/60/a40add4cf31694f64727a34fc4a2093c599f1c911fdb6fbf61bf40d437f5/zuban-0.8.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8c4b26c1a383234c340d4956c04d8528e5e1654a08571d9d3eaced4973d21f87", size = 30851896, upload-time = "2026-06-08T23:29:18.04Z" }, - { url = "https://files.pythonhosted.org/packages/17/6f/7e32ec7c1677dfd7ac5821ac1d6cc6d4552f65fe06b098bd3515f5c5699d/zuban-0.8.2-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:32699e64acdb7d8984eddc3095b8f6fcf37fa00c52d54e74fed920440fe36ebe", size = 28551589, upload-time = "2026-06-08T23:29:20.922Z" }, - { url = "https://files.pythonhosted.org/packages/68/26/f5e8434aa8ea478a949b4dab8bd94abb47ff46f4777943a3309c33bfda94/zuban-0.8.2-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:f2ada854ceddeae6f7a8ecf709577235f5845770ebd6d51b26dde4358e78b645", size = 29007499, upload-time = "2026-06-08T23:29:23.954Z" }, - { url = "https://files.pythonhosted.org/packages/5c/37/70e6696e0e9d202fa84be8437b9dbf32e6d5854d9a201b9ca24965496391/zuban-0.8.2-py3-none-musllinux_1_2_i686.whl", hash = "sha256:dd6c2be104e6e9e1693e15d0a7775c5841a9793534351738c24b7377c58b487c", size = 29670474, upload-time = "2026-06-08T23:29:26.769Z" }, - { url = "https://files.pythonhosted.org/packages/74/0c/1c6f0a239fc2c93c46e733fa5d6f9ac376f9e0aec909467d50f6071234bf/zuban-0.8.2-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:299debc250b729abb0ebecd0bd53cac3c6b26cdb32dc4e79e601f9a1f584d3cd", size = 29029010, upload-time = "2026-06-08T23:29:29.959Z" }, - { url = "https://files.pythonhosted.org/packages/a6/7b/d5cdb140e9979d3f7784d9565f21692cafb851cceb21cba13348bcfcfa30/zuban-0.8.2-py3-none-win32.whl", hash = "sha256:3521196b132c2650e01a085d211dfcd849de9e9409e193e8f8ad85629c60fa42", size = 10026570, upload-time = "2026-06-08T23:29:32.596Z" }, - { url = "https://files.pythonhosted.org/packages/ee/cb/25a952a3594aa7ee32dee648513a1ea758c2def98742966d24484bb3d8ab/zuban-0.8.2-py3-none-win_amd64.whl", hash = "sha256:07463d337d293efb918990900c52b976646810b8f741999e8f288fb3da6e6594", size = 10798493, upload-time = "2026-06-08T23:29:34.805Z" }, + { url = "https://files.pythonhosted.org/packages/95/d8/9a24dc2c22250fc416bff06c4ac4664c73ef7ec558b8d23049f493af73b5/zuban-0.8.2-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:07d3a498c514cb51ec881987b0e841043ea466674a9b3bed8411890bacb4d0e3", size = 11486917, upload_time = "2026-06-08T23:29:02.829Z" }, + { url = "https://files.pythonhosted.org/packages/23/62/3636a5474a9f9361ca83030cb82fefb4b1ff7771c75ab957c9025a3a7a97/zuban-0.8.2-py3-none-macosx_11_0_arm64.whl", hash = "sha256:64ed57aea375c74671d81e4d4655328a47b2157c7827e2c50cc90f80b29e8417", size = 11205360, upload_time = "2026-06-08T23:29:05.612Z" }, + { url = "https://files.pythonhosted.org/packages/49/41/0650f89e1f2ea0e865dd5e23614e6f3a205153032f0a9e970c5f4da885d1/zuban-0.8.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8bc47f343a939407ff881b0e9f0da36c7a3a509b3e6ca237512aadf30d02053b", size = 28385720, upload_time = "2026-06-08T23:29:08.177Z" }, + { url = "https://files.pythonhosted.org/packages/d7/52/58ecbdbf9668fd81c85f69b94609a5a813a94a18d9ce73ee1548cf85d98d/zuban-0.8.2-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:26ede2418f48affde0e9092108ec0be344b1323d7e87d11ecac8e5e89d383d7e", size = 28603725, upload_time = "2026-06-08T23:29:11.778Z" }, + { url = "https://files.pythonhosted.org/packages/96/ad/efc2e98a4492d010459161e03f98952227744c8f5ae8ebcc13ca88d50ad6/zuban-0.8.2-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b83e0cc35cccb2f60b50d8c6658ca3ac332914ad58d8e3d3d5886a13f761771b", size = 29769216, upload_time = "2026-06-08T23:29:14.865Z" }, + { url = "https://files.pythonhosted.org/packages/f7/60/a40add4cf31694f64727a34fc4a2093c599f1c911fdb6fbf61bf40d437f5/zuban-0.8.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8c4b26c1a383234c340d4956c04d8528e5e1654a08571d9d3eaced4973d21f87", size = 30851896, upload_time = "2026-06-08T23:29:18.04Z" }, + { url = "https://files.pythonhosted.org/packages/17/6f/7e32ec7c1677dfd7ac5821ac1d6cc6d4552f65fe06b098bd3515f5c5699d/zuban-0.8.2-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:32699e64acdb7d8984eddc3095b8f6fcf37fa00c52d54e74fed920440fe36ebe", size = 28551589, upload_time = "2026-06-08T23:29:20.922Z" }, + { url = "https://files.pythonhosted.org/packages/68/26/f5e8434aa8ea478a949b4dab8bd94abb47ff46f4777943a3309c33bfda94/zuban-0.8.2-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:f2ada854ceddeae6f7a8ecf709577235f5845770ebd6d51b26dde4358e78b645", size = 29007499, upload_time = "2026-06-08T23:29:23.954Z" }, + { url = "https://files.pythonhosted.org/packages/5c/37/70e6696e0e9d202fa84be8437b9dbf32e6d5854d9a201b9ca24965496391/zuban-0.8.2-py3-none-musllinux_1_2_i686.whl", hash = "sha256:dd6c2be104e6e9e1693e15d0a7775c5841a9793534351738c24b7377c58b487c", size = 29670474, upload_time = "2026-06-08T23:29:26.769Z" }, + { url = "https://files.pythonhosted.org/packages/74/0c/1c6f0a239fc2c93c46e733fa5d6f9ac376f9e0aec909467d50f6071234bf/zuban-0.8.2-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:299debc250b729abb0ebecd0bd53cac3c6b26cdb32dc4e79e601f9a1f584d3cd", size = 29029010, upload_time = "2026-06-08T23:29:29.959Z" }, + { url = "https://files.pythonhosted.org/packages/a6/7b/d5cdb140e9979d3f7784d9565f21692cafb851cceb21cba13348bcfcfa30/zuban-0.8.2-py3-none-win32.whl", hash = "sha256:3521196b132c2650e01a085d211dfcd849de9e9409e193e8f8ad85629c60fa42", size = 10026570, upload_time = "2026-06-08T23:29:32.596Z" }, + { url = "https://files.pythonhosted.org/packages/ee/cb/25a952a3594aa7ee32dee648513a1ea758c2def98742966d24484bb3d8ab/zuban-0.8.2-py3-none-win_amd64.whl", hash = "sha256:07463d337d293efb918990900c52b976646810b8f741999e8f288fb3da6e6594", size = 10798493, upload_time = "2026-06-08T23:29:34.805Z" }, ] From 691e9e4a8f11082f6cfb0a3a3a418a2df79da349 Mon Sep 17 00:00:00 2001 From: Victorien <65306057+Viicos@users.noreply.github.com> Date: Fri, 7 Aug 2026 05:06:36 +0200 Subject: [PATCH 272/308] Clarify runtime implementation of `Generic` (#1876) --- docs/spec/generics.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/spec/generics.rst b/docs/spec/generics.rst index c1fa05325..7f6cbb925 100644 --- a/docs/spec/generics.rst +++ b/docs/spec/generics.rst @@ -139,8 +139,8 @@ for variance, see below). takes a single type parameter ``T``. This also makes ``T`` valid as a type within the class body. -The ``Generic`` base class uses a metaclass that defines ``__getitem__`` -so that ``LoggedVar[t]`` is valid as a type:: +The ``Generic`` base class implements the :func:`~object.__class_getitem__` +classmethod so that ``LoggedVar[t]`` is valid as a type:: from collections.abc import Iterable From 4fb3203b88ac443b45850484e7c7d0bdb9f6109c Mon Sep 17 00:00:00 2001 From: wyattscarpenter Date: Thu, 6 Aug 2026 21:07:39 -0700 Subject: [PATCH 273/308] Document the trouble with lambdas in the guides (#2105) --- docs/guides/index.rst | 1 + docs/guides/lambda.rst | 88 ++++++++++++++++++++++++++++++++++++++++++ docs/index.rst | 1 + 3 files changed, 90 insertions(+) create mode 100644 docs/guides/lambda.rst diff --git a/docs/guides/index.rst b/docs/guides/index.rst index b13e03486..70dfdac98 100644 --- a/docs/guides/index.rst +++ b/docs/guides/index.rst @@ -12,6 +12,7 @@ Type System Guides :caption: Contents: libraries + lambda writing_stubs modernizing unreachable diff --git a/docs/guides/lambda.rst b/docs/guides/lambda.rst new file mode 100644 index 000000000..65c6074a9 --- /dev/null +++ b/docs/guides/lambda.rst @@ -0,0 +1,88 @@ +***************************************** +The Trouble (Or Lack Thereof) With Lambda +***************************************** + +Lambda expressions are a common and useful part of the Python programming language. +However, there is one problem with them: syntactically, they do not allow for type +annotations. While it is perfectly simple to write ``lambda x: x``, you cannot directly +indicate a type for x. (Type annotations are indicated by a colon, and so is the end +of the lambda parameter list. Where would the type annotation go?) + +However, despite this infelicity, lambda expressions are not immune from static typing, +and in fact follow the same static type rules as everything else. Type checkers try +to deduce the type of the lambda arguments and return value, and if they can't they +fall back to ``Any``. Due to the inability to directly indicate types for these, +``Any`` tends to pop up quite often here. This means that many type errors may occur +here unnoticed, which is bad. For instance, the following example is a runtime type +error, but is uncaught in most (perhaps all) type checkers: + +.. code-block:: python + + f1 = lambda a, b: a + b + f1(1, "a") + +(The alternative way of writing this, ``(lambda a, b: a + b)(1, "a")``, is typically +caught by type checkers, because it is simple and immediate enough that they are able +to deduce that a type error will occur.) + +.. + (This is an RST comment.) + A slightly more realistic example of an uncaught lambda type error is + + .. code-block :: python + def apply(f, *x): + f(*x) + apply((lambda a, b: a + b), 1, "a") + + since it doesn't immediately defeat the purpose of a lambda by binding it. + It also fails to get caught by mypy and pyright in their default modes, as + required for the example. However, it's a little bit harder to understand, + so we went with the other one. + +There are some workarounds to this problem, which all involve assigning the lambda to +something, in one way or another, and annotating that. This is a bit unfortunate, +because the idiomatic use of a lambda involves not doing that. In fact, at that point +you might as well just define a normal function. Let's call that our first workaround. + +``def f(x: object) -> object: return x`` + +The second workaround is equivalent: assigning the lambda to a variable, and annotating +the type of that variable with a Callable. + +``f: Callable[[object], object] = lambda x: x`` + +.. + (This is an RST comment. The following paragraph has been excised from the guide, + as most beginners will not know what a type comment is anyway — especially a function + type comment. However, the paragraph is left in this comment for greater context for + you, the future editor:) + + Type comments on function definitions do not actually work on lambda, nor do + normal type comments help (although you can use a type comment on an assignment + to a variable with a lambda, of course; however this will have to be the Callable + syntax and not the function-arrow special one). + +Most type checkers include an option to emit a warning if they aren't able to deduce +the type of an expression; this should be helpful if you want to avoid silent uncaught +type errors resulting from lambda expressions being deduced as ``Any``. For instance, +Mypy includes ``disallow_any_expr``/``--disallow-any-expr`` and Pyright includes +``reportUnknownLambdaType``. Both of those options are set to true in the respective +strict modes of those type checkers. + +In conclusion: + +1. There is no way to explicitly annotate lambda arguments or return values in the +lambdas themselves. + +2. However, static typing rules still apply to lambdas, including type deduction. + +3. Many lambdas get deduced as ``Any``, which might suppress the reporting of other +type errors. + +4. However, many lambdas get deduced fine, and for those it's not a problem. + +5. If you want to annotate the type of lambdas, you can bind them and annotate them +there. + +6. Most type checkers have a setting that will warn you if anything gets deduced as +``Any``, and you can use that to avoid false negatives relating to lambda. diff --git a/docs/index.rst b/docs/index.rst index 49bab4714..35857a09c 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -23,6 +23,7 @@ Guides :maxdepth: 1 guides/libraries + guides/lambda guides/writing_stubs guides/modernizing guides/unreachable From 513ebea11bfd668ed343e3cafadff354778035cd Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Thu, 6 Aug 2026 21:20:11 -0700 Subject: [PATCH 274/308] Add sentinels (PEP 661) to the spec (#2277) --- .../results/mypy/specialtypes_sentinels.toml | 27 +++++++++++++ .../pycroscope/specialtypes_sentinels.toml | 8 ++++ .../pyrefly/specialtypes_sentinels.toml | 9 +++++ .../pyright/specialtypes_sentinels.toml | 31 ++++++++++++++ conformance/results/results.html | 39 ++++++++++++------ .../results/ty/specialtypes_sentinels.toml | 9 +++++ .../results/zuban/specialtypes_sentinels.toml | 9 +++++ conformance/tests/specialtypes_sentinels.py | 40 +++++++++++++++++++ docs/spec/annotations.rst | 2 +- docs/spec/special-types.rst | 40 +++++++++++++++++++ 10 files changed, 201 insertions(+), 13 deletions(-) create mode 100644 conformance/results/mypy/specialtypes_sentinels.toml create mode 100644 conformance/results/pycroscope/specialtypes_sentinels.toml create mode 100644 conformance/results/pyrefly/specialtypes_sentinels.toml create mode 100644 conformance/results/pyright/specialtypes_sentinels.toml create mode 100644 conformance/results/ty/specialtypes_sentinels.toml create mode 100644 conformance/results/zuban/specialtypes_sentinels.toml create mode 100644 conformance/tests/specialtypes_sentinels.py diff --git a/conformance/results/mypy/specialtypes_sentinels.toml b/conformance/results/mypy/specialtypes_sentinels.toml new file mode 100644 index 000000000..1ff31a1c9 --- /dev/null +++ b/conformance/results/mypy/specialtypes_sentinels.toml @@ -0,0 +1,27 @@ +conformant = "Unsupported" +conformance_automated = "Fail" +errors_diff = """ +Line 36: Expected 1 errors +Line 39: Expected 1 errors +Line 20: Unexpected errors ['specialtypes_sentinels.py:20: error: Variable "specialtypes_sentinels.MISSING" is not valid as a type [valid-type]', 'specialtypes_sentinels.py:20: error: Variable "specialtypes_sentinels.SPECIAL" is not valid as a type [valid-type]'] +Line 22: Unexpected errors ['specialtypes_sentinels.py:22: error: Expression is of type "Any", not MISSING? [assert-type]', 'specialtypes_sentinels.py:22: error: Variable "specialtypes_sentinels.MISSING" is not valid as a type [valid-type]'] +Line 24: Unexpected errors ['specialtypes_sentinels.py:24: error: Variable "specialtypes_sentinels.SPECIAL" is not valid as a type [valid-type]'] +Line 26: Unexpected errors ['specialtypes_sentinels.py:26: error: Variable "specialtypes_sentinels.Cls.IN_CLASS" is not valid as a type [valid-type]'] +Line 28: Unexpected errors ['specialtypes_sentinels.py:28: error: Expression is of type "Any", not Cls.IN_CLASS? [assert-type]', 'specialtypes_sentinels.py:28: error: Variable "specialtypes_sentinels.Cls.IN_CLASS" is not valid as a type [valid-type]'] +""" +output = """ +specialtypes_sentinels.py:14: error: Incompatible default for parameter "x" (default has type "Sentinel", parameter has type "int") [assignment] +specialtypes_sentinels.py:20: error: Variable "specialtypes_sentinels.MISSING" is not valid as a type [valid-type] +specialtypes_sentinels.py:20: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +specialtypes_sentinels.py:20: error: Variable "specialtypes_sentinels.SPECIAL" is not valid as a type [valid-type] +specialtypes_sentinels.py:22: error: Expression is of type "Any", not MISSING? [assert-type] +specialtypes_sentinels.py:22: error: Variable "specialtypes_sentinels.MISSING" is not valid as a type [valid-type] +specialtypes_sentinels.py:22: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +specialtypes_sentinels.py:24: error: Variable "specialtypes_sentinels.SPECIAL" is not valid as a type [valid-type] +specialtypes_sentinels.py:24: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +specialtypes_sentinels.py:26: error: Variable "specialtypes_sentinels.Cls.IN_CLASS" is not valid as a type [valid-type] +specialtypes_sentinels.py:26: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +specialtypes_sentinels.py:28: error: Expression is of type "Any", not Cls.IN_CLASS? [assert-type] +specialtypes_sentinels.py:28: error: Variable "specialtypes_sentinels.Cls.IN_CLASS" is not valid as a type [valid-type] +specialtypes_sentinels.py:28: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +""" diff --git a/conformance/results/pycroscope/specialtypes_sentinels.toml b/conformance/results/pycroscope/specialtypes_sentinels.toml new file mode 100644 index 000000000..4c2425384 --- /dev/null +++ b/conformance/results/pycroscope/specialtypes_sentinels.toml @@ -0,0 +1,8 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./specialtypes_sentinels.py:14:10: Default value for argument x incompatible with declared type int [incompatible_default] +./specialtypes_sentinels.py:36:6: Incompatible argument type for x: expected int | Literal[<>, ] but got [incompatible_argument] +./specialtypes_sentinels.py:39:6: Incompatible argument type for x: expected int | Literal[] but got <> [incompatible_argument] +""" diff --git a/conformance/results/pyrefly/specialtypes_sentinels.toml b/conformance/results/pyrefly/specialtypes_sentinels.toml new file mode 100644 index 000000000..0366c5785 --- /dev/null +++ b/conformance/results/pyrefly/specialtypes_sentinels.toml @@ -0,0 +1,9 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +ERROR specialtypes_sentinels.py:14:20-27: Default `` is not assignable to parameter `x` with type `int` [bad-function-definition] +ERROR specialtypes_sentinels.py:36:7-19: Argument `Cls.Cls.IN_CLASS` is not assignable to parameter `x` with type `int | | SPECIAL` in function `func2` [bad-argument-type] +ERROR specialtypes_sentinels.py:39:7-14: Argument `` is not assignable to parameter `x` with type `int | Cls.Cls.IN_CLASS` in function `func3` [bad-argument-type] +""" diff --git a/conformance/results/pyright/specialtypes_sentinels.toml b/conformance/results/pyright/specialtypes_sentinels.toml new file mode 100644 index 000000000..a2f0cea7b --- /dev/null +++ b/conformance/results/pyright/specialtypes_sentinels.toml @@ -0,0 +1,31 @@ +conformant = "Partial" +notes = """ +Requires the string passed to `Sentinel` to match the assigned variable name. +This causes valid sentinel types and narrowing operations to be rejected. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 14: Expected 1 errors +Line 36: Expected 1 errors +Line 39: Expected 1 errors +Line 7: Unexpected errors ['specialtypes_sentinels.py:7:1 - error: Sentinel must be assigned to a variable with the same name (reportGeneralTypeIssues)'] +Line 11: Unexpected errors ['specialtypes_sentinels.py:11:5 - error: Sentinel must be assigned to a variable with the same name (reportGeneralTypeIssues)'] +Line 20: Unexpected errors ['specialtypes_sentinels.py:20:20 - error: Variable not allowed in type expression (reportInvalidTypeForm)'] +Line 22: Unexpected errors ['specialtypes_sentinels.py:22:21 - error: "assert_type" mismatch: expected "Unknown" but received "int | Unknown | SPECIAL" (reportAssertTypeFailure)', 'specialtypes_sentinels.py:22:24 - error: Variable not allowed in type expression (reportInvalidTypeForm)'] +Line 24: Unexpected errors ['specialtypes_sentinels.py:24:21 - error: "assert_type" mismatch: expected "int | SPECIAL" but received "int | Unknown | SPECIAL" (reportAssertTypeFailure)'] +Line 26: Unexpected errors ['specialtypes_sentinels.py:26:24 - error: Variable not allowed in type expression (reportInvalidTypeForm)'] +Line 28: Unexpected errors ['specialtypes_sentinels.py:28:21 - error: "assert_type" mismatch: expected "Unknown" but received "int | Unknown" (reportAssertTypeFailure)', 'specialtypes_sentinels.py:28:28 - error: Variable not allowed in type expression (reportInvalidTypeForm)'] +Line 30: Unexpected errors ['specialtypes_sentinels.py:30:21 - error: "assert_type" mismatch: expected "int" but received "int | Unknown" (reportAssertTypeFailure)'] +""" +output = """ +specialtypes_sentinels.py:7:1 - error: Sentinel must be assigned to a variable with the same name (reportGeneralTypeIssues) +specialtypes_sentinels.py:11:5 - error: Sentinel must be assigned to a variable with the same name (reportGeneralTypeIssues) +specialtypes_sentinels.py:20:20 - error: Variable not allowed in type expression (reportInvalidTypeForm) +specialtypes_sentinels.py:22:21 - error: "assert_type" mismatch: expected "Unknown" but received "int | Unknown | SPECIAL" (reportAssertTypeFailure) +specialtypes_sentinels.py:22:24 - error: Variable not allowed in type expression (reportInvalidTypeForm) +specialtypes_sentinels.py:24:21 - error: "assert_type" mismatch: expected "int | SPECIAL" but received "int | Unknown | SPECIAL" (reportAssertTypeFailure) +specialtypes_sentinels.py:26:24 - error: Variable not allowed in type expression (reportInvalidTypeForm) +specialtypes_sentinels.py:28:21 - error: "assert_type" mismatch: expected "Unknown" but received "int | Unknown" (reportAssertTypeFailure) +specialtypes_sentinels.py:28:28 - error: Variable not allowed in type expression (reportInvalidTypeForm) +specialtypes_sentinels.py:30:21 - error: "assert_type" mismatch: expected "int" but received "int | Unknown" (reportAssertTypeFailure) +""" diff --git a/conformance/results/results.html b/conformance/results/results.html index 2c57ab565..44b7924b0 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -465,6 +465,21 @@

    Python Type System Conformance Test Results

    + + + + + + + + + - - - - - - + + + + + + @@ -2587,12 +2602,12 @@

    Python Type System Conformance Test Results

    - - - - - - + + + + + +
    basilisk 0.27.0 mypy 2.1.0 pycroscope 0.4.0 pyrefly 1.1.0
    + Type annotations
    Pass Pass PassPass
    annotations_forward_refsPass Partial
      @@ -330,7 +327,6 @@

      Python Type System Conformance Test Results

    annotations_generatorsPass Partial
      @@ -345,7 +341,6 @@

      Python Type System Conformance Test Results

    annotations_methodsPass Pass
      @@ -366,7 +361,6 @@

      Python Type System Conformance Test Results

    annotations_typeexpr PassPass Partial
      @@ -380,7 +374,6 @@

      Python Type System Conformance Test Results

    5 / 5 • 100.0% 4 / 5 • 80.0% 4 / 5 • 80.0% 4.5 / 5 • 90.0%
    + Type forms
    typeforms_typeformPass Partial
      @@ -417,7 +409,6 @@

      Python Type System Conformance Test Results

    1 / 1 • 100.0% 0.5 / 1 • 50.0% 0.5 / 1 • 50.0% 1 / 1 • 100.0%
    + Special types in annotations
    Pass Pass PassPass
    specialtypes_never PassPass Partial
      @@ -466,7 +455,6 @@

      Python Type System Conformance Test Results

    Pass Pass PassPass
    specialtypes_promotions Pass Pass PassPass
    specialtypes_typePass Partial
      @@ -502,7 +488,6 @@

      Python Type System Conformance Test Results

    5 / 5 • 100.0% 4.5 / 5 • 90.0% 4.5 / 5 • 90.0% 5 / 5 • 100.0%
    + Generics
    generics_base_classPass Partial
      @@ -538,7 +522,6 @@

      Python Type System Conformance Test Results

    Pass Pass PassPass Partial
      @@ -549,7 +532,6 @@

      Python Type System Conformance Test Results

    generics_defaultsPass Partial
      @@ -577,7 +559,6 @@

      Python Type System Conformance Test Results

    generics_defaults_referentialPass Partial
      @@ -597,7 +578,6 @@

      Python Type System Conformance Test Results

    generics_defaults_specializationPass Partial
      @@ -623,7 +603,6 @@

      Python Type System Conformance Test Results

    Pass Pass PassPass
    generics_paramspec_components Pass Pass PassPass
    generics_paramspec_semantics Pass Pass PassPass Pass
      @@ -658,13 +635,11 @@

      Python Type System Conformance Test Results

    Pass Pass PassPass
    generics_scoping Pass PassPass Partial
      @@ -683,7 +658,6 @@

      Python Type System Conformance Test Results

    generics_self_advancedPass Partial
      @@ -712,7 +686,6 @@

      Python Type System Conformance Test Results

    Pass Pass PassPass
    generics_self_basic Pass Pass PassPass
    generics_self_protocols Pass Pass PassPass
    generics_self_usage Pass Pass PassPass Partial
      @@ -757,7 +727,6 @@

      Python Type System Conformance Test Results

    Pass Pass PassPass
    generics_syntax_declarations Pass Pass PassPass
    generics_syntax_infer_variancePass Unsupported
      @@ -786,7 +753,6 @@

      Python Type System Conformance Test Results

    generics_syntax_scopingPass Partial
      @@ -806,7 +772,6 @@

      Python Type System Conformance Test Results

    generics_type_erasurePass Partial
      @@ -827,7 +792,6 @@

      Python Type System Conformance Test Results

    generics_typevartuple_argsPass Partial
      @@ -852,7 +816,6 @@

      Python Type System Conformance Test Results

    generics_typevartuple_basicPass Partial
      @@ -876,7 +839,6 @@

      Python Type System Conformance Test Results

    Pass Pass PassPass Partial
      @@ -893,7 +855,6 @@

      Python Type System Conformance Test Results

    Pass Pass PassPass
    generics_typevartuple_overloads Pass Pass PassPass
    generics_typevartuple_specializationPass Partial
      @@ -929,11 +888,9 @@

      Python Type System Conformance Test Results

    Pass Pass PassPass
    generics_upper_boundPass Partial
      @@ -948,7 +905,6 @@

      Python Type System Conformance Test Results

    generics_variancePass Partial
      @@ -969,11 +925,9 @@

      Python Type System Conformance Test Results

    Pass Pass PassPass
    30 / 30 • 100.0% 23 / 30 • 76.7% 28.5 / 30 • 95.0% 29.5 / 30 • 98.3%
    + Type qualifiers
    qualifiers_annotatedPass Partial
      @@ -1015,7 +968,6 @@

      Python Type System Conformance Test Results

    qualifiers_final_annotationPass Partial
      @@ -1039,11 +991,9 @@

      Python Type System Conformance Test Results

    Pass Pass PassPass
    3 / 3 • 100.0% 2 / 3 • 66.7% 2.5 / 3 • 83.3% 3 / 3 • 100.0%
    + Class type compatibility
    classes_classvarPass Partial
      @@ -1084,11 +1033,9 @@

      Python Type System Conformance Test Results

    Pass Pass PassPass
    2 / 2 • 100.0% 1.5 / 2 • 75.0% 2 / 2 • 100.0% 2 / 2 • 100.0%
    + Type aliases
    aliases_explicitPass Partial
      @@ -1126,7 +1072,6 @@

      Python Type System Conformance Test Results

    aliases_implicit PassPass Partial
      @@ -1147,7 +1092,6 @@

      Python Type System Conformance Test Results

    aliases_newtypePass Partial
      @@ -1166,14 +1110,12 @@

      Python Type System Conformance Test Results

    Pass Pass PassPass Unsupported Pass
    aliases_type_statement PassPass Partial
      @@ -1192,7 +1134,6 @@

      Python Type System Conformance Test Results

    aliases_typealiastypePass Partial
      @@ -1224,11 +1165,9 @@

      Python Type System Conformance Test Results

    Pass Pass PassPass
    7 / 7 • 100.0% 5.5 / 7 • 78.6% 5.5 / 7 • 78.6% 7 / 7 • 100.0%
    + Literals
    literals_interactionsPass Pass
      @@ -1260,7 +1198,6 @@

      Python Type System Conformance Test Results

    literals_literalstringPass Unsupported
      @@ -1275,7 +1212,6 @@

      Python Type System Conformance Test Results

    literals_parameterizationsPass Partial
      @@ -1301,11 +1237,9 @@

      Python Type System Conformance Test Results

    Pass Pass PassPass
    4 / 4 • 100.0% 2.5 / 4 • 62.5% 3.5 / 4 • 87.5% 4 / 4 • 100.0%
    + Protocols
    protocols_class_objects PassPass Partial
      @@ -1344,7 +1277,6 @@

      Python Type System Conformance Test Results

    protocols_definitionPass Partial
      @@ -1366,7 +1298,6 @@

      Python Type System Conformance Test Results

    protocols_explicitPass Pass
      @@ -1388,7 +1319,6 @@

      Python Type System Conformance Test Results

    protocols_generic PassPass Partial
      @@ -1412,7 +1342,6 @@

      Python Type System Conformance Test Results

    Pass Pass PassPass Partial
      @@ -1429,7 +1358,6 @@

      Python Type System Conformance Test Results

    Pass Pass PassPass
    protocols_recursive Pass Pass PassPass Partial
      @@ -1448,7 +1375,6 @@

      Python Type System Conformance Test Results

    protocols_runtime_checkablePass Partial
      @@ -1474,7 +1400,6 @@

      Python Type System Conformance Test Results

    Pass Pass PassPass
    protocols_subtyping Pass Pass PassPass
    protocols_variance Pass Pass PassPass Unsupported Pass
    11 / 11 • 100.0% 10 / 11 • 90.9% 10 / 11 • 90.9% 11 / 11 • 100.0%
    + Callables
    callables_annotationPass Partial
      @@ -1536,7 +1457,6 @@

      Python Type System Conformance Test Results

    callables_kwargsPass Partial
      @@ -1557,7 +1477,6 @@

      Python Type System Conformance Test Results

    Pass Pass PassPass
    callables_subtyping Pass Pass PassPass
    4 / 4 • 100.0% 3 / 4 • 75.0% 4 / 4 • 100.0% 3.5 / 4 • 87.5%
    + Constructors
    constructors_call_initPass Partial
      @@ -1610,7 +1526,6 @@

      Python Type System Conformance Test Results

    constructors_call_metaclassPass Unsupported
      @@ -1626,7 +1541,6 @@

      Python Type System Conformance Test Results

    constructors_call_newPass Partial
      @@ -1643,7 +1557,6 @@

      Python Type System Conformance Test Results

    constructors_call_typePass Partial
      @@ -1663,7 +1576,6 @@

      Python Type System Conformance Test Results

    constructors_callablePass Partial
      @@ -1692,7 +1604,6 @@

      Python Type System Conformance Test Results

    constructors_consistencyPass Pass
      @@ -1707,7 +1618,6 @@

      Python Type System Conformance Test Results

    6 / 6 • 100.0% 3 / 6 • 50.0% 6 / 6 • 100.0% 5.5 / 6 • 91.7%
    + Overloads
    overloads_basic PassPass Partial
      @@ -1745,11 +1654,9 @@

      Python Type System Conformance Test Results

    Pass Pass PassPass
    overloads_definitionsPass Partial
      @@ -1764,7 +1671,6 @@

      Python Type System Conformance Test Results

    overloads_definitions_stubPass Partial
      @@ -1784,7 +1690,6 @@

      Python Type System Conformance Test Results

    overloads_evaluationPass Partial
      @@ -1808,7 +1713,6 @@

      Python Type System Conformance Test Results

    5 / 5 • 100.0% 3.5 / 5 • 70.0% 3.5 / 5 • 70.0% 5 / 5 • 100.0%
    + Exceptions
    exceptions_context_managers Pass PassPass Partial
      @@ -1842,7 +1745,6 @@

      Python Type System Conformance Test Results

    1 / 1 • 100.0% 1 / 1 • 100.0%1 / 1 • 100.0% 0.5 / 1 • 50.0% 1 / 1 • 100.0% 0 / 1 • 0.0%
    + Dataclasses
    dataclasses_descriptorsPass Partial
      @@ -1889,7 +1790,6 @@

      Python Type System Conformance Test Results

    dataclasses_finalPass Partial
      @@ -1911,11 +1811,9 @@

      Python Type System Conformance Test Results

    Pass Pass PassPass
    dataclasses_hashPass Unsupported
      @@ -1943,7 +1841,6 @@

      Python Type System Conformance Test Results

    Pass Pass PassPass
    dataclasses_kwonly Pass Pass PassPass
    dataclasses_match_args Pass Pass PassPass
    dataclasses_order Pass Pass PassPass
    dataclasses_postinit Pass Pass PassPass
    dataclasses_slotsPass Partial
      @@ -2013,11 +1905,9 @@

      Python Type System Conformance Test Results

    Pass Pass PassPass
    dataclasses_transform_converterPass Unsupported
      @@ -2032,7 +1922,6 @@

      Python Type System Conformance Test Results

    dataclasses_transform_fieldPass Partial
      @@ -2047,7 +1936,6 @@

      Python Type System Conformance Test Results

    dataclasses_transform_funcPass Partial
      @@ -2069,11 +1957,9 @@

      Python Type System Conformance Test Results

    Pass Pass PassPass
    dataclasses_usagePass Pass
      @@ -2088,7 +1974,6 @@

      Python Type System Conformance Test Results

    16 / 16 • 100.0% 11.5 / 16 • 71.9% 15.5 / 16 • 96.9% 15.5 / 16 • 96.9%
    + Typed dictionaries
    typeddicts_alt_syntaxPass Pass
      @@ -2120,7 +2004,6 @@

      Python Type System Conformance Test Results

    typeddicts_class_syntaxPass Partial
      @@ -2140,7 +2023,6 @@

      Python Type System Conformance Test Results

    typeddicts_extra_itemsPass Unsupported Pass Pass Pass Pass PassPass
    typeddicts_inheritance Pass Pass PassPass
    typeddicts_operations Pass Pass PassPass
    typeddicts_readonly Pass Pass PassPass
    typeddicts_readonly_consistency Pass Pass PassPass
    typeddicts_readonly_inheritancePass Partial
      @@ -2223,11 +2099,9 @@

      Python Type System Conformance Test Results

    Pass Pass PassPass
    typeddicts_readonly_updatePass Partial
      @@ -2249,12 +2123,10 @@

      Python Type System Conformance Test Results

    Pass Pass PassPass
    typeddicts_type_consistency PassPass Partial
      @@ -2274,11 +2146,9 @@

      Python Type System Conformance Test Results

    Pass Pass PassPass
    14 / 14 • 100.0% 11.5 / 14 • 82.1% 13.5 / 14 • 96.4% 14 / 14 • 100.0%
    + Tuples
    tuples_type_compatPass Partial
      @@ -2317,11 +2186,9 @@

      Python Type System Conformance Test Results

    Pass Pass PassPass
    tuples_unpackedPass Partial
      @@ -2336,7 +2203,6 @@

      Python Type System Conformance Test Results

    3 / 3 • 100.0% 2 / 3 • 66.7% 3 / 3 • 100.0% 3 / 3 • 100.0%
    + Named tuples
    namedtuples_define_classPass Partial
      @@ -2380,7 +2245,6 @@

      Python Type System Conformance Test Results

    Pass Pass PassPass
    namedtuples_type_compat Pass Pass PassPass
    namedtuples_usagePass Partial
      @@ -2409,7 +2271,6 @@

      Python Type System Conformance Test Results

    4 / 4 • 100.0% 3 / 4 • 75.0% 3.5 / 4 • 87.5% 4 / 4 • 100.0%
    + Enumerations
    Pass Pass PassPass
    enums_definition PassPass Partial
      @@ -2451,12 +2310,6 @@

      Python Type System Conformance Test Results

    enums_expansion - Partial -
      -
    • Does not accept an enum-typed value where a complete union of all literal members is declared, although it treats the two as equivalent for assert_type.
    • -
    -
    Partial
      @@ -2481,7 +2334,6 @@

      Python Type System Conformance Test Results

    enums_member_namesPass Pass
      @@ -2496,7 +2348,6 @@

      Python Type System Conformance Test Results

    enums_member_valuesPass Partial
      @@ -2512,7 +2363,6 @@

      Python Type System Conformance Test Results

    enums_membersPass Partial
      @@ -2537,7 +2387,6 @@

      Python Type System Conformance Test Results

    5.5 / 6 • 91.7% 4.5 / 6 • 75.0% 5.5 / 6 • 91.7% 6 / 6 • 100.0%
    + Type narrowing
    Pass Pass PassPass
    narrowing_typeis Pass Pass PassPass Partial
      @@ -2583,14 +2430,13 @@

      Python Type System Conformance Test Results

    2 / 2 • 100.0% 2 / 2 • 100.0% 2 / 2 • 100.0%2 / 2 • 100.0% 1.5 / 2 • 75.0% 2 / 2 • 100.0%
    + Type checker directives
    Pass Pass PassPass
    directives_cast Pass Pass PassPass
    directives_deprecated Pass Pass PassPass Partial
      @@ -2634,7 +2477,6 @@

      Python Type System Conformance Test Results

    directives_disjoint_base PassPass Partial
      @@ -2653,7 +2495,6 @@

      Python Type System Conformance Test Results

    directives_no_type_checkPass Partial
      @@ -2680,7 +2521,6 @@

      Python Type System Conformance Test Results

    Pass Pass PassPass
    directives_type_checking Pass Pass PassPass
    directives_type_ignorePass Partial
      @@ -2715,7 +2553,6 @@

      Python Type System Conformance Test Results

    Pass Pass PassPass
    directives_type_ignore_file2 Pass Pass PassPass
    directives_version_platformPass Pass
      @@ -2745,7 +2580,6 @@

      Python Type System Conformance Test Results

    11 / 11 • 100.0% 10 / 11 • 90.9% 10.5 / 11 • 95.5% 11 / 11 • 100.0%
    + Historical and deprecated features
    historical_positionalPass Partial
      @@ -2779,7 +2612,6 @@

      Python Type System Conformance Test Results

    1 / 1 • 100.0% 0.5 / 1 • 50.0% 1 / 1 • 100.0% 1 / 1 • 100.0%
    140.5 / 141 • 99.6% 109 / 141 • 77.3% 130 / 141 • 92.2% 138 / 141 • 97.9%pycroscope 0.4.0 pyrefly 1.1.0 pyright 1.1.410ty 0.0.66ty 0.0.67 zuban 0.8.2
    Pass Pass Pass - Partial -
      -
    • Does not reject Self used in a return annotation when self is annotated using another type variable.
    • -
    -
    Pass Pass
    28.5 / 30 • 95.0% 29.5 / 30 • 98.3% 28.5 / 30 • 95.0%26.5 / 30 • 88.3%27 / 30 • 90.0% 30 / 30 • 100.0%
    Partial
      -
    • type[Proto] is not yet supported.
    • -
    • Class objects are not correctly matched against @property protocol members.
    • -
    • ClassVar protocol members are only partially supported.
    • +
    • Does not reject protocol classes where type[Proto] requires a concrete class.
    • +
    • Incorrectly considers instance attributes as satisfying protocol members on class objects.
    Pass Pass Pass Pass - Partial -
      -
    • Has overly lenient handling of calls to type[T] if T is a type variable without an upper bound.
    • -
    -
    Pass Pass
    6 / 6 • 100.0% 5.5 / 6 • 91.7% 6 / 6 • 100.0%4.5 / 6 • 75.0%5 / 6 • 83.3% 6 / 6 • 100.0%
    Pass Pass Pass - Partial -
      -
    • Understands the Hashable protocol as equivalent to object.
    • -
    -
    Pass Pass
    15.5 / 16 • 96.9% 15.5 / 16 • 96.9% 16 / 16 • 100.0%14.5 / 16 • 90.6%15 / 16 • 93.8% 16 / 16 • 100.0%
    130 / 141 • 92.2% 138 / 141 • 97.9% 136 / 141 • 96.5%123.5 / 141 • 87.6%125 / 141 • 88.7% 140 / 141 • 99.3%
    mypy 2.1.0 pycroscope 0.4.0pyrefly 1.1.0pyrefly 1.3.0-dev.1 pyright 1.1.410 ty 0.0.67 zuban 0.8.2 generics_scoping Pass Pass - Partial -
      -
    • Does not implement several scoping checks/restrictions for generics.
    • -
    -
    Pass Pass Partial @@ -925,7 +920,7 @@

    Python Type System Conformance Test Results

    23 / 30 • 76.7% 28.5 / 30 • 95.0%29.5 / 30 • 98.3%30 / 30 • 100.0% 28.5 / 30 • 95.0% 27 / 30 • 90.0% 30 / 30 • 100.0% Pass - Partial -
      -
    • Parameter names are lost when resolving ParamSpec.
    • -
    -
    Pass Pass Pass Pass 3 / 4 • 75.0% 4 / 4 • 100.0%3.5 / 4 • 87.5%4 / 4 • 100.0% 4 / 4 • 100.0% 4 / 4 • 100.0% 4 / 4 • 100.0% Pass - Partial -
      -
    • Converting constructor to callable does not preserve class-scoped type params.
    • -
    -
    Pass Pass Partial @@ -1609,7 +1594,7 @@

    Python Type System Conformance Test Results

    3 / 6 • 50.0% 6 / 6 • 100.0%5.5 / 6 • 91.7%6 / 6 • 100.0% 6 / 6 • 100.0% 5 / 6 • 83.3% 6 / 6 • 100.0% exceptions_context_managers Pass Pass - Partial -
      -
    • Some error suppressing context managers are not detected.
    • -
    -
    Pass Pass Unsupported Pass 1 / 1 • 100.0% 1 / 1 • 100.0%0.5 / 1 • 50.0%1 / 1 • 100.0% 1 / 1 • 100.0% 0 / 1 • 0.0% 1 / 1 • 100.0% 109 / 141 • 77.3% 130 / 141 • 92.2%138 / 141 • 97.9%140 / 141 • 99.3% 136 / 141 • 96.5% 125 / 141 • 88.7% 140 / 141 • 99.3%Pass Pass
    specialtypes_sentinelsUnsupportedPassPass + Partial +
      +
    • Requires the string passed to Sentinel to match the assigned variable name.
    • +
    • This causes valid sentinel types and narrowing operations to be rejected.
    • +
    +
    PassPass
    specialtypes_type @@ -488,12 +503,12 @@

    Python Type System Conformance Test Results

    4.5 / 5 • 90.0%4.5 / 5 • 90.0%5 / 5 • 100.0%5 / 5 • 100.0%4.5 / 5 • 90.0%5 / 5 • 100.0%4.5 / 6 • 75.0%5.5 / 6 • 91.7%6 / 6 • 100.0%5.5 / 6 • 91.7%5.5 / 6 • 91.7%6 / 6 • 100.0%
    109 / 141 • 77.3%130 / 141 • 92.2%140 / 141 • 99.3%136 / 141 • 96.5%125 / 141 • 88.7%140 / 141 • 99.3%109 / 142 • 76.8%131 / 142 • 92.3%141 / 142 • 99.3%136.5 / 142 • 96.1%126 / 142 • 88.7%141 / 142 • 99.3%
    diff --git a/conformance/results/ty/specialtypes_sentinels.toml b/conformance/results/ty/specialtypes_sentinels.toml new file mode 100644 index 000000000..0a2125c36 --- /dev/null +++ b/conformance/results/ty/specialtypes_sentinels.toml @@ -0,0 +1,9 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +specialtypes_sentinels.py:14:11: error[invalid-parameter-default] Default value of type `MISSING` is not assignable to annotated parameter type `int` +specialtypes_sentinels.py:36:7: error[invalid-argument-type] Argument to function `func2` is incorrect: Expected `int | MISSING | SPECIAL`, found `IN_CLASS` +specialtypes_sentinels.py:39:7: error[invalid-argument-type] Argument to function `func3` is incorrect: Expected `int | IN_CLASS`, found `MISSING` +""" diff --git a/conformance/results/zuban/specialtypes_sentinels.toml b/conformance/results/zuban/specialtypes_sentinels.toml new file mode 100644 index 000000000..fc3d0bca4 --- /dev/null +++ b/conformance/results/zuban/specialtypes_sentinels.toml @@ -0,0 +1,9 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +specialtypes_sentinels.py:14: error: Incompatible default for parameter "x" (default has type "Sentinel('')", parameter has type "int") [assignment] +specialtypes_sentinels.py:36: error: Argument 1 to "func2" has incompatible type "Sentinel('Cls.IN_CLASS')"; expected "int | Sentinel('') | Sentinel('SPECIAL')" [arg-type] +specialtypes_sentinels.py:39: error: Argument 1 to "func3" has incompatible type "Sentinel('')"; expected "int | Sentinel('Cls.IN_CLASS')" [arg-type] +""" diff --git a/conformance/tests/specialtypes_sentinels.py b/conformance/tests/specialtypes_sentinels.py new file mode 100644 index 000000000..73c257017 --- /dev/null +++ b/conformance/tests/specialtypes_sentinels.py @@ -0,0 +1,40 @@ +from typing_extensions import Sentinel, assert_type + +# > Sentinel objects may be used in type annotations if they are defined using +# > a simple assignment of the form ``NAME = sentinel('NAME')`` in the +# > global scope or in a class body that is not within a function. + +MISSING = Sentinel("") # name is not required to match the variable name +SPECIAL = Sentinel("SPECIAL") + +class Cls: + IN_CLASS = Sentinel("Cls.IN_CLASS") + + +def func1(x: int = MISSING) -> None: # E: incompatible default + pass + +# > Type checkers must support narrowing union types involving sentinels using the +# > ``is`` and ``is not`` operators + +def func2(x: int | MISSING | SPECIAL = MISSING) -> None: + if x is MISSING: + assert_type(x, MISSING) + else: + assert_type(x, int | SPECIAL) + +def func3(x: int | Cls.IN_CLASS = Cls.IN_CLASS) -> None: + if x is Cls.IN_CLASS: + assert_type(x, Cls.IN_CLASS) + else: + assert_type(x, int) + + +func2(1) # ok +func2(MISSING) # ok +func2(SPECIAL) # ok +func2(Cls.IN_CLASS) # E: incompatible argument + +func3(1) # ok +func3(MISSING) # E: incompatible argument +func3(Cls.IN_CLASS) # ok diff --git a/docs/spec/annotations.rst b/docs/spec/annotations.rst index 085d9277b..558b9b700 100644 --- a/docs/spec/annotations.rst +++ b/docs/spec/annotations.rst @@ -139,7 +139,7 @@ The following grammar describes the allowed elements of type and annotation expr : | : | name : (where name must refer to a valid in-scope class, - : type alias, or TypeVar) + : type alias, TypeVar, or sentinel object) : | name '[' (`maybe_unpacked` | `type_expression_list`) : (',' (`maybe_unpacked` | `type_expression_list`))* ']' : (the `type_expression_list` form is valid only when diff --git a/docs/spec/special-types.rst b/docs/spec/special-types.rst index eab658b07..56e61daa2 100644 --- a/docs/spec/special-types.rst +++ b/docs/spec/special-types.rst @@ -53,6 +53,46 @@ are highly dynamic. When used in a type hint, the expression ``None`` is considered equivalent to ``type(None)``. +.. _ `sentinels`: + +Sentinels +--------- + +Sentinel objects may be used in type annotations to represent themselves:: + + MISSING = sentinel('MISSING') + OTHER = sentinel('OTHER') + + def f(x: int | MISSING = MISSING) -> int: + if x is MISSING: + return 0 + return x + + f(OTHER) # Error, OTHER is not an int or MISSING + f(MISSING) # OK, MISSING is a valid argument + +Sentinels may be created using the ``sentinel()`` built-in in Python 3.15 +and higher. ``typing_extensions`` provides a backport of this function. For +historical reasons the object was first introduced under the name +``typing_extensions.Sentinel``, and later ``typing_extensions.sentinel`` was +added as an alias; type checkers should support both. + +Sentinel objects may be used in type annotations if they are defined using +a simple assignment of the form ``NAME = sentinel('NAME')`` in the +global scope or in a class body that is not within a function. The name of the +variable need not match the string argument passed to ``sentinel()`` but it is +conventional to do so for names in the global scope. + +Type checkers must support narrowing union types involving sentinels using the +``is`` and ``is not`` operators:: + + def g(x: int | MISSING) -> None: + if x is MISSING: + assert_type(x, MISSING) + else: + assert_type(x, int) + + .. _`noreturn`: ``NoReturn`` From 6a9f3530b43ac9210965f855028830a9ec632743 Mon Sep 17 00:00:00 2001 From: Ashish Patel Date: Sat, 8 Aug 2026 10:53:31 +0530 Subject: [PATCH 275/308] Conformance: test @override checks on __init__ and __new__ (#2297) The @override spec requires the overriding method to be assignable to the overridden one, with no exemption for __init__/__new__. Add cases to classes_override.py covering compatible overrides (no error), incompatible overrides decorated with @override (error), and incompatible overrides without @override (allowed). Score results: pyrefly conforms; mypy, pyright, pycroscope, ty, and zuban do not currently honor the check for constructors. Closes #2222 Co-authored-by: Rebecca Chen --- .../results/mypy/classes_override.toml | 10 +++- .../results/pycroscope/classes_override.toml | 9 ++- .../results/pyrefly/classes_override.toml | 2 + .../results/pyright/classes_override.toml | 10 +++- conformance/results/results.html | 58 ++++++++++++++----- conformance/results/ty/classes_override.toml | 9 ++- .../results/zuban/classes_override.toml | 9 ++- conformance/tests/classes_override.py | 48 +++++++++++++++ 8 files changed, 134 insertions(+), 21 deletions(-) diff --git a/conformance/results/mypy/classes_override.toml b/conformance/results/mypy/classes_override.toml index 45cceb4cf..860203f3b 100644 --- a/conformance/results/mypy/classes_override.toml +++ b/conformance/results/mypy/classes_override.toml @@ -1,4 +1,8 @@ -conformant = "Pass" +conformant = "Partial" +notes = """ +Does not honor `@override` compatibility checks for `__init__` and `__new__`: +the incompatible constructor overrides in `ChildC2` are not flagged. +""" output = """ classes_override.py:53: error: Method "method3" is marked as an override, but no base method was found with this name [misc] classes_override.py:56: error: Method "method4" is marked as an override, but no base method was found with this name [misc] @@ -6,6 +10,8 @@ classes_override.py:79: error: Method "static_method1" is marked as an override, classes_override.py:84: error: Method "class_method1" is marked as an override, but no base method was found with this name [misc] classes_override.py:89: error: Method "property1" is marked as an override, but no base method was found with this name [misc] """ -conformance_automated = "Pass" +conformance_automated = "Fail" errors_diff = """ +Lines 134, 135: Expected error (tag 'init') +Lines 137, 138: Expected error (tag 'new') """ diff --git a/conformance/results/pycroscope/classes_override.toml b/conformance/results/pycroscope/classes_override.toml index b73910e7f..b5c0ee4fe 100644 --- a/conformance/results/pycroscope/classes_override.toml +++ b/conformance/results/pycroscope/classes_override.toml @@ -1,5 +1,12 @@ -conformance_automated = "Pass" +conformant = "Partial" +notes = """ +Does not honor `@override` compatibility checks for `__init__` and `__new__`: +the incompatible constructor overrides in `ChildC2` are not flagged. +""" +conformance_automated = "Fail" errors_diff = """ +Lines 134, 135: Expected error (tag 'init') +Lines 137, 138: Expected error (tag 'new') """ output = """ ./classes_override.py:53:4: Method does not override any base method [override_does_not_override] diff --git a/conformance/results/pyrefly/classes_override.toml b/conformance/results/pyrefly/classes_override.toml index cb376ba0b..bfb18ccfd 100644 --- a/conformance/results/pyrefly/classes_override.toml +++ b/conformance/results/pyrefly/classes_override.toml @@ -8,4 +8,6 @@ ERROR classes_override.py:57:9-16: Class member `ChildA.method4` is marked as an ERROR classes_override.py:79:9-23: Class member `ChildA.static_method1` is marked as an override, but no parent class has a matching attribute [bad-override] ERROR classes_override.py:84:9-22: Class member `ChildA.class_method1` is marked as an override, but no parent class has a matching attribute [bad-override] ERROR classes_override.py:89:9-18: Class member `ChildA.property1` is marked as an override, but no parent class has a matching attribute [bad-override] +ERROR classes_override.py:135:9-17: Class member `ChildC2.__init__` overrides parent class `ParentC` in an inconsistent manner [bad-override] +ERROR classes_override.py:138:9-16: Class member `ChildC2.__new__` overrides parent class `ParentC` in an inconsistent manner [bad-override] """ diff --git a/conformance/results/pyright/classes_override.toml b/conformance/results/pyright/classes_override.toml index d27bd43de..42cda7e34 100644 --- a/conformance/results/pyright/classes_override.toml +++ b/conformance/results/pyright/classes_override.toml @@ -1,4 +1,8 @@ -conformant = "Pass" +conformant = "Partial" +notes = """ +Does not honor `@override` compatibility checks for `__init__` and `__new__`: +the incompatible constructor overrides in `ChildC2` are not flagged. +""" output = """ classes_override.py:53:9 - error: Method "method3" is marked as override, but no base method of same name is present (reportGeneralTypeIssues) classes_override.py:65:9 - error: Method "method4" is marked as override, but no base method of same name is present (reportGeneralTypeIssues) @@ -6,6 +10,8 @@ classes_override.py:79:9 - error: Method "static_method1" is marked as override, classes_override.py:84:9 - error: Method "class_method1" is marked as override, but no base method of same name is present (reportGeneralTypeIssues) classes_override.py:89:9 - error: Method "property1" is marked as override, but no base method of same name is present (reportGeneralTypeIssues) """ -conformance_automated = "Pass" +conformance_automated = "Fail" errors_diff = """ +Lines 134, 135: Expected error (tag 'init') +Lines 137, 138: Expected error (tag 'new') """ diff --git a/conformance/results/results.html b/conformance/results/results.html index 44b7924b0..d0ca6ff83 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -1032,21 +1032,51 @@

    Python Type System Conformance Test Results

    classes_override + Partial +
      +
    • Does not honor @override compatibility checks for __init__ and __new__:
    • +
    • the incompatible constructor overrides in ChildC2 are not flagged.
    • +
    +
    + Partial +
      +
    • Does not honor @override compatibility checks for __init__ and __new__:
    • +
    • the incompatible constructor overrides in ChildC2 are not flagged.
    • +
    +
    PassPassPassPassPassPass + Partial +
      +
    • Does not honor @override compatibility checks for __init__ and __new__:
    • +
    • the incompatible constructor overrides in ChildC2 are not flagged.
    • +
    +
    + Partial +
      +
    • Does not honor @override compatibility checks for __init__ and __new__:
    • +
    • the incompatible constructor overrides in ChildC2 are not flagged.
    • +
    +
    + Partial +
      +
    • Does not honor @override compatibility checks for __init__ and __new__:
    • +
    • the incompatible constructor overrides in ChildC2 are not flagged.
    • +
    +
    1 / 2 • 50.0% 1.5 / 2 • 75.0% 2 / 2 • 100.0%2 / 2 • 100.0%2 / 2 • 100.0%2 / 2 • 100.0%2 / 2 • 100.0%1.5 / 2 • 75.0%1.5 / 2 • 75.0%1.5 / 2 • 75.0%
    109 / 142 • 76.8%131 / 142 • 92.3%141 / 142 • 99.3%136.5 / 142 • 96.1%126 / 142 • 88.7%108.5 / 142 • 76.4%130.5 / 142 • 91.9% 141 / 142 • 99.3%136 / 142 • 95.8%125.5 / 142 • 88.4%140.5 / 142 • 98.9%
    diff --git a/conformance/results/ty/classes_override.toml b/conformance/results/ty/classes_override.toml index 52cef47dd..90cb245d6 100644 --- a/conformance/results/ty/classes_override.toml +++ b/conformance/results/ty/classes_override.toml @@ -1,5 +1,12 @@ -conformance_automated = "Pass" +conformant = "Partial" +notes = """ +Does not honor `@override` compatibility checks for `__init__` and `__new__`: +the incompatible constructor overrides in `ChildC2` are not flagged. +""" +conformance_automated = "Fail" errors_diff = """ +Lines 134, 135: Expected error (tag 'init') +Lines 137, 138: Expected error (tag 'new') """ output = """ classes_override.py:53:9: error[invalid-explicit-override] Method `method3` is decorated with `@override` but does not override anything diff --git a/conformance/results/zuban/classes_override.toml b/conformance/results/zuban/classes_override.toml index 6bc2112ca..b33df3dd6 100644 --- a/conformance/results/zuban/classes_override.toml +++ b/conformance/results/zuban/classes_override.toml @@ -1,5 +1,12 @@ -conformance_automated = "Pass" +conformant = "Partial" +notes = """ +Does not honor `@override` compatibility checks for `__init__` and `__new__`: +the incompatible constructor overrides in `ChildC2` are not flagged. +""" +conformance_automated = "Fail" errors_diff = """ +Lines 134, 135: Expected error (tag 'init') +Lines 137, 138: Expected error (tag 'new') """ output = """ classes_override.py:53: error: Method "method3" is marked as an override, but no base method was found with this name [misc] diff --git a/conformance/tests/classes_override.py b/conformance/tests/classes_override.py index 831e37d05..0bbf5eacd 100644 --- a/conformance/tests/classes_override.py +++ b/conformance/tests/classes_override.py @@ -100,3 +100,51 @@ class ChildB(ParentB): @override def method1(self) -> None: # OK pass + + +# > When type checkers encounter a method decorated with @typing.override they +# > should treat it as a type error unless that method is overriding a method or +# > attribute in some ancestor class, and the type of the overriding method is +# > assignable to the type of the overridden method. + +# ``__init__`` and ``__new__`` are normally exempt from override compatibility +# checks, since constructors are not subject to the Liskov substitution +# principle. However, when they are explicitly decorated with ``@override`` the +# decorator's assignability check should still be honored. +# See https://github.com/python/typing/issues/2222 + + +class ParentC: + def __init__(self, x: int) -> None: ... + + def __new__(cls, x: int) -> "ParentC": + raise NotImplementedError + + +class ChildC1(ParentC): + @override + def __init__(self, x: int) -> None: ... # OK + + @override + def __new__(cls, x: int) -> "ChildC1": # OK + raise NotImplementedError + + +class ChildC2(ParentC): + @override # E[init] + def __init__(self, x: str) -> None: ... # E[init]: not assignable to "ParentC.__init__" + + @override # E[new] + def __new__(cls, x: str) -> "ChildC2": # E[new]: not assignable to "ParentC.__new__" + raise NotImplementedError + + +# Without ``@override`` an incompatible constructor signature is allowed, since +# ``__init__`` and ``__new__`` are exempt from the usual override checks. + + +class ChildC3(ParentC): + def __init__(self, x: str) -> None: ... # OK + + def __new__(cls, x: str) -> "ChildC3": # OK + raise NotImplementedError From 179780a6ed26ce03ad5518693b8a0faefc8a8b74 Mon Sep 17 00:00:00 2001 From: Danny Yang Date: Sat, 8 Aug 2026 04:56:45 -0400 Subject: [PATCH 276/308] [docs] Add references to relevant Pyrefly sub-commands in tooling sections (#2334) --- docs/guides/writing_stubs.rst | 11 +++++++++++ docs/index.rst | 4 +++- docs/reference/quality.rst | 12 ++++++++++++ 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/docs/guides/writing_stubs.rst b/docs/guides/writing_stubs.rst index 9f46a94d7..3039e8160 100644 --- a/docs/guides/writing_stubs.rst +++ b/docs/guides/writing_stubs.rst @@ -40,6 +40,17 @@ stubs serve more as a starting point. For more details, see `pyright docs `__. +pyrefly +------- + +Pyrefly also contains a tool to generate stubs. Unlike stubgen and pyright, this tool will aggressively infer types for un-annotated code, including function parameters, resulting in stubs that contain more non-``Any`` annotations. + +.. code-block:: console + + pyrefly stubgen path/to/directory/ + +For more details, see `pyrefly docs `__. + monkeytype ---------- diff --git a/docs/index.rst b/docs/index.rst index 35857a09c..93f773ac5 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -105,7 +105,7 @@ Development Environments * `PyCharm `_, an IDE that supports type stubs both for type checking and code completion. * `Visual Studio Code `_, a code editor that - supports type checking using mypy, pyright, or the + supports type checking using mypy, pyrefly, pyright, ty, Zuban, or the `Pylance `_ extension. @@ -130,3 +130,5 @@ Type-Hint and Stub Integration a thin wrapper around ``ApplyTypeAnnotationsVisitor`` from `libCST `_ that integrates .pyi signatures as inline type-hints in Python source code. +* `pyrefly infer `_, a sub-command of Pyrefly which + inserts the types that Pyrefly infers as inline type-hints. diff --git a/docs/reference/quality.rst b/docs/reference/quality.rst index c8fed8332..19918fcb4 100644 --- a/docs/reference/quality.rst +++ b/docs/reference/quality.rst @@ -221,3 +221,15 @@ Mypy reports Mypy offers several options for generating reports on its analysis. See `the mypy documentation on report generation `_ for details. + + +Pyrefly coverage +---------------- + +Pyrefly offers a sub-command for measuring and checking type coverage. + +- ``pyrefly coverage check`` fails when coverage is below a threshold, useful as a CI gate. +- ``pyrefly coverage report`` emits a JSON report with per-module statistics. + +See `the Pyrefly docs on measuring type coverage +`_ for details. From fa0a78a67b2844561c0281f3b9e5eb9464e12750 Mon Sep 17 00:00:00 2001 From: Randolf Scholz Date: Sat, 8 Aug 2026 18:16:02 +0200 Subject: [PATCH 277/308] added variance inference test with method scoped type variable (#2287) added variance inference test with method scoped type variable and bound self type --- .../mypy/generics_variance_inference.toml | 12 +++++++-- .../generics_variance_inference.toml | 1 + .../pyrefly/generics_variance_inference.toml | 1 + .../pyright/generics_variance_inference.toml | 4 +++ conformance/results/results.html | 26 ++++++++++++++----- .../ty/generics_variance_inference.toml | 1 + .../zuban/generics_variance_inference.toml | 12 ++++++++- .../tests/generics_variance_inference.py | 11 ++++++++ 8 files changed, 59 insertions(+), 9 deletions(-) diff --git a/conformance/results/mypy/generics_variance_inference.toml b/conformance/results/mypy/generics_variance_inference.toml index b1158c7e9..761c10490 100644 --- a/conformance/results/mypy/generics_variance_inference.toml +++ b/conformance/results/mypy/generics_variance_inference.toml @@ -1,4 +1,9 @@ -conformant = "Pass" +conformant = "Partial" +notes = """ +polymorphic functions with bound self type influence variance inference, +which is not part of the variance inference algorithm as described in the spec. +See gh-2281 for details. +""" output = """ generics_variance_inference.py:24: error: Incompatible types in assignment (expression has type "ClassA[float, int, int]", variable has type "ClassA[int, int, int]") [assignment] generics_variance_inference.py:25: error: Incompatible types in assignment (expression has type "ClassA[float, int, int]", variable has type "ClassA[float, float, int]") [assignment] @@ -23,7 +28,10 @@ generics_variance_inference.py:169: error: Incompatible types in assignment (exp generics_variance_inference.py:170: error: Incompatible types in assignment (expression has type "ShouldBeInvariant6[int]", variable has type "ShouldBeInvariant6[float]") [assignment] generics_variance_inference.py:181: error: Incompatible types in assignment (expression has type "ShouldBeCovariant6[float]", variable has type "ShouldBeCovariant6[int]") [assignment] generics_variance_inference.py:194: error: Incompatible types in assignment (expression has type "ShouldBeContravariant2[int]", variable has type "ShouldBeContravariant2[float]") [assignment] +generics_variance_inference.py:204: error: Incompatible types in assignment (expression has type "ShouldBeCovariant7[int]", variable has type "ShouldBeCovariant7[object]") [assignment] +generics_variance_inference.py:205: error: Incompatible types in assignment (expression has type "ShouldBeCovariant7[object]", variable has type "ShouldBeCovariant7[int]") [assignment] """ -conformance_automated = "Pass" +conformance_automated = "Fail" errors_diff = """ +Line 204: Unexpected errors ['generics_variance_inference.py:204: error: Incompatible types in assignment (expression has type "ShouldBeCovariant7[int]", variable has type "ShouldBeCovariant7[object]") [assignment]'] """ diff --git a/conformance/results/pycroscope/generics_variance_inference.toml b/conformance/results/pycroscope/generics_variance_inference.toml index 56b1fa57b..e968d354f 100644 --- a/conformance/results/pycroscope/generics_variance_inference.toml +++ b/conformance/results/pycroscope/generics_variance_inference.toml @@ -25,4 +25,5 @@ output = """ ./generics_variance_inference.py:170:0: Incompatible assignment: expected generics_variance_inference.ShouldBeInvariant6[float | int], got generics_variance_inference.ShouldBeInvariant6[int] [incompatible_assignment] ./generics_variance_inference.py:181:0: Incompatible assignment: expected generics_variance_inference.ShouldBeCovariant6[int], got generics_variance_inference.ShouldBeCovariant6[float | int] [incompatible_assignment] ./generics_variance_inference.py:194:0: Incompatible assignment: expected generics_variance_inference.ShouldBeContravariant2[float | int], got generics_variance_inference.ShouldBeContravariant2[int] [incompatible_assignment] +./generics_variance_inference.py:205:0: Incompatible assignment: expected generics_variance_inference.ShouldBeCovariant7[int], got generics_variance_inference.ShouldBeCovariant7[object] [incompatible_assignment] """ diff --git a/conformance/results/pyrefly/generics_variance_inference.toml b/conformance/results/pyrefly/generics_variance_inference.toml index 8035068c3..612ceca73 100644 --- a/conformance/results/pyrefly/generics_variance_inference.toml +++ b/conformance/results/pyrefly/generics_variance_inference.toml @@ -26,4 +26,5 @@ ERROR generics_variance_inference.py:169:31-58: `ShouldBeInvariant6[float]` is n ERROR generics_variance_inference.py:170:33-58: `ShouldBeInvariant6[int]` is not assignable to `ShouldBeInvariant6[float]` [bad-assignment] ERROR generics_variance_inference.py:181:31-58: `ShouldBeCovariant6[float]` is not assignable to `ShouldBeCovariant6[int]` [bad-assignment] ERROR generics_variance_inference.py:194:37-66: `ShouldBeContravariant2[int]` is not assignable to `ShouldBeContravariant2[float]` [bad-assignment] +ERROR generics_variance_inference.py:205:31-59: `ShouldBeCovariant7[object]` is not assignable to `ShouldBeCovariant7[int]` [bad-assignment] """ diff --git a/conformance/results/pyright/generics_variance_inference.toml b/conformance/results/pyright/generics_variance_inference.toml index 9a378ad6f..1bbd86ed4 100644 --- a/conformance/results/pyright/generics_variance_inference.toml +++ b/conformance/results/pyright/generics_variance_inference.toml @@ -79,6 +79,10 @@ generics_variance_inference.py:194:37 - error: Type "ShouldBeContravariant2[int]   "ShouldBeContravariant2[int]" is not assignable to "ShouldBeContravariant2[float]"     Type parameter "T@ShouldBeContravariant2" is contravariant, but "int" is not a supertype of "float"       "float" is not assignable to "int" (reportAssignmentType) +generics_variance_inference.py:205:31 - error: Type "ShouldBeCovariant7[object]" is not assignable to declared type "ShouldBeCovariant7[int]" +  "ShouldBeCovariant7[object]" is not assignable to "ShouldBeCovariant7[int]" +    Type parameter "T@ShouldBeCovariant7" is covariant, but "object" is not a subtype of "int" +      "object" is not assignable to "int" (reportAssignmentType) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/results.html b/conformance/results/results.html index d0ca6ff83..b342504bf 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -924,21 +924,35 @@

    Python Type System Conformance Test Results

    generics_variance_inference + Partial +
      +
    • polymorphic functions with bound self type influence variance inference,
    • +
    • which is not part of the variance inference algorithm as described in the spec.
    • +
    • See gh-2281 for details.
    • +
    +
    Pass Pass Pass PassPassPass + Partial +
      +
    • polymorphic functions with bound self type influence variance inference,
    • +
    • which is not part of the variance inference algorithm as described in the spec.
    • +
    • See gh-2281 for details.
    • +
    +
    23 / 30 • 76.7%22.5 / 30 • 75.0% 28.5 / 30 • 95.0% 30 / 30 • 100.0% 28.5 / 30 • 95.0% 27 / 30 • 90.0%30 / 30 • 100.0%29.5 / 30 • 98.3%
    108.5 / 142 • 76.4%108 / 142 • 76.1% 130.5 / 142 • 91.9% 141 / 142 • 99.3% 136 / 142 • 95.8% 125.5 / 142 • 88.4%140.5 / 142 • 98.9%140 / 142 • 98.6%
    diff --git a/conformance/results/ty/generics_variance_inference.toml b/conformance/results/ty/generics_variance_inference.toml index 1c637eecf..110ceaa3a 100644 --- a/conformance/results/ty/generics_variance_inference.toml +++ b/conformance/results/ty/generics_variance_inference.toml @@ -25,4 +25,5 @@ generics_variance_inference.py:169:31: error[invalid-assignment] Object of type generics_variance_inference.py:170:33: error[invalid-assignment] Object of type `ShouldBeInvariant6[int]` is not assignable to `ShouldBeInvariant6[int | float]` generics_variance_inference.py:181:31: error[invalid-assignment] Object of type `ShouldBeCovariant6[int | float]` is not assignable to `ShouldBeCovariant6[int]` generics_variance_inference.py:194:37: error[invalid-assignment] Object of type `ShouldBeContravariant2[int]` is not assignable to `ShouldBeContravariant2[int | float]` +generics_variance_inference.py:205:31: error[invalid-assignment] Object of type `ShouldBeCovariant7[object]` is not assignable to `ShouldBeCovariant7[int]` """ diff --git a/conformance/results/zuban/generics_variance_inference.toml b/conformance/results/zuban/generics_variance_inference.toml index 722cb1739..7e9a0604a 100644 --- a/conformance/results/zuban/generics_variance_inference.toml +++ b/conformance/results/zuban/generics_variance_inference.toml @@ -1,5 +1,12 @@ -conformance_automated = "Pass" +conformant = "Partial" +notes = """ +polymorphic functions with bound self type influence variance inference, +which is not part of the variance inference algorithm as described in the spec. +See gh-2281 for details. +""" +conformance_automated = "Fail" errors_diff = """ +Line 200: Unexpected errors ['generics_variance_inference.py:200: error: Name "S" is not defined [name-defined]', 'generics_variance_inference.py:200: error: Name "S" is not defined [name-defined]'] """ output = """ generics_variance_inference.py:24: error: Incompatible types in assignment (expression has type "ClassA[float, int, int]", variable has type "ClassA[int, int, int]") [assignment] @@ -25,4 +32,7 @@ generics_variance_inference.py:169: error: Incompatible types in assignment (exp generics_variance_inference.py:170: error: Incompatible types in assignment (expression has type "ShouldBeInvariant6[int]", variable has type "ShouldBeInvariant6[float]") [assignment] generics_variance_inference.py:181: error: Incompatible types in assignment (expression has type "ShouldBeCovariant6[float]", variable has type "ShouldBeCovariant6[int]") [assignment] generics_variance_inference.py:194: error: Incompatible types in assignment (expression has type "ShouldBeContravariant2[int]", variable has type "ShouldBeContravariant2[float]") [assignment] +generics_variance_inference.py:200: error: Name "S" is not defined [name-defined] +generics_variance_inference.py:200: error: Name "S" is not defined [name-defined] +generics_variance_inference.py:205: error: Incompatible types in assignment (expression has type "ShouldBeCovariant7[object]", variable has type "ShouldBeCovariant7[int]") [assignment] """ diff --git a/conformance/tests/generics_variance_inference.py b/conformance/tests/generics_variance_inference.py index 0a1cd41cd..a1fde4da7 100644 --- a/conformance/tests/generics_variance_inference.py +++ b/conformance/tests/generics_variance_inference.py @@ -192,3 +192,14 @@ class ShouldBeContravariant2[T](Parent_Contravariant[T]): c1: ShouldBeContravariant2[int] = ShouldBeContravariant2[float]() # OK c2: ShouldBeContravariant2[float] = ShouldBeContravariant2[int]() # E + +class ShouldBeCovariant7[T]: + def get(self) -> T: + raise NotImplementedError + + def add[S](self: "ShouldBeCovariant7[S]", other: list[S]) -> "ShouldBeCovariant7[S]": + raise NotImplementedError + + +d1: ShouldBeCovariant7[object] = ShouldBeCovariant7[int]() # OK +d2: ShouldBeCovariant7[int] = ShouldBeCovariant7[object]() # E From 043e01d99dfdbfdf671f0de47f04ec6d7bf1c791 Mon Sep 17 00:00:00 2001 From: Danny Yang Date: Mon, 10 Aug 2026 14:26:57 -0400 Subject: [PATCH 278/308] Add conformance tests to disallow ClassVar/Final in NamedTuple and TypedDict (#2335) add tests for ClassVar/Final in NamedTuple and TypedDict --- .../results/mypy/classes_classvar.toml | 46 ++++++++++--------- .../mypy/qualifiers_final_annotation.toml | 34 +++++++------- .../results/pycroscope/classes_classvar.toml | 40 +++++++++------- .../qualifiers_final_annotation.toml | 24 +++++----- .../results/pyrefly/classes_classvar.toml | 44 +++++++++--------- .../pyrefly/qualifiers_final_annotation.toml | 28 +++++------ .../results/pyright/classes_classvar.toml | 34 +++++++------- .../pyright/qualifiers_final_annotation.toml | 28 ++++++----- conformance/results/results.html | 11 +++-- conformance/results/ty/classes_classvar.toml | 34 +++++++------- .../ty/qualifiers_final_annotation.toml | 26 ++++++----- .../results/zuban/classes_classvar.toml | 40 ++++++++-------- .../zuban/qualifiers_final_annotation.toml | 26 ++++++----- conformance/tests/classes_classvar.py | 16 +++++++ .../tests/qualifiers_final_annotation.py | 16 ++++++- 15 files changed, 256 insertions(+), 191 deletions(-) diff --git a/conformance/results/mypy/classes_classvar.toml b/conformance/results/mypy/classes_classvar.toml index 853c49684..238b36032 100644 --- a/conformance/results/mypy/classes_classvar.toml +++ b/conformance/results/mypy/classes_classvar.toml @@ -6,32 +6,34 @@ Rejects `ClassVar` nested in `Annotated`. Does not reject use of `ClassVar` in `TypeAlias` definition. """ output = """ -classes_classvar.py:38: error: ClassVar[...] must have at most one type argument [valid-type] -classes_classvar.py:39: error: Invalid type: try using Literal[3] instead? [valid-type] -classes_classvar.py:40: error: Name "var" is not defined; did you mean "var1" or "vars"? [name-defined] -classes_classvar.py:52: error: Incompatible types in assignment (expression has type "dict[Never, Never]", variable has type "list[str]") [assignment] -classes_classvar.py:54: error: Variable should not be annotated with both ClassVar and Final [misc] -classes_classvar.py:55: error: Invalid type: ClassVar nested inside other type [valid-type] -classes_classvar.py:67: error: Invalid type: ClassVar nested inside other type [valid-type] -classes_classvar.py:69: error: ClassVar can only be used for assignments in class body [misc] -classes_classvar.py:70: error: ClassVar can only be used for assignments in class body [misc] +classes_classvar.py:40: error: ClassVar[...] must have at most one type argument [valid-type] +classes_classvar.py:41: error: Invalid type: try using Literal[3] instead? [valid-type] +classes_classvar.py:42: error: Name "var" is not defined; did you mean "var1" or "vars"? [name-defined] +classes_classvar.py:54: error: Incompatible types in assignment (expression has type "dict[Never, Never]", variable has type "list[str]") [assignment] +classes_classvar.py:56: error: Variable should not be annotated with both ClassVar and Final [misc] +classes_classvar.py:57: error: Invalid type: ClassVar nested inside other type [valid-type] +classes_classvar.py:69: error: Invalid type: ClassVar nested inside other type [valid-type] classes_classvar.py:71: error: ClassVar can only be used for assignments in class body [misc] +classes_classvar.py:72: error: ClassVar can only be used for assignments in class body [misc] classes_classvar.py:73: error: ClassVar can only be used for assignments in class body [misc] -classes_classvar.py:77: error: ClassVar can only be used for assignments in class body [misc] -classes_classvar.py:78: error: ClassVar[...] can't be used inside a type alias [valid-type] -classes_classvar.py:111: error: Cannot assign to class variable "stats" via instance [misc] -classes_classvar.py:130: error: All protocol members must have explicitly declared types [misc] -classes_classvar.py:140: error: Incompatible types in assignment (expression has type "ProtoAImpl", variable has type "ProtoA") [assignment] -classes_classvar.py:140: note: "ProtoAImpl" is missing following "ProtoA" protocol member: -classes_classvar.py:140: note: z -classes_classvar.py:140: note: Protocol member ProtoA.x expected class variable, got instance variable -classes_classvar.py:140: note: Protocol member ProtoA.y expected class variable, got instance variable +classes_classvar.py:75: error: ClassVar can only be used for assignments in class body [misc] +classes_classvar.py:79: error: ClassVar can only be used for assignments in class body [misc] +classes_classvar.py:80: error: ClassVar[...] can't be used inside a type alias [valid-type] +classes_classvar.py:89: error: ClassVar[...] can't be used inside a TypedDict [valid-type] +classes_classvar.py:94: error: ClassVar[...] can't be used inside a NamedTuple [valid-type] +classes_classvar.py:127: error: Cannot assign to class variable "stats" via instance [misc] +classes_classvar.py:146: error: All protocol members must have explicitly declared types [misc] +classes_classvar.py:156: error: Incompatible types in assignment (expression has type "ProtoAImpl", variable has type "ProtoA") [assignment] +classes_classvar.py:156: note: "ProtoAImpl" is missing following "ProtoA" protocol member: +classes_classvar.py:156: note: z +classes_classvar.py:156: note: Protocol member ProtoA.x expected class variable, got instance variable +classes_classvar.py:156: note: Protocol member ProtoA.y expected class variable, got instance variable """ conformance_automated = "Fail" errors_diff = """ -Line 45: Expected 1 errors -Line 46: Expected 1 errors Line 47: Expected 1 errors -Line 67: Unexpected errors ['classes_classvar.py:67: error: Invalid type: ClassVar nested inside other type [valid-type]'] -Line 130: Unexpected errors ['classes_classvar.py:130: error: All protocol members must have explicitly declared types [misc]'] +Line 48: Expected 1 errors +Line 49: Expected 1 errors +Line 69: Unexpected errors ['classes_classvar.py:69: error: Invalid type: ClassVar nested inside other type [valid-type]'] +Line 146: Unexpected errors ['classes_classvar.py:146: error: All protocol members must have explicitly declared types [misc]'] """ diff --git a/conformance/results/mypy/qualifiers_final_annotation.toml b/conformance/results/mypy/qualifiers_final_annotation.toml index 137e9f808..099d55b0c 100644 --- a/conformance/results/mypy/qualifiers_final_annotation.toml +++ b/conformance/results/mypy/qualifiers_final_annotation.toml @@ -24,25 +24,27 @@ qualifiers_final_annotation.py:107: error: Final can be only used as an outermos qualifiers_final_annotation.py:108: error: Variable should not be annotated with both ClassVar and Final [misc] qualifiers_final_annotation.py:118: error: Final can be only used as an outermost qualifier in a variable annotation [valid-type] qualifiers_final_annotation.py:121: error: Final can be only used as an outermost qualifier in a variable annotation [valid-type] -qualifiers_final_annotation.py:131: error: Invalid "NamedTuple()" field name [misc] -qualifiers_final_annotation.py:133: error: Unexpected keyword argument "x" for "N" [call-arg] -qualifiers_final_annotation.py:133: error: Unexpected keyword argument "y" for "N" [call-arg] -qualifiers_final_annotation.py:134: error: Unexpected keyword argument "a" for "N" [call-arg] -qualifiers_final_annotation.py:135: error: Unexpected keyword argument "x" for "N" [call-arg] -qualifiers_final_annotation.py:135: error: Unexpected keyword argument "y" for "N" [call-arg] -qualifiers_final_annotation.py:141: error: Cannot assign to final name "ID1" [misc] -qualifiers_final_annotation.py:145: error: Cannot assign to final name "x" [misc] -qualifiers_final_annotation.py:147: error: Cannot assign to final name "x" [misc] -qualifiers_final_annotation.py:152: error: Incompatible types in assignment (expression has type "TextIOWrapper[_WrappedBuffer]", variable has type "int") [assignment] -qualifiers_final_annotation.py:155: error: Cannot assign to final name "x" [misc] -qualifiers_final_annotation.py:166: error: Cannot assign to final name "TEN" [misc] -qualifiers_final_annotation.py:170: error: Cannot assign to final name "PI" [misc] +qualifiers_final_annotation.py:131: error: Final[...] can't be used inside a TypedDict [valid-type] +qualifiers_final_annotation.py:136: error: Final[...] can't be used inside a NamedTuple [valid-type] +qualifiers_final_annotation.py:145: error: Invalid "NamedTuple()" field name [misc] +qualifiers_final_annotation.py:147: error: Unexpected keyword argument "x" for "N" [call-arg] +qualifiers_final_annotation.py:147: error: Unexpected keyword argument "y" for "N" [call-arg] +qualifiers_final_annotation.py:148: error: Unexpected keyword argument "a" for "N" [call-arg] +qualifiers_final_annotation.py:149: error: Unexpected keyword argument "x" for "N" [call-arg] +qualifiers_final_annotation.py:149: error: Unexpected keyword argument "y" for "N" [call-arg] +qualifiers_final_annotation.py:155: error: Cannot assign to final name "ID1" [misc] +qualifiers_final_annotation.py:159: error: Cannot assign to final name "x" [misc] +qualifiers_final_annotation.py:161: error: Cannot assign to final name "x" [misc] +qualifiers_final_annotation.py:166: error: Incompatible types in assignment (expression has type "TextIOWrapper[_WrappedBuffer]", variable has type "int") [assignment] +qualifiers_final_annotation.py:169: error: Cannot assign to final name "x" [misc] +qualifiers_final_annotation.py:180: error: Cannot assign to final name "TEN" [misc] +qualifiers_final_annotation.py:184: error: Cannot assign to final name "PI" [misc] """ conformance_automated = "Fail" errors_diff = """ -Line 149: Expected 1 errors +Line 163: Expected 1 errors Line 59: Unexpected errors ['qualifiers_final_annotation.py:59: error: Cannot assign to final attribute "ID6" [misc]'] Line 96: Unexpected errors ['qualifiers_final_annotation.py:96: error: Cannot assign to final name "__private" [misc]'] -Line 131: Unexpected errors ['qualifiers_final_annotation.py:131: error: Invalid "NamedTuple()" field name [misc]'] -Line 133: Unexpected errors ['qualifiers_final_annotation.py:133: error: Unexpected keyword argument "x" for "N" [call-arg]', 'qualifiers_final_annotation.py:133: error: Unexpected keyword argument "y" for "N" [call-arg]'] +Line 145: Unexpected errors ['qualifiers_final_annotation.py:145: error: Invalid "NamedTuple()" field name [misc]'] +Line 147: Unexpected errors ['qualifiers_final_annotation.py:147: error: Unexpected keyword argument "x" for "N" [call-arg]', 'qualifiers_final_annotation.py:147: error: Unexpected keyword argument "y" for "N" [call-arg]'] """ diff --git a/conformance/results/pycroscope/classes_classvar.toml b/conformance/results/pycroscope/classes_classvar.toml index a377b105f..23479ff47 100644 --- a/conformance/results/pycroscope/classes_classvar.toml +++ b/conformance/results/pycroscope/classes_classvar.toml @@ -1,22 +1,28 @@ -conformance_automated = "Pass" +conformant = "Partial" +notes = """ +Does not reject use of `ClassVar` as a qualifier for a NamedTuple field. +""" +conformance_automated = "Fail" errors_diff = """ +Line 94: Expected 1 errors """ output = """ -./classes_classvar.py:38:10: Invalid type annotation (, ) [invalid_annotation] -./classes_classvar.py:39:10: Invalid type annotation 3 [invalid_annotation] -./classes_classvar.py:40:13: Undefined name: var [undefined_name] -./classes_classvar.py:45:10: ClassVar type cannot include type parameters [classvar_type_parameters] -./classes_classvar.py:46:10: ClassVar type cannot include type parameters [classvar_type_parameters] +./classes_classvar.py:40:10: Invalid type annotation (, ) [invalid_annotation] +./classes_classvar.py:41:10: Invalid type annotation 3 [invalid_annotation] +./classes_classvar.py:42:13: Undefined name: var [undefined_name] ./classes_classvar.py:47:10: ClassVar type cannot include type parameters [classvar_type_parameters] -./classes_classvar.py:52:4: Incompatible assignment: expected list[str], got Literal[{}] [incompatible_assignment] -./classes_classvar.py:54:10: Final cannot be combined with ClassVar [invalid_qualifier] -./classes_classvar.py:55:11: Unrecognized annotation typing.ClassVar[] [invalid_annotation] -./classes_classvar.py:69:25: Unexpected ClassVar annotation [invalid_qualifier] -./classes_classvar.py:70:11: ClassVar can only be used for assignments in class body [invalid_qualifier] -./classes_classvar.py:71:17: ClassVar can only be used for assignments in class body [invalid_qualifier] -./classes_classvar.py:73:25: Unexpected ClassVar annotation [invalid_qualifier] -./classes_classvar.py:77:7: ClassVar can only be used for assignments in class body [invalid_qualifier] -./classes_classvar.py:78:19: ClassVar cannot be used in type aliases [invalid_qualifier] -./classes_classvar.py:111:0: Cannot assign to class variable 'stats' via instance [incompatible_assignment] -./classes_classvar.py:140:0: Incompatible assignment: expected ./classes_classvar.py.ProtoA, got ./classes_classvar.py.ProtoAImpl [incompatible_assignment] +./classes_classvar.py:48:10: ClassVar type cannot include type parameters [classvar_type_parameters] +./classes_classvar.py:49:10: ClassVar type cannot include type parameters [classvar_type_parameters] +./classes_classvar.py:54:4: Incompatible assignment: expected list[str], got Literal[{}] [incompatible_assignment] +./classes_classvar.py:56:10: Final cannot be combined with ClassVar [invalid_qualifier] +./classes_classvar.py:57:11: Unrecognized annotation typing.ClassVar[] [invalid_annotation] +./classes_classvar.py:71:25: Unexpected ClassVar annotation [invalid_qualifier] +./classes_classvar.py:72:11: ClassVar can only be used for assignments in class body [invalid_qualifier] +./classes_classvar.py:73:17: ClassVar can only be used for assignments in class body [invalid_qualifier] +./classes_classvar.py:75:25: Unexpected ClassVar annotation [invalid_qualifier] +./classes_classvar.py:79:7: ClassVar can only be used for assignments in class body [invalid_qualifier] +./classes_classvar.py:80:19: ClassVar cannot be used in type aliases [invalid_qualifier] +./classes_classvar.py:89:7: Unexpected ClassVar annotation [invalid_qualifier] +./classes_classvar.py:127:0: Cannot assign to class variable 'stats' via instance [incompatible_assignment] +./classes_classvar.py:156:0: Incompatible assignment: expected ./classes_classvar.py.ProtoA, got ./classes_classvar.py.ProtoAImpl [incompatible_assignment] """ diff --git a/conformance/results/pycroscope/qualifiers_final_annotation.toml b/conformance/results/pycroscope/qualifiers_final_annotation.toml index 07fc0d812..0784a273e 100644 --- a/conformance/results/pycroscope/qualifiers_final_annotation.toml +++ b/conformance/results/pycroscope/qualifiers_final_annotation.toml @@ -19,15 +19,17 @@ output = """ ./qualifiers_final_annotation.py:108:12: Final cannot be combined with ClassVar [invalid_qualifier] ./qualifiers_final_annotation.py:118:3: Unrecognized annotation typing.Final[] [invalid_annotation] ./qualifiers_final_annotation.py:121:13: Unexpected Final annotation [invalid_qualifier] -./qualifiers_final_annotation.py:134:0: In call to pycroscope.signature.N: Missing required argument 'x' [incompatible_call] -./qualifiers_final_annotation.py:135:4: Incompatible argument type for x: expected int but got Literal[''] [incompatible_argument] -./qualifiers_final_annotation.py:135:10: Incompatible argument type for y: expected int but got Literal[''] [incompatible_argument] -./qualifiers_final_annotation.py:141:4: Cannot assign to final name ID1 [incompatible_assignment] -./qualifiers_final_annotation.py:145:4: Cannot assign to final name x [incompatible_assignment] -./qualifiers_final_annotation.py:147:9: Cannot assign to final name x [incompatible_assignment] -./qualifiers_final_annotation.py:149:8: Cannot assign to final name x [incompatible_assignment] -./qualifiers_final_annotation.py:152:29: Cannot assign to final name x [incompatible_assignment] -./qualifiers_final_annotation.py:155:8: Cannot assign to final name x [incompatible_assignment] -./qualifiers_final_annotation.py:166:0: Cannot assign to final name TEN [incompatible_assignment] -./qualifiers_final_annotation.py:170:0: Cannot assign to final name PI [incompatible_assignment] +./qualifiers_final_annotation.py:131:7: Unexpected Final annotation [invalid_qualifier] +./qualifiers_final_annotation.py:136:4: Final class attributes without initializers must be assigned in __init__ [invalid_qualifier] +./qualifiers_final_annotation.py:148:0: In call to pycroscope.signature.N: Missing required argument 'x' [incompatible_call] +./qualifiers_final_annotation.py:149:4: Incompatible argument type for x: expected int but got Literal[''] [incompatible_argument] +./qualifiers_final_annotation.py:149:10: Incompatible argument type for y: expected int but got Literal[''] [incompatible_argument] +./qualifiers_final_annotation.py:155:4: Cannot assign to final name ID1 [incompatible_assignment] +./qualifiers_final_annotation.py:159:4: Cannot assign to final name x [incompatible_assignment] +./qualifiers_final_annotation.py:161:9: Cannot assign to final name x [incompatible_assignment] +./qualifiers_final_annotation.py:163:8: Cannot assign to final name x [incompatible_assignment] +./qualifiers_final_annotation.py:166:29: Cannot assign to final name x [incompatible_assignment] +./qualifiers_final_annotation.py:169:8: Cannot assign to final name x [incompatible_assignment] +./qualifiers_final_annotation.py:180:0: Cannot assign to final name TEN [incompatible_assignment] +./qualifiers_final_annotation.py:184:0: Cannot assign to final name PI [incompatible_assignment] """ diff --git a/conformance/results/pyrefly/classes_classvar.toml b/conformance/results/pyrefly/classes_classvar.toml index 551f730b1..92c5a5257 100644 --- a/conformance/results/pyrefly/classes_classvar.toml +++ b/conformance/results/pyrefly/classes_classvar.toml @@ -3,25 +3,27 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR classes_classvar.py:38:11-29: Expected 1 type argument for `ClassVar`, got 2 [invalid-annotation] -ERROR classes_classvar.py:39:14-15: Number literal cannot be used in annotations [invalid-annotation] -ERROR classes_classvar.py:40:14-17: Could not find name `var` [unknown-name] -ERROR classes_classvar.py:45:20-21: `ClassVar` arguments may not contain any type variables [invalid-annotation] -ERROR classes_classvar.py:46:20-27: `ClassVar` arguments may not contain any type variables [invalid-annotation] -ERROR classes_classvar.py:47:20-36: `ClassVar` arguments may not contain any type variables [invalid-annotation] -ERROR classes_classvar.py:52:33-35: `dict[@_, @_]` is not assignable to `list[str]` [bad-assignment] -ERROR classes_classvar.py:54:17-30: `ClassVar` may not be nested inside `Final` [invalid-annotation] -ERROR classes_classvar.py:55:17-30: `ClassVar` is not allowed in this context [invalid-annotation] -ERROR classes_classvar.py:69:26-34: `ClassVar` is only allowed inside a class body [invalid-annotation] -ERROR classes_classvar.py:69:26-39: `ClassVar` is not allowed in this context [invalid-annotation] -ERROR classes_classvar.py:70:12-20: `ClassVar` is only allowed inside a class body [invalid-annotation] -ERROR classes_classvar.py:70:12-25: `ClassVar` is not allowed in this context [invalid-annotation] -ERROR classes_classvar.py:71:9-16: Cannot set field `xx` [read-only] -ERROR classes_classvar.py:73:26-34: `ClassVar` is only allowed inside a class body [invalid-annotation] -ERROR classes_classvar.py:73:26-39: `ClassVar` is not allowed in this context [invalid-annotation] -ERROR classes_classvar.py:77:8-16: `ClassVar` is only allowed inside a class body [invalid-annotation] -ERROR classes_classvar.py:77:8-21: `ClassVar` is not allowed in this context [invalid-annotation] -ERROR classes_classvar.py:78:20-33: `ClassVar` is not allowed in this context [invalid-annotation] -ERROR classes_classvar.py:111:1-19: Cannot set field `stats` [read-only] -ERROR classes_classvar.py:140:13-25: `ProtoAImpl` is not assignable to `ProtoA` [bad-assignment] +ERROR classes_classvar.py:40:11-29: Expected 1 type argument for `ClassVar`, got 2 [invalid-annotation] +ERROR classes_classvar.py:41:14-15: Number literal cannot be used in annotations [invalid-annotation] +ERROR classes_classvar.py:42:14-17: Could not find name `var` [unknown-name] +ERROR classes_classvar.py:47:20-21: `ClassVar` arguments may not contain any type variables [invalid-annotation] +ERROR classes_classvar.py:48:20-27: `ClassVar` arguments may not contain any type variables [invalid-annotation] +ERROR classes_classvar.py:49:20-36: `ClassVar` arguments may not contain any type variables [invalid-annotation] +ERROR classes_classvar.py:54:33-35: `dict[@_, @_]` is not assignable to `list[str]` [bad-assignment] +ERROR classes_classvar.py:56:17-30: `ClassVar` may not be nested inside `Final` [invalid-annotation] +ERROR classes_classvar.py:57:17-30: `ClassVar` is not allowed in this context [invalid-annotation] +ERROR classes_classvar.py:71:26-34: `ClassVar` is only allowed inside a class body [invalid-annotation] +ERROR classes_classvar.py:71:26-39: `ClassVar` is not allowed in this context [invalid-annotation] +ERROR classes_classvar.py:72:12-20: `ClassVar` is only allowed inside a class body [invalid-annotation] +ERROR classes_classvar.py:72:12-25: `ClassVar` is not allowed in this context [invalid-annotation] +ERROR classes_classvar.py:73:9-16: Cannot set field `xx` [read-only] +ERROR classes_classvar.py:75:26-34: `ClassVar` is only allowed inside a class body [invalid-annotation] +ERROR classes_classvar.py:75:26-39: `ClassVar` is not allowed in this context [invalid-annotation] +ERROR classes_classvar.py:79:8-16: `ClassVar` is only allowed inside a class body [invalid-annotation] +ERROR classes_classvar.py:79:8-21: `ClassVar` is not allowed in this context [invalid-annotation] +ERROR classes_classvar.py:80:20-33: `ClassVar` is not allowed in this context [invalid-annotation] +ERROR classes_classvar.py:89:5-6: `ClassVar` may not be used for TypedDict members [invalid-annotation] +ERROR classes_classvar.py:94:5-6: `ClassVar` may not be used for NamedTuple members [invalid-annotation] +ERROR classes_classvar.py:127:1-19: Cannot set field `stats` [read-only] +ERROR classes_classvar.py:156:13-25: `ProtoAImpl` is not assignable to `ProtoA` [bad-assignment] """ diff --git a/conformance/results/pyrefly/qualifiers_final_annotation.toml b/conformance/results/pyrefly/qualifiers_final_annotation.toml index eda91ff00..4da0650c7 100644 --- a/conformance/results/pyrefly/qualifiers_final_annotation.toml +++ b/conformance/results/pyrefly/qualifiers_final_annotation.toml @@ -19,17 +19,19 @@ ERROR qualifiers_final_annotation.py:108:19-27: `ClassVar` may not be nested ins ERROR qualifiers_final_annotation.py:118:9-19: `Final` is not allowed in this context [invalid-annotation] ERROR qualifiers_final_annotation.py:121:14-19: `Final` is only allowed on a class or local variable annotation [invalid-annotation] ERROR qualifiers_final_annotation.py:121:14-30: `Final` is not allowed in this context [invalid-annotation] -ERROR qualifiers_final_annotation.py:134:2-7: Missing argument `x` in function `N.__new__` [missing-argument] -ERROR qualifiers_final_annotation.py:134:2-7: Missing argument `y` in function `N.__new__` [missing-argument] -ERROR qualifiers_final_annotation.py:134:3-4: Unexpected keyword argument `a` in function `N.__new__` [unexpected-keyword] -ERROR qualifiers_final_annotation.py:135:5-7: Argument `Literal['']` is not assignable to parameter `x` with type `int` in function `N.__new__` [bad-argument-type] -ERROR qualifiers_final_annotation.py:135:11-13: Argument `Literal['']` is not assignable to parameter `y` with type `int` in function `N.__new__` [bad-argument-type] -ERROR qualifiers_final_annotation.py:141:11-12: Cannot assign to variable `ID1` because it is marked final [bad-assignment] -ERROR qualifiers_final_annotation.py:145:5-11: Cannot assign to variable `x` because it is marked final [bad-assignment] -ERROR qualifiers_final_annotation.py:147:15-16: Cannot assign to variable `x` because it is marked final [bad-assignment] -ERROR qualifiers_final_annotation.py:149:14-23: Cannot assign to variable `x` because it is marked final [bad-assignment] -ERROR qualifiers_final_annotation.py:152:10-26: Cannot assign to variable `x` because it is marked final [bad-assignment] -ERROR qualifiers_final_annotation.py:155:5-11: Cannot assign to variable `x` because it is marked final [bad-assignment] -ERROR qualifiers_final_annotation.py:166:1-4: Cannot assign to `TEN` because it is imported as final [bad-assignment] -ERROR qualifiers_final_annotation.py:170:1-3: Cannot assign to `PI` because it is imported as final [bad-assignment] +ERROR qualifiers_final_annotation.py:131:5-6: `Final` may not be used for TypedDict members [invalid-annotation] +ERROR qualifiers_final_annotation.py:136:5-6: `Final` may not be used for NamedTuple members [invalid-annotation] +ERROR qualifiers_final_annotation.py:148:2-7: Missing argument `x` in function `N.__new__` [missing-argument] +ERROR qualifiers_final_annotation.py:148:2-7: Missing argument `y` in function `N.__new__` [missing-argument] +ERROR qualifiers_final_annotation.py:148:3-4: Unexpected keyword argument `a` in function `N.__new__` [unexpected-keyword] +ERROR qualifiers_final_annotation.py:149:5-7: Argument `Literal['']` is not assignable to parameter `x` with type `int` in function `N.__new__` [bad-argument-type] +ERROR qualifiers_final_annotation.py:149:11-13: Argument `Literal['']` is not assignable to parameter `y` with type `int` in function `N.__new__` [bad-argument-type] +ERROR qualifiers_final_annotation.py:155:11-12: Cannot assign to variable `ID1` because it is marked final [bad-assignment] +ERROR qualifiers_final_annotation.py:159:5-11: Cannot assign to variable `x` because it is marked final [bad-assignment] +ERROR qualifiers_final_annotation.py:161:15-16: Cannot assign to variable `x` because it is marked final [bad-assignment] +ERROR qualifiers_final_annotation.py:163:14-23: Cannot assign to variable `x` because it is marked final [bad-assignment] +ERROR qualifiers_final_annotation.py:166:10-26: Cannot assign to variable `x` because it is marked final [bad-assignment] +ERROR qualifiers_final_annotation.py:169:5-11: Cannot assign to variable `x` because it is marked final [bad-assignment] +ERROR qualifiers_final_annotation.py:180:1-4: Cannot assign to `TEN` because it is imported as final [bad-assignment] +ERROR qualifiers_final_annotation.py:184:1-3: Cannot assign to `PI` because it is imported as final [bad-assignment] """ diff --git a/conformance/results/pyright/classes_classvar.toml b/conformance/results/pyright/classes_classvar.toml index 1b03b11a3..19026e6f9 100644 --- a/conformance/results/pyright/classes_classvar.toml +++ b/conformance/results/pyright/classes_classvar.toml @@ -1,23 +1,25 @@ conformant = "Pass" output = """ -classes_classvar.py:38:25 - error: Expected only one type argument after "ClassVar" (reportInvalidTypeForm) -classes_classvar.py:39:14 - error: Expected class but received "Literal[3]" (reportGeneralTypeIssues) -classes_classvar.py:40:14 - error: "var" is not defined (reportUndefinedVariable) -classes_classvar.py:45:20 - error: "ClassVar" type cannot include type variables (reportGeneralTypeIssues) -classes_classvar.py:46:20 - error: "ClassVar" type cannot include type variables (reportGeneralTypeIssues) +classes_classvar.py:40:25 - error: Expected only one type argument after "ClassVar" (reportInvalidTypeForm) +classes_classvar.py:41:14 - error: Expected class but received "Literal[3]" (reportGeneralTypeIssues) +classes_classvar.py:42:14 - error: "var" is not defined (reportUndefinedVariable) classes_classvar.py:47:20 - error: "ClassVar" type cannot include type variables (reportGeneralTypeIssues) -classes_classvar.py:52:33 - error: Type "dict[Any, Any]" is not assignable to declared type "list[str]" (reportAssignmentType) -classes_classvar.py:54:17 - error: "ClassVar" is not allowed in this context (reportInvalidTypeForm) -classes_classvar.py:55:17 - error: "ClassVar" is not allowed in this context (reportInvalidTypeForm) -classes_classvar.py:69:26 - error: "ClassVar" is not allowed in this context (reportInvalidTypeForm) -classes_classvar.py:70:12 - error: "ClassVar" is not allowed in this context (reportInvalidTypeForm) -classes_classvar.py:71:18 - error: "ClassVar" is not allowed in this context (reportInvalidTypeForm) -classes_classvar.py:73:26 - error: "ClassVar" is not allowed in this context (reportInvalidTypeForm) -classes_classvar.py:77:8 - error: "ClassVar" is not allowed in this context (reportInvalidTypeForm) -classes_classvar.py:78:20 - error: "ClassVar" is not allowed in this context (reportInvalidTypeForm) -classes_classvar.py:111:14 - error: Cannot assign to attribute "stats" for class "Starship" +classes_classvar.py:48:20 - error: "ClassVar" type cannot include type variables (reportGeneralTypeIssues) +classes_classvar.py:49:20 - error: "ClassVar" type cannot include type variables (reportGeneralTypeIssues) +classes_classvar.py:54:33 - error: Type "dict[Any, Any]" is not assignable to declared type "list[str]" (reportAssignmentType) +classes_classvar.py:56:17 - error: "ClassVar" is not allowed in this context (reportInvalidTypeForm) +classes_classvar.py:57:17 - error: "ClassVar" is not allowed in this context (reportInvalidTypeForm) +classes_classvar.py:71:26 - error: "ClassVar" is not allowed in this context (reportInvalidTypeForm) +classes_classvar.py:72:12 - error: "ClassVar" is not allowed in this context (reportInvalidTypeForm) +classes_classvar.py:73:18 - error: "ClassVar" is not allowed in this context (reportInvalidTypeForm) +classes_classvar.py:75:26 - error: "ClassVar" is not allowed in this context (reportInvalidTypeForm) +classes_classvar.py:79:8 - error: "ClassVar" is not allowed in this context (reportInvalidTypeForm) +classes_classvar.py:80:20 - error: "ClassVar" is not allowed in this context (reportInvalidTypeForm) +classes_classvar.py:89:8 - error: "ClassVar" is not allowed in this context (reportInvalidTypeForm) +classes_classvar.py:94:8 - error: "ClassVar" is not allowed in this context (reportInvalidTypeForm) +classes_classvar.py:127:14 - error: Cannot assign to attribute "stats" for class "Starship"   Attribute "stats" cannot be assigned through a class instance because it is a ClassVar (reportAttributeAccessIssue) -classes_classvar.py:140:13 - error: Type "ProtoAImpl" is not assignable to declared type "ProtoA" +classes_classvar.py:156:13 - error: Type "ProtoAImpl" is not assignable to declared type "ProtoA"   "ProtoAImpl" is incompatible with protocol "ProtoA"     "x" is defined as a ClassVar in protocol     "y" is defined as a ClassVar in protocol (reportAssignmentType) diff --git a/conformance/results/pyright/qualifiers_final_annotation.toml b/conformance/results/pyright/qualifiers_final_annotation.toml index 38f55274a..0fb73bda6 100644 --- a/conformance/results/pyright/qualifiers_final_annotation.toml +++ b/conformance/results/pyright/qualifiers_final_annotation.toml @@ -25,20 +25,24 @@ qualifiers_final_annotation.py:107:22 - error: "Final" is not allowed in this co qualifiers_final_annotation.py:108:19 - error: "ClassVar" is not allowed in this context (reportInvalidTypeForm) qualifiers_final_annotation.py:118:9 - error: "Final" is not allowed in this context (reportInvalidTypeForm) qualifiers_final_annotation.py:121:14 - error: "Final" is not allowed in this context (reportInvalidTypeForm) -qualifiers_final_annotation.py:134:1 - error: Arguments missing for parameters "x", "y" (reportCallIssue) -qualifiers_final_annotation.py:134:3 - error: No parameter named "a" (reportCallIssue) -qualifiers_final_annotation.py:135:5 - error: Argument of type "Literal['']" cannot be assigned to parameter "x" of type "int" in function "__new__" +qualifiers_final_annotation.py:131:5 - error: "b" is declared Final, but value is not assigned (reportGeneralTypeIssues) +qualifiers_final_annotation.py:131:8 - error: "Final" is not allowed in this context (reportInvalidTypeForm) +qualifiers_final_annotation.py:136:5 - error: "b" is declared Final, but value is not assigned (reportGeneralTypeIssues) +qualifiers_final_annotation.py:136:8 - error: "Final" is not allowed in this context (reportInvalidTypeForm) +qualifiers_final_annotation.py:148:1 - error: Arguments missing for parameters "x", "y" (reportCallIssue) +qualifiers_final_annotation.py:148:3 - error: No parameter named "a" (reportCallIssue) +qualifiers_final_annotation.py:149:5 - error: Argument of type "Literal['']" cannot be assigned to parameter "x" of type "int" in function "__new__"   "Literal['']" is not assignable to "int" (reportArgumentType) -qualifiers_final_annotation.py:135:11 - error: Argument of type "Literal['']" cannot be assigned to parameter "y" of type "int" in function "__new__" +qualifiers_final_annotation.py:149:11 - error: Argument of type "Literal['']" cannot be assigned to parameter "y" of type "int" in function "__new__"   "Literal['']" is not assignable to "int" (reportArgumentType) -qualifiers_final_annotation.py:141:5 - error: "ID1" is declared as Final and cannot be reassigned (reportGeneralTypeIssues) -qualifiers_final_annotation.py:145:5 - error: "x" is declared as Final and cannot be reassigned (reportGeneralTypeIssues) -qualifiers_final_annotation.py:147:10 - error: "x" is declared as Final and cannot be reassigned (reportGeneralTypeIssues) -qualifiers_final_annotation.py:149:9 - error: "x" is declared as Final and cannot be reassigned (reportGeneralTypeIssues) -qualifiers_final_annotation.py:152:30 - error: "x" is declared as Final and cannot be reassigned (reportGeneralTypeIssues) -qualifiers_final_annotation.py:155:9 - error: "x" is declared as Final and cannot be reassigned (reportGeneralTypeIssues) -qualifiers_final_annotation.py:166:1 - error: "TEN" is declared as Final and cannot be reassigned (reportGeneralTypeIssues) -qualifiers_final_annotation.py:170:1 - error: "PI" is declared as Final and cannot be reassigned (reportGeneralTypeIssues) +qualifiers_final_annotation.py:155:5 - error: "ID1" is declared as Final and cannot be reassigned (reportGeneralTypeIssues) +qualifiers_final_annotation.py:159:5 - error: "x" is declared as Final and cannot be reassigned (reportGeneralTypeIssues) +qualifiers_final_annotation.py:161:10 - error: "x" is declared as Final and cannot be reassigned (reportGeneralTypeIssues) +qualifiers_final_annotation.py:163:9 - error: "x" is declared as Final and cannot be reassigned (reportGeneralTypeIssues) +qualifiers_final_annotation.py:166:30 - error: "x" is declared as Final and cannot be reassigned (reportGeneralTypeIssues) +qualifiers_final_annotation.py:169:9 - error: "x" is declared as Final and cannot be reassigned (reportGeneralTypeIssues) +qualifiers_final_annotation.py:180:1 - error: "TEN" is declared as Final and cannot be reassigned (reportGeneralTypeIssues) +qualifiers_final_annotation.py:184:1 - error: "PI" is declared as Final and cannot be reassigned (reportGeneralTypeIssues) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/results.html b/conformance/results/results.html index b342504bf..4de25dec5 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -1038,7 +1038,12 @@

    Python Type System Conformance Test Results

  • Does not reject use of ClassVar in TypeAlias definition.
  • -
    Pass + Partial +
      +
    • Does not reject use of ClassVar as a qualifier for a NamedTuple field.
    • +
    +
    Pass Pass Pass
    1 / 2 • 50.0%1.5 / 2 • 75.0%1 / 2 • 50.0% 2 / 2 • 100.0% 1.5 / 2 • 75.0% 1.5 / 2 • 75.0%
    108 / 142 • 76.1%130.5 / 142 • 91.9%130 / 142 • 91.5% 141 / 142 • 99.3% 136 / 142 • 95.8% 125.5 / 142 • 88.4%pycroscope 0.4.0 pyrefly 1.3.0-dev.1 pyright 1.1.410ty 0.0.67ty 0.0.70 zuban 0.8.2
    Pass Pass Pass - Partial -
      -
    • Reports an implicit instance attribute in a Protocol method only as a warning.
    • -
    • Incorrectly considers an instance attribute on a concrete class as satisfying a ClassVar protocol member.
    • -
    -
    Pass Pass
    10 / 11 • 90.9% 11 / 11 • 100.0% 11 / 11 • 100.0%6 / 11 • 54.5%6.5 / 11 • 59.1% 11 / 11 • 100.0%
    130 / 142 • 91.5% 141 / 142 • 99.3% 136 / 142 • 95.8%125.5 / 142 • 88.4%126 / 142 • 88.7% 140 / 142 • 98.6%
    Pass Pass
    generics_mixed_variance_inferencePassUnsupportedUnsupportedUnsupportedPass + Partial +
      +
    • Does not infer covariance for a TypeVarTuple in a class with mixed type parameters.
    • +
    +
    generics_paramspec_basic Pass Pass Pass
    generics_paramspec_varianceUnsupportedUnsupportedUnsupportedUnsupported + Partial +
      +
    • Does not error when a ParamSpec is used in a position that violates its explicit variance.
    • +
    +
    Unsupported
    generics_scoping Pass Pass + Partial +
      +
    • Doesn't error when multiple type variable tuples appear in a PEP 695 type parameter list; only detects the Generic[...] form.
    • +
    +
    Pass Partial @@ -894,6 +927,20 @@

    Python Type System Conformance Test Results

    Pass Pass
    generics_typevartuple_varianceUnsupportedUnsupportedUnsupportedUnsupported + Partial +
      +
    • Does not error when a TypeVarTuple is used in a position that violates its explicit variance.
    • +
    +
    Unsupported
    generics_upper_bound @@ -947,12 +994,12 @@

    Python Type System Conformance Test Results

    22.5 / 30 • 75.0%28.5 / 30 • 95.0%30 / 30 • 100.0%28.5 / 30 • 95.0%27 / 30 • 90.0%29.5 / 30 • 98.3%23.5 / 33 • 71.2%28 / 33 • 84.8%30 / 33 • 90.9%28.5 / 33 • 86.4%29 / 33 • 87.9%30 / 33 • 90.9%
    protocols_variance + Partial +
      +
    • False report of ParamSpec variance keywords.
    • +
    +
    PassPassPassPass + Partial +
      +
    • Doesn't support variance keywords to ParamSpec
    • +
    +
    + Partial +
      +
    • Doesn't support variance keyword arguments to ParamSpec.
    • +
    +
    UnsupportedPass + Partial +
      +
    • False report of ParamSpec variance keywords.
    • +
    +
    9.5 / 11 • 86.4% 10 / 11 • 90.9%10 / 11 • 90.9%11 / 11 • 100.0%11 / 11 • 100.0%10.5 / 11 • 95.5%10.5 / 11 • 95.5% 6.5 / 11 • 59.1%11 / 11 • 100.0%10.5 / 11 • 95.5%
    Pass + Partial +
      +
    • Does not support callback protocols with PEP 695 ParamSpec type parameters.
    • +
    +
    Pass Pass Pass
    callables_protocol PassPass + Partial +
      +
    • Does not support callback protocols with PEP 695 ParamSpec type parameters.
    • +
    +
    Pass Pass Pass
    callables_subtyping PassPass + Partial +
      +
    • Does not support callback protocols with PEP 695 ParamSpec type parameters.
    • +
    +
    Pass Pass Pass
    3 / 4 • 75.0%4 / 4 • 100.0%2.5 / 4 • 62.5% 4 / 4 • 100.0% 4 / 4 • 100.0% 4 / 4 • 100.0%
    108 / 142 • 76.1%130 / 142 • 91.5%141 / 142 • 99.3%136 / 142 • 95.8%126 / 142 • 88.7%140 / 142 • 98.6%108.5 / 145 • 74.8%128 / 145 • 88.3%140.5 / 145 • 96.9%135.5 / 145 • 93.4%128 / 145 • 88.3%140 / 145 • 96.6%
    diff --git a/conformance/results/ty/generics_mixed_variance_inference.toml b/conformance/results/ty/generics_mixed_variance_inference.toml new file mode 100644 index 000000000..03796e1e0 --- /dev/null +++ b/conformance/results/ty/generics_mixed_variance_inference.toml @@ -0,0 +1,9 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +generics_mixed_variance_inference.py:13:22: error[invalid-assignment] Object of type `Mixed[bool, ()]` is not assignable to `Mixed[int, ()]` +generics_mixed_variance_inference.py:16:27: error[invalid-assignment] Object of type `Mixed[int, object, ()]` is not assignable to `Mixed[int, int, ()]` +generics_mixed_variance_inference.py:21:25: error[invalid-assignment] Object of type `Mixed[int, (bool, /)]` is not assignable to `Mixed[int, (int, /)]` +""" diff --git a/conformance/results/ty/generics_paramspec_variance.toml b/conformance/results/ty/generics_paramspec_variance.toml new file mode 100644 index 000000000..ea6750cbf --- /dev/null +++ b/conformance/results/ty/generics_paramspec_variance.toml @@ -0,0 +1,31 @@ +conformant = "Partial" +notes = """ +Does not error when a ParamSpec is used in a position that violates its explicit variance. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 117: Expected 1 errors +Line 126: Expected 1 errors +""" +output = """ +generics_paramspec_variance.py:14:42: error[invalid-assignment] Object of type `InvariantParamSpec[(int, /)]` is not assignable to `InvariantParamSpec[(object, /)]` +generics_paramspec_variance.py:15:39: error[invalid-assignment] Object of type `InvariantParamSpec[(object, /)]` is not assignable to `InvariantParamSpec[(int, /)]` +generics_paramspec_variance.py:21:42: error[invalid-assignment] Object of type `ContravariantParamSpec[(int, /)]` is not assignable to `ContravariantParamSpec[(object, /)]` +generics_paramspec_variance.py:30:36: error[invalid-assignment] Object of type `CovariantParamSpec[(object, /)]` is not assignable to `CovariantParamSpec[(int, /)]` +generics_paramspec_variance.py:61:1: error[invalid-assignment] Object of type `InitP[(*, a: int)]` is not assignable to attribute `t` of type `InitP[(a: int)]` +generics_paramspec_variance.py:63:1: error[invalid-assignment] Object of type `InitP[(a: int, /)]` is not assignable to attribute `t` of type `InitP[(a: int)]` +generics_paramspec_variance.py:65:1: error[invalid-assignment] Object of type `InitP[(b: int)]` is not assignable to attribute `t` of type `InitP[(a: int)]` +generics_paramspec_variance.py:69:1: error[invalid-assignment] Object of type `InitP[(a: int, b: str)]` is not assignable to attribute `t` of type `InitP[(a: int)]` +generics_paramspec_variance.py:88:1: error[invalid-assignment] Object of type `OutitP[(b: int)]` is not assignable to attribute `t` of type `OutitP[(a: int)]` +generics_paramspec_variance.py:90:1: error[invalid-assignment] Object of type `OutitP[(a: int = 1)]` is not assignable to attribute `t` of type `OutitP[(a: int)]` +generics_paramspec_variance.py:92:1: error[invalid-assignment] Object of type `OutitP[(a: int, b: str)]` is not assignable to attribute `t` of type `OutitP[(a: int)]` +generics_paramspec_variance.py:100:9: error[invalid-paramspec] A `ParamSpec` cannot be both covariant and contravariant +generics_paramspec_variance.py:101:9: error[invalid-paramspec] A `ParamSpec` cannot specify variance when `infer_variance=True` +generics_paramspec_variance.py:102:9: error[invalid-paramspec] A `ParamSpec` cannot specify variance when `infer_variance=True` +generics_paramspec_variance.py:110:14: error[invalid-assignment] Object of type `InvariantParamSpecOld[(bool, /)]` is not assignable to `InvariantParamSpecOld[(int, /)]` +generics_paramspec_variance.py:111:14: error[invalid-assignment] Object of type `InvariantParamSpecOld[(object, /)]` is not assignable to `InvariantParamSpecOld[(int, /)]` +generics_paramspec_variance.py:121:49: error[invalid-assignment] Object of type `ContravariantParamSpecOld[(int, /)]` is not assignable to `ContravariantParamSpecOld[(object, /)]` +generics_paramspec_variance.py:132:43: error[invalid-assignment] Object of type `CovariantParamSpecOld[(object, /)]` is not assignable to `CovariantParamSpecOld[(int, /)]` +generics_paramspec_variance.py:142:63: error[invalid-assignment] Object of type `InferredContravariantParamSpecOld[(int, /)]` is not assignable to `InferredContravariantParamSpecOld[(object, /)]` +generics_paramspec_variance.py:151:57: error[invalid-assignment] Object of type `InferredCovariantParamSpecOld[(object, /)]` is not assignable to `InferredCovariantParamSpecOld[(int, /)]` +""" diff --git a/conformance/results/ty/generics_typevartuple_basic.toml b/conformance/results/ty/generics_typevartuple_basic.toml index 7fd82253b..ffb88837a 100644 --- a/conformance/results/ty/generics_typevartuple_basic.toml +++ b/conformance/results/ty/generics_typevartuple_basic.toml @@ -1,15 +1,15 @@ conformance_automated = "Pass" +conformant = "Pass" errors_diff = """ """ output = """ -generics_typevartuple_basic.py:42:34: error[invalid-argument-type] Argument to `Array.__init__` is incorrect: Expected `tuple[Height, Width]`, found `Height` -generics_typevartuple_basic.py:43:41: error[invalid-argument-type] Argument to `Array.__init__` is incorrect: Expected `tuple[Batch, Height, Width]`, found `tuple[Batch, Width]` -generics_typevartuple_basic.py:44:41: error[invalid-assignment] Object of type `Array[Time, Batch, Width, Height]` is not assignable to `Array[Time, Batch, Height, Width]` -generics_typevartuple_basic.py:52:14: error[invalid-generic-class] `TypeVarTuple` must be unpacked with `*` or `Unpack[]` when used as an argument to `Generic` -generics_typevartuple_basic.py:53:37: error[invalid-type-form] Bare TypeVarTuple `Shape` is not valid in this context in a parameter annotation -generics_typevartuple_basic.py:56:34: error[invalid-type-form] Bare TypeVarTuple `Shape` is not valid in this context in a return type annotation -generics_typevartuple_basic.py:59:24: error[invalid-type-form] Bare TypeVarTuple `Shape` is not valid in this context in a parameter annotation -generics_typevartuple_basic.py:65:27: error[invalid-legacy-type-variable] The `covariant` parameter of `typing.TypeVarTuple` was added in Python 3.15 +generics_typevartuple_basic.py:43:34: error[invalid-argument-type] Argument to `Array.__init__` is incorrect: Expected `tuple[Height, Width]`, found `Height` +generics_typevartuple_basic.py:44:41: error[invalid-argument-type] Argument to `Array.__init__` is incorrect: Expected `tuple[Batch, Height, Width]`, found `tuple[Batch, Width]` +generics_typevartuple_basic.py:45:41: error[invalid-assignment] Object of type `Array[Time, Batch, Width, Height]` is not assignable to `Array[Time, Batch, Height, Width]` +generics_typevartuple_basic.py:53:14: error[invalid-generic-class] `TypeVarTuple` must be unpacked with `*` or `Unpack[]` when used as an argument to `Generic` +generics_typevartuple_basic.py:54:37: error[invalid-type-form] Bare TypeVarTuple `Shape` is not valid in this context in a parameter annotation +generics_typevartuple_basic.py:57:34: error[invalid-type-form] Bare TypeVarTuple `Shape` is not valid in this context in a return type annotation +generics_typevartuple_basic.py:60:24: error[invalid-type-form] Bare TypeVarTuple `Shape` is not valid in this context in a parameter annotation generics_typevartuple_basic.py:66:7: error[invalid-legacy-type-variable] `TypeVarTuple` can only have one positional argument generics_typevartuple_basic.py:67:27: error[invalid-legacy-type-variable] The `bound` parameter of `typing.TypeVarTuple` was added in Python 3.15 generics_typevartuple_basic.py:91:15: error[invalid-argument-type] Argument to function `func2` is incorrect: Expected `tuple[Literal[0], Literal[0]]`, found `tuple[Literal[0]]` @@ -17,4 +17,5 @@ generics_typevartuple_basic.py:100:14: error[invalid-argument-type] Argument to generics_typevartuple_basic.py:100:17: error[invalid-argument-type] Argument to function `multiply` is incorrect: Expected `Array[Height | Width]`, found `Array[Width]` generics_typevartuple_basic.py:101:17: error[invalid-argument-type] Argument to function `multiply` is incorrect: Expected `Array[Height]`, found `Array[Height, Width]` generics_typevartuple_basic.py:107:14: error[invalid-generic-class] Only one `TypeVarTuple` parameter is allowed in a `Generic` subscription +generics_typevartuple_basic.py:111:20: error[invalid-type-form] Generic class `Array4` cannot have multiple `TypeVarTuple` type parameters: `Ts2` is an additional TypeVarTuple """ diff --git a/conformance/results/ty/generics_typevartuple_variance.toml b/conformance/results/ty/generics_typevartuple_variance.toml new file mode 100644 index 000000000..a09b5fa8e --- /dev/null +++ b/conformance/results/ty/generics_typevartuple_variance.toml @@ -0,0 +1,35 @@ +conformant = "Partial" +conformance_automated = "Fail" +notes = """ +Does not error when a TypeVarTuple is used in a position that violates its explicit variance. +""" +errors_diff = """ +Line 79: Expected 1 errors +Line 90: Expected 1 errors +""" +output = """ +generics_typevartuple_variance.py:14:45: error[invalid-assignment] Object of type `InvariantTypeVarTuple[int]` is not assignable to `InvariantTypeVarTuple[object]` +generics_typevartuple_variance.py:15:42: error[invalid-assignment] Object of type `InvariantTypeVarTuple[object]` is not assignable to `InvariantTypeVarTuple[int]` +generics_typevartuple_variance.py:17:64: error[invalid-assignment] Object of type `InvariantTypeVarTuple[*tuple[object, ...]]` is not assignable to `InvariantTypeVarTuple[*tuple[int, ...]]` +generics_typevartuple_variance.py:18:70: error[invalid-assignment] Object of type `InvariantTypeVarTuple[*tuple[int, ...]]` is not assignable to `InvariantTypeVarTuple[*tuple[object, ...]]` +generics_typevartuple_variance.py:20:58: error[invalid-assignment] Object of type `InvariantTypeVarTuple[*tuple[int, ...]]` is not assignable to `InvariantTypeVarTuple[int]` +generics_typevartuple_variance.py:21:71: error[invalid-assignment] Object of type `InvariantTypeVarTuple[int]` is not assignable to `InvariantTypeVarTuple[*tuple[int, ...]]` +generics_typevartuple_variance.py:28:53: error[invalid-assignment] Object of type `ContravariantTypeVarTuple[object, int]` is not assignable to `ContravariantTypeVarTuple[object, object]` +generics_typevartuple_variance.py:31:70: error[invalid-assignment] Object of type `ContravariantTypeVarTuple[*tuple[int, ...]]` is not assignable to `ContravariantTypeVarTuple[*tuple[object, ...]]` +generics_typevartuple_variance.py:34:71: error[invalid-assignment] Object of type `ContravariantTypeVarTuple[int]` is not assignable to `ContravariantTypeVarTuple[*tuple[int, ...]]` +generics_typevartuple_variance.py:42:39: error[invalid-assignment] Object of type `CovariantTypeVarTuple[object]` is not assignable to `CovariantTypeVarTuple[int]` +generics_typevartuple_variance.py:45:50: error[invalid-assignment] Object of type `CovariantTypeVarTuple[bool, object]` is not assignable to `CovariantTypeVarTuple[int, int]` +generics_typevartuple_variance.py:46:50: error[invalid-assignment] Object of type `CovariantTypeVarTuple[object, bool]` is not assignable to `CovariantTypeVarTuple[int, int]` +generics_typevartuple_variance.py:47:50: error[invalid-assignment] Object of type `CovariantTypeVarTuple[object, object]` is not assignable to `CovariantTypeVarTuple[int, int]` +generics_typevartuple_variance.py:48:61: error[invalid-assignment] Object of type `CovariantTypeVarTuple[*tuple[object, ...]]` is not assignable to `CovariantTypeVarTuple[*tuple[int, ...]]` +generics_typevartuple_variance.py:51:55: error[invalid-assignment] Object of type `CovariantTypeVarTuple[*tuple[int, ...]]` is not assignable to `CovariantTypeVarTuple[int]` +generics_typevartuple_variance.py:56:10: error[invalid-legacy-type-variable] A `TypeVarTuple` cannot be both covariant and contravariant +generics_typevartuple_variance.py:57:10: error[invalid-legacy-type-variable] A `TypeVarTuple` cannot specify variance when `infer_variance=True` +generics_typevartuple_variance.py:58:10: error[invalid-legacy-type-variable] A `TypeVarTuple` cannot specify variance when `infer_variance=True` +generics_typevartuple_variance.py:68:45: error[invalid-assignment] Object of type `InvariantTypeVarTupleOld[int]` is not assignable to `InvariantTypeVarTupleOld[object]` +generics_typevartuple_variance.py:69:42: error[invalid-assignment] Object of type `InvariantTypeVarTupleOld[object]` is not assignable to `InvariantTypeVarTupleOld[int]` +generics_typevartuple_variance.py:83:52: error[invalid-assignment] Object of type `ContravariantTypeVarTupleOld[int]` is not assignable to `ContravariantTypeVarTupleOld[object]` +generics_typevartuple_variance.py:97:46: error[invalid-assignment] Object of type `CovariantTypeVarTupleOld[object]` is not assignable to `CovariantTypeVarTupleOld[int]` +generics_typevartuple_variance.py:107:66: error[invalid-assignment] Object of type `InferredContravariantTypeVarTupleOld[int]` is not assignable to `InferredContravariantTypeVarTupleOld[object]` +generics_typevartuple_variance.py:116:60: error[invalid-assignment] Object of type `InferredCovariantTypeVarTupleOld[object]` is not assignable to `InferredCovariantTypeVarTupleOld[int]` +""" diff --git a/conformance/results/ty/protocols_variance.toml b/conformance/results/ty/protocols_variance.toml index 303056e98..7e595c1a9 100644 --- a/conformance/results/ty/protocols_variance.toml +++ b/conformance/results/ty/protocols_variance.toml @@ -1,13 +1,13 @@ conformance_automated = "Fail" conformant = "Unsupported" errors_diff = """ -Line 21: Expected 1 errors -Line 40: Expected 1 errors -Line 56: Expected 1 errors -Line 66: Expected 1 errors -Line 104: Expected 1 errors -Lines 61, 62: Expected error (tag 'covariant_in_input') -Lines 71, 72: Expected error (tag 'contravariant_in_output') +Line 22: Expected 1 errors +Line 41: Expected 1 errors +Line 57: Expected 1 errors +Line 67: Expected 1 errors +Line 105: Expected 1 errors +Lines 62, 63: Expected error (tag 'covariant_in_input') +Lines 72, 73: Expected error (tag 'contravariant_in_output') """ output = """ """ diff --git a/conformance/results/zuban/generics_mixed_variance_inference.toml b/conformance/results/zuban/generics_mixed_variance_inference.toml new file mode 100644 index 000000000..7e3422c42 --- /dev/null +++ b/conformance/results/zuban/generics_mixed_variance_inference.toml @@ -0,0 +1,14 @@ +conformant = "Partial" +notes = """ +Does not infer covariance for a TypeVarTuple in a class with mixed type parameters. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 17: Unexpected errors ['generics_mixed_variance_inference.py:17: error: Incompatible types in assignment (expression has type "Mixed[int, bool, []]", variable has type "Mixed[int, int, []]") [assignment]'] +""" +output = """ +generics_mixed_variance_inference.py:13: error: Incompatible types in assignment (expression has type "Mixed[bool, []]", variable has type "Mixed[int, []]") [assignment] +generics_mixed_variance_inference.py:16: error: Incompatible types in assignment (expression has type "Mixed[int, object, []]", variable has type "Mixed[int, int, []]") [assignment] +generics_mixed_variance_inference.py:17: error: Incompatible types in assignment (expression has type "Mixed[int, bool, []]", variable has type "Mixed[int, int, []]") [assignment] +generics_mixed_variance_inference.py:21: error: Incompatible types in assignment (expression has type "Mixed[int, [bool]]", variable has type "Mixed[int, [int]]") [assignment] +""" diff --git a/conformance/results/zuban/generics_paramspec_variance.toml b/conformance/results/zuban/generics_paramspec_variance.toml new file mode 100644 index 000000000..9cf305fb1 --- /dev/null +++ b/conformance/results/zuban/generics_paramspec_variance.toml @@ -0,0 +1,47 @@ +conformant = "Unsupported" +conformance_automated = "Fail" +errors_diff = """ +Line 15: Expected 1 errors +Line 30: Expected 1 errors +Line 90: Expected 1 errors +Line 111: Expected 1 errors +Line 117: Expected 1 errors +Line 126: Expected 1 errors +Line 132: Expected 1 errors +Line 151: Expected 1 errors +Line 31: Unexpected errors ['generics_paramspec_variance.py:31: error: Incompatible types in assignment (expression has type "CovariantParamSpec[[int]]", variable has type "CovariantParamSpec[[object]]") [assignment]'] +Line 84: Unexpected errors ['generics_paramspec_variance.py:84: error: Incompatible types in assignment (expression has type "OutitP[[*, a: int]]", variable has type "OutitP[[a: int]]") [assignment]'] +Line 86: Unexpected errors ['generics_paramspec_variance.py:86: error: Incompatible types in assignment (expression has type "OutitP[[int]]", variable has type "OutitP[[a: int]]") [assignment]'] +Line 97: Unexpected errors ['generics_paramspec_variance.py:97: error: The variance and bound arguments to ParamSpec do not have defined semantics yet [misc]'] +Line 98: Unexpected errors ['generics_paramspec_variance.py:98: error: The variance and bound arguments to ParamSpec do not have defined semantics yet [misc]'] +Line 99: Unexpected errors ['generics_paramspec_variance.py:99: error: Unexpected argument to "ParamSpec()" [misc]'] +Line 133: Unexpected errors ['generics_paramspec_variance.py:133: error: Incompatible types in assignment (expression has type "CovariantParamSpecOld[[int]]", variable has type "CovariantParamSpecOld[[object]]") [assignment]'] +Line 152: Unexpected errors ['generics_paramspec_variance.py:152: error: Incompatible types in assignment (expression has type "InferredCovariantParamSpecOld[[int]]", variable has type "InferredCovariantParamSpecOld[[object]]") [assignment]'] +""" +output = """ +generics_paramspec_variance.py:14: error: Incompatible types in assignment (expression has type "InvariantParamSpec[[int]]", variable has type "InvariantParamSpec[[object]]") [assignment] +generics_paramspec_variance.py:21: error: Incompatible types in assignment (expression has type "ContravariantParamSpec[[int]]", variable has type "ContravariantParamSpec[[object]]") [assignment] +generics_paramspec_variance.py:31: error: Incompatible types in assignment (expression has type "CovariantParamSpec[[int]]", variable has type "CovariantParamSpec[[object]]") [assignment] +generics_paramspec_variance.py:61: error: Incompatible types in assignment (expression has type "InitP[[*, a: int]]", variable has type "InitP[[a: int]]") [assignment] +generics_paramspec_variance.py:63: error: Incompatible types in assignment (expression has type "InitP[[int]]", variable has type "InitP[[a: int]]") [assignment] +generics_paramspec_variance.py:65: error: Incompatible types in assignment (expression has type "InitP[[b: int]]", variable has type "InitP[[a: int]]") [assignment] +generics_paramspec_variance.py:69: error: Incompatible types in assignment (expression has type "InitP[[a: int, b: str]]", variable has type "InitP[[a: int]]") [assignment] +generics_paramspec_variance.py:84: error: Incompatible types in assignment (expression has type "OutitP[[*, a: int]]", variable has type "OutitP[[a: int]]") [assignment] +generics_paramspec_variance.py:86: error: Incompatible types in assignment (expression has type "OutitP[[int]]", variable has type "OutitP[[a: int]]") [assignment] +generics_paramspec_variance.py:88: error: Incompatible types in assignment (expression has type "OutitP[[b: int]]", variable has type "OutitP[[a: int]]") [assignment] +generics_paramspec_variance.py:92: error: Incompatible types in assignment (expression has type "OutitP[[a: int, b: str]]", variable has type "OutitP[[a: int]]") [assignment] +generics_paramspec_variance.py:97: error: The variance and bound arguments to ParamSpec do not have defined semantics yet [misc] +generics_paramspec_variance.py:98: error: The variance and bound arguments to ParamSpec do not have defined semantics yet [misc] +generics_paramspec_variance.py:99: error: Unexpected argument to "ParamSpec()" [misc] +generics_paramspec_variance.py:100: error: The variance and bound arguments to ParamSpec do not have defined semantics yet [misc] +generics_paramspec_variance.py:100: error: The variance and bound arguments to ParamSpec do not have defined semantics yet [misc] +generics_paramspec_variance.py:101: error: The variance and bound arguments to ParamSpec do not have defined semantics yet [misc] +generics_paramspec_variance.py:101: error: Unexpected argument to "ParamSpec()" [misc] +generics_paramspec_variance.py:102: error: The variance and bound arguments to ParamSpec do not have defined semantics yet [misc] +generics_paramspec_variance.py:102: error: Unexpected argument to "ParamSpec()" [misc] +generics_paramspec_variance.py:110: error: Incompatible types in assignment (expression has type "InvariantParamSpecOld[[bool]]", variable has type "InvariantParamSpecOld[[int]]") [assignment] +generics_paramspec_variance.py:121: error: Incompatible types in assignment (expression has type "ContravariantParamSpecOld[[int]]", variable has type "ContravariantParamSpecOld[[object]]") [assignment] +generics_paramspec_variance.py:133: error: Incompatible types in assignment (expression has type "CovariantParamSpecOld[[int]]", variable has type "CovariantParamSpecOld[[object]]") [assignment] +generics_paramspec_variance.py:142: error: Incompatible types in assignment (expression has type "InferredContravariantParamSpecOld[[int]]", variable has type "InferredContravariantParamSpecOld[[object]]") [assignment] +generics_paramspec_variance.py:152: error: Incompatible types in assignment (expression has type "InferredCovariantParamSpecOld[[int]]", variable has type "InferredCovariantParamSpecOld[[object]]") [assignment] +""" diff --git a/conformance/results/zuban/generics_typevartuple_basic.toml b/conformance/results/zuban/generics_typevartuple_basic.toml index ca0cca722..b9ffa1e5a 100644 --- a/conformance/results/zuban/generics_typevartuple_basic.toml +++ b/conformance/results/zuban/generics_typevartuple_basic.toml @@ -2,18 +2,18 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -generics_typevartuple_basic.py:42: error: Argument 1 to "Array" has incompatible type "Height"; expected "tuple[Height, Width]" [arg-type] -generics_typevartuple_basic.py:43: error: Argument 1 to "Array" has incompatible type "tuple[Batch, Width]"; expected "tuple[Batch, Height, Width]" [arg-type] -generics_typevartuple_basic.py:45: error: Argument 1 to "Array" has incompatible type "tuple[Time, Batch, Width, Height]"; expected "tuple[Time, Batch, Height, Width]" [arg-type] -generics_typevartuple_basic.py:52: error: Free type variable expected in Generic[...] [misc] -generics_typevartuple_basic.py:53: error: TypeVarTuple "Shape" is only valid with an unpack [valid-type] -generics_typevartuple_basic.py:56: error: TypeVarTuple "Shape" is only valid with an unpack [valid-type] -generics_typevartuple_basic.py:59: error: TypeVarTuple "Shape" is only valid with an unpack [valid-type] -generics_typevartuple_basic.py:65: error: Unexpected keyword argument "covariant" for "TypeVarTuple" [call-arg] +generics_typevartuple_basic.py:43: error: Argument 1 to "Array" has incompatible type "Height"; expected "tuple[Height, Width]" [arg-type] +generics_typevartuple_basic.py:44: error: Argument 1 to "Array" has incompatible type "tuple[Batch, Width]"; expected "tuple[Batch, Height, Width]" [arg-type] +generics_typevartuple_basic.py:46: error: Argument 1 to "Array" has incompatible type "tuple[Time, Batch, Width, Height]"; expected "tuple[Time, Batch, Height, Width]" [arg-type] +generics_typevartuple_basic.py:53: error: Free type variable expected in Generic[...] [misc] +generics_typevartuple_basic.py:54: error: TypeVarTuple "Shape" is only valid with an unpack [valid-type] +generics_typevartuple_basic.py:57: error: TypeVarTuple "Shape" is only valid with an unpack [valid-type] +generics_typevartuple_basic.py:60: error: TypeVarTuple "Shape" is only valid with an unpack [valid-type] generics_typevartuple_basic.py:66: error: Too many positional arguments for "TypeVarTuple" [call-arg] generics_typevartuple_basic.py:67: error: Unexpected keyword argument "bound" for "TypeVarTuple" [call-arg] generics_typevartuple_basic.py:91: error: Argument 2 to "func2" has incompatible type "tuple[int]"; expected "tuple[int, int]" [arg-type] generics_typevartuple_basic.py:100: error: Argument 2 to "multiply" has incompatible type "Array[Width]"; expected "Array[Height]" [arg-type] generics_typevartuple_basic.py:101: error: Argument 2 to "multiply" has incompatible type "Array[Height, Width]"; expected "Array[Height]" [arg-type] generics_typevartuple_basic.py:107: error: Can only use one type var tuple in a class def [misc] +generics_typevartuple_basic.py:111: error: Can only use one TypeVarTuple in type params [misc] """ diff --git a/conformance/results/zuban/generics_typevartuple_variance.toml b/conformance/results/zuban/generics_typevartuple_variance.toml new file mode 100644 index 000000000..c4092867e --- /dev/null +++ b/conformance/results/zuban/generics_typevartuple_variance.toml @@ -0,0 +1,63 @@ +conformant = "Unsupported" +conformance_automated = "Fail" +errors_diff = """ +Line 79: Expected 1 errors +Line 90: Expected 1 errors +Line 29: Unexpected errors ['generics_typevartuple_variance.py:29: error: Incompatible types in assignment (expression has type "ContravariantTypeVarTuple[object]", variable has type "ContravariantTypeVarTuple[int]") [assignment]'] +Line 30: Unexpected errors ['generics_typevartuple_variance.py:30: error: Incompatible types in assignment (expression has type "ContravariantTypeVarTuple[Unpack[Tuple[object, ...]]]", variable has type "ContravariantTypeVarTuple[Unpack[Tuple[int, ...]]]") [assignment]'] +Line 33: Unexpected errors ['generics_typevartuple_variance.py:33: error: Incompatible types in assignment (expression has type "ContravariantTypeVarTuple[Unpack[Tuple[int, ...]]]", variable has type "ContravariantTypeVarTuple[int]") [assignment]'] +Line 43: Unexpected errors ['generics_typevartuple_variance.py:43: error: Incompatible types in assignment (expression has type "CovariantTypeVarTuple[int]", variable has type "CovariantTypeVarTuple[object]") [assignment]'] +Line 44: Unexpected errors ['generics_typevartuple_variance.py:44: error: Incompatible types in assignment (expression has type "CovariantTypeVarTuple[bool, bool]", variable has type "CovariantTypeVarTuple[int, int]") [assignment]'] +Line 49: Unexpected errors ['generics_typevartuple_variance.py:49: error: Incompatible types in assignment (expression has type "CovariantTypeVarTuple[Unpack[Tuple[int, ...]]]", variable has type "CovariantTypeVarTuple[Unpack[Tuple[object, ...]]]") [assignment]'] +Line 52: Unexpected errors ['generics_typevartuple_variance.py:52: error: Incompatible types in assignment (expression has type "CovariantTypeVarTuple[int]", variable has type "CovariantTypeVarTuple[Unpack[Tuple[int, ...]]]") [assignment]'] +Line 55: Unexpected errors ['generics_typevartuple_variance.py:55: error: Unexpected keyword argument "infer_variance" for "TypeVarTuple" [call-arg]'] +Line 73: Unexpected errors ['generics_typevartuple_variance.py:73: error: Unexpected keyword argument "contravariant" for "TypeVarTuple" [call-arg]'] +Line 84: Unexpected errors ['generics_typevartuple_variance.py:84: error: Incompatible types in assignment (expression has type "ContravariantTypeVarTupleOld[object]", variable has type "ContravariantTypeVarTupleOld[int]") [assignment]'] +Line 87: Unexpected errors ['generics_typevartuple_variance.py:87: error: Unexpected keyword argument "covariant" for "TypeVarTuple" [call-arg]'] +Line 98: Unexpected errors ['generics_typevartuple_variance.py:98: error: Incompatible types in assignment (expression has type "CovariantTypeVarTupleOld[int]", variable has type "CovariantTypeVarTupleOld[object]") [assignment]'] +Line 108: Unexpected errors ['generics_typevartuple_variance.py:108: error: Incompatible types in assignment (expression has type "InferredContravariantTypeVarTupleOld[object]", variable has type "InferredContravariantTypeVarTupleOld[int]") [assignment]'] +Line 117: Unexpected errors ['generics_typevartuple_variance.py:117: error: Incompatible types in assignment (expression has type "InferredCovariantTypeVarTupleOld[int]", variable has type "InferredCovariantTypeVarTupleOld[object]") [assignment]'] +""" +output = """ +generics_typevartuple_variance.py:14: error: Incompatible types in assignment (expression has type "InvariantTypeVarTuple[int]", variable has type "InvariantTypeVarTuple[object]") [assignment] +generics_typevartuple_variance.py:15: error: Incompatible types in assignment (expression has type "InvariantTypeVarTuple[object]", variable has type "InvariantTypeVarTuple[int]") [assignment] +generics_typevartuple_variance.py:17: error: Incompatible types in assignment (expression has type "InvariantTypeVarTuple[Unpack[Tuple[object, ...]]]", variable has type "InvariantTypeVarTuple[Unpack[Tuple[int, ...]]]") [assignment] +generics_typevartuple_variance.py:18: error: Incompatible types in assignment (expression has type "InvariantTypeVarTuple[Unpack[Tuple[int, ...]]]", variable has type "InvariantTypeVarTuple[Unpack[Tuple[object, ...]]]") [assignment] +generics_typevartuple_variance.py:20: error: Incompatible types in assignment (expression has type "InvariantTypeVarTuple[Unpack[Tuple[int, ...]]]", variable has type "InvariantTypeVarTuple[int]") [assignment] +generics_typevartuple_variance.py:21: error: Incompatible types in assignment (expression has type "InvariantTypeVarTuple[int]", variable has type "InvariantTypeVarTuple[Unpack[Tuple[int, ...]]]") [assignment] +generics_typevartuple_variance.py:28: error: Incompatible types in assignment (expression has type "ContravariantTypeVarTuple[object, int]", variable has type "ContravariantTypeVarTuple[object, object]") [assignment] +generics_typevartuple_variance.py:29: error: Incompatible types in assignment (expression has type "ContravariantTypeVarTuple[object]", variable has type "ContravariantTypeVarTuple[int]") [assignment] +generics_typevartuple_variance.py:30: error: Incompatible types in assignment (expression has type "ContravariantTypeVarTuple[Unpack[Tuple[object, ...]]]", variable has type "ContravariantTypeVarTuple[Unpack[Tuple[int, ...]]]") [assignment] +generics_typevartuple_variance.py:31: error: Incompatible types in assignment (expression has type "ContravariantTypeVarTuple[Unpack[Tuple[int, ...]]]", variable has type "ContravariantTypeVarTuple[Unpack[Tuple[object, ...]]]") [assignment] +generics_typevartuple_variance.py:33: error: Incompatible types in assignment (expression has type "ContravariantTypeVarTuple[Unpack[Tuple[int, ...]]]", variable has type "ContravariantTypeVarTuple[int]") [assignment] +generics_typevartuple_variance.py:34: error: Incompatible types in assignment (expression has type "ContravariantTypeVarTuple[int]", variable has type "ContravariantTypeVarTuple[Unpack[Tuple[int, ...]]]") [assignment] +generics_typevartuple_variance.py:42: error: Incompatible types in assignment (expression has type "CovariantTypeVarTuple[object]", variable has type "CovariantTypeVarTuple[int]") [assignment] +generics_typevartuple_variance.py:43: error: Incompatible types in assignment (expression has type "CovariantTypeVarTuple[int]", variable has type "CovariantTypeVarTuple[object]") [assignment] +generics_typevartuple_variance.py:44: error: Incompatible types in assignment (expression has type "CovariantTypeVarTuple[bool, bool]", variable has type "CovariantTypeVarTuple[int, int]") [assignment] +generics_typevartuple_variance.py:45: error: Incompatible types in assignment (expression has type "CovariantTypeVarTuple[bool, object]", variable has type "CovariantTypeVarTuple[int, int]") [assignment] +generics_typevartuple_variance.py:46: error: Incompatible types in assignment (expression has type "CovariantTypeVarTuple[object, bool]", variable has type "CovariantTypeVarTuple[int, int]") [assignment] +generics_typevartuple_variance.py:47: error: Incompatible types in assignment (expression has type "CovariantTypeVarTuple[object, object]", variable has type "CovariantTypeVarTuple[int, int]") [assignment] +generics_typevartuple_variance.py:48: error: Incompatible types in assignment (expression has type "CovariantTypeVarTuple[Unpack[Tuple[object, ...]]]", variable has type "CovariantTypeVarTuple[Unpack[Tuple[int, ...]]]") [assignment] +generics_typevartuple_variance.py:49: error: Incompatible types in assignment (expression has type "CovariantTypeVarTuple[Unpack[Tuple[int, ...]]]", variable has type "CovariantTypeVarTuple[Unpack[Tuple[object, ...]]]") [assignment] +generics_typevartuple_variance.py:51: error: Incompatible types in assignment (expression has type "CovariantTypeVarTuple[Unpack[Tuple[int, ...]]]", variable has type "CovariantTypeVarTuple[int]") [assignment] +generics_typevartuple_variance.py:52: error: Incompatible types in assignment (expression has type "CovariantTypeVarTuple[int]", variable has type "CovariantTypeVarTuple[Unpack[Tuple[int, ...]]]") [assignment] +generics_typevartuple_variance.py:55: error: Unexpected keyword argument "infer_variance" for "TypeVarTuple" [call-arg] +generics_typevartuple_variance.py:56: error: Unexpected keyword argument "covariant" for "TypeVarTuple" [call-arg] +generics_typevartuple_variance.py:56: error: Unexpected keyword argument "contravariant" for "TypeVarTuple" [call-arg] +generics_typevartuple_variance.py:57: error: Unexpected keyword argument "covariant" for "TypeVarTuple" [call-arg] +generics_typevartuple_variance.py:57: error: Unexpected keyword argument "infer_variance" for "TypeVarTuple" [call-arg] +generics_typevartuple_variance.py:58: error: Unexpected keyword argument "contravariant" for "TypeVarTuple" [call-arg] +generics_typevartuple_variance.py:58: error: Unexpected keyword argument "infer_variance" for "TypeVarTuple" [call-arg] +generics_typevartuple_variance.py:68: error: Incompatible types in assignment (expression has type "InvariantTypeVarTupleOld[int]", variable has type "InvariantTypeVarTupleOld[object]") [assignment] +generics_typevartuple_variance.py:69: error: Incompatible types in assignment (expression has type "InvariantTypeVarTupleOld[object]", variable has type "InvariantTypeVarTupleOld[int]") [assignment] +generics_typevartuple_variance.py:73: error: Unexpected keyword argument "contravariant" for "TypeVarTuple" [call-arg] +generics_typevartuple_variance.py:83: error: Incompatible types in assignment (expression has type "ContravariantTypeVarTupleOld[int]", variable has type "ContravariantTypeVarTupleOld[object]") [assignment] +generics_typevartuple_variance.py:84: error: Incompatible types in assignment (expression has type "ContravariantTypeVarTupleOld[object]", variable has type "ContravariantTypeVarTupleOld[int]") [assignment] +generics_typevartuple_variance.py:87: error: Unexpected keyword argument "covariant" for "TypeVarTuple" [call-arg] +generics_typevartuple_variance.py:97: error: Incompatible types in assignment (expression has type "CovariantTypeVarTupleOld[object]", variable has type "CovariantTypeVarTupleOld[int]") [assignment] +generics_typevartuple_variance.py:98: error: Incompatible types in assignment (expression has type "CovariantTypeVarTupleOld[int]", variable has type "CovariantTypeVarTupleOld[object]") [assignment] +generics_typevartuple_variance.py:107: error: Incompatible types in assignment (expression has type "InferredContravariantTypeVarTupleOld[int]", variable has type "InferredContravariantTypeVarTupleOld[object]") [assignment] +generics_typevartuple_variance.py:108: error: Incompatible types in assignment (expression has type "InferredContravariantTypeVarTupleOld[object]", variable has type "InferredContravariantTypeVarTupleOld[int]") [assignment] +generics_typevartuple_variance.py:116: error: Incompatible types in assignment (expression has type "InferredCovariantTypeVarTupleOld[object]", variable has type "InferredCovariantTypeVarTupleOld[int]") [assignment] +generics_typevartuple_variance.py:117: error: Incompatible types in assignment (expression has type "InferredCovariantTypeVarTupleOld[int]", variable has type "InferredCovariantTypeVarTupleOld[object]") [assignment] +""" diff --git a/conformance/results/zuban/protocols_variance.toml b/conformance/results/zuban/protocols_variance.toml index ba95f1366..5aac24487 100644 --- a/conformance/results/zuban/protocols_variance.toml +++ b/conformance/results/zuban/protocols_variance.toml @@ -1,14 +1,20 @@ -conformance_automated = "Pass" +conformant = "Partial" +conformance_automated = "Fail" +notes = """ +False report of ParamSpec variance keywords. +""" errors_diff = """ +Line 15: Unexpected errors ['protocols_variance.py:15: error: The variance and bound arguments to ParamSpec do not have defined semantics yet [misc]'] """ output = """ -protocols_variance.py:21: error: Invariant type variable "T1" used in protocol where Covariant one is expected [misc] -protocols_variance.py:40: error: Invariant type variable "T3" used in protocol where Contravariant one is expected [misc] -protocols_variance.py:56: error: Invariant type variable "T1" used in protocol where Contravariant one is expected [misc] -protocols_variance.py:61: error: Covariant type variable "T1_co" used in protocol where Contravariant one is expected [misc] -protocols_variance.py:62: error: Cannot use a covariant type variable as a parameter [type-var] -protocols_variance.py:66: error: Invariant type variable "T1" used in protocol where Covariant one is expected [misc] -protocols_variance.py:71: error: Contravariant type variable "T1_contra" used in protocol where Covariant one is expected [misc] -protocols_variance.py:72: error: Cannot use a contravariant type variable as return type [type-var] -protocols_variance.py:104: error: Invariant type variable "T1" used in protocol where Covariant one is expected [misc] +protocols_variance.py:15: error: The variance and bound arguments to ParamSpec do not have defined semantics yet [misc] +protocols_variance.py:22: error: Invariant type variable "T1" used in protocol where Covariant one is expected [misc] +protocols_variance.py:41: error: Invariant type variable "T3" used in protocol where Contravariant one is expected [misc] +protocols_variance.py:57: error: Invariant type variable "T1" used in protocol where Contravariant one is expected [misc] +protocols_variance.py:62: error: Covariant type variable "T1_co" used in protocol where Contravariant one is expected [misc] +protocols_variance.py:63: error: Cannot use a covariant type variable as a parameter [type-var] +protocols_variance.py:67: error: Invariant type variable "T1" used in protocol where Covariant one is expected [misc] +protocols_variance.py:72: error: Contravariant type variable "T1_contra" used in protocol where Covariant one is expected [misc] +protocols_variance.py:73: error: Cannot use a contravariant type variable as return type [type-var] +protocols_variance.py:105: error: Invariant type variable "T1" used in protocol where Covariant one is expected [misc] """ diff --git a/conformance/tests/callables_annotation.py b/conformance/tests/callables_annotation.py index 35b98f5ee..8cf25c6ab 100644 --- a/conformance/tests/callables_annotation.py +++ b/conformance/tests/callables_annotation.py @@ -111,7 +111,7 @@ class Proto3(Protocol): def __call__(self, a: int, *args: Any, **kwargs: Any) -> None: ... -class Proto4(Protocol[P]): +class Proto4[**P](Protocol): def __call__(self, a: int, *args: P.args, **kwargs: P.kwargs) -> None: ... diff --git a/conformance/tests/callables_protocol.py b/conformance/tests/callables_protocol.py index 0ee1b5d34..3b05d10ca 100644 --- a/conformance/tests/callables_protocol.py +++ b/conformance/tests/callables_protocol.py @@ -173,7 +173,7 @@ def cb8_bad1(x: int) -> Any: R = TypeVar("R", covariant=True) -class Proto9(Protocol[P, R]): +class Proto9[**P, R](Protocol): other_attribute: int def __call__(self, *args: P.args, **kwargs: P.kwargs) -> R: diff --git a/conformance/tests/callables_subtyping.py b/conformance/tests/callables_subtyping.py index 0451d6289..9cecc843e 100644 --- a/conformance/tests/callables_subtyping.py +++ b/conformance/tests/callables_subtyping.py @@ -201,7 +201,7 @@ def func6( # > to a Callable parameterized by P. -class ProtocolWithP(Protocol[P]): +class ProtocolWithP[**P](Protocol): def __call__(self, *args: P.args, **kwargs: P.kwargs) -> None: ... diff --git a/conformance/tests/generics_mixed_variance_inference.py b/conformance/tests/generics_mixed_variance_inference.py new file mode 100644 index 000000000..e7cbfd752 --- /dev/null +++ b/conformance/tests/generics_mixed_variance_inference.py @@ -0,0 +1,21 @@ +""" +Tests variance inference for mixed type parameters. +""" + +# Specification: https://typing.readthedocs.io/en/latest/spec/generics.html#variance-inference + +class Mixed[T, *Ts, **P]: + def f(self, x: T, /, *args: P.args, **kwargs: P.kwargs) -> tuple[*Ts]: + raise NotImplementedError + +# T should be contra +_1: Mixed[int, []] = Mixed[object, []]() # OK +_2: Mixed[int, []] = Mixed[bool, []]() # E + +# Ts should be co +_3: Mixed[int, int, []] = Mixed[int, object, []]() # E +_4: Mixed[int, int, []] = Mixed[int, bool, []]() # OK + +# P should be contra +_5: Mixed[int, [int]] = Mixed[int, [object]]() # OK +_6: Mixed[int, [int]] = Mixed[int, [bool]]() # E diff --git a/conformance/tests/generics_paramspec_variance.py b/conformance/tests/generics_paramspec_variance.py new file mode 100644 index 000000000..04866e941 --- /dev/null +++ b/conformance/tests/generics_paramspec_variance.py @@ -0,0 +1,152 @@ +""" +Tests variance of ParamSpec. +""" + +# Specification: https://typing.readthedocs.io/en/latest/spec/generics.html#variance-inference + + +from typing import Callable, Generic, ParamSpec + + +class InvariantParamSpec[**InOutP]: + a: Callable[InOutP, None] + +in_out_obj: InvariantParamSpec[object] = InvariantParamSpec[int]() # E +in_out_int: InvariantParamSpec[int] = InvariantParamSpec[object]() # E + + +class ContravariantParamSpec[**InP]: + def f(self, *args: InP.args, **kwargs: InP.kwargs): ... + +in_obj: ContravariantParamSpec[object] = ContravariantParamSpec[int]() # E +in_int: ContravariantParamSpec[int] = ContravariantParamSpec[object]() # OK + + +class CovariantParamSpec[**OutP]: + def f(self, fn: Callable[OutP, None]) -> None: + raise NotImplementedError + + +out_int: CovariantParamSpec[int] = CovariantParamSpec[object]() # E +out_obj: CovariantParamSpec[object] = CovariantParamSpec[int]() # OK + +# cases involving keyword-only, positional-only parameters, parameter names, defaults and differing callable arities +class Box[T]: + t: T + + def __init__(self, t: T): ... + + +def f(a: int): ... +def kw(*, a: int): ... +def pos(a: int, /): ... +def names(b: int): ... +def default(a: int = 1): ... +def arity(a: int, b: str): ... + + +class InitP[**P]: # contravariant + def __init__(self, fn: Callable[P, None]): ... + + def usage(self) -> Callable[P, None]: + """infer contravariance""" + raise NotImplementedError + + +# `InitP` produces a `Callable[P, None]`, so a replacement is only safe if it +# accepts every call form that `InitP[(a: int)]` accepts. +in_box = Box(InitP(f)) + +in_kw_p = InitP(kw) +in_box.t = in_kw_p # E +in_pos_p = InitP(pos) +in_box.t = in_pos_p # E +in_names_p = InitP(names) +in_box.t = in_names_p # E +in_default_p = InitP(default) +in_box.t = in_default_p # OK +in_arity_p = InitP(arity) +in_box.t = in_arity_p # E + + +class OutitP[**P]: # covariant + def __init__(self, fn: Callable[P, None]): ... + + def usage(self, fn: Callable[P, None]): + """infer covariance""" + + +# `OutitP` consumes a `Callable[P, None]`, so the safe direction is reversed: a +# replacement is only safe if `Callable[(a: int), None]` can be passed to it. +out_box = Box(OutitP(f)) + +out_kw_p = OutitP(kw) +out_box.t = out_kw_p # OK +out_pos_p = OutitP(pos) +out_box.t = out_pos_p # OK +out_names_p = OutitP(names) +out_box.t = out_names_p # E +out_default_p = OutitP(default) +out_box.t = out_default_p # E +out_arity_p = OutitP(arity) +out_box.t = out_arity_p # E + + +# old style +P = ParamSpec("P") # OK +InP = ParamSpec("InP", contravariant=True) # OK +OutP = ParamSpec("OutP", covariant=True) # OK +InferP = ParamSpec("InferP", infer_variance=True) # OK +InvP1 = ParamSpec("InvP1", covariant=True, contravariant=True) # E +InvP2 = ParamSpec("InvP2", covariant=True, infer_variance=True) # E +InvP3 = ParamSpec("InvP3", contravariant=True, infer_variance=True) # E + +class InvariantParamSpecOld(Generic[P]): + def f(self, fn: Callable[P, None]) -> Callable[P, None]: # OK + raise NotImplementedError + +in_out_old: InvariantParamSpecOld[int] +in_out_old = InvariantParamSpecOld[int]() # OK +in_out_old = InvariantParamSpecOld[bool]() # E +in_out_old = InvariantParamSpecOld[object]() # E + +class ContravariantParamSpecOld(Generic[InP]): + def in_f(self) -> Callable[InP, None]: # OK + raise NotImplementedError + + def out_f(self, fn: Callable[InP, None]) -> None: # E + raise NotImplementedError + + +in_obj_old: ContravariantParamSpecOld[object] = ContravariantParamSpecOld[int]() # E +in_int_old: ContravariantParamSpecOld[int] = ContravariantParamSpecOld[object]() # OK + + +class CovariantParamSpecOld(Generic[OutP]): + def in_f(self) -> Callable[OutP, None]: # E + raise NotImplementedError + def out_f(self, fn: Callable[OutP, None]) -> None: # OK + raise NotImplementedError + + +out_int_old: CovariantParamSpecOld[int] = CovariantParamSpecOld[object]() # E +out_obj_old: CovariantParamSpecOld[object] = CovariantParamSpecOld[int]() # OK + + +# `infer_variance=True` on a traditional `ParamSpec` +class InferredContravariantParamSpecOld(Generic[InferP]): + def in_f(self) -> Callable[InferP, None]: # OK + raise NotImplementedError + + +infer_in_obj_old: InferredContravariantParamSpecOld[object] = InferredContravariantParamSpecOld[int]() # E +infer_in_int_old: InferredContravariantParamSpecOld[int] = InferredContravariantParamSpecOld[object]() # OK + + +class InferredCovariantParamSpecOld(Generic[InferP]): + def out_f(self, fn: Callable[InferP, None]) -> None: # OK + raise NotImplementedError + + +infer_out_int_old: InferredCovariantParamSpecOld[int] = InferredCovariantParamSpecOld[object]() # E +infer_out_obj_old: InferredCovariantParamSpecOld[object] = InferredCovariantParamSpecOld[int]() # OK diff --git a/conformance/tests/generics_typevartuple_basic.py b/conformance/tests/generics_typevartuple_basic.py index 47b493ff0..672960270 100644 --- a/conformance/tests/generics_typevartuple_basic.py +++ b/conformance/tests/generics_typevartuple_basic.py @@ -7,6 +7,7 @@ from typing import Generic, NewType, TypeVarTuple, assert_type Ts = TypeVarTuple("Ts") +Ts1 = TypeVarTuple("Ts1") class Array1(Generic[*Ts]): @@ -60,11 +61,10 @@ def method1(*args: Shape) -> None: # E: not unpacked ... -# > TypeVarTuple does not yet support specification of variance, bounds, constraints. +# > TypeVarTuple does not support type constraints. -Ts1 = TypeVarTuple("Ts1", covariant=True) # E Ts2 = TypeVarTuple("Ts2", int, float) # E -Ts3 = TypeVarTuple("Ts3", bound=int) # E +Ts3 = TypeVarTuple("Ts3", bound=int) # E: bound is unavailable in Python 3.12 # > If the same TypeVarTuple instance is used in multiple places in a signature @@ -104,5 +104,9 @@ def func3(x: Array[Height], y: Array[Width], z: Array[Height, Width]): # > Only a single type variable tuple may appear in a type parameter list. -class Array3(Generic[*Ts1, *Ts2]): # E +class Array3(Generic[*Ts, *Ts1]): # E + ... + + +class Array4[*Ts1, *Ts2]: # E ... diff --git a/conformance/tests/generics_typevartuple_variance.py b/conformance/tests/generics_typevartuple_variance.py new file mode 100644 index 000000000..ace05d773 --- /dev/null +++ b/conformance/tests/generics_typevartuple_variance.py @@ -0,0 +1,117 @@ +""" +Tests variance of TypeVarTuple. +""" + +# Specification: https://typing.readthedocs.io/en/latest/spec/generics.html#variance-inference + + +from typing import Generic +from typing_extensions import TypeVarTuple + +class InvariantTypeVarTuple[*InOutTs]: + a: tuple[*InOutTs] + +in_out_obj: InvariantTypeVarTuple[object] = InvariantTypeVarTuple[int]() # E +in_out_int: InvariantTypeVarTuple[int] = InvariantTypeVarTuple[object]() # E +in_out_int = InvariantTypeVarTuple[int]() +in_out_variadic_int: InvariantTypeVarTuple[*tuple[int, ...]] = InvariantTypeVarTuple[*tuple[object, ...]]() # E +in_out_variadic_object: InvariantTypeVarTuple[*tuple[object, ...]] = InvariantTypeVarTuple[*tuple[int, ...]]() # E +in_out_empty: InvariantTypeVarTuple[()] = InvariantTypeVarTuple[()]() # OK +in_out_fixed_from_variadic: InvariantTypeVarTuple[int] = InvariantTypeVarTuple[*tuple[int, ...]]() # E +in_out_variadic_from_fixed: InvariantTypeVarTuple[*tuple[int, ...]] = InvariantTypeVarTuple[int]() # E + + +class ContravariantTypeVarTuple[*InTs]: + def f(self, t: tuple[*InTs]): + raise NotImplementedError + +in_obj: ContravariantTypeVarTuple[object, object] = ContravariantTypeVarTuple[object, int]() # E +in_int: ContravariantTypeVarTuple[int] = ContravariantTypeVarTuple[object]() # OK +in_variadic_int: ContravariantTypeVarTuple[*tuple[int, ...]] = ContravariantTypeVarTuple[*tuple[object, ...]]() # OK +in_variadic_object: ContravariantTypeVarTuple[*tuple[object, ...]] = ContravariantTypeVarTuple[*tuple[int, ...]]() # E +in_empty: ContravariantTypeVarTuple[()] = ContravariantTypeVarTuple[()]() # OK +in_fixed_from_variadic: ContravariantTypeVarTuple[int] = ContravariantTypeVarTuple[*tuple[int, ...]]() # OK +in_variadic_from_fixed: ContravariantTypeVarTuple[*tuple[int, ...]] = ContravariantTypeVarTuple[int]() # E + + +class CovariantTypeVarTuple[*OutTs]: + def f(self) -> tuple[*OutTs]: + raise NotImplementedError + + +out_int: CovariantTypeVarTuple[int] = CovariantTypeVarTuple[object]() # E +out_obj: CovariantTypeVarTuple[object] = CovariantTypeVarTuple[int]() # OK +out_multiple1: CovariantTypeVarTuple[int, int] = CovariantTypeVarTuple[bool, bool]() # OK +out_multiple2: CovariantTypeVarTuple[int, int] = CovariantTypeVarTuple[bool, object]() # E +out_multiple3: CovariantTypeVarTuple[int, int] = CovariantTypeVarTuple[object, bool]() # E +out_multiple4: CovariantTypeVarTuple[int, int] = CovariantTypeVarTuple[object, object]() # E +out_variadic_int: CovariantTypeVarTuple[*tuple[int, ...]] = CovariantTypeVarTuple[*tuple[object, ...]]() # E +out_variadic_object: CovariantTypeVarTuple[*tuple[object, ...]] = CovariantTypeVarTuple[*tuple[int, ...]]() # OK +out_empty: CovariantTypeVarTuple[()] = CovariantTypeVarTuple[()]() # OK +out_fixed_from_variadic: CovariantTypeVarTuple[int] = CovariantTypeVarTuple[*tuple[int, ...]]() # E +out_variadic_from_fixed: CovariantTypeVarTuple[*tuple[int, ...]] = CovariantTypeVarTuple[int]() # OK + +Ts = TypeVarTuple("Ts") # OK +InferTs = TypeVarTuple("InferTs", infer_variance=True) # OK +InvTs1 = TypeVarTuple("InvTs1", covariant=True, contravariant=True) # E +InvTs2 = TypeVarTuple("InvTs2", covariant=True, infer_variance=True) # E +InvTs3 = TypeVarTuple("InvTs3", contravariant=True, infer_variance=True) # E + +class InvariantTypeVarTupleOld(Generic[*Ts]): + def in_f(self, *args: *Ts) -> None: # OK + raise NotImplementedError + + def out_f(self) -> tuple[*Ts]: # OK + raise NotImplementedError + + +obj_old: InvariantTypeVarTupleOld[object] = InvariantTypeVarTupleOld[int]() # E +int_old: InvariantTypeVarTupleOld[int] = InvariantTypeVarTupleOld[object]() # E +int_old = InvariantTypeVarTupleOld[int]() + + +InTs = TypeVarTuple("InTs", contravariant=True) + +class ContravariantTypeVarTupleOld(Generic[*InTs]): + def in_f(self, *args: *InTs) -> None: # OK + raise NotImplementedError + + def out_f(self) -> tuple[*InTs]: # E + raise NotImplementedError + + +in_obj_old: ContravariantTypeVarTupleOld[object] = ContravariantTypeVarTupleOld[int]() # E +in_int_old: ContravariantTypeVarTupleOld[int] = ContravariantTypeVarTupleOld[object]() # OK + + +OutTs = TypeVarTuple("OutTs", covariant=True) + +class CovariantTypeVarTupleOld(Generic[*OutTs]): + def in_f(self, *args: *OutTs) -> None: # E + raise NotImplementedError + + def out_f(self) -> tuple[*OutTs]: # OK + raise NotImplementedError + + +out_int_old: CovariantTypeVarTupleOld[int] = CovariantTypeVarTupleOld[object]() # E +out_obj_old: CovariantTypeVarTupleOld[object] = CovariantTypeVarTupleOld[int]() # OK + + +# `infer_variance=True` on a traditional `TypeVarTuple` +class InferredContravariantTypeVarTupleOld(Generic[*InferTs]): + def in_f(self, *args: *InferTs) -> None: # OK + raise NotImplementedError + + +infer_in_obj_old: InferredContravariantTypeVarTupleOld[object] = InferredContravariantTypeVarTupleOld[int]() # E +infer_in_int_old: InferredContravariantTypeVarTupleOld[int] = InferredContravariantTypeVarTupleOld[object]() # OK + + +class InferredCovariantTypeVarTupleOld(Generic[*InferTs]): + def out_f(self) -> tuple[*InferTs]: # OK + raise NotImplementedError + + +infer_out_int_old: InferredCovariantTypeVarTupleOld[int] = InferredCovariantTypeVarTupleOld[object]() # E +infer_out_obj_old: InferredCovariantTypeVarTupleOld[object] = InferredCovariantTypeVarTupleOld[int]() # OK diff --git a/conformance/tests/protocols_variance.py b/conformance/tests/protocols_variance.py index 069ab8ecd..724692b60 100644 --- a/conformance/tests/protocols_variance.py +++ b/conformance/tests/protocols_variance.py @@ -4,14 +4,15 @@ # Specification: https://typing.readthedocs.io/en/latest/spec/protocol.html#generic-protocols -from typing import ParamSpec, Protocol, TypeVar +from typing import Protocol, TypeVar +from typing_extensions import ParamSpec T1 = TypeVar("T1") T2 = TypeVar("T2", bound=int) T3 = TypeVar("T3", bytes, str) T1_co = TypeVar("T1_co", covariant=True) T1_contra = TypeVar("T1_contra", contravariant=True) -P = ParamSpec("P") +P = ParamSpec("P", contravariant=True) R = TypeVar("R", covariant=True) # > Type checkers will warn if the inferred variance is different from the diff --git a/conformance/uv.lock b/conformance/uv.lock index b6f401d1b..2ff42f9be 100644 --- a/conformance/uv.lock +++ b/conformance/uv.lock @@ -261,6 +261,7 @@ dependencies = [ { name = "tomlkit" }, { name = "ty" }, { name = "types-markdown" }, + { name = "typing-extensions" }, { name = "zuban" }, ] @@ -275,16 +276,17 @@ requires-dist = [ { name = "tomlkit" }, { name = "ty" }, { name = "types-markdown" }, + { name = "typing-extensions", specifier = ">=4.16.0" }, { name = "zuban" }, ] [[package]] name = "typing-extensions" -version = "4.15.0" +version = "4.16.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/72/94/1a15dd82efb362ac84269196e94cf00f187f7ed21c242792a923cdb1c61f/typing_extensions-4.15.0.tar.gz", hash = "sha256:0cea48d173cc12fa28ecabc3b837ea3cf6f38c6d1136f85cbaaf598984861466", size = 109391, upload-time = "2025-08-25T13:49:26.313Z" } +sdist = { url = "https://files.pythonhosted.org/packages/f6/cc/6253133b5bb138fc3306cebfbda2c520f545d36b5be2c7255cc528bb45d6/typing_extensions-4.16.0.tar.gz", hash = "sha256:dc983d19a509c94dba722ee6abd33940f7c05a89e243c47e907eb4db6f1a43e5", size = 113555, upload-time = "2026-07-02T08:40:05.92Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/18/67/36e9267722cc04a6b9f15c7f3441c2363321a3ea07da7ae0c0707beb2a9c/typing_extensions-4.15.0-py3-none-any.whl", hash = "sha256:f0fa19c6845758ab08074a0cfa8b7aecb71c999ca73d62883bc25cc018c4e548", size = 44614, upload-time = "2025-08-25T13:49:24.86Z" }, + { url = "https://files.pythonhosted.org/packages/49/d3/b8441a820a491ddfc024b0b0cf0393375b75ea13866d9c66727e54c2fc80/typing_extensions-4.16.0-py3-none-any.whl", hash = "sha256:481caa481374e813c1b176ada14e97f1f67a4539ce9cfeb3f350d78d6370c2e8", size = 45571, upload-time = "2026-07-02T08:40:04.659Z" }, ] [[package]] diff --git a/docs/spec/generics.rst b/docs/spec/generics.rst index 7f6cbb925..3735a5806 100644 --- a/docs/spec/generics.rst +++ b/docs/spec/generics.rst @@ -678,8 +678,9 @@ Prior to 3.12, the ``ParamSpec`` constructor can be used. P = ParamSpec("WrongName") # Rejected because P =/= WrongName The runtime should accept ``bound``\ s and ``covariant`` and ``contravariant`` -arguments in the declaration just as ``typing.TypeVar`` does, but for now we -will defer the standardization of the semantics of those options to a later PEP. +arguments in the declaration just as ``typing.TypeVar`` does. + +We defer the standardization of the semantics of the ``bound`` option to a later PEP. .. _`paramspec_valid_use_locations`: @@ -1189,14 +1190,15 @@ for two reasons: * To improve readability: the star also functions as an explicit visual indicator that the type variable tuple is not a normal type variable. -Variance, Type Constraints and Type Bounds: Not Supported -""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +Type Constraints and Type Bounds +"""""""""""""""""""""""""""""""" -``TypeVarTuple`` does not currently support specification of: +``TypeVarTuple`` does not support type constraints such as +``TypeVar('T', int, float)``. -* Variance (e.g. ``TypeVar('T', covariant=True)``) -* Type constraints (``TypeVar('T', int, float)``) -* Type bounds (``TypeVar('T', bound=ParentClass)``) +The ``TypeVarTuple`` constructor accepts a ``bound`` argument beginning in +Python 3.15 and in ``typing_extensions`` 4.16 and newer. As with ``ParamSpec``, +the typing semantics of this argument are not yet specified. Type Variable Tuple Equality """""""""""""""""""""""""""" @@ -2712,25 +2714,38 @@ The algorithm for computing the variance of a type parameter is as follows. For each type parameter in a generic class: -1. If the type parameter is variadic (``TypeVarTuple``) or a parameter -specification (``ParamSpec``), it is always considered invariant. No further -inference is needed. - -2. If the type parameter comes from a traditional ``TypeVar`` declaration and -is not specified as ``infer_variance`` (see below), its variance is specified -by the ``TypeVar`` constructor call. No further inference is needed. +1. If the type parameter comes from a traditional +``TypeVar``/``TypeVarTuple``/``ParamSpec`` declaration and is not constructed +with ``infer_variance=True`` (see below), its variance is specified by the +constructor call. No further inference is needed. -3. Create two specialized versions of the class. We'll refer to these as +2. Create two specialized versions of the class. We'll refer to these as ``upper`` and ``lower`` specializations. In both of these specializations, -replace all type parameters other than the one being inferred by a dummy type -instance (a concrete anonymous class that is assumed to meet the bounds or -constraints of the type parameter). In the ``upper`` specialized class, -specialize the target type parameter with an ``object`` instance. This -specialization ignores the type parameter's upper bound or constraints. In the -``lower`` specialized class, specialize the target type parameter with itself -(i.e. the corresponding type argument is the type parameter itself). - -4. Determine whether ``lower`` can be assigned to ``upper`` using normal +replace all type parameters other than the one being inferred by a dummy +argument of the appropriate kind: + +- for a type variable, a dummy type instance (a concrete anonymous class that + is assumed to meet the bounds or constraints of the type parameter) +- for a type variable tuple, a fixed-length pack containing a single dummy type + instance +- for a parameter specification, a signature taking a single positional-only + parameter of a dummy type + +Any dummy argument will do, as long as it is fixed across both specializations; +its only purpose is to make the class fully specialized so that the target type +parameter can be varied on its own. In the ``upper`` specialized class, +specialize the target type parameter with: + +- an ``object`` instance for a type variable +- a ``*tuple[object, ...]`` value for a type variable tuple +- a "top signature" value for a parameter specification, i.e. a type that + represents the super type of every possible signature. + +This specialization ignores the type parameter's upper bound or constraints. +In the ``lower`` specialized class, specialize the target type parameter with +itself (i.e. the corresponding type argument is the type parameter itself). + +3. Determine whether ``lower`` can be assigned to ``upper`` using normal assignability rules. If so, the target type parameter is covariant. If not, determine whether ``upper`` can be assigned to ``lower``. If so, the target type parameter is contravariant. If neither of these combinations are @@ -2776,18 +2791,21 @@ To determine the variance of ``T3``, we specialize ``ClassA`` as follows: Since ``lower`` is assignable to ``upper``, ``T3`` is covariant. -Auto Variance For TypeVar -^^^^^^^^^^^^^^^^^^^^^^^^^ +Auto Variance For Traditional Type Variables +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The ``TypeVar``, ``TypeVarTuple``, and ``ParamSpec`` constructors accept the +keyword parameters ``covariant``, ``contravariant``, and ``infer_variance``. +At most one of these parameters may be ``True``. If all three are ``False``, +the type variable is invariant. If ``infer_variance`` is ``True``, a type +checker should infer whether the type variable is invariant, covariant, or +contravariant. -The existing ``TypeVar`` class constructor accepts keyword parameters named -``covariant`` and ``contravariant``. If both of these are ``False``, the -type variable is assumed to be invariant. PEP 695 adds another keyword -parameter named ``infer_variance`` indicating that a type checker should use -inference to determine whether the type variable is invariant, covariant or -contravariant. A corresponding instance variable ``__infer_variance__`` can be -accessed at runtime to determine whether the variance is inferred. Type -variables that are implicitly allocated using the new syntax will always -have ``__infer_variance__`` set to ``True``. +:pep:`695` introduced ``infer_variance`` for ``TypeVar``. The ``TypeVarTuple`` +constructor accepts these variance parameters beginning in Python 3.15; +``typing_extensions`` provides a backport starting with version 4.16. Type +parameters implicitly allocated using the new syntax always have inferred +variance. A generic class that uses the traditional syntax may include combinations of type variables with explicit and inferred variance. From bee91c2646261629c9835dc0adad16e0d554b4a5 Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Thu, 13 Aug 2026 14:46:42 +0100 Subject: [PATCH 281/308] Clarify ClassVar protocol conformance expectations (#2340) --- .../results/mypy/protocols_definition.toml | 3 ++ .../pycroscope/protocols_definition.toml | 8 ++++- .../results/pyrefly/protocols_definition.toml | 2 ++ .../results/pyright/protocols_definition.toml | 6 ++++ conformance/results/results.html | 11 +++++-- .../results/ty/protocols_definition.toml | 2 ++ .../results/zuban/protocols_definition.toml | 3 ++ conformance/tests/protocols_class_objects.py | 2 +- conformance/tests/protocols_definition.py | 31 ++++++++++++++++++- 9 files changed, 62 insertions(+), 6 deletions(-) diff --git a/conformance/results/mypy/protocols_definition.toml b/conformance/results/mypy/protocols_definition.toml index 717b8cad5..e34a5fbba 100644 --- a/conformance/results/mypy/protocols_definition.toml +++ b/conformance/results/mypy/protocols_definition.toml @@ -51,6 +51,9 @@ protocols_definition.py:340: error: Incompatible types in assignment (expression protocols_definition.py:340: note: Protocol member Template6.val1 expected settable variable, got read-only attribute protocols_definition.py:341: error: Incompatible types in assignment (expression has type "Concrete6_Bad3", variable has type "Template6") [assignment] protocols_definition.py:341: note: Protocol member Template6.val1 expected settable variable, got read-only attribute +protocols_definition.py:369: error: Incompatible types in assignment (expression has type "Concrete7_Bad1", variable has type "Template7") [assignment] +protocols_definition.py:369: note: Protocol member Template7.val1 expected class variable, got instance variable +protocols_definition.py:370: error: Incompatible types in assignment (expression has type "Concrete7_Bad2", variable has type "Template7") [assignment] """ conformance_automated = "Fail" errors_diff = """ diff --git a/conformance/results/pycroscope/protocols_definition.toml b/conformance/results/pycroscope/protocols_definition.toml index 506df6a7a..d5e5f2dc7 100644 --- a/conformance/results/pycroscope/protocols_definition.toml +++ b/conformance/results/pycroscope/protocols_definition.toml @@ -1,5 +1,10 @@ -conformance_automated = "Pass" +conformance_automated = "Fail" +conformant = "Partial" +notes = """ +Incorrectly accepts an instance-only attribute as satisfying a `ClassVar` protocol member. +""" errors_diff = """ +Line 369: Expected 1 errors """ output = """ ./protocols_definition.py:30:10: Incompatible argument type for things: expected collections.abc.Iterable[./protocols_definition.py.SupportsClose] but got Literal[[1]] [incompatible_argument] @@ -23,4 +28,5 @@ output = """ ./protocols_definition.py:339:0: Incompatible assignment: expected ./protocols_definition.py.Template6, got ./protocols_definition.py.Concrete6_Bad1 [incompatible_assignment] ./protocols_definition.py:340:0: Incompatible assignment: expected ./protocols_definition.py.Template6, got ./protocols_definition.py.Concrete6_Bad2 [incompatible_assignment] ./protocols_definition.py:341:0: Incompatible assignment: expected ./protocols_definition.py.Template6, got ./protocols_definition.py.Concrete6_Bad3 [incompatible_assignment] +./protocols_definition.py:370:0: Incompatible assignment: expected ./protocols_definition.py.Template7, got ./protocols_definition.py.Concrete7_Bad2 [incompatible_assignment] """ diff --git a/conformance/results/pyrefly/protocols_definition.toml b/conformance/results/pyrefly/protocols_definition.toml index 766d78c3f..a02940d9b 100644 --- a/conformance/results/pyrefly/protocols_definition.toml +++ b/conformance/results/pyrefly/protocols_definition.toml @@ -24,4 +24,6 @@ ERROR protocols_definition.py:289:22-38: `Concrete5_Bad5` is not assignable to ` ERROR protocols_definition.py:339:22-38: `Concrete6_Bad1` is not assignable to `Template6` [bad-assignment] ERROR protocols_definition.py:340:22-38: `Concrete6_Bad2` is not assignable to `Template6` [bad-assignment] ERROR protocols_definition.py:341:22-38: `Concrete6_Bad3` is not assignable to `Template6` [bad-assignment] +ERROR protocols_definition.py:369:22-38: `Concrete7_Bad1` is not assignable to `Template7` [bad-assignment] +ERROR protocols_definition.py:370:22-38: `Concrete7_Bad2` is not assignable to `Template7` [bad-assignment] """ diff --git a/conformance/results/pyright/protocols_definition.toml b/conformance/results/pyright/protocols_definition.toml index b8252b8f7..2b983d502 100644 --- a/conformance/results/pyright/protocols_definition.toml +++ b/conformance/results/pyright/protocols_definition.toml @@ -97,6 +97,12 @@ protocols_definition.py:341:22 - error: Type "Concrete6_Bad3" is not assignable   "Concrete6_Bad3" is incompatible with protocol "Template6"     "val1" is writable in protocol     "val1" is not read-only in protocol (reportAssignmentType) +protocols_definition.py:369:22 - error: Type "Concrete7_Bad1" is not assignable to declared type "Template7" +  "Concrete7_Bad1" is incompatible with protocol "Template7" +    "val1" is defined as a ClassVar in protocol (reportAssignmentType) +protocols_definition.py:370:22 - error: Type "Concrete7_Bad2" is not assignable to declared type "Template7" +  "Concrete7_Bad2" is incompatible with protocol "Template7" +    "val1" is defined as a ClassVar in protocol (reportAssignmentType) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/results.html b/conformance/results/results.html index 2a8c27f44..7c89516d1 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -1384,7 +1384,12 @@

    Python Type System Conformance Test Results

  • Does not detect protocol mismatch if concrete method's parameters are position-only.
  • -
    Pass + Partial +
      +
    • Incorrectly accepts an instance-only attribute as satisfying a ClassVar protocol member.
    • +
    +
    Pass Pass Pass
    9.5 / 11 • 86.4%10 / 11 • 90.9%9.5 / 11 • 86.4% 10.5 / 11 • 95.5% 10.5 / 11 • 95.5% 6.5 / 11 • 59.1%
    108.5 / 145 • 74.8%128 / 145 • 88.3%127.5 / 145 • 87.9% 140.5 / 145 • 96.9% 135.5 / 145 • 93.4% 128 / 145 • 88.3%Passpycroscope 0.4.0 pyrefly 1.3.0-dev.1 pyright 1.1.410ty 0.0.70ty 0.0.74 zuban 0.8.2
    - Partial -
      -
    • Only partially supports TypeVarTuple in *args annotations.
    • -
    -
    Pass Pass
    Pass Pass Pass - Partial -
      -
    • Does not correctly infer a TypeVarTuple that appears between fixed leading and trailing parameters in *args.
    • -
    -
    Pass Pass
    28 / 33 • 84.8% 30 / 33 • 90.9% 28.5 / 33 • 86.4%29 / 33 • 87.9%30 / 33 • 90.9% 30 / 33 • 90.9%
    Pass Pass PassUnsupportedPass Pass
    1 / 1 • 100.0% 1 / 1 • 100.0% 1 / 1 • 100.0%0 / 1 • 0.0%1 / 1 • 100.0% 1 / 1 • 100.0%
    Pass Pass Pass - Partial -
      -
    • Synthesizes a __slots__ attribute but does not validate attribute assignments against __slots__.
    • -
    -
    Pass Pass
    15.5 / 16 • 96.9% 15.5 / 16 • 96.9% 16 / 16 • 100.0%15 / 16 • 93.8%15.5 / 16 • 96.9% 16 / 16 • 100.0%
    127.5 / 145 • 87.9% 140.5 / 145 • 96.9% 135.5 / 145 • 93.4%128 / 145 • 88.3%130.5 / 145 • 90.0% 140 / 145 • 96.6%
    pyrefly 1.3.0-dev.1 pyright 1.1.410 ty 0.0.74zuban 0.8.2zuban 0.9.2
    Unsupported Unsupported Pass - Partial -
      -
    • Does not infer covariance for a TypeVarTuple in a class with mixed type parameters.
    • -
    -
    Pass
    generics_paramspec_basic UnsupportedPass
    generics_scoping UnsupportedPass
    generics_upper_bound Pass Pass Pass - Partial -
      -
    • polymorphic functions with bound self type influence variance inference,
    • -
    • which is not part of the variance inference algorithm as described in the spec.
    • -
    • See gh-2281 for details.
    • -
    -
    Pass
    30 / 33 • 90.9% 28.5 / 33 • 86.4% 30 / 33 • 90.9%30 / 33 • 90.9%33 / 33 • 100.0%
    - Partial -
      -
    • Does not honor @override compatibility checks for __init__ and __new__:
    • -
    • the incompatible constructor overrides in ChildC2 are not flagged.
    • -
    -
    Pass
    2 / 2 • 100.0% 1.5 / 2 • 75.0% 1.5 / 2 • 75.0%1.5 / 2 • 75.0%2 / 2 • 100.0%
    Unsupported - Partial -
      -
    • False report of ParamSpec variance keywords.
    • -
    -
    Pass
    10.5 / 11 • 95.5% 10.5 / 11 • 95.5% 6.5 / 11 • 59.1%10.5 / 11 • 95.5%11 / 11 • 100.0%
    Pass - Partial -
      -
    • Does not treat a complete union of all literal members as equivalent to the enum type.
    • -
    -
    Pass
    enums_member_names 6 / 6 • 100.0% 5.5 / 6 • 91.7% 6 / 6 • 100.0%5.5 / 6 • 91.7%6 / 6 • 100.0%
    140.5 / 145 • 96.9% 135.5 / 145 • 93.4% 130.5 / 145 • 90.0%140 / 145 • 96.6%144.5 / 145 • 99.7%
    diff --git a/conformance/results/zuban/callables_subtyping.toml b/conformance/results/zuban/callables_subtyping.toml index 81e71c806..221fac6db 100644 --- a/conformance/results/zuban/callables_subtyping.toml +++ b/conformance/results/zuban/callables_subtyping.toml @@ -175,13 +175,19 @@ callables_subtyping.py:243: note: def __call__(self, x: int) -> None callables_subtyping.py:273: error: Incompatible types in assignment (expression has type "Overloaded9", variable has type "FloatArg9") [assignment] callables_subtyping.py:273: note: Following member(s) of "Overloaded9" have conflicts: callables_subtyping.py:273: note: Expected: -callables_subtyping.py:273: note: def __call__(self: FloatArg9, x: float) -> float +callables_subtyping.py:273: note: def __call__(self, x: float) -> float callables_subtyping.py:273: note: Got: -callables_subtyping.py:273: note: def __call__(*args: Any, **kwds: Any) -> Any +callables_subtyping.py:273: note: @overload +callables_subtyping.py:273: note: def __call__(self, x: int) -> int +callables_subtyping.py:273: note: @overload +callables_subtyping.py:273: note: def __call__(self, x: str) -> str callables_subtyping.py:297: error: Incompatible types in assignment (expression has type "StrArg10", variable has type "Overloaded10") [assignment] callables_subtyping.py:297: note: Following member(s) of "StrArg10" have conflicts: callables_subtyping.py:297: note: Expected: -callables_subtyping.py:297: note: def __call__(*args: Any, **kwds: Any) -> Any +callables_subtyping.py:297: note: @overload +callables_subtyping.py:297: note: def __call__(self, x: int, y: str) -> float +callables_subtyping.py:297: note: @overload +callables_subtyping.py:297: note: def __call__(self, x: str) -> complex callables_subtyping.py:297: note: Got: -callables_subtyping.py:297: note: def __call__(self: StrArg10, x: str) -> complex +callables_subtyping.py:297: note: def __call__(self, x: str) -> complex """ diff --git a/conformance/results/zuban/classes_override.toml b/conformance/results/zuban/classes_override.toml index b33df3dd6..781906c90 100644 --- a/conformance/results/zuban/classes_override.toml +++ b/conformance/results/zuban/classes_override.toml @@ -1,12 +1,5 @@ -conformant = "Partial" -notes = """ -Does not honor `@override` compatibility checks for `__init__` and `__new__`: -the incompatible constructor overrides in `ChildC2` are not flagged. -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Lines 134, 135: Expected error (tag 'init') -Lines 137, 138: Expected error (tag 'new') """ output = """ classes_override.py:53: error: Method "method3" is marked as an override, but no base method was found with this name [misc] @@ -14,4 +7,10 @@ classes_override.py:56: error: Method "method4" is marked as an override, but no classes_override.py:79: error: Method "static_method1" is marked as an override, but no base method was found with this name [misc] classes_override.py:84: error: Method "class_method1" is marked as an override, but no base method was found with this name [misc] classes_override.py:89: error: Method "property1" is marked as an override, but no base method was found with this name [misc] +classes_override.py:135: error: Argument 1 of "__init__" is incompatible with supertype "ParentC"; supertype defines the argument type as "int" [override] +classes_override.py:135: note: This violates the Liskov substitution principle +classes_override.py:135: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides +classes_override.py:138: error: Argument 1 of "__new__" is incompatible with supertype "ParentC"; supertype defines the argument type as "int" [override] +classes_override.py:138: note: This violates the Liskov substitution principle +classes_override.py:138: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides """ diff --git a/conformance/results/zuban/constructors_call_init.toml b/conformance/results/zuban/constructors_call_init.toml index 3ebf04786..6192d7a0d 100644 --- a/conformance/results/zuban/constructors_call_init.toml +++ b/conformance/results/zuban/constructors_call_init.toml @@ -3,7 +3,7 @@ errors_diff = """ """ output = """ constructors_call_init.py:21: error: Argument 1 to "Class1" has incompatible type "float"; expected "int" [arg-type] -constructors_call_init.py:42: error: Argument 1 to "Class3" has incompatible type "Class2[Any]"; expected "Self | None" [arg-type] +constructors_call_init.py:42: error: Argument 1 to "Class3" has incompatible type "Class2[int]"; expected "Self | None" [arg-type] constructors_call_init.py:56: error: Invalid self type in __init__ [call-arg] constructors_call_init.py:107: error: The type of self "T1" has type vars in non standard positions for class "Class8" [misc] constructors_call_init.py:107: error: The type of self "T2" has type vars in non standard positions for class "Class8" [misc] diff --git a/conformance/results/zuban/enums_expansion.toml b/conformance/results/zuban/enums_expansion.toml index 99ac1e7f1..5e05ae77b 100644 --- a/conformance/results/zuban/enums_expansion.toml +++ b/conformance/results/zuban/enums_expansion.toml @@ -1,15 +1,7 @@ -conformant = "Partial" -notes = """ -Does not treat a complete union of all literal members as equivalent to the enum type. -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 85: Unexpected errors ['enums_expansion.py:85: error: Incompatible types in assignment (expression has type "Answer", variable has type "Literal[Answer.Yes, Answer.No]") [assignment]'] -Line 86: Unexpected errors ['enums_expansion.py:86: error: Expression is of type "Answer", not "Literal[Answer.Yes, Answer.No]" [misc]'] """ output = """ enums_expansion.py:38: error: Statement is unreachable [unreachable] enums_expansion.py:56: error: Expression is of type "CustomFlags", not "Literal[CustomFlags.FLAG3]" [misc] -enums_expansion.py:85: error: Incompatible types in assignment (expression has type "Answer", variable has type "Literal[Answer.Yes, Answer.No]") [assignment] -enums_expansion.py:86: error: Expression is of type "Answer", not "Literal[Answer.Yes, Answer.No]" [misc] """ diff --git a/conformance/results/zuban/generics_mixed_variance_inference.toml b/conformance/results/zuban/generics_mixed_variance_inference.toml index 7e3422c42..bd9c4a3d8 100644 --- a/conformance/results/zuban/generics_mixed_variance_inference.toml +++ b/conformance/results/zuban/generics_mixed_variance_inference.toml @@ -1,14 +1,8 @@ -conformant = "Partial" -notes = """ -Does not infer covariance for a TypeVarTuple in a class with mixed type parameters. -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 17: Unexpected errors ['generics_mixed_variance_inference.py:17: error: Incompatible types in assignment (expression has type "Mixed[int, bool, []]", variable has type "Mixed[int, int, []]") [assignment]'] """ output = """ generics_mixed_variance_inference.py:13: error: Incompatible types in assignment (expression has type "Mixed[bool, []]", variable has type "Mixed[int, []]") [assignment] generics_mixed_variance_inference.py:16: error: Incompatible types in assignment (expression has type "Mixed[int, object, []]", variable has type "Mixed[int, int, []]") [assignment] -generics_mixed_variance_inference.py:17: error: Incompatible types in assignment (expression has type "Mixed[int, bool, []]", variable has type "Mixed[int, int, []]") [assignment] generics_mixed_variance_inference.py:21: error: Incompatible types in assignment (expression has type "Mixed[int, [bool]]", variable has type "Mixed[int, [int]]") [assignment] """ diff --git a/conformance/results/zuban/generics_paramspec_variance.toml b/conformance/results/zuban/generics_paramspec_variance.toml index 9cf305fb1..0b4029a1c 100644 --- a/conformance/results/zuban/generics_paramspec_variance.toml +++ b/conformance/results/zuban/generics_paramspec_variance.toml @@ -1,47 +1,27 @@ -conformant = "Unsupported" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 15: Expected 1 errors -Line 30: Expected 1 errors -Line 90: Expected 1 errors -Line 111: Expected 1 errors -Line 117: Expected 1 errors -Line 126: Expected 1 errors -Line 132: Expected 1 errors -Line 151: Expected 1 errors -Line 31: Unexpected errors ['generics_paramspec_variance.py:31: error: Incompatible types in assignment (expression has type "CovariantParamSpec[[int]]", variable has type "CovariantParamSpec[[object]]") [assignment]'] -Line 84: Unexpected errors ['generics_paramspec_variance.py:84: error: Incompatible types in assignment (expression has type "OutitP[[*, a: int]]", variable has type "OutitP[[a: int]]") [assignment]'] -Line 86: Unexpected errors ['generics_paramspec_variance.py:86: error: Incompatible types in assignment (expression has type "OutitP[[int]]", variable has type "OutitP[[a: int]]") [assignment]'] -Line 97: Unexpected errors ['generics_paramspec_variance.py:97: error: The variance and bound arguments to ParamSpec do not have defined semantics yet [misc]'] -Line 98: Unexpected errors ['generics_paramspec_variance.py:98: error: The variance and bound arguments to ParamSpec do not have defined semantics yet [misc]'] -Line 99: Unexpected errors ['generics_paramspec_variance.py:99: error: Unexpected argument to "ParamSpec()" [misc]'] -Line 133: Unexpected errors ['generics_paramspec_variance.py:133: error: Incompatible types in assignment (expression has type "CovariantParamSpecOld[[int]]", variable has type "CovariantParamSpecOld[[object]]") [assignment]'] -Line 152: Unexpected errors ['generics_paramspec_variance.py:152: error: Incompatible types in assignment (expression has type "InferredCovariantParamSpecOld[[int]]", variable has type "InferredCovariantParamSpecOld[[object]]") [assignment]'] """ output = """ generics_paramspec_variance.py:14: error: Incompatible types in assignment (expression has type "InvariantParamSpec[[int]]", variable has type "InvariantParamSpec[[object]]") [assignment] +generics_paramspec_variance.py:15: error: Incompatible types in assignment (expression has type "InvariantParamSpec[[object]]", variable has type "InvariantParamSpec[[int]]") [assignment] generics_paramspec_variance.py:21: error: Incompatible types in assignment (expression has type "ContravariantParamSpec[[int]]", variable has type "ContravariantParamSpec[[object]]") [assignment] -generics_paramspec_variance.py:31: error: Incompatible types in assignment (expression has type "CovariantParamSpec[[int]]", variable has type "CovariantParamSpec[[object]]") [assignment] +generics_paramspec_variance.py:30: error: Incompatible types in assignment (expression has type "CovariantParamSpec[[object]]", variable has type "CovariantParamSpec[[int]]") [assignment] generics_paramspec_variance.py:61: error: Incompatible types in assignment (expression has type "InitP[[*, a: int]]", variable has type "InitP[[a: int]]") [assignment] generics_paramspec_variance.py:63: error: Incompatible types in assignment (expression has type "InitP[[int]]", variable has type "InitP[[a: int]]") [assignment] generics_paramspec_variance.py:65: error: Incompatible types in assignment (expression has type "InitP[[b: int]]", variable has type "InitP[[a: int]]") [assignment] generics_paramspec_variance.py:69: error: Incompatible types in assignment (expression has type "InitP[[a: int, b: str]]", variable has type "InitP[[a: int]]") [assignment] -generics_paramspec_variance.py:84: error: Incompatible types in assignment (expression has type "OutitP[[*, a: int]]", variable has type "OutitP[[a: int]]") [assignment] -generics_paramspec_variance.py:86: error: Incompatible types in assignment (expression has type "OutitP[[int]]", variable has type "OutitP[[a: int]]") [assignment] generics_paramspec_variance.py:88: error: Incompatible types in assignment (expression has type "OutitP[[b: int]]", variable has type "OutitP[[a: int]]") [assignment] +generics_paramspec_variance.py:90: error: Incompatible types in assignment (expression has type "OutitP[[a: int =]]", variable has type "OutitP[[a: int]]") [assignment] generics_paramspec_variance.py:92: error: Incompatible types in assignment (expression has type "OutitP[[a: int, b: str]]", variable has type "OutitP[[a: int]]") [assignment] -generics_paramspec_variance.py:97: error: The variance and bound arguments to ParamSpec do not have defined semantics yet [misc] -generics_paramspec_variance.py:98: error: The variance and bound arguments to ParamSpec do not have defined semantics yet [misc] -generics_paramspec_variance.py:99: error: Unexpected argument to "ParamSpec()" [misc] -generics_paramspec_variance.py:100: error: The variance and bound arguments to ParamSpec do not have defined semantics yet [misc] -generics_paramspec_variance.py:100: error: The variance and bound arguments to ParamSpec do not have defined semantics yet [misc] -generics_paramspec_variance.py:101: error: The variance and bound arguments to ParamSpec do not have defined semantics yet [misc] -generics_paramspec_variance.py:101: error: Unexpected argument to "ParamSpec()" [misc] -generics_paramspec_variance.py:102: error: The variance and bound arguments to ParamSpec do not have defined semantics yet [misc] -generics_paramspec_variance.py:102: error: Unexpected argument to "ParamSpec()" [misc] +generics_paramspec_variance.py:100: error: ParamSpec cannot be both covariant and contravariant [misc] +generics_paramspec_variance.py:101: error: Cannot use covariant with infer_variance [misc] +generics_paramspec_variance.py:102: error: Cannot use contravariant with infer_variance [misc] generics_paramspec_variance.py:110: error: Incompatible types in assignment (expression has type "InvariantParamSpecOld[[bool]]", variable has type "InvariantParamSpecOld[[int]]") [assignment] +generics_paramspec_variance.py:111: error: Incompatible types in assignment (expression has type "InvariantParamSpecOld[[object]]", variable has type "InvariantParamSpecOld[[int]]") [assignment] +generics_paramspec_variance.py:117: error: Cannot use a contravariant param spec as a parameter [type-var] generics_paramspec_variance.py:121: error: Incompatible types in assignment (expression has type "ContravariantParamSpecOld[[int]]", variable has type "ContravariantParamSpecOld[[object]]") [assignment] -generics_paramspec_variance.py:133: error: Incompatible types in assignment (expression has type "CovariantParamSpecOld[[int]]", variable has type "CovariantParamSpecOld[[object]]") [assignment] +generics_paramspec_variance.py:126: error: Cannot use a covariant param spec as return type [type-var] +generics_paramspec_variance.py:132: error: Incompatible types in assignment (expression has type "CovariantParamSpecOld[[object]]", variable has type "CovariantParamSpecOld[[int]]") [assignment] generics_paramspec_variance.py:142: error: Incompatible types in assignment (expression has type "InferredContravariantParamSpecOld[[int]]", variable has type "InferredContravariantParamSpecOld[[object]]") [assignment] -generics_paramspec_variance.py:152: error: Incompatible types in assignment (expression has type "InferredCovariantParamSpecOld[[int]]", variable has type "InferredCovariantParamSpecOld[[object]]") [assignment] +generics_paramspec_variance.py:151: error: Incompatible types in assignment (expression has type "InferredCovariantParamSpecOld[[object]]", variable has type "InferredCovariantParamSpecOld[[int]]") [assignment] """ diff --git a/conformance/results/zuban/generics_typevartuple_variance.toml b/conformance/results/zuban/generics_typevartuple_variance.toml index c4092867e..5c9e528d5 100644 --- a/conformance/results/zuban/generics_typevartuple_variance.toml +++ b/conformance/results/zuban/generics_typevartuple_variance.toml @@ -1,22 +1,5 @@ -conformant = "Unsupported" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 79: Expected 1 errors -Line 90: Expected 1 errors -Line 29: Unexpected errors ['generics_typevartuple_variance.py:29: error: Incompatible types in assignment (expression has type "ContravariantTypeVarTuple[object]", variable has type "ContravariantTypeVarTuple[int]") [assignment]'] -Line 30: Unexpected errors ['generics_typevartuple_variance.py:30: error: Incompatible types in assignment (expression has type "ContravariantTypeVarTuple[Unpack[Tuple[object, ...]]]", variable has type "ContravariantTypeVarTuple[Unpack[Tuple[int, ...]]]") [assignment]'] -Line 33: Unexpected errors ['generics_typevartuple_variance.py:33: error: Incompatible types in assignment (expression has type "ContravariantTypeVarTuple[Unpack[Tuple[int, ...]]]", variable has type "ContravariantTypeVarTuple[int]") [assignment]'] -Line 43: Unexpected errors ['generics_typevartuple_variance.py:43: error: Incompatible types in assignment (expression has type "CovariantTypeVarTuple[int]", variable has type "CovariantTypeVarTuple[object]") [assignment]'] -Line 44: Unexpected errors ['generics_typevartuple_variance.py:44: error: Incompatible types in assignment (expression has type "CovariantTypeVarTuple[bool, bool]", variable has type "CovariantTypeVarTuple[int, int]") [assignment]'] -Line 49: Unexpected errors ['generics_typevartuple_variance.py:49: error: Incompatible types in assignment (expression has type "CovariantTypeVarTuple[Unpack[Tuple[int, ...]]]", variable has type "CovariantTypeVarTuple[Unpack[Tuple[object, ...]]]") [assignment]'] -Line 52: Unexpected errors ['generics_typevartuple_variance.py:52: error: Incompatible types in assignment (expression has type "CovariantTypeVarTuple[int]", variable has type "CovariantTypeVarTuple[Unpack[Tuple[int, ...]]]") [assignment]'] -Line 55: Unexpected errors ['generics_typevartuple_variance.py:55: error: Unexpected keyword argument "infer_variance" for "TypeVarTuple" [call-arg]'] -Line 73: Unexpected errors ['generics_typevartuple_variance.py:73: error: Unexpected keyword argument "contravariant" for "TypeVarTuple" [call-arg]'] -Line 84: Unexpected errors ['generics_typevartuple_variance.py:84: error: Incompatible types in assignment (expression has type "ContravariantTypeVarTupleOld[object]", variable has type "ContravariantTypeVarTupleOld[int]") [assignment]'] -Line 87: Unexpected errors ['generics_typevartuple_variance.py:87: error: Unexpected keyword argument "covariant" for "TypeVarTuple" [call-arg]'] -Line 98: Unexpected errors ['generics_typevartuple_variance.py:98: error: Incompatible types in assignment (expression has type "CovariantTypeVarTupleOld[int]", variable has type "CovariantTypeVarTupleOld[object]") [assignment]'] -Line 108: Unexpected errors ['generics_typevartuple_variance.py:108: error: Incompatible types in assignment (expression has type "InferredContravariantTypeVarTupleOld[object]", variable has type "InferredContravariantTypeVarTupleOld[int]") [assignment]'] -Line 117: Unexpected errors ['generics_typevartuple_variance.py:117: error: Incompatible types in assignment (expression has type "InferredCovariantTypeVarTupleOld[int]", variable has type "InferredCovariantTypeVarTupleOld[object]") [assignment]'] """ output = """ generics_typevartuple_variance.py:14: error: Incompatible types in assignment (expression has type "InvariantTypeVarTuple[int]", variable has type "InvariantTypeVarTuple[object]") [assignment] @@ -26,38 +9,23 @@ generics_typevartuple_variance.py:18: error: Incompatible types in assignment (e generics_typevartuple_variance.py:20: error: Incompatible types in assignment (expression has type "InvariantTypeVarTuple[Unpack[Tuple[int, ...]]]", variable has type "InvariantTypeVarTuple[int]") [assignment] generics_typevartuple_variance.py:21: error: Incompatible types in assignment (expression has type "InvariantTypeVarTuple[int]", variable has type "InvariantTypeVarTuple[Unpack[Tuple[int, ...]]]") [assignment] generics_typevartuple_variance.py:28: error: Incompatible types in assignment (expression has type "ContravariantTypeVarTuple[object, int]", variable has type "ContravariantTypeVarTuple[object, object]") [assignment] -generics_typevartuple_variance.py:29: error: Incompatible types in assignment (expression has type "ContravariantTypeVarTuple[object]", variable has type "ContravariantTypeVarTuple[int]") [assignment] -generics_typevartuple_variance.py:30: error: Incompatible types in assignment (expression has type "ContravariantTypeVarTuple[Unpack[Tuple[object, ...]]]", variable has type "ContravariantTypeVarTuple[Unpack[Tuple[int, ...]]]") [assignment] generics_typevartuple_variance.py:31: error: Incompatible types in assignment (expression has type "ContravariantTypeVarTuple[Unpack[Tuple[int, ...]]]", variable has type "ContravariantTypeVarTuple[Unpack[Tuple[object, ...]]]") [assignment] -generics_typevartuple_variance.py:33: error: Incompatible types in assignment (expression has type "ContravariantTypeVarTuple[Unpack[Tuple[int, ...]]]", variable has type "ContravariantTypeVarTuple[int]") [assignment] generics_typevartuple_variance.py:34: error: Incompatible types in assignment (expression has type "ContravariantTypeVarTuple[int]", variable has type "ContravariantTypeVarTuple[Unpack[Tuple[int, ...]]]") [assignment] generics_typevartuple_variance.py:42: error: Incompatible types in assignment (expression has type "CovariantTypeVarTuple[object]", variable has type "CovariantTypeVarTuple[int]") [assignment] -generics_typevartuple_variance.py:43: error: Incompatible types in assignment (expression has type "CovariantTypeVarTuple[int]", variable has type "CovariantTypeVarTuple[object]") [assignment] -generics_typevartuple_variance.py:44: error: Incompatible types in assignment (expression has type "CovariantTypeVarTuple[bool, bool]", variable has type "CovariantTypeVarTuple[int, int]") [assignment] generics_typevartuple_variance.py:45: error: Incompatible types in assignment (expression has type "CovariantTypeVarTuple[bool, object]", variable has type "CovariantTypeVarTuple[int, int]") [assignment] generics_typevartuple_variance.py:46: error: Incompatible types in assignment (expression has type "CovariantTypeVarTuple[object, bool]", variable has type "CovariantTypeVarTuple[int, int]") [assignment] generics_typevartuple_variance.py:47: error: Incompatible types in assignment (expression has type "CovariantTypeVarTuple[object, object]", variable has type "CovariantTypeVarTuple[int, int]") [assignment] generics_typevartuple_variance.py:48: error: Incompatible types in assignment (expression has type "CovariantTypeVarTuple[Unpack[Tuple[object, ...]]]", variable has type "CovariantTypeVarTuple[Unpack[Tuple[int, ...]]]") [assignment] -generics_typevartuple_variance.py:49: error: Incompatible types in assignment (expression has type "CovariantTypeVarTuple[Unpack[Tuple[int, ...]]]", variable has type "CovariantTypeVarTuple[Unpack[Tuple[object, ...]]]") [assignment] generics_typevartuple_variance.py:51: error: Incompatible types in assignment (expression has type "CovariantTypeVarTuple[Unpack[Tuple[int, ...]]]", variable has type "CovariantTypeVarTuple[int]") [assignment] -generics_typevartuple_variance.py:52: error: Incompatible types in assignment (expression has type "CovariantTypeVarTuple[int]", variable has type "CovariantTypeVarTuple[Unpack[Tuple[int, ...]]]") [assignment] -generics_typevartuple_variance.py:55: error: Unexpected keyword argument "infer_variance" for "TypeVarTuple" [call-arg] -generics_typevartuple_variance.py:56: error: Unexpected keyword argument "covariant" for "TypeVarTuple" [call-arg] -generics_typevartuple_variance.py:56: error: Unexpected keyword argument "contravariant" for "TypeVarTuple" [call-arg] -generics_typevartuple_variance.py:57: error: Unexpected keyword argument "covariant" for "TypeVarTuple" [call-arg] -generics_typevartuple_variance.py:57: error: Unexpected keyword argument "infer_variance" for "TypeVarTuple" [call-arg] -generics_typevartuple_variance.py:58: error: Unexpected keyword argument "contravariant" for "TypeVarTuple" [call-arg] -generics_typevartuple_variance.py:58: error: Unexpected keyword argument "infer_variance" for "TypeVarTuple" [call-arg] +generics_typevartuple_variance.py:56: error: TypeVarTuple cannot be both covariant and contravariant [misc] +generics_typevartuple_variance.py:57: error: Cannot use covariant with infer_variance [misc] +generics_typevartuple_variance.py:58: error: Cannot use contravariant with infer_variance [misc] generics_typevartuple_variance.py:68: error: Incompatible types in assignment (expression has type "InvariantTypeVarTupleOld[int]", variable has type "InvariantTypeVarTupleOld[object]") [assignment] generics_typevartuple_variance.py:69: error: Incompatible types in assignment (expression has type "InvariantTypeVarTupleOld[object]", variable has type "InvariantTypeVarTupleOld[int]") [assignment] -generics_typevartuple_variance.py:73: error: Unexpected keyword argument "contravariant" for "TypeVarTuple" [call-arg] +generics_typevartuple_variance.py:79: error: Cannot use a contravariant type var tuples as return type [type-var] generics_typevartuple_variance.py:83: error: Incompatible types in assignment (expression has type "ContravariantTypeVarTupleOld[int]", variable has type "ContravariantTypeVarTupleOld[object]") [assignment] -generics_typevartuple_variance.py:84: error: Incompatible types in assignment (expression has type "ContravariantTypeVarTupleOld[object]", variable has type "ContravariantTypeVarTupleOld[int]") [assignment] -generics_typevartuple_variance.py:87: error: Unexpected keyword argument "covariant" for "TypeVarTuple" [call-arg] +generics_typevartuple_variance.py:90: error: Cannot use a covariant type var tuples as a parameter [type-var] generics_typevartuple_variance.py:97: error: Incompatible types in assignment (expression has type "CovariantTypeVarTupleOld[object]", variable has type "CovariantTypeVarTupleOld[int]") [assignment] -generics_typevartuple_variance.py:98: error: Incompatible types in assignment (expression has type "CovariantTypeVarTupleOld[int]", variable has type "CovariantTypeVarTupleOld[object]") [assignment] generics_typevartuple_variance.py:107: error: Incompatible types in assignment (expression has type "InferredContravariantTypeVarTupleOld[int]", variable has type "InferredContravariantTypeVarTupleOld[object]") [assignment] -generics_typevartuple_variance.py:108: error: Incompatible types in assignment (expression has type "InferredContravariantTypeVarTupleOld[object]", variable has type "InferredContravariantTypeVarTupleOld[int]") [assignment] generics_typevartuple_variance.py:116: error: Incompatible types in assignment (expression has type "InferredCovariantTypeVarTupleOld[object]", variable has type "InferredCovariantTypeVarTupleOld[int]") [assignment] -generics_typevartuple_variance.py:117: error: Incompatible types in assignment (expression has type "InferredCovariantTypeVarTupleOld[int]", variable has type "InferredCovariantTypeVarTupleOld[object]") [assignment] """ diff --git a/conformance/results/zuban/generics_variance_inference.toml b/conformance/results/zuban/generics_variance_inference.toml index 7e9a0604a..600ad7145 100644 --- a/conformance/results/zuban/generics_variance_inference.toml +++ b/conformance/results/zuban/generics_variance_inference.toml @@ -1,12 +1,5 @@ -conformant = "Partial" -notes = """ -polymorphic functions with bound self type influence variance inference, -which is not part of the variance inference algorithm as described in the spec. -See gh-2281 for details. -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 200: Unexpected errors ['generics_variance_inference.py:200: error: Name "S" is not defined [name-defined]', 'generics_variance_inference.py:200: error: Name "S" is not defined [name-defined]'] """ output = """ generics_variance_inference.py:24: error: Incompatible types in assignment (expression has type "ClassA[float, int, int]", variable has type "ClassA[int, int, int]") [assignment] @@ -32,7 +25,5 @@ generics_variance_inference.py:169: error: Incompatible types in assignment (exp generics_variance_inference.py:170: error: Incompatible types in assignment (expression has type "ShouldBeInvariant6[int]", variable has type "ShouldBeInvariant6[float]") [assignment] generics_variance_inference.py:181: error: Incompatible types in assignment (expression has type "ShouldBeCovariant6[float]", variable has type "ShouldBeCovariant6[int]") [assignment] generics_variance_inference.py:194: error: Incompatible types in assignment (expression has type "ShouldBeContravariant2[int]", variable has type "ShouldBeContravariant2[float]") [assignment] -generics_variance_inference.py:200: error: Name "S" is not defined [name-defined] -generics_variance_inference.py:200: error: Name "S" is not defined [name-defined] generics_variance_inference.py:205: error: Incompatible types in assignment (expression has type "ShouldBeCovariant7[object]", variable has type "ShouldBeCovariant7[int]") [assignment] """ diff --git a/conformance/results/zuban/protocols_variance.toml b/conformance/results/zuban/protocols_variance.toml index 5aac24487..187f0d716 100644 --- a/conformance/results/zuban/protocols_variance.toml +++ b/conformance/results/zuban/protocols_variance.toml @@ -1,13 +1,7 @@ -conformant = "Partial" -conformance_automated = "Fail" -notes = """ -False report of ParamSpec variance keywords. -""" +conformance_automated = "Pass" errors_diff = """ -Line 15: Unexpected errors ['protocols_variance.py:15: error: The variance and bound arguments to ParamSpec do not have defined semantics yet [misc]'] """ output = """ -protocols_variance.py:15: error: The variance and bound arguments to ParamSpec do not have defined semantics yet [misc] protocols_variance.py:22: error: Invariant type variable "T1" used in protocol where Covariant one is expected [misc] protocols_variance.py:41: error: Invariant type variable "T3" used in protocol where Contravariant one is expected [misc] protocols_variance.py:57: error: Invariant type variable "T1" used in protocol where Contravariant one is expected [misc] diff --git a/conformance/results/zuban/typeddicts_extra_items.toml b/conformance/results/zuban/typeddicts_extra_items.toml index 82f60b5fd..82d257007 100644 --- a/conformance/results/zuban/typeddicts_extra_items.toml +++ b/conformance/results/zuban/typeddicts_extra_items.toml @@ -27,7 +27,7 @@ typeddicts_extra_items.py:257: error: Incompatible types in assignment (expressi typeddicts_extra_items.py:268: error: Incompatible types in assignment (expression has type "MovieNotClosed", variable has type "MovieExtraInt") [assignment] typeddicts_extra_items.py:278: error: Extra key "year" for TypedDict "NonClosedMovie" [typeddict-unknown-key] typeddicts_extra_items.py:285: error: Incompatible types (expression has type "str", TypedDict item "language" has type "int") [typeddict-item] -typeddicts_extra_items.py:293: error: Incompatible types (expression has type "int", TypedDict item "year" has type "Never") [typeddict-item] +typeddicts_extra_items.py:293: error: Extra key "year" for TypedDict "ClosedMovie" [typeddict-unknown-key] typeddicts_extra_items.py:303: error: Incompatible types in assignment (expression has type "MovieExtraInt", variable has type "Mapping[str, int]") [assignment] typeddicts_extra_items.py:352: error: Incompatible types in assignment (expression has type "dict[str, int]", variable has type "IntDict") [assignment] """ diff --git a/conformance/results/zuban/version.toml b/conformance/results/zuban/version.toml index bff04a65e..f1f3f54a9 100644 --- a/conformance/results/zuban/version.toml +++ b/conformance/results/zuban/version.toml @@ -1 +1 @@ -version = "zuban 0.8.2" +version = "zuban 0.9.2" diff --git a/conformance/uv.lock b/conformance/uv.lock index 5da6097af..2b3c979e4 100644 --- a/conformance/uv.lock +++ b/conformance/uv.lock @@ -291,19 +291,19 @@ wheels = [ [[package]] name = "zuban" -version = "0.8.2" +version = "0.9.2" source = { registry = "https://pypi.org/simple" } wheels = [ - { url = "https://files.pythonhosted.org/packages/95/d8/9a24dc2c22250fc416bff06c4ac4664c73ef7ec558b8d23049f493af73b5/zuban-0.8.2-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:07d3a498c514cb51ec881987b0e841043ea466674a9b3bed8411890bacb4d0e3", size = 11486917, upload-time = "2026-06-08T23:29:02.829Z" }, - { url = "https://files.pythonhosted.org/packages/23/62/3636a5474a9f9361ca83030cb82fefb4b1ff7771c75ab957c9025a3a7a97/zuban-0.8.2-py3-none-macosx_11_0_arm64.whl", hash = "sha256:64ed57aea375c74671d81e4d4655328a47b2157c7827e2c50cc90f80b29e8417", size = 11205360, upload-time = "2026-06-08T23:29:05.612Z" }, - { url = "https://files.pythonhosted.org/packages/49/41/0650f89e1f2ea0e865dd5e23614e6f3a205153032f0a9e970c5f4da885d1/zuban-0.8.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8bc47f343a939407ff881b0e9f0da36c7a3a509b3e6ca237512aadf30d02053b", size = 28385720, upload-time = "2026-06-08T23:29:08.177Z" }, - { url = "https://files.pythonhosted.org/packages/d7/52/58ecbdbf9668fd81c85f69b94609a5a813a94a18d9ce73ee1548cf85d98d/zuban-0.8.2-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:26ede2418f48affde0e9092108ec0be344b1323d7e87d11ecac8e5e89d383d7e", size = 28603725, upload-time = "2026-06-08T23:29:11.778Z" }, - { url = "https://files.pythonhosted.org/packages/96/ad/efc2e98a4492d010459161e03f98952227744c8f5ae8ebcc13ca88d50ad6/zuban-0.8.2-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b83e0cc35cccb2f60b50d8c6658ca3ac332914ad58d8e3d3d5886a13f761771b", size = 29769216, upload-time = "2026-06-08T23:29:14.865Z" }, - { url = "https://files.pythonhosted.org/packages/f7/60/a40add4cf31694f64727a34fc4a2093c599f1c911fdb6fbf61bf40d437f5/zuban-0.8.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8c4b26c1a383234c340d4956c04d8528e5e1654a08571d9d3eaced4973d21f87", size = 30851896, upload-time = "2026-06-08T23:29:18.04Z" }, - { url = "https://files.pythonhosted.org/packages/17/6f/7e32ec7c1677dfd7ac5821ac1d6cc6d4552f65fe06b098bd3515f5c5699d/zuban-0.8.2-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:32699e64acdb7d8984eddc3095b8f6fcf37fa00c52d54e74fed920440fe36ebe", size = 28551589, upload-time = "2026-06-08T23:29:20.922Z" }, - { url = "https://files.pythonhosted.org/packages/68/26/f5e8434aa8ea478a949b4dab8bd94abb47ff46f4777943a3309c33bfda94/zuban-0.8.2-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:f2ada854ceddeae6f7a8ecf709577235f5845770ebd6d51b26dde4358e78b645", size = 29007499, upload-time = "2026-06-08T23:29:23.954Z" }, - { url = "https://files.pythonhosted.org/packages/5c/37/70e6696e0e9d202fa84be8437b9dbf32e6d5854d9a201b9ca24965496391/zuban-0.8.2-py3-none-musllinux_1_2_i686.whl", hash = "sha256:dd6c2be104e6e9e1693e15d0a7775c5841a9793534351738c24b7377c58b487c", size = 29670474, upload-time = "2026-06-08T23:29:26.769Z" }, - { url = "https://files.pythonhosted.org/packages/74/0c/1c6f0a239fc2c93c46e733fa5d6f9ac376f9e0aec909467d50f6071234bf/zuban-0.8.2-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:299debc250b729abb0ebecd0bd53cac3c6b26cdb32dc4e79e601f9a1f584d3cd", size = 29029010, upload-time = "2026-06-08T23:29:29.959Z" }, - { url = "https://files.pythonhosted.org/packages/a6/7b/d5cdb140e9979d3f7784d9565f21692cafb851cceb21cba13348bcfcfa30/zuban-0.8.2-py3-none-win32.whl", hash = "sha256:3521196b132c2650e01a085d211dfcd849de9e9409e193e8f8ad85629c60fa42", size = 10026570, upload-time = "2026-06-08T23:29:32.596Z" }, - { url = "https://files.pythonhosted.org/packages/ee/cb/25a952a3594aa7ee32dee648513a1ea758c2def98742966d24484bb3d8ab/zuban-0.8.2-py3-none-win_amd64.whl", hash = "sha256:07463d337d293efb918990900c52b976646810b8f741999e8f288fb3da6e6594", size = 10798493, upload-time = "2026-06-08T23:29:34.805Z" }, + { url = "https://files.pythonhosted.org/packages/a4/c0/1c395a08b2a7c48fbbb1398818d65813032ad0acfec5a841db0e7142a6ac/zuban-0.9.2-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:8922df80834c2d5cb1e2798192dc85d40b4dc3fa3149e7b2b89dccf3cdc110d8", size = 11377755, upload-time = "2026-08-26T00:19:21.022Z" }, + { url = "https://files.pythonhosted.org/packages/af/3c/b323802de4a86f71479b85d388294380205006362bca4414d3213469136a/zuban-0.9.2-py3-none-macosx_11_0_arm64.whl", hash = "sha256:112c9bd639ec417fe7881a7d99bc34e35ac6ba6e0afd4f33caf0774ea8ae84fc", size = 11101402, upload-time = "2026-08-26T00:19:24.548Z" }, + { url = "https://files.pythonhosted.org/packages/9f/3b/71ee867aebe9175de1db0208c2eeee7f294821545e6140c28e5ed9f21888/zuban-0.9.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d8d65dafe086a8e73cbb8e6d7e3b234a7d2e64cf794d49c5ca0ca901a2880bea", size = 28451467, upload-time = "2026-08-26T00:19:28.898Z" }, + { url = "https://files.pythonhosted.org/packages/bc/93/7331f9f096b1c4a9d575ed6e86572cf6c5ac9eab5dc1c68d0d875e78d549/zuban-0.9.2-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:d8431a65ac7815af24e015d6f6c935518625e015e028b061899677a3d43c6349", size = 28687477, upload-time = "2026-08-26T00:19:33.102Z" }, + { url = "https://files.pythonhosted.org/packages/f8/5a/de09de19a0ea8a4593632631c905751cf380cf8a92d1607632ad40c683ea/zuban-0.9.2-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6d271a27a56ad89e3bb5942580aa903354c3861bfab29e5c655d44007d1d15a2", size = 29736764, upload-time = "2026-08-26T00:19:38.73Z" }, + { url = "https://files.pythonhosted.org/packages/cb/71/2e32dfafa5ac302b7b9cc48bbcfbc9da6bca221ccfd03da5b9d2a28240ee/zuban-0.9.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:20a467e9d90f5dce53be3c760d9b65e768870a4e940a5256985f67155587eeb9", size = 31719649, upload-time = "2026-08-26T00:19:43.454Z" }, + { url = "https://files.pythonhosted.org/packages/b2/24/d437b54a088b2a35df948841d011a011ba5db59bdb4bad7c800dffcbbe2e/zuban-0.9.2-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:a2c29e501de2f39690eadffab6369c9ac949bdab82aaab4c9fcbbfda0794d704", size = 28630746, upload-time = "2026-08-26T00:19:47.888Z" }, + { url = "https://files.pythonhosted.org/packages/04/12/a132d0ad526d8986475344546b22acfea0bd6856bb293b70e691fa9bf5d5/zuban-0.9.2-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:23e34cd5d3c2aad476506fc2a0d3f4fd314e87bb03c873ec2c319497b06f16df", size = 29122179, upload-time = "2026-08-26T00:19:52.937Z" }, + { url = "https://files.pythonhosted.org/packages/70/4e/ebbec923b02c69eee955cc65d227c4a1b6f5c6f2b509b92c9df02ad67e2b/zuban-0.9.2-py3-none-musllinux_1_2_i686.whl", hash = "sha256:40f4737d3f7c5926b986ebb4cb44767b2b72788072e833c49d2d3ad2f69ecbdb", size = 29624765, upload-time = "2026-08-26T00:19:57.778Z" }, + { url = "https://files.pythonhosted.org/packages/db/7f/8baa60499029d57bc0dbc254d75469f7b7860654671d0bf3683bc6c56f05/zuban-0.9.2-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:26a83d3c1f12cd131774a4f89b3c0d750619e7035d02dcd4f668fb43e5ba2fea", size = 28964675, upload-time = "2026-08-26T00:20:02.558Z" }, + { url = "https://files.pythonhosted.org/packages/fa/d8/4a6f29958fa962c2b12ec32a0624708b9da93bec236ace0ac993632d05b1/zuban-0.9.2-py3-none-win32.whl", hash = "sha256:59d09caf2e488eb6d31a3bead1699349f66dafbfd595eb64bcd8e11b79d8e2d1", size = 10051150, upload-time = "2026-08-26T00:20:05.965Z" }, + { url = "https://files.pythonhosted.org/packages/af/c2/123e0f3054f688039290766fdbdd4cba96834537e6fd3f6c95ae460858bd/zuban-0.9.2-py3-none-win_amd64.whl", hash = "sha256:9bc429ef78d3f21a6aeec9cddffe8748235ef2374ef318a91f4aa089cafba75c", size = 10730401, upload-time = "2026-08-26T00:20:08.97Z" }, ] From 5672d88d54c149de13d0bbd3f2995b5449f72e20 Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Thu, 27 Aug 2026 13:11:24 -0400 Subject: [PATCH 286/308] Update ty results for v0.0.75 (#2348) --- conformance/results/results.html | 17 +++------ conformance/results/ty/narrowing_typeis.toml | 8 +--- .../results/ty/protocols_variance.toml | 17 ++++----- conformance/results/ty/version.toml | 2 +- conformance/uv.lock | 38 +++++++++---------- 5 files changed, 35 insertions(+), 47 deletions(-) diff --git a/conformance/results/results.html b/conformance/results/results.html index 1aa44316d..0d37f6225 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -268,7 +268,7 @@

    Python Type System Conformance Test Results

    pycroscope 0.4.0 pyrefly 1.3.0-dev.1 pyright 1.1.410ty 0.0.74ty 0.0.75 zuban 0.9.2
    UnsupportedPass Pass
    9.5 / 11 • 86.4% 10.5 / 11 • 95.5% 10.5 / 11 • 95.5%6.5 / 11 • 59.1%7.5 / 11 • 68.2% 11 / 11 • 100.0%
    Pass Pass Pass - Partial -
      -
    • Does not fully simplify the negative branch of TypeIs narrowing for a union of fixed-length tuple types.
    • -
    -
    Pass Pass
    2 / 2 • 100.0% 2 / 2 • 100.0% 2 / 2 • 100.0%1.5 / 2 • 75.0%2 / 2 • 100.0% 2 / 2 • 100.0%
    127.5 / 145 • 87.9% 140.5 / 145 • 96.9% 135.5 / 145 • 93.4%130.5 / 145 • 90.0%132 / 145 • 91.0% 144.5 / 145 • 99.7%
    mypy 2.1.0pycroscope 0.4.0pycroscope 0.5.0 pyrefly 1.3.0-dev.1 pyright 1.1.410 ty 0.0.75 - Partial -
      -
    • Numerous issues; does not support TypeVarTuple and ParamSpec defaults.
    • -
    -
    Pass Pass Pass @@ -580,12 +575,7 @@

    Python Type System Conformance Test Results

  • Does not correctly handle defaults referencing other TypeVars.
  • - Partial -
      -
    • Fails to apply default specializations in some cases.
    • -
    -
    Pass Pass Pass Pass
    generics_mixed_variance_inference PassUnsupportedPass Unsupported Unsupported Pass
    generics_paramspec_variance UnsupportedUnsupportedPass Unsupported Unsupported @@ -787,12 +777,7 @@

    Python Type System Conformance Test Results

  • Does not following runtime scoping rules for type parameters in all cases.
  • - Partial -
      -
    • Misses some details of scoping rules.
    • -
    -
    Pass Pass Pass Pass - Partial -
      -
    • Doesn't error when multiple type variable tuples appear in a PEP 695 type parameter list; only detects the Generic[...] form.
    • -
    -
    Pass Pass Partial @@ -914,7 +894,7 @@

    Python Type System Conformance Test Results

    generics_typevartuple_variance UnsupportedUnsupportedPass Unsupported Unsupported @@ -972,7 +952,7 @@

    Python Type System Conformance Test Results

    23.5 / 33 • 71.2%28 / 33 • 84.8%33 / 33 • 100.0% 30 / 33 • 90.9% 28.5 / 33 • 86.4% 30 / 33 • 90.9% - Partial -
      -
    • Does not reject use of ClassVar as a qualifier for a NamedTuple field.
    • -
    -
    Pass Pass Pass Pass - Partial -
      -
    • Does not honor @override compatibility checks for __init__ and __new__:
    • -
    • the incompatible constructor overrides in ChildC2 are not flagged.
    • -
    -
    Pass Pass Partial @@ -1109,7 +1078,7 @@

    Python Type System Conformance Test Results

    1 / 2 • 50.0%1 / 2 • 50.0%2 / 2 • 100.0% 2 / 2 • 100.0% 1.5 / 2 • 75.0% 1.5 / 2 • 75.0% Pass - Partial -
      -
    • Rejects valid ParamSpec specialization.
    • -
    -
    Pass Pass Pass @@ -1241,7 +1206,7 @@

    Python Type System Conformance Test Results

    5.5 / 7 • 78.6%5.5 / 7 • 78.6%6 / 7 • 85.7% 7 / 7 • 100.0% 7 / 7 • 100.0% 4 / 7 • 57.1% - Partial -
      -
    • Incorrectly accepts an instance-only attribute as satisfying a ClassVar protocol member.
    • -
    -
    Pass Pass Pass Pass Partial
      -
    • Fails to reject duplicate generic/protocol bases.
    • Treats global object as a literal.
    9.5 / 11 • 86.4%9.5 / 11 • 86.4%10 / 11 • 90.9% 10.5 / 11 • 95.5% 10.5 / 11 • 95.5% 7.5 / 11 • 68.2% - Partial -
      -
    • Does not support callback protocols with PEP 695 ParamSpec type parameters.
    • -
    -
    Pass Pass Pass Pass
    callables_protocol Pass - Partial -
      -
    • Does not support callback protocols with PEP 695 ParamSpec type parameters.
    • -
    -
    Pass Pass Pass Pass
    callables_subtyping Pass - Partial -
      -
    • Does not support callback protocols with PEP 695 ParamSpec type parameters.
    • -
    -
    Pass Pass Pass Pass
    3 / 4 • 75.0%2.5 / 4 • 62.5%4 / 4 • 100.0% 4 / 4 • 100.0% 4 / 4 • 100.0% 4 / 4 • 100.0%
    typeddicts_type_consistency Pass - Partial -
      -
    • Considers TypedDicts to be assignable to plain dict types.
    • -
    -
    Pass Pass Pass Pass
    11.5 / 14 • 82.1%13.5 / 14 • 96.4%14 / 14 • 100.0% 14 / 14 • 100.0% 13.5 / 14 • 96.4% 14 / 14 • 100.0% - Partial -
      -
    • Does not support precise type inference for slices over namedtuples.
    • -
    -
    Pass Pass Pass Pass
    3 / 4 • 75.0%3.5 / 4 • 87.5%4 / 4 • 100.0% 4 / 4 • 100.0% 4 / 4 • 100.0% 4 / 4 • 100.0%
    enums_definition Pass - Partial -
      -
    • Does not allow enum members to be conditional on version/platform checks.
    • -
    -
    Pass Pass Pass Pass
    4.5 / 6 • 75.0%5.5 / 6 • 91.7%6 / 6 • 100.0% 6 / 6 • 100.0% 5.5 / 6 • 91.7% 6 / 6 • 100.0%
    directives_disjoint_base Pass - Partial -
      -
    • Does not reject invalid class definitions due to disjoint bases, but uses disjoint base information in type narrowing.
    • -
    -
    Pass Pass Unsupported @@ -2641,7 +2565,7 @@

    Python Type System Conformance Test Results

    10 / 11 • 90.9%10.5 / 11 • 95.5%11 / 11 • 100.0% 11 / 11 • 100.0% 10 / 11 • 90.9% 10.5 / 11 • 95.5%
    108.5 / 145 • 74.8%127.5 / 145 • 87.9%138 / 145 • 95.2% 140.5 / 145 • 96.9% 135.5 / 145 • 93.4% 132 / 145 • 91.0%pycroscope 0.5.0 pyrefly 1.3.0-dev.1 pyright 1.1.410ty 0.0.75ty 0.0.78 zuban 0.9.2
    Pass Unsupported Unsupported - Partial -
      -
    • Does not error when a ParamSpec is used in a position that violates its explicit variance.
    • -
    -
    Pass Pass
    Pass Pass Pass - Partial -
      -
    • Does not reject list[T]() in the global scope, where T is an unbound type variable.
    • -
    • Does not reject alias: TypeAlias = list[T] in the body scope of a class generic over a type variable T.
    • -
    -
    Pass Pass
    Pass Pass Pass - Partial -
      -
    • Does not reject access of generic instance variable from the class object.
    • -
    -
    Pass Pass
    Pass Unsupported Unsupported - Partial -
      -
    • Does not error when a TypeVarTuple is used in a position that violates its explicit variance.
    • -
    -
    Pass Pass
    33 / 33 • 100.0% 30 / 33 • 90.9% 28.5 / 33 • 86.4%30 / 33 • 90.9%32 / 33 • 97.0% 33 / 33 • 100.0%
    Pass Pass - Partial -
      -
    • Does not reject a generic type alias that recursively specializes itself with different type arguments.
    • -
    -
    Pass Pass
    Pass Pass Pass - Partial -
      -
    • Does not reject cyclically defined TypeAliasType aliases.
    • -
    -
    Pass Pass
    6 / 7 • 85.7% 7 / 7 • 100.0% 7 / 7 • 100.0%4 / 7 • 57.1%5 / 7 • 71.4% 7 / 7 • 100.0%
    Pass Pass Pass - Partial -
      -
    • Does not detect calls to deprecated overloads.
    • -
    • Does not detect implicit calls to deprecated dunder methods, for example via operators.
    • -
    • Does not detect accesses of, or attempts to set, deprecated properties.
    • -
    -
    Pass Pass
    11 / 11 • 100.0% 11 / 11 • 100.0% 10 / 11 • 90.9%10.5 / 11 • 95.5%11 / 11 • 100.0% 11 / 11 • 100.0%
    138 / 145 • 95.2% 140.5 / 145 • 96.9% 135.5 / 145 • 93.4%132 / 145 • 91.0%135.5 / 145 • 93.4% 144.5 / 145 • 99.7%
    Partial
      -
    • Does not evaluate Any in some cases where overload is ambiguous.
    • +
    • Infers list[int] for ambiguous overloads with list[Any] arguments, rejecting use as list[str].
    Passpycroscope 0.5.0 pyrefly 1.3.0-dev.1 pyright 1.1.410ty 0.0.78ty 0.0.81 zuban 0.9.2
    Partial
      -
    • Allows arbitrary attributes to be accessed on TA where TA = typing.Type[typing.Any] or TA = type[typing.Any].
    • Treats type equivalently to type[object] rather than type[typing.Any].
    - Partial -
      -
    • Does not honor @override compatibility checks for __init__ and __new__:
    • -
    • the incompatible constructor overrides in ChildC2 are not flagged.
    • -
    -
    Pass Pass
    2 / 2 • 100.0% 2 / 2 • 100.0% 1.5 / 2 • 75.0%1.5 / 2 • 75.0%2 / 2 • 100.0% 2 / 2 • 100.0%
    138 / 145 • 95.2% 140.5 / 145 • 96.9% 135.5 / 145 • 93.4%135.5 / 145 • 93.4%136 / 145 • 93.8% 144.5 / 145 • 99.7%
    Partial
    • Fails to reject "x" | int annotations that fail at runtime.
    • +
    • Resolves forward references in type annotations in classes at the point of definition instead of end-of-scope
    • Rejects some valid quoted annotations.
    Partial
      -
    • Types in quotes incorrectly refer to shadowing class member.
    • -
    • Does not reject some type forms that require quotes.
    • +
    • Resolves forward references in type annotations in classes at the point of definition instead of end-of-scope
    • +
    • Fails to resolve a forward reference to a nested class
    • +
    +
    + Partial +
      +
    • Prefers to resolve forward references in classes outside of the class instead of end-of-scope
    • +
    +
    + Partial +
      +
    • Fails to reject str: "str" forward references
    • +
    +
    + Partial +
      +
    • Fails to resolve forward references in classes from builtins
    • +
    • Incorrectly resolves type parameter syntax names in forward references
    • +
    +
    annotations_future_import + Partial +
      +
    • Resolves some forward references in type annotations in classes at the point of definition instead of end-of-scope
    • +
    +
    + Partial +
      +
    • Forward references to nested classes are not resolved
    • +
    • Nested classes are resolved, but its type is Any
    • +
    • Resolves some class annotations to outer names instead of shadowing class bindings
    • +
    +
    + Partial +
      +
    • Forward references to nested classes are not resolved
    • +
    • Resolves forward references in type annotations in classes at the point of definition instead of end-of-scope
    • +
    +
    + Partial +
      +
    • Prefers to resolve forward references in classes outside of the class instead of end-of-scope
    Pass Partial Partial
      -
    • Incorrectly generates error for quoted type defined in class scope.
    • +
    • Fails to resolve forward references in classes from builtins
    • +
    • Resolves some class annotations to outer names instead of shadowing class bindings
    4 / 5 • 80.0%4 / 5 • 80.0%4.5 / 5 • 90.0%5 / 5 • 100.0%4.5 / 5 • 90.0%4.5 / 5 • 90.0%4.5 / 6 • 75.0%4.5 / 6 • 75.0%5 / 6 • 83.3%5 / 6 • 83.3%5 / 6 • 83.3%5 / 6 • 83.3%
    108.5 / 145 • 74.8%138 / 145 • 95.2%140.5 / 145 • 96.9%135.5 / 145 • 93.4%136 / 145 • 93.8%144.5 / 145 • 99.7%109 / 146 • 74.7%138.5 / 146 • 94.9%141 / 146 • 96.6%135.5 / 146 • 92.8%136.5 / 146 • 93.5%145 / 146 • 99.3%
    diff --git a/conformance/results/ty/annotations_forward_refs.toml b/conformance/results/ty/annotations_forward_refs.toml index d176548df..2760eb69d 100644 --- a/conformance/results/ty/annotations_forward_refs.toml +++ b/conformance/results/ty/annotations_forward_refs.toml @@ -1,12 +1,10 @@ conformance_automated = "Fail" conformant = "Partial" notes = """ -Resolves references in type annotations as referring to end-of-scope types (, ) +Fails to reject `str: "str"` forward references """ errors_diff = """ -Line 87: Unexpected errors ['annotations_forward_refs.py:87:9: error[invalid-type-form] Function `int` is not valid in a type expression'] -Line 95: Unexpected errors ['annotations_forward_refs.py:95:1: error[type-assertion-failure] Type `Divergent` does not match asserted type `str`'] -Line 96: Unexpected errors ['annotations_forward_refs.py:96:1: error[type-assertion-failure] Type `Unknown` does not match asserted type `int`'] +Line 94: Expected 1 errors """ output = """ annotations_forward_refs.py:22:7: error[unresolved-reference] Name `ClassA` used when not defined @@ -28,10 +26,11 @@ annotations_forward_refs.py:52:11: error[invalid-type-form] Unary operations are annotations_forward_refs.py:53:11: error[invalid-type-form] Boolean operations are not allowed in parameter annotations annotations_forward_refs.py:54:11: error[invalid-type-form] F-strings are not allowed in parameter annotations annotations_forward_refs.py:55:11: error[invalid-type-form] Module `types` is not valid in a parameter annotation -annotations_forward_refs.py:66:26: error[unresolved-reference] Name `ClassB` used when not defined -annotations_forward_refs.py:80:14: error[unresolved-reference] Name `ClassF` used when not defined -annotations_forward_refs.py:87:9: error[invalid-type-form] Function `int` is not valid in a type expression -annotations_forward_refs.py:89:8: error[invalid-type-form] Function `int` is not valid in a type expression -annotations_forward_refs.py:95:1: error[type-assertion-failure] Type `Divergent` does not match asserted type `str` -annotations_forward_refs.py:96:1: error[type-assertion-failure] Type `Unknown` does not match asserted type `int` +annotations_forward_refs.py:65:26: error[unresolved-reference] Name `ClassB` used when not defined +annotations_forward_refs.py:83:13: error[unresolved-reference] Name `ClassInner` used when not defined +annotations_forward_refs.py:92:14: error[unresolved-reference] Name `ClassF` used when not defined +annotations_forward_refs.py:96:9: error[invalid-type-form] Function `int` is not valid in a type expression +annotations_forward_refs.py:101:8: error[invalid-type-form] Function `int` is not valid in a type expression +annotations_forward_refs.py:103:9: error[invalid-type-form] Function `int` is not valid in a type expression +annotations_forward_refs.py:111:5: error[type-assertion-failure] Type `Unknown` does not match asserted type `ClassInner` """ diff --git a/conformance/results/ty/annotations_future_import.toml b/conformance/results/ty/annotations_future_import.toml new file mode 100644 index 000000000..9744d55de --- /dev/null +++ b/conformance/results/ty/annotations_future_import.toml @@ -0,0 +1,13 @@ +conformant = "Partial" +notes = """ +Fails to reject `str: "str"` forward references +""" +conformance_automated = "Fail" +errors_diff = """ +Line 37: Expected 1 errors +""" +output = """ +annotations_future_import.py:39:8: error[invalid-type-form] Function `int` is not valid in a type expression +annotations_future_import.py:44:8: error[invalid-type-form] Function `int` is not valid in a type expression +annotations_future_import.py:46:9: error[invalid-type-form] Function `int` is not valid in a type expression +""" diff --git a/conformance/results/zuban/annotations_forward_refs.toml b/conformance/results/zuban/annotations_forward_refs.toml index 9dce37fac..f994ad5b2 100644 --- a/conformance/results/zuban/annotations_forward_refs.toml +++ b/conformance/results/zuban/annotations_forward_refs.toml @@ -1,13 +1,13 @@ conformant = "Partial" notes = """ -Incorrectly generates error for quoted type defined in class scope. +Fails to resolve forward references in classes from builtins +Incorrectly resolves type parameter syntax names in forward references """ conformance_automated = "Fail" errors_diff = """ -Line 82: Unexpected errors ['annotations_forward_refs.py:82: error: Name "str" is not defined [name-defined]'] -Line 87: Unexpected errors ['annotations_forward_refs.py:87: error: Function "tests.annotations_forward_refs.ClassD.int" is not valid as a type [valid-type]'] -Line 95: Unexpected errors ['annotations_forward_refs.py:95: error: Expression is of type "Any", not "str" [misc]'] -Line 96: Unexpected errors ['annotations_forward_refs.py:96: error: Expression is of type "Any", not "int" [misc]'] +Line 82: Unexpected errors ['annotations_forward_refs.py:82: error: Name "bytes" is not defined [name-defined]'] +Line 110: Unexpected errors ['annotations_forward_refs.py:110: error: Expression is of type "Any", not "bytes" [misc]'] +Line 130: Unexpected errors ['annotations_forward_refs.py:130: error: Expression is of type "T", not "int" [misc]', 'annotations_forward_refs.py:130: error: Argument 1 to "identity2" of "ClassE" has incompatible type "int"; expected "T" [arg-type]'] """ output = """ annotations_forward_refs.py:24: error: Forward reference unions cause runtime errors, consider wrapping the whole annotation with a string [misc] @@ -31,12 +31,16 @@ annotations_forward_refs.py:53: error: Invalid type comment or annotation [vali annotations_forward_refs.py:54: error: Invalid type comment or annotation [valid-type] annotations_forward_refs.py:55: error: Module "types" is not valid as a type [valid-type] annotations_forward_refs.py:55: note: Perhaps you meant to use a protocol matching the module structure? -annotations_forward_refs.py:80: error: Name "ClassF" is not defined [name-defined] -annotations_forward_refs.py:82: error: Name "str" is not defined [name-defined] -annotations_forward_refs.py:87: error: Function "tests.annotations_forward_refs.ClassD.int" is not valid as a type [valid-type] -annotations_forward_refs.py:87: note: Perhaps you need "Callable[...]" or a callback protocol? -annotations_forward_refs.py:89: error: Function "tests.annotations_forward_refs.ClassD.int" is not valid as a type [valid-type] -annotations_forward_refs.py:89: note: Perhaps you need "Callable[...]" or a callback protocol? -annotations_forward_refs.py:95: error: Expression is of type "Any", not "str" [misc] -annotations_forward_refs.py:96: error: Expression is of type "Any", not "int" [misc] +annotations_forward_refs.py:82: error: Name "bytes" is not defined [name-defined] +annotations_forward_refs.py:92: error: Name "ClassF" is not defined [name-defined] +annotations_forward_refs.py:94: error: Name "str" is not defined [name-defined] +annotations_forward_refs.py:96: error: Function "tests.annotations_forward_refs.ClassD.int" is not valid as a type [valid-type] +annotations_forward_refs.py:96: note: Perhaps you need "Callable[...]" or a callback protocol? +annotations_forward_refs.py:101: error: Function "tests.annotations_forward_refs.ClassD.int" is not valid as a type [valid-type] +annotations_forward_refs.py:101: note: Perhaps you need "Callable[...]" or a callback protocol? +annotations_forward_refs.py:103: error: Function "tests.annotations_forward_refs.ClassD.int" is not valid as a type [valid-type] +annotations_forward_refs.py:103: note: Perhaps you need "Callable[...]" or a callback protocol? +annotations_forward_refs.py:110: error: Expression is of type "Any", not "bytes" [misc] +annotations_forward_refs.py:130: error: Expression is of type "T", not "int" [misc] +annotations_forward_refs.py:130: error: Argument 1 to "identity2" of "ClassE" has incompatible type "int"; expected "T" [arg-type] """ diff --git a/conformance/results/zuban/annotations_future_import.toml b/conformance/results/zuban/annotations_future_import.toml new file mode 100644 index 000000000..c5cc5c2fc --- /dev/null +++ b/conformance/results/zuban/annotations_future_import.toml @@ -0,0 +1,18 @@ +conformant = "Partial" +notes = """ +Fails to resolve forward references in classes from builtins +Resolves some class annotations to outer names instead of shadowing class bindings +""" +conformance_automated = "Fail" +errors_diff = """ +Line 37: Expected 1 errors +Line 39: Expected 1 errors +Line 28: Unexpected errors ['annotations_future_import.py:28: error: Invalid type comment or annotation [valid-type]'] +""" +output = """ +annotations_future_import.py:28: error: Invalid type comment or annotation [valid-type] +annotations_future_import.py:44: error: Function "tests.annotations_future_import.ClassB.int" is not valid as a type [valid-type] +annotations_future_import.py:44: note: Perhaps you need "Callable[...]" or a callback protocol? +annotations_future_import.py:46: error: Function "tests.annotations_future_import.ClassB.int" is not valid as a type [valid-type] +annotations_future_import.py:46: note: Perhaps you need "Callable[...]" or a callback protocol? +""" diff --git a/conformance/tests/annotations_forward_refs.py b/conformance/tests/annotations_forward_refs.py index 70c644700..a3f69b9d3 100644 --- a/conformance/tests/annotations_forward_refs.py +++ b/conformance/tests/annotations_forward_refs.py @@ -57,10 +57,9 @@ def invalid_annotations( pass -# > It should evaluate without errors once the module has been fully loaded. -# > The local and global namespace in which it is evaluated should be the same -# > namespaces in which default arguments to the same function would be evaluated. - +# > Names within the expression are looked up in the same way as they would be +# > looked up at runtime in Python 3.14 and higher if the annotation was not +# > enclosed in a string literal. class ClassB: def method1(self) -> ClassB: # E?: Runtime error prior to 3.14 @@ -75,25 +74,60 @@ class ClassC: class ClassD: - ClassC: "ClassC" # OK + # OK + simple_attr: ClassA + ClassB: ClassB + ClassC: "ClassC" + bytes_direct: bytes + bytes: "bytes" + inner1: ClassInner # E?: Runtime error prior to 3.14: requires quotes + inner2: "ClassInner" + + class ClassInner: + ... + + inner_after1: ClassInner + inner_after2: "ClassInner" ClassF: "ClassF" # E: circular reference - str: "str" = "" # OK + str: "str" = "" # E: circular reference + + z: "int" = 0 # E: Refers to the local int function, which isn't a valid type def int(self) -> None: # OK ... - x: "int" = 0 # OK + y: int = 0 # E: Refers to the local int function, which isn't a valid type - y: int = 0 # E: Refers to local int, which isn't a legal type expression + x: "int" = 0 # E: Refers to the local int function, which isn't a valid type def __init__(self) -> None: self.ClassC = ClassC() -assert_type(ClassD.str, str) -assert_type(ClassD.x, int) +def check_valid_attributes(d: ClassD) -> None: + assert_type(d.bytes, bytes) + assert_type(d.inner1, ClassD.ClassInner) # E?: Runtime error prior to 3.14: requires quotes + assert_type(d.inner2, ClassD.ClassInner) + assert_type(d.inner_after1, ClassD.ClassInner) + assert_type(d.inner_after2, ClassD.ClassInner) + + +class T: + ... + + +class ClassE[T]: + def identity1(self, value: T) -> T: + return value + + def identity2(self, value: "T") -> "T": + return value + + +assert_type(ClassE[int]().identity1(1), int) +assert_type(ClassE[int]().identity2(1), int) # > If a triple quote is used, the string should be parsed as though it is implicitly diff --git a/conformance/tests/annotations_future_import.py b/conformance/tests/annotations_future_import.py new file mode 100644 index 000000000..778a46925 --- /dev/null +++ b/conformance/tests/annotations_future_import.py @@ -0,0 +1,58 @@ +""" +Tests the handling name-resolution in annotations while from __future__ import +annotations is present. +""" + +from __future__ import annotations + +from typing import assert_type + +# > For purposes of type checking, annotations in a file containing from +# > __future__ import annotations must use the same name-resolution rules as +# > explicitly stringified annotations, regardless of the target Python version. + +forward1: ClassA +forward2: list[ClassA] +forward3: "ClassA" + + +class ClassA: + ... + + +class ClassB: + ClassA: ClassA + ClassC: ClassC + inner1: ClassInner + inner2: "ClassInner" + bytes_direct: bytes + bytes: bytes + + class ClassInner: + ... + + inner_after1: ClassInner + inner_after2: "ClassInner" + + str: str = "" # E: circular reference + + z: int = 0 # E: Refers to the local int function, which isn't a valid type + + def int(self) -> None: # OK + ... + + y: int = 0 # E: Refers to the local int function, which isn't a valid type + + x: "int" = 0 # E: Refers to the local int function, which isn't a valid type + + +class ClassC: + ... + + +def check_valid_attributes(b: ClassB) -> None: + assert_type(b.ClassC, ClassC) + assert_type(b.inner1, ClassB.ClassInner) + assert_type(b.inner2, ClassB.ClassInner) + assert_type(b.inner_after1, ClassB.ClassInner) + assert_type(b.inner_after2, ClassB.ClassInner) diff --git a/docs/spec/annotations.rst b/docs/spec/annotations.rst index 558b9b700..813766bd1 100644 --- a/docs/spec/annotations.rst +++ b/docs/spec/annotations.rst @@ -223,32 +223,14 @@ String annotations When a type hint cannot be evaluated at runtime, that definition may be expressed as a string literal, to be resolved later. -A situation where this occurs commonly is the definition of a -container class, where the class being defined occurs in the signature -of some of the methods. For example, the following code (the start of -a simple binary tree implementation) does not work:: - - class Tree: - def __init__(self, left: Tree, right: Tree): - self.left = left - self.right = right - -To address this, we write:: - - class Tree: - def __init__(self, left: 'Tree', right: 'Tree'): - self.left = left - self.right = right - -The string literal should contain a valid Python expression (i.e., -``compile(lit, '', 'eval')`` should be a valid code object) and it -should evaluate without errors once the module has been fully loaded. -The local and global namespace in which it is evaluated should be the -same namespaces in which default arguments to the same function would -be evaluated. - -Moreover, the expression should be parseable as a valid type hint, i.e., -it is constrained by the rules from :ref:`the expression grammar `. +The string literal should contain a syntactically valid Python expression +(i.e., ``compile(lit, '', 'eval')`` should succeed) that is a valid +:term:`annotation expression`. Regardless of the Python version used, names +within the expression are looked up in the same way as they would be looked up +at runtime in Python 3.14 and higher if the annotation was not enclosed in a +string literal. Thus, name lookup follows general rules (e.g., the current +function, class, or module scope first, and the builtin scope last), but names +defined later within the same scope can be used in an earlier annotation. If a triple quote is used, the string should be parsed as though it is implicitly surrounded by parentheses. This allows newline characters to be @@ -308,6 +290,13 @@ _module_._class_ name:: from models.a import A from models.b import B +from __future__ import annotations +---------------------------------- + +For purposes of type checking, annotations in a file containing ``from +__future__ import annotations`` must use the same name-resolution rules as +explicitly stringified annotations, regardless of the target Python version. + Annotating generator functions and coroutines --------------------------------------------- From 3a4ada0a0e6b380c6d7561b8392c6b159f5f374e Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Thu, 17 Sep 2026 23:13:56 -0400 Subject: [PATCH 292/308] Update ty results for v0.0.82 (#2360) --- conformance/results/results.html | 30 +++++++-------- conformance/results/ty/aliases_newtype.toml | 2 +- conformance/results/ty/aliases_recursive.toml | 23 ++++++----- .../results/ty/aliases_type_statement.toml | 2 +- .../results/ty/protocols_explicit.toml | 12 +++--- conformance/results/ty/protocols_merging.toml | 8 +--- conformance/results/ty/version.toml | 2 +- conformance/uv.lock | 38 +++++++++---------- 8 files changed, 58 insertions(+), 59 deletions(-) diff --git a/conformance/results/results.html b/conformance/results/results.html index 48c3631b7..4f1ac587f 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -268,7 +268,7 @@

    Python Type System Conformance Test Results

    pycroscope 0.5.0 pyrefly 1.3.0-dev.1 pyright 1.1.410ty 0.0.81ty 0.0.82 zuban 0.9.2
    Pass Pass PassUnsupported + Partial +
      +
    • Does not reject invalid cyclic type alias definitions.
    • +
    +
    Pass
    6 / 7 • 85.7% 7 / 7 • 100.0% 7 / 7 • 100.0%5 / 7 • 71.4%5.5 / 7 • 78.6% 7 / 7 • 100.0%
    Pass Pass Pass - Unsupported + + Partial
      -
    • Allows implicitly abstract protocol methods to be called via super() on a protocol subclass.
    • -
    • Allows instantiation of abstract subclasses of protocol classes.
    • +
    • Allows abstract protocol methods with no default implementation to be called via super() on a protocol subclass.
    • +
    • Allows instantiation of protocol subclasses with uninitialized ClassVar members.
    Pass Pass Pass Pass - Partial -
      -
    • Does not reject attempted instantiation of abstract subclasses of protocols.
    • -
    -
    Pass Pass
    10 / 11 • 90.9% 10.5 / 11 • 95.5% 10.5 / 11 • 95.5%7.5 / 11 • 68.2%8.5 / 11 • 77.3% 11 / 11 • 100.0%
    138.5 / 146 • 94.9% 141 / 146 • 96.6% 135.5 / 146 • 92.8%136.5 / 146 • 93.5%138 / 146 • 94.5% 145 / 146 • 99.3%
    pyrefly 1.3.0-dev.1 pyright 1.1.410 ty 0.0.82zuban 0.9.2zuban 0.10.0
    - Partial -
      -
    • Fails to resolve forward references in classes from builtins
    • -
    • Incorrectly resolves type parameter syntax names in forward references
    • -
    -
    Pass
    annotations_future_import - Partial -
      -
    • Fails to resolve forward references in classes from builtins
    • -
    • Resolves some class annotations to outer names instead of shadowing class bindings
    • -
    -
    Pass
    annotations_generators 5 / 6 • 83.3% 5 / 6 • 83.3% 5 / 6 • 83.3%5 / 6 • 83.3%6 / 6 • 100.0%
    141 / 146 • 96.6% 135.5 / 146 • 92.8% 138 / 146 • 94.5%145 / 146 • 99.3%146 / 146 • 100.0%
    diff --git a/conformance/results/zuban/annotations_forward_refs.toml b/conformance/results/zuban/annotations_forward_refs.toml index f994ad5b2..4dec4e92a 100644 --- a/conformance/results/zuban/annotations_forward_refs.toml +++ b/conformance/results/zuban/annotations_forward_refs.toml @@ -1,13 +1,5 @@ -conformant = "Partial" -notes = """ -Fails to resolve forward references in classes from builtins -Incorrectly resolves type parameter syntax names in forward references -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 82: Unexpected errors ['annotations_forward_refs.py:82: error: Name "bytes" is not defined [name-defined]'] -Line 110: Unexpected errors ['annotations_forward_refs.py:110: error: Expression is of type "Any", not "bytes" [misc]'] -Line 130: Unexpected errors ['annotations_forward_refs.py:130: error: Expression is of type "T", not "int" [misc]', 'annotations_forward_refs.py:130: error: Argument 1 to "identity2" of "ClassE" has incompatible type "int"; expected "T" [arg-type]'] """ output = """ annotations_forward_refs.py:24: error: Forward reference unions cause runtime errors, consider wrapping the whole annotation with a string [misc] @@ -31,16 +23,12 @@ annotations_forward_refs.py:53: error: Invalid type comment or annotation [vali annotations_forward_refs.py:54: error: Invalid type comment or annotation [valid-type] annotations_forward_refs.py:55: error: Module "types" is not valid as a type [valid-type] annotations_forward_refs.py:55: note: Perhaps you meant to use a protocol matching the module structure? -annotations_forward_refs.py:82: error: Name "bytes" is not defined [name-defined] annotations_forward_refs.py:92: error: Name "ClassF" is not defined [name-defined] -annotations_forward_refs.py:94: error: Name "str" is not defined [name-defined] +annotations_forward_refs.py:94: error: Cannot resolve name "str" (possible cyclic definition) [misc] annotations_forward_refs.py:96: error: Function "tests.annotations_forward_refs.ClassD.int" is not valid as a type [valid-type] annotations_forward_refs.py:96: note: Perhaps you need "Callable[...]" or a callback protocol? annotations_forward_refs.py:101: error: Function "tests.annotations_forward_refs.ClassD.int" is not valid as a type [valid-type] annotations_forward_refs.py:101: note: Perhaps you need "Callable[...]" or a callback protocol? annotations_forward_refs.py:103: error: Function "tests.annotations_forward_refs.ClassD.int" is not valid as a type [valid-type] annotations_forward_refs.py:103: note: Perhaps you need "Callable[...]" or a callback protocol? -annotations_forward_refs.py:110: error: Expression is of type "Any", not "bytes" [misc] -annotations_forward_refs.py:130: error: Expression is of type "T", not "int" [misc] -annotations_forward_refs.py:130: error: Argument 1 to "identity2" of "ClassE" has incompatible type "int"; expected "T" [arg-type] """ diff --git a/conformance/results/zuban/annotations_future_import.toml b/conformance/results/zuban/annotations_future_import.toml index c5cc5c2fc..d35c6ae0d 100644 --- a/conformance/results/zuban/annotations_future_import.toml +++ b/conformance/results/zuban/annotations_future_import.toml @@ -1,16 +1,10 @@ -conformant = "Partial" -notes = """ -Fails to resolve forward references in classes from builtins -Resolves some class annotations to outer names instead of shadowing class bindings -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 37: Expected 1 errors -Line 39: Expected 1 errors -Line 28: Unexpected errors ['annotations_future_import.py:28: error: Invalid type comment or annotation [valid-type]'] """ output = """ -annotations_future_import.py:28: error: Invalid type comment or annotation [valid-type] +annotations_future_import.py:37: error: Cannot resolve name "str" (possible cyclic definition) [misc] +annotations_future_import.py:39: error: Function "tests.annotations_future_import.ClassB.int" is not valid as a type [valid-type] +annotations_future_import.py:39: note: Perhaps you need "Callable[...]" or a callback protocol? annotations_future_import.py:44: error: Function "tests.annotations_future_import.ClassB.int" is not valid as a type [valid-type] annotations_future_import.py:44: note: Perhaps you need "Callable[...]" or a callback protocol? annotations_future_import.py:46: error: Function "tests.annotations_future_import.ClassB.int" is not valid as a type [valid-type] diff --git a/conformance/results/zuban/version.toml b/conformance/results/zuban/version.toml index f1f3f54a9..02d95dc36 100644 --- a/conformance/results/zuban/version.toml +++ b/conformance/results/zuban/version.toml @@ -1 +1 @@ -version = "zuban 0.9.2" +version = "zuban 0.10.0" diff --git a/conformance/uv.lock b/conformance/uv.lock index 820d566e6..d067e9036 100644 --- a/conformance/uv.lock +++ b/conformance/uv.lock @@ -291,19 +291,19 @@ wheels = [ [[package]] name = "zuban" -version = "0.9.2" +version = "0.10.0" source = { registry = "https://pypi.org/simple" } wheels = [ - { url = "https://files.pythonhosted.org/packages/a4/c0/1c395a08b2a7c48fbbb1398818d65813032ad0acfec5a841db0e7142a6ac/zuban-0.9.2-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:8922df80834c2d5cb1e2798192dc85d40b4dc3fa3149e7b2b89dccf3cdc110d8", size = 11377755, upload-time = "2026-08-26T00:19:21.022Z" }, - { url = "https://files.pythonhosted.org/packages/af/3c/b323802de4a86f71479b85d388294380205006362bca4414d3213469136a/zuban-0.9.2-py3-none-macosx_11_0_arm64.whl", hash = "sha256:112c9bd639ec417fe7881a7d99bc34e35ac6ba6e0afd4f33caf0774ea8ae84fc", size = 11101402, upload-time = "2026-08-26T00:19:24.548Z" }, - { url = "https://files.pythonhosted.org/packages/9f/3b/71ee867aebe9175de1db0208c2eeee7f294821545e6140c28e5ed9f21888/zuban-0.9.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d8d65dafe086a8e73cbb8e6d7e3b234a7d2e64cf794d49c5ca0ca901a2880bea", size = 28451467, upload-time = "2026-08-26T00:19:28.898Z" }, - { url = "https://files.pythonhosted.org/packages/bc/93/7331f9f096b1c4a9d575ed6e86572cf6c5ac9eab5dc1c68d0d875e78d549/zuban-0.9.2-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:d8431a65ac7815af24e015d6f6c935518625e015e028b061899677a3d43c6349", size = 28687477, upload-time = "2026-08-26T00:19:33.102Z" }, - { url = "https://files.pythonhosted.org/packages/f8/5a/de09de19a0ea8a4593632631c905751cf380cf8a92d1607632ad40c683ea/zuban-0.9.2-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6d271a27a56ad89e3bb5942580aa903354c3861bfab29e5c655d44007d1d15a2", size = 29736764, upload-time = "2026-08-26T00:19:38.73Z" }, - { url = "https://files.pythonhosted.org/packages/cb/71/2e32dfafa5ac302b7b9cc48bbcfbc9da6bca221ccfd03da5b9d2a28240ee/zuban-0.9.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:20a467e9d90f5dce53be3c760d9b65e768870a4e940a5256985f67155587eeb9", size = 31719649, upload-time = "2026-08-26T00:19:43.454Z" }, - { url = "https://files.pythonhosted.org/packages/b2/24/d437b54a088b2a35df948841d011a011ba5db59bdb4bad7c800dffcbbe2e/zuban-0.9.2-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:a2c29e501de2f39690eadffab6369c9ac949bdab82aaab4c9fcbbfda0794d704", size = 28630746, upload-time = "2026-08-26T00:19:47.888Z" }, - { url = "https://files.pythonhosted.org/packages/04/12/a132d0ad526d8986475344546b22acfea0bd6856bb293b70e691fa9bf5d5/zuban-0.9.2-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:23e34cd5d3c2aad476506fc2a0d3f4fd314e87bb03c873ec2c319497b06f16df", size = 29122179, upload-time = "2026-08-26T00:19:52.937Z" }, - { url = "https://files.pythonhosted.org/packages/70/4e/ebbec923b02c69eee955cc65d227c4a1b6f5c6f2b509b92c9df02ad67e2b/zuban-0.9.2-py3-none-musllinux_1_2_i686.whl", hash = "sha256:40f4737d3f7c5926b986ebb4cb44767b2b72788072e833c49d2d3ad2f69ecbdb", size = 29624765, upload-time = "2026-08-26T00:19:57.778Z" }, - { url = "https://files.pythonhosted.org/packages/db/7f/8baa60499029d57bc0dbc254d75469f7b7860654671d0bf3683bc6c56f05/zuban-0.9.2-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:26a83d3c1f12cd131774a4f89b3c0d750619e7035d02dcd4f668fb43e5ba2fea", size = 28964675, upload-time = "2026-08-26T00:20:02.558Z" }, - { url = "https://files.pythonhosted.org/packages/fa/d8/4a6f29958fa962c2b12ec32a0624708b9da93bec236ace0ac993632d05b1/zuban-0.9.2-py3-none-win32.whl", hash = "sha256:59d09caf2e488eb6d31a3bead1699349f66dafbfd595eb64bcd8e11b79d8e2d1", size = 10051150, upload-time = "2026-08-26T00:20:05.965Z" }, - { url = "https://files.pythonhosted.org/packages/af/c2/123e0f3054f688039290766fdbdd4cba96834537e6fd3f6c95ae460858bd/zuban-0.9.2-py3-none-win_amd64.whl", hash = "sha256:9bc429ef78d3f21a6aeec9cddffe8748235ef2374ef318a91f4aa089cafba75c", size = 10730401, upload-time = "2026-08-26T00:20:08.97Z" }, + { url = "https://files.pythonhosted.org/packages/d0/e3/69ef2ec901c4a21b584c8f30e2957e6ee7706fff2b7f7b64554628c8e1da/zuban-0.10.0-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:59d7a698dd58bc742a6be187d000367d2dea541a2ee57531d10f4713520ee97c", size = 11352888, upload-time = "2026-09-18T11:11:30.344Z" }, + { url = "https://files.pythonhosted.org/packages/45/6b/726e27df1b5243fda6f2206147c6566a7e17e5ff64f8fec51c01e32d69c3/zuban-0.10.0-py3-none-macosx_11_0_arm64.whl", hash = "sha256:c81631c3e6ba5e3455d3953588c89612d8d0995be28909824df44fa997af7e40", size = 11112654, upload-time = "2026-09-18T11:11:33.029Z" }, + { url = "https://files.pythonhosted.org/packages/99/36/ab87b7e4b3dcd5ca89ad324c9a5249b00892ed25a2c2c29ffdea1286650f/zuban-0.10.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bd4f6fcdd46d89f5fe5ca9191e05f3c1b6e28295b0bc532e18c3164565288380", size = 28554642, upload-time = "2026-09-18T11:11:35.821Z" }, + { url = "https://files.pythonhosted.org/packages/59/7a/82a17d92dc4652086356ed5642b4b81d285dd7f851b949ca967621d62e39/zuban-0.10.0-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:98fbd6e08e79d333cca612d4ed3f679a9cddbfc3b99f07693553769fe172035a", size = 28732309, upload-time = "2026-09-18T11:11:39.495Z" }, + { url = "https://files.pythonhosted.org/packages/bf/47/21116e950934fd040a10df5309978d0c2bb1084d2c2b04c668273422377a/zuban-0.10.0-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c494f530034b56b1ca9ef6d9851b793c858fa8697c6c01f683dc0ab203e290d1", size = 29838795, upload-time = "2026-09-18T11:11:43.292Z" }, + { url = "https://files.pythonhosted.org/packages/f6/4e/fa2148a3bac24788bda3a83c58167ae86e88b87a141911140953914d6447/zuban-0.10.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ae1fb50593f129a5df4dc0b06f25124345f8d527623545e1a79ffb451a78e131", size = 31846103, upload-time = "2026-09-18T11:11:47.362Z" }, + { url = "https://files.pythonhosted.org/packages/40/dd/6124f00f1e38c63ea548bc2a9dde5f547485e9119dbd1a320de5c54e0bdf/zuban-0.10.0-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:b08b5331728b818b87aae7a287f81f7d66bed56823a1084776ccdbc84067ffdb", size = 28725088, upload-time = "2026-09-18T11:11:50.857Z" }, + { url = "https://files.pythonhosted.org/packages/4a/87/5bef3b23e53f9cc525e5cd228c51d2e6f1fa47080f48b0d3ee0bb146af07/zuban-0.10.0-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:a66d60f6afd1deddef673dab407abf1014721e393fcc18fb1b5f2f73fa3f04d8", size = 29166127, upload-time = "2026-09-18T11:11:54.567Z" }, + { url = "https://files.pythonhosted.org/packages/00/5c/b173cbcfbf8261b27f6a70a54a92d3400a378a4143041073834c2c9c5cbc/zuban-0.10.0-py3-none-musllinux_1_2_i686.whl", hash = "sha256:d83400da488b8a439358425ddfc800fa12859c03c8f7bcd8754e2cc487defea5", size = 29732954, upload-time = "2026-09-18T11:11:58.192Z" }, + { url = "https://files.pythonhosted.org/packages/f2/53/1b4d0a82aa728090458e531207a6a7634f186a566f5e0d5167ddc8f4355a/zuban-0.10.0-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:64002bf171baf49097b61521f7756a1c29264a3fcd2c98cf3e2b0b7862e74008", size = 29059999, upload-time = "2026-09-18T11:12:01.793Z" }, + { url = "https://files.pythonhosted.org/packages/ba/6d/2215ab53d7388a8d9de888af048010ef5b6421c54a50f7a38069e8e614ad/zuban-0.10.0-py3-none-win32.whl", hash = "sha256:9d39da51b2d679505011bdcf8ba5757b10dc3e24b941d572b6cde8217fa48539", size = 10002018, upload-time = "2026-09-18T11:12:05.125Z" }, + { url = "https://files.pythonhosted.org/packages/58/42/fb3c2c3a039a91608527a70beeddf1d183abdc8697bd124df8797676cefa/zuban-0.10.0-py3-none-win_amd64.whl", hash = "sha256:de928ef243a3547fa747321fb6aad4a07657827e72c23c7905dbeab4697f8337", size = 10713422, upload-time = "2026-09-18T11:12:07.69Z" }, ] From a5e60dd82a82f585bd1ea37d93101489d6bf1ea9 Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Mon, 21 Sep 2026 20:11:34 -0400 Subject: [PATCH 294/308] Update ty results for v0.0.83 (#2362) --- conformance/results/results.html | 30 ++++----------- conformance/results/ty/aliases_recursive.toml | 11 ++---- .../results/ty/aliases_type_statement.toml | 8 ++-- .../results/ty/aliases_typealiastype.toml | 8 ++-- .../results/ty/annotations_forward_refs.toml | 8 +--- .../results/ty/annotations_future_import.toml | 8 +--- .../results/ty/constructors_call_init.toml | 4 +- .../results/ty/generics_self_usage.toml | 2 +- conformance/results/ty/tuples_type_form.toml | 12 +++--- conformance/results/ty/version.toml | 2 +- conformance/uv.lock | 38 +++++++++---------- 11 files changed, 52 insertions(+), 79 deletions(-) diff --git a/conformance/results/results.html b/conformance/results/results.html index ebb94bf64..8c4c16386 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -268,7 +268,7 @@

    Python Type System Conformance Test Results

    pycroscope 0.5.0 pyrefly 1.3.0-dev.1 pyright 1.1.410ty 0.0.82ty 0.0.83 zuban 0.10.0
    - Partial -
      -
    • Fails to reject str: "str" forward references
    • -
    -
    Pass Pass
    - Partial -
      -
    • Fails to reject str: "str" forward references
    • -
    -
    Pass Pass
    4.5 / 6 • 75.0% 5 / 6 • 83.3% 5 / 6 • 83.3%5 / 6 • 83.3%6 / 6 • 100.0% 6 / 6 • 100.0%
    Pass Pass Pass - Partial -
      -
    • Does not reject invalid cyclic type alias definitions.
    • -
    -
    Pass Pass
    6 / 7 • 85.7% 7 / 7 • 100.0% 7 / 7 • 100.0%5.5 / 7 • 78.6%6 / 7 • 85.7% 7 / 7 • 100.0%
    Pass 138.5 / 146 • 94.9% 141 / 146 • 96.6% 135.5 / 146 • 92.8%138 / 146 • 94.5%139.5 / 146 • 95.5% 146 / 146 • 100.0%
    Partial
      -
    • Only partially supports @property protocol members.
    • +
    • Does not reject incompatible non-generic implementations of generic protocol methods.
    Pass
    generics_defaults_specialization - Partial -
      -
    • Does not correctly resolve defaults when classes are used directly.
    • -
    -
    Pass Pass - Partial -
      -
    • Allows incorrect assignment to type[].
    • -
    -
    PassPass Pass Pass
    23.5 / 33 • 71.2%24 / 33 • 72.7% 33 / 33 • 100.0% 30 / 33 • 90.9%28.5 / 33 • 86.4%29 / 33 • 87.9% 32 / 33 • 97.0% 33 / 33 • 100.0%
    109 / 146 • 74.7%109.5 / 146 • 75.0% 138.5 / 146 • 94.9% 141 / 146 • 96.6%135.5 / 146 • 92.8%136 / 146 • 93.2% 139.5 / 146 • 95.5% 146 / 146 • 100.0%
    pycroscope 0.5.0 pyrefly 1.3.0-dev.1 pyright 1.1.410ty 0.0.83ty 0.0.91 zuban 0.10.0
    Pass Pass Pass - Partial -
      -
    • Incorrectly allows constrained type variables to be solved to a union of their constraints.
    • -
    -
    Pass Pass
    33 / 33 • 100.0% 30 / 33 • 90.9% 29 / 33 • 87.9%32 / 33 • 97.0%32.5 / 33 • 98.5% 33 / 33 • 100.0%
    138.5 / 146 • 94.9% 141 / 146 • 96.6% 136 / 146 • 93.2%139.5 / 146 • 95.5%140 / 146 • 95.9% 146 / 146 • 100.0%
    pycroscope 0.5.0 pyrefly 1.3.0-dev.1 pyright 1.1.410ty 0.0.91ty 0.0.93 zuban 0.10.0
    Pass Pass Pass - Partial -
      -
    • 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.
    • -
    -
    Pass Pass
    Pass Pass - 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.
    • -
    -
    Pass Pass
    6 / 7 • 85.7% 7 / 7 • 100.0% 7 / 7 • 100.0%6 / 7 • 85.7%7 / 7 • 100.0% 7 / 7 • 100.0%
    138.5 / 146 • 94.9% 141 / 146 • 96.6% 136 / 146 • 93.2%140 / 146 • 95.9%141 / 146 • 96.6% 146 / 146 • 100.0%
    mypy 2.1.0mypy 2.4.0 pycroscope 0.5.0pyrefly 1.3.0-dev.1pyright 1.1.410pyrefly 1.4.0pyright 1.1.414 ty 0.0.93zuban 0.10.0zuban 0.10.1
    PassUnsupportedPass Pass Pass
    0.5 / 1 • 50.0% 0.5 / 1 • 50.0% 1 / 1 • 100.0%0 / 1 • 0.0%1 / 1 • 100.0% 1 / 1 • 100.0% 1 / 1 • 100.0%
    specialtypes_sentinelsUnsupportedPass Pass Pass @@ -530,7 +530,7 @@

    Python Type System Conformance Test Results

    4.5 / 6 • 75.0%5.5 / 6 • 91.7% 5.5 / 6 • 91.7% 6 / 6 • 100.0% 5.5 / 6 • 91.7% generics_mixed_variance_inference Pass PassUnsupportedPass Unsupported Pass Pass
    generics_syntax_declarationsPass + Partial +
      +
    • Doesn't flag TypeVar with empty constraints.
    • +
    +
    Pass Pass Pass Pass Pass - Partial -
      -
    • Does not correctly solve TypeVarTuple with heterogeneous bounds.
    • -
    -
    Pass Pass Pass
    Pass Pass - Partial -
      -
    • Does not correctly solve TypeVarTuple with heterogeneous bounds.
    • -
    -
    Pass Pass Pass
    24 / 33 • 72.7%23.5 / 33 • 71.2% 33 / 33 • 100.0%31 / 33 • 93.9% 30 / 33 • 90.9%29 / 33 • 87.9% 32.5 / 33 • 98.5% 33 / 33 • 100.0%
    Pass Pass - Partial -
      -
    • Infers list[int] for ambiguous overloads with list[Any] arguments, rejecting use as list[str].
    • -
    -
    Pass Pass Pass
    3.5 / 5 • 70.0% 3.5 / 5 • 70.0% 5 / 5 • 100.0%4.5 / 5 • 90.0%5 / 5 • 100.0% 5 / 5 • 100.0% 5 / 5 • 100.0%
    Pass Pass PassPass + Partial +
      +
    • Incorrect type for match_args
    • +
    +
    dataclasses_order 15.5 / 16 • 96.9% 16 / 16 • 100.0% 15.5 / 16 • 96.9%16 / 16 • 100.0%15.5 / 16 • 96.9%
    Pass Pass - Partial -
      -
    • Does not support version-conditional items in TypedDict definitions.
    • -
    -
    Pass Pass Pass
    11.5 / 14 • 82.1% 14 / 14 • 100.0% 14 / 14 • 100.0%13.5 / 14 • 96.4%14 / 14 • 100.0% 14 / 14 • 100.0% 14 / 14 • 100.0%
    Pass Pass - Partial -
      -
    • Does not treat a complete union of all literal members as equivalent to the enum type.
    • -
    -
    Pass Pass Pass
    4.5 / 6 • 75.0% 6 / 6 • 100.0% 6 / 6 • 100.0%5.5 / 6 • 91.7%6 / 6 • 100.0% 6 / 6 • 100.0% 6 / 6 • 100.0%
    Pass Pass Pass - Unsupported -
      -
    • Does not support PEP 800 disjoint-base semantics.
    • -
    -
    Pass Pass Pass
    10 / 11 • 90.9% 11 / 11 • 100.0% 11 / 11 • 100.0%10 / 11 • 90.9%11 / 11 • 100.0% 11 / 11 • 100.0% 11 / 11 • 100.0%
    109.5 / 146 • 75.0%110 / 146 • 75.3% 138.5 / 146 • 94.9%142 / 146 • 97.3%140.5 / 146 • 96.2% 141 / 146 • 96.6%136 / 146 • 93.2%141 / 146 • 96.6%146 / 146 • 100.0%145.5 / 146 • 99.7%
    diff --git a/conformance/results/zuban/dataclasses_match_args.toml b/conformance/results/zuban/dataclasses_match_args.toml index 1309854f5..c3f9700bc 100644 --- a/conformance/results/zuban/dataclasses_match_args.toml +++ b/conformance/results/zuban/dataclasses_match_args.toml @@ -1,7 +1,12 @@ -conformant = "Pass" -conformance_automated = "Pass" +conformant = "Partial" +notes = """ +Incorrect type for __match_args__ +""" +conformance_automated = "Fail" errors_diff = """ +Line 49: Unexpected errors ['dataclasses_match_args.py:49: error: Expression is of type "tuple[Literal[\\'x\\']]", not "tuple[()]" [misc]'] """ output = """ dataclasses_match_args.py:42: error: "type[DC4]" has no attribute "__match_args__" [attr-defined] +dataclasses_match_args.py:49: error: Expression is of type "tuple[Literal['x']]", not "tuple[()]" [misc] """ diff --git a/conformance/results/zuban/version.toml b/conformance/results/zuban/version.toml index 02d95dc36..4e0e68bd7 100644 --- a/conformance/results/zuban/version.toml +++ b/conformance/results/zuban/version.toml @@ -1 +1 @@ -version = "zuban 0.10.0" +version = "zuban 0.10.1" diff --git a/conformance/uv.lock b/conformance/uv.lock index 2ad9ff23e..c2a66a708 100644 --- a/conformance/uv.lock +++ b/conformance/uv.lock @@ -1,29 +1,49 @@ version = 1 -revision = 3 +revision = 5 requires-python = "==3.12.*" [[package]] name = "ast-serialize" -version = "0.5.0" +version = "0.13.1" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/81/9d/09e27731bd5864a9ce04e3244074e674bb8936bf62b45e0357248717adac/ast_serialize-0.5.0.tar.gz", hash = "sha256:5880091bfe6f4f986f22866375c2e884843e7a0b6343ae41aeea659613d879b6", size = 61157, upload-time = "2026-05-17T17:48:29.429Z" } +sdist = { url = "https://files.pythonhosted.org/packages/21/d5/5dc1ee8a80c3b20a0b63c61b43ba6bc53517faecd1def47bcd752d22268e/ast_serialize-0.13.1.tar.gz", hash = "sha256:401cc84e8888d4d76f2c8d296fa006ed1a5ff993b6aff90dd777c03973efd025", size = 955137, upload-time = "2026-10-17T00:04:17.183Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/e0/9e/dc2530acb3a60dc6e46d65abf27d1d9f86721694757906a148d90a6860de/ast_serialize-0.5.0-cp39-abi3-macosx_10_12_x86_64.whl", hash = "sha256:0668aa9459cfa8c9c49ddd2163ebcf43088ba045ef7492af6fe22e0098303101", size = 1191380, upload-time = "2026-05-17T17:48:03.738Z" }, - { url = "https://files.pythonhosted.org/packages/26/0a/bd3d18a582f273d6c843d16bb9e22e9e16365ff7991e92f18f798e9f1224/ast_serialize-0.5.0-cp39-abi3-macosx_11_0_arm64.whl", hash = "sha256:bf683d6363edf2b39eed6b6d4fe22d34b6203867a67e27134d9e2a2680c4bc4a", size = 1183879, upload-time = "2026-05-17T17:48:05.463Z" }, - { url = "https://files.pythonhosted.org/packages/40/ae/1f919100f8620887af58fcc381c61a1f218cdf89c6e155f87b213e61010a/ast_serialize-0.5.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9cc22cf0c9be65e71cf88fda130af60d61eb4a79370ad4cfe7900d48a4aa2211", size = 1244529, upload-time = "2026-05-17T17:48:07.008Z" }, - { url = "https://files.pythonhosted.org/packages/c6/ca/6376559dcce707cdbc1d0d9a13c8d3baaaa501e949ce0ebdc4230cd881aa/ast_serialize-0.5.0-cp39-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:f66173891548c9f2726bf27957b41cabce12fa679dc6da505ddbde4d4b3b31cf", size = 1240560, upload-time = "2026-05-17T17:48:08.46Z" }, - { url = "https://files.pythonhosted.org/packages/35/b2/a620e206b5aeb7efbf2710336df57d457cffbb3991076bbcc1147ef9abd4/ast_serialize-0.5.0-cp39-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e42d729ef2be96a14efbad355093284739e3670ece3e534f82cc8832790911d9", size = 1451172, upload-time = "2026-05-17T17:48:09.922Z" }, - { url = "https://files.pythonhosted.org/packages/fa/e0/4ad5c04c24a40481b2935ce9a0ccdb6023dc8b667167d06ae530cc3512f2/ast_serialize-0.5.0-cp39-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b725026bafa801dbd7310eb13a75f0a2e370e7e51b2cb225f9d21fcfadf919ee", size = 1265072, upload-time = "2026-05-17T17:48:11.469Z" }, - { url = "https://files.pythonhosted.org/packages/b2/71/4d1d479aa56d0101c40e17720c3d6ac2af7269ea0487a80b18e7bfd1a5b7/ast_serialize-0.5.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b54f60c1d78767a53b67eaa663f0dfac3afe606aa07f1301572f588b73d64809", size = 1270488, upload-time = "2026-05-17T17:48:13.575Z" }, - { url = "https://files.pythonhosted.org/packages/6d/4f/0de1bbe06f6edef9fde4ed12ca8e7b3ec7e6e2bd4e672c5af487f7957665/ast_serialize-0.5.0-cp39-abi3-manylinux_2_31_riscv64.whl", hash = "sha256:27d51654fc240a1e87e742d353d98eb45b75f62f129086b3596ab53df2ac2a43", size = 1260702, upload-time = "2026-05-17T17:48:15.141Z" }, - { url = "https://files.pythonhosted.org/packages/75/61/e00872439cfdddcc3c1b6cdaa6e5d904ba8e26a18807c67c4e14409d0ca8/ast_serialize-0.5.0-cp39-abi3-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:2782c36237c46dd1674542f2109740ea5ea485a169bf1431939ada0434e17934", size = 1311182, upload-time = "2026-05-17T17:48:16.779Z" }, - { url = "https://files.pythonhosted.org/packages/76/8e/699a5b955f7926956c95e9e1d74132acad73c2fe7a426f94da89123c20aa/ast_serialize-0.5.0-cp39-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:1943db345233cc7194a470f13afa9c59772c0b123dea0c9414c4d4ca54369759", size = 1421410, upload-time = "2026-05-17T17:48:18.527Z" }, - { url = "https://files.pythonhosted.org/packages/a9/ae/d5b7626874478997adc7a29ab28accf21e596fb590c944290401dfd0b29e/ast_serialize-0.5.0-cp39-abi3-musllinux_1_2_armv7l.whl", hash = "sha256:df1c00022cbbcb064bfaa505aa9c9295362443ce5dacb459d1331d3da353f887", size = 1516587, upload-time = "2026-05-17T17:48:20.133Z" }, - { url = "https://files.pythonhosted.org/packages/0c/ce/b59e02a82d9c4244d64cde502e0b00e83e38816abe19155ceb5437402c7f/ast_serialize-0.5.0-cp39-abi3-musllinux_1_2_i686.whl", hash = "sha256:cae65289fc456fde04af979a2be09302ef5d8ab92ef23e596d6746dc267ada27", size = 1515171, upload-time = "2026-05-17T17:48:21.921Z" }, - { url = "https://files.pythonhosted.org/packages/8b/38/d8d90042747d05aa08d4efcf1c99035a5f670a6bf4c214d31644392afbca/ast_serialize-0.5.0-cp39-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:239a4c354e8d676e9d94631d1d4a64edc6b266f86ff3a5a80aedd344f342c01d", size = 1464668, upload-time = "2026-05-17T17:48:23.544Z" }, - { url = "https://files.pythonhosted.org/packages/dd/51/5b840c4df7334104cecffa28f23904fe81ca89ca223d2450e288de39fd3c/ast_serialize-0.5.0-cp39-abi3-win32.whl", hash = "sha256:143a4ef63285a075871908fda3672dc21864b83a8ec3ee12304aa3e4c5387b9a", size = 1068311, upload-time = "2026-05-17T17:48:25.027Z" }, - { url = "https://files.pythonhosted.org/packages/41/11/ca5672c7d491825bc4cd6702dea106a6b60d928707712ec257c7833ae476/ast_serialize-0.5.0-cp39-abi3-win_amd64.whl", hash = "sha256:cf25572c526add400f26a4750dc6ce0c3bb93fc1f75e7ae0cad4ce4f2cd5c590", size = 1108931, upload-time = "2026-05-17T17:48:26.591Z" }, - { url = "https://files.pythonhosted.org/packages/45/19/cc8bd127d28a43da249aa955cfd164cf8fd534e79e42cea96c4854d72fd0/ast_serialize-0.5.0-cp39-abi3-win_arm64.whl", hash = "sha256:92a31c9c20d25a076edaeec76b128a3535d74a24f340b9a8a7e96c9b86dc9642", size = 1081181, upload-time = "2026-05-17T17:48:28.122Z" }, + { url = "https://files.pythonhosted.org/packages/2b/e2/b0c140fe50fa39dd249e382f7733af6f816c90021fe7959a0b026f86237f/ast_serialize-0.13.1-cp315-abi3.abi3t-macosx_10_12_x86_64.whl", hash = "sha256:23d768369b89d551077dc173da6892fad00443338417523b6732f4e8ba4a7ed5", size = 1236160, upload-time = "2026-10-17T00:03:21.945Z" }, + { url = "https://files.pythonhosted.org/packages/23/c4/a8a2ca21e3943555b48221f8fba546877a7ad39efaf6505506524967d7c4/ast_serialize-0.13.1-cp315-abi3.abi3t-macosx_11_0_arm64.whl", hash = "sha256:68f8829d114dab6c9db4a8bbb8d0e342958faee1b5e15a29022678df639960f8", size = 1222214, upload-time = "2026-10-17T00:03:23.462Z" }, + { url = "https://files.pythonhosted.org/packages/15/19/2f58f2ba64e4799b39de85c140aef09a03aa6ea53be75dd292a9d9b9d8ae/ast_serialize-0.13.1-cp315-abi3.abi3t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4e385b17d5bde892a6184003a9aff3518387908b73f8f5ea539313c07c8c0ede", size = 1282979, upload-time = "2026-10-17T00:03:24.695Z" }, + { url = "https://files.pythonhosted.org/packages/b1/af/ca6087fe84210c1ccd43e3182917bb70649fa1e69745a90c1d59ba08fea8/ast_serialize-0.13.1-cp315-abi3.abi3t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:02686b281ec9b8e9614f6f0db27e12e4cac515f336c5d05b678bc9eb73ff2af5", size = 1288596, upload-time = "2026-10-17T00:03:26.04Z" }, + { url = "https://files.pythonhosted.org/packages/b0/2c/4ef964c763329a0347125e745ec0451ba4fbaceec9efe2ac729b7cd55f17/ast_serialize-0.13.1-cp315-abi3.abi3t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a8ab2c2585b2e22e48cd4aff2136fce4eab4ced569b85f150ef9a5a5d6f34d49", size = 1545540, upload-time = "2026-10-17T00:03:27.52Z" }, + { url = "https://files.pythonhosted.org/packages/bb/85/aa961dbb75813cfa94de0ce9a16a9510c226b95f604c405421e727f44bb0/ast_serialize-0.13.1-cp315-abi3.abi3t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c652d9f5d52d8b81eff3ff2c95c9dd0f281de45f6ad5d3fa95527550c396454a", size = 1309374, upload-time = "2026-10-17T00:03:29.091Z" }, + { url = "https://files.pythonhosted.org/packages/b4/e6/f2b67c327d9f9533e41791804403ccc2dc457821195a2e51f0b587a90b90/ast_serialize-0.13.1-cp315-abi3.abi3t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:121e1d08d58b75c15491cc3003609cbad71ac2b0016043c36d30a6b2032b6605", size = 1303466, upload-time = "2026-10-17T00:03:30.451Z" }, + { url = "https://files.pythonhosted.org/packages/73/1d/33f18b81d1bb1f5d682943ea92fda8130a6593627f12f6201668d40824fd/ast_serialize-0.13.1-cp315-abi3.abi3t-manylinux_2_31_riscv64.whl", hash = "sha256:30cf89b6a6844542d116c758725d13de5b97b9410a51ee577715f761270d0c1c", size = 1300576, upload-time = "2026-10-17T00:03:32.102Z" }, + { url = "https://files.pythonhosted.org/packages/25/cb/64914144925f1a4abdd9217e717b122255c38fc5ebe4342f92052f3bacbc/ast_serialize-0.13.1-cp315-abi3.abi3t-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:732aaae9e498c973fc63fd7f308009b57c4afa6ff59d0b674d894e57d0bca01a", size = 1355960, upload-time = "2026-10-17T00:03:33.676Z" }, + { url = "https://files.pythonhosted.org/packages/ee/80/bd29379fab2bce19adc0bf9177002b11b23dfe8d8fecf409998b458b4624/ast_serialize-0.13.1-cp315-abi3.abi3t-musllinux_1_2_aarch64.whl", hash = "sha256:d9c1a920b2aa0c1e016bed7721689717034ca0dba64ac3a3ff243b003d4e8dd8", size = 1459779, upload-time = "2026-10-17T00:03:35.09Z" }, + { url = "https://files.pythonhosted.org/packages/83/89/012dbe733de05ffdf8e40ca0f9fa5d417cb16ec93a74463c57c001914198/ast_serialize-0.13.1-cp315-abi3.abi3t-musllinux_1_2_armv7l.whl", hash = "sha256:847cad4c22953823f5e76d0b126c6f9da670cfa45b1df41b9324e22189d77611", size = 1563399, upload-time = "2026-10-17T00:03:37.285Z" }, + { url = "https://files.pythonhosted.org/packages/69/37/ee4bcb0358bee38744eb0f18560446572d095fe3bf6b63d6f739d08a839c/ast_serialize-0.13.1-cp315-abi3.abi3t-musllinux_1_2_i686.whl", hash = "sha256:aca07de3ca8e3d9f2b716c3c31f4f384fe4bd2d03e09912417cff7a3e08036f7", size = 1558808, upload-time = "2026-10-17T00:03:38.711Z" }, + { url = "https://files.pythonhosted.org/packages/54/1c/ff44c5355251d61ef22934c4430bb31a61de4781d25a992154aac9b8c82a/ast_serialize-0.13.1-cp315-abi3.abi3t-musllinux_1_2_ppc64le.whl", hash = "sha256:5db12d843d931b9d1f1519ce66b9cbfe72d8563b75c1204d255322254d1964dd", size = 1666324, upload-time = "2026-10-17T00:03:40.376Z" }, + { url = "https://files.pythonhosted.org/packages/c8/bb/6da4bfc8aa3403e6447607131bf3463acaf954d990c6c8b6787c1902ddfe/ast_serialize-0.13.1-cp315-abi3.abi3t-musllinux_1_2_riscv64.whl", hash = "sha256:fb8021f4dc3296de18737e3b8b34994411da725374d74a0b9eb32a738f2a23d0", size = 1474089, upload-time = "2026-10-17T00:03:41.715Z" }, + { url = "https://files.pythonhosted.org/packages/21/97/897e33bef2eefd880e6350e375cc66bc5bcd00a139be480fd655f5b3f095/ast_serialize-0.13.1-cp315-abi3.abi3t-musllinux_1_2_x86_64.whl", hash = "sha256:0d764913374ba21df8cd618045b371ed104ce55c6276de7c59e554a4f5ba26fd", size = 1501542, upload-time = "2026-10-17T00:03:43.08Z" }, + { url = "https://files.pythonhosted.org/packages/8d/4c/821211ac83870c27e4412381b7c7838336456b40575bf840e4680b2018d9/ast_serialize-0.13.1-cp315-abi3.abi3t-win32.whl", hash = "sha256:2bad302ae2427454ef9dab71bd5c3ad67188860c39d36daee38f72031edb39c4", size = 1126118, upload-time = "2026-10-17T00:03:44.616Z" }, + { url = "https://files.pythonhosted.org/packages/1f/86/2b2d5e6c4fa352874a80618e742ffd32d249dee6c119f4233b51afc6b8f4/ast_serialize-0.13.1-cp315-abi3.abi3t-win_amd64.whl", hash = "sha256:032b09d86c785c3984e975378b7861f2a68ac44e22ba7b07b93a536b2524eeb8", size = 1163766, upload-time = "2026-10-17T00:03:45.986Z" }, + { url = "https://files.pythonhosted.org/packages/77/a3/d610cfcdabaa44fd62a54ca1fc57a7dba120643798b089a14914973562de/ast_serialize-0.13.1-cp315-abi3.abi3t-win_arm64.whl", hash = "sha256:929eda0c419e622ab49df3a4c45f81c57dcc10874bbad55d0470a4a03324dac3", size = 1134043, upload-time = "2026-10-17T00:03:48.453Z" }, + { url = "https://files.pythonhosted.org/packages/81/92/d705be88ff452b9ba0088b554a0cbd308fd01879da092b33fd2ad7d1aa60/ast_serialize-0.13.1-cp39-abi3-macosx_10_12_x86_64.whl", hash = "sha256:4bcf1d5f4eefecaa325a34ecf079b2741189e7d0821523f92cb343a389a67489", size = 1242416, upload-time = "2026-10-17T00:03:51.521Z" }, + { url = "https://files.pythonhosted.org/packages/60/c2/98370845a7f35cb8a25782e78284b48e01bf3128339881d48d613f304f8f/ast_serialize-0.13.1-cp39-abi3-macosx_11_0_arm64.whl", hash = "sha256:1b158f1c9e3a0d386913924c57995d6df78224868a4d0f215bdd41587c97b34a", size = 1229729, upload-time = "2026-10-17T00:03:52.825Z" }, + { url = "https://files.pythonhosted.org/packages/d8/8b/2d7ffed76addd9d3fcf37fb171400942735c8912264c763561a85407f6a8/ast_serialize-0.13.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:77a6201b69ce42e919f2fd9a559138d5410b5d8afff7c3a6b1f500b0481ff7d8", size = 1292255, upload-time = "2026-10-17T00:03:54.148Z" }, + { url = "https://files.pythonhosted.org/packages/6b/2a/bb9e0e719d89cc950fadfcfcc9cb4bc7640419c4228c852f031ab8abf440/ast_serialize-0.13.1-cp39-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:6eb0be64c9b8f1ed26637eef345abe75ea90351c92c85a8aec7838b3af971011", size = 1298501, upload-time = "2026-10-17T00:03:55.559Z" }, + { url = "https://files.pythonhosted.org/packages/7a/32/13ce07dce48226f5bd9cfd8f708ec101a8be05aa430cda4918ce31ce8c82/ast_serialize-0.13.1-cp39-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:7f2427bddfca208e84de700044fadf9aef2769a70bae740a1bdabb89ee9e1117", size = 1553758, upload-time = "2026-10-17T00:03:56.952Z" }, + { url = "https://files.pythonhosted.org/packages/e2/fb/9b51d186db0c20ca28cbaaefd50f03b573c89327b9a2627820cbce22196b/ast_serialize-0.13.1-cp39-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:88df960e67184a71874e5b2ee014f87d1254a0dbc1f903c7bd7b1ab7733ecaef", size = 1318258, upload-time = "2026-10-17T00:03:58.418Z" }, + { url = "https://files.pythonhosted.org/packages/c5/fa/da311559dd3dae9af5825cf21660775a929b970f72e3786af3f2cd667944/ast_serialize-0.13.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9f99786e0d62082a5b121b3437f3167562133711df22128de1e9886f57f0b226", size = 1313260, upload-time = "2026-10-17T00:04:00.194Z" }, + { url = "https://files.pythonhosted.org/packages/2b/11/97a4b9e5b4776d72f47fcd9a09a497bbf68ec8c1ae074307a2c51e410d85/ast_serialize-0.13.1-cp39-abi3-manylinux_2_31_riscv64.whl", hash = "sha256:a01b515b25a03184eff4acef25b981ae007916379682e908fc8785b342a0bf3e", size = 1309992, upload-time = "2026-10-17T00:04:01.575Z" }, + { url = "https://files.pythonhosted.org/packages/2e/c4/62f85121a80cd451ef04f550cf0f7ea0ad9ff46cc4e9a5b9ae439b6527b1/ast_serialize-0.13.1-cp39-abi3-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:29422d7bcd9e7f39411571c36cec45ce8a7a9b3ad4b2e7aa64497c15a9e397f6", size = 1362715, upload-time = "2026-10-17T00:04:02.881Z" }, + { url = "https://files.pythonhosted.org/packages/c1/fa/c5f4a545f72a7681e3295bab6e3600ee0862ec4391bed961fe9f735b67e0/ast_serialize-0.13.1-cp39-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:6ffb0f548a7dc126067fdfb7b2325ab5dfcdeecc29faf5e0f0461c96d6ebfa3d", size = 1469931, upload-time = "2026-10-17T00:04:04.181Z" }, + { url = "https://files.pythonhosted.org/packages/38/a9/65aed4f8fa7a001a7cfdc03e68e844517ab041ba6fb614b7d78a1d6ac056/ast_serialize-0.13.1-cp39-abi3-musllinux_1_2_armv7l.whl", hash = "sha256:2876444a5f87a7c76f371af3c07c2fda563a08bc8af52568df812e8aba4bf568", size = 1570945, upload-time = "2026-10-17T00:04:05.778Z" }, + { url = "https://files.pythonhosted.org/packages/fb/8c/44b2da991cede79bfbf52089f33a5f0168945466b3d9cd38b5dcf08e7130/ast_serialize-0.13.1-cp39-abi3-musllinux_1_2_i686.whl", hash = "sha256:885a62ec6481ce58ab24c6357360d7a82023b62dd7e5e7ceccf59e9662a3272b", size = 1569978, upload-time = "2026-10-17T00:04:07.347Z" }, + { url = "https://files.pythonhosted.org/packages/46/e4/109b2a5beca700237767d5add920c2f8e1ba9bd5799b0faf143d0e9cf4ef/ast_serialize-0.13.1-cp39-abi3-musllinux_1_2_ppc64le.whl", hash = "sha256:2015fd0165e463aac3b1aadc6a1fa1e5820c14ca950821f4fe02f8a3f6a388d6", size = 1676082, upload-time = "2026-10-17T00:04:08.7Z" }, + { url = "https://files.pythonhosted.org/packages/73/e0/7df70f6dbb11b5762da5416318f08316a1c51348e0d69ec79ca5f98f836a/ast_serialize-0.13.1-cp39-abi3-musllinux_1_2_riscv64.whl", hash = "sha256:eb41e1906502ac80d24ff343f45008552a3f5b5158607959fe6a07dbfc6eb037", size = 1483207, upload-time = "2026-10-17T00:04:10.162Z" }, + { url = "https://files.pythonhosted.org/packages/1f/bc/523aa1c08bd69b5654621beb3dc1a9035715a4a63762fb8d219d6fb3eb81/ast_serialize-0.13.1-cp39-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:ca9acc67f796aa2554fa3037dccc022a4b08b38b2ad153edfac9c9bb7cb1f3c6", size = 1512140, upload-time = "2026-10-17T00:04:11.589Z" }, + { url = "https://files.pythonhosted.org/packages/66/83/6607060659998f00afdea0d8375c1e6e2b7d515ab905090d9a5a02f48851/ast_serialize-0.13.1-cp39-abi3-win32.whl", hash = "sha256:4f98da562e5901d69c7dd30885594c5438f859edf354e9ac7517d188fb026c3a", size = 1131889, upload-time = "2026-10-17T00:04:12.953Z" }, + { url = "https://files.pythonhosted.org/packages/9f/6f/bafd6490fe7b355627fabe95f4417e3d02da93102c8552550eb9a0774e1e/ast_serialize-0.13.1-cp39-abi3-win_amd64.whl", hash = "sha256:ddf7cbc9c8abf70102c4a088efe154bb86bfb825b0a10e556d2b15972cf99bd7", size = 1171153, upload-time = "2026-10-17T00:04:14.362Z" }, + { url = "https://files.pythonhosted.org/packages/11/25/4235f4b375a67a37ac595bf478a5407a744eaf7b64113c1c3a5432b8d954/ast_serialize-0.13.1-cp39-abi3-win_arm64.whl", hash = "sha256:48f11d96c9ec71119612f8e79a8c55c12f2b136716d68347433c561d27a25f43", size = 1139035, upload-time = "2026-10-17T00:04:15.767Z" }, ] [[package]] @@ -49,23 +69,25 @@ wheels = [ [[package]] name = "librt" -version = "0.11.0" +version = "0.16.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/40/08/9e7f6b5d2b5bed6ad055cdd5925f192bb403a51280f86b56554d9d0699a2/librt-0.11.0.tar.gz", hash = "sha256:075dc3ef4458a278e0195cbf6ac9d38808d9b906c5a6c7f7f79c3888276a3fb1", size = 200139, upload-time = "2026-05-10T18:17:25.138Z" } +sdist = { url = "https://files.pythonhosted.org/packages/04/f5/9dc696772d241814bacac7880bac32f2930b5a6ebc1f85317b83161a011c/librt-0.16.0.tar.gz", hash = "sha256:ac38d6d8d66bf3d744148dbbc0b8e193e195a51e364ed55e224631f5721891fc", size = 219839, upload-time = "2026-09-29T00:55:32.891Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/8b/d0/07c77e067f0838949b43bd89232c29d72efebb9d2801a9750184eb706b71/librt-0.11.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:b87504f1690a23b9a2cca841191a04f83895d4fc2dd04df91d82b1a04ca2ad46", size = 144147, upload-time = "2026-05-10T18:15:53.227Z" }, - { url = "https://files.pythonhosted.org/packages/7a/24/8493538fa4f62f982686398a5b8f68008138a75086abdea19ade64bf4255/librt-0.11.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:40071fc5fe0ce8daa6de616702314a01e1250711682b0523d6ab8d4525910cb3", size = 143614, upload-time = "2026-05-10T18:15:54.657Z" }, - { url = "https://files.pythonhosted.org/packages/ff/1e/f8bad050810d9171f34a1648ed910e56814c2ba61639f2bd53c6377ae24b/librt-0.11.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:137e79445c896a0ea7b265f52d23954e05b64222ee1af69e2cb34219067cbb67", size = 485538, upload-time = "2026-05-10T18:15:56.117Z" }, - { url = "https://files.pythonhosted.org/packages/c0/fe/3594ebfbaf03084ba4b120c9ba5c3183fd938a48725e9bbe6ff0a5159ad8/librt-0.11.0-cp312-cp312-manylinux2014_i686.manylinux_2_17_i686.manylinux_2_28_i686.whl", hash = "sha256:cca6644054e78746d8d4ef238681f9c34ff8b584fe6b988ecebb8db3b15e622a", size = 479623, upload-time = "2026-05-10T18:15:57.544Z" }, - { url = "https://files.pythonhosted.org/packages/b0/da/5d1876984b3746c85dbd219dbfcb73c85f54ee263fd32e5b2a632ec14571/librt-0.11.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d5b0eea49f5562861ee8d757a32ef7d559c1d35be2aaaa1ec28941d74c9ffc8a", size = 513082, upload-time = "2026-05-10T18:15:58.805Z" }, - { url = "https://files.pythonhosted.org/packages/19/6e/55bdf5d5ca00c3e18430690bf2c953d8d3ffd3c337418173d33dec985dc9/librt-0.11.0-cp312-cp312-manylinux_2_34_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:0d1029d7e1ae1a7e647ed6fb5df8c4ce2dffefb7a9f5fd1376a4554d96dac09f", size = 508105, upload-time = "2026-05-10T18:16:00.2Z" }, - { url = "https://files.pythonhosted.org/packages/07/10/f1f23a7c595ee90ece4d35c851e5d104b1311a887ed1b4ac4c35bbd13da8/librt-0.11.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:bc3ce6b33c5828d9e80592011a5c584cb2ce86edbc4088405f70da47dc1d1b3b", size = 522268, upload-time = "2026-05-10T18:16:01.708Z" }, - { url = "https://files.pythonhosted.org/packages/b6/02/5720f5697a7f54b78b3aefbe20df3a48cedcff1276618c4aa481177942ed/librt-0.11.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:936c5995f3514a42111f20099397d8177c79b4d7e70961e396c6f5a0a3566766", size = 527348, upload-time = "2026-05-10T18:16:03.496Z" }, - { url = "https://files.pythonhosted.org/packages/50/db/b4a47c6f91db4ff76348a0b3dd0cc65e090a078b765a810a62ff9434c3d3/librt-0.11.0-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:9bc0ca6ad9381cbe8e4aa6e5726e4c80c78115a6e9723c599ed1d73e092bc49d", size = 516294, upload-time = "2026-05-10T18:16:05.173Z" }, - { url = "https://files.pythonhosted.org/packages/9e/58/9384b2f4eb1ed1d273d40948a7c5c4b2360213b402ef3be4641c06299f9c/librt-0.11.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:070aa8c26c0a74774317a72df8851facc7f0f012a5b406557ac56992d92e1ec8", size = 553608, upload-time = "2026-05-10T18:16:06.839Z" }, - { url = "https://files.pythonhosted.org/packages/21/7b/5aa8848a7c6a9278c79375146da1812e695754ceec5f005e6043461a7315/librt-0.11.0-cp312-cp312-win32.whl", hash = "sha256:6bf14feb84b05ae945277395451998c89c54d0def4070eb5c08de544930b245a", size = 101879, upload-time = "2026-05-10T18:16:08.103Z" }, - { url = "https://files.pythonhosted.org/packages/37/33/8a745436944947575b584231750a41417de1a38cf6a2e9251d1065651c09/librt-0.11.0-cp312-cp312-win_amd64.whl", hash = "sha256:75672f0bc524ede266287d532d7923dbce94c7514ad07627bac3d0c6d92cc4d9", size = 119831, upload-time = "2026-05-10T18:16:09.174Z" }, - { url = "https://files.pythonhosted.org/packages/59/67/a6739ac96e28b7855808bdb0370e250606104a859750d209e5a0716fe7ab/librt-0.11.0-cp312-cp312-win_arm64.whl", hash = "sha256:2f10cf143e4a9bb0f4f5af568a00df94a2d69ef41c2579584454bb0fe5cc642c", size = 103470, upload-time = "2026-05-10T18:16:10.369Z" }, + { url = "https://files.pythonhosted.org/packages/ad/76/bbdaeb87b7c47b5c7343e90222b9bfa4e4a8a83f647e02933ad0129225b1/librt-0.16.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:fe52bf4641069e7978a14253b036cb9002def1926317e710f2e249f8a8c47742", size = 151028, upload-time = "2026-09-29T00:52:41.508Z" }, + { url = "https://files.pythonhosted.org/packages/fd/0c/ab8ed3dab0085931aec4a792c7eaac8dc6c5ff4691fda3a5360d9d8a9cd2/librt-0.16.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:5bcc2c4726ced915b00de0c9856a4eeabfb3fddb93e10e0b8f735b7709358b6d", size = 155283, upload-time = "2026-09-29T00:52:42.873Z" }, + { url = "https://files.pythonhosted.org/packages/eb/36/494e79d460c80c1f030661e8287c9eca5e1ad652dc2b2180b6cd42abce0a/librt-0.16.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ff7baa55f8e7c69851419e50a666015d02a74198716fd45c0125a2112e0a389f", size = 503185, upload-time = "2026-09-29T00:52:44.638Z" }, + { url = "https://files.pythonhosted.org/packages/9b/34/a8464038dd9db6e4381fa2b6eb73dc9a50888d77102c4c139304ac35cddc/librt-0.16.0-cp312-cp312-manylinux2014_i686.manylinux_2_17_i686.manylinux_2_28_i686.whl", hash = "sha256:b95d5d92ab83d39e760a52091bb1baba664f3a2351e39b1e16801e5747c2f0e9", size = 496738, upload-time = "2026-09-29T00:52:46.441Z" }, + { url = "https://files.pythonhosted.org/packages/6a/53/e0e5e334ef0c6ed27039d323819368b9ef6712be87d55ee2bf9799398afd/librt-0.16.0-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:b6d085d70bce51d43c5c7c36d63490770180d8779e71c49305c87b4213918de7", size = 513818, upload-time = "2026-09-29T00:52:48.068Z" }, + { url = "https://files.pythonhosted.org/packages/ad/f7/7ce72cbf19d0addd05090b339152fd0548a02562c2866a603e6e3b3da2df/librt-0.16.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:36e53948e99bbe3ffea257124cfcae1cfb01831555c9a9c903c9f9a72db7fd07", size = 531952, upload-time = "2026-09-29T00:52:49.816Z" }, + { url = "https://files.pythonhosted.org/packages/83/22/0b1bcb6a8e723c8b4fd60dfc8ae8ec6461c54073fbc8685efeb8d900d407/librt-0.16.0-cp312-cp312-manylinux_2_34_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:54d11f726aae9df5a6ffbbf0a03a52449bbac84a53ef03669cb41cdfd4ae41bf", size = 524465, upload-time = "2026-09-29T00:52:51.354Z" }, + { url = "https://files.pythonhosted.org/packages/64/2e/e9c23b8b9df1813da1be205deca9606beb7ddd033972246cd426d05374a0/librt-0.16.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:4323193ac0cd025f85af531df8ba91bf24d1973b401697347a6282e8fd3fcf5e", size = 543191, upload-time = "2026-09-29T00:52:53.284Z" }, + { url = "https://files.pythonhosted.org/packages/bc/e5/6a8b21b342c03ed7e230fa3afbfd2edc58e6e87ef1f0d11fa2b9a748c252/librt-0.16.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:e42f8e098b9c5396fefa05fb1cc7e33b0e08fc51da106b5de4a45fd22aac6743", size = 546979, upload-time = "2026-09-29T00:52:54.932Z" }, + { url = "https://files.pythonhosted.org/packages/84/9e/b5129023eced1be01e01c22757f53be551d463b1bb7264f787927404c1d6/librt-0.16.0-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:39ec1d5a14e37baf1450a6cabf03fe552340808bf1ad9d71824ab90117716459", size = 555317, upload-time = "2026-09-29T00:52:56.869Z" }, + { url = "https://files.pythonhosted.org/packages/71/89/28bba5938c725fe91f06bf93f7fa6c6b150229df53a87b454b0d5c2a796e/librt-0.16.0-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:d1aabe3925cbb4a08d15b7b20ba4011b53019da0c4173a25155139b7b1baed65", size = 535846, upload-time = "2026-09-29T00:52:58.475Z" }, + { url = "https://files.pythonhosted.org/packages/22/92/63773026614f888c5d4e370e395ce42ca604b89f70b3acdfedbf94851b80/librt-0.16.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:300c3ffdc459f4a779a8411ecb188e3ac0b1ff3a3a7b099642555dedae06c69b", size = 573700, upload-time = "2026-09-29T00:53:00.127Z" }, + { url = "https://files.pythonhosted.org/packages/66/8f/347d4677eefb57cd9f8e01d95a1dcee9a91b4e44e664173c32ff6f3752e5/librt-0.16.0-cp312-cp312-win32.whl", hash = "sha256:c17194318e4c0c0348b36f36c2ec7534436fe0a4c15582403162a4f08c80797a", size = 106158, upload-time = "2026-09-29T00:53:02.031Z" }, + { url = "https://files.pythonhosted.org/packages/f0/2c/5193dc81127cd5ddfad031391b046bf32dda219b38463ab872407ca30646/librt-0.16.0-cp312-cp312-win_amd64.whl", hash = "sha256:25a58a19ea8d83b68209f04912df765e9260635ef77646542ed4b4abe6bc7940", size = 126176, upload-time = "2026-09-29T00:53:03.445Z" }, + { url = "https://files.pythonhosted.org/packages/ff/3d/9668a400c8dd81d162eba38b33fa49fa6205f1a64493570a13fbb815c3ee/librt-0.16.0-cp312-cp312-win_arm64.whl", hash = "sha256:f7be7cf555bc30ec12622e9447299cc4a9b8ff307548b634794353db0c2065dc", size = 116572, upload-time = "2026-09-29T00:53:04.815Z" }, ] [[package]] @@ -98,7 +120,7 @@ wheels = [ [[package]] name = "mypy" -version = "2.1.0" +version = "2.4.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "ast-serialize" }, @@ -107,16 +129,15 @@ dependencies = [ { name = "pathspec" }, { name = "typing-extensions" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/82/15/cca9d88503549ed6fedeaa1d448cdddd542ee8a490232d732e278036fbf2/mypy-2.1.0.tar.gz", hash = "sha256:81e76ad12c2d804512e9b13240d1588316531bfba07558286078bfbce9613633", size = 3898359, upload-time = "2026-05-11T18:37:36.237Z" } +sdist = { url = "https://files.pythonhosted.org/packages/34/4e/64300736cf0a0373a27b94a91b664ee7382e36f77b0621bae6381da3e180/mypy-2.4.0.tar.gz", hash = "sha256:77bdaebd452f43fcfc4cc3ba94352a3ea537cd01e3f2d0879f48673d2ec00d6e", size = 4064425, upload-time = "2026-10-01T20:40:39.229Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/95/b1/55861beb5c339b44f9a2ba92df9e2cb1eeb4ae1eee674cdf7772c797778b/mypy-2.1.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:244358bf1c0da7722230bce60683d52e8e9fd030554926f15b747a84efb5b3af", size = 14874381, upload-time = "2026-05-11T18:37:31.784Z" }, - { url = "https://files.pythonhosted.org/packages/0b/b3/b7f770114b7d0ac92d0f76e8d93c2780844a70488a90e91821927850da86/mypy-2.1.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:4ec7c57657493c7a75534df2751c8ae2cda383c16ecc55d2106c54476b1b16f6", size = 13665501, upload-time = "2026-05-11T18:34:23.063Z" }, - { url = "https://files.pythonhosted.org/packages/b6/f3/8ae2037967e2126689a0c11d99e2b707134a565191e92c60ca2572aec60a/mypy-2.1.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:d8161b6ff4392410023224f0969d17db93e1e154bc3e4ba62598e720723ae211", size = 14045750, upload-time = "2026-05-11T18:31:48.151Z" }, - { url = "https://files.pythonhosted.org/packages/a0/32/615eb5911859e43d054941b0d0a7d06cfa2870eba86529cf385b052b111c/mypy-2.1.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:bf03e12003084a67395184d3eb8cbd6a489dc3655b5664b28c210a9e2403ab0b", size = 15061630, upload-time = "2026-05-11T18:37:06.898Z" }, - { url = "https://files.pythonhosted.org/packages/d4/03/4eafbfff8bfab1b87082741eae6e6a624028c984e6708b73bce2a8570c9d/mypy-2.1.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:20509760fd791c51579d573153407d226385ec1f8bcce55d730b354f3336bc22", size = 15288831, upload-time = "2026-05-11T18:31:18.07Z" }, - { url = "https://files.pythonhosted.org/packages/99/ee/919661478e5891a3c96e549c036e467e64563ab85995b10c53c8358e16a3/mypy-2.1.0-cp312-cp312-win_amd64.whl", hash = "sha256:6753d0c1fdd6b1a23b9e4f283ce80b2153b724adcb2653b20b85a8a28ac6436b", size = 11135228, upload-time = "2026-05-11T18:34:31.23Z" }, - { url = "https://files.pythonhosted.org/packages/24/0a/6a12b9782ca0831a553192f351679f4548abc9d19a7cc93bb7feb02084c7/mypy-2.1.0-cp312-cp312-win_arm64.whl", hash = "sha256:98ebb6589bb3b6d0c6f0c459d53ca55b8091fbc13d277c4041c885392e8195e8", size = 10040684, upload-time = "2026-05-11T18:36:48.199Z" }, - { url = "https://files.pythonhosted.org/packages/0d/2a/13ca1f292f6db1b98ff495ef3467736b331621c5917cad984b7043e7348d/mypy-2.1.0-py3-none-any.whl", hash = "sha256:a663814603a5c563fb87a4f96fb473eeb30d1f5a4885afcf44f9db000a366289", size = 2693302, upload-time = "2026-05-11T18:31:29.246Z" }, + { url = "https://files.pythonhosted.org/packages/68/ed/e5d7cf4017e74a1c1e1c4058ce8f614fc1e3e7606564f47166e22bfc9f95/mypy-2.4.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:e05ff2925d8b37ad26c80c1b9dc43ae5d455da2df1e23c24c095a6425917c57e", size = 14378593, upload-time = "2026-10-01T20:38:48.222Z" }, + { url = "https://files.pythonhosted.org/packages/30/7d/12d994886a922f0f1997becc9c6625198d61eeb5962558a886af7dd38d54/mypy-2.4.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:29243242cf72582b65f9582ad9e56e8cb281566ed3519f4cd70bb8b9f2977e90", size = 14464697, upload-time = "2026-10-01T20:39:11.059Z" }, + { url = "https://files.pythonhosted.org/packages/f3/9e/bcc9af755425ad17790bf11d73c2ea7592914cf309ee1340997670f9d57a/mypy-2.4.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:29eb0b9427a6b11b992e452f6cceb8af724f4dceb47e779d0b35e405e996ea5e", size = 15552257, upload-time = "2026-10-01T20:39:56.269Z" }, + { url = "https://files.pythonhosted.org/packages/af/0c/3343fc4525d6f00d75ad17a93a9f052d5163641cb8911840d4a12cb59ff2/mypy-2.4.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:e3ebe2f72a2a1156065a9851570ffbf50c0a93cdccadef9c6e05c508a4fd10b1", size = 15800443, upload-time = "2026-10-01T20:38:54.815Z" }, + { url = "https://files.pythonhosted.org/packages/8f/0e/69aac6b8159da7c53e6115a2be1bf48e85503402cadbf506dd708e8b2ad7/mypy-2.4.0-cp312-cp312-win_amd64.whl", hash = "sha256:236e0d68f6941992b0811128e652590f590db444ab29ad8f1324765b9298b946", size = 11381574, upload-time = "2026-10-01T20:39:49.406Z" }, + { url = "https://files.pythonhosted.org/packages/6e/d3/d32ce4feb5993eec09d2024bef16cedc9b93701b1446b86092f08b24491b/mypy-2.4.0-cp312-cp312-win_arm64.whl", hash = "sha256:82d0f94c8587ccb472622ee7795280aaa38a06640d5f45b3f16909d6dd86a989", size = 10944729, upload-time = "2026-10-01T20:40:15.203Z" }, + { url = "https://files.pythonhosted.org/packages/81/12/46ae8670c98a3cd0286ca5645c2f918f8f6be65edfed81b916010619f668/mypy-2.4.0-py3-none-any.whl", hash = "sha256:d01c5d26a352acc6d5cf3128225477e1e8465e8d3029d4c345807fbf7f3cf093", size = 2800734, upload-time = "2026-10-01T20:39:26.837Z" }, ] [[package]] @@ -161,34 +182,34 @@ wheels = [ [[package]] name = "pyrefly" -version = "1.3.0.dev1" +version = "1.4.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/a5/de/fe8d8567d1d092f5d67bb8bbe0863a44919482a37febc79db8aa88088532/pyrefly-1.3.0.dev1.tar.gz", hash = "sha256:189e0e1d3212ab4ecff1d058f9e095fa9711e5e4c19436f7370ceef05d1788fd", size = 6306791, upload-time = "2026-08-07T01:56:51.009Z" } +sdist = { url = "https://files.pythonhosted.org/packages/b3/3e/ea6893be167fa14307d7f9a924bed9ecbbbd91b01953890b9b3c58ed5359/pyrefly-1.4.0.tar.gz", hash = "sha256:bb57c004a4842cfe93f93aebb5203ca6209a5f0c8bda47e8bc289e70940fd910", size = 6962062, upload-time = "2026-10-15T16:54:11.819Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/ba/6a/ca1ea8084f000ecbf7d6a2a8cde3f2d6f437d0d527f5f0bda0a383fb011f/pyrefly-1.3.0.dev1-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:327e245a54357794954a7788d22dd446b90dcc403d0d82414b0b20b6fa37648c", size = 14210092, upload-time = "2026-08-07T01:56:17.895Z" }, - { url = "https://files.pythonhosted.org/packages/a2/df/0f405798d99900a6809483db0262c820ccccdf13b379789d9280d848b9a0/pyrefly-1.3.0.dev1-py3-none-macosx_11_0_arm64.whl", hash = "sha256:00e5d88265c5e3088ac566dd4cf542a13f93e76f7672b738c1306d5d5cae6123", size = 13639017, upload-time = "2026-08-07T01:56:21.181Z" }, - { url = "https://files.pythonhosted.org/packages/4b/28/a41e1daab805124cdefc46566251555bbe0caf24668a851393971eb5cbd7/pyrefly-1.3.0.dev1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c2dcce81731dcc0dcd199b6b0117ebd3df2ee1fc4910f508cb84aa7615182f28", size = 14084976, upload-time = "2026-08-07T01:56:24.551Z" }, - { url = "https://files.pythonhosted.org/packages/df/9c/985e6ab05ab7927d5f6eb8420958957b707f8fbdcb012001b967286a46cc/pyrefly-1.3.0.dev1-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:56a855f5784978e990effe760e0eaab60b98a0add9bebb79af901d9a8269696d", size = 15230694, upload-time = "2026-08-07T01:56:27.722Z" }, - { url = "https://files.pythonhosted.org/packages/55/73/1368adde6c6f29bd88d5929211291a17c4cf9bddaafd0a3ab330d463ed10/pyrefly-1.3.0.dev1-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a0e36aede58dffab44a67ac0f322e416d0fa4955c80d491fc7e0fe80c1a73a5d", size = 15170348, upload-time = "2026-08-07T01:56:30.86Z" }, - { url = "https://files.pythonhosted.org/packages/2c/28/172a588415c48b2eb2eccabbfb3e21c5c95ddeb1022ca96b5fde75c5f71a/pyrefly-1.3.0.dev1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fdb58f30ec64ae44268baa58fcf01f0fdfba44c3153591c8b76a16a57df44ee4", size = 14582792, upload-time = "2026-08-07T01:56:34.052Z" }, - { url = "https://files.pythonhosted.org/packages/fa/8f/c7211d118a5dfb08e24655ff5c4414fda0b281de64cf83834da9fd1bbcd2/pyrefly-1.3.0.dev1-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:c4e6e3c80416636666d2a9cbca0fd32dbba51e54da4e7a5a6ba3388bfbacf612", size = 14106287, upload-time = "2026-08-07T01:56:37.073Z" }, - { url = "https://files.pythonhosted.org/packages/d5/f4/642addd2e33daf1cc2357150db5c6ab6a81bd378281203552d5e509c6f02/pyrefly-1.3.0.dev1-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:1672be7086ae54d8dfce02eb612894c3ad51c42e03b4769d0e45a9d9e622d4ed", size = 14617068, upload-time = "2026-08-07T01:56:39.913Z" }, - { url = "https://files.pythonhosted.org/packages/3b/17/e4a7c0f6ded01370f3267058f5bb2a10487d200dc5a29058fbff34aa9820/pyrefly-1.3.0.dev1-py3-none-win32.whl", hash = "sha256:7dd496f3642bba6764f3c4c9f189ef021a30fc05261087316e4d6bb9beace65e", size = 13403475, upload-time = "2026-08-07T01:56:42.782Z" }, - { url = "https://files.pythonhosted.org/packages/61/79/2a366f1b65c177e42f67b8540e7372e258d0880eed957859bbf5b1ff7d0e/pyrefly-1.3.0.dev1-py3-none-win_amd64.whl", hash = "sha256:70baea8d7577be7f50a5dbbf5819f5cb335208e97793846e14d80ebd8f90f6c4", size = 14264341, upload-time = "2026-08-07T01:56:45.772Z" }, - { url = "https://files.pythonhosted.org/packages/c8/f9/abe77e5154b1c56d60831aade2d4b6e9e9d2c458860e5fd9fc30a2fc720e/pyrefly-1.3.0.dev1-py3-none-win_arm64.whl", hash = "sha256:d5070fecbe7b22eaf46b1da510fe5ea3c69b17f805dfbc04753d9501ce24f54e", size = 13607012, upload-time = "2026-08-07T01:56:48.638Z" }, + { url = "https://files.pythonhosted.org/packages/6a/17/dfce6611acc00cb26667e5e1011438cc510f3067f961e0f07f7a0c68f416/pyrefly-1.4.0-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:460cec39bc8743915e9c2c8c10ba926ad0b29b099d89c1859fb97e0059f42fa7", size = 15705624, upload-time = "2026-10-15T16:53:43.412Z" }, + { url = "https://files.pythonhosted.org/packages/a6/78/a7b96442123fa6ed733de0d1ea933e35d6fc6b7c9cf16e05279abb493493/pyrefly-1.4.0-py3-none-macosx_11_0_arm64.whl", hash = "sha256:5a6370d686b6cbbac8869832f09a52012888371956fbc68d446a349bc85ccd43", size = 14978669, upload-time = "2026-10-15T16:53:46.546Z" }, + { url = "https://files.pythonhosted.org/packages/23/97/dfcfec6a9d8948ab4b2746f7e87558a82bffabb7a54c22e7d3ce4bdc1932/pyrefly-1.4.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8f1b16923a6583a6764e8aec07787e2ef4df644c7030294cba71339783a9451c", size = 15438858, upload-time = "2026-10-15T16:53:48.904Z" }, + { url = "https://files.pythonhosted.org/packages/31/12/6fa414aa87e398d6ddc7145a5d993b0975fc3511198dbb72c47873653ab6/pyrefly-1.4.0-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:688ad4cb4d6e711d67026fdcfb37b599f86061efe11ba5704287330e7041a69e", size = 16852241, upload-time = "2026-10-15T16:53:51.496Z" }, + { url = "https://files.pythonhosted.org/packages/a8/73/2d7312262cf6481d6ad46eed55b8f2592c3cff60f95cc2f30a114cd1484e/pyrefly-1.4.0-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f5f3c9dddb6f3128beb49cf4e0f5cb88d4d17f039008d8e0c2be653966acd234", size = 16751917, upload-time = "2026-10-15T16:53:54.39Z" }, + { url = "https://files.pythonhosted.org/packages/2c/65/b44a1cb23667bcbcdc88558cbef79fa9e07a1152c2a1da148036b1a2e0d1/pyrefly-1.4.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b6951f51687304caebfedf13dd1a943aeafdbc95abcc4e24a683b97467a77007", size = 16066345, upload-time = "2026-10-15T16:53:57.436Z" }, + { url = "https://files.pythonhosted.org/packages/a6/07/7ca6ff0c53e3a90ecdab05790d33f430fca5c48687613a0b182744166d98/pyrefly-1.4.0-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:838de4d4a8b9b8ed39bedd0b8b55629c69661d73a6fa3a3a4adff24b9dbeb399", size = 15461223, upload-time = "2026-10-15T16:54:00.364Z" }, + { url = "https://files.pythonhosted.org/packages/61/be/ec7b2f38a898ce5b2219dda730e87d31fc8cfb2108a3d5844f9d590f1281/pyrefly-1.4.0-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:afb9ce2e0ae3e6106fb45f6d47536ac92b6423e601e08401cdefa850066444f5", size = 16119099, upload-time = "2026-10-15T16:54:02.664Z" }, + { url = "https://files.pythonhosted.org/packages/6e/16/1b9549168b38a575d9c168e17b4b4ee30028d602ec0f7b07c198ef265dbe/pyrefly-1.4.0-py3-none-win32.whl", hash = "sha256:839db536d0ac29f1b23e2d974fb911075c2283e3e623755c45d826aafac175bc", size = 14858880, upload-time = "2026-10-15T16:54:05.114Z" }, + { url = "https://files.pythonhosted.org/packages/03/02/18f075d4de0e255f184f42fc28c1f0ecc9f49dd528678479fc90cf12246c/pyrefly-1.4.0-py3-none-win_amd64.whl", hash = "sha256:7aff37c2b711c8240ed650da0c6148237b327bf7e5dfacee65884f1adea22305", size = 15726220, upload-time = "2026-10-15T16:54:07.452Z" }, + { url = "https://files.pythonhosted.org/packages/92/62/92947076681550904c72a9dd03b24e92694ede9a48548f5e487c849e66ea/pyrefly-1.4.0-py3-none-win_arm64.whl", hash = "sha256:88879f0cb749e5fea81d9ff4c2d5431a70349c458bcdf0b61de72c79214d90a5", size = 14943690, upload-time = "2026-10-15T16:54:09.689Z" }, ] [[package]] name = "pyright" -version = "1.1.410" +version = "1.1.414" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "nodeenv" }, { name = "typing-extensions" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/10/53/e4d8ea1391bd4355231be6f91bf239479aa0014260ed3fb5526eeb12a1f2/pyright-1.1.410.tar.gz", hash = "sha256:07a073b8ba6749826773c1269773efa11b93440d9a6aa60419d9a3172d6dc488", size = 4062013, upload-time = "2026-06-01T17:35:48.894Z" } +sdist = { url = "https://files.pythonhosted.org/packages/e1/1b/244c7b710031ada80f27e579ec20d28a2285dfc318fed0339866b1047f12/pyright-1.1.414.tar.gz", hash = "sha256:523c0a97c60da6333234955c277730c9cf4f5bd6d5399e7b7d2b0fc5d3599524", size = 4154638, upload-time = "2026-09-10T12:26:53.181Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/d7/33/288b5868fa00846dacf249633719d747893e54aebd196b9968ac1878a5d3/pyright-1.1.410-py3-none-any.whl", hash = "sha256:5e961bed37cacf96b3f7cd7b1da39b350a9239aa2e69138d0e88f728cfaf296c", size = 6082448, upload-time = "2026-06-01T17:35:46.387Z" }, + { url = "https://files.pythonhosted.org/packages/d7/ba/18b6e682ead424ad24bcc134339ae5d1b931cd9ae260540592a058a91279/pyright-1.1.414-py3-none-any.whl", hash = "sha256:2a6b4b3298c9eec174c5ed83bd338de6eee82df2992f3e1930e6199d381be36f", size = 6225049, upload-time = "2026-09-10T12:26:51.427Z" }, ] [[package]] @@ -271,7 +292,7 @@ requires-dist = [ { name = "markdown" }, { name = "mypy" }, { name = "pycroscope" }, - { name = "pyrefly", specifier = "==1.3.0.dev1" }, + { name = "pyrefly" }, { name = "pyright" }, { name = "tomlkit" }, { name = "ty" }, @@ -291,19 +312,19 @@ wheels = [ [[package]] name = "zuban" -version = "0.10.0" +version = "0.10.1" source = { registry = "https://pypi.org/simple" } wheels = [ - { url = "https://files.pythonhosted.org/packages/d0/e3/69ef2ec901c4a21b584c8f30e2957e6ee7706fff2b7f7b64554628c8e1da/zuban-0.10.0-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:59d7a698dd58bc742a6be187d000367d2dea541a2ee57531d10f4713520ee97c", size = 11352888, upload-time = "2026-09-18T11:11:30.344Z" }, - { url = "https://files.pythonhosted.org/packages/45/6b/726e27df1b5243fda6f2206147c6566a7e17e5ff64f8fec51c01e32d69c3/zuban-0.10.0-py3-none-macosx_11_0_arm64.whl", hash = "sha256:c81631c3e6ba5e3455d3953588c89612d8d0995be28909824df44fa997af7e40", size = 11112654, upload-time = "2026-09-18T11:11:33.029Z" }, - { url = "https://files.pythonhosted.org/packages/99/36/ab87b7e4b3dcd5ca89ad324c9a5249b00892ed25a2c2c29ffdea1286650f/zuban-0.10.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bd4f6fcdd46d89f5fe5ca9191e05f3c1b6e28295b0bc532e18c3164565288380", size = 28554642, upload-time = "2026-09-18T11:11:35.821Z" }, - { url = "https://files.pythonhosted.org/packages/59/7a/82a17d92dc4652086356ed5642b4b81d285dd7f851b949ca967621d62e39/zuban-0.10.0-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:98fbd6e08e79d333cca612d4ed3f679a9cddbfc3b99f07693553769fe172035a", size = 28732309, upload-time = "2026-09-18T11:11:39.495Z" }, - { url = "https://files.pythonhosted.org/packages/bf/47/21116e950934fd040a10df5309978d0c2bb1084d2c2b04c668273422377a/zuban-0.10.0-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c494f530034b56b1ca9ef6d9851b793c858fa8697c6c01f683dc0ab203e290d1", size = 29838795, upload-time = "2026-09-18T11:11:43.292Z" }, - { url = "https://files.pythonhosted.org/packages/f6/4e/fa2148a3bac24788bda3a83c58167ae86e88b87a141911140953914d6447/zuban-0.10.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ae1fb50593f129a5df4dc0b06f25124345f8d527623545e1a79ffb451a78e131", size = 31846103, upload-time = "2026-09-18T11:11:47.362Z" }, - { url = "https://files.pythonhosted.org/packages/40/dd/6124f00f1e38c63ea548bc2a9dde5f547485e9119dbd1a320de5c54e0bdf/zuban-0.10.0-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:b08b5331728b818b87aae7a287f81f7d66bed56823a1084776ccdbc84067ffdb", size = 28725088, upload-time = "2026-09-18T11:11:50.857Z" }, - { url = "https://files.pythonhosted.org/packages/4a/87/5bef3b23e53f9cc525e5cd228c51d2e6f1fa47080f48b0d3ee0bb146af07/zuban-0.10.0-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:a66d60f6afd1deddef673dab407abf1014721e393fcc18fb1b5f2f73fa3f04d8", size = 29166127, upload-time = "2026-09-18T11:11:54.567Z" }, - { url = "https://files.pythonhosted.org/packages/00/5c/b173cbcfbf8261b27f6a70a54a92d3400a378a4143041073834c2c9c5cbc/zuban-0.10.0-py3-none-musllinux_1_2_i686.whl", hash = "sha256:d83400da488b8a439358425ddfc800fa12859c03c8f7bcd8754e2cc487defea5", size = 29732954, upload-time = "2026-09-18T11:11:58.192Z" }, - { url = "https://files.pythonhosted.org/packages/f2/53/1b4d0a82aa728090458e531207a6a7634f186a566f5e0d5167ddc8f4355a/zuban-0.10.0-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:64002bf171baf49097b61521f7756a1c29264a3fcd2c98cf3e2b0b7862e74008", size = 29059999, upload-time = "2026-09-18T11:12:01.793Z" }, - { url = "https://files.pythonhosted.org/packages/ba/6d/2215ab53d7388a8d9de888af048010ef5b6421c54a50f7a38069e8e614ad/zuban-0.10.0-py3-none-win32.whl", hash = "sha256:9d39da51b2d679505011bdcf8ba5757b10dc3e24b941d572b6cde8217fa48539", size = 10002018, upload-time = "2026-09-18T11:12:05.125Z" }, - { url = "https://files.pythonhosted.org/packages/58/42/fb3c2c3a039a91608527a70beeddf1d183abdc8697bd124df8797676cefa/zuban-0.10.0-py3-none-win_amd64.whl", hash = "sha256:de928ef243a3547fa747321fb6aad4a07657827e72c23c7905dbeab4697f8337", size = 10713422, upload-time = "2026-09-18T11:12:07.69Z" }, + { url = "https://files.pythonhosted.org/packages/42/85/bf2e4f075b5cd530d2ec50f7c3e5aecc4dfd30caf978c0c0bf9bac727f9f/zuban-0.10.1-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:7751221eb5bb47fe9d4d28857bd4067a76d2642fb43b820807a00e58311a350f", size = 11360723, upload-time = "2026-10-11T23:25:57.92Z" }, + { url = "https://files.pythonhosted.org/packages/d8/71/df27ba420cbd978be4019e9d388dbd278f66fb069b9f74601d02f32d79ed/zuban-0.10.1-py3-none-macosx_11_0_arm64.whl", hash = "sha256:94e87739f8c27d46da9f9db16f77eb65a71b4ab98b45dc4b549d0e4fd54fd060", size = 11126236, upload-time = "2026-10-11T23:26:00.689Z" }, + { url = "https://files.pythonhosted.org/packages/07/1f/300f418d89c5fd1e9a3c9eb393c2a7bce7c66a588b47545325716f95fca1/zuban-0.10.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e8007869c5010f2c4f3cdfff39cf18e75072f3bf064193adf78ec55589b7a27e", size = 28478792, upload-time = "2026-10-11T23:26:04.2Z" }, + { url = "https://files.pythonhosted.org/packages/ff/d1/93b6bdec8a74c0ff219cf356f7dbc4d0736d7d7c7681036fe85f264cdcfe/zuban-0.10.1-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:b0c4b44c07c8dcb2d600e18df846c715d5d988b9271487bf0efed4d5bf1e495f", size = 28781450, upload-time = "2026-10-11T23:26:07.963Z" }, + { url = "https://files.pythonhosted.org/packages/54/2a/132c2fd45997dc45da9b5e3e98767c2ee69bcff212dcd3f5d3fccfa4f40c/zuban-0.10.1-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2901a3cda7df0481c2b1e98135e1f9636ee257b15a3a4c0ffd4fa969fef0e22a", size = 29907271, upload-time = "2026-10-11T23:26:11.27Z" }, + { url = "https://files.pythonhosted.org/packages/09/c4/0225ef5475beee1209aca527f983422801fda7b27ecc8b5b48a8229c2f16/zuban-0.10.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8088b7be916d76f3a89a5b34e97cf26a30c2620c467a2b5a47a6c4cca47cd5b9", size = 31736506, upload-time = "2026-10-11T23:26:15.129Z" }, + { url = "https://files.pythonhosted.org/packages/46/23/f141b7a8e5103841932e5dcba6b69db7e27c5b183d67c7dbd43ac9c3b294/zuban-0.10.1-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:8f606e44f68bc7715e534059558cedd2096ec7049930decf1cfc428904d823c3", size = 28641122, upload-time = "2026-10-11T23:26:18.68Z" }, + { url = "https://files.pythonhosted.org/packages/14/0b/ed5971e3ddf457ac2c1e325dffc318a73cddf24b411c7c893a7809ca424d/zuban-0.10.1-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:7523983d56415c15423a8fe3e52c7f63a104430bef3938967db8e1464f6a510a", size = 29221427, upload-time = "2026-10-11T23:26:22.22Z" }, + { url = "https://files.pythonhosted.org/packages/d3/ba/a730cb6c712f46f007e67757b447c6998fe4d12ab92bab3b3bd124956278/zuban-0.10.1-py3-none-musllinux_1_2_i686.whl", hash = "sha256:2a91faef86ab1c86fe9a8aa77f26b5b0295a7c90c73090f50ec79d61ba24a712", size = 29801084, upload-time = "2026-10-11T23:26:25.876Z" }, + { url = "https://files.pythonhosted.org/packages/73/89/b0421c9e5185373451bead13303ce5bdc2536d8fb6f31d4cf0e273a662f1/zuban-0.10.1-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:e69b8860b992d3bcb9d75641dad9c817954d350b454989e6da11e0505e937ad4", size = 29020690, upload-time = "2026-10-11T23:26:29.07Z" }, + { url = "https://files.pythonhosted.org/packages/8d/e3/51624d02f45002e8a7fa67c15d6749657eebb3db8f4e47c82f1846d2ca93/zuban-0.10.1-py3-none-win32.whl", hash = "sha256:ff26d08e5bb5448d051fa5eb5dc6e5993a03af527571966b1499eaa62928a6c0", size = 10020499, upload-time = "2026-10-11T23:26:31.917Z" }, + { url = "https://files.pythonhosted.org/packages/ee/dc/493a9d21fda9924d9a0841402e2778114bde7788440f4f6954656ac6c80b/zuban-0.10.1-py3-none-win_amd64.whl", hash = "sha256:e74ce348967d83360c9212a1082358bb3bc5b65ced55d17017715a90abb18f28", size = 10734301, upload-time = "2026-10-11T23:26:34.439Z" }, ] From d0af36bbe9eb8a6fa188bf920e1426620182fe10 Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Thu, 29 Oct 2026 16:35:56 +0100 Subject: [PATCH 303/308] Introduce the "bare"/"explicitly typed" Final terminology (#2370) --- docs/guides/libraries.rst | 4 ++-- docs/guides/writing_stubs.rst | 4 ++-- docs/spec/dataclasses.rst | 5 +++-- docs/spec/distributing.rst | 4 ++-- docs/spec/glossary.rst | 8 +++++++ docs/spec/literal.rst | 10 ++++----- docs/spec/qualifiers.rst | 42 ++++++++++++++++++++--------------- docs/spec/typeddict.rst | 4 ++-- 8 files changed, 48 insertions(+), 33 deletions(-) diff --git a/docs/guides/libraries.rst b/docs/guides/libraries.rst index 8e62af9c5..66404aac8 100644 --- a/docs/guides/libraries.rst +++ b/docs/guides/libraries.rst @@ -568,10 +568,10 @@ type annotation would be redundant. COLOR_FORMAT_RGB: Literal["rgb"] = "rgb" LATEST_VERSION: tuple[int, int] = (4, 5) - # Final variable with inferred type + # Bare Final variable with inferred type ColorFormatRgb: Final = "rgb" - # Final variable with explicit type + # Explicitly typed Final variable ColorFormatRgb: Final[Literal["rgb"]] = "rgb" LATEST_VERSION: Final[tuple[int, int]] = (4, 5) diff --git a/docs/guides/writing_stubs.rst b/docs/guides/writing_stubs.rst index 7964566c9..af0b402cd 100644 --- a/docs/guides/writing_stubs.rst +++ b/docs/guides/writing_stubs.rst @@ -349,8 +349,8 @@ still recommended to separately define known attributes. Constants --------- -When the value of a constant is important, mark it as ``Final`` and assign it -to its value. +When the value of a constant is important, mark it as a :term:`bare Final` and +assign it to its value. Yes:: diff --git a/docs/spec/dataclasses.rst b/docs/spec/dataclasses.rst index ef08344b4..3d9648923 100644 --- a/docs/spec/dataclasses.rst +++ b/docs/spec/dataclasses.rst @@ -526,8 +526,9 @@ This includes, but is not limited to, the following semantics: * ClassVar attributes are not considered dataclass fields and are `ignored by dataclass mechanisms `_. -* A dataclass field may be annotated with ``Final[...]``. For example, ``x: - Final[int]`` in a dataclass body specifies a dataclass field ``x``, which +* A dataclass field may be annotated with an :term:`explicitly typed Final` + :term:`type qualifier`. For example, ``x: Final[int]`` + in a dataclass body specifies a dataclass field ``x``, which will be initialized in the generated ``__init__`` and cannot be assigned to thereafter. A ``Final`` dataclass field initialized in the class body is not a class attribute unless explicitly annotated with ``ClassVar``. For example, diff --git a/docs/spec/distributing.rst b/docs/spec/distributing.rst index 13cfff81a..93edf5666 100644 --- a/docs/spec/distributing.rst +++ b/docs/spec/distributing.rst @@ -105,8 +105,8 @@ assignments:: x = 0 # type: int x = ... # type: int -The :ref:`Literal shortcut using Final ` should be -supported:: +The :ref:`Literal shortcut using a bare Final ` +should be supported:: x: Final = 0 # type is Literal[0] diff --git a/docs/spec/glossary.rst b/docs/spec/glossary.rst index 340dcbd4a..3c8a32cfd 100644 --- a/docs/spec/glossary.rst +++ b/docs/spec/glossary.rst @@ -27,6 +27,10 @@ This section defines a few terms that may be used elsewhere in the specification ``B``, respectively, such that ``B'`` is a subtype of ``A'``. See :ref:`type-system-concepts`. + bare ``Final`` + A :ref:`Final ` :term:`type qualifier` without an + explicit type, e.g. ``x: Final``. + closed A :ref:`TypedDict ` type is closed if it may not contain any additional :term:`items ` beyond those specified in the TypedDict definition. @@ -59,6 +63,10 @@ This section defines a few terms that may be used elsewhere in the specification also materializations of ``B``, and all materializations of ``B`` are also materializations of ``A``. + explicitly typed ``Final`` + A :ref:`Final ` :term:`type qualifier` with an explicit + type, e.g. ``x: Final[int]``. + extra items A :ref:`TypedDict ` type with extra items may contain arbitrary additional key-value pairs beyond those specified in the TypedDict definition, but those diff --git a/docs/spec/literal.rst b/docs/spec/literal.rst index 0eb93c27a..7254632b2 100644 --- a/docs/spec/literal.rst +++ b/docs/spec/literal.rst @@ -504,8 +504,8 @@ involving Literal bools. For example, we can combine ``Literal[True]``, Interactions with Final """"""""""""""""""""""" -The ``Final`` qualifier can be used to declare that some variable or -attribute cannot be reassigned:: +A :term:`bare Final` type qualifier can be used to declare that some variable +or attribute cannot be reassigned:: foo: Final = 3 foo = 4 # Error: 'foo' is declared to be Final @@ -518,8 +518,8 @@ is valid to use in any context that expects a ``Literal[3]``:: expects_three(foo) # Type checks, since 'foo' is Final and equal to 3 -The ``Final`` qualifier serves as a shorthand for declaring that a variable -is *effectively Literal*. +A :term:`bare Final` type qualifier serves as a shorthand for declaring that a +variable is *effectively Literal*. Type checkers are expected to support this shortcut. Specifically, given a variable or attribute assignment @@ -530,7 +530,7 @@ any context that expects a ``Literal[value]``. Type checkers are not obligated to understand any other uses of Final. For example, whether or not the following program type checks is left unspecified:: - # Note: The assignment does not exactly match the form 'var: Final = value'. + # Note: Literal inference is unspecified for explicitly typed Final. bar1: Final[int] = 3 expects_three(bar1) # May or may not be accepted by type checkers diff --git a/docs/spec/qualifiers.rst b/docs/spec/qualifiers.rst index 6814692e0..b05202125 100644 --- a/docs/spec/qualifiers.rst +++ b/docs/spec/qualifiers.rst @@ -81,30 +81,27 @@ variable or attribute should not be reassigned, redefined, or overridden. Syntax ^^^^^^ -``Final`` may be used in one of several forms: +``Final`` may be used in one of two forms: -* With an explicit type, using the syntax ``Final[]``. Example:: +* As an :term:`explicitly typed Final`, using the syntax ``Final[]``. + Example:: ID: Final[float] = 1 -* With no type annotation. Example:: + In class bodies and stub files the right hand side can be omitted:: + + ID: Final[float] + +* As a :term:`bare Final`, without a type argument. Example:: ID: Final = 1 + Bare ``Final`` annotations must have an assigned value. + The typechecker should apply its usual type inference mechanisms to determine the type of ``ID`` (here, likely, ``int``). Note that unlike for generic classes this is *not* the same as ``Final[Any]``. -* In class bodies and stub files you can omit the right hand side and just write - ``ID: Final[float]``. If the right hand side is omitted, there must - be an explicit type argument to ``Final``. - -* Finally, as ``self.id: Final = 1`` (also optionally with a type in - square brackets). This is allowed *only* in ``__init__`` methods, so - that the final instance attribute is assigned only once when an - instance is created. - - Semantics and examples ^^^^^^^^^^^^^^^^^^^^^^ @@ -156,8 +153,8 @@ be initialized in the ``__init__`` method (except in stub files):: self.x = 1 # Good The generated ``__init__`` method of :doc:`dataclasses` qualifies for this -requirement: a bare ``x: Final[int]`` is permitted in a dataclass body, because -the generated ``__init__`` will initialize ``x``. +requirement: an ``x: Final[int]`` without an initializer is permitted in a +dataclass body, because the generated ``__init__`` will initialize ``x``. Type checkers should infer a final attribute that is initialized in a class body as being a class variable, except in the case of :doc:`dataclasses`, where @@ -167,6 +164,15 @@ necessary to create a final class variable with value ``3``. In non-dataclasses, combining ``ClassVar`` and ``Final`` is redundant, and type checkers may choose to warn or error on the redundancy. +``Final`` attributes can also be declared in ``__init__`` methods, as +annotations on an assignment to an attribute on ``self``. This is allowed +*only* in ``__init__``, not in any other method:: + + class ImmutableAttributes: + def __init__(self) -> None: + self.x: Final = 3 + self.y: Final[str] = "knight" + ``Final`` may only be used in assignments or variable annotations. Using it in any other position is an error. In particular, ``Final`` can't be used in annotations for function arguments:: @@ -193,9 +199,9 @@ with ``Final`` to prevent mutating such values:: z: Final = ('a', 'b') # Also works -Type checkers should treat uses of a final name that was initialized -with a literal as if it was replaced by the literal. For example, the -following should be allowed:: +Type checkers should treat uses of names declared with a :term:`bare Final` +that was initialized with a literal as if it was replaced by the literal. For +example, the following should be allowed:: from typing import NamedTuple, Final diff --git a/docs/spec/typeddict.rst b/docs/spec/typeddict.rst index 726647ef8..bbbc1fd03 100644 --- a/docs/spec/typeddict.rst +++ b/docs/spec/typeddict.rst @@ -733,8 +733,8 @@ certain items. For example, ``d['x'] = 1`` should generate a type check error if ``'x'`` is not a valid key for ``d`` (which is assumed to be a TypedDict type), unless ``d`` has mutable :term:`extra items` of a compatible type. -Type checkers should allow :ref:`final names ` with -string values to be used instead of string literals in operations on +Type checkers should allow names declared with a :term:`bare Final` and a +string value to be used instead of string literals in operations on TypedDict objects. For example, this is valid:: YEAR: Final = 'year' From 4abf23e2492405ecd2d6831405020ef999b25671 Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Sat, 31 Oct 2026 12:19:57 +0000 Subject: [PATCH 304/308] Upgrade Zuban (#2380) Upgrade zuban --- conformance/results/results.html | 13 +++------- .../results/zuban/dataclasses_match_args.toml | 8 +----- conformance/results/zuban/version.toml | 2 +- conformance/uv.lock | 26 +++++++++---------- 4 files changed, 19 insertions(+), 30 deletions(-) diff --git a/conformance/results/results.html b/conformance/results/results.html index 2c8b034f9..94a105325 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -269,7 +269,7 @@

    Python Type System Conformance Test Results

    pyrefly 1.4.0 pyright 1.1.414 ty 0.0.93zuban 0.10.1zuban 0.10.2
    Pass Pass Pass - Partial -
      -
    • Incorrect type for match_args
    • -
    -
    Pass
    dataclasses_order 15.5 / 16 • 96.9% 16 / 16 • 100.0% 15.5 / 16 • 96.9%15.5 / 16 • 96.9%16 / 16 • 100.0%
    142 / 146 • 97.3% 140.5 / 146 • 96.2% 141 / 146 • 96.6%145.5 / 146 • 99.7%146 / 146 • 100.0%
    diff --git a/conformance/results/zuban/dataclasses_match_args.toml b/conformance/results/zuban/dataclasses_match_args.toml index c3f9700bc..9b83abf57 100644 --- a/conformance/results/zuban/dataclasses_match_args.toml +++ b/conformance/results/zuban/dataclasses_match_args.toml @@ -1,12 +1,6 @@ -conformant = "Partial" -notes = """ -Incorrect type for __match_args__ -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 49: Unexpected errors ['dataclasses_match_args.py:49: error: Expression is of type "tuple[Literal[\\'x\\']]", not "tuple[()]" [misc]'] """ output = """ dataclasses_match_args.py:42: error: "type[DC4]" has no attribute "__match_args__" [attr-defined] -dataclasses_match_args.py:49: error: Expression is of type "tuple[Literal['x']]", not "tuple[()]" [misc] """ diff --git a/conformance/results/zuban/version.toml b/conformance/results/zuban/version.toml index 4e0e68bd7..66bb20900 100644 --- a/conformance/results/zuban/version.toml +++ b/conformance/results/zuban/version.toml @@ -1 +1 @@ -version = "zuban 0.10.1" +version = "zuban 0.10.2" diff --git a/conformance/uv.lock b/conformance/uv.lock index c2a66a708..e82462d9a 100644 --- a/conformance/uv.lock +++ b/conformance/uv.lock @@ -312,19 +312,19 @@ wheels = [ [[package]] name = "zuban" -version = "0.10.1" +version = "0.10.2" source = { registry = "https://pypi.org/simple" } wheels = [ - { url = "https://files.pythonhosted.org/packages/42/85/bf2e4f075b5cd530d2ec50f7c3e5aecc4dfd30caf978c0c0bf9bac727f9f/zuban-0.10.1-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:7751221eb5bb47fe9d4d28857bd4067a76d2642fb43b820807a00e58311a350f", size = 11360723, upload-time = "2026-10-11T23:25:57.92Z" }, - { url = "https://files.pythonhosted.org/packages/d8/71/df27ba420cbd978be4019e9d388dbd278f66fb069b9f74601d02f32d79ed/zuban-0.10.1-py3-none-macosx_11_0_arm64.whl", hash = "sha256:94e87739f8c27d46da9f9db16f77eb65a71b4ab98b45dc4b549d0e4fd54fd060", size = 11126236, upload-time = "2026-10-11T23:26:00.689Z" }, - { url = "https://files.pythonhosted.org/packages/07/1f/300f418d89c5fd1e9a3c9eb393c2a7bce7c66a588b47545325716f95fca1/zuban-0.10.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e8007869c5010f2c4f3cdfff39cf18e75072f3bf064193adf78ec55589b7a27e", size = 28478792, upload-time = "2026-10-11T23:26:04.2Z" }, - { url = "https://files.pythonhosted.org/packages/ff/d1/93b6bdec8a74c0ff219cf356f7dbc4d0736d7d7c7681036fe85f264cdcfe/zuban-0.10.1-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:b0c4b44c07c8dcb2d600e18df846c715d5d988b9271487bf0efed4d5bf1e495f", size = 28781450, upload-time = "2026-10-11T23:26:07.963Z" }, - { url = "https://files.pythonhosted.org/packages/54/2a/132c2fd45997dc45da9b5e3e98767c2ee69bcff212dcd3f5d3fccfa4f40c/zuban-0.10.1-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2901a3cda7df0481c2b1e98135e1f9636ee257b15a3a4c0ffd4fa969fef0e22a", size = 29907271, upload-time = "2026-10-11T23:26:11.27Z" }, - { url = "https://files.pythonhosted.org/packages/09/c4/0225ef5475beee1209aca527f983422801fda7b27ecc8b5b48a8229c2f16/zuban-0.10.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8088b7be916d76f3a89a5b34e97cf26a30c2620c467a2b5a47a6c4cca47cd5b9", size = 31736506, upload-time = "2026-10-11T23:26:15.129Z" }, - { url = "https://files.pythonhosted.org/packages/46/23/f141b7a8e5103841932e5dcba6b69db7e27c5b183d67c7dbd43ac9c3b294/zuban-0.10.1-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:8f606e44f68bc7715e534059558cedd2096ec7049930decf1cfc428904d823c3", size = 28641122, upload-time = "2026-10-11T23:26:18.68Z" }, - { url = "https://files.pythonhosted.org/packages/14/0b/ed5971e3ddf457ac2c1e325dffc318a73cddf24b411c7c893a7809ca424d/zuban-0.10.1-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:7523983d56415c15423a8fe3e52c7f63a104430bef3938967db8e1464f6a510a", size = 29221427, upload-time = "2026-10-11T23:26:22.22Z" }, - { url = "https://files.pythonhosted.org/packages/d3/ba/a730cb6c712f46f007e67757b447c6998fe4d12ab92bab3b3bd124956278/zuban-0.10.1-py3-none-musllinux_1_2_i686.whl", hash = "sha256:2a91faef86ab1c86fe9a8aa77f26b5b0295a7c90c73090f50ec79d61ba24a712", size = 29801084, upload-time = "2026-10-11T23:26:25.876Z" }, - { url = "https://files.pythonhosted.org/packages/73/89/b0421c9e5185373451bead13303ce5bdc2536d8fb6f31d4cf0e273a662f1/zuban-0.10.1-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:e69b8860b992d3bcb9d75641dad9c817954d350b454989e6da11e0505e937ad4", size = 29020690, upload-time = "2026-10-11T23:26:29.07Z" }, - { url = "https://files.pythonhosted.org/packages/8d/e3/51624d02f45002e8a7fa67c15d6749657eebb3db8f4e47c82f1846d2ca93/zuban-0.10.1-py3-none-win32.whl", hash = "sha256:ff26d08e5bb5448d051fa5eb5dc6e5993a03af527571966b1499eaa62928a6c0", size = 10020499, upload-time = "2026-10-11T23:26:31.917Z" }, - { url = "https://files.pythonhosted.org/packages/ee/dc/493a9d21fda9924d9a0841402e2778114bde7788440f4f6954656ac6c80b/zuban-0.10.1-py3-none-win_amd64.whl", hash = "sha256:e74ce348967d83360c9212a1082358bb3bc5b65ced55d17017715a90abb18f28", size = 10734301, upload-time = "2026-10-11T23:26:34.439Z" }, + { url = "https://files.pythonhosted.org/packages/04/eb/5b15139d92e667ed98d41d07c62f815709b85d960e3e5a41dce90f080f78/zuban-0.10.2-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:bf32f741a7b579a7b3500803729144493c0016364bc852feaa8db44f9fe13f7d", size = 11617429, upload-time = "2026-10-29T15:44:54.423Z" }, + { url = "https://files.pythonhosted.org/packages/ab/a1/1fd1f5e94be99d3d2a7cb6bfd8dd8a0872905f3980dffb6cb6ce00872840/zuban-0.10.2-py3-none-macosx_11_0_arm64.whl", hash = "sha256:ae00078be67ca93bca9b25bb39f4abebe3cf1a1cda8aa3c7b142d25bed75bc38", size = 11409605, upload-time = "2026-10-29T15:44:57.195Z" }, + { url = "https://files.pythonhosted.org/packages/c3/8c/dd342810155db2aac880e077b9fbba56e07ce759ab723ea1e11f4edb695c/zuban-0.10.2-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:a9be001e140d9b86bb6f09298e4ad21a01073a1d47e5171f9cc7de65d1d54c73", size = 28803766, upload-time = "2026-10-29T15:44:59.84Z" }, + { url = "https://files.pythonhosted.org/packages/36/18/17d95ed7d800230970bdc90872f36e9f3a1a5ec7296fa7ba4bf7b2fdcca4/zuban-0.10.2-py3-none-manylinux2014_armv7l.manylinux_2_17_armv7l.whl", hash = "sha256:097b5abb799207cbfeea233accbd8bf440742bfe482a064e47b17ce698a66799", size = 28997359, upload-time = "2026-10-29T15:45:02.91Z" }, + { url = "https://files.pythonhosted.org/packages/92/bf/d3b1dae8163eb9d86ed6797c39ce5b50f377defcd9a917ba9d97a330936a/zuban-0.10.2-py3-none-manylinux2014_i686.manylinux_2_17_i686.whl", hash = "sha256:1d247a12d60dae489372074c7a5695b5d7b32b2e324e6445f54aebda2512a11c", size = 30199005, upload-time = "2026-10-29T15:45:05.877Z" }, + { url = "https://files.pythonhosted.org/packages/2c/a9/8a4542e31be2c09292f431015055015f0c918d0f0232264672d545f115d5/zuban-0.10.2-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:c8b4a34e46ac3ee89cea9783c2a1f4fa6fa271bb59e99e7146d8233566ff8a29", size = 32199078, upload-time = "2026-10-29T15:45:08.892Z" }, + { url = "https://files.pythonhosted.org/packages/e4/55/a68158322cf3cf7ae6d2b56e41683a6104f325c50ed1fcf4dccc0395c2cc/zuban-0.10.2-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:2a023e4583020bf8e7109aaca391055b75f96b3d98ca6e714ccad55e58340e4a", size = 28992978, upload-time = "2026-10-29T15:45:12.16Z" }, + { url = "https://files.pythonhosted.org/packages/3a/71/798d0f33d3821f4bf1cfd73a4b9c71742b1c3b811c02a966703a6a95c89d/zuban-0.10.2-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:0b1d159d75f5d525ef25f305e5dc29eb8ba1596195e04bf8b66b8b031b01e8da", size = 29443939, upload-time = "2026-10-29T15:45:15.393Z" }, + { url = "https://files.pythonhosted.org/packages/84/44/ce29964021ba394600e0713918883501da4db90d2d80af9429040c0b59d6/zuban-0.10.2-py3-none-musllinux_1_2_i686.whl", hash = "sha256:dbab08b9ab53468f9ac28774b89dfaae695c4f9326b680771fe152b778987d89", size = 30101210, upload-time = "2026-10-29T15:45:18.33Z" }, + { url = "https://files.pythonhosted.org/packages/b9/32/b4a93835cb83bd99faba0362e2a560595fc365179529c2190094bb184c81/zuban-0.10.2-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:b2a2fcdeeab56f091a376e65a7b26c044b6be44e1360214de65db7908248ddb9", size = 29419261, upload-time = "2026-10-29T15:45:21.176Z" }, + { url = "https://files.pythonhosted.org/packages/08/a3/50554f3857c449921b635575745fe590055df6e8fe7e6482488df6673c0c/zuban-0.10.2-py3-none-win32.whl", hash = "sha256:97779d50273efdf75ed6edefbfd71a9bb6045467ac21a6e83a15933e4a8ec7bc", size = 10275468, upload-time = "2026-10-29T15:45:23.919Z" }, + { url = "https://files.pythonhosted.org/packages/a3/c2/dc2fff9bb2adcff092d9314096c5e0d7215f6358dccc4bcdf1c18b11c39d/zuban-0.10.2-py3-none-win_amd64.whl", hash = "sha256:48483b9ec019da045b7f826c496f2ab1639c3f036fcab6e9e74b42d4e2fa3d34", size = 11017736, upload-time = "2026-10-29T15:45:27.151Z" }, ] From b73d5ef78cfacfc01e62b495e8da72770a8a9fde Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Mon, 2 Nov 2026 13:24:40 +0100 Subject: [PATCH 305/308] Don't require comment for `Any` in `Callable[..., Any]` (#2383) --- docs/guides/writing_stubs.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/guides/writing_stubs.rst b/docs/guides/writing_stubs.rst index af0b402cd..f8e7e5852 100644 --- a/docs/guides/writing_stubs.rst +++ b/docs/guides/writing_stubs.rst @@ -805,6 +805,7 @@ reasons can include: * Using :ref:`Any` as a type argument for a generic with invariant type variables to say "any object of this type is allowed", e.g. ``Future[Any]``. +* Using the expression ``Callable[..., Any]`` to say "any callable". * Using ``dict[str, Any]`` or ``Mapping[str, Any]`` when the value types depend on the keys. But consider using :ref:`TypedDict` or ``dict[str, Incomplete]`` (temporarily) when the keys of the dictionary are From 784a34878b545e00e601a12b20233000975ea60b Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Mon, 2 Nov 2026 14:18:25 +0100 Subject: [PATCH 306/308] Update discussion resources (#2382) * Remove Gitter * Add Discord to the docs (it was already in the README) * Emphasize that typing-sig has been archived --- README.md | 6 ++---- docs/index.rst | 8 ++++++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 8bc02d48a..7380429d8 100644 --- a/README.md +++ b/README.md @@ -11,10 +11,8 @@ Improvements to the type system should be discussed on tracked in the [issues](https://github.com/python/typing/issues) in this repository. -For conversations that are more suitable to a chat platform, you can use one of the following: - -- [gitter](https://gitter.im/python/typing) -- [discord](https://discord.com/invite/python) [#type-hinting](https://discord.com/channels/267624335836053506/891788761371906108) channel +For conversations that are more suitable to a chat platform, you can use the +[#type-hinting](https://discord.com/channels/267624335836053506/891788761371906108) channel of the [Python Discord server](https://discord.com/invite/python). ## Repository Content diff --git a/docs/index.rst b/docs/index.rst index 93f773ac5..308274384 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -79,9 +79,13 @@ Discussions and Support ======================= * `User help forum `_ -* `User chat on Gitter `_ * `Developer forum `_ -* `Developer mailing list (archived) `_ +* The `#type-hinting channel `_ + on the `Python Discord server `_ + +The former developer mailing list has been archived: + +* `Archive of typing-sig `_ Typing-related Tools ==================== From 1f8d6f86a090b0dbcbea6452cba512fa13d527c9 Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Tue, 3 Nov 2026 20:20:31 +0100 Subject: [PATCH 307/308] New conformance tag '# E[tag!]' to require at least one success (#2354) --- conformance/README.md | 2 + conformance/src/main.py | 81 ++++++++++++++++++++++++++++++----------- 2 files changed, 61 insertions(+), 22 deletions(-) diff --git a/conformance/README.md b/conformance/README.md index 0b60a9490..7f28150dd 100644 --- a/conformance/README.md +++ b/conformance/README.md @@ -63,6 +63,8 @@ Test cases support the following special comments for declaring where errors sho * `# E[tag]`, where `tag` is an arbitrary string: must appear multiple times in a file with the same tag. Exactly one line with this tag must raise an error. * `# E[tag+]`: like `# E[tag]`, but errors may be raised on multiple lines. +* `# E[tag!]`: like `# E[tag]`, but zero or more lines with this tag may raise + an error while at least line must not raise an error. Each comment may be followed by a colon plus an explanation of the error; the explanation is ignored by the scoring system. diff --git a/conformance/src/main.py b/conformance/src/main.py index 63f82ea72..0073dcb07 100644 --- a/conformance/src/main.py +++ b/conformance/src/main.py @@ -6,9 +6,10 @@ import re import sys import tomllib +from collections.abc import Container, Sequence +from enum import Enum from pathlib import Path from time import time -from typing import Sequence import tomlkit @@ -63,17 +64,24 @@ def run_tests( update_type_checker_info(type_checker, root_dir) +class ErrorMultiplicity(Enum): + """How many lines with the same tag can have an error.""" + + SINGLE = 1 # exactly one line must have an error + MULTI = 2 # at least one line must have an error + REQUIRE_SUCCESS = 3 # at least one line must not have an error + + def get_expected_errors(test_case: Path) -> tuple[ dict[int, tuple[int, int]], - dict[str, tuple[list[int], bool]], + dict[str, tuple[list[int], ErrorMultiplicity]], ]: """Return the line numbers where type checkers are expected to produce an error. The return value is a tuple of two dictionaries: - The format of the first is {line number: (number of required errors, number of optional errors)}. - - The format of the second is {error tag: ([lines where the error may appear], allow multiple}. - If allow multiple is True, the error may appear on multiple lines; otherwise, it must - appear exactly once. + - The format of the second is {error tag: ([lines where the error may appear], error multiplicity)}. + See the ErrorMultiplicy enum for the second argument. For example, the following test case: @@ -92,7 +100,7 @@ def f(): pass # E[final] with open(test_case, "r", encoding="utf-8") as f: lines = f.readlines() output: dict[int, tuple[int, int]] = {} - groups: dict[str, tuple[list[int], bool]] = {} + groups: dict[str, tuple[list[int], ErrorMultiplicity]] = {} for i, line in enumerate(lines, start=1): line_without_comment, *_ = line.split("#") # Ignore lines with no non-comment content. This allows commenting out test cases. @@ -110,15 +118,18 @@ def f(): pass # E[final] for match in re.finditer(r"# E\[([^\]]+)\]", line): tag = match.group(1) if tag.endswith("+"): - allow_multiple = True + multiplicity = ErrorMultiplicity.MULTI + tag = tag[:-1] + elif tag.endswith("!"): + multiplicity = ErrorMultiplicity.REQUIRE_SUCCESS tag = tag[:-1] else: - allow_multiple = False + multiplicity = ErrorMultiplicity.SINGLE if tag not in groups: - groups[tag] = ([i], allow_multiple) + groups[tag] = ([i], multiplicity) else: - if groups[tag][1] != allow_multiple: - raise ValueError(f"Error group {tag} has inconsistent allow_multiple value in {test_case}") + if groups[tag][1] != multiplicity: + raise ValueError(f"Error group {tag} has inconsistent multiplicity value in {test_case}") groups[tag][0].append(i) for group, linenos in groups.items(): if len(linenos) == 1: @@ -151,21 +162,47 @@ def diff_expected_errors( differences.append(f"Line {expected_lineno}: Expected {expected_count} errors") # We don't report an issue if the count differs, because type checkers may produce # multiple error messages for a single line. - linenos_used_by_groups: set[int] = set() - for group, (linenos, allow_multiple) in error_groups.items(): - num_errors = sum(1 for lineno in linenos if lineno in errors) - if num_errors == 0: - differences.append(f"Lines {', '.join(map(str, linenos))}: Expected error (tag {group!r})") - elif num_errors == 1 or allow_multiple: - linenos_used_by_groups.update(linenos) - else: - differences.append(f"Lines {', '.join(map(str, linenos))}: Expected exactly one error (tag {group!r})") + + for group, (linenos, multiplicity) in error_groups.items(): + error = determine_group_error(group, linenos, multiplicity, errors) + if error is not None: + differences.append(error) + + linenos_used_by_groups = {ln for linenos, _ in error_groups.values() for ln in linenos} for actual_lineno, actual_errors in errors.items(): - if actual_lineno not in expected_errors and actual_lineno not in linenos_used_by_groups: - differences.append(f"Line {actual_lineno}: Unexpected errors {actual_errors}") + if ( + actual_lineno not in expected_errors + and actual_lineno not in linenos_used_by_groups + ): + differences.append( + f"Line {actual_lineno}: Unexpected errors {actual_errors}" + ) return "".join(f"{diff}\n" for diff in differences) +def determine_group_error( + group: str, + group_linenos: Sequence[int], + multiplicity: ErrorMultiplicity, + error_linenos: Container[int], +) -> str | None: + """Return the error message for the given group or None.""" + num_errors = sum(1 for lineno in group_linenos if lineno in error_linenos) + match multiplicity: + case ErrorMultiplicity.SINGLE: + if num_errors == 0: + return f"Lines {', '.join(map(str, group_linenos))}: Expected error (tag {group!r})" + elif num_errors > 1: + return f"Lines {', '.join(map(str, group_linenos))}: Expected exactly one error (tag {group!r})" + case ErrorMultiplicity.MULTI: + if num_errors == 0: + return f"Lines {', '.join(map(str, group_linenos))}: Expected error (tag {group!r})" + case ErrorMultiplicity.REQUIRE_SUCCESS: + if num_errors == len(group_linenos): + return f"Lines {', '.join(map(str, group_linenos))}: Expected at least one success (tag {group!r})" + return None + + def update_output_for_test( type_checker: TypeChecker, results_dir: Path, From 871c2f0f6cc552373c9b4f3376970391b165b756 Mon Sep 17 00:00:00 2001 From: Raphael Fakhri Date: Thu, 5 Nov 2026 16:19:00 +0200 Subject: [PATCH 308/308] [conformance] Fix check for error groups that appear on a single line (#2386) --- conformance/src/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conformance/src/main.py b/conformance/src/main.py index 0073dcb07..54c47cb77 100644 --- a/conformance/src/main.py +++ b/conformance/src/main.py @@ -94,7 +94,7 @@ def f(): pass # E[final] ( {1: (1, 0), 2: (0, 1)}, - {"final": ([3, 4], False)} + {"final": ([3, 4], ErrorMultiplicity.SINGLE)} ) """ with open(test_case, "r", encoding="utf-8") as f: @@ -131,7 +131,7 @@ def f(): pass # E[final] if groups[tag][1] != multiplicity: raise ValueError(f"Error group {tag} has inconsistent multiplicity value in {test_case}") groups[tag][0].append(i) - for group, linenos in groups.items(): + for group, (linenos, _) in groups.items(): if len(linenos) == 1: raise ValueError(f"Error group {group} only appears on a single line in {test_case}") return output, groups